Esempio n. 1
0
        private string GetProductCategory()
        {
            ProductCategoryBLL          pcBll = new ProductCategoryBLL();
            IList <PNK_ProductCategory> lst   = null;

            if (pageName == "home" || pageName == "trang-chu")
            {
                lst = pcBll.GetListTree(LangInt, string.Empty, null, int.MinValue, ConfigurationManager.AppSettings["parentIdTemplate"], string.Empty, 1, true, string.Empty, 1, 9999, out total);
                if (lst.Count > 0)
                {
                    categoryID = lst[0].ProductCategoryDesc.Id.ToString();

                    //ltrCateName.Text = lst[0].ProductCategoryDesc.Name;
                }
            }
            else
            {
                string treeNameUrl = (Session["level"] != null && DBConvert.ParseInt(Session["level"]) == 1) ? pageName : UtilityLocal.RemoveLanguage(Request.RawUrl, LangId);
                lst = pcBll.GetListTree(LangInt, string.Empty, null, int.MinValue, string.Empty, treeNameUrl, 1, true, string.Empty, 1, 9999, out total);
                if (lst.Count > 0)
                {
                    categoryID = lst[0].Id.ToString();

                    //ltrCateName.Text = lst[0].ProductCategoryDesc.Name;

                    //Set category header
                    ltrHeaderCategory.Text = Common.UtilityLocal.ImagePathByFont(lst[0], Request);

                    //Set SEO
                    WebUtils.SeoPage(lst[0].ProductCategoryDesc.MetaTitle, lst[0].ProductCategoryDesc.MetaDecription, lst[0].ProductCategoryDesc.MetaKeyword, this.Page);
                    WebUtils.SeoTagH(lst[0].ProductCategoryDesc.MetaTitle, lst[0].ProductCategoryDesc.MetaTitle, lst[0].ProductCategoryDesc.MetaTitle, Controls);
                }
            }
            return(categoryID);
        }
Esempio n. 2
0
        private string GetProductCategory()
        {
            ProductCategoryBLL          pcBll = new ProductCategoryBLL();
            IList <PNK_ProductCategory> lst   = null;

            //if (pageName == "home" || pageName == "trang-chu")
            //{
            lst = pcBll.GetListTree(LangInt, string.Empty, null, int.MinValue, ConfigurationManager.AppSettings["parentIdVideo"], string.Empty, 1, true, string.Empty, 1, 9999, out total);
            if (lst.Count > 0)
            {
                categoryID = lst[0].ProductCategoryDesc.Id.ToString();
                secCategory.Attributes.Add("style", string.Format("padding-top: 10px; padding-bottom: 20px; background: url('{0}') 50% -80.7422px/cover no-repeat;", WebUtils.GetUrlImage(ConfigurationManager.AppSettings["ProductCategoryUpload"], lst[0].BaseImage)));

                //bgImage = WebUtils.GetUrlImage(ConfigurationManager.AppSettings["ProductCategoryUpload"], lst[0].BaseImage);
            }
            //}
            //else
            //{
            //    string treeNameUrl = (Session["level"] != null && DBConvert.ParseInt(Session["level"]) == 1) ? pageName : UtilityLocal.RemoveLanguage(Request.RawUrl, LangId);
            //    lst = pcBll.GetListTree(LangInt, string.Empty, null, int.MinValue, string.Empty, treeNameUrl, 1, true, string.Empty, 1, 9999, out total);
            //    if (lst.Count > 0)
            //    {
            //        categoryID = lst[0].Id.ToString();

            //        //Set category header
            //        ltrHeaderCategory.Text = Common.UtilityLocal.ImagePathByFont(lst[0], Request);

            //        ////Set SEO
            //        //WebUtils.SeoPage(lst[0].ProductCategoryDesc.MetaTitle, lst[0].ProductCategoryDesc.MetaDecription, lst[0].ProductCategoryDesc.MetaKeyword, this.Page);
            //        //WebUtils.SeoTagH(lst[0].ProductCategoryDesc.MetaTitle, lst[0].ProductCategoryDesc.MetaTitle, lst[0].ProductCategoryDesc.MetaTitle, Controls);

            //    }
            //}
            return(categoryID);
        }
