private void CreateStockFromSale(object parameter) { var header = Terminal.Instance.Session[typeof (SaleHeader)].Value as SaleHeader; var stockNew = new StockHeader(StockType.Types.Modify,Terminal.Instance.Code); foreach (SaleItem item in header.SaleItems) { stockNew.AddNewStockItem(item.Product,item.Quantity,item.Batch); } //BusinessContext.Instance.Model.AddToStockHeaders(stockNew); }
public CreateStockViewModel(StockType.Types stockType) : base(new CreateStockView()) { _stockType = stockType; StockHeader = new StockHeader(_stockType, Terminal.Instance.Code); if (_stockType == StockType.Types.New) { ViewHeader = "Alta de Stock"; OpenDeliveryDocumentSelectionView(); } else { ViewHeader = "Baja de Stock"; OpenReturnReasonSelectionView(); } }
/// <summary> /// Create a new StockHeader object. /// </summary> /// <param name="terminalCode">Initial value of the TerminalCode property.</param> /// <param name="code">Initial value of the Code property.</param> /// <param name="terminalToCode">Initial value of the TerminalToCode property.</param> /// <param name="date">Initial value of the Date property.</param> public static StockHeader CreateStockHeader(global::System.Int32 terminalCode, global::System.Int32 code, global::System.Int32 terminalToCode, global::System.DateTime date) { StockHeader stockHeader = new StockHeader(); stockHeader.TerminalCode = terminalCode; stockHeader.Code = code; stockHeader.TerminalToCode = terminalToCode; stockHeader.Date = date; return stockHeader; }
/// <summary> /// Deprecated Method for adding a new object to the StockHeaders EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToStockHeaders(StockHeader stockHeader) { base.AddObject("StockHeaders", stockHeader); }