Person -> Customer -> Organisation erweitert.

This commit is contained in:
Waldi
2016-12-08 14:17:41 +01:00
parent 026e16c063
commit b1fe39b26f
44 changed files with 672 additions and 81 deletions

View File

@@ -1233,6 +1233,10 @@ namespace BeWo.ServiceProxy
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/ICustomerService/GetChatMediaBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
byte[] GetChatMedia(long chatMediaMessageOid);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ICustomerService/GetOrganisationsForPerson", ReplyAction="http://tempuri.org/ICustomerService/GetOrganisationsForPersonResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/ICustomerService/GetOrganisationsForPersonBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
System.Collections.Generic.List<BS.Shared.DataContracts.Compact.CompactOrganisationDC> GetOrganisationsForPerson(long personoid);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ICustomerService/ArchiveCustomer", ReplyAction="http://tempuri.org/ICustomerService/ArchiveCustomerResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/ICustomerService/ArchiveCustomerBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
void ArchiveCustomer(long pOid, long pVersion);
@@ -1982,6 +1986,11 @@ namespace BeWo.ServiceProxy
return base.Channel.GetChatMedia(chatMediaMessageOid);
}
public System.Collections.Generic.List<BS.Shared.DataContracts.Compact.CompactOrganisationDC> GetOrganisationsForPerson(long personoid)
{
return base.Channel.GetOrganisationsForPerson(personoid);
}
public void ArchiveCustomer(long pOid, long pVersion)
{
base.Channel.ArchiveCustomer(pOid, pVersion);
@@ -4010,6 +4019,12 @@ namespace BeWo.ServiceProxy
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/DeactivateBargeldkasseBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
void DeactivateBargeldkasse(long pOid, long pVersion);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/CreateNewPerson2OrganisationRelation", ReplyAction="http://tempuri.org/IOperationsService/CreateNewPerson2OrganisationRelationRespons" +
"e")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/CreateNewPerson2OrganisationRelationBeWoFau" +
"ltFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
void CreateNewPerson2OrganisationRelation(long organi, BS.Shared.DataContracts.ValueListEntryDC value, long personOid, string mail, string fax, string tele, string notice);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/DeactivateInvoices", ReplyAction="http://tempuri.org/IOperationsService/DeactivateInvoicesResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/DeactivateInvoicesBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
void DeactivateInvoices(System.Collections.Generic.List<BS.Shared.DataContracts.InvoiceDC> invoices);
@@ -4681,6 +4696,11 @@ namespace BeWo.ServiceProxy
base.Channel.DeactivateBargeldkasse(pOid, pVersion);
}
public void CreateNewPerson2OrganisationRelation(long organi, BS.Shared.DataContracts.ValueListEntryDC value, long personOid, string mail, string fax, string tele, string notice)
{
base.Channel.CreateNewPerson2OrganisationRelation(organi, value, personOid, mail, fax, tele, notice);
}
public void DeactivateInvoices(System.Collections.Generic.List<BS.Shared.DataContracts.InvoiceDC> invoices)
{
base.Channel.DeactivateInvoices(invoices);

View File

@@ -248,6 +248,7 @@
</dxg:GridColumn.CellTemplate>
</dxg:GridColumn>
<dxg:GridColumn FieldName="PersonString" Header="Person" Width="150" AllowEditing="False" />
<dxg:GridColumn FieldName="Organisation" Header="Organisation" Width="150" AllowEditing="False" />
<dxg:GridColumn x:Name="gridcolumn_evironmentroleperson" FieldName="Role" Header="Rolle" Width="150" />
<dxg:GridColumn FieldName="AddressSummaryInfo" Header="Adresse" Width="150" />
<dxg:GridColumn FieldName="ContactSummaryInfo" Header="Kontaktdaten" Width="150" />
@@ -267,6 +268,7 @@
</dxg:GridColumn.CellTemplate>
</dxg:GridColumn>
<dxg:GridColumn FieldName="OrganisationString" Header="Organisation" Width="150" AllowEditing="False" />
<dxg:GridColumn FieldName="Person" Header="Ansprechpartner" Width="150" AllowEditing="False" />
<dxg:GridColumn x:Name="gridcolumn_evironmentroleorganisation" FieldName="Role" Header="Rolle" Width="150" />
<dxg:GridColumn FieldName="AddressSummaryInfo" Header="Adresse" Width="150" />
<dxg:GridColumn FieldName="ContactSummaryInfo" Header="Kontaktdaten" Width="150" />
@@ -1199,10 +1201,13 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Label Grid.Column="0" Grid.Row="0" Content="Person" />
<Label Grid.Column="0" Grid.Row="1" Content="Rolle" />
<Label Grid.Row="2" Grid.Column="0" Content="Notiz" />
<Label Grid.Row="0" Grid.Column="0" Content="Person" />
<Label Grid.Row="1" Grid.Column="0" Content="Organisation" />
<Label Grid.Row="2" Grid.Column="0" Content="Rolle" />
<Label Grid.Row="3" Grid.Column="0" Content="Notiz" />
<uc:PopUpEdit Cursor="Arrow" NewButtonVisibility="Visible"
PreviewMouseDoubleClick="Popupedit_environmentPersonSearch_OnPreviewMouseDoubleClick"
@@ -1211,18 +1216,37 @@
Grid.Row="0" DeleteButtonVisibility="Collapsed"
PopUpClick="popupedit_environmentPersonSearch_PopUpClick"
Text="{val:ValidationBinding Path=EnvironmentPersons.NewVM.PersonString, UpdateSourceTrigger=PropertyChanged}" />
<ComboBox Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="2" Margin="3" Height="23"
<!-- Neu -->
<uc:PopUpEdit NewButtonVisibility="Visible"
Cursor="Arrow"
NewClick="popupedit_environmentOrganisationSearch_NewClick"
IsReadOnly="True"
x:Name="popupedit_environmentPersonOrganisationSearch"
Grid.Column="1" Margin="3" Height="23" Grid.Row="1" Grid.ColumnSpan="2"
DeleteButtonVisibility="Collapsed"
PopUpClick="popupedit_environmentPersonOrganisationSearch_PopUpClick"
PreviewMouseDoubleClick="Popupedit_environmentOrganisationSearch_OnPreviewMouseDoubleClick"
Text="{val:ValidationBinding Path=EnvironmentPersons.NewVM.OrganisationString, UpdateSourceTrigger=PropertyChanged}" />
<!--popupedit_environmentOrganisationSearch danach suchen für organisationsbereich -->
<ComboBox Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="2" Margin="3" Height="23"
ItemsSource="{Binding Path=EnvironmentPersons.PossibleRoles}"
SelectedItem="{val:ValidationBinding Path=EnvironmentPersons.NewVM.Role}" />
<TextBox Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="2" Margin="3" Height="50" AcceptsReturn="True"
<TextBox Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="3" Margin="3" Height="50" AcceptsReturn="True"
VerticalScrollBarVisibility="Auto"
Text="{Binding Path=EnvironmentPersons.NewVM.Notice, UpdateSourceTrigger=PropertyChanged}" />
<Button Grid.Column="1" Grid.Row="3" x:Name="button_addEnvironmentPerson"
<Button Grid.Column="1" Grid.Row="4" x:Name="button_addEnvironmentPerson"
Click="button_addEnvironmentPerson_Click" Content="Hinzufügen" Height="25"
FontWeight="Normal" Margin="3" VerticalAlignment="Bottom" HorizontalAlignment="Right" />
<Button Grid.Row="3" Grid.Column="2" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Height="25"
<Button Grid.Row="4" Grid.Column="2" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Height="25"
Margin="3" Content="Abbrechen" x:Name="button_cancelAddEnvironmentPerson" Click="button_cancelAddEnvironmentPerson_Click" />
</Grid>
</GroupBox>
</Border>
@@ -1262,11 +1286,14 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Label Grid.Column="0" Grid.Row="0" Content="Organisation" />
<Label Grid.Column="0" Grid.Row="1" Content="Rolle" />
<Label Grid.Row="2" Grid.Column="0" Content="Notiz" />
<Label Grid.Row="3" Grid.Column="0" Content="Zusätzliche Info" />
<Label Grid.Row="0" Grid.Column="0" Content="Organisation" />
<Label Grid.Row="1" Grid.Column="0" Content="Ansprechpartner" />
<Label Grid.Row="2" Grid.Column="0" Content="Rolle" />
<Label Grid.Row="3" Grid.Column="0" Content="Notiz" />
<Label Grid.Row="4" Grid.Column="0" Content="Zusätzliche Info" />
<uc:PopUpEdit NewButtonVisibility="Visible"
Cursor="Arrow"
@@ -1280,26 +1307,38 @@
Text="{val:ValidationBinding Path=EnvironmentOrganisations.NewVM.OrganisationString, UpdateSourceTrigger=PropertyChanged}" />
<ComboBox Grid.Column="1" Margin="3" Height="23" Grid.Row="1" Grid.ColumnSpan="2"
<!--Neu -->
<uc:PopUpEdit Cursor="Arrow" NewButtonVisibility="Visible"
PreviewMouseDoubleClick="Popupedit_environmentPersonSearch_OnPreviewMouseDoubleClick"
NewClick="popupedit_environmentPersonSearch_NewClick" IsReadOnly="True"
x:Name="popupedit_environmentAnsprechpartnerSearch" Grid.Column="1" Grid.ColumnSpan="2" Margin="3" Height="23"
Grid.Row="1" DeleteButtonVisibility="Collapsed"
PopUpClick="popupedit_environmentansprechpartnersearchviewSearch_PopUpClick"
Text="{val:ValidationBinding Path=EnvironmentOrganisations.NewVM.PersonString, UpdateSourceTrigger=PropertyChanged}" />
<!--Neu -->
<ComboBox Grid.Column="1" Margin="3" Height="23" Grid.Row="2" Grid.ColumnSpan="2"
ItemsSource="{Binding Path=EnvironmentOrganisations.PossibleRoles}"
SelectedItem="{val:ValidationBinding Path=EnvironmentOrganisations.NewVM.Role}" />
<TextBox Grid.Column="1" Grid.Row="2" Margin="3" Height="50" AcceptsReturn="True" Grid.ColumnSpan="2"
<TextBox Grid.Column="1" Grid.Row="3" Margin="3" Height="50" AcceptsReturn="True" Grid.ColumnSpan="2"
VerticalScrollBarVisibility="Auto"
Text="{Binding Path=EnvironmentOrganisations.NewVM.Notice, UpdateSourceTrigger=PropertyChanged}" />
<TextBox Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="3" Margin="3" Height="50" AcceptsReturn="True"
<TextBox Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="4" Margin="3" Height="50" AcceptsReturn="True"
VerticalScrollBarVisibility="Auto"
Text="{Binding Path=EnvironmentOrganisations.NewVM.Info1, UpdateSourceTrigger=PropertyChanged}" />
<Button Grid.Column="1" Grid.Row="4" x:Name="button_addEnvironmentOrganisation"
<Button Grid.Column="1" Grid.Row="5" x:Name="button_addEnvironmentOrganisation"
Click="button_addEnvironmentOrganisation_Click" Content="Hinzufügen" Height="25"
FontWeight="Normal" Margin="3" VerticalAlignment="Bottom" HorizontalAlignment="Right" />
<Button Grid.Row="4" Grid.Column="2" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Height="25"
<Button Grid.Row="5" Grid.Column="2" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Height="25"
Margin="3" Content="Abbrechen" x:Name="button_cancelAddEnvironmentOrganisation" Click="button_cancelAddEnvironmentOrganisation_Click" />
</Grid>
</GroupBox>
</Border>
@@ -1804,6 +1843,15 @@
<Popup Name="PopupMerkzeichen" StaysOpen="False" Placement="MousePoint" Width="270" Height="240" >
<controls:MerkzeichenSelectionControl x:Name="MerkzeichenSelection" AusgewaehlteMerkzeichen="{Binding Path=PublicViewModel.MerkzeichenListe, RelativeSource={RelativeSource AncestorType={x:Type detail:CustomerView}}, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" />
</Popup>
<!-- Neu -->
<Popup Margin="10" x:Name="popup_ansprechpartner" StaysOpen="False" Placement="MousePoint" Width="370" Height="250"
Closed="popup_Closed" Opened="popup_Opened">
<localSearchView:PersonSearchView x:Name="ansprechpartnersearchview" />
</Popup>
<Popup Margin="10" x:Name="popup_personOrganisation" StaysOpen="False" Placement="MousePoint" Width="370" Height="250"
Closed="popup_Closed" Opened="popup_Opened">
<localSearchView:OrganisationSearchView x:Name="personOrganisationsearchview" />
</Popup>
<Border x:Name="popup_content" />
</Grid>
</localView:BeWoView>

View File

@@ -679,6 +679,7 @@ namespace BeWo.View.Detail
if (ValidationTrigger.Validate(groupbox_newEnvironmentOrganisation))
{
popup_newEnvironmentOrganisation.IsOpen = false;
ViewModel.EnvironmentOrganisations.AddNewVMToList();
}
}
@@ -790,6 +791,10 @@ namespace BeWo.View.Detail
popup_person.IsOpen = false;
personsearchview.ItemSelected -= personsearchview_EnvironmentPersonSelected;
ViewModel.EnvironmentPersons.NewVM.Person = e.Data;
var orgList = ServiceFacade.DoCustomerServiceSync(s => s.GetOrganisationsForPerson(e.Data.PersonOid));
personOrganisationsearchview.ObjectList = orgList;
popupedit_environmentPersonSearch.Focus();
}
@@ -801,6 +806,25 @@ namespace BeWo.View.Detail
popupedit_environmentOrganisationSearch.Focus();
}
//######################## Neu ####################################
private void ansprechpartnersearchview_EnvironmentPersonSelected(object sender, EventArgs<CompactPersonDC> e)
{
popup_ansprechpartner.IsOpen = false;
ansprechpartnersearchview.ItemSelected -= ansprechpartnersearchview_EnvironmentPersonSelected;
ViewModel.EnvironmentOrganisations.NewVM.Person = e.Data;
popupedit_environmentAnsprechpartnerSearch.Focus();
}
private void PersonOrganisationsearchview_EnvironmentPersonSelected(object sender, EventArgs<CompactOrganisationDC> e)
{
popup_personOrganisation.IsOpen = false;
personOrganisationsearchview.ItemSelected -= PersonOrganisationsearchview_EnvironmentPersonSelected;
ViewModel.EnvironmentPersons.NewVM.Organisation = e.Data;
popupedit_environmentPersonOrganisationSearch.Focus();
}
//###################################################################
private void popupedit_costBearer_PopUpClick(object sender, RoutedEventArgs e)
{
popup_costBearer.IsOpen = true;
@@ -838,6 +862,21 @@ namespace BeWo.View.Detail
popup_person.IsOpen = true;
}
// ##################### Neu ######################
private void popupedit_environmentPersonOrganisationSearch_PopUpClick(object sender, RoutedEventArgs e)
{
personOrganisationsearchview.ItemSelected += PersonOrganisationsearchview_EnvironmentPersonSelected;
popup_personOrganisation.IsOpen = true;
}
private void popupedit_environmentansprechpartnersearchviewSearch_PopUpClick(object sender, RoutedEventArgs e)
{
ansprechpartnersearchview.ItemSelected += ansprechpartnersearchview_EnvironmentPersonSelected;
popup_ansprechpartner.IsOpen = true;
}
//#################################################
private void popupedit_environmentOrganisationSearch_PopUpClick(object sender, RoutedEventArgs e)
{
organisationsearchview.ItemSelected += organisationsearchview_EnvironmentOrganisationSelected;

View File

@@ -4,6 +4,7 @@
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Border x:Name="borderTemp" Visibility="Collapsed"/>
</Grid>

View File

@@ -22,20 +22,26 @@ namespace BeWo.View.Detail
{
private ValueListView personView = null;
private ValueListView organisationView = null;
private ValueListView roleInOrganisation = null;
public EnvironmentRoleView(ValueListEntryListVM pViewModelPerson, ValueListEntryListVM pViewModelOrganisation)
public EnvironmentRoleView(ValueListEntryListVM pViewModelPerson, ValueListEntryListVM pViewModelOrganisation, ValueListEntryListVM pViewModelRoleInOrganisation)
{
this.InitializeComponent();
personView = new ValueListView(pViewModelPerson);
organisationView = new ValueListView(pViewModelOrganisation);
roleInOrganisation = new ValueListView(pViewModelRoleInOrganisation);
personView.SetValue(Grid.RowProperty, 0);
organisationView.SetValue(Grid.RowProperty, 1);
roleInOrganisation.SetValue(Grid.RowProperty, 2);
organisationView.Margin = new Thickness(0, 10, 0, 0);
roleInOrganisation.Margin = new Thickness(0, 10, 0, 0);
rootGrid.Children.Add(personView);
rootGrid.Children.Add(organisationView);
rootGrid.Children.Add(roleInOrganisation);
}
@@ -47,6 +53,9 @@ namespace BeWo.View.Detail
if (!dirty)
dirty = this.organisationView.IsDirty;
if (!dirty)
dirty = this.roleInOrganisation.IsDirty;
return dirty;
}
}
@@ -68,6 +77,9 @@ namespace BeWo.View.Detail
if (valid && this.organisationView.IsDirty)
this.organisationView.SaveData();
if (valid && roleInOrganisation.IsDirty)
this.roleInOrganisation.SaveData();
}
internal override DependencyObject ValidationOnSaveRootElement

