protected void load_adv_left(int num_rows)
        {
            Uri    requestUri = Context.Request.Url;
            string baseUrl    = requestUri.Scheme + Uri.SchemeDelimiter + requestUri.Host + (requestUri.IsDefaultPort ? "" : ":" + requestUri.Port);

            int position = 4; string status = "1", result = string.Empty, Title = null, MainFilePath = null;
            BannerController banner_obj = new BannerController();
            DataTable        dt         = banner_obj.GetListByNumPosition(num_rows, position, status);

            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    if (dt.Rows.Count > 0)
                    {
                        Title        = dt.Rows[i]["Title"].ToString();
                        MainFilePath = baseUrl + "/" + main_banner_dir_path + "/" + dt.Rows[i]["MainImage"].ToString();
                        result      += "<li class=\"news-item\"><a class=\"news-item-link\" href='#'><img src='" + MainFilePath + "' width='709' height='306' alt='" + Title + "' /></a></li>";
                    }
                }
            }
            else
            {
                result += "<li class=\"news-item\">Không có dữ liệu</li>";
            }
            adv_left.InnerHtml = "<ul id=\"adv_left_inner\" class=\"ticker\">" + result + "</ul>";
        }
        private void LoadBannerList()
        {
            int num_rows = 3; int position = 1; string status = "1"; string result = string.Empty, Title = string.Empty,

                                                                            ThumbFilePath = string.Empty, MainFilePath = string.Empty;
            Uri              requestUri = Context.Request.Url;
            string           baseUrl    = requestUri.Scheme + Uri.SchemeDelimiter + requestUri.Host + (requestUri.IsDefaultPort ? "" : ":" + requestUri.Port);
            BannerController banner_obj = new BannerController();
            DataTable        dt         = banner_obj.GetListByNumPosition(num_rows, position, status);

            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    ThumbFilePath = baseUrl + "/" + main_banner_dir_path + "/" + dt.Rows[i]["ThumbImage"].ToString();
                    MainFilePath  = baseUrl + "/" + main_banner_dir_path + "/" + dt.Rows[i]["MainImage"].ToString();
                    Title         = dt.Rows[i]["Title"].ToString();
                    result       += "<li data-delay=\"6000\">"
                                    + "<a href=\"" + MainFilePath + "\" title=\"Sexy Surf\"><img src=\"" + ThumbFilePath + "\" /></a>"
                                    + "</li>";

                    //if (i < dt.Rows.Count - 1)
                    //      result += "<img src=\"" + FilePath + "\" alt=\"" + Title + "\"  />";
                    //else
                    //    result += "<img src=\"" + FilePath + "\" alt=\"" + Title + "\"  />";
                }
            }
            else
            {
                result = "Không có dữ liệu";
            }
            Literal_TopBanner.Text = "<ul>" + result + "</ul>";
        }
        public void LoadBannerList()
        {            
            int num_rows = 3; int position = 1; string status = "1"; string result = string.Empty, Title = string.Empty, 
                ThumbFilePath = string.Empty, MainFilePath = string.Empty;
            Uri requestUri = Context.Request.Url;
            string baseUrl = requestUri.Scheme + Uri.SchemeDelimiter + requestUri.Host + (requestUri.IsDefaultPort ? "" : ":" + requestUri.Port);
            BannerController banner_obj = new BannerController();
            DataTable dt = banner_obj.GetListByNumPosition(num_rows, position, status);
            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    ThumbFilePath = baseUrl + "/" + main_banner_dir_path + "/" + dt.Rows[i]["ThumbImage"].ToString();
                    MainFilePath = baseUrl + "/" + main_banner_dir_path + "/" + dt.Rows[i]["MainImage"].ToString();
                    Title = dt.Rows[i]["Title"].ToString();
                    result += "<li data-delay=\"6000\">"
                                +"<a href=\""+MainFilePath+"\" title=\"Sexy Surf\"><img src=\""+ThumbFilePath+"\" /></a>"
                              +"</li>";

                    //if (i < dt.Rows.Count - 1)
                    //      result += "<img src=\"" + FilePath + "\" alt=\"" + Title + "\"  />";
                    //else
                    //    result += "<img src=\"" + FilePath + "\" alt=\"" + Title + "\"  />";
                }
            }
            else
                result = "Không có dữ liệu";
            Literal_TopBanner.Text = "<ul>" + result+"</ul>";
        }
        public string LoadBannerList()
        {
            BannerController banner_obj = new BannerController();
            int       num_rows = 3; int position = 1; string status = "1"; string result = string.Empty, title = string.Empty, FileName = string.Empty;
            DataTable dt = banner_obj.GetListByNumPosition(num_rows, position, status);

            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    FileName = dt.Rows[i]["MainImage"].ToString();
                    Uri    requestUri = Context.Request.Url;
                    string baseUrl    = requestUri.Scheme + Uri.SchemeDelimiter + requestUri.Host + (requestUri.IsDefaultPort ? "" : ":" + requestUri.Port);
                    if (i < dt.Rows.Count - 1)
                    {
                        result += baseUrl + "/user_files/images/banner_images/main_images/" + FileName + ",";
                    }
                    else
                    {
                        result += baseUrl + "/user_files/images/banner_images/main_images/" + FileName;
                    }
                }
            }
            else
            {
                result = "Không có dữ liệu";
            }
            return(result);
        }
