public ActionResult Modify(RendCantCrudViewModel model) { //LoggerFactory.CreateLog().Debug(string.Format(CultureInfo.InvariantCulture, "Presentation Layer - ModifyRendCant Controller Begin")); try { // Add modify logic here if (ModelState.IsValid) { var committed = _serviceRendCant.Update(model.RendCant, null); _unitOfWork.SaveChanges(); if (committed) { //LoggerFactory.CreateLog().Debug(string.Format(CultureInfo.InvariantCulture, "Presentation Layer - ModifyRendCant Controller End")); return(RedirectToAction("Find")); } } } catch (Exception ex) { //LoggerFactory.CreateLog().Error(string.Format(CultureInfo.InvariantCulture, "Presentation Layer - ModifyRendCant Controller ERROR"), ex); } ModelState.AddModelError("", PresentationResources.Error); return(View("RendCantModifyView", new RendCantCrudViewModel(_serviceRendCant, _serviceAlim, _serviceRend))); }
// GET public ActionResult Add() { //LoggerFactory.CreateLog().Debug(string.Format(CultureInfo.InvariantCulture, "Presentation Layer - AddRendCant Controller Begin")); try { // Add add logic here var model = new RendCantCrudViewModel(_serviceRendCant, _serviceAlim, _serviceRend); //LoggerFactory.CreateLog().Debug(string.Format(CultureInfo.InvariantCulture, "Presentation Layer - AddRendCant Controller End")); return(View("RendCantAddView", model)); } catch (Exception ex) { //LoggerFactory.CreateLog().Error(string.Format(CultureInfo.InvariantCulture, "Presentation Layer - AddRendCant Controller ERROR"), ex); } return(RedirectToAction("Index", "Home")); }
// GET public ActionResult Remove(int id) { //LoggerFactory.CreateLog().Debug(string.Format(CultureInfo.InvariantCulture, "Presentation Layer - RemoveRendCant Controller Begin")); try { // Add remove logic here var model = new RendCantCrudViewModel(_serviceRendCant, _serviceAlim, _serviceRend) { RendCant = _serviceRendCant.Find(id) }; //LoggerFactory.CreateLog().Debug(string.Format(CultureInfo.InvariantCulture, "Presentation Layer - RemoveRendCant Controller End")); return(View("RendCantRemoveView", model)); } catch (Exception ex) { //LoggerFactory.CreateLog().Error(string.Format(CultureInfo.InvariantCulture, "Presentation Layer - RemoveRendCant Controller ERROR"), ex); } return(RedirectToAction("Find")); }