Пример #1
0
        public IActionResult Edit(int?id)
        {
            if (id.HasValue)
            {
                var item = Map(_billingContext.GetCustomer(id.Value));

                return(View(item));
            }
            return(Index());
        }
Пример #2
0
 private Bill GetBill(BillCreateJsonModel billViewModel)
 {
     return(new Bill
     {
         Date = billViewModel.BillDate,
         OutStandingAmount = billViewModel.Items.Sum(t => t.TotalPrice),
         Shop = _billingContext.GetCustomer(billViewModel.CustomerId),
         TotalQuantity = billViewModel.Items.Sum(i => i.Quantity),
         TotalPrice = billViewModel.Items.Sum(t => t.TotalPrice),
         ShopCustomerId = billViewModel.CustomerId,
     });
 }