Zwischenstand: Am Updater fehlen noch kleinere Features und im BeWoMain sind noch Bugs drinne.

Aber das meiste haben wir hinter uns :)
This commit is contained in:
rene
2021-09-30 15:31:13 +02:00
parent e26113d24b
commit fddb569212
55 changed files with 6507 additions and 35 deletions

3
.gitignore vendored
View File

@@ -480,3 +480,6 @@
/ReportImp/BeWoFlex/obj/Debug
/ValidationLibrary/obj/Debug/*.cache
*.cache
/SharedLauncher/bin
/SharedLauncher/obj
/DLLs

View File

@@ -1555,7 +1555,7 @@ namespace BeWo.Core
supConSelConSeletedItem.SupportConceptTreeNodeDC.SupportConcept.Customer = updatedCustomer;
}
var newList = control.SearchView.ObjectList;
List<CompactSupportConceptDC> newList = control.SearchView.ObjectList;
foreach (var concept in newList.Where(concept => concept.Customer.Equals(updatedCustomer)))
concept.Customer = updatedCustomer;
@@ -1576,7 +1576,7 @@ namespace BeWo.Core
if (MainSession.MainPage.HomeButtonPanel == null)
return;
//MainSession.MainPage.HomeView.txtHeader.Text = MainSession.LoggedOnUser.Employee.ToString();
MainSession.MainPage.HomeView.txtHeader.Text = MainSession.LoggedOnUser.Employee.ToString();
}
public static void WriteExcelFile(string content, string path)

573
BeWo/MainPage.xaml Normal file
View File

@@ -0,0 +1,573 @@
<UserControl x:Class="BeWo.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:localView="clr-namespace:BeWo.View"
xmlns:r="clr-namespace:BeWo.Security"
xmlns:BeWo="clr-namespace:BeWo"
xmlns:t="clr-namespace:BeWo.MultiLanguage.Markup"
Background="{DynamicResource ApplicationBackground}"
SnapsToDevicePixels="True"
RenderTransformOrigin="0.5,0.5"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<UserControl.Resources>
<ResourceDictionary>
<!--<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="MainDictionary.xaml"/>
</ResourceDictionary.MergedDictionaries>-->
<Storyboard x:Key="OnLoadedStoryboard" Completed="OnLoadedStoryboard_Completed">
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="toolbarRoot"
Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
<SplineDoubleKeyFrame KeyTime="00:00:00.5000000" Value="-5" KeySpline="0,1,1,1" />
<SplineDoubleKeyFrame KeyTime="00:00:01" Value="0" KeySpline="0.35,0.5,0.5,0.9" />
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="image"
Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
<SplineDoubleKeyFrame KeyTime="00:00:00.5000000" Value="0" KeySpline="0,1,1,1" />
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</ResourceDictionary>
</UserControl.Resources>
<UserControl.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1" />
<SkewTransform AngleX="0" AngleY="0" />
<RotateTransform Angle="0" />
<TranslateTransform X="0" Y="0" />
</TransformGroup>
</UserControl.RenderTransform>
<UserControl.Triggers>
<EventTrigger RoutedEvent="FrameworkElement.Loaded">
<BeginStoryboard Storyboard="{DynamicResource OnLoadedStoryboard}" x:Name="OnLoaded1_BeginStoryboard" />
</EventTrigger>
</UserControl.Triggers>
<Grid x:Name="grid_main" Width="Auto" Height="Auto" Margin="0,0,0,0" HorizontalAlignment="Stretch"
Grid.IsSharedSizeScope="True">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="150" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<!--<Frame x:Name="chatFrame" Grid.Column="2" Grid.Row="0" />-->
<TextBlock HorizontalAlignment="Center" Width="Auto" Margin="5,2,0,0">
<Hyperlink NavigateUri="http://www.bewoplaner.de" TargetName="newWindow" Foreground="Transparent" RequestNavigate="Hyperlink_OnRequestNavigate">
<InlineUIContainer>
<Image HorizontalAlignment="Left" Source="Ressources\Icons\bewoplaner_logo_small.png"
Style="{DynamicResource toolbarImageStyle}" RenderTransformOrigin="0.5,0.5" x:Name="image">
<Image.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1" />
<SkewTransform AngleX="0" AngleY="0" />
<RotateTransform Angle="0" />
<TranslateTransform X="-200" Y="0" />
</TransformGroup>
</Image.RenderTransform>
</Image>
</InlineUIContainer>
</Hyperlink>
</TextBlock>
<!--<TextBlock HorizontalAlignment="Right" Width="Auto" Margin="0,2,5,0" Grid.Column="2">
<Hyperlink NavigateUri="http://www.bewoplaner.de" TargetName="newWindow" Foreground="Transparent" RequestNavigate="Hyperlink_OnRequestNavigate">
<InlineUIContainer>
<Image HorizontalAlignment="Left" Source="Ressources\Icons\bewoplaner_logo_small.png"
Style="{DynamicResource toolbarImageStyle}" RenderTransformOrigin="0.5,0.5" x:Name="image2">
</Image>
</InlineUIContainer>
</Hyperlink>
</TextBlock>-->
<BeWo:BSLogoControl Grid.Column="0" Grid.ColumnSpan="3" Grid.Row="0" Grid.RowSpan="2" Width="1000" Height="1000"
VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="0,0,-300,-250" x:Name="bSLogoControl"
RenderTransformOrigin="0.5,0.5">
<BeWo:BSLogoControl.OpacityMask>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#29000000" Offset="0" />
<GradientStop Color="#29000000" Offset="1" />
</LinearGradientBrush>
</BeWo:BSLogoControl.OpacityMask>
</BeWo:BSLogoControl>
<Grid x:Name="DetailFrame" Grid.Column="0" Grid.ColumnSpan="3" Grid.Row="0" Grid.RowSpan="2"
RenderTransformOrigin="0.5,0.5" Margin="140,35,140,85">
<Grid.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1" />
<SkewTransform AngleX="0" AngleY="0" />
<RotateTransform Angle="0" />
<TranslateTransform X="0" Y="0" />
</TransformGroup>
</Grid.RenderTransform>
<Grid.OpacityMask>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FF000000" Offset="0" />
<GradientStop Color="#D8FFFFFF" Offset="1" />
</LinearGradientBrush>
</Grid.OpacityMask>
<!-- Border x:Name="detailPlaceHolder" Background="#FFB55252" CornerRadius="5,5,5,5"></Border-->
</Grid>
<Grid x:Name="toolbarRoot" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3" HorizontalAlignment="Stretch"
VerticalAlignment="Bottom" Width="Auto" RenderTransformOrigin="0.5,0.5" MouseEnter="toolbarRoot_MouseEnter"
MouseLeave="toolbarRoot_MouseLeave">
<Grid.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1" />
<SkewTransform AngleX="0" AngleY="0" />
<RotateTransform Angle="0" />
<TranslateTransform X="0" Y="100" />
</TransformGroup>
</Grid.RenderTransform>
<Border Name="toolbarBord" Height="80" RenderTransformOrigin="0.5,0.5">
<Border.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1" />
<SkewTransform AngleX="0" AngleY="0" />
<RotateTransform Angle="0" />
<TranslateTransform X="0" Y="20" />
</TransformGroup>
</Border.RenderTransform>
<Viewbox Stretch="Fill">
<Canvas Width="100" Height="100">
<Path Data="M0,100 L5,0 L95,0 L100,100 Z" StrokeThickness="1">
<Path.Fill>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#66000000" Offset="0" />
<GradientStop Color="#CC080808" Offset="1" />
</LinearGradientBrush>
</Path.Fill>
</Path>
<Rectangle Width="100" Height="132" Fill="#FF98C1FF" Canvas.Top="8">
<Rectangle.OpacityMask>
<RadialGradientBrush>
<GradientStop Color="#3FFFFFFF" Offset="0.29" />
<GradientStop Color="#00FFFFFF" Offset="0.875" />
</RadialGradientBrush>
</Rectangle.OpacityMask>
</Rectangle>
</Canvas>
</Viewbox>
</Border>
<Grid x:Name="toolbarContent" RenderTransformOrigin="0.5,0.5" MouseEnter="UIElement_OnMouseEnter" Loaded="ToolbarContent_OnLoaded">
<Grid.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1" />
<SkewTransform AngleX="0" AngleY="0" />
<RotateTransform Angle="0" />
<TranslateTransform X="0" Y="0" />
</TransformGroup>
</Grid.RenderTransform>
<StackPanel x:Name="HomeButtonPanel" Orientation="Vertical" Grid.Row="1" HorizontalAlignment="Left"
VerticalAlignment="Top" Margin="10,0,0,0">
<Button Margin="0,9,0,0" Name="btn_home" Click="btn_home_Click" Width="40" Height="40">
<Image Source="Ressources\Icons\Home.png" Stretch="Fill" StretchDirection="Both"></Image>
</Button>
<Label Content="{t:Translate Home}" FontSize="12" Foreground="#FFDBDBDB"></Label>
</StackPanel>
<!--<StackPanel x:Name="HomeButtonPanel" Orientation="Vertical" Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10,0,0,0" >
<Button Margin="0,10,0,0" Click="button_Home" Width="40" Height="40">
<Image Source="Ressources\Icons\HomeDisabled.png" Stretch="Fill" StretchDirection="Both"></Image>
</Button>
<Label Content="Startseite" FontSize="12" Foreground="#FFDBDBDB"></Label>
</StackPanel>
<StackPanel x:Name="LogoutButtonPanel" Orientation="Vertical" Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="90,0,0,0" >
<Button Margin="0,10,0,0" Click="button_Logout" Width="40" Height="40">
<Image Source="Ressources\Icons\LogoutDisabled.png" Stretch="Fill" StretchDirection="Both"></Image>
</Button>
<Label Content="Abmelden" FontSize="12" Foreground="#FFDBDBDB"></Label>
</StackPanel>-->
<ScrollViewer x:Name="toolbarScrollViewer" ScrollChanged="toolbarScrollViewer_ScrollChanged"
HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled"
HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="80,0,80,0" Height="80">
<ScrollViewer.Template>
<ControlTemplate TargetType="{x:Type ScrollViewer}">
<Grid Margin="3 0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="17" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="17" />
</Grid.ColumnDefinitions>
<Button Content="3" FontFamily="Webdings" Command="ScrollBar.PageLeftCommand"
Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" />
<ScrollContentPresenter VerticalAlignment="Bottom" Margin="20 0" Grid.Column="1"
Content="{TemplateBinding Content}" />
<Button Content="4" FontFamily="Webdings" Grid.Column="2"
Command="ScrollBar.PageRightCommand"
Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" />
</Grid>
</ControlTemplate>
</ScrollViewer.Template>
<Grid Margin="0,0,0,0" VerticalAlignment="Stretch" Height="80">
<StackPanel x:Name="toolbarMainButtonPanel" VerticalAlignment="Center" HorizontalAlignment="Center"
Width="Auto" Margin="0,0,0,0" Orientation="Horizontal">
<localView:ImageButton r:DemandUserRight.VisibleDemands="ViewAll, ServiceRecordView_View"
ImageSource="Ressources\Icons\HistoryDisabled.png" x:Name="button_serviceRecord"
Click="button_serviceRecord_Click" Style="{DynamicResource NavBarButton}"
Content="{t:Translate ZeiterfassungMenuItem}" Background="{DynamicResource ServiceRecordContentBrush}"
RenderTransformOrigin="0.5,0.5"
Tag="" Width="90" Height="Auto">
<Button.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1" />
<SkewTransform AngleX="0" AngleY="0" />
<RotateTransform Angle="0" />
<TranslateTransform X="0" Y="0" />
</TransformGroup>
</Button.RenderTransform>
</localView:ImageButton>
<localView:ImageButton r:DemandUserRight.VisibleDemands="AdditionalService_View"
ImageSource="Ressources\Icons\HistoryDisabled.png" x:Name="button_additionalService"
Click="button_additionalService_Click" Style="{DynamicResource NavBarButton}"
Content="{t:Translate Ergänzende DiensteMenuItem}" Background="{DynamicResource AdditionalServiceContentBrush}"
RenderTransformOrigin="0.5,0.5"
Tag="" Width="120" Height="Auto">
<Button.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1" />
<SkewTransform AngleX="0" AngleY="0" />
<RotateTransform Angle="0" />
<TranslateTransform X="0" Y="0" />
</TransformGroup>
</Button.RenderTransform>
</localView:ImageButton>
<localView:ImageButton r:DemandUserRight.VisibleDemands="VertretungenView_View"
ImageSource="Ressources\Icons\CalendarDisabled.png" x:Name="button_SchulbegleitenderDienst"
Click="Button_Vertretungen_OnClick" Style="{DynamicResource NavBarButton}"
Content="{t:Translate VertretungenMenuItem}" Background="{DynamicResource SchulbegleitenderDienstContentBrush}"
RenderTransformOrigin="0.5,0.5"
Width="90" >
<Button.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1" />
<SkewTransform AngleX="0" AngleY="0" />
<RotateTransform Angle="0" />
<TranslateTransform X="0" Y="0" />
</TransformGroup>
</Button.RenderTransform>
</localView:ImageButton>
<localView:ImageButton r:DemandUserRight.VisibleDemands="ViewAll, AccountingTransactionView_View"
ImageSource="Ressources\Icons\CoinsDisabled.png" x:Name="button_AccountingTransacation"
Click="button_AccountingTransacation_Click" Style="{DynamicResource NavBarButton}"
Content="{t:Translate FinanzenMenuItem}" Background="{DynamicResource AccountingContentBrush}"
RenderTransformOrigin="0.5,0.5"
Width="90">
<Button.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1" />
<SkewTransform AngleX="0" AngleY="0" />
<RotateTransform Angle="0" />
<TranslateTransform X="0" Y="0" />
</TransformGroup>
</Button.RenderTransform>
</localView:ImageButton>
<Grid>
<localView:ImageButton r:DemandUserRight.VisibleDemands="KalenderAnsehen"
ImageSource="Ressources\Icons\CalendarDisabled.png" x:Name="button_Scheduler"
Click="button_Scheduler_Click" Style="{DynamicResource NavBarButton}"
Content="{t:Translate KalenderMenuItem}" Background="{DynamicResource ResourceContentBrush}"
RenderTransformOrigin="0.5,0.5"
Width="90">
<Button.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1" />
<SkewTransform AngleX="0" AngleY="0" />
<RotateTransform Angle="0" />
<TranslateTransform X="0" Y="0" />
</TransformGroup>
</Button.RenderTransform>
</localView:ImageButton>
<BeWo:OutlinedTextBlock Visibility="Collapsed" x:Name="NewAppointmentsOutlinedTextBlock" Margin="25,0,0,0" FontFamily="Verdana" FontSize="25" FontWeight="ExtraBold" TextWrapping="Wrap" StrokeThickness="1" Stroke="White" Fill="OrangeRed" SnapsToDevicePixels="True" Text="!" HorizontalAlignment="Left" VerticalAlignment="Top">
<BeWo:OutlinedTextBlock.Triggers>
<EventTrigger RoutedEvent="BeWo:OutlinedTextBlock.Loaded">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="NewAppointmentsOutlinedTextBlock"
Storyboard.TargetProperty="(BeWo:OutlinedTextBlock.FontSize)"
To="30.0" Duration="0:0:0.3"
AutoReverse="True" RepeatBehavior="Forever" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</BeWo:OutlinedTextBlock.Triggers>
</BeWo:OutlinedTextBlock>
</Grid>
<localView:ImageButton r:DemandUserRight.VisibleDemands="ViewAll, ResourceBookingView_View"
ImageSource="Ressources\Icons\CalendarDisabled.png" x:Name="button_ResourceBooking"
Click="button_ResourceBooking_Click" Style="{DynamicResource NavBarButton}"
Content="{t:Translate RessourcenMenuItem}" Background="{DynamicResource ResourceContentBrush}"
RenderTransformOrigin="0.5,0.5"
Width="90">
<Button.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1" />
<SkewTransform AngleX="0" AngleY="0" />
<RotateTransform Angle="0" />
<TranslateTransform X="0" Y="0" />
</TransformGroup>
</Button.RenderTransform>
</localView:ImageButton>
<localView:ImageButton r:DemandUserRight.VisibleDemands="ViewAll, QueryView_View"
x:Name="button_Reports" Click="button_Reports_Click"
Style="{DynamicResource NavBarButton}"
Content="{t:Translate AuswertungenMenuItem}"
Background="{DynamicResource ReportContentBrush}" RenderTransformOrigin="0.5,0.5"
ImageSource="Ressources\Icons\ChartBarDisabled.png" Width="90">
<Button.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1" />
<SkewTransform AngleX="0" AngleY="0" />
<RotateTransform Angle="0" />
<TranslateTransform X="0" Y="0" />
</TransformGroup>
</Button.RenderTransform>
</localView:ImageButton>
<localView:ImageButton r:DemandUserRight.VisibleDemands="ViewAll, SupportConceptView_View, SupportConcept_ViewAllSupportConcepts, SupportConcept_ViewMyTeams"
x:Name="button_SupportConcept" Click="button_SupportConcept_Click"
Style="{DynamicResource NavBarButton}"
Content="{t:Translate HilfepläneMenuItem}"
Background="{DynamicResource SupportConceptContentBrush}" RenderTransformOrigin="0.5,0.5"
ImageSource="Ressources\Icons\IDBadgeDisabled.png" Width="90">
<Button.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1" />
<SkewTransform AngleX="0" AngleY="0" />
<RotateTransform Angle="0" />
<TranslateTransform X="0" Y="0" />
</TransformGroup>
</Button.RenderTransform>
</localView:ImageButton>
<localView:ImageButton r:DemandUserRight.VisibleDemands="ViewAll, CustomerView_View, Customer_ViewMyCustomers, Customer_ViewMyTeams"
x:Name="button_Customer" Click="button_Customer_Click"
Style="{DynamicResource NavBarButton}"
Content="{t:Translate KlientenMenuItem}"
Background="{DynamicResource CustomerContentBrush}" RenderTransformOrigin="0.5,0.5"
ImageSource="Ressources\Icons\UserHomeMaleDisabled.png" Width="90">
<Button.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1" />
<SkewTransform AngleX="0" AngleY="0" />
<RotateTransform Angle="0" />
<TranslateTransform X="0" Y="0" />
</TransformGroup>
</Button.RenderTransform>
</localView:ImageButton>
<!-- r:DemandUserRight.VisibleDemands="ViewAll, CustomerTeam_View" -->
<localView:ImageButton Visibility="Collapsed"
Click="button_CustomerTeam_Click"
x:Name="button_CustomerTeam"
Style="{DynamicResource NavBarButton}"
Content="{t:Translate KliententeamsMenuItem}"
Background="{DynamicResource CustomerTeamContentBrush}" RenderTransformOrigin="0.5, 0.5"
ImageSource="Ressources/Icons/UserGroupBusinessDisabled.png" Width="90">
<Button.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1" />
<SkewTransform AngleX="0" AngleY="0" />
<RotateTransform Angle="0" />
<TranslateTransform X="0" Y="0" />
</TransformGroup>
</Button.RenderTransform>
</localView:ImageButton>
<localView:ImageButton r:DemandUserRight.VisibleDemands="WohnheimView_View"
x:Name="button_Wohnheim" Click="button_Wohnheim_Click"
Style="{DynamicResource NavBarButton}"
Content="{t:Translate WohnheimeMenuItem}"
Background="{DynamicResource WohnheimContentBrush}" RenderTransformOrigin="0.5,0.5"
ImageSource="Ressources\Icons\OfficeBulidingBlackDisabled.png" Width="90">
<Button.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1" />
<SkewTransform AngleX="0" AngleY="0" />
<RotateTransform Angle="0" />
<TranslateTransform X="0" Y="0" />
</TransformGroup>
</Button.RenderTransform>
</localView:ImageButton>
<localView:ImageButton r:DemandUserRight.VisibleDemands="ViewAll, OrganisationView_View"
x:Name="button_Organisation" Click="button_Organisation_Click"
Style="{DynamicResource NavBarButton}"
Content="{t:Translate OrganisationenMenuItem}"
Background="{DynamicResource OrganisationContentBrush}" RenderTransformOrigin="0.5,0.5"
ImageSource="Ressources\Icons\OfficeBulidingBlackDisabled.png" Width="90">
<Button.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1" />
<SkewTransform AngleX="0" AngleY="0" />
<RotateTransform Angle="0" />
<TranslateTransform X="0" Y="0" />
</TransformGroup>
</Button.RenderTransform>
</localView:ImageButton>
<localView:ImageButton r:DemandUserRight.VisibleDemands="ViewAll, PersonView_View"
x:Name="button_Person" Click="button_Person_Click" Style="{DynamicResource NavBarButton}"
Content="{t:Translate PersonenMenuItem}" Background="{DynamicResource PersonContentBrush}"
RenderTransformOrigin="0.5,0.5"
ImageSource="Ressources\Icons\AnonymousUserDisabled.png"
Width="90">
<Button.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1" />
<SkewTransform AngleX="0" AngleY="0" />
<RotateTransform Angle="0" />
<TranslateTransform X="0" Y="0" />
</TransformGroup>
</Button.RenderTransform>
</localView:ImageButton>
<localView:ImageButton r:DemandUserRight.VisibleDemands="ViewAll, EmployeeView_View, Employee_AllowViewOwnEmployees, Employee_AllowViewOwnTeam"
x:Name="button_Employee" Click="button_Employee_Click"
Style="{DynamicResource NavBarButton}"
Content="{t:Translate MitarbeiterMenuItem}"
Background="{DynamicResource EmployeeContentBrush}" RenderTransformOrigin="0.5,0.5"
ImageSource="Ressources\Icons\UserBusinessMaleDisabled.png" Width="90">
<Button.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1" />
<SkewTransform AngleX="0" AngleY="0" />
<RotateTransform Angle="0" />
<TranslateTransform X="0" Y="0" />
</TransformGroup>
</Button.RenderTransform>
</localView:ImageButton>
<localView:ImageButton r:DemandUserRight.VisibleDemands="ViewAll, TeamView_ViewAll, TeamView_ViewMyTeams"
x:Name="button_Team" Click="button_Team_Click" Style="{DynamicResource NavBarButton}"
Content="{t:Translate TeamsMenuItem}" Background="{DynamicResource TeamContentBrush}"
RenderTransformOrigin="0.5,0.5"
ImageSource="Ressources\Icons\UserGroupBusinessDisabled.png" Width="90">
<Button.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1" />
<SkewTransform AngleX="0" AngleY="0" />
<RotateTransform Angle="0" />
<TranslateTransform X="0" Y="0" />
</TransformGroup>
</Button.RenderTransform>
</localView:ImageButton>
<localView:ImageButton r:DemandUserRight.VisibleDemands="ViewAll, UserView_View"
x:Name="button_User" Click="button_User_Click" Style="{DynamicResource NavBarButton}"
Content="{t:Translate BenutzerMenuItem}" Background="{DynamicResource UserContentBrush}"
RenderTransformOrigin="0.5,0.5"
ImageSource="Ressources\Icons\UserBusinessMaleDisabled.png" Width="90">
<Button.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1" />
<SkewTransform AngleX="0" AngleY="0" />
<RotateTransform Angle="0" />
<TranslateTransform X="0" Y="0" />
</TransformGroup>
</Button.RenderTransform>
</localView:ImageButton>
<localView:ImageButton r:DemandUserRight.VisibleDemands="ViewAll, UserGroupView_View"
x:Name="button_UserGroup" Click="button_UserGroup_Click"
Style="{DynamicResource NavBarButton}"
Content="{t:Translate BenutzergruppenMenuItem}"
Background="{DynamicResource UserGroupContentBrush}" RenderTransformOrigin="0.5,0.5"
ImageSource="Ressources\Icons\UserGroupBusinessDisabled.png" Width="Auto">
<Button.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1" />
<SkewTransform AngleX="0" AngleY="0" />
<RotateTransform Angle="0" />
<TranslateTransform X="0" Y="0" />
</TransformGroup>
</Button.RenderTransform>
</localView:ImageButton>
<!--<localView:ImageButton r:DemandUserRight.VisibleDemands="ViewAll, AdministrationView_View"
x:Name="button_Template" Click="button_Template_Click"
HorizontalAlignment="Stretch" Style="{DynamicResource NavBarButton}"
Content="{t:Translate Vorlagen}"
Background="#FF0045e0" RenderTransformOrigin="0.5,0.5"
ImageSource="Ressources\Icons\MenuDisabled.png" Width="90">
<Button.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1" />
<SkewTransform AngleX="0" AngleY="0" />
<RotateTransform Angle="0" />
<TranslateTransform X="0" Y="0" />
</TransformGroup>
</Button.RenderTransform>
</localView:ImageButton>-->
<localView:ImageButton r:DemandUserRight.VisibleDemands="ViewAll, AdministrationView_View"
x:Name="button_Administration" Click="button_Administration_Click"
HorizontalAlignment="Stretch" Style="{DynamicResource NavBarButton}"
Content="{t:Translate VerwaltungMenuItem}"
Background="{DynamicResource AdministrationContentBrush}" RenderTransformOrigin="0.5,0.5"
ImageSource="Ressources\Icons\ConfigurationDisabled.png" Width="90">
<Button.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1" />
<SkewTransform AngleX="0" AngleY="0" />
<RotateTransform Angle="0" />
<TranslateTransform X="0" Y="0" />
</TransformGroup>
</Button.RenderTransform>
</localView:ImageButton>
<localView:ImageButton r:DemandUserRight.VisibleDemands="Support_View"
x:Name="button_Support" Click="button_Support_Click"
HorizontalAlignment="Stretch" Style="{DynamicResource NavBarButton}"
Content="{t:Translate SupportMenuItem}"
Background="#FFD4FFCF" RenderTransformOrigin="0.5,0.5"
ImageSource="Ressources\Icons\TechSupportWhiteDisabled.png" Width="90">
<Button.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1" />
<SkewTransform AngleX="0" AngleY="0" />
<RotateTransform Angle="0" />
<TranslateTransform X="0" Y="0" />
</TransformGroup>
</Button.RenderTransform>
</localView:ImageButton>
</StackPanel>
</Grid>
</ScrollViewer>
<StackPanel x:Name="LogoutButtonPanel" Orientation="Vertical" Grid.Row="1" HorizontalAlignment="Right"
VerticalAlignment="Top" Margin="0,0,0,0">
<Button Margin="0,9,0,0" Click="button_Logout" Width="40" Height="40">
<Image Source="Ressources\Icons\LogoutDisabled.png" Stretch="Fill" StretchDirection="Both"></Image>
</Button>
<Label Content="Abmelden" FontSize="12" Foreground="#FFDBDBDB"></Label>
</StackPanel>
<!--<Rectangle Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="1" RenderTransformOrigin="0.5,0.5" Height="55" Width="1175" StrokeThickness="0" VerticalAlignment="Top">
<Rectangle.OpacityMask>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#0C000000" Offset="0"/>
<GradientStop Color="#4CFFFFFF" Offset="1"/>
</LinearGradientBrush>
</Rectangle.OpacityMask>
<Rectangle.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="-1"/>
<SkewTransform AngleX="0" AngleY="0"/>
<RotateTransform Angle="0"/>
<TranslateTransform X="-3" Y="49"/>
</TransformGroup>
</Rectangle.RenderTransform>
<Rectangle.Fill>
<VisualBrush Visual="{Binding ElementName=toolbar}"/>
</Rectangle.Fill>
</Rectangle>-->
</Grid>
</Grid>
<!--<GroupBox Visibility="Hidden" Header="Home" Grid.Column="1" Grid.Row="1" Grid.RowSpan="1" Margin="10,0,10,10" Style="{DynamicResource MainContentGroupBoxStyle}" >
<Border>
<Border.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFFFFFFF" Offset="0"/>
<GradientStop Color="#FFFFF2CF" Offset="1"/>
</LinearGradientBrush>
</Border.Background>
</Border>
</GroupBox>-->
</Grid>
</UserControl>

1707
BeWo/MainPage.xaml.cs Normal file

File diff suppressed because it is too large Load Diff

894
BeWo/MainSession.cs Normal file
View File

@@ -0,0 +1,894 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Threading;
using BeWo.Core;
using BeWo.Core.Config;
using BeWo.ServiceProxy;
using BeWo.View;
using BeWo.View.Navigation;
using BeWo.View.Navigation.Filter;
using BS.Shared;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
using BS.Shared.Extensions;
using BS.Shared.Core;
using ChatController.HauptKlassen;
using DevExpress.Xpf.Core;
using DevExpress.Xpf.Grid;
using BS.SharedLauncher;
using BS.SharedLauncher.Information;
namespace BeWo
{
public static class MainSession
{
public static string ShortVersion = "3";
public static string Version = "Version 3.0 TEST";
public static int RenderTier = 0;
private static AppSettings _AppSettings;
private static CompactEmployeeDC _CompactLoggedOnEmployee;
private static EmployeeDC _LoggedOnEmployee;
private static UserDC _LoggedOnUser;
private static MandatorDC _Mandator;
private static List<Window> _OpenDevExpressEditForms = new List<Window>();
private static DocumentWatcher _DocumentWatcher;
private static FrameworkElement _lockedContent;
private static int _LockUITime = 30;
static MainSession()
{
MainSessionSingleton.Instance.LoggedOnUsersRights = LoggedOnUsersRights;
}
public static Dictionary<string, string> ICD10Diagnosis { get; set; }
public static EmployeeDC LoggedOnEmployee
{
get { return _LoggedOnEmployee; }
set { _LoggedOnEmployee = value; }
}
public static long? LoggedOnEmployeeOid => _LoggedOnEmployee?.EmployeeOid;
public static CompactEmployeeDC CompactLoggedOnEmployee
{
get => _CompactLoggedOnEmployee;
set => _CompactLoggedOnEmployee = value;
}
public static ObservableCollection<UserRightType> LoggedOnUsersRights
{
get
{
if (LoggedOnUser != null)
return LoggedOnUser.GetGrantedRights().ToObservableCollection();
return null;
}
}
public static DocumentWatcher DocumentWatcher
{
get
{
if (_DocumentWatcher == null)
{
_DocumentWatcher = new DocumentWatcher();
}
return _DocumentWatcher;
}
}
public static AppSettings AppSettings
{
get
{
if (_AppSettings == null)
{
RestoreAppSettings();
}
return _AppSettings;
}
}
public static UserDC LoggedOnUser
{
get => _LoggedOnUser;
set
{
_LoggedOnUser = value;
if (_LoggedOnUser != null)
{
var settings = _LoggedOnUser.Settings;
//Session.BeginInvokeNormal(() =>
ServiceFacade.DoEmployeeServiceAsync(s => s.LoadEmployee(value.Employee.EmployeeOid),
r =>
{
_LoggedOnEmployee = r;
ServiceFacade.DoEmployeeServiceAsync(s => s.LoadCompactEmployee(value.Employee.EmployeeOid), r2 => { _CompactLoggedOnEmployee = r2; });
Session.BeginInvokeNormal(() => MainPage.InitOffeneTermine());
});
}
Session.FirePropertyChanged("LoggedOnUsersRights");
}
}
public static MandatorDC Mandator
{
get => _Mandator;
set
{
_Mandator = value;
bool showDatevFields = false;
bool isServiceRecordNoticeMandatory = true;
bool isPasswordSecurityActiv = false;
bool showServiceRecordsDistanceFields = false;
bool showHilfeplanBezeichnung = false;
bool showArbeitszeiten = false;
bool showCustomerDistanceFields = false;
bool showAdditionalService = false;
bool showRoundedDurationInEmployeeAnalysis = true;
bool showTeamNews = false;
bool showMarker = false;
bool showAnnualReport = false;
int maxDaysEditServiceRecordsAllowed = 0;
int hilfeplanAuslaufAuswahl = 3;
int anzTageZeiterfassErfolgt = 0;
int zeiterfassungsSchwellwert = 80;
bool printerSettingsUseLandscape = false;
bool printerSettingsUseMargins = false;
bool printerSettingsUsePaperKind = false;
var hideServiceRecordInsertedByAndInsertedOn = false;
bool isEndDateVisible = false;
bool isOnlyYearMonthVisible = false;
bool isZeiterfassDateNormal = true;
bool isZeiterfassungInStdMin = false;
int lastSelectedStundenkontoIntervall = 3;
bool showSignatures = false;
bool showRtfTextfield = false;
bool showPivotGrid = false;
bool showUrlaubsplanung = false;
bool dontShowSpitzabrechnung = false;
bool showDienstplanung = false;
AppSettings.ShowAdvisedAttendedFlag = false;
String timeRecordingMenuName = "";
if (_Mandator != null)
{
string val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, "ShowMedication");
AppSettings.IsMedicationAllowed = val != null && val.Equals("1");
val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, "ShowScheduler");
AppSettings.IsSchedulerAllowed = val != null && val.Equals("1");
val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, "ShowWohnheime");
AppSettings.IsWohnheimAllowed = val != null && val.Equals("1");
val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, "ShowChat");
AppSettings.IsChatAllowed = val != null && val.Equals("1");
val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, "IsServiceRecordNoticeMandatory");
if (val != null && val.Equals("0"))
{
isServiceRecordNoticeMandatory = false;
}
val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, "IsPasswordSecurityActiv");
if (val != null && val.Equals("1"))
{
isPasswordSecurityActiv = true;
}
val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, "IsEndDateVisible");
if (val != null && val.Equals("1"))
{
isEndDateVisible = true;
}
val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, "IsOnlyYearMonthVisible");
if (val != null && val.Equals("1"))
{
isOnlyYearMonthVisible = true;
}
val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, "IsZeiterfassungInStdMin");
if (val != null && val.Equals("1"))
{
isZeiterfassungInStdMin = true;
}
if (!isZeiterfassungInStdMin)
{
AppSettings.LetzteZeiterfassungsDauer = ZeiterfassungsDauer.Minuten;
}
val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, "IsZeiterfassDateNormal");
if (val != null && val.Equals("0"))
{
isZeiterfassDateNormal = false;
}
val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, "MaxDaysEditServiceRecordsAllowed");
int result;
if (Int32.TryParse(val, out result))
{
maxDaysEditServiceRecordsAllowed = result;
}
val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, "HilfeplanAuslaufAuswahl");
int resultplan;
if (Int32.TryParse(val, out resultplan))
{
hilfeplanAuslaufAuswahl = resultplan;
}
val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, "LastSelectedStundenkontoIntervall");
int resultinterval;
if (Int32.TryParse(val, out resultinterval))
{
lastSelectedStundenkontoIntervall = resultinterval;
}
val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, "AnzTageZeiterfassErfolgt");
int resultzeitplan;
if (Int32.TryParse(val, out resultzeitplan))
{
anzTageZeiterfassErfolgt = resultzeitplan;
}
val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, "ZeiterfassungsSchwellwert");
int resultschwell;
if (Int32.TryParse(val, out resultschwell))
{
zeiterfassungsSchwellwert = resultschwell;
}
val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, "ShowDistanceFields");
if (val != null && val.Equals("1"))
{
showServiceRecordsDistanceFields = true;
}
val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, "ShowHilfeplanBezeichnung");
if (val != null && val.Equals("1"))
{
showHilfeplanBezeichnung = true;
}
val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, "ShowArbeitszeiten");
if (val != null && val.Equals("1"))
{
showArbeitszeiten = true;
}
val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, "ShowRessources");
AppSettings.ShowRessources = val != null && val.Equals("1");
val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, "ShowTeamNews");
if (val != null && val.Equals("1"))
{
showTeamNews = true;
}
val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, "ShowPivotGrid");
if (val != null && val.Equals("1"))
{
showPivotGrid = true;
}
val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, "ShowUrlaubsplanung");
if (val != null && val.Equals("1"))
{
showUrlaubsplanung = true;
}
val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, "dontShowSpitzabrechnung");
if (val != null && val.Equals("1"))
{
dontShowSpitzabrechnung = true;
}
val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, "ShowDienstplanung");
if (val != null && val.Equals("1"))
{
showDienstplanung = true;
}
val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, "ShowMarker");
if (val != null && val.Equals("1"))
{
showMarker = true;
}
val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, "ShowAnnualReport");
if (val != null && val.Equals("1"))
{
showAnnualReport = true;
}
val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, "ShowCustomerDistanceFields");
if (val != null && val.Equals("1"))
{
showCustomerDistanceFields = true;
}
val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, "ShowAdditionalService");
if (val != null && val.Equals("1"))
{
showAdditionalService = true;
}
val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, "ShowRoundedDurationInEmployeeAnalysis");
if (val != null && val.Equals("0"))
{
showRoundedDurationInEmployeeAnalysis = false;
}
val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, "ShowDatevFields");
if (val != null && val.Equals("1"))
{
showDatevFields = true;
}
val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, "PrinterSettingsUseLandscape");
if (val != null && val.Equals("1"))
{
printerSettingsUseLandscape = true;
}
val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, "PrinterSettingsUseMargins");
if (val != null && val.Equals("1"))
{
printerSettingsUseMargins = true;
}
val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, "PrinterSettingsUsePaperKind");
if (val != null && val.Equals("1"))
{
printerSettingsUsePaperKind = true;
}
val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, "HideServiceRecordInsertedByAndInsertedOn");
if (val != null && val.Equals("1"))
{
hideServiceRecordInsertedByAndInsertedOn = true;
}
val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, "ShowSignature");
if (val != null && val.Equals("1"))
{
showSignatures = true;
}
val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, "ShowRtfTextfield");
if (val != null && val.Equals("1"))
{
showRtfTextfield = true;
}
switch (_Mandator.BeWoClientType)
{
case 1:
//Die Kette
showDatevFields = true;
AppSettings.ShowAdvisedAttendedFlag = true;
break;
case 2:
//Datev
showDatevFields = true;
break;
case 3:
////Köln Ring
showDatevFields = true;
timeRecordingMenuName = "Dokumentation";
break;
case 4:
//Betreuwo
break;
case 5:
//Kontakt und Krisenhilfe
AppSettings.ShowLargeCustomerNotice = true;
break;
case 6:
// Nur Jahresbericht
break;
case 7:
//IBP
showDatevFields = true;
break;
case 8:
//LH Würzburg
break;
case 9:
//Caritas Frankfurt+Aids Hilfe Gießen + Alle mit Korridor (Kostenträger Hessen)
break;
case 10:
//Integra
showDatevFields = true;
break;
case 11:
//Hannover
showDatevFields = true;
break;
}
}
AppSettings.ShowDatevFields = showDatevFields;
AppSettings.IsServiceRecordNoticeMandatory = isServiceRecordNoticeMandatory;
AppSettings.IsPasswordSecurityActiv = isPasswordSecurityActiv;
AppSettings.IsEndDateVisible = isEndDateVisible;
AppSettings.IsOnlyYearMonthVisible = isOnlyYearMonthVisible;
AppSettings.IsZeiterfassDateNormal = isZeiterfassDateNormal;
AppSettings.IsZeiterfassungInStdMin = isZeiterfassungInStdMin;
AppSettings.MaxDaysEditServiceRecordsAllowed = maxDaysEditServiceRecordsAllowed;
AppSettings.HilfeplanAuslaufAuswahl = hilfeplanAuslaufAuswahl;
AppSettings.LastSelectedStundenkontoIntervall = lastSelectedStundenkontoIntervall;
AppSettings.AnzTageZeiterfassErfolgt = anzTageZeiterfassErfolgt;
AppSettings.ZeiterfassungsSchwellwert = zeiterfassungsSchwellwert;
AppSettings.TimeRecordingMenuName = timeRecordingMenuName;
AppSettings.ShowDistanceFields = showServiceRecordsDistanceFields;
AppSettings.ShowHilfeplanBezeichnung = showHilfeplanBezeichnung;
AppSettings.ShowArbeitszeiten = showArbeitszeiten;
AppSettings.ShowSignatures = showSignatures;
AppSettings.ShowRtfTextfield = showRtfTextfield;
AppSettings.ShowCustomerDistanceFields = showCustomerDistanceFields;
AppSettings.ShowAdditionalService = showAdditionalService;
AppSettings.ShowRoundedDurationInEmployeeAnalysis = showRoundedDurationInEmployeeAnalysis;
AppSettings.HideServiceRecordInsertedByAndInsertedOn = hideServiceRecordInsertedByAndInsertedOn;
AppSettings.ShowTeamNews = showTeamNews;
AppSettings.ShowMarker = showMarker;
AppSettings.ShowAnnualReport = showAnnualReport;
AppSettings.PrinterSettingsUseLandscape = printerSettingsUseLandscape;
AppSettings.PrinterSettingsUseMargins = printerSettingsUseMargins;
AppSettings.PrinterSettingsUsePaperKind = printerSettingsUsePaperKind;
AppSettings.ShowPivotGrid = showPivotGrid;
AppSettings.ShowUrlaubsplanung = showUrlaubsplanung;
AppSettings.DontShowSpitzabrechnung = dontShowSpitzabrechnung;
AppSettings.ShowDienstplanung = showDienstplanung;
BS.Shared.Settings.ApplicationSettings.SupportConceptExpirationLimitInMonths = AppSettings.HilfeplanAuslaufAuswahl;
}
}
public static int LockUITime
{
get
{
var lockTime = _Mandator.Settings.SplitToKeyValuePairList(";", "=").FirstOrDefault(f => f.Key.Equals("TimeUntilUILock")).Value;
if (_LoggedOnUser != null && lockTime != null)
{
return Convert.ToInt32(lockTime);
}
return _LockUITime;
}
set
{
_LockUITime = value;
if (_LoggedOnUser == null)
{
return;
}
AutoLockUI.LockUITime = value;
AutoLockUI.StopTimer();
AutoLockUI.StartAutoLockUIOption();
}
}
public static MainPage MainPage { get; set; }
public static string GetAndCreateUserAppDataPath()
{
try
{
string localAppData = Environment.GetFolderPath(
Environment.SpecialFolder.LocalApplicationData);
string companyFilePath
= Path.Combine(localAppData, "beyondSoft");
if (!Directory.Exists(companyFilePath))
Directory.CreateDirectory(companyFilePath);
string bewoFilePath
= Path.Combine(companyFilePath, "BeWoPlaner");
if (!Directory.Exists(bewoFilePath))
Directory.CreateDirectory(bewoFilePath);
return bewoFilePath;
}
catch (Exception ex)
{
MessageBox.Show(
"Fehler beim Anlegen des Anwendungsordners. Sie besitzen nicht die erforderlichen Rechte, bitte wenden Sie sich an Ihren Systemadministrator.\n" +
ex.Message, "BeWoPlaner", MessageBoxButton.OK, MessageBoxImage.Exclamation);
}
return Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
}
internal static bool HasLoggedOnUserRight(UserRightType[] pRight)
{
if (LoggedOnUser != null)
{
return pRight == null || (pRight.Length == 1 && pRight[0] == UserRightType.None) || LoggedOnUser.GetGrantedRights().Exists(
right =>
{
var rightAsString = pRight.ToString();
var vals = rightAsString.Split(",");
foreach (var urt in pRight)
{
if (urt == right)
{
return true;
}
}
return false;
});
}
return false;
}
internal static void SaveAppSettings()
{
if (_AppSettings != null && _LoggedOnUser != null && _AppSettings.IsDirty)
{
_AppSettings.IsDirty = false;
UserSettingsUtils.SetSettingValue(SettingsType.ApplicationSettings, "WindowStateType", ((int)_AppSettings.WindowState).ToString(), _LoggedOnUser.Settings);
UserSettingsUtils.SetSettingValue(SettingsType.ApplicationSettings, "LastSelectedServiceRecordTimeInterval", ((int)_AppSettings.LastSelectedServiceRecordTimeInterval).ToString(), _LoggedOnUser.Settings);
UserSettingsUtils.SetSettingValue(SettingsType.ApplicationSettings, "CustomerFilterInZeiterfassung", ((int)_AppSettings.CustomerFilterInZeiterfassung).ToString(), _LoggedOnUser.Settings);
UserSettingsUtils.SetSettingValue(SettingsType.ApplicationSettings, "CustomerFilterSupportConcepts", ((int)_AppSettings.CustomerFilterSupportConcepts).ToString(), _LoggedOnUser.Settings);
UserSettingsUtils.SetSettingValue(SettingsType.ApplicationSettings, "CustomerFilterCustomers", ((int)_AppSettings.CustomerFilterCustomers).ToString(), _LoggedOnUser.Settings);
UserSettingsUtils.SetSettingValue(SettingsType.ApplicationSettings, "ShowExpiredSupportConcepts", _AppSettings.ShowExpiredSupportConcepts ? "1" : "0", _LoggedOnUser.Settings);
UserSettingsUtils.SetSettingValue(SettingsType.ApplicationSettings, "ShowServiceRecordGridControl", _AppSettings.ShowServiceRecordGridControl ? "1" : "0", _LoggedOnUser.Settings);
UserSettingsUtils.SetSettingValue(SettingsType.ApplicationSettings, "StartupPanelMaximized", _AppSettings.StartupPanelMaximized, _LoggedOnUser.Settings);
UserSettingsUtils.SetSettingValue(SettingsType.ApplicationSettings, "HideServiceRecordInsertedByAndInsertedOn", _AppSettings.HideServiceRecordInsertedByAndInsertedOn ? "1" : "0", _LoggedOnUser.Settings);
UserSettingsUtils.SetSettingValue(SettingsType.ApplicationSettings, "DocumentationFontSize", _AppSettings.DocumentationFontSize.ToString(), _LoggedOnUser.Settings);
UserSettingsUtils.SetSettingValue(SettingsType.ApplicationSettings, "ZeigeNurMeineTermine", _AppSettings.ZeigeNurMeineTermine ? "1" : "0", _LoggedOnUser.Settings);
UserSettingsUtils.SetSettingValue(SettingsType.ApplicationSettings, "LastSelectedServiceRecordTimeIntervalDays", _AppSettings.LastSelectedServiceRecordTimeIntervalDays.ToString(), _LoggedOnUser.Settings);
UserSettingsUtils.SetSettingValue(SettingsType.ApplicationSettings, "LetzteZeiterfassungsDauer", ((int)_AppSettings.LetzteZeiterfassungsDauer).ToString(), _LoggedOnUser.Settings);
string val = string.Empty;
if (_AppSettings.StartupPanelOrder != null)
{
foreach (string item in _AppSettings.StartupPanelOrder)
{
if (val.Length > 0)
{
val += "|";
}
val += item;
}
}
UserSettingsUtils.SetSettingValue(SettingsType.ApplicationSettings, "StartupPanelOrder", val, _LoggedOnUser.Settings);
ServiceFacade.DoUserServiceAsync(s => s.UpdateUserSettings(_LoggedOnUser.UserOid.Value, _LoggedOnUser.Settings), ReloadSettings, false);
}
}
public static void FirePropertyChanged(string pPropertyName)
{
Session.FirePropertyChanged(pPropertyName);
}
public static void InitAutoUILocking()
{
EventManager.RegisterClassHandler(typeof(Window), UIElement.PreviewMouseDownEvent, new MouseButtonEventHandler(OnPreviewMouseDown));
EventManager.RegisterClassHandler(typeof(Window), UIElement.PreviewKeyDownEvent, new KeyEventHandler(OnPreviewKeyDown));
var settingsKeyValuePairList = _Mandator.Settings.SplitToKeyValuePairList(";", "=").ToList();
var x = settingsKeyValuePairList.FirstOrDefault(f => f.Key.Equals("TimeUntilUILock")).Value ?? "NULL";
var y = _LockUITime;
AutoLockUI.LockUITime = Convert.ToInt32(settingsKeyValuePairList.FirstOrDefault(f => f.Key.Equals("TimeUntilUILock")).Value ?? LockUITime.ToString());
AutoLockUI.DoAutoLockUIEvent += AutoLockUIDoAutoLockUIEvent;
AutoLockUI.StartAutoLockUIOption();
}
private static void ReloadSettings(List<SettingsDC> settings)
{
if (_LoggedOnUser != null)
_LoggedOnUser.Settings = settings;
}
private static void RestoreAppSettings()
{
if (_LoggedOnUser != null)
{
_AppSettings = new AppSettings();
var settings = _LoggedOnUser.Settings;
var val = UserSettingsUtils.GetSettingValue(SettingsType.ApplicationSettings, "WindowStateType", settings);
if (int.TryParse(val, out var result))
{
_AppSettings.WindowState = (AppSettings.WindowStateType)result;
}
val = UserSettingsUtils.GetSettingValue(SettingsType.ApplicationSettings, "LastSelectedServiceRecordTimeInterval", settings);
if (int.TryParse(val, out result))
{
_AppSettings.LastSelectedServiceRecordTimeInterval = (ServiceRecordTimeInterval)result;
}
val = UserSettingsUtils.GetSettingValue(SettingsType.ApplicationSettings, "CustomerFilterInZeiterfassung", settings);
if (int.TryParse(val, out result))
{
_AppSettings.CustomerFilterInZeiterfassung = (CustomerFilterEnum)result;
}
val = UserSettingsUtils.GetSettingValue(SettingsType.ApplicationSettings, "CustomerFilterSupportConcepts", settings);
if (int.TryParse(val, out result))
{
_AppSettings.CustomerFilterSupportConcepts = (CustomerFilterEnum)result;
}
val = UserSettingsUtils.GetSettingValue(SettingsType.ApplicationSettings, "CustomerFilterCustomers", settings);
if (int.TryParse(val, out result))
{
_AppSettings.CustomerFilterCustomers = (CustomerFilterEnum)result;
}
val = UserSettingsUtils.GetSettingValue(SettingsType.ApplicationSettings, "ShowServiceRecordGridControl", settings);
_AppSettings.ShowServiceRecordGridControl = val == "1";
val = UserSettingsUtils.GetSettingValue(SettingsType.ApplicationSettings, "ShowExpiredSupportConcepts", settings);
_AppSettings.ShowExpiredSupportConcepts = val != "0";
_AppSettings.StartupPanelMaximized = UserSettingsUtils.GetSettingValue(SettingsType.ApplicationSettings, "StartupPanelMaximized", settings);
_AppSettings.DocumentationFontSize = Convert.ToDouble(UserSettingsUtils.GetSettingValue(SettingsType.ApplicationSettings, "DocumentationFontSize", settings));
//val = GetSettingValue(SettingsType.ApplicationSettings, "ZeigeNurMeineTermine");
//_AppSettings.ZeigeNurMeineTermine = val != "0";
_AppSettings.ZeigeNurMeineTermine = UserSettingsUtils.GetSettingValue(SettingsType.ApplicationSettings, "ZeigeNurMeineTermine", settings) == "1";
val = UserSettingsUtils.GetSettingValue(SettingsType.ApplicationSettings, "LastSelectedServiceRecordTimeIntervalDays", settings);
if (val != null)
{
_AppSettings.LastSelectedServiceRecordTimeIntervalDays = Convert.ToInt32(UserSettingsUtils.GetSettingValue(SettingsType.ApplicationSettings, "LastSelectedServiceRecordTimeIntervalDays", settings));
}
val = UserSettingsUtils.GetSettingValue(SettingsType.ApplicationSettings, "LetzteZeiterfassungsDauer", settings);
if (val != null)
{
var x = Convert.ToInt32(UserSettingsUtils.GetSettingValue(SettingsType.ApplicationSettings, "LetzteZeiterfassungsDauer", settings));
_AppSettings.LetzteZeiterfassungsDauer = x == 0 ? ZeiterfassungsDauer.Minuten : ZeiterfassungsDauer.Stunden;
}
val = UserSettingsUtils.GetSettingValue(SettingsType.ApplicationSettings, "StartupPanelOrder", settings);
if (val != null)
{
_AppSettings.StartupPanelOrder = new List<string>();
var panels = val.Split('|');
foreach (var item in panels)
{
_AppSettings.StartupPanelOrder.Add(item);
}
}
_AppSettings.IsDirty = false;
}
}
private static void BtnOpenServiceRecordView_Click(object sender, RoutedEventArgs e)
{
var btn = sender as Button;
if (btn == null) return;
var dc = btn.Tag as CompactSupportConceptDC;
if (dc == null) return;
if (MainPage != null)
MainPage.NavigateToServiceRecordView(dc.SupportConceptOid);
}
private static void Togglebutton_maximise_Checked(object sender, RoutedEventArgs e)
{
if (MainPage != null)
MainPage.Maximize();
}
private static void Togglebutton_maximise_Unchecked(object sender, RoutedEventArgs e)
{
if (MainPage != null)
MainPage.Minimize();
}
private static void TogglebuttonChat_maximise_Unchecked(object sender, RoutedEventArgs e)
{
if (MainPage.HomeView.ServiceChatView != null)
MainPage.HomeView.ServiceChatView.Normal();
}
private static void TogglebuttonChat_maximise_Checked(object sender, RoutedEventArgs e)
{
if (MainPage.HomeView.ServiceChatView != null)
MainPage.HomeView.ServiceChatView.Maximize();
}
private static void TogglebuttonChat_Minimize_Checked(object sender, RoutedEventArgs e)
{
if (MainPage.HomeView.ServiceChatView != null)
MainPage.HomeView.ServiceChatView.Minimize();
}
private static void FrameLeftMouseDown(object sender, MouseButtonEventArgs e)
{
var border = (Border)sender;
var borderParent = (Grid)border.Parent;
DependencyObject template = borderParent.TemplatedParent;
var parent = new Window();
var x = (FrameworkElement)template;
if (x != null)
{
var y = new FrameworkElement();
while (y != null)
{
y = (FrameworkElement)x.Parent;
if (y != null)
x = y;
}
if (x is Window)
{
parent = (Window)x;
parent.DragMove();
}
}
}
private static void AutoLockUIDoAutoLockUIEvent()
{
if (ConnectionInformation.Username.Equals("BSAdmin"))
{
AutoLockUI.StartAutoLockUIOption();
return;
}
if (MainPage.Content is LockedPage)
{
AutoLockUI.StartAutoLockUIOption();
return;
}
_lockedContent = MainPage.Content as FrameworkElement;
var openWindowCollection = Application.Current.Windows;
foreach (var blubb in openWindowCollection)
{
var abc = (Window)blubb;
if (!abc.Title.Equals("BeWoPlaner") && blubb.GetType() == typeof(WindowContentHolder))
{
abc.Close();
}
}
MainPage.HideCurrentModalViewWindows();
var lockedPage = new LockedPage();
lockedPage.ButtonLogin.Click += UnlockBeWoPlaner;
Application.Current.MainWindow.Content = lockedPage;
Application.Current.Dispatcher.Invoke(new Action(() => Application.Current.MainWindow?.Activate()));
AutoLockUI.StartAutoLockUIOption();
}
private static void UnlockBeWoPlaner(object sender, RoutedEventArgs e)
{
var lbtn = (Button)sender;
var lbtnParent = (Grid)lbtn.Parent;
var mainWindowUIElements = new UIElement[lbtnParent.Children.Count];
lbtnParent.Children.CopyTo(mainWindowUIElements, 0);
var elementList = mainWindowUIElements.ToList();
var username = ((TextBox)elementList.Where(el => el is TextBox && ((TextBox)el).Name.Equals("TextBoxUsername")).ToList()[0]).Text;
var password = ((PasswordBox)elementList.Where(el => el is PasswordBox && ((PasswordBox)el).Name.Equals("PasswordBoxPassword")).ToList()[0]).Password;
if (string.IsNullOrEmpty(username) || !username.Equals(_LoggedOnUser.LoginName, StringComparison.OrdinalIgnoreCase))
{
MessageBox.Show("Das Programm kann nur vom Benutzer '" + _LoggedOnUser.LoginName + "' entsperrt werden.", "Fehler bei der Anmeldung", MessageBoxButton.OK, MessageBoxImage.Exclamation);
return;
}
username = $"{username}//Version=Sperrung aufgehoben";
ServiceFacade.DoUserServiceAsync(u => u.IsUserValid(username, password, ""), r =>
{
if (!r.Equals(ServiceProxy.UserValidationResult.UserValid))
{
MessageBox.Show("Anmeldeinformationen nicht bekannt. Bitte überprüfen Sie den Benutzernamen und das Passwort!", "Fehler bei der Anmeldung", MessageBoxButton.OK, MessageBoxImage.Exclamation);
return;
}
AutoLockUI.HasJustBeenUnlocked = true;
Application.Current.Dispatcher.Invoke(delegate
{
Application.Current.MainWindow.Content = _lockedContent;
MainPage.ShowCurrentModalViewWindowsAgain();
});
}, true);
}
private static void OnPreviewMouseDown(object sender, MouseButtonEventArgs e)
{
AutoLockUI.ResetLockUITimer();
}
private static void OnPreviewKeyDown(object sender, KeyEventArgs e)
{
AutoLockUI.ResetLockUITimer();
}
private static void Hyperlink_Hilfeplan_Reaktivieren_Click(object sender, RoutedEventArgs e)
{
var scNavView = (SupportConceptNavigationView)MainPage.ActiveView;
if (scNavView != null)
{
var supportConcept = (CompactSupportConceptDC)((Hyperlink)sender).Tag;
scNavView.MainNavigationView_OnReactivateObject(supportConcept);
}
}
public static void GetChatServerUrlAsync(Action<string> callback)
{
if (string.IsNullOrWhiteSpace(ConnectionInformation.ServerName))
{
var tenant = ConnectionInformation.Tenant;
#if DEBUG
tenant = "5473568546";
#endif
var login = new Login(tenant, serverUrl =>
{
if (!string.IsNullOrWhiteSpace(serverUrl))
{
callback(serverUrl);
}
});
}
else
{
callback?.Invoke(ConnectionInformation.ChatServerAddress);
}
}
public static void Cleanup()
{
_lockedContent = null;
_AppSettings = null;
_CompactLoggedOnEmployee = null;
_LoggedOnEmployee = null;
_LoggedOnUser = null;
_Mandator = null;
}
}
}

View File

@@ -0,0 +1,37 @@
using BS.Shared;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BeWo
{
public class MainSessionSingleton
{
private static MainSessionSingleton instance = null;
private static readonly object padlock = new object();
public ObservableCollection<UserRightType> LoggedOnUsersRights { get; set; }
MainSessionSingleton()
{
}
public static MainSessionSingleton Instance
{
get
{
lock (padlock)
{
if (instance == null)
{
instance = new MainSessionSingleton();
}
return instance;
}
}
}
}
}

View File

@@ -2493,7 +2493,7 @@ namespace BeWo.Scheduler.View
return null;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException(); }
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException("#4534523454"); }
}
public class AppointmentToolTipConverter : IValueConverter

View File

@@ -0,0 +1,168 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.ServiceModel.Description;
using System.Text;
using System.Threading.Tasks;
namespace BeWo.ServiceProxy
{
public static class ServiceConfig
{
public static BasicHttpBinding BeWoBasicHttpBinding = new BasicHttpBinding()
{
Name = "BeWoBasicEndpoint",
CloseTimeout = new TimeSpan(0, 5, 0),
OpenTimeout = new TimeSpan(0, 5, 0),
ReceiveTimeout = new TimeSpan(0, 10, 0),
SendTimeout = new TimeSpan(0, 5, 0),
AllowCookies = false,
BypassProxyOnLocal = false,
HostNameComparisonMode = HostNameComparisonMode.StrongWildcard,
MaxBufferPoolSize = 524288,
MaxBufferSize = int.MaxValue,
MaxReceivedMessageSize = int.MaxValue,
TextEncoding = Encoding.UTF8,
TransferMode = TransferMode.Buffered,
UseDefaultWebProxy = true,
MessageEncoding = WSMessageEncoding.Text,
ReaderQuotas = new System.Xml.XmlDictionaryReaderQuotas
{
MaxDepth = 32,
MaxStringContentLength = int.MaxValue,
MaxArrayLength = int.MaxValue,
MaxBytesPerRead = 4096,
MaxNameTableCharCount = 16384
},
Security = new BasicHttpSecurity
{
Mode = BasicHttpSecurityMode.None
}
};
public static BasicHttpBinding BeWoStreamingBinding = new BasicHttpBinding()
{
Name = "BeWoStreamingEndpoint",
ReceiveTimeout = new TimeSpan(10, 0, 0),
SendTimeout = new TimeSpan(10, 0, 0),
MaxBufferSize = 65536,
MaxReceivedMessageSize = 67108864,
TextEncoding = Encoding.UTF8,
TransferMode = TransferMode.StreamedRequest,
UseDefaultWebProxy = true,
MessageEncoding = WSMessageEncoding.Text,
ReaderQuotas = new System.Xml.XmlDictionaryReaderQuotas
{
MaxDepth = 32,
MaxStringContentLength = 8192,
MaxArrayLength = 16384,
MaxBytesPerRead = 4096,
MaxNameTableCharCount = 16384
},
Security = new BasicHttpSecurity
{
Mode = BasicHttpSecurityMode.None
}
};
public static BasicHttpBinding QueryServiceBinding = new BasicHttpBinding()
{
Name = "BeWoBasicEndpoint",
CloseTimeout = new TimeSpan(0, 5, 0),
OpenTimeout = new TimeSpan(0, 5, 0),
ReceiveTimeout = new TimeSpan(0, 10, 0),
SendTimeout = new TimeSpan(0, 5, 0),
AllowCookies = false,
BypassProxyOnLocal = false,
HostNameComparisonMode = HostNameComparisonMode.StrongWildcard,
MaxBufferPoolSize = 524288,
MaxBufferSize = int.MaxValue,
MaxReceivedMessageSize = int.MaxValue,
TextEncoding = Encoding.UTF8,
TransferMode = TransferMode.Buffered,
UseDefaultWebProxy = true,
MessageEncoding = WSMessageEncoding.Text,
ReaderQuotas = new System.Xml.XmlDictionaryReaderQuotas
{
MaxDepth = 32,
MaxStringContentLength = 8192,
MaxArrayLength = 16384,
MaxBytesPerRead = 4096,
MaxNameTableCharCount = 16384
},
Security = new BasicHttpSecurity
{
Mode = BasicHttpSecurityMode.None
}
};
public static Dictionary<Type, BasicHttpBinding> HttpBindingConfiguration = new Dictionary<Type, BasicHttpBinding>
{
{ typeof(IQueryService), QueryServiceBinding},
{ typeof(IStreamingService), BeWoStreamingBinding},
{ typeof(IEmployeeService), BeWoBasicHttpBinding },
{ typeof(ICustomerService), BeWoBasicHttpBinding },
{ typeof(IUserService), BeWoBasicHttpBinding },
{ typeof(IValueListService), BeWoBasicHttpBinding },
{ typeof(IDownloadService), BeWoBasicHttpBinding },
{ typeof(IResourceService), BeWoBasicHttpBinding },
{ typeof(IOperationsService), BeWoBasicHttpBinding },
{ typeof(IAnalysisService), BeWoBasicHttpBinding },
{ typeof(IMailService), BeWoBasicHttpBinding },
{ typeof(IAccountingService), BeWoBasicHttpBinding},
{ typeof(IReportService), BeWoBasicHttpBinding}
};
public static Dictionary<Type, BasicHttpBinding> ServiceClient = new Dictionary<Type, BasicHttpBinding>
{
{ typeof(IQueryService), QueryServiceBinding},
{ typeof(IStreamingService), BeWoStreamingBinding},
{ typeof(IEmployeeService), BeWoBasicHttpBinding },
{ typeof(ICustomerService), BeWoBasicHttpBinding },
{ typeof(IUserService), BeWoBasicHttpBinding },
{ typeof(IValueListService), BeWoBasicHttpBinding },
{ typeof(IDownloadService), BeWoBasicHttpBinding },
{ typeof(IResourceService), BeWoBasicHttpBinding },
{ typeof(IOperationsService), BeWoBasicHttpBinding },
{ typeof(IAnalysisService), BeWoBasicHttpBinding },
{ typeof(IMailService), BeWoBasicHttpBinding },
{ typeof(IAccountingService), BeWoBasicHttpBinding},
{ typeof(IReportService), BeWoBasicHttpBinding}
};
public static TClient GetClient<TClient, TInterface>()
where TClient : ClientBase<TInterface>, TInterface, new()
where TInterface : class
{
TClient client = null;
try
{
client = new TClient();
}
catch (Exception e)
{
}
var binding = HttpBindingConfiguration[typeof(TInterface)];
var endpoint = ServiceFacade.EndpointAddresses[typeof(TInterface)];
client = //new UserServiceClient(binding, endpoint) as TClient;
(TClient)Activator.CreateInstance(typeof(TClient), new object[] {binding, endpoint});
if (typeof(IQueryService).IsAssignableFrom(typeof(TClient)))
{
}
else if (typeof(IUserService).IsAssignableFrom(typeof(TClient)))
{
}
return client;
}
}
}

View File

@@ -598,7 +598,7 @@ namespace BeWo.ServiceProxy
}
else
{
throw new NotImplementedException();
throw new NotImplementedException("#4342345669875");
}
}

View File

@@ -1,4 +1,8 @@
using BeWo.ServiceProxy;
using BeWo.MultiLanguage;
using BeWo.ServiceProxy;
using BeWo.View.Controls;
using BeWo.View.Search;
using BS.Shared.Translation;
using BS.SharedLauncher.Information;
using BS.SharedLauncher.Interfaces;
using BS.SharedLauncher.Windows;
@@ -28,6 +32,16 @@ namespace BeWo
var dict = new MainDictionary();
app.Resources.MergedDictionaries.Add(dict);
Translator t = new Translator(new ServiceTranslator());
//var test = Session.FindResource("SupportConceptListBrush");
//throw new NotImplementedException("#342342342309");
//new SupportConceptSearchView();
new SingleSupportConceptSelectionControl();
}
}
}

View File

@@ -125,7 +125,7 @@
</ListBox>
<Popup x:Name="popupSupportConcepts" StaysOpen="False" Placement="MousePoint" Width="450" Grid.Row="2" Height="400">
<localsearch:SupportConceptSearchView x:Name="SearchView" ShowFilterPanel="True" ItemSelected="SupportConceptSearchView_ItemSelected" SearchMode="ActiveCostbearer2SupportConcepts" />
<localsearch:SupportConceptSearchView x:Name="SearchView" ShowFilterPanel="True" ItemSelected="SupportConceptSearchView_ItemSelected" />
</Popup>
<Popup x:Name="popupGroup" StaysOpen="False" Placement="MousePoint" Width="400" Grid.Row="2" Height="400">
<localsearch:SupportConceptGroupSearchView x:Name="GroupSearchView" ItemSelected="GroupSearchView_ItemSelected" />

View File

@@ -25,6 +25,8 @@ namespace BeWo.View.Controls
{
this.InitializeComponent();
SearchView.SearchMode = Search.SearchMode.ActiveCostbearer2SupportConcepts;
this.UpdateListBox();
GroupSearchView.EditGroupButtonClicked += GroupSearchView_EditGroupButtonClicked;
}

View File

@@ -51,7 +51,7 @@
</Border>
</Grid>
<Popup x:Name="popupSupportConcepts" StaysOpen="False" Placement="MousePoint" Width="450" Grid.Row="1" Height="400" >
<localsearch:SupportConceptSearchView x:Name="SearchView" ShowFilterPanel="True" ItemSelected="SupportConceptSearchView_ItemSelected" SearchMode="ActiveCostbearer2SupportConcepts" />
<localsearch:SupportConceptSearchView x:Name="SearchView" ShowFilterPanel="True" ItemSelected="SupportConceptSearchView_ItemSelected" />
</Popup>
</Grid>
</UserControl>

View File

@@ -21,8 +21,16 @@ namespace BeWo.View.Controls
public SingleSupportConceptSelectionControl()
{
InitializeComponent();
SearchView.ControlInitialized += SearchView_ControlInitialized;
try
{
InitializeComponent();
SearchView.SearchMode = Search.SearchMode.ActiveCostbearer2SupportConcepts;
SearchView.ControlInitialized += SearchView_ControlInitialized;
}
catch(Exception e)
{
}
}
void SearchView_ControlInitialized(object sender, EventArgs e)
@@ -39,6 +47,9 @@ namespace BeWo.View.Controls
public List<CompactSupportConceptDC> SupportConceptList
{
//get => null;
//set { }
get { return SearchView.SupportConcepts; }
set { SearchView.SupportConcepts = value; }
}
@@ -74,6 +85,9 @@ namespace BeWo.View.Controls
{
SearchView.SearchText = value;
}
//get => null;
//set { }
}
private void SupportConceptSearchView_ItemSelected(object sender, EventArgs<CompactSupportConceptDC> e)
@@ -122,7 +136,7 @@ namespace BeWo.View.Controls
internal void SetSelectedSupportConceptOid(long pOid)
{
var items = SearchView.SupportConcepts;
List<CompactSupportConceptDC> items = SearchView.SupportConcepts;
if (items != null)
{

View File

@@ -174,9 +174,9 @@
CreateDemands="CreateAll, CustomerView_Create"
ShowDetailsPanel="True"
DetailPanelItemTemplate="{StaticResource CustomerDetailInfoTemplate}"
ContentGroupStyle="{DynamicResource CustomerNavigationStyle}"
MainListItemStyle="{DynamicResource CustomerDetailStyle}"
HistoryListItemStyle="{DynamicResource SearchSimpleStyle}"
ContentGroupStyle="{StaticResource CustomerNavigationStyle}"
MainListItemStyle="{StaticResource CustomerDetailStyle}"
HistoryListItemStyle="{StaticResource SearchSimpleStyle}"
OnReloadData="MainNavigationView_OnReloadData"/>
</Grid>

View File

@@ -15,9 +15,9 @@
DeleteDemands="DeleteAll, CustomerTeam_Delete"
CreateDemands="CreateAll, CustomerTeam_Create"
ExcelExport="mainNavigationView_ExcelExport"
ContentGroupStyle="{DynamicResource CustomerTeamNavigationStyle}"
MainListItemStyle="{DynamicResource SearchDetailStyle}"
HistoryListItemStyle="{DynamicResource SearchSimpleStyle}"
ContentGroupStyle="{StaticResource CustomerTeamNavigationStyle}"
MainListItemStyle="{StaticResource SearchDetailStyle}"
HistoryListItemStyle="{StaticResource SearchSimpleStyle}"
OnReloadData="MainNavigationView_OnReloadData"/>

View File

@@ -16,9 +16,9 @@
DeleteDemands="DeleteAll, EmployeeView_Delete"
CreateDemands="CreateAll, EmployeeView_Create"
ArchiveObject="MainNavigationView_ArchiveObject"
ContentGroupStyle="{DynamicResource EmployeeNavigationStyle}"
MainListItemStyle="{DynamicResource EmployeeDetailStyle}"
HistoryListItemStyle="{DynamicResource SearchSimpleStyle}"
ContentGroupStyle="{StaticResource EmployeeNavigationStyle}"
MainListItemStyle="{StaticResource EmployeeDetailStyle}"
HistoryListItemStyle="{StaticResource SearchSimpleStyle}"
OnReloadData="MainNavigationView_OnReloadData"/>
</Grid>
<!-- MainListItemStyle="{DynamicResource SearchDetailStyle}" -->

View File

@@ -11,9 +11,9 @@
ExcelExport="mainNavigationView_ExcelExport"
DeleteDemands="DeleteAll, OrganisationView_Delete"
CreateDemands="CreateAll, OrganisationView_Create"
ContentGroupStyle="{DynamicResource OrganisationNavigationStyle}"
MainListItemStyle="{DynamicResource OrganisationDetailStyle}"
HistoryListItemStyle="{DynamicResource SearchSimpleStyle}"
ContentGroupStyle="{StaticResource OrganisationNavigationStyle}"
MainListItemStyle="{StaticResource OrganisationDetailStyle}"
HistoryListItemStyle="{StaticResource SearchSimpleStyle}"
OnReloadData="MainNavigationView_OnReloadData"/>
</Grid>

View File

@@ -11,9 +11,9 @@
DeleteDemands="DeleteAll, PersonView_Delete"
CreateDemands="CreateAll, PersonView_Create"
ExcelExport="mainNavigationView_ExcelExport"
ContentGroupStyle="{DynamicResource PersonNavigationStyle}"
MainListItemStyle="{DynamicResource PersonDetailStyle}"
HistoryListItemStyle="{DynamicResource SearchSimpleStyle}"
ContentGroupStyle="{StaticResource PersonNavigationStyle}"
MainListItemStyle="{StaticResource PersonDetailStyle}"
HistoryListItemStyle="{StaticResource SearchSimpleStyle}"
OnReloadData="MainNavigationView_OnReloadData"/>

View File

@@ -13,9 +13,9 @@
DeleteDemands="DeleteAll, TeamView_Delete"
CreateDemands="CreateAll, TeamView_Create"
ExcelExport="mainNavigationView_ExcelExport"
ContentGroupStyle="{DynamicResource TeamNavigationStyle}"
MainListItemStyle="{DynamicResource SearchDetailStyle}"
HistoryListItemStyle="{DynamicResource SearchSimpleStyle}"
ContentGroupStyle="{StaticResource TeamNavigationStyle}"
MainListItemStyle="{StaticResource SearchDetailStyle}"
HistoryListItemStyle="{StaticResource SearchSimpleStyle}"
OnReloadData="MainNavigationView_OnReloadData"/>

View File

@@ -1,6 +1,17 @@
<localView:BeWoView x:Class="BeWo.View.Navigation.UserGroupNavigationView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:localView="clr-namespace:BeWo.View" Height="Auto" Width="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Focusable="True" xmlns:localNavView="clr-namespace:BeWo.View.Navigation" Loaded="OnLoaded">
<Grid>
<localNavView:MainNavigationView x:Name="mainNavigationView" MainGroupHeader="Benutzergruppen" CreateNewObject="mainNavigationView_CreateNewObject" OpenObject="mainNavigationView_OpenObject" DeleteDemands="DeleteAll, UserGroupView_Delete" CreateDemands="None" DeleteObject="mainNavigationView_DeleteObject" ExcelExport="mainNavigationView_ExcelExport" ContentGroupStyle="{DynamicResource UserGroupNavigationStyle}" MainListItemStyle="{DynamicResource SearchDetailStyle}" HistoryListItemStyle="{DynamicResource SearchSimpleStyle}" OnReloadData="MainNavigationView_OnReloadData"/>
<localNavView:MainNavigationView x:Name="mainNavigationView"
MainGroupHeader="Benutzergruppen"
CreateNewObject="mainNavigationView_CreateNewObject"
OpenObject="mainNavigationView_OpenObject"
DeleteDemands="DeleteAll, UserGroupView_Delete"
CreateDemands="None"
DeleteObject="mainNavigationView_DeleteObject"
ExcelExport="mainNavigationView_ExcelExport"
ContentGroupStyle="{StaticResource UserGroupNavigationStyle}"
MainListItemStyle="{StaticResource SearchDetailStyle}"
HistoryListItemStyle="{StaticResource SearchSimpleStyle}"
OnReloadData="MainNavigationView_OnReloadData"/>
</Grid>
</localView:BeWoView>

View File

@@ -9,9 +9,9 @@
DeleteDemands="DeleteAll, UserView_Delete"
CreateDemands="CreateAll, UserView_Create"
ExcelExport="mainNavigationView_ExcelExport"
ContentGroupStyle="{DynamicResource UserNavigationStyle}"
MainListItemStyle="{DynamicResource SearchDetailStyle}"
HistoryListItemStyle="{DynamicResource SearchSimpleStyle}"
ContentGroupStyle="{StaticResource UserNavigationStyle}"
MainListItemStyle="{StaticResource SearchDetailStyle}"
HistoryListItemStyle="{StaticResource SearchSimpleStyle}"
OnReloadData="MainNavigationView_OnReloadData"/>
<TextBlock Grid.Column="1" x:Name="textblock_link" VerticalAlignment="Bottom" Margin="0,0,25,15" HorizontalAlignment="Right" FontSize="16">

View File

@@ -10,9 +10,9 @@
DeleteDemands="DeleteAll,WohnheimView_Delete"
CreateDemands="CreateAll,WohnheimView_Create"
ArchiveObject="wohnheimNavigationView_ArchiveObject"
ContentGroupStyle="{DynamicResource WohnheimNavigationStyle}"
MainListItemStyle="{DynamicResource WohnheimDetailStyle}"
HistoryListItemStyle="{DynamicResource SearchSimpleStyle}"
ContentGroupStyle="{StaticResource WohnheimNavigationStyle}"
MainListItemStyle="{StaticResource WohnheimDetailStyle}"
HistoryListItemStyle="{StaticResource SearchSimpleStyle}"
OnReloadData="WohnheimNavigationView_OnReloadData"/>
</Grid>
</localView:BeWoView>

View File

@@ -0,0 +1,45 @@
<UserControl x:Class="BeWoLauncher.Components.PasswortAenderungsView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BeWoLauncher.Components"
mc:Ignorable="d"
d:DesignHeight="230" d:DesignWidth="340">
<Grid>
<GroupBox Header="Passwort ändern" x:Name="rootGroupBox" Style="{DynamicResource MainContentGroupBoxWithoutMaximizeBtnStyle}" MouseLeftButtonDown="RootGroupBox_OnMouseLeftButtonDown">
<Grid Background="{DynamicResource ObjectEditBackgroundBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock x:Name="textblock_editFailures" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Height="30" Foreground="Red" FontSize="12" TextWrapping="Wrap" Margin="3" VerticalAlignment="Center" HorizontalAlignment="Center" />
<Label Grid.Row="1" Grid.Column="0" Content="Altes Passwort" Margin="3" />
<PasswordBox x:Name="AltesPwBox" Grid.Row="1" Grid.Column="1" Margin="3" VerticalContentAlignment="Center" PasswordChanged="AltesPWgeaendert" />
<Label Grid.Row="2" Grid.Column="0" Content="Neues Passwort" Margin="3" />
<PasswordBox x:Name="NeuesPwBox" Grid.Row="2" Grid.Column="1" Margin="3" VerticalContentAlignment="Center" PasswordChanged="NeuesPwBox_OnPasswordChanged" />
<Label Grid.Row="3" Grid.Column="0" Content="Passwort bestätigen" Margin="3" />
<PasswordBox x:Name="NeuesPwBox2" Grid.Row="3" Grid.Column="1" Margin="3" VerticalContentAlignment="Center" />
<Label Content="Passwort zu kurz" Grid.Row="4" Grid.ColumnSpan="2" Foreground="Red" x:Name="passwortprüfer" Visibility="Hidden" />
<StackPanel Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,10,0,0">
<Button Margin="3" Content="OK" Width="100" Click="AendernClick" IsDefault="True" />
<Button Margin="3" x:Name="AbbrechenButton" Content="Abbrechen" Width="100" Command="Close" />
</StackPanel>
</Grid>
</GroupBox>
</Grid>
</UserControl>

View File

@@ -0,0 +1,119 @@
using BeWoLauncher.ServiceProxy;
using BeWoLauncher.WindowImp;
using BS.SharedLauncher;
using BS.SharedLauncher.Information;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Threading;
namespace BeWoLauncher.Components
{
/// <summary>
/// Interaktionslogik für UserControl1.xaml
/// </summary>
public partial class PasswortAenderungsView : UserControl
{
public PopUpWindow PopUp { get; set; }
public PasswortAenderungsView(PopUpWindow pop)
{
InitializeComponent();
PopUp = pop;
}
private void RootGroupBox_OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
try
{
PopUp.DragMove();
}
catch (Exception) { }
}
private void AendernClick(object sender, RoutedEventArgs e)
{
textblock_editFailures.Foreground = new SolidColorBrush(Colors.Red);
//if (ViewModel.CheckOldPassword(AltesPwBox.Password))
//{
// textblock_editFailures.Text = "Das alte Passwort ist nicht korrekt!";
// MessageBox.Show("Das alte Passwort ist nicht korrekt!", "Ändern des Passworts fehlgeschlagen", MessageBoxButton.OK, MessageBoxImage.Information);
// return;
//}
if (string.IsNullOrEmpty(NeuesPwBox.Password))
{
textblock_editFailures.Text = "Bitte geben Sie ein neues Passwort ein!";
MessageBox.Show("Bitte geben Sie ein neues Passwort ein!", "Ändern des Passworts fehlgeschlagen", MessageBoxButton.OK, MessageBoxImage.Information);
return;
}
if (NeuesPwBox.Password != NeuesPwBox2.Password)
{
textblock_editFailures.Text = "Die Passwörter stimmen nicht überein!";
MessageBox.Show("Die Passwörter stimmen nicht überein!", "Ändern des Passworts fehlgeschlagen", MessageBoxButton.OK, MessageBoxImage.Information);
return;
}
var lOld = AltesPwBox.Password;
var lNew = NeuesPwBox.Password;
LauncherServiceFacade.DoLauncherServiceAsync(x => x.CheckPassword2(ConnectionInformation.Username, lOld, lNew),
result => CheckPasswordResult(result, lOld, lNew), true);
}
private void CheckPasswordResult(PasswordValidationResult result, String oldPassword, String newPassword)
{
if (result == PasswordValidationResult.Succesful)
{
LauncherServiceFacade.DoLauncherServiceSync(x => x.ChangePassword(ConnectionInformation.Username, oldPassword, newPassword));
ConnectionInformation.Password = newPassword;
Dispatcher.BeginInvoke(DispatcherPriority.Normal, (Action)PopUp.Close);
}
else
{
var trans = LauncherServiceFacade.DoEnumTranslationServiceSync(x => x.GetTranslation(nameof(PasswordValidationResult), (short)result));
Session.MainWindow.ShowError("Ändern des Passworts fehlgeschlagen", trans, true);
}
}
private void AltesPWgeaendert(object sender, RoutedEventArgs e)
{
//textblock_editFailures.Text = string.Empty;
}
//PasswortSicherheit pwS = new PasswortSicherheit();
private void NeuesPwBox_OnPasswordChanged(object sender, RoutedEventArgs e)
{
//passwortprüfer = pwS.ErmittleUndZeigePasswortStaerke(NeuesPwBox.Password, passwortprüfer);
//var fehlermeldung = string.Empty;
//textblock_editFailures.Foreground = new SolidColorBrush(Color.FromRgb(255, 72, 0));
//if (!(NeuesPwBox.Password.Any(x => sonderzeichen.Contains(x)) && NeuesPwBox.Password.Any(x => zahlen.Contains(x)) && NeuesPwBox.Password.Any(x => grossBuchstaben.Contains(x)) && NeuesPwBox.Password.Any(x => kleinBuchstaben.Contains(x))))
// fehlermeldung = "Das Passwort sollte Sonderzeichen, Zahlen, Groß- und Kleinbuchstaben enthalten";
//if (NeuesPwBox.Password.Length < 8)
// fehlermeldung = "Das Passwort sollte mindestens 8 Zeichen lang sein";
//textblock_editFailures.Text = fehlermeldung;
}
}
}

View File

@@ -0,0 +1,72 @@
<Application x:Class="BeWoLauncher.LauncherApp"
x:ClassModifier="public"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:BeWoLauncher"
StartupUri="WindowImp/MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="OrangeBlack.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style x:Key="PopUpWindowStyle" TargetType="{x:Type GroupBox}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupBox}">
<Grid SnapsToDevicePixels="True">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="10" />
<RowDefinition Height="20" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Border Background="#FF202020" Grid.RowSpan="2" CornerRadius="3,1,0,3" />
<Border Background="#FF202020" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="1" Grid.RowSpan="2" CornerRadius="0,1,0,3" />
<Path StrokeThickness="0" Fill="#FF202020" Data="M 0,0 L 10,10 H 0 Z" Grid.Column="1" />
<Border Margin="0,0,0,0" x:Name="Header" Grid.Column="0" Grid.Row="0" Background="{x:Null}" Padding="10,0,3,0" Grid.ColumnSpan="2" Grid.RowSpan="2" VerticalAlignment="Bottom">
<ContentPresenter TextElement.FontSize="16" Margin="5,0,0,3" RenderTransformOrigin="0,0.5" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Content="{TemplateBinding Header}" ContentSource="Header" ContentStringFormat="{TemplateBinding HeaderStringFormat}" ContentTemplate="{TemplateBinding HeaderTemplate}" RecognizesAccessKey="True" VerticalAlignment="Stretch">
<ContentPresenter.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1" />
<SkewTransform AngleX="0" AngleY="0" />
<RotateTransform Angle="0" />
<TranslateTransform X="0" Y="0" />
</TransformGroup>
</ContentPresenter.RenderTransform>
</ContentPresenter>
</Border>
<Border Grid.Column="0" Grid.Row="2" Padding="5,5,5,5" Grid.ColumnSpan="2" Grid.RowSpan="1">
<ContentPresenter Margin="0,0,0,0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" ContentTemplate="{TemplateBinding ContentTemplate}" />
</Border>
<Path x:Name="isDirtyShape" Grid.Column="0" Grid.Row="0" Grid.RowSpan="2" VerticalAlignment="Center" HorizontalAlignment="Right" StrokeThickness="0" Data="M8.0969173,7.7938912 L7.3260856,1.6313261E-55 10.960733,0.056791361 9.8816968,7.8372078 17.130865,4.505709 18.209901,7.969982 10.336028,9.4841573 16.015164,15.065028 13.005222,17.336183 9.0298264,10.44961 4.7503484,17.141891 1.9107803,14.614571 7.6195467,9.5947088 4.3790577E-47,7.8281079 1.0589099,4.5910004 z" Margin="0,0,41.007,3" Width="18.21" Height="17.336" RenderTransformOrigin="0.5,0.5">
<Path.Fill>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFFB6F0E" Offset="0" />
<GradientStop Color="#FF8C400A" Offset="1" />
</LinearGradientBrush>
</Path.Fill>
<Path.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="0" ScaleY="0" />
<SkewTransform AngleX="0" AngleY="0" />
<RotateTransform Angle="0" />
<TranslateTransform X="0" Y="0" />
</TransformGroup>
</Path.RenderTransform>
</Path>
<Button Margin="3,3,3,3" x:Name="button_close" Grid.Column="0" Grid.Row="0" Width="20" Height="20" VerticalAlignment="Center" HorizontalAlignment="Right" Style="{DynamicResource CloseButtonStyle}" Command="ApplicationCommands.Close" Grid.ColumnSpan="1" Grid.RowSpan="2" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="Foreground" Value="{DynamicResource MainGroupBoxForegroundBrush}" />
<Setter Property="FontWeight" Value="Normal" />
<Setter Property="FontFamily" Value="Microsoft Sans Serif" />
<Setter Property="FontSize" Value="11" />
</Style>
</ResourceDictionary>
</Application.Resources>
</Application>

View File

@@ -0,0 +1,46 @@
using BeWoLauncher.ServiceProxy;
using BeWoLauncher.WindowImp;
using BS.SharedLauncher;
using BS.SharedLauncher.Information;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Threading;
namespace BeWoLauncher
{
/// <summary>
/// Interaktionslogik für "App.xaml"
/// </summary>
public partial class LauncherApp : Application
{
public static MainWindow Window { get; set; }
public static string ShortVersion => "3";
public static string Version => "Version 3.0";
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
Session.Dispatcher = Dispatcher;
Session.Application = Current;
ConnectionInformation.LauncherServerAddress = ConnectionInformation.LauncherServerAddressOrigin.ToString();
LauncherServiceFacade.UpdateServerAddresses(ConnectionInformation.LauncherServerAddress);
FrameworkElement.LanguageProperty.OverrideMetadata(typeof(FrameworkElement), new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag)));
}
}
}

View File

@@ -0,0 +1,94 @@
using BeWoLauncher.ServiceProxy;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.ServiceModel;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows;
namespace BeWoLauncher
{
public static class LauncherUtils
{
public static Dictionary<string, string> ParseQuery(string query)
{
try
{
if (query.IndexOf('?') >= 0)
{
query = query.Split('?')[1];
var valueArray = Regex.Split(query, @"[\&]{0,1}[A-Za-z0-9]+[\=]{1}");
var paramArray = Regex.Split(query, @"[\=][A-Za-z0-9;]+");
valueArray = valueArray.Where(t => !string.IsNullOrWhiteSpace(t)).ToArray();
paramArray = paramArray.Where(t => !string.IsNullOrWhiteSpace(t)).ToArray();
var queryDictionary = new Dictionary<string, string>();
int ixg = 0;
foreach (var item in paramArray)
{
queryDictionary.Add(item.Contains("&") ? Regex.Split(item, @"[\?]|[\&]")[1] : item,
valueArray[ixg]);
ixg++;
if (ixg >= valueArray.Length)
break;
}
return queryDictionary;
}
return new Dictionary<string, string>();
}
catch (Exception ex)
{
throw new Exception(String.Format("Error while parsing query '{0}'\n{1}", query, ex.Message), ex);
}
}
public static string GetAndCreateUserAppDataPath()
{
try
{
string localAppData = Environment.GetFolderPath(
Environment.SpecialFolder.LocalApplicationData);
string companyFilePath
= Path.Combine(localAppData, "beyondSoft");
if (!Directory.Exists(companyFilePath))
Directory.CreateDirectory(companyFilePath);
string bewoFilePath
= Path.Combine(companyFilePath, "BeWoPlaner");
if (!Directory.Exists(bewoFilePath))
Directory.CreateDirectory(bewoFilePath);
return bewoFilePath;
}
catch (Exception ex)
{
MessageBox.Show(
"Fehler beim Anlegen des Anwendungsordners. Sie besitzen nicht die erforderlichen Rechte, bitte wenden Sie sich an Ihren Systemadministrator.\n" +
ex.Message, "BeWoPlaner", MessageBoxButton.OK, MessageBoxImage.Exclamation);
}
return Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
}
public static bool ImplementsInterface(this Type type, Type ifaceType)
{
Type[] intf = type.GetInterfaces();
for (int i = 0; i < intf.Length; i++)
{
if (intf[i] == ifaceType)
{
return true;
}
}
return false;
}
}
}

View File

@@ -0,0 +1,200 @@
<UserControl x:Class="BeWoLauncher.PageImp.LoginPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BeWoLauncher"
mc:Ignorable="d"
Width="Auto" Background="{StaticResource LoginBackground}"
d:DesignHeight="600" d:DesignWidth="800" Loaded="UserControl_Loaded">
<Grid Name="grid_root" >
<StackPanel HorizontalAlignment="Center" >
<Grid Background="{x:Null}" Height="400" Width="600" Visibility="Visible" x:Name="gridLogin" RenderTransformOrigin="0.5,0.5" Margin="0,0,0,0">
<Grid.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1" />
<SkewTransform AngleX="0" AngleY="0" />
<RotateTransform Angle="0" />
<TranslateTransform X="0" Y="0" />
</TransformGroup>
</Grid.RenderTransform>
<Border CornerRadius="7,7,7,7" BorderThickness="2,2,2,2" Padding="5,5,5,5" BorderBrush="#FF606060" Background="{DynamicResource LoginBackgroundColor}" KeyDown="UIElement_OnKeyDown">
<Grid Opacity="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="170" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="185" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Image Grid.Row="0" Grid.ColumnSpan="4" HorizontalAlignment="Left" VerticalAlignment="Top" Source="pack://application:,,,/Icons/bewoplaner_logo_big.png" Height="45" Margin="7,7,0,0"/>
<Label VerticalAlignment="Top" HorizontalAlignment="Right" Content="Version x.x.x" Foreground="#FF818181" Margin="5,7,3,0" Grid.Row="0" Grid.ColumnSpan="4"
Grid.Column="0" FontSize="10" x:Name="lblVersion" />
<StackPanel Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="2" Margin="0,80,0,0">
<Label Content="Herzlich willkommen beim BeWoPlaner!" Foreground="#FF000000" FontSize="12" FontWeight="Bold" Margin="0,30,0,0" />
<Label Content="Bitte geben Sie Ihren Benutzernamen und Ihr Passwort ein." Foreground="#FF000000" FontSize="12" />
</StackPanel>
<Label x:Name="lblPin" Content="PIN:" Grid.Column="1" Grid.Row="1" Foreground="#FF000000" Background="#00000000" VerticalAlignment="Center" Visibility="Collapsed"/>
<TextBox x:Name="PINTextBox" Grid.Column="2" Grid.Row="1" Margin="10,0,20,0" Height="24" SnapsToDevicePixels="True" HorizontalAlignment="Stretch" Visibility="Collapsed"/>
<Label Grid.Column="1" Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Right" Content="Benutzername:" Foreground="#FF000000" Background="#00000000" />
<Label Grid.Column="1" Grid.Row="3" VerticalAlignment="Center" HorizontalAlignment="Left" Content="Passwort:" Foreground="#FF000000" Background="#00000000" />
<TextBox TabIndex="0" SnapsToDevicePixels="True" Grid.Column="2" Grid.Row="2" Margin="10,10,20,10" Height="24" x:Name="TextBox_Username" HorizontalAlignment="Stretch" Text="" GotFocus="TextBox_Username_OnGotFocus" />
<PasswordBox Margin="10,0,20,0" Height="24" Grid.Column="2" Grid.Row="3" x:Name="PasswordBox_Password" Password="" HorizontalAlignment="Stretch" GotFocus="PasswordBox_Password_OnGotFocus" TabIndex="1"/>
<Label x:Name="profileLabel" Grid.Column="1" Grid.Row="5" Content="Profil:" Foreground="#FF000000" FontSize="12" Visibility="Collapsed" VerticalAlignment="Center"/>
<StackPanel x:Name="profileStackPanel" Grid.Row="5" Grid.Column="2" Orientation="Horizontal" Margin="0,10,20,0" Visibility="Collapsed" >
<ComboBox HorizontalAlignment="Left" x:Name="profileSelectionComboBox" Width="175" Height="24" ItemsSource="{Binding Path=ProfileList}" SelectedIndex="0" Margin="10,0,0,0" />
<Button Click="button_addProfile_Click" Content="@" FontFamily="Webdings" FontSize="14" Height="23" Width="23" Margin="3,0,0,0" ToolTip="Profile bearbeiten"/>
</StackPanel>
<Label x:Name="proxyLabel" Grid.Column="1" Grid.Row="6" Content="Proxy:" Foreground="#FF000000" FontSize="12" Visibility="Collapsed" VerticalAlignment="Center"/>
<StackPanel x:Name="proxyStackPanel" Grid.Row="6" Grid.Column="2" Orientation="Horizontal" Margin="0,5,20,0" Visibility="Collapsed">
<TextBox HorizontalAlignment="Left" x:Name="proxyTextBox" Width="175" Height="24" Margin="10,0,0,0" IsReadOnly="True"/>
<Button Click="button_configureProxy_Click" Content="@" FontFamily="Webdings" FontSize="14" Height="23" Width="23" Margin="3,0,0,0" ToolTip="Proxy bearbeiten"/>
</StackPanel>
<ToggleButton x:Name="showProfileSelectionBtn" Click="ShowProfileStackPanel" HorizontalAlignment="Right" Content="Erweitert" Grid.Row="4" Grid.Column="2" Margin="0,5,20,0" Foreground="#FF818181">
<ToggleButton.Template>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="18"/>
</Grid.ColumnDefinitions>
<ContentPresenter x:Name="ButtonContent"/>
<Path Grid.Column="1"
x:Name="Down_Arrow"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Fill="{TemplateBinding Foreground}"
Data="M 0 0 L 4 4 L 8 0 L 4 2 Z" Margin="0,3,0,0"
/>
<Path Grid.Column="1"
x:Name="Down_Arrow2"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Fill="{TemplateBinding Foreground}"
Data="M 0 0 L 4 4 L 8 0 L 4 2 Z" Margin="0,-3,0,0"
/>
<Path Grid.Column="1"
x:Name="Up_Arrow"
Visibility="Collapsed"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Fill="{TemplateBinding Foreground}"
Data="M 0 4 L 4 0 L 8 4 L 4 2 Z" Margin="0,-3,0,0"
/>
<Path Grid.Column="1"
x:Name="Up_Arrow2"
Visibility="Collapsed"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Fill="{TemplateBinding Foreground}"
Data="M 0 4 L 4 0 L 8 4 L 4 2 Z" Margin="0,3,0,0"
/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Fill" Value="#FF333333" TargetName="Down_Arrow"/>
<Setter Property="Fill" Value="#FF333333" TargetName="Down_Arrow2"/>
<Setter Property="Fill" Value="#FF333333" TargetName="Up_Arrow"/>
<Setter Property="Fill" Value="#FF333333" TargetName="Up_Arrow2"/>
<Setter Property="TextBlock.Foreground" Value="#FF333333" TargetName="ButtonContent"/>
</Trigger>
<Trigger Property="IsChecked" Value="true">
<Setter Property="Visibility" Value="Collapsed" TargetName="Down_Arrow"/>
<Setter Property="Visibility" Value="Collapsed" TargetName="Down_Arrow2"/>
<Setter Property="Visibility" Value="Visible" TargetName="Up_Arrow"/>
<Setter Property="Visibility" Value="Visible" TargetName="Up_Arrow2"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</ToggleButton.Template>
<ToggleButton.Triggers>
<EventTrigger RoutedEvent="Button.Click">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation
Storyboard.TargetName="gridLogin"
Storyboard.TargetProperty="Height"
From="{Binding HeightFrom, UpdateSourceTrigger=PropertyChanged}" To="{Binding HeightTo, UpdateSourceTrigger=PropertyChanged}" Duration="0:0:0.1"
AutoReverse="False" Completed="AnimationComplete" />
<DoubleAnimation
Storyboard.TargetName="linkLine"
Storyboard.TargetProperty="Y1"
From="{Binding LineYCoordFrom, UpdateSourceTrigger=PropertyChanged}" To="{Binding LineYCoordTo, UpdateSourceTrigger=PropertyChanged}" Duration="0:0:0.1"
AutoReverse="False" Completed="Animation2Complete" />
<DoubleAnimation
Storyboard.TargetName="linkLine"
Storyboard.TargetProperty="Y2"
From="{Binding LineYCoordFrom, UpdateSourceTrigger=PropertyChanged}" To="{Binding LineYCoordTo, UpdateSourceTrigger=PropertyChanged}" Duration="0:0:0.1"
AutoReverse="False" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</ToggleButton.Triggers>
</ToggleButton>
<StackPanel Margin="10,30,20,50" Grid.Column="2" Grid.Row="7" Orientation="Vertical" HorizontalAlignment="Stretch">
<Button Height="30" x:Name="button_login" HorizontalAlignment="Stretch" Content="Anmelden" Click="button_login_Click" IsDefault="True" Foreground="White" Margin="3" />
<TextBlock VerticalAlignment="Center" Visibility="Collapsed" HorizontalAlignment="Center" Foreground="{DynamicResource MainGroupBoxForegroundBrush}" Margin="3">
<Hyperlink RequestNavigate="PasswortVergessenLinkOnRequestNavigate" NavigateUri="#" >
<TextBlock Text="Passwort vergessen" HorizontalAlignment="Center" FontSize="10" VerticalAlignment="Center" />
</Hyperlink>
</TextBlock>
</StackPanel>
<TextBlock x:Name="txtCopyright" Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="3" HorizontalAlignment="Left" VerticalAlignment="Bottom" FontSize="10" Margin="10,5,0,5" Text="Copyright 2017 | beyondSoft GmbH" Foreground="#FF818181"/>
<TextBlock Grid.Row="7" Grid.Column="3" HorizontalAlignment="Right" VerticalAlignment="Bottom" FontSize="10" Margin="0,5,12,5">
<Hyperlink x:Name="hyperlink" TargetName="newWindow" Foreground="#FF818181" NavigateUri="http://www.beyondsoft.de" RequestNavigate="Hyperlink_OnRequestNavigate">www.beyondsoft.de</Hyperlink>
</TextBlock>
</Grid>
</Border>
<Line Grid.ColumnSpan="4" Stroke="#FFADADAD" X1="14" Y1="70" X2="585" Y2="70" StrokeThickness="1"></Line>
<Line x:Name="linkLine" Stroke="#FFADADAD" X1="14" Y1="340" X2="585" Y2="340" StrokeThickness="1" Margin="0,30,0,-30"></Line>
</Grid>
<Rectangle Width="600" Height="400" RenderTransformOrigin="0.5,0.5">
<Rectangle.OpacityMask>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0.418">
<GradientStop Color="#00000000" Offset="0" />
<GradientStop Color="#4CFFFFFF" Offset="1" />
</LinearGradientBrush>
</Rectangle.OpacityMask>
<Rectangle.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="-1" />
<SkewTransform AngleX="0" AngleY="0" />
<RotateTransform Angle="0" />
<TranslateTransform X="0" Y="0" />
</TransformGroup>
</Rectangle.RenderTransform>
<Rectangle.Fill>
<VisualBrush Visual="{Binding ElementName=gridLogin}" />
</Rectangle.Fill>
</Rectangle>
</StackPanel>
<Border x:Name="profileEditPopUp" />
</Grid>
</UserControl>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,86 @@
<UserControl x:Class="BeWoLauncher.PageImp.UpdatePage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BeWoLauncher.PageImp"
mc:Ignorable="d" Background="{StaticResource LoginBackground}"
d:DesignHeight="450" d:DesignWidth="800" Loaded="UserControl_Loaded">
<Grid Name="grid_root" >
<StackPanel HorizontalAlignment="Center" >
<Grid Background="{x:Null}" Height="400" Width="600" Visibility="Visible" x:Name="gridUpdate" RenderTransformOrigin="0.5,0.5" Margin="0,0,0,0">
<Grid.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1" />
<SkewTransform AngleX="0" AngleY="0" />
<RotateTransform Angle="0" />
<TranslateTransform X="0" Y="0" />
</TransformGroup>
</Grid.RenderTransform>
<Border CornerRadius="7,7,7,7" BorderThickness="2,2,2,2" Padding="5,5,5,5" BorderBrush="#FF606060" Background="{DynamicResource LoginBackgroundColor}">
<Grid Opacity="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="170" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="185" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Image Grid.Row="0" Grid.ColumnSpan="4" HorizontalAlignment="Left" VerticalAlignment="Top" Source="pack://application:,,,/Icons/bewoplaner_logo_big.png" Height="45" Margin="7,7,0,0"/>
<Label VerticalAlignment="Top" HorizontalAlignment="Right" Content="Version x.x.x" Foreground="#FF818181" Margin="5,7,3,0" Grid.Row="0" Grid.ColumnSpan="4"
Grid.Column="0" FontSize="10" x:Name="lblVersion" />
<StackPanel Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="2" Margin="0,80,0,0">
<Label x:Name="lblMessage" Content="bewoplaner wird aktualisiert..." Foreground="#FF000000" FontSize="12" FontWeight="Bold" Margin="0,30,0,0" />
<Label x:Name="lblSubmessage" Content="Update wird installiert" Foreground="#FF000000" FontSize="12" />
</StackPanel>
<ProgressBar x:Name="proBar1" Grid.Row="3" Grid.ColumnSpan="4" Width="500" Height="20" Minimum="0" Maximum="100" IsIndeterminate="True"/>
<TextBlock x:Name="txtCopyright" Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="3" HorizontalAlignment="Left" VerticalAlignment="Bottom" FontSize="10" Margin="10,5,0,5" Text="Copyright 2017 | beyondSoft GmbH" Foreground="#FF818181"/>
<TextBlock Grid.Row="7" Grid.Column="3" HorizontalAlignment="Right" VerticalAlignment="Bottom" FontSize="10" Margin="0,5,12,5">
<Hyperlink x:Name="hyperlink" TargetName="newWindow" Foreground="#FF818181" NavigateUri="http://www.beyondsoft.de" RequestNavigate="Hyperlink_OnRequestNavigate">www.beyondsoft.de</Hyperlink>
</TextBlock>
</Grid>
</Border>
<Line Grid.ColumnSpan="4" Stroke="#FFADADAD" X1="14" Y1="70" X2="585" Y2="70" StrokeThickness="1"></Line>
<Line x:Name="linkLine" Stroke="#FFADADAD" X1="14" Y1="340" X2="585" Y2="340" StrokeThickness="1" Margin="0,30,0,-30"></Line>
</Grid>
<Rectangle Width="600" Height="400" RenderTransformOrigin="0.5,0.5">
<Rectangle.OpacityMask>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0.418">
<GradientStop Color="#00000000" Offset="0" />
<GradientStop Color="#4CFFFFFF" Offset="1" />
</LinearGradientBrush>
</Rectangle.OpacityMask>
<Rectangle.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="-1" />
<SkewTransform AngleX="0" AngleY="0" />
<RotateTransform Angle="0" />
<TranslateTransform X="0" Y="0" />
</TransformGroup>
</Rectangle.RenderTransform>
<Rectangle.Fill>
<VisualBrush Visual="{Binding ElementName=gridUpdate}" />
</Rectangle.Fill>
</Rectangle>
</StackPanel>
</Grid>
</UserControl>

View File

@@ -0,0 +1,164 @@
using System;
using System.Collections.Generic;
using System.Deployment.Application;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using BeWoLauncher.ServiceProxy;
using BS.SharedLauncher;
using BS.SharedLauncher.DataContract;
using BS.SharedLauncher.Information;
using BS.SharedLauncher.Pages;
using Path = System.IO.Path;
namespace BeWoLauncher.PageImp
{
/// <summary>
/// Interaktionslogik für UpdateView.xaml
/// </summary>
public partial class UpdatePage : UserControl, IUpdatePage
{
public event EventHandler UpdateSuccessful;
public event EventHandler UpdateFinished;
private bool _ShowDelay;
private bool _ForceUpdate;
private BeWoProgramPackageDC _Update;
public UpdatePage(bool showDelay, bool forceUpdate)
{
InitializeComponent();
Session.DirectoryRootString = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "local");
Session.DirectoryRoot = new DirectoryInfo(Session.DirectoryRootString);
_ShowDelay = showDelay;
_ForceUpdate = forceUpdate;
}
public string Message
{
get { return lblMessage.Content as string; }
set { lblMessage.Content = value; }
}
public string SubMessage
{
get { return lblSubmessage.Content as string; }
set { lblSubmessage.Content = value; }
}
private void Hyperlink_OnRequestNavigate(object sender, RequestNavigateEventArgs e)
{
System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo((sender as Hyperlink).NavigateUri.ToString()));
}
private async void startUpdateAsync()
{
Message = "Update wird vorbereitet...";
SubMessage = "";
if (_ForceUpdate)
clearLocal();
await showDelay(5000);
Message = "Update wird heruntergeladen...";
SubMessage = "";
await showDelay(1000);
getUpdate();
Message = "Update wird installiert...";
await showDelay(1000);
await applyUpdate();
Message = "Update wurde installiert!";
SubMessage = "Starte BeWoPlaner...";
await showDelay(1000);
UpdateSuccessful(this, new EventArgs());
UpdateFinished(this, null);
}
private void clearLocal()
{
foreach (FileInfo file in Session.DirectoryRoot.GetFiles())
{
file.Delete();
}
}
private void getUpdate()
{
var current = new BeWoProgramPackageDC();
if (!Directory.Exists(Session.DirectoryRootString))
Directory.CreateDirectory(Session.DirectoryRootString);
current.Files.AddRange(Session.DirectoryRoot.GetFiles().Select(file => new BeWoProgramFileDC(file)));
_Update = LauncherServiceFacade.DoLauncherServiceSync(x => x.Update(current));
Session.Assembly2LaunchName = _Update.toLoad;
}
private async Task applyUpdate()
{
proBar1.IsIndeterminate = false;
proBar1.Minimum = 0;
proBar1.Maximum = _Update.Files.Count;
foreach (var file in _Update.Files)
{
SubMessage = file.ToDo.ToString()[0] + ":" + file.FileName;
++proBar1.Value;
switch (file.ToDo)
{
case FileToDo.Update:
case FileToDo.Add:
using (var fs = new FileStream(Path.Combine(Session.DirectoryRootString, file.FileName), FileMode.Create, FileAccess.Write))
{
fs.Write(file.FileData, 0, file.FileData.Length);
}
break;
case FileToDo.Remove:
File.Delete(Path.Combine(Session.DirectoryRootString, file.FileName));
break;
case FileToDo.Nuthing:
break;
}
await showDelay(50);
}
}
private async Task showDelay(int millisec)
{
if (_ShowDelay)
await Task.Delay(millisec);
}
private void UserControl_Loaded(object sender, RoutedEventArgs e)
{
double top = (this.ActualHeight - 400) / 3;
this.gridUpdate.Margin = new Thickness(0, top, 0, 0);
//startUpdate();
Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Background, (Action)startUpdateAsync);
}
}
}

View File

@@ -0,0 +1,13 @@
<Window x:Class="BeWoLauncher.WindowImp.MainWindow"
x:ClassModifier="public"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:BeWoLauncher"
mc:Ignorable="d"
Title="MainWindow" Height="768" Width="1024" WindowStartupLocation="CenterScreen" WindowState="Maximized" BorderThickness="1" Closing="MainWindow_OnClosing">
<Grid x:Name="rootGrid">
</Grid>
</Window>

View File

@@ -0,0 +1,304 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Threading;
using BeWoLauncher.Components;
using BeWoLauncher.PageImp;
using BS.SharedLauncher;
using BS.SharedLauncher.Information;
using BS.SharedLauncher.Interfaces;
using BS.SharedLauncher.Pages;
using BS.SharedLauncher.Windows;
namespace BeWoLauncher.WindowImp
{
public partial class MainWindow : Window, IMainWindow
{
private readonly Stack<Control> _ModalPopUpControls;
private Control _CurrentModalPopUp;
private Grid _ModalPopUpBackGround;
private WaitLayer2 _WaitLayer;
public IBeWoPage CurrentPage { get; set; }
//public ILoginPage LoginPage { get; set; }
//public IUpdatePage UpdatePage { get; set; }
//public IMainPage MainPage { get; set; }
public MainWindow()
{
InitializeComponent();
_ModalPopUpControls = new Stack<Control>();
LauncherApp.Window = this;
Session.MainWindow = this;
ShowLoginView();
}
private void LoginSuccessful(object s, EventArgs e)
{
#if DEBUG
//if (ConnectionInformation.Tenant == "demo")
//{
// var dlg = new ConfirmDemoDialog();
// dlg.ShowDialog();
//}
#else
if (ConnectionInformation.Tenant == "demo")
{
var dlg = new ConfirmDemoDialog();
dlg.ShowDialog();
}
#endif
bool useUpdater = bool.TryParse(ConfigurationManager.AppSettings.Get("UseUpdater"), out bool b) && b;
if (useUpdater)
{
ShowUpdateView();
}
else
{
throw new NotImplementedException("#3423543513254");
}
}
private void UpdateSuccessful(object s, EventArgs e)
{
}
private void UpdateFinished(object s, EventArgs e)
{
ShowMainPage();
}
private void MainLogout(object s, EventArgs e)
{
ShowLoginView();
}
private void MainWindow_OnClosing(object s, CancelEventArgs e)
{
if (CurrentPage is object)
{
if (CurrentPage is IMainPage mainPage)
{
if (!mainPage.DoSaveCheck())
{
e.Cancel = true;
return;
}
mainPage.DoMoreSaveStuff();
}
}
Application.Current.Shutdown();
}
public void LoadLocal()
{
Assembly[] tmp = new Assembly[2];
foreach (var file in Session.DirectoryRoot.GetFiles())
{
if (file.Extension != ".dll")
continue;
//tmp[0] = Assembly.LoadFile(Path.Combine(Session.DirectoryRootString, file.Name));
tmp[0] = Assembly.LoadFrom(file.FullName);
Assembly assembly = Assembly.GetExecutingAssembly();
if (tmp[1] is null && file.Name == Session.Assembly2LaunchName)
{
tmp[1] = tmp[0];
}
}
if (tmp[1] is null)
throw new NotImplementedException("#565463944325");
StringBuilder sb = new StringBuilder();
foreach (var typ in tmp[1].GetExportedTypes())
{
sb.Append(typ.Name + ',');
}
var testString = sb.ToString();
var testtype = typeof(IStartRoutine);
//var startRoutineType2 = tmp[1].ExportedTypes.ToArray()[9];
//var sdf = typeof(IStartRoutine).IsAssignableFrom(startRoutineType2);
// var startRoutineType = tmp[1].ExportedTypes.First(type => type.ImplementsInterface(typeof(IStartRoutine)));
Type startRoutineType = null;
foreach (var type in tmp[1].GetExportedTypes())
{
if (typeof(IStartRoutine).IsAssignableFrom(type))
startRoutineType = type;
}
//var startRoutineType = Array.Find(tmp[1].GetExportedTypes(), type => typeof(IStartRoutine).IsAssignableFrom(type));
var startRoutineInstance = Activator.CreateInstance(startRoutineType) as IStartRoutine;
startRoutineInstance.OnStartup(this, Application.Current);
//var test = FindResource("toolbarImageStyle");
var MainPageType = Array.Find(tmp[1].GetExportedTypes(), type => typeof(IMainPage).IsAssignableFrom(type));
var MainPageInstance = Activator.CreateInstance(MainPageType) as IMainPage;
CurrentPage = MainPageInstance;
}
public void ShowBeWoPage(IBeWoPage beWo)
{
if (beWo is UserControl beWoUC)
{
Session.BeginInvokeNormal(() =>
{
rootGrid.Children.Clear();
rootGrid.Children.Add(beWoUC);
});
}
else
{
throw new NotImplementedException("#1249873429");
}
}
private void ShowLoginView()
{
var loginPage = new LoginPage();
loginPage.LoginSuccessful += LoginSuccessful;
ShowBeWoPage(loginPage);
if (bool.TryParse(ConfigurationManager.AppSettings.Get("AutoLogin"), out bool b) && b)
loginPage.Login();
}
private void ShowUpdateView()
{
var updatePage = new UpdatePage(bool.TryParse(ConfigurationManager.AppSettings.Get("ShowUpdateDelay"), out bool b) && b,
bool.TryParse(ConfigurationManager.AppSettings.Get("ForceUpdate"), out bool c) && c);
updatePage.UpdateSuccessful += UpdateSuccessful;
updatePage.UpdateFinished += UpdateFinished;
ShowBeWoPage(updatePage);
}
private void ShowMainPage()
{
LoadLocal();
ShowBeWoPage(CurrentPage);
}
public void ShowError(string message, Exception ex, bool showDetails)
{
Session.BeginInvokeNormal(() =>
ShowControlAsModalPopUp(new ExceptionMessageBox(message, ex, showDetails)));
}
public void ShowError(string message, string ex, bool showDetails)
{
Session.BeginInvokeNormal(() =>
ShowControlAsModalPopUp(new ExceptionMessageBox(message, ex, showDetails)));
}
private void ShowModalBackground()
{
_ModalPopUpBackGround = new Grid();
_ModalPopUpBackGround.IsHitTestVisible = true;
_ModalPopUpBackGround.Background = Brushes.White;
_ModalPopUpBackGround.Opacity = .5;
Grid.SetColumnSpan(_ModalPopUpBackGround, 3);
Grid.SetRowSpan(_ModalPopUpBackGround, 3);
rootGrid.Children.Add(_ModalPopUpBackGround);
Panel.SetZIndex(_ModalPopUpBackGround, int.MaxValue - 1);
}
public void ShowControlAsModalPopUp(Control control)
{
ShowControlAsModalPopUp(control, HorizontalAlignment.Center, VerticalAlignment.Center);
}
public void ShowControlAsModalPopUp(Control control, HorizontalAlignment ha, VerticalAlignment va)
{
Session.BeginInvokeNormal(() =>
{
if (_CurrentModalPopUp != null)
{
rootGrid.Children.Remove(_CurrentModalPopUp);
_ModalPopUpControls.Push(_CurrentModalPopUp);
}
else
{
this.ShowModalBackground();
}
_CurrentModalPopUp = control;
control.HorizontalAlignment = ha;
control.VerticalAlignment = va;
Grid.SetColumnSpan(control, 3);
Grid.SetRowSpan(control, 3);
this.rootGrid.Children.Add(control);
Panel.SetZIndex(control, int.MaxValue);
});
}
public void CloseCurrentPopUp()
{
if (_ModalPopUpBackGround != null)
{
Session.BeginInvokeNormal(() =>
{
rootGrid.Children.Remove(_CurrentModalPopUp);
_CurrentModalPopUp = null;
if (_ModalPopUpControls.Count == 0)
{
rootGrid.Children.Remove(_ModalPopUpBackGround);
_ModalPopUpBackGround = null;
}
else
{
var control = this._ModalPopUpControls.Pop();
_CurrentModalPopUp = control;
rootGrid.Children.Add(control);
Panel.SetZIndex(control, int.MaxValue);
}
});
}
}
public void StartWaiting()
{
Dispatcher.BeginInvoke(DispatcherPriority.Normal,
(Action)delegate
{
if (_WaitLayer == null)
{
_WaitLayer = new WaitLayer2();
_WaitLayer.HorizontalAlignment = HorizontalAlignment.Center;
_WaitLayer.VerticalAlignment = VerticalAlignment.Center;
rootGrid.Children.Add(_WaitLayer);
Panel.SetZIndex(_WaitLayer, int.MaxValue);
_WaitLayer.Dispatcher.Invoke(DispatcherPriority.Render, (Action)delegate () { });
}
});
}
public void EndWaiting()
{
Dispatcher.BeginInvoke(
DispatcherPriority.Normal,
(Action)delegate
{
if (_WaitLayer != null)
{
rootGrid.Children.Remove(_WaitLayer);
_WaitLayer = null;
}
});
}
}
}

View File

@@ -0,0 +1,12 @@
<Window x:Class="BeWoLauncher.WindowImp.PopUpWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:BeWoLauncher.WindowImp"
mc:Ignorable="d"
Title="PopUpWindow" Height="450" Width="800">
<Grid x:Name="root">
</Grid>
</Window>

View File

@@ -0,0 +1,55 @@
using BS.SharedLauncher.Windows;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace BeWoLauncher.WindowImp
{
/// <summary>
/// Interaktionslogik für PopUpWindow.xaml
/// </summary>
public partial class PopUpWindow : Window, IPopUpWindow
{
public bool Abbruch { get; set; }
public PopUpWindow()
{
InitializeComponent();
Abbruch = false;
CommandBindings.Add(new CommandBinding(ApplicationCommands.Close, (s, e) =>
{
Abbruch = true;
Close();
}));
}
public PopUpWindow(UserControl content) : this()
{
SetContent(content);
}
public Window GetWindow()
{
return this;
}
public void SetContent(UserControl usa)
{
root.Children.Clear();
root.Children.Add(usa);
}
}
}

View File

@@ -0,0 +1 @@
<%@ ServiceHost Language="C#" Debug="true" Service="BeWo.Service.ServiceImplementations.EnumTranslationServiceImp" %>

View File

@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.ServiceModel;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Reports;
using BS.SharedLauncher;
namespace BeWo.Service.ServiceContracts
{
[ServiceContract]
public interface IEnumTranslationService
{
[FaultContract(typeof(BeWoFault))]
[OperationContract]
string GetTranslation(string e, short value);
}
}

View File

@@ -0,0 +1,61 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using BeWo.Data;
using BeWo.Service.Plugins;
using BS.Shared.DataContracts.Compact;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Service.Core;
using BeWo.Service.DCEntityMapper;
using BeWo.Service.ServiceContracts;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
using BS.SharedLauncher;
using BeWo.Service.Invoicing;
using System.IO;
using System.Configuration;
using System.Diagnostics;
namespace BeWo.Service.ServiceImplementations
{
[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall, ConcurrencyMode = ConcurrencyMode.Single)]
public class EnumTranslationServiceImp : IEnumTranslationService
{
Dictionary<string, Dictionary<object, string>> TranslationDictionary;
Dictionary<object, string> PasswordValidationDict = new Dictionary<object, string>
{
{ PasswordValidationResult.NotCorrect, "Das angegebene Passwort ist nicht korrekt!"},
{ PasswordValidationResult.NotLongEnough, "Das Passwort muss mindestens 8 Zeichen lang sein!"},
{ PasswordValidationResult.NotSpecialEnough, "Das Passwort muss mindestens drei Zeichen aus der Gruppe Sonderzeichen, Zahlen, Groß- und Kleinbuchstaben enthalten."},
{ PasswordValidationResult.ImFunnyAndUsingBewoAsPasswordSmile, "Das Passwort ist nicht sicher genug."},
{ PasswordValidationResult.AreTheSame, "Das Passwort hat sich nicht geändert"},
{ PasswordValidationResult.Succesful, ""},
};
public EnumTranslationServiceImp()
{
TranslationDictionary = new Dictionary<string, Dictionary<object, string>>
{
{nameof(PasswordValidationResult), PasswordValidationDict}
};
}
public string GetTranslation(string e, short value)
{
try
{
return TranslationDictionary[e][value];
}
catch (Exception ex)
{
throw Core.Utils.CreateBeWoFaultException(ex);
}
}
}
}

View File

@@ -0,0 +1,47 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BS.SharedLauncher
{
public class ConnectionProfile
{
public string Name { get; set; }
public string Server { get; set; }
public string Tenant { get; set; }
public ConnectionProfile(string pname, string pserver, string ptenant)
{
Name = pname;
Server = pserver;
Tenant = ptenant;
if (Name == null)
Name = String.Empty;
}
public override string ToString()
{
return Name;
}
public override int GetHashCode()
{
String key = String.Format("{0}_{1}_{2}", Name, Server, Tenant);
return key.GetHashCode();
}
public override bool Equals(object obj)
{
var profile = obj as ConnectionProfile;
if (profile == null)
{
return false;
}
String key1 = String.Format("{0}_{1}_{2}", Name, Server, Tenant);
String key2 = String.Format("{0}_{1}_{2}", profile.Name, profile.Server, profile.Tenant);
return key1.Equals(key2);
}
}
}

View File

@@ -0,0 +1,67 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Runtime.Serialization;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
namespace BS.SharedLauncher.DataContract
{
[DebuggerDisplay("{FileName} ({FileVersion})")]
[DataContract]
public class BeWoProgramFileDC
{
public BeWoProgramFileDC() : this(null, null, null, FileToDo.Nuthing) { }
public BeWoProgramFileDC(string filename, Version version) : this(filename, version, null, FileToDo.Nuthing) { }
public BeWoProgramFileDC(string filename, Version version, byte[] data, FileToDo todo)
{
FileName = filename;
FileVersion = version;
FileData = data;
ToDo = todo;
}
public BeWoProgramFileDC(FileInfo fi)
{
FileName = fi.Name;
FileExtension = fi.Extension;
FullPath = fi.FullName;
FileVersion = new Version(FileVersionInfo.GetVersionInfo(fi.FullName).FileVersion ?? "0.0.0.0");
ToDo = FileToDo.Nuthing;
using (var md5 = MD5.Create())
{
using (var stream = File.OpenRead(FullPath))
{
Checksum = BitConverter.ToString(md5.ComputeHash(stream)).Replace("-", "").ToLowerInvariant();
}
}
}
[DataMember]
public string FileName { get; set; }
[DataMember]
public string FileExtension { get; set; }
[DataMember]
public Version FileVersion { get; set; }
[DataMember]
public string FullPath { get; set; }
[DataMember]
public byte[] FileData { get; set; }
[DataMember]
public FileToDo ToDo { get; set; }
[DataMember]
public string Checksum { get; set; }
}
}

View File

@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
namespace BS.SharedLauncher.DataContract
{
//[DebuggerDisplay("{InternalName} ({FileVersion})")]
[DataContract]
public class BeWoProgramPackageDC
{
public BeWoProgramPackageDC()
{
Files = new List<BeWoProgramFileDC>();
}
[DataMember]
public List<BeWoProgramFileDC> Files { get; set; }
[DataMember]
public string toLoad { get; set; }
}
}

View File

@@ -0,0 +1,141 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BS.SharedLauncher.Information
{
public static class ConnectionInformation
{
private static string _ChatServerAddress;
private static string _CoreServerAddress;
private static string _IpAddress;
private static string _LauncherServerAddress;
private static string _Password;
private static string _ServerName;
private static string _Tenant;
private static string _Username;
public static string ChatServerAddress
{
get { return _ChatServerAddress; }
set { _ChatServerAddress = value; }
}
public static string CoreServerAddress
{
get { return _CoreServerAddress; }
set { _CoreServerAddress = value; }
}
public static string IpAddress
{
get { return _IpAddress; }
set { _IpAddress = value; }
}
public static string Password
{
get { return _Password; }
set { _Password = value; }
}
public static string ServerName
{
get { return _ServerName; }
set { _ServerName = value; }
}
public static string Tenant
{
get { return _Tenant; }
set { _Tenant = value; }
}
public static string Username
{
get { return _Username; }
set { _Username = value; }
}
public static string LauncherServerAddress
{
get { return _LauncherServerAddress; }
set
{
_LauncherServerAddress = value;
//LauncherServiceFacade.UpdateServerAddresses(LauncherServerAddressOrigin.ToString());
}
}
public static Uri LauncherServerAddressOrigin
{
get
{
String url = _LauncherServerAddress?.ToLower();
#if DEBUG
url = String.Format("http://localhost:3778");
//return new Uri("https://app4.bewoplaner.de/servicesbd");
//url = String.Format("app1.bewoplaner.de/service");
#endif
if (url.IndexOf("localhost") < 0)
{
if (int.TryParse(url, out int i))
url = "app" + url;
if (url.IndexOf('.') < 0)
{
url += ".bewoplaner.de";
}
if (url.IndexOf("/servicesbd") < 0)
{
url += "/servicesbd";
}
return new Uri(string.Format("https://{0}", url));
}
return new Uri(url);
}
}
public static Uri CoreServerAddressOrigin
{
get
{
String url = _CoreServerAddress?.ToLower();
#if DEBUG
url = String.Format("http://localhost:3777/Host");
//return new Uri("https://app4.bewoplaner.de/servicesbd");
//url = String.Format("app1.bewoplaner.de/service");
#endif
if (url.IndexOf("localhost") < 0)
{
if (Int32.TryParse(url, out int i))
url = "app" + url;
if (url.IndexOf('.') < 0)
{
url += ".bewoplaner.de";
}
//if (url.IndexOf("/service45") < 0)
//{
// url += "/service45";
//}
if (url.IndexOf("/servicesbd") < 0)
{
url += "/servicesbd";
}
return new Uri(string.Format("https://{0}", url));
}
return new Uri(url);
}
}
}
}

View File

@@ -0,0 +1,63 @@
using BS.SharedLauncher.Windows;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Threading;
namespace BS.SharedLauncher.Information
{
public static class Session
{
public static DirectoryInfo DirectoryRoot { get; set; }
public static string DirectoryRootString { get; set; }
public static string Assembly2LaunchName { get; set; }
public static PropertyChangedEventHandler PropertyChanged { get; set; }
public static IMainWindow MainWindow { get; set; }
public static Application Application { get; set; }
public static Dispatcher Dispatcher { get; set; }
private static Dictionary<string, Timer> Timers { get; set; }
static Session()
{
Timers = new Dictionary<string, Timer>();
}
public static void AddTimer(string name, Timer t)
{
if (Timers.ContainsKey(name))
return;
Timers.Add(name, t);
}
public static Window GetWindow() => MainWindow as Window;
public static void ShowError(string message, Exception ex, bool showDetails)
=> MainWindow.ShowError(message, ex, showDetails);
public static void ShowError(string message, string submessage, bool showDetails)
=> MainWindow.ShowError(message, submessage, showDetails);
public static void ShowError(Exception ex)
=> MainWindow.ShowError("Exception", ex, true);
public static void ShowError(string s)
=> MainWindow.ShowError("Fehler", s, true);
public static void FirePropertyChanged(string pPropertyName)
=> PropertyChanged?.Invoke(null, new PropertyChangedEventArgs(pPropertyName));
public static object FindResource(object key)
=> Application.FindResource(key);
public static void BeginInvokeNormal(Action action)
=> Dispatcher.BeginInvoke(DispatcherPriority.Normal, action);
}
}

View File

@@ -0,0 +1,15 @@
using BS.SharedLauncher.Windows;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
namespace BS.SharedLauncher.Interfaces
{
public interface IStartRoutine
{
void OnStartup(IBeWoWindow mainWindow, Application app);
}
}

View File

@@ -0,0 +1,48 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BS.SharedLauncher
{
public enum UserValidationResult
{
UserUnknown = 0,
UserValid = 1,
UnkownError = 2,
TenantUnknown = 3,
IncorrectPin = 4,
PinExpired = 5,
PinAlreadyUsed = 6,
PasswordExpired = 7
}
public enum LauncherPasswortSecurityStrength
{
SehrSchwach,
Schwach,
Mittelmass,
Stark,
SehrStark
}
public enum FileToDo
{
Add,
Remove,
Update,
Nuthing
}
public enum PasswordValidationResult
{
Succesful,
NotCorrect,
NotLongEnough,
NotSpecialEnough,
NotStrongEnough,
ImFunnyAndUsingBewoAsPasswordSmile,
AreTheSame
}
}

View File

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
namespace BS.SharedLauncher.Pages
{
public interface IBeWoPage
{
}
}

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BS.SharedLauncher.Pages
{
public interface ILoginPage : IBeWoPage
{
event EventHandler LoginSuccessful;
void Login();
}
}

View File

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BS.SharedLauncher.Pages
{
public interface IUpdatePage : IBeWoPage
{
event EventHandler UpdateSuccessful;
event EventHandler UpdateFinished;
}
}

View File

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BS.SharedLauncher.Pages
{
public interface IMainPage : IBeWoPage
{
bool DoSaveCheck();
void DoMoreSaveStuff();
}
}

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Allgemeine Informationen über eine Assembly werden über die folgenden
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
// die einer Assembly zugeordnet sind.
[assembly: AssemblyTitle("SharedLauncher")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SharedLauncher")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly
// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen.
[assembly: ComVisible(false)]
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
[assembly: Guid("efe05c79-e0dd-4311-8b90-a8da7ebdf36f")]
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
//
// Hauptversion
// Nebenversion
// Buildnummer
// Revision
//
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// indem Sie "*" wie unten gezeigt eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{EFE05C79-E0DD-4311-8B90-A8DA7EBDF36F}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>BS.SharedLauncher</RootNamespace>
<AssemblyName>BS.SharedLauncher</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\DLLs\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Windows" />
<Reference Include="System.Windows.Presentation" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="ConnectionProfile.cs" />
<Compile Include="Interfaces\IStartRoutine.cs" />
<Compile Include="LauncherEnums.cs" />
<Compile Include="DataContract\BeWoProgramFileDC.cs" />
<Compile Include="Information\ConnectionInformation.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="DataContract\BeWoProgramPackageDC.cs" />
<Compile Include="Information\Session.cs" />
<Compile Include="Pages\00 IBeWoPage.cs" />
<Compile Include="Pages\01 ILoginPage.cs" />
<Compile Include="Pages\02 IUpdatePage.cs" />
<Compile Include="Pages\03 IMainPage.cs" />
<Compile Include="Windows\IBeWoWindow.cs" />
<Compile Include="Windows\IMainWindow.cs" />
<Compile Include="Windows\IPopUpWindow.cs" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
namespace BS.SharedLauncher.Windows
{
public interface IBeWoWindow
{
}
}

View File

@@ -0,0 +1,24 @@
using BS.SharedLauncher.Pages;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BS.SharedLauncher.Windows
{
public interface IMainWindow : IBeWoWindow
{
IBeWoPage CurrentPage { get; set; }
//ILoginPage LoginPage { get; set; }
//IUpdatePage UpdatePage { get; set; }
//IMainPage MainPage { get; set; }
void ShowError(string message, Exception ex, bool showDetails);
void ShowError(string message, string submessage, bool showDetails);
//void ShowWarning();
// MessageBox.Show("Bitte geben Sie ein neues Passwort ein!", "Ändern des Passworts fehlgeschlagen", MessageBoxButton.OK, MessageBoxImage.Information);
}
}

View File

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
namespace BS.SharedLauncher.Windows
{
public interface IPopUpWindow : IBeWoWindow
{
void SetContent(UserControl usa);
}
}