Merge branch 'master' of ssh://float.beyondsoft.de/git/beyondSoft/BeWo

# Conflicts:
#	BeWo/ServiceProxy/Generated.cs
#	Host/Multitenancy/demo.config
This commit is contained in:
Christian
2020-10-12 13:37:29 +02:00
48 changed files with 4336 additions and 2425 deletions

View File

@@ -645,7 +645,7 @@ namespace BeWo.Scheduler.ViewModel
{
var unavailableResources = new List<ResourceDC>();
ServiceFacade.DoResourceServiceSync(s => unavailableResources = s.CheckResourceAvailability(vm.Start, vm.End, vm.ResourceList.Select(resource => resource.ResourceOid.Value).ToList(), null));
ServiceFacade.DoResourceServiceSync(s => unavailableResources = s.CheckResourceAvailability(vm.Start, vm.End, vm.ResourceList.Select(resource => resource.ResourceOid.Value).ToList(), vm.DataContract?.SchedulerAppointmentOid));
if(unavailableResources.Any())
{

File diff suppressed because it is too large Load Diff

View File

@@ -14,6 +14,8 @@
xmlns:dxpbars="http://schemas.devexpress.com/winfx/2008/xaml/printing/bars"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
d:DesignHeight="450" d:DesignWidth="800"
Initialized="KilometerauslastungsView_OnInitialized"
Width="Auto" Height="Auto" d:DataContext="{d:DesignData KilometerauslastungsView}">
<GroupBox Style="{StaticResource ObjectEditGroupBox}" Header="Kilometerauswertung">
@@ -30,20 +32,26 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<CheckBox Grid.Column="0" Grid.Row="0" Margin="3" x:Name="AllCustomersCheckBox" VerticalAlignment="Center" VerticalContentAlignment="Center" Content="Alle Klienten" Checked="AllCustomersCheckBox_OnCheckedChanged" Unchecked="AllCustomersCheckBox_OnCheckedChanged"></CheckBox>
<RadioButton x:Name="CustomerKmReportRadioButton" Grid.Column="0" Grid.Row="0" Margin="3" VerticalAlignment="Center" VerticalContentAlignment="Center" Content="Nach Klient" GroupName="ReportTypeRadioGroup" Checked="ToggleButton_OnChecked" />
<RadioButton x:Name="EmployeeKmReportRadioButton" Grid.Column="1" Grid.Row="0" Margin="3" VerticalAlignment="Center" VerticalContentAlignment="Center" Content="Nach Mitarbeiter" GroupName="ReportTypeRadioGroup" Checked="ToggleButton_OnChecked" />
<controls:PopUpEdit Grid.Column="1" Visibility="{Binding ElementName=AllCustomersCheckBox, Path=IsChecked, Converter={StaticResource BoolVisibilityConverter}, ConverterParameter=false}" Text="{Binding Path=SelectedCustomer.SimpleDescription, UpdateSourceTrigger=PropertyChanged, Mode=OneWay}" Grid.ColumnSpan="3" Grid.Row="0" Margin="3" PopUpClick="PopUpEdit_OnPopUpClick" Height="22" Cursor="Arrow" DeleteButtonVisibility="Collapsed" HorizontalAlignment="Stretch" />
<CheckBox Grid.Column="0" Grid.Row="1" Margin="3" x:Name="AllCustomersCheckBox" VerticalAlignment="Center" VerticalContentAlignment="Center" Content="Alle Klienten" Checked="AllCustomersCheckBox_OnCheckedChanged" Unchecked="AllCustomersCheckBox_OnCheckedChanged" />
<controls:PopUpEdit Grid.Column="1" x:Name="CustomerPopUpEdit" Visibility="{Binding Path=CustomerPopUpEditVisibility, UpdateSourceTrigger=PropertyChanged}" Text="{Binding Path=SelectedCustomer.SimpleDescription, UpdateSourceTrigger=PropertyChanged, Mode=OneWay}" Grid.ColumnSpan="3" Grid.Row="1" Margin="3" PopUpClick="CustomersPopUpEdit_OnPopUpClick" Height="22" Cursor="Arrow" DeleteButtonVisibility="Collapsed" HorizontalAlignment="Stretch" />
<Label Grid.Column="0" Grid.Row="1" Margin="3" Content="Monat:" />
<ComboBox Height="22" x:Name="ComboBoxMonth" ItemsSource="{Binding Path=MonthNames, UpdateSourceTrigger=PropertyChanged}" SelectedIndex="{Binding Path=SelectedMonthIndex, UpdateSourceTrigger=PropertyChanged}" Grid.Row="1" Grid.Column="1" Margin="3" HorizontalAlignment="Left" Width="90" />
<CheckBox Grid.Column="0" Grid.Row="1" Margin="3" x:Name="AllEmployeesCheckBox" VerticalAlignment="Center" VerticalContentAlignment="Center" Content="Alle Mitarbeiter" Checked="AllEmployeesCheckBox_OnChecked" Unchecked="AllEmployeesCheckBox_OnChecked" Visibility="Collapsed" />
<controls:PopUpEdit Grid.Column="1" x:Name="EmployeePopUpEdit" Visibility="{Binding Path=EmployeePopUpEditVisibility, UpdateSourceTrigger=PropertyChanged}" Text="{Binding Path=SelectedEmployee.SimpleDescription, UpdateSourceTrigger=PropertyChanged, Mode=OneWay}" Grid.ColumnSpan="3" Grid.Row="1" Margin="3" PopUpClick="EmployeesPopUpEdit_OnPopUpClick" Height="22" Cursor="Arrow" DeleteButtonVisibility="Collapsed" HorizontalAlignment="Stretch" />
<Label Grid.Column="2" Grid.Row="1" Margin="3" Content="Jahr:" />
<ComboBox Height="22" x:Name="ComboBoxYear" ItemsSource="{Binding Path=Years, UpdateSourceTrigger=PropertyChanged}" SelectedIndex="{Binding Path=SelectedYearIndex, UpdateSourceTrigger=PropertyChanged}" Grid.Row="1" Grid.Column="3" Margin="3" Width="90"></ComboBox>
<Label Grid.Column="0" Grid.Row="2" Margin="3" Content="Monat:" />
<ComboBox Height="22" x:Name="ComboBoxMonth" ItemsSource="{Binding Path=MonthNames, UpdateSourceTrigger=PropertyChanged}" SelectedIndex="{Binding Path=SelectedMonthIndex, UpdateSourceTrigger=PropertyChanged}" Grid.Row="2" Grid.Column="1" Margin="3" HorizontalAlignment="Left" Width="90" />
<Button x:Name="ButtonGenerate" HorizontalAlignment="Left" Click="ButtonGenerate_OnClick" Grid.Column="0" Grid.Row="2" Margin="2,15,2,2" Content="Erstellen" Height="22" IsEnabled="{Binding Path=IsCreateButtonEnabled, UpdateSourceTrigger=PropertyChanged}" />
<Label Grid.Column="2" Grid.Row="2" Margin="3" Content="Jahr:" />
<ComboBox Height="22" x:Name="ComboBoxYear" ItemsSource="{Binding Path=Years, UpdateSourceTrigger=PropertyChanged}" SelectedIndex="{Binding Path=SelectedYearIndex, UpdateSourceTrigger=PropertyChanged}" Grid.Row="2" Grid.Column="3" Margin="3" Width="90"></ComboBox>
<Button x:Name="ButtonGenerate" HorizontalAlignment="Left" Click="ButtonGenerate_OnClick" Grid.Column="0" Grid.Row="3" Margin="2,15,2,2" Content="Erstellen" Height="22" IsEnabled="{Binding Path=IsCreateButtonEnabled, UpdateSourceTrigger=PropertyChanged}" />
<dxp:DocumentPreviewControl x:Name="DocumentPreviewControl" Grid.Row="4" Grid.ColumnSpan="5" Grid.Column="0" Visibility="Collapsed" CommandBarStyle="Bars" dx:ThemeManager.ThemeName="Office2010Black">
<dxp:DocumentPreviewControl.CommandProvider>
@@ -68,9 +76,12 @@
</dxp:DocumentPreviewControl.CommandProvider>
</dxp:DocumentPreviewControl>
<Popup x:Name="CustomerSearchViewPopup" Grid.Column="0" Grid.Row="4" Grid.ColumnSpan="5" Margin="10" StaysOpen="False" Placement="MousePoint" Width="400">
<Popup x:Name="CustomerSearchViewPopup" Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="5" Margin="10" StaysOpen="False" Placement="MousePoint" Width="400">
<localSearchView:CustomerSearchView ItemSelected="CustomerSearchViewPopup_CustomerSelected" />
</Popup>
<Popup x:Name="EmployeeSearchViewPopup" Visibility="{Binding Path=EmployeePopUpEditVisibility, UpdateSourceTrigger=PropertyChanged}" Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="5" Margin="10" StaysOpen="False" Placement="MousePoint" Width="400">
<localSearchView:EmployeeSearchView ItemSelected="EmployeeSearchViewPopup_EmployeeSelected" x:Name="EmployeeSearchView" />
</Popup>
</Grid>
</GroupBox>
</localView:BeWoView>

View File

@@ -6,13 +6,10 @@ using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Windows;
using System.Windows.Controls;
using BeWo.Annotations;
using BeWo.Core;
using BeWo.Core.Service;
using BeWo.ServiceProxy;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
using ChatController.Utilities.Extensions;
using DevExpress.Xpf.Core;
@@ -22,11 +19,24 @@ namespace BeWo.View.Report.Kilometerauswertung
{
public partial class KilometerauslastungsView : INotifyPropertyChanged
{
public bool IsCreateButtonEnabled => _ShouldDoListReport || _SelectedCustomer != null;
public bool IsCreateButtonEnabled => ShouldDoListReport || _ReportType == KilometerauslastungsType.Customer && _SelectedCustomer != null || _ReportType == KilometerauslastungsType.Employee && _SelectedEmployee != null;
private List<CompactCustomerDC> AllCustomers { get; set; } = new List<CompactCustomerDC>();
private bool _ShouldDoListReport;
private List<CompactEmployeeDC> AllEmployees { get; set; } = new List<CompactEmployeeDC>();
public bool ShouldDoListReport
{
get
{
if(_ReportType == KilometerauslastungsType.Customer)
{
return AllCustomersCheckBox.IsChecked.HasValue && AllCustomersCheckBox.IsChecked.Value;
}
return AllEmployeesCheckBox.IsChecked.HasValue && AllEmployeesCheckBox.IsChecked.Value;
}
}
private CompactCustomerDC _SelectedCustomer;
public CompactCustomerDC SelectedCustomer
@@ -49,6 +59,27 @@ namespace BeWo.View.Report.Kilometerauswertung
}
}
private CompactEmployeeDC _SelectedEmployee;
public CompactEmployeeDC SelectedEmployee
{
get => _SelectedEmployee;
set
{
if(!Equals(_SelectedEmployee, value))
{
_SelectedEmployee = value;
if(value != null)
{
OnPropertyChanged(nameof(IsCreateButtonEnabled));
}
OnPropertyChanged(nameof(SelectedEmployee));
}
}
}
public List<string> MonthNames => DateTimeFormatInfo.CurrentInfo?.MonthNames.Where(s => !string.IsNullOrEmpty(s)).ToList();
private int _SelectedMonthIndex;
@@ -102,6 +133,9 @@ namespace BeWo.View.Report.Kilometerauswertung
}
}
private KilometerauslastungsType _ReportType = KilometerauslastungsType.Customer;
public KilometerauslastungsView()
{
InitializeComponent();
@@ -114,28 +148,23 @@ namespace BeWo.View.Report.Kilometerauswertung
InitYearComboBox();
ServiceFacade.DoCustomerServiceAsync(s => s.GetAllActiveCustomersCompact(false, BeWoApp.LoggedOnEmployeeOid), allCustomers =>
ServiceFacade.DoEmployeeServiceAsync(s => s.GetActiveCompactCustomersForEmployee(BeWoApp.LoggedOnEmployeeOid), allCustomers =>
{
this.Dispatch(() =>
{
if(BeWoApp.LoggedOnUser.HasRight(UserRightType.ViewAll) || BeWoApp.LoggedOnUser.HasRight(UserRightType.CustomerView_View))
{
AllCustomers = allCustomers;
}
else
{
if(BeWoApp.LoggedOnUser.HasRight(UserRightType.Customer_ViewMyTeams))
{
AllCustomers = allCustomers.Where(customer => customer.IsRelatedToTeam || customer.IsRelatedToEmployee).ToList();
}
else if(BeWoApp.LoggedOnUser.HasRight(UserRightType.Customer_ViewMyCustomers))
{
AllCustomers = allCustomers.Where(customer => customer.IsRelatedToEmployee).ToList();
}
}
AllCustomers = allCustomers;
});
});
ServiceFacade.DoEmployeeServiceAsync(s => s.GetActiveCompactEmployeesForEmployee(BeWoApp.LoggedOnEmployeeOid.Value), allEmployees =>
{
this.Dispatch(() =>
{
AllEmployees = allEmployees;
});
});
// DevExpress
ThemeManager.SetTheme(BeWoApp.CurrentBeWo.MainWindow, Theme.Office2010Black);
Unloaded += delegate
@@ -156,11 +185,16 @@ namespace BeWo.View.Report.Kilometerauswertung
Years = years;
}
private void PopUpEdit_OnPopUpClick(object sender, RoutedEventArgs e)
private void CustomersPopUpEdit_OnPopUpClick(object sender, RoutedEventArgs e)
{
CustomerSearchViewPopup.IsOpen = true;
}
private void EmployeesPopUpEdit_OnPopUpClick(object sender, RoutedEventArgs e)
{
EmployeeSearchViewPopup.IsOpen = true;
}
private void CustomerSearchViewPopup_CustomerSelected(object sender, EventArgs<CompactCustomerDC> e)
{
SelectedCustomer = e.Data;
@@ -181,30 +215,28 @@ namespace BeWo.View.Report.Kilometerauswertung
var rangeDate = new DateTime(selectedYear, SelectedMonthIndex + 1, 1);
//var end = rangeDate.AddMonths(1).AddDays(-1);
//var timeSpan = new DateTimeSpan(rangeDate, end);
//var customerOids = _ShouldDoListReport ? AllCustomers.Select(customer => customer.CustomerOid).ToList() : new List<long> {SelectedCustomer.CustomerOid};
//ServiceFacade.DoReportServiceAsync(rs => rs.CheckForAnyServiceRecordsWithDistanceValues(customerOids, timeSpan), hasAny =>
//{
// if(hasAny)
// {
if(_ShouldDoListReport)
{
ServiceFacade.DoReportServiceAsync(s => s.CreateKilometerauswertungForAllCustomers(AllCustomers.Select(customer => customer.CustomerOid).ToList(), rangeDate), ShowReport, true);
}
else
{
ServiceFacade.DoReportServiceAsync(s => s.CreateKilometerauswertung(SelectedCustomer.CustomerOid, rangeDate), ShowReport, true);
}
// }
// else
// {
// this.Dispatch(() => { MessageBox.Show("Der ausgewählte Zeitraum enthält keinerlei Buchungen mit Angaben zu gefahreren Kilometern", "Kilometerauswertung", MessageBoxButton.OK, MessageBoxImage.Warning); });
// }
// });
if(ShouldDoListReport)
{
if(_ReportType == KilometerauslastungsType.Customer)
{
ServiceFacade.DoReportServiceAsync(s => s.CreateKilometerauswertungForAllCustomers(AllCustomers.Select(customer => customer.CustomerOid).ToList(), rangeDate), ShowReport, true);
}
else
{
ServiceFacade.DoReportServiceAsync(s => s.CreateKilometerauswertungForAllEmployees(AllEmployees.Select(employee => employee.EmployeeOid).ToList(), rangeDate), ShowReport, true);
}
}
else
{
if(_ReportType == KilometerauslastungsType.Customer)
{
ServiceFacade.DoReportServiceAsync(s => s.CreateKilometerauswertung(SelectedCustomer.CustomerOid, rangeDate), ShowReport, true);
}
else
{
ServiceFacade.DoReportServiceAsync(s => s.CreateEmployeeKilometerauswertung(SelectedEmployee.EmployeeOid, rangeDate), ShowReport, true);
}
}
}
private void ShowReport(MemoryStream reportStream)
@@ -237,8 +269,78 @@ namespace BeWo.View.Report.Kilometerauswertung
private void AllCustomersCheckBox_OnCheckedChanged(object sender, RoutedEventArgs e)
{
_ShouldDoListReport = AllCustomersCheckBox.IsChecked.HasValue && AllCustomersCheckBox.IsChecked.Value;
CustomerPopUpEdit.Visibility = ShouldDoListReport ? Visibility.Hidden : Visibility.Visible;
EmployeePopUpEdit.Visibility = Visibility.Collapsed;
OnPropertyChanged(nameof(IsCreateButtonEnabled));
OnPropertyChanged(nameof(ShouldDoListReport));
}
private void ToggleButton_OnChecked(object sender, RoutedEventArgs e)
{
var radioButton = (RadioButton) sender;
switch(radioButton.Name)
{
case "CustomerKmReportRadioButton":
_ReportType = KilometerauslastungsType.Customer;
break;
case "EmployeeKmReportRadioButton":
_ReportType = KilometerauslastungsType.Employee;
break;
}
SetVisibilityValues();
}
private void AllEmployeesCheckBox_OnChecked(object sender, RoutedEventArgs e)
{
EmployeePopUpEdit.Visibility = ShouldDoListReport ? Visibility.Hidden : Visibility.Visible;
CustomerPopUpEdit.Visibility = Visibility.Collapsed;
OnPropertyChanged(nameof(IsCreateButtonEnabled));
OnPropertyChanged(nameof(ShouldDoListReport));
}
private void EmployeeSearchViewPopup_EmployeeSelected(object sender, EventArgs<CompactEmployeeDC> e)
{
SelectedEmployee = e.Data;
EmployeeSearchViewPopup.IsOpen = false;
}
private void SetVisibilityValues()
{
if(_ReportType == KilometerauslastungsType.Customer)
{
EmployeeSearchViewPopup.Visibility = Visibility.Collapsed;
AllEmployeesCheckBox.Visibility = Visibility.Collapsed;
EmployeePopUpEdit.Visibility = Visibility.Collapsed;
CustomerSearchViewPopup.Visibility = Visibility.Visible;
AllCustomersCheckBox.Visibility = Visibility.Visible;
CustomerSearchViewPopup.Visibility = Visibility.Visible;
}
else
{
CustomerSearchViewPopup.Visibility = Visibility.Collapsed;
AllCustomersCheckBox.Visibility = Visibility.Collapsed;
CustomerSearchViewPopup.Visibility = Visibility.Collapsed;
EmployeeSearchViewPopup.Visibility = Visibility.Visible;
AllEmployeesCheckBox.Visibility = Visibility.Visible;
EmployeePopUpEdit.Visibility = Visibility.Visible;
}
}
private void KilometerauslastungsView_OnInitialized(object sender, EventArgs e)
{
CustomerKmReportRadioButton.IsChecked = true;
}
}
public enum KilometerauslastungsType
{
Customer,
Employee
}
}

