// Menu where is the list of all areas with its corresponding tables public ActionResult Tables() { try { // Joining list of areas and tables to a single model mainPageModel.Areas = areaData.GetAll().OrderBy(x => x.Name).ToList(); mainPageModel.Tables = tableData.GetAll().OrderBy(x => x.NumberOfTable).ToList(); } catch (Exception ex) { log.Error("Could't load areas or tables from Database", ex); return(View("ErrorRetriveData")); } return(View(mainPageModel)); }
// Lists all products public ActionResult Index() { try { return(View(productData.GetAll().OrderBy(x => x.Name))); } catch (Exception ex) { log.Error("Could't load products from Database", ex); return(View("ErrorRetriveData")); } }
// Lists all tables public ActionResult Index() { try { return(View(tableData.GetAll().OrderBy(x => x.NumberOfTable))); } catch (Exception ex) { log.Error("Could't load tables from Database", ex); return(View("ErrorRetriveData")); } }
// GET: api/Tables public List <ITableModel> Get() { return(tableData.GetAll()); }
// GET: api/Products public List <IProductModel> Get() { return(productData.GetAll()); }