예제 #1
0
        private ODBC_DB2Connect dbcmd; //��Ʈw����

        #endregion Fields

        #region Constructors

        private TunnelData()
        {
            tunList = new TunnelList();
            dbcmd = new ODBC_DB2Connect();
            dbcmd.GetReaderData += new GetReaderDataHandler(dbcmd_GetReaderData);
            dbcmd.select(DataType.Tunnel, Command.GetSelectCmd.getTunnelData());
        }
예제 #2
0
 /// <summary>
 /// �غc��
 /// </summary>
 public Execution()
 {
     try
     {
         tunnelData = TunnelData.getBuilder();
         //ServerMeg = ServerMessage.getBuilder();
         input = EvenInput.getBuilder();
         rspData = RSPDataTbl.getBuilder();
         dbcmd = new ODBC_DB2Connect();
         //runThread = new System.Collections.Generic.List<string>();
         //input.InsertEvent += new EvenInput.InsertEventHandler(input_InsertEvent);
         dbcmd.GetReaderData += new GetReaderDataHandler(dbcmd_GetReaderData);
     }
     catch (System.Exception ex)
     {
         //ServerMeg.setAlarmMeg(ex.Message);
         throw new System.Exception(ex.StackTrace);
     }
 }
예제 #3
0
        /// <summary>
        /// ���wHost
        /// </summary>
        public static RemoteInterface.HC.I_HC_FWIS getHost()
        {
            if (hobj == null)
            {
                lock (typeof(RemoteInterface.HC.I_HC_FWIS))
                {
                    if (hobj == null)
                    {
                        ODBC_DB2Connect com = new ODBC_DB2Connect();
                        com.GetReaderData += new GetReaderDataHandler(com_GetReader);
                        string hostip = ((List<object>)com.select(DataType.Host, Command.GetSelectCmd.getHostIP()))[0].ToString();
                        //string hostip = "10.21.50.217";
                        System.Diagnostics.Trace.WriteLine("Host IP = " + hostip);

                        hobj = (RemoteInterface.HC.I_HC_FWIS)RemoteInterface.RemoteBuilder.GetRemoteObj(typeof(RemoteInterface.HC.I_HC_FWIS),
                                RemoteInterface.RemoteBuilder.getRemoteUri(hostip, 9010, "FWIS"));

                    }
                }
            }
            else
            {
                try
                {
                    ((RemoteInterface.RemoteClassBase)hobj).HelloWorld();
                }
                catch
                {
                    lock (typeof(RemoteInterface.HC.I_HC_FWIS))
                    {
                        ODBC_DB2Connect com = new ODBC_DB2Connect();
                        com.GetReaderData += new GetReaderDataHandler(com_GetReader);
                        string hostip = ((List<object>)com.select(DataType.Host, Command.GetSelectCmd.getHostIP()))[0].ToString();
                        System.Diagnostics.Trace.WriteLine("Host IP = " + hostip);

                        hobj = (RemoteInterface.HC.I_HC_FWIS)RemoteInterface.RemoteBuilder.GetRemoteObj(typeof(RemoteInterface.HC.I_HC_FWIS),
                                RemoteInterface.RemoteBuilder.getRemoteUri(hostip, 9010, "FWIS"));
                    }

                }
            }
            if (hobj == null)
                System.Diagnostics.Trace.WriteLine("Host �s�u����");
            return hobj;
        }
예제 #4
0
 public EasyClient()
 {
     com = new ODBC_DB2Connect();
     //com = new DB2Connection();
     com.GetReaderData += new GetReaderDataHandler(com_GetReaderData);
 }
예제 #5
0
        /// <summary>
        /// ���wHost
        /// </summary>
        public static RemoteInterface.HC.I_HC_FWIS getHost()
        {
            if (hobj == null)
            {
                lock (typeof(RemoteInterface.HC.I_HC_FWIS))
                {
                    if (hobj == null)
                    {
                        ODBC_DB2Connect com = new ODBC_DB2Connect();
                        com.GetReaderData+=new GetReaderDataHandler(com_GetReader);
                        string hostip=((List<object>)com.select(DataType.Host, Command.GetSelectCmd.getHostIP()))[0].ToString();

                        hobj = (RemoteInterface.HC.I_HC_FWIS)RemoteInterface.RemoteBuilder.GetRemoteObj(typeof(RemoteInterface.HC.I_HC_FWIS),
                                RemoteInterface.RemoteBuilder.getRemoteUri(hostip, 9010, "FWIS"));
                    }
                }
            }
            return hobj;
        }
