protected void btn_Delete_Click(object sender, EventArgs e) { ExtendBLL.ApplicationDelete ApplicationDelete = new ExtendBLL.ApplicationDelete(); List<string> ls = new List<string>(); int ID = 0; if (int.TryParse(Request.QueryString["ID"].ToString(), out ID)) { if (HFQueryString != ID) { Page.ClientScript.RegisterClientScriptBlock(GetType(), "script", "<script type='text/javascript'>window.location.href='err.aspx?Message=��ѯ�ַ�������'</script>'"); return; } ls.Add(ID.ToString()); int result= ApplicationDelete.AppDelete(ls); if (result == 1) { Page.ClientScript.RegisterClientScriptBlock(GetType(), "script", "<script type='text/javascript'>alert('ɾ���ɹ�');window.location.href='ApplicationList.aspx';</script>"); return; } else { Page.ClientScript.RegisterClientScriptBlock(GetType(), "script", "<script type='tyep/javascript'>alert('ɾ��ʧ��,����ϵ����Ա�����ظ�����');window.location.href=window.location.href;</script>"); return; } } }
protected void Delete_Click(object sender, EventArgs e) { List<string> ls = new List<string>(); for (int n = 0; n < gv_AppList.Rows.Count; n++) { if (gv_AppList.Rows[n].RowType == DataControlRowType.DataRow) { CheckBox cbox = (CheckBox)gv_AppList.Rows[n].FindControl("Chk"); if (cbox.Checked == true && gv_AppList.DataKeys[n].Values["App_State"].ToString() == "SubmitNotYet") { ls.Add(gv_AppList.DataKeys[n].Value.ToString()); } } } if (ls.Count == 0) { LabMS.Common.JShelper.JSAlert(this, "δѡ��", "δѡ��ɾ����Ŀ"); return; } ExtendBLL.ApplicationDelete App = new ExtendBLL.ApplicationDelete(); int result = App.AppDelete(ls); if (result == 2 || result == -1) { LabMS.Common.JShelper.JSAlert(this, "���ݲ���δ�ɹ�", " ���ݲ���δ�ɹ����Ժ�"); } else { LabMS.Common.JShelper.JSAlert(this, " �������", "���ݲ����ɹ�"); } Gv_DataBind(); }