Exemplo n.º 1
0
        public String CreateMultiProjectProjectFolder(DbEntities.dbserver3.wordup.rows.Projekt[] ProjectsToCreate,
            String TargetDirectory, String Description, String FileNameElement = "")
            {
            //String ProjectFolderBaseDirectory = Basics.Instance.ProjektMaterialDirectory;
            //String OrteFolderBaseDirectory = Basics.Instance.OrtsMaterialDirectory;
            String FileName = String.Empty;
            if (String.IsNullOrEmpty(FileNameElement))
                FileName = Path.Combine(TargetDirectory,
                    "ProjektMappe_" + DateTime.Now.ToString("yyyy-MMM-dd_HH_mm") + ".pdf");
            else
                FileName = Path.Combine(TargetDirectory,
                    WMB.Basics.ConvertToCorrectFileNameElement(FileNameElement) + ".pdf");
	        Guid OldOrteID = Guid.Empty;
            List<Object> ResultetObjectsToPrint = new List<Object>();

			foreach (DbEntities.dbserver3.wordup.rows.Projekt projectEntry in ProjectsToCreate)
                {
                PlanungPrint planungPrint = new PlanungPrint(projectEntry)
					{
					PageBreakAllowedBefore = true
					};
				ResultetObjectsToPrint.Add(planungPrint);
				planungPrint.MaximalWMUValue = Data.DbServer3.WordUp.Projekte.WMUDistribution.Keys.Max();
				planungPrint.MaximalWSPLakateValue = Data.DbServer3.WordUp.Projekte.WSPlakateDistribution.Keys.Max();
				planungPrint.MaximalWertigkeitValue = Data.DbServer3.WordUp.Projekte.WertigkeitValueDistribution.Keys.Max();
				ResultetObjectsToPrint.Add(new HeadLinePrint("Bemerkungen:", "SubSubSub"));
				foreach (Aktivitaet aktivitaet in projectEntry.Aktivitaeten)
	                {
					ResultetObjectsToPrint.Add(new AktivitaetenPrint(aktivitaet)
						{
						
						});
					}
				ResultetObjectsToPrint.Add(new HeadLinePrint("Ideen", "SubSubSub"));
				foreach (WSPlakat wsPlakat in projectEntry.WSPlakate)
	                {
					ResultetObjectsToPrint.Add(new IdeePrint(wsPlakat)
						{}
					);
                    }
                foreach (ProjektZuTermin projektZuTermin in Data.DbServer3.WordUp.ProjekteZuTerminen.Find_By_ProjekteId(projectEntry.Id) )
	                {
					TerminPrint TerminRoot = new TerminPrint(projektZuTermin.Termin);
					ResultetObjectsToPrint.Add(TerminRoot);
					bool firstTeam = true;
					bool firstVertreter = true;
					foreach (PersonZuTermin PersonZuTerminEntry in Data.DbServer3.WordUp.PersonenZuTerminen
						.FindOrLoad_ActivePersonenZuTerminen(projektZuTermin.Termin.Id)
						.Where(sel => Data.DbServer3.WordUp.Typen.AllTypIDsForBetreuer.Contains((Guid)sel.PersonenTypId)))
						{
						if (firstTeam)
							{
							ResultetObjectsToPrint.Add(new HeadLinePrint("Betreuer", "Sub")
								{ PageBreakAllowedBefore = true, BorderPadding = new Thickness(40, 10, 0, 0) });
							firstTeam = false;
							}
						TeamPersonPrint TeamPerson = new TeamPersonPrint(PersonZuTerminEntry);
						TeamPerson.BorderPadding = new Thickness(40, 0, 0, 0);

						ResultetObjectsToPrint.Add(TeamPerson);
						}
					foreach (PersonZuTermin PersonZuTerminEntry in Data.DbServer3.WordUp.PersonenZuTerminen
						.FindOrLoad_ActivePersonenZuTerminen(projektZuTermin.Termin.Id)
						.Where(sel => Data.DbServer3.WordUp.Typen.AllTypIDsForVertreter.Contains((Guid)sel.PersonenTypId)))
						{
						if (firstVertreter)
							{
							ResultetObjectsToPrint.Add(new HeadLinePrint("VertreterInnen", "Sub")
								{ PageBreakAllowedBefore = true, BorderPadding = new Thickness(40, 10, 0, 0) });
							firstVertreter = false;
							}
						VertreterPersonPrint VertreterPerson = new VertreterPersonPrint(PersonZuTerminEntry);
						VertreterPerson.BorderPadding = new Thickness(40, 0, 0, 0);
						ResultetObjectsToPrint.Add(VertreterPerson);

						}


					}
				if (projectEntry.Ort.Id != OldOrteID)
                    {
                    OldOrteID = projectEntry.Ort.Id;
                    ResultetObjectsToPrint.AddRange(DataWrapper.Instance.CreateTreeForOrtePictures
                        (projectEntry));
                    }

                }

            XAMLPrintoutDefinitions.PrintFileCards PicturePrintHandler = new XAMLPrintoutDefinitions.PrintFileCards();
            return PicturePrintHandler.PrintProjektMapData(ResultetObjectsToPrint, FileName, Description);
            }
