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.FaPiaoGuanLi
{
    public partial class W_FaPiaoDanTongJi
    {
        public W_FaPiaoDanTongJi()
        {

        }
        public override void OnLoad()
        {
            base.OnLoad();

            ddlb_kplx.Items.Add("全部");
            ddlb_pjzl.Items.Add("全部");
            ddlb_wczt.Items.Add("全部");
            ddlb_pjlx.Items.Add("全部");
            ddlb_pjlx.Items.Add("开票单");
            ddlb_pjlx.Items.Add("退票单");

            //DataTable dt = null;
            //DBHelp db = new DBHelp();

            //dt = db.QueryRDataTable(" select csbh,csmc from da_qj_csb where csfl='cw_pjlx' ");
            //int count = dt.Rows.Count;
            //if (count > 0)
            //{
            //    for (int i = 0; i < count; i++)//"[" + dt.Rows[i]["csbh"].ToString() + "]" +
            //    {
            //        ddlb_kplx.Items.Add( dt.Rows[i]["csmc"].ToString());
            //    }
            //}

            string curKplx = AppService.GetXiTongCanShu("xsfp", "cw_pjlx", "csmc");
            ddlb_kplx.Items.Add(curKplx);


            string curPjzl1 = AppService.GetXiTongCanShu("ptfp", "cw_pjzl", "csmc");
            string curPjzl2 = AppService.GetXiTongCanShu("zzsfp", "cw_pjzl", "csmc");

            ddlb_pjzl.Items.Add(curPjzl1);
            ddlb_pjzl.Items.Add(curPjzl2);



            //dt = db.QueryRDataTable(" select fhjb,fhmc from da_qx_mokuai_fuhejibie where cdbh='SJ508'");
            //int count2 = dt.Rows.Count;
            //if (count2 > 0)
            //{
            //    for (int i = 0; i < count2; i++)
            //    {
            ddlb_wczt.Items.Add("未审核");
            ddlb_wczt.Items.Add("审核");
            //    }
            //}

            //db.Close();
            //dt.Dispose();

            dw_1.DataStore.DataWindowObject = "da_fp_fpdtj_list";
            dw_1.SetTransaction(this.AdoTransaction);

            A8ERP.Common.DWServiceHelp.AddReportService(dw_1);

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

            if (this.Page != null)
            {
                this.Page.ClientScript.RegisterClientScriptInclude("OpenWindowQueryBase", "/DangAn/Base/OpenWindowQueryBase.win.js?JSV=" + AppService.GetJSVesion());
                this.Page.ClientScript.RegisterClientScriptInclude("W_FaPiaoDanTongJi", "/CaiWu/FaPiaoGuanLi/W_FaPiaoDanTongJi.win.js?JSV=" + AppService.GetJSVesion());
            }

            this.IsRegisterScriptFile = false;
        }
    }
}
