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($"无效清单"); }