private void ViewNewsHot(int groupcate)
    {
        //  string strCate = GetCateParentIDArrayByID(cateID, groupcate);
        DataTable table = new DataTable();

        if (AspNetCache.CheckCache("Table_Mainhome_ltlHotNewsSlider_" + hddValue.Value + "_" + Language.language.Replace("-", "_")) == false)
        {
            string strCate = GetCateParentIDArrayByID(0, groupcate);

            NewsGroupBSO newsgroupBSO = new NewsGroupBSO();
            table = newsgroupBSO.GetNewsGroupByCateHomeList(strCate, groupcate, "1", Convert.ToInt32(hddRecord.Value), "1");

            //NewsGroupBSO newsGroupBSO = new NewsGroupBSO();
            ////table = newsGroupBSO.GetNewsGroupHot(Convert.ToInt32(hddRecord.Value), Language.language, "1");
            //table = newsGroupBSO.GetNewsGroupHot(Language.language, Convert.ToInt32(hddRecord.Value), "1", groupcate);
            AspNetCache.SetCacheWithTime("Table_Mainhome_ltlHotNewsSlider_" + hddValue.Value + "_" + Language.language.Replace("-", "_"), table, 150);
        }
        else
        {
            table = (DataTable)AspNetCache.GetCache("Table_Mainhome_ltlHotNewsSlider_" + hddValue.Value + "_" + Language.language.Replace("-", "_"));
        }


        // string strHotNewsSlider = "";


        if (table.Rows.Count > 0)
        {
            rptLListNews.DataSource = table;
            rptLListNews.DataBind();
        }

        //ltlHotNewsSlider.Text = strHotNewsSlider;
    }
Exemplo n.º 2
0
    void GetNewsGroup(int cateID, int groupcate)
    {
        string    strCate = GetCateParentIDArrayByID(cateID, groupcate);
        DataTable table   = new DataTable();

        if (AspNetCache.CheckCache("HTML_ltlNews_MainHome_by_cate_list1_" + hddValue.Value + "_" + Language.language.Replace("-", "_")) == false)
        {
            NewsGroupBSO newsgroupBSO = new NewsGroupBSO();
            table = newsgroupBSO.GetNewsGroupByCateHomeList(strCate, groupcate, "1", Convert.ToInt32(hddRecord.Value), "1");
            AspNetCache.SetCacheWithTime("HTML_ltlNews_MainHome_by_cate_list1_" + hddValue.Value + "_" + Language.language.Replace("-", "_"), table, 150);
        }
        else
        {
            table = (DataTable)AspNetCache.GetCache("HTML_ltlNews_MainHome_by_cate_list1_" + hddValue.Value + "_" + Language.language.Replace("-", "_"));
        }


        string strHotNewsCate = "";

        if (table.Rows.Count > 0)
        {
            DateTime dtNow = DateTime.Now;

            DataRow dataRow0 = table.Rows[0];
            strHotNewsCate += "<div class='thumbnail no-thumbnail'>";
            strHotNewsCate += "<a href='" + ResolveUrl("~/") + "d4/news/" + GetString(dataRow0["Title"]) + "-" + dataRow0["GroupCate"] + "-" + dataRow0["NewsGroupID"].ToString() + ".aspx' title='" + dataRow0["Title"] + "'>";
            strHotNewsCate += "<div class='embed-image ratio-16-9'>";
            if (dataRow0["ImageThumb"].ToString() != "")
            {
                strHotNewsCate += "<img class='img-responsive' src='" + Utils.getURLThumbImage(dataRow0["ImageThumb"].ToString(), 330) + "' alt='" + dataRow0["Title"] + "'>";
            }
            else
            {
                strHotNewsCate += "<img class='img-responsive' src='" + Utils.getURLThumbImage(ResolveUrl("~/") + "images/img_logo.jpg", 330) + "'  alt='" + dataRow0["Title"] + "'>";
            }
            strHotNewsCate += "</div>";
            strHotNewsCate += "</a>";

            strHotNewsCate += "<div class='caption'>";
            strHotNewsCate += "<h3 class='title-news'>";
            strHotNewsCate += "<a href='" + ResolveUrl("~/") + "d4/news/" + GetString(dataRow0["Title"]) + "-" + dataRow0["GroupCate"] + "-" + dataRow0["NewsGroupID"].ToString() + ".aspx' title='" + dataRow0["Title"] + "'>";

            strHotNewsCate += dataRow0["Title"].ToString();
            strHotNewsCate += "</a>";
            strHotNewsCate += "<span style='color: #6D6D6D; font-size: 12px;'> (" + Convert.ToDateTime(dataRow0["PostDate"]).ToString("dd/MM/yyyy") + ")</span>";
            strHotNewsCate += "</h3>";
            strHotNewsCate += "</div>";
            strHotNewsCate += "</div>";
        }
        ltlNewsCateMainHome.Text = strHotNewsCate;
    }
