Example #1
0
        public ActionResult Create(bool Catering, [Bind(Include = "Id,Nazwa,RodzicId")] Kategoria kategoria)
        {
            if (ModelState.IsValid)
            {
                _repo.Aktualizuj(kategoria);
                _repo.SaveChanges();
                return(View(new KategoriaView {
                    Kategoria = new Kategoria(), lista = _repo.PobierzKategorie(Catering).ToList()
                }));
            }

            return(View(kategoria));
        }
 public ActionResult Edit(Kategoria kategoria)
 {
     if (ModelState.IsValid)
     {
         try
         {
             // ogloszenie.UzytkownikId = "ffgfs";
             _repo.Aktualizuj(kategoria);
             _repo.SaveChanges();
         }
         catch (Exception)
         {
             ViewBag.Blad = true;
             return(View(kategoria));
         }
     }
     ViewBag.Blad = false;
     return(View(kategoria));
 }