protected void btn_audit_Click(object sender, EventArgs e) { Button bt = sender as Button; string args = bt.CommandArgument.ToString(); GridViewRow row = bt.Parent.Parent as GridViewRow; HyperLink thisData = row.Cells[1].Controls[0] as HyperLink; string receipt_id = thisData.Text; ReceiptAuditAdapter raa = new ReceiptAuditAdapter(); T_ReceiptHead head = new T_ReceiptHead(); head.ReceiptId = receipt_id; T_AccountLog account_log = new T_AccountLog(); account_log.ReceiptId = receipt_id; account_log.AccountId = (bt.Parent.FindControl("hdf_account_id") as HiddenField).Value; account_log.Operater = UserInfoAdapter.CurrentUser.Name; account_log.OperateTime = DateTime.Now; account_log.Amount = Decimal.Parse(row.Cells[5].Text); AccountLogAdapter ala = new AccountLogAdapter(); if (args == "Y") { head.AuditStatus = 3;//通过 //更新账户金额 } else { account_log.Amount *= -1; head.AuditStatus = 2;//不通过 } ala.insert(account_log); ala.Add(account_log); raa.updateReceiptHeadAuditStatus(head); GridViewBind(); }