Exemplo n.º 3
0
    private void ViewListCate(int cId, int gId)
    {
        if (!AspNetCache.CheckCache("HTML_ltlListNewsCatebyCate_" + gId + "_" + cId))
        {
            CateNewsBSO  cateNewsBSO     = new CateNewsBSO();
            DataTable    cateClientGroup = cateNewsBSO.getCateClientGroup(cId, Language.language, gId, 6);
            string       text            = "";
            NewsGroupBSO newsGroupBSO    = new NewsGroupBSO();
            DataTable    dataTable       = new DataTable();
            if (cateClientGroup.Rows.Count > 0 && cateClientGroup != null)
            {
                listNewsCatePanel.Visible = true;
                for (int i = 0; i < cateClientGroup.Rows.Count; i++)
                {
                    DataRow dataRow = cateClientGroup.Rows[i];
                    string  cateParentIDArrayByID = GetCateParentIDArrayByID(Convert.ToInt32(dataRow["CateNewsID"]), gId);
                    dataTable = newsGroupBSO.GetNewsGroupByCateHomeList(cateParentIDArrayByID, gId, "1", 5, "1");

                    if (dataTable.Rows.Count > 0)
                    {
                        text += "<div class='r-ro'>";
                        text += "<div class='box-list-content-cate'>";
                        text += "<h2 class='h2'>";

                        text += "<a class='h2-cate' href='" + ResolveUrl("~/") + "c3/" + cateNewsBSO.GetSlugByCateId(Convert.ToInt32(dataRow["CateNewsID"])) + "/" + GetString(dataRow["CateNewsName"].ToString().Trim()) + "-" + dataRow["GroupCate"] + "-" + dataRow["CateNewsID"].ToString() + ".aspx' title='" + dataRow["CateNewsName"].ToString().Trim() + "'>";
                        text += "<span>" + Tool.SubString(Tool.StripTagsCharArray(dataRow["CateNewsName"].ToString().Trim()), 20) + "</span></a>";

                        text += "</h2>";
                        text += "<div class='box-content-main-col-a'>";


                        DataRow dataRow2 = dataTable.Rows[0];
                        text += "<div class='box-tintuc-first'>";
                        text += "<div class='box-tintuc-image'>";

                        text += "<a href='" + ResolveUrl("~/") + "d4/news/" + GetString(dataRow2["Title"]) + "-" + dataRow2["GroupCate"] + "-" + dataRow2["NewsGroupID"].ToString() + ".aspx' title='" + dataRow2["Title"] + "'>";
                        if (dataRow2["ImageLarge"].ToString() != "")
                        {
                            text += "<img class='box-tintuc-landscape' src='" + Utils.getURLThumbImage(dataRow2["ImageLarge"].ToString(), 175) + "' width='175px' height='110px' alt='" + dataRow2["Title"] + "'>";
                        }
                        else if (dataRow2["ImageThumb"].ToString() != "")
                        {
                            text += "<img class='box-tintuc-landscape' src='" + Utils.getURLThumbImage(dataRow2["ImageThumb"].ToString(), 175) + "' width='175px' height='110px' alt='" + dataRow2["Title"] + "'>";
                        }
                        //else
                        //{

                        //    text += "<img class='box-tintuc-landscape' src='" + ResolveUrl("~/") + "images/img_logo.jpg' width='205px' height='120px' alt='" + dataRow2["Title"] + "'>";

                        //}
                        text += "</a>";
                        text += "</div>";
                        text += "<div class='clear'></div>";
                        text += "<div class='box-tintuc-linkabs'>";

                        text += "<a href='" + ResolveUrl("~/") + "d4/news/" + GetString(dataRow2["Title"]) + "-" + dataRow2["GroupCate"] + "-" + dataRow2["NewsGroupID"].ToString() + ".aspx' title='" + dataRow2["Title"] + "'>";

                        text += dataRow2["Title"].ToString();
                        text += "</a>";
                        text += "</div>";
                        text += "</div>";
                        text += "<div class='box-tintuc-linkother'>";
                        text += "<ul>";
                        for (int j = 1; j < dataTable.Rows.Count; j++)
                        {
                            DataRow dataRow3 = dataTable.Rows[j];
                            text += "<li class='ter'>";

                            text += "<a href='" + ResolveUrl("~/") + "d4/news/" + GetString(dataRow3["Title"]) + "-" + dataRow3["GroupCate"] + "-" + dataRow3["NewsGroupID"].ToString() + ".aspx' title='" + dataRow3["Title"] + "'>";

                            text += dataRow3["Title"].ToString();
                            text += "</a>";
                            text += "</li>";
                        }
                        text += "</ul></div>";

                        text += "</div>";
                        text += "</div>";
                        text += "</div>";
                    }
                }
            }
            else
            {
                listNewsCatePanel.Visible = false;
            }
            AspNetCache.SetCacheWithTime("HTML_ltlListNewsCatebyGroup_" + gId, text, 150.0);
            ltlListNewsCate.Text = text;
        }
        else
        {
            ltlListNewsCate.Text = (string)AspNetCache.GetCache("HTML_ltlListNewsCatebyGroup_" + gId);
        }

        if (ltlListNewsCate.Text != "")
        {
            tintuc_col1.Attributes.Add("class", "tintuc-col1");
            //   ViewListCate(cId, gId);
        }
        else
        {
            tintuc_col1.Attributes.Add("class", "tintuc-col-main");
            listNewsCatePanel.Visible = false;
        }
    }
