Beispiel #1
0
 public ActionResult Edit(CutDetailType cutDetailType)
 {
     if (ModelState.IsValid)
     {
         cutDetailType.IsDeleted = false;
         UnitOfWork.CutDetailTypeRepository.Update(cutDetailType);
         UnitOfWork.Save();
         return(RedirectToAction("Index"));
     }
     return(View(cutDetailType));
 }
Beispiel #2
0
        // GET: CutDetailTypes/Delete/5
        public ActionResult Delete(Guid?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CutDetailType cutDetailType = UnitOfWork.CutDetailTypeRepository.GetById(id.Value);

            if (cutDetailType == null)
            {
                return(HttpNotFound());
            }
            return(View(cutDetailType));
        }
Beispiel #3
0
        public ActionResult Create(CutDetailType cutDetailType)
        {
            if (ModelState.IsValid)
            {
                cutDetailType.IsDeleted    = false;
                cutDetailType.CreationDate = DateTime.Now;
                cutDetailType.Id           = Guid.NewGuid();
                UnitOfWork.CutDetailTypeRepository.Insert(cutDetailType);
                UnitOfWork.Save();
                return(RedirectToAction("Index"));
            }

            return(View(cutDetailType));
        }