public static CommonSelectionControl CreateSelectionControl (InformationenAddOn InfoAddOn,
			TemplateElementManagement ConnectedTemplateElementManagement, TemplateManagement.AuswahlSelection EntriesToShow,
			TemplateManagement.AuswahlSortOrder SortOrder)
			{
			CommonSelectionControl SelectionControl = new CommonSelectionControl ();
			SelectionControl.InfoAddOn = InfoAddOn;
			SelectionControl.ConnectedTemplateElementManagement = ConnectedTemplateElementManagement;
			if (SelectionControl.Create (EntriesToShow, SortOrder) == false)
				return null;
			return SelectionControl;
			}
		public bool Create (TemplateManagement.AuswahlSelection EntriesToShow, TemplateManagement.AuswahlSortOrder SortOrder)
			{
			FireClick = false;
			SelectionGrid.BeginInit ();

			String BereichToUse = TemplateManagement.GetBereichToUse (InfoAddOn.ActuallBezeichner);

			SelectionGrid.SelectionMode = DataGridSelectionMode.Single;
			SelectionGrid.Tag = this;
			SelectionGrid.Visibility = System.Windows.Visibility.Visible;

			List<TemplateManagement.AuswahlSelection> MultipleAuswahlEntries = new List<TemplateManagement.AuswahlSelection>
						{ 
						TemplateManagement.AuswahlSelection.AllFromType,
						TemplateManagement.AuswahlSelection.Used,
						TemplateManagement.AuswahlSelection.My,
						TemplateManagement.AuswahlSelection.All
						};

			TemplateManagement.AuswahlSortOrder SortOrderUsed = TemplateManagement.AuswahlSortOrder.Alphabetic;
			if (SelectionData != null)
				SelectionData.Clear ();
			while (((SelectionData == null)
				|| (SelectionData.Count == 0))
				&& (MultipleAuswahlEntries.Count > 0))
				{
				if (MultipleAuswahlEntries.Contains (EntriesToShow))
					MultipleAuswahlEntries.Remove (EntriesToShow);
				else
					{
					EntriesToShow = MultipleAuswahlEntries [0];
					MultipleAuswahlEntries.RemoveAt (0);
					}
				if (EntriesToShow == TemplateManagement.AuswahlSelection.All)
					SortOrderUsed = TemplateManagement.AuswahlSortOrder.Alphabetic;
				else
					SortOrderUsed = SortOrder;
				SelectionData = GetSelectionData (BereichToUse, TemplateManagement.CurrentUserName, InfoAddOn,
						ConnectedTemplateElementManagement, EntriesToShow, SortOrderUsed);
				if (SelectionData == null)
					return false;
				}

			SelectionGrid.ItemsSource = SelectionData;

			switch (EntriesToShow)
				{
				case TemplateManagement.AuswahlSelection.My:
					if (SortOrderUsed == TemplateManagement.AuswahlSortOrder.Alphabetic)
						MyEntriesOrderByAlphabet.IsChecked = true;
					else
						MyEntriesOrderByOccurence.IsChecked = true;
					break;
				case TemplateManagement.AuswahlSelection.AllFromType:
					if (SortOrderUsed == TemplateManagement.AuswahlSortOrder.Alphabetic)
						TypEntriesOrderByAlphabet.IsChecked = true;
					else
						TypEntriesOrderByOccurence.IsChecked = true;
					break;
				case TemplateManagement.AuswahlSelection.Used:
					
					if (SortOrderUsed == TemplateManagement.AuswahlSortOrder.Alphabetic)
						UsedEntriesOrderByAlphabet.IsChecked = true;
					else
						UsedEntriesOrderByOccurence.IsChecked = true;
					break;
				case TemplateManagement.AuswahlSelection.All:
						AllEntriesOrderByAlphabet.IsChecked = true;
					break;
				}
			SelectionGrid.EndInit ();
			FireClick = true;
			if (SelectionData == null)
				return false;
			if (SelectionData.Count == 0)
				return false;
			return true;
			}
		private List<SelectionDataClass> LoadMyOrUsedSelectionData (InformationenAddOn InfoAddOn, String BereichToUse, 
			TemplateManagement.AuswahlSelection EntriesToShow, TemplateManagement.AuswahlSortOrder SortOrder)
			{
			String SelectClause = String.Empty;
				SelectClause = TemplateManagement.GetMyOrUsedUnifiedTableIDsSelectClause (InfoAddOn, EntriesToShow);
			
			if (String.IsNullOrEmpty (SelectClause))
				return new List<SelectionDataClass> ();
			WCFStandards DataAccess = new WCFStandards ();
			DataSet ResultDataSet = null;
			if (SortOrder == TemplateManagement.AuswahlSortOrder.Alphabetic)
				ResultDataSet = DataAccess.GetCommonDataSet ("Select " + String.Join (", ", ItemsToSelectForSelection)
								+ " from " + ViewNameForSelection + " where ( " 
								+ TemplateManagement.GetWhereClauseFromBereich (BereichToUse) + " ) and "
								+ SelectClause + " order by " + String.Join (", ", SortingItemsForSelection));
			else
				ResultDataSet = DataAccess.GetCommonDataSet ("Select " + String.Join (", ", ItemsToSelectForSelection)
								+ " from " + ViewNameForSelection + " where ( " 
								+ TemplateManagement.GetWhereClauseFromBereich (BereichToUse) + " ) and "
								+ SelectClause );
			return GetSelectionDataFormatting (ResultDataSet.Tables [ViewNameForSelection]);
			}
		public List<SelectionDataClass> GetSelectionData(String BereichToUse, String ActiveUser, InformationenAddOn InfoAddOnParameter,
			TemplateElementManagement ConnectedTemplateElementManagement, TemplateManagement.AuswahlSelection EntriesToShow,
			TemplateManagement.AuswahlSortOrder SortOrder)
			{
			SortingItemsForSelection =
				TemplateManagement.GetInterface [InfoAddOnParameter.Tabelle].GetSortingItemsForSelection ();
			ItemsToSelectForSelection = 
				TemplateManagement.GetInterface [InfoAddOnParameter.Tabelle].GetItemsToSelectForSelection ();
			ViewNameForSelection =
				TemplateManagement.GetInterface [InfoAddOnParameter.Tabelle].GetViewNameForSelection ();
			ItemsToFillHinweisColumn =
				TemplateManagement.GetInterface [InfoAddOnParameter.Tabelle].GetItemsToFillHinweisColumn ();

			if ((SortingItemsForSelection.Length == 0)
				&& (ItemsToSelectForSelection.Length == 0)
				&& (ItemsToFillHinweisColumn.Length == 0)
				&& (String.IsNullOrEmpty (ViewNameForSelection)))
				return null;
			switch (EntriesToShow)
				{
				case TemplateManagement.AuswahlSelection.AllFromType:
					{
					return LoadTypeSelectionData (InfoAddOnParameter, BereichToUse,
						ConnectedTemplateElementManagement.ParentTemplateRuntime.TypID, EntriesToShow, SortOrder);
					}
					break;
				case TemplateManagement.AuswahlSelection.Used:
				case TemplateManagement.AuswahlSelection.My:
					{
					return LoadMyOrUsedSelectionData (InfoAddOnParameter, BereichToUse, EntriesToShow, SortOrder);
					}
					break;
				case TemplateManagement.AuswahlSelection.All:
					{
					return LoadAllSelectionData (InfoAddOnParameter, BereichToUse);
					}
					break;
				}
			return null;

			}
