示例#1
0
        public async Task <OrderInventory> AddOrderInventoryAsync(OrderInventory orderInventory)
        {
            _dbContext.OrderInventory.Add(orderInventory);
            await _dbContext.SaveChangesAsync();

            return(orderInventory);
        }
示例#2
0
    public OrderInventoryForm(Model model, OrderInventory item, bool newItem)
    {
      _model   = model;
      _item    = item;
      _newItem = newItem;

      InitializeComponent();

      _sequenceId.Text = _item.SequenceId.ToString();
      Inventory inventory = _model.GetInventory(_item.InventoryId);
      _inventory.Text = inventory != null ? inventory.DisplayString : string.Empty;
      _quantity.Text = _item.InventoryQuantity.ToString();
      _price.Text    = _item.InventoryPrice.ToString();
      _date.Value    = _item.InventoryDate;
    }
示例#3
0
 public bool OrderInventoryUpdate(OrderInventory item)
 {
   using (DbManager db = new DbManager())
     return new OrderInventoryAccessor().Update(db, item);
 }
示例#4
0
 public bool OrderInventoryInsert(OrderInventory item)
 {
   using (DbManager db = new DbManager())
     return new OrderInventoryAccessor().Insert(db, item);
 }
        public OrderInvoiceViewModel CreateOrderInvoiceViewModel(CustomUser user, Product product, OrderInventory oInv)
        {
            OrderInvoiceViewModel ivm = new OrderInvoiceViewModel()
            {
                Id         = user.Id,
                OrderId    = oInv.OrderId,
                LocationId = user.DefaultStore,
                Product    = product,
                Quantity   = oInv.OrderQuantity,
                LineTotal  = oInv.OrderQuantity * product.Price
            };

            return(ivm);
        }
示例#6
0
 public GridItem(OrderInventory item, string name)
 {
   _name = name;
   _item = item;
 }
示例#7
0
 private void Edit(OrderInventory item)
 {
   using (OrderInventoryForm form = new OrderInventoryForm(_model, item, false))
   {
     if (form.ShowDialog() != DialogResult.OK)
       item.RejectChanges();
     else
       SetAllTotal();
   }
 }