Ejemplo n.º 1
0
        protected void rptResult_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                PNK_Product data = e.Item.DataItem as PNK_Product;

                Literal ltrTitle = e.Item.FindControl("ltrTitle") as Literal;
                ltrTitle.Text = data.ProductDesc.Title;

                Literal ltrTourCode = e.Item.FindControl("ltrTourCode") as Literal;
                ltrTourCode.Text = data.Status;

                Literal ltrBrief = e.Item.FindControl("ltrBrief") as Literal;
                ltrBrief.Text = data.ProductDesc.Brief;

                Literal ltrDate = e.Item.FindControl("ltrDate") as Literal;
                ltrDate.Text = data.PostDate.ToString("dd/MM/yyyy");

                HtmlImage img = e.Item.FindControl("img") as HtmlImage;
                img.Src = WebUtils.GetUrlImage(ConfigurationManager.AppSettings["ProductUpload"], data.Image);

                HtmlAnchor hypContinus          = e.Item.FindControl("hypContinus") as HtmlAnchor;
                Dictionary <string, object> dic = UtilityLocal.GetHRefByLevel(data, LangInt, LangId, Ci);
                hypContinus.HRef = dic["HRef"].ToString();
            }
        }
Ejemplo n.º 2
0
        protected void rptRight_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                PNK_Product data     = e.Item.DataItem as PNK_Product;
                HtmlAnchor  hypTitle = e.Item.FindControl("hypTitle") as HtmlAnchor;

                cid = Utils.GetParameter("cid", string.Empty);
                string link  = UtilityLocal.GetPathTreeNameUrl(data.CategoryId, LangInt, LangId);
                int    level = link.Count(i => i.Equals('/'));

                if (level == 3)
                {
                    hypTitle.HRef = LinkHelper.GetLink(pageName, LangId, cid, data.CategoryUrlDesc, data.ProductDesc.TitleUrl);
                }
                else if (level == 2)
                {
                    hypTitle.HRef = LinkHelper.GetLink(link, LocalizationUtility.GetText("linktmp", Ci), data.ProductDesc.TitleUrl);
                }
                else if (level == 1)
                {
                    hypTitle.HRef = LinkHelper.GetLink(UtilityLocal.GetPathTreeNameUrl(data.CategoryId, LangInt, LangId), LocalizationUtility.GetText("linkCate", Ci), LocalizationUtility.GetText("linktmp", Ci), data.ProductDesc.TitleUrl);
                }

                Literal ltrTitle = e.Item.FindControl("ltrTitle") as Literal;
                ltrTitle.Text = data.ProductDesc.Title;

                Literal ltrBrief = e.Item.FindControl("ltrBrief") as Literal;
                ltrBrief.Text = data.ProductDesc.Brief;

                Literal ltrDate = e.Item.FindControl("ltrDate") as Literal;
                ltrDate.Text = data.PostDate.ToString("dd/MM/yyyy");
            }
        }
Ejemplo n.º 3
0
        protected void rptLastBlog_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                PNK_Product data = e.Item.DataItem as PNK_Product;

                HtmlImage imgLastBlog = e.Item.FindControl("imgLastBlog") as HtmlImage;
                imgLastBlog.Src = WebUtils.GetUrlImage(ConfigurationManager.AppSettings["ProductUpload"], data.Image);
                imgLastBlog.Attributes.Add("srcset", WebUtils.GetUrlImage(ConfigurationManager.AppSettings["ProductUpload"], data.Image));

                HtmlAnchor hypLastBlogImg   = e.Item.FindControl("hypLastBlogImg") as HtmlAnchor;
                HtmlAnchor hypLastBlogTitle = e.Item.FindControl("hypLastBlogTitle") as HtmlAnchor;

                Dictionary <string, object> dic = UtilityLocal.GetHRefByLevel(data, LangInt, LangId, Ci);
                hypLastBlogTitle.HRef = hypLastBlogImg.HRef = dic["HRef"].ToString();

                Literal ltrLastBlogTitle = e.Item.FindControl("ltrLastBlogTitle") as Literal;
                hypLastBlogTitle.Title = hypLastBlogImg.Title = imgLastBlog.Alt = imgLastBlog.Attributes["title"] = ltrLastBlogTitle.Text = hypLastBlogImg.Title = data.ProductDesc.Title;

                Literal ltrLastBlogBrief = e.Item.FindControl("ltrLastBlogBrief") as Literal;
                ltrLastBlogBrief.Text = hypLastBlogImg.Title = data.ProductDesc.Brief;

                Literal ltrLastBlogDate = e.Item.FindControl("ltrLastBlogDate") as Literal;
                ltrLastBlogDate.Text = data.PostDate.ToString("dd/MM/yyyy");
            }
        }
