Exemple #1
0
        public int SaveInsurance(int idCar, int idInsured)
        {
            Insurance       insurance       = new Insurance();
            CarBusiness     carBusiness     = new CarBusiness();
            InsuredBusiness insuredBusiness = new InsuredBusiness();

            insurance.car     = carBusiness.GetCarById(idCar);
            insurance.insured = insuredBusiness.GetInsuredById(idInsured);
            CalculateInsuranceValue(insurance);
            return(dalInsurance.SaveInsurance(insurance));
        }
Exemple #2
0
        public List <Insurance> GetInsuranceByCpf(string cpf)
        {
            List <Insurance> insurances      = new List <Insurance>();
            CarBusiness      carBusiness     = new CarBusiness();
            InsuredBusiness  insuredBusiness = new InsuredBusiness();

            insurances = dalInsurance.GetInsuranceByCpf(cpf);
            foreach (Insurance item in insurances)
            {
                item.car     = carBusiness.GetCarById(item.car.idCar);
                item.insured = insuredBusiness.GetInsuredById(item.insured.idInsured);
            }
            return(insurances);
        }