public IEnumerable <Job> SearchJobs(Expression <Func <DB.Job, bool> > where) { return(jobsRepository .SearchData(where) .Select(j => j.AutoMapObject <DB.Job, Job>()) .OrderByDescending(c => c.JobId)); }
public IEnumerable <BOQ> GetBOQsByPOId(int POId) { var res = jobsRepo .SearchData(j => j.POId == POId) .SelectMany(j => bOQRepository .SearchData(b => b.JobId == j.JobId)); return(res.Select(b => b.AutoMapObject <DesignBOQ, BOQ>())); }
private static bool ValidateJobNumber(string jobNumber) { var jobRepo = new JobsRepository(new PmcsDbContext()); var result = jobRepo.SearchData(j => j.JobNumber == jobNumber); return(result.Any()); }
public IEnumerable <Job> GetElementJobs(int elementId) { return(jobsRepository .SearchData(j => j.ElementId == elementId) .Select(j => j.AutoMapObject <DB.Job, Job>()) .OrderByDescending(c => c.JobId)); }
public IEnumerable <Element> GetPOElements(int POId) { return(jobsRepository .SearchData(j => j.POId == POId) .Select(j => elementsRepositroy .GetById(e => e.ElementId == j.ElementId) .AutoMapObject <DB.Element, Element>()) .OrderByDescending(c => c.ElementId)); }