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.Base
{
    public partial class W_Base_Open_Edit
    {
        public W_Base_Open_Edit()
        {

        }
        protected string curFlag = string.Empty;
        protected string curJdbh = string.Empty;
        protected string curSslb = string.Empty;
        protected string curFunID = string.Empty;
        public override void OnLoad()
        {
            base.OnLoad();
    
            string curFjdbh_name = "";
            string curjdbh_name = "";
            if (Request["opFlag"] != null)
            {
                curFlag = Request["opFlag"].ToString();
            }
            if (Request["targe_jdbh_value"] != null)
            {
                curJdbh = Request["targe_jdbh_value"].ToString();
            }
            if (Request["targe_fjdbh_value"] != null)
            {
                curSslb = Request["targe_fjdbh_value"].ToString();
            }
            if (Request["targe_fjdbh_name"] != null)
            {
                curFjdbh_name = Request["targe_fjdbh_name"].ToString();
            }
            if (Request["targe_jdbh_name"] != null)
            {
                curjdbh_name = Request["targe_jdbh_name"].ToString();
            }
            if (Request["FunID"] != null)
            {
                curFunID = Request["FunID"].ToString();
            }
            this.SetParm("opflag", curFlag);
            if ("Add".Equals(curFlag))
            {
                
            }
            else
            {
                string modstr = "";
                if (curFjdbh_name != null && curFjdbh_name != "")
                {
                    modstr = curFjdbh_name + ".Protect='1' " + curFjdbh_name + ".color='8421504' ";
                }
                if (curjdbh_name != null && curjdbh_name != "")
                {
                    modstr += curjdbh_name + ".Protect='1' " + curjdbh_name + ".color='8421504'";
                }
                dw_1.Modify(modstr);
                if (Request["CURGNQXSTR"] != null)
                {
                    if (Request["CURGNQXSTR"].ToString().IndexOf("btn_Edit") < 0)
                    {
                        this.cb_ok.Enabled = false;
                    }
                }
            }
            if (this.Page != null)
            {
                this.Page.ClientScript.RegisterClientScriptInclude("MyJs_Base", "/Scripts/MyJs_Base.js");
                this.Page.ClientScript.RegisterClientScriptInclude("W_Base_Open_Edit", "/Base/W_Base_Open_Edit.win.js");
                //this.Page.ClientScript.RegisterClientScriptInclude("W_Edit", "/Base/W_Edit.win.js");
            }
           
        }
    }
}
