Exemple #1
0
        public QuoteStatusDto GetQuoteStatus(GetClaimsInput input)
        {
            var query = _quotestatusrepositry
                        .GetAll().FirstOrDefault(c => c.Id == input.Id).MapTo <QuoteStatusDto>();

            return(query);
        }
Exemple #2
0
        public ListResultDto <VendorMainListDto> GetMasterVendors(GetClaimsInput input)
        {
            var countries = _countryRepository.GetAll().AsNoTracking().ToList();

            var query = _vendorMainRepository.GetAll()
                        .WhereIf(
                !input.Filter.IsNullOrEmpty(),
                p => p.SupplierName.Equals(input.Filter)
                )
                        .OrderByDescending(p => p.LastModificationTime)
                        .ToList();

            var sub_query = _vendorSubRepository.GetAll().ToList();


            var finalQuery = (from master in query
                              join c in countries on master.CountryID equals c.Id
                              join v in sub_query on master.Id equals v.VendorID into ps
                              from y1 in ps.DefaultIfEmpty()

                              select new VendorMainListDto
            {
                id = master.Id,
                SupplierCode = master.SupplierCode,
                SupplierName = master.SupplierName,
                Country = c.Country,
                IsActive = y1 == null ? false : y1.IsActive,
                HasSub = y1 == null ? false : true
            }).ToList();


            return(new ListResultDto <VendorMainListDto>(finalQuery));
        }
Exemple #3
0
        public JobStatusMaskDto GetJobStatusMask(GetClaimsInput input)
        {
            var query = _jobstatusmaskRepository
                        .GetAll().FirstOrDefault(c => c.Id == input.Id).MapTo <JobStatusMaskDto>();

            return(query);
        }
        public TowOperatorMainDto GetMainTowOperator(GetClaimsInput input)
        {
            int id    = Convert.ToInt32(input.Filter);
            var query = _towoperatorrepository.FirstOrDefault(c => c.Id == id).MapTo <TowOperatorMainDto>();

            return(query);
        }
Exemple #5
0
        public SignOnDto GetPlanDetail(GetClaimsInput input)
        {
            var query = _signonplans
                        .GetAll().FirstOrDefault(c => c.Id == input.Id).MapTo <SignOnDto>();

            return(query);
        }
Exemple #6
0
        public RoleCategoryDto GetRoleCategory(GetClaimsInput input)
        {
            var query = _rolescategory
                        .GetAll().FirstOrDefault(c => c.Id == input.Id).MapTo <RoleCategoryDto>();

            return(query);
        }
Exemple #7
0
        public TowOperatorDto GetTowOperator(GetClaimsInput input)
        {
            var query = _towoperatorrepositry
                        .GetAll().FirstOrDefault(c => c.Id == input.Id).MapTo <TowOperatorDto>();

            return(query);
        }
Exemple #8
0
        public ListResultDto <GVendorsListDto> GetVendors(GetClaimsInput input)
        {
            int countryId = GetCountryIdByCode();
            var query     = _vendorMainRepository.GetAll()
                            .WhereIf(
                !input.Filter.IsNullOrEmpty(),
                p => p.SupplierName.Equals(input.Filter)
                )
                            .Where(p => p.CountryID.Equals(countryId))
                            .OrderByDescending(p => p.LastModificationTime)
                            .ToList();

            var sub_query = _vendorSubRepository.GetAll()
                            .Where(sv => sv.TenantId == _abpSession.TenantId)
                            .ToList();


            var finalQuery = (from master in query
                              join v in sub_query on master.Id equals v.VendorID into ps
                              from y1 in ps.DefaultIfEmpty()

                              select new GVendorsListDto
            {
                VendorID = master.Id,
                SupplierCode = master.SupplierCode,
                SupplierName = master.SupplierName,
                ContactEmail = y1 == null ? "" : y1.ContactEmail,
                ContactPhone = y1 == null ? "" : y1.ContactPhone,
                IsActive = y1 == null ? false : y1.IsActive
            }).ToList();


            return(new ListResultDto <GVendorsListDto>(finalQuery));
        }
