Ejemplo n.º 1
0
 public ActionResult AddContent(AddContent add)
 {
     if (ModelState.IsValid)
     {
         DBcontext.Add(add);
         DBcontext.SaveChanges();
     }
     else
     {
         throw new Exception();
     }
     return(RedirectToAction(nameof(PlayVideo), new { id = add.Id }));
 }
Ejemplo n.º 2
0
 public async Task <IActionResult> OnGetAsync(AddContent add)
 {
     if (ModelState.IsValid)
     {
         DBcontext.Add(add);
         DBcontext.SaveChanges();
     }
     else
     {
         throw new Exception();
     }
     return(Redirect("/Identity/Account/Manage/PlayVideo"));
     //return RedirectToAction(nameof("Identity/Account/Manage/PlayVideo"), new { id = add.Id });
 }
Ejemplo n.º 3
0
        public IActionResult SignUp(Account add)
        {
            if (ModelState.IsValid)
            {
                DBcontext.Add(add);
                DBcontext.SaveChanges();
                ModelState.Clear();

                //ViewBag.Message = add.Username + " " + "successfully registered!";
            }
            //else
            //{
            //throw new Exception();
            //}

            return(RedirectToAction(nameof(Login)));
        }