public List<JobModel> GetAllJobs() { //unitOfWork.StartTransaction(); JobRepository repo = new JobRepository(unitOfWork); List<JobModel> jobModelList = new List<JobModel>(); List<Job> jobList = new List<Job>(); AutoMapper.Mapper.Map(jobModelList, jobList); jobList = repo.GetAllIncluding("ServiceProvider").Where(x=>x.IsPaid==true).OrderByDescending(x=>x.JobId).ToList(); //unitOfWork.Commit(); AutoMapper.Mapper.Map(jobList, jobModelList); return jobModelList; }
public JobModel GetJobById(int jobId) { //unitOfWork.StartTransaction(); JobRepository repo = new JobRepository(unitOfWork); JobModel jobModel = new JobModel(); Job job = new Job(); AutoMapper.Mapper.Map(jobModel, job); job = repo.GetAllIncluding("ServiceProvider").Where(x => x.JobId == jobId).OrderByDescending(x=>x.JobId).FirstOrDefault(); //unitOfWork.Commit(); AutoMapper.Mapper.Map(job, jobModel); return jobModel; }
public List<JobModel> GetJobListByServiceProviderIdWithClient(string serviceProviderId) { //unitOfWork.StartTransaction(); JobRepository repo = new JobRepository(unitOfWork); List<JobModel> jobModelList = new List<JobModel>(); List<Job> job = new List<Job>(); AutoMapper.Mapper.Map(jobModelList, job); job = repo.GetAllIncluding("Client").Where(x => x.ServiceProviderId == serviceProviderId && x.IsPaid == true).OrderByDescending(x => x.JobId).ToList(); //unitOfWork.Commit(); AutoMapper.Mapper.Map(job, jobModelList); return jobModelList; }
public List<JobModel> GetJobListByEmployeeId(string employeeId) { //unitOfWork.StartTransaction(); JobRepository repo = new JobRepository(unitOfWork); List<JobModel> jobModelList = new List<JobModel>(); List<Job> job = new List<Job>(); AutoMapper.Mapper.Map(jobModelList, job); job = repo.GetAllIncluding("Client").Where(x => x.EmployeeId == employeeId).OrderByDescending(x=>x.JobId).ToList(); //unitOfWork.Commit(); AutoMapper.Mapper.Map(job, jobModelList); return jobModelList; }