Example #1
0
        // 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));
        }
Example #2
0
 // 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"));
     }
 }
Example #3
0
 // 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"));
     }
 }
Example #4
0
 // GET: api/Tables
 public List <ITableModel> Get()
 {
     return(tableData.GetAll());
 }
Example #5
0
 // GET: api/Products
 public List <IProductModel> Get()
 {
     return(productData.GetAll());
 }