Esempio n. 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;
                }
            }
        }
Esempio n. 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();
        }
Esempio n. 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;
                }
            }
        }
Esempio n. 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;
        }