Esempio n. 5
0
		public List<SelectionDataClass> GetSelectionData (String BereichToUse, String ActiveUser, InformationenAddOn InfoAddOnParameter,
			TemplateElementManagement ConnectedTemplateElementManagement, TemplateManagement.AuswahlSelection EntriesToShow,
			TemplateManagement.AuswahlSortOrder SortOrder)
			{
			AltErlaaInfoEntities WebAccess = new AltErlaaInfoEntities ();
			IQueryable<Timings> TimingsDaten = from Tim in WebAccess.Timings
											   where Tim.ConnectedID == InfoAddOnParameter.InformationenID
												orderby Tim.TimeA descending 
												select Tim;

			List<SelectionDataClass> Result = new List<SelectionDataClass> ();
			foreach (Timings SelectionEntry in TimingsDaten)
				{
				SelectionDataClass SelectionData = new SelectionDataClass ();
				SelectionData.ID = SelectionEntry.TimingsID;
				SelectionData.ZurAuswahl = FormatFreitext (SelectionEntry, FreiTextFormat.Full);
				Result.Add (SelectionData);
				}
			return Result;
			}
Esempio n. 6
0
		public DataCollection<SelectionDataClass> GetSelectionData(
			TemplateManagement.AuswahlSelection EntriesToShow,
			TemplateManagement.AuswahlSortOrder SortOrder)
			{

			if ((SortingItemsForSelection.Length == 0)
				&& (ItemsToSelectForSelection.Length == 0)
				&& (ItemsToFillHinweisColumn.Length == 0)
				&& (String.IsNullOrEmpty(ViewNameForSelection)))
				return null;
			switch (EntriesToShow)
				{
				case TemplateManagement.AuswahlSelection.AllFromType:
					{
					if (TypeToProcess == null)
						return null;
					return LoadTypeSelectionData(EntriesToShow, SortOrder);
					}
					break;
				case TemplateManagement.AuswahlSelection.Used:
				case TemplateManagement.AuswahlSelection.My:
						{
						return LoadMyOrUsedSelectionData(EntriesToShow, SortOrder);
						}
					break;
				case TemplateManagement.AuswahlSelection.All:
						{
						return LoadAllSelectionData();
						}
					break;
				}
			return null;

			}