View File

@@ -6,7 +6,9 @@
xmlns:uc="clr-namespace:BeWo.Controls;assembly=BeWo.Controls"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:shared="clr-namespace:BS.Shared;assembly=BS.Shared"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid" Height="Auto" Width="Auto"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:search="clr-namespace:BeWo.View.Search"
Height="Auto" Width="Auto"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Focusable="True">
<Grid x:Name="gridroot">
<Grid.Resources>
@@ -15,6 +17,9 @@
<dxg:GridColumn AllowEditing="False" FieldName="Person.LastName" Header="Nachname" Width="100" ReadOnly="True" />
<dxg:GridColumn AllowEditing="False" FieldName="Person.FirstName" Header="Vorname" Width="100" ReadOnly="True" />
<dxg:GridColumn AllowEditing="False" FieldName="Person.Function" Header="Funktion" Width="100" ReadOnly="True" />
<dxg:GridColumn AllowEditing="False" FieldName="RolleInOrganisation" Header="Rolle" Width="100" ReadOnly="True" />
<dxg:GridColumn AllowEditing="False" FieldName="Person.Communication1" Header="Telefon" Width="100" ReadOnly="True" />
<dxg:GridColumn AllowEditing="False" FieldName="Person.Communication3" Header="E-Mail" Width="100" ReadOnly="True">
<dxg:GridColumn.CellTemplate>
@@ -368,8 +373,75 @@
</ScrollViewer>
</TabItem>
<TabItem Header="Ansprechpartner" Selector.Selected="TabItemsPersons_Selected">
<GroupBox x:Name="GroupBoxPersonGrid" Header="Dieser Organisation zugeordnete Ansprechpartner" Grid.Row="2" Style="{StaticResource ObjectEditGroupBox}" Margin="0 20 0 0" MinHeight="120">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<GroupBox x:Name="groupbox_newOrganisationAnsprechpartner" Header="Neue Zuordnung hinzufügen" Style="{DynamicResource ObjectEditGroupBox}">
<Grid Margin="0,15,0,0" Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Label Grid.Column="0" Grid.Row="0">Person</Label>
<Label Grid.Column="0" Grid.Row="1">geschäftl. Mailadresse</Label>
<Label Grid.Column="0" Grid.Row="2">geschäftl. Telefonnummer</Label>
<Label Grid.Column="0" Grid.Row="3">geschäftl. Faxnummer</Label>
<Label Grid.Column="2" Grid.Row="0">Rolle in der Organisation</Label>
<Label Grid.Column="2" Grid.Row="1">Notiz</Label>
<uc:PopUpEdit Cursor="Arrow" NewButtonVisibility="Collapsed"
IsReadOnly="True"
x:Name="popupedit_environmentPersonSearch" Grid.Column="1" Margin="3" Height="23"
Grid.Row="0" DeleteButtonVisibility="Collapsed"
PopUpClick="popupedit_Person_PopUpClick"
Text="{val:ValidationBinding Path=EnvironmentPersons.NewVM.PersonString, UpdateSourceTrigger=PropertyChanged}" />
<TextBox Grid.Column="1" Grid.Row="1" Height="23" Margin="3" x:Name="textbox_mail" Text="" />
<TextBox Grid.Column="1" Grid.Row="3" Height="23" Margin="3" x:Name="textbox_fax" Text="" />
<TextBox Grid.Column="1" Grid.Row="2" Height="23" Margin="3" x:Name="textbox_phone" Text="" />
<TextBox Grid.Column="3" Grid.Row="1" VerticalScrollBarVisibility="Auto" AcceptsReturn="True" Grid.RowSpan="2" Margin="3" x:Name="textbox_notice" Text="" />
<!-- neu -->
<ComboBox Grid.Column="3" Grid.Row="0" Margin="3" Height="23" x:Name="Combobox_Rolle" ItemsSource="" />
<!--
PopUpClick="popupedit_Person_PopUpClick"
PreviewMouseDoubleClick="Popupedit_Person_OnPreviewMouseDoubleClick"
-->
<Button Height="25" Grid.ColumnSpan="4" Margin="3" Grid.Row="4" Name="button_addOrganisationRelation" Click="CreateNewAnsprechpartner_OnClick" HorizontalAlignment="Right" Content="Ansprechpartner Speichern" />
</Grid>
</GroupBox>
<GroupBox x:Name="GroupBoxPersonGrid" Header="Dieser Organisation zugeordnete Ansprechpartner" Grid.Row="1" Style="{StaticResource ObjectEditGroupBox}" Margin="0 20 0 0" MinHeight="120" />
</Grid>
</TabItem>
<TabItem Header="Finanzen" Name="tabitem_finance">
<GroupBox Grid.Column="0" Grid.Row="3" Header="Finanzen" Grid.ColumnSpan="2"
@@ -425,5 +497,9 @@
</Grid>
</GroupBox>
</uc:ShadowChrome>
<Popup Margin="10" x:Name="popup_person" StaysOpen="False" Placement="MousePoint" Width="370" Height="250" Closed="popup_Closed" Opened="popup_Opened">
<search:PersonSearchView SearchMode="All" x:Name="personsearchview" />
</Popup>
</Grid>
</localView:BeWoView>

