public ActionResult EditPaymentBill(int paymentBillId) { var viewModel = new PaymentBillViewModel(); var result = paymentBillService.GetSinglePaymentBillById(paymentBillId); viewModel = ViewModelMapper.Mapper.Map <PaymentBillViewModel>(result); return(View(viewModel)); }
public ActionResult AddPaymentBill(int rentalId) { var viewModel = new PaymentBillViewModel() { id_wynajem = rentalId, id_faktury = -1 //This is a brand new payment so there's no id. }; return(View("EditPaymentBill", viewModel)); }
public void ConfirmPaymentBillEdit(int rentalId, int paymentBillId, float paymentBillValue, DateTime paymentBillDate, int paymentBillNumber) { var viewModel = new PaymentBillViewModel() { id_wynajem = rentalId, cena = paymentBillValue, data_platnosci = paymentBillDate, id_faktury = paymentBillId, numer_faktury = paymentBillNumber }; paymentBillService.AddOrEditPaymentBill(ViewModelMapper.Mapper.Map <PaymentBillModel>(viewModel)); }
public IActionResult CloseBill([FromBody] PaymentBillViewModel paymentBill) { var bill = _service.GetById(paymentBill.BillId); if (bill == null) { return(NotFound(false)); } if (!Enum.GetValues(typeof(PaymentMethod)).Cast <PaymentMethod>().Any(m => m.Equals(paymentBill.PaymentMethod))) { return(NotFound(false)); } return(Ok(_service.CloseBill(bill, paymentBill.PaymentMethod))); }