Ejemplo n.º 1
0
        // Get Quote type for Create or Edit
        public async Task <QuoteMasterDto> QuoteDetailToEdit(GetJobInput input)
        {
            var output = new QuoteMasterDto();
            var quote  = _quotemasterrepository.FirstOrDefault(p => p.Id == input.id);

            if (quote != null)
            {
                output       = quote.MapTo <QuoteMasterDto>();
                output.JobId = quote.JobId;
            }
            else
            {
                output.JobId = input.id; // jobId
            }
            var VehicleID = _jobsrrepository.FirstOrDefault(p => p.Id == quote.JobId);

            if (VehicleID != null)
            {
                var vehicle = await _vehiclerrepository.GetAsync(VehicleID.VehicleID);

                if (vehicle != null)
                {
                    output.RegNo             = vehicle.RegistrationNumber;
                    output.IsSpecialisedType = vehicle.IsSpecialisedType;
                    output.IsLuxury          = vehicle.IsLuxury;
                    output.UnderWaranty      = VehicleID.UnderWaranty;
                    output.PaintTypeId       = vehicle.PaintTypeId;
                    output.vehicleId         = VehicleID.VehicleID;
                    //output = vehicle.MapTo<QuoteMasterDto>();
                }
            }
            return(output);
        }
Ejemplo n.º 2
0
        // Get Quote type for Create or Edit
        public async Task <QuoteMasterDto> GetQuoteForNewQuotation(GetJobInput input)
        {
            var VehicleID = _jobsrrepository.FirstOrDefault(p => p.Id == input.id);
            var vehicle   = await _vehiclerrepository.GetAsync(VehicleID.VehicleID);

            var output = new QuoteMasterDto();

            output.JobId             = input.id;
            output.vehicleId         = VehicleID.VehicleID;
            output.RegNo             = vehicle.RegistrationNumber;
            output.IsSpecialisedType = vehicle.IsSpecialisedType;
            output.IsLuxury          = vehicle.IsLuxury;
            output.UnderWaranty      = VehicleID.UnderWaranty;
            output.PaintTypeId       = vehicle.PaintTypeId;
            return(output);
        }