private void SetDemographics(Demographics demographics)
		{
			if (demographics != null)
			{
				SetDemograpicsBitsInfoType(
					demographics.Salary,
					Banner.TargettingProperty.Salary_Unknown,
					Banner.TargettingProperty.Salary_1,
					Banner.TargettingProperty.Salary_2,
					Banner.TargettingProperty.Salary_3,
					Banner.TargettingProperty.Salary_4,
					Banner.TargettingProperty.Salary_5,
					Banner.TargettingProperty.Salary_6,
					Banner.TargettingProperty.Salary_7
					);

				SetDemograpicsBitsInfoType(
					demographics.Employment,
					Banner.TargettingProperty.Employment_Unknown,
					Banner.TargettingProperty.Employment_1,
					Banner.TargettingProperty.Employment_2,
					Banner.TargettingProperty.Employment_3,
					Banner.TargettingProperty.Employment_4
					);

				SetDemograpicsBitsInfoType(
					demographics.DrinkAlcopops,
					Banner.TargettingProperty.DrinkAlcopops_True,
					Banner.TargettingProperty.DrinkAlcopops_False
					);

				SetDemograpicsBitsInfoType(
					demographics.DrinkBottledBeer,
					Banner.TargettingProperty.DrinkBottledBeer_True,
					Banner.TargettingProperty.DrinkBottledBeer_False
					);

				SetDemograpicsBitsInfoType(
					demographics.DrinkCider,
					Banner.TargettingProperty.DrinkCider_True,
					Banner.TargettingProperty.DrinkCider_False
					);

				SetDemograpicsBitsInfoType(
					demographics.DrinkDraftBeer,
					Banner.TargettingProperty.DrinkDraftBeer_True,
					Banner.TargettingProperty.DrinkDraftBeer_False
					);

				SetDemograpicsBitsInfoType(
					demographics.DrinkEnergy,
					Banner.TargettingProperty.DrinkEnergy_True,
					Banner.TargettingProperty.DrinkEnergy_False
					);

				SetDemograpicsBitsInfoType(
					demographics.DrinkSoft,
					Banner.TargettingProperty.DrinkSoft_True,
					Banner.TargettingProperty.DrinkSoft_False
					);

				SetDemograpicsBitsInfoType(
					demographics.DrinkSpirits,
					Banner.TargettingProperty.DrinkSpirits_True,
					Banner.TargettingProperty.DrinkSpirits_False
					);

				SetDemograpicsBitsInfoType(
					demographics.DrinkWater,
					Banner.TargettingProperty.DrinkWater_True,
					Banner.TargettingProperty.DrinkWater_False
					);

				SetDemograpicsBitsInfoType(
					demographics.DrinkWine,
					Banner.TargettingProperty.DrinkWine_True,
					Banner.TargettingProperty.DrinkWine_False
					);

				SetDemograpicsBitsInfoType(
					demographics.CreditCard,
					Banner.TargettingProperty.CreditCard_True,
					Banner.TargettingProperty.CreditCard_False
					);

				SetDemograpicsBitsInfoType(
					demographics.Loan,
					Banner.TargettingProperty.Loan_True,
					Banner.TargettingProperty.Loan_False
					);

				SetDemograpicsBitsInfoType(
					demographics.Mortgage,
					Banner.TargettingProperty.Mortgage_True,
					Banner.TargettingProperty.Mortgage_False
					);

				SetDemograpicsBitsInfoType(
					demographics.SpendMusicCd,
					Banner.TargettingProperty.SpendMusicCd_Zero,
					Banner.TargettingProperty.SpendMusicCd_Zero, // "Nothing" is actually 1
					Banner.TargettingProperty.SpendMusicCd_MoreThanZero,
					Banner.TargettingProperty.SpendMusicCd_MoreThanZero,
					Banner.TargettingProperty.SpendMusicCd_MoreThanZero,
					Banner.TargettingProperty.SpendMusicCd_MoreThanZero,
					Banner.TargettingProperty.SpendMusicCd_MoreThanZero,
					Banner.TargettingProperty.SpendMusicCd_MoreThanZero
					);

				SetDemograpicsBitsInfoType(
					demographics.SpendMusicVinyl,
					Banner.TargettingProperty.SpendMusicVinyl_Zero,
					Banner.TargettingProperty.SpendMusicVinyl_Zero, // "Nothing" is actually 1
					Banner.TargettingProperty.SpendMusicVinyl_MoreThanZero,
					Banner.TargettingProperty.SpendMusicVinyl_MoreThanZero,
					Banner.TargettingProperty.SpendMusicVinyl_MoreThanZero,
					Banner.TargettingProperty.SpendMusicVinyl_MoreThanZero,
					Banner.TargettingProperty.SpendMusicVinyl_MoreThanZero,
					Banner.TargettingProperty.SpendMusicVinyl_MoreThanZero
					);

				SetDemograpicsBitsInfoType(
					demographics.SpendMusicDownload,
					Banner.TargettingProperty.SpendMusicDownload_Zero,
					Banner.TargettingProperty.SpendMusicDownload_Zero, // "Nothing" is actually 1
					Banner.TargettingProperty.SpendMusicDownload_MoreThanZero,
					Banner.TargettingProperty.SpendMusicDownload_MoreThanZero,
					Banner.TargettingProperty.SpendMusicDownload_MoreThanZero,
					Banner.TargettingProperty.SpendMusicDownload_MoreThanZero,
					Banner.TargettingProperty.SpendMusicDownload_MoreThanZero,
					Banner.TargettingProperty.SpendMusicDownload_MoreThanZero
					);
			}
			else
			{
				Add(Banner.TargettingProperty.Salary_Unknown);
				Add(Banner.TargettingProperty.Employment_Unknown);
				Add(Banner.TargettingProperty.DrinkAlcopops_Unknown);
				Add(Banner.TargettingProperty.DrinkBottledBeer_Unknown);
				Add(Banner.TargettingProperty.DrinkCider_Unknown);
				Add(Banner.TargettingProperty.DrinkDraftBeer_Unknown);
				Add(Banner.TargettingProperty.DrinkEnergy_Unknown);
				Add(Banner.TargettingProperty.DrinkSoft_Unknown);
				Add(Banner.TargettingProperty.DrinkSpirits_Unknown);
				Add(Banner.TargettingProperty.DrinkWater_Unknown);
				Add(Banner.TargettingProperty.DrinkWine_Unknown);
				Add(Banner.TargettingProperty.CreditCard_Unknown);
				Add(Banner.TargettingProperty.Loan_Unknown);
				Add(Banner.TargettingProperty.Mortgage_Unknown);
				Add(Banner.TargettingProperty.SpendMusicCd_Unknown);
				Add(Banner.TargettingProperty.SpendMusicVinyl_Unknown);
				Add(Banner.TargettingProperty.SpendMusicDownload_Unknown);
			}
		}
