Ejemplo n.º 1
0
 public ActionResult NewProduct()
 {
     using (DBAgent.DBAgent agent = new DBAgent.DBAgent())
     {
         ViewBag.categories = agent.GetProdCategories();
     }
     return(View());
 }
Ejemplo n.º 2
0
 public ActionResult EditProduct(string name, int ID, int?price, int?categoryID, int?salary)
 {
     using (DBAgent.DBAgent agent = new DBAgent.DBAgent())
     {
         ViewBag.categories = agent.GetProdCategories();
         ViewBag.ID         = ID;
         ViewBag.product    = new Product
         {
             ID         = ID,
             name       = name,
             price      = price,
             categoryID = categoryID,
             salary     = salary
         };
         ViewBag.method = "EditProduct";
     }
     return(View("NewProduct"));
 }