Exemplo n.º 2
0
        public List<Object> CreatePersonenTreeForSpecialSortField(List<Guid> TypListToSelect,
			String ItemNameToPageBreakBefore, String ItemNameToGroup)
            {
            List<Object> CollectionOfClassesToPrint = new List<object>();

            String PageBreakContent = String.Empty;
            bool FirstPageBreakContent = true;
            String GroupBreakContent = String.Empty;
            bool FirstGroupBreakContent = true;
            String SubGroupBreakContent = String.Empty;
            bool FirstSubGroupBreakContent = true;
	        PersonenZuWordUpID[] PersonenEntries;
	        if ((ItemNameToPageBreakBefore == "CodeName") // Vertreter pro Klasse - KlassenListe
	            && (ItemNameToGroup == "PersonenTyp"))
		        {
		        foreach (Organisation Schule in Data.DbServer3.WordUp.Organisationen.AktuelleSchulen)
			        {
			        if (FirstPageBreakContent)
				        {
				        CollectionOfClassesToPrint.Add(new HeadLinePrint(Schule.CodeName + " " + Schule.Beschreibung, "Main")
					        {
					        PageBreakAllowedBefore = true,
					        AdditionalTopDistance = 10
					        });
				        FirstPageBreakContent = false;
				        }
			        else
				        CollectionOfClassesToPrint.Add(new HeadLinePrint(Schule.CodeName + " " + Schule.Beschreibung, "Main")
					        {
					        PageBreakAllowedBefore = true,
					        PageBreakBeforeRequested = true,
					        AdditionalTopDistance = 10
					        });
			        GroupBreakContent = String.Empty;
			        FirstGroupBreakContent = true;
			        foreach (Organisation Klasse in Data.DbServer3.WordUp.Organisationen.AktuelleKlassen
				        .Where(kla => kla.ParentOrganisationsId == Schule.Id))
				        {
				        CollectionOfClassesToPrint.Add(new HeadLinePrint(Klasse.CodeName, "Sub")
					        {
					        PageBreakAllowedBefore = true,
					        PageBreakBeforeRequested = false,
					        AdditionalTopDistance = 10
					        });

				        foreach (DbEntities.dbserver3.wordup.rows.PersonZuWordUpID ConnectorEntry in
					        Data.DbServer3.WordUp.PersonenZuWordUpID
						        .Find_TypedPersonenInOrganisationsID(TypListToSelect, Klasse.Id))
					        {
					        if ((ConnectorEntry.Typ.TypNameId == "Vorsteher")
					            || (ConnectorEntry.Typ.TypNameId == "Rat")
					            || (ConnectorEntry.Typ.TypNameId == "Stellvertreter"))
						        {
						        VertreterPersonPrint PersonPrint = new VertreterPersonPrint(ConnectorEntry);
						        PersonPrint.BorderPadding = new Thickness(50, 0, 0, 0);
						        PersonPrint.PageBreakAllowedBefore = true;
						        CollectionOfClassesToPrint.Add(PersonPrint);
						        }
					        else
						        {
						        TeamPersonPrint PersonPrint = new TeamPersonPrint(ConnectorEntry);
						        PersonPrint.BorderPadding = new Thickness(50, 0, 0, 0);
						        PersonPrint.PageBreakAllowedBefore = true;
						        CollectionOfClassesToPrint.Add(PersonPrint);
						        }

					        }

				        }
			        }
		        }
	        if ((ItemNameToPageBreakBefore == "Gruppe") // Vertreter aus allen Klassen pro Klasse - KlassenListe
		            && (ItemNameToGroup == "PersonenTyp"))
		        {
		        String HeadLineAddOn = Data.DbServer3.WordUp.Typen.Find(TypListToSelect[0]).TypNameId;
			        foreach (Guid TypeGuid in TypListToSelect)
				        {
				        DbEntities.dbserver3.wordup.rows.Typ ActuallType = Data.DbServer3.WordUp.Typen.Find(TypeGuid);
				        if (FirstPageBreakContent)
					        {
					        CollectionOfClassesToPrint.Add(new HeadLinePrint(ActuallType.TypNameId, "Main")
						        {
						        PageBreakAllowedBefore = true,
						        AdditionalTopDistance = 10
						        });
					        FirstPageBreakContent = false;
					        }
				        else
					        CollectionOfClassesToPrint.Add(new HeadLinePrint(ActuallType.TypNameId, "Main")
						        {
						        PageBreakAllowedBefore = true,
						        PageBreakBeforeRequested = true,
						        AdditionalTopDistance = 10
						        });
				        GroupBreakContent = System.String.Empty;
				        FirstGroupBreakContent = true;
					    foreach (DbEntities.dbserver3.wordup.rows.PersonZuWordUpID ConnectorEntry in
						    Data.DbServer3.WordUp.PersonenZuWordUpID
							    .Find_TypedPersonen(new List<Guid>() { TypeGuid }).OrderBy(ent => ent.Person.FamilienName))
						    {
						    if ((ConnectorEntry.Typ.TypNameId == "Vorsteher")
						        || (ConnectorEntry.Typ.TypNameId == "Rat")
						        || (ConnectorEntry.Typ.TypNameId == "Stellvertreter"))
							    {
							    VertreterPersonPrint PersonPrint = new VertreterPersonPrint(ConnectorEntry);
							    PersonPrint.BorderPadding = new Thickness(50, 0, 0, 0);
							    PersonPrint.PageBreakAllowedBefore = true;
							    CollectionOfClassesToPrint.Add(PersonPrint);
							    }
						    else
							    {
							    TeamPersonPrint PersonPrint = new TeamPersonPrint(ConnectorEntry);
							    PersonPrint.BorderPadding = new Thickness(50, 0, 0, 0);
							    PersonPrint.PageBreakAllowedBefore = true;
							    CollectionOfClassesToPrint.Add(PersonPrint);
							    }

						    }

				        }
			        }

				

				return CollectionOfClassesToPrint;
            }