View File

@@ -386,6 +386,7 @@
<Content Include="Scripts\umd\popper-utils.min.js" />
<Content Include="Scripts\umd\popper.js" />
<Content Include="Scripts\umd\popper.min.js" />
<Content Include="Scripts\utils\trimCanvas.js" />
<Content Include="Scripts\utils\dateUtils.js" />
<Content Include="Scripts\view-scripts\report.js" />
<Content Include="Scripts\view-scripts\scheduler.js" />
@@ -606,7 +607,7 @@
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>False</UseIIS>
<UseIIS>True</UseIIS>
<AutoAssignPort>False</AutoAssignPort>
<DevelopmentServerPort>8808</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>

View File

@@ -16,7 +16,7 @@ namespace BeWoPlanerMobil.Controllers
protected readonly IValueListService ValueListService = new MobileSessionFacade().ValueListService;
protected readonly IResourceService KalenderService = new MobileSessionFacade().ResourceService;
protected readonly IUserService UserService = new MobileSessionFacade().UserService;
protected const string _LeerzeichenFuerGetMethoden = " ";
protected const string _LeerzeichenFuerGetMethoden = " ";
protected static readonly log4net.ILog Log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

View File

@@ -23,7 +23,7 @@ namespace BeWoPlanerMobil.Controllers
{
if (!MobileSessionFacade.IsUserLoggedIn())
{
RedirectToActionPermanent("Index", "Login");
Logout();
return null;
}
@@ -46,7 +46,7 @@ namespace BeWoPlanerMobil.Controllers
{
if (!MobileSessionFacade.IsUserLoggedIn() || Request.Browser.Browser.Equals("InternetExplorer"))
{
return RedirectToActionPermanent("Index", "Login");
return Logout();
}
InitViewModel();
@@ -77,7 +77,7 @@ namespace BeWoPlanerMobil.Controllers
{
if (!MobileSessionFacade.IsUserLoggedIn() || Request.Browser.Browser.Equals("InternetExplorer"))
{
return RedirectToActionPermanent("Index", "Login");
return Logout();
}
InitViewModel();
@@ -99,7 +99,7 @@ namespace BeWoPlanerMobil.Controllers
{
if (Model == null)
{
return RedirectToActionPermanent("Index", "Login");
return Logout();
}
var selectedCustomerOidString = formCollection[FormCollectionConstants.SelectedCustomerOidKey];

View File

@@ -2,11 +2,9 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using System.Web.UI.WebControls.WebParts;
using System.Windows.Forms;
using BeWo.Service.ServiceImplementations;
@@ -240,7 +238,7 @@ namespace BeWoPlanerMobil.Controllers
{
if (Model == null)
{
return RedirectToActionPermanent("Index", "Login");
return Logout();
}
var newValue = "true,false" == collection[FormCollectionConstants.ShowOnlyOwnSupportConceptsKey];
@@ -256,7 +254,7 @@ namespace BeWoPlanerMobil.Controllers
{
if (Model == null)
{
return RedirectToActionPermanent("Index", "Login");
return Logout();
}
var newValue = "true,false" == pCollection[FormCollectionConstants.ShowExpiredSupportConceptsKey];
@@ -271,7 +269,7 @@ namespace BeWoPlanerMobil.Controllers
{
if (Model == null)
{
return RedirectToActionPermanent("Index", "Login");
return Logout();
}
var userSettings = GetUser().Settings;
@@ -356,7 +354,7 @@ namespace BeWoPlanerMobil.Controllers
{
if((!Model.CostBearer2SupportConceptOid.HasValue || Model.CostBearer2SupportConceptOid.Value > 0) && Model.SelectedSupportConcept == null)
{
RedirectToActionPermanent("Index", "Login");
Logout();
return null;
}
@@ -457,7 +455,7 @@ namespace BeWoPlanerMobil.Controllers
var settings = user?.SettingList.FirstOrDefault(f => f.Type.Equals(SettingsType.ApplicationSettings));
return settings != null ? MobileUtils.GetSettingValue(settings.Value, key) : null;
return settings != null ? GetSettingValue(settings.Value, key) : null;
}
[Authorize]
@@ -467,7 +465,7 @@ namespace BeWoPlanerMobil.Controllers
{
if (Model == null)
{
RedirectToActionPermanent("Index", "Login");
Logout();
return _LeerzeichenFuerGetMethoden;
}
@@ -494,7 +492,7 @@ namespace BeWoPlanerMobil.Controllers
{
if (Model == null)
{
RedirectToActionPermanent("Index", "Login");
Logout();
return _LeerzeichenFuerGetMethoden;
}
@@ -530,6 +528,7 @@ namespace BeWoPlanerMobil.Controllers
{
if (Model == null || string.IsNullOrWhiteSpace(Model.SignatureImage))
{
Logout();
return;
}
@@ -572,8 +571,8 @@ namespace BeWoPlanerMobil.Controllers
{
if (Model == null)
{
RedirectToActionPermanent("Index", "Login");
return _LeerzeichenFuerGetMethoden;
Logout();
return _LeerzeichenFuerGetMethoden;
}
try
@@ -599,7 +598,7 @@ namespace BeWoPlanerMobil.Controllers
{
if (Model == null)
{
RedirectToActionPermanent("Index", "Login");
Logout();
return _LeerzeichenFuerGetMethoden;
}
@@ -613,7 +612,7 @@ namespace BeWoPlanerMobil.Controllers
var textbausteine = OperationsService.GetAllTextModules();
foreach (var tm in textbausteine)
{
if (String.IsNullOrWhiteSpace(tm.Text))
if (string.IsNullOrWhiteSpace(tm.Text))
{
tm.Text = tm.Name;
}
@@ -667,7 +666,7 @@ namespace BeWoPlanerMobil.Controllers
{
if (Model == null)
{
RedirectToActionPermanent("Index", "Login");
Logout();
return _LeerzeichenFuerGetMethoden;
}
@@ -684,7 +683,7 @@ namespace BeWoPlanerMobil.Controllers
{
if(Model == null)
{
return RedirectToActionPermanent("Index", "Login");
return Logout();
}
string doku1;
@@ -1304,7 +1303,7 @@ namespace BeWoPlanerMobil.Controllers
{
if(Model == null)
{
return RedirectToActionPermanent("Index", "Login");
return Logout();
}
long? cb2ScOid = Convert.ToInt64(formCollection[FormCollectionConstants.CostBearer2SupportConceptOidKey]);
@@ -1373,7 +1372,7 @@ namespace BeWoPlanerMobil.Controllers
{
if (Model == null)
{
return RedirectToActionPermanent("Index", "Login");
return Logout();
}
Model.ServiceRecordOidToDelete = long.Parse(formCollection[FormCollectionConstants.ServiceRecordOidHolderKey]);
@@ -1400,7 +1399,7 @@ namespace BeWoPlanerMobil.Controllers
{
if (Model == null)
{
RedirectToActionPermanent("Index", "Login");
Logout();
return _LeerzeichenFuerGetMethoden;
}
@@ -1431,7 +1430,7 @@ namespace BeWoPlanerMobil.Controllers
{
if (Model == null)
{
RedirectToActionPermanent("Index", "Login");
Logout();
return _LeerzeichenFuerGetMethoden;
}
@@ -1445,7 +1444,7 @@ namespace BeWoPlanerMobil.Controllers
{
if (Model == null)
{
return RedirectToActionPermanent("Index", "Login");
return Logout();
}
var zeitraum = int.Parse(formCollection[FormCollectionConstants.RecordsKey]);
@@ -1465,7 +1464,7 @@ namespace BeWoPlanerMobil.Controllers
{
if (Model == null)
{
RedirectToActionPermanent("Index", "Login");
Logout();
return;
}
@@ -1498,7 +1497,7 @@ namespace BeWoPlanerMobil.Controllers
{
if(Model == null)
{
return RedirectToActionPermanent("Index", "Login");
return Logout();
}
var oidString = formCollection[FormCollectionConstants.ServiceRecordOidHolder2Key];
@@ -1547,7 +1546,7 @@ namespace BeWoPlanerMobil.Controllers
{
if (Model == null)
{
RedirectToActionPermanent("Index", "Login");
Logout();
return _LeerzeichenFuerGetMethoden;
}
@@ -1565,7 +1564,7 @@ namespace BeWoPlanerMobil.Controllers
{
if (Model == null)
{
RedirectToActionPermanent("Index", "Login");
Logout();
return _LeerzeichenFuerGetMethoden;
}
@@ -1579,7 +1578,7 @@ namespace BeWoPlanerMobil.Controllers
{
if (Model == null)
{
RedirectToActionPermanent("Index", "Login");
Logout();
return _LeerzeichenFuerGetMethoden;
}
@@ -1743,6 +1742,8 @@ namespace BeWoPlanerMobil.Controllers
var bookAfterSettlementInvoice = MobileSessionFacade.CheckForUserRight(UserRightType.BookServiceRecordAfterSettlementInvoice);
var bookServiceRecordOutOfSupportConcept = MobileSessionFacade.CheckForUserRight(UserRightType.BookServiceRecordOutOfSupportConcept);
// TODO: Prüfen, ob Stunden übertragbar sind. Wenn nicht, prüfen, ob nach Ausreizung des FLS-Zeitraums die Anzahl der FLS pro Zeitraum überschritten werden darf!
var newResult = new ValidationResult();
var exitLoop = false;
foreach (var sr2V in validationResults)
@@ -1867,7 +1868,7 @@ namespace BeWoPlanerMobil.Controllers
{
if (Model == null)
{
RedirectToActionPermanent("Index", "Login");
Logout();
return _LeerzeichenFuerGetMethoden;
}
@@ -1958,7 +1959,7 @@ namespace BeWoPlanerMobil.Controllers
{
if (Model == null)
{
return RedirectToActionPermanent("Index", "Login");
return Logout();
}
var isInGroupBookingMode = "true,false" == pFormCollection[FormCollectionConstants.IsInGroupBookingModeKey];
@@ -1978,7 +1979,7 @@ namespace BeWoPlanerMobil.Controllers
{
if (Model == null)
{
RedirectToActionPermanent("Index", "Login");
Logout();
return;
}
@@ -2036,7 +2037,7 @@ namespace BeWoPlanerMobil.Controllers
{
if (Model == null)
{
return RedirectToActionPermanent("Index", "Login");
return Logout();
}
Model.NewServiceRecord = new ServiceRecordDC();
@@ -2072,7 +2073,7 @@ namespace BeWoPlanerMobil.Controllers
{
if(Model == null)
{
RedirectToActionPermanent("Index", "Login");
Logout();
return _LeerzeichenFuerGetMethoden;
}
@@ -2142,7 +2143,7 @@ namespace BeWoPlanerMobil.Controllers
{
if(Model == null)
{
RedirectToActionPermanent("Index", "Login");
Logout();
return _LeerzeichenFuerGetMethoden;
}
@@ -2169,7 +2170,7 @@ namespace BeWoPlanerMobil.Controllers
{
if(Model == null)
{
RedirectToActionPermanent("Index", "Login");
Logout();
return _LeerzeichenFuerGetMethoden;
}
@@ -2198,7 +2199,7 @@ namespace BeWoPlanerMobil.Controllers
{
if(Model == null)
{
return RedirectToActionPermanent("Index", "Login");
return Logout();
}
var isParsingSuccessful2 = long.TryParse(pFormCollection[FormCollectionConstants.ServiceRecordOidHolder2Key], out var serviceRecordOid);
@@ -2239,7 +2240,7 @@ namespace BeWoPlanerMobil.Controllers
{
if(Model == null)
{
return RedirectToActionPermanent("Index", "Login");
return Logout();
}
if(Model.SelectedConceptCostBearerRelations.Count == 1)
@@ -2462,7 +2463,7 @@ namespace BeWoPlanerMobil.Controllers
{
if(Model == null)
{
return RedirectToActionPermanent("Index", "Login");
return Logout();
}
try
{

View File

@@ -1,11 +1,13 @@
using System;
using System.Linq;
using System.Web.Mvc;
using System.Web.Razor.Parser.SyntaxTree;
using BeWo.Report.ReportObjects;
using BeWoPlanerMobil.Models;
using BeWoPlanerMobil.Service;
using BeWoPlanerMobil.Util;
using BS.Shared.Core;
using BS.Shared.DataContracts;
using BS.Shared.Extensions;
namespace BeWoPlanerMobil.Controllers
@@ -53,13 +55,20 @@ namespace BeWoPlanerMobil.Controllers
{
if(!MobileSessionFacade.IsUserLoggedIn() || Request.Browser.Browser.Equals("InternetExplorer") || !AbstractModel.IsAllowedToSeeScheduler)
{
return RedirectToActionPermanent("Index", "Login");
return Logout();
}
var customers = EmployeeService.GetActiveCompactCustomersForEmployee(null);
Model.Customers = customers;
var kek = new ConfirmationReceiptSignatureDC();
OperationsService.InsertConfirmationReceiptSignature(kek);
var alle = OperationsService.GetAllConfirmationReceiptSignatures();
var test = OperationsService.GetConfirmationReceiptSignaturesByEmployee(1, new DateTimeSpan(new DateTime(2020, 1, 1), new DateTime(2020, 2, 1)));
return View(Model);
@@ -125,11 +134,36 @@ namespace BeWoPlanerMobil.Controllers
[Authorize]
[HttpPost]
public ActionResult CreateEmployeeSignatureForServiceOverview(FormCollection formCollection)
public string CreateEmployeeSignatureForServiceOverview(string base64SignatureString, string date)
{
if(Model == null)
{
Logout();
}
var confirmationReceiptSignature = new ConfirmationReceiptSignatureDC();
return RedirectToActionPermanent("Report");
var serviceRecordOids = Model.QuittierungsbelegItems.Select(item => item.ServiceRecordOid).ToList();
var serviceRecords = OperationsService.GetServiceRecordsByIds(serviceRecordOids);
confirmationReceiptSignature.ServiceRecords = serviceRecords;
confirmationReceiptSignature.EmployeeOid = Model.Employee.EmployeeOid;
using(var signatureBitmap = SignatureUtils.Base64StringToBitmap(base64SignatureString.Split(',')[1]))
{
var isValid = SignatureUtils.ValidateSignature(signatureBitmap);
if(!isValid)
{
return MobileUtils.SerializeObject("Das Unterschriftenfeld darf nicht leer sein.");
}
confirmationReceiptSignature.SignatureImage = base64SignatureString;
OperationsService.InsertConfirmationReceiptSignature(confirmationReceiptSignature);
}
return _LeerzeichenFuerGetMethoden;
}
}
}

View File

@@ -27,7 +27,7 @@ namespace BeWoPlanerMobil.Controllers
{
if (!MobileSessionFacade.IsUserLoggedIn())
{
RedirectToActionPermanent("Index", "Login");
Logout();
return null;
}
@@ -50,7 +50,7 @@ namespace BeWoPlanerMobil.Controllers
{
if (!MobileSessionFacade.IsUserLoggedIn() || Request.Browser.Browser.Equals("InternetExplorer") || !AbstractModel.IsAllowedToSeeScheduler)
{
return RedirectToActionPermanent("Index", "Login");
return Logout();
}
if(AbstractModel.HasRightToInsertRessourceAppointments)
@@ -187,7 +187,7 @@ namespace BeWoPlanerMobil.Controllers
{
if (Model == null)
{
RedirectToActionPermanent("Index", "Login");
Logout();
}
var rawStartDate = formCollection[FormCollectionConstants.AppointmentStartDateKey];
@@ -258,7 +258,7 @@ namespace BeWoPlanerMobil.Controllers
{
if (Model == null)
{
RedirectToActionPermanent("Index", "Login");
Logout();
}
Model.SelectedDate = Model.SelectedDate.AddDays(-1);
@@ -278,7 +278,7 @@ namespace BeWoPlanerMobil.Controllers
{
if(Model == null)
{
RedirectToActionPermanent("Index", "Login");
Logout();
}
Model.SelectedDate = Model.SelectedDate.AddDays(1);
@@ -297,7 +297,7 @@ namespace BeWoPlanerMobil.Controllers
public ActionResult SelectSchedulerDate(FormCollection formCollection) {
if (Model == null)
{
RedirectToActionPermanent("Index", "Login");
Logout();
}
var rawSchedulerDate = formCollection[FormCollectionConstants.AppointmentSchedulerDateKey];
@@ -349,6 +349,7 @@ namespace BeWoPlanerMobil.Controllers
{
if (Model == null)
{
Logout();
return null;
}
@@ -394,6 +395,7 @@ namespace BeWoPlanerMobil.Controllers
{
if(Model == null)
{
Logout();
return _LeerzeichenFuerGetMethoden;
}

View File

@@ -34,6 +34,6 @@ namespace BeWoPlanerMobil.Models
public static string TimeOfLastAction { get; set; }
public static bool HasRightToInsertRessourceAppointments => MobileSessionFacade.CheckForUserRight(UserRightType.KalenderRessourcentermineAnlegen) || MobileSessionFacade.CheckForUserRight(UserRightType.CreateAll);
public static bool IsAllowedToSeeBills => false;// MobileSessionFacade.CheckForUserRight(UserRightType.Analysis_ServiceOverview_View);
public static bool IsAllowedToSeeBills => false;//MobileSessionFacade.CheckForUserRight(UserRightType.Analysis_ServiceOverview_View);
}
}

View File

@@ -13,6 +13,9 @@ function hideSpinner() {
function showMessagePopup(title, message) {
$("#popupTitle").text(title);
if(message !== null) {
$("#modal-body").html("<p id=\"popupMessage\"></p>");
}
$("#popupMessage").text(message);
$("#messagePopup").modal(
@@ -25,6 +28,11 @@ function showMessagePopup(title, message) {
function showMessagePopupWithCallback(title, message, callback, executeCallbackByBothButtons) {
$("#popupTitle").text(title);
if (message !== null) {
$("#modal-body").html("<p id=\"popupMessage\"></p>");
}
$("#popupMessage").text(message);
$("#message-popup-ok-btn").on("click", function() {
@@ -32,8 +40,7 @@ function showMessagePopupWithCallback(title, message, callback, executeCallbackB
});
if (executeCallbackByBothButtons === true) {
$("#message-popup-close-btn").on("click",
function() {
$("#message-popup-close-btn").on("click", function() {
callback();
});
}
@@ -85,6 +92,9 @@ function isInArray(value, array) {
function showMessagePopupWithHtml(title, html) {
$("#popupTitle").text(title);
if(message !== null) {
$("#modal-body").html("<p id=\"popupMessage\"></p>");
}
$("#popupMessage").html(html);
$("#messagePopup").modal(
@@ -109,4 +119,37 @@ function hasEmptyRequiredFields(form) {
});
return count > 0;
}
function showAboutPopup() {
// Auf deutsch?
var text = "SignaturePad:<br/>Copyright (c) 2018 Szymon Nowak<br/><br/>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights<br/>to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:<br/>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.<br/>THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.";
$("#message-popup-ok-btn").unbind();
$("#message-popup-close-btn").unbind();
$("#popupTitle").text("Copyrights");
$("#modal-body").html("<p id=\"popupMessage\"></p>");
$("#modal-body").html(text);
$("#messagePopup").modal(
{
backdrop: "static",
keyboard: false
}
);
}
function cloneCanvas(oldCanvas) {
var newCanvas = document.createElement("canvas");
var context = newCanvas.getContext("2d");
newCanvas.width = oldCanvas.width;
newCanvas.height = oldCanvas.height;
context.drawImage(oldCanvas, 0, 0);
return newCanvas;
}

View File

@@ -1,135 +1,60 @@
class Signature {
constructor() {
this.color = "#000000";
this.sign = false;
this.beginSign = false;
this.lineWidth = 2;
this.canvas = document.getElementById("sketch-pad");
this.offsetLeft = this.canvas.offsetLeft;
this.offsetRight = this.canvas.offsetRight;
this.context = this.canvas.getContext("2d");
this.context.lineJoin = "round";
this.context.lineCap = "round";
this.onCanvasMouseDown();
this.onCanvasMouseUp();
this.onCanvasMouseMove();
this.onCanvasTouchStart();
this.onCanvasTouchMove();
this.onCanvasTouchEnd();
this.createSignature();
this.clearCanvas();
this.resetCanvas();
}
// Blendet das Popup mit der gespeicherten Unterschrift wieder aus
function hideSignature() {
$("#signature-img-popup").modal("hide");
updateMousePosition(mX, mY) {
var rect = this.canvas.getBoundingClientRect();
var scaleX = this.canvas.width / rect.width;
var scaleY = this.canvas.height / rect.height;
this.cursorX = (mX - rect.left) * scaleX;
this.cursorY = (mY - rect.top) * scaleY;
}
var url = getResetSignatureImageUrl();
onCanvasMouseDown() {
this.canvas.addEventListener("mousedown", ({ clientX, clientY }) => {
$("body").addClass("stop-scrolling");
$("body").bind("touchmove",
function(e) {
e.preventDefault();
});
$.get(url);
}
this.sign = true;
this.updateMousePosition(clientX, clientY);
}, false);
}
function resizeCanvas(sketchPadId, canvasRoId) {
if($(sketchPadId).length !== 0) {
var rowWidth = $(canvasRoId).innerWidth();
var canvasWidth = $(sketchPadId).innerWidth();
onCanvasMouseUp() {
this.canvas.addEventListener("mouseup", () => {
$("body").removeClass("stop-scrolling");
$("body").unbind("touchmove");
var h = $(window).height();
var w = $(window).width();
this.sign = false;
this.beginSign = false;
}, false);
}
var isInPortraitMode = h > w;
onCanvasMouseMove() {
this.canvas.addEventListener("mousemove", ({ clientX, clientY }) => {
if (this.sign) {
this.updateMousePosition(clientX, clientY);
this.createSignature();
}
});
}
var newWidth = rowWidth * (isInPortraitMode === true ? 1.0 : 0.85);
onCanvasTouchStart() {
this.canvas.addEventListener("touchstart", (e) => {
var touch = e.touches[0];
var mouseEvent = new MouseEvent("mousedown", { clientX: touch.clientX, clientY: touch.clientY });
var parsedNewWidth = parseInt(newWidth, 10);
var parsedCanvasWidth = parseInt(canvasWidth, 10);
this.canvas.dispatchEvent(mouseEvent);
}, false);
}
var isMinDifferenceMet = false;
onCanvasTouchMove() {
this.canvas.addEventListener("touchmove", (e) => {
var touch = e.touches[0];
var mouseEvent = new MouseEvent("mousemove", { clientX: touch.clientX, clientY: touch.clientY });
this.canvas.dispatchEvent(mouseEvent);
}, false);
}
onCanvasTouchEnd() {
this.canvas.addEventListener("touchend", (e) => {
var mouseEvent = new MouseEvent("mouseup", {});
this.canvas.dispatchEvent(mouseEvent);
}, false);
}
createSignature() {
if (!this.beginSign) {
this.context.beginPath();
this.context.moveTo(this.cursorX, this.cursorY);
this.beginSign = true;
if (parsedCanvasWidth > parsedNewWidth) {
isMinDifferenceMet = parsedCanvasWidth - parsedNewWidth > 4;
} else {
this.context.lineTo(this.cursorX, this.cursorY);
this.context.strokeStyle = this.color;
this.context.lineWidth = this.lineWidth;
this.context.stroke();
isMinDifferenceMet = parsedNewWidth - parsedCanvasWidth > 4;
}
}
clearCanvas() {
this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);
}
if(isMinDifferenceMet) {
console.log("changing canvas size");
var sourceCanvas = document.getElementById(sketchPadId.split("#")[1]);
var canvasContext = sourceCanvas.getContext("2d");
var imageData = sourceCanvas.toDataURL("image/png");
resetCanvas() {
document.getElementById("clear-canvas-btn").addEventListener("click",
() => {
this.clearCanvas();
});
$(sketchPadId).prop("width", newWidth);
var img = new Image;
img.onload = function() {
canvasContext.drawImage(img, 0, 0);
};
img.src = imageData;
}
}
}
document.addEventListener("DOMContentLoaded", event => {
if ($("#sketch-pad").length !== 0) {
new Signature();
}
});
document.addEventListener("DOMContentLoaded", event => {
if ($("#report-sketch-pad").length !== 0) {
new Signature();
}
});
function prepareSigningPopup(serviceRecordOid) {
function initializeSignature(selectedServiceRecordOid) {
$("#main-container, #checkbox-container").hide();
$("#signature-container").addClass("d-block");
$.get(getSelectedRecordInformationUrlWithOid(), { oid: serviceRecordOid }).done(function(jsonServiceRecord) {
if (jsonServiceRecord === "SessionTimeout") {
$.get(getSelectedRecordInformationUrlWithOid(), { oid: selectedServiceRecordOid }).done(function(jsonServiceRecord) {
if(jsonServiceRecord === "SessionTimeout") {
window.location.href = getRedirectLink();
return;
}
@@ -154,79 +79,64 @@ function prepareSigningPopup(serviceRecordOid) {
$("#signature-employee").text(record.Employee.FirstName + " " + record.Employee.LastName);
$("#signature-date-time").text(datum + " " + startDate + " - " + endDate);
$("#service-record-oid-holder").val(serviceRecordOid);
resizeCanvas("#sketch-pad", "#canvas-row");
resizeCanvas();
var canvas = document.getElementById("sketch-pad");
var signaturePad = new SignaturePad(canvas, { backgroundColor: "rgba(255, 255, 255, 0)" });
var saveButton = document.getElementById("save-signature-btn");
var clearButton = document.getElementById("clear-canvas-btn");
var cancelButton = document.getElementById("cancel-signature-btn");
saveButton.addEventListener("click", function(event) {
var url = getSetSelectedSignatureUrl();
var date = moment(new Date());
var clonedCanvas = trimCanvas(cloneCanvas(document.getElementById("sketch-pad")));
var context = clonedCanvas.getContext("2d");
context.globalCompositeOperation = "destination-over";
context.fillStyle = "white";
context.fillRect(0, 0, clonedCanvas.width, clonedCanvas.height);
var dataUrl = clonedCanvas.toDataURL("image/png");
var formattedDate = date.format("DD.MM.YYYY HH:mm:ss");
showSpinner();
$.post(url, { blob: dataUrl, timeStamp: formattedDate, serviceRecordOid: selectedServiceRecordOid }).done(function(json) {
hideSpinner();
if(isEmptyOrSpaces(json)) {
$("#signature-container").removeClass("d-block");
$("#main-container, #checkbox-container").show();
showMessagePopupWithCallback("Unterschrift", "Die Unterschrift wurde erfolgreich gespeichert.", function() {
showSpinner();
location.reload();
}, true);
} else {
showMessagePopup("Fehler", json);
signaturePad.clear();
}
});
});
clearButton.addEventListener("click", function(event) {
signaturePad.clear();
});
cancelButton.addEventListener("click", function(event) {
showMessagePopupWithCallback("Unterschrift", "Sind Sie sicher, dass Sie die Unterschrift nicht speichern möchten?",
function() {
$("#signature-container, #checkbox-container").removeClass("d-block");
$("#main-container").show();
signaturePad.clear();
$.get(getResetSignatureImageUrl());
}, false);
});
});
}
function saveSignature() {
var url = getSetSelectedSignatureUrl();
var date = moment(new Date());
var canvas = document.getElementById("sketch-pad");
var context = canvas.getContext("2d");
context.globalCompositeOperation = "destination-over";
context.fillStyle = "white";
context.fillRect(0, 0, canvas.width, canvas.height);
var dataUrl = document.getElementById("sketch-pad").toDataURL();
var formattedDate = date.format("DD.MM.YYYY HH:mm:ss");
var serviceRecordOid = $("#service-record-oid-holder").val();
showSpinner();
$.post(url, { blob: dataUrl, timeStamp: formattedDate, serviceRecordOid: serviceRecordOid }).done(function(json) {
hideSpinner();
if (isEmptyOrSpaces(json)) {
$("#signature-container").removeClass("d-block");
$("#main-container, #checkbox-container").show();
showMessagePopupWithCallback("Unterschrift", "Die Unterschrift wurde erfolgreich gespeichert.", function() {
showSpinner();
location.reload();
}, true);
} else {
showMessagePopup("Fehler", json);
new Signature();
}
});
}
function confirmCancellation() {
showMessagePopupWithCallback("Unterschrift", "Sind Sie sicher, dass Sie die Unterschrift nicht speichern möchten?",
function() {
$("#signature-container, #checkbox-container").removeClass("d-block");
$("#main-container").show();
var canvas = document.getElementById("sketch-pad");
var context = canvas.getContext("2d");
context.clearRect(0, 0, canvas.width, canvas.height);
$.get(getResetSignatureImageUrl());
}, false);
}
function hideSignature() {
$("#signature-img-popup").modal("hide");
var url = getResetSignatureImageUrl();
$.get(url);
}
function resizeCanvas() {
if($("#sketch-pad").length !== 0) {
var rowWidth = $("#canvas-row").innerWidth();
var canvasWidth = $("#sketch-pad").innerWidth();
var newWidth = rowWidth;
if(newWidth !== canvasWidth) {
$("#sketch-pad").prop("width", newWidth);
new Signature();
}
}
}

View File

@@ -0,0 +1,86 @@
function trimCanvas(canvas) {
var context = canvas.getContext("2d");
var imgWidth = canvas.width;
var imgHeight = canvas.height;
var imgData = context.getImageData(0, 0, imgWidth, imgHeight).data;
// get the corners of the relevant content (everything that's not white)
var cropTop = scanY(true, imgWidth, imgHeight, imgData);
var cropBottom = scanY(false, imgWidth, imgHeight, imgData);
var cropLeft = scanX(true, imgWidth, imgHeight, imgData);
var cropRight = scanX(false, imgWidth, imgHeight, imgData);
// + 1 is needed because this is a difference, there are n + 1 pixels in
// between the two numbers inclusive
var cropXDiff = (cropRight - cropLeft) + 1;
var cropYDiff = (cropBottom - cropTop) + 1;
// get the relevant data from the calculated coordinates
var trimmedData = context.getImageData(cropLeft, cropTop, cropXDiff, cropYDiff);
// set the trimmed width and height
canvas.width = cropXDiff;
canvas.height = cropYDiff;
// clear the canvas
context.clearRect(0, 0, cropXDiff, cropYDiff);
// place the trimmed data into the cleared canvas to create
// a new, trimmed canvas
context.putImageData(trimmedData, 0, 0);
return canvas; // for chaining
}
// returns the RGBA values of an x, y coord of imgData
function getRGBA(x, y, imgWidth, imgData) {
return {
red: imgData[(imgWidth * y + x) * 4],
green: imgData[(imgWidth * y + x) * 4 + 1],
blue: imgData[(imgWidth * y + x) * 4 + 2],
alpha: imgData[(imgWidth * y + x) * 4 + 3]
}
}
function getAlpha(x, y, imgWidth, imgData) {
return getRGBA(x, y, imgWidth, imgData).alpha;
}
// finds the first y coord in imgData that is not white
function scanY(fromTop, imgWidth, imgHeight, imgData) {
var offset = fromTop ? 1 : -1;
var firstCol = fromTop ? 0 : imgHeight - 1;
// loop through each row
for(var y = firstCol; fromTop ? (y < imgHeight) : (y > -1); y += offset) {
// loop through each column
for(var x = 0; x < imgWidth; x++) {
// if not white, return col
if(getAlpha(x, y, imgWidth, imgData)) {
return y;
}
}
}
// the whole image is white already
return null
}
// finds the first x coord in imgData that is not white
function scanX(fromLeft, imgWidth, imgHeight, imgData) {
var offset = fromLeft ? 1 : -1;
var firstRow = fromLeft ? 0 : imgWidth - 1;
// loop through each column
for(var x = firstRow; fromLeft ? (x < imgWidth) : (x > -1); x += offset) {
// loop through each row
for(var y = 0; y < imgHeight; y++) {
// if not white, return row
if(getAlpha(x, y, imgWidth, imgData)) {
return x;
}
}
}
// the whole image is white already
return null;
}

View File

@@ -363,7 +363,7 @@ function validateForm(form) {
if(isValid === false) {
hideSpinner();
$("#messagePopup .modal-body").html('<div class="alert alert-danger" role="alert">' + errorMessage + "</div>");
showMessagePopupWithCallback("Fehler", null, function() {
$("#messagePopup .modal-body").html();
}, true);
@@ -385,7 +385,7 @@ function validateForm(form) {
var kannTrotzdemGespeichertWerden = message.KannTrotzdemGespeichertWerden;
var background = kannTrotzdemGespeichertWerden ? "alert-warning" : "alert-danger";
$("#messagePopup .modal-body").html('<div class="alert ' + background + '" role="alert">' + message.Message + "</div>");
showMessagePopupWithCallback("Fehler", null, function() {

View File

@@ -1,4 +1,4 @@
function prepareReportSignature() {
function initializeReportSignature() {
$("#report-form-container").hide();
$("#report-signature-container").addClass("d-block");
@@ -8,7 +8,46 @@
$("#report-info-column").html("Unterschrift für erbrachte Leistungen von " + customer + " im " + month + " " + year);
resizeCanvas();
resizeCanvas("#report-sketch-pad", "#report-canvas-row");
var canvas = document.getElementById("report-sketch-pad");
var signaturePad = new SignaturePad(canvas, { backgroundColor: "rgba(255, 255, 255, 0)" });
var saveButton = document.getElementById("save-report-signature-btn");
var clearButton = document.getElementById("clear-report-canvas-btn");
var cancelButton = document.getElementById("cancel-report-signature-btn");
saveButton.addEventListener("click", function(event) {
var clonedCanvas = trimCanvas(cloneCanvas(document.getElementById("report-sketch-pad")));
var context = clonedCanvas.getContext("2d");
context.globalCompositeOperation = "destination-over";
context.fillStyle = "white";
context.fillRect(0, 0, clonedCanvas.width, clonedCanvas.height);
var dataUrl = clonedCanvas.toDataURL("image/png");
var date = moment(new Date());
var formattedDate = date.format("DD.MM.YYYY HH:mm:ss");
});
clearButton.addEventListener("click", function(event) {
signaturePad.clear();
});
cancelButton.addEventListener("click", function(event) {
showMessagePopupWithCallback("Unterschrift", "Sind Sie sicher, dass Sie die Unterschrift nicht speichern möchten?",
function() {
$("#report-signature-container").removeClass("d-block");
$("#report-form-container").show();
signaturePad.clear();
//TODO: Notwendigkeit prüfen
//$.get(getResetSignatureImageUrl());
}, false);
});
}
function saveReportSignature() {

View File

@@ -13,9 +13,12 @@ using BeWo.Service.ServiceImplementations;
using BS.Shared;
using BS.Shared.Core;
using log4net.Appender;
using log4net.Layout;
using log4net.Repository.Hierarchy;
using NHibernate;
using Configuration = NHibernate.Cfg.Configuration;
using LogManager = log4net.LogManager;
namespace BeWoPlanerMobil.Service
{
@@ -36,7 +39,14 @@ namespace BeWoPlanerMobil.Service
if (!_SessionFactories.ContainsKey(MobileSessionFacade.Tenant))
{
var serverPath = HttpContext.Current.Server.MapPath("");
#if DEBUG
var hierarchy = (Hierarchy)LogManager.GetRepository();
var logger = (Logger)hierarchy.GetLogger("NHibernate.SQL");
logger.AddAppender(new TraceAppender { Layout = new SimpleLayout() });
hierarchy.Configured = true;
#endif
var serverPath = HttpContext.Current.Server.MapPath("");
serverPath = Path.Combine(serverPath, ConfigurationManager.AppSettings.Get("MultitenancyPath"));
serverPath = Path.Combine(serverPath, MobileSessionFacade.Tenant + ".config");

View File

@@ -17,13 +17,15 @@ namespace BeWoPlanerMobil.Util
public string Employees { get; set; }
public long ServiceRecordOid { get; set; }
public QuittierungsbelegItem(ServicesOverviewRO.ServiceDetail serviceDetail)
{
Kontaktart = serviceDetail.IsGroup ? "GR" : "E";
CustomersCount = serviceDetail.CustomerCount;
Minutes = serviceDetail.Minutes;
Employees = serviceDetail.EmployeeAbbr;
Kontaktart = serviceDetail.IsGroup ? "GR" : "E";
CustomersCount = serviceDetail.CustomerCount;
Minutes = serviceDetail.Minutes;
Employees = serviceDetail.EmployeeAbbr;
ServiceRecordOid = serviceDetail.ServiceRecordOid;
DateTimeString = $"{serviceDetail.StartDate:dd.MM.yyyy HH:mm} - {serviceDetail.EndDate:HH:mm}";

View File

@@ -1,7 +1,9 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
namespace BeWoPlanerMobil.Util
{

View File

@@ -81,7 +81,7 @@
);
}
resizeCanvas();
//resizeCanvas();
@if (Model != null && Model.IsInEditingMode)
{
@@ -138,7 +138,7 @@
}(jQuery));
$(window).resize(function() {
resizeCanvas();
resizeCanvas("#sketch-pad", "#canvas-row");
});
function getSetServiceRecordEmployeeUrl() {
@@ -680,7 +680,7 @@
@if(Model.ShowSignature && !serviceRecord.SignatureOid.HasValue)
{
<div class="col-auto">
<button type="button" class="btn btn-primary" onclick="prepareSigningPopup(@serviceRecord.ServiceRecordOid)">
<button type="button" class="btn btn-primary" onclick="initializeSignature(@serviceRecord.ServiceRecordOid)">
<span class="fas fa-signature"></span>
</button>
</div>
@@ -1467,7 +1467,7 @@
<div class="row">
<div class="col">
<h4 class="d-inline">Unterschrift</h4>
<button type="button" class="btn btn-primary float-right" onclick="confirmCancellation()">
<button type="button" class="btn btn-primary float-right" id="cancel-signature-btn">
<span class="fas fa-times-circle"></span>
</button>
</div>
@@ -1512,18 +1512,18 @@
</div>
</div>
<div class="row mt-3" id="canvas-row">
<div class="canvas-container" id="canvas-container">
<canvas id="sketch-pad" width="500" height="200" class="bg-white rounded" style="border: 1px solid #343A40;"></canvas>
</div>
</div>
<div class="row">
<div class="col-12">
<button type="button" class="btn btn-primary float-right" onclick="saveSignature()">Speichern</button>
<button type="button" class="btn btn-primary float-right" id="save-signature-btn">Speichern</button>
<button type="button" class="btn btn-secondary float-right mr-3" id="clear-canvas-btn">Neu</button>
</div>
</div>
<div class="row mt-3" id="canvas-row">
<div class="canvas-container" id="canvas-container">
<canvas id="sketch-pad" width="500" height="200" class="bg-white" style="border: 1px solid #343A40;"></canvas>
</div>
</div>
<input type="hidden" id="service-record-oid-holder" />
</div>
</div>

View File

@@ -119,7 +119,7 @@ Info:
<!-- Abstandshalter -->
</div>
<div class="ml-3 bd-highlight">
<button type="button" class="btn btn-primary" id="signature-button" onclick="prepareReportSignature()">Unterschreiben</button>
<button type="button" class="btn btn-primary" id="signature-button" onclick="initializeReportSignature()">Unterschreiben</button>
</div>
</div>
}
@@ -134,20 +134,20 @@ Info:
<div class="row">
<div class="col">
<h4 class="d-inline" id="report-info-column">Unterschrift</h4>
<button type="button" class="btn btn-primary float-right" onclick="confirmReportSignatureCancellation()">
<button type="button" class="btn btn-primary float-right" id="cancel-report-signature-btn">
<span class="fas fa-times-circle"></span>
</button>
</div>
</div>
<div class="row mt-3" id="canvas-row">
<div class="row mt-3" id="report-canvas-row">
<div class="canvas-container" id="canvas-container">
<canvas id="sketch-pad" width="500" heigh="200" style="border: 1px solid #343A40" class="bg-white rounded"></canvas>
<canvas id="report-sketch-pad" width="500" heigh="200" style="border: 1px solid #343A40" class="bg-white rounded"></canvas>
</div>
</div>
<div class="row">
<div class="col-12">
<button type="button" class="btn btn-primary float-right" onclick="saveReportSignature()">Speichern</button>
<button type="button" class="btn btn-secondary float-right mr-3" id="clear-canvas-btn">Neu</button>
<button type="button" class="btn btn-primary float-right" id="save-report-signature-btn">Speichern</button>
<button type="button" class="btn btn-secondary float-right mr-3" id="clear-report-canvas-btn">Neu</button>
</div>
</div>
</div>

View File

@@ -33,6 +33,8 @@
<script src="~/Scripts/view-scripts/scheduler.js"></script>
<script src="~/Scripts/utils/dateUtils.js"></script>
<script src="~/Scripts/view-scripts/report.js"></script>
<script src="https://cdn.jsdelivr.net/npm/signature_pad@2.3.2/dist/signature_pad.min.js"></script>
<script src="~/Scripts/utils/trimCanvas.js"></script>
<script>
$(document).ready(function() {
@@ -166,6 +168,13 @@
</button>
}
</li>
<li class="nav-item">
<button class="btn btn-link text-light no-underline" onclick="showAboutPopup()">
<i class="fas fa-balance-scale text-primary"></i>
Über
</button>
</li>
</ul>
</div>
</div>
@@ -193,7 +202,7 @@
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="modal-body" id="modal-body">
<p id="popupMessage"></p>
</div>
<div class="modal-footer">

View File

@@ -18,7 +18,7 @@
</sources>
</system.diagnostics>
<log4net debug="true">
<appender name="logFile" type="log4net.Appender.RollingFileAppender,log4net">
<!--<appender name="logFile" type="log4net.Appender.RollingFileAppender,log4net">
<param name="File" value="logs\mobilelog.txt" />
<param name="AppendToFile" value="true" />
<param name="RollingStyle" value="Date" />
@@ -27,10 +27,19 @@
<layout type="log4net.Layout.PatternLayout,log4net">
<param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n" />
</layout>
</appender>
</appender>-->
<appender name="DebugSQL" type="log4net.Appender.TraceAppender">
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
</layout>
</appender>
<logger name="NHibernnate.SQL" additivity="false">
<level value="DEBUG" />
<appender-ref ref="DebugSQL" />
</logger>
<root>
<priority value="INFO" />
<appender-ref ref="logFile" />
<appender-ref ref="DebugSQL" />
</root>
</log4net>
<system.webServer>

View File

@@ -2119,16 +2119,17 @@ namespace BeWo.Data.Access
public static string ToSql(ICriteria criteria)
{
var c = (CriteriaImpl)criteria;
var s = (SessionImpl)c.Session;
var factory = (ISessionFactoryImplementor)s.SessionFactory;
var implementors = factory.GetImplementors(c.EntityOrClassName);
var loader = new CriteriaLoader(
(IOuterJoinLoadable)factory.GetEntityPersister(implementors[0]),
factory,
c,
implementors[0],
s.EnabledFilters);
var criteriaImpl = (CriteriaImpl) criteria;
var sessionImpl = (SessionImpl) criteriaImpl.Session;
var factory = (ISessionFactoryImplementor) sessionImpl.SessionFactory;
var implementors = factory.GetImplementors(criteriaImpl.EntityOrClassName);
if(implementors.Length == 0)
{
return "No entity or class name found!";
}
var loader = new CriteriaLoader((IOuterJoinLoadable)factory.GetEntityPersister(implementors[0]), factory, criteriaImpl, implementors[0], sessionImpl.EnabledFilters);
return loader.SqlString.ToString();
}
@@ -3434,22 +3435,13 @@ namespace BeWo.Data.Access
public IList<ConfirmationReceiptSignature> GetConfirmationReceiptSignaturesByEmployee(long employeeOid, DateTimeSpan timeSpan)
{
/*
* var detachedCriteria1 = DetachedCriteria.For<Employee2SchedulerAppointment>()
.Add(Restrictions.In(Employee2SchedulerAppointment.PropertyName_Employee + ".Oid", pSelectedEmployees))
.SetProjection(Projections.Property(Employee2SchedulerAppointment.PropertyName_SchedulerAppointment));
var employee2SchedCrit = Subqueries.PropertyIn(BeWoEntityBase.PropertyName_Oid, detachedCriteria1);
*/
var liste = CreateCriteria<ConfirmationReceiptSignature>()
.Add(Restrictions.Eq(nameof(BeWoEntityBase.IsActive), ActivationTypeId.Active))
.Add(Restrictions.Eq(nameof(ConfirmationReceiptSignature.EmployeeOid), employeeOid))
.CreateAlias(nameof(ConfirmationReceiptSignature.ServiceRecords), "s", JoinType.InnerJoin)
.Add(CreateBetweenDateTimesCriterion(timeSpan.StartDateTime, timeSpan.EndDateTime, "s.Start", "s.End")).List<ConfirmationReceiptSignature>();
var between = CreateBetweenDateTimesCriterion(timeSpan.StartDateTime, timeSpan.EndDateTime, nameof(ServiceRecord.Start), nameof(ServiceRecord.End));
var criteria = CreateCriteriaIsActive<ConfirmationReceiptSignature>()
.Add(Restrictions.Eq(nameof(ConfirmationReceiptSignature.EmployeeOid), employeeOid))
.CreateCriteria(nameof(ConfirmationReceiptSignature.ServiceRecords), JoinType.InnerJoin).Add(between);
var mySql = ToSql(criteria);
return criteria.List<ConfirmationReceiptSignature>();
return liste;
}
public List<ConfirmationReceiptSignature> GetConfirmationReceiptSignaturesByServiceRecord(long serviceRecordOid)
@@ -3459,5 +3451,124 @@ namespace BeWo.Data.Access
return null;
}
public IList<ServiceRecord> FindEmployeeServiceRecordsForKilometerauswertung(long employeeOid, DateTimeSpan timeSpan)
{
var lCriteria = CreateCriteria<ServiceRecord>()
.Add(Restrictions.Eq(nameof(ServiceRecord.EmployeeOid), employeeOid))
.Add(Restrictions.IsNotNull(nameof(ServiceRecord.DistanceInMeter)));
var orCriteria = Restrictions.Or(
Restrictions.Between(nameof(ServiceRecord.Start), timeSpan.StartDateTime, timeSpan.EndDateTime),
Restrictions.Between(nameof(ServiceRecord.End), timeSpan.StartDateTime, timeSpan.EndDateTime));
orCriteria = Restrictions.Or(orCriteria,
Restrictions.And(
Restrictions.Le(nameof(ServiceRecord.Start), timeSpan.EndDateTime),
Restrictions.Ge(nameof(ServiceRecord.End), timeSpan.StartDateTime)));
lCriteria.Add(orCriteria);
lCriteria.Add(Restrictions.Eq(nameof(ServiceRecord.ServiceRecordType), ServiceRecordTypeId.DefaultActivity));
return lCriteria.List<ServiceRecord>();
}
public Dictionary<long, List<ServiceRecord>> FindListOfEmployeeServiceRecordsForKilometerauswertung(List<long> employeeOids, DateTimeSpan span)
{
var lCriteria = CreateCriteria<ServiceRecord>()
.Add(Restrictions.In(nameof(ServiceRecord.EmployeeOid), employeeOids))
.Add(Restrictions.IsNotNull(nameof(ServiceRecord.DistanceInMeter)));
var orCriteria = Restrictions.Or(
Restrictions.Between(nameof(ServiceRecord.Start), span.StartDateTime, span.EndDateTime),
Restrictions.Between(nameof(ServiceRecord.End), span.StartDateTime, span.EndDateTime));
orCriteria = Restrictions.Or(orCriteria,
Restrictions.And(
Restrictions.Le(nameof(ServiceRecord.Start), span.EndDateTime),
Restrictions.Ge(nameof(ServiceRecord.End), span.StartDateTime)));
lCriteria.Add(orCriteria);
lCriteria.Add(Restrictions.Eq(nameof(ServiceRecord.ServiceRecordType), ServiceRecordTypeId.DefaultActivity));
var allServiceRecords = lCriteria.List<ServiceRecord>().ToList();
var result = new Dictionary<long, List<ServiceRecord>>();
foreach(var serviceRecord in allServiceRecords)
{
result.AddOrUpdateValueInDictionary(serviceRecord.EmployeeOid.Value, new List<ServiceRecord> { serviceRecord });
}
return result;
}
public IList<Employee> GetAllActiveEmployeesForEmployee(long? employeeOid)
{
ApplicationUser user;
if(employeeOid.HasValue)
{
var employee = CreateCriteria<Employee>().Add(Restrictions.Eq(nameof(Employee.Oid), employeeOid)).UniqueResult<Employee>();
user = FindUserForEmployee(employee);
}
else
{
if(LoggedInUserOperationContextExt.Current != null && LoggedInUserOperationContextExt.Current.User != null)
{
user = LoggedInUserOperationContextExt.Current.User;
}
else
{
user = SessionFacade.LoggedInUser;
}
}
if(user.Employee.Oid == null)
{
return new List<Employee>();
}
var rights = new List<UserRightType>();
user.UserGroups.DoForEach(s => s.Rights.DoForEach(right => rights.AddIfNotIn(right.RightType)));
var lCriteria = CreateCriteriaIsActive<Employee>();
if(rights.Contains(UserRightType.ViewAll) || rights.Contains(UserRightType.CustomerView_View))
{
return lCriteria.List<Employee>().ToList();
}
var result = new List<Employee>();
if(rights.Contains(UserRightType.Employee_AllowViewOwnEmployees))
{
result.AddIfNotIn(user.Employee);
}
if(rights.Contains(UserRightType.Employee_AllowViewOwnTeam))
{
var leadingTeams = user.Employee.LeadingTeams;
leadingTeams.DoForEach(team =>
{
result.AddIfNotIn(team.Leader);
result.AddRangeIfElementsNotIn(team.MemberList);
});
var teams = FindTeamsOfEmployee(user.Employee.Oid.Value);
teams.DoForEach(team =>
{
result.AddIfNotIn(team.Leader);
result.AddRangeIfElementsNotIn(team.MemberList);
});
}
return result;
}
}
}

View File

@@ -608,7 +608,7 @@
<EmbeddedResource Include="Mappings\DienstInfo.hbm.xml">
<SubType>Designer</SubType>
</EmbeddedResource>
<Content Include="Mappings\ConfirmationReceiptSignature.hbm.xml" />
<EmbeddedResource Include="Mappings\ConfirmationReceiptSignature.hbm.xml" />
<Content Include="Mappings\DeletionHistory.hbm.xml" />
<EmbeddedResource Include="Mappings\FlexibleReportLayout.hbm.xml">
<SubType>Designer</SubType>

View File

@@ -54,10 +54,10 @@ namespace BeWo.Data
{
#if DEBUG
//TODO: wieder einkommentieren!
//var hierarchy = (Hierarchy)LogManager.GetRepository();
//var logger = (Logger)hierarchy.GetLogger("NHibernate.SQL");
//logger.AddAppender(new TraceAppender { Layout = new SimpleLayout() });
//hierarchy.Configured = true;
var hierarchy = (Hierarchy)LogManager.GetRepository();
var logger = (Logger)hierarchy.GetLogger("NHibernate.SQL");
logger.AddAppender(new TraceAppender { Layout = new SimpleLayout() });
hierarchy.Configured = true;
#endif
var baseDirectory = AppDomain.CurrentDomain.BaseDirectory;

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic;
using BS.Shared;
namespace BeWo.Data.Entities
{
@@ -48,5 +49,11 @@ namespace BeWo.Data.Entities
}
}
}
public ConfirmationReceiptSignature()
{
_Tid = TableID.ConfirmationReceiptSignature;
}
}
}

View File

@@ -1,12 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="BeWo.Data.Entities.ConfirmationReceiptSignature, BeWo.Data" table="ConfirmationReceiptSignature">
<class name="BeWo.Data.Entities.ConfirmationReceiptSignature, BeWo.Data" table="confirmationreceiptsignature">
<id name="Oid" column ="Oid" unsaved-value="null">
<generator class="identity" />
</id>
<version type="Int64" column="Version" name="Version" />
<property name="ServiceRecordOid" column="ServiceRecordOid" />
<property name="InsTs" />
<property name="InsUser" />
<property column="Tid" type="BS.Shared.TableID, BS.Shared" name="_Tid" access="field" />
@@ -17,8 +16,8 @@
<property name="SignatureImage" column="SignatureImage" />
<property name="EmployeeOid" />
<bag name="ServiceRecords" table="ConfirmationSignature2ServiceRecord" generic="true" cascade="none" batch-size="250">
<key column="ConfirmationSignatureOid" />
<bag name="ServiceRecords" table="ConfirmationReceiptSignature2ServiceRecord" generic="true" cascade="none" batch-size="250">
<key column="ConfirmationReceiptSignatureOid" />
<many-to-many column="ServiceRecordOid" class="BeWo.Data.Entities.ServiceRecord, BeWo.Data" />
</bag>
</class>

View File

@@ -47,10 +47,10 @@ namespace BeWo.Data
{
#if DEBUG
//TODO: wieder einkommentieren!
//var hierarchy = (Hierarchy)LogManager.GetRepository();
//var logger = (Logger)hierarchy.GetLogger("NHibernate.SQL");
//logger.AddAppender(new TraceAppender { Layout = new SimpleLayout() });
//hierarchy.Configured = true;
var hierarchy = (Hierarchy)LogManager.GetRepository();
var logger = (Logger)hierarchy.GetLogger("NHibernate.SQL");
logger.AddAppender(new TraceAppender { Layout = new SimpleLayout() });
hierarchy.Configured = true;
#endif
_SessionFactories[MultitenancyOperationContextExt.Current.Tenant] = new Configuration().Configure(BS.Shared.Core.Utils.CreateSavePath(AppDomain.CurrentDomain.BaseDirectory, @"Multitenancy\" + MultitenancyOperationContextExt.Current.Tenant + ".config")).BuildSessionFactory();
}

View File

@@ -82,5 +82,9 @@ namespace BeWo.Report
public abstract XtraReport CreateKilometerauswertungForAllCustomers(List<long> customerOids, DateTime rangeDate);
public abstract XtraReport CreateEmployeeKilometerauswertung(long employeeOid, DateTime range);
public abstract XtraReport CreateKilometerauswertungForAllEmployees(List<long> employeeOids, DateTime rangeDate);
}
}

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Data;
@@ -875,6 +876,24 @@ namespace BeWo.Report
return report as XtraReport;
}
public override XtraReport CreateEmployeeKilometerauswertung(long employeeOid, DateTime range)
{
var report = FindReportImp<EmployeeKilometerauswertungsRO>();
report.SetReportDataSource(EmployeeKilometerauswertungsRO.Create(MapperFactory.CompactEmployeeDC_Employee.MapToNewDC(DAOFactory.GenericDAO.LoadByID<Employee>(employeeOid)), range));
return report as XtraReport;
}
public override XtraReport CreateKilometerauswertungForAllEmployees(List<long> employeeOids, DateTime rangeDate)
{
var report = FindReportImp<EmployeeKilometerauswertungsListRO>();
report.SetReportDataSource(EmployeeKilometerauswertungsListRO.Create(MapperFactory.CompactEmployeeDC_Employee.MapToNewDCs(DAOFactory.GenericDAO.LoadByIDs<Employee>(employeeOids)), rangeDate));
return report as XtraReport;
}
public override XtraReport CreateAbsenceReport(DateTime dt, List<long> abs, List<long> empTypes)
{
var report = FindReportImp<AbsenceRO>();
@@ -882,7 +901,6 @@ namespace BeWo.Report
report.SetReportDataSource(AbsenceRO.Create(dt, (new OperationsServiceImp()).GetAbsenceTimeDCEmployee51(dt, dt.AddMonths(1).AddTicks(-1), abs, empTypes)));
return report as XtraReport;
}
public override XtraReport CreateRosterReport(long wOid, DateTime dt)

View File

@@ -0,0 +1,474 @@
using BeWo.Report.ReportObjects;
namespace BeWo.Report.DefaultReports
{
partial class EmployeeKilometerauswertungsListReport
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if(disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.Detail = new DevExpress.XtraReports.UI.DetailBand();
this.xrTableCell1 = new DevExpress.XtraReports.UI.XRTableCell();
this.xrTableRow1 = new DevExpress.XtraReports.UI.XRTableRow();
this.xrTable1 = new DevExpress.XtraReports.UI.XRTable();
this.Detail1 = new DevExpress.XtraReports.UI.DetailBand();
this.xrLabel7 = new DevExpress.XtraReports.UI.XRLabel();
this.DetailReport = new DevExpress.XtraReports.UI.DetailReportBand();
this.DetailReport1 = new DevExpress.XtraReports.UI.DetailReportBand();
this.Detail2 = new DevExpress.XtraReports.UI.DetailBand();
this.xrTable4 = new DevExpress.XtraReports.UI.XRTable();
this.xrTableRow4 = new DevExpress.XtraReports.UI.XRTableRow();
this.xrTableCell3 = new DevExpress.XtraReports.UI.XRTableCell();
this.xrTableCell4 = new DevExpress.XtraReports.UI.XRTableCell();
this.xrTableCell9 = new DevExpress.XtraReports.UI.XRTableCell();
this.GroupHeader2 = new DevExpress.XtraReports.UI.GroupHeaderBand();
this.xrTable2 = new DevExpress.XtraReports.UI.XRTable();
this.xrTableRow2 = new DevExpress.XtraReports.UI.XRTableRow();
this.xrTableCell5 = new DevExpress.XtraReports.UI.XRTableCell();
this.xrTableCell6 = new DevExpress.XtraReports.UI.XRTableCell();
this.xrTableCell7 = new DevExpress.XtraReports.UI.XRTableCell();
this.GroupFooter1 = new DevExpress.XtraReports.UI.GroupFooterBand();
this.ReportHeader = new DevExpress.XtraReports.UI.ReportHeaderBand();
this.xrLabel2 = new DevExpress.XtraReports.UI.XRLabel();
this.xrLabel1 = new DevExpress.XtraReports.UI.XRLabel();
this.pageFooterBand1 = new DevExpress.XtraReports.UI.PageFooterBand();
this.xrPageInfo2 = new DevExpress.XtraReports.UI.XRPageInfo();
this.xrPageInfo1 = new DevExpress.XtraReports.UI.XRPageInfo();
this.Title = new DevExpress.XtraReports.UI.XRControlStyle();
this.FieldCaption = new DevExpress.XtraReports.UI.XRControlStyle();
this.PageInfo = new DevExpress.XtraReports.UI.XRControlStyle();
this.DataField = new DevExpress.XtraReports.UI.XRControlStyle();
this.fieldFLS = new DevExpress.XtraReports.UI.CalculatedField();
this.topMarginBand1 = new DevExpress.XtraReports.UI.TopMarginBand();
this.bottomMarginBand1 = new DevExpress.XtraReports.UI.BottomMarginBand();
this.objectDataSource1 = new DevExpress.DataAccess.ObjectBinding.ObjectDataSource(this.components);
((System.ComponentModel.ISupportInitialize)(this.xrTable1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.xrTable4)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.xrTable2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.objectDataSource1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this)).BeginInit();
//
// Detail
//
this.Detail.HeightF = 0F;
this.Detail.Name = "Detail";
this.Detail.Padding = new DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 100F);
this.Detail.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft;
//
// xrTableCell1
//
this.xrTableCell1.Borders = DevExpress.XtraPrinting.BorderSide.None;
this.xrTableCell1.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Text", null, "Employees2Entries.EmployeeName")});
this.xrTableCell1.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Bold);
this.xrTableCell1.Name = "xrTableCell1";
this.xrTableCell1.StylePriority.UseBorderColor = false;
this.xrTableCell1.StylePriority.UseBorders = false;
this.xrTableCell1.StylePriority.UseFont = false;
this.xrTableCell1.Weight = 4.0816326530612246D;
//
// xrTableRow1
//
this.xrTableRow1.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] {
this.xrTableCell1});
this.xrTableRow1.Name = "xrTableRow1";
this.xrTableRow1.Weight = 1D;
//
// xrTable1
//
this.xrTable1.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right)
| DevExpress.XtraPrinting.BorderSide.Bottom)));
this.xrTable1.LocationFloat = new DevExpress.Utils.PointFloat(0F, 25F);
this.xrTable1.Name = "xrTable1";
this.xrTable1.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] {
this.xrTableRow1});
this.xrTable1.SizeF = new System.Drawing.SizeF(600F, 25F);
this.xrTable1.StylePriority.UseBorders = false;
this.xrTable1.StylePriority.UsePadding = false;
//
// Detail1
//
this.Detail1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
this.xrLabel7,
this.xrTable1});
this.Detail1.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Detail1.HeightF = 83F;
this.Detail1.Name = "Detail1";
this.Detail1.StylePriority.UseFont = false;
//
// xrLabel7
//
this.xrLabel7.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Text", null, "Employees2Entries.TotalDistanceInMeters", "Kilometer gesamt: {0:}")});
this.xrLabel7.Font = new System.Drawing.Font("Arial", 10F);
this.xrLabel7.LocationFloat = new DevExpress.Utils.PointFloat(0F, 50F);
this.xrLabel7.Name = "xrLabel7";
this.xrLabel7.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.xrLabel7.SizeF = new System.Drawing.SizeF(280F, 25F);
this.xrLabel7.StylePriority.UseFont = false;
//
// DetailReport
//
this.DetailReport.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] {
this.Detail1,
this.DetailReport1});
this.DetailReport.DataMember = "Employees2Entries";
this.DetailReport.DataSource = this.objectDataSource1;
this.DetailReport.Level = 0;
this.DetailReport.Name = "DetailReport";
//
// DetailReport1
//
this.DetailReport1.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] {
this.Detail2,
this.GroupHeader2,
this.GroupFooter1});
this.DetailReport1.DataMember = "Employees2Entries.Entries";
this.DetailReport1.DataSource = this.objectDataSource1;
this.DetailReport1.Level = 0;
this.DetailReport1.Name = "DetailReport1";
//
// Detail2
//
this.Detail2.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
this.xrTable4});
this.Detail2.HeightF = 25F;
this.Detail2.Name = "Detail2";
//
// xrTable4
//
this.xrTable4.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right)
| DevExpress.XtraPrinting.BorderSide.Bottom)));
this.xrTable4.LocationFloat = new DevExpress.Utils.PointFloat(102F, 0F);
this.xrTable4.Name = "xrTable4";
this.xrTable4.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F);
this.xrTable4.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] {
this.xrTableRow4});
this.xrTable4.SizeF = new System.Drawing.SizeF(474.5801F, 25F);
this.xrTable4.StylePriority.UseBorders = false;
this.xrTable4.StylePriority.UsePadding = false;
//
// xrTableRow4
//
this.xrTableRow4.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] {
this.xrTableCell3,
this.xrTableCell4,
this.xrTableCell9});
this.xrTableRow4.Name = "xrTableRow4";
this.xrTableRow4.Weight = 1D;
//
// xrTableCell3
//
this.xrTableCell3.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Text", null, "Employees2Entries.Entries.DateTime", "{0:dd.MM.yyyy}")});
this.xrTableCell3.Font = new System.Drawing.Font("Arial", 9.75F);
this.xrTableCell3.Name = "xrTableCell3";
this.xrTableCell3.StylePriority.UseFont = false;
this.xrTableCell3.StylePriority.UseTextAlignment = false;
this.xrTableCell3.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
this.xrTableCell3.Weight = 0.54421779087611588D;
//
// xrTableCell4
//
this.xrTableCell4.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Text", null, "Employees2Entries.Entries.DistanceInMeters")});
this.xrTableCell4.Font = new System.Drawing.Font("Arial", 9.75F);
this.xrTableCell4.Name = "xrTableCell4";
this.xrTableCell4.StylePriority.UseFont = false;
this.xrTableCell4.StylePriority.UseTextAlignment = false;
this.xrTableCell4.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
this.xrTableCell4.Weight = 1.028912291234853D;
//
// xrTableCell9
//
this.xrTableCell9.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Text", null, "Employees2Entries.Entries.CustomerName")});
this.xrTableCell9.Font = new System.Drawing.Font("Arial", 9.75F);
this.xrTableCell9.Name = "xrTableCell9";
this.xrTableCell9.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 5, 0, 0, 100F);
this.xrTableCell9.StylePriority.UseFont = false;
this.xrTableCell9.StylePriority.UsePadding = false;
this.xrTableCell9.StylePriority.UseTextAlignment = false;
this.xrTableCell9.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
this.xrTableCell9.Weight = 1.6553058235012754D;
//
// GroupHeader2
//
this.GroupHeader2.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
this.xrTable2});
this.GroupHeader2.HeightF = 25F;
this.GroupHeader2.Name = "GroupHeader2";
this.GroupHeader2.RepeatEveryPage = true;
//
// xrTable2
//
this.xrTable2.Borders = ((DevExpress.XtraPrinting.BorderSide)((((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Top)
| DevExpress.XtraPrinting.BorderSide.Right)
| DevExpress.XtraPrinting.BorderSide.Bottom)));
this.xrTable2.Font = new System.Drawing.Font("Arial", 10F, System.Drawing.FontStyle.Bold);
this.xrTable2.LocationFloat = new DevExpress.Utils.PointFloat(102F, 0F);
this.xrTable2.Name = "xrTable2";
this.xrTable2.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F);
this.xrTable2.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] {
this.xrTableRow2});
this.xrTable2.SizeF = new System.Drawing.SizeF(474.58F, 25F);
this.xrTable2.StylePriority.UseBorders = false;
this.xrTable2.StylePriority.UseFont = false;
this.xrTable2.StylePriority.UsePadding = false;
//
// xrTableRow2
//
this.xrTableRow2.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] {
this.xrTableCell5,
this.xrTableCell6,
this.xrTableCell7});
this.xrTableRow2.Name = "xrTableRow2";
this.xrTableRow2.Weight = 1D;
//
// xrTableCell5
//
this.xrTableCell5.Name = "xrTableCell5";
this.xrTableCell5.StylePriority.UseTextAlignment = false;
this.xrTableCell5.Text = "Datum";
this.xrTableCell5.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
this.xrTableCell5.Weight = 0.54421769109920315D;
//
// xrTableCell6
//
this.xrTableCell6.Name = "xrTableCell6";
this.xrTableCell6.StylePriority.UseTextAlignment = false;
this.xrTableCell6.Text = "gefahrene Kilometer";
this.xrTableCell6.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
this.xrTableCell6.Weight = 1.0289115603020467D;
//
// xrTableCell7
//
this.xrTableCell7.Name = "xrTableCell7";
this.xrTableCell7.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 5, 0, 0, 100F);
this.xrTableCell7.StylePriority.UsePadding = false;
this.xrTableCell7.StylePriority.UseTextAlignment = false;
this.xrTableCell7.Text = "Klient";
this.xrTableCell7.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
this.xrTableCell7.Weight = 1.6553060397102077D;
//
// GroupFooter1
//
this.GroupFooter1.HeightF = 0F;
this.GroupFooter1.Name = "GroupFooter1";
this.GroupFooter1.PageBreak = DevExpress.XtraReports.UI.PageBreak.AfterBand;
//
// ReportHeader
//
this.ReportHeader.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
this.xrLabel2,
this.xrLabel1});
this.ReportHeader.HeightF = 50F;
this.ReportHeader.Name = "ReportHeader";
//
// xrLabel2
//
this.xrLabel2.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Text", null, "MonthInformation", "Zeitraum: {0:MMMM yyyy}")});
this.xrLabel2.Font = new System.Drawing.Font("Arial", 12F);
this.xrLabel2.LocationFloat = new DevExpress.Utils.PointFloat(0F, 25F);
this.xrLabel2.Name = "xrLabel2";
this.xrLabel2.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.xrLabel2.SizeF = new System.Drawing.SizeF(280F, 25F);
this.xrLabel2.StylePriority.UseFont = false;
//
// xrLabel1
//
this.xrLabel1.Font = new System.Drawing.Font("Arial", 14F);
this.xrLabel1.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F);
this.xrLabel1.Multiline = true;
this.xrLabel1.Name = "xrLabel1";
this.xrLabel1.SizeF = new System.Drawing.SizeF(600F, 25F);
this.xrLabel1.StyleName = "Title";
this.xrLabel1.StylePriority.UseFont = false;
this.xrLabel1.Text = "Auswertung über gefahrene Kilometer";
//
// pageFooterBand1
//
this.pageFooterBand1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
this.xrPageInfo2,
this.xrPageInfo1});
this.pageFooterBand1.HeightF = 48F;
this.pageFooterBand1.Name = "pageFooterBand1";
//
// xrPageInfo2
//
this.xrPageInfo2.Font = new System.Drawing.Font("Arial", 8F);
this.xrPageInfo2.Format = "Seite {0} von {1}";
this.xrPageInfo2.LocationFloat = new DevExpress.Utils.PointFloat(425.13F, 25F);
this.xrPageInfo2.Name = "xrPageInfo2";
this.xrPageInfo2.SizeF = new System.Drawing.SizeF(236.9999F, 23F);
this.xrPageInfo2.StyleName = "PageInfo";
this.xrPageInfo2.StylePriority.UseFont = false;
this.xrPageInfo2.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight;
//
// xrPageInfo1
//
this.xrPageInfo1.Font = new System.Drawing.Font("Arial", 8F);
this.xrPageInfo1.LocationFloat = new DevExpress.Utils.PointFloat(8F, 25F);
this.xrPageInfo1.Name = "xrPageInfo1";
this.xrPageInfo1.PageInfo = DevExpress.XtraPrinting.PageInfo.DateTime;
this.xrPageInfo1.SizeF = new System.Drawing.SizeF(133.6666F, 23F);
this.xrPageInfo1.StyleName = "PageInfo";
this.xrPageInfo1.StylePriority.UseFont = false;
//
// Title
//
this.Title.BackColor = System.Drawing.Color.White;
this.Title.BorderColor = System.Drawing.SystemColors.ControlText;
this.Title.Borders = DevExpress.XtraPrinting.BorderSide.None;
this.Title.BorderWidth = 1F;
this.Title.Font = new System.Drawing.Font("Times New Roman", 24F);
this.Title.ForeColor = System.Drawing.Color.Black;
this.Title.Name = "Title";
//
// FieldCaption
//
this.FieldCaption.BackColor = System.Drawing.Color.White;
this.FieldCaption.BorderColor = System.Drawing.SystemColors.ControlText;
this.FieldCaption.Borders = DevExpress.XtraPrinting.BorderSide.None;
this.FieldCaption.BorderWidth = 1F;
this.FieldCaption.Font = new System.Drawing.Font("Times New Roman", 10F, System.Drawing.FontStyle.Bold);
this.FieldCaption.ForeColor = System.Drawing.Color.Black;
this.FieldCaption.Name = "FieldCaption";
//
// PageInfo
//
this.PageInfo.BackColor = System.Drawing.Color.White;
this.PageInfo.BorderColor = System.Drawing.SystemColors.ControlText;
this.PageInfo.Borders = DevExpress.XtraPrinting.BorderSide.None;
this.PageInfo.BorderWidth = 1F;
this.PageInfo.Font = new System.Drawing.Font("Times New Roman", 8F);
this.PageInfo.ForeColor = System.Drawing.Color.Black;
this.PageInfo.Name = "PageInfo";
//
// DataField
//
this.DataField.BackColor = System.Drawing.Color.White;
this.DataField.BorderColor = System.Drawing.SystemColors.ControlText;
this.DataField.Borders = DevExpress.XtraPrinting.BorderSide.None;
this.DataField.BorderWidth = 1F;
this.DataField.Font = new System.Drawing.Font("Times New Roman", 8F);
this.DataField.ForeColor = System.Drawing.SystemColors.ControlText;
this.DataField.Name = "DataField";
//
// fieldFLS
//
this.fieldFLS.DataMember = "FLSReportGroups";
this.fieldFLS.Expression = "[TotalFLM] / 60";
this.fieldFLS.FieldType = DevExpress.XtraReports.UI.FieldType.Decimal;
this.fieldFLS.Name = "fieldFLS";
//
// topMarginBand1
//
this.topMarginBand1.HeightF = 50F;
this.topMarginBand1.Name = "topMarginBand1";
//
// bottomMarginBand1
//
this.bottomMarginBand1.HeightF = 50F;
this.bottomMarginBand1.Name = "bottomMarginBand1";
//
// objectDataSource1
//
this.objectDataSource1.DataSource = typeof(BeWo.Report.ReportObjects.EmployeeKilometerauswertungsListRO);
this.objectDataSource1.Name = "objectDataSource1";
//
// EmployeeKilometerauswertungsListReport
//
this.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] {
this.Detail,
this.DetailReport,
this.ReportHeader,
this.pageFooterBand1,
this.topMarginBand1,
this.bottomMarginBand1});
this.CalculatedFields.AddRange(new DevExpress.XtraReports.UI.CalculatedField[] {
this.fieldFLS});
this.ComponentStorage.AddRange(new System.ComponentModel.IComponent[] {
this.objectDataSource1});
this.DataSource = this.objectDataSource1;
this.Margins = new System.Drawing.Printing.Margins(75, 75, 50, 50);
this.PageHeight = 1169;
this.PageWidth = 827;
this.PaperKind = System.Drawing.Printing.PaperKind.A4;
this.StyleSheet.AddRange(new DevExpress.XtraReports.UI.XRControlStyle[] {
this.Title,
this.FieldCaption,
this.PageInfo,
this.DataField});
this.Version = "17.1";
((System.ComponentModel.ISupportInitialize)(this.xrTable1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.xrTable4)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.xrTable2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.objectDataSource1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this)).EndInit();
}
#endregion
private DevExpress.XtraReports.UI.DetailBand Detail;
private DevExpress.XtraReports.UI.XRTableCell xrTableCell1;
private DevExpress.XtraReports.UI.XRTableRow xrTableRow1;
private DevExpress.XtraReports.UI.XRTable xrTable1;
private DevExpress.XtraReports.UI.DetailBand Detail1;
private DevExpress.XtraReports.UI.DetailReportBand DetailReport;
private DevExpress.XtraReports.UI.ReportHeaderBand ReportHeader;
private DevExpress.XtraReports.UI.XRLabel xrLabel1;
private DevExpress.XtraReports.UI.PageFooterBand pageFooterBand1;
private DevExpress.XtraReports.UI.XRPageInfo xrPageInfo2;
private DevExpress.XtraReports.UI.XRPageInfo xrPageInfo1;
private DevExpress.XtraReports.UI.XRControlStyle Title;
private DevExpress.XtraReports.UI.XRControlStyle FieldCaption;
private DevExpress.XtraReports.UI.XRControlStyle PageInfo;
private DevExpress.XtraReports.UI.XRControlStyle DataField;
private DevExpress.XtraReports.UI.XRTable xrTable2;
private DevExpress.XtraReports.UI.XRTableRow xrTableRow2;
private DevExpress.XtraReports.UI.XRTableCell xrTableCell5;
private DevExpress.XtraReports.UI.XRTableCell xrTableCell6;
private DevExpress.XtraReports.UI.XRTableCell xrTableCell7;
private DevExpress.XtraReports.UI.DetailReportBand DetailReport1;
private DevExpress.XtraReports.UI.DetailBand Detail2;
private DevExpress.XtraReports.UI.XRTable xrTable4;
private DevExpress.XtraReports.UI.XRTableRow xrTableRow4;
private DevExpress.XtraReports.UI.XRTableCell xrTableCell3;
private DevExpress.XtraReports.UI.XRTableCell xrTableCell4;
private DevExpress.XtraReports.UI.XRTableCell xrTableCell9;
private DevExpress.XtraReports.UI.XRLabel xrLabel2;
private DevExpress.XtraReports.UI.GroupHeaderBand GroupHeader2;
private DevExpress.XtraReports.UI.XRLabel xrLabel7;
private DevExpress.XtraReports.UI.CalculatedField fieldFLS;
private DevExpress.XtraReports.UI.GroupFooterBand GroupFooter1;
private DevExpress.XtraReports.UI.TopMarginBand topMarginBand1;
private DevExpress.XtraReports.UI.BottomMarginBand bottomMarginBand1;
private DevExpress.DataAccess.ObjectBinding.ObjectDataSource objectDataSource1;
}
}

View File

@@ -0,0 +1,17 @@
using BeWo.Report.ReportObjects;
namespace BeWo.Report.DefaultReports
{
public partial class EmployeeKilometerauswertungsListReport : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<EmployeeKilometerauswertungsListRO>
{
public EmployeeKilometerauswertungsListReport()
{
InitializeComponent();
}
public void SetReportDataSource(EmployeeKilometerauswertungsListRO pRO)
{
objectDataSource1.DataSource = pRO;
}
}
}

View File

@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="objectDataSource1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@@ -0,0 +1,19 @@
using BeWo.Report.ReportObjects;
namespace BeWo.Report.DefaultReports
{
public partial class EmployeeKilometerauswertungsReport : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<EmployeeKilometerauswertungsRO>
{
public EmployeeKilometerauswertungsReport()
{
InitializeComponent();
}
public void SetReportDataSource(EmployeeKilometerauswertungsRO pRO)
{
pRO.CreateDistanceList();
objectDataSource1.DataSource = pRO;
}
}
}

View File

@@ -0,0 +1,454 @@
using BeWo.Report.ReportObjects;
namespace BeWo.Report.DefaultReports
{
partial class EmployeeKilometerauswertungsReport
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.Detail = new DevExpress.XtraReports.UI.DetailBand();
this.Detail1 = new DevExpress.XtraReports.UI.DetailBand();
this.xrLabel13 = new DevExpress.XtraReports.UI.XRLabel();
this.DetailReport = new DevExpress.XtraReports.UI.DetailReportBand();
this.DetailReport1 = new DevExpress.XtraReports.UI.DetailReportBand();
this.Detail2 = new DevExpress.XtraReports.UI.DetailBand();
this.xrTable4 = new DevExpress.XtraReports.UI.XRTable();
this.xrTableRow4 = new DevExpress.XtraReports.UI.XRTableRow();
this.xrTableCell3 = new DevExpress.XtraReports.UI.XRTableCell();
this.xrTableCell4 = new DevExpress.XtraReports.UI.XRTableCell();
this.xrTableCell9 = new DevExpress.XtraReports.UI.XRTableCell();
this.GroupFooter1 = new DevExpress.XtraReports.UI.GroupFooterBand();
this.GroupHeader2 = new DevExpress.XtraReports.UI.GroupHeaderBand();
this.xrTable2 = new DevExpress.XtraReports.UI.XRTable();
this.xrTableRow2 = new DevExpress.XtraReports.UI.XRTableRow();
this.xrTableCell5 = new DevExpress.XtraReports.UI.XRTableCell();
this.xrTableCell6 = new DevExpress.XtraReports.UI.XRTableCell();
this.xrTableCell7 = new DevExpress.XtraReports.UI.XRTableCell();
this.objectDataSource1 = new DevExpress.DataAccess.ObjectBinding.ObjectDataSource(this.components);
this.ReportHeader = new DevExpress.XtraReports.UI.ReportHeaderBand();
this.xrLabel2 = new DevExpress.XtraReports.UI.XRLabel();
this.xrLabel1 = new DevExpress.XtraReports.UI.XRLabel();
this.pageFooterBand1 = new DevExpress.XtraReports.UI.PageFooterBand();
this.xrPageInfo2 = new DevExpress.XtraReports.UI.XRPageInfo();
this.xrPageInfo1 = new DevExpress.XtraReports.UI.XRPageInfo();
this.Title = new DevExpress.XtraReports.UI.XRControlStyle();
this.FieldCaption = new DevExpress.XtraReports.UI.XRControlStyle();
this.PageInfo = new DevExpress.XtraReports.UI.XRControlStyle();
this.DataField = new DevExpress.XtraReports.UI.XRControlStyle();
this.fieldFLS = new DevExpress.XtraReports.UI.CalculatedField();
this.fieldGroupFLS = new DevExpress.XtraReports.UI.CalculatedField();
this.topMarginBand1 = new DevExpress.XtraReports.UI.TopMarginBand();
this.bottomMarginBand1 = new DevExpress.XtraReports.UI.BottomMarginBand();
((System.ComponentModel.ISupportInitialize)(this.xrTable4)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.xrTable2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.objectDataSource1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this)).BeginInit();
//
// Detail
//
this.Detail.Expanded = false;
this.Detail.HeightF = 0F;
this.Detail.Name = "Detail";
this.Detail.Padding = new DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 100F);
this.Detail.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft;
//
// Detail1
//
this.Detail1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
this.xrLabel13});
this.Detail1.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Detail1.HeightF = 46.16668F;
this.Detail1.Name = "Detail1";
this.Detail1.StylePriority.UseFont = false;
//
// xrLabel13
//
this.xrLabel13.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Text", null, "TotalDistanceInMeters", "Kilometer gesamt: {0:0.##}")});
this.xrLabel13.Font = new System.Drawing.Font("Arial", 10F);
this.xrLabel13.LocationFloat = new DevExpress.Utils.PointFloat(0F, 10.00001F);
this.xrLabel13.Name = "xrLabel13";
this.xrLabel13.SizeF = new System.Drawing.SizeF(677.0001F, 25F);
this.xrLabel13.StylePriority.UseFont = false;
this.xrLabel13.StylePriority.UsePadding = false;
this.xrLabel13.StylePriority.UseTextAlignment = false;
this.xrLabel13.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft;
//
// DetailReport
//
this.DetailReport.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] {
this.Detail1,
this.DetailReport1});
this.DetailReport.DataSource = this.objectDataSource1;
this.DetailReport.Level = 0;
this.DetailReport.Name = "DetailReport";
//
// DetailReport1
//
this.DetailReport1.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] {
this.Detail2,
this.GroupFooter1,
this.GroupHeader2});
this.DetailReport1.DataMember = "Entries";
this.DetailReport1.DataSource = this.objectDataSource1;
this.DetailReport1.Level = 0;
this.DetailReport1.Name = "DetailReport1";
//
// Detail2
//
this.Detail2.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
this.xrTable4});
this.Detail2.HeightF = 25F;
this.Detail2.KeepTogether = true;
this.Detail2.KeepTogetherWithDetailReports = true;
this.Detail2.Name = "Detail2";
//
// xrTable4
//
this.xrTable4.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right)
| DevExpress.XtraPrinting.BorderSide.Bottom)));
this.xrTable4.LocationFloat = new DevExpress.Utils.PointFloat(102.0001F, 0F);
this.xrTable4.Name = "xrTable4";
this.xrTable4.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F);
this.xrTable4.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] {
this.xrTableRow4});
this.xrTable4.SizeF = new System.Drawing.SizeF(474.5834F, 25F);
this.xrTable4.StylePriority.UseBorders = false;
this.xrTable4.StylePriority.UsePadding = false;
//
// xrTableRow4
//
this.xrTableRow4.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] {
this.xrTableCell3,
this.xrTableCell4,
this.xrTableCell9});
this.xrTableRow4.Name = "xrTableRow4";
this.xrTableRow4.Weight = 1D;
//
// xrTableCell3
//
this.xrTableCell3.CanGrow = false;
this.xrTableCell3.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Text", null, "Entries.DateTime", "{0:dd.MM.yyyy}")});
this.xrTableCell3.Font = new System.Drawing.Font("Arial", 9.75F);
this.xrTableCell3.Name = "xrTableCell3";
this.xrTableCell3.StylePriority.UseFont = false;
this.xrTableCell3.StylePriority.UseTextAlignment = false;
this.xrTableCell3.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
this.xrTableCell3.Weight = 0.54421768707482976D;
//
// xrTableCell4
//
this.xrTableCell4.CanGrow = false;
this.xrTableCell4.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Text", null, "Entries.DistanceInMeters", "{0:#.00}")});
this.xrTableCell4.Font = new System.Drawing.Font("Arial", 9.75F);
this.xrTableCell4.Name = "xrTableCell4";
this.xrTableCell4.StylePriority.UseFont = false;
this.xrTableCell4.StylePriority.UseTextAlignment = false;
this.xrTableCell4.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
this.xrTableCell4.Weight = 1.028910120556823D;
//
// xrTableCell9
//
this.xrTableCell9.CanGrow = false;
this.xrTableCell9.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Text", null, "Entries.CustomerName")});
this.xrTableCell9.Font = new System.Drawing.Font("Arial", 9.75F);
this.xrTableCell9.Name = "xrTableCell9";
this.xrTableCell9.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 5, 0, 0, 100F);
this.xrTableCell9.StylePriority.UseFont = false;
this.xrTableCell9.StylePriority.UsePadding = false;
this.xrTableCell9.StylePriority.UseTextAlignment = false;
this.xrTableCell9.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
this.xrTableCell9.Weight = 1.655330774159318D;
//
// GroupFooter1
//
this.GroupFooter1.HeightF = 0F;
this.GroupFooter1.Name = "GroupFooter1";
this.GroupFooter1.PageBreak = DevExpress.XtraReports.UI.PageBreak.AfterBand;
//
// GroupHeader2
//
this.GroupHeader2.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
this.xrTable2});
this.GroupHeader2.HeightF = 25F;
this.GroupHeader2.Name = "GroupHeader2";
//
// xrTable2
//
this.xrTable2.Borders = ((DevExpress.XtraPrinting.BorderSide)((((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Top)
| DevExpress.XtraPrinting.BorderSide.Right)
| DevExpress.XtraPrinting.BorderSide.Bottom)));
this.xrTable2.Font = new System.Drawing.Font("Arial", 10F, System.Drawing.FontStyle.Bold);
this.xrTable2.LocationFloat = new DevExpress.Utils.PointFloat(102F, 0F);
this.xrTable2.Name = "xrTable2";
this.xrTable2.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F);
this.xrTable2.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] {
this.xrTableRow2});
this.xrTable2.SizeF = new System.Drawing.SizeF(474.5834F, 25F);
this.xrTable2.StylePriority.UseBorders = false;
this.xrTable2.StylePriority.UseFont = false;
this.xrTable2.StylePriority.UsePadding = false;
//
// xrTableRow2
//
this.xrTableRow2.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] {
this.xrTableCell5,
this.xrTableCell6,
this.xrTableCell7});
this.xrTableRow2.Name = "xrTableRow2";
this.xrTableRow2.Weight = 1D;
//
// xrTableCell5
//
this.xrTableCell5.CanGrow = false;
this.xrTableCell5.Name = "xrTableCell5";
this.xrTableCell5.StylePriority.UseTextAlignment = false;
this.xrTableCell5.Text = "Datum";
this.xrTableCell5.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
this.xrTableCell5.Weight = 0.54421768707482976D;
//
// xrTableCell6
//
this.xrTableCell6.CanGrow = false;
this.xrTableCell6.Name = "xrTableCell6";
this.xrTableCell6.StylePriority.UseTextAlignment = false;
this.xrTableCell6.Text = "gefahrene Kilometer";
this.xrTableCell6.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
this.xrTableCell6.Weight = 1.0289109483071579D;
//
// xrTableCell7
//
this.xrTableCell7.CanGrow = false;
this.xrTableCell7.Name = "xrTableCell7";
this.xrTableCell7.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 5, 0, 0, 100F);
this.xrTableCell7.StylePriority.UsePadding = false;
this.xrTableCell7.StylePriority.UseTextAlignment = false;
this.xrTableCell7.Text = "Klient";
this.xrTableCell7.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
this.xrTableCell7.Weight = 1.6553300906804376D;
//
// objectDataSource1
//
this.objectDataSource1.DataSource = typeof(BeWo.Report.ReportObjects.EmployeeKilometerauswertungsRO);
this.objectDataSource1.Name = "objectDataSource1";
//
// ReportHeader
//
this.ReportHeader.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
this.xrLabel2,
this.xrLabel1});
this.ReportHeader.HeightF = 50F;
this.ReportHeader.Name = "ReportHeader";
//
// xrLabel2
//
this.xrLabel2.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Text", null, "MonthInformation", "Zeitraum: {0:MMMM yyyy}")});
this.xrLabel2.Font = new System.Drawing.Font("Arial", 12F);
this.xrLabel2.LocationFloat = new DevExpress.Utils.PointFloat(0F, 24.99999F);
this.xrLabel2.Name = "xrLabel2";
this.xrLabel2.Padding = new DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 100F);
this.xrLabel2.SizeF = new System.Drawing.SizeF(677.0001F, 25F);
this.xrLabel2.StylePriority.UseFont = false;
this.xrLabel2.StylePriority.UsePadding = false;
//
// xrLabel1
//
this.xrLabel1.Font = new System.Drawing.Font("Arial", 14F);
this.xrLabel1.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F);
this.xrLabel1.Multiline = true;
this.xrLabel1.Name = "xrLabel1";
this.xrLabel1.SizeF = new System.Drawing.SizeF(677.0001F, 25F);
this.xrLabel1.StyleName = "Title";
this.xrLabel1.StylePriority.UseFont = false;
this.xrLabel1.Text = "Auswertung über gefahrene Kilometer für [EmployeeName]";
//
// pageFooterBand1
//
this.pageFooterBand1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
this.xrPageInfo2,
this.xrPageInfo1});
this.pageFooterBand1.HeightF = 48F;
this.pageFooterBand1.Name = "pageFooterBand1";
//
// xrPageInfo2
//
this.xrPageInfo2.Font = new System.Drawing.Font("Arial", 8F);
this.xrPageInfo2.Format = "Seite {0} von {1}";
this.xrPageInfo2.LocationFloat = new DevExpress.Utils.PointFloat(425.1251F, 25F);
this.xrPageInfo2.Name = "xrPageInfo2";
this.xrPageInfo2.SizeF = new System.Drawing.SizeF(243.875F, 23F);
this.xrPageInfo2.StyleName = "PageInfo";
this.xrPageInfo2.StylePriority.UseFont = false;
this.xrPageInfo2.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight;
//
// xrPageInfo1
//
this.xrPageInfo1.Font = new System.Drawing.Font("Arial", 8F);
this.xrPageInfo1.LocationFloat = new DevExpress.Utils.PointFloat(7.999929F, 25F);
this.xrPageInfo1.Name = "xrPageInfo1";
this.xrPageInfo1.PageInfo = DevExpress.XtraPrinting.PageInfo.DateTime;
this.xrPageInfo1.SizeF = new System.Drawing.SizeF(232F, 23F);
this.xrPageInfo1.StyleName = "PageInfo";
this.xrPageInfo1.StylePriority.UseFont = false;
//
// Title
//
this.Title.BackColor = System.Drawing.Color.White;
this.Title.BorderColor = System.Drawing.SystemColors.ControlText;
this.Title.Borders = DevExpress.XtraPrinting.BorderSide.None;
this.Title.BorderWidth = 1F;
this.Title.Font = new System.Drawing.Font("Times New Roman", 24F);
this.Title.ForeColor = System.Drawing.Color.Black;
this.Title.Name = "Title";
//
// FieldCaption
//
this.FieldCaption.BackColor = System.Drawing.Color.White;
this.FieldCaption.BorderColor = System.Drawing.SystemColors.ControlText;
this.FieldCaption.Borders = DevExpress.XtraPrinting.BorderSide.None;
this.FieldCaption.BorderWidth = 1F;
this.FieldCaption.Font = new System.Drawing.Font("Times New Roman", 10F, System.Drawing.FontStyle.Bold);
this.FieldCaption.ForeColor = System.Drawing.Color.Black;
this.FieldCaption.Name = "FieldCaption";
//
// PageInfo
//
this.PageInfo.BackColor = System.Drawing.Color.White;
this.PageInfo.BorderColor = System.Drawing.SystemColors.ControlText;
this.PageInfo.Borders = DevExpress.XtraPrinting.BorderSide.None;
this.PageInfo.BorderWidth = 1F;
this.PageInfo.Font = new System.Drawing.Font("Times New Roman", 8F);
this.PageInfo.ForeColor = System.Drawing.Color.Black;
this.PageInfo.Name = "PageInfo";
//
// DataField
//
this.DataField.BackColor = System.Drawing.Color.White;
this.DataField.BorderColor = System.Drawing.SystemColors.ControlText;
this.DataField.Borders = DevExpress.XtraPrinting.BorderSide.None;
this.DataField.BorderWidth = 1F;
this.DataField.Font = new System.Drawing.Font("Times New Roman", 8F);
this.DataField.ForeColor = System.Drawing.SystemColors.ControlText;
this.DataField.Name = "DataField";
//
// fieldFLS
//
this.fieldFLS.DataMember = "FLSReportGroups.FLSReportDetails";
this.fieldFLS.Expression = "[TotalFLM] / 60\r\n";
this.fieldFLS.FieldType = DevExpress.XtraReports.UI.FieldType.Decimal;
this.fieldFLS.Name = "fieldFLS";
//
// fieldGroupFLS
//
this.fieldGroupFLS.DataMember = "FLSReportGroups";
this.fieldGroupFLS.Expression = "[TotalFLM]/60";
this.fieldGroupFLS.FieldType = DevExpress.XtraReports.UI.FieldType.Decimal;
this.fieldGroupFLS.Name = "fieldGroupFLS";
//
// topMarginBand1
//
this.topMarginBand1.HeightF = 50F;
this.topMarginBand1.Name = "topMarginBand1";
//
// bottomMarginBand1
//
this.bottomMarginBand1.HeightF = 50F;
this.bottomMarginBand1.Name = "bottomMarginBand1";
//
// EmployeeKilometerauswertungsReport
//
this.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] {
this.Detail,
this.DetailReport,
this.ReportHeader,
this.pageFooterBand1,
this.topMarginBand1,
this.bottomMarginBand1});
this.CalculatedFields.AddRange(new DevExpress.XtraReports.UI.CalculatedField[] {
this.fieldFLS,
this.fieldGroupFLS});
this.ComponentStorage.AddRange(new System.ComponentModel.IComponent[] {
this.objectDataSource1});
this.DataSource = this.objectDataSource1;
this.Margins = new System.Drawing.Printing.Margins(75, 75, 50, 50);
this.PageHeight = 1169;
this.PageWidth = 827;
this.PaperKind = System.Drawing.Printing.PaperKind.A4;
this.StyleSheet.AddRange(new DevExpress.XtraReports.UI.XRControlStyle[] {
this.Title,
this.FieldCaption,
this.PageInfo,
this.DataField});
this.Version = "17.1";
((System.ComponentModel.ISupportInitialize)(this.xrTable4)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.xrTable2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.objectDataSource1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this)).EndInit();
}
#endregion
private DevExpress.XtraReports.UI.DetailBand Detail;
private DevExpress.XtraReports.UI.DetailBand Detail1;
private DevExpress.XtraReports.UI.DetailReportBand DetailReport;
private DevExpress.XtraReports.UI.ReportHeaderBand ReportHeader;
private DevExpress.XtraReports.UI.XRLabel xrLabel1;
private DevExpress.XtraReports.UI.PageFooterBand pageFooterBand1;
private DevExpress.XtraReports.UI.XRPageInfo xrPageInfo2;
private DevExpress.XtraReports.UI.XRPageInfo xrPageInfo1;
private DevExpress.XtraReports.UI.XRControlStyle Title;
private DevExpress.XtraReports.UI.XRControlStyle FieldCaption;
private DevExpress.XtraReports.UI.XRControlStyle PageInfo;
private DevExpress.XtraReports.UI.XRControlStyle DataField;
private DevExpress.XtraReports.UI.XRTable xrTable2;
private DevExpress.XtraReports.UI.XRTableRow xrTableRow2;
private DevExpress.XtraReports.UI.XRTableCell xrTableCell5;
private DevExpress.XtraReports.UI.XRTableCell xrTableCell6;
private DevExpress.XtraReports.UI.XRTableCell xrTableCell7;
private DevExpress.XtraReports.UI.DetailReportBand DetailReport1;
private DevExpress.XtraReports.UI.DetailBand Detail2;
private DevExpress.XtraReports.UI.XRTable xrTable4;
private DevExpress.XtraReports.UI.XRTableRow xrTableRow4;
private DevExpress.XtraReports.UI.XRTableCell xrTableCell3;
private DevExpress.XtraReports.UI.XRTableCell xrTableCell4;
private DevExpress.XtraReports.UI.XRTableCell xrTableCell9;
private DevExpress.XtraReports.UI.XRLabel xrLabel2;
private DevExpress.XtraReports.UI.XRLabel xrLabel13;
private DevExpress.XtraReports.UI.CalculatedField fieldFLS;
private DevExpress.XtraReports.UI.CalculatedField fieldGroupFLS;
private DevExpress.XtraReports.UI.GroupFooterBand GroupFooter1;
private DevExpress.XtraReports.UI.TopMarginBand topMarginBand1;
private DevExpress.XtraReports.UI.BottomMarginBand bottomMarginBand1;
private DevExpress.XtraReports.UI.GroupHeaderBand GroupHeader2;
private DevExpress.DataAccess.ObjectBinding.ObjectDataSource objectDataSource1;
}
}

