Exemple #1
0
        private Dictionary<String, Dictionary<String, String>> CreateCommonPersonenListings
            (List<Guid> TypListToSelect, String OutputFileName, String HeadLine,
                String ItemToPageBreakBy, String ItemToGroupBy)
            {

            Dictionary<String, Dictionary<String, String>> Result = new Dictionary<String, Dictionary<String, String>>();
            XAMLPrintoutDefinitions.PrintFileCards PrintHandler = new XAMLPrintoutDefinitions.PrintFileCards();
            List<Object> CollectionOfClassesToPrint = DataWrapper.Instance.CreatePersonenTreeForSpecialSortField
                (TypListToSelect, ItemToPageBreakBy, ItemToGroupBy);
            PrintHandler.PrintSimpleFormattedArbeitsGruppenPersonenProjekte(CollectionOfClassesToPrint,
                OutputFileName, HeadLine);
            return Result;
            }
Exemple #2
0
        private Dictionary<String, Dictionary<String, String>> CreateSpecialFormattedPersonenPrintOuts
            (String OutputFileName, String HeadLine, List<String> FixTexte)
            {
            String AktuellerFixText = FixTexte[0];
            Cursor = Cursors.Wait;
            Dictionary<String, Dictionary<String, String>> Result = new Dictionary<String, Dictionary<String, String>>();

// all Data (Vorstände, Stellvertreter und Räte

            List<List<Guid>> TypenList = new List<List<Guid>>()
                {
                new List<Guid>()
                    {
                    PersonenTypen.Vorsteher,
                    PersonenTypen.Stellvertreter,
                    PersonenTypen.Rat
                    },
                new List<Guid>()
                    {
                    PersonenTypen.Vorsteher,
                    PersonenTypen.Stellvertreter
                    },
                new List<Guid>()
                    {
                    PersonenTypen.Vorsteher
                    }
                };
            List<String> Headlines = new List<String>()
                {
                "Vorsteher, Stellvertreter und Räte",
                "Vorsteher und Stellvertreter",
                "Vorsteher"
                };
            List<String> FileIDs = new List<String>()
                {
                "_VSR",
                "_VS",
                "_V"
                };

            int RuntimeIndex = 0;
            while (RuntimeIndex < FileIDs.Count)
                {
				List<Guid> VertreterTypen = null;
                switch (RuntimeIndex)
	                {
		                case 0:
			                VertreterTypen = new List<Guid>()
				                {
				                PersonenTypen.Vorsteher,
				                PersonenTypen.Stellvertreter,
				                PersonenTypen.Rat
				                };
			                break;
		                case 1:
			                VertreterTypen = new List<Guid>()
				                {
				                PersonenTypen.Vorsteher,
				                PersonenTypen.Stellvertreter
				                };
			                break;
		                case 2:
			                VertreterTypen = new List<Guid>()
				                {
				                PersonenTypen.Vorsteher
				                };
			                break;
	                }

				PersonZuWordUpID[] PersonenZuWordUpIDs = Data.DbServer3.WordUp
					.PersonenZuWordUpID.Find_TypedPersonen(TypenList[RuntimeIndex])
					.Where(ent => ent.Organisation.OrganisationenTypId == OrganisationenTypen.Klasse)
							.OrderBy(ent => ent.Organisation.CodeName)
							.ThenByDescending(ent => ent.Person.FamilienName).ToArray();

               XAMLPrintoutDefinitions.PrintFileCards PrintHandler = new XAMLPrintoutDefinitions.PrintFileCards();

				List<Object> CollectionOfClassesToPrint =
                    DataWrapper.Instance.CreateTreeForAnwesenheitsListen(VertreterTypen);
                PrintHandler.PrintSimpleFormattedArbeitsGruppenPersonenProjekte(CollectionOfClassesToPrint,
                    String.Format(OutputFileName, "_AnwesenheitsListe" + FileIDs[RuntimeIndex]),
                    "Anwesenheitsliste für " + Headlines[RuntimeIndex] + "\r\n" + HeadLine, "Landscape");
				
				CollectionOfClassesToPrint =
					DataWrapper.Instance.CreateTreeForZeitGutScheine(VertreterTypen, AktuellerFixText, true);
				PrintHandler.PrintSimpleFormattedArbeitsGruppenPersonenProjekte(CollectionOfClassesToPrint,
					String.Format(OutputFileName, "_Zeitgutschein_Signed" + FileIDs[RuntimeIndex]),
					"Zeitgutscheine für " + Headlines[RuntimeIndex] + "\r\n" + HeadLine);

				CollectionOfClassesToPrint =
					DataWrapper.Instance.CreateTreeForZeitGutScheine(VertreterTypen, AktuellerFixText, false);
				PrintHandler.PrintSimpleFormattedArbeitsGruppenPersonenProjekte(CollectionOfClassesToPrint,
					String.Format(OutputFileName, "_Zeitgutschein_UnSigned" + FileIDs[RuntimeIndex]),
					"Zeitgutscheine für " + Headlines[RuntimeIndex] + "\r\n" + HeadLine);
				

				RuntimeIndex++;
                }


            Cursor = Cursors.Arrow;
            return Result;
            }