Exemple #9
0
        public RepairTypeDto GetRepairType(GetClaimsInput input)
        {
            var query = _repairtypesrepositry
                        .GetAll().FirstOrDefault(c => c.Id == input.Id).MapTo <RepairTypeDto>();

            return(query);
        }
Exemple #10
0
        public VendorDto GetMainVendor(GetClaimsInput input)
        {
            int Id        = Convert.ToInt32(input.Filter);
            int CountryID = GetCountryIdByCode();

            var main_query = _vendorMainRepository
                             .GetAll().FirstOrDefault(c => c.Id == Id && (CountryID == 0 || c.CountryID == CountryID));

            return(main_query.MapTo <VendorDto>());
        }
Exemple #11
0
        public BrokersDto GetBrokerMasterDetail(GetClaimsInput input)
        {
            int countryId = GetCountryIdByCode();
            int Id        = Convert.ToInt32(input.Filter);

            var query = _BrokersRepository
                        .GetAll().Where(c => c.Id == Id && (countryId == 0 || c.CountryID == countryId))
                        .FirstOrDefault();

            return(query.MapTo <BrokersDto>());
        }
Exemple #12
0
        public BankDetailDto GetBank(GetClaimsInput input)
        {
            var query = _bank
                        .GetAll().Where(c => c.Id == input.Id)
                        .FirstOrDefault();

            var finalquery = query.MapTo <BankDetailDto>();

            finalquery.CountryId = input.Id != 0 ? _countries.FirstOrDefault(query.CountryID).Id : 0;

            return(finalquery);
        }
        public ListResultDto <BranchClaimListDto> GetClaims(GetClaimsInput input)
        {
            var queryjobs = _claimRepository.GetAll().Where(p => p.TenantID == _abpSession.TenantId).ToList();

            var queryveh = _brVehicleRepository.GetAll().Where(p => p.TenantId == _abpSession.TenantId).ToList();

            var queryClient = _clientRepository.GetAll().ToList();

            var queryStatus = _jobstatusRepository.GetAll().Where(p => p.IsDeleted == false).ToList();

            var queryInsurance = _InsuranceRepository.GetAll().Where(p => p.IsDeleted == false && p.IsActive == true).ToList();

            var queryBroker = _brokerRepository.GetAll().Where(p => p.IsDeleted == false && p.IsActive == true).ToList();

            var query = (from j in queryjobs
                         join c in queryClient on j.ClientID equals c.Id
                         join n in queryInsurance on j.InsuranceID equals n.Id
                         join v in queryveh on j.VehicleID equals v.Id
                         join js in queryStatus on j.JobStatusID equals js.Id
                         join br in queryBroker on j.BrokerID equals br.Id
                         select new BranchClaimListDto
            {
                Id = j.Id,
                Name = c.Name,
                Surname = c.Surname,
                Insurance = n.InsurerName,
                Broker = br.BrokerName,
                RegNo = v.RegistrationNumber,
                BranchEntryMethod = j.BranchEntryMethod,
                JobStatusDesc = js.Description,
                CreationTime = j.CreationTime,
                ShopAllocation = j.ShopAllocation
            }).WhereIf(
                !input.Filter.IsNullOrWhiteSpace(),
                u =>
                u.Name.Contains(input.Filter) ||
                u.Surname.Contains(input.Filter) ||
                u.Insurance.Contains(input.Filter) ||
                u.RegNo.Contains(input.Filter)
                )
                        .OrderBy(p => p.Name)
                        .ThenBy(p => p.Surname)
                        .ToList();


            return(new ListResultDto <BranchClaimListDto>(ObjectMapper.Map <List <BranchClaimListDto> >(query)));
        }
