Zeiterfassung so weit fertig, verbesserungen aber noch möglich
This commit is contained in:
@@ -1507,18 +1507,19 @@ namespace BeWo.Core
|
||||
dc.CostBearer = cbDc;
|
||||
|
||||
if(vm.ServiceRecordFormat != ServiceRecordFormate.ZeiterfassungMitMonatJahr){
|
||||
|
||||
dc.Start = new DateTime(vm.Date.Value.Year,
|
||||
vm.Date.Value.Month,
|
||||
vm.Date.Value.Day,
|
||||
vm.StartTime == null ? vm.DateAndTime.Value.Hour : vm.StartDate.Value.Hour,
|
||||
vm.StartTime == null ? vm.DateAndTime.Value.Minute : vm.StartDate.Value.Minute,
|
||||
vm.StartTime == null ? vm.DateAndTime.Value.Second : vm.StartDate.Value.Second);
|
||||
|
||||
|
||||
//muss noch bearbeitet werden weil alt eversion || eine unterscheidung zwischen stunden und minuten abfragen
|
||||
|
||||
if(vm.DurationInStunden == ZeiterfassungsDauer.Minuten)
|
||||
{
|
||||
if (vm.ServiceRecordFormat != ServiceRecordFormate.ZeiterfassungMitEndDatum)
|
||||
if (vm.ServiceRecordFormat == ServiceRecordFormate.ZeiterfassungMitEndDatum)
|
||||
{
|
||||
dc.End = dc.Start.Value.AddMinutes(Convert.ToDouble(vm.DurationSTD));
|
||||
}
|
||||
@@ -1529,7 +1530,7 @@ namespace BeWo.Core
|
||||
}
|
||||
else
|
||||
{
|
||||
if (vm.ServiceRecordFormat != ServiceRecordFormate.ZeiterfassungMitEndDatum)
|
||||
if (vm.ServiceRecordFormat == ServiceRecordFormate.ZeiterfassungMitEndDatum)
|
||||
{
|
||||
dc.End = dc.Start.Value.AddHours(Convert.ToDouble(vm.DurationSTD));
|
||||
}
|
||||
|
||||
@@ -420,57 +420,7 @@ namespace BeWo.ViewModel
|
||||
TimeCheck();
|
||||
}
|
||||
|
||||
FirePropertyChanged(PropertyName_Date);
|
||||
|
||||
//Diese abfrage genauso zur timecheck verlegen !! deswegen machen wir ja timecheck.
|
||||
//if (BeWoApp.AppSettings.IsEndDateVisible)
|
||||
//{
|
||||
// if (oldDate != _Date)
|
||||
// {
|
||||
// // decimal dura = DurationSTD.Value/1440;
|
||||
|
||||
// // var x = oldDate.Value.Day - _Date.Value.Day;
|
||||
// var x = _Date.Value.Date - oldDate.Value.Date;//_EditableEndDate.Value.Day;
|
||||
|
||||
// int daydiff;
|
||||
// if (_DurationInStunden == ZeiterfassungsDauer.Minuten)
|
||||
// {
|
||||
// daydiff = (int) x.Days * 1440;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// daydiff = (int)x.Days * 24;
|
||||
// }
|
||||
|
||||
|
||||
// if (DurationSTD.HasValue)
|
||||
// {
|
||||
|
||||
// if (EditableEndDate.Value.Date <= _Date.Value.Date)
|
||||
// {
|
||||
// DurationSTD = 0;
|
||||
// }else{
|
||||
// DurationSTD = DurationSTD.Value - daydiff;
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (_EditableEndDate.Value.Date <= oldDate.Value)
|
||||
// {
|
||||
// DurationSTD = 0;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// DurationSTD = 0 - daydiff;
|
||||
// }
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
|
||||
|
||||
//}
|
||||
|
||||
FirePropertyChanged(PropertyName_Date);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -600,17 +550,36 @@ namespace BeWo.ViewModel
|
||||
}
|
||||
|
||||
//?? Keine ahnung weis nicht ??
|
||||
if (_DurationInStunden == ZeiterfassungsDauer.Stunden)
|
||||
//if (_DurationInStunden == ZeiterfassungsDauer.Stunden)
|
||||
//{
|
||||
// rd = rd/60;
|
||||
// Duration = Duration/60;
|
||||
// DurationSTD = DurationSTD/60;
|
||||
// DurationMonthYearGes = DurationMonthYearGes/60;
|
||||
//}
|
||||
|
||||
// hier abfrage + statt durationstd , duration
|
||||
if(_ServiceRecordFormat == ServiceRecordFormate.ZeiterfassungMitEndDatum) {
|
||||
|
||||
var strResult = _GroupOid != null ? String.Format("{0} ({0})", rd) : String.Format("{0} ({1})", DurationSTD, rd);
|
||||
|
||||
return strResult;
|
||||
|
||||
}else if (_ServiceRecordFormat == ServiceRecordFormate.ZeiterfassungMitMonatJahr)
|
||||
{
|
||||
rd = rd/60;
|
||||
Duration = Duration/60;
|
||||
var strResult = _GroupOid != null ? String.Format("{0} ({0})", rd) : String.Format("{0} ({1})", DurationMonthYearGes, rd);
|
||||
|
||||
return strResult;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
var strResult = _GroupOid != null ? String.Format("{0} ({0})", rd) : String.Format("{0} ({1})", Duration, rd);
|
||||
|
||||
return strResult;
|
||||
}
|
||||
|
||||
|
||||
var strResult = _GroupOid != null ? String.Format("{0} ({0})", rd) : String.Format("{0} ({1})", Duration, rd);
|
||||
|
||||
|
||||
return strResult;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -908,11 +877,7 @@ namespace BeWo.ViewModel
|
||||
{
|
||||
//eigentlich unnötig aber erstma drinne lassen zur zusätzlichen überprüfung
|
||||
if (BeWoApp.AppSettings.IsEndDateVisible)
|
||||
{
|
||||
|
||||
//und was das soll weis ich noch nicht
|
||||
//var olddate = _EditableEndDate;
|
||||
|
||||
{
|
||||
|
||||
if (AreDifferent(_EditableEndDate, value))
|
||||
{
|
||||
@@ -940,179 +905,11 @@ namespace BeWo.ViewModel
|
||||
}
|
||||
|
||||
|
||||
//Brauch ich glaub ich garnet soll das doch alles die Timecheck überprüfen
|
||||
////Warum setzte ich nochmal die startzeit ??
|
||||
////wenn start gesetzt ist
|
||||
//if (StartTime != null)
|
||||
//{
|
||||
// //mache nix
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// //mache etwas
|
||||
|
||||
//}
|
||||
|
||||
|
||||
|
||||
FirePropertyChanged(PropertyName_EditableEndDate);
|
||||
FirePropertyChanged(PropertyName_DurationSTD);
|
||||
TimeCheckForDurationSTD();
|
||||
}
|
||||
|
||||
|
||||
//##############################################################################################################
|
||||
//alter bereich muss gelöscht werden sobald das neue fertig sein sollte
|
||||
//if (StartTime != null && DurationSTD != 0)
|
||||
//{
|
||||
// //Muss unbeding bearbeitet werden
|
||||
// //var start = StartTime.Value;
|
||||
|
||||
|
||||
// var diff = _EditableEndDate.Value.Subtract(StartTime.Value);
|
||||
|
||||
// //Mann wie soll ich das den machen
|
||||
// //DurationSTD = (int)diff.TotalMinutes;
|
||||
// if (diff.TotalHours != 0 && diff.TotalDays > 0) // die abfrage könnte fail sein
|
||||
// {
|
||||
// //hier liegt immer noch das problem.
|
||||
// //für die differenz startstunden mit endstunden vergleichen und zu diff total hinzuzählen
|
||||
|
||||
// var diffhour = EndTime.Value.Hour - start.Hour;
|
||||
|
||||
|
||||
// diffhour = diffhour*60;
|
||||
|
||||
// if (olddate != _EditableEndDate && olddate > _EditableEndDate)
|
||||
// {
|
||||
// // decimal dura = DurationSTD.Value/1440;
|
||||
|
||||
// // var x = olddate.Value.Day - _EditableEndDate.Value.Day;
|
||||
|
||||
// //int daydiff = (int) x*1440;
|
||||
|
||||
|
||||
|
||||
// //var ahh = _EndTime.Value.Subtract(start);
|
||||
|
||||
// var ahh = _EndTime.Value.Subtract(_EditableEndDate.Value);
|
||||
// // var x = ahh.Days -
|
||||
|
||||
// int s = 0;
|
||||
|
||||
// if (_DurationInStunden == ZeiterfassungsDauer.Stunden)
|
||||
// {
|
||||
// // s = (int)ahh.Hours;
|
||||
// s = ahh.Days*24;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// // s = (int)ahh.Minutes;
|
||||
// s = ahh.Days*1440;
|
||||
// }
|
||||
|
||||
|
||||
// //if (s < 0) // keine ahnung glaub ich muss dass entfernen
|
||||
// //{
|
||||
// // s = s * -1;
|
||||
// //}
|
||||
|
||||
|
||||
// DurationSTD = DurationSTD - s;
|
||||
|
||||
|
||||
// // DurationSTD = DurationSTD.Value - daydiff;
|
||||
|
||||
// }
|
||||
// else if (olddate != _EditableEndDate && olddate < _EditableEndDate)
|
||||
// {
|
||||
// var x = olddate.Value.Day - _EditableEndDate.Value.Day;
|
||||
|
||||
// int daydiff = (int)x * 1440;
|
||||
|
||||
// if (daydiff < 0) // keine ahnung glaub ich muss dass entfernen
|
||||
// {
|
||||
// daydiff = daydiff * -1;
|
||||
// }
|
||||
|
||||
|
||||
// if (_DurationInStunden == ZeiterfassungsDauer.Stunden)
|
||||
// {
|
||||
// daydiff = daydiff/60;
|
||||
|
||||
// DurationSTD = DurationSTD.Value + daydiff;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// DurationSTD = DurationSTD.Value + daydiff;
|
||||
// }
|
||||
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (olddate.Value.Date < _Date.Value.Date)
|
||||
// {
|
||||
// DurationSTD = 0;
|
||||
// }
|
||||
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
|
||||
// // dieser bereich muss kurz bearbeitet werden.
|
||||
// // var ahh = _EndTime.Value.Subtract(start);
|
||||
|
||||
// int s = 0;
|
||||
|
||||
// var ahh = _EndTime.Value.Subtract(_EditableEndDate.Value);
|
||||
|
||||
// if(_DurationInStunden == ZeiterfassungsDauer.Stunden){
|
||||
// // s = (int)ahh.Hours;
|
||||
// s = s + (ahh.Days * 24);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
|
||||
// s = (ahh.Days * 1440);
|
||||
// }
|
||||
|
||||
|
||||
// //if (s < 0) // keine ahnung glaub ich muss dass entfernen
|
||||
// //{
|
||||
// // s = s*-1;
|
||||
// //}
|
||||
|
||||
|
||||
// DurationSTD = DurationSTD - s;
|
||||
|
||||
// }
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
|
||||
// StartTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, 0, 0);
|
||||
|
||||
// _EditableEndDate.Value.AddHours(StartTime.Value.Hour);
|
||||
|
||||
|
||||
// var stx = _EditableEndDate.Value.Day - StartTime.Value.Day;
|
||||
|
||||
// int daydiff = stx*1440;
|
||||
|
||||
|
||||
|
||||
// if (_EditableEndDate.Value.Date < _Date.Value.Date)
|
||||
// {
|
||||
// DurationSTD = 0;
|
||||
// }
|
||||
|
||||
// //DurationSTD = daydiff;
|
||||
|
||||
//}
|
||||
//Timecheck durchführen und die range zwischen den daten prüfen und zur duration hinzufügen
|
||||
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1304,21 +1101,7 @@ namespace BeWo.ViewModel
|
||||
get
|
||||
{
|
||||
var date = string.Empty;
|
||||
|
||||
//if (_Date != null)
|
||||
//{
|
||||
|
||||
// if (_EditableEndDate.Value.Date != _Date.Value.Date)
|
||||
// {
|
||||
// date = DateTimeFormatInfo.CurrentInfo.GetAbbreviatedDayName(_Date.Value.DayOfWeek) + ", " + _Date.Value.ToShortDateString() + " - " + _EditableEndDate.Value.ToShortDateString();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// date = DateTimeFormatInfo.CurrentInfo.GetAbbreviatedDayName(_Date.Value.DayOfWeek) + ", " + _Date.Value.ToShortDateString();
|
||||
// }
|
||||
|
||||
//}
|
||||
|
||||
|
||||
string time = string.Empty;
|
||||
|
||||
string endtime = string.Empty;
|
||||
@@ -1349,17 +1132,23 @@ namespace BeWo.ViewModel
|
||||
if (_Date != null)
|
||||
{
|
||||
|
||||
if (_EditableEndDate.Value.Date != _Date.Value.Date)
|
||||
if (endtime.Equals("") && time.Equals(""))
|
||||
{
|
||||
date = DateTimeFormatInfo.CurrentInfo.GetAbbreviatedDayName(_Date.Value.DayOfWeek) + ", " + _Date.Value.ToShortDateString() + " " + time + " - " + _EditableEndDate.Value.ToShortDateString() + " " + endtime;
|
||||
date = DateTimeFormatInfo.CurrentInfo.GetAbbreviatedDayName(_Date.Value.DayOfWeek) + ", " + _Date.Value.ToShortDateString();
|
||||
}
|
||||
else
|
||||
{
|
||||
time = time + " - " + endtime;
|
||||
date = DateTimeFormatInfo.CurrentInfo.GetAbbreviatedDayName(_Date.Value.DayOfWeek) + ", " + _Date.Value.ToShortDateString() + " " + time;
|
||||
else {
|
||||
|
||||
if (_EditableEndDate.Value.Date != _Date.Value.Date)
|
||||
{
|
||||
date = DateTimeFormatInfo.CurrentInfo.GetAbbreviatedDayName(_Date.Value.DayOfWeek) + ", " + _Date.Value.ToShortDateString() + " " + time + " - " + _EditableEndDate.Value.ToShortDateString() + " " + endtime;
|
||||
}
|
||||
else
|
||||
{
|
||||
time = time + " - " + endtime;
|
||||
date = DateTimeFormatInfo.CurrentInfo.GetAbbreviatedDayName(_Date.Value.DayOfWeek) + ", " + _Date.Value.ToShortDateString() + " " + time;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//date += " " + time;
|
||||
|
||||
@@ -1796,10 +1585,9 @@ namespace BeWo.ViewModel
|
||||
|
||||
set
|
||||
{
|
||||
//minimale probleme
|
||||
|
||||
if (value == ZeiterfassungsDauer.Minuten && _DurationInStunden == ZeiterfassungsDauer.Stunden )
|
||||
{
|
||||
|
||||
if (BeWoApp.AppSettings.IsZeiterfassDateNormal)
|
||||
Duration = _Duration * 60;
|
||||
|
||||
@@ -2110,7 +1898,7 @@ namespace BeWo.ViewModel
|
||||
copy.GroupOid = GroupOid;
|
||||
copy.GroupRoundedDuration = GroupRoundedDuration;
|
||||
|
||||
//??
|
||||
|
||||
copy.DurationInStunden = DurationInStunden;
|
||||
copy.ServiceRecordFormat = ServiceRecordFormat;
|
||||
|
||||
@@ -2259,7 +2047,7 @@ namespace BeWo.ViewModel
|
||||
|
||||
private ServiceRecordDC CopyToDataContract(ServiceRecordDC pDataContract)
|
||||
{
|
||||
if (_ServiceRecordFormat == ServiceRecordFormate.ZeiterfassungMitEndDatum)
|
||||
if (BeWoApp.AppSettings.IsEndDateVisible )
|
||||
{
|
||||
pDataContract.Start = _Date;
|
||||
pDataContract.End = _EditableEndDate;
|
||||
@@ -2280,7 +2068,7 @@ namespace BeWo.ViewModel
|
||||
|
||||
ServiceRecordFormat = ServiceRecordFormate.ZeiterfassungMitEndDatum;
|
||||
}
|
||||
else if (_ServiceRecordFormat == ServiceRecordFormate.ZeiterfassungMitMonatJahr)
|
||||
else if (BeWoApp.AppSettings.IsOnlyYearMonthVisible)
|
||||
{
|
||||
var dates = DateTime.Parse("1." + _OnlyMonth + _OnlyYear);
|
||||
|
||||
@@ -2465,8 +2253,8 @@ namespace BeWo.ViewModel
|
||||
|
||||
if (_StartTime == null && _EndTime == null && duration == 0)
|
||||
{
|
||||
_StartTime = new DateTime(_Date.Value.Year, _Date.Value.Month, _Date.Value.Day, 0, 0, 0);
|
||||
_EndTime = new DateTime(_EditableEndDate.Value.Year, _EditableEndDate.Value.Month, _EditableEndDate.Value.Day, 0, 0, 0);
|
||||
_StartTime = new DateTime(_Date.Value.Year, _Date.Value.Month, _Date.Value.Day, 0, 0, 1);
|
||||
_EndTime = new DateTime(_EditableEndDate.Value.Year, _EditableEndDate.Value.Month, _EditableEndDate.Value.Day, 0, 0, 1);
|
||||
}
|
||||
else if (_StartTime == null && _EndTime == null)
|
||||
{
|
||||
@@ -2529,8 +2317,8 @@ namespace BeWo.ViewModel
|
||||
|
||||
if (_StartTime == null && _EndTime == null && duration == 0)
|
||||
{
|
||||
_StartTime = new DateTime(_Date.Value.Year, _Date.Value.Month, _Date.Value.Day, 0, 0, 0);
|
||||
_EndTime = new DateTime(_EditableEndDate.Value.Year, _EditableEndDate.Value.Month, _EditableEndDate.Value.Day, 0, 0, 0);
|
||||
_StartTime = new DateTime(_Date.Value.Year, _Date.Value.Month, _Date.Value.Day, 0, 0, 1);
|
||||
_EndTime = new DateTime(_EditableEndDate.Value.Year, _EditableEndDate.Value.Month, _EditableEndDate.Value.Day, 0, 0, 1);
|
||||
}
|
||||
else if (_StartTime == null && _EndTime == null)
|
||||
{
|
||||
@@ -2543,7 +2331,7 @@ namespace BeWo.ViewModel
|
||||
|
||||
|
||||
|
||||
_Date = new DateTime(_Date.Value.Year, _Date.Value.Month, _Date.Value.Day, _StartTime.Value.Hour, _StartTime.Value.Minute, 0);
|
||||
_Date = new DateTime(_Date.Value.Year, _Date.Value.Month, _Date.Value.Day, _StartTime.Value.Hour, _StartTime.Value.Minute, _StartTime.Value.Second);
|
||||
_EditableEndDate = new DateTime(_EndTime.Value.Year, _EndTime.Value.Month, _EndTime.Value.Day, _EndTime.Value.Hour, _EndTime.Value.Minute, _EndTime.Value.Second);
|
||||
|
||||
|
||||
@@ -2560,160 +2348,8 @@ namespace BeWo.ViewModel
|
||||
FirePropertyChanged(PropertyName_EndTime);
|
||||
FirePropertyChanged(PropertyName_Date);
|
||||
FirePropertyChanged(PropertyName_EditableEndDate);
|
||||
//#####################################################################
|
||||
|
||||
//if (_EditableEndDate.Value.Date < _Date.Value.Date)
|
||||
//{
|
||||
// duration = 0;
|
||||
//}
|
||||
|
||||
////StoreDirtyInformation rausnehmen und dafür beim service einfach abfragen was gegeben ist, ist glaub ich besser als hiermit rum zu hantieren
|
||||
////StoreDirtyInformation(
|
||||
//// AreDifferent(DataContract.End, (_Date.Value + _StartTime.Value.TimeOfDay).AddMinutes(duration)) ||
|
||||
//// AreDifferent(DataContract.Start, _Date.Value + _StartTime.Value.TimeOfDay), "TIME");
|
||||
|
||||
|
||||
|
||||
// if (_DurationInStunden == ZeiterfassungsDauer.Stunden)
|
||||
// duration = duration * 60;
|
||||
|
||||
|
||||
|
||||
//if(_StartTime.HasValue){
|
||||
// if (_StartTime.Value.Year == 2000)
|
||||
// {
|
||||
// _StartTime = new DateTime(_Date.Value.Year, _Date.Value.Month, _Date.Value.Day, DateTime.Now.Hour, 0, 0);
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
////################ könnte man gebrauchen ##############
|
||||
//if (_StartTime != null)
|
||||
//{
|
||||
// _EndTime = _StartTime.Value.AddMinutes(duration);
|
||||
//}
|
||||
|
||||
//if (_StartTime == null && _EndTime == null)
|
||||
//{
|
||||
// _StartTime = new DateTime(_Date.Value.Year, _Date.Value.Month, _Date.Value.Day, DateTime.Now.Hour, 0, 0); // DateTime.now Year / Month / day
|
||||
// _EndTime = _StartTime.Value.AddMinutes(duration);
|
||||
//}
|
||||
|
||||
//if (_StartTime == null && _EndTime != null)
|
||||
//{
|
||||
// duration = duration * -1;
|
||||
|
||||
// _StartTime = _EndTime.Value.AddMinutes(duration);
|
||||
//}
|
||||
////#####################################################
|
||||
|
||||
////Hier TimeCheck für das enddatum falls aktiv
|
||||
//if (BeWoApp.AppSettings.IsEndDateVisible)
|
||||
//{
|
||||
// int eintag = 0; // hier der tagessatz
|
||||
// var adddays = 0;
|
||||
|
||||
// if (_DurationInStunden == ZeiterfassungsDauer.Minuten)
|
||||
// {
|
||||
// eintag = 1440;
|
||||
|
||||
// }
|
||||
// else if (_DurationInStunden == ZeiterfassungsDauer.Stunden)
|
||||
// {
|
||||
// eintag = 24;
|
||||
// duration = duration/60;
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// //############### ich probier jetzmal was aus #######################
|
||||
|
||||
// if (_DurationInStunden == ZeiterfassungsDauer.Minuten)
|
||||
// {
|
||||
// // Editable enddate muss die Aktuelle Uhrzeit von starttime erhalten und diese Uhrzeit muss dann übergeben werden
|
||||
// //_EditableEndDate = _StartTime; //
|
||||
|
||||
// _Date = _StartTime;
|
||||
// _EditableEndDate = _Date.Value.Date.AddHours(_Date.Value.Hour).AddMinutes(duration);
|
||||
|
||||
// //_EditableEndDate = _Date.Value.Date.AddMinutes(duration);
|
||||
// }
|
||||
// else if (_DurationInStunden == ZeiterfassungsDauer.Stunden)
|
||||
// {
|
||||
|
||||
// _Date = _StartTime;
|
||||
// _EditableEndDate = _Date.Value.AddHours(duration);
|
||||
// }
|
||||
|
||||
//###################################################################
|
||||
|
||||
|
||||
//########################### Alte Version | Die Halbwegs funktioniert ################################
|
||||
/*if (duration == 0 || (_EndTime.Value.Date <= _EditableEndDate.Value.Date && duration < eintag)) // EditableEnddate hat die 11 dabei ist die date_time 10
|
||||
{
|
||||
_EditableEndDate = _Date.Value.Date;
|
||||
}else
|
||||
if (duration >= eintag)
|
||||
{
|
||||
//###### bearbeiten ######
|
||||
decimal dura = duration / eintag;
|
||||
|
||||
var x = (double) dura;
|
||||
|
||||
var zwischen = _EndTime.Value.Subtract(EditableEndDate.Value);
|
||||
|
||||
double eee = 0;
|
||||
|
||||
if (art == ZeiterfassungsDauer.Minuten)
|
||||
{
|
||||
eee = zwischen.TotalMinutes; // das ist murks
|
||||
}
|
||||
else if(art == ZeiterfassungsDauer.Stunden)
|
||||
{
|
||||
eee = zwischen.TotalMinutes; // das ist murks
|
||||
}
|
||||
|
||||
if(_EndTime.Value.Hour > 0 && _EndTime.Value.Date != EditableEndDate.Value.Date ) // hmmmmm
|
||||
{
|
||||
//abfrage um wieviel es sich unterscheidet
|
||||
_EditableEndDate = _Date.Value.Date.AddMinutes(duration);
|
||||
}
|
||||
else
|
||||
{
|
||||
_EditableEndDate = _Date.Value.Date.AddDays(x);
|
||||
}
|
||||
}
|
||||
else if (EditableEndDate.Value.Date >= _Date.Value.Date && duration < 1440 && art != ZeiterfassungsDauer.Stunden)
|
||||
{
|
||||
if (_EndTime.Value.Date != _EditableEndDate.Value.Date && _EndTime.Value.Date < _EditableEndDate.Value.Date) //man warum 10 != 9 deswegen kommt der rein // die abfrage muss verbessert werden
|
||||
{
|
||||
_EditableEndDate = _Date.Value.Date.AddDays(1); // auch hier müssen änderungen vorgenommen werden.
|
||||
|
||||
}else{
|
||||
|
||||
_EditableEndDate = _Date.Value.Date;
|
||||
}
|
||||
}
|
||||
else if (EditableEndDate.Value.Date >= _Date.Value.Date && duration < 24 && art != ZeiterfassungsDauer.Minuten)
|
||||
{
|
||||
|
||||
if (_EndTime.Value.Date != _EditableEndDate.Value.Date && _EndTime.Value.Date < _EditableEndDate.Value.Date )
|
||||
{
|
||||
_EditableEndDate = _Date.Value.Date.AddDays(1); // auch hier müssen änderungen vorgenommen werden.
|
||||
|
||||
}else{
|
||||
_EditableEndDate = _Date.Value.Date;
|
||||
}
|
||||
}*/
|
||||
//######################################################################################
|
||||
}
|
||||
|
||||
|
||||
// FirePropertyChanged(PropertyName_StartTime);
|
||||
//FirePropertyChanged(PropertyName_EndTime);
|
||||
//FirePropertyChanged(PropertyName_EditableEndDate);
|
||||
// FirePropertyChanged(PropertyName_EndDate);
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2012
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.25420.1
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Client", "Client", "{E7543C39-A44C-40C9-82C9-E7FAA2D9A852}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Server", "Server", "{FEB0336B-F053-40B6-92DD-7DE56AB9408A}"
|
||||
@@ -32,6 +34,9 @@ EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BeWoChatServer", "BeWoChatServer\BeWoChatServer.csproj", "{4E069DC0-8153-41E0-A89A-FC1916DF4A5F}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(Performance) = preSolution
|
||||
HasPerformanceSessions = true
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|.NET = Debug|.NET
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -157,9 +162,9 @@ Global
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{3FEBB560-9275-413A-9767-BB68C44EEBC3} = {E7543C39-A44C-40C9-82C9-E7FAA2D9A852}
|
||||
{D5E53B0F-BF5A-41E8-93E2-0F32845FC729} = {E7543C39-A44C-40C9-82C9-E7FAA2D9A852}
|
||||
{094331C3-ECEE-4C89-BBFD-4C9DED89F0EF} = {FEB0336B-F053-40B6-92DD-7DE56AB9408A}
|
||||
{B0D73E3D-4AE7-4024-93A6-DB1F46D7CCEE} = {FEB0336B-F053-40B6-92DD-7DE56AB9408A}
|
||||
{D5E53B0F-BF5A-41E8-93E2-0F32845FC729} = {E7543C39-A44C-40C9-82C9-E7FAA2D9A852}
|
||||
{40D8B312-EA64-49E3-A31A-5E57ED4D5654} = {FEB0336B-F053-40B6-92DD-7DE56AB9408A}
|
||||
{E1154C7B-BB77-4155-9854-DAD8FC5A8BC3} = {FEB0336B-F053-40B6-92DD-7DE56AB9408A}
|
||||
{284B02ED-114A-426C-9162-31BB6CF05589} = {FEB0336B-F053-40B6-92DD-7DE56AB9408A}
|
||||
@@ -167,7 +172,4 @@ Global
|
||||
{D3E18AE6-05A4-44B3-B0F6-6EF696DD306C} = {FEB0336B-F053-40B6-92DD-7DE56AB9408A}
|
||||
{4E069DC0-8153-41E0-A89A-FC1916DF4A5F} = {FEB0336B-F053-40B6-92DD-7DE56AB9408A}
|
||||
EndGlobalSection
|
||||
GlobalSection(Performance) = preSolution
|
||||
HasPerformanceSessions = true
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
@@ -1943,5 +1943,13 @@ namespace BeWo.Data.Access
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
public ServiceRecord FindServiceRecordforHistory(long? ServiceRecordOid)
|
||||
{
|
||||
var c =
|
||||
CreateCriteria<ServiceRecord>().Add(Restrictions.Eq(ServiceRecord.PropertyName_Oid, ServiceRecordOid));
|
||||
|
||||
return c.UniqueResult<ServiceRecord>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using System.Security.Cryptography;
|
||||
using BeWo.Data.Access;
|
||||
using BeWo.Data.Entities;
|
||||
using BS.Shared.DataContracts;
|
||||
|
||||
@@ -39,6 +41,7 @@ namespace BeWo.Service.DCEntityMapper
|
||||
pDataContract.DistanceInMeter = pEntity.DistanceInMeter;
|
||||
pDataContract.Relevance = pEntity.Relevance;
|
||||
pDataContract.IsCreatedInMobileClient = pEntity.IsCreatedInMobileClient;
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
@@ -83,6 +86,9 @@ namespace BeWo.Service.DCEntityMapper
|
||||
pDataContract.SupportConcept =
|
||||
MapperFactory.CompactSupportConceptDC_SupportConcept.MapToNewDC(pEntity.SupportConcept);
|
||||
}
|
||||
|
||||
var x = MapperFactory.ServiceRecordDC_ServiceRecord.MapToNewDC(DAOFactory.SearchDAO.FindServiceRecordforHistory(pEntity.ServiceRecordOid.Value));
|
||||
pDataContract.DurationInStunden = x.DurationInStunden;
|
||||
|
||||
return pDataContract;
|
||||
}
|
||||
|
||||
@@ -915,6 +915,8 @@ namespace BeWo.Service.ServiceImplementations
|
||||
dc.InsertedOn = item.InsTs;
|
||||
dc.InsUser = item.InsUser;
|
||||
|
||||
dc.DurationInStunden = item.DurationInStunden;
|
||||
|
||||
CompactCustomerDC customerDC = null;
|
||||
if (item.Customer != null)
|
||||
{
|
||||
@@ -2364,10 +2366,16 @@ namespace BeWo.Service.ServiceImplementations
|
||||
dc.Notice5 = sr.Notice5;
|
||||
if (sr.ServiceDescription != null)
|
||||
dc.ServiceDescription = MapperFactory.ServiceDescriptionDC_ServiceDescription.MapToNewDC(sr.ServiceDescription);
|
||||
|
||||
|
||||
dc.RoundedDuration = sr.RoundedDuration;
|
||||
dc.DistanceInMeter = sr.DistanceInMeter;
|
||||
|
||||
dc.DistanceInMeter = sr.DistanceInMeter;
|
||||
dc.InsertedOn = sr.InsTs;
|
||||
dc.InsUser = sr.InsUser;
|
||||
|
||||
dc.DurationInStunden = sr.DurationInStunden;
|
||||
|
||||
dc.GroupEmployeeCount = sr.GroupEmployeeCount;
|
||||
dc.GroupPersonCount = sr.GroupPersonCount;
|
||||
dc.GroupRoundedDuration = sr.GroupRoundedDuration;
|
||||
@@ -2387,6 +2395,10 @@ namespace BeWo.Service.ServiceImplementations
|
||||
dc.Employee.ActivationType = sr.Employee.IsActive;
|
||||
}
|
||||
|
||||
//if(sr.DurationInStunden == ZeiterfassungsDauer.Stunden)
|
||||
// dc.RoundedDuration = sr.RoundedDuration /60;
|
||||
//else
|
||||
// dc.RoundedDuration = sr.RoundedDuration;
|
||||
|
||||
//Goals -------------------------
|
||||
var list = new List<ValueListEntryType>();
|
||||
@@ -2422,6 +2434,7 @@ namespace BeWo.Service.ServiceImplementations
|
||||
dc.RoundedDuration = sr.RoundedDuration;
|
||||
dc.InsertedOn = sr.InsTs;
|
||||
dc.InsUser = sr.InsUser;
|
||||
dc.DurationInStunden = sr.DurationInStunden;
|
||||
|
||||
//Customer -----------------
|
||||
dc.Customer = new CompactCustomerDC();
|
||||
|
||||
@@ -109,5 +109,8 @@ namespace BS.Shared.DataContracts
|
||||
|
||||
[DataMember]
|
||||
public bool IsCreatedInMobileClient { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public ZeiterfassungsDauer? DurationInStunden { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user