Example #1
0
        //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));
        }
Example #2
0
        //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);
        }