public ICollection <RequsitionAssignReportViewModel> RequsitionAssignReportViewModels(RequsitionAssignViewModel requsitionAssignViewModel)
        {
            var result = sdb.GetRequsitionAssignSummary();

            if (requsitionAssignViewModel.JourneyStart != null && requsitionAssignViewModel.JourneyStart != DateTime.MinValue)
            {
                result = result.Where(c => DbFunctions.TruncateTime(c.JourneyStart) >= requsitionAssignViewModel.JourneyStart);
            }
            if (requsitionAssignViewModel.JouneyEnd != null && requsitionAssignViewModel.JouneyEnd != DateTime.MinValue)
            {
                result = result.Where(c => DbFunctions.TruncateTime(c.JouneyEnd) <= requsitionAssignViewModel.JouneyEnd);
            }
            if (!string.IsNullOrEmpty(requsitionAssignViewModel.Form))
            {
                result = result.Where(c => c.Form.ToLower().Contains(requsitionAssignViewModel.Form.ToLower()));
            }
            if (!string.IsNullOrEmpty(requsitionAssignViewModel.Name))
            {
                result = result.Where(c => c.Name.ToLower().Contains(requsitionAssignViewModel.Name.ToLower()));
            }
            if (!string.IsNullOrEmpty(requsitionAssignViewModel.DriverName))
            {
                result = result.Where(c => c.DriverName.ToLower().Contains(requsitionAssignViewModel.DriverName.ToLower()));
            }
            if (!string.IsNullOrEmpty(requsitionAssignViewModel.VehicleName))
            {
                result = result.Where(c => c.VehicleName.ToLower().Contains(requsitionAssignViewModel.VehicleName.ToLower()));
            }
            return(result.ToList());
        }
Ejemplo n.º 2
0
 public ICollection <RequsitionAssignReportViewModel> RequsitionAssignReportViewModels(RequsitionAssignViewModel requsitionAssignViewModel)
 {
     return(managerRepository.RequsitionAssignReportViewModels(requsitionAssignViewModel));
 }