Exemplo n.º 3
0
        public List<Object> CreateTreeForTerminData(Termin TerminEntry, String SecurityGroup)
            {
            List<Object> CollectionOfClassesToPrint = new List<object>();
            String TerminID = TerminEntry.Id.ToString();
            TerminPrint TerminRoot = new TerminPrint(TerminEntry);
            CollectionOfClassesToPrint.Add(TerminRoot);
            bool firstTeam = true;
            bool firstVertreter = true;
			bool firstProjekt = true;
			foreach (PersonZuTermin PersonZuTerminEntry in Data.DbServer3.WordUp.PersonenZuTerminen
		        .FindOrLoad_ActivePersonenZuTerminen(TerminEntry.Id)
		        .Where(sel => Data.DbServer3.WordUp.Typen.AllTypIDsForBetreuer.Contains((Guid) sel.PersonenTypId)))
		        {
		        if (firstTeam)
			        {
			        CollectionOfClassesToPrint.Add(new HeadLinePrint("Betreuer", "Sub")
				        {PageBreakAllowedBefore = true, BorderPadding = new Thickness(40, 10, 0, 0)});
			        firstTeam = false;
			        }
		        TeamPersonPrint TeamPerson = new TeamPersonPrint(PersonZuTerminEntry);
		        TeamPerson.BorderPadding = new Thickness(40, 0, 0, 0);

		        CollectionOfClassesToPrint.Add(TeamPerson);
		        }
			foreach (PersonZuTermin PersonZuTerminEntry in Data.DbServer3.WordUp.PersonenZuTerminen
				.FindOrLoad_ActivePersonenZuTerminen(TerminEntry.Id)
				.Where(sel => Data.DbServer3.WordUp.Typen.AllTypIDsForVertreter.Contains((Guid)sel.PersonenTypId)))
				{
				if (firstVertreter)
                    {
                    CollectionOfClassesToPrint.Add(new HeadLinePrint("VertreterInnen", "Sub")
                        {PageBreakAllowedBefore = true, BorderPadding = new Thickness(40, 10, 0, 0)});
                    firstVertreter = false;
                    }
                VertreterPersonPrint VertreterPerson = new VertreterPersonPrint(PersonZuTerminEntry);
                VertreterPerson.BorderPadding = new Thickness(40, 0, 0, 0);
                CollectionOfClassesToPrint.Add(VertreterPerson);
                        
                }

            foreach (ProjektZuTermin projektZuTerminEntry in Data.DbServer3.WordUp.ProjekteZuTerminen.Collection
                                        .Where(sel => sel.TermineId == TerminEntry.Id
											&& sel.Projekt.WordUpRootId == Data.DbServer3.WordUp.WordUpIDGuid))
                {
                if (firstProjekt)
                    {
                    CollectionOfClassesToPrint.Add(
                        new HeadLinePrint("Zu behandelnde Planungen/Projekte bei diesem Termin", "Sub")
                            {
                            PageBreakAllowedBefore = true,
                            BorderPadding = new Thickness(40, 10, 0, 0)
                            });
                    }
                CreateAllForOneProjectToPrint(Basics.DataSelection.Planungen, CollectionOfClassesToPrint,
							projektZuTerminEntry.Projekt, ref firstProjekt, true, true, false,
                    true, SecurityGroup);
                }
            return CollectionOfClassesToPrint;
            }
