using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using System.Web;
using System.Data;
using System.Data.SqlClient;

using Sybase.DataWindow;
using TXSoft.Common;
using TXSoft.ExtPB;
using TXSoft.DataStore;


namespace A8ERP.CaiWu.XianJinPinZheng
{
    public partial class W_XJYinHangPZ
    {
        public W_XJYinHangPZ()
        {

        }
        public override void OnLoad()
        {
            base.OnLoad();
            string FormatPzh = Request["FormatPzh"];
            string FormatValue = Request["FormatValue"];
            if (FormatPzh != null && FormatPzh != "")
            {
                this.SetParm("format_pzh", FormatPzh);
                AppService.GetYwFormat(dw_1, FormatValue);
            }

            A8ERP.Common.DWServiceHelp.AddReportService(dw_1);

            string yhbh = A8ERP.AppService.GetUserID();
            this.SetParm("curYhbh", yhbh);
            this.SetParm("FunctionID", this.FunctionID);

            //DataWindowChild dwc = dw_1.GetChild("dqzt");
            //dwc.SetTransaction(this.AdoTransaction);
            //dwc.Retrieve(this.FunctionID);

            DataWindowChild dwc = dw_1.GetChild("tzlx");
            dwc.SetTransaction(this.AdoTransaction);
            dwc.Retrieve("xjyh_tzlx");

            //dw_1.Retrieve(yhbh);

            #region  处理权限
            dw_fhjb.DataStore.DataWindowObject = "dw_da_qx_fhjb_by_cdbh";
            dw_fhjb.SetTransaction(this.AdoTransaction);
            dw_fhjb.Retrieve(this.FunctionID);
            #endregion

            #region 每页显示条数&查询天数
            string curDayAndPageSize = DBHelp.GetDayAndPageSize(this.FunctionID,"CW");

            string curPageSize = curDayAndPageSize.Split('#')[1];
            this.dw_1.PageSize = Convert.ToInt32(curPageSize);

            // 查询天数
            string seldays = curDayAndPageSize.Split('#')[0];
            this.SetParm("seldays", seldays.ToString());

            #endregion

            for (int i = 1; i <= dw_fhjb.RowCount; i++)
            {
                ddlb_1.Items.Add(dw_fhjb.GetItemString(i, "fhmc"));
            }
            ddlb_1.Items.Add("未记账");
            ddlb_1.Items.Add("已记账");
            ddlb_1.Items.Add("全部");
            ddlb_1.Text = "未记账";

            this.SetParm("CURGNQXSTR", base.GnqxStr);
            if (this.Page != null)
            {
                this.Page.ClientScript.RegisterClientScriptInclude("W_XJYinHangPZ", "/CaiWu/XianJinPinZheng/W_XJYinHangPZ.win.js?JSV=" + AppService.GetJSVesion());
                this.Page.ClientScript.RegisterClientScriptInclude("W_XJYinHangPZ_Edit", "/CaiWu/XianJinPinZheng/W_XJYinHangPZ_Edit.win.js?JSV=" + AppService.GetJSVesion());
                this.Page.ClientScript.RegisterClientScriptInclude("OpenWindowQueryBase", "/DangAn/Base/OpenWindowQueryBase.win.js?JSV=" + AppService.GetJSVesion());
                this.Page.ClientScript.RegisterClientScriptInclude("OpenWindowSimpleChoseBase", "/DangAn/Base/OpenWindowSimpleChoseBase.win.js?JSV=" + AppService.GetJSVesion());
                this.Page.ClientScript.RegisterClientScriptInclude("W_CaiWuChaXun", "/CaiWu/ChaXun/W_CaiWuChaXun.win.js?JSV=" + AppService.GetJSVesion());
            }
            this.IsRegisterScriptFile = false;
        }
    }
}
