public ActionResult ManageProducts(int?ID) { List <ProductType> Producttypes = ProductTypeDA.GetAll(); if (ID == null) { } else { } return(View(Producttypes)); }
public ProductType Get(int nProductTypeID, int nUserID) { Connection.Open(); Command.CommandText = ProductTypeDA.Get(nProductTypeID, nUserID); SqlDataReader reader = Command.ExecuteReader(); ProductType _oProductType = new ProductType(); if (reader.HasRows) { _oProductType = MakeObject(reader); } reader.Close(); Connection.Close(); return(_oProductType); }
public List <ProductType> Gets(string sSQL, int nBUID, int nUserID) { Connection.Open(); Command.CommandText = ProductTypeDA.Gets(sSQL, nBUID, nUserID); SqlDataReader reader = Command.ExecuteReader(); ProductType _oProductType = new ProductType(); List <ProductType> _oProductTypes = new List <ProductType>(); if (reader.HasRows) { _oProductTypes = MakeObjects(reader); } reader.Close(); Connection.Close(); return(_oProductTypes); }
public string Delete(ProductType oProductType, int nUserID) { string sReturnMessage = ""; Connection.Open(); Command.CommandText = ProductTypeDA.IUD(oProductType, EnumDBOperation.Delete, nUserID); try { Command.ExecuteNonQuery(); } catch (Exception e) { sReturnMessage = e.Message.Split('~')[0]; } Connection.Close(); return(sReturnMessage); }
public ProductType IUD(ProductType oProductType, EnumDBOperation eDBAction, int nUserID) { Connection.Open(); Command.CommandText = ProductTypeDA.IUD(oProductType, eDBAction, nUserID); SqlDataReader reader = Command.ExecuteReader(); ProductType _oProductType = new ProductType(); if (reader.HasRows) { _oProductType = MakeObject(reader); } reader.Close(); Connection.Close(); return(_oProductType); }
public ActionResult DeleteProductType(ProductType P) { ProductTypeDA.Delete(P.ID); return(RedirectToAction("ManageProductTypes")); }
public ActionResult AddProductType(ProductType Ptype) { ProductTypeDA.Add(Ptype); return(RedirectToAction("ManageProductTypes")); }
public ActionResult ManageProductTypes() { List <ProductType> Ptypes = ProductTypeDA.GetAll(); return(View(Ptypes)); }
public ActionResult ItemsPartial(int ID) { ViewBag.TypeName = ProductTypeDA.GetSingle(ID).Name; return(PartialView("~/Views/Home/Partials/ItemsPartial.cshtml", ProductDA.GetAllByType(ID))); }
public ActionResult Index() { return(View(ProductTypeDA.GetAll())); }