public ActionResult Add(Models.ServicesDirectory servicesDirectory) { if (ModelState.IsValid) { servicesDirectoryRepository.Insert(serviceDirectoryMapper.MapFromModel(servicesDirectory)); return(RedirectPermanent("/ServicesDirectory/show/")); } return(View()); }
public ActionResult Edit(Models.ServicesDirectory servicesDirectory, int id) { if (ModelState.IsValid) { servicesDirectoryRepository.Update(id, serviceDirectoryMapper.MapFromModel(servicesDirectory)); return(RedirectPermanent("/ServicesDirectory/show")); } servicesDirectory.Id = id; return(View(servicesDirectory)); }
public ActionResult Edit(int id) { Models.ServicesDirectory serviceDirectoryModel = serviceDirectoryMapper.MapFromEntity(servicesDirectoryRepository.GetItem(id)); return(View(serviceDirectoryModel)); }
public DataAccessLayerCommon.ServicesDirectory MapFromModel(Models.ServicesDirectory model) { return(new DataAccessLayerCommon.ServicesDirectory { Id = model.Id, Name = model.Name }); }