コード例 #1
0
ファイル: newslist.aspx.cs プロジェクト: chuntian1983/nccqjy
        protected void btnshenhe_Click(object sender, EventArgs e)
        {
            int    i     = 0;
            string sysID = string.Empty;

            foreach (RepeaterItem row in this.rep.Items)
            {
                if (row.ItemType == ListItemType.Item || row.ItemType == ListItemType.AlternatingItem)
                {
                    CheckBox chk  = (CheckBox)row.FindControl("cbx");
                    Label    lbid = (Label)row.FindControl("lbid");
                    if (chk.Checked)
                    {
                        i++;
                        sysID = lbid.Text;
                        NCPEP.Bll.T_News   bll   = new NCPEP.Bll.T_News();
                        NCPEP.Model.T_News model = bll.GetModel(int.Parse(sysID));
                        model.IsCheck = 1;
                        bll.Update(model);
                    }
                }
            }
            if (i == 0)
            {
                MessageBox.Show(this, "请选择需要审核的项!");
            }
            else
            {
                MessageBox.Show(this, "已成功审核所选项!");
                BindDate();
            }
        }
コード例 #2
0
ファイル: newsview.aspx.cs プロジェクト: chuntian1983/nccqjy
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Request.QueryString["id"] != null)
     {
         NCPEP.Model.T_News model = new NCPEP.Model.T_News();
         NCPEP.Bll.T_News   bll   = new NCPEP.Bll.T_News();
         model = bll.GetModel(int.Parse(Request.QueryString["id"]));
         this.txtContent.Text        = model.Content;
         this.txtKeyword.Text        = model.Keyword;
         this.txtNewsSource.Text     = model.NewsSource;
         this.txtNewsSubheading.Text = model.NewsSubheading;
         this.txtNewsTitle.Text      = model.NewsTitle;
         this.txtNewsTypeId.Text     = model.NewsTypeId.ToString();//新闻类型
         this.txtsj.Text             = model.CreateDate.ToString("yyyy-MM-dd");
         this.content1.Text          = model.NewsContent;
         this.fileNewsImg.ImageUrl   = "../../newsimg/max/" + model.NewsImg;
         NCPEP.Bll.T_Fujian fjbll = new NCPEP.Bll.T_Fujian();
         DataSet            ds    = fjbll.GetList("fid='" + model.Id + "'");
         if (ds.Tables[0].Rows.Count > 0)
         {
             this.repfujian.Visible    = true;
             this.repfujian.DataSource = ds;
             this.repfujian.DataBind();
         }
     }
 }
コード例 #3
0
ファイル: JbOne.aspx.cs プロジェクト: chuntian1983/nccqjy
        protected void btnquxiao_Click(object sender, EventArgs e)
        {
            int    i     = 0;
            string sysID = string.Empty;

            foreach (RepeaterItem row in this.rep.Items)
            {
                if (row.ItemType == ListItemType.Item || row.ItemType == ListItemType.AlternatingItem)
                {
                    CheckBox chk  = (CheckBox)row.FindControl("cbx");
                    Label    lbid = (Label)row.FindControl("lbid");
                    if (chk.Checked)
                    {
                        i++;
                        sysID = lbid.Text;
                    }
                }
            }
            if (i == 0)
            {
                MessageBox.Show(this, "请选择需要查看的项!");
            }
            else if (i > 1)
            {
                MessageBox.Show(this, "只能选择一项进行操作");
            }
            else
            {
                NCPEP.Bll.T_News   newsbll   = new NCPEP.Bll.T_News();
                NCPEP.Model.T_News newsmodel = new NCPEP.Model.T_News();
                newsmodel = newsbll.GetModel(int.Parse(sysID));
                if (newsmodel != null)
                {
                    if (newsmodel.NewsTypeId != 9)
                    {
                        MessageBox.Show(this, "请选择通知公告类型的信息进行设置!");
                    }
                    else
                    {
                        NCPEP.Bll.T_Notice bllnotice = new NCPEP.Bll.T_Notice();


                        if (bllnotice.DeleteNotice(sysID))
                        {
                            MessageBox.Show(this, "取消成功!");
                        }
                    }
                }
            }
        }