public ProductCategoryData(ProductCategoryData data) { Name = data.Name; rowguid = data.rowguid; ModifiedDate = data.ModifiedDate; Uid = data.Uid; }
public void SetChildList(long?selectId = null) { var data = new ProductCategoryData(); if (selectId != null) { ViewBag.ChildID = new SelectList(data.ListChild(selectId.Value), "ID", "Name", selectId); } }
protected override void LazySet() { base.LazySet(); if (PersistenceState == PersistenceState.NewAndChanged || PersistenceState == PersistenceState.LoadedAndChanged) { if ((object)InnerData == (object)OriginalData) { OriginalData = new ProductCategoryData(InnerData); } } }
public JsonResult GetChildListById(string selectedValue) { if (selectedValue != "") { var selectval = int.Parse(selectedValue); var cateList = new ProductCategoryData().ListChildById(selectval); return(Json(data: new { CateList = cateList, JsonRequestBehavior.AllowGet })); } else { return(Json(data: null)); } }
public int Exists(string name) { ProductCategoryData data = new ProductCategoryData(); try { return(data.Exists(name)); } catch (Exception ex) { log.Write(ex.Message, "Exists"); throw (ex); } finally { data = null; } }
public bool RemoveProductCategory(int productcategoryID) { ProductCategoryData data = new ProductCategoryData(); bool ret = false; try { ret = data.DeleteProductCategory(productcategoryID); } catch (Exception ex) { log.Write(ex.Message, "RemoveProductCategory"); throw (ex); } finally { data = null; } return(ret); }
public int AddProductCategory(ProductCategory productcategory) { ProductCategoryData data = new ProductCategoryData(); int productCateogryID = 0; try { productCateogryID = data.AddProductCategory(productcategory); } catch (Exception ex) { log.Write(ex.Message, "AddProductCategory"); throw (ex); } finally { data = null; } return(productCateogryID); }
public ProductCategoryCollection GetProductCategoryCollection(string whereExpression, string orderByExpression) { ProductCategoryData data = new ProductCategoryData(); ProductCategoryCollection col = new ProductCategoryCollection(); try { col = data.GetProductCategorysDynamicCollection(whereExpression, orderByExpression); } catch (Exception ex) { log.Write(ex.Message, "GetProductCategoryCollection"); throw (ex); } finally { data = null; } return(col); }
public ProductCategoryCollection GetAllProductCategoryCollection() { ProductCategoryData data = new ProductCategoryData(); ProductCategoryCollection col = new ProductCategoryCollection(); try { col = data.GetAllProductCategorysCollection(); } catch (Exception ex) { log.Write(ex.Message, "GetAllProductCategoryCollection"); throw (ex); } finally { data = null; } return(col); }
public DataSet GetAllProductCategoryDataSet() { ProductCategoryData data = new ProductCategoryData(); DataSet ds = new DataSet(); try { ds = data.GetAllProductCategoryDataSet(); } catch (Exception ex) { log.Write(ex.Message, "GetAllProductCategoryDataSet"); throw (ex); } finally { data = null; } return(ds); }
public ProductCategory GetProductCategory(int productCategoryID) { ProductCategoryData data = new ProductCategoryData(); ProductCategory productCategory = new ProductCategory(); try { productCategory = data.GetProductCategory(productCategoryID); } catch (Exception ex) { log.Write(ex.Message, "GetProductCategory"); throw (ex); } finally { data = null; } return(productCategory); }
public bool UpdateProductCategory(ProductCategory productcategory) { ProductCategoryData data = new ProductCategoryData(); bool ret = false; try { ret = data.UpdateProductCategory(productcategory); } catch (Exception ex) { log.Write(ex.Message, "UpdateProductCategory"); throw (ex); } finally { data = null; } return(ret); }
public DataSet GetProductCategoryDataSet(string whereExpression, string orderByExpression) { ProductCategoryData data = new ProductCategoryData(); DataSet ds = new DataSet(); try { ds = data.GetProductCategorysDynamicDataSet(whereExpression, orderByExpression); } catch (Exception ex) { log.Write(ex.Message, "GetProductCategoryDataSet"); throw (ex); } finally { data = null; } return(ds); }
public ProductCategoryData GetProductCategoryList() { ProductCategoryData objProductData = new ProductCategoryData(); try { APICall.APIData objAPIResult = APICall.CallGETAPI(CommonConfig.GetAPIEndPoint + "ProductCategory"); if (objAPIResult.isAPIResponse) { objProductData = JsonConvert.DeserializeObject <ProductCategoryData>(objAPIResult.apiResponseString); return(objProductData); } } catch (Exception ex) { objProductData.error_code = 1; objProductData.message = ex.Message; } return(objProductData); }
public string GetCategoryNameBySubCategory(int SubCategoryID) { string CatName = ""; ProductCategoryData data = new ProductCategoryData(); string where = "productcategoryid in (select productcategoryid from productsubcategory where productsubcategoryid=" + SubCategoryID + ")"; string orderby = "Name"; try { DataSet ds = data.GetProductCategorysDynamicDataSet(where, orderby); if (ds.Tables[0].Rows[0]["Name"] != DBNull.Value) { CatName = ds.Tables[0].Rows[0]["Name"].ToString(); } } catch (Exception ex) { log.Write(ex.Message, "GetCategoryNameBySubCategory"); throw (ex); } return(CatName); }
public void SetviewBag(long?selectedId = null) { var data = new ProductCategoryData(); ViewBag.CatID = new SelectList(data.ListAllForAdmin(), "ID", "Name", selectedId); }
public ActionResult Menu_Left() { var model = new ProductCategoryData().ListAll(); return(PartialView(model)); }