Ejemplo n.º 4
0
        protected void rptTopDetination_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                PNK_ProductCategory data     = e.Item.DataItem as PNK_ProductCategory;
                HtmlAnchor          hypTitle = e.Item.FindControl("hypTitle") as HtmlAnchor;
                HtmlAnchor          hypImg   = e.Item.FindControl("hypImg") as HtmlAnchor;

                cid = Utils.GetParameter("cid", string.Empty);
                string link  = UtilityLocal.GetPathTreeNameUrl(data.Id, LangInt, LangId);
                int    level = link.Count(i => i.Equals('/'));
                if (level == 1)
                {
                    hypTitle.HRef = hypImg.HRef = LinkHelper.GetLink(data.ProductCategoryDesc.NameUrl, LangId);
                }
                else if (level == 2)
                {
                    hypTitle.HRef = hypImg.HRef = LinkHelper.GetLink(link, LocalizationUtility.GetText("linktmp", Ci), data.ProductCategoryDesc.NameUrl);
                }
                else if (level == 3)
                {
                    hypTitle.HRef = hypImg.HRef = LinkHelper.GetLink(link);
                }
                else if (level == 4)
                {
                    hypTitle.HRef = hypImg.HRef = LinkHelper.GetLink(link);
                }

                HtmlImage img = e.Item.FindControl("img") as HtmlImage;
                img.Src = WebUtils.GetUrlImage(ConfigurationManager.AppSettings["ProductCategoryUpload"], data.BaseImage);

                Literal ltrTitle = e.Item.FindControl("ltrTitle") as Literal;
                ltrTitle.Text = hypTitle.Title = hypImg.Title = img.Alt = img.Attributes["title"] = data.ProductCategoryDesc.Name;
            }
        }
Ejemplo n.º 5
0
        protected void rptResult_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                PNK_Product data = e.Item.DataItem as PNK_Product;

                string    src = WebUtils.GetUrlImage(ConfigurationManager.AppSettings["ProductUpload"], data.Image);
                HtmlImage img = e.Item.FindControl("img") as HtmlImage;
                img.Src = src;
                string srcset = string.Format("{0} 300w, {1} 420w, {2} 690w", src, src, src);
                img.Attributes.Add("srcset", srcset);

                HtmlAnchor hypImg = e.Item.FindControl("hypImg") as HtmlAnchor;

                //Dictionary<string, object> dic = UtilityLocal.GetHRefByLevel(data, LangInt, LangId, Ci);
                hypImg.HRef = LinkHelper.GetLink(UtilityLocal.GetPathTreeNameUrl(data.CategoryId, LangInt, LangId), data.ProductDesc.TitleUrl);

                Literal ltrTitle = e.Item.FindControl("ltrTitle") as Literal;
                ltrTitle.Text = hypImg.Title = data.ProductDesc.Title;

                #region Price

                StringBuilder sbPrice = new StringBuilder();
                //Nếu không có giá giảm
                if (string.IsNullOrWhiteSpace(data.Post))
                {
                    string normalPrice = data.Website == "" ? "<ins><span class=\"amount\">Call</span></ins>" : string.Format("{0} USD", data.Website);
                    sbPrice.AppendFormat("<ins><span class=\"amount\">{0}</span></ins>", normalPrice);
                }
                //Nếu có giá giảm
                else
                {
                    string normalPrice = data.Website == "" ? "Call" : string.Format("{0} USD", data.Website);
                    if (data.Website != "")
                    {
                        decimal discountPercent = ((DBConvert.ParseDecimal(data.Website) - DBConvert.ParseDecimal(data.Post)) / DBConvert.ParseDecimal(data.Website)) * 100;
                        sbPrice.AppendFormat("<ins><span class=\"amount\">{0} USD</span></ins>", data.Post);
                        sbPrice.AppendFormat("<del><span class=\"amount\">{0} USD</span></del>", data.Website);

                        //Show icon sale price
                        HtmlControl divIsSale = e.Item.FindControl("divIsSale") as HtmlControl;
                        divIsSale.Style.Add("display", "block");
                    }
                    else
                    {
                        sbPrice.Append("<ins><span class=\"amount\">Call</span></ins>");
                    }
                }
                Literal ltrPrice = e.Item.FindControl("ltrPrice") as Literal;
                ltrPrice.Text = sbPrice.ToString();

                #endregion

                Literal ltrDate = e.Item.FindControl("ltrDate") as Literal;
                ltrDate.Text = data.Bedroom;

                Literal ltrBrief = e.Item.FindControl("ltrBrief") as Literal;
                ltrBrief.Text = DBHelper.getTruncate(data.ProductDesc.Brief, 20);
            }
        }