Exemple #14
0
        public ImportDto ImportExistingData(GetClaimsInput input)
        {
            ImportDto importDto = new ImportDto();
            var       query     = _clientRepository.GetAll()
                                  .Where(p =>
                                         p.IdNumber.Equals(input.FilterText) ||
                                         p.Tel.Equals(input.FilterText) ||
                                         p.Email.Equals(input.FilterText))
                                  .FirstOrDefault();

            if (query != null)
            {
                importDto.Id                     = query.Id;
                importDto.Name                   = query.Name;
                importDto.Surname                = query.Surname;
                importDto.Title                  = query.Title;
                importDto.Email                  = query.Email;
                importDto.Tel                    = query.Tel;
                importDto.IdNumber               = query.IdNumber;
                importDto.CommunicationType      = query.CommunicationType;
                importDto.ContactAfterService    = query.ContactAfterService;
                importDto.ClientOtherInformation = query.OtherInformation;
            }
            var query1 = _brvehiclerepository.GetAll()
                         .Where(p => p.RegistrationNumber.Equals(input.FilterText1) || p.VinNumber.Equals(input.FilterText1))
                         .FirstOrDefault();

            if (query1 != null)
            {
                importDto.MakeId             = query1.MakeId;
                importDto.ModelId            = query1.ModelId;
                importDto.Colour             = query1.Color;
                importDto.PaintTypeId        = query1.PaintTypeId;
                importDto.Year               = query1.Year;
                importDto.RegistrationNumber = query1.RegistrationNumber;
                importDto.VinNumber          = query1.VinNumber;
                //importDto.UnderWaranty = query1.UnderWaranty;
                importDto.IsSpecialisedType       = query1.IsSpecialisedType;
                importDto.IsLuxury                = query1.IsLuxury;
                importDto.VehicleOtherInformation = query1.OtherInformation;
                importDto.VId = query1.Id;
            }
            return(importDto);
        }
        public InsurersForListDto GetInsurerSubDetail(GetClaimsInput input)
        {
            int Id = Convert.ToInt32(input.Filter);

            var query = _insurersubRepository
                        .GetAll().FirstOrDefault(c => c.InsurerID == Id && c.TenantID == _abpSession.TenantId)
                        .MapTo <InsurersForListDto>();

            if (query != null)
            {
                var querymain = _insurersRepository
                                .GetAll().FirstOrDefault(c => c.Id == query.InsurerID);

                query.InsurerName = querymain.InsurerName;
                query.MaskMain    = querymain.Mask;
                query.InsurerID   = query.Id;
            }
            return(query);
        }
        public ListResultDto <TowOperatorDto> GetTowOperators(GetClaimsInput input)
        {
            int countryId = GetCountryIdByCode();
            var towops    = _towoperatorrepository.GetAll().Where(p => p.CountryID == countryId)
                            .WhereIf(
                !input.Filter.IsNullOrWhiteSpace(),
                u =>
                u.Description.Contains(input.Filter)
                )
                            .OrderBy(p => p.Id)
                            .ToList();

            var towsub = _towsuboperatorrepositry.GetAll().Where(p => p.TenantId == _abpSession.TenantId)
                         .WhereIf(
                !input.Filter.IsNullOrWhiteSpace(),
                u =>
                u.ContactNumber.Contains(input.Filter) ||
                u.ContactPerson.Contains(input.Filter) ||
                u.EmailAddress.Contains(input.Filter)
                )
                         .OrderByDescending(p => p.LastModificationTime)
                         .ToList();

            var final = (from master in towops
                         join v in towsub on master.Id equals v.TowOperatorId into ps
                         from x in ps.DefaultIfEmpty()
                         select new TowOperatorDto
            {
                Id = master.Id,
                SubpkId = x == null ? 0 : x.Id,
                Description = master.Description,
                ContactNumber = x == null ? "--" : x.ContactNumber,
                ContactPerson = x == null ? "--" : x.ContactPerson,
                EmailAddress = x == null ? "--" : x.EmailAddress,
                isActive = x == null ? false : x.isActive
            });


            return(new ListResultDto <TowOperatorDto>(ObjectMapper.Map <List <TowOperatorDto> >(final)));
        }
