public ProductCategoryShould() { _productCategoryManager = new ProductCategoryManager(); _productCategory = new ProductCategory() { CategoryName = "Shoes" }; }
public ContentResult GetProductCategoryList() { List <ProductCategory> list = new ProductCategoryManager().GetAllProductCategorys(); string jsonObj = getJsonByObject(list); return(base.Content(jsonObj)); }
public ActionResult ModifyProductCategory(ProductCategory category) { category.ModifyTime = DateTime.Now; int ret = new ProductCategoryManager().UpdateProductCategory(category); return(RedirectToRoute("Admin_route3", new { controller = "Home", action = "ProductCategory" })); }
public ActionResult ProductCategoryExists(string CategoryName) { bool ret = new ProductCategoryManager().ProductCategoryExists(CategoryName); message msg = new message(); msg.valid = !ret; return(Json(msg, JsonRequestBehavior.AllowGet)); }
public ActionResult EnableProductCategory() { string id = Request.Params["id"].ToString(); int ret = new ProductCategoryManager().EnableProductCategory(id); int state = new ProductCategoryManager().GetProductCategoryState(id); return(base.Content(state.ToString())); }
public ContentResult GetProductCategoryDetail() { string id = Request.Params["id"].ToString(); ProductCategory category = new ProductCategoryManager().GetProductCategoryDetail(id); string objJson = getJsonByObject(category); return(base.Content(objJson)); }
public ActionResult ProductCategory() { List <ProductCategory> categoryList = new List <ProductCategory>(); categoryList = new ProductCategoryManager().GetAllProductCategorys(); ViewBag.categoryList = categoryList; return(View("ProductCategory")); }
public ActionResult addProductCategory(ProductCategory category) { category.CategoryId = new Common().getGUID(); DateTime dt = DateTime.Now; category.CreateTime = dt; category.ModifyTime = dt; category.Enable = 0; int ret = new ProductCategoryManager().InsertProductCategory(category); return(RedirectToRoute("Admin_route3", new { controller = "Home", action = "ProductCategory" })); }
public ActionResult GetProductCategorysByName() { List <ProductCategory> categoryList = new List <ProductCategory>(); if (Request.Params["name"] == null) { return(RedirectToRoute("Admin_route3", new { controller = "Home", action = "ProductCategory" })); } else { string name = Request.Params["name"].ToString(); categoryList = new ProductCategoryManager().GetProductCategorys(name); ViewBag.categoryList = categoryList; return(View("ProductCategory")); } }
public ActionResult DeleteProductCategory() { string id = Request.Params["id"].ToString(); id = id.Trim(); int ret = 0; if (id != null && string.Empty != id) { ret = new ProductCategoryManager().DeleteProductCategoryById(id); } if (ret <= 0) { return(base.Content("False")); } else { return(base.Content("True")); } }
public void GetAll() { System.Diagnostics.Stopwatch stopWatch = new System.Diagnostics.Stopwatch(); stopWatch.Start(); using (ProductCategoryManager mgr = new ProductCategoryManager()) { try { DataCollection = mgr.GetAll(); RowsAffected = mgr.RowsAffected; ResultText = "Rows Affected: " + RowsAffected.ToString(); } catch (Exception ex) { PublishException(ex); } } stopWatch.Stop(); // Get the elapsed time as a TimeSpan value. TimeSpan ts = stopWatch.Elapsed; // Format and display the TimeSpan value. ResultText += " - RunTime " + String.Format("{0:00}:{1:00}:{2:00}.{3:00}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds / 10); Console.WriteLine(ResultText); }
public static List <ProductCategory> GetProductCategories() { ProductCategoryManager aManager = new ProductCategoryManager(); return(aManager.GetAll().ToList()); }
public int ManageProductCategory(int id, int action) { var productCategoryManager = new ProductCategoryManager(); return(productCategoryManager.ManageProductCategory(id, action)); }
public IList <ProductCategory> GetAllProductCategories() { var productCategoryManager = new ProductCategoryManager(); return(productCategoryManager.GetAllProductCategories().Select(p => p.ToServiceProductCategory()).ToList()); }
public ActionResult GetProductCategory() { return(Json(ProductCategoryManager.GetProductCategory(), JsonRequestBehavior.AllowGet)); }
public ActionResult ProductCategoryUpd(ProductCategory pro) { return(Json(ProductCategoryManager.ProductCategoryUpd(pro), JsonRequestBehavior.AllowGet)); }
public ActionResult ProductCategoryByPcid(int Pcid) { return(Json(ProductCategoryManager.ProductCategoryByPcid(Pcid), JsonRequestBehavior.AllowGet)); }
public int CreateOrUpdateProductCategory(ProductCategory productCategory) { var productCategoryManager = new ProductCategoryManager(); return(productCategoryManager.CreateOrUpdateProductCategory(productCategory.ToDALProductCategory())); }
public ProductCategory GetProductCategoryById(int id) { var productCategoryManager = new ProductCategoryManager(); return(productCategoryManager.GetProductCategoryById(id).ToServiceProductCategory()); }
public UpdateProductCategoryUI() { categoryManager = new ProductCategoryManager(); }
public static IEnumerable <ProductCategories> GetProductCategories() { ProductCategoryManager _categoryManager = new ProductCategoryManager(); return(_categoryManager.GetAllProductCategories(1, false)); }
public ActionResult ProductCategoryList(int PageIndex, int PageSize, string PcName) { return(Json(ProductCategoryManager.ProductCategoryList(PageIndex, PageSize, PcName), JsonRequestBehavior.AllowGet)); }