public void paid(record rcd) { hrs.records.Add(rcd); hrs.SaveChanges(); customer custm = hrs.customers.Where(x => (x.cnic == rcd.CNIC_)).FirstOrDefault(); payment pay = hrs.payments.Where(x => (x.cust_id == custm.cust_id)).FirstOrDefault(); booking bk = hrs.bookings.Where(x => (x.Booking_id == pay.Booking_id)).FirstOrDefault(); bk.room.status = "unreserved"; hrs.SaveChanges(); hrs.bookings.Remove(bk); hrs.payments.Remove(pay); hrs.customers.Remove(custm); hrs.SaveChanges(); }
public void deletebooking(customer cust) { customer custme = hrs.customers.Where(x => (x.cust_id == cust.cust_id)).FirstOrDefault(); booking bok = hrs.bookings.Where(x => (x.Booking_id == cust.booking_id)).FirstOrDefault(); System.Console.WriteLine(bok.booking_date); System.Console.WriteLine(bok.Booking_id); System.Console.WriteLine(bok.cust_id); System.Console.WriteLine(bok.Room_); System.Console.WriteLine(bok.leave_date); payment py = hrs.payments.Where(x => (x.cust_id == cust.cust_id)).FirstOrDefault(); hrs.customers.Remove(custme); hrs.SaveChanges(); hrs.bookings.Remove(bok); hrs.payments.Remove(py); hrs.SaveChanges(); }
public void rm_service(payment pay, int total) { payment pays = hrs.payments.Where(x => (x.booking.Room_ == pay.booking.Room_)).FirstOrDefault(); if (pays.room_service == null) { pay.room_service = total; pays.room_service = pay.room_service; } else { int?ppp = pays.room_service; int amnt = total + ppp ?? default(int); Console.WriteLine(amnt); pay.room_service = amnt; Console.WriteLine(pay.room_service); pays.room_service = pay.room_service; } // hrs.Entry(pays).CurrentValues.SetValues(pay.room_service); hrs.SaveChanges(); }
public void updatepaymnt(payment paym, customer cust) { hrsda.updatepaymnt(paym, cust); }
public List <payment> getpaymnt(payment pay) { return(hrsda.getpaymnt(pay)); }
public void rm_service(payment pay, int total) { hrsda.rm_service(pay, total); }
public void addpayment(customer cus, booking bk, payment pay) { hrsda.addpayment(cus, bk, pay); }
public payment makebill(payment pay) { return(hrsda.makebill(pay)); }