private bool LoadPlanInfo(ref PetfirstCustomer mCustomer, string splanLookup) { bool bReturn = true; SqlConnection con = GetConnection(); SqlDataReader sdr = null; SqlCommand cmd = new SqlCommand("usp_pricecompare_prequote_get_by_quote_id", con); string sMemberCodeString = "I"; if (mCustomer.DiscountMilitarySelected) { sMemberCodeString += "M"; } if (mCustomer.DiscountVetSelected) { sMemberCodeString += "A"; } cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("@pre_quote_id", SqlDbType.BigInt)); cmd.Parameters["@pre_quote_id"].Value = Int32.Parse(splanLookup); cmd.Parameters.Add(new SqlParameter("@membercodestring", SqlDbType.VarChar, 20)); cmd.Parameters["@membercodestring"].Value = sMemberCodeString; try { con.Open(); sdr = cmd.ExecuteReader(); while (sdr.Read()) { foreach (Pet mp in mCustomer.MyPets) { mp.AnnualPaymentTotal = sdr.GetDecimal(PTANNUALTOTAL); mp.DeductibleAmount = sdr.GetDecimal(PTDEDUCTIBLE); mp.Enrolled = true; mp.FirstMonthPaymentTotal = sdr.GetDecimal(PTFIRSTMONTHTOTAL); mp.FirstMonthPremiumOnly = sdr.GetDecimal(PTFIRSTMONTHTOTAL); mp.FirstMonthTax = sdr.GetDecimal(PTFIRSTMONTHTAXFEE); mp.IsFamilyPlan = false; mp.PlanId = sdr.GetByte(PTPLANID); mp.QuoteId = sdr.GetInt32(PTQUOTEID); mp.RecurringMonthPaymentTotal = sdr.GetDecimal(PTRECURRINGMONTHTOTAL); mp.RecurringMonthPremiumOnly = sdr.GetDecimal(PTRECURRINGMONTHTOTAL); mp.RecurringMonthTax = sdr.GetDecimal(PTRECURRINGMONTHTAXFEE); mp.Reimbursement = 1 - sdr.GetDecimal(PTCOPAY); mp.InternetDiscountAmount = sdr.GetDecimal(PTDISCOUNTS); using (PetfirstData pfData = new PetfirstData()) { mp.LimitAmount = pfData.GetPlanLimitByPlanId(mp.PlanId); mp.PlanName = pfData.GetPlanShortNameByPlanId(mp.PlanId); pfData.SavePet(mp, mCustomer.CustomerId); } } } } catch (Exception ex) { bReturn = false; LoggingError(ex.Message, ex.StackTrace); } finally { if (con != null) { con.Close(); con.Dispose(); con = null; } if (cmd != null) { cmd.Dispose(); cmd = null; } } return (bReturn); }