public async Task <User_MasterDTO> GetAccess(string username, string password) { User_MasterDTO User_MasterDTO = null; using (User_MasterBAL user_Master = new User_MasterBAL()) { WebApiHelper.Crypt common = new WebApiHelper.Crypt(); //var encpassword=common.EncryptText(password, "password"); var reuslt = await user_Master.LogIN(username, password); if (reuslt.TransactionStatus == WebApiCommon.Enums.ResultStatus.Success) { User_MasterDTO = (User_MasterDTO)reuslt.ReturnObject; } } return(User_MasterDTO); }
/// <summary> /// Decrypts the specified STR to decrypt. /// </summary> /// <param name="strToDecrypt">The STR to decrypt.</param> /// <returns></returns> //public static string Decrypt(this String strToDecrypt) //{ // Crypt objCrypt = new Crypt(); // return objCrypt.DecryptText(strToDecrypt, "TH#&^$HSJB$@#^GGHWF&)!&^@*(#$HJDY"); //} /// <summary> /// Decrypts the specified STR to decrypt. /// </summary> /// <param name="strToDecrypt">The STR to decrypt.</param> /// <param name="IsQueryStringParameter">if set to <c>true</c> [is query string parameter].</param> /// <returns></returns> public static string Decrypt(this String strToDecrypt, bool IsQueryStringParameter = true) { WebApiHelper.Crypt objCrypt = new WebApiHelper.Crypt(); return(objCrypt.DecryptText(IsQueryStringParameter ? strToDecrypt.Replace("_", "+").Replace("~", "/") : strToDecrypt, PrivateKey)); }
/// <summary> /// Encrypts the specified STR to encrypt. /// </summary> /// <param name="strToEncrypt">The STR to encrypt.</param> /// <returns></returns> public static string Encrypt(this String strToEncrypt) { WebApiHelper.Crypt objCrypt = new WebApiHelper.Crypt(); return(objCrypt.EncryptText(strToEncrypt, PrivateKey).Replace("/", "~").Replace("+", "_")); }