View File

@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="objectDataSource1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@@ -191,12 +191,24 @@
<Compile Include="DefaultReports\AdditionalServiceBookingReport.Designer.cs">
<DependentUpon>AdditionalServiceBookingReport.cs</DependentUpon>
</Compile>
<Compile Include="DefaultReports\EmployeeKilometerauswertungsListReport.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="DefaultReports\EmployeeKilometerauswertungsListReport.Designer.cs">
<DependentUpon>EmployeeKilometerauswertungsListReport.cs</DependentUpon>
</Compile>
<Compile Include="DefaultReports\KilometerauswertungsListReport.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="DefaultReports\KilometerauswertungsListReport.Designer.cs">
<DependentUpon>KilometerauswertungsListReport.cs</DependentUpon>
</Compile>
<Compile Include="DefaultReports\EmployeeKilometerauswertungsReport.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="DefaultReports\EmployeeKilometerauswertungsReport.designer.cs">
<DependentUpon>EmployeeKilometerauswertungsReport.cs</DependentUpon>
</Compile>
<Compile Include="DefaultReports\KilometerauswertungsReport.cs">
<SubType>Component</SubType>
</Compile>
@@ -430,6 +442,8 @@
<Compile Include="ReportObjects\AssessmentSheetRO.cs" />
<Compile Include="ReportObjects\AuslastungBerechnung.cs" />
<Compile Include="ReportObjects\EmployeeDataRO.cs" />
<Compile Include="ReportObjects\EmployeeKilometerauswertungsListRO.cs" />
<Compile Include="ReportObjects\EmployeeKilometerauswertungsRO.cs" />
<Compile Include="ReportObjects\MitarbeiterstundenkontoBerechnungTagesansicht.cs" />
<Compile Include="ReportObjects\KalenderRO.cs" />
<Compile Include="ReportObjects\FinanceRO.cs" />
@@ -472,10 +486,17 @@
<EmbeddedResource Include="DefaultReports\AdditionalServiceBookingReport.resx">
<DependentUpon>AdditionalServiceBookingReport.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="DefaultReports\EmployeeKilometerauswertungsListReport.resx">
<DependentUpon>EmployeeKilometerauswertungsListReport.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="DefaultReports\KilometerauswertungsListReport.resx">
<DependentUpon>KilometerauswertungsListReport.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="DefaultReports\EmployeeKilometerauswertungsReport.resx">
<DependentUpon>EmployeeKilometerauswertungsReport.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="DefaultReports\KilometerauswertungsReport.resx">
<DependentUpon>KilometerauswertungsReport.cs</DependentUpon>
</EmbeddedResource>

