Example #1
0
        /// <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);
        }
Example #2
0
        /// <summary>
        /// 更新員工的重置密碼用唯一值
        /// </summary>
        public bool UpdateEmployeePasswordResetKey(string empAccount, string passwordResetKey)
        {
            bool result = false;

            using (EmployeeAuthorityDataAccess empAuthDao = new EmployeeAuthorityDataAccess())
            {
                Employee entity = empAuthDao.Get <Employee>(emp => emp.EmpAccount == empAccount);

                entity.PasswordResetKey     = passwordResetKey;
                entity.PasswordResetKeyDate = DateTime.Now;
                entity.MdfAccount           = empAccount;
                entity.MdfDate = DateTime.Now;

                result   = empAuthDao.Update();
                dbErrMsg = empAuthDao.GetErrMsg();
            }

            return(result);
        }
Example #3
0
        /// <summary>
        /// 更新員工本次登入資訊
        /// </summary>
        public bool UpdateEmployeeLoginInfo(string empAccount, string thisLoginIP)
        {
            bool result = false;

            using (EmployeeAuthorityDataAccess empAuthDao = new EmployeeAuthorityDataAccess())
            {
                Employee entity = empAuthDao.Get <Employee>(emp => emp.EmpAccount == empAccount);

                //備份上次的登入資訊,記錄這次的
                entity.LastLoginTime = entity.ThisLoginTime;
                entity.LastLoginIP   = entity.ThisLoginIP;
                entity.ThisLoginTime = DateTime.Now;
                entity.ThisLoginIP   = thisLoginIP;

                result   = empAuthDao.Update();
                dbErrMsg = empAuthDao.GetErrMsg();
            }

            return(result);
        }
Example #4
0
        /// <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);
        }
Example #5
0
        /// <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);
        }