Exemple #17
0
        public ListResultDto <VendorSubListDto> GetSubVendor(GetClaimsInput input)
        {
            int Id        = Convert.ToInt32(input.Filter);
            var sub_query = _vendorSubRepository
                            .GetAll().Where(s => s.VendorID == Id && s.TenantId == _abpSession.TenantId)
                            .ToList();

            var newList = new List <VendorSubListDto>();

            foreach (VendorSub vendor_obj in sub_query)
            {
                newList.Add(new VendorSubListDto
                {
                    subVendorID           = vendor_obj.Id,
                    TenantId              = vendor_obj.TenantId,
                    VendorID              = vendor_obj.VendorID,
                    ContactName           = vendor_obj.ContactName,
                    ContactPhone          = vendor_obj.ContactPhone,
                    ContactFax            = vendor_obj.ContactFax,
                    ContactEmail          = vendor_obj.ContactEmail,
                    Address1              = vendor_obj.Address1,
                    Address2              = vendor_obj.Address2,
                    Address3              = vendor_obj.Address3,
                    Location              = vendor_obj.Location,
                    SupplierAccount       = vendor_obj.SupplierAccount,
                    PaymentTerms          = vendor_obj.PaymentTerms,
                    AccountNumber         = vendor_obj.AccountNumber,
                    Type                  = vendor_obj.Type,
                    Branch                = vendor_obj.Branch,
                    CurrencyID            = vendor_obj.CurrencyID,
                    BankID                = vendor_obj.BankID,
                    TaxRegistrationNumber = vendor_obj.TaxRegistrationNumber,
                    RegistrationNumber    = vendor_obj.RegistrationNumber,
                    IsActive              = vendor_obj.IsActive
                });
            }

            return(new ListResultDto <VendorSubListDto>(newList));
        }
        public ListResultDto <JobStatusDto> GetJobStatuses(GetClaimsInput input)
        {
            var querystatustenant = _jobstatustenantRepository.GetAll().Where(p => p.Tenant == _abpSession.TenantId).ToList();

            var queryjobstatus = _jobstatusRepository.GetAll().ToList();

            var queryjobstatusmask = _jobstatusmaskRepository.GetAll().ToList();

            var query = (from j in queryjobstatus
                         join c in querystatustenant on j.Id equals c.JobStatusID into ps
                         from py1s in ps.DefaultIfEmpty()

                         select new JobStatusDto
            {
                Id = j.Id,
                pkId = py1s == null ? 0 : py1s.Id,
                Jobstatus = j.Description,
                JobstatusMask = py1s == null ? "--" : (_jobstatusmaskRepository.FirstOrDefault(p => p.Id == py1s.Mask).Description1),
                CreationTime = py1s == null ? "--" : py1s.CreationTime.ToShortDateString(),
                Sortorder = py1s == null ? 0 : py1s.Sortorder,
                IsActive = py1s == null ? false : py1s.isActive,
                ShowAwaiting = py1s == null ? "--" : ((py1s.ShowAwaiting == true) ? "Yes" : "No"),
                ShowSpeedbump = py1s == null ? "--" : ((py1s.ShowSpeedbump == true) ? "Yes" : "No")
            }).WhereIf(
                !input.Filter.IsNullOrWhiteSpace(),
                u =>
                u.Jobstatus.Contains(input.Filter) ||
                u.JobstatusMask.Contains(input.Filter) ||
                u.ShowAwaiting.Contains(input.Filter) ||
                u.ShowSpeedbump.Contains(input.Filter)
                )
                        .OrderBy(p => p.Id)
                        .ToList();

            return(new ListResultDto <JobStatusDto>(ObjectMapper.Map <List <JobStatusDto> >(query)));
        }
        public BranchClaimListDto GetJobDetails(GetClaimsInput input)
        {
            //string dd = input.Filter;
            int Id = Convert.ToInt32(input.Filter);

            //Get Jobs by Id
            var thisJob = _claimRepository
                          .GetAll().Where(c => c.Id == Id)
                          .FirstOrDefault();

            //Get Vehicle by Id
            var thisVeh = _brVehicleRepository
                          .GetAll().Where(c => c.Id == thisJob.VehicleID)
                          .FirstOrDefault();

            //Get Client by Id
            var thisclient = _clientRepository
                             .GetAll().Where(c => c.Id == thisJob.ClientID)
                             .FirstOrDefault();

            //Get Insurance by Id
            var thisInsurance = _InsuranceRepository
                                .GetAll().Where(c => c.Id == thisJob.InsuranceID)
                                .FirstOrDefault();

            //Get Broker by Id
            var thisBroker = _brokerRepository
                             .GetAll().Where(c => c.Id == thisJob.BrokerID)
                             .FirstOrDefault();

            //Get Model by Id
            var thisModel = _vehicleModelRepository
                            .GetAll().Where(m => m.Id == thisVeh.ModelId)
                            .FirstOrDefault();

            //Get Make/Manufacture by Id
            var thisMake = _manufactureRepository
                           .GetAll().Where(m => m.Id == thisVeh.MakeId)
                           .FirstOrDefault();

            //Get Job Status

            var thisJobStatus = _jobstatusRepository
                                .GetAll().Where(js => js.Id == thisJob.JobStatusID)
                                .FirstOrDefault();

            var thisPaintType = _paintTypesRepository
                                .GetAll().Where(pt => pt.Id == thisVeh.PaintTypeId)
                                .FirstOrDefault();

            //get users

            var ExistingCsa          = _userRepository.GetAll().Where(u => u.Id == thisJob.CSAID).FirstOrDefault();
            var ExistingClaimHandler = _userRepository.GetAll().Where(u => u.Id == thisJob.ClaimHandlerID).FirstOrDefault();
            var ExistingEstimator    = _userRepository.GetAll().Where(u => u.Id == thisJob.EstimatorID).FirstOrDefault();
            var ExistingPartsBuyer   = _userRepository.GetAll().Where(u => u.Id == thisJob.PartsBuyerID).FirstOrDefault();

            var finalQuery = (new BranchClaimListDto
            {
                ClientID = thisclient.Id,
                Name = thisclient.Name,
                Surname = thisclient.Surname,
                Email = thisclient.Email,
                Tel = thisclient.Tel,

                Id = thisVeh.Id,
                Colour = thisVeh.Color,
                Year = thisVeh.Year,
                RegNo = thisVeh.RegistrationNumber,
                VinNumber = thisVeh.VinNumber,
                VehicleCode = thisVeh.VehicleCode,
                mmCode = thisVeh.MM_Code,
                VehicleOtherInfo = thisVeh.OtherInformation,
                IsLuxury = thisVeh.IsLuxury,
                IsSpecialisedType = thisVeh.IsSpecialisedType,

                BrokerID = thisBroker.Id,
                Broker = thisBroker.BrokerName,

                InsuranceID = thisInsurance.Id,
                Insurance = thisInsurance.InsurerName,

                ManufactureID = thisMake.Id,
                Manufacture = thisMake.Description,

                ModelID = thisModel.Id,
                Model = thisModel.Model,

                JobStatusID = thisJobStatus.Id,
                JobStatusDesc = thisJobStatus.Description,
                New_Comeback = thisJob.New_Comeback,
                UnderWaranty = thisJob.UnderWaranty,
                BranchEntryMethod = thisJob.BranchEntryMethod,
                IsUnrelatedDamageReason = thisJob.IsUnrelatedDamangeReason,
                ShopAllocation = thisJob.ShopAllocation,
                HighPriority = thisJob.HighPriority,
                Contents = thisJob.Contents,
                JobNotProceeding = thisJob.JobNotProceeding,
                CurrentKMs = thisJob.CurrentKMs,
                OtherInformation = thisJob.OtherInformation,
                DamageReason = thisJob.DamangeReason,
                CsaID = thisJob.CSAID,
                CsaDesc = ExistingCsa == null ? " " : ExistingCsa.Name,
                ClaimHandlerID = thisJob.ClaimHandlerID,
                ClaimHandlerDesc = ExistingClaimHandler == null ? " " : ExistingClaimHandler.Name,
                EstimatorID = thisJob.EstimatorID,
                EstimatorDesc = ExistingEstimator == null ? " " : ExistingEstimator.Name,
                PartsBuyerID = thisJob.PartsBuyerID,
                PartsBuyerDesc = ExistingPartsBuyer == null ? " " : ExistingPartsBuyer.Name,
                ShopAllocationID = thisJob.ShopAllocation,
                ClaimAdministrator = thisJob.ClaimAdministrator,
                ClaimNumber = thisJob.ClaimNumber,
                InsuranceOtherInfo = thisJob.InsuranceOtherInfo,
                PolicyNumber = thisJob.PolicyNumber,
                PaintTypeId = thisPaintType.Id,
                PaintTypeDesc = thisPaintType.PaintType
            }).MapTo <BranchClaimListDto>();

            return(finalQuery);
        }