示例#5
0
        public void LoadBannerList()
        {
            BannerController banner_obj = new BannerController();
            int       num_rows = 3; int position = 1; string status = "1"; string result = string.Empty, Title = string.Empty, FilePath = string.Empty;
            Uri       requestUri = Context.Request.Url;
            string    baseUrl    = requestUri.Scheme + Uri.SchemeDelimiter + requestUri.Host + (requestUri.IsDefaultPort ? "" : ":" + requestUri.Port);
            DataTable dt = banner_obj.GetListByNumPosition(num_rows, position, status);

            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    FilePath = baseUrl + "/user_files/images/banner_images/" + dt.Rows[i]["FileName"].ToString();
                    Title    = dt.Rows[i]["Title"].ToString();
                    result  += "<img src=\"" + FilePath + "\" alt=\"" + Title + "\"  />";
                    //if (i < dt.Rows.Count - 1)
                    //      result += "<img src=\"" + FilePath + "\" alt=\"" + Title + "\"  />";
                    //else
                    //    result += "<img src=\"" + FilePath + "\" alt=\"" + Title + "\"  />";
                }
            }
            else
            {
                result = "Không có dữ liệu";
            }
            Literal_TopBanner.Text = result;
        }
 public string LoadBannerList()
 {
     BannerController banner_obj = new BannerController();            
     int num_rows = 3; int position = 1; string status = "1"; string result = string.Empty, title = string.Empty, FileName = string.Empty;
     DataTable dt = banner_obj.GetListByNumPosition(num_rows, position, status);
     if (dt.Rows.Count > 0)
     {
         for (int i = 0; i < dt.Rows.Count; i++)
         {
             FileName = dt.Rows[i]["MainImage"].ToString();
             Uri requestUri = Context.Request.Url;
             string baseUrl = requestUri.Scheme + Uri.SchemeDelimiter + requestUri.Host + (requestUri.IsDefaultPort ? "" : ":" + requestUri.Port);
             if (i < dt.Rows.Count - 1)
                 result += baseUrl + "/user_files/images/banner_images/main_images/" + FileName + ",";
             else
                 result += baseUrl + "/user_files/images/banner_images/main_images/" + FileName;
         }
     }
     else
         result = "Không có dữ liệu";
     return result;
 }
        protected void load_adv_right(int num_rows)
        {            
            int position = 5; 
            string status = "1", result = string.Empty, Title = null, MainFilePath = null;
            Uri requestUri = Context.Request.Url;
            string baseUrl = requestUri.Scheme + Uri.SchemeDelimiter + requestUri.Host + (requestUri.IsDefaultPort ? "" : ":" + requestUri.Port);
            BannerController banner_obj = new BannerController();
            DataTable dt = banner_obj.GetListByNumPosition(num_rows, position, status);
            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    MainFilePath = baseUrl + "/" + main_banner_dir_path + "/" + dt.Rows[i]["MainImage"].ToString();
                    Title = dt.Rows[i]["Title"].ToString();
                    result += "<li class=\"news-item\"><a class=\"news-item-link\" href='#'><img src='" + MainFilePath + "' width='709' height='306' alt='" + Title + "' /></a></li>";
                }
            }else
                result = "<li class=\"news-item\">Đang Cập Nhật</li>";
            adv_right.InnerHtml = "<ul id=\"adv_right_inner\" class=\"ticker\">" + result + "</ul>";

        }