Пример #1
0
        void BtnBackupClick(object sender, EventArgs e)
        {
            saveFileDialog1.Title = "Select your folder and backup name:";

            saveFileDialog1.FileName = DateTime.Now.Year.ToString() +
                                       DateTime.Now.Month.ToString().PadLeft(2, '0') +
                                       DateTime.Now.Day.ToString().PadLeft(2, '0') +
                                       DateTime.Now.Hour.ToString().PadLeft(2, '0') +
                                       DateTime.Now.Minute.ToString().PadLeft(2, '0') +
                                       "_" + app_handle.m_schema + ".bkp";

            saveFileDialog1.Filter = "Backup files (*.bkp)|*.bkp";

            if (saveFileDialog1.ShowDialog() == DialogResult.OK)
            {
                Backup bkp = new Backup();

                string connection = IServAppHandle.getConnString(var_data.db_machine,
                                                                 InfraSoftwareServer.db_schema,
                                                                 var_data.user,
                                                                 var_data.password,
                                                                 Convert.ToInt32(var_data.db_port),
                                                                 Convert.ToInt32(var_data.db_choice));


                if (saveFileDialog1.FileName != "")
                {
                    pgBackup.Visible = true;

                    BtnStart.Enabled   = false;
                    BtnBackup.Enabled  = false;
                    BtnRestore.Enabled = false;

                    LblBackup.Text = "Saving Database";
                    Application.DoEvents();

                    bkp.doBackup(saveFileDialog1.FileName, connection, pgBackup);

                    MessageBox.Show("Backup Completed!", "SYSTEM");

                    LblBackup.Text = "";

                    pgBackup.Visible   = false;
                    BtnStart.Enabled   = true;
                    BtnBackup.Enabled  = true;
                    BtnRestore.Enabled = true;
                }
            }
        }
Пример #2
0
        public LoadInterface()
        {
            InitializeComponent();

            connString = IServAppHandle.getConnString(var_data.db_machine,
                                                      InfraSoftwareServer.db_schema,
                                                      var_data.user,
                                                      var_data.password,
                                                      Convert.ToInt32(var_data.db_port),
                                                      Convert.ToInt32(var_data.db_choice));

            var_tim.Interval = 1000;
            var_tim.Tick    += time_up;
            var_tim.Start();
        }
Пример #3
0
        void BtnRestoreClick(object sender, EventArgs e)
        {
            openFileDialog1.Title    = "Select your backup file:";
            openFileDialog1.Filter   = "Backup files (*.bkp)|*.bkp";
            openFileDialog1.FileName = "";

            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                Backup bkp = new Backup();

                string connection = IServAppHandle.getConnString(var_data.db_machine,
                                                                 InfraSoftwareServer.db_schema,
                                                                 var_data.user,
                                                                 var_data.password,
                                                                 Convert.ToInt32(var_data.db_port),
                                                                 Convert.ToInt32(var_data.db_choice));

                if (openFileDialog1.FileName != "")
                {
                    pgBackup.Visible = true;

                    BtnStart.Enabled   = false;
                    BtnBackup.Enabled  = false;
                    BtnRestore.Enabled = false;

                    bkp.doRestore(openFileDialog1.FileName, connection, pgBackup, LblBackup);

                    MessageBox.Show("Restore Completed!", "SYSTEM");

                    LblBackup.Text = "";

                    pgBackup.Visible   = false;
                    BtnStart.Enabled   = true;
                    BtnBackup.Enabled  = true;
                    BtnRestore.Enabled = true;
                }
            }
        }
Пример #4
0
        public void LoadParams()
        {
            app_handle.m_connectionString = IServAppHandle.getConnString(var_data.db_machine,
                                                                         InfraSoftwareServer.db_schema,
                                                                         var_data.user,
                                                                         var_data.password,
                                                                         Convert.ToInt32(var_data.db_port),
                                                                         Convert.ToInt32(var_data.db_choice));
            app_handle.m_DB_Machine       = var_data.db_machine;
            app_handle.m_schema           = InfraSoftwareServer.db_schema;
            app_handle.m_language         = var_data.language;
            app_handle.m_clientServerPort = Convert.ToInt32(var_data.clientServerPort);
            app_handle.m_max_packet_size  = Convert.ToInt32(var_data.maxPacket);

            app_handle.m_transDisp = new ServerDispatcher();
            app_handle.m_recept    = new ServerRecept();

            app_handle.m_master_server       = "";
            app_handle.m_standby_server      = var_data.standBy;
            app_handle.m_standby_server_web  = var_data.webStandBy;
            app_handle.m_standby_server_port = var_data.standByPort;
            app_handle.m_fail_fs             = var_data.failFS;
        }
Пример #5
0
        public ClusterInterface(ref Translator trans)
        {
            InitializeComponent();

            string target_file = var_data.pathDir + "\\connection_stats.log";

            if (File.Exists(target_file))
            {
                File.Delete(target_file);
            }

            target_file = var_data.pathDir + "\\load_stats.log";

            if (File.Exists(target_file))
            {
                File.Delete(target_file);
            }

            target_file = var_data.pathDir + "\\cpu_stats.log";

            if (File.Exists(target_file))
            {
                File.Delete(target_file);
            }

            target_file = var_data.pathDir + "\\scheduler.log";

            if (File.Exists(target_file))
            {
                File.Delete(target_file);
            }

            BtnClientsClick(null, null);

            var_translator = trans;

            app_handle = new IServAppHandle(var_data.pathDir, ref var_translator);

            LoadParams();

            BtnPause.Enabled   = false;
            BtnBackup.Enabled  = true;
            BtnRestore.Enabled = true;

            tm_AppRefresh.Interval = 250;

            Text = app_handle.m_schema;

            refreshTitles();

            string schel_log = new SyCrafEngine.InstallData().pathDir + "\\log\\scheduler_log";

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

            string dir_watch = new SyCrafEngine.InstallData().pathDir + "\\proc";

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

            if (!Directory.Exists(dir_watch + "\\rejected"))
            {
                Directory.CreateDirectory(dir_watch + "\\rejected");
            }

            if (!Directory.Exists(dir_watch + "\\term"))
            {
                Directory.CreateDirectory(dir_watch + "\\term");
            }
        }