Beispiel #1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var Form = new ClientInterface();

            SplashScreen.ShowSplashScreen();

            Application.DoEvents();
            SplashScreen.SetStatus("Loading Client Interface");
            System.Threading.Thread.Sleep(1000);
            SplashScreen.SetStatus("Loading module 1");
            System.Threading.Thread.Sleep(500);

            /*
             * SplashScreen.SetStatus("Loading module 2");
             * System.Threading.Thread.Sleep(300);
             * SplashScreen.SetStatus("Loading module 3");
             * System.Threading.Thread.Sleep(900);
             * SplashScreen.SetStatus("Loading module 4");
             * System.Threading.Thread.Sleep(100);
             * */
            SplashScreen.CloseForm();
            Application.Run(Form);
        }
Beispiel #2
0
 private void FormMain_Shown(object sender, EventArgs e)
 {
     if (m_bLayoutCalled == false)
     {
         m_bLayoutCalled = true;
         m_dt            = DateTime.Now;
         this.Activate();
         SplashScreen.CloseForm();
     }
 }
        private static void OnAppIdle(object sender, EventArgs e)
        {
            if (context.MainForm == null)
            {
                //	first we remove the eventhandler
                Application.Idle -= new EventHandler(OnAppIdle);

                mForm.Loading += new Netron.Cobalt.MainForm.LoadingInfo(mainForm_Loading);
                //	here we preload our form
                mForm.PreLoad();

                //	now we set the main form for the context...
                context.MainForm = mForm;

                //	...show it...
                context.MainForm.Show();

                System.Threading.Thread.Sleep(1300);
                //	...and hide the splashscreen. done!
                SplashScreen.CloseForm();
            }
        }
    private static void Main()
    {
        Application.EnableVisualStyles();
        Application.SetCompatibleTextRenderingDefault(false);

        SplashScreen.ShowSplashScreen();
        Application.DoEvents();

        while (!isButtonClicked)
        {
            System.Threading.Thread.Sleep(50);
        }

        var window = new MyForm();

        window.Load += (s, e) =>
        {
            SplashScreen.CloseForm();
            window.Activate();
        }
        Application.Run(window);
    }
Beispiel #5
0
        /// <summary>
        /// Creates the Security Center object and blocks until the Report Center is told to close
        /// or the user closes the Report Center.
        /// </summary>
        private void Run()
        {
            mReportMDI = new frmReportCenterMDIParent(); //ReportCenter();

            try
            {
                if (mSplashScreen == null)
                {
                    SetSplashScreen();
                }
                mSplashScreen.Show();
                mSplashScreen.Status = Resources.splashInfoLoadStationSettings;
                //get intial module level data
                ModuleComm comm = new ModuleComm();
                Configuration.operatorID   = comm.GetOperatorId();
                Configuration.LoginStaffID = comm.GetStaffId();
                Configuration.mMachineID   = comm.GetMachineId();
                GetGamingDate(); // Rally DE525
                GetSettings();
                Utilities.InitLog();

                mSplashScreen.Status = Resources.infoCheckingReports;

                if (mReportMDI.LoadReports(mSplashScreen))
                {
                    // Listen for the event where something wants the Security Center to stop.
                    StopMe       += new EventHandler(mReportMDI.ExitReportCenter);
                    BringToFront += new EventHandler(ComeToFrontEvent);

                    mSplashScreen.CloseForm();
                    mSplashScreen.Dispose();
                    Utilities.Log("Start running...", LoggerLevel.Information);
                    Application.Run(mReportMDI);
                }
            }
            catch (Exception e)
            {
                Utilities.Log("ReportCenterModule.Run()...Exception.Message =" + e.Message, LoggerLevel.Severe);
                Utilities.Log("Exception.Stack=" + e.StackTrace, LoggerLevel.Severe);

                MessageForm.Show(Resources.errorStart + "\n" + e.Message + "\n\n" + e.StackTrace, Resources.report_center);
            }
            finally
            { // Shutdown
                if (mSplashScreen != null)
                {
                    mSplashScreen.Close();
                    mSplashScreen.Dispose();
                }

                if (mReportMDI != null)
                {
                    mReportMDI.Close();
                    mReportMDI = null;
                }

                OnStop();
                lock (m_syncRoot)
                {
                    // Mark the module as stopped.
                    m_isStopped = true;
                }
            }
        }
Beispiel #6
0
        // ReSharper disable once IdentifierTypo
        public frmDAnTEmdi(string danteFilePath, string customLogFilePath)
        {
            mSessionFile = danteFilePath;

            InitializeComponent();

            if (!string.IsNullOrEmpty(customLogFilePath))
            {
                mCustomLoggerEnabled = true;

                try
                {
                    if (File.Exists(customLogFilePath))
                    {
                        mCustomLogWriter = File.AppendText(customLogFilePath);
                    }
                    else
                    {
                        mCustomLogWriter = new StreamWriter(customLogFilePath);
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(string.Format("Error appending to the log file at {0}: {1}", customLogFilePath,
                                                  ex.Message));
                }
            }

            Text = "InfernoRDN";

            var startupErrString = new StringBuilder();

            SplashScreen.ShowSplashScreen();
            Application.DoEvents();
            var appVersionCurrent = clsRCmdLog.GetProgramVersion();

            Log(mCustomLoggerEnabled, string.Format("Starting Inferno v{0} [{1}]...", appVersionCurrent, DateTime.Now), mCustomLogWriter);
            SplashScreen.SetStatus(string.Format("Starting Inferno v{0} [{1}]...", appVersionCurrent, DateTime.Now));
            System.Threading.Thread.Sleep(100);
            SplashScreen.SetStatus("Reading Configuration Parameters...");

            if (!ConfigParameters())
            {
                Log(mCustomLoggerEnabled, "Error: Error in reading inferno.conf file.", mCustomLogWriter);
                startupErrString.AppendLine("* Error in reading inferno.conf file.");
                //SplashScreen.CloseForm();
                //MessageBox.Show("Error in reading inferno.conf file.",
                //    "inferno.conf error", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                //this.Close();
            }
            Log(mCustomLoggerEnabled, "Done reading configuration parameters.", mCustomLogWriter);

            SplashScreen.SetStatus("Initializing Folders...");

            // Initialize folders
            var tempFolderPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);

            var appDataDirectoryPath = Path.Combine(tempFolderPath, "Inferno");

            if (!Directory.Exists(appDataDirectoryPath))
            {
                Directory.CreateDirectory(appDataDirectoryPath);
            }

            mRTempFilePath = appDataDirectoryPath.Replace(@"\", "/") + "/_temp.png";
            mhelpProviderDAnTE.HelpNamespace = Path.Combine(Application.StartupPath, "InfernoHelp.chm");

            System.Threading.Thread.Sleep(10);
            Log(mCustomLoggerEnabled, "Done setting folders.", mCustomLogWriter);

            SplashScreen.SetStatus("Establishing Connection to R...");
            mRConnector = new clsRconnect();
            var connectionSucceeded = mRConnector.initR();

            if (!connectionSucceeded)
            {
                startupErrString.AppendLine(string.Format("* R failed to initialize: {0}", mRConnector.Message));
                //SplashScreen.CloseForm();
                //MessageBox.Show("Try again. R failed to initialize for some unknown reason.",
                //    "R connection failed.", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                Log(mCustomLoggerEnabled, "Error: Connection to R failed.", mCustomLogWriter);
                //this.Close();
            }
            else
            {
                System.Threading.Thread.Sleep(10);
                Log(mCustomLoggerEnabled, "Done Connecting to R.", mCustomLogWriter);
            }

            SplashScreen.SetStatus("Initializing R Functions...");
            if (!LoadRFunctions("Inferno.RData"))
            {
                if (connectionSucceeded)
                {
                    startupErrString.AppendLine("* Error in sourcing R functions.");
                }
                //SplashScreen.CloseForm();
                //MessageBox.Show("Error in sourcing R functions", "Initializing R error",
                //    MessageBoxButtons.OK, MessageBoxIcon.Error);
                Log(mCustomLoggerEnabled, "Error: Sourcing R functions failed.", mCustomLogWriter);
                //this.Close();
            }
            else
            {
                Log(mCustomLoggerEnabled, "Done sourcing R functions.", mCustomLogWriter);
            }

            SplashScreen.SetStatus("Initializing R Plotting Functions...");

            var    useGGPlot = Settings.Default.useGG;
            string plotFuncFileName;

            if (useGGPlot)
            {
                plotFuncFileName = "Inferno_ggplots.RData";
            }
            else
            {
                plotFuncFileName = "Inferno_stdplots.RData";
            }

            if (!LoadRFunctions(plotFuncFileName))
            {
                if (connectionSucceeded)
                {
                    startupErrString.AppendLine("* Error in sourcing R plotting functions.");
                }
                //SplashScreen.CloseForm();
                //MessageBox.Show("Error in sourcing R plotting functions", "Initializing R error",
                //    MessageBoxButtons.OK, MessageBoxIcon.Error);
                Log(mCustomLoggerEnabled, "Error: Sourcing R plotting functions failed.", mCustomLogWriter);
                //this.Close();
            }
            else
            {
                Log(mCustomLoggerEnabled, "Done sourcing R plotting functions.", mCustomLogWriter);
            }

            //if (!InitLoadRPackages()) {
            //  startupErrString.AppendLine("* Error loading key R packages.");
            //  //SplashScreen.CloseForm();
            //  //MessageBox.Show("Error loading key R packages", "Error loading key R packs",
            //  //    MessageBoxButtons.OK, MessageBoxIcon.Error);
            //  Log(mCustomLoggerEnabled, "Error: Loading key R packages failed.", logWriter);
            //  //this.Close();
            //}
            //Log(mCustomLoggerEnabled, "Done loading key R packages.", logWriter);
            ////InitLoadRPackages();
            System.Threading.Thread.Sleep(10);

            SplashScreen.SetStatus("Checking R version...");
            if (!CheckRVersion("3", "6.0"))
            {
                if (connectionSucceeded)
                {
                    startupErrString.AppendLine("* R version is not compatible. Install a more recent version.");
                }
                //SplashScreen.CloseForm();
                //MessageBox.Show("R version is not compatible." + Environment.NewLine +
                //    "Please install R version 2.9.x." + Environment.NewLine +
                //    "R can be downloaded from http://cran.r-project.org/",
                //    "R version incompatible", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Log(mCustomLoggerEnabled, "Error: R version incompatible.", mCustomLogWriter);
                //this.Close();
            }
            System.Threading.Thread.Sleep(10);

            SplashScreen.SetStatus(SplashScreen.VALIDATING_R_PACKAGES);

            if (!InstallRequiredRPackages())
            {
                if (connectionSucceeded)
                {
                    startupErrString.AppendLine("* R failed to install required packages (this may not be a fatal error)");
                }

                //SplashScreen.CloseForm();
                //MessageBox.Show("Try again. R failed to install required packages." + Environment.NewLine +
                //    "If this is the first time you run Inferno after installing, check permissions to modify R install folder, else " +
                //    "try changing the repository in the inferno.conf file.",
                //    "R problem...", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                Log(mCustomLoggerEnabled, "Error: Loading required R packages failed.", mCustomLogWriter);
                //this.Close();
            }
            else
            {
                Log(mCustomLoggerEnabled, "Done loading required R packages.", mCustomLogWriter);
                System.Threading.Thread.Sleep(10);
            }

            SplashScreen.SetStatus("Cleaning up temp files; checking for " + mRTempFilePath.Replace("/", @"\"));
            if (!DeleteTempFile())
            {
                // This is not a fatal error
                // Log it, but move on
                startupErrString.AppendLine("* Error cleaning temp files.");
                Log(mCustomLoggerEnabled, "Error: Cleaning temp files failed.", mCustomLogWriter);
            }
            System.Threading.Thread.Sleep(10);

            this.Activate();
            SplashScreen.CloseForm();

            Log(mCustomLoggerEnabled, "Inferno started.", mCustomLogWriter);
            if (startupErrString.Length > 1)
            {
                var errorMessage = startupErrString.ToString();
                if (!string.IsNullOrEmpty(clsRCmdLog.CurrentLogFilePath))
                {
                    errorMessage += "\nFor more information, see file " + clsRCmdLog.CurrentLogFilePath;
                }

                MessageBox.Show(errorMessage, "Errors Found", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Beispiel #7
0
 private void frmLogin_Shown(object sender, EventArgs e)
 {
     SplashScreen.CloseForm();
 }
Beispiel #8
0
        /// <summary>
        /// Creates the Security Center object and blocks until the Security Center is told to close
        /// or the user closes the Security Center.
        /// </summary>
        private void Run()
        {
            //SecurityMDI sc = null;
            sc = new SecurityCenterMDIParent();

            try
            {
                if (mSplashScreen == null)
                {
                    SetSplashScreen();
                }
                mSplashScreen.Show();
                mSplashScreen.Status = Properties.Resources.splashInfoLoadStationSettings;

                //get intial module level data
                ModuleComm comm = new ModuleComm();
                Configuration.operatorID   = comm.GetOperatorId();
                Configuration.LoginStaffID = comm.GetStaffId();
                Configuration.mMachineID   = comm.GetMachineId();
                GetWorkstationSettings();
                GetPasswordSettings();

                // Create and initialize new object.
                mSplashScreen.Status = Properties.Resources.splashInfoLoadModuleLevelData;
                sc.LoadData();

                // Listen for the event where something wants the Security Center to stop.
                StopMe       += new EventHandler(sc.ExitSecurityCenter);
                BringToFront += new EventHandler(BringToFrontEvent);

                // Initialize Logger
                Utilities.InitLog();
                Utilities.Log("SecurityCenter start running...", LoggerLevel.Information);

                //Start Fix RALY DE 2991
                //// Get our current operator
                //try
                //{
                //    m_currentOp = GetOperator(comm.GetOperatorId());
                //}
                //catch (Exception e)
                //{
                //    MessageForm.Show(mSplashScreen, string.Format(CultureInfo.CurrentCulture, Resources.GetOperatorDataFailed, e.Message), Resources.SecurityCenterName);

                //    Utilities.Log("Get operator data failed: " + e.Message, LoggerLevel.Severe);
                //    return;
                //}
                //End FIX RALLY DE 2991

                // Get our Staff and module permissions
                try
                {
                    m_currentStaff = GetStaff(comm.GetStaffId());
                }
                catch (Exception e)
                {
                    MessageForm.Show(mSplashScreen, string.Format(CultureInfo.CurrentCulture, Resources.GetStaffDataFailed, e.Message), Resources.SecurityCenterName);

                    Utilities.Log("Get staff info failed: " + e.Message, LoggerLevel.Severe);
                    return;
                }

                // Get our Permissions
                try
                {
                    GetStaffPermissionList();
                }
                catch (Exception e)
                {
                    MessageForm.Show(mSplashScreen, string.Format(CultureInfo.CurrentCulture, Resources.GetStaffPermsFailed, e.Message), Resources.SecurityCenterName);

                    Utilities.Log("Get staff module features failed: " + e.Message, LoggerLevel.Severe);
                    return;
                }

                mSplashScreen.CloseForm();
                mSplashScreen.Dispose();

                sc.CurentStaff = m_currentStaff;
                Application.Run(sc);
            }
            catch (Exception e)
            {
                Utilities.Log("Exception.Message =" + e.Message, LoggerLevel.Severe);
                Utilities.Log("Exception.Stack=" + e.StackTrace, LoggerLevel.Severe);
                MessageForm.Show(Properties.Resources.errorStart, Properties.Resources.securityCenter);
            }
            finally
            { // Shutdown
                if (mSplashScreen != null)
                {
                    mSplashScreen.Close();
                    mSplashScreen.Dispose();
                }
                if (sc != null)
                {
                    sc.Close();
                    sc = null;
                }

                OnStop();
                lock (m_syncRoot)
                {
                    // Mark the module as stopped.
                    m_isStopped = true;
                }
                Utilities.Log("Leaving SecurityCenter...", LoggerLevel.Information);
            }
        }
Beispiel #9
0
        static void Main()
        {
            //Global.Servicio.EnviarMailFactura(null, "*****@*****.**","");

            string      advertencia = string.Empty;
            bool        errorConBD  = false;
            CultureInfo ci          = new System.Globalization.CultureInfo("es-ES");

            ci.NumberFormat.CurrencyDecimalSeparator             = ".";
            ci.NumberFormat.NumberDecimalSeparator               = ".";
            ci.NumberFormat.NumberGroupSeparator                 = ",";
            ci.NumberFormat.CurrencyGroupSeparator               = ",";
            System.Threading.Thread.CurrentThread.CurrentCulture = ci;// new System.Globalization.CultureInfo("en-US");

            Application.EnableVisualStyles();
            SplashScreen.ShowSplashScreen();
            Application.DoEvents();
            SplashScreen.SetStatus("Inicializando módulo de Servicios...");

            SplashScreen.SetStatus("Verificando instancia DB...");
            string instancia = ConfigurationManager.AppSettings["InstanciaBD"];

            if (instancia != "SinServicio")
            {
                ServiceController sc = new ServiceController(instancia);
                try
                {
                    if (sc != null)
                    {
                        if (sc.Status == ServiceControllerStatus.Stopped)
                        {
                            sc.Start();
                            while (sc.Status == ServiceControllerStatus.Stopped)
                            {
                                Thread.Sleep(1000);
                                sc.Refresh();
                            }
                        }
                        if (sc.Status == ServiceControllerStatus.Running)
                        {
                            SplashScreen.SetStatus("Instancia ejecutándose correctamente...");
                        }
                    }
                    else
                    {
                        SplashScreen.SetStatus("Instancia no encontrada...");
                    }
                }
                catch (Exception ex)
                {
                    var message = "";
                    if (ex.InnerException != null)
                    {
                        message = ex.InnerException.Message;
                    }
                    else
                    {
                        message = ex.Message;
                    }

                    SplashScreen.CloseForm();
                    MessageBox.Show(String.Format("Ha ocurrido un error verificando el servicio de base de datos. Instancia: {0}. Detalles: {1} ¿Ha probado ejecutar la aplicación como administrador?{2}Aplicación abortada.", instancia, message, Environment.NewLine));
                    errorConBD = true;
                }
            }
            if (!errorConBD)
            {
                Thread.Sleep(1000);

                SplashScreen.SetStatus("Corroborando rutinas generadas...");
                try
                {
                    Global.Servicio.corroboraArchivosLocales();
                }
                catch (Exception ex)
                {
                    advertencia = ex.Message;
                }
                SplashScreen.SetStatus("Validando usuarios...");
                Usuario administrador = Global.Servicio.obtenerAdministrador();
                SplashScreen.SetStatus("Inicializando...");

                SplashScreen.CloseForm();

                frmLogin form = new frmLogin(advertencia);

                Application.Run(form);
            }
        }
Beispiel #10
0
        static void Main(string[] args)
        {
            //DataTable dtBiz = new DataTable("CONFIG_DB_INFO");
            //dtBiz.Columns.Add("SERVICE_NAME");
            //dtBiz.Columns.Add("SERVICE_URI");

            //dtBiz.Rows.Add("PFV [리조트통합]","http://116.123.223.4:51004/DataService.svc");
            //dtBiz.Rows.Add("AMC [인사/회계]" ,"http://116.123.223.4:51006/DataService.svc");

            //dtBiz.WriteXml(@"C:\CONFIG_INFO.xml");


            string bb = BizCommon.SettingKeys.GetString(BizCommon.SettingKeys.ROOM_TASK_SKIP_YN).ToUpper();

            string path = System.Windows.Forms.Application.StartupPath;

            if (File.Exists(path + "\\KiccDSC.ocx"))
            {
                System.Diagnostics.Process.Start("regsvr32.exe", "/s " + path + "\\KiccDSC.ocx").WaitForExit();
            }

            if (File.Exists(path + "\\KSNet_Dongle.ocx"))
            {
                System.Diagnostics.Process.Start("regsvr32.exe", "/s " + path + "\\KSNet_Dongle.ocx").WaitForExit();
            }

            if (File.Exists(path + "\\KisvanMS3.ocx"))
            {
                System.Diagnostics.Process.Start("regsvr32.exe", "/s " + path + "\\KisvanMS3.ocx").WaitForExit();
            }


            if (args.Length > 0)
            {
                if (args[0].Trim() != "")
                {
                    string[] arryInfo = args[0].Split('$');

                    if (arryInfo.Length > 0)
                    {
                        if (arryInfo[0] != "") //이이디나 비밀번호가 들어왔다
                        {
                            string[] arryUserInfo = arryInfo[0].Split(',');

                            if (arryUserInfo.Length == 2)
                            {
                                BizCommon.Parm.CurrentUserInformation.id  = arryUserInfo[0];
                                BizCommon.Parm.CurrentUserInformation.Pwd = arryUserInfo[1];
                            }
                        }

                        if (arryInfo.Length > 1)
                        {
                            if (arryInfo[1] != "")
                            {
                                Parm.CONFIG_FILE = arryInfo[1];
                            }
                        }
                    }

                    //string[] arryInfo = args[0].Split(',');

                    //if (arryInfo.Length == 2)
                    //{
                    //    BizCommon.Parm.CurrentUserInformation.id = arryInfo[0];
                    //    BizCommon.Parm.CurrentUserInformation.Pwd = arryInfo[1];
                    //}
                }
            }


            WindowsPrincipal pricipal = new WindowsPrincipal(WindowsIdentity.GetCurrent());
            bool             hasAdministrativeRight = pricipal.IsInRole(WindowsBuiltInRole.Administrator);

            //스플레쉬 칼라값 및 레이블 칼라를 지정한다.



            /******************************************************
             *  뮤택스를 쓰지 않는 이유
             *  프로세스만 살아있다면 사용자는 프로세스를 강제로
             *  종료 해야한다. (작업관리자에서) 그렇기 때문에
             *  뮤택스를 사용하지 않고 Process를 강제로 Kill해준다.
             ***************************************************** /
             *
             * //프로세스 체크
             * bool bProcessCheck = true;
             * Process currentPRocess = Process.GetCurrentProcess();
             * Mutex dup = new Mutex(true, currentPRocess.ProcessName, out bProcessCheck);
             *
             *
             * if (!bProcessCheck)
             * {
             *  MessageBox.Show("프로세스가 실행 중 입니다.","확인",MessageBoxButtons.OK,MessageBoxIcon.Asterisk);
             *  Application.Exit();
             *  return;
             * }
             *********************************************************/


            //프로세스 중복 확인
            try
            {
                fnProcCheck();

                /**/
                //DataTable dtConnect = new DataTable("CONNECT_INFO");
                ///************************************************************************************/
                //dtConnect.Columns.Add("BIZ_CODE");
                //dtConnect.Columns.Add("BIZ_NAME");
                //dtConnect.Columns.Add("FILE_URI");
                //dtConnect.Columns.Add("DB_URI");
                //dtConnect.Rows.Add(new object[] {"10" ,"스코스"                     , "http://www.scosystem.co.kr:51004/WCF_SCOS_BIZ/Download/" , "http://www.scosystem.co.kr:51004/WCF_SCOS_BIZ/DataService.svc"});
                //dtConnect.Rows.Add(new object[] {"20" ,"천안리조트피에프브이(주)"  , "http://www.scosystem.co.kr:51004/WCF_SCOS_BIZ/Download/" , "http://www.scosystem.co.kr:51004/WCF_SCOS_BIZ/DataService.svc"});
                //dtConnect.Rows.Add(new object[] {"21" ,"유러피안리조트"             , "http://www.scosystem.co.kr:51004/WCF_SCOS_BIZ/Download/" , "http://www.scosystem.co.kr:51004/WCF_SCOS_BIZ/DataService.svc"});
                //dtConnect.Rows.Add(new object[] {"11" ,"부여리조트"                 , "http://www.scosystem.co.kr:51004/WCF_SCOS_BIZ/Download/" , "http://www.scosystem.co.kr:51004/WCF_SCOS_BIZ/DataService.svc"});
                //dtConnect.Rows.Add(new object[] {"R1" ,"부여리조트"                 , "http://www.scosystem.co.kr:51004/WCF_SCOS_BIZ/Download/" , "http://www.scosystem.co.kr:51004/WCF_SCOS_BIZ/DataService.svc"});
                //dtConnect.Rows.Add(new object[] {"22" ,"대천리조트"                 , "http://www.scosystem.co.kr:51004/WCF_SCOS_BIZ/Download/" , "http://www.scosystem.co.kr:51004/WCF_SCOS_BIZ/DataService.svc"});

                //dtConnect.WriteXml(@"C:\CONNECT_INFO.xml");
                /************************************************************************************/


                ///**/
                //DataTable dtvan = new DataTable("VAN_INFO");
                ///************************************************************************************/
                //dtvan.Columns.Add("VAN_TYPE");
                //dtvan.Columns.Add("VAN_NAME");
                //dtvan.Columns.Add("SERVER_IP");
                //dtvan.Columns.Add("SERVER_PORT");
                //dtvan.Columns.Add("TEST_IP");
                //dtvan.Columns.Add("TEST_PORT");

                //dtvan.Rows.Add(new object[] {"KICC" ,"KICC 밴" , "203.233.72.55" , "15200" ,  "203.233.72.55" , "15200" });

                //dtvan.WriteXml(@"C:\VAN_INFO.xml");
                ///************************************************************************************/

                if (System.IO.File.Exists(System.Windows.Forms.Application.StartupPath + "\\" + Parm.mPath.PATH_CONNECT_REFERENCE_FILE))
                {
                    Parm.mDataTable.dtConnectInfo.ReadXmlSchema(System.Windows.Forms.Application.StartupPath + "\\" + Parm.mPath.PATH_CONNECT_REFERENCE_FILE);
                    Parm.mDataTable.dtConnectInfo.ReadXml(System.Windows.Forms.Application.StartupPath + "\\" + Parm.mPath.PATH_CONNECT_REFERENCE_FILE);
                }

                if (System.IO.File.Exists(System.Windows.Forms.Application.StartupPath + "\\" + Parm.mPath.PATH_VAN_REFERENCE_FILE))
                {
                    Parm.mDataTable.dtVanInfo.ReadXmlSchema(System.Windows.Forms.Application.StartupPath + "\\" + Parm.mPath.PATH_VAN_REFERENCE_FILE);
                    Parm.mDataTable.dtVanInfo.ReadXml(System.Windows.Forms.Application.StartupPath + "\\" + Parm.mPath.PATH_VAN_REFERENCE_FILE);
                }



                SplashScreen.ShowSplashScreen();
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);


                Application.DoEvents();
                for (int i = 0; i < 20; i++)
                {
                    SplashScreen.SetStatus("시스템 로딩중...");
                    System.Threading.Thread.Sleep(50);
                }

                BizCommon.SettingKeys.Settings();
                BizCommon.SettingKeys.Write();


                if (!System.IO.File.Exists(BizCommon.SettingKeys.GetFilePath()))
                {
                    SplashScreen.SetStatus("환경설정 파일이 없습니다....");
                    System.Threading.Thread.Sleep(1500);


                    SplashScreen.SetStatus("환경설정 파일을 생성합니다.");
                    System.Threading.Thread.Sleep(1000);

                    SplashScreen.SetStatus("모든설정이 초기화 되었습니다.");
                    System.Threading.Thread.Sleep(2000);

                    SplashScreen.SetStatus("접속이 되지 않으면 Service 연결정보를 확인하세요");
                    System.Threading.Thread.Sleep(2000);
                }

                SplashScreen.SetStatus("접속정보를 확인 합니다.");
                System.Threading.Thread.Sleep(500);
                Application.DoEvents();

                BizCommon.SettingKeys.Read();


                ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

                SplashScreen.SetStatus("시스템 환경변수를 구성합니다.");
                System.Threading.Thread.Sleep(1000);

                BizCommon.Parm.mMainStyle.WindowSkin = BizCommon.SettingKeys.GetString(BizCommon.SettingKeys.SKIN);
                BizCommon.Parm.mMainStyle.BAR_STYLE  = BizCommon.SettingKeys.GetString(BizCommon.SettingKeys.BAR_STYLE);
                BizCommon.Parm.mMainStyle.BAR_STYLE1 = BizCommon.SettingKeys.GetString(BizCommon.SettingKeys.BAR_STYLE1);
                mService.ServiceURI = BizCommon.SettingKeys.GetString(BizCommon.SettingKeys.WEB_SERVICE_IP);
                mService.AuthId     = BizCommon.SettingKeys.GetString(BizCommon.SettingKeys.AUTH_ID);
                mService.AuthPwd    = BizCommon.SettingKeys.GetString(BizCommon.SettingKeys.AUTH_PWD);
                BizCommon.Parm.mMainStyle.IsRibonMini            = BizCommon.SettingKeys.GetString(BizCommon.SettingKeys.RIBONMINI) == "TRUE" ? true : false;
                BizCommon.Parm.mMainStyle.MAIN_HEADER_LOCATION   = BizCommon.SettingKeys.GetString(BizCommon.SettingKeys.MAIN_HEADER_LOCATION);
                BizCommon.Parm.mMainStyle.MAIN_HEADER_ORIENTAION = BizCommon.SettingKeys.GetString(BizCommon.SettingKeys.MAIN_HEADER_ORIENTAION);

                /*Van 설정*/
                BizVan.SettingVanParm(BizCommon.SettingKeys.GetString(BizCommon.SettingKeys.VAN_TYPE),
                                      BizCommon.SettingKeys.GetString(BizCommon.SettingKeys.VAN_SVR_IP),
                                      BizCommon.SettingKeys.GetString(BizCommon.SettingKeys.VAN_SVR_PORT),
                                      "  ");
                /************************************************************************************************************************************************************************/

                ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

                //SplashScreen.SetStatus("로컬컴퓨터 시간을 서버시간과 동기화 합니다...");
                //Application.DoEvents();
                //System.Threading.Thread.Sleep(50);

                //DataSet dsTime = DataLayer.ExecuteSpDataset("PKG_LOAD.PR_03", DataLayer.MessageEncoding.Default);
                //System.DateTime time = DateTime.Parse(dsTime.Tables[0].Rows[0][0].ToString().Trim());
                //SplashScreen.SetStatus("시간을 설정합니다....");
                //Application.DoEvents();
                //Basic.SetSysDateTime(time);

                ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


                string ver = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + "\\Ver.txt";
                Parm.VERSION = "정보없음";
                if (File.Exists(ver))
                {
                    string[] lines = System.IO.File.ReadAllLines(ver, System.Text.Encoding.Default);

                    if (lines.Length > 0)
                    {
                        Parm.VERSION = lines[0];
                    }
                }


                ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                //오토업데이트 파일을 복사한다.
                string ConfigFilePathTmp = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + "\\download";
                if (Directory.Exists(ConfigFilePathTmp))
                {
                    string[] arry = Directory.GetFiles(ConfigFilePathTmp);
                    for (int t = 0; t < arry.Length; t++)
                    {
                        string fileName = arry[t].Substring(arry[t].LastIndexOf('\\') + 1, arry[t].Length - arry[t].LastIndexOf('\\') - 1);

                        if (fileName.ToUpper().IndexOf("SMARTUPDATE") >= 0 ||
                            (fileName.ToUpper().IndexOf("AUTOUPDATER") >= 0))
                        {
                            string sourceFilePath = arry[t];
                            string destFilePath   = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + "\\" + fileName;

                            if (System.IO.File.Exists(destFilePath))
                            {
                                //파일이 있다면...
                                DateTime timeDest   = LastModFromDisk(destFilePath);
                                DateTime timeSource = LastModFromDisk(sourceFilePath);

                                if (timeSource > timeDest)
                                {
                                    File.Copy(sourceFilePath, destFilePath, true);
                                }
                            }
                            else
                            {
                                File.Copy(sourceFilePath, destFilePath, true);
                            }
                            //File.Delete(arry[t]);
                        }
                    }
                }
                ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

                Application.DoEvents();
                SplashScreen.SetStatus("접속 URI : " + mService.ServiceURI);
                Application.DoEvents();
                System.Threading.Thread.Sleep(2000);

                SplashScreen.CloseForm();
                Application.Run(new Start());
            }
            catch (Exception ex)
            {
                SplashScreen.SetStatus(ex.Message);
                Application.DoEvents();
                System.Threading.Thread.Sleep(3000);
                Application.Exit();
            }
        }
Beispiel #11
0
 private static void CloseSplashScreen()
 {
     SplashScreen.CloseForm();
 }
Beispiel #12
0
        public frmDAnTEmdi(string danteFilePath, string customLogFilePath)
        {
            mSessionFile = danteFilePath;

            InitializeComponent();

            if (!string.IsNullOrEmpty(customLogFilePath))
            {
                mCustomLoggerEnabled = true;

                if (File.Exists(customLogFilePath))
                {
                    mCustomLogWriter = File.AppendText(customLogFilePath);
                }
                else
                {
                    mCustomLogWriter = new StreamWriter(customLogFilePath);
                }
            }

            this.Text = "InfernoRDN"; //Application.ProductVersion.ToString();

            var startupErrString = new StringBuilder();

            SplashScreen.ShowSplashScreen();
            Application.DoEvents();

            Log(mCustomLoggerEnabled, string.Format("Starting Inferno [{0}]...", DateTime.Now), mCustomLogWriter);
            SplashScreen.SetStatus(string.Format("Starting Inferno [{0}]...", DateTime.Now));
            System.Threading.Thread.Sleep(100);
            SplashScreen.SetStatus("Reading Configuration Parameters...");

            if (!ConfigParameters())
            {
                Log(mCustomLoggerEnabled, "Error: Error in reading inferno.conf file.", mCustomLogWriter);
                startupErrString.Append("* Error in reading inferno.conf file.").AppendLine();
                //SplashScreen.CloseForm();
                //MessageBox.Show("Error in reading inferno.conf file.",
                //    "inferno.conf error", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                //this.Close();
            }
            Log(mCustomLoggerEnabled, "Done reading configuration parameters.", mCustomLogWriter);

            SplashScreen.SetStatus("Initializing Folders...");

            // Initialize folders
            var tempFolderPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);

            var appDataFldrPath = Path.Combine(tempFolderPath, "Inferno");

            if (!Directory.Exists(appDataFldrPath))
            {
                Directory.CreateDirectory(appDataFldrPath);
            }

            mRTempFilePath = appDataFldrPath.Replace(@"\", "/") + "/_temp.png";
            mhelpProviderDAnTE.HelpNamespace = Path.Combine(Application.StartupPath, "InfernoHelp.chm");

            System.Threading.Thread.Sleep(10);
            Log(mCustomLoggerEnabled, "Done setting folders.", mCustomLogWriter);

            SplashScreen.SetStatus("Establishing Connection to R...");
            mRConnector = new clsRconnect();
            if (!mRConnector.initR())
            {
                startupErrString.Append(string.Format("* R failed to initialize: {0}", mRConnector.Message)).AppendLine();
                //SplashScreen.CloseForm();
                //MessageBox.Show("Try again. R failed to initialize for some unknown reason.",
                //    "R connection failed.", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                Log(mCustomLoggerEnabled, "Error: Connection to R failed.", mCustomLogWriter);
                //this.Close();
            }
            System.Threading.Thread.Sleep(10);
            Log(mCustomLoggerEnabled, "Done Connecting to R.", mCustomLogWriter);

            SplashScreen.SetStatus("Initializing R Functions...");
            if (!LoadRfunctions("Inferno.RData"))
            {
                startupErrString.Append("* Error in sourcing R functions.").AppendLine();
                //SplashScreen.CloseForm();
                //MessageBox.Show("Error in sourcing R functions", "Initializing R error",
                //    MessageBoxButtons.OK, MessageBoxIcon.Error);
                Log(mCustomLoggerEnabled, "Error: Sourcing R functions failed.", mCustomLogWriter);
                //this.Close();
            }
            Log(mCustomLoggerEnabled, "Done sourcing R functions.", mCustomLogWriter);

            SplashScreen.SetStatus("Initializing R Plotting Functions...");

            var    usePlotgg = Settings.Default.useGG;
            string mstrPlotFuncFileName;

            if (usePlotgg)
            {
                mstrPlotFuncFileName = "Inferno_ggplots.RData";
            }
            else
            {
                mstrPlotFuncFileName = "Inferno_stdplots.RData";
            }

            if (!LoadRfunctions(mstrPlotFuncFileName))
            {
                startupErrString.Append("* Error in sourcing R plotting functions.").AppendLine();
                //SplashScreen.CloseForm();
                //MessageBox.Show("Error in sourcing R plotting functions", "Initializing R error",
                //    MessageBoxButtons.OK, MessageBoxIcon.Error);
                Log(mCustomLoggerEnabled, "Error: Sourcing R plotting functions failed.", mCustomLogWriter);
                //this.Close();
            }
            Log(mCustomLoggerEnabled, "Done sourcing R plotting functions.", mCustomLogWriter);

            //if (!InitLoadRpackages()) {
            //  startupErrString.Append("* Error loading key R packages.").AppendLine();
            //  //SplashScreen.CloseForm();
            //  //MessageBox.Show("Error loading key R packages", "Error loading key R packs",
            //  //    MessageBoxButtons.OK, MessageBoxIcon.Error);
            //  Log(mblLog, "Error: Loading key R packages failed.", logwriter);
            //  //this.Close();
            //}
            //Log(mblLog, "Done loading key R packages.", logwriter);
            ////InitLoadRpackages();
            System.Threading.Thread.Sleep(10);

            SplashScreen.SetStatus("Checking R version...");
            if (!CheckRVersion("2", "8.0"))
            {
                startupErrString.Append("* R version is not compatible. Install a more recent version.").AppendLine();
                //SplashScreen.CloseForm();
                //MessageBox.Show("R version is not compatible." + Environment.NewLine +
                //    "Please install R version 2.9.x." + Environment.NewLine +
                //    "R can be downloaded from http://cran.r-project.org/",
                //    "R version incompatible", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Log(mCustomLoggerEnabled, "Error: R version incompatible.", mCustomLogWriter);
                //this.Close();
            }
            System.Threading.Thread.Sleep(10);

            SplashScreen.SetStatus(SplashScreen.VALIDATING_R_PACKAGES);

            if (!InstallRequiredRPackages())
            {
                startupErrString.Append("* R failed to install required packages.").AppendLine();
                //SplashScreen.CloseForm();
                //MessageBox.Show("Try again. R failed to install required packages." + Environment.NewLine +
                //    "If this is the first time you run Inferno after installing, check permissions to modify R install folder, else " +
                //    "try changing the repository in the inferno.conf file.",
                //    "R problem...", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                Log(mCustomLoggerEnabled, "Error: Loading required R packages failed.", mCustomLogWriter);
                //this.Close();
            }
            Log(mCustomLoggerEnabled, "Done loading required R packages.", mCustomLogWriter);
            System.Threading.Thread.Sleep(10);

            SplashScreen.SetStatus("Cleaning up temp files; checking for " + mRTempFilePath.Replace("/", @"\"));
            if (!DeleteTempFile())
            {
                // This is not a fatal error
                // Log it, but move on
                startupErrString.Append("* Error cleaning temp files.").AppendLine();
                Log(mCustomLoggerEnabled, "Error: Cleaning temp files failed.", mCustomLogWriter);
            }
            System.Threading.Thread.Sleep(10);


            // No longer used (only used on Windows XP and 2000)
            //
            //SplashScreen.SetStatus("Setting Up Child Forms...");
            //if (RunRlogs())
            //{
            //    mRmsgForm = new frmRmsg();
            //    try
            //    {
            //        //-// rConnector.SetCharacterOutputDevice((StatConnectorCommonLib.IStatConnectorCharacterDevice)mfrmRmsg.axStatConnectorCharacterDevice1.GetOcx());
            //        mRConnector.EvaluateNoReturn("print(version)");
            //        Log(mCustomLoggerEnabled, "Done starting R log viewer.", mCustomLogWriter);
            //    }
            //    catch (Exception ex)
            //    {
            //        startupErrString.Append("* Error starting R log viewer.").AppendLine();
            //        //MessageBox.Show("Error: " + ex.Message, "Watchout!");
            //        Log(mCustomLoggerEnabled, "Error: Error starting R log viewer." + ex.Message, mCustomLogWriter);
            //    }
            //}
            //else
            //{
            //    Log(mCustomLoggerEnabled, "R log viewer not used for this OS.", mCustomLogWriter);
            //}

            this.Activate();
            SplashScreen.CloseForm();

            Log(mCustomLoggerEnabled, "Inferno started.", mCustomLogWriter);
            if (startupErrString.Length > 1)
            {
                var errorMessage = startupErrString.ToString();
                if (!string.IsNullOrEmpty(clsRCmdLog.CurrentLogFilePath))
                {
                    errorMessage += "\nFor more information, see file " + clsRCmdLog.CurrentLogFilePath;
                }

                MessageBox.Show(errorMessage, "Errors Found", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Beispiel #13
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            try
            {
                SplashScreen.ShowSplashScreen();
                Application.DoEvents();
                SplashScreen.SetStatus("Checking for [ " + SystemsConfigFile + " ] ...");
                if (!File.Exists(SystemsConfigFile))
                {
                    throw new FileNotFoundException("SB Payroll cannot locate configuration file " + SystemsConfigFile);
                }

                SplashScreen.SetStatus("Checking for Default System...");
                SBSystem defSys = SQLHelper.GetDataDefaultSystem();
                if (defSys == null)
                {
                    throw new ArgumentException("No Default System is Set", "system");
                }

                //SplashScreen.SetStatus("Connecting to the SQL Server [" + defSys.Server + "]");
                //if (!SQLHelper.ServerExists(defSys))
                //    throw new ArgumentException("Unable to connect to Server [" + defSys.Server + "] ", "server");

                SplashScreen.SetStatus("Checking for a valid Database...");
                if (!SQLHelper.DatabaseExists(defSys))
                {
                    throw new ArgumentException("Database [ " + defSys.Database + " ] does not exist in Server [ " + defSys.Server + " ] ", "database");
                }

                SplashScreen.SetStatus("Checking for Database Version...");
                string dbver  = SQLHelper.DatabaseVersion(defSys);
                string sysver = Assembly.GetEntryAssembly().GetName().Version.ToString();
                if (!dbver.Equals(sysver))
                {
                    throw new ArgumentException("Database and System Version do not match; the Database may not be usable. Use a Database Migration Tool", "version");
                }


                SplashScreen.SetStatus("Checking Defaults Tables are populated...");
                System.Threading.Thread.Sleep(400);

                SplashScreen.SetStatus("Checking for a valid License...");
                System.Threading.Thread.Sleep(2000);
                SplashScreen.CloseForm();
                Application.Run(new Forms.LoginForm(defSys));
            }
            catch (ArgumentException argex)
            {
                string msgex = string.Empty;
                if (argex.ParamName.Equals("server") || argex.ParamName.Equals("system") || argex.ParamName.Equals("database") || argex.ParamName.Equals("version"))
                {
                    switch (argex.ParamName)
                    {
                    case "system":
                        msgex = "Do you want to search other Servers ?";
                        break;

                    case "server":
                        msgex = "The default Server does not exist. Do you want to search for other Servers ?";
                        break;

                    case "database":
                        msgex = "Do you want to create a Database ?";
                        break;

                    case "version":
                        msgex = "Do you want to create a Database with current Version ?";
                        break;
                    }

                    string msg = argex.Message;
                    if (argex.InnerException != null)
                    {
                        msg += "\n" + argex.InnerException.Message;
                    }

                    msg += "\n\n " + msgex;

                    if (DialogResult.Yes == MessageBox.Show(msg, "SB Payroll", MessageBoxButtons.YesNo, MessageBoxIcon.Information))
                    {
                        Forms.DatabaseControlPanelForm f = new DatabaseControlPanelForm();
                        f.ShowDialog();
                    }
                }
            }
            catch (Microsoft.SqlServer.Management.Common.ConnectionFailureException smoex
                   )
            {
                string msg = smoex.Message;
                if (smoex.InnerException != null)
                {
                    msg += "\n" + smoex.InnerException.Message
                           + "\n\n " + "Do you want to Administer Servers and Databases ?";
                }

                if (DialogResult.Yes == MessageBox.Show(msg, "SB Payroll", MessageBoxButtons.YesNo, MessageBoxIcon.Information))
                {
                    Forms.DatabaseControlPanelForm f = new DatabaseControlPanelForm();
                    f.ShowDialog();
                }
            }
            catch (Exception ex)
            {
                string msg = ex.Message;
                if (ex.InnerException != null)
                {
                    msg += "\n" + ex.InnerException.Message
                           + "\n\n " + "Do you want to Administer Servers and Databases ?";
                }

                if (DialogResult.Yes == MessageBox.Show(msg, "SB Payroll", MessageBoxButtons.YesNo, MessageBoxIcon.Information))
                {
                    Forms.DatabaseControlPanelForm f = new DatabaseControlPanelForm();
                    f.ShowDialog();
                }
            }
        }