Ejemplo n.º 1
0
 public void DeleteServiceProvider(string serviceProviderId)
 {
     //unitOfWork.StartTransaction();
     ServiceProviderRepository repo = new ServiceProviderRepository(unitOfWork);
     ServiceProvider serviceProvider = new ServiceProvider();
     serviceProvider = repo.GetAll().Where(x => x.ServiceProviderId == serviceProviderId).SingleOrDefault();
     repo.Delete(x => x.ServiceProviderId == serviceProvider.ServiceProviderId);
     //unitOfWork.Commit();
 }
Ejemplo n.º 2
0
 public ServiceProviderModel GetServiceProviderById(string serviceProviderId)
 {
     //unitOfWork.StartTransaction();
     ServiceProviderRepository repo = new ServiceProviderRepository(unitOfWork);
     ServiceProviderModel serviceProviderModel = new ServiceProviderModel();
     ServiceProvider serviceProvider = new ServiceProvider();
     AutoMapper.Mapper.Map(serviceProviderModel, serviceProvider);
     serviceProvider = repo.GetAll().Where(x => x.ServiceProviderId == serviceProviderId).FirstOrDefault();
     //unitOfWork.Commit();
     AutoMapper.Mapper.Map(serviceProvider, serviceProviderModel);
     return serviceProviderModel;
 }
Ejemplo n.º 3
0
 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;
 }
Ejemplo n.º 4
0
 public ServiceProviderModel SaveServiceProvider(ServiceProviderModel model)
 {
     //unitOfWork.StartTransaction();
     ServiceProviderRepository repo = new ServiceProviderRepository(unitOfWork);
     ServiceProvider serviceProvider = new ServiceProvider();
     AutoMapper.Mapper.Map(model, serviceProvider);
     repo.Insert(serviceProvider);
     //unitOfWork.Commit();
     AutoMapper.Mapper.Map(serviceProvider, model);
     return model;
 }