Ejemplo n.º 1
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();
         }
     }
 }
Ejemplo n.º 2
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();
         }
     }
 }
Ejemplo n.º 3
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);
     }
 }
Ejemplo n.º 4
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);
            }
        }
Ejemplo n.º 5
0
 public static List <Login> GetDataTable(string username, string password)
 {
     try
     {
         List <Login> lst = null;
         using (HotelBookingsEntities db = new HotelBookingsEntities())
         {
             lst = (from u in db.Logins where u.username == username && u.password == password select u).ToList();
             return(lst);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }