protected void bt_Delete_Click(object sender, EventArgs e)
    {
        string selectids = "";

        foreach (GridViewRow item in gv_List.Rows)
        {
            if (((CheckBox)item.FindControl("cb_Select")).Checked == true)
            {
                selectids += gv_List.DataKeys[item.RowIndex].Value.ToString() + ",";
                int id = int.Parse(gv_List.DataKeys[item.RowIndex].Value.ToString());
                CSO_OfferBalanceBLL bll = new CSO_OfferBalanceBLL(id);
                if (bll.Model.State == 1 && bll.Model.ApproveFlag == 2)
                {
                    bll.Delete();
                }
            }
        }
        if (string.IsNullOrEmpty(selectids))
        {
            MessageBox.Show(this, "请选择要删除的费用单!");
            return;
        }
        MessageBox.Show(this, "删除成功!");
        BindGrid();
    }
 protected void bt_Delete_Click(object sender, EventArgs e)
 {
     int id = (int)ViewState["BalanceID"];
     CSO_OfferBalanceBLL bll = new CSO_OfferBalanceBLL(id);
     if (bll.Model != null && bll.Model.ApproveFlag != 1)
     {
         bll.Delete();
         MessageBox.ShowAndRedirect(this, "结算单删除成功!", "CSO_OfferBalanceList.aspx");
     }
 }
Esempio n. 3
0
    protected void bt_Delete_Click(object sender, EventArgs e)
    {
        int id = (int)ViewState["BalanceID"];
        CSO_OfferBalanceBLL bll = new CSO_OfferBalanceBLL(id);

        if (bll.Model != null && bll.Model.ApproveFlag != 1)
        {
            bll.Delete();
            MessageBox.ShowAndRedirect(this, "结算单删除成功!", "CSO_OfferBalanceList.aspx");
        }
    }
    protected void bt_Delete_Click(object sender, EventArgs e)
    {
        string selectids = "";
        foreach (GridViewRow item in gv_List.Rows)
        {
            if (((CheckBox)item.FindControl("cb_Select")).Checked == true)
            {
                selectids += gv_List.DataKeys[item.RowIndex].Value.ToString() + ",";
                int id = int.Parse(gv_List.DataKeys[item.RowIndex].Value.ToString());
                CSO_OfferBalanceBLL bll = new CSO_OfferBalanceBLL(id);
                if (bll.Model.State == 1 && bll.Model.ApproveFlag == 2) bll.Delete();
            }

        }
        if (string.IsNullOrEmpty(selectids))
        {
            MessageBox.Show(this, "请选择要删除的费用单!");
            return;
        }
        MessageBox.Show(this, "删除成功!");
        BindGrid();
    }