Asp.net

Get Currency Symbol From CultureInfo Class In asp.net 4.0

Function Return the Currency Symbol Currency = ISO3 Currency Code Ex: Currency =”INR” public static string CurrencySymbol(string Currency) { Hashtable currencySymbols = null; string currencysymbol = “”; if (Currency == null) return “”; if (Currency == “”) return “”; if (currencySymbols == null) { currencySymbols = new Hashtable(); foreach (CultureInfo ci in CultureInfo.GetCultures(CultureTypes.SpecificCultures)) { RegionInfoContinue Reading “Get Currency Symbol From CultureInfo Class In asp.net 4.0”

J query

Disable Button After Click with jquery

1. Add Below J query In page $(document).on(“click”, “#<%= btnaddtocart.ClientID %>”, function (e) { if (typeof Page_IsValid != “undefined” && Page_IsValid == true) { document.getElementById(‘<%= btnaddtocart.ClientID %>’).value = “Wait…”; document.getElementById(‘<%= btnaddtocart.ClientID %>’).className = “”; var button = this; $(button).css(‘width’, ’76px’); setTimeout(function () { $(button).attr(‘disabled’, ‘disabled’); }, 1); } else if (typeof Page_IsValid == “undefined”) { document.getElementById(‘<%= btnaddtocart.ClientID %>’).valueContinue Reading “Disable Button After Click with jquery”

Sql server

Db Cleaner

/* Drop all non-system stored procs */DECLARE @name VARCHAR(128)DECLARE @SQL VARCHAR(254) SELECT @name = (SELECT TOP 1 [name] FROM sysobjects WHERE [type] = ‘P’ AND category = 0 ORDER BY [name]) WHILE @name is not nullBEGIN    SELECT @SQL = ‘DROP PROCEDURE [dbo].[‘ + RTRIM(@name) +’]’    EXEC (@SQL)    PRINT ‘Dropped Procedure: ‘ + @name    SELECT @nameContinue Reading “Db Cleaner”

Asp.net

Currency Converter

1. Add Currency Dropdownlist in Master Page with Currency Code and  On Page Load Of Master Page: if (!IsPostBack) { if (Session[“currency”] == null) { Session[“currency”] = “INR”; } else { drpdwncurrency.SelectedValue = Session[“currency”].ToString(); } } On dropdownlist change event : Session[“currency”] = drpdwncurrency.SelectedValue; drpdwncurrency.SelectedValue = Session[“currency”].ToString(); Response.Redirect(Request.Url.ToString()); use a session as selected currency 2.AddContinue Reading “Currency Converter”

C#

Grouping and sum with Datatable Using IEnumerable

Use for Groupping and sum with datatble Pass Datatable as dttemp var query = from r in dttemp.AsEnumerable() group r by new { StyleDetail_COLOR_NAME = r.Field<string>(“StyleDetail_COLOR_NAME”), StyleDetail_QLY_NAME = r.Field<string>(“StyleDetail_QLY_NAME”), StyleDetail_SHAPENAME = r.Field<string>(“StyleDetail_SHAPENAME”), StyleDetail_SHAPENO = r.Field<int>(“StyleDetail_SHAPENO”), StyleDetail_QLY_ID = r.Field<int>(“StyleDetail_QLY_ID”), StyleDetail_COLOR_ID = r.Field<int>(“StyleDetail_COLOR_ID”) } into groupedTable select new { StyleDetail_SHAPENO = groupedTable.Key.StyleDetail_SHAPENO, StyleDetail_QLY_ID = groupedTable.Key.StyleDetail_QLY_ID, StyleDetail_COLOR_ID =Continue Reading “Grouping and sum with Datatable Using IEnumerable”