Esempio n. 3
0
        private Dictionary <string, object> GetProductCategory(string treeNameUrl)
        {
            Dictionary <string, object> dicCate = new Dictionary <string, object>();
            string result_TreeNameUrl = string.Empty, result_TreeName = string.Empty;

            treeNameUrl = UtilityLocal.RemoveLanguage(treeNameUrl, LangId);
            ProductCategoryBLL          pcBll   = new ProductCategoryBLL();
            IList <PNK_ProductCategory> lstCate = pcBll.GetListTree(LangInt, string.Empty, null, int.MinValue, string.Empty, treeNameUrl, 1, true, string.Empty, 1, 9999, out total);
            StringBuilder sb = new StringBuilder();

            if (lstCate.Count > 0)
            {
                string[] arrTreeNameUrlUnicodeDesc = lstCate[0].ProductCategoryDesc.TreeNameUrlUnicodeDesc.Split('/');
                string[] arrTreeNameUrl            = lstCate[0].ProductCategoryDesc.TreeNameUrlDesc.Split('/');

                if (arrTreeNameUrlUnicodeDesc != null)
                {
                    for (int i = 0; i < arrTreeNameUrlUnicodeDesc.Length; i++)
                    {
                        result_TreeNameUrl = i == 0 ? LinkHelper.GetLink(PageName, LangId) : string.Format("{0}/{1}", result_TreeNameUrl, arrTreeNameUrl[i]);
                        result_TreeName    = result_TreeName + arrTreeNameUrlUnicodeDesc[i];
                        sb.AppendFormat("<li><a href='{0}'>{1}</a></li>", result_TreeNameUrl, arrTreeNameUrlUnicodeDesc[i]);
                    }
                }
            }
            dicCate.Add("TreeNameUrl", sb);
            //dicCate.Add("TreeName", result_TreeName);
            return(dicCate);
        }
Esempio n. 4
0
        private void GetProductCategory()
        {
            ProductCategoryBLL          pcBll       = new ProductCategoryBLL();
            string                      treeNameUrl = UtilityLocal.RemoveLanguage(Request.RawUrl, LangId);
            IList <PNK_ProductCategory> lstAll      = pcBll.GetListTree(LangInt, string.Empty, null, int.MinValue, string.Empty, treeNameUrl, 1, true, string.Empty, 1, 9999, out total);

            if (lstAll.Count > 0)
            {
                ltrHeaderCategory.Text = Common.UtilityLocal.ImagePathByFont(lstAll[0], Request);
            }
        }
Esempio n. 5
0
        private void GetProductCategory()
        {
            ProductCategoryBLL          pcBll = new ProductCategoryBLL();
            IList <PNK_ProductCategory> lst   = pcBll.GetListTree(LangInt, string.Empty, "1", int.MinValue, ConfigurationManager.AppSettings["parentIdLastBlog"], string.Empty, 0, true, string.Empty, 1, 9999, out total);

            //pcBll.GetList(LangInt, string.Empty, string.Empty, DBConvert.ParseInt(ConfigurationManager.AppSettings["parentIdLastBlog"]), false, "p.ordering", 1, 1000, out  total);
            if (total > 0)
            {
                rptCategory.DataSource = lst;
                rptCategory.DataBind();
            }
        }
Esempio n. 6
0
        private void GetProductCategory()
        {
            ProductCategoryBLL          pcBll = new ProductCategoryBLL();
            IList <PNK_ProductCategory> lst   = null;

            //if (pageName == "home" || pageName == "trang-chu")
            //{
            lst = pcBll.GetListTree(LangInt, string.Empty, null, int.MinValue, categoryIdByPass, string.Empty, 1, true, string.Empty, 1, 9999, out total);
            if (lst.Count > 0)
            {
                secCategory.Attributes.Add("style", string.Format("padding-top: 10px; padding-bottom: 20px; background: url('{0}') 50% -80.7422px/cover no-repeat;", WebUtils.GetUrlImage(ConfigurationManager.AppSettings["ProductCategoryUpload"], lst[0].BaseImage)));
            }
        }
Esempio n. 7
0
        private void GetCateName(string categoryIdByPass)
        {
            ProductCategoryBLL          pcBll = new ProductCategoryBLL();
            IList <PNK_ProductCategory> lst   = pcBll.GetListTree(LangInt, string.Empty, string.Empty, DBConvert.ParseInt(CategoryParentIdByPass), int.MinValue, string.Empty
                                                                  , 1, true, string.Empty, 1, 1, out total);

            if (lst.Count > 0)
            {
                ltrCateName.Text = lst[0].ProductCategoryDesc.Name;

                string link = Utils.CombineUrl(Template_path, UtilityLocal.AppendLanguage(lst[0].ProductCategoryDesc.TreeNameUrlDesc, LangId));
                hypCateName.HRef = link;
            }
        }
