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)); }
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)); }
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()); } }