示例#1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (!string.IsNullOrEmpty(Request.QueryString["expressId"]))
         {
             int expressId = int.Parse(Request.QueryString["expressId"].ToString());
             bindModel(expressId);
             btnUpdate.Visible = true;
             Button1.Visible   = false;
         }
         else
         {
             Button1.Visible = true;
         }
         if (!string.IsNullOrEmpty(Request.QueryString["exId"]))
         {
             int expressId = int.Parse(Request.QueryString["exId"].ToString());
             if (!bll.Delete(expressId))
             {
                 Response.Write("<script>alert('删除失败!');document.location='ExpressMange.aspx'</script>");
             }
             else
             {
                 Response.Redirect("ExpressMange.aspx");
             }
         }
     }
 }
    protected void Button1_Click(object sender, EventArgs e)
    {
        bool flag = false;

        string[] values = Request.Form.GetValues("cbxSelect");
        //string[] values = Request.Form.GetValues("inType");
        if (values == null || values.Length < 1)
        {
            Tz888.Common.MessageBox.Show(this.Page, "请选择要删除的资源!");
            return;
        }
        else
        {
            foreach (string str in values)
            {
                if (!bll.Delete(int.Parse(str.ToString().Trim())))
                {
                    flag = true;
                }
            }
            if (flag)
            {
                Tz888.Common.MessageBox.Show(this.Page, "删除失败");
            }
            this.GetInfoNews();
        }
    }