示例#1
0
        private void SaveProduct(IDigitalProductControl productControl)
        {
            if (productControl == null)
            {
                return;
            }

            productControl.Product.ShowFlightDates = checkEditShowFlightDates.Checked;

            SaveDurationCheckboxValues(productControl);
            productControl.Product.DurationValue = spinEditDuration.EditValue != null ? (int?)spinEditDuration.Value : null;
        }
示例#2
0
 private void SaveDurationCheckboxValues(IDigitalProductControl productControl)
 {
     productControl.Product.ShowDuration = checkEditDuration.Checked;
     if (checkEditMonths.Checked)
     {
         productControl.Product.DurationType = "Months";
     }
     else if (checkEditWeeks.Checked)
     {
         productControl.Product.DurationType = "Weeks";
     }
     RaiseDataChanged();
 }
示例#3
0
        public void LoadProduct(IDigitalProductControl productControl)
        {
            if (productControl == null)
            {
                return;
            }

            _allowApplyValues = false;

            var product = productControl.Product;

            simpleLabelItemCategory.Text     = product.Category;
            checkEditShowFlightDates.Checked = product.ShowFlightDates;

            checkEditDuration.Checked = product.ShowDuration;
            switch (product.DurationType)
            {
            case "Months":
                checkEditMonths.Checked = true;
                checkEditWeeks.Checked  = false;
                break;

            case "Weeks":
                checkEditWeeks.Checked  = true;
                checkEditMonths.Checked = false;
                break;
            }
            if (product.DurationValue.HasValue)
            {
                spinEditDuration.EditValue = product.DurationValue;
            }
            else
            {
                if (checkEditMonths.Checked)
                {
                    spinEditDuration.EditValue = product.MonthDuraton;
                }
                else if (checkEditWeeks.Checked)
                {
                    spinEditDuration.EditValue = product.WeeksDuration;
                }
            }
            _allowApplyValues = true;
        }
		private void SaveDurationCheckboxValues(IDigitalProductControl productControl)
		{
			productControl.Product.ShowDuration = checkEditDuration.Checked;
			if (checkEditMonths.Checked)
				productControl.Product.DurationType = "Months";
			else if (checkEditWeeks.Checked)
				productControl.Product.DurationType = "Weeks";
			RaiseDataChanged();
		}
		private void SaveProduct(IDigitalProductControl productControl)
		{
			if (productControl == null) return;

			productControl.Product.ShowFlightDates = checkEditShowFlightDates.Checked;

			SaveDurationCheckboxValues(productControl);
			productControl.Product.DurationValue = spinEditDuration.EditValue != null ? (int?)spinEditDuration.Value : null;
		}
		public void LoadProduct(IDigitalProductControl productControl)
		{
			if (productControl == null) return;

			_allowApplyValues = false;

			var product = productControl.Product;

			labelControlCategory.Text = product.Category;
			checkEditShowFlightDates.Checked = product.ShowFlightDates;

			checkEditDuration.Checked = product.ShowDuration;
			switch (product.DurationType)
			{
				case "Months":
					checkEditMonths.Checked = true;
					checkEditWeeks.Checked = false;
					break;
				case "Weeks":
					checkEditWeeks.Checked = true;
					checkEditMonths.Checked = false;
					break;
			}
			if (product.DurationValue.HasValue)
			{
				spinEditDuration.EditValue = product.DurationValue;
			}
			else
			{
				if (checkEditMonths.Checked)
					spinEditDuration.EditValue = product.MonthDuraton;
				else if (checkEditWeeks.Checked)
					spinEditDuration.EditValue = product.WeeksDuration;
			}
			_allowApplyValues = true;
		}