View File

@@ -6,11 +6,13 @@ using System.Windows.Navigation;
using BeWo.Core;
using BeWo.Core.Service;
using BeWo.ServiceProxy;
using BeWo.Validation;
using BeWo.ViewModel;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
using BS.Shared.Extensions;
using DevExpress.Xpf.Grid;
@@ -37,6 +39,8 @@ namespace BeWo.View.Detail
comboBox_Function.ItemsSource = _ViewModel.Functions;
Combobox_Rolle.ItemsSource = _ViewModel.RoleInOrganisations;
if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.Organisation_AllowArchiving))
{
lblArchiviert.Visibility = Visibility.Hidden;
@@ -196,5 +200,45 @@ namespace BeWo.View.Detail
{
BeWoUtils.OpenMailClient(e.Uri.ToString());
}
private void CreateNewAnsprechpartner_OnClick(object sender, RoutedEventArgs e)
{
if (ValidationTrigger.Validate(groupbox_newOrganisationAnsprechpartner))
{
var mail = textbox_mail.Text;
var fax = textbox_fax.Text;
var phone = textbox_phone.Text;
var notice = textbox_notice.Text;
var ldc = ViewModel.CommitToDataContract();
if(pes.PersonOid != 0 )
ServiceFacade.DoOperationsServiceSync(s => s.CreateNewPerson2OrganisationRelation(ldc.OrganisationOid.Value, (ValueListEntryDC)Combobox_Rolle.SelectedItem,pes.PersonOid,mail,fax,phone.ToString(),notice.ToString()));
textbox_mail.Text = " ";
textbox_fax.Text = " ";
textbox_phone.Text = " ";
textbox_notice.Text = " ";
ReloadViewModel();
}
}
CompactPersonDC pes = new CompactPersonDC();
private void popupedit_Person_PopUpClick(object sender, RoutedEventArgs e)
{
personsearchview.ItemSelected += personsearchview_EnvironmentPersonSelected;
popup_person.IsOpen = true;
}
private void personsearchview_EnvironmentPersonSelected(object sender, EventArgs<CompactPersonDC> e)
{
popup_person.IsOpen = false;
personsearchview.ItemSelected -= personsearchview_EnvironmentPersonSelected;
pes = e.Data;
popupedit_environmentPersonSearch.Text = pes.FirstName +" "+ pes.LastName;
popupedit_environmentPersonSearch.Focus();
}
}
}

