CEL_Payroll/Payroll.BO/Query Analyzer/Utils.cs
2024-09-17 14:30:13 +06:00

76 lines
2.0 KiB
C#

using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
namespace Payroll.BO
{
public class Utils
{
public static void BackupDatabase(string filepath)
{
try
{
UtilsService Service = new UtilsService();
Service.BackupDatabase(filepath);
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}
public static ArrayList GetDatabases()
{
try
{
UtilsService Service = new UtilsService();
return Service.GetDatabases();
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}
public static void RestorDatabase(string dbName,string filepath)
{
try
{
UtilsService Service = new UtilsService();
Service.RestorDatabase(dbName, filepath);
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}
public static void AttachSingleDB(string dbName, string filepath)
{
try
{
UtilsService Service = new UtilsService();
Service.AttachSingleDB(filepath,dbName);
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}
public static void RestorDatabase(string sDBName, string sBackupFilePath, string sToDataFilePath, string sToLogFilePath)
{
try
{
UtilsService Service = new UtilsService();
Service.RestorDatabase(sDBName, sBackupFilePath,sToDataFilePath,sToLogFilePath);
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}
}
}