Exemple #3
0
 private Dictionary<String, Dictionary<String, String>> CreateProjectListOAP
     (IEnumerable<DbEntities.dbserver3.wordup.rows.Projekt> SortableProjekte, Basics.DataSelection Phase,
         String PrintThisSecurityGroup, String OutputFileName, String HeadLine,
         bool WithOrWithoutPlakate, bool WithOrWithoutActivities, bool WithOrWithoutTermine)
     {
     Dictionary<String, Dictionary<String, String>> Result = new Dictionary<String, Dictionary<String, String>>();
     XAMLPrintoutDefinitions.PrintFileCards PrintHandler = new XAMLPrintoutDefinitions.PrintFileCards();
     List<Object> CollectionOfClassesToPrint = DataWrapper.Instance.CreateTreeForProjectListingsAG
         (Phase, SortableProjekte, WithOrWithoutPlakate, WithOrWithoutActivities, WithOrWithoutTermine,
             true, PrintThisSecurityGroup);
     PrintHandler.PrintSimpleFormattedArbeitsGruppenPersonenProjekte(CollectionOfClassesToPrint,
         OutputFileName, HeadLine);
     return Result;
     }
Exemple #4
0
        private Dictionary<String, Dictionary<String, String>> CreateProjectListOAPGetrennt
            (IEnumerable<DbEntities.dbserver3.wordup.rows.Projekt> SortableProjekte, Basics.DataSelection RequestedPhase,
                String PrintThisSecurityGroup, String OutputFileName, String HeadLine,
                bool WithOrWithoutPlakate, bool WithOrWithoutActivities, bool WithOrWithoutTermine)
            {
            Dictionary<String, Dictionary<String, String>> Result = new Dictionary<String, Dictionary<String, String>>();
            XAMLPrintoutDefinitions.PrintFileCards PrintHandler = new XAMLPrintoutDefinitions.PrintFileCards();

            foreach (
                DbEntities.dbserver3.wordup.rows.ArbeitsGruppe AGEntry in Data.DbServer3.WordUp.ArbeitsGruppen.Collection
                    .Where(Entry => Entry.WordUpRootId == Guid.Parse(Data.DbServer3.WordUp.WordUpID))
                    .OrderBy(Entry => Entry.NameId))
                {
                String AG = AGEntry.NameId;
                String AGID = AGEntry.Id.ToString().ToLower();
                String Ortsteile = AGEntry.AktuallOrtsTeile;
                String AGFileName = OutputFileName.Replace(".pdf", "_" + AG + ".pdf");
                String AGTitle = AG + " - " + Ortsteile + "\r\n" + HeadLine;
                Result[AG] = new Dictionary<String, String>();
                Result[AG][AGID] = AGFileName + ";" + AGTitle;

                List<Object> PrintableProjektePerAG = DataWrapper.Instance.CreateTreeForArbeitsGruppenProjekte
                    (RequestedPhase, AG,
						SortableProjekte.Where(whe => whe.Ort.OrtsTeil.AktuallArbeitsGruppe.NameId == AG),
						PrintThisSecurityGroup, WithOrWithoutPlakate,
                        WithOrWithoutActivities, WithOrWithoutTermine);
                String CreatedProjekteFileName = PrintHandler.PrintSimpleFormattedArbeitsGruppenPersonenProjekte
                    (PrintableProjektePerAG, AGFileName, AGTitle);
                }

            return Result;
            }
