Esempio n. 1
0
 public ActionResult ListProducts()
 {
     if (IsActiveSession())
     {
         var data = ProductProcessor.LoadProductsAdmin();
         List <ProductModel> products = new List <ProductModel>();
         foreach (var row in data)
         {
             products.Add(new ProductModel
             {
                 Id            = row.Id,
                 ProductCode   = row.ProductCode,
                 Description   = row.Description,
                 UnitOfMeasure = row.UnitOfMeasure,
                 Category      = row.Category,
                 Price         = row.Price,
                 ImageTitle    = row.ImageTitle,
                 ImagePath     = row.ImagePath,
                 IsActive      = row.IsActive
             });
         }
         return(View(products));
     }
     return(RedirectToAction("Login", "Login", null));
 }