View File

@@ -20,6 +20,7 @@
</dxg:GridColumn.CellTemplate>
</dxg:GridColumn>
<dxg:GridColumn FieldName="OrganisationString" Header="Organisation" ReadOnly="True"/>
<dxg:GridColumn FieldName="RolleInOrganisation" Header="Rolle" ReadOnly="True"/>
<dxg:GridColumn FieldName="Mail" Header="geschäftl. Mail" />
<dxg:GridColumn FieldName="Phone" Header="geschäftl. Tel." />
<dxg:GridColumn FieldName="Fax" Header="geschäftl. Fax." />
@@ -228,6 +229,7 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Label Grid.Column="0" Grid.Row="0">Organisation</Label>
@@ -237,8 +239,9 @@
<Label Grid.Column="0" Grid.Row="2">
geschäftl. Telefonnummer
</Label>
<Label Grid.Column="2" Grid.Row="0">geschäftl. Faxnummer</Label>
<Label Grid.Column="0" Grid.Row="3">geschäftl. Faxnummer</Label>
<Label Grid.Column="2" Grid.Row="1">Notiz</Label>
<Label Grid.Column="2" Grid.Row="0">Rolle in der Organisation</Label>
<uc:PopUpEdit NewButtonVisibility="Visible"
NewClick="popupedit_organisation_NewClick"
@@ -249,12 +252,21 @@
Text="{val:ValidationBinding Path=OrganisationRelations.NewVM.OrganisationString, UpdateSourceTrigger=PropertyChanged}"
Cursor="Arrow"
PreviewMouseDoubleClick="Popupedit_organisation_OnPreviewMouseDoubleClick"/>
<TextBox Grid.Column="1" Grid.Row="1" Height="23" Margin="3" Name="textbox_mail" Text="{Binding Path=OrganisationRelations.NewVM.Mail, UpdateSourceTrigger=PropertyChanged}" />
<TextBox Grid.Column="3" Grid.Row="0" Height="23" Margin="3" Name="textbox_fax" Text="{Binding Path=OrganisationRelations.NewVM.Fax, UpdateSourceTrigger=PropertyChanged}" />
<TextBox Grid.Column="1" Grid.Row="3" Height="23" Margin="3" Name="textbox_fax" Text="{Binding Path=OrganisationRelations.NewVM.Fax, UpdateSourceTrigger=PropertyChanged}" />
<TextBox Grid.Column="1" Grid.Row="2" Height="23" Margin="3" Name="textbox_phone" Text="{Binding Path=OrganisationRelations.NewVM.Phone, UpdateSourceTrigger=PropertyChanged}" />
<TextBox Grid.Column="3" Grid.Row="1" VerticalScrollBarVisibility="Auto" AcceptsReturn="True" Grid.RowSpan="2" Margin="3" Name="textbox_notice" Text="{Binding Path=OrganisationRelations.NewVM.Notice, UpdateSourceTrigger=PropertyChanged}" />
<Button Height="25" Grid.ColumnSpan="4" Margin="3" Grid.Row="3" Name="button_addOrganisationRelation" Click="button_addOrganisationRelation_Click" HorizontalAlignment="Right">Zuordnung hinzufügen</Button>
<!-- neu -->
<ComboBox Grid.Column="3" Grid.Row="0" Margin="3" Height="23"
x:Name="ComboBox_RoleInOrganisation"
SelectedItem="{val:ValidationBinding Path=OrganisationRelations.NewVM.RolleInOrganisation}" />
<!-- alt -->
<Button Height="25" Grid.ColumnSpan="4" Margin="3" Grid.Row="4" Name="button_addOrganisationRelation" Click="button_addOrganisationRelation_Click" HorizontalAlignment="Right">Zuordnung hinzufügen</Button>
</Grid>
</GroupBox>

View File

@@ -38,6 +38,7 @@ namespace BeWo.View.Detail
comboBox_Title.ItemsSource = pPersonVM.Titles;
comboBox_Function.ItemsSource = pPersonVM.Functions;
ComboBox_RoleInOrganisation.ItemsSource = pPersonVM.RoleInOrganisations;
if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.Person_AllowArchiving))
{

View File

@@ -199,9 +199,11 @@ namespace BeWo.View.Master
//VMFactory.CreateValueListVMAsync(ValueListEntryType.EnvironmentPersonType, r => this.Dispatch(delegate { this.AddView(this.tabitem_environmentRoles, new ValueListView(r)); }));
VMFactory.CreateValueListVMAsync(ValueListEntryType.EnvironmentPersonType,
personList => VMFactory.CreateValueListVMAsync(ValueListEntryType.EnvironmentOrganisationType,
orgList =>
this.Dispatch(() => AddView(tabitem_environmentRoles, new EnvironmentRoleView(personList, orgList)))));
personList => VMFactory.CreateValueListVMAsync(ValueListEntryType.RoleInOrganisationType,
roleInOrgList => VMFactory.CreateValueListVMAsync(ValueListEntryType.EnvironmentOrganisationType,
orgList => this.Dispatch(() => AddView(tabitem_environmentRoles,
new EnvironmentRoleView(personList, orgList,roleInOrgList))))));
}
}
@@ -220,9 +222,10 @@ namespace BeWo.View.Master
//VMFactory.CreateValueListVMAsync(ValueListEntryType.FunctionType, r => this.Dispatch(() => AddView(tabitem_functions, new ValueListView(r))));
VMFactory.CreateValueListVMAsync(ValueListEntryType.FunctionType,
personList => VMFactory.CreateValueListVMAsync(ValueListEntryType.OrganisationFunctionType,
personList => VMFactory.CreateValueListVMAsync(ValueListEntryType.RoleInOrganisationType,
roleInOrgList => VMFactory.CreateValueListVMAsync(ValueListEntryType.OrganisationFunctionType,
orgList =>
this.Dispatch(() => AddView(tabitem_functions, new EnvironmentRoleView(personList, orgList)))));
this.Dispatch(() => AddView(tabitem_functions, new EnvironmentRoleView(personList, orgList,roleInOrgList))))));
}
}

View File

