Esempio n. 1
0
        public ActionResult Create(ModelisEditViewModel collection)
        {
            try
            {
                // TODO: Add insert logic here
                if (ModelState.IsValid)
                {
                    modeliuRepository.addModelis(collection);
                }

                return(RedirectToAction("Index"));
            }
            catch
            {
                PopulateSelections(collection);
                return(View(collection));
            }
        }
        public ActionResult Edit(int id, ModelisEditViewModel collection)
        {
            try
            {
                // TODO: Add update logic here
                if (ModelState.IsValid)
                {
                    modeliuRepository.updateModelis(collection);
                }

                return(RedirectToAction("Index"));
            }
            catch
            {
                PopulateSelections(collection);
                return(View(collection));
            }
        }
        // GET: Modelis/Delete/5
        public ActionResult Delete(int id)
        {
            ModelisEditViewModel modelis = modeliuRepository.getModelis(id);

            return(View(modelis));
        }