using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using System.Web;
using System.Data;
using System.Data.SqlClient;
using A8ERP.Common;
using Sybase.DataWindow;
using TXSoft.Common;
using TXSoft.ExtPB;
using TXSoft.DataStore;
using A8erp.Cache;


namespace A8ERP.DiaoBo.BaoBiao_Base
{
    public partial class W_JQCM_DB
    {
        private string cdbh = "";
        private string bbfl = "";
        private string bbmc = "";
        private string yhbh = "";
        private string pzh = "";
        public W_JQCM_DB()
        {

        }
        public override void OnLoad()
        {
            base.OnLoad();
            DBHelp dbhelp = new DBHelp();
            if (this.Page != null)
            {
                this.Page.ClientScript.RegisterClientScriptInclude("W_Edit", "/DangAn/Base/OpenWindowDoubleRowsChooseBase.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_Base_Report_Open_Mx_Ex", "/Base/W_Base_Report_Open_Mx_Ex.win.js?JSV=" + AppService.GetJSVesion());
                this.Page.ClientScript.RegisterClientScriptInclude("W_Base_SaveOP", "/KuCun/TongJiFenXi/Base/W_Base_SaveOP.win.js?JSV=" + AppService.GetJSVesion());
                this.Page.ClientScript.RegisterClientScriptInclude("W_Base_BB_List", "/KuCun/TongJiFenXi/Base/W_Base_BB_List.win.js?JSV=" + AppService.GetJSVesion());
                this.Page.ClientScript.RegisterClientScriptInclude("W_KC_PIC", "/KuCun/TongJiFenXi/W_KC_PIC.win.js?JSV=" + AppService.GetJSVesion());
                this.Page.ClientScript.RegisterClientScriptInclude("W_NFCheck", "/KuCun/TongJiFenXi/W_NFCheck.win.js?JSV=" + AppService.GetJSVesion());
                this.Page.ClientScript.RegisterClientScriptInclude("W_JQCM_DB", "/DiaoBo/BaoBiao_Base/W_JQCM_DB.win.js?JSV=" + AppService.GetJSVesion());  
            }
            this.IsRegisterScriptFile = false;
            rb_hx.Checked = true;
            string curcm = A8ERP.Common.DWServiceHelp.GetCMByString1();
            dw_list.StringData1 = curcm;
            mle_1.Visible = false;
            User user = new User();
            user = (User)Session["User"];
            string curYhbh = user.Yhbh;

            string curjgqx = A8ERP.DBHelp.GetJGTXByBMAndYH(this.FunctionID, curYhbh);
            this.SetParm("curjgqx", curjgqx);
            this.SetParm("curYhbh", curYhbh);
            this.SetParm("curYhmc", AppService.GetUserName());

            string ywflag = "";
            if (this.FunctionID.Equals("SJ414"))
            {
                ywflag = "DB";
                st_title.Text = "调拨订单明细统计";
            }
            else if (this.FunctionID.Equals("SJ427"))
            {
                ywflag = "DZ";
                st_title.Text = "调拨通知单明细统计";
            }

            else if (this.FunctionID.Equals("SJ428"))
            {
                ywflag = "DC";
                st_title.Text = "调拨出库单明细统计";
               
               
            }
            else if (this.FunctionID.Equals("SJ429"))
            {
                ywflag = "DR";
                st_title.Text = "调拨入库单明细统计";
            }
            StaticText st_14 = new TXSoft.ExtPB.StaticText();
            gb_1.Controls.Add(st_14);
            gb_1.Controls.SetChildIndex(st_14, 1);
            st_14.Height = 23;
            st_14.Name = "st_14";
            st_14.TabIndex = 186;
            st_14.Text = "转单状态";
            st_14.Width = 53;
            st_14.X = 620;
            st_14.Y = 67;

            DropDownListBox ddlb_1 = new TXSoft.ExtPB.DropDownListBox();
            gb_1.Controls.Add(ddlb_1);
            gb_1.Controls.SetChildIndex(ddlb_1, 0);
            ddlb_1.Items.AddRange(new string[] {
                        "--",
                        "未转单",
                        "已转单"});
            ddlb_1.Limit = 0u;
            ddlb_1.Name = "ddlb_1";
            ddlb_1.TabIndex = 187;
            ddlb_1.Text = "--";
            ddlb_1.Width = 100;
            ddlb_1.X = 670;
            ddlb_1.Y = 63;

            rb_hx.X = 465;
            
            rb_zx.X = 527;
            this.SetParm("ywflag", ywflag);
            this.SetParm("curCdbh", this.FunctionID);
            dw_temp.AllowCreate = true;
            dw_temp.AllowRetrieve = true;
            dw_format.AllowCreate = true;
            dw_format.AllowRetrieve = true;
            //this.dw_list.ClickHeaderSort = true;
            string curJgtx = A8ERP.DBHelp.GetJGTXByBMAndYH(this.FunctionID, curYhbh);
            this.SetParm("jgtxlist", curJgtx);
            DataRow[] dt = CacheHelp.GetDataTable("REPORT_FORMAT").Select("cdbh ='" + this.FunctionID + "'  AND qdid ='" + curYhbh + "'");
            if (dt != null)
            {
                if (dt.Length > 0)
                {
                    pzh = dt[0][0].ToString();
                    bbmc = dt[0][1].ToString();
                    bbfl = dt[0][2].ToString();

                }
            }
            this.SetParm("pzh", pzh);
            this.SetParm("bbmc", bbmc);
            this.SetParm("bbfl", bbfl);

        }
    }
}