@@ -22,8 +22,12 @@ namespace BeWo.ViewModel
public static string PropertyName_Organisation = "Organisation";
public static string PropertyName_Person = "Person";
public static string PropertyName_OrganisationString = "OrganisationString";
public static string PropertyName_PersonString = "PersonString";
public static string PropertyName_Role = "Role";
public static string PropertyName_AddressSummaryInfo = "AddressSummaryInfo";
@@ -44,6 +48,8 @@ namespace BeWo.ViewModel
private CompactOrganisationDC _Organisation;
private CompactPersonDC _Person;
private ValueListEntryDC _Role;
public CustomerOrganisationRelationVM(CustomerOrganisationRelationDC pDC)
@@ -160,6 +166,22 @@ namespace BeWo.ViewModel
}
}
public CompactPersonDC Person
{
get { return this._Person; }
set
{
if (this.AreDifferent(this._Person, value))
{
this._Person = value;
this.StoreDirtyInformation(this.AreDifferent(DataContract.Person, value), PropertyName_Person);
this.FirePropertyChanged(PropertyName_Person);
this.FirePropertyChanged(PropertyName_PersonString);
}
}
}
[Validation(ValidationRule = ValidationRules.NotNullOrStringEmpty)]
public string OrganisationString
{
@@ -167,6 +189,13 @@ namespace BeWo.ViewModel
set { }
}
[Validation(ValidationRule = ValidationRules.NotNullOrStringEmpty)]
public string PersonString
{
get { return _Person.ToStringNullCheck(); } // Validation Workaround
set { }
}
[ValidationAttribute(ValidationRule = ValidationRules.NotNullOrStringEmpty)]
public ValueListEntryDC Role
{
@@ -248,6 +277,7 @@ namespace BeWo.ViewModel
this._Organisation = pDataContract.Organisation;
this._Role = pDataContract.RelationRole;
_Person = pDataContract.Person;
}
protected override CustomerOrganisationRelationDC MapToDataContract(CustomerOrganisationRelationDC pDataContract, bool doCommit)
@@ -261,6 +291,8 @@ namespace BeWo.ViewModel
pDataContract.Info4 = this._Info4;
pDataContract.Info5 = this._Info5;
pDataContract.Person = _Person;
return pDataContract;
}
}

View File

@@ -12,8 +12,12 @@ namespace BeWo.ViewModel
public static string PropertyName_Person = "Person";
public static string PropertyName_Organisation = "Organisation";
public static string PropertyName_PersonString = "PersonString";
public static string PropertyName_OrganisationString = "OrganisationString";
public static string PropertyName_AddressSummaryInfo = "AddressSummaryInfo";
public static string PropertyName_ContactSummaryInfo = "ContactSummaryInfo";
@@ -24,6 +28,8 @@ namespace BeWo.ViewModel
private CompactPersonDC _Person;
private CompactOrganisationDC _Organisation;
private ValueListEntryDC _Role;
public CustomerPersonRelationVM(CustomerPersonRelationDC pDC) : base(pDC, pDC.Customer2PersonOid == null) { }
@@ -61,6 +67,23 @@ namespace BeWo.ViewModel
}
}
public CompactOrganisationDC Organisation
{
get { return _Organisation; }
set
{
if (AreDifferent(_Organisation, value))
{
_Organisation = value;
StoreDirtyInformation(AreDifferent(DataContract.Organisation, value), PropertyName_Organisation);
FirePropertyChanged(PropertyName_Organisation);
FirePropertyChanged(PropertyName_OrganisationString);
}
}
}
[Validation(ValidationRule = ValidationRules.NotNullOrStringEmpty)]
public string PersonString
{
@@ -68,6 +91,13 @@ namespace BeWo.ViewModel
set { }
}
[Validation(ValidationRule = ValidationRules.NotNullOrStringEmpty)]
public string OrganisationString
{
get { return _Organisation.ToStringNullCheck(); } // Validation Workaround
set { }
}
public string AddressSummaryInfo
{
get
@@ -161,6 +191,7 @@ namespace BeWo.ViewModel
_Notice = pDataContract.Customer2PersonNotice;
_Person = pDataContract.Person;
_Role = pDataContract.RelationRole;
_Organisation = pDataContract.Organisation;
}
}
@@ -169,6 +200,7 @@ namespace BeWo.ViewModel
pDataContract.Customer2PersonNotice = _Notice;
pDataContract.Person = _Person;
pDataContract.RelationRole = _Role;
pDataContract.Organisation = _Organisation;
return pDataContract;
}

View File

@@ -19,12 +19,16 @@ namespace BeWo.ViewModel
public static string PropertyName_Notice = "Notice";
public static string PropertyName_RolleInOrganisation = "Rolle In Organisation";
private CompactOrganisationDC _Organisation;
private CompactPersonDC _Person;
private string _Notice;
private ValueListEntryDC _RolleInOrganisation;
public OrganisationPersonRelationVM(OrganisationPersonRelationDC pDC)
: base(pDC, pDC.Organisation2PersonOid == null)
{
@@ -94,6 +98,12 @@ namespace BeWo.ViewModel
}
}
public ValueListEntryDC RolleInOrganisation
{
get { return this._RolleInOrganisation; }
}
protected override void InitByDataContract(OrganisationPersonRelationDC pDataContract)
{
if(!IsNew)
@@ -101,6 +111,7 @@ namespace BeWo.ViewModel
_Person = pDataContract.Person;
_Organisation = pDataContract.Organisation;
_Notice = pDataContract.Notice;
_RolleInOrganisation = pDataContract.RolleInOrganisation;
}
}

View File

@@ -131,15 +131,19 @@ namespace BeWo.ViewModel
private ObservableSortCollection<ValueListEntryDC> _Functions;
private ObservableSortCollection<ValueListEntryDC> _RoleInOrganisations;
private ValueListEntryDC _Function;
public OrganisationVM(OrganisationDC pDataContract, List<ValueListEntryDC> pAllQualifications, List<ValueListEntryDC> pPossibleFunctions)
public OrganisationVM(OrganisationDC pDataContract, List<ValueListEntryDC> pAllQualifications, List<ValueListEntryDC> pPossibleFunctions, List<ValueListEntryDC> pPossibleRoleInOrganisations)
: base(pDataContract, pDataContract.OrganisationOid == null)
{
this._AllQualifications = pAllQualifications;
this._Functions = new ObservableSortCollection<ValueListEntryDC>(pPossibleFunctions, Comparer.ValueListEntryDCComparer);
_RoleInOrganisations = new ObservableSortCollection<ValueListEntryDC>(pPossibleRoleInOrganisations, Comparer.ValueListEntryDCComparer);
}
public string AccountNumber
@@ -623,6 +627,21 @@ namespace BeWo.ViewModel
}
}
public ObservableSortCollection<ValueListEntryDC> RoleInOrganisations
{
get
{
if (this._RoleInOrganisations == null)
{
this._RoleInOrganisations = new ObservableSortCollection<ValueListEntryDC>();
}
return this._RoleInOrganisations;
}
}
public ValueListEntryDC Function
{
get { return this._Function; }

View File

@@ -19,6 +19,8 @@ namespace BeWo.ViewModel
public static string PropertyName_Phone = "Phone";
public static string PropertyName_RolleInOrganisation = "Rolle In Organisation";
private string _Fax;
private string _Mail;
@@ -27,6 +29,8 @@ namespace BeWo.ViewModel
private CompactOrganisationDC _Organisation;
private ValueListEntryDC _RolleInOrganisation;
private string _Phone;
public PersonOrganisationRelationVM(Organisation2PersonDC pDataContract) : base(pDataContract, pDataContract.Organisation2PersonOid == null)
@@ -119,6 +123,21 @@ namespace BeWo.ViewModel
}
}
public ValueListEntryDC RolleInOrganisation
{
get { return this._RolleInOrganisation; }
set
{
if (this.AreDifferent(this._RolleInOrganisation, value))
{
this._RolleInOrganisation = value;
this.StoreDirtyInformation(this.AreDifferent(this.DataContract.RolleInOrganisation, value),PropertyName_RolleInOrganisation);
this.FirePropertyChanged(PropertyName_RolleInOrganisation);
}
}
}
protected override void InitByDataContract(Organisation2PersonDC pDataContract)
{
if (!this.IsNew)
@@ -128,7 +147,7 @@ namespace BeWo.ViewModel
this._Phone = pDataContract.Phone;
this._Mail = pDataContract.Mail;
this._Organisation = pDataContract.Organisation;
_RolleInOrganisation = pDataContract.RolleInOrganisation;
}
}
@@ -140,6 +159,8 @@ namespace BeWo.ViewModel
pDataContract.Mail = this._Mail;
pDataContract.Phone = this._Phone;
pDataContract.Organisation = this._Organisation;
pDataContract.RolleInOrganisation = _RolleInOrganisation;
return pDataContract;
}

