BeWoPlanerMobil:
Die Validierung von ServiceRecords auf dem Server und die Anzeige im Browser der Anzeige im Fat-Client angepasst.
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
<AssemblyName>BeWoPlanerMobil</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<MvcBuildViews>false</MvcBuildViews>
|
||||
<UseIISExpress>true</UseIISExpress>
|
||||
<UseIISExpress>false</UseIISExpress>
|
||||
<IISExpressSSLPort />
|
||||
<IISExpressAnonymousAuthentication />
|
||||
<IISExpressWindowsAuthentication />
|
||||
@@ -276,7 +276,7 @@
|
||||
<AutoAssignPort>False</AutoAssignPort>
|
||||
<DevelopmentServerPort>8808</DevelopmentServerPort>
|
||||
<DevelopmentServerVPath>/</DevelopmentServerVPath>
|
||||
<IISUrl>http://localhost:8808/</IISUrl>
|
||||
<IISUrl>http://localhost/BeWoPlanerMobil</IISUrl>
|
||||
<NTLMAuthentication>False</NTLMAuthentication>
|
||||
<UseCustomServer>False</UseCustomServer>
|
||||
<CustomServerUrl>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<UseIISExpress>true</UseIISExpress>
|
||||
<UseIISExpress>false</UseIISExpress>
|
||||
<Use64BitIISExpress />
|
||||
<IISExpressSSLPort />
|
||||
<IISExpressAnonymousAuthentication />
|
||||
|
||||
@@ -1936,6 +1936,8 @@ namespace BeWoPlanerMobil.Controllers
|
||||
var splitSettings = settings.Split(';');
|
||||
var maxDaysEditSRsAllowedSetting = splitSettings.ToList().FirstOrDefault(f => f.Contains("MaxDaysEditServiceRecordsAllowed"));
|
||||
var maxDaysEditSRsAllowed = maxDaysEditSRsAllowedSetting != null ? int.Parse(maxDaysEditSRsAllowedSetting.Split('=')[1]) : 0;
|
||||
var limitFuerZeiterfassungSetting = splitSettings.ToList().FirstOrDefault(f => f.Contains("AnzTageZeiterfassErfolgt"));
|
||||
var limitFuerZeiterfassung = limitFuerZeiterfassungSetting != null ? limitFuerZeiterfassungSetting.Split('=')[1] : "0";
|
||||
|
||||
SupportConceptStatisticsDC stats = null;
|
||||
|
||||
@@ -1948,7 +1950,8 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
var newResult = new ValidationResult();
|
||||
|
||||
//if (checkSR.GroupOid.HasValue)
|
||||
string dateRangeString;
|
||||
|
||||
if(Model.IsInGroupBookingMode)
|
||||
{
|
||||
if (checkSR.GroupOid.HasValue)
|
||||
@@ -1988,17 +1991,22 @@ namespace BeWoPlanerMobil.Controllers
|
||||
}
|
||||
|
||||
var result = OperationsService.ValidateServiceRecord(checkSR, stats, maxDaysEditSRsAllowed, employees, cb2scOids);
|
||||
newResult.ServiceRecord2Validations.Add(new ServiceRecord2Validation(checkSR, result));
|
||||
dateRangeString = node?.SupportConceptTreeNodeDC != null ? node.SupportConceptTreeNodeDC.SupportConceptCostBearerRelDC.DateRangeString : "";
|
||||
|
||||
newResult.ServiceRecord2Validations.Add(new ServiceRecord2Validation(checkSR, result, dateRangeString));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var node = CreateFlatSupportConceptItem(CustomerService.LoadCompactSupportConceptDC(Model.SelectedSupportConcept.SupportConceptOid.Value, Model.SelectedEmployee.EmployeeOid), null);
|
||||
dateRangeString = node?.SupportConceptTreeNodeDC != null ? node.SupportConceptTreeNodeDC.SupportConceptCostBearerRelDC.DateRangeString : "";
|
||||
|
||||
var result = OperationsService.ValidateServiceRecordEntry(checkSR, stats, maxDaysEditSRsAllowed, checkSR.GroupOid.HasValue, employees);
|
||||
newResult.ServiceRecord2Validations.Add(new ServiceRecord2Validation(checkSR, result));
|
||||
newResult.ServiceRecord2Validations.Add(new ServiceRecord2Validation(checkSR, result, dateRangeString));
|
||||
}
|
||||
|
||||
newResult.Rights = new Dictionary<int, bool>();
|
||||
newResult.MaxDaysEditServiceRecordsAllowed = maxDaysEditSRsAllowed.ToString();
|
||||
newResult.LimitFuerZeiterfassung = limitFuerZeiterfassung;
|
||||
|
||||
newResult.Rights.Add(0, MobileSessionFacade.LoggedInUser.UserGroups.Any(a => a.Rights.Any(f => f.RightType.Equals(UserRightType.ServiceRecord_AllowCreateOverlappingFLS))));
|
||||
newResult.Rights.Add(1, MobileSessionFacade.LoggedInUser.UserGroups.Any(a => a.Rights.Any(f => f.RightType.Equals(UserRightType.ServiceRecord_AllowCreateMoreFLSThanApproved))));
|
||||
@@ -2217,6 +2225,11 @@ namespace BeWoPlanerMobil.Controllers
|
||||
[Authorize]
|
||||
public ActionResult SetGroupBookingMode(FormCollection pFormCollection)
|
||||
{
|
||||
if (Model == null)
|
||||
{
|
||||
return RedirectToActionPermanent("Index", "Login");
|
||||
}
|
||||
|
||||
var isInGroupBookingMode = "true,false" == pFormCollection["IsInGroupBookingMode"];
|
||||
|
||||
ResetGroupBookingMode(isInGroupBookingMode);
|
||||
@@ -2226,6 +2239,12 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
private void ResetGroupBookingMode(bool pIsInGroupBookingMode)
|
||||
{
|
||||
if (Model == null)
|
||||
{
|
||||
RedirectToActionPermanent("Index", "Login");
|
||||
return;
|
||||
}
|
||||
|
||||
Model.IsInGroupBookingMode = pIsInGroupBookingMode;
|
||||
|
||||
if (pIsInGroupBookingMode)
|
||||
@@ -2267,6 +2286,11 @@ namespace BeWoPlanerMobil.Controllers
|
||||
[Authorize]
|
||||
public ActionResult ResetEditingMode(FormCollection pFormCollection)
|
||||
{
|
||||
if (Model == null)
|
||||
{
|
||||
return RedirectToActionPermanent("Index", "Login");
|
||||
}
|
||||
|
||||
Model.NewServiceRecord = new ServiceRecordDC();
|
||||
Model.SelectedServiceRecord = null;
|
||||
Model.SelectedSupportConcepts.Clear();
|
||||
@@ -2279,6 +2303,12 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
public string LoadCategoryAndDescription()
|
||||
{
|
||||
if (Model == null)
|
||||
{
|
||||
RedirectToActionPermanent("Index", "Login");
|
||||
return null;
|
||||
}
|
||||
|
||||
if (Model.SelectedServiceRecord == null)
|
||||
{
|
||||
return null;
|
||||
@@ -2296,7 +2326,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
{
|
||||
if (Model == null)
|
||||
{
|
||||
return RedirectToAction("Main");
|
||||
return RedirectToActionPermanent("Index", "Login");
|
||||
}
|
||||
|
||||
var oids = new List<long>();
|
||||
@@ -2322,6 +2352,11 @@ namespace BeWoPlanerMobil.Controllers
|
||||
[HttpPost]
|
||||
public ActionResult AddSupportConceptsToGroupBooking(FormCollection pFormCollection)
|
||||
{
|
||||
if (Model == null)
|
||||
{
|
||||
return RedirectToActionPermanent("Index", "Login");
|
||||
}
|
||||
|
||||
var relOids = new List<long>();
|
||||
var groups = new List<GroupOfPeopleDC>();
|
||||
|
||||
@@ -2381,6 +2416,12 @@ namespace BeWoPlanerMobil.Controllers
|
||||
[Authorize]
|
||||
public string ResetGroupBookingModeViaGET()
|
||||
{
|
||||
if (Model == null)
|
||||
{
|
||||
RedirectToActionPermanent("Index", "Login");
|
||||
return null;
|
||||
}
|
||||
|
||||
Model.IsInGroupBookingMode = false;
|
||||
Model.SelectedCostbearerRelOids.Clear();
|
||||
Model.SelectedEmployees.Clear();
|
||||
|
||||
@@ -598,11 +598,10 @@ function validateServiceRecordBeforeSubmit() {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
for (var j = 0; j < relations.length; j++) {
|
||||
results = relations[j].ValidationResults;
|
||||
|
||||
var exitLoop = false;
|
||||
|
||||
for (var i = 0; i < results.length; i++) {
|
||||
if (exitLoop) {
|
||||
break;
|
||||
@@ -610,74 +609,101 @@ function validateServiceRecordBeforeSubmit() {
|
||||
|
||||
switch (results[i].ResultType) {
|
||||
case 0:
|
||||
var msg1 = 'An dem gewählten Datum \'' + vonDatum + '\' existiert bereits ein Eintrag (' + results[i].Message + ' bei Klient/in ' + results[i].CustomerName + '). Speichern nicht möglich.';
|
||||
// ServiceRecordOverlapping: ServiceRecord überschneidet sich mit einem anderen Eintrag
|
||||
var msg1 = "An dem gewählten Datum '" + vonDatum + "' existiert bereits ein Eintrag (" + results[i].Message + " bei Klient/in " + results[i].CustomerName + "). Speichern nicht möglich.";
|
||||
if (allowOverlappingFLS === true) {
|
||||
var r = confirm('An dem gewählten Datum \'' + vonDatum + '\' existiert bereits ein Eintrag (' + results[i].Message + ' bei Klient/in ' + results[i].CustomerName + '). Möchten Sie trotzdem speichern?');
|
||||
var r = confirm("An dem gewählten Datum '" + vonDatum + "' existiert bereits ein Eintrag (" + results[i].Message + " bei Klient/in " + results[i].CustomerName + "). Möchten Sie trotzdem speichern?");
|
||||
isValidRecord = r;
|
||||
exitLoop = !isValidRecord;
|
||||
} else {
|
||||
writeFatalErrorMessage(msg1);
|
||||
alert(msg1);
|
||||
isValidRecord = false;
|
||||
exitLoop = true;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
var msg2 = 'An dem gewählten Datum ' + vonDatum + ' existiert bereits ein Eintrag für den ausgewählten Mitarbeiter(' + results[i].EmployeeName + '). Speichern nicht möglich.';
|
||||
// EmployeeOverlapping: Employee hat einen mit diesem Eintrag sich überschneidenden Eintrag
|
||||
var msg2 = "An dem gewählten Datum " + vonDatum + " existiert bereits ein Eintrag von " + results[i].EmployeeName + "(" + results[i].Message + "). Speichern nicht möglich.";
|
||||
if (allowOverlappingFLS === true) {
|
||||
var r2 = confirm('An dem gewählten Datum ' + vonDatum + ' existiert bereits ein Eintrag für den ausgewählten Mitarbeiter(' + results[i].EmployeeName + '). Möchten Sie trotzdem speichern?');
|
||||
var r2 = confirm("An dem gewählten Datum " + vonDatum + " existiert bereits ein Eintrag von " + results[i].EmployeeName + "(" + results[i].Message + "). Möchten Sie trotzdem speichern?");
|
||||
isValidRecord = r2;
|
||||
exitLoop = !isValidRecord;
|
||||
} else {
|
||||
writeFatalErrorMessage(msg2);
|
||||
alert(msg2);
|
||||
isValidRecord = false;
|
||||
exitLoop = true;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
writeFatalErrorMessage('Das gewählte Datum ' + vonDatum.slice(0, 10) + ' liegt außerhalb des Zeitraumes des gewählten Hilfeplans. Speichern nicht möglich.');
|
||||
// OutsideOfSupportConcept: Der Eintrag liegt außerhalb des Hilfeplanzeitraumes
|
||||
alert("Das gewählte Datum " + vonDatum.slice(0, 10) + " liegt außerhalb des Zeitraumes des gewählten Hilfeplans (" + relations[j].HilfePlanZeitraum + "). Speichern nicht möglich.");
|
||||
//writeFatalErrorMessage("Das gewählte Datum " + vonDatum.slice(0, 10) + " liegt außerhalb des Zeitraumes des gewählten Hilfeplans (" + relations[j].HilfePlanZeitraum + "). Speichern nicht möglich.");
|
||||
|
||||
isValidRecord = false;
|
||||
exitLoop = true;
|
||||
break;
|
||||
case 3:
|
||||
var msg3 = 'Die für diesen Hilfeplan genehmigten FLS (' + results[i].ApprovedHours + ') werden mit diesem Eintrag überschritten. (' + results[i].HoursNew + ').';
|
||||
// ApprovedFLSOverspending: Die Anzahl der genehmigten FLS wird überschritten
|
||||
var klient = "diesen Hilfeplan";
|
||||
if (results[i].CustomerName !== null && results[i].CustomerName.length >= 0) {
|
||||
klient = "Klient/in " + results[i].CustomerName;
|
||||
}
|
||||
|
||||
var msg3 = "Die für " + klient + " genehmigten FLS (" + results[i].ApprovedHours + ") werden mit diesem Eintrag überschritten. (" + results[i].HoursNew + ").";
|
||||
if (allowMoreFLSThanApproved === true) {
|
||||
var r3 = confirm(msg3 + " Möchten Sie trotzdem speichern?");
|
||||
isValidRecord = r3;
|
||||
exitLoop = !isValidRecord;
|
||||
} else {
|
||||
writeFatalErrorMessage(msg3);
|
||||
alert(msg3);
|
||||
isValidRecord = false;
|
||||
exitLoop = true;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
writeFatalErrorMessage('Sie können keine neuen Leistungen für den ' + vonDatum + ' dokumentieren, da bereits der ' + meldungen.MaxDaysEditServiceRecordsAllowed + '. des nachfolgenden Monats überschritten ist.');
|
||||
// OutOfEditLimit: MaxDaysEditServiceRecordAllowed überschritten
|
||||
alert("Sie können keine neuen Leistungen für den " + vonDatum + " dokumentieren, da bereits der " + meldungen.MaxDaysEditServiceRecordsAllowed + ". des nachfolgenden Monats überschritten ist.");
|
||||
isValidRecord = false;
|
||||
exitLoop = true;
|
||||
break;
|
||||
case 5:
|
||||
writeFatalErrorMessage("Beim Speichern ist ein Fehler aufgetreten. Speichern nicht möglich.");
|
||||
// Error: Ein genereller Fehler ist bei der Validierung aufgetreten
|
||||
alert("Beim Speichern ist ein Fehler aufgetreten. Speichern nicht möglich.");
|
||||
isValidRecord = false;
|
||||
exitLoop = true;
|
||||
break;
|
||||
case 6:
|
||||
var msg6 = "Es existiert bereits eine Spitzabrechnung. Um diesen Eintrag zu berücksichtigen, muss eventuell eine neue Spitzabrechnung erstellt werden. Das Speichern ist nicht möglich.";
|
||||
if (bookAfterSettlementInvoice === true) {
|
||||
msg6 = "Sie können den Eintrag nicht bearbeiten, da bereits eine Spitzabrechnung für diesen Hilfeplan erstellt wurde. Speichern nicht möglich.";
|
||||
// SettlementInvoiceAlreadyExisting: Es existiert bereits eine Spitzabrechnung
|
||||
var klient2 = "diesen Hilfeplan";
|
||||
if (results[i].CustomerName !== null && results[i].CustomerName.length >= 0) {
|
||||
klient2 = "Klient/in " + results[i].CustomerName;
|
||||
}
|
||||
writeFatalErrorMessage(msg6);
|
||||
|
||||
var msg6 = "Es existiert bereits eine Spitzabrechnung für " + klient2 + ". Um diesen Eintrag zu berücksichtigen, muss eventuell eine neue Spitzabrechnung erstellt werden. Das Speichern ist nicht möglich.";
|
||||
if (bookAfterSettlementInvoice === true) {
|
||||
msg6 = "Sie können den Eintrag nicht bearbeiten, da bereits eine Spitzabrechnung für " + klient2 + " erstellt wurde. Speichern nicht möglich.";
|
||||
}
|
||||
alert(msg6);
|
||||
isValidRecord = false;
|
||||
exitLoop = true;
|
||||
break;
|
||||
case 7:
|
||||
var msg7 = "Sie können keine neuen Leistungen dokumentieren, da die Frist zur Bearbeitung abgelaufen ist. Das Speichern ist nicht möglich.";
|
||||
writeFatalErrorMessage(msg7);
|
||||
// FristAbgelaufen: Die Frist zur Bearbeitung ist abgelaufen
|
||||
var intervall = "einem Tag";
|
||||
|
||||
if (results[i].LimitFuerZeiterfassung !== "1") {
|
||||
intervall = results[i].LimitFuerZeiterfassung + " Tagen";
|
||||
}
|
||||
|
||||
var msg7 = "Sie können keine neuen Leistungen für den " + vonDatum + " dokumentieren, da die Zeiterfassung innerhalb von " + intervall + " erfolgen muss. Das Speichern ist nicht möglich.";
|
||||
|
||||
alert(msg7);
|
||||
isValidRecord = false;
|
||||
exitLoop = true;
|
||||
break;
|
||||
default:
|
||||
writeFatalErrorMessage(results[i].Message);
|
||||
// Custom(8), da default: ServiceRecordValidationResult.Custom
|
||||
alert(results[i].Message);
|
||||
isValidRecord = false;
|
||||
exitLoop = true;
|
||||
break;
|
||||
@@ -754,6 +780,7 @@ function initSignatureInfo(serviceRecordOid){
|
||||
});
|
||||
}
|
||||
|
||||
// Man kann nur eine fatale Fehlermeldung auf einmal anzeigen. Ein Aufruf dieser Methode bei einem bereits angezeigten Fehler führt dazu, dass das Popup wieder unsichtbar geschaltet wird.
|
||||
function writeFatalErrorMessage(msg, i) {
|
||||
toggleErrorPopup(msg, i);
|
||||
}
|
||||
|
||||
19
BeWoPlanerMobil/Util/ServiceRecord2Validation.cs
Normal file
19
BeWoPlanerMobil/Util/ServiceRecord2Validation.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System.Collections.Generic;
|
||||
using BS.Shared.DataContracts;
|
||||
|
||||
namespace BeWoPlanerMobil.Util
|
||||
{
|
||||
public class ServiceRecord2Validation
|
||||
{
|
||||
public ServiceRecordDC ServiceRecord { get; set; }
|
||||
public List<ServiceRecordValidationResultDC> ValidationResults { get; set; }
|
||||
public string HilfePlanZeitraum { get; }
|
||||
|
||||
public ServiceRecord2Validation(ServiceRecordDC pServiceRecord, List<ServiceRecordValidationResultDC> pValidationResults, string pHilfePlanZeitraum)
|
||||
{
|
||||
ServiceRecord = pServiceRecord;
|
||||
ValidationResults = pValidationResults;
|
||||
HilfePlanZeitraum = pHilfePlanZeitraum;
|
||||
}
|
||||
}
|
||||
}
|
||||
13
BeWoPlanerMobil/Util/ValidationResult.cs
Normal file
13
BeWoPlanerMobil/Util/ValidationResult.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace BeWoPlanerMobil.Util
|
||||
{
|
||||
public class ValidationResult
|
||||
{
|
||||
public Dictionary<int, bool> Rights { get; set; } = new Dictionary<int, bool>();
|
||||
public string MaxDaysEditServiceRecordsAllowed { get; set; }
|
||||
public string LimitFuerZeiterfassung { get; set; } = "0";
|
||||
|
||||
public List<ServiceRecord2Validation> ServiceRecord2Validations { get; set; } = new List<ServiceRecord2Validation>();
|
||||
}
|
||||
}
|
||||
@@ -119,7 +119,7 @@
|
||||
<add key="ClientValidationEnabled" value="true"/>
|
||||
<add key="UnobtrusiveJavaScriptEnabled" value="true"/>
|
||||
<!--<add key="MultitenancyPath" value="D:\Projects\BeWo\Host\Multitenancy\"/>-->
|
||||
<add key="MultitenancyPath" value="C:\Users\Lyndon\Documents\beyondsoft\BeWo\Host\Multitenancy\"/>
|
||||
<add key="MultitenancyPath" value="C:\Users\Lyndon\Documents\beyondSoft\BeWo\Host\Multitenancy\"/>
|
||||
<add key="LicenseInfoUrl" value="https://support.bewoplaner.de/api/getlicensecount.php?k=[TENANT]" />
|
||||
<add key="LicenseOrderUrl" value="https://support.bewoplaner.de/lizenzbestellung/?k=[TENANT]" />
|
||||
<add key="LicenseCancellationUrl" value="https://support.bewoplaner.de/api/licencecancellation.php?k=[TENANT]" />
|
||||
|
||||
Reference in New Issue
Block a user