Пример #1
0
 public ProductCategoryData(ProductCategoryData data)
 {
     Name         = data.Name;
     rowguid      = data.rowguid;
     ModifiedDate = data.ModifiedDate;
     Uid          = data.Uid;
 }
Пример #2
0
        public void SetChildList(long?selectId = null)
        {
            var data = new ProductCategoryData();

            if (selectId != null)
            {
                ViewBag.ChildID = new SelectList(data.ListChild(selectId.Value), "ID", "Name", selectId);
            }
        }
Пример #3
0
 protected override void LazySet()
 {
     base.LazySet();
     if (PersistenceState == PersistenceState.NewAndChanged || PersistenceState == PersistenceState.LoadedAndChanged)
     {
         if ((object)InnerData == (object)OriginalData)
         {
             OriginalData = new ProductCategoryData(InnerData);
         }
     }
 }
Пример #4
0
 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));
     }
 }
Пример #5
0
        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;
            }
        }
Пример #6
0
        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);
        }
Пример #7
0
        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);
        }
Пример #8
0
        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);
        }
Пример #9
0
        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);
        }
Пример #10
0
        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);
        }
Пример #11
0
        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);
        }
Пример #12
0
        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);
        }
Пример #13
0
        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);
        }
Пример #15
0
        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);
        }
Пример #16
0
        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));
        }