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(); }
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(); }