public ActionResult Bill(int id, CreateBillInput billInput, int ActivityId) { var dealer = _dealerAppService.GetDealer(id); if (dealer != null) { var activities = _dealerActivityAppService.GetDealerActivities(dealer); var revenue = _revenueSourceAppService.GetRevenueResource(ActivityId); //Dealer Registration Bill int bill = _billAppService.CreateBill(billInput); if (bill > 0) { foreach (var activity in activities) { var item = new CreateBillItemInput { BillId = bill, ActivityId = ActivityId, Description = revenue.Description, Loyality = activity.Activity.Fee + activity.Activity.RegistrationFee, Total = activity.Activity.Fee + activity.Activity.RegistrationFee }; _billItemAppService.CreateBillItem(item); _dealerAppService.UpdateBillControlNumber(dealer, _billAppService.GetBill(bill).ControlNumber); } } return(RedirectToAction("ApplicationBill", "DealerActivities", new { id = bill })); } return(RedirectToAction("Create", new { id = dealer.Id })); }
// GET: Bills/confirm/5 public ActionResult Details(int id) { var bill = new BillItemModel { Bill = _billAppService.GetBill(id), Items = _billItemAppService.GetBillItems(_billAppService.GetBill(id)) }; return(View(bill)); }
public async Task <IActionResult> Detail(int id) { var bill = await _billAppService.GetBill(id); if (bill != null) { var billDetails = await _billAppService.GetBillDetails(id); var model = new DeatailViewModel { Bill = bill, BillDetails = billDetails }; if (bill.ObjectId != null) { var exchangeObject = await _exchangeObjectAppService.GetForEditByIdAsync(bill.ObjectId.Value); if (exchangeObject.ObjectType == (int)EnumObjectType.道) { return(View("InsideDetail", model)); } } switch (bill.Type) { case EnumListType.收件清单: return(View("ReceiveDetail", model)); case EnumListType.发件清单: return(View("SendDetail", model)); case EnumListType.收发清单: return(View("ReceiveSendDetail", model)); default: throw new ArgumentOutOfRangeException($"清单类型无效"); } } throw new ArgumentOutOfRangeException($"无效清单"); }
// GET: Bills/confirm/5 public ActionResult Confirm(int id) { var bill = _billAppService.GetBill(id); return(View(bill)); }