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.YingFuKuanZhangGuanLi
{
    public partial class ZhangDanHeXiao_Edit
    {
        public ZhangDanHeXiao_Edit()
        {

        }
        public override void OnLoad()
        {
            base.OnLoad();
            string CurPzh = string.Empty;
            
            this.SetParm("CurKhxje", Request["CurKhxje"]);
            CurPzh = Request["curParm2"].ToString().Trim();
            dw_1.DataStore.DataWindowObject = "dw_cw_yfksj_top";
            dw_1.SetTransaction(this.AdoTransaction);

            dw_2.DataStore.DataWindowObject = "dw_cw_yfksj_hx_zd1";
            dw_2.SetTransaction(this.AdoTransaction);
            dw_2.Retrieve(CurPzh);

            dw_1.Retrieve(CurPzh);

            //this.SetParm("CurUserId", CurUserId);
            //dw_1.DataStore.DataWindowObject = "dw_cw_yfksj_edit2";
            //dw_1.SetTransaction(this.AdoTransaction);

            //dw_2.DataStore.DataWindowObject = "dw_cw_yfksj_hx_zd";
            //dw_2.SetTransaction(this.AdoTransaction);

            //dw_3.DataStore.DataWindowObject = "dw_cw_yfksj_hxmx_save";
            //dw_3.SetTransaction(this.AdoTransaction);

            //dw_khye.DataStore.DataWindowObject = "dw_cw_yfkye_list";
            //dw_khye.SetTransaction(this.AdoTransaction);

            //DataWindowChild dwc = dw_1.GetChild("bmbh");
            //dwc.SetTransaction(this.AdoTransaction);
            //dwc.Retrieve("%", CurUserId, "cw");

            //dwc = dw_1.GetChild("gysbh");
            //dwc.SetTransaction(this.AdoTransaction);
            //dwc.Retrieve("%", CurUserId);

            //if (Request["curParm1"] != null)
            //{
            //    EditModel = Request["curParm1"].ToString().Trim();
            //    this.SetParm("EditModel", EditModel);
            //    CurPzh = Request["curParm2"].ToString().Trim();

            //    if ("EDIT".Equals(EditModel))
            //    {
            //        dw_1.Retrieve(CurPzh);
            //        dw_2.DataStore.DataWindowObject = "dw_cw_yfksj_hx_zd2";
            //        dw_2.Retrieve(CurPzh);
            //        dw_3.RetrieveEx("cw_yfksj_hxmx.pzh='" + CurPzh + "'");
            //        this.SetParm("CurPzh", CurPzh);
            //        string CurDqzt = Request["CurDqzt"].ToString().Trim();
            //        if ("T".Equals(CurDqzt))
            //        {
            //            dw_1.Enabled = false;
            //            dw_2.Enabled = false;
            //            dw_3.Enabled = false;
            //        }
            //        if (Request["CURGNQXSTR"] != null)
            //        {
            //            if (Request["CURGNQXSTR"].ToString().IndexOf("btn_Edit") < 0)
            //            {
            //                this.cb_Ok.Enabled = false;
            //            }
            //        }
            //    }
            //    else
            //    {
            //        this.SetParm("FunctionID", CurPzh);
            //    }
            //}
            //else
            //{
            //    this.SetParm("EditModel", "ERROR");
            //}
            A8ERP.Common.DWServiceHelp.AddReportService(dw_2);

            if (this.Page != null)
            {
                this.Page.ClientScript.RegisterClientScriptInclude("ZhangDanHeXiao_Edit", "/CaiWu/YingFuKuanZhangGuanLi/ZhangDanHeXiao_Edit.win.js?JSV=" + AppService.GetJSVesion());

            }
            this.IsRegisterScriptFile = false;
        }
    }
}
