Esempio n. 1
0
    protected void btnDel_Click(object sender, EventArgs e)
    {
        for (int i = 0; i < dvDisobeyRecord.Rows.Count; i++)
        {
            CheckBox cb = (CheckBox)dvDisobeyRecord.Rows[i].FindControl("input") as CheckBox;
            if (cb.Checked == true)
            {
                HiddenField lfCarID = dvDisobeyRecord.Rows[i].FindControl("lblDR_Id") as HiddenField;
                int         id      = Convert.ToInt32(lfCarID.Value);
                DisobeyRecordManager.delDisobeyRecordById(id);
            }
        }

        Response.Redirect("~/CarManager/DisobeyRecordlist.aspx");
    }
Esempio n. 2
0
    protected void btnDel_Click(object sender, EventArgs e)
    {
        try
        {
            for (int i = 0; i < dvDisobeyRecord.Rows.Count; i++)
            {
                CheckBox cb = (CheckBox)dvDisobeyRecord.Rows[i].FindControl("input") as CheckBox;
                if (cb.Checked == true)
                {
                    HiddenField lfCarID = dvDisobeyRecord.Rows[i].FindControl("lblDR_Id") as HiddenField;
                    int         id      = Convert.ToInt32(lfCarID.Value);
                    DisobeyRecordManager.delDisobeyRecordById(id);
                }
            }

            Response.Redirect("~/CarManager/DisobeyRecordlist.aspx");
        }
        catch (Exception ex)
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('删除失败!');", true);

            return;
        }
    }