Exemplo n.º 2
0
		public void Finish(object o, System.EventArgs e)
		{
			if (Page.IsValid)
			{

				Demographics d = Usr.Current.Demographics;
				if (d == null)
				{
					d = new Demographics();
					d.Guid = Usr.Current.Guid;
				}

				d.DateTime = DateTime.Now;

				#region Drinks
				d.DrinkWater = DrinkWater.Checked;
				d.DrinkSoft = DrinkSoft.Checked;
				d.DrinkEnergy = DrinkEnergy.Checked;
				d.DrinkDraftBeer = DrinkDraftBeer.Checked;
				d.DrinkBottledBeer = DrinkBottledBeer.Checked;
				d.DrinkSpirits = DrinkSpirits.Checked;
				d.DrinkWine = DrinkWine.Checked;
				d.DrinkAlcopops = DrinkAlcopops.Checked;
				d.DrinkCider = DrinkCider.Checked;
				#endregion
				#region Smoking
				if (Smoke1.Checked)
					d.Smoke = 1;
				else if (Smoke2.Checked)
					d.Smoke = 2;
				else
					d.Smoke = 3;
				#endregion
				#region Evenings
				d.EveningAllNight = float.Parse(EveningAllNight.SelectedValue);
				d.EveningLateNight = float.Parse(EveningLateNight.SelectedValue);
				d.EveningCoupleDrinks = float.Parse(EveningCoupleDrinks.SelectedValue);
				d.EveningOther = float.Parse(EveningOther.SelectedValue);
				d.EveningStayIn = float.Parse(EveningStayIn.SelectedValue);
				#endregion
				#region Employment
				if (Employment1.Checked)
					d.Employment = 1;
				else if (Employment2.Checked)
					d.Employment = 2;
				else if (Employment3.Checked)
					d.Employment = 3;
				else
					d.Employment = 4;
				#endregion
				#region Salary
				if (Salary1.Checked)
					d.Salary = 1;
				else if (Salary2.Checked)
					d.Salary = 2;
				else if (Salary3.Checked)
					d.Salary = 3;
				else if (Salary4.Checked)
					d.Salary = 4;
				else if (Salary5.Checked)
					d.Salary = 5;
				else if (Salary6.Checked)
					d.Salary = 6;
				else
					d.Salary = 7;
				#endregion
				#region Money
				d.CreditCard = CreditCardYes.Checked;
				d.Loan = LoanYes.Checked;
				d.Mortgage = MortgageYes.Checked;
				#endregion
				#region Stuff
				d.OwnCar = OwnCar.Checked;
				d.OwnBike = OwnBike.Checked;
				d.OwnMp3 = OwnMp3.Checked;
				d.OwnPc = OwnPc.Checked;
				d.OwnLaptop = OwnLaptop.Checked;
				d.OwnMac = OwnMac.Checked;
				d.OwnBroadband = OwnBroadband.Checked;
				d.OwnConsole = OwnConsole.Checked;
				d.OwnCamera = OwnCamera.Checked;
				d.OwnDvd = OwnDvd.Checked;
				d.OwnDvdRec = OwnDvdRec.Checked;
				d.BuyCar = BuyCar.Checked;
				d.BuyBike = BuyBike.Checked;
				d.BuyMp3 = BuyMp3.Checked;
				d.BuyPc = BuyPc.Checked;
				d.BuyLaptop = BuyLaptop.Checked;
				d.BuyMac = BuyMac.Checked;
				d.BuyBroadband = BuyBroadband.Checked;
				d.BuyConsole = BuyConsole.Checked;
				d.BuyCamera = BuyCamera.Checked;
				d.BuyDvd = BuyDvd.Checked;
				d.BuyDvdRec = BuyDvdRec.Checked;
				#endregion
				#region Shopping
				d.SpendDesignerClothes = int.Parse(SpendDesignerClothes.SelectedValue);
				d.SpendHighStreetClothes = int.Parse(SpendHighStreetClothes.SelectedValue);
				d.SpendMusicCd = int.Parse(SpendMusicCd.SelectedValue);
				d.SpendMusicVinyl = int.Parse(SpendMusicVinyl.SelectedValue);
				d.SpendMusicDownload = int.Parse(SpendMusicDownload.SelectedValue);
				d.SpendDvd = int.Parse(SpendDvd.SelectedValue);
				d.SpendGames = int.Parse(SpendGames.SelectedValue);
				d.SpendMobile = int.Parse(SpendMobile.SelectedValue);
				d.SpendSms = int.Parse(SpendSms.SelectedValue);
				d.SpendCar = int.Parse(SpendCar.SelectedValue);
				d.SpendTravel = int.Parse(SpendTravel.SelectedValue);
				#endregion
				#region Holidays
				d.Holidays = int.Parse(Holidays.SelectedValue);
				#endregion
				#region Imaging
				//d.ImagingManufacturer = Cambro.Web.Helpers.Strip(ImagingManufacturer.Text);
				//d.ImagingImportant = GetImagingVal(ImagingImportant1, ImagingImportant2, ImagingImportant3, ImagingImportant4, ImagingImportant5);

				//d.ImagingOpinionSony = GetImagingVal(ImagingOpinionSony1, ImagingOpinionSony2, ImagingOpinionSony3, ImagingOpinionSony4, ImagingOpinionSony5);
				//d.ImagingOpinionNokia = GetImagingVal(ImagingOpinionNokia1, ImagingOpinionNokia2, ImagingOpinionNokia3, ImagingOpinionNokia4, ImagingOpinionNokia5);
				//d.ImagingOpinionMotorola = GetImagingVal(ImagingOpinionMotorola1, ImagingOpinionMotorola2, ImagingOpinionMotorola3, ImagingOpinionMotorola4, ImagingOpinionMotorola5);
				//d.ImagingOpinionSiemens = GetImagingVal(ImagingOpinionSiemens1, ImagingOpinionSiemens2, ImagingOpinionSiemens3, ImagingOpinionSiemens4, ImagingOpinionSiemens5);
				//d.ImagingOpinionLg = GetImagingVal(ImagingOpinionLg1, ImagingOpinionLg2, ImagingOpinionLg3, ImagingOpinionLg4, ImagingOpinionLg5);
				//d.ImagingOpinionSamsung = GetImagingVal(ImagingOpinionSamsung1, ImagingOpinionSamsung2, ImagingOpinionSamsung3, ImagingOpinionSamsung4, ImagingOpinionSamsung5);

				//d.ImagingCapabilitySony = GetImagingVal(ImagingCapabilitySony1, ImagingCapabilitySony2, ImagingCapabilitySony3, ImagingCapabilitySony4, ImagingCapabilitySony5);
				//d.ImagingCapabilityNokia = GetImagingVal(ImagingCapabilityNokia1, ImagingCapabilityNokia2, ImagingCapabilityNokia3, ImagingCapabilityNokia4, ImagingCapabilityNokia5);
				//d.ImagingCapabilityMotorola = GetImagingVal(ImagingCapabilityMotorola1, ImagingCapabilityMotorola2, ImagingCapabilityMotorola3, ImagingCapabilityMotorola4, ImagingCapabilityMotorola5);
				//d.ImagingCapabilitySiemens = GetImagingVal(ImagingCapabilitySiemens1, ImagingCapabilitySiemens2, ImagingCapabilitySiemens3, ImagingCapabilitySiemens4, ImagingCapabilitySiemens5);
				//d.ImagingCapabilityLg = GetImagingVal(ImagingCapabilityLg1, ImagingCapabilityLg2, ImagingCapabilityLg3, ImagingCapabilityLg4, ImagingCapabilityLg5);
				//d.ImagingCapabilitySamsung = GetImagingVal(ImagingCapabilitySamsung1, ImagingCapabilitySamsung2, ImagingCapabilitySamsung3, ImagingCapabilitySamsung4, ImagingCapabilitySamsung5);

				//d.ImagingBuySony = GetImagingVal(ImagingBuySony1, ImagingBuySony2, ImagingBuySony3, ImagingBuySony4, ImagingBuySony5);
				//d.ImagingBuyNokia = GetImagingVal(ImagingBuyNokia1, ImagingBuyNokia2, ImagingBuyNokia3, ImagingBuyNokia4, ImagingBuyNokia5);
				//d.ImagingBuyMotorola = GetImagingVal(ImagingBuyMotorola1, ImagingBuyMotorola2, ImagingBuyMotorola3, ImagingBuyMotorola4, ImagingBuyMotorola5);
				//d.ImagingBuySiemens = GetImagingVal(ImagingBuySiemens1, ImagingBuySiemens2, ImagingBuySiemens3, ImagingBuySiemens4, ImagingBuySiemens5);
				//d.ImagingBuyLg = GetImagingVal(ImagingBuyLg1, ImagingBuyLg2, ImagingBuyLg3, ImagingBuyLg4, ImagingBuyLg5);
				//d.ImagingBuySamsung = GetImagingVal(ImagingBuySamsung1, ImagingBuySamsung2, ImagingBuySamsung3, ImagingBuySamsung4, ImagingBuySamsung5);
				#endregion

				d.Update();

				Usr.Current.HasCompletedDemographics = true;
				Usr.Current.ExtraIcon = 1;
				Usr.Current.ExtraExpire = DateTime.Now.AddMonths(1);
				Usr.Current.Update();

				Bobs.Log.Increment(Bobs.Log.Items.CompleteQuestionairre);

				if (Request.QueryString["Url"] != null && Request.QueryString["Url"].Length > 0)
					Response.Redirect(Request.QueryString["Url"]);
				else
					Response.Redirect("/");
			}
			else
				QuestionairreDiv.Style["visibility"] = "visible";//.Remove("display");

		}