public static bool CheckUserOfGasStation(int userId, int gasStationId) { bool result = false; using (var perBL = new BL.Permission()) { result = perBL.CheckUserOfGasStation(userId, gasStationId); } return(result); }
public static bool CheckUserOfCompany(int userId, int companyId) { bool result = false; using (var perBL = new BL.Permission()) { result = perBL.CheckUserOfCompany(userId, companyId); } return(result); }
/// <summary> /// Use User Name to DB get the User Info data, and save it to Session. /// </summary> /// <param name="userName"></param> /// <param name="type"></param> /// <returns></returns> public static IdentityModel GetCurrentUser(string userName, VM.EnumAuthenticationType type) { IdentityModel user; using (var perBL = new BL.Permission()) { user = perBL.GetUser(userName, type); //HACK: only for test purpose. if (user == null) { FormsAuthentication.SignOut(); return(null); } } return(user); }