vorsichtshalber update
This commit is contained in:
@@ -1506,30 +1506,44 @@ namespace BeWo.Core
|
||||
dc.SupportConcept = scDc;
|
||||
dc.CostBearer = cbDc;
|
||||
|
||||
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);
|
||||
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
|
||||
if (BeWoApp.AppSettings.IsEndDateVisible)
|
||||
{
|
||||
if (vm.EndTime.Value.Day != vm.DateAndTime.Value.Day)
|
||||
{
|
||||
dc.End = vm.EndTime.Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
dc.End = dc.Start.Value.AddMinutes(Convert.ToDouble(vm.Duration));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dc.End = dc.Start.Value.AddMinutes(Convert.ToDouble(vm.Duration));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
var dates = DateTime.Parse("1." + vm.OnlyMonth + vm.OnlyYear);
|
||||
|
||||
if (BeWoApp.AppSettings.IsEndDateVisible)
|
||||
{
|
||||
if (vm.EndTime.Value.Day != vm.DateAndTime.Value.Day)
|
||||
{
|
||||
dc.End = vm.EndTime.Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
dc.End = dc.Start.Value.AddMinutes(Convert.ToDouble(vm.Duration));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dc.End = dc.Start.Value.AddMinutes(Convert.ToDouble(vm.Duration));
|
||||
}
|
||||
var StartDatetime = new DateTime(dates.Year, dates.Month, 1, 0, 0, 0);
|
||||
|
||||
dc.Start = StartDatetime;
|
||||
dc.End = StartDatetime.AddHours(vm.DurationMonthYearGes.Value);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (relDc != null)
|
||||
|
||||
@@ -196,9 +196,13 @@ namespace BeWo.View.Detail
|
||||
if (scv == ServiceRecordFormate.ZeiterfassungMitEndDatum/* Settings.IsEndDateVisible*/)
|
||||
{
|
||||
GridMitEnddatum.Visibility = Visibility.Visible;
|
||||
GridOhneEnddatum.Visibility = Visibility.Collapsed;
|
||||
GridMitJahrMonat.Visibility = Visibility.Collapsed;
|
||||
|
||||
GridOhneEnddatum.Visibility = Visibility.Collapsed;
|
||||
//numerictb_duration.EditValue = null; damit wird das problem nicht gelöst
|
||||
|
||||
GridMitJahrMonat.Visibility = Visibility.Collapsed;
|
||||
//numeric_duration3.EditValue = null;
|
||||
|
||||
// ein Bereich für istSTDMin gestzt abfrage
|
||||
if (Settings.IsZeiterfassungInStdMin || zsd == ZeiterfassungsDauer.Stunden)
|
||||
{
|
||||
@@ -211,15 +215,23 @@ namespace BeWo.View.Detail
|
||||
if (scv == ServiceRecordFormate.ZeiterfassungMitMonatJahr/*Settings.IsOnlyYearMonthVisible*/)
|
||||
{
|
||||
GridMitJahrMonat.Visibility = Visibility.Visible;
|
||||
|
||||
GridOhneEnddatum.Visibility = Visibility.Collapsed;
|
||||
//numerictb_duration.EditValue = null;
|
||||
|
||||
GridMitEnddatum.Visibility = Visibility.Collapsed;
|
||||
|
||||
//numeric_duration.EditValue = null;
|
||||
|
||||
}else
|
||||
{
|
||||
GridOhneEnddatum.Visibility = Visibility.Visible;
|
||||
|
||||
GridMitEnddatum.Visibility = Visibility.Collapsed;
|
||||
//numeric_duration.EditValue = null;
|
||||
|
||||
GridMitJahrMonat.Visibility = Visibility.Collapsed;
|
||||
|
||||
//numeric_duration3.EditValue = null;
|
||||
|
||||
// ist STDMin gestzt abfrage
|
||||
if (Settings.IsZeiterfassungInStdMin || zsd == ZeiterfassungsDauer.Stunden)
|
||||
{
|
||||
@@ -264,12 +276,11 @@ namespace BeWo.View.Detail
|
||||
|
||||
bool lValid = !(!_HideCustomers && selectedNode == null);
|
||||
|
||||
lValid = ValidationTrigger.Validate(rootGrid) && lValid;
|
||||
lValid = ValidationTrigger.Validate(rootGrid) && lValid; // das problem löst alle probleme aus.
|
||||
|
||||
if (lValid)
|
||||
{
|
||||
lValid = BeWoUtils.ValidateServiceRecordVM(_ServiceRecordVM, ViewModel.StatisticsDC, _ServiceRecordVM.ChoosenNode, false, _ServiceRecordVM.Employee, null, null);
|
||||
|
||||
lValid = BeWoUtils.ValidateServiceRecordVM(_ServiceRecordVM, ViewModel.StatisticsDC, _ServiceRecordVM.ChoosenNode, false, _ServiceRecordVM.Employee, null, null);
|
||||
}
|
||||
return lValid;
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ namespace BeWo.View.Detail
|
||||
{
|
||||
combobox_services.SelectedIndex = 0;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
//combobox_services_wohnheimbuchung.SelectionChanged += (s, e) =>
|
||||
//{
|
||||
@@ -293,16 +293,6 @@ namespace BeWo.View.Detail
|
||||
EndDatumHeader.Visible = false;
|
||||
}
|
||||
|
||||
|
||||
// ein Bereich für istSTDMin gestzt abfrage
|
||||
if (Settings.IsZeiterfassungInStdMin)
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void ConfigureDocTypes()
|
||||
|
||||
@@ -673,6 +673,7 @@ namespace BeWo.ViewModel.ListViewModel
|
||||
// newVM.RoundedDuration = newVM.GroupRoundedDuration.Value;
|
||||
}
|
||||
|
||||
|
||||
VMList.Add(newVM);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -416,8 +416,8 @@ namespace BeWo.ViewModel
|
||||
TimeCheckForDurationSTD();
|
||||
}
|
||||
else
|
||||
{
|
||||
TimeCheck();
|
||||
{
|
||||
TimeCheck();
|
||||
}
|
||||
|
||||
FirePropertyChanged(PropertyName_Date);
|
||||
@@ -562,7 +562,7 @@ namespace BeWo.ViewModel
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_Duration == null)
|
||||
if (_Duration == null )
|
||||
{
|
||||
return 0;
|
||||
}else{
|
||||
@@ -575,11 +575,15 @@ namespace BeWo.ViewModel
|
||||
if (AreDifferent(_Duration, value))
|
||||
{
|
||||
_Duration = value;
|
||||
|
||||
|
||||
|
||||
|
||||
TimeCheck();
|
||||
|
||||
FirePropertyChanged(PropertyName_Duration);
|
||||
FirePropertyChanged(PropertyName_RoundedDuration);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -595,8 +599,17 @@ namespace BeWo.ViewModel
|
||||
rd = (rd*Category.Percentage)/100;
|
||||
}
|
||||
|
||||
//?? Keine ahnung weis nicht ??
|
||||
if (_DurationInStunden == ZeiterfassungsDauer.Stunden)
|
||||
{
|
||||
rd = rd/60;
|
||||
Duration = Duration/60;
|
||||
}
|
||||
|
||||
|
||||
var strResult = _GroupOid != null ? String.Format("{0} ({0})", rd) : String.Format("{0} ({1})", Duration, rd);
|
||||
|
||||
|
||||
return strResult;
|
||||
}
|
||||
}
|
||||
@@ -1134,7 +1147,7 @@ namespace BeWo.ViewModel
|
||||
|
||||
if (_EndTime != null)
|
||||
{
|
||||
if (BeWoApp.AppSettings.IsEndDateVisible)
|
||||
if (BeWoApp.AppSettings.IsEndDateVisible)
|
||||
{
|
||||
if (_StartTime.Value.Date == null)
|
||||
{
|
||||
@@ -1184,6 +1197,7 @@ namespace BeWo.ViewModel
|
||||
|
||||
FirePropertyChanged(PropertyName_EndTime);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1924,7 +1938,7 @@ namespace BeWo.ViewModel
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_DurationSTD == null)
|
||||
if (_DurationSTD == null )
|
||||
{
|
||||
return 0;
|
||||
}else{
|
||||
@@ -1938,12 +1952,14 @@ namespace BeWo.ViewModel
|
||||
{
|
||||
_DurationSTD = value;
|
||||
|
||||
|
||||
StoreDirtyInformation(AreDifferent(DataContract.RoundedDuration, value), PropertyName_DurationSTD);
|
||||
|
||||
FirePropertyChanged(PropertyName_DurationSTD);
|
||||
FirePropertyChanged(PropertyName_RoundedDuration);
|
||||
TimeCheckForDurationSTD();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1952,7 +1968,14 @@ namespace BeWo.ViewModel
|
||||
{
|
||||
get
|
||||
{
|
||||
return _DurationMonthYearGes;
|
||||
if (_DurationMonthYearGes == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return _DurationMonthYearGes;
|
||||
}
|
||||
}
|
||||
|
||||
set
|
||||
@@ -1961,10 +1984,15 @@ namespace BeWo.ViewModel
|
||||
{
|
||||
_DurationMonthYearGes = value;
|
||||
|
||||
StoreDirtyInformation(AreDifferent(DataContract.RoundedDuration, value), PropertyName_DurationMonthYearGes);
|
||||
StoreDirtyInformation(AreDifferent(DataContract.RoundedDuration, value),
|
||||
PropertyName_DurationMonthYearGes);
|
||||
|
||||
FirePropertyChanged(PropertyName_DurationMonthYearGes);
|
||||
}
|
||||
|
||||
FirePropertyChanged(PropertyName_DurationMonthYearGes);
|
||||
FirePropertyChanged(PropertyName_RoundedDuration);
|
||||
TimeCheckMonatJahr();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2124,14 +2152,6 @@ namespace BeWo.ViewModel
|
||||
//einfach nur sicherheitshalber dass der wert nicht null ist und es nicht zu unerwarteten fehlermeldungen kommt.
|
||||
_EditableEndDate = pDataContract.End.Value;
|
||||
|
||||
//if (pDataContract.Start.Value.Date == pDataContract.End.Value.Date)
|
||||
//{
|
||||
// _Duration = (pDataContract.End.Value - pDataContract.Start.Value).GetTotalMinutes();
|
||||
// if (pDataContract.Start != null && pDataContract.Start.Value.Second == 0 && _Duration != null)
|
||||
// {
|
||||
// _EndTime = pDataContract.Start.Value.AddMinutes(_Duration.Value);
|
||||
// }
|
||||
//}
|
||||
if (pDataContract.DurationInStunden == ZeiterfassungsDauer.Stunden /*&& BeWoApp.AppSettings.IsZeiterfassungInStdMin*/) // die bewoapp abfrage ist glaub ich nicht nötig
|
||||
{
|
||||
_Duration = (int)(pDataContract.End.Value - pDataContract.Start.Value).TotalHours;
|
||||
@@ -2145,6 +2165,9 @@ namespace BeWo.ViewModel
|
||||
_EndTime = pDataContract.Start.Value.AddMinutes(_Duration.Value);
|
||||
}
|
||||
|
||||
_DurationSTD = 0;
|
||||
_DurationMonthYearGes = 0;
|
||||
|
||||
}else
|
||||
if (pDataContract.ServiceRecordFormat == ServiceRecordFormate.ZeiterfassungMitEndDatum)
|
||||
{
|
||||
@@ -2162,12 +2185,23 @@ namespace BeWo.ViewModel
|
||||
_DurationSTD = (pDataContract.End.Value - pDataContract.Start.Value).GetTotalMinutes();
|
||||
}
|
||||
|
||||
}
|
||||
_Duration = 0;
|
||||
_DurationMonthYearGes = 0;
|
||||
}
|
||||
else if (pDataContract.ServiceRecordFormat == ServiceRecordFormate.ZeiterfassungMitMonatJahr)
|
||||
{
|
||||
|
||||
|
||||
_Date = pDataContract.Start.Value.Date;
|
||||
_StartTime = pDataContract.Start.Value;
|
||||
_EndTime = pDataContract.End.Value;
|
||||
|
||||
_DurationMonthYearGes = (int)(pDataContract.End.Value - pDataContract.Start.Value).TotalHours;
|
||||
_OnlyMonth = pDataContract.Start.Value.ToString("MMMM");
|
||||
_OnlyYear = pDataContract.Start.Value.ToString("yyyy");
|
||||
|
||||
_Duration = 0;
|
||||
_DurationSTD = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -2196,8 +2230,6 @@ namespace BeWo.ViewModel
|
||||
_DurationInStunden = pDataContract.DurationInStunden;
|
||||
_ServiceRecordFormat = pDataContract.ServiceRecordFormat;
|
||||
|
||||
|
||||
|
||||
|
||||
if (pDataContract.Goals != null)
|
||||
{
|
||||
@@ -2226,8 +2258,8 @@ namespace BeWo.ViewModel
|
||||
}
|
||||
|
||||
private ServiceRecordDC CopyToDataContract(ServiceRecordDC pDataContract)
|
||||
{
|
||||
if (BeWoApp.AppSettings.IsEndDateVisible)
|
||||
{
|
||||
if (_ServiceRecordFormat == ServiceRecordFormate.ZeiterfassungMitEndDatum)
|
||||
{
|
||||
pDataContract.Start = _Date;
|
||||
pDataContract.End = _EditableEndDate;
|
||||
@@ -2243,34 +2275,34 @@ namespace BeWo.ViewModel
|
||||
}
|
||||
}
|
||||
|
||||
_DurationMonthYearGes = 0;
|
||||
_Duration = 0;
|
||||
|
||||
ServiceRecordFormat = ServiceRecordFormate.ZeiterfassungMitEndDatum;
|
||||
}
|
||||
else if (BeWoApp.AppSettings.IsOnlyYearMonthVisible)
|
||||
else if (_ServiceRecordFormat == ServiceRecordFormate.ZeiterfassungMitMonatJahr)
|
||||
{
|
||||
//Fertig
|
||||
var dates = DateTime.Parse("1." + _OnlyMonth + _OnlyYear);
|
||||
|
||||
// var daysInMonth = DateTime.DaysInMonth(dates.Year,dates.Month); // Fals Der Ganze Monat als BEreich deklariert werden soll
|
||||
|
||||
var StartDatetime = new DateTime(dates.Year, dates.Month,1,0,0,0);
|
||||
// var EndDatetime = new DateTime(dates.Year, dates.Month, daysInMonth,0,0,0);
|
||||
|
||||
|
||||
pDataContract.Start = StartDatetime;
|
||||
pDataContract.End = StartDatetime.AddHours(_DurationMonthYearGes.Value);
|
||||
|
||||
StartTime = StartDatetime;
|
||||
EndTime = StartDatetime.AddHours(_DurationMonthYearGes.Value);
|
||||
|
||||
if (_DurationMonthYearGes != 0)
|
||||
{
|
||||
RoundedDuration = _DurationMonthYearGes.Value * 60;
|
||||
}
|
||||
|
||||
_DurationSTD = 0;
|
||||
_Duration = 0;
|
||||
|
||||
ServiceRecordFormat = ServiceRecordFormate.ZeiterfassungMitMonatJahr;
|
||||
|
||||
_DurationInStunden = ZeiterfassungsDauer.Stunden;
|
||||
}
|
||||
else
|
||||
{
|
||||
//Testen wir das mussen
|
||||
{
|
||||
var date = _Date.Value;
|
||||
var time = _StartTime.Value;
|
||||
|
||||
@@ -2287,7 +2319,9 @@ namespace BeWo.ViewModel
|
||||
{
|
||||
duration = duration * 60;
|
||||
}
|
||||
|
||||
|
||||
_DurationSTD = 0;
|
||||
_DurationMonthYearGes = 0;
|
||||
|
||||
pDataContract.End = pDataContract.Start.Value.AddMinutes(duration);
|
||||
|
||||
@@ -2363,6 +2397,22 @@ namespace BeWo.ViewModel
|
||||
AreDifferent(DataContract.Start,_Date.Value + _StartTime.Value.TimeOfDay), "TIME");
|
||||
}
|
||||
|
||||
private void TimeCheckMonatJahr()
|
||||
{
|
||||
var duration = 0;
|
||||
if (_DurationMonthYearGes.HasValue)
|
||||
{
|
||||
duration = _DurationMonthYearGes.Value;
|
||||
}
|
||||
|
||||
var dates = DateTime.Parse("1." + _OnlyMonth + _OnlyYear);
|
||||
var StartDatetime = new DateTime(dates.Year, dates.Month, 1, 0, 0, 0);
|
||||
|
||||
StoreDirtyInformation(
|
||||
AreDifferent(DataContract.End, StartDatetime.AddHours(duration)) ||
|
||||
AreDifferent(DataContract.Start, StartDatetime), "TIME");
|
||||
}
|
||||
|
||||
private void TimeCheckForDurationSTD()
|
||||
{
|
||||
//setzte duration
|
||||
@@ -2381,7 +2431,6 @@ namespace BeWo.ViewModel
|
||||
{
|
||||
if (_StartTime != null && _EndTime != null)
|
||||
{
|
||||
//Villeicht hier von der Startzeit die duration einfügen um den enddatum anzupassen
|
||||
_StartTime = new DateTime(_Date.Value.Year, _Date.Value.Month, _Date.Value.Day,
|
||||
_StartTime.Value.Hour, _StartTime.Value.Minute, _StartTime.Value.Second);
|
||||
|
||||
@@ -2400,7 +2449,6 @@ namespace BeWo.ViewModel
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (_StartTime != null && _EndTime == null && duration == 0)
|
||||
{
|
||||
_EndTime = new DateTime(_EditableEndDate.Value.Year, _EditableEndDate.Value.Month, _EditableEndDate.Value.Day, _StartTime.Value.Hour, _StartTime.Value.Minute, _StartTime.Value.Second);
|
||||
|
||||
Reference in New Issue
Block a user