public async Task <JsonResult> AddBills(CreateBillDto bill) { try { if (string.IsNullOrEmpty(bill.CreatorUser)) { bill.CreatorUser = "******"; } await _billAppService.CreatBill(bill); return(Json(new { result = true, data = "success" }, JsonRequestBehavior.AllowGet)); } catch (Exception e) { return(Json(new { result = false, data = e.Message }, JsonRequestBehavior.AllowGet)); } }
public async Task CreatBill(CreateBillDto input) { var bill = ObjectMapper.Map <Bill>(input); await _billRepository.InsertAsync(bill); }