public AccountController() { _AccountService = new CU_AccountService(); _logService = new CU_LogService(); }
public static bool CheckUserCookie(UserProfile profile) { if (HttpContext.Current.Request.Cookies["UserProfileCookie"] != null) { string strId = DataProtection.Decrypt(HttpContext.Current.Request.Cookies["UserProfileCookie"]["Id"]); if (string.IsNullOrWhiteSpace(strId)) { return(false); } UserModel employee = new CU_AccountService().ValidateLoginData(DataProtection.Decrypt(HttpContext.Current.Request.Cookies["UserProfileCookie"]["LoginName"]) , DataProtection.Decrypt(HttpContext.Current.Request.Cookies["UserProfileCookie"]["Password"])); if (employee != null) { CreateUserSession(profile, employee); return(true); } else { return(false); } return(true); } else { return(false); } }
public EmployeeController() // : base(new CU_Employee_RoleProgramService()) // just in case of changing somr thing in the service but the inserted service must inherit from IManageBaseService<[same model]> { _CU_EmployeeService = new CU_EmployeeService(); _CU_Role_ProgramService = new CU_Role_ProgramService(); _CU_Employee_RoleProgramService = new CU_Employee_RoleProgramService(); _CU_AcountService = new CU_AccountService(); }