protected void btn_Delete_Click(object sender, EventArgs e) { ExtendBLL.TeachingMissionLab teaMis = new ExtendBLL.TeachingMissionLab(); List<string> strTable = new List<string>(); List<string> strID = new List<string>(); List<string> strColumn = new List<string>(); for (int i = 0; i < Gv_Mission.Rows.Count; i++) { CheckBox cb = (CheckBox)Gv_Mission.Rows[i].Cells[0].FindControl("chk"); if (cb.Checked == true) { #region ��ѧ������ strTable.Add("TeachMission"); strColumn.Add("ID"); strID.Add(Gv_Mission.DataKeys[i].Value.ToString()); #endregion #region ѡ�ΰ༶ strTable.Add("ClassItem"); strColumn.Add("TeachMissionID"); strID.Add(Gv_Mission.DataKeys[i].Value.ToString()); #endregion } } try { teaMis.DeleteTeaMis(strID, strTable, strColumn); } catch { Page.ClientScript.RegisterClientScriptBlock(GetType(), "", "<script type='text/javascript'>alert('ɾ��ʧ��')</script>"); return; } Page.ClientScript.RegisterClientScriptBlock(GetType(), "", "<script type='text/javascript'>alert('ɾ���ɹ�')</script>"); Gv_DataBinds(); }
protected void Gv_DataBinds() { ExtendBLL.TeachingMissionLab TeachMissionLab = new ExtendBLL.TeachingMissionLab(); List<ExtendModule.TeachingMissionLab> ls = new List<ExtendModule.TeachingMissionLab>(); ls = TeachMissionLab.GetModelList2(CombineStr()); Gv_Mission.DataSource = ls; Gv_Mission.DataBind(); }