Exemple #1
0
        protected void datanewsquan_ItemDataBound(object sender, DataListItemEventArgs e)
        {
            Maticsoft.BLL.NewsInfo newbll = new Maticsoft.BLL.NewsInfo();
            int index = int.Parse(datanewsquan.DataKeys[e.Item.ItemIndex].ToString());
            //DataSet bllds = newbll.GetList("NewsTypeID="+index+"");
            int pageSize = 5; //每页大小
            int page     = 1; //当前第几页
            int recordCount;  //总共有多少条数据

            if (Request.QueryString["page"] != null)
            {
                if (Request.QueryString["page"].ToString() != "")
                {
                    page = int.Parse(Request.QueryString["page"].ToString());
                }
            }
            recordCount = newbll.GetNewCount("NewsTypeID=" + index + "");
            int pageCount = recordCount / pageSize + 1;//共有多少页

            if (recordCount % pageSize == 0)
            {
                pageCount--;
            }
            DataSet  bllds  = newbll.GeNewsList(pageSize * (page - 1), pageSize, "NewsTypeID=" + index + "");
            DataList dlNews = e.Item.FindControl("datanewsfen") as DataList;

            dlNews.DataSource = bllds;
            dlNews.DataBind();
            Maticsoft.BLL.NewsTypeInfo   typebll   = new Maticsoft.BLL.NewsTypeInfo();
            Maticsoft.Model.NewsTypeInfo typemodel = typebll.GetModel(int.Parse(this.datanewsquan.DataKeys[e.Item.ItemIndex].ToString()));
            Label lbltype = e.Item.FindControl("lbltype") as Label;

            lbltype.Text = typemodel.NewsTypeTitle;
            Label lblpage = e.Item.FindControl("lblpage") as Label;
        }
Exemple #2
0
 private void ShowInfo(int NewsTypeID)
 {
     Maticsoft.BLL.NewsTypeInfo   bll   = new Maticsoft.BLL.NewsTypeInfo();
     Maticsoft.Model.NewsTypeInfo model = bll.GetModel(NewsTypeID);
     this.lblNewsTypeID.Text    = model.NewsTypeID.ToString();
     this.txtNewsTypeTitle.Text = model.NewsTypeTitle;
 }
Exemple #3
0
        protected void datamess_ItemDataBound(object sender, DataListItemEventArgs e)
        {
            int index = int.Parse(datamess.DataKeys[e.Item.ItemIndex].ToString());

            Maticsoft.BLL.NewsInfo   newbll   = new Maticsoft.BLL.NewsInfo();
            Maticsoft.Model.NewsInfo newmodel = newbll.GetModel(index);
            int typeid = int.Parse(newmodel.NewsTypeID.ToString());

            Maticsoft.BLL.NewsTypeInfo   typebll   = new Maticsoft.BLL.NewsTypeInfo();
            Maticsoft.Model.NewsTypeInfo typemodel = typebll.GetModel(typeid);
            ((Label)e.Item.FindControl("lbltype")).Text = typemodel.NewsTypeTitle;
        }
Exemple #4
0
        private void bind(int newsid)
        {
            Maticsoft.BLL.NewsInfo   newbll   = new Maticsoft.BLL.NewsInfo();
            Maticsoft.Model.NewsInfo newmodel = newbll.GetModel(newsid);
            int typeid = int.Parse(newmodel.NewsTypeID.ToString());

            Maticsoft.BLL.NewsTypeInfo   typebll   = new Maticsoft.BLL.NewsTypeInfo();
            Maticsoft.Model.NewsTypeInfo typemodel = typebll.GetModel(typeid);
            lblFatime.Text         = Convert.ToDateTime(newmodel.Fatime.ToString()).ToString("yyyy-MM-dd");
            lblNewsContent.Text    = newmodel.NewsContent;
            lblNewsTitle.Text      = newmodel.NewsTitle;
            lblNewsTypeTitle.Text  = typemodel.NewsTypeTitle;
            lblNewsTypeTitle1.Text = typemodel.NewsTypeTitle;
            lblWrite.Text          = newmodel.Write;
            imgnews.ImageUrl       = newmodel.ImageURL;
        }
Exemple #5
0
        private void bind()
        {
            Maticsoft.BLL.NewsInfo newsbll = new Maticsoft.BLL.NewsInfo();
            int index = int.Parse(Request.QueryString["NewsID"].ToString());

            Maticsoft.Model.NewsInfo   newmodel = newsbll.GetModel(index);
            Maticsoft.BLL.NewsTypeInfo typebll  = new Maticsoft.BLL.NewsTypeInfo();
            int typeid = int.Parse(newmodel.NewsTypeID.ToString());

            Maticsoft.Model.NewsTypeInfo typemodel = typebll.GetModel(typeid);
            lblkey.Text       = newmodel.NewsKey;
            lblstarttime.Text = Convert.ToDateTime(newmodel.Fatime.ToString()).ToString("yyyy-MM-dd");
            lbltitle.Text     = newmodel.NewsTitle;
            lbltype.Text      = typemodel.NewsTypeTitle;
            lblwrite.Text     = newmodel.Write;
            Image1.ImageUrl   = newmodel.ImageURL;
            txtcontent.Text   = newmodel.NewsContent;
        }