protected override void DelRow() { if (MessageBox.Show("Удалить запись?", "Подтверждение удаления", MessageBoxButtons.OKCancel) == DialogResult.OK) { ShipmentElement shipmentElement = _context.ShipmentElements.Find(tblElements.Rows[tblElements.CurrentCell.RowIndex].Cells["colId"].Value); _context.ShipmentElements.Remove(shipmentElement); Save(); } }
protected override void AddRow() { ShipmentElement shipmentElement = new ShipmentElement(); var frmShipmentElementEdit = new ShipmentElementEdit(shipmentElement); frmShipmentElementEdit.ShowDialog(); if (frmShipmentElementEdit.DialogResult == DialogResult.Cancel) { return; } _context.ShipmentElements.Add(shipmentElement); Save(); }
protected override void EditRow() { ShipmentElement shipmentElement = _context.ShipmentElements.Find(tblElements.Rows[tblElements.CurrentCell.RowIndex].Cells["colId"].Value); var frmTimeSlotEdit = new ShipmentElementEdit(shipmentElement); frmTimeSlotEdit.ShowDialog(); if (frmTimeSlotEdit.DialogResult == DialogResult.Cancel) { return; } Save(); }
public ShipmentElementEdit(ShipmentElement shipmentElement) { InitializeComponent(); _shipmentElement = shipmentElement; _context = DataService.context; }