Ejemplo n.º 1
0
 public bool CreateBill(BillDTO bill)
 {
     return(_billRepository.CreateBill(new BillRecord
     {
         Amount = bill.OriginalAmount,
         DueDate = bill.DueDate,
         PaymentDate = bill.PaymentDate,
         Name = bill.Name
     }));
 }
Ejemplo n.º 2
0
 public bool CreateBill(HoaDon billToCreate)
 {
     if (!ValidateBill(billToCreate))
     {
         return(false);
     }
     try
     {
         _billrepository.CreateBill(billToCreate);
     }
     catch
     {
         return(false);
     }
     return(true);
 }
Ejemplo n.º 3
0
 public void CreateBillIfNotExists()
 {
     if (_view.Functionality == ReceptionFunctionalityEnum.Patient)
     {
         var bill = _billRepository.GetUnpaidBillByPatientId(_view.PatientIdSelected);
         if (bill is null)
         {
             bill = new bill()
             {
                 created_at    = DateTime.Now,
                 is_paid       = false,
                 patient_id    = _view.PatientIdSelected,
                 total_money   = 0,
                 staff_created = Program.staffId
             };
             _billRepository.CreateBill(bill);
         }
     }
 }