public bool SetAllGlobalVariables()
        {
            bool success = false;

            try
            {
                GlobalValues.GLOBAL_DB_CON_STRING   = BasicConfig.GetXmlTextOfTag("connectionString");
                GlobalValues.GLOBAL_ENTRY_XML_PATH  = BasicConfig.GetXmlTextOfTag("EntryKioskXmlPath");
                GlobalValues.GLOBAL_EXIT_XML_PATH   = BasicConfig.GetXmlTextOfTag("ExitKioskXmlPath");
                GlobalValues.GLOBAL_BACKUP_XML_PATH = BasicConfig.GetXmlTextOfTag("BackupkXmlPath");

                GlobalValues.GLOBAL_DISPLAY_XML_PATH = BasicConfig.GetXmlTextOfTag("DisplayXmlPath");

                GlobalValues.REPORT_PATH      = BasicConfig.GetXmlTextOfTag("ReportPath");
                GlobalValues.OPC_MACHINE_HOST = BasicConfig.GetXmlTextOfTag("opcMachineHost");
                GlobalValues.OPC_SERVER_NAME  = BasicConfig.GetXmlTextOfTag("opcServerName");

                GlobalValues.CAM_HOST_SERVER     = BasicConfig.GetXmlTextOfTag("CamHostServer");
                GlobalValues.CAM_OPC_SERVER_NAME = BasicConfig.GetXmlTextOfTag("CamOpcServerName");
                GlobalValues.LOG_DIR             = BasicConfig.GetXmlTextOfTag("LogDir");
                GlobalValues.IMG_DIR             = BasicConfig.GetXmlTextOfTag("ImagePath");
                GlobalValues.AUTO_REFRESH        = (BasicConfig.GetXmlTextOfTag("AutoRefresh") == "true");

                success = true;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }

            return(success);
        }
Esempio n. 2
0
        private bool GetAutoRefresh()
        {
            bool refreshStatus = false;

            refreshStatus = BasicConfig.GetXmlTextOfTag("AutoRefresh") == "true";
            return(refreshStatus);
        }
Esempio n. 3
0
        static void TestFunction(int index)
        {
            //OpcConnection.GetOPCServerConnection();
            switch (index)
            {
            case 1:
                try
                {
                    //BasicConfig.GetXmlTextOfTag("connectionString");
                    DataTable dt = new DataTable();
                    //dt.TableName = "SNAPSHOT";
                    using (OracleConnection conn = new DBConnection().getDBConnection())
                    {
                        OracleCommand cmd = new OracleCommand();
                        cmd.Connection  = conn;
                        cmd.CommandText = "select *  from l2_ees_master";
                        cmd.CommandType = CommandType.Text;
                        //OracleDataReader dr = cmd.ExecuteReader();
                        //dr.Read();
                        OracleDataAdapter dadapter = new OracleDataAdapter(cmd);
                        dadapter.Fill(dt);
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex);
                }
                break;

            case 2:
                GlobalValues.LOG_DIR = BasicConfig.GetXmlTextOfTag("LogPath");

                // for (int i = 0; i < 100;i++ )
                //Logger.WriteLogger(GlobalValues.LOG_DIR, GlobalValues.PARKING_LOG, "for testing" + i);
                break;

            case 3:
                GlobalValues.LOG_DIR = BasicConfig.GetXmlTextOfTag("LogPath");

                // for (int i = 0; i < 100;i++ )
                //Logger.WriteLogger(GlobalValues.LOG_DIR, GlobalValues.PARKING_LOG, "for testing" + i);
                break;

            default:
                break;
            }
        }
        // static OracleConnection GlobalConn;
        //public string connectionString = null;
        public OracleConnection getDBConnection()
        {
            OracleConnection con = new OracleConnection();

            try
            {
                // con.ConnectionString = "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=3.0.0.188)(PORT=1521))(CONNECT_DATA=(SID=orcl)));User Id=l2_user_admin;Password=fcluser456;";
                con.ConnectionString = BasicConfig.GetXmlTextOfTag("userConnectionString");
                if (con.State == ConnectionState.Closed)
                {
                    con.Open();
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
            return(con);
        }