Esempio n. 8
0
        private string GetProductCategory()
        {
            ProductCategoryBLL          pcBll = new ProductCategoryBLL();
            IList <PNK_ProductCategory> lst   = null;

            if (pageName == "home" || pageName == "trang-chu")
            {
                lst = pcBll.GetListTree(LangInt, string.Empty, null, int.MinValue, ConfigurationManager.AppSettings["parentIdTemplate"], string.Empty, 1, true, string.Empty, 1, 9999, out total);
                if (lst.Count > 0)
                {
                    categoryID = lst[0].ProductCategoryDesc.Id.ToString();
                }
            }
            else
            {
                string treeNameUrl = (Session["level"] != null && DBConvert.ParseInt(Session["level"]) == 1) ? pageName : UtilityLocal.RemoveLanguage(Request.RawUrl, LangId);
                lst = pcBll.GetListTree(LangInt, string.Empty, null, int.MinValue, string.Empty, treeNameUrl, 1, true, string.Empty, 1, 9999, out total);
                if (lst.Count > 0)
                {
                    categoryID = lst[0].Id.ToString();
                }
            }
            return(categoryID);
        }
        /// <summary>
        /// getDataDropDownCategory
        /// </summary>
        /// <param name="_drp"></param>
        private void GetDataDropDownCategory(DropDownList _drp)
        {
            int    total;
            string strTemp;

            _drp.Items.Clear();
            _drp.Items.Add(new ListItem(Constant.UI.admin_Category, Constant.DSC.IdRootProductCategory.ToString()));
            IList <PNK_ProductCategory> lst = pcBll.GetListTree(Constant.DB.LangId, string.Empty, 1, 300, out total);

            if (lst != null && lst.Count > 0)
            {
                foreach (PNK_ProductCategory item in lst)
                {
                    strTemp = Utils.GetScmplit(item.ProductCategoryDesc.Name, item.PathTree);
                    _drp.Items.Add(new ListItem(strTemp, DBConvert.ParseString(item.Id)));
                }
            }
        }
Esempio n. 10
0
        private void GetProductCategory()
        {
            ProductCategoryBLL          pcBll       = new ProductCategoryBLL();
            string                      treeNameUrl = UtilityLocal.RemoveLanguage(Request.RawUrl, LangId);
            IList <PNK_ProductCategory> lst         = pcBll.GetListTree(LangInt, string.Empty, null, int.MinValue, ConfigurationManager.AppSettings["parentIdPictureVideo"], string.Empty, 1, true, string.Empty, 1, 9999, out total);

            if (lst.Count > 0)
            {
                //Set category header
                ltrHeaderCategory.Text = Common.UtilityLocal.ImagePathByFont(lst[0], Request);

                ltrCateName.Text  = lst[0].ProductCategoryDesc.Name;
                ltrCateBrief.Text = lst[0].ProductCategoryDesc.Brief;

                this.rptResult.DataSource = lst.Where(m => m.ProductCategoryDesc.TreeLevelDesc > 1).ToList();
                this.rptResult.DataBind();
            }
        }
        /// <summary>
        /// getDataDropDownCategory
        /// </summary>
        /// <param name="_drp"></param>
        public static void GetDataDropDownCategory(DropDownList _drp)
        {
            int    totalrow;
            string strTemp;

            _drp.Items.Clear();
            _drp.Items.Add(new ListItem(Constant.UI.admin_Category, Constant.DSC.IdRootProductCategory.ToString()));
            ProductCategoryBLL          ncBll = new ProductCategoryBLL();
            IList <PNK_ProductCategory> lst   = ncBll.GetListTree(Constant.DB.LangId, string.Empty, 1, 300, out totalrow);

            if (lst != null && lst.Count > 0)
            {
                foreach (PNK_ProductCategory item in lst)
                {
                    strTemp = Utils.GetScmplit(item.ProductCategoryDesc.Name, item.PathTree);
                    _drp.Items.Add(new ListItem(strTemp, DBConvert.ParseString(item.Id)));
                }
            }
            //_drp.SelectedIndex = _drp.Items.IndexOf(_drp.Items.FindByValue(ConfigurationManager.AppSettings["parentIdLeture"]));
        }
