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_XMGG bll = new NCPEP.Bll.T_XMGG(); NCPEP.Model.T_XMGG model = new NCPEP.Model.T_XMGG(); model = bll.GetModel(int.Parse(sysID)); if (model != null) { model.xmby = "0"; if (bll.Update(model)) { MessageBox.Show(this, "取消成功!"); BindDate(); } } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.QueryString["id"] != null) { NCPEP.Model.T_XMGG model = new NCPEP.Model.T_XMGG(); NCPEP.Bll.T_XMGG bll = new NCPEP.Bll.T_XMGG(); model = bll.GetModel(int.Parse(Request.QueryString["id"])); if (model != null) { this.lbxmmc.Text = model.bid.ToString(); NCPEP.Model.T_Bid modelb = new NCPEP.Model.T_Bid(); NCPEP.Bll.T_Bid bllb = new NCPEP.Bll.T_Bid(); modelb = bllb.GetModel(model.bid); this.lbxmmc.Text = modelb.BidName; this.txtNewsTitle.Text = model.xmtitle; this.txtsj.Text = model.xmsj; this.lbconten.Text = model.xmneirong; } } } }