public void InsertRoom(Room room) { room.StatusId = 1; room.Active = true; dbContext.Rooms.Add(room); dbContext.SaveChanges(); }
public void InsertOutlet(Outlet outlet) { outlet.ControlId = dbContext.Controls.Select(n => n.Id).First(); outlet.Active = true; dbContext.Outlets.Add(outlet); dbContext.SaveChanges(); }
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(); }
public int InsertGuest(Guest guest) { try { dbContext.Guests.Add(guest); dbContext.SaveChanges(); return(guest.Id); } catch (Exception) { throw; } }
public void InsertControl(Control control) { dbContext.Controls.Add(control); dbContext.SaveChanges(); }
public void InsertFloor(Floor floor) { floor.Active = true; dbContext.Floors.Add(floor); dbContext.SaveChanges(); }
public void CreateCheckIn(CheckIn checkIn) { dbContext.CheckIns.Add(checkIn); dbContext.SaveChanges(); }