Ejemplo n.º 6
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);
        }
Ejemplo n.º 7
0
        protected void rptResultSub_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                //Repeater dataParent = (Repeater)e.Item.Parent.Parent;

                PNK_ProductCategory data = e.Item.DataItem as PNK_ProductCategory;
                string     link          = UtilityLocal.GetPathTreeNameUrl(data.Id, LangInt, LangId);
                HtmlAnchor hypNameSub2   = e.Item.FindControl("hypNameSub2") as HtmlAnchor;
                hypNameSub2.HRef = LinkHelper.GetLink(link);

                Literal ltrNameSub2 = e.Item.FindControl("ltrNameSub2") as Literal;
                hypNameSub2.Title = ltrNameSub2.Text = data.ProductCategoryDesc.Name;

                //HtmlImage img = e.Item.FindControl("img") as HtmlImage;
                //img.Src = WebUtils.GetUrlImage(ConfigurationManager.AppSettings["ProductCategoryUpload"], data.BaseImage);

                //Sub menu con
                IList <PNK_ProductCategory> lstSub = lstAll.Where(m => m.ParentId == data.Id).ToList();
                if (lstSub.Count() > 0)
                {
                    hddParentNameUrl.Value = data.ProductCategoryDesc.NameUrl;

                    Repeater rptResultSub1 = e.Item.FindControl("rptResultSub1") as Repeater;
                    rptResultSub1.DataSource = lstSub;
                    rptResultSub1.DataBind();
                }
            }
        }
Ejemplo n.º 8
0
        private static string GetConfigFile(string configFile = null)
        {
            if (string.IsNullOrWhiteSpace(configFile))
            {
                configFile = CONFIGFILE;
            }

            return(UtilityLocal.EnsureFilePath(configFile));
        }
Ejemplo n.º 9
0
        protected void rptVideoTop_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                PNK_Product data = e.Item.DataItem as PNK_Product;

                HtmlControl ifrVideo = e.Item.FindControl("ifrVideo") as HtmlControl;
                ifrVideo.Attributes.Add("src", "//www.youtube.com/embed/" + UtilityLocal.GetVideoList(data.Id) + "?rel=0&amp;autoplay=0");
            }
        }
Ejemplo n.º 10
0
        protected void rptResult_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                PNK_Product data   = e.Item.DataItem as PNK_Product;
                HtmlAnchor  hypImg = e.Item.FindControl("hypImg") as HtmlAnchor;

                Dictionary <string, object> dic = UtilityLocal.GetHRefByLevel(data, LangInt, LangId, Ci);
                hypImg.HRef = dic["HRef"].ToString();

                HtmlImage img = e.Item.FindControl("img") as HtmlImage;
                img.Src = WebUtils.GetUrlImage(ConfigurationManager.AppSettings["ProductUpload"], data.Image);
                img.Attributes.Add("data-lazysrc", WebUtils.GetUrlImage(ConfigurationManager.AppSettings["ProductUpload"], data.Image));

                Literal ltrTitle = e.Item.FindControl("ltrTitle") as Literal;
                hypImg.Title = ltrTitle.Text = img.Alt = img.Attributes["title"] = data.ProductDesc.Title;

                HtmlControl liTilte = e.Item.FindControl("liTilte") as HtmlControl;
                liTilte.Attributes.Add("data-title", "data.ProductDesc.Title");
                liTilte.Attributes.Add("class", string.Format("filterall filter-{0} eg-w_jason-wrapper eg-post-id-5874", data.CategoryUrlDesc));

                #region Price

                StringBuilder sbPrice = new StringBuilder();
                //Nếu không có giá giảm
                if (string.IsNullOrWhiteSpace(data.Post))
                {
                    string normalPrice = data.Website == "" ? "<ins><span class=\"amount\">Call</span></ins>" : string.Format("{0} USD", data.Website);
                    sbPrice.AppendFormat("<ins><span class=\"amount\">{0}</span></ins>", normalPrice);
                }
                //Nếu có giá giảm
                else
                {
                    string normalPrice = data.Website == "" ? "Call" : string.Format("$USD {0}", data.Website);
                    if (data.Website != "")
                    {
                        decimal discountPercent = ((DBConvert.ParseDecimal(data.Website) - DBConvert.ParseDecimal(data.Post)) / DBConvert.ParseDecimal(data.Website)) * 100;
                        sbPrice.AppendFormat("<ins><span class=\"amount\">{0} USD</span></ins>", data.Post);
                        sbPrice.AppendFormat("<del><span class=\"amount\">{0} USD</span></del>", data.Website);

                        //Show icon sale price
                        HtmlControl divIsSale = e.Item.FindControl("divIsSale") as HtmlControl;
                        divIsSale.Style.Add("display", "block");
                    }
                    else
                    {
                        sbPrice.Append("<ins><span class=\"amount\">Call</span></ins>");
                    }
                }
                Literal ltrPrice = e.Item.FindControl("ltrPrice") as Literal;
                ltrPrice.Text = sbPrice.ToString();

                #endregion
            }
        }
