Exemple #1
0
 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;
 }
Exemple #2
0
 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;
 }
Exemple #3
0
 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;
 }
Exemple #4
0
 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;
 }