View File

@@ -118,11 +118,16 @@ namespace BeWo.ViewModel
private VarFieldListVM _VarFields;
public PersonVM(PersonDC pDataContract, List<ValueListEntryDC> pPossibleTitles, List<ValueListEntryDC> pPossibleFunctions) : base(pDataContract, pDataContract.PersonOid == null)
private ObservableSortCollection<ValueListEntryDC> _RoleInOrganisations;
public PersonVM(PersonDC pDataContract, List<ValueListEntryDC> pPossibleTitles, List<ValueListEntryDC> pPossibleFunctions, List<ValueListEntryDC> pPossibleRoleInOrganisation)
: base(pDataContract, pDataContract.PersonOid == null)
{
this._Titles = new ObservableSortCollection<ValueListEntryDC>(pPossibleTitles, Comparer.ValueListEntryDCComparer);
this._Functions = new ObservableSortCollection<ValueListEntryDC>(pPossibleFunctions, Comparer.ValueListEntryDCComparer);
_RoleInOrganisations = new ObservableSortCollection<ValueListEntryDC>(pPossibleRoleInOrganisation, Comparer.ValueListEntryDCComparer);
}
public DateTime? DateOfBirth
@@ -539,6 +544,19 @@ namespace BeWo.ViewModel
}
}
public ObservableSortCollection<ValueListEntryDC> RoleInOrganisations
{
get
{
if (this._RoleInOrganisations == null)
{
this._RoleInOrganisations = new ObservableSortCollection<ValueListEntryDC>();
}
return this._RoleInOrganisations;
}
}
public string Town
{
get { return this._Town; }

View File

@@ -335,7 +335,9 @@ namespace BeWo.ViewModel
{
ServiceFacade.DoCustomerServiceAsync(
s => s.LoadOrganisation(pOid),
r1 => ServiceFacade.DoValueListServiceAsync(s1 => s1.GetAllValueListEntrysByType(ValueListEntryType.StaffQualificationsType),r2 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(ValueListEntryType.OrganisationFunctionType, r3 => pCallBack(new OrganisationVM(r1,r2,r3)))));
r1 => ServiceFacade.DoValueListServiceAsync(s1 => s1.GetAllValueListEntrysByType(ValueListEntryType.StaffQualificationsType),r2 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(ValueListEntryType.OrganisationFunctionType,
r4 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(ValueListEntryType.RoleInOrganisationType,
r3 => pCallBack(new OrganisationVM(r1,r2,r4,r3))))));
}
public static void CreateOrganisationVMAsync(Action<OrganisationVM> pCallBack)
@@ -347,11 +349,13 @@ namespace BeWo.ViewModel
s => s.GetVarFieldDefs(TableID.Organisation),
r2 =>Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
ValueListEntryType.OrganisationFunctionType,
r4 =>Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
ValueListEntryType.RoleInOrganisationType,
r3 => pCallBack(new OrganisationVM(
new OrganisationDC
{
VarFields = r2
}, r1,r3)))));
}, r1,r4,r3))))));
}
//public static void CreatePersonOrganisationRelationVMAsync(CompactOrganisationDC pOrganisation, Action<PersonOrganisationRelationVM> pCallBack)
@@ -375,6 +379,8 @@ namespace BeWo.ViewModel
s => s.GetVarFieldDefs(TableID.Person),
r2 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
ValueListEntryType.FunctionType,
r4 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
ValueListEntryType.RoleInOrganisationType,
r3 => pCallBack(
new PersonVM(
new PersonDC
@@ -382,7 +388,8 @@ namespace BeWo.ViewModel
VarFields = r2
},
r1,
r3)))));
r4,
r3))))));
}
public static void CreatePersonVMAsync(long pOid, Action<PersonVM> pCallBack)
@@ -391,7 +398,9 @@ namespace BeWo.ViewModel
s => s.LoadPerson(pOid),
cb =>
Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
ValueListEntryType.TitleType, r1 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(ValueListEntryType.FunctionType, r2 => pCallBack(new PersonVM(cb, r1, r2)))));
ValueListEntryType.TitleType,
r1 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(ValueListEntryType.FunctionType,
r3 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(ValueListEntryType.RoleInOrganisationType, r2 => pCallBack(new PersonVM(cb, r1, r3, r2))))));
}
public static void CreateResourceListVMAsync(Action<ResourceListVM> pCallBack)

View File

@@ -15,14 +15,14 @@
NHibernate.Driver.MySqlDataDriver
</property>
<property name="connection.connection_string">
Server=localhost;Password=root;User ID=root;Initial Catalog=bewodemo
</property>
<!--<property name="connection.connection_string">
Server=localhost;Password=root;User ID=root;Initial Catalog=1234567890
Server=localhost;Password=root;User ID=root;Initial Catalog=bewodemo
</property>-->
<property name="connection.connection_string">
Server=localhost;Password=root;User ID=root;Initial Catalog=1234567890
</property>
<property name="dialect">
NHibernate.Dialect.MySQLDialect
</property>

View File

@@ -1,8 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.40629.0
MinimumVisualStudioVersion = 10.0.40219.1
# Visual Studio 2012
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Client", "Client", "{E7543C39-A44C-40C9-82C9-E7FAA2D9A852}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Server", "Server", "{FEB0336B-F053-40B6-92DD-7DE56AB9408A}"
@@ -159,9 +157,9 @@ Global
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{3FEBB560-9275-413A-9767-BB68C44EEBC3} = {E7543C39-A44C-40C9-82C9-E7FAA2D9A852}
{D5E53B0F-BF5A-41E8-93E2-0F32845FC729} = {E7543C39-A44C-40C9-82C9-E7FAA2D9A852}
{094331C3-ECEE-4C89-BBFD-4C9DED89F0EF} = {FEB0336B-F053-40B6-92DD-7DE56AB9408A}
{B0D73E3D-4AE7-4024-93A6-DB1F46D7CCEE} = {FEB0336B-F053-40B6-92DD-7DE56AB9408A}
{D5E53B0F-BF5A-41E8-93E2-0F32845FC729} = {E7543C39-A44C-40C9-82C9-E7FAA2D9A852}
{40D8B312-EA64-49E3-A31A-5E57ED4D5654} = {FEB0336B-F053-40B6-92DD-7DE56AB9408A}
{E1154C7B-BB77-4155-9854-DAD8FC5A8BC3} = {FEB0336B-F053-40B6-92DD-7DE56AB9408A}
{284B02ED-114A-426C-9162-31BB6CF05589} = {FEB0336B-F053-40B6-92DD-7DE56AB9408A}
@@ -169,4 +167,7 @@ Global
{D3E18AE6-05A4-44B3-B0F6-6EF696DD306C} = {FEB0336B-F053-40B6-92DD-7DE56AB9408A}
{4E069DC0-8153-41E0-A89A-FC1916DF4A5F} = {FEB0336B-F053-40B6-92DD-7DE56AB9408A}
EndGlobalSection
GlobalSection(Performance) = preSolution
HasPerformanceSessions = true
EndGlobalSection
EndGlobal

