public static bool login(string text1, string text2) { bool login_state = false; string _pass = EncryptDecryptString.Encrypt(text2, "Taj$$Key"); // create filter paramters string[,] _params = { { "UserName", text1 }, { "Password", _pass } }; // get all of data. var _ds = new Select().SelectLists("Users_Login", _params); var dt = _ds.Tables[0]; if (dt.Rows.Count > 0) { SessionManager.Current.ID = string.Format("{0}", dt.Rows[0][0]); SessionManager.Current.Name = string.Format("{0}", dt.Rows[0][1]); //SessionManager.Current.Level = string.Format("{0}", dt.Rows[0][2]); CookiesManager.SaveCoockie(); login_state = true; } return(login_state); }
void LoginUSers(string _email, string _pass) { var emp = new AdminManager().AdminsLogin(_email, _pass); if (emp != null) { ClientSession.Current.loginId = emp.id; ClientSession.Current.loginName = emp.name; CookiesManager.SaveCoockie(); // save this data in cookie. // Redirect to the last opened page in admin. // Redirect to the last opened page in the system. string[] operators = { "default.aspx", "adm-tunr/", "default" }; // Redirect to the last opened page in the system. string rURL = Request.UrlReferrer.AbsoluteUri.ToLower(); bool check = operators.Any(x => rURL.EndsWith(x)); if (!check) { Response.RedirectPermanent(rURL); } else { Response.RedirectPermanent("home.aspx"); } } else { lblError.Text = Resources.AdminResources_en.ErrorLogin; } }
public static object login(string text1, string text2) { // create filter paramters string _pass = EncryptDecryptString.Encrypt(text2, "Taj$$Key"); string[,] _params = { { "Username", text1 }, { "Password", _pass } }; // get all of data. var _ds = new Select().SelectLists("Clients_Login", _params); var dt = _ds.Tables[0]; object result = new { Status = false, Name = "" }; if (dt.Rows.Count > 0) { SessionManager.Current.ID = string.Format("{0}", dt.Rows[0][0]); SessionManager.Current.Name = string.Format("{0}", dt.Rows[0][1]); CookiesManager.SaveCoockie(); result = new { Status = true, Name = SessionManager.Current.Name }; } return(result); }