diff --git a/BeWo/View/Detail/AbsenceTimesView.xaml.cs b/BeWo/View/Detail/AbsenceTimesView.xaml.cs index 92f47d1fc..514e780d0 100644 --- a/BeWo/View/Detail/AbsenceTimesView.xaml.cs +++ b/BeWo/View/Detail/AbsenceTimesView.xaml.cs @@ -32,7 +32,10 @@ namespace BeWo.View.Detail private void AddAbsenceTimes() { - AbsenceTimes?.AddNewVMToList(); + AbsenceTimes?.NewVM.ValidateDates(() => + { + AbsenceTimes?.AddNewVMToList(); + }); } private void RemoveAbsenceTime() diff --git a/BeWo/ViewModel/AbsenceTimeVM.cs b/BeWo/ViewModel/AbsenceTimeVM.cs index 96509f75a..985a3c44b 100644 --- a/BeWo/ViewModel/AbsenceTimeVM.cs +++ b/BeWo/ViewModel/AbsenceTimeVM.cs @@ -188,8 +188,8 @@ namespace BeWo.ViewModel pDataContract.Reason = _Reason; } - pDataContract.Start = _Start; - pDataContract.End = _End; + pDataContract.Start = _Start; + pDataContract.End = _End; pDataContract.Notice = _Notice; pDataContract.KrankheitsMeldung = _KrankheitsMeldung; @@ -203,7 +203,8 @@ namespace BeWo.ViewModel { var me = (IDataErrorInfo)this; var error = me[nameof(Start)] + - me[nameof(End)]; + me[nameof(End)] + + me[nameof(Reason)]; return error; } @@ -213,14 +214,19 @@ namespace BeWo.ViewModel { get { - if (Start == null) + if (columnName.Equals(nameof(Start)) && Start == null) { - return "Das Startdatum muss einen Wert haben."; + return "Das Startdatum muss einen Wert haben.\n"; } - if (End != null && End.Value < Start) + if (columnName.Equals(nameof(End)) && End != null && End.Value < Start) { - return "Das Startdatum muss vor dem Enddatum liegen."; + return "Das Startdatum muss vor dem Enddatum liegen.\n"; + } + + if (columnName.Equals(nameof(Reason)) && Reason == null) + { + return "Die Kategorie darf nicht leer sein.\n"; } return null; @@ -233,9 +239,10 @@ namespace BeWo.ViewModel if (!string.IsNullOrEmpty(error)) { - MessageBox.Show("Das Startdatum muss vor dem Enddatum liegen.", "Ungültige Datumsangaben", MessageBoxButton.OK, MessageBoxImage.Error); + MessageBox.Show(error, "Ungültige Eingabe", MessageBoxButton.OK, MessageBoxImage.Error); FirePropertyChanged(nameof(Start)); FirePropertyChanged(nameof(End)); + FirePropertyChanged(nameof(Reason)); } else { diff --git a/BeWoPlanerMobil/BeWoPlanerMobil.csproj b/BeWoPlanerMobil/BeWoPlanerMobil.csproj index 3eb38f90c..75e55575d 100644 --- a/BeWoPlanerMobil/BeWoPlanerMobil.csproj +++ b/BeWoPlanerMobil/BeWoPlanerMobil.csproj @@ -1,5 +1,7 @@  + + Debug @@ -8,7 +10,7 @@ 2.0 {284B02ED-114A-426C-9162-31BB6CF05589} - {E3E379DF-F4C6-4180-9B81-6769533ABE47};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} Library Properties BeWoPlanerMobil @@ -23,6 +25,9 @@ + + + 3.7 true @@ -45,6 +50,9 @@ false + + ..\packages\Antlr.3.5.0.2\lib\Antlr3.Runtime.dll + False @@ -52,11 +60,20 @@ + + ..\packages\EntityFramework.6.4.0\lib\net45\EntityFramework.dll + + + ..\packages\EntityFramework.6.4.0\lib\net45\EntityFramework.SqlServer.dll + False ..\Lib\log4net.dll + + ..\packages\Microsoft.AspNet.WebHelpers.3.2.7\lib\net45\Microsoft.Web.Helpers.dll + False ..\Lib\MySql.Data.dll @@ -76,6 +93,17 @@ + + + ..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Extensions.dll + + + ..\packages\Microsoft.AspNet.WebApi.Client.5.2.7\lib\net45\System.Net.Http.Formatting.dll + + + ..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Primitives.dll + + @@ -84,74 +112,52 @@ + + ..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.Helpers.dll + + + ..\packages\Microsoft.AspNet.WebApi.Core.5.2.7\lib\net45\System.Web.Http.dll + + + ..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.7\lib\net45\System.Web.Http.WebHost.dll + + + ..\packages\Microsoft.AspNet.Mvc.5.2.7\lib\net45\System.Web.Mvc.dll + + + ..\packages\Microsoft.AspNet.Web.Optimization.1.1.3\lib\net40\System.Web.Optimization.dll + + + ..\packages\Microsoft.AspNet.Razor.3.2.7\lib\net45\System.Web.Razor.dll + + + ..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.dll + + + ..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Deployment.dll + + + ..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Razor.dll + - - ..\packages\EntityFramework.5.0.0\lib\net40\EntityFramework.dll - True ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - - True - ..\packages\Microsoft.AspNet.Mvc.FixedDisplayModes.1.0.0\lib\net40\Microsoft.Web.Mvc.FixedDisplayModes.dll - - - True - ..\packages\Microsoft.Net.Http.2.0.20710.0\lib\net40\System.Net.Http.dll - - - ..\packages\Microsoft.AspNet.WebApi.Client.4.0.20710.0\lib\net40\System.Net.Http.Formatting.dll - - - True - ..\packages\Microsoft.Net.Http.2.0.20710.0\lib\net40\System.Net.Http.WebRequest.dll - - - ..\packages\Microsoft.AspNet.WebApi.Core.4.0.20710.0\lib\net40\System.Web.Http.dll - - - ..\packages\Microsoft.AspNet.WebApi.WebHost.4.0.20710.0\lib\net40\System.Web.Http.WebHost.dll - - - True - ..\packages\Microsoft.AspNet.Mvc.4.0.20710.0\lib\net40\System.Web.Mvc.dll - - - ..\packages\Microsoft.AspNet.Web.Optimization.1.0.0\lib\net40\System.Web.Optimization.dll - - - ..\packages\Microsoft.AspNet.Providers.Core.1.2\lib\net40\System.Web.Providers.dll - - - True - ..\packages\Microsoft.AspNet.Razor.2.0.20715.0\lib\net40\System.Web.Razor.dll - - - True - ..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.dll - - - True - ..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.Deployment.dll - - - True - ..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.Razor.dll - - - True - ..\packages\WebGrease.1.3.0\lib\WebGrease.dll + + ..\packages\WebGrease.1.6.0\lib\WebGrease.dll - - True - ..\packages\WebGrease.1.3.0\lib\Antlr3.Runtime.dll + + ..\packages\Microsoft.AspNet.WebPages.Data.3.2.7\lib\net45\WebMatrix.Data.dll + + + ..\packages\Microsoft.AspNet.WebPages.WebData.3.2.7\lib\net45\WebMatrix.WebData.dll @@ -198,6 +204,8 @@ + + @@ -224,24 +232,160 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -263,6 +407,11 @@ + + + + + @@ -290,11 +439,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + @@ -318,6 +612,16 @@ + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + - - - - - - -
- -
- -
-
- - - - -
- - -
- - - - - - - - - -

- - - - -
- - -
- - -
- - -
- - - - -
- - -
- - - - -
- - -
- - - - - - - - - -
- - -
- - - - -
-
- - - - - -
- -
- -
-
- -
-
- -
-
- -
-
- -
-
- - - - - - - - - - - - - -
- - - - - - - - - - - - -
- } - - - - - - @{ - var shouldShowServiceRecordList = "display: block"; - - if (Model.IsInGroupBookingMode && !Model.IsInEditingMode) - { - shouldShowServiceRecordList = "display: none"; - } - } - - @using (Html.BeginForm("LoadServiceRecords", "Main", FormMethod.Post, new { id = "selectSCForm2", style = shouldShowServiceRecordList })) - { -
-
- -
-
- } - - -
- -
- @foreach (var record in Model.ServiceRecords) - { -
- -
- - - - - - - - - - - @{ - if (Model.ShowDistanceField && record.DistanceInMeter != null && record.DistanceInMeter.Value > 0) - { - - - - - } - } - - - - - - - - - - - - - - - - - - - - - - @{ - if (Model.Dokutypes.Length >= 1) - { - - - - - } - else if (record.Notice2 == null && record.Notice3 == null && record.Notice4 == null && record.Notice5 == null && Model.Dokutypes.Length == 0) - { - - - - - } - else if (record.Notice2 != null || record.Notice3 != null || record.Notice4 != null || record.Notice5 != null) - { - - - - - } - } - @{if (record.Notice2 != null) - { - if (Model.Dokutypes.Length >= 2) - { - if (!record.Notice2.Equals("") && Model.Dokutypes[1] != null) - { - - - - - } - } - else if (!record.Notice2.Equals("")) - { - - - - - } - } - - if (record.Notice3 != null) - { - if (Model.Dokutypes.Length >= 3) - { - if (!record.Notice3.Equals("") && Model.Dokutypes[2] != null) - { - - - - - } - } - else if (!record.Notice3.Equals("")) - { - - - - - } - } - - if (record.Notice4 != null) - { - if (Model.Dokutypes.Length >= 4) - { - if (!record.Notice4.Equals("") && Model.Dokutypes[3] != null) - { - - - - - } - } - else if (!record.Notice4.Equals("")) - { - - - - - } - } - - if (record.Notice5 != null) - { - if (Model.Dokutypes.Length == 5) - { - if (!record.Notice5.Equals("") && Model.Dokutypes[4] != null) - { - - - - - } - } - else if (!record.Notice5.Equals("")) - { - - - - - } - } - } - - @{if (Model.ShowSignature) - { - - - - -} - } - -
-
- @using (Html.BeginForm("SetSelectedGroupServiceRecord", "Main", FormMethod.Post, new { id = "editGroupServiceRecord_" + record.ServiceRecordOid.Value })) - { - - } - - - - - - @{ - if (record.SignatureOid == null && Model.ShowSignature) - { - - } - } - - @{ - if (record.SignatureOid.HasValue) - { - using (Html.BeginForm("LoadSignatureImage", "Main", FormMethod.Post, new { id = String.Format("signatureLoadingForm{0}", record.SignatureOid.Value), style = "display:inline;" })) - { - - - } - } - } -
-
Minuten (gerundet): - @{ - var rd = MobileUtils.GetDecimalValueWithMaxDecimal(record.RoundedDuration, 2); - - if (record.ServiceDescription.Category.Percentage > 0 && record.ServiceDescription.Category.Percentage < 100) - { - rd = rd * record.ServiceDescription.Category.Percentage / 100; - } - - @(record.GroupOid != null ? string.Format("{0:###0.#} ({0:###0.#})", rd) : string.Format("{0:###0.#} ({1:###0.#})", (record.End.Value - record.Start.Value).TotalMinutes, rd)) - } - -
Gefahrene Kilometer:@record.DistanceInMeter.ToString()
Ziele: - @{ - if (record.Goals != null) - { - foreach (var goal in record.Goals) - { - @(goal.TypeDescription) - if (record.Goals.IndexOf(goal) < record.Goals.Count - 1) - { - @(", ") - } - } - } - } -
Leistungskategorie:@record.ServiceDescription.CategoryName
Leistung:@record.ServiceDescription.Name
Mitarbeiter:@record.Employee
Angelegt am:@record.InsertedOn
@Model.Dokutypes[0].TypeDescription:@record.Notice
Dokumentation:@record.Notice
Dokumentation:@record.Notice
@Model.Dokutypes[1].TypeDescription: @record.Notice2
Dokumentation 2: @record.Notice2
@Model.Dokutypes[2].TypeDescription: @record.Notice3
Dokumentation 3: @record.Notice3
@Model.Dokutypes[3].TypeDescription: @record.Notice4
Dokumentation 4: @record.Notice4
@Model.Dokutypes[4].TypeDescription: @record.Notice5
Dokumentation 5: @record.Notice5
Unterschrieben: - @{if (record.SignatureOid == null || record.SignatureOid < 1) - { - @Html.Raw("NEIN") - } - else - { - @Html.Raw("JA") - } - } -
-
-
- } -
- - - - - - -
-

Eintrag löschen

-

Sind Sie sicher, dass Sie den Eintrag löschen möchten?

-
- @using (Html.BeginForm("DeleteServiceRecord", "Main", FormMethod.Post, new { id = "deletionForm" })) - { - - - - } -
-
- -
-

Speichern erfolgreich

-

-
- - -
-
- - - -
-
- -
- -
-
-
-
- - -
-
- - @foreach (var hp in Model.SupportConceptListObjectsForGroupBooking) - { - - - - - - - - } -
- - - @hp.NameAndDateOfBirth -
-

@hp.SupportConceptTimeSpan

-
-
-
- - @foreach (var gruppe in Model.GroupOfPeopleListItems) - { - - - - - } -
- - - @gruppe.Text -
-
-
-
- -
-
-
- @using (Html.BeginForm("AddEmployeesToGroupBooking", "Main", FormMethod.Post, new { id = "groupBookingEmployeeSelectionForm" })) - { - var i = 0; - - @foreach (var ma in Model.EmployeeListItems) - { - - - - - i++; - } -
- a.EmployeeOid == long.Parse(ma.Value))) { @Html.Raw("checked=\"checked\"") } /> - - @ma.Text -
- } -
-
- -@{ - if (!string.IsNullOrEmpty(Model.SignatureImage)) - { -
-
- Unterschrift -
- } -} - -
-

