コード例 #1
0
        private int DeleteBackup(int backupSetId)
        {
            LOG.DEBUG("Delete backup", "backup_set_id", backupSetId);
            taKeys.Fill(dataSet.keys, backupSetId);
            string query = string.Format(CONS.QUERYSTRING.DELETE_BACKUP, backupSetId);

            int restoreCount = bdsKeys.Count;

            if (restoreCount > 0)
            {
                string queryDeleteRestoreHistory = "";
                for (int index = 0; index < restoreCount; index++)
                {
                    string restore_history_id = ((DataRowView)bdsKeys[index])["restore_history_id"].ToString();
                    queryDeleteRestoreHistory += string.Format(CONS.QUERYSTRING.DELETE_RESTORE_HISTORY, restore_history_id);
                }
                query = queryDeleteRestoreHistory + query;
            }

            return(Program.ExecSqlNonQuery(query, Program.ConnectionString));
        }