Esempio n. 12
0
        /// <summary>
        /// Get HReft theo từng level của Product
        /// </summary>
        /// <param name="data"></param>
        /// <param name="LangInt"></param>
        /// <param name="LangId"></param>
        /// <returns>ArrayList</returns>
        ///  item 0: HRef
        public static Dictionary <string, object> GetHRefByLevel(PNK_Product data, int LangInt, string LangId, CultureInfo Ci)
        {
            Dictionary <string, object> dic = new Dictionary <string, object>();

            try
            {
                //string link = UtilityLocal.GetPathTreeNameUrl(data.CategoryId, LangInt, LangId);
                string                      link  = string.Empty;
                ProductCategoryBLL          pcBll = new ProductCategoryBLL();
                IList <PNK_ProductCategory> lst   = pcBll.GetListTree(LangInt, string.Empty, string.Empty, int.MinValue, data.CategoryId.ToString(), string.Empty, 1, true, string.Empty, 1, 9999, out total);
                if (lst.Count > 0)
                {
                    link = AppendLanguage(lst[0].ProductCategoryDesc.TreeNameUrlDesc, LangId);
                    dic.Add("HRef", LinkHelper.GetLink(link, data.ProductDesc.TitleUrl));
                }
            }
            catch (Exception ex)
            {
            }

            return(dic);
        }
Esempio n. 13
0
        private void GetPageName(string pageName)
        {
            try
            {
                //cid = Utils.GetParameter("page", string.Empty);
                cid    = Utils.GetParameter("cid", string.Empty);
                cidsub = Utils.GetParameter("cidsub", string.Empty);
                id     = Utils.GetParameter("id", string.Empty);
                idsub  = Utils.GetParameter("idsub", string.Empty);

                if (pageName == "booking")
                {
                    pageName         = "Pages/BookingManagement/Booking.ascx";
                    Session["level"] = 1;
                }
                else
                {
                    ProductCategoryBLL          pcBll = new ProductCategoryBLL();
                    IList <PNK_ProductCategory> lst   = null;
                    string treeNameUrl = UtilityLocal.RemoveLanguage(Request.RawUrl, LangId);
                    if (pageName == "trang-chu" || pageName == "home")
                    {
                        lst = pcBll.GetList(LangInt, pageName, string.Empty, int.MinValue, false, "p.ordering", 1, 9999, out total);
                        if (lst.Count > 0)
                        {
                            pageName         = lst[0].Page;
                            Session["level"] = lst[0].PathTree.Count(i => i.Equals('.'));
                        }
                    }
                    if (treeNameUrl != string.Empty && (pageName != "trang-chu" || pageName != "home"))
                    {
                        lst = pcBll.GetListTree(LangInt, string.Empty, null, int.MinValue, string.Empty, treeNameUrl, 1, true, string.Empty, 1, 9999, out total);
                        if (lst.Count > 0)
                        {
                            pageName         = lst[0].Page;
                            Session["level"] = lst[0].ProductCategoryDesc.TreeLevelDesc;
                        }
                        else
                        {
                            //Loại bỏ dấu ? để lấy link đúng
                            string url = Request.RawUrl.Split('?')[0];

                            //Cắt url, để lấy product name
                            string[] urlArr = url.Split('/').ToArray();
                            Array.Reverse(urlArr);
                            lastUrl    = urlArr[0];
                            forwardUrl = urlArr[1] == LangId ? urlArr[2] : urlArr[1];
                            if (lastUrl != string.Empty && lastUrl != "default.aspx" && !string.IsNullOrEmpty(lastUrl))
                            {
                                ProductBLL          pcBllProduct = new ProductBLL();
                                IList <PNK_Product> lstProduct   = pcBllProduct.GetList(LangInt, forwardUrl, string.Empty, string.Empty, lastUrl, null, string.Empty, 1, 9999, out total);
                                if (total > 0)
                                {
                                    // lstProduct = lstProduct.Where(p => p.ProductDesc.TitleUrl == idsub).ToList();
                                    pageName            = lstProduct[0].Page;
                                    Session["level"]    = urlArr.Length;
                                    Session["maxLevel"] = true;
                                }
                            }
                        }
                    }
                }

                UserControl contentView = (UserControl)Page.LoadControl(pageName);
                phdContent.Controls.Add(contentView);
            }
            catch (Exception ex)
            {
                Write2Log.WriteLogs("default.aspx", "GetPageName", ex.Message);
            }
        }