Exemple #5
0
	    private void CreateCounterProArbeitsGruppe(String TargetDirectory)
		    {
			List<Object> CollectionOfClassesToPrint = new List<object>();
			XAMLPrintoutDefinitions.PrintFileCards PrintHandler = new XAMLPrintoutDefinitions.PrintFileCards();
			StatistikCounters AllCounter = new StatistikCounters(Data.DbServer3);
		    foreach (WordUpRoot wordUpRoot in AllCounter.AllRoots.Keys.OrderByDescending(ord => ord.NameId))
			    {
				if (AllCounter.AllRoots.ContainsKey(wordUpRoot))
					{
					List<StatistikCounter> counterSet = AllCounter.AllRoots[wordUpRoot];
					foreach (StatistikCounter statistikCounter in counterSet)
						{
						CollectionOfClassesToPrint.Add(statistikCounter);
//						statistikCounter.DebugValues();
						}
					}

			    if (AllCounter.AllWordUps.ContainsKey(wordUpRoot))
				    {
				    List<StatistikCounter> summenCounterSet = AllCounter.AllWordUps[wordUpRoot];
				    foreach (StatistikCounter statistikCounter in summenCounterSet)
					    {
					    CollectionOfClassesToPrint.Add(statistikCounter);
//						statistikCounter.DebugValues();
						}
					}

				if (AllCounter.AllWordUpAGs.ContainsKey(wordUpRoot))
				    {
				    List<StatistikCounter> agCounterSet = AllCounter.AllWordUpAGs[wordUpRoot];
				    foreach (StatistikCounter statistikCounter in agCounterSet)
					    {
					    CollectionOfClassesToPrint.Add(statistikCounter);
//						statistikCounter.DebugValues();
						}
					}

				}
		    String OutputFileName = Path.Combine(TargetDirectory, "VorschlagUndIdeenVerteilung" + ".pdf");
			if (!Directory.Exists(TargetDirectory))
				Directory.CreateDirectory(TargetDirectory);
			String HeadLine = "Verteilung der Vorschläge und Ideen über die Jahre";
			PrintHandler.PrintSimpleFormattedArbeitsGruppenPersonenProjekte(CollectionOfClassesToPrint,
				OutputFileName, HeadLine);
			}
Exemple #6
0
 private Dictionary<String, Dictionary<String, String>> CreateProjectListNumericID
     (IEnumerable<DbEntities.dbserver3.wordup.rows.Projekt> SortableProjekte, Basics.DataSelection Phase,
         String PrintThisSecurityGroup, String OutputFileName, String HeadLine,
         bool WithOrWithoutPlakate, bool WithOrWithoutActivities, bool WithOrWithoutTermine)
     {
     Dictionary<String, Dictionary<String, String>> Result = new Dictionary<String, Dictionary<String, String>>();
     List<Object> CollectionOfClassesToPrint = new List<object>();
     bool FirstProjektInProjektOrt = true;
     foreach (DbEntities.dbserver3.wordup.rows.Projekt ProjektEntry in SortableProjekte)
         {
         DataWrapper.Instance.CreateAllForOneProjectToPrint(Phase, CollectionOfClassesToPrint,
             ProjektEntry, ref FirstProjektInProjektOrt,
             WithOrWithoutPlakate, WithOrWithoutActivities, WithOrWithoutTermine,
             true, PrintThisSecurityGroup);
         }
     XAMLPrintoutDefinitions.PrintFileCards PrintHandler = new XAMLPrintoutDefinitions.PrintFileCards();
     PrintHandler.PrintSimpleFormattedArbeitsGruppenPersonenProjekte(CollectionOfClassesToPrint,
         OutputFileName, HeadLine);
     return Result;
     }
