Skip to main content

Posts

Showing posts from October, 2015

QueryString Encode & Decode

QueryString Encode & Decode Helper Class public class clsQueryString { static public string QueryStringEncode( string value) { return clsEncryptionDecryption .GetEncrypt(value); } static public string QueryStringDecode( string value) { return clsEncryptionDecryption .GetDecrypt(value); } public static string GetValueFromQueryString( string value, string key) { string strValue = string .Empty; if (value != null ) { string DataString = clsEncryptionDecryption .GetDecrypt(value); Hashtable objHash = clsQueryString .GetQueryString(DataString); strValue = clsCheckDBNull .ConvertToStr(objHash[key]); return strValue; } else return "" ; } publi

Encryption Decryption Helper

Encryption Decryption Helper public class clsEncryptionDecryption { #region Variable Declaration private static string keyString = " keyString "; #endregion #region Methods/Functions /// <summary> /// Get Encrpted Value of Passed value /// </summary> /// <param name="value"></param> /// <returns></returns> /// <remarks></remarks> public static string GetEncrypt( string value) { return Encrypt(keyString, value); } /// <summary> /// Get Decrypted value of passed encrypted string /// </summary> /// <param name="value"></param> /// <returns></returns> /// <remarks></remarks> public static string

Message Helper for MVC Application

Message Helper for MVC Application public static class MessageExtensions { public enum MessageType { Success = 0, Info = 1, Warning = 2, Error = 3 } public static void ShowMessage( this Controller controller, MessageType messageType, string message, bool showAfterRedirect = false ) { string messageTypeKey = messageType.ToString(); if (showAfterRedirect) { controller.TempData[messageTypeKey] = message; } else { controller.ViewData[messageTypeKey] = message; } } public static HtmlString RenderMessages( this HtmlHelper htmlHelper, bool clearMessage = true ) { string messages = String .Empty; foreach ( string messageType in Enum .GetNames( t