Esempio n. 7
0
		public CombinedSelectionAndSortOrderEnum GetFinalSelectionAndSortCriteria
			(TemplateManagement.AuswahlSelection EntriesToShow, TemplateManagement.AuswahlSortOrder SortOrder)
			{
			switch (EntriesToShow)
				{
				case TemplateManagement.AuswahlSelection.My:
					if (SortOrder == TemplateManagement.AuswahlSortOrder.Alphabetic)
						return CombinedSelectionAndSortOrderEnum.MyEntriesOrderByAlphabet;
					else
						return CombinedSelectionAndSortOrderEnum.MyEntriesOrderByOccurence;
					break;
				case TemplateManagement.AuswahlSelection.AllFromType:
					if (SortOrder == TemplateManagement.AuswahlSortOrder.Alphabetic)
						return CombinedSelectionAndSortOrderEnum.TypEntriesOrderByAlphabet;
					else
						return CombinedSelectionAndSortOrderEnum.TypEntriesOrderByOccurence;
					break;
				case TemplateManagement.AuswahlSelection.Used:

					if (SortOrder == TemplateManagement.AuswahlSortOrder.Alphabetic)
						return CombinedSelectionAndSortOrderEnum.UsedEntriesOrderByAlphabet;
					else
						return CombinedSelectionAndSortOrderEnum.UsedEntriesOrderByOccurence;
					break;
				case TemplateManagement.AuswahlSelection.All:
					return CombinedSelectionAndSortOrderEnum.AllEntriesOrderByAlphabet;
					break;
				}
			return CombinedSelectionAndSortOrderEnum.AllEntriesOrderByAlphabet;
			}
Esempio n. 8
0
		public bool Create(TemplateManagement.AuswahlSelection EntriesToShow, TemplateManagement.AuswahlSortOrder SortOrder)
			{


			TemplateManagement.AuswahlSortOrder SortOrderUsed = TemplateManagement.AuswahlSortOrder.Alphabetic;
			if (SelectionData != null)
				SelectionData.Clear();
			while (((SelectionData == null)
				|| (SelectionData.Count == 0))
				&& (MultipleAuswahlEntries.Count > 0))
				{
				if (MultipleAuswahlEntries.Contains(EntriesToShow))
					MultipleAuswahlEntries.Remove(EntriesToShow);
				else
					{
					EntriesToShow = MultipleAuswahlEntries[0];
					MultipleAuswahlEntries.RemoveAt(0);
					}
				if (EntriesToShow == TemplateManagement.AuswahlSelection.All)
					SortOrderUsed = TemplateManagement.AuswahlSortOrder.Alphabetic;
				else
					SortOrderUsed = SortOrder;
				SelectionData = GetSelectionData (EntriesToShow, SortOrderUsed);
				if (SelectionData == null)
					return false;
				}

			
			if (SelectionData == null)
				return false;
			if (SelectionData.Count == 0)
				return false;
			return true;
			}