Esempio n. 1
0
        public ActionResult DatabaseBackup(FormCollection fc)
        {
            ViewBag.Title = Constant.BACKUP_DATABASE;

            try
            {
                var backupType = fc["BackupType"];

                if (backupType == "FullDatabaseBackup")
                {
                    //Perform Full Database Backup
                    BackupRestore.FullDatabaseBackup(LoadEnvironment.FOLDER_LOCATION + AppendDate.Append(Path.GetFileName(LoadEnvironment.BACKUP_FILE_NAME)));
                }
            }
            catch (IOException e)
            {
                // Extract some information from this exception, and then
                // throw it to the parent method.
                if (e.Source != null)
                {
                    Console.WriteLine("IOException source: {0}", e.Source);
                    throw;
                }
            }
            return(View());
        }