Ejemplo n.º 11
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);
            }
        }
Ejemplo n.º 12
0
        protected void rptResult_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                PNK_Product data        = e.Item.DataItem as PNK_Product;
                HtmlAnchor  hypImg      = e.Item.FindControl("hypImg") as HtmlAnchor;
                HtmlAnchor  hypContinus = e.Item.FindControl("hypContinus") as HtmlAnchor;
                //cid = Utils.GetParameter("cid", string.Empty);
                //string link = UtilityLocal.GetPathTreeNameUrl(data.CategoryId, LangInt, LangId);
                //int level = link.Count(i => i.Equals('/'));

                Dictionary <string, object> dic = UtilityLocal.GetHRefByLevel(data, LangInt, LangId, Ci);
                hypImg.HRef = hypContinus.HRef = dic["HRef"].ToString();

                //switch (ConfigurationManager.AppSettings["Version"])
                //{
                //    case "1":
                //        hypContinus.HRef = hypImg.HRef = WebUtils.GetUrlImage(ConfigurationManager.AppSettings["ProductUpload"], data.Image);
                //        break;
                //    case "2":
                //        if (level == 3)
                //        {
                //            hypContinus.HRef = hypImg.HRef = LinkHelper.GetLink(pageName, LangId, cid, data.CategoryUrlDesc, data.ProductDesc.TitleUrl);
                //        }
                //        else if (level == 2)
                //        {
                //            hypContinus.HRef = hypImg.HRef = LinkHelper.GetLink(link, "page", data.ProductDesc.TitleUrl);
                //            //hypImg.HRef = LinkHelper.GetLink(link, LocalizationUtility.GetText("linktmp", Ci), data.ProductDesc.TitleUrl);
                //        }
                //        else if (level == 1)
                //        {
                //            hypContinus.HRef = hypImg.HRef = LinkHelper.GetLink(UtilityLocal.GetPathTreeNameUrl(data.CategoryId, LangInt, LangId), LocalizationUtility.GetText("linkCate", Ci), "page", data.ProductDesc.TitleUrl);
                //            //hypImg.HRef = LinkHelper.GetLink(UtilityLocal.GetPathTreeNameUrl(data.CategoryId, LangInt, LangId), LocalizationUtility.GetText("linkCate", Ci), LocalizationUtility.GetText("linktmp", Ci), data.ProductDesc.TitleUrl);
                //        }
                //        break;
                //}

                HtmlImage img = e.Item.FindControl("img") as HtmlImage;
                img.Src = WebUtils.GetUrlImage(ConfigurationManager.AppSettings["ProductUpload"], data.Image);
                img.Attributes.Add("srcset", WebUtils.GetUrlImage(ConfigurationManager.AppSettings["ProductUpload"], data.Image));

                Literal ltrTitle = e.Item.FindControl("ltrTitle") as Literal;
                hypImg.Title = ltrTitle.Text = img.Alt = img.Attributes["title"] = data.ProductDesc.Title;

                HtmlControl article = e.Item.FindControl("article") as HtmlControl;
                //article.Attributes.Add("data-title", "data.ProductDesc.Title");
                article.Attributes.Add("class", string.Format("post-item col-md-3 col-sm-4 col-xs-12 {0}", data.CategoryUrlDesc));

                Literal ltrContinus = e.Item.FindControl("ltrContinus") as Literal;
                ltrContinus.Text = LocalizationUtility.GetText("ltrContinus", Ci);
            }
        }
Ejemplo n.º 13
0
        protected void rptCategory_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                PNK_ProductCategory data = e.Item.DataItem as PNK_ProductCategory;

                Literal ltrTitle = e.Item.FindControl("ltrTitle") as Literal;
                ltrTitle.Text = data.ProductCategoryDesc.Name;

                HtmlAnchor hypTitle = e.Item.FindControl("hypTitle") as HtmlAnchor;
                hypTitle.HRef = Utils.CombineUrl(Template_path, UtilityLocal.AppendLanguage(data.ProductCategoryDesc.TreeNameUrlDesc, LangId));
            }
        }
