This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
C# Code | |
============================================================================================================================= | |
Here we create an xml code and we parse or get data from xml file using SQL (Stored Procedure) | |
------------------------------------------------------------------------------------------------ | |
public string AddEntitlementMaster(EntitlementMaster EmModel) | |
{ | |
String strXmlString; | |
string empId = EmModel.vEmpId; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SQL Stored Procedures | |
---------------------------------------------------------------------- | |
Here some example of SQL Stored Procedure for Insert/Update/Delete. | |
---------------------------------------------------------------------- | |
USE [EHD] | |
GO | |
/****** Object: StoredProcedure [dbo].[EHD_ENTITLEMENT_MASTER_DETAILS] Script Date: 12/09/2017 09:49:55 ******/ | |
SET ANSI_NULLS ON | |
GO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public string SavePictureApiPath(string mimeType, int productId, byte[] pictureBinary) | |
{ | |
//string lastPart = GetFileExtensionFromMimeType(mimeType); | |
string lastPart = "jpg"; | |
string fileName = string.Format("{0}.{1}",productId, lastPart); | |
string path = Path.Combine(CommonHelper.MapPath("~/reader/new-epubs/coverpage/"), fileName); | |
byte[] resizePictureBinary; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ListbrandList = new List<String>() { | |
"Joshi", | |
"Vikas", | |
"Joshi", | |
"Vikas", | |
"Sharma", | |
"Anuj", | |
"Joshi", | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Use Old Technique - | |
------------------------ | |
SqlConnection sqlcon = new SqlConnection(SqlConString); | |
sqlcon.Open(); | |
SqlCommand cmd = new SqlCommand(); | |
cmd = new SqlCommand("UserRecentRequestList", sqlcon); | |
cmd.CommandType = CommandType.StoredProcedure; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
delete FROM dbo.GenrePreference WHERE id NOT IN (SELECT MIN(id) _ | |
FROM dbo.GenrePreference GROUP BY CategoryId) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string accountActivationUrl = string.Format("{0}/customer/activation?token={1}&email={2}", url, "AccountActivationToken", HttpUtility.UrlEncode(email)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string epubPath = "D://reader/epubs/test.html"; | |
string epubPath1 = "D://reader/epubs/test1.html"; | |
HtmlDocument doc = new HtmlDocument(); | |
doc.Load(epubPath); | |
HtmlNode rootbody_node = doc.DocumentNode.Descendants("body").ElementAt(0); | |
HtmlNodeCollection body_elements = rootbody_node.ChildNodes; | |
if (body_elements.Count != 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@model EmailAndNotificationModel | |
@using System.Globalization; | |
@{ | |
var defaultGridPageSize = EngineContext.Current.Resolve<Nop.Core.Domain.Common.AdminAreaSettings>().DefaultGridPageSize; | |
var gridPageSizes = EngineContext.Current.Resolve<Nop.Core.Domain.Common.AdminAreaSettings>().GridPageSizes; | |
//page title | |
ViewBag.Title = "Send email & notification"; | |
var GroupRolesIdsInput = new List<int>(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
json stringify vs parse | |
Defi : JSON.parse() is for "parsing" something that was received as JSON. JSON.stringify() is to create a JSON string out of an object/array. They are the inverse of each other. JSON.stringify() serializes a JS object into a JSON string, whereas JSON.parse() will deserialize a JSON string into a JS object.Jul 22, 2013 | |
https://stackoverflow.com/questions/17785592/difference-between-json-stringify-and-json-parse |
OlderNewer