Exemple #7
0
        private void CreateProjectListNumericID(IEnumerable<DbEntities.dbserver3.wordup.rows.Projekt> SortableProjekte,
            Basics.DataSelection Phase, String PrintThisSecurityGroup, String GroupingInfo)
            {
            if (!Directory.Exists(DataWrapper.Instance.TargetDirectory + "\\ProjektListings\\Numeric"))
                Directory.CreateDirectory(DataWrapper.Instance.TargetDirectory + "\\ProjektListings\\Numeric");

            String OutputFileName =
                System.IO.Path.Combine(DataWrapper.Instance.TargetDirectory + "\\ProjektListings\\Numeric",
                    "Stand_" + DataWrapper.Instance.RuntimeEnvironmentShortText + "_"
                    + Enum.GetName(typeof (Basics.DataSelection), Phase) + "_" + PrintThisSecurityGroup
                    + "_" + GroupingInfo + ".pdf");
            List<Object> CollectionOfClassesToPrint = new List<object>();
            bool FirstProjektInProjektOrt = true;
            foreach (DbEntities.dbserver3.wordup.rows.Projekt ProjektEntry in SortableProjekte)
                {
                DataWrapper.Instance.CreateAllForOneProjectToPrint(Phase, CollectionOfClassesToPrint, ProjektEntry,
                    ref FirstProjektInProjektOrt,
                    true, true, true, true, PrintThisSecurityGroup);
                }
            XAMLPrintoutDefinitions.PrintFileCards PrintHandler = new XAMLPrintoutDefinitions.PrintFileCards();
            String HeadLine = "Projektliste \"" + WordUpName + "\" sortiert \"" + GroupingInfo + "\"\r\n"
                              + Enum.GetName(typeof (Basics.DataSelection), Phase) + " Stand " +
                              DateTime.Now.ToString("ddd. dd.MMM yyyy HH:mm") + " (incl. Ideen)";

            PrintHandler.PrintSimpleFormattedArbeitsGruppenPersonenProjekte(CollectionOfClassesToPrint, OutputFileName,
                HeadLine);

            OutputFileName = System.IO.Path.Combine(DataWrapper.Instance.TargetDirectory + "\\ProjektListings\\Numeric",
                "Stand_" + DataWrapper.Instance.RuntimeEnvironmentShortText + "_"
                + Enum.GetName(typeof (Basics.DataSelection), Phase) + "_" + PrintThisSecurityGroup
                + "_" + GroupingInfo + "_OhnePlakate.pdf");
            CollectionOfClassesToPrint.Clear();
            foreach (DbEntities.dbserver3.wordup.rows.Projekt ProjektEntry in SortableProjekte)
                {
                DataWrapper.Instance.CreateAllForOneProjectToPrint(Phase, CollectionOfClassesToPrint, ProjektEntry,
                    ref FirstProjektInProjektOrt,
                    false, true, true, true, PrintThisSecurityGroup);
                }
            HeadLine = "Projektliste \"" + WordUpName + "\" sortiert \"" + GroupingInfo + "\"\r\n"
                       + Enum.GetName(typeof (Basics.DataSelection), Phase) + " Stand " +
                       DateTime.Now.ToString("ddd. dd.MMM yyyy HH:mm") + " (excl. Ideen)";

            PrintHandler.PrintSimpleFormattedArbeitsGruppenPersonenProjekte(CollectionOfClassesToPrint, OutputFileName,
                HeadLine);
            }
