public IActionResult AddDojo(Dojo dojo)
 {
     if (ModelState.IsValid)
     {
         _dojofactory.Add(dojo);
         return(RedirectToAction("Dojos"));
     }
     return(View("Dojos"));
 }
Exemplo n.º 2
0
 public IActionResult ProcessDojo(Dojo data)
 {
     if (ModelState.IsValid)
     {
         dojoFactory.Add(data);
         return(RedirectToAction("Dojos"));
     }
     return(RedirectToAction("Dojos"));
 }
 public IActionResult AddDojo(Dojo dojo)
 {
     if (ModelState.IsValid)
     {
         dojoFactory.Add(dojo);
         return(RedirectToAction("Index"));
     }
     ;
     return(View("Index", dojo));
 }
 public IActionResult AddDojo(Dojo dojo)
 {
     if (ModelState.IsValid)
     {
         dojoFactory.Add(dojo);
         return(RedirectToAction("Dojos"));
     }
     ViewBag.dojos = dojoFactory.FindAll();
     return(View("Dojos"));
 }
Exemplo n.º 5
0
        public IActionResult addDojo(Dojo item)
        {
            if (ModelState.IsValid)
            {
                dojoFactory.Add(item);
                return(RedirectToAction("DojoHome"));
            }
            ViewBag.dojos = dojoFactory.GetAll();

            return(View("dojos"));
        }
 public IActionResult CreateDojo(DojoModel submission)
 {
     if (ModelState.IsValid)
     {
         dojoFactory.Add(submission);
         return(RedirectToAction("Dojos"));
     }
     else
     {
         return(View("Dojos"));
     }
 }
Exemplo n.º 7
0
 public IActionResult createDojo(Dojo dojo)
 {
     if (ModelState.IsValid)
     {
         dojoFactory.Add(dojo);
         return(RedirectToAction("AllDojos"));
     }
     else
     {
         ViewBag.allDojos = dojoFactory.FindAll();
         return(View("AllDojos"));
     }
 }
Exemplo n.º 8
0
 public IActionResult AddDojo(Dojo newDojo)
 {
     if (ModelState.IsValid)
     {
         dojoFactory.Add(newDojo);
         return(RedirectToAction("Dojos"));
     }
     else
     {
         ViewBag.Errors = ModelState.Values; // NEED to add errors to View
         return(RedirectToAction("Dojos"));
     }
 }
Exemplo n.º 9
0
 public IActionResult AddDojo(Dojo dojo)
 {
     if (!ModelState.IsValid)
     {
         ViewBag.Dojos = dojoFactory.FindAll();
         return(View("Index"));
     }
     else
     {
         dojoFactory.Add(dojo);
         return(RedirectToAction("Index"));
     }
 }
 public IActionResult addDojo(Dojo dojo)
 {
     if (ModelState.IsValid)
     {
         Console.WriteLine("THERE WERE NO ERRORS!");
         dojoFactory.Add(dojo);
         return(Redirect("/Dojos"));
     }
     else
     {
         Console.WriteLine("THERE WAS ERRORS IN YOUR FORM!");
         return(View("index", dojo));
     }
 }
Exemplo n.º 11
0
 public IActionResult AddDojo(RegisterViewDojo model)
 {
     if (ModelState.IsValid)
     {
         Dojo NewDojo = new Dojo
         {
             Name        = model.Name,
             Location    = model.Location,
             Information = model.Information
         };
         dojoFactory.Add(NewDojo);
         return(RedirectToAction("Dojos"));
     }
     return(View("Dojos", model));
 }
        public IActionResult AddDojo(DojoDisplay DojoDisplay)
        {
            Dojo Dojo = DojoDisplay.Dojo;

            // check for validations
            if (ModelState.IsValid)
            {
                // add to db
                _dojoFactory.Add(DojoDisplay.Dojo);
                return(RedirectToAction("Dojo"));
            }
            else
            {
                // display the validation errors
                DojoDisplay.AllDojos = _dojoFactory.FindAllDojos();
                return(View("Dojo", DojoDisplay));
            }
        }
Exemplo n.º 13
0
 public IActionResult Create(Dojo dojo)
 {
     dojoFactory.Add(dojo);
     return(RedirectToAction("Index"));
 }
 public IActionResult CreateDojo(Dojo item)
 {
     dojoFactory.Add(item);
     return(RedirectToAction("DojoIndex"));
 }