private void InitializeScreen() { // Load lookup combobox data. LookupData(); // Binding event to control. txtUserAccount.KeyPress += CtrlUtil.SetNextControl; txtUsername.KeyPress += CtrlUtil.SetNextControl; cboDefaultDateFormat.KeyPress += CtrlUtil.SetNextControl; cboDefaultLang.KeyPress += CtrlUtil.SetNextControl; txtCurrentPassword.KeyPress += CtrlUtil.SetNextControl; txtNewPassword.KeyPress += CtrlUtil.SetNextControl; txtConfirmNewPassword.KeyPress += CtrlUtil.SetNextControl; // Binding Model dmcUserProfile.AddRangeControl( txtUserAccount, txtUsername, txtNewPassword, txtConfirmNewPassword, cboDefaultDateFormat, cboDefaultLang, txtCurrentPassword ); Map <string, object> mapData = m_prcUserProfile.LoadUserProfile(Common.CurrentUserInfomation.UserCD); UserProfileUIDM dataModel = mapData.ExtractValue <UserProfileUIDM>(UserProfileController.C_VAL_MODEL); dmcUserProfile.LoadData(dataModel); // Startup Enable/Disable control. CtrlUtil.EnabledControl(false, txtUserAccount); CtrlUtil.EnabledControl(true, txtUsername, txtNewPassword, txtConfirmNewPassword, cboDefaultDateFormat, cboDefaultLang, txtCurrentPassword); }
/// <summary> /// Save modified user profile. /// </summary> /// <param name="model"></param> /// <exception cref="BusinessException"><c>BusinessException</c>.</exception> /// <exception cref="Exception"><c>Exception</c>.</exception> public void SaveUserProfile(UserProfileUIDM model) { UserBIZ bizUser = new UserBIZ(); bizUser.UpdateUserProfile(CommonLib.Common.CurrentUserInfomation.UserCD, model.Username, model.CurrentPassword, model.Password, model.ConfirmPassword, new NZInt(null, model.DefaultDateFormat.Value), new NZInt(null, model.DefaultLang.Value)); }
public Map <string, object> LoadUserProfile(NZString userCD) { UserProfileUIDM model = new UserProfileUIDM(); UserBIZ bizUser = new UserBIZ(); UserDTO dtoUser = bizUser.LoadUser(userCD); model.UserAccount.Value = dtoUser.USER_ACCOUNT.Value; model.Username.Value = dtoUser.FULL_NAME.Value; model.DefaultDateFormat.Value = dtoUser.DATE_FORMAT.Value; model.DefaultLang.Value = dtoUser.LANG_CD.Value; Map <string, object> mapData = new Map <string, object>(); mapData.Put(C_VAL_MODEL, model); return(mapData); }
private void btnSave_Click(object sender, EventArgs e) { UserProfileUIDM model = new UserProfileUIDM(); model = dmcUserProfile.SaveData(model); try { m_prcUserProfile.SaveUserProfile(model); MessageDialog.ShowInformation(this, null, "UserProfile has updated."); Close(); } catch (ValidateException err) { MessageDialog.ShowBusiness(this, err.ErrorResults[0].Message); } catch (BusinessException err) { MessageDialog.ShowBusiness(this, err.Error.Message); } catch (Exception err) { MessageDialog.ShowBusiness(this, err.Message); } }