private void btnUpdate_Click(object sender, EventArgs e) { using (ASRS_ServiceSoapClient srv = new ASRS_ServiceSoapClient()) { PW_User one = new PW_User(); var row = dGVPeopleInfo.SelectedRows[0]; List <PW_User> lst = dGVPeopleInfo.DataSource as List <PW_User>; one.ID = row.Cells["ID"].Value.ToString(); PW_User findOne = lst.Find(delegate(PW_User user) { return(user.ID == one.ID); });//用Find方法按工号找到此人的密码 if (findOne.USERNAME == "001") { MessageBox.Show("不允许修改001管理员账号!"); return; } one.PASSWORD = findOne.PASSWORD; one.USERNAME = row.Cells[1].Value.ToString(); one.USERGROUP = row.Cells["UserGroup"].Value == null ? "" : row.Cells["UserGroup"].Value.ToString(); FormEditPeopleInfo f = new FormEditPeopleInfo(one); f.ShowDialog(); } FormEmpSetting_Load(null, e); }
private void btnAddNew_Click(object sender, EventArgs e) { FormEditPeopleInfo f = new FormEditPeopleInfo(); f.ShowDialog(); FormEmpSetting_Load(null, e); }