diff --git a/BeWoPlanerMobil/App_Start/FilterConfig.cs b/BeWoPlanerMobil/App_Start/FilterConfig.cs index 8ed3f537b..de3e82ae3 100644 --- a/BeWoPlanerMobil/App_Start/FilterConfig.cs +++ b/BeWoPlanerMobil/App_Start/FilterConfig.cs @@ -7,6 +7,21 @@ namespace BeWoPlanerMobil public static void RegisterGlobalFilters(GlobalFilterCollection filters) { filters.Add(new HandleErrorAttribute()); + filters.Add(new BeWoExceptionFilter()); } } + + public class BeWoExceptionFilter : IExceptionFilter + { + protected static readonly log4net.ILog Log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + + public void OnException(ExceptionContext filterContext) + { + var exception = filterContext.Exception; + + Log.Error($"{exception.Message}: {exception.StackTrace}"); + filterContext.Result = new ViewResult { ViewName = "Error" }; + + } + } } \ No newline at end of file diff --git a/BeWoPlanerMobil/BeWoPlanerMobil.csproj b/BeWoPlanerMobil/BeWoPlanerMobil.csproj index 7d6b5324d..82f38c36a 100644 --- a/BeWoPlanerMobil/BeWoPlanerMobil.csproj +++ b/BeWoPlanerMobil/BeWoPlanerMobil.csproj @@ -409,7 +409,6 @@ - diff --git a/BeWoPlanerMobil/Content/images/bewoplaner_logo_big.png b/BeWoPlanerMobil/Content/images/bewoplaner_logo_big.png deleted file mode 100644 index a5874eb7a..000000000 Binary files a/BeWoPlanerMobil/Content/images/bewoplaner_logo_big.png and /dev/null differ diff --git a/BeWoPlanerMobil/Controllers/AbstractBaseController.cs b/BeWoPlanerMobil/Controllers/AbstractBaseController.cs index 89afc922a..70862f4a8 100644 --- a/BeWoPlanerMobil/Controllers/AbstractBaseController.cs +++ b/BeWoPlanerMobil/Controllers/AbstractBaseController.cs @@ -8,7 +8,6 @@ using BeWo.Service.DCEntityMapper; using BeWo.Service.ServiceContracts; using BeWoPlanerMobil.Models; using BeWoPlanerMobil.Service; -using BeWoPlanerMobil.Util; using BS.Shared; using BS.Shared.Core; using BS.Shared.DataContracts; @@ -154,5 +153,14 @@ namespace BeWoPlanerMobil.Controllers } public abstract string SaveCollapsibleStatus(bool isOpen, string identifier); + + public ActionResult Error() + { +#if DEBUG + ViewBag.ErrorMessage = "[HIER KOMMT DIE FEHLERMELDUNG HIN]"; +#endif + + return View("Error"); + } } } diff --git a/BeWoPlanerMobil/Controllers/DevExpressSchedulerController.cs b/BeWoPlanerMobil/Controllers/DevExpressSchedulerController.cs index d5efe7300..4a5f6c2a4 100644 --- a/BeWoPlanerMobil/Controllers/DevExpressSchedulerController.cs +++ b/BeWoPlanerMobil/Controllers/DevExpressSchedulerController.cs @@ -37,7 +37,7 @@ namespace BeWoPlanerMobil.Controllers [Authorize] public ActionResult DevExpressScheduler() { - if(!MobileSessionFacade.IsUserLoggedIn() || Model == null) + if(!MobileSessionFacade.IsUserLoggedIn() || Model is null) { return RedirectToActionPermanent("Index", "Login"); } diff --git a/BeWoPlanerMobil/Controllers/MainController.cs b/BeWoPlanerMobil/Controllers/MainController.cs index f7d959929..6b2026aa3 100644 --- a/BeWoPlanerMobil/Controllers/MainController.cs +++ b/BeWoPlanerMobil/Controllers/MainController.cs @@ -2935,7 +2935,7 @@ namespace BeWoPlanerMobil.Controllers newResult.KannTrotzdemGespeichertWerden = false; break; - case Error: + case ServiceRecordValidationResult.Error: newResult.Message += "Beim Speichern ist ein Fehler aufgetreten.

"; exitLoop = true; newResult.KannTrotzdemGespeichertWerden = false; diff --git a/BeWoPlanerMobil/Controllers/ReportViewerController.cs b/BeWoPlanerMobil/Controllers/ReportViewerController.cs index 9d6d543a4..276bcaabc 100644 --- a/BeWoPlanerMobil/Controllers/ReportViewerController.cs +++ b/BeWoPlanerMobil/Controllers/ReportViewerController.cs @@ -658,7 +658,7 @@ namespace BeWoPlanerMobil.Controllers Model.SelectedValues.Remove(parameterOid.Value); } - break; + break; case QueryParameterType.DateRange: if(textValue != null && textValue.Length == 21 &&textValue.Contains("_")) { @@ -673,7 +673,7 @@ namespace BeWoPlanerMobil.Controllers { Model.SelectedValues.Remove(parameterOid.Value); } - break; + break; case QueryParameterType.Month: if(!textValue.Contains("_")) { @@ -689,7 +689,7 @@ namespace BeWoPlanerMobil.Controllers Model.SelectedValues.AddOrUpdate(parameterOid.Value, new SelectedValue(queryParameterType, new DateTime(year, month, 1))); } - break; + break; case QueryParameterType.ServiceCategory: if(objectOid is null || objectOid.Value.Equals(0)) { @@ -703,7 +703,7 @@ namespace BeWoPlanerMobil.Controllers { Model.SelectedValues.AddOrUpdate(parameterOid.Value, new SelectedValue(queryParameterType, selectedServiceCategory)); } - break; + break; case QueryParameterType.SupportConcept: var costBearer2SupportConceptRelListObj = Model.CostBearer2SupportConceptRelListObjects.FirstOrDefault(costBearer2SupportConceptRelListObject => costBearer2SupportConceptRelListObject.CostBearer2SupportConceptOid.Equals(objectOid.ToString())); @@ -719,7 +719,7 @@ namespace BeWoPlanerMobil.Controllers { Model.SelectedValues.AddOrUpdate(parameterOid.Value, new SelectedValue(queryParameterType, costBearer2SupportConceptRelListObj)); } - break; + break; case QueryParameterType.Team: if(objectOid is null || objectOid.Value.Equals(0)) { @@ -733,7 +733,7 @@ namespace BeWoPlanerMobil.Controllers { Model.SelectedValues.AddOrUpdate(parameterOid.Value, new SelectedValue(queryParameterType, selectedTeam)); } - break; + break; case QueryParameterType.ValueListEntryType: if(objectOid is null || objectOid.Value.Equals(0)) { @@ -747,7 +747,7 @@ namespace BeWoPlanerMobil.Controllers { Model.SelectedValues.AddOrUpdate(parameterOid.Value, new SelectedValue(queryParameterType, selectedValueListEntry)); } - break; + break; case QueryParameterType.Year: break; } diff --git a/BeWoPlanerMobil/Views/DevExpressScheduler/SchedulerPagePartial.cshtml b/BeWoPlanerMobil/Views/DevExpressScheduler/SchedulerPagePartial.cshtml index 7a34de776..c711e697e 100644 --- a/BeWoPlanerMobil/Views/DevExpressScheduler/SchedulerPagePartial.cshtml +++ b/BeWoPlanerMobil/Views/DevExpressScheduler/SchedulerPagePartial.cshtml @@ -1,4 +1,5 @@ @using BeWoPlanerMobil.Views.DevExpressScheduler +@using BS.Shared.DataContracts @using DevExpress.XtraScheduler @model BeWoPlanerMobil.Models.DevExpressSchedulerModel @@ -50,8 +51,19 @@ 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); + settings.Storage.Appointments.Mappings.End = nameof(SchedulerAppointmentDC.EndDate); + settings.Storage.Appointments.Mappings.Subject = nameof(SchedulerAppointmentDC.Subject); + settings.Storage.Appointments.Mappings.AllDay = nameof(SchedulerAppointmentDC.AllDay); + settings.Storage.Appointments.Mappings.Description = nameof(SchedulerAppointmentDC.Description); + settings.Storage.Appointments.Mappings.Status = nameof(SchedulerAppointmentDC.Status); + settings.Storage.Appointments.Mappings.Label = nameof(SchedulerAppointmentDC.LabelKey); settings.Views.DayView.Styles.ScrollAreaHeight = new Unit(500); diff --git a/BeWoPlanerMobil/Views/Main/SingleBookingPartial.cshtml b/BeWoPlanerMobil/Views/Main/SingleBookingPartial.cshtml index 5be159062..bfefa2426 100644 --- a/BeWoPlanerMobil/Views/Main/SingleBookingPartial.cshtml +++ b/BeWoPlanerMobil/Views/Main/SingleBookingPartial.cshtml @@ -627,7 +627,7 @@ Bis - + diff --git a/BeWoPlanerMobil/Views/Shared/Error.cshtml b/BeWoPlanerMobil/Views/Shared/Error.cshtml index 19d1517f8..034d282ad 100644 --- a/BeWoPlanerMobil/Views/Shared/Error.cshtml +++ b/BeWoPlanerMobil/Views/Shared/Error.cshtml @@ -1,19 +1,46 @@ -@{ - Layout = null; -} - - + Fehler + + + + + + + + -
-

Fehler.

-

Es ist ein Fehler aufgetreten. Bitte wenden Sie sich an Ihren Administrator.

-

@ViewData["BeWoError"]

-
+ + +
+
+
+

Fehler

+

Es ist ein Fehler aufgetreten. Bitte wenden Sie sich an Ihren Administrator.

+ + + + +
+
+
\ No newline at end of file diff --git a/BeWoPlanerMobil/Web.Debug.config b/BeWoPlanerMobil/Web.Debug.config index a83c1d4a0..bcf225805 100644 --- a/BeWoPlanerMobil/Web.Debug.config +++ b/BeWoPlanerMobil/Web.Debug.config @@ -21,10 +21,10 @@ Note that because there is only one customErrors section under the node, there is no need to use the "xdt:Locator" attribute. - - - + --> + + + \ No newline at end of file