/// <summary> /// 增加组 /// </summary> private void AddGroup() { using (FrmSmmgroupEdit dlg = new FrmSmmgroupEdit()) { if (dlg.ShowDialog() == DialogResult.OK) { GroupService.Create <Smmgroup>(dlg.DataObject); CreateView(); } } }
/// <summary> /// 修改组 /// </summary> private void EditGroup() { string currentuser = MIS.UserNumber; if (currentuser != "admin") { MessageBox.Show("您无权进行此操作!"); return; } string id = treeView1.SelectedNode.Name; Smmgroup data = GroupService.GetOneByKey <Smmgroup>(id); using (FrmSmmgroupEdit dlg = new FrmSmmgroupEdit()) { dlg.DataObject = data; if (dlg.ShowDialog() == DialogResult.OK) { GroupService.Update <Smmgroup>(data); CreateView(); } } }
/// <summary> /// ������ /// </summary> private void AddGroup() { using (FrmSmmgroupEdit dlg = new FrmSmmgroupEdit()) { if (dlg.ShowDialog() == DialogResult.OK) { GroupService.Create<Smmgroup>(dlg.DataObject); CreateView(); } } }
/// <summary> /// ���� /// </summary> private void EditGroup() { string currentuser = MIS.UserNumber; if (currentuser != "admin") { MessageBox.Show("����Ȩ���д˲�����"); return; } string id = treeView1.SelectedNode.Name; Smmgroup data = GroupService.GetOneByKey<Smmgroup>(id); using (FrmSmmgroupEdit dlg = new FrmSmmgroupEdit()) { dlg.DataObject = data; if (dlg.ShowDialog() == DialogResult.OK) { GroupService.Update<Smmgroup>(data); CreateView(); } } }
private void EditGroup() { if (listView1.SelectedItems.Count > 0) { ListViewItem item = listView1.SelectedItems[0]; string id = item.SubItems[0].Text; Smmgroup data = GroupService.GetOneByKey<Smmgroup>(id); using (FrmSmmgroupEdit dlg = new FrmSmmgroupEdit()) { dlg.DataObject = data; if (dlg.ShowDialog() == DialogResult.OK) { GroupService.Update<Smmgroup>(data); Retrieve(); } } } }