/// <summary> /// 修改用户 /// </summary> private void EditUser() { string currentuser = MIS.UserNumber; string id = treeView1.SelectedNode.Name; if (currentuser != "admin" && currentuser != id) { MessageBox.Show("您无权进行此操作!"); return; } Smmuser data = UserService.GetOneByKey(id); using (FrmSmmuserEdit_new dlg = new FrmSmmuserEdit_new()) { dlg.DataObject = data; dlg.UserNo = data.Userid; dlg.UserName = data.UserName; dlg.currentuser = currentuser; if (dlg.ShowDialog() == DialogResult.OK) { UserService.Update(data); CreateView(); } MainForm.CurrentForm.SetStatusLabel(); } }
/// <summary> /// 增加用户 /// </summary> private void AddUser() { string currentuser = MIS.UserNumber; using (FrmSmmuserEdit_new dlg = new FrmSmmuserEdit_new()) { dlg.currentuser = currentuser; if (dlg.ShowDialog() == DialogResult.OK) { UserService.Create(dlg.DataObject); CreateView(); } } }
/// <summary> /// ���û� /// </summary> private void EditUser() { string currentuser = MIS.UserNumber; string id = treeView1.SelectedNode.Name; if (currentuser != "admin" && currentuser != id) { MessageBox.Show("����Ȩ���д˲�����"); return; } Smmuser data = UserService.GetOneByKey(id); using (FrmSmmuserEdit_new dlg = new FrmSmmuserEdit_new()) { dlg.DataObject = data; dlg.UserNo = data.Userid; dlg.UserName = data.UserName; dlg.currentuser = currentuser; if (dlg.ShowDialog() == DialogResult.OK) { UserService.Update(data); CreateView(); } MainForm.CurrentForm.SetStatusLabel(); } }
/// <summary> /// �����û� /// </summary> private void AddUser() { string currentuser = MIS.UserNumber; using (FrmSmmuserEdit_new dlg = new FrmSmmuserEdit_new()) { dlg.currentuser = currentuser; if (dlg.ShowDialog() == DialogResult.OK) { UserService.Create(dlg.DataObject); CreateView(); } } }