public AccountVM(User user) { SQL sql = new SQL(); sql.Connect(); this.Scripts = sql.ReturnAllSCriptsByUser(user); foreach(Script item in this.Scripts) { item.InstOfDb.Name = sql.ReturnNameOfInstance(item.InstOfDb.ID); } sql.Close(); }
public PartialViewResult ScriptInfo(int id) { Script sc = new Script(); SQL sql = new SQL(); sql.Connect(); sc = sql.ReturnScriptByID(id); sc.InOfDb = sql.ReturnNameOfInstance(sc.InstOfDb.ID); File file = new File(); sc.Content = file.ReturnContentOfScript(sc.Path); sql.Close(); return PartialView("_ScriptInfo", sc); }