예제 #1
0
        private void backup_Click(object sender, EventArgs e)
        {
            DBBackup dbb = new DBBackup(false);

            dbb.ShowDialog();

            updateDataGridView(DbRollbackRecord.getInctance().getAllRecord());
        }
예제 #2
0
        private void FormBaseDbRollbackRecord_Load(object sender, EventArgs e)
        {
            m_dateGridViewExtend.addDataGridViewColumn("ID", 30);
            m_dateGridViewExtend.addDataGridViewColumn("日期时间", 150);
            m_dateGridViewExtend.addDataGridViewColumn("备份人姓名", 100);
            m_dateGridViewExtend.addDataGridViewColumn("主机名", 100);
            m_dateGridViewExtend.addDataGridViewColumn("恢复使用文件名", 200);
            m_dateGridViewExtend.addDataGridViewColumn("执行恢复操作原因", 300);
            m_dateGridViewExtend.addDataGridViewColumn("是否成功", 80);

            m_dateGridViewExtend.initDataGridViewColumn(this.dataGridViewBilConfigList);
            updateDataGridView(DbRollbackRecord.getInctance().getAllRecord());

            setPageActionEnable();
        }
예제 #3
0
        private void buttonSave_Click(object sender, EventArgs e)
        {
            if (this.textBoxFileDirectory.Text.Length == 0)
            {
                MessageBoxExtend.messageWarning(this.labelPath.Text + "不能为空,请填写");
                return;
            }

            if (this.textBoxReason.Text.Length == 0)
            {
                MessageBoxExtend.messageWarning(this.labelReason.Text + "不能为空,请填写");
                return;
            }

            if (m_isBackup)
            {
                DbBackupRecordTable record = new DbBackupRecordTable();

                record.name      = DbPublic.getInctance().getCurrentLoginUserName();
                record.hostName  = Dns.GetHostName();
                record.backType  = 0;
                record.reason    = this.textBoxReason.Text;
                record.note      = this.textBoxNode.Text;
                record.savePath1 = this.textBoxFileDirectory.Text;

                //DbBackupRecord.getInctance().insert(record);

                //string parameter = record.savePath1 + " #";

                //// 启动DBBackup.exe
                //Process.Start(@"DBBackup.exe", parameter);

                if (DbBackupRecord.getInctance().databaseBack(record.savePath1))
                {
                    DbBackupRecord.getInctance().insert(record);
                }
            }
            else
            {
                DbRollbackRecordTable record = new DbRollbackRecordTable();

                record.name     = DbPublic.getInctance().getCurrentLoginUserName();
                record.hostName = Dns.GetHostName();
                record.reason   = this.textBoxReason.Text;
                record.note     = this.textBoxNode.Text;
                record.fileName = this.textBoxFileDirectory.Text;

                record.reason = this.textBoxReason.Text;
                record.note   = this.textBoxNode.Text;

                //DbRollbackRecord.getInctance().insert(record);
                //string newRecordID = Convert.ToString(DbPublic.getInctance().getTableMaxPkey("BASE_DB_ROLLBACK_RECORD") + 1);
                //string parameter = record.fileName + " " + newRecordID;

                //// 启动DBBackup.exe
                //Process.Start(@"DBRollback.exe", parameter);

                if (DbRollbackRecord.getInctance().databaseRollback(record.fileName))
                {
                    DbRollbackRecord.getInctance().insert(record);
                }
            }

            this.Close();
        }