View File

@@ -0,0 +1,79 @@
using System;
using System.Collections.Generic;
using System.Linq;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BS.Shared.Core;
using BS.Shared.DataContracts.Compact;
namespace BeWo.Report.ReportObjects
{
public class EmployeeKilometerauswertungsListRO : AbstractBeWoReportObject<EmployeeKilometerauswertungsListRO>
{
public List<CompactEmployeeDC> AllEmployees { get; set; }
public DateTime MonthInformation { get; set; }
public List<Employee2EmployeeKilometerauswertungsEntry> Employees2Entries { get; set; } = new List<Employee2EmployeeKilometerauswertungsEntry>();
public static EmployeeKilometerauswertungsListRO Create(List<CompactEmployeeDC> employees, DateTime monthInformation)
{
var employeeKilometerauswertungsListRO = new EmployeeKilometerauswertungsListRO
{
AllEmployees = employees,
MonthInformation = monthInformation
};
employeeKilometerauswertungsListRO.CreateEntries();
return employeeKilometerauswertungsListRO;
}
public void CreateEntries()
{
var start = MonthInformation;
var end = start.AddMonths(1).AddDays(-1);
var timeSpan = new DateTimeSpan(start, end);
var rawData = DAOFactory.SearchDAO.FindListOfEmployeeServiceRecordsForKilometerauswertung(AllEmployees.Select(employee => employee.EmployeeOid).ToList(), timeSpan);
foreach(var employeeOid2ServiceRecords in rawData)
{
var employee = AllEmployees.FirstOrDefault(e => e.EmployeeOid == employeeOid2ServiceRecords.Key);
if(employee != null)
{
var employee2KilometerauswertungsEntry = new Employee2EmployeeKilometerauswertungsEntry(employee, employeeOid2ServiceRecords.Value.OrderBy(serviceRecord => serviceRecord.Start));
Employees2Entries.Add(employee2KilometerauswertungsEntry);
}
}
}
}
public class Employee2EmployeeKilometerauswertungsEntry
{
public CompactEmployeeDC Employee { get; set; }
public string EmployeeName => Employee?.ToString();
public List<EmployeeKilometerauswertungsEntry> Entries { get; set; }
public int TotalDistanceInMeters { get; set; }
public Employee2EmployeeKilometerauswertungsEntry(CompactEmployeeDC employee, IEnumerable<ServiceRecord> serviceRecords)
{
Employee = employee;
Entries = new List<EmployeeKilometerauswertungsEntry>();
TotalDistanceInMeters = 0;
foreach(var serviceRecord in serviceRecords.Where(serviceRecord => serviceRecord.DistanceInMeter.HasValue && serviceRecord.Start.HasValue))
{
TotalDistanceInMeters += serviceRecord.DistanceInMeter.Value;
Entries.Add(new EmployeeKilometerauswertungsEntry(serviceRecord.Start.Value, serviceRecord.DistanceInMeter.Value, serviceRecord.Customer?.Person?.LastNameFirstName ?? string.Empty));
}
}
}
}

