+ @* Start *@
+
+ |
+ @Html.DevExpress().Label(
+ settings =>
+ {
+ settings.AssociatedControlName = nameof(SchedulerAppointmentDC.StartDate);
+ settings.Text = "Start:";
+ settings.Width = Unit.Percentage(100);
+ }).GetHtml()
+ |
+
+ @Html.DevExpress().DateEdit(
+ settings =>
+ {
+ settings.Name = nameof(SchedulerAppointmentDC.StartDate);
+ settings.Properties.EditFormat = EditFormat.DateTime;
+ settings.ShowModelErrors = true;
+ settings.Properties.ValidationSettings.Display = Display.Dynamic;
+ settings.Width = Unit.Percentage(100);
+ }).Bind(Model.StartTime).GetHtml()
+ |
+
+
+ @* Ende *@
+
+ |
+ @Html.DevExpress().Label(
+ settings =>
+ {
+ settings.AssociatedControlName = nameof(SchedulerAppointmentDC.EndDate);
+ settings.Text = "Ende:";
+ settings.Width = Unit.Percentage(100);
+ }).GetHtml()
+ |
+
+ @Html.DevExpress().DateEdit(
+ settings =>
+ {
+ settings.Name = nameof(SchedulerAppointmentDC.EndDate);
+ settings.Properties.EditFormat = EditFormat.DateTime;
+ settings.ShowModelErrors = true;
+ settings.Properties.ValidationSettings.Display = Display.Dynamic;
+ settings.Width = Unit.Percentage(100);
+ }).Bind(Model.EndTime).GetHtml()
+ |
+
+
+ @* Private & Ganztägig *@
+
+
+
+
+ |
+ @Html.DevExpress().CheckBox(
+ settings =>
+ {
+ settings.Name = nameof(SchedulerAppointmentDC.IsPrivate);
+ settings.Width = Unit.Percentage(100);
+ }).Bind(Model.IsPrivate).GetHtml()
+ |
+
+ @Html.DevExpress().Label(
+ settings =>
+ {
+ settings.AssociatedControlName = nameof(SchedulerAppointmentDC.IsPrivate);
+ settings.Text = "Privat";
+ settings.Width = Unit.Percentage(100);
+ settings.ControlStyle.CssClass = "centeredLabel";
+ }).GetHtml()
+ |
+
+ @Html.DevExpress().CheckBox(
+ settings =>
+ {
+ settings.Name = nameof(SchedulerAppointmentDC.AllDay);
+ settings.Width = Unit.Percentage(100);
+ }).Bind(Model.AllDay).GetHtml()
+ |
+
+ @Html.DevExpress().Label(
+ settings =>
+ {
+ settings.AssociatedControlName = nameof(SchedulerAppointmentDC.AllDay);
+ settings.Text = "Ganztägig";
+ settings.Width = Unit.Percentage(100);
+ settings.ControlStyle.CssClass = "centeredLabel";
+ }).GetHtml()
+ |
+
+
+ |
+
+
+ @* Mitarbeiter, Klienten, Ressourcen *@
+
+
+
+
+ |
+ @Html.Partial("EmployeeMultiSelectPartial")
+ |
+
+ @Html.Partial("CustomerMultiSelectPartial")
+ |
+
+ @Html.Partial("ResourceMultiSelectPartial")
+ |
+
+
+ |
+
+
+ @* Betreff *@
+
+ |
+ @Html.DevExpress().Label(
+ settings =>
+ {
+ settings.AssociatedControlName = nameof(SchedulerAppointmentDC.Subject);
+ settings.Text = "Betreff:";
+ settings.Width = Unit.Percentage(100);
+ }).GetHtml()
+ |
+
+ @Html.DevExpress().TextBox(
+ settings =>
+ {
+ settings.Name = nameof(SchedulerAppointmentDC.Subject);
+ settings.ShowModelErrors = true;
+ settings.Properties.ValidationSettings.Display = Display.Dynamic;
+ settings.Width = Unit.Percentage(100);
+ }).Bind(Model.Subject).GetHtml()
+ |
+
+
+ @* Ort *@
+
+ |
+ @Html.DevExpress().Label(
+ settings =>
+ {
+ settings.AssociatedControlName = nameof(SchedulerAppointmentDC.Location);
+ settings.Text = "Ort:";
+ settings.Width = Unit.Percentage(100);
+ }).GetHtml()
+ |
+
+ @Html.DevExpress().TextBox(
+ settings =>
+ {
+ settings.Name = nameof(SchedulerAppointmentDC.Location);
+ settings.ShowModelErrors = true;
+ settings.Properties.ValidationSettings.Display = Display.Dynamic;
+ settings.Width = Unit.Percentage(100);
+ }).Bind(Model.Location).GetHtml()
+ |
+
+
+ @* Notiz *@
+
+ |
+ @Html.DevExpress().Label(
+ settings =>
+ {
+ settings.AssociatedControlName = nameof(SchedulerAppointmentDC.Description);
+ settings.Text = "Notiz:";
+ settings.Width = Unit.Percentage(100);
+ }).GetHtml()
+ |
+
+
+ |
+ @Html.DevExpress().Memo(
+ settings =>
+ {
+ settings.Name = nameof(SchedulerAppointmentDC.Description);
+ settings.Properties.Rows = 4;
+ settings.ShowModelErrors = true;
+ settings.Properties.ValidationSettings.Display = Display.Dynamic;
+ settings.Width = Unit.Percentage(100);
+ }).Bind(Model.Description).GetHtml()
+ |
+
+
+
+ @Html.DevExpress().AppointmentRecurrenceForm(ViewBag.AppointmentRecurrenceFormSettings).GetHtml()
+
+ ");
+ Html.DevExpress().Button(btnSettings =>
+ {
+ btnSettings.Name = "btnClose";
+ btnSettings.UseSubmitBehavior = false;
+ btnSettings.Text = "Schließen";
+ btnSettings.ClientSideEvents.Click = "CloseCustomerGridLookup";
+ }).Render();
+ ViewContext.Writer.Write("
");
+ });
+}).BindList(Model.PossibleCustomers).Bind(Model.SelectedCustomerOids).GetHtml()
\ No newline at end of file
diff --git a/BeWoPlanerMobil/Views/DevExpressScheduler/DevExpressScheduler.cshtml b/BeWoPlanerMobil/Views/DevExpressScheduler/DevExpressScheduler.cshtml
index 9569735f6..b3da0836b 100644
--- a/BeWoPlanerMobil/Views/DevExpressScheduler/DevExpressScheduler.cshtml
+++ b/BeWoPlanerMobil/Views/DevExpressScheduler/DevExpressScheduler.cshtml
@@ -1,7 +1,127 @@
-@model BeWoPlanerMobil.Models.DevExpressSchedulerModel
+@using BeWoPlanerMobil.Util.Constants
+@using BeWoPlanerMobil.Util.SchedulerUtils
+@using BS.Shared.DataContracts.Compact
+@model BeWoPlanerMobil.Models.DevExpressSchedulerModel
@{
ViewBag.Title = "DevExpressScheduler";
}
-@Html.Partial("SchedulerPagePartial", Model)
\ No newline at end of file
+
+
+@using(Html.BeginForm())
+{
+ @Html.Partial("SchedulerPagePartial", Model)
+}
\ No newline at end of file
diff --git a/BeWoPlanerMobil/Views/DevExpressScheduler/EmployeeMultiSelectPartial.cshtml b/BeWoPlanerMobil/Views/DevExpressScheduler/EmployeeMultiSelectPartial.cshtml
new file mode 100644
index 000000000..61fee524b
--- /dev/null
+++ b/BeWoPlanerMobil/Views/DevExpressScheduler/EmployeeMultiSelectPartial.cshtml
@@ -0,0 +1,50 @@
+@model BeWoPlanerMobil.Models.AppointmentModel
+@using BS.Shared.DataContracts.Compact
+@using DevExpress.Web.Mvc.UI
+
+@Html.DevExpress().GridLookup(settings =>
+{
+ // ToDo: Es müssen CompcatEmployee-Objekte sein!
+ settings.Name = "EmployeeGridLookup";
+ settings.GridViewProperties.CallbackRouteValues = new { controller = "DevExpressScheduler", Action = "EmployeeGridLookupPartial" };
+ settings.KeyFieldName = nameof(CompactEmployeeDC.EmployeeOid);
+
+ settings.CommandColumn.ShowSelectCheckbox = true;
+ settings.CommandColumn.Visible = true;
+
+ settings.Columns.Add(c =>
+ {
+ c.FieldName = nameof(CompactEmployeeDC.EmployeeOid);
+ c.Visible = false;
+ });
+
+ settings.Columns.Add(c =>
+ {
+ c.FieldName = nameof(CompactEmployeeDC.DetailDescription);
+ c.Caption = nameof(CompactEmployeeDC.DetailDescription);
+ });
+
+ settings.Width = Unit.Percentage(100);
+ settings.Properties.SelectionMode = GridLookupSelectionMode.Multiple;
+ settings.Properties.TextFormatString = "{1}";
+ settings.Properties.MultiTextSeparator = "; ";
+ settings.Properties.Width = 250;
+ settings.Properties.NullText = "Mitarbeiter";
+
+ settings.GridViewProperties.Settings.ShowFilterRow = true;
+ settings.GridViewProperties.Settings.ShowStatusBar = GridViewStatusBarMode.Visible;
+ settings.GridViewProperties.SettingsPager.EnableAdaptivity = true;
+ settings.GridViewProperties.SettingsPager.PageSize = 7;
+ settings.GridViewProperties.SetStatusBarTemplateContent(c =>
+ {
+ ViewContext.Writer.Write("");
+ Html.DevExpress().Button(btnSettings =>
+ {
+ btnSettings.Name = "btnClose3";
+ btnSettings.UseSubmitBehavior = false;
+ btnSettings.Text = "Schließen";
+ btnSettings.ClientSideEvents.Click = "CloseEmployeeGridLookup";
+ }).Render();
+ ViewContext.Writer.Write("
");
+ });
+}).BindList(Model.PossibleEmployees).Bind(Model.SelectedEmployeeOids).GetHtml()
\ No newline at end of file
diff --git a/BeWoPlanerMobil/Views/DevExpressScheduler/HorizontalAppointmentTemplatePartial.cshtml b/BeWoPlanerMobil/Views/DevExpressScheduler/HorizontalAppointmentTemplatePartial.cshtml
new file mode 100644
index 000000000..8b3dad682
--- /dev/null
+++ b/BeWoPlanerMobil/Views/DevExpressScheduler/HorizontalAppointmentTemplatePartial.cshtml
@@ -0,0 +1,52 @@
+@using BeWoPlanerMobil.Util
+@model DevExpress.XtraScheduler.Appointment
+
+@functions
+{
+ string GetSubjectAndLocation()
+ {
+ var locationPart = false == string.IsNullOrWhiteSpace(Model.Location) ? $" ({Model.Location})" : string.Empty;
+
+ return $" {Model.Subject}{locationPart}";
+ }
+
+ string GetHeaderTime()
+ {
+ return Model.AllDay ? string.Empty : $"{Model.Start.ToShortTimeString()} - {Model.End.ToShortTimeString()}";
+ }
+}
+
+
+
+ ");
+ Html.DevExpress().Button(btnSettings =>
+ {
+ btnSettings.Name = "btnClose2";
+ btnSettings.UseSubmitBehavior = false;
+ btnSettings.Text = "Schließen";
+ btnSettings.ClientSideEvents.Click = "CloseResourceGridLookup";
+ }).Render();
+ ViewContext.Writer.Write("
");
+ });
+}).BindList(Model.PossibleResources).Bind(Model.SelectedResourceOids).GetHtml()
\ No newline at end of file
diff --git a/BeWoPlanerMobil/Views/DevExpressScheduler/SchedulerHelper.cs b/BeWoPlanerMobil/Views/DevExpressScheduler/SchedulerHelper.cs
index 7371ff96d..f2115d4e6 100644
--- a/BeWoPlanerMobil/Views/DevExpressScheduler/SchedulerHelper.cs
+++ b/BeWoPlanerMobil/Views/DevExpressScheduler/SchedulerHelper.cs
@@ -1,83 +1,62 @@
-using System;
-using System.Web.Mvc;
-using System.Web.UI.WebControls;
+using DevExpress.Web.ASPxScheduler;
using DevExpress.Web.Mvc;
-using DevExpress.XtraScheduler;
-using DayView = DevExpress.Web.ASPxScheduler.DayView;
-
-// TODO:
-
-/*
- *
- * ToDo am 08.12.2025: Folgende Klassen erstellen:
- *
- * 1: SchedulerDataHelper mit Datenbankzugriffen
- * GetAppointments()
- * GetResources()
- *
- *
- *
- *
- *
- *
- *
- * 1. SchedulerDataObject
- *
- */
+using BS.Shared.DataContracts;
namespace BeWoPlanerMobil.Views.DevExpressScheduler
{
public static class SchedulerHelper
{
private static MVCxAppointmentStorage _DefaultAppointmentStorage;
-
public static MVCxAppointmentStorage DefaultAppointmentStorage => _DefaultAppointmentStorage ?? (_DefaultAppointmentStorage = CreateDefaultAppointmentStorage());
+ private static MVCxResourceStorage _DefaultResourceStorage;
+ public static MVCxResourceStorage DefaultResourceStorage => _DefaultResourceStorage ?? (_DefaultResourceStorage = CreateDefaultResourceStorage());
+
private static MVCxAppointmentStorage CreateDefaultAppointmentStorage()
{
var appointmentStorage = new MVCxAppointmentStorage();
- SetupMappings(appointmentStorage);
+ appointmentStorage.Mappings.AppointmentId = nameof(SchedulerAppointmentDC.SchedulerAppointmentOid);
+ appointmentStorage.Mappings.Type = nameof(SchedulerAppointmentDC.Type);
+ appointmentStorage.Mappings.Label = nameof(SchedulerAppointmentDC.LabelKey);
+ appointmentStorage.Mappings.AllDay = nameof(SchedulerAppointmentDC.AllDay);
+ appointmentStorage.Mappings.Location = nameof(SchedulerAppointmentDC.Location);
+ appointmentStorage.Mappings.Status = nameof(SchedulerAppointmentDC.Status);
+ appointmentStorage.Mappings.RecurrenceInfo = nameof(SchedulerAppointmentDC.RecurrenceInfo);
+ appointmentStorage.Mappings.Subject = nameof(SchedulerAppointmentDC.Subject);
+ appointmentStorage.Mappings.Start = nameof(SchedulerAppointmentDC.StartDate);
+ appointmentStorage.Mappings.End = nameof(SchedulerAppointmentDC.EndDate);
+ appointmentStorage.Mappings.Description = nameof(SchedulerAppointmentDC.Description);
+ appointmentStorage.Mappings.ReminderInfo = nameof(SchedulerAppointmentDC.ReminderInfo);
+ appointmentStorage.Mappings.ResourceId = "ResourceID";
- appointmentStorage.CustomFieldMappings.Add("CustomFieldStorage", "CustomFieldStorage");
+ appointmentStorage.CustomFieldMappings.Add(new ASPxAppointmentCustomFieldMapping("Originator", nameof(SchedulerAppointmentDC.Originator)));
+ appointmentStorage.CustomFieldMappings.Add(new ASPxAppointmentCustomFieldMapping("Customers", nameof(SchedulerAppointmentDC.CustomerList)));
+ appointmentStorage.CustomFieldMappings.Add(new ASPxAppointmentCustomFieldMapping("Employees", nameof(SchedulerAppointmentDC.EmployeeList)));
+ appointmentStorage.CustomFieldMappings.Add(new ASPxAppointmentCustomFieldMapping("Resources", nameof(SchedulerAppointmentDC.ResourceList)));
+
+ appointmentStorage.CustomFieldMappings.Add(new ASPxAppointmentCustomFieldMapping("IsPrivate", "IsPrivate"));
+ appointmentStorage.CustomFieldMappings.Add(new ASPxAppointmentCustomFieldMapping("CanBeEdited", "CanBeEdited"));
+
+ appointmentStorage.CustomFieldMappings.Add(new ASPxAppointmentCustomFieldMapping("HasServiceRecordEntry", "HasServiceRecordEntry"));
+ appointmentStorage.CustomFieldMappings.Add(new ASPxAppointmentCustomFieldMapping("ServiceRecordList", "ServiceRecordList"));
+
+ appointmentStorage.CustomFieldMappings.Add(new ASPxAppointmentCustomFieldMapping("IsAbsenceTime", "IsAbsenceTime"));
+ appointmentStorage.CustomFieldMappings.Add(new ASPxAppointmentCustomFieldMapping("IsCustomerAbsenceTime", "IsCustomerAbsenceTime"));
+ appointmentStorage.CustomFieldMappings.Add(new ASPxAppointmentCustomFieldMapping("AbsenceTimeStart", "AbsenceTimeStart"));
+ appointmentStorage.CustomFieldMappings.Add(new ASPxAppointmentCustomFieldMapping("AbsenceTimeEnd", "AbsenceTimeEnd"));
+ appointmentStorage.CustomFieldMappings.Add(new ASPxAppointmentCustomFieldMapping("AbsenceTimeOid", "AbsenceTimeOid"));
+
+ appointmentStorage.CustomFieldMappings.Add(new ASPxAppointmentCustomFieldMapping("IsTask", "IsTask"));
+ appointmentStorage.CustomFieldMappings.Add(new ASPxAppointmentCustomFieldMapping("DueDate", "DueDate"));
+ appointmentStorage.CustomFieldMappings.Add(new ASPxAppointmentCustomFieldMapping("CompletedDate", "CompletedDate"));
+ appointmentStorage.CustomFieldMappings.Add(new ASPxAppointmentCustomFieldMapping("CompletedNotice", "CompletedNotice"));
+ appointmentStorage.CustomFieldMappings.Add(new ASPxAppointmentCustomFieldMapping("CompletedUser", "CompletedUser"));
+ appointmentStorage.CustomFieldMappings.Add(new ASPxAppointmentCustomFieldMapping("TaskDescription", "TaskDescription"));
return appointmentStorage;
}
- public static void SetupMappings(MVCxAppointmentStorage storage)
- {
- storage.Mappings.AppointmentId = "Oid";
- storage.Mappings.Start = "StartDate";
- storage.Mappings.End = "EndDate";
- storage.Mappings.Subject = "Subject";
- storage.Mappings.Description = "Description";
- storage.Mappings.Label = "LabelId";
- storage.Mappings.AllDay = "AllDay";
- storage.Mappings.ResourceId = "ResourceId";
- storage.Mappings.RecurrenceInfo = "RecurrenceInfo";
- storage.Mappings.ReminderInfo = "ReminderInfo";
- storage.Mappings.Location = "Location";
- storage.Mappings.Type = "EventType";
- storage.Mappings.Status = "Status";
- }
-
- public static void ApplyCommonViewSettings(DayView view)
- {
- view.ResourcesPerPage = 1;
- ApplyWorkTime(view);
- }
-
- private static void ApplyWorkTime(DayView view)
- {
- view.WorkTime.Start = TimeSpan.FromHours(7);
- view.WorkTime.End = TimeSpan.FromHours(20);
- view.ShowWorkTimeOnly = true;
- }
-
- private static MVCxResourceStorage _DefaultResourceStorage;
-
- public static MVCxResourceStorage DefaultResourceStorage => _DefaultResourceStorage ?? (_DefaultResourceStorage = CreateDefaultResourceStorage());
-
private static MVCxResourceStorage CreateDefaultResourceStorage()
{
var resourceStorage = new MVCxResourceStorage();
@@ -87,54 +66,5 @@ namespace BeWoPlanerMobil.Views.DevExpressScheduler
return resourceStorage;
}
-
- public static SchedulerSettings GetSchedulerSettings()
- {
- return GetSchedulerSettings(null);
- }
-
- public static SchedulerSettings GetSchedulerSettings(this HtmlHelper customHtml)
- {
- var settings = new SchedulerSettings
- {
- Name = "scheduler",
- CallbackRouteValues = new { Controller = "DevExpressScheduler", Action = "SchedulerPagePartial" },
- EditAppointmentRouteValues = new { Controller = "DevExpressScheduler", Action = "EditAppointment" },
- };
-
- ApplyCommonViewSettings(settings.Views.DayView);
- ApplyCommonViewSettings(settings.Views.WorkWeekView);
- ApplyCommonViewSettings(settings.Views.FullWeekView);
-
- 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 =
- {
- new TimeScaleYear { Enabled = false },
- new TimeScaleQuarter { Enabled = false },
- new TimeScaleMonth(),
- new TimeScaleFixedInterval { Enabled = false },
- new TimeScaleDay(),
- new TimeScaleHour { Enabled = false }
- };
-
- settings.Views.TimelineView.Scales.AddRange(timeScales);
- settings.Views.TimelineView.ResourcesPerPage = 2;
-
- settings.Storage.EnableReminders = false;
- settings.Storage.Resources.Assign(DefaultResourceStorage);
- settings.Storage.Appointments.Assign(DefaultAppointmentStorage);
-
- settings.Views.DayView.Styles.ScrollAreaHeight = new Unit(500);
-
- return settings;
- }
}
}
\ No newline at end of file
diff --git a/BeWoPlanerMobil/Views/DevExpressScheduler/SchedulerPagePartial.cshtml b/BeWoPlanerMobil/Views/DevExpressScheduler/SchedulerPagePartial.cshtml
index c9ea0d33a..0429dde94 100644
--- a/BeWoPlanerMobil/Views/DevExpressScheduler/SchedulerPagePartial.cshtml
+++ b/BeWoPlanerMobil/Views/DevExpressScheduler/SchedulerPagePartial.cshtml
@@ -1,62 +1,246 @@
-@using BeWoPlanerMobil.Views.DevExpressScheduler
+@using BeWoPlanerMobil.Models
+@using BeWoPlanerMobil.Util.Constants
+@using BeWoPlanerMobil.Util.SchedulerUtils
+@using BeWoPlanerMobil.Views.DevExpressScheduler
@using BS.Shared.DataContracts
-@using DevExpress.Data.Helpers
+@using BS.Shared.DataContracts.Compact
@using DevExpress.XtraScheduler
+@using MenuItem = DevExpress.Web.MenuItem
+@using PopupMenuShowingEventArgs = DevExpress.Web.ASPxScheduler.PopupMenuShowingEventArgs
@model BeWoPlanerMobil.Models.DevExpressSchedulerModel
+@functions
+{
+ //ToDo: So das EditForm verändern!
+ //https://docs.devexpress.com/AspNetMvc/119776/components/scheduler/get-started/how-to-customize-the-appointment-dialog-using-view-model-api-working-with-custom-fields?utm_source=SupportCenter&utm_medium=website&utm_campaign=docs-feedback&utm_content=T743814
+
+ static AppointmentRecurrenceFormSettings CreateAppointmentRecurrenceFormSettings(CustomAppointmentTemplateContainer container)
+ {
+ return new AppointmentRecurrenceFormSettings
+ {
+ Name = "appointmentRecurrenceForm",
+ Width = Unit.Percentage(100),
+ IsRecurring = container.Appointment.IsRecurring,
+ DayNumber = container.RecurrenceDayNumber,
+ End = container.RecurrenceEnd,
+ Month = container.RecurrenceMonth,
+ OccurrenceCount = container.RecurrenceOccurrenceCount,
+ Periodicity = container.RecurrencePeriodicity,
+ RecurrenceRange = container.RecurrenceRange,
+ Start = container.Start,
+ WeekDays = container.RecurrenceWeekDays,
+ WeekOfMonth = container.RecurrenceWeekOfMonth,
+ RecurrenceType = container.RecurrenceType,
+ IsFormRecreated = container.IsFormRecreated
+ };
+ }
+
+ static void PopupMenuShowing(object s, PopupMenuShowingEventArgs e)
+ {
+ var menuId = e.Menu.MenuId;
+
+ var invisibleMenuItemNames = new List