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 GetDisplayName(Enum enumValue) | |
{ | |
return enumValue.GetType().GetMember(enumValue.ToString()) | |
.First() | |
.GetCustomAttribute<DisplayAttribute>() | |
.Name; | |
} |
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
static public void Send(string emails, string subject, string message, bool isHTML=true, params string[] attachmentPaths) | |
{ | |
try | |
{ | |
using (var client = new SmtpClient()) | |
{ | |
var section = ConfigurationManager.GetSection("system.net/mailSettings/smtp") as SmtpSection; | |
// email message setting | |
MailMessage msg = new MailMessage(); |
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
using iTextSharp.text.pdf; | |
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace ProtectPDF | |
{ |
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
Html File Code | |
=============================== | |
<!doctype html> | |
<html> | |
<head><title> Translate </title> | |
<script type="text/javascript" src="watch.js"> | |
</script> | |
</head> |
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 elemList = doc.GetElementsByTagName("spine")[0].ChildNodes; //solved by this | |
---------------------------------------------------------------- | |
http://stackoverflow.com/questions/18017692/c-sharp-get-values-from-xml-attributes | |
<?xml version="1.0" encoding="utf-8" ?> | |
<Config version="1.0.1.1" > | |
<Items> | |
<Item action="Create" filename="newtest.xml"/> | |
<Item action="Update" filename="oldtest.xml"/> | |
</Items> |
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
protected virtual string GetEpubPath() | |
{ | |
return Path.Combine(_webHelper.MapPath("~/content/epubs/")); | |
} | |
public string CreateSampleEpub() | |
{ | |
string[] files = Directory.GetFiles(GetEpubPath());//GetAllFiles |
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
analyticsandreport: function (urladd,productId,categoryId,typeId) { | |
$.ajax({ | |
cache: false, | |
url: '/AnalyticsAndReports/InsertAnalytic', | |
data: { productId: productId, typeId: typeId, categoryId: categoryId }, | |
type: 'post', | |
success: function (data) { | |
// window.location.href = urladd | |
}, | |
}); |
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
http://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/members/setoptions/ | |
http://api.highcharts.com/highcharts/yAxis | |
*********************** | |
<Script> | |
@model DotNet.Highcharts.Highcharts | |
@using Nop.Core.Infrastructure; | |
@{ | |
//Html.AppendScriptParts("~/Administration/Scripts/Highcharts-4.0.1/highcharts.js"); |
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
query = from p in query | |
from pc in p.ProductCategories.Where(pc => (pc.Category.Published)) | |
select p; | |
condition on property that is in list of list ex here [query] is list and in this list [ProductCategories] is list, And here check publish prperty that is in query=>ProductCategories=>category. |
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
Main view => | |
@Html.Partial("_CatalogSelectors", Model.PagingFilteringContext, new ViewDataDictionary { { "pageTotal", ViewBag.pageTotal },{"productTotal", ViewBag.TotalProduct},{"productName",Model.Name} }) | |
Get in partial view => | |
@{ | |
string pageTotal = Convert.ToString(ViewData["pageTotal"]); |
NewerOlder