public ActionResult ShowAll() //ShowAllPage { List <BookingModel> allBookings; using (var database = new LogicLL()) { allBookings = mapper.Map <List <BookingModel> >(database.GetAllBookings()).ToList(); } return(View(allBookings)); }
//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 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()); }