예제 #6
0
 //private static EvenInput evenInput = null;
 //public delegate void InsertEventHandler(string insertID);
 //public event InsertEventHandler InsertEvent;
 private EvenInput()
 {
     dbCmd = new ODBC_DB2Connect();
     //ServerMeg = ServerMessage.getBuilder();
     dbCmd.GetReaderData += new GetReaderDataHandler(dbCmd_GetReaderData);
 }
예제 #7
0
파일: AEvent.cs 프로젝트: ufjl0683/Center
 protected virtual void Initialize(System.Collections.Hashtable ht, CategoryType type)
 {
     this.type = type;
     this.secType = Convert.ToByte(ht["INC_NAME"]);
     this.ht = ht;
     if (ht["INC_BLOCKAGE"].ToString() == "") ht["INC_BLOCKAGE"] = "0000000000";//�p�G�S��"���_���D�r��"�A�w�]��"0000000000"
     this.com = new DBConnect.ODBC_DB2Connect();
 }
예제 #8
0
파일: GenEvent.cs 프로젝트: ufjl0683/Center
 public GenEvent(System.Collections.Hashtable ht, CategoryType type)
 {
     Initialize(ht, type);
     cod = new ODBC_DB2Connect();
     cod.GetReaderData += new DBConnect.GetReaderDataHandler(cod_GetReaderData);
 }
예제 #9
0
파일: AEvent.cs 프로젝트: ufjl0683/Center
        protected void Initialize(System.Collections.Hashtable ht, CategoryType type)
        {
            this.type = type;
            this.secType = Convert.ToByte(ht["INC_NAME"]);
            this.ht = ht;
            if (ht["INC_BLOCKAGE"].ToString() == "") ht["INC_BLOCKAGE"] = "0000000000";//�p�G�S��"���_���D�r��"�A�w�]��"0000000000"
            this.com = new DBConnect.ODBC_DB2Connect();

            System.Data.DataRow DR = RSPGlobal.GetLineNameDT().Rows.Find(ht["INC_LINEID"]);
            ht.Add("ORIGINAL_FROM_MILEPOST1", (int)ht["FROM_MILEPOST1"]);
            ht.Add("ORIGINAL_TO_MILEPOST1", (int)ht["TO_MILEPOST1"]);
            ht.Add("ORIGINAL_INC_LOCATION", (string)ht["INC_LOCATION"]);

            if (DR != null)
            {
                string SecCmd = string.Empty;
                if ((int)ht["FROM_MILEPOST1"] < (int)DR[2])
                {
                    ht["FROM_MILEPOST1"] = (int)DR[2];

                    if ((int)ht["TO_MILEPOST1"] < (int)DR[2])
                    {
                        ht["TO_MILEPOST1"] = (int)DR[2];
                    }

                    SecCmd = string.Format("Select SectionID from {0}.{1} sec Left Join  {0}.{2} div on sec.Start_DivisionID = div.divisionID "
                        + " where sec.LineID = '{3}' and sec.Direction = '{4}' order by div.mileage fetch first 1 rows only;"
                        , RSPGlobal.GlobaSchema, DBConnect.DB2TableName.tblGroupSection, DBConnect.DB2TableName.tblGroupDivision, ht["INC_LINEID"], ht["INC_DIRECTION"]);
                    System.Data.DataTable DT = com.Select(SecCmd);
                    ht["INC_LOCATION"] = DT.Rows[0][0];
                    if (ht["INC_DIRECTION"].Equals("S") || ht["INC_DIRECTION"].Equals("W"))
                    {
                        NearDirError = true;
                    }

                    isNear = true;
                }
                else if ((int)ht["FROM_MILEPOST1"] > (int)DR[3])
                {
                    ht["FROM_MILEPOST1"] = (int)DR[3];

                    if ((int)ht["TO_MILEPOST1"] > (int)DR[3])
                    {
                        ht["TO_MILEPOST1"] = (int)DR[3];
                    }
                    SecCmd = string.Format("Select SectionID from {0}.{1} sec Left Join  {0}.{2} div on sec.Start_DivisionID = div.divisionID "
                        + " where sec.LineID = '{3}' and sec.Direction = '{4}' order by div.mileage desc fetch first 1 rows only;"
                        , RSPGlobal.GlobaSchema,DBConnect.DB2TableName.tblGroupSection, DBConnect.DB2TableName.tblGroupDivision, ht["INC_LINEID"], ht["INC_DIRECTION"]);
                    System.Data.DataTable DT = com.Select(SecCmd);
                    ht["INC_LOCATION"] = DT.Rows[0][0];
                    if (ht["INC_DIRECTION"].Equals("N") || ht["INC_DIRECTION"].Equals("E"))
                    {
                        NearDirError = true;
                    }

                    isNear = true;
                }
            }
        }