Ejemplo n.º 14
0
        private void GetVideo()
        {
            try
            {
                string categoryID = GetProductCategory();

                ProductBLL          pcBll = new ProductBLL();
                IList <PNK_Product> lst2  = null;
                IList <PNK_Product> lst3  = null;
                string level = string.Empty;

                if (Session["level"] != null)
                {
                    level = Session["level"].ToString();
                    switch (level)
                    {
                    case "1":
                        lst2 = pcBll.GetList(LangInt, pageName, string.Empty, string.Empty, string.Empty, null, string.Empty, 1, 9999, out total);
                        break;

                    case "2":
                        lst2 = pcBll.GetList(LangInt, cid, string.Empty, string.Empty, string.Empty, null, string.Empty, 1, 9999, out total);
                        ifrTop.Attributes.Add("src", "//www.youtube.com/embed/" + UtilityLocal.GetVideoList(lst2[0].Id) + "?rel=0&amp;autoplay=0");
                        break;

                    case "3":
                    default:
                        lst2 = pcBll.GetList(LangInt, cid, string.Empty, string.Empty, string.Empty, null, string.Empty, 1, 9999, out total);
                        lst3 = lst2.Where(m => m.ProductDesc.TitleUrl == id).ToList();
                        ifrTop.Attributes.Add("src", "//www.youtube.com/embed/" + UtilityLocal.GetVideoList(lst3[0].Id) + "?rel=0&amp;autoplay=0");


                        break;
                    }
                }

                if (total > 0)
                {
                    this.records         = DBConvert.ParseString(total);
                    this.pager.PageSize  = DBConvert.ParseInt(ConfigurationManager.AppSettings["pageSizeCate"]);
                    this.pager.ItemCount = total;

                    this.rptVideo.DataSource = lst2;
                    this.rptVideo.DataBind();
                }
            }
            catch (Exception ex)
            {
                Write2Log.WriteLogs("GetVideo", "GetVideo", ex.Message);
            }
        }
Ejemplo n.º 15
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;
            }
        }
Ejemplo n.º 16
0
        protected void rptSub1_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                PNK_ProductCategory data = e.Item.DataItem as PNK_ProductCategory;

                string     link    = UtilityLocal.GetPathTreeNameUrl(data.Id, LangInt, LangId);
                HtmlAnchor hypName = e.Item.FindControl("hypName") as HtmlAnchor;
                hypName.HRef = LinkHelper.GetLink(link);

                Literal ltrName = e.Item.FindControl("ltrName") as Literal;
                hypName.Title = hypName.Title = ltrName.Text = data.ProductCategoryDesc.Name;
            }
        }
Ejemplo n.º 17
0
        protected void rptConstruction_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                PNK_Product data = e.Item.DataItem as PNK_Product;

                HtmlAnchor hypImg = e.Item.FindControl("hypImg") as HtmlAnchor;

                HtmlImage img = e.Item.FindControl("img") as HtmlImage;
                img.Src = WebUtils.GetUrlImage(ConfigurationManager.AppSettings["ProductUpload"], data.Image);

                Dictionary <string, object> dic = UtilityLocal.GetHRefByLevel(data, LangInt, LangId, Ci);
                hypImg.HRef = dic["HRef"].ToString();

                hypImg.Title = img.Alt = img.Attributes["title"] = data.ProductDesc.Title;
            }
        }
