private void GetPhoneNumber()
 {
     try
     {
         using (PetfirstData pfData = new PetfirstData())
         {
             mCustomer.CallCenter = pfData.GetPhoneNumber(mCustomer.EnrollmentCode);
         }
     }
     catch (Exception ex)
     {
         DisplayError("Getting phone number by enrollment", ex.ToString(), true);
     }
 }
        private bool LoadCustomerInfo(ref PetfirstCustomer mCustomer, string scustomerLookup)
        {
            bool bReturn = true;
            SqlConnection con = GetConnection();
            SqlDataReader sdr = null;
            SqlCommand cmd = new SqlCommand("usp_pricecompare_tmpcustomer_get_by_customer_id", con);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add(new SqlParameter("@customer_id", SqlDbType.BigInt));
            cmd.Parameters["@customer_id"].Value = Int32.Parse(scustomerLookup);

            try
            {
                con.Open();
                sdr = cmd.ExecuteReader();

                while (sdr.Read())
                {
                    mCustomer.MembershipInfo.FirstName = sdr.GetString(CTFIRSTNAME);
                    mCustomer.MembershipInfo.LastName = sdr.GetString(CTLASTNAME);
                    mCustomer.EnrollmentCode = sdr.GetString(CTENROLLMENTCODE);

                    using (PetfirstData pfData = new PetfirstData())
                    {
                        mCustomer.CallCenter = pfData.GetPhoneNumber(mCustomer.EnrollmentCode);
                    }

                    mCustomer.MembershipInfo.Email = sdr.GetString(CTEMAIL);
                    mCustomer.MembershipInfo.Zip = sdr.GetString(CTZIP);
                    mCustomer.MembershipInfo.Phone = sdr.GetString(CTPHONE);

                    if ((sdr.GetString(CTPAYFREQUENCY)).ToString().Contains("monthly") == true)
                    {
                        mCustomer.PayFrequency = 1;
                    }
                    else
                    {
                        mCustomer.PayFrequency = 2;
                    }

                    CoreServiceClient csc = new CoreServiceClient();
                    CoreServiceGetStateByZipResponse resp = csc.GetStateByZip(mCustomer.MembershipInfo.Zip);
                    if (string.IsNullOrEmpty(resp.Error.ErrorText))
                    {
                        mCustomer.MembershipInfo.StateId = resp.State.Id;
                        mCustomer.MembershipInfo.City = resp.State.CityName;
                        mCustomer.MembershipInfo.State = resp.State.StateName;
                    }

                    Pet myPet = new Pet();

                    myPet.Birthday = sdr.GetDateTime(CTPETBIRTHDAY);
                    myPet.ColorId = 146; //Any Breed//
                    myPet.ColorName = "Any";

                    if ((sdr.GetString(CTSPECIESNAME)).ToString().Contains("dog") == true)
                    {
                        myPet.SpeciesId = 1;
                        myPet.SpeciesName = "Dog";
                    }
                    else
                    {
                        myPet.SpeciesId = 2;
                        myPet.SpeciesName = "Cat";
                    }

                    myPet.BreedId = sdr.GetInt32(CTBREEDID);
                    myPet.WeightId = sdr.GetByte(CTWEIGHTID);
                    myPet.PetName = sdr.GetString(CTPETNAME);
                    myPet.GenderFull = sdr.GetString(CTPETGENDER);
                    myPet.GenderFull.Trim();

                    if (myPet.GenderFull.Contains("female"))
                    {
                        myPet.Gender = "F";
                    }
                    else
                    {
                        myPet.Gender = "M";
                    }

                    myPet.DeductibleAmount = sdr.GetDecimal(CTDEDUCTIBLE);
                    myPet.Reimbursement = sdr.GetDecimal(CTREIMBURSEMENT);
                    myPet.SpayedOrNeutered = sdr.GetBoolean(CTSPAYORNEUTER);
                    //stored procedure will take care of figuring out if this is true or not.
                    mCustomer.DiscountVetAvailable = true;
                    mCustomer.DiscountMilitaryAvailable = true;
                    mCustomer.DiscountMilitarySelected = sdr.GetBoolean(CTMILITARY);
                    mCustomer.DiscountVetSelected = sdr.GetBoolean(CTVETPROFFESIONAL);

                    mCustomer.MyPets.Add(myPet);

                    try
                    {
                        using (PetfirstData pfData = new PetfirstData())
                        {
                            pfData.SaveCustomer(mCustomer);
                        }
                    }
                    catch
                    {
                        throw;
                    }

                }

                con.Close();
            }
            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);
        }