public ActionResult ShowAllPage() { List <ClientModel> list; using (var database = new LogicLL()) list = mapper.Map <List <ClientModel> >(database.GetAllClients()); return(View(list)); }
public ActionResult ShowAll() { List <HolidayListModel> holidays; using (var database = new LogicLL()) holidays = mapper.Map <List <HolidayListModel> >(database.GetAllHolidayList()); return(View(holidays)); }
public ActionResult CreatePageName() { List <ClientModel> allClients; using (var database = new LogicLL()) allClients = mapper.Map <List <ClientModel> >(database.GetAllClients()); ViewData["AllClients"] = allClients; return(View(allClients)); }
public ActionResult EditPrice(Guid id) { RoomPriceModel roomPrice; using (var database = new LogicLL()) roomPrice = (mapper.Map <List <RoomPriceModel> >(database.GetAllRoomPrice())) .Where(x => x.Id == id).Single(); return(View(roomPrice)); }
public ActionResult Delete(Guid id) //DeletePage { HolidayListModel holiday; using (var database = new LogicLL()) holiday = (mapper.Map <List <HolidayListModel> >(database.GetAllHolidayList())) .Where(x => x.Id == id) .First(); return(View(holiday)); }
public ActionResult ShowAll() //ShowAllPage { List <BookingModel> allBookings; using (var database = new LogicLL()) { allBookings = mapper.Map <List <BookingModel> >(database.GetAllBookings()).ToList(); } return(View(allBookings)); }
public ActionResult EditPage(Guid id) { ClientModel client; using (var database = new LogicLL()) client = (mapper.Map <List <ClientModel> >(database.GetAllClients())) .Where(x => x.Id == id) .First(); return(View(client)); }
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)); }
//TODO: public ActionResult Invoice(Guid id)//InvoiceClient { InvoiceModel invoice; using (var database = new LogicLL()) invoice = (mapper.Map <List <BookingModel> >(database.GetAllBookings())) .Where(x => x.Id == id) .Select(x => x.Invoice) .First(); return(View(invoice)); }
//TODO: public ActionResult HistoryClient(Guid id) { List <BookingModel> bookingHistory = new List <BookingModel>(); using (var database = new LogicLL()) { bookingHistory = (mapper.Map <List <BookingModel> >(database.GetAllBookings())) .Where(x => x.Client.Id == id).ToList(); } return(View(bookingHistory)); }
public ActionResult SavePrice(RoomPriceModel roomPrice) { try { using (var database = new LogicLL()) database.UpdateRoomPrice(mapper.Map <RoomPriceLL>(roomPrice)); return(RedirectToAction("ShowAvailablePage")); } catch (Exception ex) { return(View()); } }
public ActionResult Create(HolidayListModel holiday) //CreateHoliday { try { using (var database = new LogicLL()) database.AddHoliday(mapper.Map <HolidayListLL>(holiday)); return(RedirectToAction(nameof(ShowAll))); } catch (Exception ex) { return(View()); } }
public ActionResult SaveClient(ClientModel client) { try { using (var database = new LogicLL()) database.UpdateClient(mapper.Map <ClientLL>(client)); return(RedirectToAction("ShowAllPage")); } catch { return(View()); } }
public ActionResult Delete(HolidayListModel holiday) //DeletePage { try { using (var database = new LogicLL()) database.RemoveHoliday(holiday.Id); return(RedirectToAction(nameof(ShowAll))); } catch { return(View()); } }
public ActionResult SearchPage(string searchString) { if (String.IsNullOrWhiteSpace(searchString)) { return(RedirectToAction("SearchPage")); } List <ClientModel> output; using (var database = new LogicLL()) output = mapper.Map <List <ClientModel> >(database.GetAllClients()); output.Where(x => JsonConvert.SerializeObject(x).Contains(searchString)); return(View(output)); }
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()); } }
public ActionResult CreatePage(string id) { BookingModel booking; using (var database = new LogicLL()) { database.AddBooking(mapper.Map <BookingLL>(new BookingModel())); booking = mapper.Map <BookingModel>(database.GetAllBookings().Last()); } //clients = mapper.Map<List<ClientModel>>(database.GetAllClients()); //List<string> clientNames = new List<string>(); //foreach (var cl in clients) // clientNames.Add(cl.ClientFullName); //ViewData["ClientList"] = clientNames; return(View()); }