Exemplo n.º 1
0
        public ActionResult ShowAllPage()
        {
            List <RoomModel> list;

            using (var database = new LogicLL())
                list = mapper.Map <List <RoomModel> >(database.GetAllRooms())
                       .OrderBy(i => i.RoomNumber)
                       .ToList();

            return(View(list));
        }
Exemplo n.º 2
0
        public ActionResult EditPage(Guid id)
        {
            RoomModel room;

            using (var database = new LogicLL())
                room = (mapper.Map <List <RoomModel> >(database.GetAllRooms()))
                       .Where(i => i.Id == id)
                       .First();

            return(View(room));
        }
Exemplo n.º 3
0
 public ActionResult CreateRoom(RoomModel room)
 {
     try
     {
         using (var database = new LogicLL())
         {
             database.AddRoom(mapper.Map <RoomLL>(room));
             room = mapper.Map <List <RoomModel> >(database.GetAllRooms())
                    .ToList().Last();
             room.RoomPrice.RoomId = room.Id;
         }
         return(RedirectToAction("PricePage", room.RoomPrice)); //PricePage
     }
     catch (Exception ex)
     {
         return(View());
     }
 }