Esempio n. 1
0
 public void InsertRoom(Room room)
 {
     room.StatusId = 1;
     room.Active   = true;
     dbContext.Rooms.Add(room);
     dbContext.SaveChanges();
 }
Esempio n. 2
0
 public void InsertOutlet(Outlet outlet)
 {
     outlet.ControlId = dbContext.Controls.Select(n => n.Id).First();
     outlet.Active    = true;
     dbContext.Outlets.Add(outlet);
     dbContext.SaveChanges();
 }
Esempio n. 3
0
 public void InsertDefaults()
 {
     foreach (var a in dbContext.Agents)
     {
         foreach (var p in dbContext.Plans)
         {
             foreach (var r in dbContext.RoomTypes)
             {
                 for (int i = 1; i <= r.Occupancy; i++)
                 {
                     var model = new Rate
                     {
                         RoomTypeId        = r.Id,
                         PlanId            = p.Id,
                         AgentId           = a.Id,
                         Occupancy         = i,
                         Amount            = 0,
                         ExtraPersonCharge = 0,
                         AgentName         = a.AgentName,
                         PlanName          = p.PlanType,
                         RoomType          = r.RoomTypeName
                     };
                     dbContext.Rates.Add(model);
                 }
             }
         }
     }
     dbContext.SaveChanges();
 }
Esempio n. 4
0
 public int InsertGuest(Guest guest)
 {
     try
     {
         dbContext.Guests.Add(guest);
         dbContext.SaveChanges();
         return(guest.Id);
     }
     catch (Exception)
     {
         throw;
     }
 }
Esempio n. 5
0
 public void InsertControl(Control control)
 {
     dbContext.Controls.Add(control);
     dbContext.SaveChanges();
 }
Esempio n. 6
0
 public void InsertFloor(Floor floor)
 {
     floor.Active = true;
     dbContext.Floors.Add(floor);
     dbContext.SaveChanges();
 }
Esempio n. 7
0
 public void CreateCheckIn(CheckIn checkIn)
 {
     dbContext.CheckIns.Add(checkIn);
     dbContext.SaveChanges();
 }