Пример #1
0
 public override void LoadCalendar(bool quickLoad)
 {
     _localSchedule = BusinessObjects.Instance.ScheduleManager.GetLocalSchedule();
     base.LoadCalendar(quickLoad);
 }
Пример #2
0
		public override void LoadCalendar(bool quickLoad)
		{
			_localSchedule = BusinessObjects.Instance.ScheduleManager.GetLocalSchedule();
			base.LoadCalendar(quickLoad);
		}
		public void LoadSchedule(bool quickLoad)
		{
			_allowToSave = false;
			_localSchedule = BusinessObjects.Instance.ScheduleManager.GetLocalSchedule();
			gridControlPrintProducts.DataSource = new BindingList<PrintProduct>(_localSchedule.PrintProducts);
			digitalProductListControl.UpdateData(_localSchedule,
				() =>
				{
					UpdateProductsCount();
					Controller.Instance.UpdateDigitalProductTab(_localSchedule.DigitalProducts.Any(p => !String.IsNullOrEmpty(p.Name)));
					if (_allowToSave)
						SettingsNotSaved = true;
				},
				activity =>
				{
					var propertyEditActivity = activity as PropertyEditActivity;
					if (propertyEditActivity != null)
						propertyEditActivity.Advertiser = Controller.Instance.HomeBusinessName.EditValue as String;
					BusinessObjects.Instance.ActivityManager.AddActivity(activity);
				});
			if (_dragDropHelper == null)
			{
				_dragDropHelper = new GridDragDropHelper(gridViewPrintProducts, true);
				_dragDropHelper.AfterDrop += PrintProductsAfterDrop;
			}
			if (!quickLoad)
			{
				LoadView();

				#region Print Products
				repositoryItemComboBox.Items.Clear();
				repositoryItemComboBox.Items.AddRange(Core.AdSchedule.ListManager.Instance.PublicationSources.Where(x => !x.Name.Equals("Default")).Select(x => x.Name).Distinct().ToArray());
				Controller.Instance.HomeClientType.Properties.Items.Clear();
				Controller.Instance.HomeClientType.Properties.Items.AddRange(Core.AdSchedule.ListManager.Instance.ClientTypes.ToArray());

				Controller.Instance.HomeBusinessName.EditValue = _localSchedule.BusinessName;
				Controller.Instance.HomeDecisionMaker.EditValue = _localSchedule.DecisionMaker;

				if (!string.IsNullOrEmpty(_localSchedule.ClientType))
					Controller.Instance.HomeClientType.SelectedIndex = Controller.Instance.HomeClientType.Properties.Items.IndexOf(_localSchedule.ClientType);

				Controller.Instance.HomeAccountNumberCheck.Checked = !string.IsNullOrEmpty(_localSchedule.AccountNumber);
				Controller.Instance.HomeAccountNumberText.EditValue = _localSchedule.AccountNumber;

				Controller.Instance.HomePresentationDate.EditValue = _localSchedule.PresentationDate;
				Controller.Instance.HomeFlightDatesStart.EditValue = _localSchedule.FlightDateStart;
				Controller.Instance.HomeFlightDatesEnd.EditValue = _localSchedule.FlightDateEnd;
				Controller.Instance.UpdatePrintProductTab(_localSchedule.PrintProducts.Any(p => !String.IsNullOrEmpty(p.Name)));
				#endregion

				CalcWeeksOnFlightDatesChange(null, EventArgs.Empty);
				Controller.Instance.UpdateOutputTabs(_localSchedule.PrintProducts.Select(x => x.Inserts.Count).Sum() > 0);
				xtraTabControlProducts_SelectedPageChanged(xtraTabControlProducts, new TabPageChangedEventArgs(null, xtraTabControlProducts.SelectedTabPage));
			}
			SettingsNotSaved = false;
			_allowToSave = true;
		}
Пример #4
0
        public void LoadSchedule(bool quickLoad)
        {
            _allowToSave   = false;
            _localSchedule = BusinessObjects.Instance.ScheduleManager.GetLocalSchedule();
            gridControlPrintProducts.DataSource = new BindingList <PrintProduct>(_localSchedule.PrintProducts);
            digitalProductListControl.UpdateData(_localSchedule,
                                                 () =>
            {
                UpdateProductsCount();
                Controller.Instance.UpdateDigitalProductTab(_localSchedule.DigitalProducts.Any(p => !String.IsNullOrEmpty(p.Name)));
                if (_allowToSave)
                {
                    SettingsNotSaved = true;
                }
            },
                                                 activity =>
            {
                var propertyEditActivity = activity as PropertyEditActivity;
                if (propertyEditActivity != null)
                {
                    propertyEditActivity.Advertiser = Controller.Instance.HomeBusinessName.EditValue as String;
                }
                BusinessObjects.Instance.ActivityManager.AddActivity(activity);
            });
            if (_dragDropHelper == null)
            {
                _dragDropHelper            = new GridDragDropHelper(gridViewPrintProducts, true);
                _dragDropHelper.AfterDrop += PrintProductsAfterDrop;
            }
            if (!quickLoad)
            {
                LoadView();

                #region Print Products
                repositoryItemComboBox.Items.Clear();
                repositoryItemComboBox.Items.AddRange(Core.AdSchedule.ListManager.Instance.PublicationSources.Where(x => !x.Name.Equals("Default")).Select(x => x.Name).Distinct().ToArray());
                Controller.Instance.HomeClientType.Properties.Items.Clear();
                Controller.Instance.HomeClientType.Properties.Items.AddRange(Core.AdSchedule.ListManager.Instance.ClientTypes.ToArray());

                Controller.Instance.HomeBusinessName.EditValue  = _localSchedule.BusinessName;
                Controller.Instance.HomeDecisionMaker.EditValue = _localSchedule.DecisionMaker;

                if (!string.IsNullOrEmpty(_localSchedule.ClientType))
                {
                    Controller.Instance.HomeClientType.SelectedIndex = Controller.Instance.HomeClientType.Properties.Items.IndexOf(_localSchedule.ClientType);
                }

                Controller.Instance.HomeAccountNumberCheck.Checked  = !string.IsNullOrEmpty(_localSchedule.AccountNumber);
                Controller.Instance.HomeAccountNumberText.EditValue = _localSchedule.AccountNumber;

                Controller.Instance.HomePresentationDate.EditValue = _localSchedule.PresentationDate;
                Controller.Instance.HomeFlightDatesStart.EditValue = _localSchedule.FlightDateStart;
                Controller.Instance.HomeFlightDatesEnd.EditValue   = _localSchedule.FlightDateEnd;
                Controller.Instance.UpdatePrintProductTab(_localSchedule.PrintProducts.Any(p => !String.IsNullOrEmpty(p.Name)));
                #endregion

                CalcWeeksOnFlightDatesChange(null, EventArgs.Empty);
                Controller.Instance.UpdateOutputTabs(_localSchedule.PrintProducts.Select(x => x.Inserts.Count).Sum() > 0);
                xtraTabControlProducts_SelectedPageChanged(xtraTabControlProducts, new TabPageChangedEventArgs(null, xtraTabControlProducts.SelectedTabPage));
            }
            SettingsNotSaved = false;
            _allowToSave     = true;
        }