Exemple #8
0
		public void CreateProjectEvaluationCardsOrderByWMU(String TargetDirectory)
			{
			Cursor = Cursors.Wait;
			try
				{
				int MaximalWMUValue = Data.DbServer3.WordUp.Projekte.WMUDistribution.Keys.Max();
				int MaximalWSPLakateValue = Data.DbServer3.WordUp.Projekte.WSPlakateDistribution.Keys.Max();
				List<Guid?> OrteIDWithProjektenAndBezirkZustaendigkeit = Data.DbServer3.WordUp.Projekte.Collection
					.Where(proj => proj.WordUpRootId == Data.DbServer3.WordUp.WordUpIDGuid
									&& proj.ZustaendigId == Zustaendig.Bezirk)
										.Select(sel => sel.OrteId).Distinct().ToList();
				String IntermediateTargetDirectory = Path.Combine(TargetDirectory, "ArbeitsgruppenOrderedByWMU");
				foreach (DbEntities.dbserver3.wordup.rows.ArbeitsGruppe arbeitsGruppe
											in Data.DbServer3.WordUp.ArbeitsGruppen.Collection
												.Where(arg => arg.WordUpRootId == Data.DbServer3.WordUp.WordUpIDGuid
												&& arg.UseForProjects == "Ja")
												.OrderBy(ord => ord.NameId))
					{
					String FinalTargetDirectory = Path.Combine(IntermediateTargetDirectory, arbeitsGruppe.NameId);
					foreach (OrtsTeil ortsTeil in Data.DbServer3.WordUp.OrtsTeile.Collection
												.Where(sel => sel.AktuallArbeitsGruppe == arbeitsGruppe)
												.OrderBy(ord => ord.NameId))
						{
						XAMLPrintoutDefinitions.PrintFileCards PrintHandler = new XAMLPrintoutDefinitions.PrintFileCards();
						List<Object> CollectionOfClassesToPrint = new List<object>();
						foreach (DbEntities.dbserver3.wordup.rows.Projekt projekt in Data.DbServer3.WordUp.Projekte.Collection
							.Where(proj => OrteIDWithProjektenAndBezirkZustaendigkeit.Contains(proj.OrteId)
											&& proj.WordUpRootId == Data.DbServer3.WordUp.WordUpIDGuid
											&& proj.ZustaendigId == Zustaendig.Bezirk
											   && (proj.AmpelTypForThisProjekt == AktivitaetsTyp.AmpelTyp.Green
													|| proj.AmpelTypForThisProjekt == AktivitaetsTyp.AmpelTyp.Yellow)
											&& proj.Ort?.OrtsTeilId == ortsTeil.Id)
											.OrderByDescending(ord => ord.SummeWMU))
							{
							CollectionOfClassesToPrint.Add(new EvaluationCardPrint(projekt)
								{
								MaximalWMUValue = MaximalWMUValue,
								MaximalWSPLakateValue = MaximalWSPLakateValue
								});
							CollectionOfClassesToPrint.Add(new SchnittLinePrint());
							}
						String OutputFileName = Path.Combine(FinalTargetDirectory, ortsTeil.NameId + ".pdf");
						if (!Directory.Exists(FinalTargetDirectory))
							Directory.CreateDirectory(FinalTargetDirectory);
						String HeadLine = "Projekte der AG \"" + arbeitsGruppe.NameId + "\" im OrtsTeil \"" + ortsTeil.NameId + "\" bei " + Basics.Instance.WordUpName;
						PrintHandler.PrintSimpleFormattedArbeitsGruppenPersonenProjekte(CollectionOfClassesToPrint,
							OutputFileName, HeadLine);
						}
					}
				Cursor = Cursors.Arrow;
				}
			catch (Exception Excp)
				{
				System.Windows.MessageBox.Show("Fehler beim KartenDruck:\r\n" +
											   Excp.ToString());
				WMB.Basics.ReportErrorToEventViewer("Fehler beim KartenDruck:\r\n" +
													Excp.ToString());

				}

			}
