示例#1
0
        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();
                    }
                }
            }
        }
示例#2
0
        /// <summary>
        /// �����û�
        /// </summary>
        private void AddUser()
        {
            using (FrmPersonEdit dlg = new FrmPersonEdit()) {

                if (dlg.ShowDialog() == DialogResult.OK) {

                    UserService.Create(dlg.DataObject);
                    Retrieve();
                }
            }
        }