Ejemplo n.º 18
0
        protected void rptLastBlog_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                PNK_Product data = e.Item.DataItem as PNK_Product;

                HtmlImage img = e.Item.FindControl("img") as HtmlImage;
                img.Src = WebUtils.GetUrlImage(ConfigurationManager.AppSettings["ProductUpload"], data.Image);

                HtmlAnchor hypImg      = e.Item.FindControl("hypImg") as HtmlAnchor;
                HtmlAnchor hypContinus = e.Item.FindControl("hypContinus") as HtmlAnchor;
                HtmlAnchor hypTitle    = e.Item.FindControl("hypTitle") as HtmlAnchor;

                cid = Utils.GetParameter("cid", string.Empty);
                string link  = UtilityLocal.GetPathTreeNameUrl(data.CategoryId, LangInt, LangId);
                int    level = link.Count(i => i.Equals('/'));

                if (level == 3)
                {
                    hypTitle.HRef = hypContinus.HRef = hypImg.HRef = LinkHelper.GetLink(pageName, LangId, cid, data.CategoryUrlDesc, data.ProductDesc.TitleUrl);
                }
                else if (level == 2)
                {
                    hypTitle.HRef = hypContinus.HRef = hypImg.HRef = LinkHelper.GetLink(link, LocalizationUtility.GetText("linktmp", Ci), data.ProductDesc.TitleUrl);
                }
                else if (level == 1)
                {
                    hypTitle.HRef = hypContinus.HRef = hypImg.HRef = LinkHelper.GetLink(UtilityLocal.GetPathTreeNameUrl(data.CategoryId, LangInt, LangId), LocalizationUtility.GetText("linkCate", Ci), LocalizationUtility.GetText("linktmp", Ci), data.ProductDesc.TitleUrl);
                }

                Literal ltrTitle = e.Item.FindControl("ltrTitle") as Literal;
                hypTitle.Title = hypContinus.Title = hypImg.Title = img.Alt = img.Attributes["title"] = ltrTitle.Text = hypImg.Title = data.ProductDesc.Title;

                Literal ltrBrief = e.Item.FindControl("ltrBrief") as Literal;
                ltrBrief.Text = hypImg.Title = data.ProductDesc.Brief;

                Literal ltrDate = e.Item.FindControl("ltrDate") as Literal;
                ltrDate.Text = data.PostDate.ToString("dd/MM/yyyy");

                Literal ltrUpdateBy = e.Item.FindControl("ltrUpdateBy") as Literal;
                ltrUpdateBy.Text = data.UpdateBy;

                Literal ltrContinus = e.Item.FindControl("ltrContinus") as Literal;
                ltrContinus.Text = LocalizationUtility.GetText(ltrContinus.ID);
            }
        }
Ejemplo n.º 19
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();
            }
        }
Ejemplo n.º 20
0
        protected void rptResultSub_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                Repeater rpt        = (Repeater)sender;
                var      dataSource = (IList <PNK_ProductCategory>)rpt.DataSource;
                int      count      = dataSource.Count;

                //Set col ul tag
                HtmlControl ulSub = (HtmlControl)e.Item.FindControl("ulSub");
                if (count <= 4)
                {
                    ulSub.Attributes.Add("class", string.Format("col-md-{0} col-sm-{0} col-xs-12 col-md-15 link-list1", 12 / count));
                }
                else
                {
                    ulSub.Attributes.Add("class", "col-md-3 col-sm-4 col-xs-12 col-md-15 link-list1");
                }

                PNK_ProductCategory data = e.Item.DataItem as PNK_ProductCategory;
                string     link          = UtilityLocal.GetPathTreeNameUrl(data.Id, LangInt, LangId);
                HtmlAnchor hypNameSub2   = e.Item.FindControl("hypNameSub2") as HtmlAnchor;
                hypNameSub2.HRef = LinkHelper.GetLink(link);

                Literal ltrNameSub2 = e.Item.FindControl("ltrNameSub2") as Literal;
                hypNameSub2.Title = ltrNameSub2.Text = data.ProductCategoryDesc.Name;

                HtmlImage img = e.Item.FindControl("img") as HtmlImage;
                img.Src = WebUtils.GetUrlImage(ConfigurationManager.AppSettings["ProductCategoryUpload"], data.BaseImage);

                //Sub menu con
                IList <PNK_ProductCategory> lstSub = lstAll.Where(m => m.ParentId == data.Id).ToList();
                if (lstSub.Count() > 0)
                {
                    hddParentNameUrl.Value = data.ProductCategoryDesc.NameUrl;

                    Repeater rptResultSub1 = e.Item.FindControl("rptResultSub1") as Repeater;
                    rptResultSub1.DataSource = lstSub;
                    rptResultSub1.DataBind();
                }
            }
        }
Ejemplo n.º 21
0
        protected void rptSub_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                PNK_ProductCategory data = e.Item.DataItem as PNK_ProductCategory;

                string     link    = UtilityLocal.GetPathTreeNameUrl(data.Id, LangInt, LangId);
                HtmlAnchor hypName = e.Item.FindControl("hypName") as HtmlAnchor;
                hypName.HRef = LinkHelper.GetLink(link);

                hddParentNameUrlFooter.Value = data.ProductCategoryDesc.NameUrl;

                Literal ltrName = e.Item.FindControl("ltrName") as Literal;
                hypName.Title = ltrName.Text = data.ProductCategoryDesc.Name;

                //Sub menu con
                Repeater rptSub1 = e.Item.FindControl("rptSub1") as Repeater;
                GetSubMenu(data.Id.ToString(), rptSub1);
            }
        }
