Exemplo n.º 1
0
 public IEnumerable <InsuranceType> GetInsuranceTypes(string name)
 {
     if (string.IsNullOrEmpty(name))
     {
         return(insuranceTypesRepository.GetAll());
     }
     else
     {
         var input = name.First().ToString().ToUpper() + name.Substring(1).ToLower();
         return(insuranceTypesRepository.GetAll().Where(c => c.Name == input));
     }
 }
Exemplo n.º 2
0
        /// <summary>
        ///Get Hire Group Detail List
        /// </summary>
        /// <returns>Hire Group Detail Response</returns>
        public InsuranceRtDetailResponse GetInsuranceRtDetail(long insuranceRtMainId)
        {
            IEnumerable <HireGroupDetail> hireGroupDetails = hireGroupDetailRepository.GetAll();
            IEnumerable <InsuranceType>   insuranceTypes   = insuranceTypeRepository.GetAll();
            IEnumerable <InsuranceRt>     insuranceRts     =
                insuranceRtRepository.GetInsuranceRtByInsuranceRtMainId(insuranceRtMainId);
            // ReSharper disable once SuggestUseVarKeywordEvident
            List <InsuranceRtDetailContent> insuranceRtDetailList = new List <InsuranceRtDetailContent>();

            foreach (var insuranceType in insuranceTypes)
            {
                foreach (var hireGroupDetail in hireGroupDetails)
                {
                    var insuranceRtDetailContent = new InsuranceRtDetailContent();
                    insuranceRtDetailContent.InsuranceTypeId       = insuranceType.InsuranceTypeId;
                    insuranceRtDetailContent.InsuranceTypeCodeName = insuranceType.InsuranceTypeCode + " - " +
                                                                     insuranceType.InsuranceTypeName;
                    insuranceRtDetailContent.HireGroupDetailId       = hireGroupDetail.HireGroupDetailId;
                    insuranceRtDetailContent.ModelYear               = hireGroupDetail.ModelYear;
                    insuranceRtDetailContent.HireGroupDetailCodeName = hireGroupDetail.HireGroup.HireGroupCode + " - " + hireGroupDetail.HireGroup.HireGroupName;
                    insuranceRtDetailContent.VehicleCategoryCodeName = hireGroupDetail.VehicleCategory.VehicleCategoryCode + " - " + hireGroupDetail.VehicleCategory.VehicleCategoryName;
                    insuranceRtDetailContent.VehicleMakeCodeName     = hireGroupDetail.VehicleMake.VehicleMakeCode + " - " + hireGroupDetail.VehicleMake.VehicleMakeName;
                    insuranceRtDetailContent.VehicleModelCodeName    = hireGroupDetail.VehicleModel.VehicleModelCode + " - " + hireGroupDetail.VehicleModel.VehicleModelName;
                    insuranceRtDetailList.Add(insuranceRtDetailContent);
                }
            }
            foreach (var insuranceRt in insuranceRts)
            {
                foreach (var insuranceRtDetailContent in insuranceRtDetailList)
                {
                    if (insuranceRtDetailContent.InsuranceTypeId == insuranceRt.InsuranceTypeId &&
                        insuranceRtDetailContent.HireGroupDetailId == insuranceRt.HireGroupDetailId)
                    {
                        insuranceRtDetailContent.InsuranceRtId     = insuranceRt.InsuranceRtId;
                        insuranceRtDetailContent.InsuranceRtMainId = insuranceRt.InsuranceRtMainId;
                        insuranceRtDetailContent.InsuranceRate     = insuranceRt.InsuranceRate;
                        insuranceRtDetailContent.StartDate         = insuranceRt.StartDt;
                        insuranceRtDetailContent.IsChecked         = true;
                        insuranceRtDetailContent.RevisionNumber    = insuranceRt.RevisionNumber;
                    }
                }
            }
            return(new InsuranceRtDetailResponse
            {
                InsuranceRateDetails = insuranceRtDetailList,
            });
        }
Exemplo n.º 3
0
 /// <summary>
 /// Get Base Data
 /// </summary>
 /// <returns></returns>
 public VehicleBaseDataResponse GetBaseData()
 {
     return(new VehicleBaseDataResponse
     {
         Operations = operationRepository.GetAll(),
         FleetPools = fleetPoolRepository.GetAll(),
         Companies = companyRepository.GetAll(),
         Regions = regionRepository.GetAll(),
         FuelTypes = fuelTypeRepository.GetAll(),
         VehicleModels = vehicleModelRepository.GetAll(),
         VehicleStatuses = vehicleStatusRepository.GetAll(),
         Departments = departmentRepository.GetAll(),
         VehicleCategories = vehicleCategoryRepository.GetAll(),
         TransmissionTypes = transmissionTypeResposirory.GetAll(),
         VehicleMakes = vehicleMakeRepository.GetAll(),
         BusinessPartners = businessPartnerRepository.GetAll(),
         InsuranceType = insuranceTypeRepository.GetAll(),
         MaintenanceTypes = maintenanceTypeRepository.GetAll(),
         VehicleCheckList = vehicleCheckListRepository.GetAll(),
         Locations = operationsWorkPlaceRepository.GetSalesOperationsWorkPlace()
     });
 }
Exemplo n.º 4
0
        public IEnumerable <InsuranceTypeDTO> getAllInsuranceType()
        {
            var InsuranceTypes = _insuranceTypeRepository.GetAll();

            return(_mapper.Map <IEnumerable <InsuranceTypeDTO> >(InsuranceTypes.AsEnumerable()));
        }
Exemplo n.º 5
0
 /// <summary>
 /// Get All For RA
 /// </summary>
 public IEnumerable <InsuranceType> GetAllForRa()
 {
     return(insuranceTypeRepository.GetAll());
 }