Validierung

-

-
- - -
-
- -
-

Unterschrift

- -
- - - - - - - - - - - - - - - - - -
- Hilfeplan: -
- Kategorie: -
- Leistung: -
- Datum / Uhrzeit: -
- - -
- -
- - -
- -
- -
- -
- - - + +
+
+ @if(AbstractModel.HasRightToSeeAllSupportConcepts) + { +
+ @using(Html.BeginForm("SetShowOnlyOwnSupportConcepts", "Main", FormMethod.Post)) + { +
+ @Html.CheckBoxFor(m => m.ShowOnlyOwnSupportConcepts, new { onchange = "submitForm(this)", @class = "custom-control-input" }) + @Html.LabelFor(m => m.ShowOnlyOwnSupportConcepts, new { @class = "custom-control-label" }) +
+ } +
+ } + +
+ @using(Html.BeginForm("SetShowExpiredSupportConcepts", "Main", FormMethod.Post)) + { +
+ @Html.CheckBoxFor(m => m.ShowExpiredSupportConcepts, new { onchange = "submitForm(this)", @class = "custom-control-input" }) + @Html.LabelFor(m => m.ShowExpiredSupportConcepts, new { @class = "custom-control-label" }) +
+ } +
+ @if(AbstractModel.HasRightForGroupBookings) + { +
+ @using(Html.BeginForm("SetGroupBookingMode", "Main", FormMethod.Post)) + { +
+ @Html.CheckBoxFor(m => m.IsInGroupBookingMode, new { onchange = "submitForm(this)", @class = "custom-control-input" }) + @Html.LabelFor(m => m.IsInGroupBookingMode, new { @class = "custom-control-label" }) +
+ } +
+ } +
+ + @if(Model != null && !Model.IsInGroupBookingMode) + { + using(Html.BeginForm("SelectSupportConcept", "Main", FormMethod.Post, new { Id = "selectSupportConceptForm" })) + { + var selectedSuportConceptTimeSpanColorClass = Model.SelectedSupportConceptListObject.IsAboutToExpire ? "text-bewo-is-about-to-expire" : Model.SelectedSupportConceptListObject.ExpiresInThreeMonthsOrLess ? "text-bewo-expires-in-three-months" : "text-dark"; + + + + + } + + using(Html.BeginForm("CreateServiceRecord", "Main", FormMethod.Post, new { onreset = "serviceDescriptionSelectOnReset()", id = "serviceRecordCreationForm" })) + { +
+
+
+ +
+
+ +
+
+
+ @Html.LabelFor(m => m.SelectedEmployeeOid) + @Html.DropDownListFor(m => m.SelectedEmployeeOid, Model.EmployeeListItems, new { id = "employeesDropDown", @class = "form-control", onchange = "setSelectedEmployee()" }) +
+
+
+
+
+
+ @Html.LabelFor(m => m.SelectedServiceCategoryOid) + @Html.DropDownListFor(m => m.SelectedServiceCategoryOid, Model.ServiceCategoryListItems, new { onchange = "loadServiceDescriptions()", @class = "form-control", Id = "category-select" }) +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+ +
+
+
+
+ @if(Model.NumberOfDokuTypes == 0) + { +
+ + +
+ } + else + { + +
+ @for(var i = 0; i < Model.Dokutypes.Length; i++) + { + var textareaName = i + 1 < 1 ? "Dokumentation" : "Dokumentation" + (i + 1); + +
+ +
+ } +
+ } +
+ +
+
+ } + +
+
+ @using(Html.BeginForm("LoadServiceRecords", "Main", FormMethod.Post, new { id = "selectServiceRecordForm" })) + { + + } +
+
+ +
+
+ +
+
+ } + + @if(Model != null) + { + foreach(var serviceRecord in Model.ServiceRecords) + { +

@serviceRecord.Start - @serviceRecord.End

+ } + } + + +
diff --git a/BeWoPlanerMobil/Views/Shared/_Layout.cshtml b/BeWoPlanerMobil/Views/Shared/_Layout.cshtml index 217d3e3cb..2e766c3ee 100644 --- a/BeWoPlanerMobil/Views/Shared/_Layout.cshtml +++ b/BeWoPlanerMobil/Views/Shared/_Layout.cshtml @@ -6,16 +6,15 @@ @ViewBag.Title - - + @* - - - - + + + + @@ -27,7 +26,6 @@ - @@ -37,80 +35,120 @@ - + *@ + + + + + + + + + + + + + + + + + + - Lade... + @if (Model != null) + { + + } + + -
-
- -
-

Fehler

-

Ein Fehler ist aufgetreten

-
-
- -
-
- -