예제 #1
0
 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();
     }
 }
예제 #2
0
        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();
        }
예제 #3
0
        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();
        }
예제 #4
0
 public ShipmentElementEdit(ShipmentElement shipmentElement)
 {
     InitializeComponent();
     _shipmentElement = shipmentElement;
     _context         = DataService.context;
 }