Ejemplo n.º 22
0
        protected void rptResult_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                PNK_Product data        = e.Item.DataItem as PNK_Product;
                HtmlAnchor  hypContinus = e.Item.FindControl("hypContinus") as HtmlAnchor;

                Dictionary <string, object> dic = UtilityLocal.GetHRefByLevel(data, LangInt, LangId, Ci);
                hypContinus.HRef = dic["HRef"].ToString();

                HtmlImage img = e.Item.FindControl("img") as HtmlImage;
                img.Src = WebUtils.GetUrlImage(ConfigurationManager.AppSettings["ProductUpload"], data.Image);
                img.Attributes.Add("srcset", WebUtils.GetUrlImage(ConfigurationManager.AppSettings["ProductUpload"], data.Image));

                Literal ltrTitle = e.Item.FindControl("ltrTitle") as Literal;
                ltrTitle.Text = hypContinus.Title = data.ProductDesc.Title;

                Literal ltrContinus = e.Item.FindControl("ltrContinus") as Literal;
                ltrContinus.Text = LocalizationUtility.GetText("ltrContinus", Ci);
            }
        }
Ejemplo n.º 23
0
        protected void rptVideoTop_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                PNK_Product data = e.Item.DataItem as PNK_Product;

                HtmlImage img = e.Item.FindControl("img") as HtmlImage;
                img.Src = WebUtils.GetUrlImage(ConfigurationManager.AppSettings["ProductUpload"], data.Image);

                Literal ltrTitle = e.Item.FindControl("ltrTitle") as Literal;
                ltrTitle.Text = img.Alt = img.Attributes["title"] = DBHelper.getTruncate(data.ProductDesc.Title, 10);

                Literal ltrBrief = e.Item.FindControl("ltrBrief") as Literal;
                ltrBrief.Text = DBHelper.getTruncate(data.ProductDesc.Brief, 30);

                HtmlAnchor hypVideo = e.Item.FindControl("hypVideo") as HtmlAnchor;
                hypVideo.HRef = string.Format("https://www.youtube.com/watch?v={0}", UtilityLocal.GetVideoList(data.Id));

                //HtmlControl ifrVideo = e.Item.FindControl("ifrVideo") as HtmlControl;
                //ifrVideo.Attributes.Add("src", "//www.youtube.com/embed/" + UtilityLocal.GetVideoList(data.Id) + "?rel=0&amp;autoplay=0");
            }
        }
Ejemplo n.º 24
0
        protected void rptResult_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                PNK_Product data   = e.Item.DataItem as PNK_Product;
                HtmlAnchor  hypImg = e.Item.FindControl("hypImg") as HtmlAnchor;
                //HtmlAnchor hypTitle = e.Item.FindControl("hypTitle") as HtmlAnchor;
                //HtmlAnchor hypBrief = e.Item.FindControl("hypBrief") as HtmlAnchor;
                cid = Utils.GetParameter("cid", string.Empty);
                string link  = UtilityLocal.GetPathTreeNameUrl(data.CategoryId, LangInt, LangId);
                int    level = link.Count(i => i.Equals('/'));

                if (level == 3)
                {
                    hypImg.HRef = LinkHelper.GetLink(pageName, LangId, cid, data.CategoryUrlDesc, data.ProductDesc.TitleUrl);
                }
                else if (level == 2)
                {
                    //link = link + "/" + LocalizationUtility.GetText("linktmp", Ci);
                    hypImg.HRef = LinkHelper.GetLink(link, LocalizationUtility.GetText("linktmp", Ci), data.ProductDesc.TitleUrl);
                }
                else if (level == 1)
                {
                    hypImg.HRef = LinkHelper.GetLink(UtilityLocal.GetPathTreeNameUrl(data.CategoryId, LangInt, LangId), LocalizationUtility.GetText("linkCate", Ci), LocalizationUtility.GetText("linktmp", Ci), data.ProductDesc.TitleUrl);
                }

                HtmlImage img = e.Item.FindControl("img") as HtmlImage;
                img.Src = WebUtils.GetUrlImage(ConfigurationManager.AppSettings["ProductUpload"], data.Image);
                img.Attributes.Add("data-lazysrc", WebUtils.GetUrlImage(ConfigurationManager.AppSettings["ProductUpload"], data.Image));

                Literal ltrTitle = e.Item.FindControl("ltrTitle") as Literal;
                hypImg.Title = ltrTitle.Text = img.Alt = img.Attributes["title"] = data.ProductDesc.Title;

                HtmlControl liTilte = e.Item.FindControl("liTilte") as HtmlControl;
                liTilte.Attributes.Add("data-title", "data.ProductDesc.Title");
                liTilte.Attributes.Add("class", string.Format("filterall filter-{0} eg-w_jason-wrapper eg-post-id-5874", data.CategoryUrlDesc));
            }
        }