Exemplo n.º 4
0
    void GetNewsGroup(int cateID, int groupcate)
    {
        DataTable table = new DataTable();

        if (AspNetCache.CheckCache("HTML_ltlNews_MainHome_by_cate_list_" + hddValue.Value + "_" + Language.language.Replace("-", "_")) == false)
        {
            string strCate = GetCateParentIDArrayByID(cateID, groupcate);

            NewsGroupBSO newsgroupBSO = new NewsGroupBSO();
            table = newsgroupBSO.GetNewsGroupByCateHomeList(strCate, groupcate, "1", Convert.ToInt32(hddRecord.Value), "1");

            AspNetCache.SetCacheWithTime("HTML_ltlNews_MainHome_by_cate_list_" + hddValue.Value + "_" + Language.language.Replace("-", "_"), table, 150);
        }
        else
        {
            table = (DataTable)AspNetCache.GetCache("HTML_ltlNews_MainHome_by_cate_list_" + hddValue.Value + "_" + Language.language.Replace("-", "_"));
        }

        string strNewsCateSlider = "";
        string text1             = "";

        if (table.Rows.Count > 0)
        {
            DateTime dtNow    = DateTime.Now;
            DataRow  dataRow0 = table.Rows[0];
            text1 += "<div class='col-lg-3 col-md-4 col-sm-6 col-xs-12'>";
            text1 += "<div class='box-news-thumb'>";
            text1 += "<div class='thumbnail no-thumbnail thumbnail-style thumbnail-kenburn'>";
            text1 += "<a href='" + ResolveUrl("~/") + "d4/news/" + GetString(dataRow0["Title"]) + "-" + dataRow0["GroupCate"] + "-" + dataRow0["NewsGroupID"].ToString() + ".aspx' title='" + dataRow0["Title"] + "'>";
            text1 += "<div class='embed-image ratio-16-9'>";
            if (dataRow0["ImageThumb"].ToString() != "")
            {
                text1 += "<img class='img-responsive' src='" + Utils.getURLThumbImage(dataRow0["ImageThumb"].ToString(), 330) + "' alt='" + dataRow0["Title"] + "'>";
            }
            else
            {
                text1 += "<img class='img-responsive' src='" + Utils.getURLThumbImage(ResolveUrl("~/") + "images/img_logo.jpg", 330) + "'  alt='" + dataRow0["Title"] + "'>";
            }
            text1 += "</div>";
            text1 += "</a>";


            text1 += "<div class='caption'>";
            text1 += "<h3 class='title-news'>";
            text1 += "<a href='" + ResolveUrl("~/") + "d4/news/" + GetString(dataRow0["Title"]) + "-" + dataRow0["GroupCate"] + "-" + dataRow0["NewsGroupID"].ToString() + ".aspx' title='" + dataRow0["Title"] + "'>";

            text1 += dataRow0["Title"].ToString();
            if (Convert.ToDateTime(dataRow0["PostDate"].ToString()).Date >= dtNow.Date)
            {
                text1 += "<span class='fs12 fa fa-star text-danger pl5'></span>";
            }
            text1 += "</a> <br/>";
            text1 += "<span style='color: #6D6D6D; font-size: 12px;'> (" + Convert.ToDateTime(dataRow0["PostDate"]).ToString("dd/MM/yyyy") + ")</span>";
            text1 += "</h3>";
            text1 += "</div>";
            text1 += "</div>";
            text1 += "</div>";
            text1 += "</div>";

            int col = 0;
            int dem = 0;
            for (int i = 1; i < table.Rows.Count; i++)
            {
                DataRow dataRow = table.Rows[i];

                if (dem == 0)
                {
                    col++;
                    text1 += "<div class='col-lg-3 col-md-4 col-sm-6 col-xs-12 " + ((col == 3) ? "hidden-md" : "") + "'>";
                    text1 += "<ul class='news-thumb-list'>";
                }
                text1 += "<li>";

                text1 += "<a href='" + ResolveUrl("~/") + "d4/news/" + GetString(dataRow["Title"]) + "-" + dataRow["GroupCate"] + "-" + dataRow["NewsGroupID"].ToString() + ".aspx' title='" + dataRow["Title"] + "'>";

                if (dataRow["ImageThumb"].ToString() != "")
                {
                    text1 += "<img src='" + Utils.getURLThumbImage(dataRow["ImageThumb"].ToString(), 100) + "' alt='" + dataRow["Title"] + "' width='100px' class='image loaded'>";
                }
                else
                {
                    text1 += "<img src='" + Utils.getURLThumbImage(ResolveUrl("~/") + "images/img_logo.jpg", 100) + "'  alt='" + dataRow["Title"] + "' width='100px' class='image loaded'>";
                }

                text1 += "<div class='caption'>";
                text1 += "<span class='title'>";
                text1 += dataRow["Title"].ToString();
                text1 += "</span>";
                text1 += "<span class='sourcename'> (" + Convert.ToDateTime(dataRow["PostDate"]).ToString("dd/MM/yyyy") + ")</span>";
                text1 += "</div>";
                text1 += "</a>";
                text1 += "</li>";

                dem++;

                if (dem == 3)
                {
                    text1 += "</ul>";
                    text1 += "</div>";
                    dem    = 0;
                }
            }

            if (dem > 0)
            {
                text1 += "</ul>";
                text1 += "</div>";
                dem    = 0;
            }

            strNewsCateSlider += text1;
        }


        ltlNewsCateMainHome.Text = strNewsCateSlider;

        DataTable   table1      = new DataTable();
        CateNewsBSO cateNewsBSO = new CateNewsBSO();

        if (AspNetCache.CheckCache("HTML_ltlCateSubMainHome_by_cate_list_" + hddValue.Value + "_" + Language.language.Replace("-", "_")) == false)
        {
            table1 = cateNewsBSO.getCateClientGroup(cateID, Language.language, groupcate, 5);
            AspNetCache.SetCacheWithTime("HTML_ltlCateSubMainHome_by_cate_list_" + hddValue.Value + "_" + Language.language.Replace("-", "_"), table1, 150);
        }
        else
        {
            table1 = (DataTable)AspNetCache.GetCache("HTML_ltlCateSubMainHome_by_cate_list_" + hddValue.Value + "_" + Language.language.Replace("-", "_"));
        }


        string strCateSub = "";

        if (table1.Rows.Count > 0)
        {
            for (int i = 0; i < table1.Rows.Count; i++)
            {
                DataRow dataRow = table1.Rows[i];
                strCateSub += "<li><a href='" + ResolveUrl("~/") + "c3/" + cateNewsBSO.GetSlugByCateId(Convert.ToInt32(dataRow["CateNewsID"])) + "/" + GetString(dataRow["CateNewsName"]) + "-" + dataRow["GroupCate"] + "-" + dataRow["CateNewsID"].ToString() + ".aspx' title='" + dataRow["CateNewsName"] + "'>" + dataRow["CateNewsName"] + "</a></li>";
            }
        }


        ltlCateSub.Text = strCateSub;
    }