示例#1
0
    protected void GridView3_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "Delete")
        {
            string receipt_id = e.CommandArgument.ToString();

            ReceiptAuditAdapter raa = new ReceiptAuditAdapter();
            InDecreaseAdapter   ida = new InDecreaseAdapter();
            DepositAdapter      da  = new DepositAdapter();

            try
            {
                DataSet ds = raa.getInDecreaseList(receipt_id);
                ida.updateHeadCheckStatus(ds);

                ds = raa.getDepositList(receipt_id);
                da.updateHeadCheckStatus(ds);



                raa.deleteToDone(receipt_id);
                raa.deleteReceipt(receipt_id);
                GridView3.SelectedIndex = -1;
                GridViewBind();

                Label1.Text = "删除成功";
            }
            catch (Exception ex)
            {
                Label1.Text = ex.Message;
            }
        }
    }
示例#2
0
    protected void GridView3_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "Delete")
        {
            string[] args         = e.CommandArgument.ToString().Split(',');
            string   receipt_id   = args[0];
            string   receipt_type = args[1];

            ReceiptAuditAdapter raa = new ReceiptAuditAdapter();
            InDecreaseAdapter   ida = new InDecreaseAdapter();
            DepositAdapter      da  = new DepositAdapter();
            try
            {
                DataSet ds = raa.getInDecreaseList(receipt_id);
                ida.updateHeadCheckStatus(ds);

                ds = raa.getDepositList(receipt_id);
                if (receipt_type == "B")
                {
                    da.updateHeadIsPayed(ds);
                }
                else
                {
                    da.updateHeadCheckStatus(ds);//更新定金单的check_status值;
                }

                raa.deleteToDone(receipt_id);
                raa.deleteReceipt(receipt_id);
                GridView3.SelectedIndex = -1;
                GridViewBind();

                Label1.Text = "删除成功";
            }
            catch (Exception ex)
            {
                Label1.Text = ex.Message;
            }
        }
    }