Example #1
0
        // GET: Materiel/Delete/5
        public ActionResult Delete(int id)
        {
            materiel mat = service.GetById(id);

            service.DeleteMateriel(mat);
            service.SaveChange();
            return(RedirectToAction("Index"));
        }
Example #2
0
 public ActionResult Create(materiel m)
 {
     if (ModelState.IsValid)
     {
         service.AddMateriel(m);
         service.SaveChange();
         return(RedirectToAction("Index"));
     }
     else
     {
         return(View());
     }
 }
Example #3
0
        // GET: Materiel/Details/5
        public ActionResult Details(long id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            materiel util = service.GetById(id);

            if (util == null)
            {
                return(HttpNotFound());
            }
            return(View(util));
        }
Example #4
0
        public ActionResult Edit(materiel mat)
        {
            try
            {
                // TODO: Add update logic here
                if (ModelState.IsValid)
                {
                    service.editMateriel(mat);
                    service.SaveChange();
                }

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Example #5
0
        // GET: Materiel/Edit/5
        public ActionResult Edit(int id)
        {
            materiel mat = service.GetById(id);

            return(View(mat));
        }
Example #6
0
 public void editMateriel(materiel materiel)
 {
     uow.MaterielRepository.Update(materiel);
     uow.Commit();
 }
Example #7
0
 public void DeleteMateriel(materiel materiel)
 {
     uow.MaterielRepository.Delete(materiel);
 }
Example #8
0
 public void AddMateriel(materiel materiel)
 {
     uow.MaterielRepository.Add(materiel);
     uow.Commit();
 }