# Conflicts: # BeWo/ServiceProxy/Generated.cs # BeWo/View/Master/ReportView.xaml.cs # BeWo/View/Report/Employee/EmployeeHourReportView.xaml # Data/Data.csproj # Report/AbstractReportCreator.cs # Report/DefaultReportCreator.cs # Report/Report.csproj # Service/DCEntityMapper/MapperFactory.cs # Service/Service.csproj # Service/ServiceContracts/IOperationsService.cs # Service/ServiceImplementations/OperationsServiceImp.cs # Shared/BeWoEntityEnums.cs # Shared/DataContracts/ReportTypes.cs # Shared/Shared.csproj
329 lines
12 KiB
C#
329 lines
12 KiB
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
|
|
using BeWo.ServiceProxy;
|
|
using BeWo.View.Detail.Report;
|
|
using BeWo.View.Report.AnnualReport;
|
|
using BeWo.View.Report.Employee;
|
|
|
|
using BS.Shared;
|
|
using BS.Shared.Extensions;
|
|
using BeWo.View.Report.Auslastung;
|
|
using BeWo.View.Report.Kilometerauswertung;
|
|
using BeWo.View.Report.Rating;
|
|
|
|
namespace BeWo.View.Master
|
|
{
|
|
public partial class ReportView
|
|
{
|
|
public Dictionary<TabItem, BeWoView> OpenViews { get; } = new Dictionary<TabItem, BeWoView>();
|
|
|
|
public ReportView()
|
|
{
|
|
InitializeComponent();
|
|
|
|
InitRights();
|
|
}
|
|
|
|
public override bool IsDirty => OpenViews.ContainsKey(root.SelectedItem as TabItem) && OpenViews[root.SelectedItem as TabItem].IsDirty;
|
|
|
|
internal override DependencyObject ValidationOnSaveRootElement => OpenViews[root.SelectedItem as TabItem].ValidationOnSaveRootElement;
|
|
|
|
internal override bool DoSaveCheck()
|
|
{
|
|
foreach (var lPair in OpenViews)
|
|
{
|
|
if (lPair.Value.IsDirty)
|
|
{
|
|
lPair.Key.IsSelected = true;
|
|
if (!lPair.Value.DoSaveCheck())
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
protected override void Save()
|
|
{
|
|
OpenViews[root.SelectedItem as TabItem].SaveData();
|
|
}
|
|
|
|
private void InitRights()
|
|
{
|
|
if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.Analysis_ServiceOverview_View))
|
|
{
|
|
tabitem_serviceOverview.Visibility = Visibility.Collapsed;
|
|
}
|
|
|
|
if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.Analysis_Auslastung_View))
|
|
{
|
|
tabitem_maReport.Visibility = Visibility.Collapsed;
|
|
}
|
|
|
|
if (BeWoApp.Mandator.BeWoClientType != 3) //Nur Köln Ring
|
|
{
|
|
tabitem_Mitarbeiter.Visibility = Visibility.Collapsed;
|
|
}
|
|
else if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.Analysis_EmployeeOverviewAll_View))
|
|
{
|
|
tabitem_Mitarbeiter.Visibility = Visibility.Collapsed;
|
|
}
|
|
|
|
tabitem_annualReport.Visibility = Visibility.Visible;
|
|
|
|
//if (BeWoApp.Mandator.BeWoClientType == 6 || BeWoApp.Mandator.BeWoClientType == 7 || BeWoApp.Mandator.BeWoClientType == 10 || BeWoApp.AppSettings.ShowAnnualReport)
|
|
// {
|
|
// //Nur Jahresbericht + IBP + Integra
|
|
// tabitem_annualReport.Visibility = Visibility.Visible;
|
|
// }
|
|
|
|
if (BeWoApp.Tenant == "3010479871" || (!BeWoApp.LoggedOnUser.HasRight(UserRightType.Mitarbeiterstundenkonto_ViewAll) && !BeWoApp.LoggedOnUser.HasRight(UserRightType.Mitarbeiterstundenkonto_ViewSelf) && !BeWoApp.LoggedOnUser.HasRight(UserRightType.Mitarbeiterstundenkonto_ViewTeams)))
|
|
{
|
|
//Aachener Verein
|
|
tabitem_makonto.Visibility = Visibility.Collapsed;
|
|
}
|
|
|
|
if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.Jahresbericht))
|
|
{
|
|
tabitem_annualReport.Visibility = Visibility.Collapsed;
|
|
}
|
|
if (BeWoApp.Mandator.AllowSbd)
|
|
{
|
|
//tabitem_serviceOverview.Visibility = Visibility.Collapsed;
|
|
tabitem_stundenzettelOverview.Visibility = Visibility.Visible;
|
|
}
|
|
else
|
|
{
|
|
tabitem_stundenzettelOverview.Visibility = Visibility.Collapsed;
|
|
}
|
|
|
|
if (BeWoApp.AppSettings.ShowPivotGrid)
|
|
{
|
|
tabitem_flexibleReport.Visibility = Visibility.Visible;
|
|
}
|
|
else
|
|
{
|
|
tabitem_flexibleReport.Visibility = Visibility.Collapsed;
|
|
}
|
|
if (BeWoApp.AppSettings.ShowDienstplanung)
|
|
{
|
|
tabitem_dienstPlaner.Visibility = Visibility.Visible;
|
|
}
|
|
else
|
|
{
|
|
tabitem_dienstPlaner.Visibility = Visibility.Collapsed;
|
|
}
|
|
if (BeWoApp.AppSettings.ShowUrlaubsplanung)
|
|
{
|
|
tabitem_abwesenheitsTabelle.Visibility = Visibility.Visible;
|
|
}
|
|
else
|
|
{
|
|
tabitem_abwesenheitsTabelle.Visibility = Visibility.Collapsed;
|
|
}
|
|
|
|
tabitem_RatingAnalysis.Visibility = Visibility.Visible;
|
|
|
|
|
|
if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.Analysis_ServiceOverview_View))
|
|
{
|
|
this.tabitem_serviceOverview.Visibility = Visibility.Collapsed;
|
|
}
|
|
|
|
if(!(BeWoApp.LoggedOnUser.HasRight(UserRightType.ViewAll) || BeWoApp.LoggedOnUser.HasRight(UserRightType.CustomerView_View) || BeWoApp.LoggedOnUser.HasRight(UserRightType.Customer_ViewMyCustomers) || BeWoApp.LoggedOnUser.HasRight(UserRightType.Customer_ViewMyTeams)))
|
|
{
|
|
TabItemKilometerauswertung.Visibility = Visibility.Collapsed;
|
|
}
|
|
|
|
// if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.Analysis_Settlement_View))
|
|
// tabitem_settlement.Visibility = Visibility.Collapsed;
|
|
|
|
#if DEBUG
|
|
tabitem_serviceOverview.Visibility = Visibility.Visible;
|
|
tabitem_abwesenheitsTabelle.Visibility = Visibility.Visible;
|
|
tabitem_dienstPlaner.Visibility = Visibility.Visible;
|
|
#endif
|
|
}
|
|
|
|
private void Show(TabItem pTi)
|
|
{
|
|
foreach (var i in this.OpenViews)
|
|
{
|
|
i.Key.Content = null;
|
|
}
|
|
|
|
foreach (var i in this.OpenViews)
|
|
{
|
|
if (i.Key == pTi)
|
|
{
|
|
pTi.Content = this.OpenViews[pTi];
|
|
}
|
|
//else
|
|
//{
|
|
// i.Key.Content = null;
|
|
//}
|
|
}
|
|
}
|
|
|
|
private void tabitem_flsReport_Selected(object sender, RoutedEventArgs e)
|
|
{
|
|
if (!this.OpenViews.ContainsKey(this.tabitem_flsReport))
|
|
{
|
|
this.OpenViews[this.tabitem_flsReport] = new BeWo.View.Report.FLSReport.FLSReportView();
|
|
}
|
|
|
|
this.Show(this.tabitem_flsReport);
|
|
}
|
|
|
|
private void tabitem_Mitarbeiter_Selected(object sender, RoutedEventArgs e)
|
|
{
|
|
if (!OpenViews.ContainsKey(tabitem_Mitarbeiter))
|
|
OpenViews[tabitem_Mitarbeiter] = new BeWo.View.Report.MitarbeiterKoelnRing.FLSReportView();
|
|
Show(tabitem_Mitarbeiter);
|
|
}
|
|
|
|
private void tabitem_maReport_Selected(object sender, RoutedEventArgs e)
|
|
{
|
|
if (!OpenViews.ContainsKey(tabitem_maReport))
|
|
OpenViews[tabitem_maReport] = new AuslastungReportView2();
|
|
Show(tabitem_maReport);
|
|
}
|
|
|
|
private void tabitem_maKonto_Selected(object sender, RoutedEventArgs e)
|
|
{
|
|
if (!OpenViews.ContainsKey(tabitem_makonto))
|
|
OpenViews[tabitem_makonto] = new EmployeeHourReportView();
|
|
Show(tabitem_makonto);
|
|
}
|
|
|
|
private void tabitem_abwesenheitsTabelle_Selected(object sender, RoutedEventArgs e)
|
|
{
|
|
if (!OpenViews.ContainsKey(tabitem_abwesenheitsTabelle))
|
|
OpenViews[tabitem_abwesenheitsTabelle] = new AbwesenheitstabelleView();
|
|
Show(tabitem_abwesenheitsTabelle);
|
|
}
|
|
|
|
private void tabitem_dienstPlaner_Selected(object sender, RoutedEventArgs e)
|
|
{
|
|
if (!OpenViews.ContainsKey(tabitem_dienstPlaner))
|
|
OpenViews[tabitem_dienstPlaner] = new DienstplanerView();
|
|
Show(tabitem_dienstPlaner);
|
|
}
|
|
|
|
private void tabitem_queries_Selected(object sender, RoutedEventArgs e)
|
|
{
|
|
if (!OpenViews.ContainsKey(tabitem_queries))
|
|
{
|
|
ServiceFacade.DoQueryServiceAsync(
|
|
s => s.GetAllQueriesOfType(QueryType.Public),
|
|
r => this.Dispatch(
|
|
delegate
|
|
{
|
|
OpenViews[tabitem_queries] = new QueryView(r);
|
|
Show(tabitem_queries);
|
|
}));
|
|
}
|
|
else
|
|
{
|
|
Show(tabitem_queries);
|
|
}
|
|
}
|
|
|
|
private void tabitem_accountingreport_Selected(object sender, RoutedEventArgs e)
|
|
{
|
|
//if (!_OpenViews.ContainsKey(tabitem_accountingreport))
|
|
// _OpenViews[tabitem_accountingreport] = new AccountingReportView();
|
|
//Show(tabitem_accountingreport);
|
|
}
|
|
|
|
private void tabitem_serviceOverview_Selected(object sender, RoutedEventArgs e)
|
|
{
|
|
if (!this.OpenViews.ContainsKey(this.tabitem_serviceOverview))
|
|
{
|
|
this.OpenViews[this.tabitem_serviceOverview] = new ServicesReportView();
|
|
}
|
|
|
|
this.Show(this.tabitem_serviceOverview);
|
|
}
|
|
|
|
private void tabitem_stundenzettelOverview_Selected(object sender, RoutedEventArgs e)
|
|
{
|
|
if (!this.OpenViews.ContainsKey(this.tabitem_stundenzettelOverview))
|
|
{
|
|
this.OpenViews[this.tabitem_stundenzettelOverview] = new TimeSheetMailView();
|
|
}
|
|
|
|
this.Show(this.tabitem_stundenzettelOverview);
|
|
}
|
|
|
|
private void tabitem_flexibleReport_Selected(object sender, RoutedEventArgs e)
|
|
{
|
|
if (!this.OpenViews.ContainsKey(this.tabitem_flexibleReport))
|
|
{
|
|
this.OpenViews[this.tabitem_flexibleReport] = new FlexibleReportView();
|
|
}
|
|
|
|
this.Show(this.tabitem_flexibleReport);
|
|
}
|
|
|
|
|
|
private void tabitem_supportConceptAnalysis_Selected(object sender, RoutedEventArgs e)
|
|
{
|
|
if (!this.OpenViews.ContainsKey(this.tabitem_supportConceptAnalysis))
|
|
{
|
|
ServiceFacade.DoAnalysisServiceAsync(
|
|
s => s.GetSupportConceptAnalysis(BeWoApp.LoggedOnUser.Employee.EmployeeOid, true, false, null),
|
|
r => this.Dispatch(
|
|
delegate
|
|
{
|
|
this.OpenViews[this.tabitem_supportConceptAnalysis] = new SupportConceptsAnalysisView(r.OrderBy(o => o.CustomerLastName + ", " + o.CustomerFirstName).GroupBy(so => so.CustomerLastName + ", " + so.CustomerFirstName).ToDictionary(g => g.Key, g => g.ToList()));
|
|
|
|
// _OpenViews[tabitem_supportConceptAnalysis] = new SupportConceptsAnalysisView(r
|
|
// .GroupBy(so => so.CustomerLastName + ", " + so.CustomerFirstName)
|
|
// .ToDictionary(g => g.Key, g => g.ToList()));
|
|
this.Show(this.tabitem_supportConceptAnalysis);
|
|
}));
|
|
}
|
|
else
|
|
{
|
|
this.Show(this.tabitem_supportConceptAnalysis);
|
|
}
|
|
}
|
|
|
|
private void tabitem_RatingAnalysis_Selected(object sender, RoutedEventArgs e)
|
|
{
|
|
if (!this.OpenViews.ContainsKey(this.tabitem_RatingAnalysis))
|
|
{
|
|
this.OpenViews[this.tabitem_RatingAnalysis] = new RatingReportView();
|
|
}
|
|
|
|
this.Show(this.tabitem_RatingAnalysis);
|
|
}
|
|
|
|
private void tabitem_annualReport_Selected(object sender, RoutedEventArgs e)
|
|
{
|
|
if (!this.OpenViews.ContainsKey(this.tabitem_annualReport))
|
|
{
|
|
this.OpenViews[this.tabitem_annualReport] = new AnnualReportView();
|
|
}
|
|
|
|
this.Show(this.tabitem_annualReport);
|
|
|
|
}
|
|
|
|
private void TabItemKilometerauswertung_OnSelected(object sender, RoutedEventArgs e)
|
|
{
|
|
if(!OpenViews.ContainsKey(TabItemKilometerauswertung))
|
|
{
|
|
OpenViews[TabItemKilometerauswertung] = new KilometerauslastungsView();
|
|
}
|
|
|
|
Show(TabItemKilometerauswertung);
|
|
}
|
|
}
|
|
} |