- Neues Feld bei Vermittlung gemeinnütziger Arbeit
- Beta Version Vorlagen Editor fertiggestellt
This commit is contained in:
@@ -2101,7 +2101,6 @@ namespace BeWo.ServiceProxy
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.ServiceInvoicePeriodDC))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.InvoiceNumberDC))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List<BS.Shared.DataContracts.InvoiceNumberDC>))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.AppResponseDC))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.InvoiceType))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.GkvTransferResultType))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.GkvRawDataType))]
|
||||
@@ -2117,6 +2116,7 @@ namespace BeWo.ServiceProxy
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungSendResponseDC))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungGetIKRequestDC))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungGetIKResponseDC))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.AppResponseDC))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.IO.MemoryStream))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.IO.Stream))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List<System.DateTime>))]
|
||||
@@ -6009,7 +6009,6 @@ namespace BeWo.ServiceProxy
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.ServiceInvoicePeriodDC))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.InvoiceNumberDC))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List<BS.Shared.DataContracts.InvoiceNumberDC>))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.AppResponseDC))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.InvoiceType))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.GkvTransferResultType))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.GkvRawDataType))]
|
||||
@@ -6025,6 +6024,7 @@ namespace BeWo.ServiceProxy
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungSendResponseDC))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungGetIKRequestDC))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungGetIKResponseDC))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.AppResponseDC))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.IO.MemoryStream))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.IO.Stream))]
|
||||
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List<System.DateTime>))]
|
||||
@@ -6115,6 +6115,11 @@ namespace BeWo.ServiceProxy
|
||||
"loyeeAndCustomerBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
|
||||
bool HasConfirmationReceiptSignatureByDateAndEmployeeAndCustomer(out System.Collections.Generic.List<BS.Shared.DataContracts.ConfirmationReceiptSignatureDC> confirmationReceiptSignatures, long customerOid, long employeeOid, System.DateTime start, System.DateTime end, long costBearer2SupportConceptOid);
|
||||
|
||||
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/CreateRtfDocumentFromTemplate", ReplyAction="http://tempuri.org/IOperationsService/CreateRtfDocumentFromTemplateResponse")]
|
||||
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/CreateRtfDocumentFromTemplateBeWoFaultFault" +
|
||||
"", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
|
||||
string CreateRtfDocumentFromTemplate(long vorlageOid, BS.Shared.TableID objectTid, System.Collections.Generic.List<long> objectOids);
|
||||
|
||||
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/DeleteDienstvertretung2", ReplyAction="http://tempuri.org/IOperationsService/DeleteDienstvertretung2Response")]
|
||||
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/DeleteDienstvertretung2BeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
|
||||
bool DeleteDienstvertretung2(long empId, long wohnId, int zeile, System.DateTime date, BS.Shared.DataContracts.DienstvertretungDC dienstvertretung, System.Collections.Generic.List<BS.Shared.DataContracts.DienstEintragDC> alleDiensteintraege, System.Collections.Generic.List<BS.Shared.DataContracts.DienstvertretungDC> alleDienstvertretungen, int day, System.DateTime pflichtStart, System.DateTime pflichtEnde);
|
||||
@@ -7700,6 +7705,11 @@ namespace BeWo.ServiceProxy
|
||||
return base.Channel.HasConfirmationReceiptSignatureByDateAndEmployeeAndCustomer(out confirmationReceiptSignatures, customerOid, employeeOid, start, end, costBearer2SupportConceptOid);
|
||||
}
|
||||
|
||||
public string CreateRtfDocumentFromTemplate(long vorlageOid, BS.Shared.TableID objectTid, System.Collections.Generic.List<long> objectOids)
|
||||
{
|
||||
return base.Channel.CreateRtfDocumentFromTemplate(vorlageOid, objectTid, objectOids);
|
||||
}
|
||||
|
||||
public bool DeleteDienstvertretung2(long empId, long wohnId, int zeile, System.DateTime date, BS.Shared.DataContracts.DienstvertretungDC dienstvertretung, System.Collections.Generic.List<BS.Shared.DataContracts.DienstEintragDC> alleDiensteintraege, System.Collections.Generic.List<BS.Shared.DataContracts.DienstvertretungDC> alleDienstvertretungen, int day, System.DateTime pflichtStart, System.DateTime pflichtEnde)
|
||||
{
|
||||
return base.Channel.DeleteDienstvertretung2(empId, wohnId, zeile, date, dienstvertretung, alleDiensteintraege, alleDienstvertretungen, day, pflichtStart, pflichtEnde);
|
||||
@@ -9795,42 +9805,6 @@ namespace BeWo.ServiceProxy
|
||||
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAccountingService/StorniereInvoiceBases", ReplyAction="http://tempuri.org/IAccountingService/StorniereInvoiceBasesResponse")]
|
||||
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IAccountingService/StorniereInvoiceBasesBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
|
||||
void StorniereInvoiceBases(System.Collections.Generic.List<BS.Shared.DataContracts.InvoiceBaseDC> invoices);
|
||||
|
||||
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAccountingService/GetGkvAbrechnung", ReplyAction="http://tempuri.org/IAccountingService/GetGkvAbrechnungResponse")]
|
||||
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IAccountingService/GetGkvAbrechnungBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
|
||||
BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungDC GetGkvAbrechnung(long oid);
|
||||
|
||||
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAccountingService/GetAllGkvAbrechnungen", ReplyAction="http://tempuri.org/IAccountingService/GetAllGkvAbrechnungenResponse")]
|
||||
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IAccountingService/GetAllGkvAbrechnungenBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
|
||||
System.Collections.Generic.List<BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungDC> GetAllGkvAbrechnungen();
|
||||
|
||||
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAccountingService/GetFilteredGkvAbrechnungen", ReplyAction="http://tempuri.org/IAccountingService/GetFilteredGkvAbrechnungenResponse")]
|
||||
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IAccountingService/GetFilteredGkvAbrechnungenBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
|
||||
System.Collections.Generic.List<BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungDC> GetFilteredGkvAbrechnungen(BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungViewFilterDC gkvAbrechnungViewFilter);
|
||||
|
||||
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAccountingService/GetProtokollRawDataString", ReplyAction="http://tempuri.org/IAccountingService/GetProtokollRawDataStringResponse")]
|
||||
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IAccountingService/GetProtokollRawDataStringBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
|
||||
string GetProtokollRawDataString(long oid, BS.Shared.GkvRawDataType gkvRawData);
|
||||
|
||||
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAccountingService/CreateNewGkvAbrechnung", ReplyAction="http://tempuri.org/IAccountingService/CreateNewGkvAbrechnungResponse")]
|
||||
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IAccountingService/CreateNewGkvAbrechnungBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
|
||||
BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungCreateResponseDC CreateNewGkvAbrechnung(BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungCreateRequestDC request);
|
||||
|
||||
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAccountingService/UpdateGkvAbrechnung", ReplyAction="http://tempuri.org/IAccountingService/UpdateGkvAbrechnungResponse")]
|
||||
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IAccountingService/UpdateGkvAbrechnungBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
|
||||
BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungDC UpdateGkvAbrechnung(BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungDC abrechnung);
|
||||
|
||||
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAccountingService/DeleteGkvAbrechnung", ReplyAction="http://tempuri.org/IAccountingService/DeleteGkvAbrechnungResponse")]
|
||||
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IAccountingService/DeleteGkvAbrechnungBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
|
||||
void DeleteGkvAbrechnung(BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungDC abrechnung);
|
||||
|
||||
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAccountingService/SendNewGkvAbrechnung", ReplyAction="http://tempuri.org/IAccountingService/SendNewGkvAbrechnungResponse")]
|
||||
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IAccountingService/SendNewGkvAbrechnungBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
|
||||
BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungSendResponseDC SendNewGkvAbrechnung(BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungSendRequestDC req);
|
||||
|
||||
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAccountingService/SendGetIKRequest", ReplyAction="http://tempuri.org/IAccountingService/SendGetIKRequestResponse")]
|
||||
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IAccountingService/SendGetIKRequestBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
|
||||
BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungGetIKResponseDC SendGetIKRequest(BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungGetIKRequestDC req);
|
||||
}
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
|
||||
@@ -10026,51 +10000,6 @@ namespace BeWo.ServiceProxy
|
||||
{
|
||||
base.Channel.StorniereInvoiceBases(invoices);
|
||||
}
|
||||
|
||||
public BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungDC GetGkvAbrechnung(long oid)
|
||||
{
|
||||
return base.Channel.GetGkvAbrechnung(oid);
|
||||
}
|
||||
|
||||
public System.Collections.Generic.List<BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungDC> GetAllGkvAbrechnungen()
|
||||
{
|
||||
return base.Channel.GetAllGkvAbrechnungen();
|
||||
}
|
||||
|
||||
public System.Collections.Generic.List<BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungDC> GetFilteredGkvAbrechnungen(BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungViewFilterDC gkvAbrechnungViewFilter)
|
||||
{
|
||||
return base.Channel.GetFilteredGkvAbrechnungen(gkvAbrechnungViewFilter);
|
||||
}
|
||||
|
||||
public string GetProtokollRawDataString(long oid, BS.Shared.GkvRawDataType gkvRawData)
|
||||
{
|
||||
return base.Channel.GetProtokollRawDataString(oid, gkvRawData);
|
||||
}
|
||||
|
||||
public BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungCreateResponseDC CreateNewGkvAbrechnung(BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungCreateRequestDC request)
|
||||
{
|
||||
return base.Channel.CreateNewGkvAbrechnung(request);
|
||||
}
|
||||
|
||||
public BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungDC UpdateGkvAbrechnung(BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungDC abrechnung)
|
||||
{
|
||||
return base.Channel.UpdateGkvAbrechnung(abrechnung);
|
||||
}
|
||||
|
||||
public void DeleteGkvAbrechnung(BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungDC abrechnung)
|
||||
{
|
||||
base.Channel.DeleteGkvAbrechnung(abrechnung);
|
||||
}
|
||||
|
||||
public BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungSendResponseDC SendNewGkvAbrechnung(BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungSendRequestDC req)
|
||||
{
|
||||
return base.Channel.SendNewGkvAbrechnung(req);
|
||||
}
|
||||
|
||||
public BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungGetIKResponseDC SendGetIKRequest(BS.Shared.DataContracts.GkvAbrechnung.GkvAbrechnungGetIKRequestDC req)
|
||||
{
|
||||
return base.Channel.SendGetIKRequest(req);
|
||||
}
|
||||
}
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
|
||||
|
||||
@@ -79,35 +79,45 @@
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Label
|
||||
Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
Content="Eigenes Aktenzeichen" />
|
||||
Content="AZ der Staatsanwaltschaft/des Gerichts" />
|
||||
<TextBox
|
||||
Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
IsReadOnly="{Binding PermissionCustomerGemeinnutzigeArbeitManage, Mode=OneTime, Converter={StaticResource BoolReverseConverter}, ElementName=root}"
|
||||
Text="{Binding Path=AktenzeichenGericht, UpdateSourceTrigger=PropertyChanged}" />
|
||||
<Label
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Content="Eigenes Aktenzeichen" />
|
||||
<TextBox
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
IsReadOnly="{Binding PermissionCustomerGemeinnutzigeArbeitManage, Mode=OneTime, Converter={StaticResource BoolReverseConverter}, ElementName=root}"
|
||||
Text="{Binding Path=EigenesAktenzeichen, UpdateSourceTrigger=PropertyChanged}" />
|
||||
|
||||
<Label
|
||||
Grid.Row="1"
|
||||
Grid.Row="2"
|
||||
Grid.Column="0"
|
||||
Content="Auftragseingang" />
|
||||
<dxe:DateEdit
|
||||
Grid.Row="1"
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
EditValue="{Binding Path=Auftragseingang, UpdateSourceTrigger=PropertyChanged}"
|
||||
IsReadOnly="{Binding PermissionCustomerGemeinnutzigeArbeitManage, Mode=OneTime, Converter={StaticResource BoolReverseConverter}, ElementName=root}"
|
||||
ShowClearButton="False" />
|
||||
|
||||
<Label
|
||||
Grid.Row="2"
|
||||
Grid.Row="3"
|
||||
Grid.Column="0"
|
||||
Content="Auftragsherkunft" />
|
||||
<uc:NullItemComboBox
|
||||
x:Name="comboBox_Auftragsherkunft"
|
||||
Grid.Row="2"
|
||||
Grid.Row="3"
|
||||
Grid.Column="1"
|
||||
DisplayMemberPath="TypeDescription"
|
||||
IsEnabled="{Binding PermissionCustomerGemeinnutzigeArbeitManage, Mode=OneTime, ElementName=root}"
|
||||
@@ -116,12 +126,12 @@
|
||||
Style="{StaticResource PrimaryNullItemComboBox}" />
|
||||
|
||||
<Label
|
||||
Grid.Row="3"
|
||||
Grid.Row="4"
|
||||
Grid.Column="0"
|
||||
Content="Vermittlungsgrundlage" />
|
||||
<uc:NullItemComboBox
|
||||
x:Name="comboBox_Vermittlungsgrundlage"
|
||||
Grid.Row="3"
|
||||
Grid.Row="4"
|
||||
Grid.Column="1"
|
||||
DisplayMemberPath="TypeDescription"
|
||||
IsEnabled="{Binding PermissionCustomerGemeinnutzigeArbeitManage, Mode=OneTime, ElementName=root}"
|
||||
@@ -129,65 +139,65 @@
|
||||
SelectedValue="{Binding Path=Vermittlungsgrundlage, Mode=TwoWay}" />
|
||||
|
||||
<Label
|
||||
Grid.Row="4"
|
||||
Grid.Row="5"
|
||||
Grid.Column="0"
|
||||
Content="Tagessätze" />
|
||||
<dxe:TextEdit
|
||||
Grid.Row="4"
|
||||
Grid.Row="5"
|
||||
Grid.Column="1"
|
||||
EditValue="{Binding Path=Tagessatze, UpdateSourceTrigger=PropertyChanged}"
|
||||
IsReadOnly="{Binding PermissionCustomerGemeinnutzigeArbeitManage, Mode=OneTime, Converter={StaticResource BoolReverseConverter}, ElementName=root}"
|
||||
Style="{StaticResource TextEditNumberDecimalNullable}" />
|
||||
|
||||
<Label
|
||||
Grid.Row="5"
|
||||
Grid.Row="6"
|
||||
Grid.Column="0"
|
||||
Content="Tagessatzhöhe" />
|
||||
<dxe:TextEdit
|
||||
Grid.Row="5"
|
||||
Grid.Row="6"
|
||||
Grid.Column="1"
|
||||
EditValue="{Binding Path=Tagessatzhohe, UpdateSourceTrigger=PropertyChanged}"
|
||||
IsReadOnly="{Binding PermissionCustomerGemeinnutzigeArbeitManage, Mode=OneTime, Converter={StaticResource BoolReverseConverter}, ElementName=root}"
|
||||
Style="{StaticResource TextEditCurrency}" />
|
||||
|
||||
<Label
|
||||
Grid.Row="6"
|
||||
Grid.Row="7"
|
||||
Grid.Column="0"
|
||||
Content="Höhe der Geldstrafe" />
|
||||
<dxe:TextEdit
|
||||
Grid.Row="6"
|
||||
Grid.Row="7"
|
||||
Grid.Column="1"
|
||||
EditValue="{Binding Path=HoheDerGeldstrafe, UpdateSourceTrigger=PropertyChanged}"
|
||||
IsReadOnly="True"
|
||||
Style="{StaticResource TextEditCurrency}" />
|
||||
|
||||
<Label
|
||||
Grid.Row="7"
|
||||
Grid.Row="8"
|
||||
Grid.Column="0"
|
||||
Content="Zu leistende Arbeitsstunden" />
|
||||
<dxe:TextEdit
|
||||
Grid.Row="7"
|
||||
Grid.Row="8"
|
||||
Grid.Column="1"
|
||||
EditValue="{Binding Path=ZuLeistendeArbeitsstunden, UpdateSourceTrigger=PropertyChanged}"
|
||||
IsReadOnly="{Binding PermissionCustomerGemeinnutzigeArbeitManage, Mode=OneTime, Converter={StaticResource BoolReverseConverter}, ElementName=root}"
|
||||
Style="{StaticResource TextEditHours}" />
|
||||
|
||||
<Label
|
||||
Grid.Row="8"
|
||||
Grid.Row="9"
|
||||
Grid.Column="0"
|
||||
Content="Hinweis" />
|
||||
<TextBox
|
||||
Grid.Row="8"
|
||||
Grid.Row="9"
|
||||
Grid.Column="1"
|
||||
IsReadOnly="{Binding PermissionCustomerGemeinnutzigeArbeitManage, Mode=OneTime, Converter={StaticResource BoolReverseConverter}, ElementName=root}"
|
||||
Text="{Binding Path=Hinweis, UpdateSourceTrigger=PropertyChanged}" />
|
||||
|
||||
<Label
|
||||
Grid.Row="9"
|
||||
Grid.Row="10"
|
||||
Grid.Column="0"
|
||||
Content="Termin" />
|
||||
<dxe:DateEdit
|
||||
Grid.Row="9"
|
||||
Grid.Row="10"
|
||||
Grid.Column="1"
|
||||
EditValue="{Binding Path=Termin, UpdateSourceTrigger=PropertyChanged}"
|
||||
IsReadOnly="{Binding PermissionCustomerGemeinnutzigeArbeitManage, Mode=OneTime, Converter={StaticResource BoolReverseConverter}, ElementName=root}"
|
||||
@@ -200,12 +210,12 @@
|
||||
</dxe:DateEdit>
|
||||
|
||||
<Label
|
||||
Grid.Row="10"
|
||||
Grid.Row="11"
|
||||
Grid.Column="0"
|
||||
Content="Bearbeitungsstatus" />
|
||||
<uc:NullItemComboBox
|
||||
x:Name="combobox_bearbeitungsstatus"
|
||||
Grid.Row="10"
|
||||
Grid.Row="11"
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
IsEnabled="{Binding PermissionCustomerGemeinnutzigeArbeitManage, Mode=OneTime, ElementName=root}"
|
||||
@@ -214,75 +224,75 @@
|
||||
Style="{StaticResource EnumTranslationNullItemComboBox}" />
|
||||
|
||||
<Label
|
||||
Grid.Row="11"
|
||||
Grid.Row="12"
|
||||
Grid.Column="0"
|
||||
Content="Auftragsrückgabe" />
|
||||
<TextBox
|
||||
Grid.Row="11"
|
||||
Grid.Row="12"
|
||||
Grid.Column="1"
|
||||
IsReadOnly="{Binding PermissionCustomerGemeinnutzigeArbeitManage, Mode=OneTime, Converter={StaticResource BoolReverseConverter}, ElementName=root}"
|
||||
Text="{Binding Path=Auftragsruckgabe, UpdateSourceTrigger=PropertyChanged}" />
|
||||
|
||||
<Label
|
||||
Grid.Row="12"
|
||||
Grid.Row="13"
|
||||
Grid.Column="0"
|
||||
Content="Verlauf" />
|
||||
<TextBox
|
||||
Grid.Row="12"
|
||||
Grid.Row="13"
|
||||
Grid.Column="1"
|
||||
IsReadOnly="{Binding PermissionCustomerGemeinnutzigeArbeitManage, Mode=OneTime, Converter={StaticResource BoolReverseConverter}, ElementName=root}"
|
||||
Text="{Binding Path=Verlauf, UpdateSourceTrigger=PropertyChanged}" />
|
||||
|
||||
<Label
|
||||
Grid.Row="13"
|
||||
Grid.Row="14"
|
||||
Grid.Column="0"
|
||||
Content="Abgeleistete Stunden" />
|
||||
<dxe:TextEdit
|
||||
Grid.Row="13"
|
||||
Grid.Row="14"
|
||||
Grid.Column="1"
|
||||
EditValue="{Binding Path=AbgeleisteteStunden, UpdateSourceTrigger=PropertyChanged}"
|
||||
IsReadOnly="{Binding PermissionCustomerGemeinnutzigeArbeitManage, Mode=OneTime, Converter={StaticResource BoolReverseConverter}, ElementName=root}"
|
||||
Style="{StaticResource TextEditHours}" />
|
||||
|
||||
<Label
|
||||
Grid.Row="14"
|
||||
Grid.Row="15"
|
||||
Grid.Column="0"
|
||||
Content="Ersparte Hafttage" />
|
||||
<dxe:TextEdit
|
||||
Grid.Row="14"
|
||||
Grid.Row="15"
|
||||
Grid.Column="1"
|
||||
EditValue="{Binding Path=ErsparteHafttage, UpdateSourceTrigger=PropertyChanged}"
|
||||
IsReadOnly="{Binding PermissionCustomerGemeinnutzigeArbeitManage, Mode=OneTime, Converter={StaticResource BoolReverseConverter}, ElementName=root}"
|
||||
Style="{StaticResource TextEditDays}" />
|
||||
|
||||
<Label
|
||||
Grid.Row="15"
|
||||
Grid.Row="16"
|
||||
Grid.Column="0"
|
||||
Content="Geleistete Ratenzahlung" />
|
||||
<dxe:TextEdit
|
||||
Grid.Row="15"
|
||||
Grid.Row="16"
|
||||
Grid.Column="1"
|
||||
EditValue="{Binding Path=GeleisteteRatenzahlung, UpdateSourceTrigger=PropertyChanged}"
|
||||
IsReadOnly="{Binding PermissionCustomerGemeinnutzigeArbeitManage, Mode=OneTime, Converter={StaticResource BoolReverseConverter}, ElementName=root}"
|
||||
Style="{StaticResource TextEditCurrency}" />
|
||||
|
||||
<Label
|
||||
Grid.Row="16"
|
||||
Grid.Row="17"
|
||||
Grid.Column="0"
|
||||
Content="Geleistete Einmalzahlung" />
|
||||
<dxe:TextEdit
|
||||
Grid.Row="16"
|
||||
Grid.Row="17"
|
||||
Grid.Column="1"
|
||||
EditValue="{Binding Path=GeleisteteEinmalzahlung, UpdateSourceTrigger=PropertyChanged}"
|
||||
IsReadOnly="{Binding PermissionCustomerGemeinnutzigeArbeitManage, Mode=OneTime, Converter={StaticResource BoolReverseConverter}, ElementName=root}"
|
||||
Style="{StaticResource TextEditCurrency}" />
|
||||
|
||||
<Label
|
||||
Grid.Row="17"
|
||||
Grid.Row="18"
|
||||
Grid.Column="0"
|
||||
Content="Bemerkung" />
|
||||
<TextBox
|
||||
Grid.Row="17"
|
||||
Grid.Row="18"
|
||||
Grid.Column="1"
|
||||
Height="92"
|
||||
MaxHeight="184"
|
||||
|
||||
@@ -15,6 +15,7 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Threading;
|
||||
|
||||
namespace BeWo.View.Document
|
||||
{
|
||||
@@ -30,10 +31,8 @@ namespace BeWo.View.Document
|
||||
{
|
||||
var view = new SingleTemplateSelectionView();
|
||||
|
||||
var customerFolderList = VMFactory.CreateFolderList(objectTid, objectOid);
|
||||
|
||||
var templateFolderList = VMFactory.CreateFolderList(TableID.Vorlagentabelle, tabelle.VorlagentabelleOid.Value);
|
||||
view.InitView(tabelle, alleVorlagen, templateFolderList, customerFolderList, true, false);
|
||||
view.InitView(tabelle, alleVorlagen, templateFolderList, null, true, false, "");
|
||||
var beWoWindow = BeWoWindowBuilder.GetBeWoWindow(Translator.Translate("Vorlage auswählen"), view, 500, 500);
|
||||
|
||||
view.ButtonCancelClicked += () => beWoWindow.Close();
|
||||
@@ -47,32 +46,66 @@ namespace BeWo.View.Document
|
||||
beWoWindow.ShowDialog();
|
||||
}
|
||||
}
|
||||
|
||||
public static BeWoFolderDC OpenAndSelectBeWoFolderSelectionDialog(TableID objectTid, long objectOid, String fileName)
|
||||
{
|
||||
BeWoFolderDC selectedFolder = null;
|
||||
|
||||
var view = new SingleTemplateSelectionView();
|
||||
|
||||
var customerFolderList = VMFactory.CreateFolderList(objectTid, objectOid);
|
||||
|
||||
//var alleVorlagenTabellen = ServiceFacade.DoOperationsServiceSync(s => s.GetVorlagentabelleDCs());
|
||||
//var tabelle = alleVorlagenTabellen.FirstOrDefault(v => v.VorlagentabelleObjectTid.HasValue && v.VorlagentabelleObjectTid.Value == (int)objectTid);
|
||||
//if (tabelle != null)
|
||||
//{
|
||||
view.InitView(null, null, null, customerFolderList, false, true, fileName);
|
||||
var beWoWindow = BeWoWindowBuilder.GetBeWoWindow(Translator.Translate("Ordner auswählen"), view, 500, 500);
|
||||
|
||||
view.ButtonCancelClicked += () => beWoWindow.Close();
|
||||
view.ButtonCreateForSelectionClicked += () =>
|
||||
{
|
||||
|
||||
selectedFolder = view.SelectedFolder;
|
||||
beWoWindow.Close();
|
||||
|
||||
|
||||
};
|
||||
|
||||
beWoWindow.ShowDialog();
|
||||
//}
|
||||
return selectedFolder;
|
||||
|
||||
}
|
||||
|
||||
public static void CreateTemplateTreeViewItems(TreeListControl treeControl, IList<VorlagentabelleDC> vorlagentabellen, List<BeWoFolderDC> allFolder, bool expandItems)
|
||||
{
|
||||
treeControl.BeginDataUpdate();
|
||||
|
||||
foreach (var table in vorlagentabellen)
|
||||
if (vorlagentabellen != null)
|
||||
{
|
||||
TreeListNode node = new TreeListNode();
|
||||
DocumentTreeItemDC dc = new DocumentTreeItemDC()
|
||||
foreach (var table in vorlagentabellen)
|
||||
{
|
||||
DocTreeItemOid = table.VorlagentabelleOid,
|
||||
ParentOid = null,
|
||||
Name = table.Tabellenname,
|
||||
Table = BS.Shared.TableID.Vorlagentabelle,
|
||||
ObjectOid = table.VorlagentabelleOid,
|
||||
Node = node,
|
||||
BeWoFolderDC = new BeWoFolderDC { Name = "RootFolder", SubFolders = new List<BeWoFolderDC>() }
|
||||
};
|
||||
DocumentTreeItemVM vm = new DocumentTreeItemVM(dc);
|
||||
node.Content = vm;
|
||||
treeControl.View.Nodes.Add(node);
|
||||
node.IsExpandButtonVisible = DefaultBoolean.True;
|
||||
node.IsExpanded = expandItems;
|
||||
node.Image = LoadImage(table.ImageName);
|
||||
TreeListNode node = new TreeListNode();
|
||||
DocumentTreeItemDC dc = new DocumentTreeItemDC()
|
||||
{
|
||||
DocTreeItemOid = table.VorlagentabelleOid,
|
||||
ParentOid = null,
|
||||
Name = table.Tabellenname,
|
||||
Table = BS.Shared.TableID.Vorlagentabelle,
|
||||
ObjectOid = table.VorlagentabelleOid,
|
||||
Node = node,
|
||||
BeWoFolderDC = new BeWoFolderDC { Name = "RootFolder", SubFolders = new List<BeWoFolderDC>() }
|
||||
};
|
||||
DocumentTreeItemVM vm = new DocumentTreeItemVM(dc);
|
||||
node.Content = vm;
|
||||
treeControl.View.Nodes.Add(node);
|
||||
node.IsExpandButtonVisible = DefaultBoolean.True;
|
||||
node.IsExpanded = expandItems;
|
||||
node.Image = LoadImage(table.ImageName);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (allFolder != null && allFolder.Count > 0)
|
||||
{
|
||||
AddFolderToTreeView(treeControl, allFolder, expandItems);
|
||||
@@ -140,38 +173,81 @@ namespace BeWo.View.Document
|
||||
{
|
||||
treeControl.BeginDataUpdate();
|
||||
|
||||
|
||||
foreach (var node in treeControl.View.Nodes)
|
||||
if (treeControl.View.Nodes.Count > 0) // Wenn Nodes vorhanden sind (Vorlagen Ordner) hänge die Folder an die Vorlagen Objekte
|
||||
{
|
||||
AddFolderToNode(node, folders, expandItems);
|
||||
foreach (var node in treeControl.View.Nodes)
|
||||
{
|
||||
AddFolderToNode(treeControl, node, folders, expandItems);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
AddFolderToNode(treeControl, null, folders, expandItems);
|
||||
//foreach (var folder in folders)
|
||||
//{
|
||||
|
||||
// DocumentTreeItemDC dc = new DocumentTreeItemDC()
|
||||
// {
|
||||
// DocTreeItemOid = folder.BeWoFolderOid,
|
||||
// Name = folder.Name,
|
||||
// FilesInFolder = new List<FileAttachmentDC>(),
|
||||
// BeWoFolderDC = folder
|
||||
// };
|
||||
// DocumentTreeItemVM folder_vm = new DocumentTreeItemVM(dc);
|
||||
// var newFolderNode = new TreeListNode()
|
||||
// {
|
||||
// Content = folder_vm,
|
||||
// IsExpandButtonVisible = folder.SubFolders != null && folder.SubFolders.Count > 0 ? DefaultBoolean.True : DefaultBoolean.False,
|
||||
// IsExpanded = expandItems,
|
||||
// Tag = false,
|
||||
// Image = LoadFolderImage()
|
||||
// };
|
||||
// dc.Node = newFolderNode;
|
||||
|
||||
// AddFolderToNode(newFolderNode, folder.SubFolders, expandItems);
|
||||
// //}
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (folder.ObjectOid.HasValue && folder.ObjectOid == parentVm.DocTreeItemOid)
|
||||
// {
|
||||
// AddFolderToNode(parentNode, folder.SubFolders, expandItems);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
treeControl.EndDataUpdate();
|
||||
}
|
||||
|
||||
private static void AddFolderToNode(TreeListNode parentNode, List<BeWoFolderDC> folders, bool expandItems)
|
||||
private static void AddFolderToNode(TreeListControl treeControl, TreeListNode parentNode, List<BeWoFolderDC> folders, bool expandItems)
|
||||
{
|
||||
if (parentNode != null && folders != null)
|
||||
if (folders != null)
|
||||
{
|
||||
var parentVm = parentNode.Content as DocumentTreeItemVM;
|
||||
DocumentTreeItemVM parentVm = null;
|
||||
|
||||
if (parentNode != null)
|
||||
{
|
||||
parentVm = parentNode.Content as DocumentTreeItemVM;
|
||||
}
|
||||
|
||||
|
||||
foreach (var folder in folders)
|
||||
{
|
||||
|
||||
if (folder.BeWoFolderOid.HasValue)
|
||||
if (folder.BeWoFolderOid.HasValue || (folder.Name == "Alle Ordner" && folder.ObjectTid != TableID.Vorlagentabelle))// && folder.ObjectTid !=
|
||||
{
|
||||
//if (parentVm != null && parentVm.DocTreeItemOid == folder.ObjectOid)
|
||||
//{
|
||||
DocumentTreeItemDC dc = new DocumentTreeItemDC()
|
||||
{
|
||||
DocTreeItemOid = folder.BeWoFolderOid,
|
||||
ParentOid = parentVm.DocTreeItemOid,
|
||||
ParentOid = parentVm?.DocTreeItemOid,
|
||||
Name = folder.Name,
|
||||
FilesInFolder = new List<FileAttachmentDC>(),
|
||||
BeWoFolderDC = folder,
|
||||
Table = parentVm.DataContract.Table,
|
||||
ObjectOid = parentVm.DataContract.ObjectOid
|
||||
Table = parentVm != null ? parentVm.DataContract.Table : folder.ObjectTid,
|
||||
ObjectOid = parentVm?.DataContract.ObjectOid
|
||||
};
|
||||
if (folder.Files.Count != 0)
|
||||
{
|
||||
@@ -190,16 +266,22 @@ namespace BeWo.View.Document
|
||||
Image = LoadFolderImage()
|
||||
};
|
||||
dc.Node = newFolderNode;
|
||||
parentNode.Nodes.Add(newFolderNode);
|
||||
|
||||
AddFolderToNode(newFolderNode, folder.SubFolders, expandItems);
|
||||
if (parentNode != null)
|
||||
{
|
||||
parentNode.Nodes.Add(newFolderNode);
|
||||
}
|
||||
else
|
||||
{
|
||||
treeControl.View.Nodes.Add(newFolderNode);
|
||||
}
|
||||
AddFolderToNode(treeControl, newFolderNode, folder.SubFolders, expandItems);
|
||||
//}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (folder.ObjectOid.HasValue && folder.ObjectOid == parentVm.DocTreeItemOid)
|
||||
if (folder.ObjectOid.HasValue && parentVm != null && folder.ObjectOid == parentVm.DocTreeItemOid)
|
||||
{
|
||||
AddFolderToNode(parentNode, folder.SubFolders, expandItems);
|
||||
AddFolderToNode(treeControl, parentNode, folder.SubFolders, expandItems);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -266,17 +348,128 @@ namespace BeWo.View.Document
|
||||
|
||||
}
|
||||
|
||||
|
||||
//public static DokumentvorlageVM EditTemplate(VorlagentabelleDC vt, DokumentvorlageVM vm)
|
||||
//{
|
||||
|
||||
// var control = new VorlageEditView();
|
||||
|
||||
// control.InitView(vt, vm);
|
||||
// var beWoWindow = new BeWoWindow
|
||||
// {
|
||||
// rootGroupBox = { Header = "Vorlage bearbeiten" },
|
||||
// Height = this.Height,
|
||||
// Width = 1200,
|
||||
// MinWidth = 550,
|
||||
// WindowStartupLocation = WindowStartupLocation.CenterOwner,
|
||||
// GroupBoxContent = control,
|
||||
// Owner = BeWoApp.CurrentBeWo.MainWindow
|
||||
// };
|
||||
// bool saved = false;
|
||||
|
||||
// control.ButtonSavedClicked += () =>
|
||||
// {
|
||||
// saved = true;
|
||||
// if (control.ViewModel.IsNew || control.ViewModel.IsDirty)
|
||||
// {
|
||||
// var dc = SaveInDatabase(control.ViewModel);
|
||||
// vm.DataContract = dc;
|
||||
|
||||
// RefreshSelectedList();
|
||||
// }
|
||||
|
||||
// beWoWindow.Close();
|
||||
// };
|
||||
|
||||
// control.ButtonCancelClicked += () =>
|
||||
// {
|
||||
// beWoWindow.Close();
|
||||
// };
|
||||
|
||||
// beWoWindow.ShowDialog();
|
||||
|
||||
// if (!saved)
|
||||
// {
|
||||
// return null;
|
||||
// }
|
||||
// return control.ViewModel;
|
||||
//}
|
||||
|
||||
|
||||
private static void PrintTemplate(DokumentvorlageDC vorlage, TableID objectTid, long objectOid)
|
||||
{
|
||||
|
||||
string url = GenerateURL(vorlage.DokumentvorlageOid.Value, objectTid, new List<long> { objectOid });
|
||||
|
||||
BeWoUtils.NavigateToReportUri(url, vorlage.Name);
|
||||
ServiceFacade.DoOperationsServiceAsync(s => s.CreateRtfDocumentFromTemplate(vorlage.DokumentvorlageOid.Value, objectTid, new List<long> { objectOid }),
|
||||
rtf =>
|
||||
BeWoApp.CurrentBeWo.Dispatcher.BeginInvoke(
|
||||
DispatcherPriority.Normal,
|
||||
(Action)delegate
|
||||
{
|
||||
var control = new RtfEditView();
|
||||
control.InitView(rtf);
|
||||
|
||||
var window = BeWoWindowBuilder.GetBeWoWindow(vorlage.Name, control, Math.Min(BeWoApp.MainControl.ActualHeight, 1000), Math.Min(BeWoApp.MainControl.ActualWidth, 1600));
|
||||
|
||||
control.ButtonSavedClicked += () =>
|
||||
{
|
||||
var selectedFolder = OpenAndSelectBeWoFolderSelectionDialog(objectTid, objectOid, vorlage.Name);
|
||||
if (selectedFolder != null)
|
||||
{
|
||||
var newRtfText = control.RtfText;
|
||||
var filename = selectedFolder.Name;
|
||||
window.Close();
|
||||
|
||||
SaveRtfInBeWoFolder(selectedFolder, newRtfText, filename, objectTid, objectOid);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
control.ButtonCancelClicked += () =>
|
||||
{
|
||||
window.Close();
|
||||
};
|
||||
|
||||
window.ShowDialog();
|
||||
}));
|
||||
|
||||
//var rtf = ServiceFacade.DoOperationsServiceSync(s => s.CreateRtfDocumentFromTemplate(vorlage.DokumentvorlageOid.Value, objectTid, new List<long> { objectOid }));
|
||||
|
||||
|
||||
//string url = GenerateURL(vorlage.DokumentvorlageOid.Value, objectTid, new List<long> { objectOid });
|
||||
|
||||
//BeWoUtils.NavigateToReportUri(url, vorlage.Name);
|
||||
|
||||
}
|
||||
|
||||
|
||||
private static void SaveRtfInBeWoFolder(BeWoFolderDC selectedFolder, string rtfText, string filename, TableID objectTid, long objectOid)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
var ms = new System.IO.MemoryStream(Encoding.Default.GetBytes(rtfText));
|
||||
var upload = new ProgressStream(ms);
|
||||
|
||||
var lUlPackage = new UploadPackage(selectedFolder.BeWoFolderOid, 0, String.Format("{0}.{1}", filename, "rtf"), "", objectOid, (int)objectTid, upload);
|
||||
|
||||
ServiceFacade.DoStreamingServiceAsync(
|
||||
s => s.UploadDocument(lUlPackage),
|
||||
r =>
|
||||
{
|
||||
upload.Dispose();
|
||||
ms.Dispose();
|
||||
},
|
||||
() =>
|
||||
{
|
||||
upload.Dispose();
|
||||
ms.Dispose();
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Fehler", MessageBoxButton.OK, MessageBoxImage.Exclamation);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static string GenerateURL(long vorlage, TableID objectTid, List<long> objectOids)
|
||||
{
|
||||
|
||||
@@ -1535,11 +1535,6 @@ namespace BeWo.View.Document
|
||||
private DokumentvorlageDC SaveInDatabase(DokumentvorlageVM savedTemplate)
|
||||
{
|
||||
var dc = savedTemplate.CommitToDataContract();
|
||||
if (!String.IsNullOrEmpty(dc.RTFText))
|
||||
{
|
||||
var textasbytes = Encoding.ASCII.GetBytes(dc.RTFText);
|
||||
dc.Data = textasbytes;
|
||||
}
|
||||
var updatedDC = ServiceFacade.DoOperationsServiceSync(s => s.InsertTemplate(dc));
|
||||
|
||||
return updatedDC;
|
||||
@@ -1740,7 +1735,7 @@ namespace BeWo.View.Document
|
||||
objectOids.Add((long)p.ObjectOid);
|
||||
}
|
||||
|
||||
string url = GenerateURL((long)templateVM.DataContract.DokumentvorlageOid, objectOids, (long)printSelectionVMs[0].Table);
|
||||
string url = DokumentViewHelper.GenerateURL(templateVM.DataContract.DokumentvorlageOid.Value, (TableID)printSelectionVMs[0].Table.Value, objectOids);
|
||||
|
||||
BeWoUtils.NavigateToReportUri(url, Translator.Translate("Dokument mit ersetzten Platzhaltern"), () => { });
|
||||
|
||||
@@ -1858,28 +1853,6 @@ namespace BeWo.View.Document
|
||||
}
|
||||
}
|
||||
|
||||
public string GenerateURL(long vorlage, List<long> objectOids, long table)
|
||||
{
|
||||
string url = BeWoApp.SiteOfOrigin + "/ReportView.aspx?";
|
||||
|
||||
url += "&vorlage=" + 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)
|
||||
|
||||
@@ -19,14 +19,14 @@
|
||||
|
||||
<Grid Margin="0,3,0,0" Background="{StaticResource ObjectEditBackgroundBrush}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" /> <!-- Felder für Vorlagenname und Beschreibung -->
|
||||
<RowDefinition Height="*" />
|
||||
|
||||
<RowDefinition Height="Auto" /> <!-- Speichern und abbrechen -->
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<dxre:RichEditControl x:Name="EditorControl" Grid.Row="0" Grid.Column="0" Language="de-DE" CommandBarStyle="Ribbon" Margin="0,0,0,0" VerticalAlignment="Stretch" Grid.ColumnSpan="2" ShowReviewingPane="False" RtfTextChanged="EditorControl_RtfTextChanged"/>
|
||||
<dxre:RichEditControl x:Name="EditorControl" Grid.Row="0" Grid.Column="0" Language="de-DE" CommandBarStyle="Ribbon" Margin="0,0,0,0" VerticalAlignment="Stretch" Grid.ColumnSpan="2" ShowReviewingPane="False" />
|
||||
|
||||
<StackPanel Grid.ColumnSpan="3" Grid.Row="2" Orientation="Horizontal" VerticalAlignment="Center" Height="Auto" Margin="0,5,0,5" HorizontalAlignment="Right">
|
||||
<StackPanel Grid.ColumnSpan="3" Grid.Row="1" Orientation="Horizontal" VerticalAlignment="Center" Height="Auto" Margin="0,5,0,5" HorizontalAlignment="Right">
|
||||
<Button x:Name="btnSave" Content="Als Dokument speichern" Margin="0,0,3,0" Height="25" Click="btnSave_Click"/>
|
||||
<Button x:Name="btnClose" Content="Schließen" Margin="0,0,3,0" Height="25" Click="btnClose_Click"/>
|
||||
</StackPanel>
|
||||
|
||||
@@ -32,141 +32,41 @@ namespace BeWo.View.Document
|
||||
{
|
||||
public partial class RtfEditView
|
||||
{
|
||||
List<PlatzhalterVM> Templates = new List<PlatzhalterVM>();
|
||||
Dictionary<string, BitmapImage> ImageTypeToImage = new Dictionary<string, BitmapImage>();
|
||||
|
||||
|
||||
|
||||
public event Action ButtonSavedClicked;
|
||||
public event Action ButtonCancelClicked;
|
||||
|
||||
public VorlagentabelleDC VorlagenTabelle { get; set; }
|
||||
public DokumentvorlageVM ViewModel { get; set; }
|
||||
|
||||
public RtfEditView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public override bool IsDirty
|
||||
{
|
||||
get
|
||||
{
|
||||
|
||||
|
||||
//if (ViewModel.SelectedVMForEditing != null && _SelectedEmployee != null &&
|
||||
// !_SelectedEmployee.Equals(ViewModel.SelectedVMForEditing.Employee))
|
||||
// return true;
|
||||
|
||||
return ViewModel != null && ViewModel.IsDirty;
|
||||
}
|
||||
}
|
||||
|
||||
public void InitView(VorlagentabelleDC vorlagenTabelle, DokumentvorlageVM pVM)
|
||||
public void InitView(String rtfText)
|
||||
{
|
||||
InitializeComponent();
|
||||
VorlagenTabelle = vorlagenTabelle;
|
||||
ViewModel = pVM;
|
||||
DataContext = pVM;
|
||||
|
||||
if (pVM.Text != null)
|
||||
{
|
||||
EditorControl.RtfText = pVM.RTFText;
|
||||
}
|
||||
|
||||
|
||||
RtfText = rtfText;
|
||||
|
||||
|
||||
Focus();
|
||||
}
|
||||
|
||||
private void LoadImagesForNodes(List<PlatzhalterVM> templates)
|
||||
public String RtfText
|
||||
{
|
||||
// Icons in ImageTypeToImage laden
|
||||
foreach (var item in templates)
|
||||
get
|
||||
{
|
||||
if (item.Children != null)
|
||||
LoadImagesForNodes(item.Children);
|
||||
|
||||
if (item.IconType != null)
|
||||
item.Icon = LoadImage(item.IconType);
|
||||
|
||||
return EditorControl.RtfText;
|
||||
}
|
||||
set
|
||||
{
|
||||
EditorControl.RtfText = value;
|
||||
}
|
||||
}
|
||||
private BitmapImage LoadImage(string imageName)
|
||||
{
|
||||
return new BitmapImage(new Uri("/Ressources/Icons/" + imageName + ".png", UriKind.Relative));
|
||||
}
|
||||
|
||||
private PlatzhalterVM ConvertDataContractToViewModel(PlatzhalterDC dc)
|
||||
{
|
||||
var vm = new PlatzhalterVM()
|
||||
{
|
||||
Bezeichnung = dc.Bezeichnung,
|
||||
Children = new List<PlatzhalterVM>(),
|
||||
FieldName = dc.FieldName,
|
||||
Icon = LoadImage(dc.IconType),
|
||||
IconType = dc.IconType,
|
||||
Platzhalter = dc.Platzhalter
|
||||
};
|
||||
|
||||
if (dc.Children != null && dc.Children.Count > 0)
|
||||
{
|
||||
foreach (var item in dc.Children)
|
||||
vm.Children.Add(ConvertDataContractToViewModel(item));
|
||||
}
|
||||
|
||||
return vm;
|
||||
}
|
||||
private List<PlatzhalterVM> ConvertListOfDataContractsToViewModels(List<PlatzhalterDC> dcs)
|
||||
{
|
||||
List<PlatzhalterVM> vms = new List<PlatzhalterVM>();
|
||||
foreach (var dc in dcs)
|
||||
vms.Add(ConvertDataContractToViewModel(dc));
|
||||
|
||||
return vms;
|
||||
}
|
||||
|
||||
//private List<PlatzhalterDC> LoadTemplates(long? tabelle)
|
||||
//{
|
||||
// List<PlatzhalterDC> templates = new List<PlatzhalterDC>();
|
||||
|
||||
// List<PlatzhalterDC> platzhalterDCs = new List<PlatzhalterDC>();
|
||||
|
||||
// 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<PlatzhalterVM> GetPlatzhalter()
|
||||
{
|
||||
return ConvertListOfDataContractsToViewModels(ServiceFacade.DoOperationsServiceSync(s => s.GetPlatzhalterForTemplate(VorlagenTabelle)));
|
||||
|
||||
}
|
||||
/*
|
||||
private void combobox_templates_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (combobox_templates.SelectedItem == null)
|
||||
return;
|
||||
var selected = combobox_templates.SelectedItem as PlatzhalterDC;
|
||||
|
||||
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;
|
||||
}
|
||||
EditorControl.Document.InsertText(EditorControl.Document.CaretPosition, "[" + selected.Platzhalter + "]");
|
||||
|
||||
|
||||
|
||||
|
||||
//EditorControl.Text += "[" + selected.Platzhalter + "]";
|
||||
//EditorControl.RtfText += "[" + selected.Platzhalter + "]";
|
||||
|
||||
combobox_templates.SelectedItem = null;
|
||||
}
|
||||
*/
|
||||
private void btnSave_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
@@ -176,15 +76,14 @@ namespace BeWo.View.Document
|
||||
private void btnClose_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
bool close = true;
|
||||
if (ViewModel.IsDirty)
|
||||
{
|
||||
if (MessageBox.Show(
|
||||
Translator.Translate("Möchten Sie wirklich abbrechen und die Änderungen verwerfen?"),
|
||||
|
||||
if (MessageBox.Show(
|
||||
Translator.Translate("Möchten Sie wirklich abbrechen und das Dokument verwerfen?"),
|
||||
"BeWoPlaner", MessageBoxButton.OKCancel, MessageBoxImage.Question) == MessageBoxResult.Cancel)
|
||||
{
|
||||
close = false;
|
||||
}
|
||||
{
|
||||
close = false;
|
||||
}
|
||||
|
||||
|
||||
if (close)
|
||||
{
|
||||
@@ -192,24 +91,5 @@ namespace BeWo.View.Document
|
||||
}
|
||||
}
|
||||
|
||||
// Mouseup, um die aktuelle Position des Cursors zu speichern, um dort den Platzhalter an der aktuellen Stelle einzusetzen
|
||||
// Klappt nur, wenn in Text geklickt wird und nicht hinter ein Wort..
|
||||
// Hat aber keine verwendbaren Inhalte
|
||||
private void richEditControl1_MouseUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
RichEditControl richEditControl = sender as RichEditControl;
|
||||
System.Windows.Point point = e.GetPosition(richEditControl);
|
||||
System.Drawing.Point docPoint = new System.Drawing.Point((int)point.X, (int)point.Y);
|
||||
docPoint = Units.PixelsToDocuments(docPoint, richEditControl.DpiX, richEditControl.DpiY);
|
||||
DocumentPosition pos = richEditControl.GetPositionFromPoint(docPoint);
|
||||
//pos.
|
||||
}
|
||||
|
||||
private void EditorControl_RtfTextChanged(object sender, EventArgs e)
|
||||
{
|
||||
ViewModel.Text = EditorControl.Text;
|
||||
ViewModel.RTFText = EditorControl.RtfText;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -16,46 +16,53 @@
|
||||
Focusable="True">
|
||||
|
||||
<Grid Background="{StaticResource ObjectEditBackgroundBrush}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition x:Name="GridRowTemplate" Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition x:Name="GridRowFolder" Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
|
||||
<Label Margin="0,0,0,0" x:Name="lblTemplate" Content="Vorlage:"/>
|
||||
<dxg:TreeListControl x:Name="treelistcontrol_template" Grid.Row="1" DefaultSorting="Name" Margin="5,0,5,0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >
|
||||
<dxg:TreeListControl x:Name="treelistcontrol_template" Grid.Row="1" Grid.ColumnSpan="2" DefaultSorting="Name" Margin="5,0,5,0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >
|
||||
<dxg:TreeListControl.Columns>
|
||||
<dxg:TreeListColumn FieldName="Name" AllowSorting="True" CellToolTipBinding="{Binding Description}"/>
|
||||
</dxg:TreeListControl.Columns>
|
||||
<dxg:TreeListControl.View>
|
||||
<dxg:TreeListView x:Name="TreeView_template" ShowColumnHeaders="False" ShowIndicator="False" ShowHorizontalLines="False" ShowVerticalLines="False" AutoWidth="True"
|
||||
FocusedRowChanged="DocumentsTreeView_FocusedRowChanged" PreviewMouseLeftButtonDown="DocumentsTreeView_folderStructureForSelection_PreviewMouseLeftButtonDown"
|
||||
NodeExpanding="DocumentsTreeView_NodeExpanding" AllowEditing="False" ShowNodeImages="True" PrintNodeImages="True"
|
||||
AllowEditing="False" ShowNodeImages="True" PrintNodeImages="True"
|
||||
KeyFieldName="{Binding DocumentTreeItemVM.DocTreeItemOid}" ParentFieldName="Binding DocumentTreeItemVM.ParentOid">
|
||||
</dxg:TreeListView>
|
||||
</dxg:TreeListControl.View>
|
||||
</dxg:TreeListControl>
|
||||
|
||||
<CheckBox x:Name="chkSaveDoc" Content="Dokument abspeichern" Grid.Row="2" Checked="CheckBox_Checked" Margin="5,8,0,0" Unchecked="CheckBox_Unchecked" />
|
||||
<!--<CheckBox x:Name="chkSaveDoc" Content="Dokument abspeichern" Grid.Row="2" Checked="CheckBox_Checked" Margin="5,8,0,0" Unchecked="CheckBox_Unchecked" />-->
|
||||
|
||||
<dxg:TreeListControl x:Name="treelistcontrol_folderStructureForSelection" Grid.Row="3" DefaultSorting="Name" Margin="5,5,5,0" VerticalAlignment="Stretch" Visibility="Visible">
|
||||
<Label x:Name="lblFileName" Grid.Row="2" Margin="0,3,0,0" Content="Name:" />
|
||||
<TextBox x:Name="txtFileName" Grid.Row="2" Grid.Column="1" Margin="3,3,0,0" HorizontalAlignment="Stretch"/>
|
||||
|
||||
<dxg:TreeListControl x:Name="treelistcontrol_folderStructureForSelection" Grid.Row="4" Grid.ColumnSpan="2" DefaultSorting="Name" Margin="5,5,5,0" VerticalAlignment="Stretch" Visibility="Visible">
|
||||
<dxg:TreeListControl.Columns>
|
||||
<dxg:TreeListColumn FieldName="Name" AllowSorting="True"/>
|
||||
</dxg:TreeListControl.Columns>
|
||||
<dxg:TreeListControl.View>
|
||||
<dxg:TreeListView x:Name="TreeView_folderStructureForSelection" ShowColumnHeaders="False" ShowIndicator="False" ShowHorizontalLines="False" ShowVerticalLines="False" AutoWidth="True"
|
||||
FocusedRowChanged="DocumentsTreeView_FocusedRowChanged" PreviewMouseLeftButtonDown="DocumentsTreeView_folderStructureForSelection_PreviewMouseLeftButtonDown"
|
||||
NodeExpanding="DocumentsTreeView_NodeExpanding" AllowEditing="False" ShowNodeImages="True" PrintNodeImages="True"
|
||||
AllowEditing="False" ShowNodeImages="True" PrintNodeImages="True"
|
||||
KeyFieldName="{Binding DocumentTreeItemVM.DocTreeItemOid}" ParentFieldName="Binding DocumentTreeItemVM.ParentOid">
|
||||
</dxg:TreeListView>
|
||||
</dxg:TreeListControl.View>
|
||||
</dxg:TreeListControl>
|
||||
|
||||
<WrapPanel Grid.Row="4" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="0 5 5 5">
|
||||
<Button x:Name="Button_CreateTemplateBasedDocument_OnlyOne" Content="Dokument erstellen" Margin="0 0 5 0" Click="Button_CreateTemplateForSelection_Click" />
|
||||
<WrapPanel Grid.Row="5" Grid.ColumnSpan="2" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="0 5 5 5">
|
||||
<Button x:Name="Button_SelectTemplate" Content="Dokument erstellen" Margin="0 0 5 0" Click="Button_CreateTemplateForSelection_Click" />
|
||||
<Button x:Name="Button_SelectFolder" Content="Dokument speichern" Margin="0 0 5 0" Click="Button_SelectFolder_Click" />
|
||||
<Button x:Name="Button_Cancel_OnlyOne" Content="Abbrechen" Click="Button_Cancel_Click" />
|
||||
</WrapPanel>
|
||||
</Grid>
|
||||
|
||||
@@ -32,9 +32,7 @@ namespace BeWo.View.Document
|
||||
{
|
||||
public partial class SingleTemplateSelectionView
|
||||
{
|
||||
public event Action ButtonCreateClicked;
|
||||
public event Action ButtonCreateForSelectionClicked;
|
||||
public event Action ButtonCreateForAllClicked;
|
||||
public event Action ButtonCancelClicked;
|
||||
private VorlagentabelleDC vorlagenTabelle;
|
||||
private List<DokumentvorlageDC> alleVorlagen;
|
||||
@@ -46,11 +44,11 @@ namespace BeWo.View.Document
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public DocumentTreeItemVM SelectedFolder { get; set; }
|
||||
public BeWoFolderDC SelectedFolder { get; set; }
|
||||
|
||||
public DokumentvorlageDC SelectedTemplate { get; set; }
|
||||
|
||||
public void InitView(VorlagentabelleDC vt, List<DokumentvorlageDC> alleVorlagen, List<BeWoFolderDC> allTemplateFolder, List<BeWoFolderDC> allObjectFolder, bool showTemplateTree, bool showDocumentTree)
|
||||
public void InitView(VorlagentabelleDC vt, List<DokumentvorlageDC> alleVorlagen, List<BeWoFolderDC> allTemplateFolder, List<BeWoFolderDC> allObjectFolder, bool showTemplateTree, bool showDocumentTree, String defaultFileName)
|
||||
{
|
||||
//tableId = tid;
|
||||
|
||||
@@ -58,23 +56,33 @@ namespace BeWo.View.Document
|
||||
this.alleVorlagen = alleVorlagen;
|
||||
this.allTemplateFolder = allTemplateFolder;
|
||||
this.allObjectFolder = allObjectFolder;
|
||||
|
||||
DokumentViewHelper.CreateTemplateTreeViewItems(treelistcontrol_template, new List<VorlagentabelleDC>() { vt }, allTemplateFolder, true);
|
||||
DokumentViewHelper.AddTemplatesToTreeView(treelistcontrol_template, alleVorlagen, true);
|
||||
this.txtFileName.Text = defaultFileName;
|
||||
|
||||
|
||||
List<PrintSelectionVM> vms = new List<PrintSelectionVM>();
|
||||
|
||||
if (!showTemplateTree)
|
||||
if (showTemplateTree)
|
||||
{
|
||||
DokumentViewHelper.CreateTemplateTreeViewItems(treelistcontrol_template, new List<VorlagentabelleDC>() { vt }, allTemplateFolder, true);
|
||||
DokumentViewHelper.AddTemplatesToTreeView(treelistcontrol_template, alleVorlagen, true);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Button_SelectTemplate.Visibility = Visibility.Collapsed;
|
||||
lblTemplate.Visibility = Visibility.Collapsed;
|
||||
treelistcontrol_template.Visibility = Visibility.Collapsed;
|
||||
GridRowTemplate.Height = GridLength.Auto;
|
||||
}
|
||||
|
||||
if (!showDocumentTree)
|
||||
if (showDocumentTree)
|
||||
{
|
||||
chkSaveDoc.Visibility = Visibility.Collapsed;
|
||||
DokumentViewHelper.CreateTemplateTreeViewItems(treelistcontrol_folderStructureForSelection, null, allObjectFolder, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
//chkSaveDoc.Visibility = Visibility.Collapsed;
|
||||
lblFileName.Visibility = Visibility.Collapsed;
|
||||
txtFileName.Visibility = Visibility.Collapsed;
|
||||
Button_SelectFolder.Visibility = Visibility.Collapsed;
|
||||
treelistcontrol_folderStructureForSelection.Visibility = Visibility.Collapsed;
|
||||
GridRowFolder.Height = GridLength.Auto;
|
||||
}
|
||||
@@ -112,6 +120,22 @@ namespace BeWo.View.Document
|
||||
ButtonCreateForSelectionClicked?.Invoke();
|
||||
}
|
||||
|
||||
private void Button_SelectFolder_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var selected = treelistcontrol_folderStructureForSelection.SelectedItem as DocumentTreeItemVM;
|
||||
|
||||
if (selected == null || selected.DataContract.BeWoFolderDC == null)
|
||||
{
|
||||
MessageBox.Show("Bitte wählen Sie einen Ordner aus.", "BeWoPlaner", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
return;
|
||||
}
|
||||
SelectedFolder = selected.DataContract.BeWoFolderDC;
|
||||
//Kleiner Hack;-)
|
||||
SelectedFolder.Name = txtFileName.Text;
|
||||
|
||||
ButtonCreateForSelectionClicked?.Invoke();
|
||||
}
|
||||
|
||||
//private void Button_CreateTemplateBasedDocumentForAll_Click(object sender, RoutedEventArgs e)
|
||||
//{
|
||||
// var selected = datagrid_enabled_for_template.ItemsSource as List<PrintSelectionVM>;
|
||||
@@ -135,101 +159,9 @@ namespace BeWo.View.Document
|
||||
treelistcontrol_folderStructureForSelection.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
//private void GenerateFolderStructure(TableID table, TreeListNode node, List<BeWoFolderDC> 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<FileAttachmentDC>(),
|
||||
// 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 (TreeView_template.SelectedRows.Count != 0)
|
||||
SelectedFolder = TreeView_template.SelectedRows[0] as DocumentTreeItemVM;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//public List<PrintSelectionVM> SelectAllElements()
|
||||
//{
|
||||
// return datagrid_enabled_for_template.ItemsSource as List<PrintSelectionVM>;
|
||||
//}
|
||||
}
|
||||
}
|
||||
@@ -67,7 +67,7 @@ namespace BeWo.View.Document
|
||||
ViewModel = pVM;
|
||||
DataContext = pVM;
|
||||
|
||||
if (pVM.Text != null)
|
||||
if (pVM.RTFText != null)
|
||||
{
|
||||
EditorControl.RtfText = pVM.RTFText;
|
||||
}
|
||||
@@ -220,11 +220,24 @@ namespace BeWo.View.Document
|
||||
}
|
||||
private void TemplatesTreeView_MouseDoubleClick(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
var selection = TreeListControlTemplates.SelectedItem as PlatzhalterVM;
|
||||
|
||||
if (selection.Platzhalter != null)
|
||||
try
|
||||
{
|
||||
EditorControl.Document.InsertText(EditorControl.Document.CaretPosition, "[" + selection.Platzhalter + "]");
|
||||
var selection = TreeListControlTemplates.SelectedItem as PlatzhalterVM;
|
||||
|
||||
if (selection.Platzhalter != null)
|
||||
{
|
||||
var doc = EditorControl.Document as DevExpress.XtraRichEdit.API.Native.Implementation.NativeDocument;
|
||||
//var test = doc.ActiveSubDocument.EndPosition;
|
||||
var sd = doc.ActiveSubDocument;
|
||||
sd.InsertText(EditorControl.Document.CaretPosition, "[" + selection.Platzhalter + "]");
|
||||
|
||||
//EditorControl.Document.InsertText(EditorControl.Document.CaretPosition, "[" + selection.Platzhalter + "]");
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
//Ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ namespace BeWo.ViewModel
|
||||
{
|
||||
public class CustomerVermittlungArbeitVM : AbstractDCMapperVM<CustomerVermittlungArbeitDC>
|
||||
{
|
||||
private string _AktenzeichenGericht;
|
||||
private string _EigenesAktenzeichen;
|
||||
private DateTime? _Auftragseingang;
|
||||
private ValueListEntryDC _Auftragsherkunft;
|
||||
@@ -57,7 +58,21 @@ namespace BeWo.ViewModel
|
||||
|
||||
}
|
||||
|
||||
public string Displayname => $"AZ: {EigenesAktenzeichen}";
|
||||
public string Displayname => $"AZ: {AktenzeichenGericht}";
|
||||
public string AktenzeichenGericht
|
||||
{
|
||||
get { return _AktenzeichenGericht; }
|
||||
set
|
||||
{
|
||||
if (!AreDifferent(_AktenzeichenGericht, value))
|
||||
return;
|
||||
|
||||
_AktenzeichenGericht = value;
|
||||
StoreDirtyInformation(AreDifferent(DataContract.AktenzeichenGericht, value), nameof(AktenzeichenGericht));
|
||||
FirePropertyChanged(nameof(AktenzeichenGericht));
|
||||
FirePropertyChanged(nameof(Displayname));
|
||||
}
|
||||
}
|
||||
public string EigenesAktenzeichen
|
||||
{
|
||||
get { return _EigenesAktenzeichen; }
|
||||
@@ -69,7 +84,6 @@ namespace BeWo.ViewModel
|
||||
_EigenesAktenzeichen = value;
|
||||
StoreDirtyInformation(AreDifferent(DataContract.EigenesAktenzeichen, value), nameof(EigenesAktenzeichen));
|
||||
FirePropertyChanged(nameof(EigenesAktenzeichen));
|
||||
FirePropertyChanged(nameof(Displayname));
|
||||
}
|
||||
}
|
||||
public DateTime? Auftragseingang
|
||||
@@ -515,6 +529,7 @@ namespace BeWo.ViewModel
|
||||
|
||||
protected override void InitByDataContract(CustomerVermittlungArbeitDC pDataContract)
|
||||
{
|
||||
_AktenzeichenGericht = pDataContract.AktenzeichenGericht;
|
||||
_EigenesAktenzeichen = pDataContract.EigenesAktenzeichen;
|
||||
_Auftragseingang = pDataContract.Auftragseingang;
|
||||
_Auftragsherkunft = pDataContract.Auftragsherkunft;
|
||||
@@ -559,6 +574,7 @@ namespace BeWo.ViewModel
|
||||
|
||||
protected override CustomerVermittlungArbeitDC MapToDataContract(CustomerVermittlungArbeitDC pDataContract, bool doCommit)
|
||||
{
|
||||
pDataContract.AktenzeichenGericht = _AktenzeichenGericht;
|
||||
pDataContract.EigenesAktenzeichen = _EigenesAktenzeichen;
|
||||
pDataContract.Auftragseingang = _Auftragseingang;
|
||||
pDataContract.Auftragsherkunft = _Auftragsherkunft;
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace BeWo.ViewModel.ListViewModel
|
||||
{
|
||||
AddVMCommand = new DelegateCommand(() => AddNewVMToListAndSelect(true), CanAddVM);
|
||||
|
||||
DeleteSelectedVMCommand = new DelegateCommand(() => DeleteSelectedVM($"Aktenzeichen '{SelectedVM.EigenesAktenzeichen}'"));
|
||||
DeleteSelectedVMCommand = new DelegateCommand(() => DeleteSelectedVM($"Aktenzeichen '{SelectedVM.AktenzeichenGericht}'"));
|
||||
|
||||
PermissionManageVM = BeWoApp.HasLoggedOnUserRight(BS.Shared.UserRightType.Customer_GemeinnutzigeArbeit_Manage);
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ namespace BeWo.Data.Entities
|
||||
|
||||
public virtual Customer Customer { get; set; }
|
||||
|
||||
public virtual string AktenzeichenGericht { get; set; }
|
||||
public virtual string EigenesAktenzeichen { get; set; }
|
||||
public virtual DateTime? Auftragseingang { get; set; }
|
||||
public virtual ValueListEntry Auftragsherkunft { get; set; }
|
||||
|
||||
@@ -12,8 +12,8 @@ namespace BeWo.Data.Entities
|
||||
private string _Name;
|
||||
private string _Beschreibung;
|
||||
private byte[] _Data;
|
||||
private string _Text;
|
||||
private string _RTFText;
|
||||
private byte[] _Text;
|
||||
private byte[] _RTFText;
|
||||
private long? _Parent;
|
||||
private long _Tabellenzugehoerigkeit;
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace BeWo.Data.Entities
|
||||
_Data = value;
|
||||
}
|
||||
}
|
||||
public virtual string Text
|
||||
public virtual byte[] Text
|
||||
{
|
||||
get { return _Text; }
|
||||
set
|
||||
@@ -58,7 +58,7 @@ namespace BeWo.Data.Entities
|
||||
_Text = value;
|
||||
}
|
||||
}
|
||||
public virtual string RTFText
|
||||
public virtual byte[] RTFText
|
||||
{
|
||||
get { return _RTFText; }
|
||||
set
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
<property name="SystemEntryID" type="BS.Shared.SystemEntryID, BS.Shared" />
|
||||
<property name="Notice"/>
|
||||
<many-to-one name="Customer" column="CustomerOid" class="BeWo.Data.Entities.Customer, BeWo.Data" cascade="none"/>
|
||||
<property name="AktenzeichenGericht"/>
|
||||
<property name="EigenesAktenzeichen"/>
|
||||
<property name="Auftragseingang"/>
|
||||
<many-to-one name="Auftragsherkunft" column="Auftragsherkunft" class="BeWo.Data.Entities.ValueListEntry, BeWo.Data" cascade="none" />
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
<property column="Name" type="String" name="Name"/>
|
||||
<property column="Beschreibung" type="String" name="Beschreibung"/>
|
||||
<property column="Data" type="BinaryBlob" name="Data"/>
|
||||
<property column="Text" type="String" name="Text"/>
|
||||
<property column="RTFText" type="String" name="RTFText"/>
|
||||
<property column="Text" type="BinaryBlob" name="Text"/>
|
||||
<property column="RTFText" type="BinaryBlob" name="RTFText"/>
|
||||
<property column="Parent" type="Int64" name="Parent"/>
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
|
||||
<PropertyGroup>
|
||||
<NameOfLastUsedPublishProfile>BeWo2.0</NameOfLastUsedPublishProfile>
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
|
||||
ALTER TABLE `dokumentvorlage`
|
||||
CHANGE COLUMN `Text` `Text` LONGBLOB NULL DEFAULT NULL ;
|
||||
|
||||
ALTER TABLE `dokumentvorlage`
|
||||
CHANGE COLUMN `RTFText` `RTFText` LONGBLOB NULL DEFAULT NULL ;
|
||||
|
||||
ALTER TABLE `CustomerVermittlungArbeit` ADD COLUMN AktenzeichenGericht VARCHAR(256) NULL DEFAULT NULL;
|
||||
@@ -1524,3 +1524,40 @@ CREATE TABLE `AbsenceTimeHistory` (
|
||||
`AbsenceTimeCustomerOid` bigint DEFAULT NULL,
|
||||
PRIMARY KEY (`Oid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||
|
||||
CREATE TABLE `signaturehistory` (
|
||||
`Oid` BIGINT AUTO_INCREMENT PRIMARY KEY,
|
||||
`Tid` INT DEFAULT NULL,
|
||||
`Version` BIGINT DEFAULT NULL,
|
||||
`IsActive` TINYINT DEFAULT NULL,
|
||||
`InsTs` DATETIME DEFAULT NULL,
|
||||
`SystemEntryID` INT DEFAULT NULL,
|
||||
`InsUser` VARCHAR(256) DEFAULT NULL,
|
||||
`UdpUser` VARCHAR(256) DEFAULT NULL,
|
||||
`Notice` VARCHAR(1024) DEFAULT NULL,
|
||||
`SignatureOid` BIGINT DEFAULT NULL,
|
||||
`SignatureType` INT DEFAULT NULL,
|
||||
`SignatureInsTs` DATETIME DEFAULT NULL,
|
||||
`CustomerOid` BIGINT DEFAULT NULL,
|
||||
`EmployeeOid` BIGINT DEFAULT NULL,
|
||||
`BargeldtransaktionsOid` BIGINT DEFAULT NULL,
|
||||
`SignatureTimeSpanStart` DATETIME DEFAULT NULL,
|
||||
`SignatureTimeSpanEnd` DATETIME DEFAULT NULL,
|
||||
`SignatureEventType` INT DEFAULT NULL
|
||||
) Engine=InnoDB DEFAULT CHARSET=latin1;
|
||||
|
||||
CREATE TABLE `servicerecord2signaturehistory` (
|
||||
`Oid` BIGINT AUTO_INCREMENT PRIMARY KEY,
|
||||
`SignatureHistoryOid` BIGINT DEFAULT NULL,
|
||||
`ServiceRecordOid` BIGINT DEFAULT NULL,
|
||||
FOREIGN KEY (`SignatureHistoryOid`) REFERENCES `signaturehistory`(`Oid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||
|
||||
|
||||
ALTER TABLE `CustomerVermittlungArbeit` ADD COLUMN AktenzeichenGericht VARCHAR(256) NULL DEFAULT NULL;
|
||||
|
||||
ALTER TABLE `dokumentvorlage`
|
||||
CHANGE COLUMN `Text` `Text` LONGBLOB NULL DEFAULT NULL ;
|
||||
|
||||
ALTER TABLE `dokumentvorlage`
|
||||
CHANGE COLUMN `RTFText` `RTFText` LONGBLOB NULL DEFAULT NULL ;
|
||||
|
||||
@@ -18,6 +18,7 @@ namespace BeWo.Service.DCEntityMapper
|
||||
pDataContract.Oid = pEntity.Oid;
|
||||
pDataContract.Version = pEntity.Version;
|
||||
pDataContract.Notice = pEntity.Notice;
|
||||
pDataContract.AktenzeichenGericht = pEntity.AktenzeichenGericht;
|
||||
pDataContract.EigenesAktenzeichen = pEntity.EigenesAktenzeichen;
|
||||
pDataContract.Auftragseingang = pEntity.Auftragseingang;
|
||||
pDataContract.Tagessatze = pEntity.Tagessatze;
|
||||
@@ -69,6 +70,7 @@ namespace BeWo.Service.DCEntityMapper
|
||||
pEntity.Oid = pDataContract.Oid;
|
||||
pEntity.Version = pDataContract.Version;
|
||||
pEntity.Notice = pDataContract.Notice;
|
||||
pEntity.AktenzeichenGericht = pDataContract.AktenzeichenGericht;
|
||||
pEntity.EigenesAktenzeichen = pDataContract.EigenesAktenzeichen;
|
||||
pEntity.Auftragseingang = pDataContract.Auftragseingang;
|
||||
pEntity.Tagessatze = pDataContract.Tagessatze;
|
||||
|
||||
@@ -25,8 +25,14 @@ namespace BeWo.Service.DCEntityMapper
|
||||
pDataContract.Data = pEntity.Data;
|
||||
pDataContract.Parent = pEntity.Parent;
|
||||
pDataContract.Tabellenzugehoerigkeit = pEntity.Tabellenzugehoerigkeit;
|
||||
pDataContract.Text = pEntity.Text;
|
||||
pDataContract.RTFText = pEntity.RTFText;
|
||||
if (pEntity.Text != null)
|
||||
{
|
||||
pDataContract.Text = Encoding.Default.GetString(pEntity.Text);
|
||||
}
|
||||
if (pEntity.RTFText != null)
|
||||
{
|
||||
pDataContract.RTFText = Encoding.Default.GetString(pEntity.RTFText);
|
||||
}
|
||||
|
||||
|
||||
return pDataContract;
|
||||
@@ -49,8 +55,15 @@ namespace BeWo.Service.DCEntityMapper
|
||||
pEntity.Data = pDataContract.Data;
|
||||
pEntity.Parent = pDataContract.Parent;
|
||||
pEntity.Tabellenzugehoerigkeit = pDataContract.Tabellenzugehoerigkeit;
|
||||
pEntity.Text = pDataContract.Text;
|
||||
pEntity.RTFText = pDataContract.RTFText;
|
||||
if (pDataContract.Text != null)
|
||||
{
|
||||
pEntity.Text = Encoding.Default.GetBytes(pDataContract.Text);
|
||||
}
|
||||
if (pDataContract.RTFText != null)
|
||||
{
|
||||
pEntity.RTFText = Encoding.Default.GetBytes(pDataContract.RTFText);
|
||||
}
|
||||
|
||||
|
||||
return pEntity;
|
||||
}
|
||||
|
||||
330
Service/Dokumentverwaltung/CustomerPlaceholderManager.cs
Normal file
330
Service/Dokumentverwaltung/CustomerPlaceholderManager.cs
Normal file
@@ -0,0 +1,330 @@
|
||||
using BeWo.Data.Access;
|
||||
using BeWo.Data.Entities;
|
||||
using BeWo.Service.DCEntityMapper;
|
||||
using BS.Shared;
|
||||
using BS.Shared.DataContracts;
|
||||
using DevExpress.XtraRichEdit;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Media.Imaging;
|
||||
|
||||
namespace BeWo.Service.Dokumentverwaltung
|
||||
{
|
||||
public class CustomerPlaceholderManager : PlaceholderManager
|
||||
{
|
||||
|
||||
public override List<PlatzhalterDC> GetPlatzhalter()
|
||||
{
|
||||
List<PlatzhalterDC> liste = new List<PlatzhalterDC>();
|
||||
|
||||
|
||||
PlatzhalterDC personendaten = new PlatzhalterDC()
|
||||
{
|
||||
Bezeichnung = "Klient/in",
|
||||
Children = new List<PlatzhalterDC>(),
|
||||
IconType = "BoyAndGirl"
|
||||
};
|
||||
#region Children Personendaten
|
||||
personendaten.Children.Add(new PlatzhalterDC { Bezeichnung = "Anrede", Platzhalter = "KlAnrede", IconType = "AB" });
|
||||
personendaten.Children.Add(new PlatzhalterDC { Bezeichnung = "Briefanrede", Platzhalter = "KlBriefanrede", IconType = "AB" });
|
||||
PlatzhalterDC vorname = new PlatzhalterDC() { Bezeichnung = "Vorname", Platzhalter = "KlVorname" , FieldName = "Person.FirstName", IconType = "AB" };
|
||||
personendaten.Children.Add(vorname);
|
||||
PlatzhalterDC nachname = new PlatzhalterDC() { Bezeichnung = "Nachname", Platzhalter = "KlNachname", FieldName = "Person.LastName", IconType = "AB" };
|
||||
personendaten.Children.Add(nachname);
|
||||
PlatzhalterDC alias = new PlatzhalterDC() { Bezeichnung = "Alias", Platzhalter = "KlAlias", FieldName = "CustomerAlias", IconType = "AB" };
|
||||
personendaten.Children.Add(alias);
|
||||
PlatzhalterDC gebDatum = new PlatzhalterDC() { Bezeichnung = "Geburtsdatum", Platzhalter = "KlGeburtsdatum", FieldName = "Person.DateOfBirth", IconType = "AB" };
|
||||
personendaten.Children.Add(gebDatum);
|
||||
PlatzhalterDC telefonnummer = new PlatzhalterDC() { Bezeichnung = "Telefon", Platzhalter = "KlTelefon", FieldName = "Person.Contacts", IconType = "AB" };
|
||||
personendaten.Children.Add(telefonnummer);
|
||||
PlatzhalterDC handynummer = new PlatzhalterDC() { Bezeichnung = "Handy", Platzhalter = "KlHandy", FieldName = "Person.Contacts", IconType = "AB" };
|
||||
personendaten.Children.Add(handynummer);
|
||||
PlatzhalterDC email = new PlatzhalterDC() { Bezeichnung = "E-Mail", Platzhalter = "KlEmail", FieldName = "Person.Contacts", IconType = "AB" };
|
||||
personendaten.Children.Add(email);
|
||||
PlatzhalterDC fax = new PlatzhalterDC() { Bezeichnung = "KlFax", Platzhalter = "KlFax", FieldName = "Person.Contacts", IconType = "AB" };
|
||||
personendaten.Children.Add(fax);
|
||||
PlatzhalterDC berufsbezeichnung = new PlatzhalterDC() { Bezeichnung = "Beruf", Platzhalter = "KlBeruf", FieldName = "Person.Profession", IconType = "AB" };
|
||||
personendaten.Children.Add(berufsbezeichnung);
|
||||
PlatzhalterDC debitor = new PlatzhalterDC() { Bezeichnung = "Debitorennumer", Platzhalter = "Debitorennumer", FieldName = "DebitorNumber", IconType = "AB" };
|
||||
personendaten.Children.Add(debitor);
|
||||
PlatzhalterDC kostenstelle = new PlatzhalterDC() { Bezeichnung = "Kostenstelle", Platzhalter = "Kostenstelle", FieldName = "CostCenter", IconType = "AB" };
|
||||
personendaten.Children.Add(kostenstelle);
|
||||
|
||||
|
||||
#endregion Children Personendaten
|
||||
PlatzhalterDC adressdatenKlient = new PlatzhalterDC()
|
||||
{
|
||||
Bezeichnung = "Adressdaten Klient/-in",
|
||||
Children = new List<PlatzhalterDC>(),
|
||||
IconType = "Home"
|
||||
};
|
||||
#region Children Adressdaten Klient/-in
|
||||
PlatzhalterDC strasse = new PlatzhalterDC() { Bezeichnung = "Straße", Platzhalter = "KlStrasse", IconType = "AB", FieldName = "Person.Address.Street" };
|
||||
adressdatenKlient.Children.Add(strasse);
|
||||
PlatzhalterDC plz = new PlatzhalterDC() { Bezeichnung = "PLZ", Platzhalter = "KlPLZ", IconType = "AB", FieldName = "Person.Address.PostalCode" };
|
||||
adressdatenKlient.Children.Add(plz);
|
||||
PlatzhalterDC ort = new PlatzhalterDC() { Bezeichnung = "Ort", Platzhalter = "KlOrt", IconType = "AB", FieldName = "Person.Address.Town" };
|
||||
adressdatenKlient.Children.Add(ort);
|
||||
#endregion
|
||||
|
||||
PlatzhalterDC vga = new PlatzhalterDC()
|
||||
{
|
||||
Bezeichnung = "Vermittlung gemeinnütziger Arbeit",
|
||||
Children = new List<PlatzhalterDC>(),
|
||||
IconType = "BoyAndGirl"
|
||||
};
|
||||
#region Children Vermittlung gemeinnütziger Arbeit
|
||||
vga.Children.Add(new PlatzhalterDC() { Bezeichnung = "AZ der Staatsanwaltschaft/des Gerichts", Platzhalter = "AktenzeichenGericht", FieldName = "Person.CustomerVermittlungArbeit.AktenzeichenGericht", IconType = "AB"});
|
||||
vga.Children.Add(new PlatzhalterDC() { Bezeichnung = "Eigenes Aktenzeichen", Platzhalter = "EigenesAktenzeichen", FieldName = "Person.CustomerVermittlungArbeit.EigenesAktenzeichen", IconType = "AB" });
|
||||
vga.Children.Add(new PlatzhalterDC() { Bezeichnung = "Auftragseingang", Platzhalter = "Auftragseingang", FieldName = "Person.CustomerVermittlungArbeit.Auftragseingang", IconType = "AB" });
|
||||
vga.Children.Add(new PlatzhalterDC() { Bezeichnung = "Auftragsherkunft", Platzhalter = "Auftragsherkunft", FieldName = "Person.CustomerVermittlungArbeit.Auftragsherkunft", IconType = "AB" });
|
||||
vga.Children.Add(new PlatzhalterDC() { Bezeichnung = "Vermittlungsgrundlage", Platzhalter = "Vermittlungsgrundlage", FieldName = "Person.CustomerVermittlungArbeit.Vermittlungsgrundlage", IconType = "AB" });
|
||||
vga.Children.Add(new PlatzhalterDC() { Bezeichnung = "Tagessätze", Platzhalter = "Tagessatze", FieldName = "Person.CustomerVermittlungArbeit.Tagessatze", IconType = "AB" });
|
||||
vga.Children.Add(new PlatzhalterDC() { Bezeichnung = "Tagessatzhöhe", Platzhalter = "Tagessatzhohe", FieldName = "Person.CustomerVermittlungArbeit.Tagessatzhohe", IconType = "AB" });
|
||||
vga.Children.Add(new PlatzhalterDC() { Bezeichnung = "Höhe der Geldstrafe", Platzhalter = "HoheDerGeldstrafe", FieldName = "Person.CustomerVermittlungArbeit.HoheDerGeldstrafe", IconType = "AB" });
|
||||
vga.Children.Add(new PlatzhalterDC() { Bezeichnung = "Zu leistende Arbeitsstunden", Platzhalter = "ZuLeistendeArbeitsstunden", FieldName = "Person.CustomerVermittlungArbeit.ZuLeistendeArbeitsstunden", IconType = "AB" });
|
||||
vga.Children.Add(new PlatzhalterDC() { Bezeichnung = "Hinweis", Platzhalter = "Hinweis", FieldName = "Person.CustomerVermittlungArbeit.Hinweis", IconType = "AB" });
|
||||
vga.Children.Add(new PlatzhalterDC() { Bezeichnung = "Termin", Platzhalter = "Termin", FieldName = "Person.CustomerVermittlungArbeit.Termin", IconType = "AB" });
|
||||
vga.Children.Add(new PlatzhalterDC() { Bezeichnung = "Bearbeitungsstatus", Platzhalter = "CustomerVermittlungBearbeitungsstatus", FieldName = "Person.CustomerVermittlungArbeit.CustomerVermittlungBearbeitungsstatus", IconType = "AB" });
|
||||
vga.Children.Add(new PlatzhalterDC() { Bezeichnung = "Auftragsrückgabe", Platzhalter = "Auftragsruckgabe", FieldName = "Person.CustomerVermittlungArbeit.Auftragsruckgabe", IconType = "AB" });
|
||||
vga.Children.Add(new PlatzhalterDC() { Bezeichnung = "Verlauf", Platzhalter = "Verlauf", FieldName = "Person.CustomerVermittlungArbeit.Verlauf", IconType = "AB" });
|
||||
vga.Children.Add(new PlatzhalterDC() { Bezeichnung = "Abgeleistete Stunden", Platzhalter = "AbgeleisteteStunden", FieldName = "Person.CustomerVermittlungArbeit.AbgeleisteteStunden", IconType = "AB" });
|
||||
vga.Children.Add(new PlatzhalterDC() { Bezeichnung = "Ersparte Hafttage", Platzhalter = "ErsparteHafttage", FieldName = "Person.CustomerVermittlungArbeit.ErsparteHafttage", IconType = "AB" });
|
||||
vga.Children.Add(new PlatzhalterDC() { Bezeichnung = "Geleistete Ratenzahlung", Platzhalter = "GeleisteteRatenzahlung", FieldName = "Person.CustomerVermittlungArbeit.GeleisteteRatenzahlung", IconType = "AB" });
|
||||
vga.Children.Add(new PlatzhalterDC() { Bezeichnung = "Geleistete Einmalzahlung", Platzhalter = "GeleisteteEinmalzahlung", FieldName = "Person.CustomerVermittlungArbeit.GeleisteteEinmalzahlung", IconType = "AB" });
|
||||
vga.Children.Add(new PlatzhalterDC() { Bezeichnung = "Bemerkung", Platzhalter = "Bemerkung", FieldName = "Person.CustomerVermittlungArbeit.Bemerkung", IconType = "AB" });
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
PlatzhalterDC betreuung = new PlatzhalterDC()
|
||||
{
|
||||
Bezeichnung = "Betreuung",
|
||||
Children = new List<PlatzhalterDC>(),
|
||||
IconType = "Paste"
|
||||
};
|
||||
#region Children Betreuung
|
||||
PlatzhalterDC betreuungsbeginn = new PlatzhalterDC() { Bezeichnung = "Betreuungsbeginn", Platzhalter = "Betreuungsbeginn", FieldName = "AssistanceBegin", IconType = "AB" };
|
||||
betreuung.Children.Add(betreuungsbeginn);
|
||||
PlatzhalterDC betreuungsende = new PlatzhalterDC() { Bezeichnung = "Betreuungsende", Platzhalter = "Betreuungsende", FieldName = "TerminationDate", IconType = "AB" };
|
||||
betreuung.Children.Add(betreuungsende);
|
||||
PlatzhalterDC grundBetreuungsende = new PlatzhalterDC() { Bezeichnung = "Grund Betreuungsbeendung", Platzhalter = "GrundBetreuungsbeendung", FieldName = "TerminationReason", IconType = "AB" };
|
||||
betreuung.Children.Add(grundBetreuungsende);
|
||||
|
||||
PlatzhalterDC behindertenausweis = new PlatzhalterDC()
|
||||
{
|
||||
Bezeichnung = "Schwerbehindertenausweis",
|
||||
Children = new List<PlatzhalterDC>(),
|
||||
IconType = "ContactCardWebDisabled"
|
||||
};
|
||||
#region Children Behindertenausweis
|
||||
PlatzhalterDC amt = new PlatzhalterDC() { Bezeichnung = "Ausstellendes Amt", Platzhalter = "AusweisAmt", FieldName = "AusstVersAmt", IconType = "AB" };
|
||||
behindertenausweis.Children.Add(amt);
|
||||
PlatzhalterDC gueltigVon = new PlatzhalterDC() { Bezeichnung = "Gültig von", Platzhalter = "AusweisGueltigVon", FieldName = "AusweisGueltigVon", IconType = "AB" };
|
||||
behindertenausweis.Children.Add(gueltigVon);
|
||||
PlatzhalterDC gueltigbis = new PlatzhalterDC() { Bezeichnung = "Gültig bis", Platzhalter = "AusweisGueltigBis", FieldName = "AusweisGueltigBis", IconType = "AB" };
|
||||
behindertenausweis.Children.Add(gueltigbis);
|
||||
PlatzhalterDC ausweisAktenzeichen = new PlatzhalterDC() { Bezeichnung = "Aktenzeichen", Platzhalter = "AusweisAktenzeichen", FieldName = "AusweisAktenzeichen", IconType = "AB" };
|
||||
behindertenausweis.Children.Add(ausweisAktenzeichen);
|
||||
PlatzhalterDC beiblatt = new PlatzhalterDC() { Bezeichnung = "Beiblattgültigkeit", Platzhalter = "AusweisBeiblatt", FieldName = "BeiblattGueltigBis", IconType = "AB" };
|
||||
behindertenausweis.Children.Add(beiblatt);
|
||||
PlatzhalterDC gradDerBehinderung = new PlatzhalterDC() { Bezeichnung = "Grad der Behinderung", Platzhalter = "AusweisGradDerBehinderung", FieldName = "GradDerBehinderung", IconType = "AB" };
|
||||
behindertenausweis.Children.Add(gradDerBehinderung);
|
||||
|
||||
betreuung.Children.Add(behindertenausweis);
|
||||
#endregion
|
||||
|
||||
PlatzhalterDC pflegegrad = new PlatzhalterDC() { Bezeichnung = "Pflegegrad", Platzhalter = "Pflegegrad", FieldName = "Pflegegrad", IconType = "AB" };
|
||||
betreuung.Children.Add(pflegegrad);
|
||||
|
||||
PlatzhalterDC versicherung = new PlatzhalterDC()
|
||||
{
|
||||
Bezeichnung = "Versicherungsdaten",
|
||||
Children = new List<PlatzhalterDC>(),
|
||||
IconType = "OfficeBulidingBlackDisabled"
|
||||
};
|
||||
#region Children Versicherung
|
||||
PlatzhalterDC krankenkasse = new PlatzhalterDC() { Bezeichnung = "Krankenkasse", Platzhalter = "KlientKrankenkasse", IconType = "AB" };
|
||||
versicherung.Children.Add(krankenkasse);
|
||||
PlatzhalterDC versnummer = new PlatzhalterDC() { Bezeichnung = "Versichertennummer", Platzhalter = "KlientVersNummer", IconType = "AB" };
|
||||
versicherung.Children.Add(krankenkasse);
|
||||
PlatzhalterDC versStatus = new PlatzhalterDC() { Bezeichnung = "Versicherungsstatus", Platzhalter = "KlientVersicherungsstatus", IconType = "AB" };
|
||||
versicherung.Children.Add(krankenkasse);
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
PlatzhalterDC sonstiges = new PlatzhalterDC()
|
||||
{
|
||||
Bezeichnung = "Sonstiges",
|
||||
Children = new List<PlatzhalterDC>(),
|
||||
IconType = "Add24"
|
||||
};
|
||||
#region Children Sonstiges
|
||||
PlatzhalterDC datum = new PlatzhalterDC() { Bezeichnung = "Tagesdatum", Platzhalter = "Tagesdatum", IconType = "AB" };
|
||||
sonstiges.Children.Add(datum);
|
||||
#endregion
|
||||
|
||||
|
||||
var em = new EmployeePlaceholderManager();
|
||||
liste.AddRange(em.GetPlatzhalter());
|
||||
|
||||
liste.Add(personendaten);
|
||||
liste.Add(adressdatenKlient);
|
||||
liste.Add(vga);
|
||||
//liste.Add(adressdatenOrganisation);
|
||||
liste.Add(betreuung);
|
||||
liste.Add(sonstiges);
|
||||
|
||||
return liste;
|
||||
}
|
||||
|
||||
public override Object GetEntityObject(long oid)
|
||||
{
|
||||
return DAOFactory.GenericDAO.GetByID<Customer>(oid);
|
||||
}
|
||||
|
||||
public override String GetPlaceholderValue(PlatzhalterDC ph, Object obj)
|
||||
{
|
||||
return GetPlaceholderValueForCustomer(ph, obj as Customer);
|
||||
}
|
||||
|
||||
public String GetPlaceholderValueForCustomer(PlatzhalterDC ph, Customer customer)
|
||||
{
|
||||
if (customer == null)
|
||||
{
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
if (ph.Platzhalter == "MaVorname" ||
|
||||
ph.Platzhalter == "MaNachname" ||
|
||||
ph.Platzhalter == "MaTelefon" ||
|
||||
ph.Platzhalter == "MaFax" ||
|
||||
ph.Platzhalter == "MaEmail" ||
|
||||
ph.Platzhalter == "MaHandy")
|
||||
{
|
||||
var em = new EmployeePlaceholderManager();
|
||||
return em.GetPlaceholderValueForEmployee(ph, Data.Security.UserRightHelper.GetLoggedInUser().Employee);
|
||||
}
|
||||
|
||||
if (ph.Platzhalter == "KlBriefanrede")
|
||||
{
|
||||
if (customer.Person.Sex == Sex.Male)
|
||||
return "Sehr geehrter Herr";
|
||||
else if (customer.Person.Sex == Sex.Female)
|
||||
return "Sehr geehrte Frau";
|
||||
}
|
||||
|
||||
if (ph.Platzhalter == "KlAnrede")
|
||||
{
|
||||
if (customer.Person.Sex == Sex.Male)
|
||||
return "Herr";
|
||||
else if (customer.Person.Sex == Sex.Female)
|
||||
return "Frau";
|
||||
}
|
||||
|
||||
if (ph.Platzhalter == "KlVorname")
|
||||
{
|
||||
return base.GetPlaceholderValue(ph, customer);
|
||||
//return customer.Person.FirstName;
|
||||
}
|
||||
if (ph.Platzhalter == "KlNachname")
|
||||
{
|
||||
return customer.Person.LastName;
|
||||
}
|
||||
|
||||
if (ph.Platzhalter == "KlGeburtsdatum")
|
||||
{
|
||||
return String.Format("{0:dd.MM.yyyy}", customer.Person.DateOfBirth);
|
||||
}
|
||||
|
||||
if (ph.Platzhalter == "KlTelefon")
|
||||
{
|
||||
foreach (Contact c in customer.Person.Contacts)
|
||||
{
|
||||
if (c.Type == ContactType.business_Phone)
|
||||
{
|
||||
return c.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ph.Platzhalter == "KlHandy")
|
||||
{
|
||||
foreach (Contact c in customer.Person.Contacts)
|
||||
{
|
||||
if (c.Type == ContactType.business_MobilePhone)
|
||||
{
|
||||
return c.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ph.Platzhalter == "KlEmail")
|
||||
{
|
||||
foreach (Contact c in customer.Person.Contacts)
|
||||
{
|
||||
if (c.Type == ContactType.business_Mail)
|
||||
{
|
||||
return c.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ph.Platzhalter == "KlFax")
|
||||
{
|
||||
foreach (Contact c in customer.Person.Contacts)
|
||||
{
|
||||
if (c.Type == ContactType.business_Fax)
|
||||
{
|
||||
return c.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ph.Platzhalter == "KlBeruf")
|
||||
{
|
||||
return customer.Person.Profession;
|
||||
}
|
||||
|
||||
//Adressdaten
|
||||
if (customer.Person.Address != null)
|
||||
{
|
||||
if (ph.Platzhalter == "KlStrasse")
|
||||
{
|
||||
return customer.Person.Address.Street;
|
||||
}
|
||||
if (ph.Platzhalter == "KlPLZ")
|
||||
{
|
||||
return customer.Person.Address.PostalCode;
|
||||
}
|
||||
if (ph.Platzhalter == "KlOrt")
|
||||
{
|
||||
return customer.Person.Address.Town;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Betreuung
|
||||
if (ph.Platzhalter == "KlAnsprechpartner")
|
||||
{
|
||||
|
||||
string anrede = (customer.Ansprechpartner.Sex == 0) ? "Herr " : "Frau ";
|
||||
return anrede + customer.Ansprechpartner.FirstNameLastName;
|
||||
}
|
||||
if (ph.Platzhalter == "Kostenstelle")
|
||||
{
|
||||
return customer.CostCenter;
|
||||
}
|
||||
|
||||
//Sonstiges
|
||||
if (ph.Platzhalter == "Tagesdatum")
|
||||
{
|
||||
return String.Format("{0:dd.MM.yyyy}", DateTime.Now);
|
||||
}
|
||||
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,7 @@ namespace BeWo.Service.Dokumentverwaltung
|
||||
bool templateFolder = folder.Any(f => f.SystemEntryID.Equals(SystemEntryID.TemplateDirectory));
|
||||
var folderDCList = new List<BeWoFolderDC>();
|
||||
|
||||
foreach (BeWoFolder item in SortiereOrdner(folder))
|
||||
foreach (BeWoFolder item in SortiereOrdner(folder))
|
||||
{
|
||||
folderDCList.Add(MapperFactory.BeWoFolderDC_BeWoFolder.MapToNewDC(item));
|
||||
}
|
||||
|
||||
121
Service/Dokumentverwaltung/EmployeePlaceholderManager.cs
Normal file
121
Service/Dokumentverwaltung/EmployeePlaceholderManager.cs
Normal file
@@ -0,0 +1,121 @@
|
||||
using BeWo.Data.Access;
|
||||
using BeWo.Data.Entities;
|
||||
using BeWo.Service.DCEntityMapper;
|
||||
using BS.Shared;
|
||||
using BS.Shared.DataContracts;
|
||||
using DevExpress.XtraRichEdit;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Media.Imaging;
|
||||
|
||||
namespace BeWo.Service.Dokumentverwaltung
|
||||
{
|
||||
public class EmployeePlaceholderManager : PlaceholderManager
|
||||
{
|
||||
|
||||
public override List<PlatzhalterDC> GetPlatzhalter()
|
||||
{
|
||||
List<PlatzhalterDC> liste = new List<PlatzhalterDC>();
|
||||
|
||||
PlatzhalterDC employeedaten = new PlatzhalterDC()
|
||||
{
|
||||
Bezeichnung = "Mitarbeiter/in",
|
||||
Children = new List<PlatzhalterDC>(),
|
||||
IconType = "UserGroupHome24bw"
|
||||
};
|
||||
employeedaten.Children.Add(new PlatzhalterDC { Bezeichnung = "Vorname", Platzhalter = "MaVorname", FieldName = "Employee.Person.FirstName", IconType = "AB" });
|
||||
employeedaten.Children.Add(new PlatzhalterDC { Bezeichnung = "Nachname", Platzhalter = "MaNachname", FieldName = "Employee.Person.LastName", IconType = "AB" });
|
||||
employeedaten.Children.Add(new PlatzhalterDC { Bezeichnung = "Telefon", Platzhalter = "MaTelefon", FieldName = "Employee.Person.Phone", IconType = "AB" });
|
||||
employeedaten.Children.Add(new PlatzhalterDC { Bezeichnung = "Fax", Platzhalter = "MaFax", FieldName = "Employee.Person.Fax", IconType = "AB" });
|
||||
employeedaten.Children.Add(new PlatzhalterDC { Bezeichnung = "E-Mail", Platzhalter = "MaEmail", FieldName = "Employee.Person.Mail", IconType = "AB" });
|
||||
employeedaten.Children.Add(new PlatzhalterDC { Bezeichnung = "Handy", Platzhalter = "MaHandy", FieldName = "Employee.Person.Mobile", IconType = "AB" });
|
||||
|
||||
|
||||
liste.Add(employeedaten);
|
||||
|
||||
return liste;
|
||||
}
|
||||
|
||||
public virtual Object GetEntityObject(long oid)
|
||||
{
|
||||
return DAOFactory.GenericDAO.GetByID<Employee>(oid);
|
||||
}
|
||||
|
||||
public override String GetPlaceholderValue(PlatzhalterDC ph, Object obj)
|
||||
{
|
||||
return GetPlaceholderValueForEmployee(ph, obj as Employee);
|
||||
}
|
||||
|
||||
public String GetPlaceholderValueForEmployee(PlatzhalterDC ph, Employee employee)
|
||||
{
|
||||
if (employee == null)
|
||||
{
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
if (ph.Platzhalter == "MaVorname")
|
||||
{
|
||||
return base.GetPlaceholderValue(ph, employee);
|
||||
//return customer.Person.FirstName;
|
||||
}
|
||||
if (ph.Platzhalter == "MaNachname")
|
||||
{
|
||||
return employee.Person.LastName;
|
||||
}
|
||||
|
||||
if (ph.Platzhalter == "MaGeburtsdatum")
|
||||
{
|
||||
return String.Format("{0:dd.MM.yyyy}", employee.Person.DateOfBirth);
|
||||
}
|
||||
|
||||
if (ph.Platzhalter == "MaTelefon")
|
||||
{
|
||||
foreach (Contact c in employee.Person.Contacts)
|
||||
{
|
||||
if (c.Type == ContactType.business_Phone)
|
||||
{
|
||||
return c.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ph.Platzhalter == "MaHandy")
|
||||
{
|
||||
foreach (Contact c in employee.Person.Contacts)
|
||||
{
|
||||
if (c.Type == ContactType.business_MobilePhone)
|
||||
{
|
||||
return c.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ph.Platzhalter == "MaEmail")
|
||||
{
|
||||
foreach (Contact c in employee.Person.Contacts)
|
||||
{
|
||||
if (c.Type == ContactType.business_Mail)
|
||||
{
|
||||
return c.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ph.Platzhalter == "MaFax")
|
||||
{
|
||||
foreach (Contact c in employee.Person.Contacts)
|
||||
{
|
||||
if (c.Type == ContactType.business_Fax)
|
||||
{
|
||||
return c.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
92
Service/Dokumentverwaltung/PlaceholderManager.cs
Normal file
92
Service/Dokumentverwaltung/PlaceholderManager.cs
Normal file
@@ -0,0 +1,92 @@
|
||||
using BeWo.Data.Access;
|
||||
using BeWo.Data.Entities;
|
||||
using BeWo.Service.DCEntityMapper;
|
||||
using BS.Shared;
|
||||
using BS.Shared.DataContracts;
|
||||
using DevExpress.XtraRichEdit;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Media.Imaging;
|
||||
|
||||
namespace BeWo.Service.Dokumentverwaltung
|
||||
{
|
||||
public class PlaceholderManager
|
||||
{
|
||||
|
||||
public virtual List<PlatzhalterDC> GetPlatzhalter()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public virtual string ReplacePlaceholdersInTemplate(DokumentvorlageDC template, long? objectOid, TableID tid)
|
||||
{
|
||||
//Nur für abgeleitete Klassen
|
||||
return null;
|
||||
}
|
||||
|
||||
public virtual void ReplacePlaceholderInText(RichEditDocumentServer rtfServer, PlatzhalterDC ph, Object obj)
|
||||
{
|
||||
if (!String.IsNullOrEmpty(ph.Platzhalter))
|
||||
{
|
||||
String platzhalter = String.Format("[{0}]", ph.Platzhalter);
|
||||
|
||||
String platzhalterWert = GetPlaceholderValue(ph, obj);
|
||||
|
||||
//var doc = rtfServer.Document as DevExpress.XtraRichEdit.API.Native.Implementation.NativeDocument;
|
||||
|
||||
//var list = rtfServer.Document.FindAll("blablubb", DevExpress.XtraRichEdit.API.Native.SearchOptions.None);
|
||||
|
||||
foreach (var shape in rtfServer.Document.Shapes)
|
||||
{
|
||||
var subdoc = shape.ShapeFormat?.TextBox?.Document;
|
||||
if (subdoc != null)
|
||||
{
|
||||
subdoc.ReplaceAll(platzhalter, platzhalterWert, DevExpress.XtraRichEdit.API.Native.SearchOptions.CaseSensitive);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
//var list = rtfServer.MailMerge( sd.FindAll(platzhalter1, DevExpress.XtraRichEdit.API.Native.SearchOptions.CaseSensitive);
|
||||
|
||||
rtfServer.Document.ReplaceAll(platzhalter, platzhalterWert, DevExpress.XtraRichEdit.API.Native.SearchOptions.CaseSensitive);
|
||||
//sd.ReplaceAll(platzhalter1, GetPlaceholderValue(ph, obj), DevExpress.XtraRichEdit.API.Native.SearchOptions.CaseSensitive);
|
||||
//if (text.Contains(platzhalter1))
|
||||
//{
|
||||
// int test = 0;
|
||||
//}
|
||||
|
||||
//if (text.Contains(platzhalter1) || text.Contains(platzhalter2) || text.Contains(platzhalter3))
|
||||
//{
|
||||
// return text.Replace(ph.Platzhalter, GetPlaceholderValue(ph, obj));
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
public virtual String GetPlaceholderValue(PlatzhalterDC ph, Object obj)
|
||||
{
|
||||
var props = obj.GetType().GetProperties();
|
||||
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
public virtual String GetPlaceholderValue(String FieldName, Object obj)
|
||||
{
|
||||
var props = obj.GetType().GetProperties();
|
||||
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
public virtual Object GetEntityObject(long oid)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -3,15 +3,17 @@ using BeWo.Data.Entities;
|
||||
using BeWo.Service.DCEntityMapper;
|
||||
using BS.Shared;
|
||||
using BS.Shared.DataContracts;
|
||||
using DevExpress.XtraRichEdit;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Media.Imaging;
|
||||
|
||||
namespace BeWo.Service.Vorlagen
|
||||
namespace BeWo.Service.Dokumentverwaltung
|
||||
{
|
||||
public class VorlagenManager
|
||||
{
|
||||
@@ -60,11 +62,14 @@ namespace BeWo.Service.Vorlagen
|
||||
|
||||
public List<PlatzhalterDC> GetPlatzhalterForTemplate(VorlagentabelleDC vt)
|
||||
{
|
||||
PlaceholderManager pm = null;
|
||||
|
||||
var tid = (TableID)vt.VorlagentabelleObjectTid;
|
||||
switch (tid)
|
||||
{
|
||||
case TableID.Customer:
|
||||
return GetPlatzhalterForCustomer();
|
||||
pm = new CustomerPlaceholderManager();
|
||||
break;
|
||||
case TableID.SupportConcept:
|
||||
return GetPlatzhalterForSupportConcept();
|
||||
case TableID.Employee:
|
||||
@@ -72,154 +77,14 @@ namespace BeWo.Service.Vorlagen
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (pm != null)
|
||||
{
|
||||
return pm.GetPlatzhalter();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<PlatzhalterDC> GetPlatzhalterForCustomer()
|
||||
{
|
||||
List<PlatzhalterDC> liste = new List<PlatzhalterDC>();
|
||||
|
||||
PlatzhalterDC personendaten = new PlatzhalterDC()
|
||||
{
|
||||
Bezeichnung = "Personendaten",
|
||||
Children = new List<PlatzhalterDC>(),
|
||||
IconType = "BoyAndGirl"
|
||||
};
|
||||
#region Children Personendaten
|
||||
PlatzhalterDC anrede = new PlatzhalterDC() { Bezeichnung = "Anrede", Platzhalter = "Anrede", IconType = "AB" };
|
||||
personendaten.Children.Add(anrede);
|
||||
PlatzhalterDC vorname = new PlatzhalterDC() { Bezeichnung = "Vorname", Platzhalter = "Vorname" , FieldName = "Person.FirstName", IconType = "AB" };
|
||||
personendaten.Children.Add(vorname);
|
||||
PlatzhalterDC nachname = new PlatzhalterDC() { Bezeichnung = "Nachname", Platzhalter = "Nachname", FieldName = "Person.LastName", IconType = "AB" };
|
||||
personendaten.Children.Add(nachname);
|
||||
PlatzhalterDC alias = new PlatzhalterDC() { Bezeichnung = "Alias", Platzhalter = "Alias", FieldName = "CustomerAlias", IconType = "AB" };
|
||||
personendaten.Children.Add(alias);
|
||||
PlatzhalterDC gebDatum = new PlatzhalterDC() { Bezeichnung = "Geburtsdatum", Platzhalter = "Geburtsdatum", FieldName = "Person.DateOfBirth", IconType = "AB" };
|
||||
personendaten.Children.Add(gebDatum);
|
||||
PlatzhalterDC telefonnummer = new PlatzhalterDC() { Bezeichnung = "Telefonnummer", Platzhalter = "Telefonnummer", FieldName = "Person.Contacts", IconType = "AB" };
|
||||
personendaten.Children.Add(telefonnummer);
|
||||
PlatzhalterDC handynummer = new PlatzhalterDC() { Bezeichnung = "Handynummer", Platzhalter = "Handynummer", FieldName = "Person.Contacts", IconType = "AB" };
|
||||
personendaten.Children.Add(handynummer);
|
||||
PlatzhalterDC email = new PlatzhalterDC() { Bezeichnung = "E-Mail-Adresse", Platzhalter = "Email", FieldName = "Person.Contacts", IconType = "AB" };
|
||||
personendaten.Children.Add(email);
|
||||
PlatzhalterDC fax = new PlatzhalterDC() { Bezeichnung = "Fax", Platzhalter = "Fax", FieldName = "Person.Contacts", IconType = "AB" };
|
||||
personendaten.Children.Add(fax);
|
||||
PlatzhalterDC berufsbezeichnung = new PlatzhalterDC() { Bezeichnung = "Berufsbezeichnung", Platzhalter = "Berufsbezeichnung", FieldName = "Person.Profession", IconType = "AB" };
|
||||
personendaten.Children.Add(berufsbezeichnung);
|
||||
PlatzhalterDC debitor = new PlatzhalterDC() { Bezeichnung = "Debitorennumer", Platzhalter = "Debitorennumer", FieldName = "DebitorNumber", IconType = "AB" };
|
||||
personendaten.Children.Add(debitor);
|
||||
PlatzhalterDC kostenstelle = new PlatzhalterDC() { Bezeichnung = "Kostenstelle", Platzhalter = "Kostenstelle", FieldName = "CostCenter", IconType = "AB" };
|
||||
personendaten.Children.Add(kostenstelle);
|
||||
|
||||
|
||||
#endregion Children Personendaten
|
||||
PlatzhalterDC adressdatenKlient = new PlatzhalterDC()
|
||||
{
|
||||
Bezeichnung = "Adressdaten Klient/-in",
|
||||
Children = new List<PlatzhalterDC>(),
|
||||
IconType = "Home"
|
||||
};
|
||||
#region Children Adressdaten Klient/-in
|
||||
PlatzhalterDC strasse = new PlatzhalterDC() { Bezeichnung = "Straße", Platzhalter = "KlientStrasse", IconType = "AB", FieldName = "Person.Address.Street" };
|
||||
adressdatenKlient.Children.Add(strasse);
|
||||
PlatzhalterDC plz = new PlatzhalterDC() { Bezeichnung = "PLZ", Platzhalter = "KlientPLZ", IconType = "AB", FieldName = "Person.Address.PostalCode" };
|
||||
adressdatenKlient.Children.Add(plz);
|
||||
PlatzhalterDC ort = new PlatzhalterDC() { Bezeichnung = "Ort", Platzhalter = "KlientOrt", IconType = "AB", FieldName = "Person.Address.Town" };
|
||||
adressdatenKlient.Children.Add(ort);
|
||||
#endregion
|
||||
|
||||
PlatzhalterDC vga = new PlatzhalterDC()
|
||||
{
|
||||
Bezeichnung = "Vermittlung gemeinnütziger Arbeit",
|
||||
Children = new List<PlatzhalterDC>(),
|
||||
IconType = "BoyAndGirl"
|
||||
};
|
||||
#region Children Vermittlung gemeinnütziger Arbeit
|
||||
vga.Children.Add(new PlatzhalterDC() { Bezeichnung = "Straße", Platzhalter = "KlientStrasse", FieldName = "Person.Address.Street", IconType = "AB"});
|
||||
vga.Children.Add(new PlatzhalterDC() { Bezeichnung = "PLZ", Platzhalter = "KlientPLZ", FieldName = "Person.Address.PostalCode", IconType = "AB" });
|
||||
vga.Children.Add(new PlatzhalterDC() { Bezeichnung = "Ort", Platzhalter = "KlientOrt", FieldName = "Person.Address.Town", IconType = "AB" });
|
||||
#endregion
|
||||
|
||||
|
||||
PlatzhalterDC betreuung = new PlatzhalterDC()
|
||||
{
|
||||
Bezeichnung = "Betreuung",
|
||||
Children = new List<PlatzhalterDC>(),
|
||||
IconType = "Paste"
|
||||
};
|
||||
#region Children Betreuung
|
||||
PlatzhalterDC betreuungsbeginn = new PlatzhalterDC() { Bezeichnung = "Betreuungsbeginn", Platzhalter = "Betreuungsbeginn", FieldName = "AssistanceBegin", IconType = "AB" };
|
||||
betreuung.Children.Add(betreuungsbeginn);
|
||||
PlatzhalterDC betreuungsende = new PlatzhalterDC() { Bezeichnung = "Betreuungsende", Platzhalter = "Betreuungsende", FieldName = "TerminationDate", IconType = "AB" };
|
||||
betreuung.Children.Add(betreuungsende);
|
||||
PlatzhalterDC grundBetreuungsende = new PlatzhalterDC() { Bezeichnung = "Grund Betreuungsbeendung", Platzhalter = "GrundBetreuungsbeendung", FieldName = "TerminationReason", IconType = "AB" };
|
||||
betreuung.Children.Add(grundBetreuungsende);
|
||||
|
||||
PlatzhalterDC behindertenausweis = new PlatzhalterDC()
|
||||
{
|
||||
Bezeichnung = "Schwerbehindertenausweis",
|
||||
Children = new List<PlatzhalterDC>(),
|
||||
IconType = "ContactCardWebDisabled"
|
||||
};
|
||||
#region Children Behindertenausweis
|
||||
PlatzhalterDC amt = new PlatzhalterDC() { Bezeichnung = "Ausstellendes Amt", Platzhalter = "AusweisAmt", FieldName = "AusstVersAmt", IconType = "AB" };
|
||||
behindertenausweis.Children.Add(amt);
|
||||
PlatzhalterDC gueltigVon = new PlatzhalterDC() { Bezeichnung = "Gültig von", Platzhalter = "AusweisGueltigVon", FieldName = "AusweisGueltigVon", IconType = "AB" };
|
||||
behindertenausweis.Children.Add(gueltigVon);
|
||||
PlatzhalterDC gueltigbis = new PlatzhalterDC() { Bezeichnung = "Gültig bis", Platzhalter = "AusweisGueltigBis", FieldName = "AusweisGueltigBis", IconType = "AB" };
|
||||
behindertenausweis.Children.Add(gueltigbis);
|
||||
PlatzhalterDC ausweisAktenzeichen = new PlatzhalterDC() { Bezeichnung = "Aktenzeichen", Platzhalter = "AusweisAktenzeichen", FieldName = "AusweisAktenzeichen", IconType = "AB" };
|
||||
behindertenausweis.Children.Add(ausweisAktenzeichen);
|
||||
PlatzhalterDC beiblatt = new PlatzhalterDC() { Bezeichnung = "Beiblattgültigkeit", Platzhalter = "AusweisBeiblatt", FieldName = "BeiblattGueltigBis", IconType = "AB" };
|
||||
behindertenausweis.Children.Add(beiblatt);
|
||||
PlatzhalterDC gradDerBehinderung = new PlatzhalterDC() { Bezeichnung = "Grad der Behinderung", Platzhalter = "AusweisGradDerBehinderung", FieldName = "GradDerBehinderung", IconType = "AB" };
|
||||
behindertenausweis.Children.Add(gradDerBehinderung);
|
||||
|
||||
betreuung.Children.Add(behindertenausweis);
|
||||
#endregion
|
||||
|
||||
PlatzhalterDC pflegegrad = new PlatzhalterDC() { Bezeichnung = "Pflegegrad", Platzhalter = "Pflegegrad", FieldName = "Pflegegrad", IconType = "AB" };
|
||||
betreuung.Children.Add(pflegegrad);
|
||||
|
||||
PlatzhalterDC versicherung = new PlatzhalterDC()
|
||||
{
|
||||
Bezeichnung = "Versicherungsdaten",
|
||||
Children = new List<PlatzhalterDC>(),
|
||||
IconType = "OfficeBulidingBlackDisabled"
|
||||
};
|
||||
#region Children Versicherung
|
||||
PlatzhalterDC krankenkasse = new PlatzhalterDC() { Bezeichnung = "Krankenkasse", Platzhalter = "KlientKrankenkasse", IconType = "AB" };
|
||||
versicherung.Children.Add(krankenkasse);
|
||||
PlatzhalterDC versnummer = new PlatzhalterDC() { Bezeichnung = "Versichertennummer", Platzhalter = "KlientVersNummer", IconType = "AB" };
|
||||
versicherung.Children.Add(krankenkasse);
|
||||
PlatzhalterDC versStatus = new PlatzhalterDC() { Bezeichnung = "Versicherungsstatus", Platzhalter = "KlientVersicherungsstatus", IconType = "AB" };
|
||||
versicherung.Children.Add(krankenkasse);
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
PlatzhalterDC sonstiges = new PlatzhalterDC()
|
||||
{
|
||||
Bezeichnung = "Sonstiges",
|
||||
Children = new List<PlatzhalterDC>(),
|
||||
IconType = "Add24"
|
||||
};
|
||||
#region Children Sonstiges
|
||||
PlatzhalterDC datum = new PlatzhalterDC() { Bezeichnung = "Datum", Platzhalter = "Datum", IconType = "AB" };
|
||||
sonstiges.Children.Add(datum);
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
liste.Add(personendaten);
|
||||
liste.Add(adressdatenKlient);
|
||||
liste.Add(vga);
|
||||
//liste.Add(adressdatenOrganisation);
|
||||
liste.Add(betreuung);
|
||||
liste.Add(sonstiges);
|
||||
|
||||
return liste;
|
||||
}
|
||||
|
||||
public List<PlatzhalterDC> GetPlatzhalterForSupportConcept()
|
||||
{
|
||||
List<PlatzhalterDC> liste = new List<PlatzhalterDC>();
|
||||
@@ -439,28 +304,55 @@ namespace BeWo.Service.Vorlagen
|
||||
DAOFactory.GenericDAO.Delete(origTemplate);
|
||||
}
|
||||
}
|
||||
public string ReplacePlaceholdersInTemplate(DokumentvorlageDC template, long? objectOid, long? tableOid)
|
||||
{
|
||||
string adaptedRTF = "";
|
||||
|
||||
if (!String.IsNullOrEmpty(template.RTFText))
|
||||
public void ReplacePlaceholdersInTemplate(RichEditDocumentServer rtfServer, long objectOid, TableID tid)
|
||||
{
|
||||
PlaceholderManager pm = null;
|
||||
|
||||
|
||||
switch (tid)
|
||||
{
|
||||
switch (tableOid)
|
||||
case TableID.Employee:
|
||||
break;
|
||||
case TableID.Customer:
|
||||
pm = new CustomerPlaceholderManager();
|
||||
break;
|
||||
case TableID.SupportConcept:
|
||||
break;
|
||||
}
|
||||
|
||||
if (pm != null)
|
||||
{
|
||||
|
||||
var obj = pm.GetEntityObject(objectOid);
|
||||
|
||||
var phList = pm.GetPlatzhalter();
|
||||
|
||||
ReplacePlaceholdersInTemplate(pm, rtfServer, phList, obj);
|
||||
}
|
||||
}
|
||||
|
||||
private void ReplacePlaceholdersInTemplate(PlaceholderManager pm, RichEditDocumentServer rtfServer, List<PlatzhalterDC> phList, object obj)
|
||||
{
|
||||
foreach (var ph in phList)
|
||||
{
|
||||
pm.ReplacePlaceholderInText(rtfServer, ph, obj);
|
||||
|
||||
if (ph.Children != null && ph.Children.Count > 0)
|
||||
{
|
||||
case 2: adaptedRTF = EmployeeTemplate(objectOid, template.RTFText); break;
|
||||
case 8: adaptedRTF = CustomerTemplate(objectOid, template.RTFText); break;
|
||||
case 15: adaptedRTF = SupportConceptTemplate(objectOid, template.RTFText); break;
|
||||
ReplacePlaceholdersInTemplate(pm, rtfServer, ph.Children, obj);
|
||||
}
|
||||
}
|
||||
return adaptedRTF;
|
||||
|
||||
}
|
||||
private string EmployeeTemplate(long? objectOid, string RTFWithPlaceholders)
|
||||
|
||||
private string EmployeeTemplate(long objectOid, string RTFWithPlaceholders)
|
||||
{
|
||||
bool allSet = true;
|
||||
List<string> attributeList = new List<string>();
|
||||
string attributeString = "";
|
||||
|
||||
var employee = DAOFactory.GenericDAO.GetByID<Employee>((long)objectOid);
|
||||
var employee = DAOFactory.GenericDAO.GetByID<Employee>(objectOid);
|
||||
var contacts = employee.Person.Contacts;
|
||||
|
||||
|
||||
@@ -621,241 +513,6 @@ namespace BeWo.Service.Vorlagen
|
||||
}
|
||||
}
|
||||
|
||||
private string CustomerTemplate(long? objectOid, string RTFWithPlaceholders)
|
||||
{
|
||||
bool allSet = true;
|
||||
List<string> attributeList = new List<string>();
|
||||
string attributeString = "";
|
||||
|
||||
var customer = DAOFactory.GenericDAO.GetByID<Customer>((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 "";
|
||||
}
|
||||
}
|
||||
|
||||
//private static string ErsetzePlatzhalter(Object objekt, PlatzhalterDC pdc)
|
||||
//{
|
||||
@@ -1095,5 +752,52 @@ namespace BeWo.Service.Vorlagen
|
||||
}
|
||||
}
|
||||
|
||||
public String CreateRtfDocumentFromTemplate(long vorlageOid, TableID objectTid, List<long> objectOids)
|
||||
{
|
||||
string rtf = "";
|
||||
|
||||
var templateDC = MapperFactory.DokumentvorlageDC_Dokumentvorlage.MapToNewDC(DAOFactory.GenericDAO.GetByID<Dokumentvorlage>(vorlageOid));
|
||||
|
||||
if (!String.IsNullOrEmpty(templateDC.RTFText))
|
||||
{
|
||||
RichEditDocumentServer server = new RichEditDocumentServer();
|
||||
|
||||
using (var stream = new MemoryStream(Encoding.Default.GetBytes(templateDC.RTFText)))
|
||||
{
|
||||
server.LoadDocument(stream);
|
||||
}
|
||||
|
||||
foreach (var oid in objectOids)
|
||||
{
|
||||
ReplacePlaceholdersInTemplate(server, oid, objectTid);
|
||||
|
||||
rtf = server.Document.RtfText;
|
||||
|
||||
//var server = new RichEditDocumentServer();
|
||||
|
||||
//using (var stream = new MemoryStream(Encoding.Default.GetBytes(text)))
|
||||
//{
|
||||
// server.LoadDocument(stream);
|
||||
//}
|
||||
|
||||
//var ranges = server.Document.FindAll(DevExpress.Office.Characters.PageBreak.ToString(), DevExpress.XtraRichEdit.API.Native.SearchOptions.None);
|
||||
//var dp = server.Document.Paragraphs[0].Range.Start;
|
||||
|
||||
//List<VorlageRO> collection = new List<VorlageRO>();
|
||||
//foreach (var dr in ranges)
|
||||
//{
|
||||
// var tmpRange = server.Document.CreateRange(dp, dr.Start.ToInt() - dp.ToInt());
|
||||
// collection.Add(new VorlageRO { RTFText = server.Document.GetRtfText(tmpRange) });
|
||||
// dp = dr.End;
|
||||
//}
|
||||
//var tmpRange2 = server.Document.CreateRange(dp, server.Document.Paragraphs[server.Document.Paragraphs.Count - 1].Range.End.ToInt() - dp.ToInt());
|
||||
//collection.Add(new VorlageRO { RTFText = server.Document.GetRtfText(tmpRange2) });
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
return rtf;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -202,7 +202,7 @@ namespace BeWo.Service.Plugins
|
||||
//t = "2279593936"; // Diakonie Mülheim
|
||||
//t = "3623837005"; // Betreuwo Wesel
|
||||
//t = "8407321888"; // AWO Wesel
|
||||
t = "8454426692"; // Mit-Menschen Wuppertal
|
||||
//t = "8454426692"; // Mit-Menschen Wuppertal
|
||||
//t = "0629004412"; // BeWo-Colonia Basaran (Projekt
|
||||
//t = "7668701607"; // Wohnstätten Essen
|
||||
//t = "3833058951"; // Aids Hilfe Duisburg (Self)
|
||||
@@ -226,7 +226,7 @@ namespace BeWo.Service.Plugins
|
||||
//t = "7817461089"; // FAB e.V. (Familienarbeit und Beratung e.V.)
|
||||
//t = "5207911843"; // Pro Balance
|
||||
//t = "8619663355"; // HSH Cologne
|
||||
//t = "1652658918"; // LH Frankfurt Oder
|
||||
t = "1652658918"; // LH Frankfurt Oder
|
||||
//t = "7696927868"; // Kuhring Betreuung
|
||||
//t = "6251348980"; // BeWo Gün
|
||||
//t = "6782533512"; // LH Dorsten
|
||||
|
||||
@@ -403,7 +403,10 @@
|
||||
<Compile Include="Dienstplanung\DienstplanungsManager.cs" />
|
||||
<Compile Include="Dienstplanung\MitarbeiterstundenkontoBerechnung.cs" />
|
||||
<Compile Include="Dienstplanung\Mitarbeiterstundenkonto.cs" />
|
||||
<Compile Include="Dokumentverwaltung\EmployeePlaceholderManager.cs" />
|
||||
<Compile Include="Dokumentverwaltung\PlaceholderManager.cs" />
|
||||
<Compile Include="Dokumentverwaltung\DokumentManager.cs" />
|
||||
<Compile Include="Dokumentverwaltung\CustomerPlaceholderManager.cs" />
|
||||
<Compile Include="Import\AvisImport\AvisImportResult.cs" />
|
||||
<Compile Include="Import\AvisImport\LvrAviseImporter.cs" />
|
||||
<Compile Include="Import\AvisImport\AviseImporter.cs" />
|
||||
@@ -563,7 +566,7 @@
|
||||
<Compile Include="UnitOfWork\HibernateSessionContextInitializer.cs" />
|
||||
<Compile Include="Urlaubsplanung\UrlaubsplanungsManager.cs" />
|
||||
<Compile Include="ServiceUtils\History\HistoryCreator.cs" />
|
||||
<Compile Include="Vorlagen\VorlagenManager.cs" />
|
||||
<Compile Include="Dokumentverwaltung\VorlagenManager.cs" />
|
||||
<Compile Include="XAMLInformation\InfoViaXAMLManager.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1411,5 +1411,9 @@ namespace BeWo.Service.ServiceContracts
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
bool HasConfirmationReceiptSignatureByDateAndEmployeeAndCustomer(long customerOid, long employeeOid, DateTime start, DateTime end, long costBearer2SupportConceptOid, out List<ConfirmationReceiptSignatureDC> confirmationReceiptSignatures);
|
||||
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
String CreateRtfDocumentFromTemplate(long vorlageOid, TableID objectTid, List<long> objectOids);
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,6 @@ using BeWo.Service.Plugins;
|
||||
using BeWo.Service.SBD;
|
||||
using BeWo.Service.Security;
|
||||
using BeWo.Service.ServiceContracts;
|
||||
using BeWo.Service.Vorlagen;
|
||||
using BS.Shared;
|
||||
using BS.Shared.Core;
|
||||
using BS.Shared.DataContracts;
|
||||
@@ -7711,8 +7710,8 @@ namespace BeWo.Service.ServiceImplementations
|
||||
{
|
||||
try
|
||||
{
|
||||
var vm = PluginLoader.FindClass<VorlagenManager>();
|
||||
return vm.GetPlatzhalterForCustomer();
|
||||
var pm = PluginLoader.FindClass<CustomerPlaceholderManager>();
|
||||
return pm.GetPlatzhalter();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -7743,6 +7742,20 @@ namespace BeWo.Service.ServiceImplementations
|
||||
throw Utils.CreateBeWoFaultException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
public String CreateRtfDocumentFromTemplate(long vorlageOid, TableID objectTid, List<long> objectOids)
|
||||
{
|
||||
try
|
||||
{
|
||||
var vm = PluginLoader.FindClass<VorlagenManager>();
|
||||
return vm.CreateRtfDocumentFromTemplate(vorlageOid, objectTid, objectOids);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw Utils.CreateBeWoFaultException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public BeWoFolderDC GetFolderById(long oid)
|
||||
{
|
||||
try
|
||||
@@ -7837,7 +7850,8 @@ namespace BeWo.Service.ServiceImplementations
|
||||
try
|
||||
{
|
||||
var vm = PluginLoader.FindClass<VorlagenManager>();
|
||||
return vm.ReplacePlaceholdersInTemplate(template, objectOid, tableOid);
|
||||
//Methode wird nicht mehr benutzt
|
||||
return null; // vm.ReplacePlaceholdersInTemplate(template, objectOid.Value, (TableID)tableOid.Value);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
@@ -6,6 +6,7 @@ namespace BS.Shared.DataContracts
|
||||
[DataContract]
|
||||
public class CustomerVermittlungArbeitDC : BeWoDataContract
|
||||
{
|
||||
[DataMember] public string AktenzeichenGericht { get; set; }
|
||||
[DataMember] public string EigenesAktenzeichen { get; set; }
|
||||
[DataMember] public DateTime? Auftragseingang { get; set; }
|
||||
[DataMember] public ValueListEntryDC Auftragsherkunft { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user