Ejemplo n.º 1
0
 public void DeleteJobServiceMapping(int jobServiceMappingId)
 {
     //unitOfWork.StartTransaction();
     JobServiceMappingRepository repo = new JobServiceMappingRepository(unitOfWork);
     repo.Delete(x => x.JobServiceMappingId == jobServiceMappingId);
     //unitOfWork.Commit();
 }
Ejemplo n.º 2
0
 public JobServiceMappingModel GetJobServiceMappingByJobId(int jobId)
 {
     //unitOfWork.StartTransaction();
     JobServiceMappingRepository repo = new JobServiceMappingRepository(unitOfWork);
     JobServiceMappingModel jobServiceMappingModel = new JobServiceMappingModel();
     JobServiceMapping jobServiceMapping = new JobServiceMapping();
     AutoMapper.Mapper.Map(jobServiceMappingModel, jobServiceMapping);
     jobServiceMapping = repo.GetAll().Where(x => x.JobId == jobId).FirstOrDefault();
     //unitOfWork.Commit();
     AutoMapper.Mapper.Map(jobServiceMapping, jobServiceMappingModel);
     return jobServiceMappingModel;
 }
Ejemplo n.º 3
0
 public List<JobServiceMappingModel> GetJobServiceMapping()
 {
     //unitOfWork.StartTransaction();
     JobServiceMappingRepository repo = new JobServiceMappingRepository(unitOfWork);
     List<JobServiceMappingModel> jobServiceMappingModelList = new List<JobServiceMappingModel>();
     List<JobServiceMapping> jobServiceMapping = new List<JobServiceMapping>();
     AutoMapper.Mapper.Map(jobServiceMappingModelList, jobServiceMapping);
     jobServiceMapping = repo.GetAll().ToList();
     //unitOfWork.Commit();
     AutoMapper.Mapper.Map(jobServiceMapping, jobServiceMappingModelList);
     return jobServiceMappingModelList;
 }
Ejemplo n.º 4
0
 public List<JobServiceMappingModel> GetJobServiceMappingByJobIds(string[] jobIds)
 {
     //unitOfWork.StartTransaction();
     JobServiceMappingRepository repo = new JobServiceMappingRepository(unitOfWork);
     List<JobServiceMappingModel> jobServiceMappingModel = new List<JobServiceMappingModel>();
     List<JobServiceMapping> jobServiceMapping = new List<JobServiceMapping>();
     AutoMapper.Mapper.Map(jobServiceMappingModel, jobServiceMapping);
     jobServiceMapping = repo.GetAll().Where(x => jobIds.Contains(x.JobId.ToString())).ToList();
     //unitOfWork.Commit();
     //jobServiceMapping = repo.GetAll().Where(x => x.JobId == jobId).FirstOrDefault();
     AutoMapper.Mapper.Map(jobServiceMapping, jobServiceMappingModel);
     return jobServiceMappingModel;
 }
Ejemplo n.º 5
0
 public JobServiceMappingModel SaveJobServiceMapping(JobServiceMappingModel model)
 {
     //unitOfWork.StartTransaction();
     JobServiceMappingRepository repo = new JobServiceMappingRepository(unitOfWork);
     JobServiceMapping jobServiceMapping = new JobServiceMapping();
     AutoMapper.Mapper.Map(model, jobServiceMapping);
     repo.Insert(jobServiceMapping);
     //unitOfWork.Commit();
     AutoMapper.Mapper.Map(jobServiceMapping, model);
     return model;
 }
Ejemplo n.º 6
0
 public List<JobServiceMappingModel> GetJobServiceMappingListByJobId(int jobId)
 {
     //unitOfWork.StartTransaction();
     JobServiceMappingRepository repo = new JobServiceMappingRepository(unitOfWork);
     List<JobServiceMappingModel> jobServiceMappingModel = new List<JobServiceMappingModel>();
     List<JobServiceMapping> jobServiceMapping = new List<JobServiceMapping>();
     AutoMapper.Mapper.Map(jobServiceMappingModel, jobServiceMapping);
     jobServiceMapping = repo.GetAll().Where(x => x.JobId == jobId).ToList();
     //unitOfWork.Commit();
     AutoMapper.Mapper.Map(jobServiceMapping, jobServiceMappingModel);
     return jobServiceMappingModel;
 }
Ejemplo n.º 7
0
 public JobServiceMappingModel UpadteJobServiceMapping(JobServiceMappingModel model)
 {
     //unitOfWork.StartTransaction();
     JobServiceMappingRepository repo = new JobServiceMappingRepository(unitOfWork);
     JobServiceMapping jobServiceMapping = new JobServiceMapping();
     jobServiceMapping = repo.GetAll().Where(x => x.JobServiceMappingId == model.JobServiceMappingId).FirstOrDefault();
     AutoMapper.Mapper.Map(model, jobServiceMapping);
     repo.Update(jobServiceMapping);
     //unitOfWork.Commit();
     AutoMapper.Mapper.Map(jobServiceMapping, model);
     return model;
 }