View File

@@ -34,7 +34,7 @@
</root>
</log4net>
<appSettings>
<add key="MultitenancyPath" value="F:\Projects\BeWo\Host\Multitenancy\" />
<add key="MultitenancyPath" value="C:\Projekte\BeWo\Host\Multitenancy\" /> <!--F:\Projects\BeWo\Host\Multitenancy\ -->
<add key="BeWoPlanerAndroid.AndroidSoapService" value="http://localhost/AndroidSoapService.asmx" />
</appSettings>
<system.serviceModel>

View File

@@ -17,7 +17,7 @@ using NHibernate.SqlCommand;
using BS.Shared.Core;
using BS.Shared;
using BS.Shared.DataContracts.Compact;
using Login = BeWo.Data.Entities.Login;
namespace BeWo.Data.Access
@@ -1926,5 +1926,14 @@ namespace BeWo.Data.Access
return c.UniqueResult<NewestChatMessage>();
}
public IList<Organisation> GetAllOrganisation2PersonRelations(long personOid)
{
var c = CreateCriteriaIsActive<Person>()
.Add(Restrictions.Eq(BeWoEntityBase.PropertyName_Oid,personOid)).UniqueResult<Person>().Organisation2Persons.Select(s => s.Organisation).ToList();
return c;
}
}
}

View File

@@ -8,6 +8,8 @@ namespace BeWo.Data.Entities
{
public static string PropertyName_Organisation = "Organisation";
public static string PropertyName_Person = "Person";
public static string PropertyName_Type = "Type";
public static string PropertyName_Info1 = "Info1";
@@ -24,6 +26,8 @@ namespace BeWo.Data.Entities
private Organisation _Organisation;
private Person _Person;
private IList<ValueListEntry2Object> _ValueList;
private string _Info1;
@@ -137,6 +141,22 @@ namespace BeWo.Data.Entities
}
}
public virtual Person Person
{
get
{
return this._Person;
}
set
{
if (this.AreDifferent(this._Person, value))
{
this._Person = value;
}
}
}
public virtual IList<ValueListEntry2Object> ValueList
{
get

View File

@@ -8,12 +8,16 @@ namespace BeWo.Data.Entities
{
public static string PropertyName_Person = "Person";
public static string PropertyName_Organisation = "Organisation";
public static string PropertyName_Type = "Type";
public static string PropertyName_ValueList = "ValueList";
private Person _Person;
private Organisation _Organisation;
private IList<ValueListEntry2Object> _ValueList;
public Customer2Person()
@@ -37,6 +41,23 @@ namespace BeWo.Data.Entities
}
}
public virtual Organisation Organisation
{
get
{
return this._Organisation;
}
set
{
if (this.AreDifferent(this._Organisation, value))
{
this._Organisation = value;
}
}
}
public virtual IList<ValueListEntry2Object> ValueList
{
get

View File

@@ -1,6 +1,7 @@
using System.Collections.Generic;
using BS.Shared;
using BS.Shared.DataContracts;
namespace BeWo.Data.Entities
{
@@ -12,12 +13,16 @@ namespace BeWo.Data.Entities
public static string PropertyName_ValueList = "ValueList";
public static string PropertyName_RoleInOrganisation = "Rolle in der Organisation";
private IList<Contact> _Contacts;
private Organisation _Organisation;
private Person _Person;
private ValueListEntry _RolleInOrganisation;
public Organisation2Person()
{
this._Tid = TableID.Organisation2Person;
@@ -65,5 +70,18 @@ namespace BeWo.Data.Entities
this._Person = value;
}
}
public virtual ValueListEntry RolleInOrganisation
{
get{ return _RolleInOrganisation;}
set
{
if (this.AreDifferent(this._RolleInOrganisation, value))
{
_RolleInOrganisation = value;
}
}
}
}
}

View File

@@ -21,6 +21,8 @@
<many-to-one name="Organisation" column="OrganisationOid" class="BeWo.Data.Entities.Organisation,BeWo.Data" cascade="none" />
<many-to-one name="Person" column="PersonOid" class="BeWo.Data.Entities.Person,BeWo.Data" cascade="none" />
<bag name="ValueList" table="ValueListEntry2Object" generic="true" cascade="all-delete-orphan" where="ObjectTid = 69" batch-size="250">
<key column="ObjectOid" />
<one-to-many class="BeWo.Data.Entities.ValueListEntry2Object,BeWo.Data" />

View File

@@ -16,6 +16,8 @@
<many-to-one name="Person" column="PersonOid" class="BeWo.Data.Entities.Person,BeWo.Data" cascade="none" />
<many-to-one name="Organisation" column="OrganisationOid" class="BeWo.Data.Entities.Organisation,BeWo.Data" cascade="none" />
<bag name="ValueList" table="ValueListEntry2Object" generic="true" cascade="all-delete-orphan" where="ObjectTid = 10" batch-size="250">
<key column="ObjectOid" />
<one-to-many class="BeWo.Data.Entities.ValueListEntry2Object,BeWo.Data" />

View File

@@ -14,6 +14,8 @@
<property column="IsActive" type="BS.Shared.ActivationTypeId, BS.Shared" name="IsActive" />
<property column="SystemEntryID" type="BS.Shared.SystemEntryID, BS.Shared" name="SystemEntryID" />
<many-to-one column="RolleInOrganisationValueListOid" name="RolleInOrganisation" class="BeWo.Data.Entities.ValueListEntry,BeWo.Data" cascade="none" fetch="join" />
<many-to-one name="Organisation" column="OrganisationOid" class="BeWo.Data.Entities.Organisation,BeWo.Data" cascade="none" />
<many-to-one name="Person" column="PersonOid" class="BeWo.Data.Entities.Person, BeWo.Data" cascade="none" />
@@ -21,5 +23,6 @@
<key column="Organisation2PersonOid" />
<one-to-many class="BeWo.Data.Entities.Contact,BeWo.Data" />
</bag>
</class>
</hibernate-mapping>

View File

@@ -15,14 +15,14 @@
NHibernate.Driver.MySqlDataDriver
</property>
<property name="connection.connection_string">
Server=localhost;Password=root;User ID=root;Initial Catalog=bewodemo
</property>
<!-- <property name="connection.connection_string">
Server=localhost;Password=root;User ID=root;Initial Catalog=1234567890
Server=localhost;Password=root;User ID=root;Initial Catalog=bewodemo
</property>-->
<property name="connection.connection_string">
Server=localhost;Password=root;User ID=root;Initial Catalog=1234567890
</property>
<property name="dialect">
NHibernate.Dialect.MySQLDialect
</property>

View File

@@ -0,0 +1,8 @@
ALTER TABLE `1234567890`.`customer2person`
ADD COLUMN `OrganisationOid` BIGINT(19) NULL DEFAULT NULL COMMENT '' AFTER `SystemEntryID`;
ALTER TABLE `1234567890`.`customer2organisation`
ADD COLUMN `PersonOid` BIGINT(19) NULL DEFAULT NULL COMMENT '' AFTER `SystemEntryID`;

View File

@@ -0,0 +1,9 @@
ALTER TABLE `1234567890`.`organisation2person`
ADD COLUMN `RolleInOrganisation` BIGINT(19) NULL DEFAULT NULL COMMENT '' AFTER `SystemEntryID`;
ALTER TABLE `1234567890`.`organisation2person`
CHANGE COLUMN `RolleInOrganisation` `RolleInOrganisationValueListOid` BIGINT(19) NULL DEFAULT NULL COMMENT '' ;

View File

