// GET: Kategoria/Details/5 //public ActionResult Details(int? id) //{ // if (id == null) // { // return new HttpStatusCodeResult(HttpStatusCode.BadRequest); // } // Kategoria kategoria = db.Kategorie.Find(id); // if (kategoria == null) // { // return HttpNotFound(); // } // return View(kategoria); //} // GET: Kategoria/Create public ActionResult Create(bool Catering) { var kategoriaview = new KategoriaView { Kategoria = new Kategoria(), lista = _repo.PobierzKategorie(Catering).ToList() }; //ProcessStartInfo info = new ProcessStartInfo(); //info.Verb = "print"; //info.FileName = @"D:\sfe.txt"; //info.CreateNoWindow = true; //info.WindowStyle = ProcessWindowStyle.Hidden; //Process p = new Process(); //p.StartInfo = info; //p.Start(); //p.WaitForInputIdle(); //System.Threading.Thread.Sleep(3000); //if (false == p.CloseMainWindow()) // p.Kill(); return(View(kategoriaview)); }
//GET: Kategoria/Edit/5 //public ActionResult Edit() //{ // var kategoriaview = new KategoriaView { Kategoria = new Kategoria(), lista = _repo.PobierzKategorie().ToList() }; // return View(kategoriaview); //} // POST: Kategoria/Edit/5 // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. //[HttpPost] //[ValidateAntiForgeryToken] //public ActionResult Edit([Bind(Include = "Id,Nazwa,RodzicId")] Kategoria kategoria) //{ // if (ModelState.IsValid) // { // db.Entry(kategoria).State = EntityState.Modified; // db.SaveChanges(); // return RedirectToAction("Index"); // } // ViewBag.RodzicId = new SelectList(db.Kategorie, "Id", "Nazwa", kategoria.RodzicId); // return View(kategoria); //} // GET: Kategoria/Delete/5 public ActionResult Delete(bool Catering, bool?blad) { var kategoriaview = new KategoriaView { Kategoria = new Kategoria(), lista = _repo.PobierzKategorie(Catering).ToList() }; if (blad != null) { ViewBag.Blad = true; } return(View(kategoriaview)); }