|
|
@@ -1,9 +1,71 @@
|
|
|
@using GreenTree.Nachtragsmanagement.Web.Extensions
|
|
|
|
|
|
+@{
|
|
|
+ var userContext = GreenTree.Nachtragsmanagement.Core.CommonHelper.UserContext();
|
|
|
+}
|
|
|
+
|
|
|
@model GreenTree.Nachtragsmanagement.Web.Models.Deviation.DeviationDataModel
|
|
|
|
|
|
<div class="deviationEditContainer">
|
|
|
|
|
|
+ <script>
|
|
|
+ function addStatus() {
|
|
|
+ $.ajax({
|
|
|
+ url: '@Url.Action("EditClaim", "Deviation")',
|
|
|
+ data: { claimType: "status", Id: -1 },
|
|
|
+ success: function (response) {
|
|
|
+ setTimeout(function () {
|
|
|
+ $(".claimEditContainer").remove();
|
|
|
+ $("body").append(response);
|
|
|
+ parent.addCustomEventListener('StatusDataCallbackEventReceiver', function () {
|
|
|
+ StatusId.PerformCallback();
|
|
|
+ });
|
|
|
+ }, 200);
|
|
|
+ },
|
|
|
+ error: function () {
|
|
|
+ alert("error occured");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ function addDisturbance() {
|
|
|
+ $.ajax({
|
|
|
+ url: '@Url.Action("EditClaim", "Deviation")',
|
|
|
+ data: { claimType: "disturbance", Id: -1 },
|
|
|
+ success: function (response) {
|
|
|
+ setTimeout(function () {
|
|
|
+ $(".claimEditContainer").remove();
|
|
|
+ $("body").append(response);
|
|
|
+ parent.addCustomEventListener('DisturbanceDataCallbackEventReceiver', function () {
|
|
|
+ DisturbanceId.PerformCallback();
|
|
|
+ });
|
|
|
+ }, 200);
|
|
|
+ },
|
|
|
+ error: function () {
|
|
|
+ alert("error occured");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ function addKind() {
|
|
|
+ $.ajax({
|
|
|
+ url: '@Url.Action("EditClaim", "Deviation")',
|
|
|
+ data: { claimType: "kind", Id: -1 },
|
|
|
+ success: function (response) {
|
|
|
+ setTimeout(function () {
|
|
|
+ $(".claimEditContainer").remove();
|
|
|
+ $("body").append(response);
|
|
|
+ parent.addCustomEventListener('KindDataCallbackEventReceiver', function () {
|
|
|
+ KindId.PerformCallback();
|
|
|
+ });
|
|
|
+ }, 200);
|
|
|
+ },
|
|
|
+ error: function () {
|
|
|
+ alert("error occured");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ </script>
|
|
|
@Html.DevExpress().PopupControl(s =>
|
|
|
{
|
|
|
s.Name = "devPopupControlEditDeviation";
|
|
|
@@ -17,14 +79,15 @@
|
|
|
s.Width = new Unit(500, UnitType.Pixel);
|
|
|
s.CloseAction = CloseAction.CloseButton;
|
|
|
s.PopupHorizontalAlign = PopupHorizontalAlign.WindowCenter;
|
|
|
- s.PopupVerticalAlign = PopupVerticalAlign.WindowCenter;
|
|
|
+ s.PopupVerticalAlign = PopupVerticalAlign.TopSides;
|
|
|
+ s.PopupVerticalOffset = 10;
|
|
|
s.AllowDragging = false;
|
|
|
s.AllowResize = false;
|
|
|
s.ShowFooter = false;
|
|
|
s.ShowOnPageLoad = true;
|
|
|
s.SetContent(() =>
|
|
|
{
|
|
|
- using (Html.BeginForm("EditDeviation", "Admin", FormMethod.Post, new { id = "deviationEditForm" }))
|
|
|
+ using (Html.BeginForm("EditDeviation", "Deviation", FormMethod.Post, new { id = "deviationEditForm" }))
|
|
|
{
|
|
|
ViewContext.Writer.Write("<div class='editFormWrapper'>");
|
|
|
|
|
|
@@ -34,62 +97,191 @@
|
|
|
ViewContext.Writer.Write(Html.ValidationMessageFor(m => m.CustomNumber).ToHtmlString());
|
|
|
Html.DevExpress().TextBoxFor(m => m.CustomNumber, t =>
|
|
|
{
|
|
|
- t.Width = new Unit(60, UnitType.Percentage);
|
|
|
+ t.Width = new Unit(47.5, UnitType.Percentage);
|
|
|
}).Render();
|
|
|
|
|
|
- ViewContext.Writer.Write(Html.CustomLabelFor(m => m.Value, "Wert:"));
|
|
|
- ViewContext.Writer.Write(Html.ValidationMessageFor(m => m.Value).ToHtmlString());
|
|
|
- Html.DevExpress().SpinEditFor(m => m.Value, t =>
|
|
|
+ ViewContext.Writer.Write("<div class='inlineModelPropertyContainer'>");
|
|
|
{
|
|
|
- t.Width = new Unit(50, UnitType.Percentage);
|
|
|
- }).Render();
|
|
|
+ ViewContext.Writer.Write("<div class='inlineModelProperty' style='width: 50%'>");
|
|
|
+ {
|
|
|
+ ViewContext.Writer.Write(Html.CustomLabelFor(m => m.Value, "Wert:"));
|
|
|
+ ViewContext.Writer.Write(Html.ValidationMessageFor(m => m.Value).ToHtmlString());
|
|
|
+ Html.DevExpress().SpinEditFor(m => m.Value, t =>
|
|
|
+ {
|
|
|
+ t.Width = new Unit(95, UnitType.Percentage);
|
|
|
+ t.Properties.DecimalPlaces = 2;
|
|
|
+ t.Properties.NumberType = SpinEditNumberType.Float;
|
|
|
+ t.Properties.DisplayFormatString = "c2";
|
|
|
+ }).Render();
|
|
|
+ }
|
|
|
+ ViewContext.Writer.Write("</div>");
|
|
|
+ ViewContext.Writer.Write("<div class='inlineModelProperty' style='width: 50%'>");
|
|
|
+ {
|
|
|
+ ViewContext.Writer.Write(Html.CustomLabelFor(m => m.ReceiptDate, "Eingangsdatum:"));
|
|
|
+ ViewContext.Writer.Write(Html.ValidationMessageFor(m => m.ReceiptDate).ToHtmlString());
|
|
|
+ Html.DevExpress().DateEditFor(m => m.ReceiptDate, t =>
|
|
|
+ {
|
|
|
+ t.Width = new Unit(100, UnitType.Percentage);
|
|
|
+ }).Render();
|
|
|
+ }
|
|
|
+ ViewContext.Writer.Write("</div>");
|
|
|
+ }
|
|
|
+ ViewContext.Writer.Write("</div>");
|
|
|
+
|
|
|
+ ViewContext.Writer.Write(Html.CustomLabelFor(m => m.AppendixId, "Nachtrag:"));
|
|
|
+
|
|
|
+ Session.Add("DeviationAppendicesComboBoxSettings", new Action<ComboBoxSettings>(a =>
|
|
|
+ {
|
|
|
+ a.Width = new Unit(47.5, UnitType.Percentage);
|
|
|
+ a.Properties.ValueType = typeof(int);
|
|
|
+ a.Properties.ValueField = "Id";
|
|
|
+ a.Properties.TextField = "Description";
|
|
|
+
|
|
|
+ var serializedModel = Newtonsoft.Json.JsonConvert.SerializeObject(Model);
|
|
|
+
|
|
|
+ a.CallbackRouteValues = new
|
|
|
+ {
|
|
|
+ Controller = "DataCallback",
|
|
|
+ Action = "AppendicesComboBox",
|
|
|
+ SettingsKey = "DeviationAppendicesComboBoxSettings",
|
|
|
+ Model = serializedModel,
|
|
|
+ Type = Model.GetType().FullName
|
|
|
+ };
|
|
|
+ }));
|
|
|
+ ViewData.Add("AppendicesComboBoxSettings", "DeviationAppendicesComboBoxSettings");
|
|
|
+ Html.RenderPartial("~/Views/Shared/DataEditorTemplates/_AppendicesComboBox.cshtml", Model, ViewData);
|
|
|
|
|
|
ViewContext.Writer.Write("<div class='inlineModelPropertyContainer'>");
|
|
|
- ViewContext.Writer.Write("<div class='inlineModelProperty' style='width: 30%'>");
|
|
|
+ {
|
|
|
+ ViewContext.Writer.Write("<div class='inlineModelProperty' style='width: 33%'>");
|
|
|
+ {
|
|
|
ViewContext.Writer.Write(Html.CustomLabelFor(m => m.StatusId, "Status:"));
|
|
|
ViewContext.Writer.Write(Html.ValidationMessageFor(m => m.StatusId).ToHtmlString());
|
|
|
- Html.DevExpress().ComboBoxFor(m => m.StatusId, t =>
|
|
|
+
|
|
|
+ Session.Add("DeviationStatusesComboBoxSettings", new Action<ComboBoxSettings>(a =>
|
|
|
{
|
|
|
- t.Width = new Unit(100, UnitType.Percentage);
|
|
|
- t.Properties.ValueType = typeof(int);
|
|
|
- t.Properties.ValueField = "Id";
|
|
|
- t.Properties.TextField = "Description";
|
|
|
- }).BindList(ViewData["AllStatuses"]).Render();
|
|
|
+ a.Width = new Unit(95, UnitType.Percentage);
|
|
|
+ a.Properties.ValueType = typeof(int);
|
|
|
+ a.Properties.ValueField = "Id";
|
|
|
+ a.Properties.TextField = "Description";
|
|
|
+
|
|
|
+ var serializedModel = Newtonsoft.Json.JsonConvert.SerializeObject(Model);
|
|
|
+
|
|
|
+ a.CallbackRouteValues = new
|
|
|
+ {
|
|
|
+ Controller = "DataCallback",
|
|
|
+ Action = "StatusesComboBox",
|
|
|
+ SettingsKey = "DeviationStatusesComboBoxSettings",
|
|
|
+ Model = serializedModel,
|
|
|
+ Type = Model.GetType().FullName
|
|
|
+ };
|
|
|
+ }));
|
|
|
+ ViewData.Add("StatusesComboBoxSettings", "DeviationStatusesComboBoxSettings");
|
|
|
+ Html.RenderPartial("~/Views/Shared/DataEditorTemplates/_StatusesComboBox.cshtml", Model, ViewData);
|
|
|
+
|
|
|
+ if (userContext.CurrentUser.HasFunction("Deviation-Claims-Edit"))
|
|
|
+ {
|
|
|
+ Html.DevExpress().HyperLink(t =>
|
|
|
+ {
|
|
|
+ t.Name = "devHyperLinkStatusEventReceiver";
|
|
|
+ t.Properties.Text = "Hinzufügen";
|
|
|
+ t.NavigateUrl = "#";
|
|
|
+ t.Properties.ClientSideEvents.Click = "function (s, e) { addStatus(); }";
|
|
|
+ t.Style.Add("line-height", "24px");
|
|
|
+ }).Render();
|
|
|
+ }
|
|
|
+ }
|
|
|
ViewContext.Writer.Write("</div>");
|
|
|
|
|
|
- ViewContext.Writer.Write("<div class='inlineModelProperty' style='width: 30%'>");
|
|
|
+ ViewContext.Writer.Write("<div class='inlineModelProperty' style='width: 33%'>");
|
|
|
+ {
|
|
|
ViewContext.Writer.Write(Html.CustomLabelFor(m => m.DisturbanceId, "Verzögerung:"));
|
|
|
ViewContext.Writer.Write(Html.ValidationMessageFor(m => m.DisturbanceId).ToHtmlString());
|
|
|
- Html.DevExpress().ComboBoxFor(m => m.DisturbanceId, t =>
|
|
|
+
|
|
|
+ Session.Add("DeviationDisturbancesComboBoxSettings", new Action<ComboBoxSettings>(a =>
|
|
|
{
|
|
|
- t.Width = new Unit(100, UnitType.Percentage);
|
|
|
- t.Properties.ValueType = typeof(int);
|
|
|
- t.Properties.ValueField = "Id";
|
|
|
- t.Properties.TextField = "Description";
|
|
|
- }).BindList(ViewData["AllDisturbances"]).Render();
|
|
|
+ a.Width = new Unit(95, UnitType.Percentage);
|
|
|
+ a.Properties.ValueType = typeof(int);
|
|
|
+ a.Properties.ValueField = "Id";
|
|
|
+ a.Properties.TextField = "Description";
|
|
|
+
|
|
|
+ var serializedModel = Newtonsoft.Json.JsonConvert.SerializeObject(Model);
|
|
|
+
|
|
|
+ a.CallbackRouteValues = new
|
|
|
+ {
|
|
|
+ Controller = "DataCallback",
|
|
|
+ Action = "DisturbancesComboBox",
|
|
|
+ SettingsKey = "DeviationDisturbancesComboBoxSettings",
|
|
|
+ Model = serializedModel,
|
|
|
+ Type = Model.GetType().FullName
|
|
|
+ };
|
|
|
+ }));
|
|
|
+ ViewData.Add("DisturbancesComboBoxSettings", "DeviationDisturbancesComboBoxSettings");
|
|
|
+ Html.RenderPartial("~/Views/Shared/DataEditorTemplates/_DisturbancesComboBox.cshtml", Model, ViewData);
|
|
|
+
|
|
|
+ if (userContext.CurrentUser.HasFunction("Deviation-Claims-Edit"))
|
|
|
+ {
|
|
|
+ Html.DevExpress().HyperLink(t =>
|
|
|
+ {
|
|
|
+ t.Name = "devHyperLinkDisturbanceEventReceiver";
|
|
|
+ t.Properties.Text = "Hinzufügen";
|
|
|
+ t.NavigateUrl = "#";
|
|
|
+ t.Properties.ClientSideEvents.Click = "function (s, e) { addDisturbance(); }";
|
|
|
+ t.Style.Add("line-height", "24px");
|
|
|
+ }).Render();
|
|
|
+ }
|
|
|
+ }
|
|
|
ViewContext.Writer.Write("</div>");
|
|
|
|
|
|
- ViewContext.Writer.Write("<div class='inlineModelProperty' style='width: 40%'>");
|
|
|
+ ViewContext.Writer.Write("<div class='inlineModelProperty' style='width: 34%'>");
|
|
|
+ {
|
|
|
ViewContext.Writer.Write(Html.CustomLabelFor(m => m.KindId, "Art:"));
|
|
|
ViewContext.Writer.Write(Html.ValidationMessageFor(m => m.KindId).ToHtmlString());
|
|
|
- Html.DevExpress().ComboBoxFor(m => m.KindId, t =>
|
|
|
+
|
|
|
+ Session.Add("DeviationKindsComboBoxSettings", new Action<ComboBoxSettings>(a =>
|
|
|
{
|
|
|
- t.Width = new Unit(100, UnitType.Percentage);
|
|
|
- t.Properties.ValueType = typeof(int);
|
|
|
- t.Properties.ValueField = "Id";
|
|
|
- t.Properties.TextField = "Description";
|
|
|
- }).BindList(ViewData["AllKinds"]).Render();
|
|
|
+ a.Width = new Unit(95, UnitType.Percentage);
|
|
|
+ a.Properties.ValueType = typeof(int);
|
|
|
+ a.Properties.ValueField = "Id";
|
|
|
+ a.Properties.TextField = "Description";
|
|
|
+
|
|
|
+ var serializedModel = Newtonsoft.Json.JsonConvert.SerializeObject(Model);
|
|
|
+
|
|
|
+ a.CallbackRouteValues = new
|
|
|
+ {
|
|
|
+ Controller = "DataCallback",
|
|
|
+ Action = "KindsComboBox",
|
|
|
+ SettingsKey = "DeviationKindsComboBoxSettings",
|
|
|
+ Model = serializedModel,
|
|
|
+ Type = Model.GetType().FullName
|
|
|
+ };
|
|
|
+ }));
|
|
|
+ ViewData.Add("KindsComboBoxSettings", "DeviationKindsComboBoxSettings");
|
|
|
+ Html.RenderPartial("~/Views/Shared/DataEditorTemplates/_KindsComboBox.cshtml", Model, ViewData);
|
|
|
+
|
|
|
+ if (userContext.CurrentUser.HasFunction("Deviation-Claims-Edit"))
|
|
|
+ {
|
|
|
+ Html.DevExpress().HyperLink(t =>
|
|
|
+ {
|
|
|
+ t.Name = "devHyperLinkKindEventReceiver";
|
|
|
+ t.Properties.Text = "Hinzufügen";
|
|
|
+ t.NavigateUrl = "#";
|
|
|
+ t.Properties.ClientSideEvents.Click = "function (s, e) { addKind(); }";
|
|
|
+ t.Style.Add("line-height", "24px");
|
|
|
+ }).Render();
|
|
|
+ }
|
|
|
+ }
|
|
|
ViewContext.Writer.Write("</div>");
|
|
|
+ }
|
|
|
ViewContext.Writer.Write("</div>");
|
|
|
|
|
|
- ViewContext.Writer.Write(Html.CustomLabelFor(m => m.AppendixId, "Nachtrag:"));
|
|
|
- Html.DevExpress().ComboBoxFor(m => m.AppendixId, t =>
|
|
|
+ ViewContext.Writer.Write(Html.CustomLabelFor(m => m.Comment, "Kommentar:"));
|
|
|
+ ViewContext.Writer.Write(Html.ValidationMessageFor(m => m.Comment).ToHtmlString());
|
|
|
+ Html.DevExpress().MemoFor(m => m.Comment, t =>
|
|
|
{
|
|
|
t.Width = new Unit(100, UnitType.Percentage);
|
|
|
- t.Properties.ValueType = typeof(int);
|
|
|
- t.Properties.ValueField = "Id";
|
|
|
- t.Properties.TextField = "Description";
|
|
|
- }).BindList(ViewData["AllAppendices"]).Render();
|
|
|
+ t.Height = new Unit(90, UnitType.Pixel);
|
|
|
+ }).Render();
|
|
|
|
|
|
ViewContext.Writer.Write("</div>");
|
|
|
|