Пример #1
0
 public static INSURANCE_TBL the_worth_hmo(int age, string categoryName)
 {
     categ     = db.CATEGORIES_TBL.Where(g => g.categoryName == categoryName).FirstOrDefault();
     prod      = db.PRODUCTS_TBL.Where(g => g.categoryId == categ.categoriesId).FirstOrDefault();
     price1    = db.PRICEs.Where(g => g.productId == prod.productId).FirstOrDefault();
     insurance = db.INSURANCE_TBL.Where(g => g.insuranceId == price1.insuranceId).FirstOrDefault();
     //age = db.AGE_TBL.Where(g => g.begins >= age && s=>s.ends <= age).FirstOrDefault();
     return(insurance);
 }
Пример #2
0
 public static INSURANCE_DTO CastToDTO(INSURANCE_TBL a)
 {
     return(new INSURANCE_DTO
     {
         insuranceId = a.insuranceId,
         insuranceName = a.insuranceName,
         hmoId = a.hmoId,
         description = a.description,
         InsurancePrice = a.InsurancePrice
     });
 }
Пример #3
0
 public static HMO_TBL GetHmoByProduct(PRODUCTS_TBL product)
 {
     using (HMO_PROGECTEntities ctx = new HMO_PROGECTEntities())
     {
         INSURANCE_TBL insurance = InsuranceModule.GetProductInsurance(product);
         if (insurance != null)
         {
             HMO_TBL hmo = ctx.HMO_TBL.Where(u => u.hmoId == insurance.hmoId).FirstOrDefault();
         }
         return(null);
     }
 }
Пример #4
0
        public static double?getInsurancePrice(INSURANCE_TBL insurance)
        {
            using (HMO_PROGECTEntities ctx = new HMO_PROGECTEntities())
            {
                var selectedInsurance = InsuranceCRUD.Read(insurance.insuranceId);
                if (selectedInsurance != null)
                {
                    return(selectedInsurance.InsurancePrice);
                }

                return(null);
            }
        }
Пример #5
0
 public static INSURANCE_TBL GetProductInsurance(PRODUCTS_TBL product)
 {
     using (HMO_PROGECTEntities ctx = new HMO_PROGECTEntities())
     {
         var productdetail = ProductsCRUD.ReadById(ctx, product.productId);
         if (productdetail != null)
         {
             PRICE         price     = ctx.PRICEs.Where(u => u.productId == product.productId).FirstOrDefault();
             INSURANCE_TBL insurance = ctx.INSURANCE_TBL.Where(u => u.insuranceId == price.insuranceId).FirstOrDefault();
             return(insurance);
         }
         return(null);
     }
 }