Exemplo n.º 4
0
		public List<Object> CreateTreeForArbeitsGruppenPersonen(String ArbeitsGruppenNameIDSelectionCriteria)
            {
            String OldAGNameID = String.Empty;
            String OldPersonenInDerAGTyp = String.Empty;
            List<Object> CollectionOfClassesToPrint = new List<object>();
            bool FirstPersonenGruppe = false;

            foreach (PersonZuArbeitsGruppe ArbeitsGruppenEntry in Data.DbServer3.WordUp.PersonenZuArbeitsGruppen
							.FindOrLoad_ActivePersonZuArbeitsGruppenEntries())
                {
                if (ArbeitsGruppenEntry.ArbeitsGruppe.NameId != OldAGNameID)
                    {
                    OldAGNameID = ArbeitsGruppenEntry.ArbeitsGruppe.NameId;
                    String Beschreibung = ArbeitsGruppenEntry.ArbeitsGruppe.Beschreibung;
                    CollectionOfClassesToPrint.Add(new HeadLinePrint(OldAGNameID + " " + Beschreibung, "Main")
                        {PageBreakAllowedBefore = true, AdditionalTopDistance = 10});
                    OldPersonenInDerAGTyp = String.Empty;
                    FirstPersonenGruppe = true;
                    }
                if (ArbeitsGruppenEntry.Typ.TypNameId != OldPersonenInDerAGTyp)
                    {
                    OldPersonenInDerAGTyp = ArbeitsGruppenEntry.Typ.TypNameId;
                    if (FirstPersonenGruppe)
                        {
                        CollectionOfClassesToPrint.Add(new HeadLinePrint(ArbeitsGruppenEntry.Typ.TypNameId, "Sub")
                            {AdditionalTopDistance = 10});
                        FirstPersonenGruppe = false;
                        }
                    else
                        CollectionOfClassesToPrint.Add(new HeadLinePrint(OldPersonenInDerAGTyp, "Sub")
                            {
                            PageBreakAllowedBefore = true,
                            AdditionalTopDistance = 10
                            });
                    }
                if ((OldPersonenInDerAGTyp == "AG Mitglied")
                    || (OldPersonenInDerAGTyp == "Plenumssprecher"))
                    {
                    VertreterPersonPrint PersonPrint = new VertreterPersonPrint(ArbeitsGruppenEntry);
                    PersonPrint.BorderPadding = new Thickness(50, 0, 0, 0);
                    CollectionOfClassesToPrint.Add(PersonPrint);
                    }
                else
                    {
                    TeamPersonPrint PersonPrint = new TeamPersonPrint(ArbeitsGruppenEntry);
                    PersonPrint.BorderPadding = new Thickness(50, 0, 0, 0);
                    CollectionOfClassesToPrint.Add(PersonPrint);
                    }
                }


            return CollectionOfClassesToPrint;
            }