@@ -25,6 +25,10 @@ namespace BeWo.Service.DCEntityMapper
pDataContract.Customer2OrganisationVersion = pEntity.Version;
pDataContract.Organisation = MapperFactory.CompactOrganisationDC_Organisation.MapToNewDC(pEntity.Organisation);
if(pEntity.Person != null)
pDataContract.Person = MapperFactory.CompactPersonDC_Person.MapToNewDC(pEntity.Person);
if (pEntity.Organisation.Address != null)
{
pDataContract.Organisation.Street = pEntity.Organisation.Address.Street;
@@ -79,6 +83,12 @@ namespace BeWo.Service.DCEntityMapper
pEntity.Organisation = DAOFactory.GenericDAO.LoadByID<Organisation>(pDataContract.Organisation.OrganisationOid);
if (pDataContract.Person != null)
{
pEntity.Person = DAOFactory.GenericDAO.LoadByID<Person>(pDataContract.Person.PersonOid);
}
return pEntity;
}

View File

@@ -20,6 +20,9 @@ namespace BeWo.Service.DCEntityMapper
pDataContract.Customer2PersonVersion = pEntity.Version;
pDataContract.Person = MapperFactory.CompactPersonDC_Person.MapToNewDC(pEntity.Person);
if(pEntity.Organisation != null)
pDataContract.Organisation = MapperFactory.CompactOrganisationDC_Organisation.MapToNewDC(pEntity.Organisation);
if (pDataContract.Person != null && pEntity.Person.Contacts != null)
{
foreach (var contact in pEntity.Person.Contacts)
@@ -61,6 +64,11 @@ namespace BeWo.Service.DCEntityMapper
pEntity.Person = DAOFactory.GenericDAO.LoadByID<Person>(pDataContract.Person.PersonOid);
if (pDataContract.Organisation != null)
{
pEntity.Organisation = DAOFactory.GenericDAO.LoadByID<Organisation>(pDataContract.Organisation.OrganisationOid);
}
return pEntity;
}

View File

@@ -39,6 +39,12 @@ namespace BeWo.Service.DCEntityMapper
}
}
if (pEntity.RolleInOrganisation != null)
{
pDataContract.RolleInOrganisation =
MapperFactory.ValueListEntryDC_ValueListEntry.MapToNewDC(pEntity.RolleInOrganisation);
}
//pDataContract.ContactInformations = MapperFactory.ContactDC_Contact.MapToNewDCs(pEntity.Contacts);
return pDataContract;
@@ -48,6 +54,11 @@ namespace BeWo.Service.DCEntityMapper
{
pEntity.Notice = pDataContract.Notice;
if (pDataContract.RolleInOrganisation != null)
{
pEntity.RolleInOrganisation = DAOFactory.GenericDAO.LoadByID<ValueListEntry>(pDataContract.RolleInOrganisation.ValueListEntryOid.Value);
}
pEntity.Organisation = DAOFactory.GenericDAO.LoadByID<Organisation>(pDataContract.Organisation.OrganisationOid);
//MapperFactory.ContactDC_Contact.MergeWithEntitys(pDataContract.ContactInformations, pEntity.Contacts);

View File

@@ -21,6 +21,10 @@ namespace BeWo.Service.DCEntityMapper
personDc.PersonVersion = pEntity.Person.Version.Value;
personDc.PersonType = pEntity.Person.Type;
if (pEntity.RolleInOrganisation != null)
pDataContract.RolleInOrganisation = MapperFactory.ValueListEntryDC_ValueListEntry.MapToNewDC(pEntity.RolleInOrganisation);
if (pEntity.Person.Function != null)
{
personDc.Function = pEntity.Person.Function.Value;

View File

@@ -628,5 +628,9 @@ namespace BeWo.Service.ServiceContracts
[FaultContract(typeof(BeWoFault))]
[OperationContract]
Byte[] GetChatMedia(long chatMediaMessageOid);
[FaultContract(typeof (BeWoFault))]
[OperationContract]
List<CompactOrganisationDC> GetOrganisationsForPerson(long personoid);
}
}

View File

@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using System.ServiceModel;
using BeWo.Data.Entities;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
@@ -560,5 +560,10 @@ namespace BeWo.Service.ServiceContracts
[FaultContract(typeof(BeWoFault))]
[OperationContract]
void DeactivateBargeldkasse(long pOid, long pVersion);
[FaultContract(typeof (BeWoFault))]
[OperationContract]
void CreateNewPerson2OrganisationRelation(long organi, ValueListEntryDC value, long personOid, string mail, string fax, string tele, string notice);
}
}

View File

@@ -3409,6 +3409,17 @@ namespace BeWo.Service.ServiceImplementations
}
}
public List<CompactOrganisationDC> GetOrganisationsForPerson(long personoid)
{
var x = DAOFactory.SearchDAO.GetAllOrganisation2PersonRelations(personoid);
var items = MapperFactory.CompactOrganisationDC_Organisation.MapToNewDCs(x);
return items;
}
}
internal struct WohnheimbuchungsIntervallStruct

View File

@@ -7,7 +7,7 @@ using System.Net;
using System.ServiceModel;
using System.Text;
using System.Threading;
using System.Windows.Documents;
using BeWo.Data;
using BeWo.Data.Access;
using BeWo.Data.Entities;
@@ -3683,6 +3683,34 @@ namespace BeWo.Service.ServiceImplementations
return dc;
}
public void CreateNewPerson2OrganisationRelation(long organi, ValueListEntryDC value, long personOid, string mail, string fax, string tele, string notice)
{
try
{
List<Contact> continuiti = new List<Contact>();
continuiti.Add(new Contact() {Type = ContactType.business_Fax, Value = fax });
continuiti.Add(new Contact() { Type = ContactType.business_Mail, Value = mail });
continuiti.Add(new Contact() { Type = ContactType.business_Phone, Value = tele });
var x = new Organisation2Person()
{
Organisation = DAOFactory.GenericDAO.LoadByID<Organisation>(organi),
Notice = notice,
RolleInOrganisation = DAOFactory.GenericDAO.LoadByID<ValueListEntry>(value.ValueListEntryOid.Value),
Person = DAOFactory.GenericDAO.LoadByID<Person>(personOid),
Contacts = continuiti
};
DAOFactory.GenericDAO.Insert(x);
}
catch (Exception e)
{
throw Utils.CreateBeWoFaultException(e);
}
}
#endregion
}
}

View File

@@ -521,7 +521,8 @@ namespace BS.Shared
Auszahlungsart,
SupportConceptIndividualGoalCategoryType, // 20
DocumentType,
OrganisationFunctionType
OrganisationFunctionType,
RoleInOrganisationType
}
public enum ContactType

View File

@@ -719,6 +719,9 @@ namespace BS.Shared.Core
},
{
ValueListEntryType.OrganisationFunctionType,"Funktionen Organisation"
},
{
ValueListEntryType.RoleInOrganisationType,"Rolle in der Organisation"
}
};
#endregion
@@ -782,6 +785,9 @@ namespace BS.Shared.Core
},
{
ValueListEntryType.OrganisationFunctionType,"Funktionen Organisation"
},
{
ValueListEntryType.RoleInOrganisationType, "Rolle in der Organisation"
}
};
#endregion

View File

@@ -36,5 +36,8 @@ namespace BS.Shared.DataContracts
[DataMember]
public string Info5 { get; set; }
[DataMember]
public CompactPersonDC Person { get; set; }
}
}

View File

@@ -21,5 +21,8 @@ namespace BS.Shared.DataContracts
[DataMember]
public ValueListEntryDC RelationRole { get; set; }
[DataMember]
public CompactOrganisationDC Organisation { get; set; }
}
}

View File

@@ -38,5 +38,8 @@ namespace BS.Shared.DataContracts
//[DataMember]
//public long? OrganisationVersion { get; set; }
[DataMember]
public ValueListEntryDC RolleInOrganisation { get; set; }
}
}

View File

@@ -22,5 +22,8 @@ namespace BS.Shared.DataContracts
//###CBNEU_DC
[DataMember]
public string Notice { get; set; }
[DataMember]
public ValueListEntryDC RolleInOrganisation { get; set; }
}
}