Ejemplo n.º 25
0
        protected void rptResult_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                PNK_ProductCategory data = e.Item.DataItem as PNK_ProductCategory;

                HtmlImage img = e.Item.FindControl("img") as HtmlImage;
                img.Src = WebUtils.GetUrlImage(ConfigurationManager.AppSettings["ProductCategoryUpload"], data.BaseImage);
                img.Attributes.Add("data-lazysrc", WebUtils.GetUrlImage(ConfigurationManager.AppSettings["ProductCategoryUpload"], data.BaseImage));

                HtmlAnchor hypImg = e.Item.FindControl("hypImg") as HtmlAnchor;
                hypImg.HRef = Utils.CombineUrl(Template_path, UtilityLocal.AppendLanguage(data.ProductCategoryDesc.TreeNameUrlDesc, LangId));

                Literal ltrTitle = e.Item.FindControl("ltrTitle") as Literal;
                hypImg.Title = ltrTitle.Text = DBHelper.getTruncate(data.ProductCategoryDesc.Name, 7);

                //Literal ltrBrief = e.Item.FindControl("ltrBrief") as Literal;
                //ltrBrief.Text = DBHelper.getTruncate(data.ProductCategoryDesc.Brief, 26);

                //Literal ltrMoreProduct = e.Item.FindControl("ltrMoreProduct") as Literal;
                //ltrMoreProduct.Text = LocalizationUtility.GetText("ltrContinus", Ci);
            }
        }
Ejemplo n.º 26
0
        protected void rptResult_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                PNK_Product data = e.Item.DataItem as PNK_Product;

                HtmlAnchor hypImg   = e.Item.FindControl("hypImg") as HtmlAnchor;
                HtmlAnchor hypTitle = e.Item.FindControl("hypTitle") as HtmlAnchor;

                Dictionary <string, object> dic = UtilityLocal.GetHRefByLevel(data, LangInt, LangId, Ci);
                hypImg.HRef = string.Format("https://www.youtube.com/watch?v={0}", UtilityLocal.GetVideoList(data.Id));
                //  hypImg.HRef = dic["HRef"].ToString();

                HtmlImage img = e.Item.FindControl("img") as HtmlImage;
                img.Src = WebUtils.GetUrlImage(ConfigurationManager.AppSettings["ProductUpload"], data.Image);
                img.Attributes.Add("data-lazysrc", WebUtils.GetUrlImage(ConfigurationManager.AppSettings["ProductUpload"], data.Image));

                Literal ltrTitle = e.Item.FindControl("ltrTitle") as Literal;
                ltrTitle.Text = data.ProductDesc.Title;

                //GetVideoList(data.Id);
            }
        }
Ejemplo n.º 27
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 = 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);
        }
Ejemplo n.º 28
0
        protected void rptServiceLeft_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                PNK_Product data = e.Item.DataItem as PNK_Product;

                Literal ltrImge = e.Item.FindControl("ltrImge") as Literal;
                ltrImge.Text = Common.UtilityLocal.ImagePathByFont(data);

                HtmlAnchor hypTitle = e.Item.FindControl("hypTitle") as HtmlAnchor;

                Dictionary <string, object> dic = UtilityLocal.GetHRefByLevel(data, LangInt, LangId, Ci);
                hypTitle.HRef = LinkHelper.GetLink(UtilityLocal.GetPathTreeNameUrl(data.CategoryId, LangInt, LangId), data.ProductDesc.TitleUrl);

                Literal ltrTitle = e.Item.FindControl("ltrTitle") as Literal;
                ltrTitle.Text = hypTitle.Title = data.ProductDesc.Title;

                Literal ltrBrief = e.Item.FindControl("ltrBrief") as Literal;
                ltrBrief.Text = data.ProductDesc.Brief;

                //Literal ltrContinus = e.Item.FindControl("ltrContinus") as Literal;
                //ltrContinus.Text = LocalizationUtility.GetText(ltrContinus.ID);
            }
        }
Ejemplo n.º 29
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);
        }
Ejemplo n.º 30
0
            public static Dictionary <string, object> GetHandlers(List <CustomHandlerLocal> handlerLocals)
            {
                var handlersDic = new Dictionary <string, object>();

                if (handlerLocals == null || !handlerLocals.Any())
                {
                    return(handlersDic);
                }

                foreach (var item in handlerLocals)
                {
                    object value = string.IsNullOrWhiteSpace(item.customObjectQualifiedName) ? null : UtilityLocal.Create(item.customObjectQualifiedName);
                    handlersDic.Add(item.name, value);
                }

                return(handlersDic);
            }