Example #1
0
 public ActionResult Edit(int id, ServiceProviderModel serviceProvider)
 {
     try
     {
         ServiceProviderRepository.Update(id, serviceProvider);
         return(RedirectToAction(nameof(Index)));
     }
     catch
     {
         return(View());
     }
 }
Example #2
0
 public ActionResult Edit(int id, ServiceProvider provider)
 {
     try
     {
         // TODO: Add update logic here
         ServiceProviderRepository.Update(id, provider);
         return(RedirectToAction(nameof(Index)));
     }
     catch
     {
         return(View());
     }
 }
 public ServiceProviderModel UpadteServiceProvider(ServiceProviderModel model)
 {
     //unitOfWork.StartTransaction();
     ServiceProviderRepository repo = new ServiceProviderRepository(unitOfWork);
     ServiceProvider serviceProvider = new ServiceProvider();
     serviceProvider = repo.GetAll().Where(x => x.ServiceProviderId == model.ServiceProviderId).SingleOrDefault();
     AutoMapper.Mapper.Map(model, serviceProvider);
     //serviceProvider.IsActive = model.IsActive;
     repo.Update(serviceProvider);
     //unitOfWork.Commit();
     AutoMapper.Mapper.Map(serviceProvider, model);
     return model;
 }