public FileStreamResult Download() { return(new FileStreamResult(LocalDbHelper.Download(), "application/x-sql") { FileDownloadName = "localdb.sql" }); }
public IActionResult Restore([Bind("Path")] string path) { var success = LocalDbHelper.Restore(path); if (success) { return(RedirectToAction("Index", new { table = "T1" })); } return(RedirectToAction("Error")); }
public IActionResult Delete([Bind("ID")] T1 data) { var success = LocalDbHelper.Delete(data); if (success) { return(RedirectToAction("Index", new { table = "T1" })); } return(RedirectToAction("Error")); }
public ContentResult Backup() { var success = LocalDbHelper.Backup(); if (success) { return(Content("{\"success\":true}", "application/json")); } return(Content("{\"success\":false}", "application/json")); }
public IActionResult Index(string table = null) { var data = new List <T1>(); if (table == "T1") { ViewData["Table"] = table; data = LocalDbHelper.ReadT1(); } return(View(data)); }
public IActionResult Index([Bind("ID,Name")] FilterModel filterModel, string table = null) { var data = new List <T1>(); if (table == "T1") { ViewData["Table"] = table; data = LocalDbHelper.ReadT1(filterModel); } ViewData["Filter"] = filterModel; return(View(data)); }
public void TestCreateConnectCloseDeleteDatabase() { var connStr = LocalDbHelper.CreateDatabase("Database1", InstanceName); Assert.IsTrue(File.Exists(Environment.ExpandEnvironmentVariables(Path.Combine(LocalDbHelper.DataPath, InstanceName, "Database1_data.mdf")))); var conn = new System.Data.SqlClient.SqlConnection(connStr); conn.Open(); Assert.AreEqual(System.Data.ConnectionState.Open, conn.State); // intentionally leaving database connection open above LocalDbHelper.DeleteDatabase("Database1", InstanceName); Assert.IsFalse(File.Exists(Environment.ExpandEnvironmentVariables(Path.Combine(LocalDbHelper.DataPath, InstanceName, "Database1_data.mdf")))); }
private static bool Bootstrap() { container = new Container(); var connectionstring = LocalDbHelper.GetConnectionString(); if (string.IsNullOrEmpty(connectionstring)) { MessageBox.Show("De database kon niet worden aangemaakt of gevonden. Mogelijk is deze niet geïnstalleerd. Installeer SqlLocalDB.MSI", "Database niet gevonden", MessageBoxButtons.OK); return(false); } container.Register <IDataService>(() => new DataService(connectionstring), Lifestyle.Singleton); container.Register <TopXConverter>(); return(true); }
public PlatformBllBase() { m_dbHelper = LocalDbHelper <Platform> .Instance; }
public InstanceStatusKeeper(ISLogger logger) { this.logger = logger; instanceInfoHelper = new InstanceInfoHelper(); localDbHelper = new LocalDbHelper(); }
public static void Cleanup() { LocalDbHelper.DeleteInstance(InstanceName); }
static LocalDbHelperTests() { LocalDbHelper.TryDeleteInstance(InstanceName); LocalDbHelper.CreateInstance(InstanceName); }
public CommonRepository() { DbHelper = new LocalDbHelper(); }
public UserBllBase() { m_dbHelper = LocalDbHelper <User> .Instance; }