private void personelInf_Load(object sender, EventArgs e) { DataTable dt = null; dt = mainPanel.logininfcontrol.getComBoBoxItemsInf("职位"); for (int i = 0; i < dt.Rows.Count; i++) { comboBoxClass.Items.Add(dt.Rows[i]["MC"].ToString()); } comboBoxClass.SelectedIndex = 0; labelUsername.Text = mainPanel.nowUser.userName; staffmodel = mainPanel.logininfcontrol.GetStaffInf(mainPanel.nowUser.userID); }
private void buttonSAVEINF_Click(object sender, EventArgs e) { if (!checkInfIsRight()) { return; } SYS_MODEL.staffModel staffmodel = new SYS_MODEL.staffModel(); staffmodel.STAFFID = textBoxID.Text; staffmodel.NAME = textBoxNAME.Text; staffmodel.ID = textBoxID.Text; staffmodel.POSTID = mainPanel.logininfcontrol.getPostIDbyPostName(comboBoxClass.Text); staffmodel.BIRTHDAY = dateBIRTHDAY.Value.ToString(); staffmodel.ADDRESS = textBoxADD.Text; staffmodel.AGE = textBoxAGE.Text; staffmodel.PHONE = textBoxTEL.Text; staffmodel.QQ = textBoxQQ.Text; staffmodel.EMAIL = textBoxMAIL.Text; staffmodel.EDUCATION = textBoxEDUCATION.Text; staffmodel.PASSWORD = textBoxNEWPASSWORD.Text; if (radioButtonMALE.Checked) { staffmodel.SEX = "男"; } else { staffmodel.SEX = "女"; } if (radioButtonMARRIED.Checked) { staffmodel.MARRIED = "已婚"; } else { staffmodel.MARRIED = "未婚"; } if (mainPanel.logininfcontrol.checkUserIsAlive(staffmodel.STAFFID)) { MessageBox.Show("该用户存在,不能重复注册", "系统提示"); return; } if (mainPanel.logininfcontrol.saveStaffInf(staffmodel)) { MessageBox.Show("用户注册成功", "系统提示"); } else { MessageBox.Show("未知原因导致用户注册失败", "系统提示"); } ref_Staff(); }