diff --git a/BeWoPlanerMobil/BeWoPlanerMobil.csproj b/BeWoPlanerMobil/BeWoPlanerMobil.csproj
index e05a9fd89..d6934346e 100644
--- a/BeWoPlanerMobil/BeWoPlanerMobil.csproj
+++ b/BeWoPlanerMobil/BeWoPlanerMobil.csproj
@@ -308,6 +308,7 @@
+
diff --git a/BeWoPlanerMobil/Controllers/MainController.cs b/BeWoPlanerMobil/Controllers/MainController.cs
index 92bb7876a..b52d87a9a 100644
--- a/BeWoPlanerMobil/Controllers/MainController.cs
+++ b/BeWoPlanerMobil/Controllers/MainController.cs
@@ -39,7 +39,7 @@ using ServiceRecordDC = BS.Shared.DataContracts.ServiceRecordDC;
namespace BeWoPlanerMobil.Controllers
{
- public class MainController : AbstractBaseController
+ public class MainController : SignableController
{
public MainController()
{
@@ -1132,33 +1132,29 @@ namespace BeWoPlanerMobil.Controllers
}
[Authorize]
- public ActionResult SaveSignature(FormCollection formCollection)
+ [HttpPost]
+ public override ActionResult SaveSignature(FormCollection formCollection)
{
try
{
var blob = formCollection[FormCollectionConstants.ServiceRecordSignatureBlobKey];
var date = DateTime.Parse(formCollection[FormCollectionConstants.ServiceRecordSignatureDateKey]);
- long.TryParse(formCollection[FormCollectionConstants.ServiceRecordSignatureRecordOidKey], out var serviceRecordOid);
- var serviceRecord = GetServiceRecordDC(serviceRecordOid, false);
+ long.TryParse(formCollection[FormCollectionConstants.ServiceRecordSignatureObjOidKey], out var objectOid);
- if(serviceRecordOid < 1 || serviceRecord is null)
+ if(objectOid <= 0)
{
- var message2Log = string.Empty;
+ return RedirectToAction("Main", "Main", Model);
+ }
- if(serviceRecordOid < 1)
- {
- message2Log = $"Einzelunterschrift konnte nicht gespeichert werden, da die ServiceRecordOid {serviceRecordOid} ungültig ist.";
- }
- else if(serviceRecord is null)
- {
- message2Log = "Einzelunterschrift konnte nicht gespeichert werden, da der Zeiterfassungseintrag im Model nicht gefunden werden konnte.";
- }
+ var serviceRecord = GetServiceRecordDC(objectOid, false);
- Log.Error(message2Log);
+ if(serviceRecord is null)
+ {
+ Log.Error("Einzelunterschrift konnte nicht gespeichert werden, da der Zeiterfassungseintrag im Model nicht gefunden werden konnte.");
TempData[TempDataConstants.ErrorMessageKey] = "Beim Speichern der Unterschrift ist ein Fehler aufgetreten. Bitte wenden Sie sich an Ihren Administrator.";
- return RedirectToActionPermanent("Main", "Main");
+ return RedirectToAction("Main", "Main", Model);
}
long? oid;
@@ -1170,14 +1166,14 @@ namespace BeWoPlanerMobil.Controllers
if(!isValid)
{
TempData[TempDataConstants.ErrorMessageKey] = "Das Unterschriftenfeld darf nicht leer sein.";
- return RedirectToActionPermanent("Main", "Main");
+ return RedirectToAction("Main", "Main", Model);
}
oid = OperationsService.InsertSignature(new SignatureDC
{
DataBild = blob,
Zeitstempel = date,
- ServiceRecordOid = serviceRecordOid
+ ServiceRecordOid = objectOid
}).SignatureOid;
}
@@ -1194,8 +1190,8 @@ namespace BeWoPlanerMobil.Controllers
{
Log.Error("Fehler beim Speichern der Einzelunterschrift: " + ex.Message, ex);
}
-
- return RedirectToActionPermanent("Main", "Main");
+
+ return RedirectToAction("Main", "Main", Model);
}
[Authorize]
diff --git a/BeWoPlanerMobil/Controllers/SignableController.cs b/BeWoPlanerMobil/Controllers/SignableController.cs
new file mode 100644
index 000000000..8eca8099c
--- /dev/null
+++ b/BeWoPlanerMobil/Controllers/SignableController.cs
@@ -0,0 +1,9 @@
+using System.Web.Mvc;
+
+namespace BeWoPlanerMobil.Controllers
+{
+ public abstract class SignableController : AbstractBaseController
+ {
+ public abstract ActionResult SaveSignature(FormCollection formCollection);
+ }
+}
diff --git a/BeWoPlanerMobil/Util/FormCollectionConstants.cs b/BeWoPlanerMobil/Util/FormCollectionConstants.cs
index 6a5237f5c..060200bdd 100644
--- a/BeWoPlanerMobil/Util/FormCollectionConstants.cs
+++ b/BeWoPlanerMobil/Util/FormCollectionConstants.cs
@@ -31,6 +31,7 @@
public static string BetragKey => "betrag";
public static string ServiceRecordSignatureBlobKey => "service-record-signature-blob";
public static string ServiceRecordSignatureDateKey => "service-record-signature-date";
+ public static string ServiceRecordSignatureObjOidKey => "signature-obj-oid";
public static string ServiceRecordSignatureRecordOidKey => "service-record-signature-record-oid";
public static string GroupBookingSelectedCb2ScOidsKey => "service-record-group-booking-cb2sc-oids";
public static string GroupBookingSelectedEmployeeOidsKey => "service-record-group-booking-employee-oids";
diff --git a/BeWoPlanerMobil/Views/DevExpressScheduler/SchedulerPagePartial.cshtml b/BeWoPlanerMobil/Views/DevExpressScheduler/SchedulerPagePartial.cshtml
index 0d003b384..c9ea0d33a 100644
--- a/BeWoPlanerMobil/Views/DevExpressScheduler/SchedulerPagePartial.cshtml
+++ b/BeWoPlanerMobil/Views/DevExpressScheduler/SchedulerPagePartial.cshtml
@@ -1,5 +1,6 @@
@using BeWoPlanerMobil.Views.DevExpressScheduler
@using BS.Shared.DataContracts
+@using DevExpress.Data.Helpers
@using DevExpress.XtraScheduler
@model BeWoPlanerMobil.Models.DevExpressSchedulerModel
@@ -25,14 +26,6 @@
settings.Views.MonthView.AppointmentDisplayOptions.ShowRecurrence = true;
settings.Views.MonthView.MonthViewStyles.DateCellBody.Height = Unit.Pixel(170);
- settings.Views.FullWeekView.Enabled = true;
- settings.Views.WeekView.Enabled = false;
- settings.Views.MonthView.ResourcesPerPage = 1;
- settings.Views.MonthView.AppointmentDisplayOptions.StartTimeVisibility = AppointmentTimeVisibility.Never;
- settings.Views.MonthView.AppointmentDisplayOptions.EndTimeVisibility = AppointmentTimeVisibility.Never;
- settings.Views.MonthView.AppointmentDisplayOptions.StatusDisplayType = AppointmentStatusDisplayType.Bounds;
- settings.Views.MonthView.AppointmentDisplayOptions.ShowRecurrence = true;
- settings.Views.MonthView.MonthViewStyles.DateCellBody.Height = Unit.Pixel(170);
TimeScale[] timeScales =
{
@@ -51,10 +44,6 @@
settings.Storage.Resources.Assign(SchedulerHelper.DefaultResourceStorage);
settings.Storage.Appointments.Assign(SchedulerHelper.DefaultAppointmentStorage);
- /*
- *
- */
-
settings.Storage.Appointments.Assign(SchedulerHelper.DefaultAppointmentStorage);
settings.Storage.Resources.Assign(SchedulerHelper.DefaultResourceStorage);
settings.Storage.Appointments.Mappings.Start = nameof(SchedulerAppointmentDC.StartDate);
diff --git a/BeWoPlanerMobil/Views/Main/ServiceRecordListPartial.cshtml b/BeWoPlanerMobil/Views/Main/ServiceRecordListPartial.cshtml
index 7f45a3027..08e4fcd3f 100644
--- a/BeWoPlanerMobil/Views/Main/ServiceRecordListPartial.cshtml
+++ b/BeWoPlanerMobil/Views/Main/ServiceRecordListPartial.cshtml
@@ -291,16 +291,6 @@
}
}
- @if(Model.ShowSignature && !serviceRecord.SignatureOid.HasValue && serviceRecord.Customer != null)
- {
- using(Html.BeginForm("SaveSignature", "Main", FormMethod.Post, new { id = $"save-signature-form-{serviceRecord.ServiceRecordOid.Value}" }))
- {
-
-
-
- }
- }
-
@* Button-Leiste (bearbeiten, löschen, unterschreiben/Unterschrift, externe Unterschrift *@
@* Edit-Button *@
diff --git a/BeWoPlanerMobil/Views/Main/SingleSignaturePopupPartial.cshtml b/BeWoPlanerMobil/Views/Main/SingleSignaturePopupPartial.cshtml
index 64d8a7bbf..c5429d124 100644
--- a/BeWoPlanerMobil/Views/Main/SingleSignaturePopupPartial.cshtml
+++ b/BeWoPlanerMobil/Views/Main/SingleSignaturePopupPartial.cshtml
@@ -69,7 +69,7 @@
}
@*
- Benötigt: ServiceRecord-Oid, Modal-Id, SketchPad-Container-Id, Ok-Button-Id, Neu-Button-Id, Abbrechen-Button-Id
+ Benötigt: ServiceRecord-Oid, Modal-Id, SketchPad-Container-Id, Ok-Button-Id, Neu-Button-Id, Abbrechen-Button-Id, SketchPad-Id
*@
function initializeSignatureCanvas(serviceRecordOid) {
hideSpinner();
@@ -154,7 +154,7 @@
form.append($("
",
{
type: "hidden",
- name: "@FormCollectionConstants.ServiceRecordSignatureRecordOidKey",
+ name: "@FormCollectionConstants.ServiceRecordSignatureObjOidKey",
value: selectedServiceRecordOid
}));
@@ -209,7 +209,7 @@ else