private bool CheckParentIsThisOrChild()
        {
            IList <PNK_ProductCategory> lst = pcBll.GetAllChild(productcategoryId, true);

            if (lst != null && lst.Count > 0)
            {
                foreach (PNK_ProductCategory item in lst)
                {
                    if (item.Id == DBConvert.ParseInt(drpCategory.SelectedValue))
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }
Beispiel #2
0
        private string GetAllChildCategory()
        {
            int categoryId = DBConvert.ParseInt(drpCategory.SelectedValue);

            categoryId = categoryId == 0 ? int.MinValue : DBConvert.ParseInt(drpCategory.SelectedValue);
            string arrId = "";

            if (categoryId != int.MinValue)
            {
                ProductCategoryBLL          newsCateBll = new ProductCategoryBLL();
                IList <PNK_ProductCategory> lst         = newsCateBll.GetAllChild(DBConvert.ParseInt(drpCategory.SelectedValue), true);
                arrId = arrId + Utils.ArrayToString <PNK_ProductCategory>((List <PNK_ProductCategory>)lst, "Id", ",");
            }
            else
            {
                arrId = string.Empty;
            }
            return(arrId);// !string.IsNullOrEmpty(arrId) ? arrId : "-1011";
        }
Beispiel #3
0
        private string GetAllChildCategory()
        {
            int    categoryId = int.MinValue;// = DBConvert.ParseInt(drpCategory.SelectedValue);
            string pageName   = Utils.GetParameter("page", "home");

            switch (pageName)
            {
            case "picture":
                categoryId = 112;
                break;

            case "video":
                categoryId = 113;
                break;
            }

            //categoryId = categoryId == 0 ? int.MinValue : DBConvert.ParseInt(drpCategory.SelectedValue);
            string arrId = "";

            if (categoryId != int.MinValue)
            {
                ProductCategoryBLL          newsCateBll = new ProductCategoryBLL();
                IList <PNK_ProductCategory> lst         = newsCateBll.GetAllChild(categoryId, true);

                arrId = arrId + Utils.ArrayToString((List <PNK_ProductCategory>)lst, "Id", ",");

                drpCategory.SelectedValue = categoryId.ToString();
                drpCategory.Attributes.Add("readonly", "true");
            }
            else
            {
                ProductCategoryBLL          newsCateBll = new ProductCategoryBLL();
                IList <PNK_ProductCategory> lst         = newsCateBll.GetAllChild(DBConvert.ParseInt(ConfigurationManager.AppSettings["parentIdContact"]), true);

                arrId = arrId + Utils.ArrayToString <PNK_ProductCategory>((List <PNK_ProductCategory>)lst, "Id", ",");
            }
            return(arrId);// !string.IsNullOrEmpty(arrId) ? arrId : "-1011";
        }