Esempio n. 1
0
 public ActionResult Add(Models.ServicesDirectory servicesDirectory)
 {
     if (ModelState.IsValid)
     {
         servicesDirectoryRepository.Insert(serviceDirectoryMapper.MapFromModel(servicesDirectory));
         return(RedirectPermanent("/ServicesDirectory/show/"));
     }
     return(View());
 }
Esempio n. 2
0
 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));
 }
Esempio n. 3
0
        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
     });
 }