private void btnConfirm_Click(object sender, EventArgs e) { if (!BasePageLogic.ControlValueIsEmpty(gbDetail)) { return; } else { if (!txtNewPassword.Text.Trim().Equals(txtConfirmPassword.Text.Trim())) { MessageBoxHelper.ShowWarningMsg(RDIFrameworkMessage.MSG0231); txtConfirmPassword.Focus(); return; } } if (MessageBoxHelper.Show("确认修改用户密码嘛?") == System.Windows.Forms.DialogResult.Yes) { // 更新用户的密码 if (this.SetPassword()) { this.Close(); } } }
private void btnSave_Click(object sender, EventArgs e) { if (!BasePageLogic.ControlValueIsEmpty(gbMain)) { return; } if (this.isAdd) //增加数据 { if (!this.SaveData()) { return; } this.Changed = true; this.DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); } else //修改数据 { if (!this.SaveEditData()) { return; } this.Changed = true; this.DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); } }
private void btnSave_Click(object sender, EventArgs e) { if (BasePageLogic.ControlValueIsEmpty(pnlMain)) { if (isAdd) //新增数据 { if (this.SaveEntity()) { this.Changed = true; } } else //修改数据 { if (UpdateData()) { this.Changed = true; } } if (this.Changed) { (this.Owner as BaseForm).RefreshForm(); this.Close(); } } }
private void btnSave_Click(object sender, EventArgs e) { // 检查输入的有效性 if (!BasePageLogic.ControlValueIsEmpty(pnlMan)) { return; } // 设置鼠标繁忙状态,并保留原先的状态 var holdCursor = this.Cursor; this.Cursor = Cursors.WaitCursor; try { this.SaveEntity(true); } catch (Exception ex) { this.ProcessException(ex); } finally { // 设置鼠标默认状态,原来的光标状态 this.Cursor = holdCursor; } }
private void btnSaveContine_Click(object sender, EventArgs e) { if (BasePageLogic.ControlValueIsEmpty(pnlMain)) { SaveData(false); BasePageLogic.EmptyControlValue(pnlMain); } }
private void btnSave_Click(object sender, EventArgs e) { if (BasePageLogic.ControlValueIsEmpty(pnlMain) && this.SaveEntity()) { this.Changed = true; this.DialogResult = DialogResult.OK; this.Close(); } }
private void btnAdd_Click(object sender, EventArgs e) { if (BasePageLogic.ControlValueIsEmpty(pnlMain) && this.SaveEntity()) { this.Changed = true; BasePageLogic.EmptyControlValue(pnlMain); txtRealName.Focus(); } }
private void btnAdd_Click(object sender, EventArgs e) { if (BasePageLogic.ControlValueIsEmpty(groupBox1)) { if (this.SaveEntity()) { this.Changed = true; //this.DialogResult = System.Windows.Forms.DialogResult.OK; } } }
private void btnSaveContinue_Click(object sender, EventArgs e) { if (BasePageLogic.ControlValueIsEmpty(pnlMain)) { if (this.SaveEntity()) { this.Changed = true; } BasePageLogic.EmptyControlValue(pnlMain); this.txtItemCode.Focus(); } }
private void btnSaveContinue_Click(object sender, EventArgs e) { if (!BasePageLogic.ControlValueIsEmpty(gbDetail)) { return; } if (this.SaveEntity()) { isAddData = true; this.Changed = true; BasePageLogic.EmptyControlValue(gbDetail); txtUserName.Focus(); } }
private void btnSaveContinue_Click(object sender, EventArgs e) { if (!BasePageLogic.ControlValueIsEmpty(gbMain)) { return; } if (!this.SaveData()) { return; } this.Changed = true; BasePageLogic.EmptyControlValue(gbMain); txtFullName.Focus(); }
private void btnSave_Click(object sender, EventArgs e) { if (!BasePageLogic.ControlValueIsEmpty(gbDetail)) { return; } if (this.SaveEntity()) { this.Changed = true; (this.Owner as BaseForm).RefreshForm(); this.DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); } }
/// <summary> /// 保存序列 /// </summary> /// <param name="close">关闭窗体</param> private void AddSequence(bool close = true) { // 检查输入的有效性 if (!BasePageLogic.ControlValueIsEmpty(gbDetail)) { return; } // 设置鼠标繁忙状态,并保留原先的状态 Cursor holdCursor = this.Cursor; this.Cursor = Cursors.WaitCursor; try { if (this.SaveEntity()) { if (close) { this.DialogResult = DialogResult.OK; // 关闭窗口 this.Close(); } else { BasePageLogic.EmptyControlValue(gbDetail); } } } catch (Exception ex) { this.ProcessException(ex); } finally { // 设置鼠标默认状态,原来的光标状态 this.Cursor = holdCursor; } }
private void btnSave_Click(object sender, EventArgs e) { if (!BasePageLogic.ControlValueIsEmpty(pnlMain)) { return; } if (string.IsNullOrEmpty(this.EntityId)) { SaveData(true); } else { if (SaveEditData()) { this.DialogResult = DialogResult.OK; this.Close(); if (OnFormClosedRefreash != null) { OnFormClosedRefreash(); } } } }
/// <summary> /// 保存新增的数据 /// </summary> /// <param name="close">增加成功是否关闭窗体</param> private void SaveAddData(bool close) { if (!BasePageLogic.ControlValueIsEmpty(gbMain)) { return; } // 设置鼠标繁忙状态,并保留原先的状态 var holdCursor = this.Cursor; this.Cursor = Cursors.WaitCursor; var moduleEntity = new PiModuleEntity { ParentId = BusinessLogic.ConvertToString(txtParentId.SelectedValue), FullName = txtFullName.Text.Trim(), Code = txtCode.Text.Trim(), Target = txtTarget.Text.Trim(), NavigateUrl = txtNavigateUrl.Text.Trim(), MvcNavigateUrl = txtMvcNavigateUrl.Text.Trim(), ImageIndex = SelectedFileId, IconUrl = txtIconUrl.Text.Trim(), IconCss = txtIconCss.Text.Trim(), FormName = txtFormName.Text.Trim(), AssemblyName = txtAssemblyName.Text.Trim(), ModuleType = 3 }; if (rbModuleType1.Checked) { moduleEntity.ModuleType = 1; } if (rbModuleType2.Checked) { moduleEntity.ModuleType = 2; } if (rbModuleType3.Checked) { moduleEntity.ModuleType = 3; } if (string.IsNullOrEmpty(moduleEntity.NavigateUrl)) { moduleEntity.NavigateUrl = @"#"; } if (moduleEntity.ModuleType != null && moduleEntity.ModuleType == 2) { moduleEntity.IconCss = "icon-note"; } moduleEntity.PermissionItemCode = "Resource.AccessPermission"; moduleEntity.Enabled = chkEnabled.Checked ? 1 : 0; moduleEntity.IsPublic = chkIsPublic.Checked ? 1 : 0; moduleEntity.Expand = chkExpand.Checked ? 1 : 0; moduleEntity.Description = txtDescription.Text.Trim(); moduleEntity.AllowDelete = chkAllowDelete.Checked ? 1 : 0; moduleEntity.AllowEdit = chkAllowEdit.Checked ? 1 : 0; moduleEntity.IsMenu = chkIsMenu.Checked ? 1 : 0; moduleEntity.DeleteMark = 0; string statusCode = string.Empty; string statusMessage = string.Empty; this.EntityId = moduleService.Add(UserInfo, moduleEntity, out statusCode, out statusMessage); this.FullName = moduleEntity.FullName; this.ParentId = BusinessLogic.ConvertToString(moduleEntity.ParentId); if (statusCode == StatusCode.OKAdd.ToString()) { this.Changed = true; if (SystemInfo.ShowInformation) { // 添加成功,进行提示 MessageBoxHelper.ShowSuccessMsg(statusMessage); } if (close) { this.DialogResult = DialogResult.OK; } else { BasePageLogic.EmptyControlValue(gbMain); this.chkEnabled.Checked = true; this.chkAllowEdit.Checked = true; this.chkAllowDelete.Checked = true; txtFullName.Focus(); } } else { MessageBoxHelper.ShowWarningMsg(statusMessage); // 是否编号重复了,提高友善性 if (statusCode == StatusCode.ErrorCodeExist.ToString()) { this.txtCode.SelectAll(); this.txtCode.Focus(); } } // 设置鼠标默认状态,原来的光标状态 this.Cursor = holdCursor; if (this.Changed && close) { this.Close(); } }
/// <summary> /// 保存修改的数据 /// </summary> private void SaveEditData() { if (!BasePageLogic.ControlValueIsEmpty(gbMain)) { return; } // 设置鼠标繁忙状态,并保留原先的状态 var holdCursor = this.Cursor; this.Cursor = Cursors.WaitCursor; currentModuleEntity.ParentId = BusinessLogic.ConvertToString(txtParentId.SelectedValue); currentModuleEntity.FullName = txtFullName.Text.Trim(); currentModuleEntity.Code = txtCode.Text.Trim(); currentModuleEntity.Target = txtTarget.Text.Trim(); currentModuleEntity.NavigateUrl = txtNavigateUrl.Text.Trim(); currentModuleEntity.MvcNavigateUrl = txtMvcNavigateUrl.Text.Trim(); currentModuleEntity.IconUrl = txtIconUrl.Text.Trim(); currentModuleEntity.IconCss = txtIconCss.Text.Trim(); currentModuleEntity.FormName = txtFormName.Text.Trim(); currentModuleEntity.AssemblyName = txtAssemblyName.Text.Trim(); if (rbModuleType1.Checked) { currentModuleEntity.ModuleType = 1; } if (rbModuleType2.Checked) { currentModuleEntity.ModuleType = 2; } if (rbModuleType3.Checked) { currentModuleEntity.ModuleType = 3; } currentModuleEntity.Enabled = chkEnabled.Checked ? 1 : 0; currentModuleEntity.IsPublic = chkIsPublic.Checked ? 1 : 0; currentModuleEntity.Expand = chkExpand.Checked ? 1 : 0; currentModuleEntity.AllowDelete = chkAllowDelete.Checked ? 1 : 0; currentModuleEntity.AllowEdit = chkAllowEdit.Checked ? 1 : 0; currentModuleEntity.IsMenu = chkIsMenu.Checked ? 1 : 0; currentModuleEntity.Description = txtDescription.Text.Trim(); if (!string.IsNullOrEmpty(SelectedFileId.Trim())) { currentModuleEntity.ImageIndex = SelectedFileId; } string statusCode = string.Empty; string statusMessage = string.Empty; this.EntityId = currentModuleEntity.Id.ToString(); this.FullName = currentModuleEntity.FullName; this.ParentId = BusinessLogic.ConvertToString(currentModuleEntity.ParentId); moduleService.Update(UserInfo, currentModuleEntity, out statusCode, out statusMessage); if (statusCode == StatusCode.OKUpdate.ToString()) { this.Changed = true; if (SystemInfo.ShowInformation) { // 添加成功,进行提示 MessageBoxHelper.ShowSuccessMsg(statusMessage); } this.DialogResult = DialogResult.OK; } else { MessageBoxHelper.ShowWarningMsg(statusMessage); // 是否编号重复了,提高友善性 if (statusCode == StatusCode.ErrorCodeExist.ToString()) { this.txtCode.SelectAll(); this.txtCode.Focus(); } } // 设置鼠标默认状态,原来的光标状态 this.Cursor = holdCursor; if (this.Changed) { this.Close(); } }
private void SaveData() { var userEntity = currentUserEntity; if (string.IsNullOrEmpty(this.ucOSCompanyName.SelectedFullName)) { MessageBoxHelper.ShowWarningMsg(RDIFrameworkMessage.MSG0229); this.ucOSCompanyName.Focus(); return; } if (!BasePageLogic.ControlValueIsEmpty(gbDetail)) { return; } userEntity.Id = currentUserEntity.Id; userEntity.UserName = txtUserName.Text.Trim(); userEntity.RealName = txtRealName.Text.Trim(); userEntity.Code = txtCode.Text.Trim(); userEntity.Gender = cboGender.Text; userEntity.Mobile = txtMobile.Text.Trim(); userEntity.Birthday = DateTimeHelper.ToDate(txtBirthday.Text); userEntity.Telephone = txtTelphone.Text.Trim(); userEntity.Title = txtTitle.Text.Trim(); userEntity.Duty = txtDuty.Text.Trim(); userEntity.QICQ = txtQQ.Text.Trim(); userEntity.Email = txtEmail.Text.Trim(); userEntity.Enabled = chkEnabled.Checked ? 1 : 0; userEntity.RoleId = BusinessLogic.ConvertToString(BasePageLogic.GetComboSelectedValue(cboRoleName, BasePageLogic.ComboBoxValueType.SelectValue)); userEntity.CompanyId = string.IsNullOrEmpty(ucOSCompanyName.SelectedId) ? null : ucOSCompanyName.SelectedId; userEntity.CompanyName = string.IsNullOrEmpty(ucOSCompanyName.SelectedId) ? null : ucOSCompanyName.SelectedFullName; userEntity.SubCompanyId = string.IsNullOrEmpty(ucOSSubCompanyName.SelectedId) ? null : ucOSSubCompanyName.SelectedId; userEntity.SubCompanyName = string.IsNullOrEmpty(ucOSSubCompanyName.SelectedId) ? null : ucOSSubCompanyName.SelectedFullName; userEntity.DepartmentId = string.IsNullOrEmpty(ucOSDepartmentName.SelectedId) ? null : ucOSDepartmentName.SelectedId; userEntity.DepartmentName = string.IsNullOrEmpty(ucOSDepartmentName.SelectedId) ? null : ucOSDepartmentName.SelectedFullName; userEntity.SubDepartmentId = string.IsNullOrEmpty(ucOSSubDepartmentName.SelectedId) ? null : ucOSSubDepartmentName.SelectedId; userEntity.SubDepartmentName = string.IsNullOrEmpty(ucOSSubDepartmentName.SelectedId) ? null : ucOSSubDepartmentName.SelectedFullName; userEntity.WorkgroupId = string.IsNullOrEmpty(ucOSWorkgroupName.SelectedId) ? null : ucOSWorkgroupName.SelectedId; userEntity.WorkgroupName = string.IsNullOrEmpty(ucOSWorkgroupName.SelectedId) ? null : ucOSWorkgroupName.SelectedFullName; userEntity.HomeAddress = txtHomeAddress.Text.Trim(); userEntity.Description = txtDescription.Text.Trim(); if (base.UserInfo != null) { userEntity.ModifiedBy = UserInfo.RealName; userEntity.ModifiedUserId = UserInfo.Id; } // 设置鼠标繁忙状态,并保留原先的状态 var holdCursor = this.Cursor; this.Cursor = Cursors.WaitCursor; try { string statusCode = string.Empty; string statusMessage = string.Empty; userService.UpdateUser(UserInfo, userEntity, out statusCode, out statusMessage); if (statusCode == StatusCode.OKUpdate.ToString()) { this.Changed = true; if (SystemInfo.ShowInformation) { // 添加成功,进行提示 MessageBoxHelper.ShowSuccessMsg(statusMessage); } this.DialogResult = DialogResult.OK; } else { MessageBoxHelper.ShowWarningMsg(statusMessage); if (statusCode == StatusCode.ErrorUserExist.ToString()) { this.txtUserName.SelectAll(); this.txtUserName.Focus(); } // 是否编号重复了,提高友善性 if (statusCode == StatusCode.ErrorCodeExist.ToString()) { this.txtCode.SelectAll(); this.txtCode.Focus(); } } } catch (Exception ex) { this.ProcessException(ex); } finally { // 鼠标正常状态 this.Cursor = holdCursor; } }
public override bool SaveUpdated() { var returnValue = false; var userEntity = currentUserEntity; if (!BasePageLogic.ControlValueIsEmpty(gbDetail)) { return(returnValue); } userEntity.Id = currentUserEntity.Id; userEntity.UserName = txtUserName.Text.Trim(); userEntity.RealName = txtRealName.Text.Trim(); userEntity.Code = txtCode.Text.Trim(); userEntity.Gender = cboGender.Text; userEntity.Mobile = txtMobile.Text.Trim(); userEntity.Birthday = DateTimeHelper.ToDate(txtBirthday.Text); userEntity.Telephone = txtTelphone.Text.Trim(); userEntity.Title = txtTitle.Text.Trim(); userEntity.Duty = txtDuty.Text.Trim(); userEntity.QICQ = txtQQ.Text.Trim(); userEntity.Email = txtEmail.Text.Trim(); userEntity.Enabled = chkEnabled.Checked ? 1 : 0; userEntity.RoleId = BusinessLogic.ConvertToString(BasePageLogic.GetComboSelectedValue(cboRoleName, BasePageLogic.ComboBoxValueType.SelectValue)); userEntity.CompanyId = string.IsNullOrEmpty(ucOSCompanyName.SelectedId) ? null : ucOSCompanyName.SelectedId; userEntity.CompanyName = string.IsNullOrEmpty(ucOSCompanyName.SelectedId) ? null : ucOSCompanyName.SelectedFullName; userEntity.SubCompanyId = string.IsNullOrEmpty(ucOSSubCompanyName.SelectedId) ? null : ucOSSubCompanyName.SelectedId; userEntity.SubCompanyName = string.IsNullOrEmpty(ucOSSubCompanyName.SelectedId) ? null : ucOSSubCompanyName.SelectedFullName; userEntity.DepartmentId = string.IsNullOrEmpty(ucOSDepartmentName.SelectedId) ? null : ucOSDepartmentName.SelectedId; userEntity.DepartmentName = string.IsNullOrEmpty(ucOSDepartmentName.SelectedId) ? null : ucOSDepartmentName.SelectedFullName; userEntity.SubDepartmentId = string.IsNullOrEmpty(ucOSSubDepartmentName.SelectedId) ? null : ucOSSubDepartmentName.SelectedId; userEntity.SubDepartmentName = string.IsNullOrEmpty(ucOSSubDepartmentName.SelectedId) ? null : ucOSSubDepartmentName.SelectedFullName; userEntity.WorkgroupId = string.IsNullOrEmpty(ucOSWorkgroupName.SelectedId) ? null : ucOSWorkgroupName.SelectedId; userEntity.WorkgroupName = string.IsNullOrEmpty(ucOSWorkgroupName.SelectedId) ? null : ucOSWorkgroupName.SelectedFullName; userEntity.HomeAddress = txtHomeAddress.Text.Trim(); userEntity.Description = txtDescription.Text.Trim(); if (base.UserInfo != null) { userEntity.ModifiedBy = UserInfo.RealName; userEntity.ModifiedUserId = UserInfo.Id; } string statusCode = string.Empty; string statusMessage = string.Empty; userService.UpdateUser(UserInfo, userEntity, out statusCode, out statusMessage); if (statusCode == StatusCode.OKUpdate.ToString()) { returnValue = true; } else { MessageBoxHelper.ShowWarningMsg(statusMessage); if (statusCode == StatusCode.ErrorUserExist.ToString()) { this.txtUserName.SelectAll(); this.txtUserName.Focus(); } // 是否编号重复了,提高友善性 if (statusCode == StatusCode.ErrorCodeExist.ToString()) { this.txtCode.SelectAll(); this.txtCode.Focus(); } returnValue = false; } return(returnValue); }