Beispiel #1
0
 public static void InsertAddress(Customeraddress insertadd)
 {
     using (HotelBookingsEntities db = new HotelBookingsEntities())
     {
         db.Customeraddresses.Add(insertadd);
         db.SaveChanges();
     }
 }
Beispiel #2
0
 public static void InsertRoomsBooked(checkout checkoutdetails)
 {
     using (HotelBookingsEntities db = new HotelBookingsEntities())
     {
         db.checkouts.Add(checkoutdetails);
         db.SaveChanges();
     }
 }
Beispiel #3
0
 public static void InsertRoomDetails(Room Roomsdetails)
 {
     using (HotelBookingsEntities db = new HotelBookingsEntities())
     {
         db.Rooms.Add(Roomsdetails);
         db.SaveChanges();
     }
 }
Beispiel #4
0
 public static int SaveCusRegistration(CustomerRegestration insertCusreg)
 {
     using (HotelBookingsEntities db = new HotelBookingsEntities())
     {
         db.CustomerRegestrations.Add(insertCusreg);
         db.SaveChanges();
         return(insertCusreg.CustomerID);
     }
 }
Beispiel #5
0
 public static void DeleteRoom(object selectedValue)
 {
     using (HotelBookingsEntities db = new HotelBookingsEntities())
     {
         Room c = db.Rooms.SingleOrDefault(x => x.Room_id.ToString().Trim() == selectedValue.ToString().Trim());
         if (c != null)
         {
             db.Rooms.Remove(c);
             db.SaveChanges();
         }
     }
 }
Beispiel #6
0
 public static void DeleteRecord(string insertCusreg)
 {
     using (HotelBookingsEntities db = new HotelBookingsEntities())
     {
         CustomerRegestration c = db.CustomerRegestrations.SingleOrDefault(x => x.CustomerID.ToString().Trim() == insertCusreg.Trim());
         if (c != null)
         {
             db.CustomerRegestrations.Remove(c);
             db.SaveChanges();
         }
     }
 }
Beispiel #7
0
 public static int UpdateRoomDetails(Room insertCusreg)
 {
     using (HotelBookingsEntities db = new HotelBookingsEntities())
     {
         //Lembda expression
         Room c = db.Rooms.SingleOrDefault(x => x.Room_id == insertCusreg.Room_id);
         c.Roomno = insertCusreg.Roomno;
         c.Beds   = insertCusreg.Beds;
         c.Floor  = insertCusreg.Floor;
         c.Type   = insertCusreg.Type;
         db.SaveChanges();
         return(insertCusreg.Room_id);
     }
 }
Beispiel #8
0
        public static int UpdateCusRegistration(CustomerRegestration insertCusreg)
        {
            using (HotelBookingsEntities db = new HotelBookingsEntities())
            {
                //Lembda expression

                CustomerRegestration c = db.CustomerRegestrations.SingleOrDefault(x => x.CustomerID == insertCusreg.CustomerID);
                c.FirstNAME = insertCusreg.FirstNAME;
                c.LastNAME  = insertCusreg.LastNAME;
                c.EMAILID   = insertCusreg.EMAILID;
                c.PHONE     = insertCusreg.PHONE;
                db.SaveChanges();
                return(insertCusreg.CustomerID);
            }
        }