public IActionResult Edit(int?id) { if (id.HasValue) { var item = Map(_billingContext.GetCustomer(id.Value)); return(View(item)); } return(Index()); }
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, }); }