Пример #1
0
        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();
        }
Пример #2
0
        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();
        }
Пример #3
0
        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();
        }
Пример #4
0
 public void updatepaymnt(payment paym, customer cust)
 {
     hrsda.updatepaymnt(paym, cust);
 }
Пример #5
0
 public List <payment> getpaymnt(payment pay)
 {
     return(hrsda.getpaymnt(pay));
 }
Пример #6
0
 public void rm_service(payment pay, int total)
 {
     hrsda.rm_service(pay, total);
 }
Пример #7
0
 public void addpayment(customer cus, booking bk, payment pay)
 {
     hrsda.addpayment(cus, bk, pay);
 }
Пример #8
0
 public payment makebill(payment pay)
 {
     return(hrsda.makebill(pay));
 }