Пример #1
0
        protected override void AddRow()
        {
            User user        = new User();
            var  frmUserEdit = new UserEditEx(user, true);

            frmUserEdit.ShowDialog();
            if (frmUserEdit.DialogResult == DialogResult.Cancel)
            {
                return;
            }
            DataService.context.Users.Add(user);


            Save();
        }
Пример #2
0
        protected override void EditRow()
        {
            if (tblUsers.SelectedCells.Count <= 0)
            {
                return;
            }
            User user        = _context.Users.Find(tblUsers.Rows[tblUsers.CurrentCell.RowIndex].Cells["colId"].Value);
            var  frmUserEdit = new UserEditEx(user, false);

            frmUserEdit.ShowDialog();
            if (frmUserEdit.DialogResult == DialogResult.Cancel)
            {
                return;
            }

            Save();
        }