/// <summary> /// 添加按钮 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void simpleButtonEmployeeAdd_Click(object sender, EventArgs e) { if (this.ValidateChildren() == false) { return; } decimal? telephone = textEditEmplcode.EditValue as decimal?; decimal? mobphone = textEditMobphone.EditValue as decimal?; Employee employee = new Employee( txtDepartment.Text, textEditEmplcode.Text, textEditUsername.Text, PasswordTextEdit.Text, comboBoxEditSex.Text, textEditTelephone.Text.ToString(), textEditMobphone.Text.ToString(), textEditEmpladd.Text, Convert.ToInt32(txtLastedDate.Text.Trim()));; if (employeeManager.Save(employee)) { employeeManager.Add(employee); } gridControlEmployee.DataSource = _rightsQueryService.GetAllUserAsync().GetAwaiter().GetResult().rows; }
/// <summary> /// 新增 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void simpleButtonRoleAdd_Click(object sender, EventArgs e) { if (this.ValidateChildren() == false) { return; } Role role = new Role(textEditRolename.Text, textEditRoledesc.Text); if (roleManager.Save(role)) { this.roleManager.Add(role); } this.ValidateChildren(); }