View File

@@ -0,0 +1,69 @@
using System;
using System.Collections.Generic;
using System.Linq;
using BeWo.Data.Access;
using BS.Shared.Core;
using BS.Shared.DataContracts.Compact;
namespace BeWo.Report.ReportObjects
{
public class EmployeeKilometerauswertungsRO : AbstractBeWoReportObject<EmployeeKilometerauswertungsRO>
{
public CompactEmployeeDC Employee { get; set; }
public string EmployeeName => Employee?.ToString();
public DateTime MonthInformation { get; set; }
public int TotalDistanceInMeters { get; set; }
public List<EmployeeKilometerauswertungsEntry> Entries { get; set; }
public static EmployeeKilometerauswertungsRO Create(CompactEmployeeDC employee, DateTime monthInformation)
{
var employeeKilometerauswertung = new EmployeeKilometerauswertungsRO
{
Employee = employee,
MonthInformation = monthInformation
};
return employeeKilometerauswertung;
}
public void CreateDistanceList()
{
var start = MonthInformation;
var end = start.AddMonths(1).AddDays(-1);
var timeSpan = new DateTimeSpan(start, end);
var serviceRecords = DAOFactory.SearchDAO.FindEmployeeServiceRecordsForKilometerauswertung(Employee.EmployeeOid, timeSpan);
Entries = new List<EmployeeKilometerauswertungsEntry>();
TotalDistanceInMeters = 0;
foreach(var serviceRecord in serviceRecords.Where(serviceRecord => serviceRecord.DistanceInMeter.HasValue && serviceRecord.DistanceInMeter > 0 && serviceRecord.Start.HasValue))
{
TotalDistanceInMeters += serviceRecord.DistanceInMeter.Value;
Entries.Add(new EmployeeKilometerauswertungsEntry(serviceRecord.Start.Value, serviceRecord.DistanceInMeter.Value, serviceRecord.Customer?.Person?.LastNameFirstName ?? string.Empty));
}
}
}
public class EmployeeKilometerauswertungsEntry
{
public DateTime DateTime { get; }
public int DistanceInMeters { get; }
public string CustomerName { get; }
public EmployeeKilometerauswertungsEntry(DateTime dateTime, int distanceInMeters, string customerName)
{
DateTime = dateTime;
DistanceInMeters = distanceInMeters;
CustomerName = customerName;
}
}
}

