Exemple #1
0
 public Bill GetBill(Guid bookingId)
 {
     using (var context = new BillingContext())
     {
         return(context.Bills.FirstOrDefault(b => b.BookingId == bookingId));
     }
 }
Exemple #2
0
 public Bill RemoveBill(Guid billId)
 {
     using (var context = new BillingContext())
     {
         var bill = context.Bills.Remove(context.Bills.FirstOrDefault(b => b.Id == billId));
         context.SaveChanges();
         return(bill);
     }
 }
Exemple #3
0
 public Bill AddBill(decimal price, string requisites, Guid bookingId)
 {
     using (var context = new BillingContext())
     {
         var bill = context.Bills.Add(new Bill()
         {
             Price = price, Requisites = requisites, BookingId = bookingId
         });
         context.SaveChanges();
         return(bill);
     }
 }