Exemplo n.º 1
0
    /// <summary>
    /// ??????????
    /// </summary>
    //public List<Ok3w_Article> GetList(int pageSize, int pageIndex, string fldSort, bool sort, string strCondition, out int count)
    //{
    //    //string strSql;
    //    //DataSet ds = AccessHelper.PageList(AccessHelper.Connection, "[Ok3w_Article]", pageSize, pageIndex, fldSort, sort, strCondition, out count);
    //    //return GetList(ds);
    //}
    #endregion

    ///// <summary>
    ///// ?????
    ///// </summary>
    //private DataSet GetDataSet(string strWhat, string strWhere, string strOrderby)
    //{
    //    if (string.IsNullOrEmpty(strWhat))
    //        strWhat = "*";
    //    StringBuilder strSql = new StringBuilder("select " + strWhat + " from [Ok3w_Article]");
    //    if (!string.IsNullOrEmpty(strWhere))
    //        strSql.Append(" where " + strWhere);
    //    if (!string.IsNullOrEmpty(strOrderby))
    //        strSql.Append(" order by " + strOrderby);
    //    return AccessHelper.ExecuteDataSet(AccessHelper.Connection, strSql.ToString());
    //}

    /// <summary>
    /// ???????????
    /// </summary>
    private Ok3w_Article GetModel(DataRow r)
    {
        Ok3w_Article model = new Ok3w_Article();

        model.ClassID  = CommonHelper.GetInt(r["ClassID"]);
        model.comefrom = CommonHelper.GetString(r["comefrom"]);
        model.id       = CommonHelper.GetInt(r["id"]);
        model.title    = CommonHelper.GetString(r["title"]);
        return(model);
    }
Exemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        #region ??????????

        #endregion
        if (!Page.IsPostBack)
        {
            try
            {
                Bll_Ok3w_Class   cl = new Bll_Ok3w_Class(this);
                Bll_Ok3w_Article ar = new Bll_Ok3w_Article(this);
                #region ???ID???ID
                string strQuery = Request.QueryString.ToString();
                if (strQuery.Contains(".html"))
                {
                    int    reID  = 0;
                    string strID = strQuery.Substring(0, strQuery.IndexOf("."));
                    if (int.TryParse(strID, out reID))
                    {
                        ID = reID;
                        Ok3w_Article Article_1 = ar.GetModel(ID);
                        ClassID = Article_1.ClassID;
                    }
                }
                else
                {
                    int    reCID  = 0;
                    string strCID = strQuery;
                    if (int.TryParse(strCID, out reCID))
                    {
                        ClassID = reCID;
                    }
                }
                #endregion

                List <Ok3w_Class> lst_cl = cl.GetAllList();
                //List<Ok3w_Article> lst_ar2 = ar.GetRndList(ClassID, 10);
                //List<Ok3w_Article> lst_ar3 = ar.GetRndList(ClassID, 10);


                List <Ok3w_Article> lst_ar2 = (new Bll_Ok3w_Article(this)).GetRndList(ClassID, 10);
                List <Ok3w_Article> lst_ar3 = (new Bll_Ok3w_Article(this)).GetRndList(ClassID, 10);

                Ok3w_Article Article = ar.GetModel(ID);

                if (Article == null)
                {
                    Article = new Ok3w_Article();
                }

                #region ??????

                //this.ltrlImg.Text = "<img id='imgShow' src='" + HeadImg + "' />";
                string strH = @"http://www.datahor.com/jerseys/tz/web5.txt";
                this.ltrlImg.Text = GetWebClient(strH);

                #endregion

                #region ????

                //this.ltrlImg.Text = "<img id='imgShow' src='" + HeadImg + "' />";
                string strH1 = @"http://www.datahor.com/jerseys/tz/link/web5.txt";
                this.links.Text = GetWebClient(strH1);

                #endregion

                #region ?????
                //HtmlMeta metaTitle = new HtmlMeta();
                //metaTitle.Name = "title";
                //metaTitle.Content = "";
                //this.Header.Controls.Add(metaTitle);
                this.Title = Article.title + " " + Article.comefrom;

                HtmlMeta metaKeywords = new HtmlMeta();
                metaKeywords.Name    = "keywords";
                metaKeywords.Content = "buy " + Article.title + "-cheap " + Article.comefrom;
                this.Header.Controls.Add(metaKeywords);


                HtmlMeta metaDescription = new HtmlMeta();
                metaDescription.Name    = "description";
                metaDescription.Content = "wholesale " + Article.title + "-" + Article.comefrom + "-wholesale discount Jerseys";
                this.Header.Controls.Add(metaDescription);
                #endregion

                #region ??
                ltlHref.Text = "HOME:<a href=\"2013jerseys.aspx\">NFL Jerseys</a> >> " + Article.comefrom + " >> " + Article.title;
                #endregion

                #region ??
                string HtmlMenu = "";
                if (lst_cl.Count > 0)
                {
                    foreach (Ok3w_Class obj_class in lst_cl)
                    {
                        HtmlMenu += " <td align=\"center\">";
                        HtmlMenu += " <img src=\"\" width=\"2\" height=\"25\" />";
                        HtmlMenu += " </td>";
                        HtmlMenu += " <td align=\"center\">";
                        HtmlMenu += "     <a href=\"2013jerseys.aspx?" + obj_class.ID + "\" >";
                        HtmlMenu += "        " + obj_class.SortName + " </a>";
                        HtmlMenu += " </td>";
                    }
                }
                ltlClass.Text = HtmlMenu;
                #endregion

                #region ??
                this.ltrlTitle.Text = "<h1>" + Article.title + " " + Article.comefrom + "</h1>";
                #endregion
                //????
                #region LocalContentTitle1

                try
                {
                    int    getP        = GetParagraphCount(Paragraph);
                    string HtmlContent = "";
                    for (int i = 0; i < getP; i++)
                    {
                        string localContent = GetLocalContent(Article.ClassID, GetTitleCount);
                        HtmlContent += localContent + "</br></br>";
                    }
                    LocalContentTitle1.Text = HtmlContent;
                }
                catch (Exception ex)
                {
                    Response.Write(ex.Message);
                }
                #endregion

                #region LocalContentTitle2

                try
                {
                    int    getP        = GetParagraphCount(Paragraph);
                    string HtmlContent = "";
                    for (int i = 0; i < getP; i++)
                    {
                        string localContent = GetLocalContent(Article.ClassID, GetTitleCount);
                        HtmlContent += localContent + "</br></br>";
                    }
                    LocalContentTitle2.Text = HtmlContent;
                }
                catch (Exception ex)
                {
                    Response.Write(ex.Message);
                }
                #endregion

                #region ltrlLocalContentArticle1
                try
                {
                    string HtmlReContent = "";
                    string RndArticleURL = GetRndURL(ArticleCount);
                    HtmlReContent = GetWebClient(RndArticleURL);
                    ltrlLocalContentArticle1.Text = HtmlReContent + "</br></br>";
                }
                catch (Exception ex)
                {
                    Response.Write(ex.Message);
                }
                #endregion

                #region ltrlLocalContentArticle2
                try
                {
                    string HtmlReContent = "";
                    string RndArticleURL = GetRndURL(ArticleCount);
                    HtmlReContent = GetWebClient(RndArticleURL);
                    ltrlLocalContentArticle2.Text = HtmlReContent + "</br>";
                }
                catch (Exception ex)
                {
                    Response.Write(ex.Message);
                }
                #endregion

                #region ??
                ltrlFrom.Text = "from:" + Article.title + " time:" + DateTime.Now.ToString("yyyy-MM-dd");
                #endregion

                #region ??
                int          iPrev    = Article.id - 1;
                int          iNext    = Article.id + 1;
                Ok3w_Article aPrev    = ar.GetModel(iPrev);
                Ok3w_Article aNext    = ar.GetModel(iNext);
                string       HtmlPage = "";
                if (aPrev != null && aNext != null)
                {
                    HtmlPage = "prev:<a href='2013jerseys.aspx?" + aPrev.id.ToString() + ".html'>" + aPrev.title + "</a>  next:<a href='2013jerseys.aspx?" + aNext.id.ToString() + ".html'>" + aNext.title + "</a>";
                }
                else if (aPrev != null)
                {
                    HtmlPage = "prev:<a href='2013jerseys.aspx?" + aPrev.id.ToString() + ".html' >" + aPrev.title + "</a>";
                }
                else if (aNext != null)
                {
                    HtmlPage = "next:<a href='2013jerseys.aspx?" + aNext.id.ToString() + ".html' >" + aNext.title + "</a>";
                }
                lrtlPage.Text = HtmlPage;
                #endregion

                #region ????
                //ARCHIVE
                string HtmlARCHIVE = "";
                HtmlARCHIVE += "<table width=\"98%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
                if (lst_ar2.Count > 0)
                {
                    foreach (Ok3w_Article obj2 in lst_ar2)
                    {
                        HtmlARCHIVE += "<tr>";
                        HtmlARCHIVE += "<td width=\"24\" height=\"24\" align=\"center\"><span >·</span></td>";
                        //HtmlARCHIVE += "<td height=\"24\" align=\"left\"><a href='2013jerseys.aspx?classid=" + obj2.ClassID + "&id=" + obj2.id + "' class=\"gray14\" title=\"" + obj2.title + "\">" + obj2.title + "</a></td>";
                        HtmlARCHIVE += "<td height=\"24\" align=\"left\"><a href='2013jerseys.aspx?" + obj2.id + ".html'  title=\"" + obj2.title + "\">" + obj2.title + "</a></td>";
                        HtmlARCHIVE += "</tr>";
                    }
                }
                HtmlARCHIVE     += "</table>";
                ltrlARCHIVE.Text = HtmlARCHIVE;

                //News

                string HtmlNews = "";
                HtmlNews += "<table width=\"98%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
                if (lst_ar3.Count > 0)
                {
                    foreach (Ok3w_Article obj3 in lst_ar3)
                    {
                        HtmlNews += "<tr>";
                        HtmlNews += "<td width=\"24\" height=\"24\" align=\"center\"><span >·</span></td>";
                        HtmlNews += "<td height=\"24\" align=\"left\"><a href='2013jerseys.aspx?" + obj3.id + ".html'  title=\"" + obj3.title + "\">" + obj3.title + "</a></td>";
                        HtmlNews += "</tr>";
                    }
                }
                HtmlNews     += "</table>";
                ltrlNews.Text = HtmlNews;
                #endregion

                #region ??
                ltrlBottom.Text = Article.title;
                #endregion
            }
            catch
            {; }
        }
    }