public async Task <IActionResult> PutStockDelivery(int id, StockDelivery stockDelivery) { if (id != stockDelivery.DeliveryID) { return(BadRequest()); } _context.Entry(stockDelivery).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!StockDeliveryExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <StockDelivery> > PostStockDelivery(StockDelivery stockDelivery) { _context.StockDeliveries.Add(stockDelivery); await _context.SaveChangesAsync(); Stock stock = _context.Stocks.Single(s => s.StockID == stockDelivery.StockID); stock.DeliveryID = stockDelivery.DeliveryID; _context.Entry(stock).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!StockExists(stockDelivery.StockID)) { return(NotFound()); } else { throw; } } return(CreatedAtAction("GetStockDelivery", new { id = stockDelivery.DeliveryID }, stockDelivery)); }
public void Save_Click() { if (StockDelivery.IsValid()) { StockDelivery.EndEdit(); Display = !Display; } }
private void dataGridViewStockDeliveryMaster_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex == -1) { return; } if (e.ColumnIndex == this.ColumnStockDeliveryMasterComplete.Index) { StockDelivery stockDelivery = (dataGridViewStockDeliveryMaster.CurrentRow.DataBoundItem as StockDelivery); this.simulatorCore.StockDeliverySetCore.CompleteDelivery(stockDelivery); //update UI. this.StorageSystemSimulatorCore_StockDeliveryUpdated(this, null); } }
private void dataGridViewStockDeliveryDetail_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex == -1) { return; } if (e.ColumnIndex == this.ColumnStockDeliveryLoadPack.Index) { StockDelivery stockDelivery = (dataGridViewStockDeliveryMaster.CurrentRow.DataBoundItem as StockDelivery); StockDeliveryItem stockDeliveryItem = (dataGridViewStockDeliveryDetail.Rows[e.RowIndex].DataBoundItem as StockDeliveryItem); this.simulatorCore.StockDeliverySetCore.LoadStockDeliveryItem(stockDelivery, stockDeliveryItem); //update UI. this.StorageSystemSimulatorCore_StockDeliveryUpdated(this, null); } }
public bool LoadStockDeliveryItem(StockDelivery stockDelivery, StockDeliveryItem stockDeliveryItem) { if ((stockDelivery.State != StockDeliveryState.Queued) && ((stockDelivery.State != StockDeliveryState.InProcess))) { // delivery doesn't expect any more packs. return(false); } if ((stockDeliveryItem.RequestedQuantity <= stockDeliveryItem.ProcessedQuantity) && (stockDeliveryItem.RequestedQuantity != 0)) { // this item doesn't expect any more packs. return(false); } if (stockDelivery.State == StockDeliveryState.Queued) { stockDelivery.State = StockDeliveryState.InProcess; } stockDeliveryItem.ProcessedQuantity++; this.stock.LoadInput(stockDeliveryItem.ArticleCode, stockDeliveryItem.Name, stockDeliveryItem.DosageForm, stockDeliveryItem.PackagingUnit, stockDeliveryItem.MaxSubItemQuantity, stockDeliveryItem.BatchNumber, stockDeliveryItem.ExternalID, stockDeliveryItem.ExpiryDate, 0, // is stock delivery always for full packs ? stockDeliveryItem.MachineLocation, stockDeliveryItem.TenantID, stockDeliveryItem.StockLocationID); return(true); }
private void dataGridViewStockDeliveryMaster_RowEnter(object sender, DataGridViewCellEventArgs e) { StockDelivery stockDelivery = (dataGridViewStockDeliveryMaster.Rows[e.RowIndex].DataBoundItem as StockDelivery); dataGridViewStockDeliveryDetail.DataSource = new BindingSource(stockDelivery.Items, ""); }
public void Cancel_Click() { StockDelivery.CancelEdit(); Display = !Display; }
public void Edit_Click() { StockDelivery.BeginEdit(); Display = !Display; }
public void CompleteDelivery(StockDelivery stockDelivery) { // chould we check that all epxected pack have been loaded and set state to complete / imcomplete stockDelivery.State = StockDeliveryState.Completed; }