View File

@@ -45,7 +45,7 @@ namespace BeWo.Report.ReportObjects
if(customer != null)
{
var customer2KilometerauswertungsEntry = new Customer2KilometerauswertungsEntry(customer, customerOid2Servicerecords.Value);
var customer2KilometerauswertungsEntry = new Customer2KilometerauswertungsEntry(customer, customerOid2Servicerecords.Value.OrderBy(serviceRecord => serviceRecord.Start));
Customer2Entries.Add(customer2KilometerauswertungsEntry);
}
}
@@ -62,7 +62,7 @@ namespace BeWo.Report.ReportObjects
public int TotalDistanceInMeters { get; set; }
public Customer2KilometerauswertungsEntry(CompactCustomerDC customer, List<ServiceRecord> serviceRecords)
public Customer2KilometerauswertungsEntry(CompactCustomerDC customer, IEnumerable<ServiceRecord> serviceRecords)
{
Customer = customer;

View File

@@ -9,6 +9,7 @@ using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
using DevExpress.Data.Mask;
namespace ReportingService.ServiceContracts
{
@@ -59,5 +60,12 @@ namespace ReportingService.ServiceContracts
[OperationContract]
bool CheckForAnyServiceRecordsWithDistanceValues(List<long> customerOids, DateTimeSpan span);
[FaultContract(typeof(BeWoFault))]
[OperationContract]
MemoryStream CreateEmployeeKilometerauswertung(long employeeOid, DateTime range);
[FaultContract(typeof(BeWoFault))]
[OperationContract]
MemoryStream CreateKilometerauswertungForAllEmployees(List<long> employeeOids, DateTime rangeDate);
}
}