Exemple #9
0
        private void ActualizeProjectFolder(String ProjectFolderBaseDirectory, String OrteFolderBaseDirectory)
            {
            DbEntities.dbserver3.wordup.rows.Projekt[] Projekte = Data.DbServer3.WordUp.Projekte.Find_PhasenCorrectProjekte
                (DataWrapper.Instance.WordUpPhase.ToString())
                .OrderBy(aG => aG.Ort?.OrtsTeil?.AktuallArbeitsGruppe?.NameId)
                .ToArray();
            String OldOrteID = String.Empty;
            foreach (DbEntities.dbserver3.wordup.rows.Projekt projectEntry in Projekte)
                {
                if (projectEntry.OrteId.ToString() != OldOrteID)
                    {
                    OldOrteID = projectEntry.OrteId.ToString();
                    String OrtsNameID = projectEntry.Ort.NameId;
                    List<Object> PicturesToPrint = null;		//DataWrapper.Instance.CreateTreeForOrtePictures (OrteFolderBaseDirectory, projectEntry);
                    String OrteDirectory = Path.Combine(OrteFolderBaseDirectory,
                        DataWrapper.Instance.GetDirectoryNamePart
                            (projectEntry, false));

                    String PictureFileName = Path.Combine(OrteDirectory, "Bilder.pdf");
                    XAMLPrintoutDefinitions.PrintFileCards PicturePrintHandler = new XAMLPrintoutDefinitions.PrintFileCards();
                    String CreatedPictureFileNameAndDescription = PicturePrintHandler.PrintPictureData
                        (PicturesToPrint, PictureFileName, OrtsNameID);
                    }

                String ProjectDirectory = Path.Combine(ProjectFolderBaseDirectory,
                    DataWrapper.Instance.GetDirectoryNamePart(projectEntry));
                List<Object> PicturesToPrintBefore = DataWrapper.Instance.CreateTreeForProjektBeforePictures
                    (ProjectDirectory);
                List<Object> PicturesToPrintAfter = DataWrapper.Instance.CreateTreeForProjektAfterPictures
                    (ProjectDirectory);
                List<Object> PicturesToPrintIntermediate = DataWrapper.Instance.CreateTreeForProjektIntermediatePictures
                    (ProjectDirectory);
                String FolderFileName = DataWrapper.Instance.GetFileNameForProjectFolder(projectEntry) + ".pdf";
                String FullFolderPath = Path.Combine(ProjectDirectory, FolderFileName);
                DateTime LastWriteTime = DateTime.MinValue;
                bool FolderExists = false;
                if (File.Exists(FullFolderPath))
                    {
                    FileInfo FInfo = new FileInfo(FullFolderPath);
                    LastWriteTime = FInfo.LastWriteTime;
                    FolderExists = true;
                    }
                String ProjektBeschreibung = projectEntry.Beschreibung;
                List<Object> ObjectsToPrint = DataWrapper.Instance.CreateTreeForProjekteFolder(projectEntry,
                    "ProfisFull");
                List<Object> ResultetObjectsToPrint = new List<object>(PicturesToPrintBefore);
                ResultetObjectsToPrint.AddRange(ObjectsToPrint);
                ResultetObjectsToPrint.AddRange(PicturesToPrintIntermediate);
                ResultetObjectsToPrint.AddRange(PicturesToPrintAfter);

                XAMLPrintoutDefinitions.PrintFileCards PrintHandler = new XAMLPrintoutDefinitions.PrintFileCards();
                String CreatedFileNameAndDescription = PrintHandler.PrintProjektMapData(ResultetObjectsToPrint,
                    FullFolderPath, ProjektBeschreibung);

                if (FolderExists)
                    {
                    }
                }
            }
Exemple #10
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);
            }
