This file contains hidden or 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
window.location.host : you'll get sub.domain.com:8080 or sub.domain.com:80 | |
window.location.hostname : you'll get sub.domain.com | |
window.location.protocol : you'll get http: | |
window.location.port : you'll get 8080 or 80 | |
window.location.pathname : you'll get /virtualPath | |
window.location.origin : you'll get http://sub.domain.com ***** | |
http://stackoverflow.com/questions/1368264/how-to-extract-the-hostname-portion-of-a-url-in-javascript |
This file contains hidden or 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
if (response.actionType == "RemoveCartItem") { | |
var price = $("#price_" + String(response.productId)).html(); | |
price = price.split("$"); | |
var pr = parseFloat(price[1]); | |
var totalPrice = $(".totalprice").html(); | |
totalPrice =totalPrice.split("$"); | |
var tPrice = parseFloat(totalPrice[1]); |
This file contains hidden or 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
https://console.developers.google.com/apis/credentials?project=oneread-d3dc8 | |
To => Creditials =>create credintials => | |
Name =estore.one-read.com | |
Restrictions => 1st box =>http://estore.one-read.com | |
2nd box=>http://www.estore.one-read.com | |
************************************************* |
This file contains hidden or 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
/// create log [If file name not exist then create and write file name else write on existing file] /// | |
private void LogFile(string txt) | |
{ | |
StringBuilder sb =new StringBuilder(); | |
sb.Append(txt); | |
System.IO.File.AppendAllText(filePath() + "log.txt", sb.ToString()); | |
} | |
/// create path on root /// |
This file contains hidden or 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 cusId = from x in record | |
group x.CustomerId by x.CustomerId into g | |
let count = g.Count() | |
select new { Value = g.Key, Count = count }; |
This file contains hidden or 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
Controller | |
using DotNet.Highcharts.Options; | |
using Nop.Core.Domain.Customers; | |
using Nop.Plugin.OneRead.AnalyticsAndReports.Domain; | |
using Nop.Plugin.OneRead.AnalyticsAndReports.Models; | |
using Nop.Plugin.OneRead.AnalyticsAndReports.Services; | |
using Nop.Services.Common; | |
using Nop.Services.Customers; | |
using Nop.Web.Framework.Controllers; |
This file contains hidden or 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
// It return the just previous url. | |
returnUrl = HttpContext.Request.UrlReferrer.ToString(); |
This file contains hidden or 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 partial class Customer_CustomerRole_Mapping | |
{ | |
[Key, DatabaseGenerated(DatabaseGeneratedOption.None)] | |
public int Customer_Id { get; set; } | |
public int CustomerRole_Id { get; set; } | |
} |
This file contains hidden or 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 = query.Where(c => c.CustomerRoles.Select(cr => cr.SystemName).Contains(customerRole)); |
This file contains hidden or 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://stackoverflow.com/questions/3815741/what-does-operator-means-in-c | |
x ?? y is roughly equivalent to this (except that the first argument is only evaluated once): | |
if (x == null) | |
{ | |
result = y; | |
} | |
else | |
{ |