//Konto public ActionResult Account(int? page) { int pageSize = 10; int pageNum = (page ?? 1); //AccountVM vm = new AccountVM(User.Identity.Name); SQL sql = new SQL(); sql.Connect(); User user = sql.ReturnUserByName(User.Identity.Name); sql.Close(); AccountVM vm = new AccountVM(user); return View(vm.Scripts.ToPagedList(pageNum, pageSize)); }
public void SetModel(string UserName) { SQL sql = new SQL(); sql.Connect(); this.user = sql.ReturnUserByName(UserName); this.user.Name = UserName; this.script = new Script(); this.ListOfInstanceDb = new List<string>(); ListOfInstanceDb = sql.ReturnAllInstDB(); sql.Close(); this.ListOfTypeOfDb = new List<string>(); ListOfTypeOfDb.Add("ORACLE"); ListOfTypeOfDb.Add("MSSQL"); ListOfTypeOfDb.Add("POSTGRE"); }
//usuwanie skryptu public ActionResult RemoveScript(int id) { Script sc = new Script(); SQL sql = new SQL(); sql.Connect(); sc = sql.ReturnScriptByID(id); sql.DeleteScriptFromList(sc.ID); File f = new File(); f.RemoveFile(sc.Path); sql.DeleteScriptFromScript(sc.ID); //AccountVM vm = new AccountVM(User.Identity.Name); User user = sql.ReturnUserByName(User.Identity.Name); AccountVM vm = new AccountVM(user); sql.Close(); return View("Account", vm); }