private void updateDataGridView(SortedDictionary <int, DbRollbackRecordTable> backupRecordList) { m_dataGridRecordCount = backupRecordList.Count; SortedDictionary <int, ArrayList> backupRecordLArrary = new SortedDictionary <int, ArrayList>(); for (int i = 0; i < backupRecordList.Count; i++) { DbRollbackRecordTable record = new DbRollbackRecordTable(); record = (DbRollbackRecordTable)backupRecordList[i]; ArrayList temp = new ArrayList(); temp.Add(record.pkey); temp.Add(record.dateTime); temp.Add(record.name); temp.Add(record.hostName); temp.Add(record.fileName); temp.Add(record.reason); temp.Add(record.state); backupRecordLArrary.Add(i, temp); } m_dateGridViewExtend.initDataGridViewData(backupRecordLArrary); }
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(); }