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; } } }
private void InDecreaseBind(string receipt_id) { ReceiptAuditAdapter raa = new ReceiptAuditAdapter(); DataSet ds = raa.getInDecreaseList(receipt_id); if (ds.Tables[0].Rows.Count == 0) { GridView2EmptyBind(); } else { GridView2.DataSource = ds; GridView2.DataBind(); } }
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; } } }