private void FormatAccordingColorOptions(PrintProductControl printProductControl)
		{
			PrintProduct printProduct = printProductControl.PrintProduct;
			switch (printProduct.ColorOption)
			{
				case ColorOptions.BlackWhite:
					Controller.Instance.PrintProductColorOptionsCostPerAd.Enabled = false;
					Controller.Instance.PrintProductColorOptionsPercentOfAd.Enabled = false;
					Controller.Instance.PrintProductColorOptionsIncluded.Enabled = false;
					Controller.Instance.PrintProductColorOptionsPCI.Enabled = false;

					printProductControl.gridBandColorPricing.Caption = @"Black & White";
					printProductControl.gridColumnColorPricing.OptionsColumn.ReadOnly = true;
					printProductControl.gridColumnColorPricing.OptionsColumn.AllowEdit = false;
					printProductControl.gridColumnColorPricingPercent.Visible = false;
					printProductControl.gridColumnColorPricingPCI.Visible = false;
					printProductControl.gridColumnColorPricing.AppearanceCell.TextOptions.HAlignment = HorzAlignment.Center;
					printProductControl.repositoryItemSpinEditColorPricingDisplay.NullText = "B-W";
					printProductControl.repositoryItemSpinEditColorPricingDisplayFirstRow.NullText = "B-W";
					printProductControl.repositoryItemSpinEditColorPricingDisplayFirstRow.Buttons[1].Visible = false;
					break;
				case ColorOptions.SpotColor:
				case ColorOptions.FullColor:
					Controller.Instance.PrintProductColorOptionsCostPerAd.Enabled = true;
					Controller.Instance.PrintProductColorOptionsPercentOfAd.Enabled = true;
					Controller.Instance.PrintProductColorOptionsIncluded.Enabled = true;
					Controller.Instance.PrintProductColorOptionsPCI.Enabled = printProduct.SizeOptions.EnableSquare & printProduct.AdPricingStrategy != AdPricingStrategies.SharePage;
					printProductControl.repositoryItemSpinEditColorPricingDisplay.NullText = "Included";
					printProductControl.repositoryItemSpinEditColorPricingDisplayFirstRow.NullText = "Included";

					if (printProduct.ColorOption == ColorOptions.SpotColor)
					{
						printProductControl.gridBandColorPricing.Caption = "Spot Color";
					}
					else if (printProduct.ColorOption == ColorOptions.FullColor)
					{
						printProductControl.gridBandColorPricing.Caption = "Full Color";
					}
					switch (printProduct.ColorPricing)
					{
						case ColorPricingType.CostPerAd:
							printProductControl.gridColumnColorPricing.OptionsColumn.AllowEdit = true;
							printProductControl.gridColumnColorPricing.OptionsColumn.ReadOnly = false;
							printProductControl.gridColumnColorPricingPercent.Visible = false;
							printProductControl.gridColumnColorPricingPCI.Visible = false;
							printProductControl.gridColumnColorPricing.ColumnEdit = printProductControl.repositoryItemSpinEditColorPricingDisplay;
							printProductControl.repositoryItemSpinEditColorPricingDisplayFirstRow.Buttons[1].Visible = true;
							printProductControl.gridColumnColorPricing.AppearanceCell.TextOptions.HAlignment = HorzAlignment.Near;

							break;
						case ColorPricingType.PercentOfAdRate:
							printProductControl.gridColumnColorPricing.OptionsColumn.AllowEdit = false;
							printProductControl.gridColumnColorPricing.OptionsColumn.ReadOnly = true;
							printProductControl.gridColumnColorPricingPercent.Visible = true;
							printProductControl.gridColumnColorPricingPCI.Visible = false;
							printProductControl.gridColumnColorPricing.ColumnEdit = printProductControl.repositoryItemSpinEditDiscountRate;
							printProductControl.repositoryItemSpinEditColorPricingDisplayFirstRow.Buttons[1].Visible = false;
							printProductControl.gridColumnColorPricing.AppearanceCell.TextOptions.HAlignment = HorzAlignment.Near;
							break;
						case ColorPricingType.ColorIncluded:
							printProductControl.gridColumnColorPricing.OptionsColumn.AllowEdit = false;
							printProductControl.gridColumnColorPricing.OptionsColumn.ReadOnly = true;
							printProductControl.gridColumnColorPricingPercent.Visible = false;
							printProductControl.gridColumnColorPricingPCI.Visible = false;
							printProductControl.gridColumnColorPricing.ColumnEdit = printProductControl.repositoryItemSpinEditColorPricingDisplay;
							printProductControl.repositoryItemSpinEditColorPricingDisplayFirstRow.Buttons[1].Visible = false;
							printProductControl.gridColumnColorPricing.AppearanceCell.TextOptions.HAlignment = HorzAlignment.Center;
							break;
						case ColorPricingType.CostPerInch:
							printProductControl.gridColumnColorPricing.OptionsColumn.AllowEdit = false;
							printProductControl.gridColumnColorPricing.OptionsColumn.ReadOnly = true;
							printProductControl.gridColumnColorPricingPercent.Visible = false;
							printProductControl.gridColumnColorPricingPCI.Visible = true;
							printProductControl.gridColumnColorPricing.ColumnEdit = printProductControl.repositoryItemSpinEditColorPricingDisplay;
							printProductControl.repositoryItemSpinEditColorPricingDisplayFirstRow.Buttons[1].Visible = false;
							printProductControl.gridColumnColorPricing.AppearanceCell.TextOptions.HAlignment = HorzAlignment.Center;
							break;
					}
					break;
			}
		}
		public void LoadSchedule(bool quickLoad)
		{
			LocalSchedule = BusinessObjects.Instance.ScheduleManager.GetLocalSchedule();
			labelControlScheduleInfo.Text = String.Format("{0}   <color=gray><i>({1} {2})</i></color>",
				LocalSchedule.BusinessName,
				LocalSchedule.FlightDates,
				String.Format("{0} {1}s", LocalSchedule.TotalWeeks, "week"));
			Controller.Instance.UpdateOutputTabs(LocalSchedule.PrintProducts.Select(x => x.Inserts.Count).Sum() > 0);
			if (!quickLoad)
			{
				xtraTabControlPublications.SuspendLayout();
				Application.DoEvents();
				xtraTabControlPublications.SelectedPageChanged -= xtraTabControlPublications_SelectedPageChanged;
				xtraTabControlPublications.TabPages.Clear();
				_tabPages.RemoveAll(x => !LocalSchedule.PrintProducts.Select(y => y.UniqueID).Contains(x.PrintProduct.UniqueID));
				foreach (var publication in LocalSchedule.PrintProducts)
				{
					if (string.IsNullOrEmpty(publication.Name)) continue;
					var printProductTab = _tabPages.FirstOrDefault(x => x.PrintProduct.UniqueID.Equals(publication.UniqueID));
					if (printProductTab == null)
					{
						printProductTab = new PrintProductControl();
						_tabPages.Add(printProductTab);
						Application.DoEvents();
					}
					printProductTab.PrintProduct = publication;
					printProductTab.Text = publication.Name.Replace("&", "&&");
					publication.RefreshAvailableDays();
					printProductTab.LoadInserts();
					Application.DoEvents();
				}
				_tabPages.Sort((x, y) => x.PrintProduct.Index.CompareTo(y.PrintProduct.Index));
				xtraTabControlPublications.TabPages.AddRange(_tabPages.ToArray());
				Application.DoEvents();
				LoadPublication();
				xtraTabControlPublications.SelectedPageChanged += xtraTabControlPublications_SelectedPageChanged;
				;
				xtraTabControlPublications.ResumeLayout();
			}
			else
			{
				foreach (var publication in LocalSchedule.PrintProducts)
				{
					if (string.IsNullOrEmpty(publication.Name)) continue;
					var printProductTab = _tabPages.FirstOrDefault(x => x.PrintProduct.UniqueID.Equals(publication.UniqueID));
					if (printProductTab != null)
					{
						printProductTab.PrintProduct = publication;
						publication.RefreshAvailableDays();
						printProductTab.LoadInserts();
					}
					Application.DoEvents();
				}
			}
			SettingsNotSaved = false;
		}
		private void FormatAccordingSizeOptions(PrintProductControl printProductControl)
		{
			var sizeOptions = printProductControl.PrintProduct.SizeOptions;
			Controller.Instance.PrintProductStandartHeight.Enabled = sizeOptions.EnableSquare;
			Controller.Instance.PrintProductStandartWidth.Enabled = sizeOptions.EnableSquare;
			Controller.Instance.PrintProductStandardSquareValueContainer.Visible = sizeOptions.Square.HasValue;
			Controller.Instance.PrintProductStandardSquareValue.Text = sizeOptions.Square.HasValue ? sizeOptions.Square.Value.ToString("#,##0.00#") : string.Empty;
			Controller.Instance.PrintProductPageSizeGroup.Enabled = sizeOptions.EnablePageSize;
			Controller.Instance.PrintProductPageSizeName.Enabled = sizeOptions.EnablePageSize;
			Controller.Instance.PrintProductMechanicalsName.Enabled = sizeOptions.EnableMechanicals;
			if (sizeOptions.EnablePageSize)
			{
				if (Controller.Instance.PrintProductPageSizeGroup.EditValue == null && Controller.Instance.PrintProductPageSizeGroup.Properties.Items.Count > 0)
					Controller.Instance.PrintProductPageSizeGroup.EditValue = Controller.Instance.PrintProductPageSizeGroup.Properties.Items[0];
			}
			else
			{
				Controller.Instance.PrintProductPageSizeGroup.EditValue = null;
				Controller.Instance.PrintProductPageSizeName.EditValue = null;
			}
			Controller.Instance.PrintProductColorOptionsPCI.Enabled = sizeOptions.EnableSquare & printProductControl.PrintProduct.AdPricingStrategy != AdPricingStrategies.SharePage & printProductControl.PrintProduct.ColorOption != ColorOptions.BlackWhite;
			Controller.Instance.PrintProductPercentOfPage.Enabled = !string.IsNullOrEmpty(sizeOptions.RateCard);
			Controller.Instance.PrintProductSharePageSquareContainer.Visible = Controller.Instance.PrintProductSharePageSquare.Items.Count > 0;
			Controller.Instance.PrintProductDimensionsRibbonBar.RecalcLayout();
			Controller.Instance.PrintProductPanel.PerformLayout();
		}
		private void LoadColorOptions(PrintProductControl printProductControl)
		{
			_allowToSave = false;
			PrintProduct printProduct = printProductControl.PrintProduct;
			switch (printProduct.ColorOption)
			{
				case ColorOptions.BlackWhite:
					Controller.Instance.PrintProductColor.SelectedIndex = 0;
					break;
				case ColorOptions.SpotColor:
				case ColorOptions.FullColor:

					if (printProduct.ColorOption == ColorOptions.SpotColor)
						Controller.Instance.PrintProductColor.SelectedIndex = 1;
					else if (printProduct.ColorOption == ColorOptions.FullColor)
						Controller.Instance.PrintProductColor.SelectedIndex = 2;
					switch (printProduct.ColorPricing)
					{
						case ColorPricingType.CostPerAd:
							Controller.Instance.PrintProductColorOptionsCostPerAd.Checked = true;
							break;
						case ColorPricingType.PercentOfAdRate:
							Controller.Instance.PrintProductColorOptionsPercentOfAd.Checked = true;
							break;
						case ColorPricingType.ColorIncluded:
							Controller.Instance.PrintProductColorOptionsIncluded.Checked = true;
							break;
						case ColorPricingType.CostPerInch:
							Controller.Instance.PrintProductColorOptionsPCI.Checked = true;
							break;
					}
					break;
			}
			FormatAccordingColorOptions(printProductControl);
			_allowToSave = true;
		}
		private void SetSizeOptions(PrintProductControl printProductControl)
		{
			var sizeOptions = printProductControl.PrintProduct.SizeOptions;
			switch (printProductControl.PrintProduct.AdPricingStrategy)
			{
				case AdPricingStrategies.StandartPCI:
				case AdPricingStrategies.FlatModular:
					sizeOptions.ResetToDefaults(AdPricingStrategies.StandartPCI);
					_allowToSave = false;
					Controller.Instance.PrintProductRateCard.EditValue = null;
					Controller.Instance.PrintProductPercentOfPage.EditValue = null;
					Controller.Instance.PrintProductSharePageSquare.Items.Clear();
					_allowToSave = true;

					sizeOptions.EnableSquare = Controller.Instance.PrintProductAdSizeStandartSquare.Checked;
					sizeOptions.Width = sizeOptions.EnableSquare ? (double)Controller.Instance.PrintProductStandartWidth.Value : 0;
					sizeOptions.Height = sizeOptions.EnableSquare ? (double)Controller.Instance.PrintProductStandartHeight.Value : 0;
					break;
				case AdPricingStrategies.SharePage:
					sizeOptions.ResetToDefaults(AdPricingStrategies.SharePage);
					_allowToSave = false;
					Controller.Instance.PrintProductAdSizeStandartSquare.Checked = false;
					Controller.Instance.PrintProductStandartHeight.Value = 0;
					Controller.Instance.PrintProductStandartWidth.Value = 0;
					_allowToSave = true;
					sizeOptions.RateCard = !string.IsNullOrEmpty((string)Controller.Instance.PrintProductRateCard.EditValue) ? Controller.Instance.PrintProductRateCard.EditValue.ToString() : null;
					sizeOptions.PercentOfPage = !string.IsNullOrEmpty((string)Controller.Instance.PrintProductPercentOfPage.EditValue) ? Controller.Instance.PrintProductPercentOfPage.EditValue.ToString() : null;
					var shareUnit = (from CheckedListBoxItem item in Controller.Instance.PrintProductSharePageSquare.Items where item.CheckState == CheckState.Checked select item.Value as ShareUnit).FirstOrDefault();
					sizeOptions.Height = shareUnit != null ? shareUnit.HeightValue : 0;
					sizeOptions.HeightMeasure = shareUnit != null ? shareUnit.HeightMeasureUnit : sizeOptions.HeightMeasure;
					sizeOptions.Width = shareUnit != null ? shareUnit.WidthValue : 0;
					sizeOptions.WidthMeasure = shareUnit != null ? shareUnit.WidthMeasureUnit : sizeOptions.WidthMeasure;
					sizeOptions.EnableSquare = false;
					break;
			}
			sizeOptions.EnablePageSize = Controller.Instance.PrintProductPageSizeCheck.Checked;
			sizeOptions.PageSizeGroup = sizeOptions.EnablePageSize ? Controller.Instance.PrintProductPageSizeGroup.EditValue as String : null;
			sizeOptions.PageSize = sizeOptions.EnablePageSize ? Controller.Instance.PrintProductPageSizeName.EditValue as String : null;
			sizeOptions.EnableMechanicals = Controller.Instance.PrintProductMechanicalsCheck.Checked;
			sizeOptions.Mechanicals = sizeOptions.EnableMechanicals ? Controller.Instance.PrintProductMechanicalsName.EditValue as String : null;
			FormatAccordingSizeOptions(printProductControl);
			printProductControl.LoadInserts();
			printProductControl.UpdateTotals();
			printProductControl.UpdateProductButtonsState();
		}
		private void LoadSizeOptions(PrintProductControl printProductControl)
		{
			_allowToSave = false;
			var sizeOptions = printProductControl.PrintProduct.SizeOptions;
			Controller.Instance.PrintProductPageSizeCheck.Checked = sizeOptions.EnablePageSize;
			Controller.Instance.PrintProductPageSizeGroup.Properties.Items.Clear();
			Controller.Instance.PrintProductPageSizeGroup.Properties.Items.AddRange(ListManager.Instance.PageSizes.Select(ps => ps.Code).Distinct().ToArray());
			Controller.Instance.PrintProductPageSizeGroupContainer.Visible = Controller.Instance.PrintProductPageSizeGroup.Properties.Items.Count > 1;
			if (!String.IsNullOrEmpty(sizeOptions.PageSizeGroup))
				Controller.Instance.PrintProductPageSizeGroup.EditValue = sizeOptions.PageSizeGroup;
			else
				Controller.Instance.PrintProductPageSizeGroup.EditValue = ListManager.Instance.PageSizes.Select(ps => ps.Code).Distinct().FirstOrDefault();
			Controller.Instance.PrintProductPageSizeName.Properties.Items.Clear();
			Controller.Instance.PrintProductPageSizeName.Properties.Items.AddRange(ListManager.Instance.PageSizes.Where(ps => ps.Code.Equals(Controller.Instance.PrintProductPageSizeGroup.EditValue as String) || Controller.Instance.PrintProductPageSizeGroup.Properties.Items.Count <= 1).Select(ps => ps.Name).ToArray());
			Controller.Instance.PrintProductPageSizeName.EditValue = sizeOptions.PageSize;
			Controller.Instance.PrintProductMechanicalsCheck.Checked = sizeOptions.EnableMechanicals;
			Controller.Instance.PrintProductMechanicalsName.EditValue = sizeOptions.Mechanicals;
			Controller.Instance.PrintProductRateCard.Properties.Items.Clear();
			Controller.Instance.PrintProductRateCard.Properties.Items.AddRange(ListManager.Instance.ShareUnits.Select(x => x.RateCard).Distinct().ToArray());

			switch (printProductControl.PrintProduct.AdPricingStrategy)
			{
				case AdPricingStrategies.StandartPCI:
				case AdPricingStrategies.FlatModular:
					Controller.Instance.PrintProductAdSizeStandartSquare.Checked = sizeOptions.EnableSquare;
					Controller.Instance.PrintProductStandartWidth.Value = (decimal)sizeOptions.Width;
					Controller.Instance.PrintProductStandartHeight.Value = (decimal)sizeOptions.Height;
					break;
				case AdPricingStrategies.SharePage:
					Controller.Instance.PrintProductRateCard.EditValue = sizeOptions.RateCard;
					Controller.Instance.PrintProductPercentOfPage.Properties.Items.Clear();
					if (!string.IsNullOrEmpty(sizeOptions.RateCard))
						Controller.Instance.PrintProductPercentOfPage.Properties.Items.AddRange(ListManager.Instance.ShareUnits.Where(x => x.RateCard.Equals(sizeOptions.RateCard)).Select(x => x.PercentOfPage).Distinct().ToArray());
					Controller.Instance.PrintProductPercentOfPage.EditValue = sizeOptions.PercentOfPage;
					Controller.Instance.PrintProductSharePageSquare.Items.Clear();
					var shareUnits = new ShareUnit[] { };
					if (Controller.Instance.PrintProductPercentOfPage.EditValue != null && Controller.Instance.PrintProductRateCard.EditValue != null)
						shareUnits = ListManager.Instance.ShareUnits.Where(x => x.RateCard.Equals(Controller.Instance.PrintProductRateCard.EditValue.ToString()) && x.PercentOfPage.Equals(Controller.Instance.PrintProductPercentOfPage.EditValue.ToString())).ToArray();
					if (shareUnits.Length > 0)
					{
						var storedShareUnit = printProductControl.PrintProduct.SizeOptions.RelatedShareUnit;
						foreach (var shareUnit in shareUnits)
							Controller.Instance.PrintProductSharePageSquare.Items.Add(shareUnit, shareUnit.Dimensions, shareUnit.Dimensions.Equals(storedShareUnit.Dimensions) ? CheckState.Checked : CheckState.Unchecked, true);
						if (Controller.Instance.PrintProductSharePageSquare.CheckedIndices.Count == 0)
							Controller.Instance.PrintProductSharePageSquare.Items[0].CheckState = CheckState.Checked;
					}
					break;
			}
			FormatAccordingSizeOptions(printProductControl);
			printProductControl.UpdateProductButtonsState();
			_allowToSave = true;
		}
		private void FormatAccordingPricingOptions(PrintProductControl printProductControl)
		{
			var printProduct = printProductControl.PrintProduct;
			switch (printProduct.AdPricingStrategy)
			{
				case AdPricingStrategies.StandartPCI:
					Controller.Instance.PrintProductAdSizeStandart.Visible = true;
					Controller.Instance.PrintProductAdSizeSharePage.Visible = false;
					Controller.Instance.PrintProductAdSizeStandartSquare.Enabled = false;
					Controller.Instance.PrintProductAdSizeStandartSquare.Checked = true;
					Controller.Instance.PrintProductColorOptionsPCI.Enabled = printProductControl.PrintProduct.ColorOption != ColorOptions.BlackWhite;
					Controller.Instance.PrintProductDimensionsRibbonBar.Text = "Col. x In.";

					printProductControl.gridBandPCIRate.Caption = "PCI";
					printProductControl.gridBandADRate.Caption = "Cost (B&W)";
					printProductControl.gridColumnPCIRate.OptionsColumn.ReadOnly = false;
					printProductControl.gridColumnPCIRate.OptionsColumn.AllowEdit = true;
					printProductControl.gridColumnPCIRate.AppearanceCell.TextOptions.HAlignment = HorzAlignment.Far;
					printProductControl.gridColumnPCIRate.AppearanceCell.ForeColor = Color.Black;
					printProductControl.repositoryItemSpinEditPCIRateDisplay.Appearance.ForeColor = Color.Black;
					printProductControl.repositoryItemSpinEditPCIRateDisplay.AppearanceDisabled.ForeColor = Color.Black;
					printProductControl.repositoryItemSpinEditPCIRateDisplay.AppearanceFocused.ForeColor = Color.Black;
					printProductControl.repositoryItemSpinEditPCIRateDisplay.AppearanceReadOnly.ForeColor = Color.Black;
					printProductControl.repositoryItemSpinEditPCIRateDisplayFirstRow.Appearance.ForeColor = Color.Black;
					printProductControl.repositoryItemSpinEditPCIRateDisplayFirstRow.AppearanceDisabled.ForeColor = Color.Black;
					printProductControl.repositoryItemSpinEditPCIRateDisplayFirstRow.AppearanceFocused.ForeColor = Color.Black;
					printProductControl.repositoryItemSpinEditPCIRateDisplayFirstRow.AppearanceReadOnly.ForeColor = Color.Black;
					printProductControl.gridColumnADRate.AppearanceCell.TextOptions.HAlignment = HorzAlignment.Center;
					printProductControl.gridColumnADRate.AppearanceCell.ForeColor = Color.Gray;
					printProductControl.repositoryItemSpinEditADRateDisplay.Appearance.ForeColor = Color.Gray;
					printProductControl.repositoryItemSpinEditADRateDisplay.AppearanceDisabled.ForeColor = Color.Gray;
					printProductControl.repositoryItemSpinEditADRateDisplay.AppearanceFocused.ForeColor = Color.Gray;
					printProductControl.repositoryItemSpinEditADRateDisplay.AppearanceReadOnly.ForeColor = Color.Gray;
					printProductControl.repositoryItemSpinEditADRateDisplayNull.Appearance.ForeColor = Color.Gray;
					printProductControl.repositoryItemSpinEditADRateDisplayNull.AppearanceDisabled.ForeColor = Color.Gray;
					printProductControl.repositoryItemSpinEditADRateDisplayNull.AppearanceFocused.ForeColor = Color.Gray;
					printProductControl.repositoryItemSpinEditADRateDisplayNull.AppearanceReadOnly.ForeColor = Color.Gray;
					printProductControl.repositoryItemSpinEditADRateDisplayFirstRow.Appearance.ForeColor = Color.Gray;
					printProductControl.repositoryItemSpinEditADRateDisplayFirstRow.AppearanceDisabled.ForeColor = Color.Gray;
					printProductControl.repositoryItemSpinEditADRateDisplayFirstRow.AppearanceFocused.ForeColor = Color.Gray;
					printProductControl.repositoryItemSpinEditADRateDisplayFirstRow.AppearanceReadOnly.ForeColor = Color.Gray;
					printProductControl.repositoryItemSpinEditADRateDisplayNullFirstRow.Appearance.ForeColor = Color.Gray;
					printProductControl.repositoryItemSpinEditADRateDisplayNullFirstRow.AppearanceDisabled.ForeColor = Color.Gray;
					printProductControl.repositoryItemSpinEditADRateDisplayNullFirstRow.AppearanceFocused.ForeColor = Color.Gray;
					printProductControl.repositoryItemSpinEditADRateDisplayNullFirstRow.AppearanceReadOnly.ForeColor = Color.Gray;
					break;
				case AdPricingStrategies.FlatModular:
					Controller.Instance.PrintProductAdSizeStandart.Visible = true;
					Controller.Instance.PrintProductAdSizeSharePage.Visible = false;
					Controller.Instance.PrintProductAdSizeStandartSquare.Enabled = true;
					Controller.Instance.PrintProductAdSizeStandartSquare.Enabled = true;
					Controller.Instance.PrintProductColorOptionsPCI.Enabled = printProduct.SizeOptions.EnableSquare & printProductControl.PrintProduct.ColorOption != ColorOptions.BlackWhite;
					Controller.Instance.PrintProductDimensionsRibbonBar.Text = "Col. x In.";

					printProductControl.gridBandPCIRate.Caption = "Package PCI";
					printProductControl.gridBandADRate.Caption = "Package Rate";
					printProductControl.gridColumnPCIRate.OptionsColumn.ReadOnly = true;
					printProductControl.gridColumnPCIRate.OptionsColumn.AllowEdit = false;
					printProductControl.gridColumnPCIRate.AppearanceCell.TextOptions.HAlignment = HorzAlignment.Center;
					printProductControl.gridColumnPCIRate.AppearanceCell.ForeColor = Color.Gray;
					printProductControl.repositoryItemSpinEditPCIRateDisplay.Appearance.ForeColor = Color.Gray;
					printProductControl.repositoryItemSpinEditPCIRateDisplay.AppearanceDisabled.ForeColor = Color.Gray;
					printProductControl.repositoryItemSpinEditPCIRateDisplay.AppearanceFocused.ForeColor = Color.Gray;
					printProductControl.repositoryItemSpinEditPCIRateDisplay.AppearanceReadOnly.ForeColor = Color.Gray;
					printProductControl.repositoryItemSpinEditPCIRateDisplayFirstRow.Appearance.ForeColor = Color.Gray;
					printProductControl.repositoryItemSpinEditPCIRateDisplayFirstRow.AppearanceDisabled.ForeColor = Color.Gray;
					printProductControl.repositoryItemSpinEditPCIRateDisplayFirstRow.AppearanceFocused.ForeColor = Color.Gray;
					printProductControl.repositoryItemSpinEditPCIRateDisplayFirstRow.AppearanceReadOnly.ForeColor = Color.Gray;
					printProductControl.gridColumnADRate.AppearanceCell.TextOptions.HAlignment = HorzAlignment.Far;
					printProductControl.gridColumnADRate.AppearanceCell.ForeColor = Color.Black;
					printProductControl.repositoryItemSpinEditADRateDisplay.Appearance.ForeColor = Color.Black;
					printProductControl.repositoryItemSpinEditADRateDisplay.AppearanceDisabled.ForeColor = Color.Black;
					printProductControl.repositoryItemSpinEditADRateDisplay.AppearanceFocused.ForeColor = Color.Black;
					printProductControl.repositoryItemSpinEditADRateDisplay.AppearanceReadOnly.ForeColor = Color.Black;
					printProductControl.repositoryItemSpinEditADRateDisplayNull.Appearance.ForeColor = Color.Black;
					printProductControl.repositoryItemSpinEditADRateDisplayNull.AppearanceDisabled.ForeColor = Color.Black;
					printProductControl.repositoryItemSpinEditADRateDisplayNull.AppearanceFocused.ForeColor = Color.Black;
					printProductControl.repositoryItemSpinEditADRateDisplayNull.AppearanceReadOnly.ForeColor = Color.Black;
					printProductControl.repositoryItemSpinEditADRateDisplayFirstRow.Appearance.ForeColor = Color.Black;
					printProductControl.repositoryItemSpinEditADRateDisplayFirstRow.AppearanceDisabled.ForeColor = Color.Black;
					printProductControl.repositoryItemSpinEditADRateDisplayFirstRow.AppearanceFocused.ForeColor = Color.Black;
					printProductControl.repositoryItemSpinEditADRateDisplayFirstRow.AppearanceReadOnly.ForeColor = Color.Black;
					printProductControl.repositoryItemSpinEditADRateDisplayNullFirstRow.Appearance.ForeColor = Color.Black;
					printProductControl.repositoryItemSpinEditADRateDisplayNullFirstRow.AppearanceDisabled.ForeColor = Color.Black;
					printProductControl.repositoryItemSpinEditADRateDisplayNullFirstRow.AppearanceFocused.ForeColor = Color.Black;
					printProductControl.repositoryItemSpinEditADRateDisplayNullFirstRow.AppearanceReadOnly.ForeColor = Color.Black;
					break;
				case AdPricingStrategies.SharePage:
					Controller.Instance.PrintProductAdSizeStandart.Visible = false;
					Controller.Instance.PrintProductAdSizeSharePage.Visible = true;
					Controller.Instance.PrintProductAdSizeStandartSquare.Enabled = false;
					Controller.Instance.PrintProductColorOptionsPCI.Enabled = false;
					Controller.Instance.PrintProductDimensionsRibbonBar.Text = "Ratecard && Share";

					printProductControl.gridBandPCIRate.Caption = "Package PCI";
					printProductControl.gridBandADRate.Caption = "Package Rate";
					printProductControl.gridColumnPCIRate.OptionsColumn.ReadOnly = true;
					printProductControl.gridColumnPCIRate.OptionsColumn.AllowEdit = false;
					printProductControl.gridColumnPCIRate.AppearanceCell.TextOptions.HAlignment = HorzAlignment.Center;
					printProductControl.gridColumnPCIRate.AppearanceCell.ForeColor = Color.Gray;
					printProductControl.repositoryItemSpinEditPCIRateDisplay.Appearance.ForeColor = Color.Gray;
					printProductControl.repositoryItemSpinEditPCIRateDisplay.AppearanceDisabled.ForeColor = Color.Gray;
					printProductControl.repositoryItemSpinEditPCIRateDisplay.AppearanceFocused.ForeColor = Color.Gray;
					printProductControl.repositoryItemSpinEditPCIRateDisplay.AppearanceReadOnly.ForeColor = Color.Gray;
					printProductControl.repositoryItemSpinEditPCIRateDisplayFirstRow.Appearance.ForeColor = Color.Gray;
					printProductControl.repositoryItemSpinEditPCIRateDisplayFirstRow.AppearanceDisabled.ForeColor = Color.Gray;
					printProductControl.repositoryItemSpinEditPCIRateDisplayFirstRow.AppearanceFocused.ForeColor = Color.Gray;
					printProductControl.repositoryItemSpinEditPCIRateDisplayFirstRow.AppearanceReadOnly.ForeColor = Color.Gray;
					printProductControl.gridColumnADRate.AppearanceCell.TextOptions.HAlignment = HorzAlignment.Far;
					printProductControl.gridColumnADRate.AppearanceCell.ForeColor = Color.Black;
					printProductControl.repositoryItemSpinEditADRateDisplay.Appearance.ForeColor = Color.Black;
					printProductControl.repositoryItemSpinEditADRateDisplay.AppearanceDisabled.ForeColor = Color.Black;
					printProductControl.repositoryItemSpinEditADRateDisplay.AppearanceFocused.ForeColor = Color.Black;
					printProductControl.repositoryItemSpinEditADRateDisplay.AppearanceReadOnly.ForeColor = Color.Black;
					printProductControl.repositoryItemSpinEditADRateDisplayNull.Appearance.ForeColor = Color.Black;
					printProductControl.repositoryItemSpinEditADRateDisplayNull.AppearanceDisabled.ForeColor = Color.Black;
					printProductControl.repositoryItemSpinEditADRateDisplayNull.AppearanceFocused.ForeColor = Color.Black;
					printProductControl.repositoryItemSpinEditADRateDisplayNull.AppearanceReadOnly.ForeColor = Color.Black;
					printProductControl.repositoryItemSpinEditADRateDisplayFirstRow.Appearance.ForeColor = Color.Black;
					printProductControl.repositoryItemSpinEditADRateDisplayFirstRow.AppearanceDisabled.ForeColor = Color.Black;
					printProductControl.repositoryItemSpinEditADRateDisplayFirstRow.AppearanceFocused.ForeColor = Color.Black;
					printProductControl.repositoryItemSpinEditADRateDisplayFirstRow.AppearanceReadOnly.ForeColor = Color.Black;
					printProductControl.repositoryItemSpinEditADRateDisplayNullFirstRow.Appearance.ForeColor = Color.Black;
					printProductControl.repositoryItemSpinEditADRateDisplayNullFirstRow.AppearanceDisabled.ForeColor = Color.Black;
					printProductControl.repositoryItemSpinEditADRateDisplayNullFirstRow.AppearanceFocused.ForeColor = Color.Black;
					printProductControl.repositoryItemSpinEditADRateDisplayNullFirstRow.AppearanceReadOnly.ForeColor = Color.Black;
					break;
			}
			Controller.Instance.PrintProductDimensionsRibbonBar.RecalcLayout();
			Controller.Instance.PrintProductPanel.PerformLayout();
		}
		private void LoadPricingOptions(PrintProductControl printProductControl)
		{
			_allowToSave = false;
			PrintProduct printProduct = printProductControl.PrintProduct;
			switch (printProduct.AdPricingStrategy)
			{
				case AdPricingStrategies.StandartPCI:
					Controller.Instance.PrintProductAdPricingColumnInches.Checked = true;
					Controller.Instance.PrintProductAdPricingFlat.Checked = false;
					Controller.Instance.PrintProductAdPricingPagePercent.Checked = false;
					break;
				case AdPricingStrategies.FlatModular:
					Controller.Instance.PrintProductAdPricingColumnInches.Checked = false;
					Controller.Instance.PrintProductAdPricingFlat.Checked = true;
					Controller.Instance.PrintProductAdPricingPagePercent.Checked = false;
					break;
				case AdPricingStrategies.SharePage:
					Controller.Instance.PrintProductAdPricingColumnInches.Checked = false;
					Controller.Instance.PrintProductAdPricingFlat.Checked = false;
					Controller.Instance.PrintProductAdPricingPagePercent.Checked = true;
					break;
			}
			FormatAccordingPricingOptions(printProductControl);
			_allowToSave = true;
		}
		private void xtraTabControlPublications_MouseDown(object sender, MouseEventArgs e)
		{
			var c = sender as XtraTabControl;

			var hi = c.CalcHitInfo(new Point(e.X, e.Y));
			if (hi.HitTest != XtraTabHitTest.PageHeader || e.Button != MouseButtons.Right) return;
			var publicationControl = hi.Page as PrintProductControl;
			using (var form = new FormCloneProduct())
			{
				if (form.ShowDialog() != DialogResult.Yes || publicationControl == null) return;
				var selectedPage = xtraTabControlPublications.SelectedTabPage as PrintProductControl;
				var newPrintProduct = publicationControl.PrintProduct.Clone();
				xtraTabControlPublications.SelectedPageChanged -= xtraTabControlPublications_SelectedPageChanged;
				xtraTabControlPublications.TabPages.Clear();
				var newPublicationTab = new PrintProductControl();
				newPublicationTab.PrintProduct = newPrintProduct;
				newPublicationTab.Text = newPrintProduct.Name.Replace("&", "&&");
				newPrintProduct.RefreshAvailableDays();
				newPublicationTab.LoadInserts();
				_tabPages.Add(newPublicationTab);
				_tabPages.Sort((x, y) => x.PrintProduct.Index.CompareTo(y.PrintProduct.Index));
				xtraTabControlPublications.TabPages.AddRange(_tabPages.ToArray());
				xtraTabControlPublications.SelectedPageChanged += xtraTabControlPublications_SelectedPageChanged;
				;
				xtraTabControlPublications.SelectedTabPage = selectedPage;
				SettingsNotSaved = true;
			}
		}