View File

@@ -228,5 +228,23 @@ namespace ReportingService.ServiceImplementations
{
return DAOFactory.SearchDAO.CheckForAnyServiceRecordsWithDistanceValues(customerOids, span);
}
public MemoryStream CreateEmployeeKilometerauswertung(long employeeOid, DateTime range)
{
var reportCreator = GetReportCreator();
var report = reportCreator.CreateEmployeeKilometerauswertung(employeeOid, range);
return report == null ? null : CreateReportStream(report);
}
public MemoryStream CreateKilometerauswertungForAllEmployees(List<long> employeeOids, DateTime rangeDate)
{
var reportCreator = GetReportCreator();
var report = reportCreator.CreateKilometerauswertungForAllEmployees(employeeOids, rangeDate);
return report == null ? null : CreateReportStream(report);
}
}
}

View File

@@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Linq;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BS.Shared.DataContracts;
@@ -12,8 +9,9 @@ namespace BeWo.Service.DCEntityMapper
{
public override ConfirmationReceiptSignatureDC MergeWithDC(ConfirmationReceiptSignature pEntity, ConfirmationReceiptSignatureDC pDataContract)
{
pDataContract.ConfirmationReceiptSignatureOid = pEntity.Oid;
pDataContract.ConfirmationReceiptSignatureVersion = pEntity.Version;
pDataContract.SignatureImage = pEntity.SignatureImage;
pDataContract.EmployeeOid = pEntity.EmployeeOid;
pDataContract.ServiceRecords = MapperFactory.ServiceRecordDC_ServiceRecord.MapToNewDCs(pEntity.ServiceRecords);
@@ -23,12 +21,29 @@ namespace BeWo.Service.DCEntityMapper
public override ConfirmationReceiptSignature MergeWithEntity(ConfirmationReceiptSignatureDC pDataContract, ConfirmationReceiptSignature pEntity)
{
throw new NotImplementedException();
ConcurrencyCheck(pDataContract.ConfirmationReceiptSignatureVersion, pEntity);
pEntity.Oid = pDataContract.ConfirmationReceiptSignatureOid;
pEntity.Version = pDataContract.ConfirmationReceiptSignatureVersion;
pEntity.SignatureImage = pDataContract.SignatureImage;
pEntity.EmployeeOid = pDataContract.EmployeeOid;
if(pDataContract.ServiceRecords != null)
{
pEntity.ServiceRecords = DAOFactory.GenericDAO.LoadByIDs<ServiceRecord>(pDataContract.ServiceRecords.Select(s => s.ServiceRecordOid.Value));
}
return pEntity;
}
protected override bool AreDCAndEntityEqual(ConfirmationReceiptSignatureDC pDC, ConfirmationReceiptSignature pEntity)
{
throw new NotImplementedException();
if(pDC.ConfirmationReceiptSignatureOid == null)
{
return false;
}
return pDC.ConfirmationReceiptSignatureOid == pEntity.Oid;
}
}
}

