public bool UpdateUserController(CreateUserDomain userDm) { UserBIZ userBIZ = new UserBIZ(); UserDTO userDTO = new UserDTO(); userDTO.APPLY_DATE.Value = DateTime.Now; userDTO.CRT_BY = CommonLib.Common.CurrentUserInfomation.Username; userDTO.CRT_DATE.Value = DateTime.Now; userDTO.CRT_MACHINE = CommonLib.Common.CurrentUserInfomation.UserCD; userDTO.DATE_FORMAT = userDm.DefaultDateFormat; userDTO.FLG_ACTIVE = userDm.IsActive; userDTO.FLG_RESIGN = userDm.IsResign; userDTO.GROUP_CD = userDm.GroupUser; userDTO.LANG_CD = userDm.DefaultLang; userDTO.LOWER_USER_ACCOUNT = userDm.UserAccount.ToLower(); userDTO.MENU_SET_CD = userDm.MenuSet; if (!userDm.PassWord.IsNull) { userDTO.PASS.Value = userBIZ.HashUserPassword(userDm.UserAccount.StrongValue, userDm.PassWord.StrongValue, true);//userDm.PassWord; userDTO.PASS.Owner = userDm.PassWord.Owner; } userDTO.UPPER_USER_ACCOUNT = userDm.UserAccount.ToUpper(); userDTO.UPD_BY = CommonLib.Common.CurrentUserInfomation.Username; userDTO.UPD_DATE.Value = DateTime.Now; userDTO.UPD_MACHINE = CommonLib.Common.CurrentUserInfomation.UserCD; userDTO.USER_ACCOUNT = userDm.UserAccount; userDTO.FULL_NAME = userDm.UserName; userBIZ.UpdateUser(userDTO); return(true); }
public bool AddUserToGroupController(CreateUserDomain userDm) { UserBIZ userBIZ = new UserBIZ(); UserDTO userDTO = new UserDTO(); userDTO.GROUP_CD = userDm.GroupUser; userDTO.UPD_BY = CommonLib.Common.CurrentUserInfomation.Username; userDTO.UPD_DATE.Value = DateTime.Now; userDTO.UPD_MACHINE = CommonLib.Common.CurrentUserInfomation.UserCD; userDTO.USER_ACCOUNT = userDm.UserAccount; userBIZ.AddUserToGroup(userDTO); return(true); }
private void AddUserToGroup() { switch (ShowConfirmMessage(Messages.eConfirm.CFM9001)) { case MessageDialogResult.Cancel: return; case MessageDialogResult.No: return; case MessageDialogResult.Yes: break; } try { int row = shtUser.Rows.Count; for (int i = 0; i < row; i++) { if (shtUser.Cells[i, (int)eColUser.SEL].Text == "True") { CreateUserDomain userDm = new CreateUserDomain(); userDm.GroupUser.Value = m_GroupCD; userDm.UserAccount.Value = shtUser.Cells[i, (int)eColUser.USER_ACCOUNT].Text; UserMaintenanceController userCtrler = new UserMaintenanceController(); userCtrler.AddUserToGroupController(userDm); } } } catch (ValidateException err) { for (int i = 0; i < err.ErrorResults.Count; i++) { MessageBox.Show(err.ErrorResults[i].Message.MessageDescription); err.ErrorResults[i].FocusOnControl(); } } catch (BusinessException err) { MessageBox.Show(err.Error.Message.MessageDescription); } catch (Exception ex) { MessageBox.Show(ex.Message); } this.Close(); }
public CreateUserDomain LoadData(CreateUserDomain userDm) { UserBIZ userBIZ = new UserBIZ(); UserDTO userDTO = userBIZ.LoadUser(userDm.UserAccount); userDm.DefaultLang.Value = userDTO.LANG_CD.Value; userDm.GroupUser.Value = userDTO.GROUP_CD.Value; userDm.PassWord.Value = userDTO.PASS.Value; userDm.UserName.Value = userDTO.FULL_NAME.Value; userDm.DefaultDateFormat.Value = userDTO.DATE_FORMAT.Value; userDm.UserAccount.Value = userDTO.USER_ACCOUNT.Value; userDm.MenuSet.Value = userDTO.MENU_SET_CD.Value; userDm.IsActive.Value = userDTO.FLG_ACTIVE.Value; userDm.IsResign.Value = userDTO.FLG_RESIGN.Value; return(userDm); }
private void SFM0031_CreateUser_Load(object sender, EventArgs e) { InitialScreen(); if (m_eMode == eOperationMode.PROPERTIES_SHOW) { CreateUserDomain userDm = new CreateUserDomain(); UserMaintenanceController userCtrler = new UserMaintenanceController(); userDm.UserAccount.Value = m_UserAccount; dmcCreateUserAccount.LoadData(userCtrler.LoadData(userDm)); txtPassWord.Text = string.Empty; chkIsActive.Checked = true; // disable control CommonLib.CtrlUtil.EnabledControl(false, txtUserAccount); } }
private void SaveData() { try { switch (ShowConfirmMessage(Messages.eConfirm.CFM9001)) { case MessageDialogResult.Cancel: return; case MessageDialogResult.No: this.Close(); return; case MessageDialogResult.Yes: break; } CreateUserDomain userDm = dmcCreateUserAccount.SaveData(new CreateUserDomain()); UserMaintenanceController userCtrler = new UserMaintenanceController(); if (m_eMode == eOperationMode.CREATE_ACCOUNT) { userCtrler.CreateUserController(userDm); } else { userCtrler.UpdateUserController(userDm); } this.Close(); } catch (ValidateException err) { for (int i = 0; i < err.ErrorResults.Count; i++) { MessageBox.Show(err.ErrorResults[i].Message.MessageDescription); err.ErrorResults[i].FocusOnControl(); } } catch (BusinessException err) { MessageBox.Show(err.Error.Message.MessageDescription); } catch (Exception ex) { MessageBox.Show(ex.Message); } }