Exemple #11
0
        private void CreateeMailsForTerminAndParticipant(List<Guid> TypIDListToSelect, String FileName)
            {
            Termin[] TerminEntries = Data.DbServer3.WordUp.Termine.Find_ForSpecificTypIDs
                (TypIDListToSelect, DateTime.Now.AddDays(-1));
            Dictionary<Person, List<String>> SendList = new Dictionary<Person, List<string>>();
            foreach (Termin TerminEntry in TerminEntries)
                {
                String TerminID = TerminEntry.Id.ToString();
                List<Object> ObjectsToPrint = DataWrapper.Instance.CreateTreeForTerminData(TerminEntry, "ProfisPart");
                String TargetDirectory = Path.GetDirectoryName(FileName);
                if (!Directory.Exists(TargetDirectory))
	                Directory.CreateDirectory(TargetDirectory);
                String CreatedFileNameAndDescription;
                PersonZuTermin[] InvolvedPersonen = Data.DbServer3.WordUp.PersonenZuTerminen.Collection
							.Where(sel => sel.WordUpId == Data.DbServer3.WordUp.WordUpIDGuid
								&& sel.TermineId == TerminEntry.Id
								&& TypIDListToSelect.Contains((Guid) sel.PersonenTypId)).ToArray();
				ProjektZuTermin[] InvolvedProjekte = Data.DbServer3.WordUp.ProjekteZuTerminen.Collection
							.Where(sel => sel.Projekt.WordUpRootId == Data.DbServer3.WordUp.WordUpIDGuid
								  && sel.TermineId == TerminEntry.Id).ToArray();
				if((InvolvedPersonen.Length > 0)
					|| (InvolvedProjekte.Length > 0))
					{
                    XAMLPrintoutDefinitions.PrintFileCards PrintHandler = new XAMLPrintoutDefinitions.PrintFileCards();
                    CreatedFileNameAndDescription = PrintHandler.PrintTermine(ObjectsToPrint, TargetDirectory);
                    }
                else
                    {
                    TerminPrint Helper = new TerminPrint(TerminEntry);
                    CreatedFileNameAndDescription = ";" + Helper.DescriptionElements;
                    }
				foreach (PersonZuTermin personZuTermin in Data.DbServer3.WordUp.PersonenZuTerminen.Collection
							.Where(sel => sel.WordUpId == Data.DbServer3.WordUp.WordUpIDGuid
								&& sel.TermineId == TerminEntry.Id
								&& Data.DbServer3.WordUp.Typen.AllTypIDsForBetreuer
										.Contains((Guid)sel.PersonenTypId)).ToArray())
                    {
                    if (SendList.ContainsKey(personZuTermin.Person))
                        SendList[personZuTermin.Person].Add(CreatedFileNameAndDescription);
                    else
                        SendList[personZuTermin.Person] = new List<string>() {CreatedFileNameAndDescription};
                    }
                }

            SmtpClient MailClient = new SmtpClient(WMB.SecureData.StandardSMTPServer);
            MailClient.Credentials = new NetworkCredential(WMB.SecureData.StandardSMTPUser, WMB.SecureData.StandardSMTPPassword);
            MailClient.DeliveryMethod = SmtpDeliveryMethod.Network;

            String Receiver = SelectReceiver();
            foreach (Person staffPerson in SendList.Keys)
                {
                StringBuilder Result = new StringBuilder();
//					Result.AppendLine("<html>");
//					Result.AppendLine(CommonHTMLHeader);
//					Result.AppendLine("<body>");
                Result.AppendLine("Hallo Brigitte!");
                Result.AppendLine(String.Empty);
                Result.AppendLine("Diese Mail gehört an die folgende Adresse gesendet:");
                Result.AppendLine(String.Empty);
                Result.AppendLine(String.Empty);
                Result.AppendLine("<h3>" + staffPerson.EMail + "</h3>");
                Result.AppendLine(String.Empty);
                Result.AppendLine(String.Empty);
                Result.AppendLine("<H3>Hallo " + staffPerson.VorName + "!</H3>");
                Result.AppendLine(String.Empty);
                Result.AppendLine("<p>Diese Mail enthält die nächsten Termine, soweit sie Dich betreffen.</p>");
                Result.AppendLine("<p>Beiliegend (Attachment) schicke ich dir zu manchen Terminen noch "
                                  + "detaillierte Infos, die du zur Terminvorbereitung benötigst.</p>");
                Result.AppendLine(String.Empty);
                Result.AppendLine("<h3>lg Brigitte</h3>");
                Result.AppendLine(String.Empty);
                Result.AppendLine("<h3>Hier noch die demnächst stattfindenden Termine:</h3>");
                Result.AppendLine(String.Empty);
                List<Attachment> Attachments = new List<Attachment>();
                Result.AppendLine("<table border=\"1\">");
                Result.AppendLine("<tr><th>Att.</th><th>Wann</th><th>Was</th><th>Wo</th><th>Details</th></tr>");
                foreach (String fileNameAndDescription in SendList[staffPerson])
                    {
                    Result.AppendLine("<tr>");

                    String[] Elements = fileNameAndDescription.Split(';');
                    String[] EinzelElemente = Elements[1].Split('\t');
                    String AttachmentAvailable = "-";
                    if (!String.IsNullOrEmpty(Elements[0]))
                        {
                        Attachments.Add(new Attachment(Elements[0].Replace(".xps", ".pdf")));
                        AttachmentAvailable = "ja";
                        }
                    Result.AppendLine("<td>" + AttachmentAvailable + "</td>");
                    foreach (String EinzelElement in EinzelElemente)
                        {
                        Result.AppendLine("<td>" + EinzelElement + "</td>");
                        }


                    Result.AppendLine("</tr>");
                    }
                Result.AppendLine("</table>");

//					Result.Append("</body></html>");

                MailMessage BasicMail = new MailMessage(WMB.SecureData.StandardSMTPUser,
                    ((String.IsNullOrEmpty(Receiver)) ? staffPerson.EMail : Receiver));

                BasicMail.IsBodyHtml = true;
                BasicMail.BodyEncoding = Encoding.UTF8;
                BasicMail.HeadersEncoding = Encoding.UTF8;
                BasicMail.SubjectEncoding = Encoding.UTF8;
                BasicMail.Subject = "word up!23-Termindaten für die nächsten Termine";
                BasicMail.Body = "<p>" + Result.ToString().Replace("\r\n", "</br>") + "</p>";
                //.Replace ("\r\n", "</br>");
                foreach (Attachment Att in Attachments)
                    {
                    BasicMail.Attachments.Add(Att);
                    }
                MailClient.Send(BasicMail);
                BasicMail.Dispose();
                }

            return;
            }