View File

@@ -383,5 +383,9 @@ namespace BeWo.Service.ServiceContracts
[FaultContract(typeof(BeWoFault))]
[OperationContract]
List<CompactCustomerDC> GetActiveCompactCustomersForEmployee(long? employeeOid);
[FaultContract(typeof(BeWoFault))]
[OperationContract]
List<CompactEmployeeDC> GetActiveCompactEmployeesForEmployee(long employeeOid);
}
}

View File

@@ -1,12 +1,11 @@
using System;
using System.Collections.Generic;
using System.ServiceModel;
using BeWo.Data.Entities;
using BS.Shared;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
using BS.Shared.DataContracts.Reports;
using System;
using System.Collections.Generic;
using System.ServiceModel;
namespace BeWo.Service.ServiceContracts
{
@@ -944,6 +943,10 @@ namespace BeWo.Service.ServiceContracts
[OperationContract]
List<ConfirmationReceiptSignatureDC> GetConfirmationReceiptSignaturesByServiceRecord(long serviceRecordOid);
[FaultContract(typeof(BeWoFault))]
[OperationContract]
List<ConfirmationReceiptSignatureDC> GetAllConfirmationReceiptSignatures();
[FaultContract(typeof(BeWoFault))]
[OperationContract]
void UpdateDienst(List<DienstInfoDC> dienste);
@@ -967,5 +970,9 @@ namespace BeWo.Service.ServiceContracts
[FaultContract(typeof(BeWoFault))]
[OperationContract]
List<AbsenceTimeDC> GetAbsenceTimeVacationByWohnheim(long wohnId, int year, int month);
[FaultContract(typeof(BeWoFault))]
[OperationContract]
List<ServiceRecordDC> GetServiceRecordsByIds(List<long> serviceRecordOids);
}
}

View File

@@ -1645,5 +1645,19 @@ namespace BeWo.Service.ServiceImplementations
throw Utils.CreateBeWoFaultException(exception);
}
}
public List<CompactEmployeeDC> GetActiveCompactEmployeesForEmployee(long employeeOid)
{
try
{
var employees = DAOFactory.SearchDAO.GetAllActiveEmployeesForEmployee(employeeOid);
return MapperFactory.CompactEmployeeDC_Employee.MapToNewDCs(employees);
}
catch(Exception exception)
{
throw Utils.CreateBeWoFaultException(exception);
}
}
}
}

View File

@@ -6371,5 +6371,29 @@ namespace BeWo.Service.ServiceImplementations
throw Utils.CreateBeWoFaultException(exception);
}
}
public List<ConfirmationReceiptSignatureDC> GetAllConfirmationReceiptSignatures()
{
try
{
return MapperFactory.ConfirmationReceiptSignatureDC_ConfirmationReceiptSignature.MapToNewDCs(DAOFactory.GenericDAO.GetAllActive<ConfirmationReceiptSignature>());
}
catch(Exception exception)
{
throw Utils.CreateBeWoFaultException(exception);
}
}
public List<ServiceRecordDC> GetServiceRecordsByIds(List<long> serviceRecordOids)
{
try
{
return MapperFactory.ServiceRecordDC_ServiceRecord.MapToNewDCs(DAOFactory.GenericDAO.LoadByIDs<ServiceRecord>(serviceRecordOids));
}
catch(Exception exception)
{
throw Utils.CreateBeWoFaultException(exception);
}
}
}
}