public ActionResult Delete(int id) { AppUser user = _userManager.FindById(User.Identity.GetUserId()); DataBaseInfo foundDb = DataBasesManager.GetDbInfos(user.Id).Single(db => db.Id == id); return(PartialView(foundDb)); }
public ActionResult ShowConnectionString(int id) { //Find user AppUser user = _userManager.FindById(User.Identity.GetUserId()); //Find DB DataBaseInfo foundDb = DataBasesManager.GetDbInfos(user.Id).Single(db => db.Id == id); return(PartialView("WatchConnectionString", foundDb.ConnectionString)); }
public ActionResult GoToEditingProtected() { var id = DataBasesManager.GetDbInfos(User.Identity.GetUserId()) .OrderByDescending(db => db.DateOfCreating) .First() .Id; return(RedirectToAction("Index", "DisplayTable", new { dbId = id })); }
public ActionResult ShowConnectionString() { string cs = DataBasesManager.GetDbInfos(User.Identity.GetUserId()) .OrderByDescending(db => db.DateOfCreating) .First() .ConnectionString; return(PartialView("ShowConnectionString", cs)); }
/// <summary> /// Removes Database after confiramtion /// </summary> /// <returns></returns> public ActionResult DeleteConfirmed(int id) { //Find user AppUser user = _userManager.FindById(User.Identity.GetUserId()); //Find DB DataBaseInfo foundDb = DataBasesManager.GetDbInfos(user.Id).Single(db => db.Id == id); //Remove db info from DbInfos DataBasesManager.RemoveDbInfo(foundDb); //Delete database DataService.DropDataBase(foundDb.DbmsType, foundDb.Name); return(RedirectToAction("Index")); }
public ActionResult QueryExecutor(QueryExecutorVm vm) { //Find user AppUser user = _userManager.FindById(User.Identity.GetUserId()); DataBaseInfo foundDb = DataBasesManager.GetDbInfos(user.Id).Single(m => m.Id == vm.DbId); //TODO: Think, if i need different executors for each DBMS or not using (IQueryExecutor executor = new SqlServerExecutor(foundDb.ConnectionString)) { vm.DataTable = executor.ExecuteQueryAsDataTable(vm.Query); } return(PartialView("QueryResults", vm.DataTable)); }
public ActionResult ExecuteQuery(int id) { //Find user AppUser user = _userManager.FindById(User.Identity.GetUserId()); //Find DB DataBaseInfo foundDb = DataBasesManager.GetDbInfos(user.Id).Single(db => db.Id == id); QueryExecutorVm vm = new QueryExecutorVm { DbId = id, DbName = foundDb.Name }; return(PartialView("~/Views/Query/QueryExecutor.cshtml", vm)); }
public ActionResult Index() { AppUser user = _userManager.FindById(User.Identity.GetUserId()); return(View(DataBasesManager.GetDbInfos(user.Id))); }