public Job_SearchModel GetJobsListByClientId(AdvSearchCriteria model, int pageNumber) { var result = new Job_SearchModel(); result.AdvSearchCriteria = model; result.CurrentPage = pageNumber; if (!string.IsNullOrEmpty(model.ServiceId) || !string.IsNullOrEmpty(model.Surname) || !string.IsNullOrEmpty(model.TelNo) || !string.IsNullOrEmpty(model.Postcode) || !string.IsNullOrEmpty(model.PolicyNumber) || !string.IsNullOrEmpty(model.ClientRef) || !string.IsNullOrEmpty(model.Address)) { //Logging Log.File.Info(Msg.GenerateLogMsg("Finding jobs... Criteria:")); // get products var list = Repository.FindJobsByClientId(model.ServiceId, model.Surname, model.Postcode, model.TelNo, model.PolicyNumber, model.ClientRef, model.Address, model.UseAndInWhereCondition.Value, pageNumber, Settings.Default.JobSearchPageSize); // if list empty if ((list != null) && (list.Count > 0)) { result.CurrentPage = pageNumber; result.SearchResults = list; result.FirstItemIndex = list[0].StartElem; result.TotalRecords = list[0].ElemCount; result.LastItemIndex = list[0].LastElem; } } return(result); }
/// <summary> /// Get product list by search criteris /// </summary> /// <returns></returns> public Job_SearchModel GetJobsList(string searchCriteria, int pageNumber) { var result = new Job_SearchModel(); result.SearchCriteria = searchCriteria; result.CurrentPage = pageNumber; if (!string.IsNullOrEmpty(searchCriteria)) { //Logging Log.File.Info(Msg.GenerateLogMsg("Finding jobs... Criteria:", searchCriteria)); // get products var list = Repository.FindJobs(searchCriteria, pageNumber, Settings.Default.JobSearchPageSize, StoreId); // if list empty if ((list != null) && (list.Count > 0)) { result.CurrentPage = pageNumber; result.SearchResults = list; result.FirstItemIndex = list[0].StartElem; result.TotalRecords = list[0].ElemCount; result.LastItemIndex = list[0].LastElem; } } return(result); }
//public RepeatRepairResult RepeatRepairCheck(string SerialNumber , string modelCode) //{ // RepeatRepairResult result = new RepeatRepairResult(); // OnlineBookingService onlineService = new OnlineBookingService(); // result = onlineService.RepeatRepairCheck(0, "", modelCode,SerialNumber, Settings.Default.RepeatHistoryCheckinDays); // // result.RepeatDetectedFlag = true; // if (result.RepeatDetectedFlag) // { // result.repeatHistory.HistoryResult = result.repeatHistory.HistoryResult.Replace('"', '\''); // } // return result; //} internal Job_SearchModel AwaitingForApprovalList(int pageNumber) { var result = new Job_SearchModel(); result.CurrentPage = pageNumber; //Logging Log.File.Info(Msg.GenerateLogMsg("Finding not booked jobs...")); // get products var list = Repository.AwaitingForApprovalListJobs(pageNumber, Settings.Default.JobSearchPageSize); // if list empty if ((list != null) && (list.Count > 0)) { result.CurrentPage = pageNumber; result.SearchResults = list; result.FirstItemIndex = list[0].StartElem; result.TotalRecords = list[0].ElemCount; result.LastItemIndex = list[0].LastElem; Log.File.Info(Msg.GenerateLogMsg("Found jobs...Count: " + list.Count.ToString())); } else { Log.File.Info(Msg.GenerateLogMsg("not Found jobs...Count: 0")); } return(result); }
public ActionResult JobStatusList(int?page) { var model = new Job_SearchModel(); JobService.SessionInfo.PageNumber = page ?? 1; // var model = new JobStatus_SearchModel(); // model.Title = Service.Title; ViewBag.JobStatus = jobStatusService.GetSummaryJobsStatuses(); string StatusKey = jobStatusService.StatusSearch; var list = jobStatusService.GetJobsListByKey(StatusKey, JobService.SessionInfo.PageNumber, Settings.Default.ProductSearchPageSize); if ((list != null) && (list.Count > 0)) { model.CurrentPage = JobService.SessionInfo.PageNumber; model.SearchResults = list; model.FirstItemIndex = list[0].StartElem; model.TotalRecords = list[0].ElemCount; model.LastItemIndex = list[0].LastElem; } ViewBag.OnePageOfJobs = new StaticPagedList <Job_SearchResult>(model.SearchResults, JobService.SessionInfo.PageNumber, Settings.Default.ProductSearchPageSize, model.TotalRecords); ////model.JobStatusCount = _jobStatus.GetSummaryJobsStatuses(); // model.JobStatusSearchResults = Service.GetJobsListByKey(StatusKey); // model. = Service.GetJobsListByKey(StatusKey); ////if (model.JobStatusSearchResults.Count > 0) ////{ //// model.ChangeStatusText = model.JobStatusSearchResults[0].ChangeStatusText; //// model.ChangeStatusId = model.JobStatusSearchResults[0].ChangeStatusId; ////} //model.JobDurationList = Service.GetJobSearchDurationList(Service.Months); //model.JobDuration = Service.Months; //model.StatusId = Service.StatusId; return(View(model)); }
internal Job_SearchModel ApprovedJobs(int pageNumber) { var result = new Job_SearchModel(); result.CurrentPage = pageNumber; //Logging Log.File.Info(Msg.GenerateLogMsg("Found Approved repeated jobs...")); // get products List <Job_SearchResult> list = new List <Job_SearchResult>(); if (accountService.IsSuperAdmin) { list = Repository.ApprovedJobs(pageNumber, Settings.Default.JobSearchPageSize, 0); } else { list = Repository.ApprovedJobs(pageNumber, Settings.Default.JobSearchPageSize, StoreId); } // if list empty if ((list != null) && (list.Count > 0)) { result.CurrentPage = pageNumber; result.SearchResults = list; result.FirstItemIndex = list[0].StartElem; result.TotalRecords = list[0].ElemCount; result.LastItemIndex = list[0].LastElem; Log.File.Info(Msg.GenerateLogMsg("Found jobs...Count: " + list.Count.ToString())); } else { Log.File.Info(Msg.GenerateLogMsg("Finded jobs...Count: 0")); } return(result); }