private void EditUser() { if (listView1.SelectedItems.Count > 0) { ListViewItem item = listView1.SelectedItems[0]; string id = item.SubItems[0].Text; Smmuser data = UserService.GetOneByKey(id); using (FrmPersonEdit dlg = new FrmPersonEdit()) { dlg.DataObject = data; if (dlg.ShowDialog() == DialogResult.OK) { UserService.Update(data); Retrieve(); } } } }
/// <summary> /// �����û� /// </summary> private void AddUser() { using (FrmPersonEdit dlg = new FrmPersonEdit()) { if (dlg.ShowDialog() == DialogResult.OK) { UserService.Create(dlg.DataObject); Retrieve(); } } }