public static string[] CheckUser(string UserName, string Pass) { string[] nResult = new string[8]; User_Info nUserLogin = new User_Info(UserName, true); if (nUserLogin.Key.Trim().Length == 0) { nResult[0] = "ERR"; nResult[1] = "CheckUser_Error01"; return(nResult);//"Don't have this UserName"; } if (nUserLogin.GroupKey < 2) { nResult[0] = "ERR"; nResult[1] = "CantLogin"; return(nResult);//"Don't have this UserName"; } //LINH //string moa = MyCryptography.HashPass(Pass); //if (nUserLogin.Password != MyCryptography.HashPass(Pass)) //{ // nUserLogin.UpdateFailedPass(); // nResult[0] = "ERR"; // nResult[1] = "CheckUser_Error01"; // return nResult;// "Wrong Password"; //} if (!nUserLogin.Activate) { nResult[0] = "ERR"; nResult[1] = "CheckUser_Error02"; return(nResult);//"Don't Activate" } //if (nUserLogin.ExpireDate < DateTime.Now) //{ // nResult[0] = "ERR"; // nResult[1] = "CheckUser_Error03"; // return nResult;//"Expire On" //} nResult[0] = "OK"; nResult[1] = nUserLogin.Key; nResult[2] = nUserLogin.EmployeeKey.ToString(); nResult[3] = nUserLogin.GroupKey.ToString(); nResult[4] = nUserLogin.CooperativeKey.ToString(); nResult[5] = nUserLogin.EmployeeName; nResult[6] = nUserLogin.BranchName; nResult[7] = nUserLogin.CooperativeVenturesKey.ToString(); nUserLogin.UpdateDateLogin(); return(nResult); }
public static string[] CheckUser(string UserName, string Pass) { string[] nResult = new string[3]; User_Info nUserLogin = new User_Info(UserName, true); if (nUserLogin.Key.Trim().Length == 0) { nResult[0] = "ERR"; nResult[1] = "CheckUser_Error01"; return(nResult);//"Don't have this UserName"; } if (nUserLogin.Password != MyCryptography.HashPass(Pass)) { nUserLogin.UpdateFailedPass(); nResult[0] = "ERR"; nResult[1] = "CheckUser_Error01"; return(nResult);// "Wrong Password"; } if (!nUserLogin.Activate) { nResult[0] = "ERR"; nResult[1] = "CheckUser_Error02"; return(nResult);//"Don't Activate" } if (nUserLogin.ExpireDate < DateTime.Now) { nResult[0] = "ERR"; nResult[1] = "CheckUser_Error03"; return(nResult);//"Expire On" } nResult[0] = "OK"; nResult[1] = nUserLogin.Key; nResult[2] = nUserLogin.EmployeeKey.ToString(); nUserLogin.UpdateDateLogin(); return(nResult); }