コード例 #1
0
    private void ListBind()
    {
        string            account_id = ddl_account.SelectedValue;
        string            start_time = CalendarBox1.Text;
        string            end_time   = CalendarBox2.Text;
        AccountLogAdapter ala        = new AccountLogAdapter();
        DataSet           ds         = ala.getAccountLogs(account_id, start_time, end_time);

        if (ds.Tables[0].Rows.Count == 0)
        {
            GridView1EmptyBind();
            return;
        }
        show(ds);
    }
コード例 #2
0
    private void HeadBind()
    {
        string            account_id = ddl_account.SelectedValue;
        AccountLogAdapter ala        = new AccountLogAdapter();
        DataSet           ds         = ala.getAccount(account_id);
        DataRow           dr         = ds.Tables[0].Rows[0];

        lbl_account_id.Text   = dr["account_id"].ToString();
        lbl_account_name.Text = dr["account_name"].ToString();
        lbl_opening_bank.Text = dr["opening_bank"].ToString();
        CommonAdapter ca         = new CommonAdapter();
        int           currencyID = Int32.Parse(dr["currencyID"].ToString());

        lbl_currency.Text = ca.getCurrencyByID(currencyID);
        lbl_amount.Text   = dr["amount"].ToString();
    }
コード例 #3
0
    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();
    }