protected void Page_Load(object sender, EventArgs e) { strPagePrivilege.Add("CKSJ"); strPageUserType.Add("mana"); strPageUserType.Add("teacher"); try { if (!Page.IsPostBack) { #region get key int key = 0; if (Request.QueryString["key"] != null) { key = int.Parse(Request.QueryString["key"]); } #endregion LabMS.BLL.ResearchResult bll = new LabMS.BLL.ResearchResult(); LabMS.Model.ResearchResult rr; rr = bll.GetModel(key); if (rr == null) { throw new Exception("�Բ���,�������Ѿ���ɾ��!"); } lblBanZhengShiJian.Text = rr.BanZhengShiJian; lblChengGuoBianHao.Text = rr.ChengGuoBianHao; lblChengGuoDengJi.Text = rr.ChengGuoDengJi; lblChengGuoLeiBie.Text = rr.ChengGuoLeiBie; lblChengGuoLieXing.Text = rr.ChengGuoLieXing; lblChengGuoMingCheng.Text = rr.ChengGuoMingCheng; lblChengGuoZuoZe.Text = rr.ChengGuoZuoZe; lblDanWeiMingCheng.Text = rr.DanWeiMingCheng; lblID.Text = rr.ID; lblShiFouJiangLi.Text = rr.ShiFouJiangLi; lblShuMingDanWei.Text = rr.ShuMingDanWei; lblShuMingZuoZe.Text = rr.ShuMingZuoZe; lblXueXiaoShenHe.Text = rr.XueXiaoShenHe; lblXueYuanShenHe.Text = rr.XueYuanShenHe; } } catch { } }
protected void BtnDelete_Click(object sender, EventArgs e) { CheckBox cb; int key; LabMS.BLL.ResearchResult bll = new LabMS.BLL.ResearchResult(); for (int i = GridViewResultList.Rows.Count - 1; i > -1; i--) { cb = (CheckBox)GridViewResultList.Rows[i].FindControl("CBSelect"); if (cb.Checked) { key = int.Parse(GridViewResultList.DataKeys[i].Value.ToString()); bll.Delete(key); } } BindData(); WriteBackScript("alert('�ѳɹ�ɾ���������')"); }