/// <summary> /// 更新後端作業選項 /// </summary> public bool UpdateOperaionData(OpParams param) { bool result = false; using (EmployeeAuthorityDataAccess empAuthDao = new EmployeeAuthorityDataAccess()) { Operations entity = empAuthDao.GetEmptyEntity <Operations>(new OperationsRequiredPropValues() { OpId = param.OpId, IsNewWindow = !param.IsNewWindow, IsHideSelf = !param.IsHideSelf }); entity.OpId = param.OpId; entity.OpSubject = param.OpSubject; entity.LinkUrl = param.LinkUrl; entity.IsNewWindow = param.IsNewWindow; entity.IconImageFile = param.IconImageFile; entity.SortNo = param.SortNo; entity.IsHideSelf = param.IsHideSelf; entity.CommonClass = param.CommonClass; entity.EnglishSubject = param.EnglishSubject; entity.MdfAccount = param.PostAccount; entity.MdfDate = DateTime.Now; result = empAuthDao.Update(); dbErrMsg = empAuthDao.GetErrMsg(); } return(result); }
/// <summary> /// 更新部門資料 /// </summary> public bool UpdateDepartmentData(DeptParams param) { bool result = false; using (EmployeeAuthorityDataAccess empAuthDao = new EmployeeAuthorityDataAccess()) { Department entity = empAuthDao.GetEmptyEntity <Department>(new DepartmentRequiredPropValues() { DeptId = param.DeptId, DeptName = "" }); entity.DeptName = param.DeptName; entity.SortNo = param.SortNo; entity.MdfAccount = param.PostAccount; entity.MdfDate = DateTime.Now; result = empAuthDao.UpdateDepartmentData(entity); dbErrMsg = empAuthDao.GetErrMsg(); if (!result && empAuthDao.GetSqlErrNumber() == 50000 && empAuthDao.GetSqlErrState() == 2) { param.HasDeptNameBeenUsed = true; } } return(result); }
/// <summary> /// 更新員工身分資料 /// </summary> public bool UpdateEmployeeRoleData(RoleParams param) { bool result = false; using (EmployeeAuthorityDataAccess empAuthDao = new EmployeeAuthorityDataAccess()) { EmployeeRole entity = empAuthDao.GetEmptyEntity <EmployeeRole>(new EmployeeRoleRequiredPropValues() { RoleId = param.RoleId, RoleName = "" }); entity.RoleDisplayName = param.RoleDisplayName; entity.SortNo = param.SortNo; entity.MdfAccount = param.PostAccount; entity.MdfDate = DateTime.Now; result = empAuthDao.Update(); dbErrMsg = empAuthDao.GetErrMsg(); } return(result); }
/// <summary> /// 更新員工資料 /// </summary> public bool UpdateEmployeeData(AccountParams param) { bool result = false; using (EmployeeAuthorityDataAccess empAuthDao = new EmployeeAuthorityDataAccess()) { Employee entity = empAuthDao.GetEmptyEntity <Employee>(new EmployeeRequiredPropValues() { EmpId = param.EmpId, EmpAccount = "", EmpPassword = "", IsAccessDenied = !param.IsAccessDenied, PasswordHashed = !param.PasswordHashed }); entity.EmpPassword = param.EmpPassword; entity.EmpName = param.EmpName; entity.Email = param.Email; entity.Remarks = param.Remarks; entity.DeptId = param.DeptId; entity.RoleId = param.RoleId; entity.IsAccessDenied = param.IsAccessDenied; entity.StartDate = param.StartDate; entity.EndDate = param.EndDate; entity.OwnerAccount = param.OwnerAccount; entity.PasswordHashed = param.PasswordHashed; entity.DefaultRandomPassword = param.DefaultRandomPassword; entity.MdfAccount = param.PostAccount; entity.MdfDate = DateTime.Now; result = empAuthDao.Update(); dbErrMsg = empAuthDao.GetErrMsg(); } return(result); }