diff --git a/BeWo/BeWo.csproj b/BeWo/BeWo.csproj
index a95ec86f8..bf470a35a 100644
--- a/BeWo/BeWo.csproj
+++ b/BeWo/BeWo.csproj
@@ -310,6 +310,14 @@
MSBuild:Compile
Designer
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
MSBuild:Compile
Designer
@@ -869,6 +877,7 @@
+
@@ -900,6 +909,7 @@
+
@@ -989,6 +999,13 @@
OwnChatSettingsView.xaml
+
+
+ Suchergebnis.xaml
+
+
+ TemplatePrintSelection.xaml
+
VorlageEditView.xaml
@@ -2436,392 +2453,392 @@
False
+ Include
+ True
- Include
- True
Assembly
False
+ Include
+ True
- Include
- True
Assembly
False
+ Include
+ True
- Include
- True
Assembly
False
+ Include
+ True
- Include
- True
Assembly
False
+ Include
+ True
- Include
- True
Assembly
False
+ Include
+ True
- Include
- True
Assembly
False
+ Include
+ True
- Include
- True
Assembly
False
+ Include
+ True
- Include
- True
Assembly
False
+ Include
+ True
- Include
- True
Assembly
False
+ Include
+ True
- Include
- True
Assembly
False
+ Include
+ True
- Include
- True
Assembly
False
+ Include
+ True
- Include
- True
Assembly
False
+ Include
+ True
- Include
- True
Assembly
False
+ Include
+ True
- Include
- True
Assembly
False
+ Include
+ True
- Include
- True
Assembly
False
+ Include
+ True
- Include
- True
Assembly
False
+ Include
+ True
- Include
- True
Assembly
False
+ Include
+ True
- Include
- True
Assembly
False
+ Include
+ True
- Include
- True
Assembly
False
+ Include
+ True
- Include
- True
Assembly
False
+ Include
+ True
- Include
- True
Assembly
False
+ Include
+ True
- Include
- True
Assembly
False
+ Include
+ True
- Include
- True
Assembly
False
+ Include
+ True
- Include
- True
Assembly
False
+ Include
+ True
- Include
- True
Assembly
False
+ Include
+ True
- Include
- True
Assembly
False
+ Include
+ True
- Include
- True
Assembly
False
+ Include
+ True
- Include
- True
Assembly
False
+ Include
+ True
- Include
- True
Assembly
False
+ Include
+ True
- Include
- True
Assembly
False
+ Include
+ True
- Include
- True
Assembly
False
+ Include
+ True
- Include
- True
Assembly
False
+ Include
+ True
- Include
- True
Assembly
False
+ Include
+ True
- Include
- True
Assembly
False
+ Include
+ True
- Include
- True
Assembly
False
+ Include
+ True
- Include
- True
Assembly
False
+ Include
+ True
- Include
- True
Assembly
False
+ Include
+ True
- Include
- True
Assembly
False
+ Include
+ True
- Include
- True
Assembly
diff --git a/BeWo/ServiceProxy/Generated.cs b/BeWo/ServiceProxy/Generated.cs
index a4068491f..9b7154d51 100644
--- a/BeWo/ServiceProxy/Generated.cs
+++ b/BeWo/ServiceProxy/Generated.cs
@@ -4995,12 +4995,21 @@ namespace BeWo.ServiceProxy
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/InsertTemplate", ReplyAction="http://tempuri.org/IOperationsService/InsertTemplateResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/InsertTemplateBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
- void InsertTemplate(BS.Shared.DataContracts.DokumentvorlageDC dc);
+ BS.Shared.DataContracts.DokumentvorlageDC InsertTemplate(BS.Shared.DataContracts.DokumentvorlageDC dc);
+
+ [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/GetPlatzhalterForSupportConcept", ReplyAction="http://tempuri.org/IOperationsService/GetPlatzhalterForSupportConceptResponse")]
+ [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetPlatzhalterForSupportConceptBeWoFaultFau" +
+ "lt", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
+ System.Collections.Generic.List GetPlatzhalterForSupportConcept();
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/GetPlatzhalterForCustomer", ReplyAction="http://tempuri.org/IOperationsService/GetPlatzhalterForCustomerResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetPlatzhalterForCustomerBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
System.Collections.Generic.List GetPlatzhalterForCustomer();
+ [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/GetPlatzhalterForEmployee", ReplyAction="http://tempuri.org/IOperationsService/GetPlatzhalterForEmployeeResponse")]
+ [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetPlatzhalterForEmployeeBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
+ System.Collections.Generic.List GetPlatzhalterForEmployee();
+
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/GetFolderById", ReplyAction="http://tempuri.org/IOperationsService/GetFolderByIdResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetFolderByIdBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
BS.Shared.DataContracts.BeWoFolderDC GetFolderById(long oid);
@@ -5021,6 +5030,23 @@ namespace BeWo.ServiceProxy
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/DeleteTemplatesBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
void DeleteTemplates(System.Collections.Generic.List vorlagen);
+ [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/ReplacePlaceholdersInTemplate", ReplyAction="http://tempuri.org/IOperationsService/ReplacePlaceholdersInTemplateResponse")]
+ [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/ReplacePlaceholdersInTemplateBeWoFaultFault" +
+ "", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
+ string ReplacePlaceholdersInTemplate(BS.Shared.DataContracts.DokumentvorlageDC template, System.Nullable objectOid, System.Nullable tableOid);
+
+ [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/InsertFileAttachment", ReplyAction="http://tempuri.org/IOperationsService/InsertFileAttachmentResponse")]
+ [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/InsertFileAttachmentBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
+ void InsertFileAttachment(BS.Shared.DataContracts.FileAttachmentDC fileAttachmentDC);
+
+ [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/SearchForFiles", ReplyAction="http://tempuri.org/IOperationsService/SearchForFilesResponse")]
+ [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/SearchForFilesBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
+ System.Collections.Generic.List SearchForFiles(string nutzereingabe);
+
+ [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/GetObjectForFilePath", ReplyAction="http://tempuri.org/IOperationsService/GetObjectForFilePathResponse")]
+ [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetObjectForFilePathBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
+ string GetObjectForFilePath(BS.Shared.TableID table, System.Nullable oid);
+
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/UpdateIsChatActiveCustomerAPPCodeDC", ReplyAction="http://tempuri.org/IOperationsService/UpdateIsChatActiveCustomerAPPCodeDCResponse" +
"")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/UpdateIsChatActiveCustomerAPPCodeDCBeWoFaul" +
@@ -6141,9 +6167,14 @@ namespace BeWo.ServiceProxy
return base.Channel.GetVorlagentabelleDCs();
}
- public void InsertTemplate(BS.Shared.DataContracts.DokumentvorlageDC dc)
+ public BS.Shared.DataContracts.DokumentvorlageDC InsertTemplate(BS.Shared.DataContracts.DokumentvorlageDC dc)
{
- base.Channel.InsertTemplate(dc);
+ return base.Channel.InsertTemplate(dc);
+ }
+
+ public System.Collections.Generic.List GetPlatzhalterForSupportConcept()
+ {
+ return base.Channel.GetPlatzhalterForSupportConcept();
}
public System.Collections.Generic.List GetPlatzhalterForCustomer()
@@ -6151,6 +6182,11 @@ namespace BeWo.ServiceProxy
return base.Channel.GetPlatzhalterForCustomer();
}
+ public System.Collections.Generic.List GetPlatzhalterForEmployee()
+ {
+ return base.Channel.GetPlatzhalterForEmployee();
+ }
+
public BS.Shared.DataContracts.BeWoFolderDC GetFolderById(long oid)
{
return base.Channel.GetFolderById(oid);
@@ -6176,6 +6212,26 @@ namespace BeWo.ServiceProxy
base.Channel.DeleteTemplates(vorlagen);
}
+ public string ReplacePlaceholdersInTemplate(BS.Shared.DataContracts.DokumentvorlageDC template, System.Nullable objectOid, System.Nullable tableOid)
+ {
+ return base.Channel.ReplacePlaceholdersInTemplate(template, objectOid, tableOid);
+ }
+
+ public void InsertFileAttachment(BS.Shared.DataContracts.FileAttachmentDC fileAttachmentDC)
+ {
+ base.Channel.InsertFileAttachment(fileAttachmentDC);
+ }
+
+ public System.Collections.Generic.List SearchForFiles(string nutzereingabe)
+ {
+ return base.Channel.SearchForFiles(nutzereingabe);
+ }
+
+ public string GetObjectForFilePath(BS.Shared.TableID table, System.Nullable oid)
+ {
+ return base.Channel.GetObjectForFilePath(table, oid);
+ }
+
public void UpdateIsChatActiveCustomerAPPCodeDC(long customerOid, int activeType)
{
base.Channel.UpdateIsChatActiveCustomerAPPCodeDC(customerOid, activeType);
diff --git a/BeWo/View/Detail/Suchergebnis.xaml b/BeWo/View/Detail/Suchergebnis.xaml
new file mode 100644
index 000000000..87133ac68
--- /dev/null
+++ b/BeWo/View/Detail/Suchergebnis.xaml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/BeWo/View/Detail/Suchergebnis.xaml.cs b/BeWo/View/Detail/Suchergebnis.xaml.cs
new file mode 100644
index 000000000..8757ab7cd
--- /dev/null
+++ b/BeWo/View/Detail/Suchergebnis.xaml.cs
@@ -0,0 +1,69 @@
+using System;
+using System.Collections.Generic;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Input;
+
+using BeWo.Controls;
+using BeWo.Core;
+using BeWo.ServiceProxy;
+using BeWo.Validation;
+using BeWo.View.Search;
+using BeWo.ViewModel;
+using BeWo.ViewModel.ListViewModel;
+using BeWo.Core.Service;
+
+using BS.Shared;
+using BS.Shared.Extensions;
+using BS.Shared.Core;
+using BS.Shared.DataContracts;
+using BS.Shared.DataContracts.ClientPartials;
+using BS.Shared.DataContracts.Compact;
+using BS.Shared.Services;
+using BS.Shared.Translation;
+using DevExpress.Xpf.RichEdit;
+using SupportConceptService = BeWo.Core.Service.SupportConceptService;
+using System.Linq;
+using DevExpress.Xpf.Grid;
+using System.Windows.Media.Imaging;
+using DevExpress.Utils;
+
+namespace BeWo.View.Detail
+{
+ public partial class Suchergebnis
+ {
+ public event Action ButtonOpenClicked;
+ public event Action ButtonCancelClicked;
+
+ public SuchergebnisVM Selected { get; set; }
+
+ public Suchergebnis()
+ {
+ InitializeComponent();
+ }
+
+ public void InitView(List suchergebnisse)
+ {
+ datagrid_searchresult.ItemsSource = suchergebnisse;
+ datagrid_searchresult.SelectedItem = Selected;
+ }
+
+ private void Button_Open_Click(object sender, RoutedEventArgs e)
+ {
+ Selected = datagrid_searchresult.SelectedItem as SuchergebnisVM;
+ if (Selected == null)
+ {
+ MessageBox.Show("Sie müssen eine Auswahl treffen.", "BeWoPlaner", MessageBoxButton.OK, MessageBoxImage.Information);
+ return;
+ }
+ ButtonOpenClicked?.Invoke();
+ }
+ private void Button_Cancel_Click(object sender, RoutedEventArgs e)
+ {
+ if (MessageBox.Show("Wollen Sie wirklich abbrechen?", "BeWoPlaner", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes)
+ ButtonCancelClicked?.Invoke();
+ }
+
+
+ }
+}
\ No newline at end of file
diff --git a/BeWo/View/Detail/SuchergebnisMasterMenuItem.cs b/BeWo/View/Detail/SuchergebnisMasterMenuItem.cs
new file mode 100644
index 000000000..910918885
--- /dev/null
+++ b/BeWo/View/Detail/SuchergebnisMasterMenuItem.cs
@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BeWo.View.Detail
+{
+
+ public class SuchergebnisMasterMenuItem
+ {
+ public SuchergebnisMasterMenuItem()
+ {
+ TargetType = typeof(SuchergebnisMasterMenuItem);
+ }
+ public int Id { get; set; }
+ public string Title { get; set; }
+
+ public Type TargetType { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/BeWo/View/Detail/TemplatePrintSelection.xaml b/BeWo/View/Detail/TemplatePrintSelection.xaml
new file mode 100644
index 000000000..38b7b4a33
--- /dev/null
+++ b/BeWo/View/Detail/TemplatePrintSelection.xaml
@@ -0,0 +1,102 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/BeWo/View/Detail/TemplatePrintSelection.xaml.cs b/BeWo/View/Detail/TemplatePrintSelection.xaml.cs
new file mode 100644
index 000000000..229d7c8cb
--- /dev/null
+++ b/BeWo/View/Detail/TemplatePrintSelection.xaml.cs
@@ -0,0 +1,321 @@
+using System;
+using System.Collections.Generic;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Input;
+
+using BeWo.Controls;
+using BeWo.Core;
+using BeWo.ServiceProxy;
+using BeWo.Validation;
+using BeWo.View.Search;
+using BeWo.ViewModel;
+using BeWo.ViewModel.ListViewModel;
+using BeWo.Core.Service;
+
+using BS.Shared;
+using BS.Shared.Extensions;
+using BS.Shared.Core;
+using BS.Shared.DataContracts;
+using BS.Shared.DataContracts.ClientPartials;
+using BS.Shared.DataContracts.Compact;
+using BS.Shared.Services;
+using BS.Shared.Translation;
+using DevExpress.Xpf.RichEdit;
+using SupportConceptService = BeWo.Core.Service.SupportConceptService;
+using System.Linq;
+using DevExpress.Xpf.Grid;
+using System.Windows.Media.Imaging;
+using DevExpress.Utils;
+
+namespace BeWo.View.Detail
+{
+ public partial class TemplatePrintSelection
+ {
+ public event Action ButtonCreateClicked;
+ public event Action ButtonCreateForSelectionClicked;
+ public event Action ButtonCreateForAllClicked;
+ public event Action ButtonCancelClicked;
+
+ public DocumentTreeItemVM selectedFolder = null;
+
+ public TemplatePrintSelection()
+ {
+ InitializeComponent();
+ }
+
+ public void InitView(long? tabelle)
+ {
+ InitializeComponent();
+
+ List vms = new List();
+
+ switch (tabelle)
+ {
+ case 2: vms = GetEmployee(); break;
+ case 8: vms = GetCustomers(); break;
+ case 15: vms = GetSupportConcepts(); break;
+ }
+
+ List sortedList = vms.OrderBy(vm => vm.LastName).ToList();
+ datagrid_enabled_for_template.ItemsSource = sortedList;
+ combobox_elementList.ItemsSource = sortedList;
+
+ datagrid_enabled_for_template.SelectedItem = null;
+
+ Focus();
+ }
+
+ private List GetEmployee()
+ {
+ var DCs = VMFactory.CreateEmployeeList();
+
+ List list = new List();
+
+ foreach (var e in DCs)
+ {
+ list.Add(new PrintSelectionVM(e.LastName, e.FirstName, 2, e.EmployeeOid));
+ }
+
+ return list;
+ }
+
+ private List GetCustomers()
+ {
+ var DCs = VMFactory.CreateCustomerList();
+
+ List list = new List();
+
+ foreach (var c in DCs)
+ {
+ list.Add(new PrintSelectionVM(c.LastName, c.FirstName, 8, c.CustomerOid));
+ }
+
+ return list;
+ }
+
+ private List GetSupportConcepts()
+ {
+ var DCs = VMFactory.CreateSupportConceptList();
+
+ List list = new List();
+
+ foreach (var s in DCs)
+ {
+ string[] dateAndTime = s.StartDate.ToString().Split(' ');
+ list.Add(new PrintSelectionVM(s.LastName + " (" + dateAndTime[0] + ")", s.FirstName, 15, s.SupportConceptOid));
+ }
+
+ return list;
+ }
+
+ private void Button_CreateTemplateBasedDocument_Click(object sender, RoutedEventArgs e)
+ {
+ selectedFolder = null;
+
+ var selected = GetSelectedElements();
+
+ if (selected == null || selected.Count == 0)
+ {
+ MessageBox.Show("Es muss mindestens ein Datensatz ausgewählt werden.", "BeWoPlaner", MessageBoxButton.OK, MessageBoxImage.Information);
+ return;
+ }
+
+ ButtonCreateClicked?.Invoke();
+ }
+ private void Button_CreateTemplateForSelection_Click(object sender, RoutedEventArgs e)
+ {
+ var selected = combobox_elementList.SelectedItem as PrintSelectionVM;
+
+ if (selected == null)
+ {
+ MessageBox.Show("Es muss ein Datensatz ausgewählt werden.", "BeWoPlaner", MessageBoxButton.OK, MessageBoxImage.Information);
+ return;
+ }
+
+
+ ButtonCreateForSelectionClicked?.Invoke();
+ }
+
+ //private void Button_CreateTemplateBasedDocumentForAll_Click(object sender, RoutedEventArgs e)
+ //{
+ // var selected = datagrid_enabled_for_template.ItemsSource as List;
+
+ // ButtonCreateForAllClicked?.Invoke();
+ //}
+
+ private void Button_Cancel_Click(object sender, RoutedEventArgs e)
+ {
+ ButtonCancelClicked?.Invoke();
+ }
+
+ public List GetSelectedElements()
+ {
+ var t = datagrid_enabled_for_template.ItemsSource as List;
+ List vms = new List();
+
+ foreach (var item in t)
+ {
+ if(item.Selected)
+ vms.Add(item);
+ }
+
+ return vms;
+ }
+
+ private void Button_SelectAll_Click(object sender, RoutedEventArgs e)
+ {
+ var t = datagrid_enabled_for_template.ItemsSource as List;
+ List vms = new List();
+
+ foreach (var item in t)
+ {
+ item.Selected = true;
+ vms.Add(item);
+ }
+
+ //datagrid_enabled_for_template.ItemsSource = null;
+ datagrid_enabled_for_template.ItemsSource = vms;
+ }
+
+ private void Button_UnselectAll_Click(object sender, RoutedEventArgs e)
+ {
+ var t = datagrid_enabled_for_template.ItemsSource as List;
+ List vms = new List();
+
+ foreach (var item in t)
+ {
+ item.Selected = false;
+ vms.Add(item);
+ }
+
+ //datagrid_enabled_for_template.ItemsSource = null;
+ datagrid_enabled_for_template.ItemsSource = vms;
+ }
+
+ private void CheckBox_Checked(object sender, RoutedEventArgs e)
+ {
+ treelistcontrol_folderStructureForSelection.Visibility = Visibility.Visible;
+ }
+
+ private void CheckBox_Unchecked(object sender, RoutedEventArgs e)
+ {
+ selectedFolder = null;
+ treelistcontrol_folderStructureForSelection.Visibility = Visibility.Collapsed;
+ }
+ private void combobox_elementList_SelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ var selection = combobox_elementList.SelectedItem as PrintSelectionVM;
+ var objectOid = selection.ObjectOid;
+ TableID tid = TableID.Employee;
+ switch(selection.Table)
+ {
+ case 2: tid = TableID.Employee;break;
+ case 8: tid = TableID.Customer;break;
+ case 15: tid = TableID.SupportConcept;break;
+ }
+ var folderDCs = VMFactory.CreateFolderList(tid, (long)objectOid);
+
+ for (int i = DocumentsTreeView_folderStructureForSelection.Nodes.Count - 1; i >= 0; i--)
+ DocumentsTreeView_folderStructureForSelection.Nodes.Remove(DocumentsTreeView_folderStructureForSelection.Nodes[i]);
+
+ GenerateFolderStructure(tid, null, folderDCs);
+ }
+ private void GenerateFolderStructure(TableID table, TreeListNode node, List folderDCs)
+ {
+
+ if (node == null)
+ {
+ node = new TreeListNode()
+ {
+ IsExpandButtonVisible = DefaultBoolean.True,
+ Tag = false,
+ Image = LoadFolderImage()
+ };
+ }
+
+ var content = node.Content as DocumentTreeItemVM;
+
+ foreach (var folder in folderDCs)
+ {
+ //Falls kein übergeordneter Knoten exisitert
+ //if(content == null)
+ //{
+ // PrintSelectionVM selected = combobox_elementList.SelectedItem as PrintSelectionVM;
+ // var dc = new DocumentTreeItemDC()
+ // {
+ // DocTreeItemOid = 0,
+ // ParentOid = null,
+ // Name = "Alle Ordner",
+ // Table = table
+ // };
+ // content = new DocumentTreeItemVM(dc);
+ // node.Content = content;
+ // DocumentsTreeView_folderStructureForSelection.Nodes.Add(node);
+ //}
+
+ PrintSelectionVM selected = combobox_elementList.SelectedItem as PrintSelectionVM;
+ DocumentTreeItemDC folder_dc = new DocumentTreeItemDC()
+ {
+ DocTreeItemOid = folder.BeWoFolderOid,
+ ParentOid = null,
+ Name = folder.Name,
+ FilesInFolder = new List(),
+ BeWoFolderDC = folder,
+ Table = table,
+ ObjectOid = selected.ObjectOid
+ };
+ if (content != null)
+ folder_dc.ParentOid = content.DocTreeItemOid;
+ DocumentTreeItemVM folder_vm = new DocumentTreeItemVM(folder_dc);
+ TreeListNode newNode_folder = new TreeListNode()
+ {
+ Content = folder_vm,
+ IsExpandButtonVisible = DefaultBoolean.True,
+ Tag = false,
+ Image = LoadFolderImage()
+ };
+ folder_dc.Node = newNode_folder;
+
+ if(node.Content == null)
+ DocumentsTreeView_folderStructureForSelection.Nodes.Add(newNode_folder);
+ else
+ node.Nodes.Add(newNode_folder);
+
+ if (folder.SubFolders.Count != 0)
+ {
+ GenerateFolderStructure(table, newNode_folder, folder.SubFolders);
+ }
+ }
+ }
+ private BitmapImage LoadFolderImage()
+ {
+ return new BitmapImage(new Uri("/Ressources/Icons/Folder.png", UriKind.Relative));
+ }
+
+ private void DocumentsTreeView_FocusedRowChanged(object sender, DevExpress.Xpf.Grid.FocusedRowChangedEventArgs e)
+ {
+ //if(DocumentsTreeView_folderStructureForSelection.SelectedRows.Count != 0)
+ // selectedFolder = DocumentsTreeView_folderStructureForSelection.SelectedRows[0] as DocumentTreeItemVM;
+ }
+
+ private void DocumentsTreeView_NodeExpanding(object sender, DevExpress.Xpf.Grid.TreeList.TreeListNodeAllowEventArgs e)
+ {
+
+ }
+
+ private void DocumentsTreeView_folderStructureForSelection_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+ {
+ if (DocumentsTreeView_folderStructureForSelection.SelectedRows.Count != 0)
+ selectedFolder = DocumentsTreeView_folderStructureForSelection.SelectedRows[0] as DocumentTreeItemVM;
+ }
+
+
+
+
+ //public List SelectAllElements()
+ //{
+ // return datagrid_enabled_for_template.ItemsSource as List;
+ //}
+ }
+}
\ No newline at end of file
diff --git a/BeWo/View/Detail/VorlageEditView.xaml b/BeWo/View/Detail/VorlageEditView.xaml
index f437e8e2a..2e0fb22ee 100644
--- a/BeWo/View/Detail/VorlageEditView.xaml
+++ b/BeWo/View/Detail/VorlageEditView.xaml
@@ -36,14 +36,8 @@
-
-
+
+
@@ -58,7 +52,7 @@
-
+
@@ -596,7 +590,7 @@
-
+
diff --git a/BeWo/View/Detail/VorlageEditView.xaml.cs b/BeWo/View/Detail/VorlageEditView.xaml.cs
index c6d0e8b83..0d399e42a 100644
--- a/BeWo/View/Detail/VorlageEditView.xaml.cs
+++ b/BeWo/View/Detail/VorlageEditView.xaml.cs
@@ -74,9 +74,11 @@ namespace BeWo.View.Detail
TextEdit_Beschreibung.Text = pVM.Beschreibung;
}
if (pVM.Text != null)
- richEditControl1.Text = pVM.Text;
+ {
+ richEditControl1.RtfText = pVM.RTFText;
+ }
- List templates = new List();
+ List templates = new List();
switch(tabelle)
{
@@ -90,36 +92,71 @@ namespace BeWo.View.Detail
Focus();
}
- private List TemplatesForSupportConcepts()
+ private List LoadTemplates(long? tabelle)
{
- List templates = new List();
+ List templates = new List();
+ List platzhalterDCs = new List();
+ switch (tabelle)
+ {
+ case 1: platzhalterDCs = ServiceFacade.DoOperationsServiceSync(s => s.GetPlatzhalterForSupportConcept()); break;
+ case 2: platzhalterDCs = TemplatesForCustomers(); break;
+ case 3: platzhalterDCs = TemplatesForEmployee(); break;
+ }
return templates;
}
- private List TemplatesForCustomers()
+ private List TemplatesForSupportConcepts()
{
- List templates = new List();
- var platzhalterDCs = ServiceFacade.DoOperationsServiceSync(s => s.GetPlatzhalterForCustomer());
+ List templates = new List();
+
+ var platzhalterDCs = ServiceFacade.DoOperationsServiceSync(s => s.GetPlatzhalterForSupportConcept());
foreach (var item in platzhalterDCs)
{
- templates.Add("-" + item.Bezeichnung + "-");
+ templates.Add(item);
foreach (var item2 in item.Children)
{
- templates.Add(item2.Bezeichnung);
+ templates.Add(item2);
}
}
return templates;
}
- private List TemplatesForEmployee()
+ private List TemplatesForCustomers()
{
- List templates = new List();
-
+ List templates = new List();
+ var platzhalterDCs = ServiceFacade.DoOperationsServiceSync(s => s.GetPlatzhalterForCustomer());
+
+ foreach (var item in platzhalterDCs)
+ {
+ templates.Add(item);
+ foreach (var item2 in item.Children)
+ {
+ templates.Add(item2);
+ }
+ }
+
+ return templates;
+ }
+ private List TemplatesForEmployee()
+ {
+ List templates = new List();
+
+ var platzhalterDCs = ServiceFacade.DoOperationsServiceSync(s => s.GetPlatzhalterForEmployee());
+
+ foreach (var item in platzhalterDCs)
+ {
+ templates.Add(item);
+ foreach (var item2 in item.Children)
+ {
+ templates.Add(item2);
+ }
+ }
+
return templates;
}
@@ -127,9 +164,14 @@ namespace BeWo.View.Detail
{
if (combobox_templates.SelectedItem == null)
return;
- var selected = combobox_templates.SelectedItem;
+ var selected = combobox_templates.SelectedItem as PlatzhalterDC;
- richEditControl1.Text += "[" + selected + "]";
+ if(selected.ToString().StartsWith("-") && selected.ToString().EndsWith("-"))
+ {
+ MessageBox.Show("Bindestriche kennzeichnen eine Vorlagenkategorie. Wählen Sie eine Vorlage ohne Bindestriche.", "BeWoPlaner", MessageBoxButton.OK, MessageBoxImage.Information);
+ return;
+ }
+ richEditControl1.Text += "[" + selected.Platzhalter + "]";
combobox_templates.SelectedItem = null;
}
diff --git a/BeWo/View/Master/DokumenteView.xaml b/BeWo/View/Master/DokumenteView.xaml
index 47c8306b9..57ca73e99 100644
--- a/BeWo/View/Master/DokumenteView.xaml
+++ b/BeWo/View/Master/DokumenteView.xaml
@@ -6,7 +6,7 @@
xmlns:dxa="http://schemas.devexpress.com/winfx/2008/xaml/accordion"
xmlns:markup="clr-namespace:BeWo.MultiLanguage.Markup"
- xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid" xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
+ xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid" xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol" xmlns:controls="clr-namespace:BeWo.View.Controls"
Height="Auto" Width="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Focusable="True">
@@ -86,29 +86,33 @@
-
-
+
+
-
-
+
-
+
+
+
+
+
+
+
+ FocusedRowChanged="DocumentsTreeView_FocusedRowChanged" LostFocus="DocumentsTreeView_LostFocus"
+ NodeExpanding="treeListView_NodeExpanding" AllowEditing="False" ShowNodeImages="True" PrintNodeImages="True"
+ KeyFieldName="{Binding DocumentTreeItemVM.DocTreeItemOid}" ParentFieldName="Binding DocumentTreeItemVM.ParentOid" ContextMenu="{StaticResource cm}">
-
-
+
@@ -133,9 +137,40 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -219,7 +254,7 @@
-
+
@@ -299,23 +334,12 @@
-
+
-
@@ -323,6 +347,13 @@
+
+
+
+
+
+
+
diff --git a/BeWo/View/Master/DokumenteView.xaml.cs b/BeWo/View/Master/DokumenteView.xaml.cs
index 912bbe397..73e61183b 100644
--- a/BeWo/View/Master/DokumenteView.xaml.cs
+++ b/BeWo/View/Master/DokumenteView.xaml.cs
@@ -37,6 +37,7 @@ using TextBox = System.Windows.Controls.TextBox;
using BS.Shared.DataContracts.Compact;
using BeWo.View.Detail;
using System.Text;
+using BS.Shared.Translation;
namespace BeWo.View.Master
{
@@ -754,38 +755,45 @@ namespace BeWo.View.Master
private void popupedit_file_PopUpClick(object sender, RoutedEventArgs pe)
{
- var dlg = new OpenFileDialog();
+ //var dlg = new OpenFileDialog();
- if (dlg.ShowDialog() == DialogResult.OK)
- {
- try
- {
- _UploadFileName = dlg.FileName;
+ //if (dlg.ShowDialog() == DialogResult.OK)
+ //{
+ // try
+ // {
+ // _UploadFileName = dlg.FileName;
- _NormalFileName = dlg.SafeFileName;
- _FileNotice = textbox_fileNotice.Text;
- button_uploadDocument.IsEnabled = true;
+ // _NormalFileName = dlg.SafeFileName;
+ // //_FileNotice = textbox_fileNotice.Text;
+ // button_uploadDocument.IsEnabled = true;
- button_uploadDocument_Click(sender, pe);
+ // button_uploadDocument_Click(sender, pe);
- textbox_fileNotice.Text = "";
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message, "Fehler", MessageBoxButton.OK, MessageBoxImage.Exclamation);
- }
- }
+ // //textbox_fileNotice.Text = "";
+ // }
+ // catch (Exception ex)
+ // {
+ // MessageBox.Show(ex.Message, "Fehler", MessageBoxButton.OK, MessageBoxImage.Exclamation);
+ // }
+ //}
}
private void button_uploadDocument_Click(object sender, RoutedEventArgs pe)
{
if (!String.IsNullOrEmpty(_NormalFileName))
{
+ if(DocumentsTreeView.SelectedRows.Count == 0)
+ {
+ MessageBox.Show("Wählen Sie links einen Ordner aus, in den die Datei hochgeladen werden soll.", "BeWoPlaner", MessageBoxButton.OK, MessageBoxImage.Information);
+ return;
+ }
var selectedTreeViewRow = DocumentsTreeView.SelectedRows[0] as DocumentTreeItemVM;
+
var selectedFolder = selectedTreeViewRow.DataContract.BeWoFolderDC;
long? bewoFolderOid = selectedFolder.BeWoFolderOid;
TableID tableID = selectedFolder.ObjectTid;
long? objectOid = selectedFolder.ObjectOid;
+ _FileNotice = textbox_beschreibung.Text;
try
{
@@ -813,6 +821,7 @@ namespace BeWo.View.Master
//Warum klappt das nicht??
var vmlist = datagrid_documents.ItemsSource as List;
+ datagrid_documents.ItemsSource = null;
vmlist.Add(newFileVM);
datagrid_documents.ItemsSource = vmlist;
@@ -839,6 +848,10 @@ namespace BeWo.View.Master
upload.Dispose();
}));
+ popupedit_file.Text = "";
+ textbox_beschreibung.Text = "";
+ popup_UploadFiles.IsOpen = false;
+
}
catch (Exception ex)
@@ -846,6 +859,10 @@ namespace BeWo.View.Master
MessageBox.Show(ex.Message, "Fehler", MessageBoxButton.OK, MessageBoxImage.Exclamation);
}
}
+ else
+ {
+ MessageBox.Show("Wählen Sie eine Datei zum hochladen aus.", "BeWoPlaner", MessageBoxButton.OK, MessageBoxImage.Information);
+ }
}
private void DocumentsTreeView_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
@@ -1138,24 +1155,6 @@ namespace BeWo.View.Master
}
- private void Templates_SupportConcepts_Expended(TreeListNode node)
- {
- if (node.Nodes.Count == 0)
- {
-
- }
-
- }
-
- private void Templates_Customers_Expended(TreeListNode node)
- {
-
- }
-
- private void Templates_Employee_Expended(TreeListNode node)
- {
-
- }
private void TemplateContextMenu_Opened(object sender, RoutedEventArgs e)
{
if (e.OriginalSource is ContextMenu)
@@ -1249,8 +1248,20 @@ namespace BeWo.View.Master
vm.Parent = row.DataContract.BeWoFolderDC.BeWoFolderOid;
var savedTemplate = EditTemplate(vm);
- if(savedTemplate != null)
- SaveInDatabase(savedTemplate);
+ if(savedTemplate != null)
+ {
+ if(savedTemplate.IsDirty)
+ {
+ SaveInDatabase(savedTemplate);
+
+ var tableitems = datagrid_templates.ItemsSource as List;
+ datagrid_templates.ItemsSource = new List();
+
+ tableitems.Add(savedTemplate);
+ datagrid_templates.ItemsSource = tableitems;
+ }
+
+ }
}
}
}
@@ -1259,7 +1270,7 @@ namespace BeWo.View.Master
private DokumentvorlageVM EditTemplate(DokumentvorlageVM vm)
{
var row = TemplateTreeView.SelectedRows[0] as DocumentTreeItemVM;
- var folder = ServiceFacade.DoOperationsServiceSync(s => s.GetFolderById((long)row.DocTreeItemOid));
+ var folder = ServiceFacade.DoOperationsServiceSync(s => s.GetFolderById((long)row.DataContract.BeWoFolderDC.BeWoFolderOid));
long? tabelle = folder.ObjectOid;
var control = new VorlageEditView();
@@ -1297,13 +1308,14 @@ namespace BeWo.View.Master
return control.ViewModel;
}
- private void SaveInDatabase(DokumentvorlageVM savedTemplate)
+ private DokumentvorlageDC SaveInDatabase(DokumentvorlageVM savedTemplate)
{
var dc = savedTemplate.CommitToDataContract();
var textasbytes = Encoding.ASCII.GetBytes(dc.RTFText);
dc.Data = textasbytes;
- ServiceFacade.DoOperationsServiceSync(s => s.InsertTemplate(dc));
+ var updatedDC = ServiceFacade.DoOperationsServiceSync(s => s.InsertTemplate(dc));
+ return updatedDC;
}
private void EditSelectedTemplateFolder()
@@ -1352,17 +1364,14 @@ namespace BeWo.View.Master
var row = TemplateTreeView.SelectedRows[0] as DocumentTreeItemVM;
- var templatesInFolder = datagrid_templates.ItemsSource as List;
- List dcs = new List();
- if (templatesInFolder == null)
- return;
- else if(templatesInFolder.Count != 0)
+ var templatesInFolder = ServiceFacade.DoOperationsServiceSync(s => s.GetDokumentvorlagenInFolder((long)folder.BeWoFolderOid));
+
+ if (templatesInFolder != null)
{
- foreach (var t in templatesInFolder)
+ if (templatesInFolder.Count != 0)
{
- dcs.Add(t.DataContract);
+ ServiceFacade.DoOperationsServiceSync(s => s.DeleteTemplates(templatesInFolder));
}
- ServiceFacade.DoOperationsServiceSync(s => s.DeleteTemplates(dcs));
}
if (folder.SubFolders.Count != 0)
@@ -1385,7 +1394,11 @@ namespace BeWo.View.Master
var selected = source.SelectedRows[0] as DocumentTreeItemVM;
if (selected == null || selected.Name.Equals("Alle Ordner"))
+ {
+ datagrid_templates.ItemsSource = new List();
return;
+ }
+
var vmList = new List();
@@ -1393,16 +1406,16 @@ namespace BeWo.View.Master
//var folderDC_Oid = folderDC.BeWoFolderOid;
if (selected.DataContract.BeWoFolderDC == null)
return;
- var maybeRightOid = selected.DataContract.BeWoFolderDC.BeWoFolderOid;
//if(folderDC != null)
//{
- var folderOid = maybeRightOid;
+ var folderOid = selected.DataContract.BeWoFolderDC.BeWoFolderOid;
- var vorlagenInOrdner = ServiceFacade.DoOperationsServiceSync(s => s.GetDokumentvorlagenInFolder((long)folderOid));
+ var vorlagenInOrdner = ServiceFacade.DoOperationsServiceSync(s => s.GetDokumentvorlagenInFolder((long)folderOid));
foreach(DokumentvorlageDC dc in vorlagenInOrdner)
{
vmList.Add(new DokumentvorlageVM(dc));
}
+
datagrid_templates.ItemsSource = vmList;
//}
@@ -1416,7 +1429,397 @@ namespace BeWo.View.Master
var templateVM = datagrid_templates.SelectedItem as DokumentvorlageVM;
EditTemplate(templateVM);
if(templateVM.IsDirty)
- SaveInDatabase(templateVM);
+ {
+ var dc = SaveInDatabase(templateVM);
+ templateVM.DataContract = dc;
+ }
+
+ }
+ private void PrintTemplate_Click(object sender, RoutedEventArgs e)
+ {
+ var templateVM = datagrid_templates.SelectedItem as DokumentvorlageVM;
+
+ var liste = ServiceFacade.DoOperationsServiceSync(s => s.GetVorlagentabelleDCs());
+ long vorlagentabelle = 0;
+ foreach (var item in liste)
+ {
+ if(item.VorlagentabelleObjectTid == templateVM.Tabellenzugehoerigkeit)
+ {
+ vorlagentabelle = templateVM.Tabellenzugehoerigkeit;
+ break;
+ }
+ }
+ long? tabellenoid = vorlagentabelle;
+
+ var control = new TemplatePrintSelection();
+ control.InitView(tabellenoid);
+
+ var beWoWindow = new BeWoWindow
+ {
+ rootGroupBox = { Header = "Auswahl für Vorlage treffen" },
+ Height = this.Height,
+ Width = 600,
+ MinWidth = 400,
+ WindowStartupLocation = WindowStartupLocation.CenterOwner,
+ GroupBoxContent = control,
+ Owner = BeWoApp.CurrentBeWo.MainWindow
+ };
+
+ List printSelectionVMs = new List();
+
+ control.ButtonCreateClicked += () =>
+ {
+ printSelectionVMs = control.GetSelectedElements();
+ beWoWindow.Close();
+ };
+ control.ButtonCreateForSelectionClicked += () =>
+ {
+ printSelectionVMs.Add(control.combobox_elementList.SelectedItem as PrintSelectionVM);
+ beWoWindow.Close();
+ };
+ //control.ButtonCreateForAllClicked += () =>
+ //{
+ // printSelectionVMs = control.SelectAllElements();
+ // beWoWindow.Close();
+ //};
+
+ control.ButtonCancelClicked += () =>
+ {
+ beWoWindow.Close();
+ return;
+ };
+
+ beWoWindow.ShowDialog();
+
+ if(printSelectionVMs != null && printSelectionVMs.Count > 0)
+ {
+ if (printSelectionVMs[0].ObjectOid != null && printSelectionVMs[0].Table != null)
+ {
+ List objectOids = new List();
+ foreach (var p in printSelectionVMs)
+ {
+ objectOids.Add((long)p.ObjectOid);
+ }
+
+ string url = GenerateURL((long)templateVM.DataContract.DokumentvorlageOid, objectOids, (long)printSelectionVMs[0].Table);
+
+ BeWoUtils.NavigateToReportUri(url, Translator.Translate("Dokument mit ersetzten Platzhaltern"), () => { });
+
+ if(control.selectedFolder != null)
+ {
+ var objectOid = (control.combobox_elementList.SelectedItem as PrintSelectionVM).ObjectOid;
+ string text = ServiceFacade.DoOperationsServiceSync(s => s.ReplacePlaceholdersInTemplate(templateVM.DataContract, (long)objectOid, (control.combobox_elementList.SelectedItem as PrintSelectionVM).Table));
+ templateVM.Data = Encoding.ASCII.GetBytes(text);
+ UploadTemplateBasedDocument(control.selectedFolder.DataContract.BeWoFolderDC, templateVM.Name, (long)objectOid, templateVM);
+ }
+
+ }
+ }
+ }
+
+ private void UploadTemplateBasedDocument(BeWoFolderDC folder, string filename, long objectOid, DokumentvorlageVM dokumentvorlage)
+ {
+ try
+ {
+ FileAttachmentDC file = new FileAttachmentDC()
+ {
+ BeWoFolderOid = folder.BeWoFolderOid,
+ BinaryData = dokumentvorlage.Data,
+ Description = dokumentvorlage.Beschreibung,
+ FileAttachmentType = FileAttachmentType.NotSpecified,
+ FileAttachmentVersion = 1,
+ FileName = filename,
+ ObjectOid = objectOid,
+ ObjectTid = folder.ObjectTid,
+ InsertedBy = BeWoApp.LoggedOnEmployee.FirstName + BeWoApp.LoggedOnEmployee.LastName,
+ InsertedOn = DateTime.Now
+ };
+
+ ServiceFacade.DoOperationsServiceSync(s => s.InsertFileAttachment(file));
+
+ foreach (var node in DocumentsTreeView.Nodes)
+ {
+ UpdateFilesInFolder(file, folder, node);
+ }
+
+
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, "Fehler", MessageBoxButton.OK, MessageBoxImage.Exclamation);
+ }
+ }
+
+ private void UpdateFilesInFolder(FileAttachmentDC file, BeWoFolderDC folder, TreeListNode node)
+ {
+ var doctreeitem = node.Content as DocumentTreeItemVM;
+ if(doctreeitem.DataContract.ParentOid != null)
+ {
+ if (doctreeitem.DataContract.BeWoFolderDC != null)
+ {
+ foreach (var subnode in node.Nodes)
+ {
+ var sub = subnode.Content as DocumentTreeItemVM;
+ if (sub.DataContract.BeWoFolderDC.BeWoFolderOid == folder.BeWoFolderOid)
+ sub.DataContract.FilesInFolder.Add(file);
+ }
+
+ }
+ else
+ {
+ if (node.Nodes.Count > 0)
+ {
+ foreach (var n in node.Nodes)
+ {
+ UpdateFilesInFolder(file, folder, n);
+ }
+ }
+
+ }
+ }
+ else
+ {
+ if (node.Nodes.Count > 0)
+ {
+ foreach (var n in node.Nodes)
+ {
+ UpdateFilesInFolder(file, folder, n);
+ }
+ }
+
+ }
+
+ }
+
+ private void TemplateDeleteButton_Click(object sender, RoutedEventArgs e)
+ {
+ var row = TemplateTreeView.SelectedRows[0] as DocumentTreeItemVM;
+ var selectedTemplate = this.datagrid_templates.GetFocusedRow() as DokumentvorlageVM;
+ if (selectedTemplate == null)
+ {
+ return;
+ }
+
+ if (MessageBox.Show("ACHTUNG: Das Löschen von Vorlagen kann nicht rückgängig gemacht werden!\nWollen Sie die Vorlage '" + selectedTemplate.Name + "' wirklich löschen?", "Löschen bestätigen", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.No)
+ {
+ return;
+ }
+
+ List listeMitDemDC = new List();
+ listeMitDemDC.Add(selectedTemplate.DataContract);
+ if (selectedTemplate.DataContract.DokumentvorlageOid != null)
+ {
+ ServiceFacade.DoOperationsServiceSync(s => s.DeleteTemplates(listeMitDemDC));
+
+ var gridItemsSource = this.datagrid_templates.ItemsSource as List;
+ datagrid_templates.ItemsSource = new List();
+
+ gridItemsSource.Remove(selectedTemplate);
+ this.datagrid_templates.ItemsSource = gridItemsSource;
+ }
+ }
+
+ public string GenerateURL(long vorlage, List objectOids, long table)
+ {
+ string url = BeWoApp.SiteOfOrigin + "/ReportView.aspx?";
+
+ url += "&template=" + vorlage;
+
+ url += "&obj=";
+ foreach (var oid in objectOids)
+ {
+ if (objectOids.IndexOf(oid) == objectOids.Count - 1)
+ url += oid;
+ else
+ url += oid + ",";
+ }
+
+ url += "&table=" + table;
+ url += "&type=" + Utils.EnumName(ReportTypes.VorlagenReport);
+ url = BeWoWpfUtils.GetHTMLEncodedURL(url);
+
+ return url;
+ }
+
+ private void TextBox_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
+ {
+ if (e.Key != Key.Enter)
+ return;
+
+ if (textbox_searchForFileName.Text.IsNullOrEmpty())
+ {
+ MessageBoxResult result = MessageBox.Show("Die Eingabe ist leer. Wollen Sie statt zu suchen alle vorhandenen Dateien ansehen?", "BeWoPlaner",
+ MessageBoxButton.YesNo, MessageBoxImage.Information);
+ if (result == MessageBoxResult.No)
+ return;
+ }
+
+ List passendeFileAttachments = ServiceFacade.DoOperationsServiceSync(s => s.SearchForFiles(textbox_searchForFileName.Text));
+
+ List suchergebnisse = new List();
+ foreach (var file in passendeFileAttachments)
+ {
+ string path = BuildPath(file.BeWoFolderOid);
+ if (path.Equals("Alle Ordner"))
+ {
+ string table = TableIDToString(file.ObjectTid);
+ string objectName = ServiceFacade.DoOperationsServiceSync(s => s.GetObjectForFilePath(file.ObjectTid, file.ObjectOid));
+ path = table + "/" + objectName + "/" + path;
+ }
+ else
+ path = path.Remove(path.Length - 1);
+
+ suchergebnisse.Add(new SuchergebnisVM(file.FileName, path));
+ }
+ suchergebnisse = suchergebnisse.OrderBy(s => s.FileName).ToList();
+ var control = new Suchergebnis();
+ control.InitView(suchergebnisse);
+
+ var beWoWindow = new BeWoWindow
+ {
+ rootGroupBox = { Header = "Suchergebnis" },
+ Height = this.Height,
+ Width = 600,
+ MinWidth = 400,
+ WindowStartupLocation = WindowStartupLocation.CenterOwner,
+ GroupBoxContent = control,
+ Owner = BeWoApp.CurrentBeWo.MainWindow
+ };
+
+ List printSelectionVMs = new List();
+
+ control.ButtonOpenClicked += () =>
+ {
+ SuchergebnisVM selected = control.Selected;
+ string[] folders = selected.FilePath.Split('/');
+ TreeListNodeCollection nodes = DocumentsTreeView.Nodes;
+ foreach (var folder in folders)
+ {
+ if (folders[folders.Length - 1] == folder)
+ {
+ foreach (var node in nodes)
+ {
+ var c = node.Content as DocumentTreeItemVM;
+ foreach(var file in c.DataContract.FilesInFolder)
+ {
+ if (file.FileName.Equals(selected.FileName))
+ datagrid_documents.ItemsSource = c.DataContract.FilesInFolder;
+ }
+ }
+ beWoWindow.Close();
+ break;
+ }
+
+ if (nodes != null)
+ nodes = ExpandNodeWhichContainsFile(nodes, folder);
+
+ }
+ };
+ control.ButtonCancelClicked += () =>
+ {
+ beWoWindow.Close();
+ return;
+ };
+
+ beWoWindow.ShowDialog();
+ }
+
+ private TreeListNodeCollection ExpandNodeWhichContainsFile(TreeListNodeCollection nodes, string folder)
+ {
+ TreeListNodeCollection nextNodes = null;
+ foreach (var node in nodes)
+ {
+ var content = node.Content as DocumentTreeItemVM;
+ if (content.Name.Equals(folder))
+ {
+ node.IsExpanded = true;
+ if(node.Nodes != null)
+ nextNodes = node.Nodes;
+ break;
+ }
+ }
+
+
+
+ return nextNodes;
+ }
+
+ private string BuildPath(long? folderOid)
+ {
+ string path = "";
+
+ if (folderOid != null)
+ {
+ var folder = ServiceFacade.DoOperationsServiceSync(s => s.GetFolderById((long)folderOid));
+
+
+
+ if (folder.ParentBeWoFolderOid != null)
+ path += BuildPath((long)folder.ParentBeWoFolderOid);
+ else
+ {
+ TableID tableID = folder.ObjectTid;
+ string objectName = ServiceFacade.DoOperationsServiceSync(s => s.GetObjectForFilePath(tableID, folder.ObjectOid));
+ string table = TableIDToString(tableID);
+ string t = path;
+ path = table + "/" + objectName + "/" + "Alle Ordner/" + t;
+
+ }
+ path += folder.Name + "/";
+ }
+ else
+ path += "Alle Ordner";
+
+
+
+ return path;
+ }
+
+ private string TableIDToString(TableID tableID)
+ {
+ string table = "";
+ switch(tableID)
+ {
+ case TableID.ApplicationUser: table = "Benutzer";break;
+ case TableID.SupportConcept: table = "Hilfepläne";break;
+ case TableID.Customer: table = "Klienten";break;
+ case TableID.Organisation: table = "Organisationen";break;
+ case TableID.Person: table = "Personen";break;
+ case TableID.Employee: table = "Mitarbeiter";break;
+ case TableID.Team: table = "Teams";break;
+ case TableID.UserGroup: table = "Benutzergruppen";break;
+ }
+
+ return table;
+ }
+
+ private void button_OpenUploadDocument_Click(object sender, RoutedEventArgs e)
+ {
+ popup_UploadFiles.IsOpen = true;
+ }
+
+ private void popupedit_file_PopUpClick_1(object sender, RoutedEventArgs e)
+ {
+
+ var dlg = new OpenFileDialog();
+
+ if (dlg.ShowDialog() == DialogResult.OK)
+ {
+ try
+ {
+ _UploadFileName = dlg.FileName;
+ _NormalFileName = dlg.SafeFileName;
+ popupedit_file.Text = dlg.SafeFileName;
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, "Fehler", MessageBoxButton.OK, MessageBoxImage.Exclamation);
+ }
+ }
+ }
+ private void button_cancelFileUpload_Click(object sender, RoutedEventArgs e)
+ {
+ popup_UploadFiles.IsOpen = false;
}
}
}
diff --git a/BeWo/ViewModel/DocumentTreeItemVM.cs b/BeWo/ViewModel/DocumentTreeItemVM.cs
index 00d4eb6c6..64a85e0f7 100644
--- a/BeWo/ViewModel/DocumentTreeItemVM.cs
+++ b/BeWo/ViewModel/DocumentTreeItemVM.cs
@@ -9,7 +9,7 @@ using System.Threading.Tasks;
namespace BeWo.ViewModel
{
- class DocumentTreeItemVM : AbstractDCMapperVM
+ public class DocumentTreeItemVM : AbstractDCMapperVM
{
private long? _DocTreeItemOid;
private long? _ParentOid;
diff --git a/BeWo/ViewModel/PrintSelectionVM.cs b/BeWo/ViewModel/PrintSelectionVM.cs
new file mode 100644
index 000000000..43c227f2f
--- /dev/null
+++ b/BeWo/ViewModel/PrintSelectionVM.cs
@@ -0,0 +1,33 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BeWo.ViewModel
+{
+ public class PrintSelectionVM
+ {
+ public bool Selected { get; set; }
+ public string FirstName { get; set; }
+ public string LastName { get; set; }
+ public long? Table { get; set; }
+ public long? ObjectOid { get; set; }
+
+ public PrintSelectionVM(){ }
+
+ public PrintSelectionVM(string LastName, string FirstName, long? Table, long? ObjectOid)
+ {
+ this.Selected = false;
+ this.LastName = LastName;
+ this.FirstName = FirstName;
+ this.Table = Table;
+ this.ObjectOid = ObjectOid;
+ }
+
+ public override string ToString()
+ {
+ return LastName + ", " + FirstName;
+ }
+ }
+}
diff --git a/BeWo/ViewModel/SuchergebnisVM.cs b/BeWo/ViewModel/SuchergebnisVM.cs
new file mode 100644
index 000000000..f6eb71ba5
--- /dev/null
+++ b/BeWo/ViewModel/SuchergebnisVM.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BeWo.ViewModel
+{
+ public class SuchergebnisVM
+ {
+ public string FileName { get; set; }
+ public string FilePath { get; set; }
+
+ public SuchergebnisVM(string FileName, string FilePath)
+ {
+ this.FileName = FileName;
+ this.FilePath = FilePath;
+ }
+ }
+}
diff --git a/Data/Access/SearchDAO.cs b/Data/Access/SearchDAO.cs
index 89d229258..05e2f4db1 100644
--- a/Data/Access/SearchDAO.cs
+++ b/Data/Access/SearchDAO.cs
@@ -4100,5 +4100,23 @@ namespace BeWo.Data.Access
return stringBuilder.ToString();
}
- }
+
+ public virtual IList FindFileattachmentOids(string text)
+ {
+ var q = Session.CreateSQLQuery(Format("SELECT Oid, bewofolderoid, objectoid, objecttid, path FROM FileAttachment WHERE Path like '%{0}%'", text));
+
+ return q.List();
+ }
+ //public IList GetContactForPerson(long? personOid)
+ //{
+ // var criteria = CreateCriteria();
+ // Contact c = new Contact();
+ // //ContactDC dc = new ContactDC();
+
+ // //dc.ContactType = ContactType.private_MobilePhone;
+ // criteria.Add(Restrictions.Eq("PersonOid", personOid));
+
+ // return criteria.List();
+ //}
+ }
}
diff --git a/Host/ReportView.aspx.cs b/Host/ReportView.aspx.cs
index 682999e67..c502ee55a 100644
--- a/Host/ReportView.aspx.cs
+++ b/Host/ReportView.aspx.cs
@@ -156,6 +156,9 @@ namespace Host
case ReportTypes.RosterReport:
report = CreateRosterReport();
break;
+ case ReportTypes.VorlagenReport:
+ report = CreateVorlagenReport();
+ break;
default:
report = CreateQueryReport();
break;
@@ -692,6 +695,21 @@ namespace Host
return reportCreator.CreateRosterReport(wOid, dt);
}
+ private XtraReport CreateVorlagenReport()
+ {
+ long template = long.Parse(Request.Params["template"]);
+ string objectOidString = Request.Params["obj"];
+ string[] oidArray = objectOidString.Split(',');
+
+ List objectOids = new List();
+ foreach (string s in oidArray)
+ objectOids.Add(long.Parse(s));
+
+ long table = long.Parse(Request.Params["table"]);
+
+ return reportCreator.CreateVorlagenReport(template, objectOids, table);
+ }
+
private AbstractReportCreator GetReportCreator()
{
String t = slicedToken["tenant"].ToString();
diff --git a/Report/AbstractReportCreator.cs b/Report/AbstractReportCreator.cs
index cb96ab97d..28698eb1c 100644
--- a/Report/AbstractReportCreator.cs
+++ b/Report/AbstractReportCreator.cs
@@ -91,5 +91,8 @@ namespace BeWo.Report
public abstract XtraReport CreateKilometerauswertungForAllEmployees(List employeeOids, DateTime rangeDate);
- }
+ public abstract XtraReport CreateVorlagenReport(long template, List objectOids, long table);
+
+
+ }
}
\ No newline at end of file
diff --git a/Report/DefaultReportCreator.cs b/Report/DefaultReportCreator.cs
index b9dd2cd5a..8a5abd046 100644
--- a/Report/DefaultReportCreator.cs
+++ b/Report/DefaultReportCreator.cs
@@ -959,5 +959,37 @@ namespace BeWo.Report
return report as XtraReport;
}
+
+ public override XtraReport CreateVorlagenReport(long template, List objectOids, long table)
+ {
+ string rtf = "";
+
+ var templateDC = MapperFactory.DokumentvorlageDC_Dokumentvorlage.MapToNewDC(DAOFactory.GenericDAO.GetByID(template));
+
+ OperationsServiceImp operations = new OperationsServiceImp();
+
+ XtraReport mainReport = null;
+
+ foreach (var oid in objectOids)
+ {
+ string text = operations.ReplacePlaceholdersInTemplate(templateDC, oid, table);
+
+ var report = FindReportImp();
+ report.SetReportDataSource(VorlageRO.Create(text));
+ ((XtraReport)report).CreateDocument();
+
+ if (mainReport == null)
+ {
+ mainReport = (XtraReport)report;
+ }
+ else
+ {
+ if (!text.Equals(""))
+ mainReport.Pages.AddRange(((XtraReport)report).Pages);
+ }
+ }
+
+ return mainReport;
+ }
}
}
\ No newline at end of file
diff --git a/Report/DefaultReports/JahresReport.designer.cs b/Report/DefaultReports/JahresReport.designer.cs
index 7560aaf93..854a0b8b2 100644
--- a/Report/DefaultReports/JahresReport.designer.cs
+++ b/Report/DefaultReports/JahresReport.designer.cs
@@ -329,7 +329,6 @@ namespace BeWo.Report.DefaultReports
//
this.Detail4.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
this.xrTable8});
- this.Detail4.Expanded = false;
this.Detail4.HeightF = 25F;
this.Detail4.KeepTogether = true;
this.Detail4.Name = "Detail4";
diff --git a/Report/DefaultReports/VorlageReport.Designer.cs b/Report/DefaultReports/VorlageReport.Designer.cs
new file mode 100644
index 000000000..1e0353d79
--- /dev/null
+++ b/Report/DefaultReports/VorlageReport.Designer.cs
@@ -0,0 +1,117 @@
+namespace BeWo.Report.DefaultReports
+{
+ partial class VorlageReport
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Designer generated code
+
+ #endregion
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.components = new System.ComponentModel.Container();
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(VorlageReport));
+ this.topMarginBand1 = new DevExpress.XtraReports.UI.TopMarginBand();
+ this.detailBand1 = new DevExpress.XtraReports.UI.DetailBand();
+ this.bottomMarginBand1 = new DevExpress.XtraReports.UI.BottomMarginBand();
+ this.calculatedField1 = new DevExpress.XtraReports.UI.CalculatedField();
+ this.ReportHeader = new DevExpress.XtraReports.UI.ReportHeaderBand();
+ this.objectDataSource1 = new DevExpress.DataAccess.ObjectBinding.ObjectDataSource(this.components);
+ this.xrRichText1 = new DevExpress.XtraReports.UI.XRRichText();
+ ((System.ComponentModel.ISupportInitialize)(this.objectDataSource1)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.xrRichText1)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this)).BeginInit();
+ //
+ // topMarginBand1
+ //
+ this.topMarginBand1.HeightF = 10F;
+ this.topMarginBand1.Name = "topMarginBand1";
+ //
+ // detailBand1
+ //
+ this.detailBand1.HeightF = 0F;
+ this.detailBand1.Name = "detailBand1";
+ //
+ // bottomMarginBand1
+ //
+ this.bottomMarginBand1.HeightF = 10F;
+ this.bottomMarginBand1.Name = "bottomMarginBand1";
+ //
+ // calculatedField1
+ //
+ this.calculatedField1.Name = "calculatedField1";
+ //
+ // ReportHeader
+ //
+ this.ReportHeader.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
+ this.xrRichText1});
+ this.ReportHeader.HeightF = 100.8751F;
+ this.ReportHeader.Name = "ReportHeader";
+ //
+ // objectDataSource1
+ //
+ this.objectDataSource1.DataSource = typeof(BeWo.Report.ReportObjects.VorlageRO);
+ this.objectDataSource1.Name = "objectDataSource1";
+ //
+ // xrRichText1
+ //
+ this.xrRichText1.BorderColor = System.Drawing.Color.Black;
+ this.xrRichText1.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
+ new DevExpress.XtraReports.UI.XRBinding("Rtf", null, "RTFText")});
+ this.xrRichText1.Font = new System.Drawing.Font("Verdana", 9F);
+ this.xrRichText1.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F);
+ this.xrRichText1.Name = "xrRichText1";
+ this.xrRichText1.SerializableRtfString = resources.GetString("xrRichText1.SerializableRtfString");
+ this.xrRichText1.SizeF = new System.Drawing.SizeF(829.9999F, 100.8751F);
+ this.xrRichText1.StylePriority.UseBorderColor = false;
+ this.xrRichText1.StylePriority.UseFont = false;
+ //
+ // VorlageReport
+ //
+ this.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] {
+ this.topMarginBand1,
+ this.detailBand1,
+ this.bottomMarginBand1,
+ this.ReportHeader});
+ this.CalculatedFields.AddRange(new DevExpress.XtraReports.UI.CalculatedField[] {
+ this.calculatedField1});
+ this.ComponentStorage.AddRange(new System.ComponentModel.IComponent[] {
+ this.objectDataSource1});
+ this.DataSource = this.objectDataSource1;
+ this.Margins = new System.Drawing.Printing.Margins(10, 10, 10, 10);
+ this.Version = "17.1";
+ ((System.ComponentModel.ISupportInitialize)(this.objectDataSource1)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.xrRichText1)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this)).EndInit();
+
+ }
+
+ private DevExpress.XtraReports.UI.TopMarginBand topMarginBand1;
+ private DevExpress.XtraReports.UI.DetailBand detailBand1;
+ private DevExpress.XtraReports.UI.BottomMarginBand bottomMarginBand1;
+ private DevExpress.XtraReports.UI.CalculatedField calculatedField1;
+ private DevExpress.DataAccess.ObjectBinding.ObjectDataSource objectDataSource1;
+ private DevExpress.XtraReports.UI.ReportHeaderBand ReportHeader;
+ private DevExpress.XtraReports.UI.XRRichText xrRichText1;
+ }
+}
diff --git a/Report/DefaultReports/VorlageReport.cs b/Report/DefaultReports/VorlageReport.cs
new file mode 100644
index 000000000..7f554e43f
--- /dev/null
+++ b/Report/DefaultReports/VorlageReport.cs
@@ -0,0 +1,18 @@
+using System.Linq;
+using BeWo.Report.ReportObjects;
+
+namespace BeWo.Report.DefaultReports
+{
+ public partial class VorlageReport : DevExpress.XtraReports.UI.XtraReport, IBeWoReport
+ {
+ public VorlageReport()
+ {
+ InitializeComponent();
+ }
+
+ public void SetReportDataSource(VorlageRO pRO)
+ {
+ objectDataSource1.DataSource = pRO;
+ }
+ }
+}
diff --git a/Report/DefaultReports/VorlageReport.resx b/Report/DefaultReports/VorlageReport.resx
new file mode 100644
index 000000000..8c022f262
--- /dev/null
+++ b/Report/DefaultReports/VorlageReport.resx
@@ -0,0 +1,126 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ ewBcAHIAdABmADEAXABkAGUAZgBmADAAewBcAGYAbwBuAHQAdABiAGwAewBcAGYAMAAgAEMAYQBsAGkAYgByAGkAOwB9AHsAXABmADEAIABUAGkAbQBlAHMAIABOAGUAdwAgAFIAbwBtAGEAbgA7AH0AfQB7AFwAYwBvAGwAbwByAHQAYgBsACAAOwBcAHIAZQBkADAAXABnAHIAZQBlAG4AMABcAGIAbAB1AGUAMAAgADsAXAByAGUAZAAwAFwAZwByAGUAZQBuADAAXABiAGwAdQBlADIANQA1ACAAOwB9AHsAXAAqAFwAZABlAGYAYwBoAHAAIABcAGYAMQBcAGYAcwAyADQAfQB7AFwAcwB0AHkAbABlAHMAaABlAGUAdAAgAHsAXABxAGwAXABmADEAXABmAHMAMgA0ACAATgBvAHIAbQBhAGwAOwB9AHsAXAAqAFwAYwBzADEAXABmADEAXABmAHMAMgA0AFwAYwBmADEAIABEAGUAZgBhAHUAbAB0ACAAUABhAHIAYQBnAHIAYQBwAGgAIABGAG8AbgB0ADsAfQB7AFwAKgBcAGMAcwAyAFwAcwBiAGEAcwBlAGQAbwBuADEAXABmADEAXABmAHMAMgA0AFwAYwBmADEAIABMAGkAbgBlACAATgB1AG0AYgBlAHIAOwB9AHsAXAAqAFwAYwBzADMAXAB1AGwAXABmADEAXABmAHMAMgA0AFwAYwBmADIAIABIAHkAcABlAHIAbABpAG4AawA7AH0AewBcACoAXAB0AHMANABcAHQAcwByAG8AdwBkAFwAZgAxAFwAZgBzADIANABcAHEAbABcAHQAcwBjAGUAbABsAHAAYQBkAGQAZgBsADMAXAB0AHMAYwBlAGwAbABwAGEAZABkAGwAMQAwADgAXAB0AHMAYwBlAGwAbABwAGEAZABkAGYAYgAzAFwAdABzAGMAZQBsAGwAcABhAGQAZABmAHIAMwBcAHQAcwBjAGUAbABsAHAAYQBkAGQAcgAxADAAOABcAHQAcwBjAGUAbABsAHAAYQBkAGQAZgB0ADMAXAB0AHMAdgBlAHIAdABhAGwAdABcAGMAbAB0AHgAbAByAHQAYgAgAE4AbwByAG0AYQBsACAAVABhAGIAbABlADsAfQB7AFwAKgBcAHQAcwA1AFwAdABzAHIAbwB3AGQAXABzAGIAYQBzAGUAZABvAG4ANABcAGYAMQBcAGYAcwAyADQAXABxAGwAXAB0AHIAYgByAGQAcgB0AFwAYgByAGQAcgBzAFwAYgByAGQAcgB3ADEAMABcAHQAcgBiAHIAZAByAGwAXABiAHIAZAByAHMAXABiAHIAZAByAHcAMQAwAFwAdAByAGIAcgBkAHIAYgBcAGIAcgBkAHIAcwBcAGIAcgBkAHIAdwAxADAAXAB0AHIAYgByAGQAcgByAFwAYgByAGQAcgBzAFwAYgByAGQAcgB3ADEAMABcAHQAcgBiAHIAZAByAGgAXABiAHIAZAByAHMAXABiAHIAZAByAHcAMQAwAFwAdAByAGIAcgBkAHIAdgBcAGIAcgBkAHIAcwBcAGIAcgBkAHIAdwAxADAAXAB0AHMAYwBlAGwAbABwAGEAZABkAGYAbAAzAFwAdABzAGMAZQBsAGwAcABhAGQAZABsADEAMAA4AFwAdABzAGMAZQBsAGwAcABhAGQAZABmAHIAMwBcAHQAcwBjAGUAbABsAHAAYQBkAGQAcgAxADAAOABcAHQAcwB2AGUAcgB0AGEAbAB0AFwAYwBsAHQAeABsAHIAdABiACAAVABhAGIAbABlACAAUwBpAG0AcABsAGUAIAAxADsAfQB9AHsAXAAqAFwAbABpAHMAdABvAHYAZQByAHIAaQBkAGUAdABhAGIAbABlAH0AXABuAG8AdQBpAGMAbwBtAHAAYQB0AFwAcwBwAGwAeQB0AHcAbgBpAG4AZQBcAGgAdABtAGEAdQB0AHMAcABcAHAAYQByAGQAXABwAGwAYQBpAG4AXABxAGwAewBcACoAXABiAGsAbQBrAHMAdABhAHIAdAAgAF8AZAB4AF8AZgByAGEAZwBfAFMAdABhAHIAdABGAHIAYQBnAG0AZQBuAHQAfQB7AFwAKgBcAGIAawBtAGsAZQBuAGQAIABfAGQAeABfAGYAcgBhAGcAXwBTAHQAYQByAHQARgByAGEAZwBtAGUAbgB0AH0AXABsAGEAbgBnADcAXABsAGEAbgBnAGYAZQA3AFwAZgAxAFwAZgBzADIANABcAGMAZgAxAFwAcABhAHIAfQA=
+
+
+ 17, 17
+
+
\ No newline at end of file
diff --git a/Report/Report.csproj b/Report/Report.csproj
index 403ceb0ab..626c4c552 100644
--- a/Report/Report.csproj
+++ b/Report/Report.csproj
@@ -162,6 +162,12 @@
BewertungsstatistikReport.cs
+
+ Component
+
+
+ VorlageReport.cs
+
Component
@@ -464,11 +470,16 @@
+
BewertungsstatistikReport.cs
+
+ VorlageReport.cs
+ Designer
+
RosterReport.cs
Designer
diff --git a/Report/ReportObjects/VorlageRO.cs b/Report/ReportObjects/VorlageRO.cs
new file mode 100644
index 000000000..467f5c35a
--- /dev/null
+++ b/Report/ReportObjects/VorlageRO.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BeWo.Report.ReportObjects
+{
+ public class VorlageRO : AbstractBeWoReportObject
+ {
+ public string RTFText { get; set; }
+
+ public static VorlageRO Create(string RTFText)
+ {
+ var ro = new VorlageRO();
+ ro.RTFText = RTFText;
+
+ return ro;
+ }
+
+ }
+}
diff --git a/Service/ServiceContracts/IOperationsService.cs b/Service/ServiceContracts/IOperationsService.cs
index f44b321b2..3ac6dbb5e 100644
--- a/Service/ServiceContracts/IOperationsService.cs
+++ b/Service/ServiceContracts/IOperationsService.cs
@@ -990,12 +990,20 @@ namespace BeWo.Service.ServiceContracts
[FaultContract(typeof(BeWoFault))]
[OperationContract]
- void InsertTemplate(DokumentvorlageDC dc);
+ DokumentvorlageDC InsertTemplate(DokumentvorlageDC dc);
+
+ [FaultContract(typeof(BeWoFault))]
+ [OperationContract]
+ List GetPlatzhalterForSupportConcept();
[FaultContract(typeof(BeWoFault))]
[OperationContract]
List GetPlatzhalterForCustomer();
+ [FaultContract(typeof(BeWoFault))]
+ [OperationContract]
+ List GetPlatzhalterForEmployee();
+
[FaultContract(typeof(BeWoFault))]
[OperationContract]
BeWoFolderDC GetFolderById(long oid);
@@ -1016,5 +1024,21 @@ namespace BeWo.Service.ServiceContracts
[OperationContract]
void DeleteTemplates(List vorlagen);
+ [FaultContract(typeof(BeWoFault))]
+ [OperationContract]
+ string ReplacePlaceholdersInTemplate(DokumentvorlageDC template, long? objectOid, long? tableOid);
+
+
+ [FaultContract(typeof(BeWoFault))]
+ [OperationContract]
+ void InsertFileAttachment(FileAttachmentDC fileAttachmentDC);
+
+ [FaultContract(typeof(BeWoFault))]
+ [OperationContract]
+ List SearchForFiles(string nutzereingabe);
+
+ [FaultContract(typeof(BeWoFault))]
+ [OperationContract]
+ string GetObjectForFilePath(TableID table, long? oid);
}
}
\ No newline at end of file
diff --git a/Service/ServiceImplementations/OperationsServiceImp.cs b/Service/ServiceImplementations/OperationsServiceImp.cs
index 823def4ea..33164ba53 100644
--- a/Service/ServiceImplementations/OperationsServiceImp.cs
+++ b/Service/ServiceImplementations/OperationsServiceImp.cs
@@ -6568,7 +6568,7 @@ namespace BeWo.Service.ServiceImplementations
}
}
- public void InsertTemplate(DokumentvorlageDC dc)
+ public DokumentvorlageDC InsertTemplate(DokumentvorlageDC dc)
{
try
{
@@ -6576,12 +6576,17 @@ namespace BeWo.Service.ServiceImplementations
{
var entity = MapperFactory.DokumentvorlageDC_Dokumentvorlage.MapToNewEntity(dc);
DAOFactory.GenericDAO.Insert(entity);
+
+ return dc;
}
else
{
var origTemplate = DAOFactory.GenericDAO.LoadByID((long)dc.DokumentvorlageOid);
MapperFactory.DokumentvorlageDC_Dokumentvorlage.MergeWithEntity(dc, origTemplate);
DAOFactory.GenericDAO.Update(origTemplate);
+
+ var updatedTemplateDC = MapperFactory.DokumentvorlageDC_Dokumentvorlage.MapToNewDC(origTemplate);
+ return updatedTemplateDC;
}
}
catch (Exception ex)
@@ -6594,99 +6599,74 @@ namespace BeWo.Service.ServiceImplementations
try
{
List liste = new List();
- //Personendaten
+
PlatzhalterDC personendaten = new PlatzhalterDC()
{
- Bezeichnung = "Personendaten",
+ Bezeichnung = "-Personendaten-",
Children = new List()
};
#region Children Personendaten
- PlatzhalterDC anrede = new PlatzhalterDC() { Bezeichnung = "Anrede" };
+ PlatzhalterDC anrede = new PlatzhalterDC() { Bezeichnung = "Anrede", Platzhalter = "Anrede" };
personendaten.Children.Add(anrede);
- PlatzhalterDC vorname = new PlatzhalterDC() { Bezeichnung = "Vorname" };
+ PlatzhalterDC vorname = new PlatzhalterDC() { Bezeichnung = "Vorname", Platzhalter = "Vorname" };
personendaten.Children.Add(vorname);
- PlatzhalterDC nachname = new PlatzhalterDC() { Bezeichnung = "Nachname" };
+ PlatzhalterDC nachname = new PlatzhalterDC() { Bezeichnung = "Nachname", Platzhalter = "Nachname" };
personendaten.Children.Add(nachname);
- PlatzhalterDC gebDatum = new PlatzhalterDC() { Bezeichnung = "Geburtsdatum" };
+ PlatzhalterDC gebDatum = new PlatzhalterDC() { Bezeichnung = "Geburtsdatum", Platzhalter = "Geburtsdatum" };
personendaten.Children.Add(gebDatum);
- PlatzhalterDC gebOrt = new PlatzhalterDC() { Bezeichnung = "Geburtsort" };
- personendaten.Children.Add(gebOrt);
- PlatzhalterDC telefonnummer = new PlatzhalterDC() { Bezeichnung = "Telefonnummer" };
+ PlatzhalterDC telefonnummer = new PlatzhalterDC() { Bezeichnung = "Telefonnummer", Platzhalter = "Telefonnummer" };
personendaten.Children.Add(telefonnummer);
- PlatzhalterDC email = new PlatzhalterDC() { Bezeichnung = "E-Mail-Adresse" };
+ PlatzhalterDC handynummer = new PlatzhalterDC() { Bezeichnung = "Handynummer", Platzhalter = "Handynummer" };
+ personendaten.Children.Add(handynummer);
+ PlatzhalterDC email = new PlatzhalterDC() { Bezeichnung = "E-Mail-Adresse", Platzhalter = "Email" };
personendaten.Children.Add(email);
- PlatzhalterDC berufsbezeichnung = new PlatzhalterDC() { Bezeichnung = "Berufsbezeichnung" };
+ PlatzhalterDC fax = new PlatzhalterDC() { Bezeichnung = "Fax", Platzhalter = "Fax" };
+ personendaten.Children.Add(fax);
+ PlatzhalterDC berufsbezeichnung = new PlatzhalterDC() { Bezeichnung = "Berufsbezeichnung", Platzhalter = "Berufsbezeichnung" };
personendaten.Children.Add(berufsbezeichnung);
#endregion Children Personendaten
PlatzhalterDC adressdatenKlient = new PlatzhalterDC()
{
- Bezeichnung = "Adressdaten Klient",
+ Bezeichnung = "-Adressdaten Klient/-in-",
Children = new List()
};
- #region Children Adressdaten Klient
- PlatzhalterDC strasse = new PlatzhalterDC() { Bezeichnung = "Straße" };
+ #region Children Adressdaten Klient/-in
+ PlatzhalterDC strasse = new PlatzhalterDC() { Bezeichnung = "Straße", Platzhalter = "KlientStrasse" };
adressdatenKlient.Children.Add(strasse);
- PlatzhalterDC hausnr = new PlatzhalterDC() { Bezeichnung = "Hausnummer" };
- adressdatenKlient.Children.Add(hausnr);
- PlatzhalterDC plz = new PlatzhalterDC() { Bezeichnung = "PLZ" };
+ PlatzhalterDC plz = new PlatzhalterDC() { Bezeichnung = "PLZ", Platzhalter = "KlientPLZ" };
adressdatenKlient.Children.Add(plz);
- PlatzhalterDC ort = new PlatzhalterDC() { Bezeichnung = "Ort" };
+ PlatzhalterDC ort = new PlatzhalterDC() { Bezeichnung = "Ort", Platzhalter = "KlientOrt" };
adressdatenKlient.Children.Add(ort);
#endregion
- PlatzhalterDC adressdatenOrganisation = new PlatzhalterDC()
+ PlatzhalterDC betreuung = new PlatzhalterDC()
{
- Bezeichnung = "Adressdaten Organisation",
+ Bezeichnung = "-Betreuung-",
Children = new List()
};
- #region Children Adressdaten Organisation
- PlatzhalterDC adressat = new PlatzhalterDC() { Bezeichnung = "Adressat" };
- adressdatenOrganisation.Children.Add(adressat);
- PlatzhalterDC strasseOrga = new PlatzhalterDC() { Bezeichnung = "Straße" };
- adressdatenOrganisation.Children.Add(strasseOrga);
- PlatzhalterDC hausnrOrga = new PlatzhalterDC() { Bezeichnung = "Hausnummer" };
- adressdatenOrganisation.Children.Add(hausnrOrga);
- PlatzhalterDC plzOrga = new PlatzhalterDC() { Bezeichnung = "PLZ" };
- adressdatenOrganisation.Children.Add(plzOrga);
- PlatzhalterDC ortOrga = new PlatzhalterDC() { Bezeichnung = "Ort" };
- adressdatenOrganisation.Children.Add(ortOrga);
+ #region Children Betreuung
+ //PlatzhalterDC ansprechpartner = new PlatzhalterDC() { Bezeichnung = "Ansprechpartner/-in", Platzhalter = "Ansprechpartner/-in" };
+ //betreuung.Children.Add(ansprechpartner);
+ //PlatzhalterDC kostenstelle = new PlatzhalterDC() { Bezeichnung = "Kostenstelle", Platzhalter = "Kostenstelle" };
+ //betreuung.Children.Add(kostenstelle);
#endregion
+ PlatzhalterDC sonstiges = new PlatzhalterDC()
+ {
+ Bezeichnung = "-Sonstiges-",
+ Children = new List()
+ };
+ #region Children Sonstiges
+ PlatzhalterDC datum = new PlatzhalterDC() { Bezeichnung = "Datum", Platzhalter = "Datum" };
+ sonstiges.Children.Add(datum);
+ #endregion
liste.Add(personendaten);
liste.Add(adressdatenKlient);
- liste.Add(adressdatenOrganisation);
-
- return liste;
- /*
- *--Personendaten
- * Anrede
- * Vorname
- * Nachname
- * Geburtsdatum
- * Geburtsort
- * Telefonnummer
- * E-Mail
- * Berufsbezeichnung
- *
- * --Adressdaten Klient
- * Straße
- * Hausnummer
- * PLZ
- * Ort
- *
- * --Adressdaten Organisation
- * Adressat
- * Straße
- * Hausnummer
- * PLZ
- * Ort
- *
- * --Sonstiges
- * Datum
- * Ort
- *
- */
+ //liste.Add(adressdatenOrganisation);
+ liste.Add(betreuung);
+ liste.Add(sonstiges);
return liste;
+
}
catch (Exception ex)
{
@@ -6699,6 +6679,70 @@ namespace BeWo.Service.ServiceImplementations
{
List liste = new List();
+ PlatzhalterDC hilfeplanDaten = new PlatzhalterDC()
+ {
+ Bezeichnung = "-Hilfeplandaten-",
+ Children = new List()
+ };
+ #region Children HilfeplanDaten
+ //PlatzhalterDC klient = new PlatzhalterDC() { Bezeichnung = "Klient", Platzhalter = "Klient" };
+ //hilfeplanDaten.Children.Add(klient);
+ PlatzhalterDC bewilligungsdatum = new PlatzhalterDC() { Bezeichnung = "Bewilligungsdatum", Platzhalter = "Bewilligungsdatum" };
+ hilfeplanDaten.Children.Add(bewilligungsdatum);
+ #endregion
+ PlatzhalterDC klient = new PlatzhalterDC()
+ {
+ Bezeichnung = "-Klient-",
+ Children = new List()
+ };
+ #region Children Klient
+ PlatzhalterDC klientanrede = new PlatzhalterDC() { Bezeichnung = "Anrede", Platzhalter = "KlientAnrede" };
+ klient.Children.Add(klientanrede);
+ PlatzhalterDC klientnachname = new PlatzhalterDC() { Bezeichnung = "Nachname", Platzhalter = "KlientNachname" };
+ klient.Children.Add(klientnachname);
+ PlatzhalterDC klientvorname = new PlatzhalterDC() { Bezeichnung = "Vorname", Platzhalter = "KlientVorname" };
+ klient.Children.Add(klientvorname);
+ PlatzhalterDC klientgeburtsdatum = new PlatzhalterDC() { Bezeichnung = "Geburtsdatum", Platzhalter = "KlientGeburtsdatum" };
+ klient.Children.Add(klientgeburtsdatum);
+ PlatzhalterDC klienttelefonnummer = new PlatzhalterDC() { Bezeichnung = "Telefonnummer", Platzhalter = "KlientTelefonnummer" };
+ klient.Children.Add(klienttelefonnummer);
+ PlatzhalterDC klienthandynummer = new PlatzhalterDC() { Bezeichnung = "Handynummer", Platzhalter = "KlientHandynummer" };
+ klient.Children.Add(klienthandynummer);
+ PlatzhalterDC klientemail = new PlatzhalterDC() { Bezeichnung = "E-Mail-Adresse", Platzhalter = "KlientEmail" };
+ klient.Children.Add(klientemail);
+ PlatzhalterDC klientfax = new PlatzhalterDC() { Bezeichnung = "Fax", Platzhalter = "KlientFax" };
+ klient.Children.Add(klientfax);
+ #endregion
+ PlatzhalterDC betreuer = new PlatzhalterDC()
+ {
+ Bezeichnung = "-Betreuer-",
+ Children = new List()
+ };
+ #region Children Betreuer
+ PlatzhalterDC betreueranrede = new PlatzhalterDC() { Bezeichnung = "Anrede", Platzhalter = "BetreuerAnrede" };
+ betreuer.Children.Add(betreueranrede);
+ PlatzhalterDC betreuernachname = new PlatzhalterDC() { Bezeichnung = "Nachname", Platzhalter = "BetreuerNachname" };
+ betreuer.Children.Add(betreuernachname);
+ PlatzhalterDC betreuervorname = new PlatzhalterDC() { Bezeichnung = "Vorname", Platzhalter = "BetreuerVorname" };
+ betreuer.Children.Add(betreuervorname);
+ PlatzhalterDC mitarbeiternummer = new PlatzhalterDC() { Bezeichnung = "Mitarbeiternummer", Platzhalter = "Mitarbeiternummer" };
+ betreuer.Children.Add(mitarbeiternummer);
+ #endregion
+ PlatzhalterDC sonstiges = new PlatzhalterDC()
+ {
+ Bezeichnung = "-Sonstiges-",
+ Children = new List()
+ };
+ #region Children Sonstiges
+ PlatzhalterDC datum = new PlatzhalterDC() { Bezeichnung = "Datum", Platzhalter = "Datum" };
+ sonstiges.Children.Add(datum);
+ #endregion
+
+ liste.Add(hilfeplanDaten);
+ liste.Add(betreuer);
+ liste.Add(klient);
+ liste.Add(sonstiges);
+
return liste;
}
catch (Exception ex)
@@ -6712,6 +6756,82 @@ namespace BeWo.Service.ServiceImplementations
{
List liste = new List();
+ PlatzhalterDC mitarbeiterdaten = new PlatzhalterDC()
+ {
+ Bezeichnung = "-Mitarbeiterdaten-",
+ Children = new List()
+ };
+ #region Children Mitarbeiterdaten
+ PlatzhalterDC anrede = new PlatzhalterDC() { Bezeichnung = "Anrede", Platzhalter = "Anrede" };
+ mitarbeiterdaten.Children.Add(anrede);
+ PlatzhalterDC vorname = new PlatzhalterDC() { Bezeichnung = "Vorname", Platzhalter = "Vorname" };
+ mitarbeiterdaten.Children.Add(vorname);
+ PlatzhalterDC nachname = new PlatzhalterDC() { Bezeichnung = "Nachname", Platzhalter = "Nachname" };
+ mitarbeiterdaten.Children.Add(nachname);
+ PlatzhalterDC gebDatum = new PlatzhalterDC() { Bezeichnung = "Geburtsdatum", Platzhalter = "Geburtsdatum" };
+ mitarbeiterdaten.Children.Add(gebDatum);
+ PlatzhalterDC telefonnummer = new PlatzhalterDC() { Bezeichnung = "Telefonnummer", Platzhalter = "Telefonnummer" };
+ mitarbeiterdaten.Children.Add(telefonnummer);
+ PlatzhalterDC handynummer = new PlatzhalterDC() { Bezeichnung = "Handynummer", Platzhalter = "Handynummer" };
+ mitarbeiterdaten.Children.Add(handynummer);
+ PlatzhalterDC email = new PlatzhalterDC() { Bezeichnung = "E-Mail-Adresse", Platzhalter = "Email" };
+ mitarbeiterdaten.Children.Add(email);
+ PlatzhalterDC emailPrivat = new PlatzhalterDC() { Bezeichnung = "E-Mail-Adresse Privat", Platzhalter = "EmailPrivat" };
+ mitarbeiterdaten.Children.Add(emailPrivat);
+ PlatzhalterDC fax = new PlatzhalterDC() { Bezeichnung = "Fax", Platzhalter = "Fax" };
+ mitarbeiterdaten.Children.Add(fax);
+ PlatzhalterDC mitarbeiternummer = new PlatzhalterDC() { Bezeichnung = "Angestelltennummer", Platzhalter = "Angestelltennummer" };
+ mitarbeiterdaten.Children.Add(mitarbeiternummer);
+ PlatzhalterDC steuernummer = new PlatzhalterDC() { Bezeichnung = "Steuernummer", Platzhalter = "Steuernummer" };
+ mitarbeiterdaten.Children.Add(steuernummer);
+ PlatzhalterDC krankenkasse = new PlatzhalterDC() { Bezeichnung = "Krankenkasse", Platzhalter = "Krankenkasse" };
+ mitarbeiterdaten.Children.Add(krankenkasse);
+ PlatzhalterDC versicherungsnummer = new PlatzhalterDC() { Bezeichnung = "Versichertennummer", Platzhalter = "Versichertennummer" };
+ mitarbeiterdaten.Children.Add(versicherungsnummer);
+ #endregion
+ PlatzhalterDC adressdatenMitarbeiter = new PlatzhalterDC()
+ {
+ Bezeichnung = "-Adressdaten Mitarbeiter/-in-",
+ Children = new List()
+ };
+ #region Children Adressdaten Mitarbeiter/-in
+ PlatzhalterDC strasse = new PlatzhalterDC() { Bezeichnung = "Straße", Platzhalter = "MitarbeiterStrasse" };
+ adressdatenMitarbeiter.Children.Add(strasse);
+ PlatzhalterDC plz = new PlatzhalterDC() { Bezeichnung = "PLZ", Platzhalter = "MitarbeiterPLZ" };
+ adressdatenMitarbeiter.Children.Add(plz);
+ PlatzhalterDC ort = new PlatzhalterDC() { Bezeichnung = "Ort", Platzhalter = "MitarbeiterOrt" };
+ adressdatenMitarbeiter.Children.Add(ort);
+ #endregion
+ //PlatzhalterDC adressdatenOrganisation = new PlatzhalterDC()
+ //{
+ // Bezeichnung = "-Adressdaten Organisation-",
+ // Children = new List()
+ //};
+ #region Children Adressdaten Organisation
+ //PlatzhalterDC adressat = new PlatzhalterDC() { Bezeichnung = "Organisation", Platzhalter = "Organisation" };
+ //adressdatenOrganisation.Children.Add(adressat);
+ //PlatzhalterDC strasseOrga = new PlatzhalterDC() { Bezeichnung = "Straße", Platzhalter = "OrgaStrasse" };
+ //adressdatenOrganisation.Children.Add(strasseOrga);
+ //PlatzhalterDC plzOrga = new PlatzhalterDC() { Bezeichnung = "PLZ", Platzhalter = "OrgaPLZ" };
+ //adressdatenOrganisation.Children.Add(plzOrga);
+ //PlatzhalterDC ortOrga = new PlatzhalterDC() { Bezeichnung = "Ort", Platzhalter = "OrgaOrt" };
+ //adressdatenOrganisation.Children.Add(ortOrga);
+ #endregion
+ PlatzhalterDC sonstiges = new PlatzhalterDC()
+ {
+ Bezeichnung = "-Sonstiges-",
+ Children = new List()
+ };
+ #region Children Sonstiges
+ PlatzhalterDC datum = new PlatzhalterDC() { Bezeichnung = "Datum", Platzhalter = "Datum" };
+ sonstiges.Children.Add(datum);
+ #endregion
+
+ liste.Add(mitarbeiterdaten);
+ liste.Add(adressdatenMitarbeiter);
+ //liste.Add(adressdatenOrganisation);
+ liste.Add(sonstiges);
+
return liste;
}
catch (Exception ex)
@@ -6779,7 +6899,852 @@ namespace BeWo.Service.ServiceImplementations
throw Utils.CreateBeWoFaultException(e);
}
}
+
+ public string ReplacePlaceholdersInTemplate(DokumentvorlageDC template, long? objectOid, long? tableOid)
+ {
+ try
+ {
+ string adaptedRTF = "";
+
+ switch(tableOid)
+ {
+ case 2: adaptedRTF = EmployeeTemplate(objectOid, template.RTFText);break;
+ case 8: adaptedRTF = CustomerTemplate(objectOid, template.RTFText);break;
+ case 15: adaptedRTF = SupportConceptTemplate(objectOid, template.RTFText);break;
+ }
+
+ return adaptedRTF;
+ }
+ catch(Exception e)
+ {
+ throw Utils.CreateBeWoFaultException(e);
+ }
+ }
+
+ private string EmployeeTemplate(long? objectOid, string RTFWithPlaceholders)
+ {
+ try
+ {
+ bool allSet = true;
+ List attributeList = new List();
+ string attributeString = "";
+
+ var employee = DAOFactory.GenericDAO.GetByID((long)objectOid);
+ var contacts = employee.Person.Contacts;
+
+
+ string RTFText = RTFWithPlaceholders;
+
+ #region Auf verschiedene Platzhalter prüfen
+ if (RTFText.Contains("[Anrede]") || RTFText.Contains("[Anrede") || RTFText.Contains("Anrede]"))
+ {
+ if (employee.Person.Sex == Sex.Male)
+ RTFText = RTFText.Replace("Anrede", "Sehr geehrter Herr");
+ else if (employee.Person.Sex == Sex.Female)
+ RTFText = RTFText.Replace("Anrede", "Sehr geehrte Frau");
+ //else
+ //{
+ // attributeList.Add("Geschlecht");
+ // allSet = false;
+ //}
+ }
+ if (RTFText.Contains("[Vorname]") || RTFText.Contains("[Vorname") || RTFText.Contains("Vorname]"))
+ {
+ //if (employee.Person.FirstName.IsNullOrEmpty())
+ //{
+ // attributeList.Add("Vorname");
+ // allSet = false;
+ //}
+ //else
+ RTFText = RTFText.Replace("Vorname", employee.Person.FirstName);
+ }
+ if (RTFText.Contains("[Nachname]") || RTFText.Contains("[Nachname") || RTFText.Contains("Nachname]"))
+ {
+ //if (employee.Person.LastName.IsNullOrEmpty())
+ //{
+ // attributeList.Add("Nachname");
+ // allSet = false;
+ //}
+ //else
+ RTFText = RTFText.Replace("Nachname", employee.Person.LastName);
+ }
+ if (RTFText.Contains("[Geburtsdatum]") || RTFText.Contains("[Geburtsdatum") || RTFText.Contains("Geburtsdatum]"))
+ {
+ string[] dateAndTime = employee.Person.DateOfBirth.ToString().Split(' ');
+ //if (dateAndTime[0].IsNullOrEmpty())
+ //{
+ // allSet = false;
+ // attributeList.Add("Geburtsdatum");
+ //}
+ //else
+ RTFText = RTFText.Replace("Geburtsdatum", dateAndTime[0]);
+ }
+ if (RTFText.Contains("[Geburtsort]") || RTFText.Contains("[Geburtsort") || RTFText.Contains("Geburtsort]"))
+ {
+ //if (employee.TaxNumber.IsNullOrEmpty())
+ //{
+ // attributeList.Add("Steuernummer");
+ // allSet = false;
+ //}
+ //else
+ RTFText = RTFText.Replace("Steuernummer", employee.TaxNumber);
+ }
+ if (RTFText.Contains("[Telefonnummer]") || RTFText.Contains("[Telefonnummer") || RTFText.Contains("Telefonnummer]"))
+ {
+ string phone = "";
+ foreach (Contact c in contacts)
+ {
+ if (c.Type == ContactType.business_Phone)
+ {
+ phone = c.Value;
+ break;
+ }
+ }
+ //if (phone.IsNullOrEmpty())
+ //{
+ // attributeList.Add("Telefonnummer");
+ // allSet = false;
+ //}
+ //else
+ RTFText = RTFText.Replace("Telefonnummer", phone);
+ }
+ if (RTFText.Contains("[Handynummer]") || RTFText.Contains("[Handynummer") || RTFText.Contains("Handynummer]"))
+ {
+ string mobile = "";
+ foreach (Contact c in contacts)
+ {
+ if (c.Type == ContactType.business_MobilePhone)
+ {
+ mobile = c.Value;
+ break;
+ }
+
+ }
+ //if (mobile.IsNullOrEmpty())
+ //{
+ // attributeList.Add("Handynummer");
+ // allSet = false;
+ //}
+ //else
+ RTFText = RTFText.Replace("Handynummer", mobile);
+ }
+ if (RTFText.Contains("[EmailPrivat]") || RTFText.Contains("[EmailPrivat") || RTFText.Contains("EmailPrivat]"))
+ {
+ string email = "";
+ foreach (Contact c in contacts)
+ {
+ if (c.Type == ContactType.private_Mail)
+ {
+ email = c.Value;
+ break;
+ }
+ }
+ //if (email.IsNullOrEmpty())
+ //{
+ // attributeList.Add("private Email-Adresse");
+ // allSet = false;
+ //}
+ //else
+ RTFText = RTFText.Replace("EmailPrivat", email);
+ }
+ if (RTFText.Contains("[Email]") || RTFText.Contains("[Email") || RTFText.Contains("Email]"))
+ {
+ string email = "";
+ foreach (Contact c in contacts)
+ {
+ if (c.Type == ContactType.business_Mail)
+ {
+ email = c.Value;
+ break;
+ }
+ }
+ //if (email.IsNullOrEmpty())
+ //{
+ // attributeList.Add("Email-Adresse");
+ // allSet = false;
+ //}
+ //else
+ RTFText = RTFText.Replace("Email", email);
+ }
+ if (RTFText.Contains("[Fax]") || RTFText.Contains("[Fax") || RTFText.Contains("Fax]"))
+ {
+ string fax = "";
+ foreach (Contact c in contacts)
+ {
+ if (c.Type == ContactType.business_Fax)
+ {
+ fax = c.Value;
+ break;
+ }
+ }
+ //if (fax.IsNullOrEmpty())
+ //{
+ // attributeList.Add("Fax");
+ // allSet = false;
+ //}
+ //else
+ RTFText = RTFText.Replace("Fax", fax);
+ }
+ if (RTFText.Contains("[Angestelltennummer]") || RTFText.Contains("[Angestelltennummer") || RTFText.Contains("Angestelltennummer]"))
+ {
+ //if (employee.PersonnelNumber.IsNullOrEmpty())
+ //{
+ // attributeList.Add("Mitarbeiternummer");
+ // allSet = false;
+ //}
+ //else
+ RTFText = RTFText.Replace("Angestelltennummer", employee.PersonnelNumber);
+ }
+ if (RTFText.Contains("[Steuernummer]") || RTFText.Contains("[Steuernummer") || RTFText.Contains("Steuernummer]"))
+ {
+ //if (employee.TaxNumber.IsNullOrEmpty())
+ //{
+ // attributeList.Add("Steuernummer");
+ // allSet = false;
+ //}
+ //else
+ RTFText = RTFText.Replace("Steuernummer", employee.TaxNumber);
+ }
+ if (RTFText.Contains("[Krankenkasse]") || RTFText.Contains("[Krankenkasse") || RTFText.Contains("Krankenkasse]"))
+ {
+ //if (employee.HealthInsurance.IsNullOrEmpty())
+ //{
+ // attributeList.Add("Krankenkasse");
+ // allSet = false;
+ //}
+ //else
+ RTFText = RTFText.Replace("Krankenkasse", employee.HealthInsurance);
+ }
+ if (RTFText.Contains("[Versichertennummer]") || RTFText.Contains("[Versichertennummer") || RTFText.Contains("Versichertennummer]"))
+ {
+ //if (employee.InsuranceNumber.IsNullOrEmpty())
+ //{
+ // attributeList.Add("Versichertennummer");
+ // allSet = false;
+ //}
+ //else
+ RTFText = RTFText.Replace("Versichertennummer", employee.InsuranceNumber);
+ }
+
+ //Adressdaten
+ if(employee.Person.Address != null)
+ {
+ if (RTFText.Contains("[MitarbeiterStrasse]") || RTFText.Contains("[MitarbeiterStrasse") || RTFText.Contains("MitarbeiterStrasse]"))
+ {
+ //if (employee.Person.Address.Street.IsNullOrEmpty())
+ //{
+ // attributeList.Add("Straße");
+ // allSet = false;
+ //}
+ //else
+ RTFText = RTFText.Replace("MitarbeiterStrasse", employee.Person.Address.Street);
+ }
+ if (RTFText.Contains("[MitarbeiterPLZ]") || RTFText.Contains("[MitarbeiterPLZ") || RTFText.Contains("MitarbeiterPLZ]"))
+ {
+ //if (employee.Person.Address.PostalCode.IsNullOrEmpty())
+ //{
+ // attributeList.Add("Postleitzahl");
+ // allSet = false;
+ //}
+ //else
+ RTFText = RTFText.Replace("MitarbeiterPLZ", employee.Person.Address.PostalCode);
+ }
+ if (RTFText.Contains("[MitarbeiterOrt]") || RTFText.Contains("[MitarbeiterOrt") || RTFText.Contains("MitarbeiterOrt]"))
+ {
+ //if (employee.Person.Address.Town.IsNullOrEmpty())
+ //{
+ // attributeList.Add("Ort");
+ // allSet = false;
+ //}
+ //else
+ RTFText = RTFText.Replace("MitarbeiterOrt", employee.Person.Address.Town);
+ }
+ }
+
+
+ //Sonstiges
+ if (RTFText.Contains("[Datum]") || RTFText.Contains("[Datum") || RTFText.Contains("Datum]"))
+ {
+ string[] datum = DateTime.Now.ToString().Split(' ');
+ RTFText = RTFText.Replace("Datum", datum[0]);
+ }
+
+
+ RTFText = RTFText.Replace("[", "");
+ RTFText = RTFText.Replace("]", "");
+ #endregion
+
+ if (allSet)
+ return RTFText;
+ else
+ {
+ foreach (var s in attributeList)
+ {
+ attributeString += (s != attributeList.Last()) ? s + ", " : s;
+ }
+ MessageBox.Show("Seite für " + employee.Person.FirstNameLastName + " kann nicht erstellt werden, da folgende Attribute des Mitarbeiters nicht gesetzt sind:\n" +
+ attributeString + "\nSetzen Sie die Attribute und erstellen Sie die Druckvorscheu für den Mitarbeiter erneut.", "BeWoPlaner", MessageBoxButton.OK, MessageBoxImage.Warning);
+ return "";
+ }
+ }
+ catch (Exception e)
+ {
+ throw Utils.CreateBeWoFaultException(e);
+ }
+ }
+
+ private string CustomerTemplate(long? objectOid, string RTFWithPlaceholders)
+ {
+ try
+ {
+ bool allSet = true;
+ List attributeList = new List();
+ string attributeString = "";
+
+ var customer = DAOFactory.GenericDAO.GetByID((long)objectOid);
+ var contacts = customer.Person.Contacts;
+
+ string RTFText = RTFWithPlaceholders;
+
+ #region Auf verschiedene Platzhalter prüfen
+ if (RTFText.Contains("[Anrede]") || RTFText.Contains("[Anrede") || RTFText.Contains("Anrede]"))
+ {
+ if (customer.Person.Sex == Sex.Male)
+ RTFText = RTFText.Replace("Anrede", "Sehr geehrter Herr");
+ else if (customer.Person.Sex == Sex.Female)
+ RTFText = RTFText.Replace("Anrede", "Sehr geehrte Frau");
+ //else
+ //{
+ // attributeList.Add("Geschlecht");
+ // allSet = false;
+ //}
+ }
+ if (RTFText.Contains("[Vorname]") || RTFText.Contains("[Vorname") || RTFText.Contains("Vorname]"))
+ {
+ //if(customer.Person.FirstName.IsNullOrEmpty())
+ //{
+ // attributeList.Add("Vorname");
+ // allSet = false;
+ //}
+ //else
+ RTFText = RTFText.Replace("Vorname", customer.Person.FirstName);
+ }
+ if (RTFText.Contains("[Nachname]") || RTFText.Contains("[Nachname") || RTFText.Contains("Nachname]"))
+ {
+ //if (customer.Person.LastName.IsNullOrEmpty())
+ //{
+ // attributeList.Add("Nachname");
+ // allSet = false;
+ //}
+ //else
+ RTFText = RTFText.Replace("Nachname", customer.Person.LastName);
+ }
+ if (RTFText.Contains("[Geburtsdatum]") || RTFText.Contains("[Geburtsdatum") || RTFText.Contains("Geburtsdatum]"))
+ {
+
+ string[] dateAndTime = customer.Person.DateOfBirth.ToString().Split(' ');
+ //if(dateAndTime[0].IsNullOrEmpty())
+ //{
+ // allSet = false;
+ // attributeList.Add("Geburtsdatum");
+ //}
+ //else
+ RTFText = RTFText.Replace("Geburtsdatum", dateAndTime[0]);
+ }
+ if (RTFText.Contains("[Telefonnummer]") || RTFText.Contains("[Telefonnummer") || RTFText.Contains("Telefonnummer]"))
+ {
+ string phone = "";
+ foreach (Contact c in contacts)
+ {
+ if (c.Type == ContactType.business_Phone)
+ {
+ phone = c.Value;
+ break;
+ }
+ }
+
+ //if (phone.IsNullOrEmpty())
+ //{
+ // attributeList.Add("Telefonnummer");
+ // allSet = false;
+ //}
+ //else
+ RTFText = RTFText.Replace("Telefonnummer", phone);
+ }
+ if (RTFText.Contains("[Handynummer]") || RTFText.Contains("[Handynummer") || RTFText.Contains("Handynummer]"))
+ {
+ string mobile = "";
+ foreach (Contact c in contacts)
+ {
+ if (c.Type == ContactType.business_MobilePhone)
+ {
+ mobile = c.Value;
+ break;
+ }
+
+ }
+
+ //if (mobile.IsNullOrEmpty())
+ //{
+ // attributeList.Add("Handynummer");
+ // allSet = false;
+ //}
+ //else
+ RTFText = RTFText.Replace("Handynummer", mobile);
+ }
+ if (RTFText.Contains("[Email]") || RTFText.Contains("[Email") || RTFText.Contains("Email]"))
+ {
+ string email = "";
+ foreach (Contact c in contacts)
+ {
+ if (c.Type == ContactType.business_Mail)
+ {
+ email = c.Value;
+ break;
+ }
+ }
+
+ //if (email.IsNullOrEmpty())
+ //{
+ // attributeList.Add("Email-Adresse");
+ // allSet = false;
+ //}
+ //else
+ RTFText = RTFText.Replace("Email", email);
+ }
+ if (RTFText.Contains("[Fax]") || RTFText.Contains("[Fax") || RTFText.Contains("Fax]"))
+ {
+ string fax = "";
+ foreach (Contact c in contacts)
+ {
+ if (c.Type == ContactType.business_Fax)
+ {
+ fax = c.Value;
+ break;
+ }
+ }
+ //if (fax.IsNullOrEmpty())
+ //{
+ // attributeList.Add("Fax");
+ // allSet = false;
+ //}
+ //else
+ RTFText = RTFText.Replace("Fax", fax);
+ }
+ if (RTFText.Contains("[Berufsbezeichnung]") || RTFText.Contains("[Berufsbezeichnung") || RTFText.Contains("Berufsbezeichnung]"))
+ {
+ //if(customer.Person.Profession.IsNullOrEmpty())
+ //{
+ // attributeList.Add("Berufsbezeichnung");
+ // allSet = false;
+ //}
+ //else
+ RTFText = RTFText.Replace("Berufsbezeichnung", customer.Person.Profession);
+ }
+
+ //Adressdaten
+ if (customer.Person.Address != null)
+ {
+ if (RTFText.Contains("[KlientStrasse]") || RTFText.Contains("[KlientStrasse") || RTFText.Contains("KlientStrasse]"))
+ {
+ //if (customer.Person.Address.Street.IsNullOrEmpty())
+ //{
+ // attributeList.Add("Straße");
+ // allSet = false;
+ //}
+ //else
+ RTFText = RTFText.Replace("KlientStrasse", customer.Person.Address.Street);
+ }
+ if (RTFText.Contains("[KlientPLZ]") || RTFText.Contains("[KlientPLZ") || RTFText.Contains("KlientPLZ]"))
+ {
+ //if (customer.Person.Address.PostalCode.IsNullOrEmpty())
+ //{
+ // attributeList.Add("Postleitzahl");
+ // allSet = false;
+ //}
+ //else
+ RTFText = RTFText.Replace("KlientPLZ", customer.Person.Address.PostalCode);
+ }
+ if (RTFText.Contains("[KlientOrt]") || RTFText.Contains("[KlientOrt") || RTFText.Contains("KlientOrt]"))
+ {
+ //if (customer.Person.Address.Town.IsNullOrEmpty())
+ //{
+ // attributeList.Add("Ort");
+ // allSet = false;
+ //}
+ //else
+ RTFText = RTFText.Replace("KlientOrt", customer.Person.Address.Town);
+ }
+ }
+
+
+ //Betreuung
+ if (RTFText.Contains("[Ansprechpartner/-in]") || RTFText.Contains("[Ansprechpartner/-in") || RTFText.Contains("Ansprechpartner/-in]"))
+ {
+ //if (customer.Ansprechpartner == null)
+ //{
+ // attributeList.Add("Ansprechpartner");
+ // allSet = false;
+ //}
+ //else
+ //{
+ string anrede = (customer.Ansprechpartner.Sex == 0) ? "Herr " : "Frau ";
+ RTFText = RTFText.Replace("Ansprechpartner/-in", anrede + customer.Ansprechpartner.FirstNameLastName);
+ //}
+ }
+ if (RTFText.Contains("[Kostenstelle]") || RTFText.Contains("[Kostenstelle") || RTFText.Contains("Kostenstelle]"))
+ {
+ //if(customer.CostCenter.IsNullOrEmpty())
+ //{
+ // attributeList.Add("Kostenstelle");
+ // allSet = false;
+ //}
+ //else
+ RTFText = RTFText.Replace("Kostenstelle", customer.CostCenter);
+ }
+
+ //Sonstiges
+ if (RTFText.Contains("[Datum]") || RTFText.Contains("[Datum") || RTFText.Contains("Datum]"))
+ {
+ string[] datum = DateTime.Now.ToString().Split(' ');
+ RTFText = RTFText.Replace("Datum", datum[0]);
+ }
+
+
+ RTFText = RTFText.Replace("[", "");
+ RTFText = RTFText.Replace("]", "");
+ #endregion
+
+ if (allSet)
+ return RTFText;
+ else
+ {
+ foreach (var s in attributeList)
+ {
+ attributeString += (s != attributeList.Last()) ? s + ", " : s;
+ }
+ MessageBox.Show("Seite für " + customer.Person.FirstNameLastName + " kann nicht erstellt werden, da folgende Attribute des Klienten nicht gesetzt sind:\n" +
+ attributeString + "\nSetzen Sie die Attribute und erstellen Sie die Druckvorscheu für den Klienten erneut.","BeWoPlaner", MessageBoxButton.OK, MessageBoxImage.Warning);
+ return "";
+ }
+
+ }
+ catch (Exception e)
+ {
+ throw Utils.CreateBeWoFaultException(e);
+ }
+ }
+
+ private string SupportConceptTemplate(long? objectOid, string RTFWithPlaceholders)
+ {
+ try
+ {
+ var supportConcept = DAOFactory.GenericDAO.GetByID((long)objectOid);
+
+ bool allSet = true;
+ List attributeList = new List();
+ string attributeString = "";
+
+ string RTFText = RTFWithPlaceholders;
+
+ //Hilfeplan
+ if (RTFText.Contains("[Bewilligungsdatum]") || RTFText.Contains("[Bewilligungsdatum") || RTFText.Contains("Bewilligungsdatum]"))
+ {
+ string[] datum = supportConcept.ApprovalDate.ToString().Split(' ');
+
+ //if (datum[0].IsNullOrEmpty())
+ //{
+ // allSet = false;
+ // attributeList.Add("Bewilligungsdatum");
+ //}
+ //else
+ RTFText = RTFText.Replace("Bewilligungsdatum", datum[0]);
+ }
+
+ //Klient
+ var contacts = supportConcept.Customer.Person.Contacts;
+
+ if (RTFText.Contains("[KlientAnrede]") || RTFText.Contains("[KlientAnrede") || RTFText.Contains("KlientAnrede]"))
+ {
+ if (supportConcept.Customer.Person.Sex == Sex.Male)
+ RTFText = RTFText.Replace("KlientAnrede", "Sehr geehrter Herr");
+ else if (supportConcept.Customer.Person.Sex == Sex.Female)
+ RTFText = RTFText.Replace("KlientAnrede", "Sehr geehrte Frau");
+ //else
+ //{
+ // attributeList.Add("Klientengeschlecht");
+ // allSet = false;
+ //}
+ }
+ if (RTFText.Contains("[KlientNachname]") || RTFText.Contains("[KlientNachname") || RTFText.Contains("KlientNachname]"))
+ {
+ //if (supportConcept.Customer.Person.LastName.IsNullOrEmpty())
+ //{
+ // allSet = false;
+ // attributeList.Add("Klientennachname");
+ //}
+ //else
+ RTFText = RTFText.Replace("KlientNachname", supportConcept.Customer.Person.LastName);
+ }
+ if (RTFText.Contains("[KlientVorname]") || RTFText.Contains("[KlientVorname") || RTFText.Contains("KlientVorname]"))
+ {
+ //if (supportConcept.Customer.Person.FirstName.IsNullOrEmpty())
+ //{
+ // allSet = false;
+ // attributeList.Add("Klientenvorname");
+ //}
+ //else
+ RTFText = RTFText.Replace("KlientVorname", supportConcept.Customer.Person.FirstName);
+ }
+ if (RTFText.Contains("[KlientGeburtsdatum]") || RTFText.Contains("[KlientGeburtsdatum") || RTFText.Contains("KlientGeburtsdatum]"))
+ {
+ string[] dateAndTime = supportConcept.Customer.Person.DateOfBirth.ToString().Split(' ');
+ //if (dateAndTime[0].IsNullOrEmpty())
+ //{
+ // allSet = false;
+ // attributeList.Add("Geburtsdatum");
+ //}
+ //else
+ RTFText = RTFText.Replace("KlientGeburtsdatum", dateAndTime[0]);
+ }
+ if (RTFText.Contains("[KlientTelefonnummer]") || RTFText.Contains("[KlientTelefonnummer") || RTFText.Contains("KlientTelefonnummer]"))
+ {
+ string phone = "";
+ foreach (Contact c in contacts)
+ {
+ if (c.Type == ContactType.business_Phone)
+ {
+ phone = c.Value;
+ break;
+ }
+ }
+
+ //if (phone.IsNullOrEmpty())
+ //{
+ // attributeList.Add("Kliententelefonnummer");
+ // allSet = false;
+ //}
+ //else
+ RTFText = RTFText.Replace("KlientTelefonnummer", phone);
+ }
+ if (RTFText.Contains("[KlientHandynummer]") || RTFText.Contains("[KlientHandynummer") || RTFText.Contains("KlientHandynummer]"))
+ {
+ string mobile = "";
+ foreach (Contact c in contacts)
+ {
+ if (c.Type == ContactType.business_MobilePhone)
+ {
+ mobile = c.Value;
+ break;
+ }
+
+ }
+ //if (mobile.IsNullOrEmpty())
+ //{
+ // attributeList.Add("Klientenhandynummer");
+ // allSet = false;
+ //}
+ //else
+ RTFText = RTFText.Replace("KlientHandynummer", mobile);
+ }
+ if (RTFText.Contains("[KlientEmail]") || RTFText.Contains("[KlientEmail") || RTFText.Contains("KlientEmail]"))
+ {
+ string email = "";
+ foreach (Contact c in contacts)
+ {
+ if (c.Type == ContactType.business_Mail)
+ {
+ email = c.Value;
+ break;
+ }
+ }
+ //if (email.IsNullOrEmpty())
+ //{
+ // attributeList.Add("Klienten-Email-Adresse");
+ // allSet = false;
+ //}
+ //else
+ RTFText = RTFText.Replace("KlientEmail", email);
+ }
+ if (RTFText.Contains("[KlientFax]") || RTFText.Contains("[KlientFax") || RTFText.Contains("KlientFax]"))
+ {
+ string fax = "";
+ foreach (Contact c in contacts)
+ {
+ if (c.Type == ContactType.business_Fax)
+ {
+ fax = c.Value;
+ break;
+ }
+ }
+ //if (fax.IsNullOrEmpty())
+ //{
+ // attributeList.Add("Klientenfax");
+ // allSet = false;
+ //}
+ //else
+ RTFText = RTFText.Replace("KlientFax", fax);
+ }
+
+ //Betreuer
+ if (RTFText.Contains("[BetreuerAnrede]") || RTFText.Contains("[BetreuerAnrede") || RTFText.Contains("BetreuerAnrede]"))
+ {
+ if (supportConcept.Customer.Person.Sex == Sex.Male)
+ RTFText = RTFText.Replace("BetreuerAnrede", "Sehr geehrter Herr");
+ else if (supportConcept.Customer.Person.Sex == Sex.Female)
+ RTFText = RTFText.Replace("BetreuerAnrede", "Sehr geehrte Frau");
+ //else
+ //{
+ // attributeList.Add("Betreuergeschlecht");
+ // allSet = false;
+ //}
+ }
+ if (RTFText.Contains("[BetreuerNachname]") || RTFText.Contains("[BetreuerNachname") || RTFText.Contains("BetreuerNachname]"))
+ {
+ //if (supportConcept.Originator.Person.LastName.IsNullOrEmpty())
+ //{
+ // allSet = false;
+ // attributeList.Add("Betreuernachname");
+ //}
+ //else
+ RTFText = RTFText.Replace("BetreuerNachname", supportConcept.Originator.Person.LastName);
+ }
+ if (RTFText.Contains("[BetreuerVorname]") || RTFText.Contains("[BetreuerVorname") || RTFText.Contains("BetreuerVorname]"))
+ {
+ //if (supportConcept.Originator.Person.FirstName.IsNullOrEmpty())
+ //{
+ // allSet = false;
+ // attributeList.Add("Betreuervorname");
+ //}
+ //else
+ RTFText = RTFText.Replace("BetreuerVorname", supportConcept.Originator.Person.FirstName);
+ }
+ if (RTFText.Contains("[Mitarbeiternummer]") || RTFText.Contains("[Mitarbeiternummer") || RTFText.Contains("Mitarbeiternummer]"))
+ {
+ //if (supportConcept.Originator.PersonnelNumber.IsNullOrEmpty())
+ //{
+ // allSet = false;
+ // attributeList.Add("Mitarbeiternummer");
+ //}
+ //else
+ RTFText = RTFText.Replace("Mitarbeiternummer", supportConcept.Originator.PersonnelNumber);
+ }
+
+
+ //Sonstiges
+ if (RTFText.Contains("[Datum]") || RTFText.Contains("[Datum") || RTFText.Contains("Datum]"))
+ {
+ string[] datum = DateTime.Now.ToString().Split(' ');
+ RTFText = RTFText.Replace("Datum", datum[0]);
+ }
+
+
+ RTFText = RTFText.Replace("[", "");
+ RTFText = RTFText.Replace("]", "");
+
+ if (allSet)
+ return RTFText;
+ else
+ {
+ foreach (var s in attributeList)
+ {
+ attributeString += (s != attributeList.Last()) ? s + ", " : s;
+ }
+ MessageBox.Show("Seite für " + supportConcept.Customer.Person.FirstNameLastName + " kann nicht erstellt werden, da folgende Attribute des Hilfeplans nicht gesetzt sind:\n" +
+ attributeString + "\nSetzen Sie die Attribute und erstellen Sie die Druckvorschau für den Hilfeplan erneut.", "BeWoPlaner", MessageBoxButton.OK, MessageBoxImage.Warning);
+ return "";
+ }
+ }
+ catch (Exception e)
+ {
+ throw Utils.CreateBeWoFaultException(e);
+ }
+
+
+ }
+
+ public void InsertFileAttachment(FileAttachmentDC fileAttachmentDC)
+ {
+ var entity = new FileAttachment()
+ {
+ BeWoFolderOid = fileAttachmentDC.BeWoFolderOid,
+ Data = fileAttachmentDC.BinaryData,
+ InsTs = fileAttachmentDC.InsertedOn,
+ InsUser = fileAttachmentDC.InsertedBy,
+ IsActive = ActivationTypeId.Active,
+ ObjectOid = fileAttachmentDC.ObjectOid,
+ ObjectTid = fileAttachmentDC.ObjectTid,
+ Type = FileAttachmentType.NotSpecified,
+ Version = 1,
+ Path = fileAttachmentDC.FileName
+ };
+ entity = MapperFactory.FileAttachmentDC_FileAttachment.MergeWithEntity(fileAttachmentDC, entity);
+
+ DAOFactory.GenericDAO.Insert(entity);
+ }
+
+ public List SearchForFiles(string nutzereingabe)
+ {
+ List allFiles = MapperFactory.FileAttachmentDC_FileAttachment.MapToNewDCs(DAOFactory.GenericDAO.GetAllActive());
+ var list = DAOFactory.SearchDAO.FindFileattachmentOids(nutzereingabe);
+
+ List files = new List();
+
+ //foreach (var file in allFiles)
+ //{
+ // if (file.FileName.ToLower().Contains(nutzereingabe.ToLower()))
+ // files.Add(file);
+ //}
+
+
+ foreach (object[] info in list)
+ {
+
+ var dc = new FileAttachmentDC();
+ dc.FileAttachmentOid = info[0] as long?;
+ dc.BeWoFolderOid = info[1] as long?;
+ dc.ObjectOid = info[2] as long?;
+ dc.ObjectTid = (TableID)info[3];
+ dc.FileName = info[4].ToString();
+ files.Add(dc);
+ }
+ return files;
+ }
+
+ public string GetObjectForFilePath(TableID table, long? oid)
+ {
+ string objectName = "";
+
+ switch(table)
+ {
+ case TableID.ApplicationUser: objectName = (DAOFactory.GenericDAO.GetByID((long)oid)).LoginName; break;
+ case TableID.SupportConcept: var sc = DAOFactory.GenericDAO.GetByID((long)oid);
+ objectName = sc.Customer.Person.LastNameFirstName + " " + CustomizeDates(sc.StartDate, sc.EndDate); break;
+ case TableID.Customer: objectName = (DAOFactory.GenericDAO.GetByID((long)oid)).Person.LastNameFirstName; break;
+ case TableID.Organisation: objectName = (DAOFactory.GenericDAO.GetByID((long)oid)).Name; break;
+ case TableID.Person: objectName = (DAOFactory.GenericDAO.GetByID((long)oid)).LastNameFirstName; break;
+ case TableID.Employee: objectName = (DAOFactory.GenericDAO.GetByID((long)oid)).Person.LastNameFirstName; break;
+ case TableID.Team: objectName = (DAOFactory.GenericDAO.GetByID((long)oid)).Name; break;
+ case TableID.UserGroup: objectName = (DAOFactory.GenericDAO.GetByID((long)oid)).Name; break;
+ }
+
+ return objectName;
+ }
+ private string CustomizeDates(DateTime? startdate, DateTime? enddate)
+ {
+ string span = "";
+ string startday, endday, startmonth, endmonth;
+
+ startday = (startdate.Value.Day < 10) ? "0" + startdate.Value.Day : startdate.Value.Day.ToString();
+ endday = (enddate.Value.Day < 10) ? "0" + enddate.Value.Day : enddate.Value.Day.ToString();
+ startmonth = (startdate.Value.Month < 10) ? "0" + startdate.Value.Month : startdate.Value.Month.ToString();
+ endmonth = (enddate.Value.Month < 10) ? "0" + enddate.Value.Month : enddate.Value.Month.ToString();
+
+ span = "(" + startday + "." + startmonth + "." + startdate.Value.Year + " - " + endday + "." + endmonth + "." + enddate.Value.Year + ")";
+
+ return span;
+ }
}
-
+
}
diff --git a/Shared/DataContracts/PlatzhalterDC.cs b/Shared/DataContracts/PlatzhalterDC.cs
index 5942804ec..eafb7fa19 100644
--- a/Shared/DataContracts/PlatzhalterDC.cs
+++ b/Shared/DataContracts/PlatzhalterDC.cs
@@ -9,6 +9,12 @@ namespace BS.Shared.DataContracts
public class PlatzhalterDC
{
public string Bezeichnung { get; set; }
- public List Children {get;set;}
+ public string Platzhalter { get; set; }
+ public List Children { get; set; }
+
+ public override string ToString()
+ {
+ return Bezeichnung;
+ }
}
}
diff --git a/Shared/DataContracts/ReportTypes.cs b/Shared/DataContracts/ReportTypes.cs
index 1686ec90b..11032291a 100644
--- a/Shared/DataContracts/ReportTypes.cs
+++ b/Shared/DataContracts/ReportTypes.cs
@@ -30,6 +30,7 @@
AbsenceReport,
RosterReport,
ServicesOverviewNew,
- Stundenzettel
+ Stundenzettel,
+ VorlagenReport
}
}
\ No newline at end of file