Exemple #12
0
		private Dictionary<String, String> CreateArbeitsGruppenPersonen(String ArbeitsGruppenTargetDirectory)
            {
            ShowProgressMessage("Create ProjektPersonen Auswertungen");
            Dictionary<String, String> Result = new Dictionary<String, String>();
            ArbeitsGruppenTargetDirectory += "\\Personen";
            if (!Directory.Exists(ArbeitsGruppenTargetDirectory))
                Directory.CreateDirectory(ArbeitsGruppenTargetDirectory);
            String HeadLine;
            XAMLPrintoutDefinitions.PrintFileCards PrintHandler = new XAMLPrintoutDefinitions.PrintFileCards();

            List<Object> AllPrintablePersonen = DataWrapper.Instance.CreateTreeForArbeitsGruppenPersonen("");

            String CreatedPersonenFileName =
                PrintHandler.PrintSimpleFormattedArbeitsGruppenPersonenProjekte(AllPrintablePersonen,
                    Path.Combine(ArbeitsGruppenTargetDirectory, "word up!23 - alle Arbeitsgruppen - Personenliste.pdf"),
                    "Alle Arbeitsgruppen\r\nAlle VertreterInnen, BetreuerInnen und PlenumssprecherInnen");

            foreach (DataRow AGRow in Basics.Instance.ArbeitsGruppen.Values)
                {
                String AG = AGRow["NameID"].ToString();
                String AGID = AGRow["ID"].ToString().ToLower();
                String Ortsteile = AGRow["LangName"].ToString();
                String AGFileName = Path.Combine(ArbeitsGruppenTargetDirectory,
                    "word up!23 - " + AG + " - Personenliste.pdf");
                String AGTitle = AG + " - " + Ortsteile +
                                 "\r\nAlle VertreterInnen, BetreuerInnen und PlenumssprecherInnen";
                Result[AGID] = AGFileName + ";" + AGTitle;
                List<Object> PrintablePersonenPerAG = DataWrapper.Instance.CreateTreeForArbeitsGruppenPersonen
                    (AG);
                CreatedPersonenFileName =
                    PrintHandler.PrintSimpleFormattedArbeitsGruppenPersonenProjekte(PrintablePersonenPerAG,
                        AGFileName, AGTitle);
                }

            ShowProgressMessage("");
            return Result;
            }
Exemple #13
0
		private void CreateStatistikPrintOut(List<Object> StatistikContentClasses,
					String reportSubType, String targetDirectory, String HeadLine)
			{

			String OutputFileName =
				System.IO.Path.Combine(targetDirectory, reportSubType + ".pdf");
			bool FirstProjektInProjektOrt = true;
			XAMLPrintoutDefinitions.PrintFileCards StatistikenPrinter
						= new XAMLPrintoutDefinitions.PrintFileCards();
			StatistikenPrinter.PrintStatistiken(StatistikContentClasses, OutputFileName,
				HeadLine);


			}