|
@@ -9,6 +9,8 @@
|
|
|
<div class="deviationEditContainer">
|
|
<div class="deviationEditContainer">
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
|
+ var textSeparator = ", ";
|
|
|
|
|
+
|
|
|
function addStatus() {
|
|
function addStatus() {
|
|
|
$.ajax({
|
|
$.ajax({
|
|
|
url: '@Url.Action("EditClaim", "Deviation")',
|
|
url: '@Url.Action("EditClaim", "Deviation")',
|
|
@@ -65,6 +67,55 @@
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ function calculateValue() {
|
|
|
|
|
+ Sum.SetValue(Value.GetValue() * (Percentage.GetValue() / 100));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ function onListBoxSelectionChanged(s, e) {
|
|
|
|
|
+ if (e.index == 0)
|
|
|
|
|
+ e.isSelected ? s.SelectAll() : s.UnselectAll();
|
|
|
|
|
+ updateSelectAllItemState();
|
|
|
|
|
+ updateText();
|
|
|
|
|
+ }
|
|
|
|
|
+ function updateSelectAllItemState() {
|
|
|
|
|
+ isAllSelected() ? DisturbanceValues.SelectIndices([0]) : DisturbanceValues.UnselectIndices([0]);
|
|
|
|
|
+ }
|
|
|
|
|
+ function isAllSelected() {
|
|
|
|
|
+ for (var i = 1; i < DisturbanceValues.GetItemCount(); i++)
|
|
|
|
|
+ if (!DisturbanceValues.GetItem(i).selected)
|
|
|
|
|
+ return false;
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+ function updateText() {
|
|
|
|
|
+ var selectedItems = DisturbanceValues.GetSelectedItems();
|
|
|
|
|
+ devDropDownListDisturbanceValues.SetText(getSelectedItemsText(selectedItems));
|
|
|
|
|
+ }
|
|
|
|
|
+ function synchronizeListBoxValues(s, e) {
|
|
|
|
|
+ DisturbanceValues.UnselectAll();
|
|
|
|
|
+ var texts = s.GetText().split(textSeparator);
|
|
|
|
|
+ var values = getValuesByTexts(texts);
|
|
|
|
|
+ DisturbanceValues.SelectValues(values);
|
|
|
|
|
+ updateSelectAllItemState();
|
|
|
|
|
+ updateText();
|
|
|
|
|
+ }
|
|
|
|
|
+ function getSelectedItemsText(items) {
|
|
|
|
|
+ var texts = [];
|
|
|
|
|
+ for (var i = 0; i < items.length; i++)
|
|
|
|
|
+ if (items[i].index != 0)
|
|
|
|
|
+ texts.push(items[i].text);
|
|
|
|
|
+ return texts.join(textSeparator);
|
|
|
|
|
+ }
|
|
|
|
|
+ function getValuesByTexts(texts) {
|
|
|
|
|
+ var actualValues = [];
|
|
|
|
|
+ var item;
|
|
|
|
|
+ for (var i = 0; i < texts.length; i++) {
|
|
|
|
|
+ item = DisturbanceValues.FindItemByText(texts[i]);
|
|
|
|
|
+ if (item != null)
|
|
|
|
|
+ actualValues.push(item.value);
|
|
|
|
|
+ }
|
|
|
|
|
+ return actualValues;
|
|
|
|
|
+ }
|
|
|
</script>
|
|
</script>
|
|
|
@Html.DevExpress().PopupControl(s =>
|
|
@Html.DevExpress().PopupControl(s =>
|
|
|
{
|
|
{
|
|
@@ -76,7 +127,7 @@
|
|
|
s.HeaderText = "\"" + Model.CustomNumber + "\" bearbeiten";
|
|
s.HeaderText = "\"" + Model.CustomNumber + "\" bearbeiten";
|
|
|
|
|
|
|
|
s.Modal = true;
|
|
s.Modal = true;
|
|
|
- s.Width = new Unit(500, UnitType.Pixel);
|
|
|
|
|
|
|
+ s.Width = new Unit(700, UnitType.Pixel);
|
|
|
s.CloseAction = CloseAction.CloseButton;
|
|
s.CloseAction = CloseAction.CloseButton;
|
|
|
s.PopupHorizontalAlign = PopupHorizontalAlign.WindowCenter;
|
|
s.PopupHorizontalAlign = PopupHorizontalAlign.WindowCenter;
|
|
|
s.PopupVerticalAlign = PopupVerticalAlign.TopSides;
|
|
s.PopupVerticalAlign = PopupVerticalAlign.TopSides;
|
|
@@ -93,31 +144,31 @@
|
|
|
|
|
|
|
|
ViewContext.Writer.Write("<input type=\"hidden\" value=\"" + Model.Id + "\" id=\"Id\" name=\"Id\" />");
|
|
ViewContext.Writer.Write("<input type=\"hidden\" value=\"" + Model.Id + "\" id=\"Id\" name=\"Id\" />");
|
|
|
|
|
|
|
|
- ViewContext.Writer.Write(Html.CustomLabelFor(m => m.CustomNumber, "Eigene ID:"));
|
|
|
|
|
- ViewContext.Writer.Write(Html.ValidationMessageFor(m => m.CustomNumber).ToHtmlString());
|
|
|
|
|
- Html.DevExpress().TextBoxFor(m => m.CustomNumber, t =>
|
|
|
|
|
- {
|
|
|
|
|
- t.Width = new Unit(47.5, UnitType.Percentage);
|
|
|
|
|
- }).Render();
|
|
|
|
|
-
|
|
|
|
|
ViewContext.Writer.Write("<div class='inlineModelPropertyContainer'>");
|
|
ViewContext.Writer.Write("<div class='inlineModelPropertyContainer'>");
|
|
|
{
|
|
{
|
|
|
- ViewContext.Writer.Write("<div class='inlineModelProperty' style='width: 50%'>");
|
|
|
|
|
|
|
+ ViewContext.Writer.Write("<div class='inlineModelProperty' style='width: 15%'>");
|
|
|
{
|
|
{
|
|
|
- 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(Html.CustomLabelFor(m => m.CustomNumber, "Nummer:"));
|
|
|
|
|
+ ViewContext.Writer.Write(Html.ValidationMessageFor(m => m.CustomNumber).ToHtmlString());
|
|
|
|
|
+ Html.DevExpress().TextBoxFor(m => m.CustomNumber, t =>
|
|
|
{
|
|
{
|
|
|
- t.Width = new Unit(95, UnitType.Percentage);
|
|
|
|
|
- t.Properties.DecimalPlaces = 2;
|
|
|
|
|
- t.Properties.NumberType = SpinEditNumberType.Float;
|
|
|
|
|
- t.Properties.DisplayFormatString = "c2";
|
|
|
|
|
|
|
+ t.Width = new Unit(80, UnitType.Percentage);
|
|
|
}).Render();
|
|
}).Render();
|
|
|
}
|
|
}
|
|
|
ViewContext.Writer.Write("</div>");
|
|
ViewContext.Writer.Write("</div>");
|
|
|
- ViewContext.Writer.Write("<div class='inlineModelProperty' style='width: 50%'>");
|
|
|
|
|
|
|
+ ViewContext.Writer.Write("<div class='inlineModelProperty' style='width: 55%'>");
|
|
|
{
|
|
{
|
|
|
- ViewContext.Writer.Write(Html.CustomLabelFor(m => m.ReceiptDate, "Eingangsdatum:"));
|
|
|
|
|
|
|
+ ViewContext.Writer.Write(Html.CustomLabelFor(m => m.Description, "Bezeichnung:"));
|
|
|
|
|
+ ViewContext.Writer.Write(Html.ValidationMessageFor(m => m.Description).ToHtmlString());
|
|
|
|
|
+ Html.DevExpress().TextBoxFor(m => m.Description, t =>
|
|
|
|
|
+ {
|
|
|
|
|
+ t.Width = new Unit(92, UnitType.Percentage);
|
|
|
|
|
+ }).Render();
|
|
|
|
|
+ }
|
|
|
|
|
+ ViewContext.Writer.Write("</div>");
|
|
|
|
|
+ ViewContext.Writer.Write("<div class='inlineModelProperty' style='width: 30%'>");
|
|
|
|
|
+ {
|
|
|
|
|
+ ViewContext.Writer.Write(Html.CustomLabelFor(m => m.ReceiptDate, "Einreichdatum VA:"));
|
|
|
ViewContext.Writer.Write(Html.ValidationMessageFor(m => m.ReceiptDate).ToHtmlString());
|
|
ViewContext.Writer.Write(Html.ValidationMessageFor(m => m.ReceiptDate).ToHtmlString());
|
|
|
Html.DevExpress().DateEditFor(m => m.ReceiptDate, t =>
|
|
Html.DevExpress().DateEditFor(m => m.ReceiptDate, t =>
|
|
|
{
|
|
{
|
|
@@ -128,37 +179,121 @@
|
|
|
}
|
|
}
|
|
|
ViewContext.Writer.Write("</div>");
|
|
ViewContext.Writer.Write("</div>");
|
|
|
|
|
|
|
|
- ViewContext.Writer.Write(Html.CustomLabelFor(m => m.AppendixId, "Nachtrag:"));
|
|
|
|
|
-
|
|
|
|
|
- Session.Add("DeviationAppendicesComboBoxSettings", new Action<ComboBoxSettings>(a =>
|
|
|
|
|
|
|
+ ViewContext.Writer.Write("<div class='inlineModelPropertyContainer'>");
|
|
|
{
|
|
{
|
|
|
- a.Width = new Unit(47.5, UnitType.Percentage);
|
|
|
|
|
- a.Properties.ValueType = typeof(int);
|
|
|
|
|
- a.Properties.ValueField = "Id";
|
|
|
|
|
- a.Properties.TextField = "Description";
|
|
|
|
|
|
|
+ ViewContext.Writer.Write("<div class='inlineModelProperty' style='width: 40%'>");
|
|
|
|
|
+ {
|
|
|
|
|
+ ViewContext.Writer.Write(Html.CustomLabelFor(m => m.DisturbanceValues, "Kategorien:"));
|
|
|
|
|
+ ViewContext.Writer.Write(Html.ValidationMessageFor(m => m.DisturbanceValues).ToHtmlString());
|
|
|
|
|
+ Html.DevExpress().DropDownEdit(t =>
|
|
|
|
|
+ {
|
|
|
|
|
+ t.Name = "devDropDownListDisturbanceValues";
|
|
|
|
|
+ t.Width = new Unit(95, UnitType.Percentage);
|
|
|
|
|
+
|
|
|
|
|
+ if (Model.DisturbanceDescriptions != null && Model.DisturbanceDescriptions.Any())
|
|
|
|
|
+ t.Text = String.Join(", ", Model.DisturbanceDescriptions);
|
|
|
|
|
+
|
|
|
|
|
+ t.SetDropDownWindowTemplateContent(l =>
|
|
|
|
|
+ {
|
|
|
|
|
+ Html.DevExpress().ListBox(lb =>
|
|
|
|
|
+ {
|
|
|
|
|
+ lb.Name = "DisturbanceValues";
|
|
|
|
|
+ lb.Width = new Unit(100, UnitType.Percentage);
|
|
|
|
|
+ lb.Properties.TextField = "Description";
|
|
|
|
|
+ lb.Properties.ValueField = "Id";
|
|
|
|
|
+ lb.Properties.ValueType = typeof(int);
|
|
|
|
|
+ lb.Properties.SelectionMode = ListEditSelectionMode.CheckColumn;
|
|
|
|
|
+ lb.ControlStyle.Border.BorderStyle = BorderStyle.None;
|
|
|
|
|
+ lb.PreRender = (sender, e) =>
|
|
|
|
|
+ {
|
|
|
|
|
+ var listBox = sender as MVCxListBox;
|
|
|
|
|
+
|
|
|
|
|
+ foreach (ListEditItem listItem in listBox.Items)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (Model.DisturbanceValues == null || !Model.DisturbanceValues.Any(m => m == (int)listItem.Value)) continue;
|
|
|
|
|
+
|
|
|
|
|
+ listItem.Selected = true;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ listBox.Items.Insert(0, new ListEditItem("(Alle auswählen)", -1));
|
|
|
|
|
+ };
|
|
|
|
|
+ lb.Properties.ClientSideEvents.SelectedIndexChanged = "function (s, e) { onListBoxSelectionChanged(s, e); }";
|
|
|
|
|
+ }).BindList(ViewData["AllDisturbances"]).Render();
|
|
|
|
|
+
|
|
|
|
|
+ t.Properties.ClientSideEvents.TextChanged = "function (s, e) { synchronizeListBoxValues(s, e); }";
|
|
|
|
|
+ t.Properties.ClientSideEvents.DropDown = "function (s, e) { synchronizeListBoxValues(s, e); }";
|
|
|
|
|
+ });
|
|
|
|
|
+ }).Render();
|
|
|
|
|
|
|
|
- var serializedModel = Newtonsoft.Json.JsonConvert.SerializeObject(Model);
|
|
|
|
|
|
|
+ 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>");
|
|
|
|
|
|
|
|
- a.CallbackRouteValues = new
|
|
|
|
|
|
|
+ ViewContext.Writer.Write("<div class='inlineModelProperty' style='width: 22%'>");
|
|
|
{
|
|
{
|
|
|
- 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(Html.CustomLabelFor(m => m.Value, "Schätzung VA:"));
|
|
|
|
|
+ ViewContext.Writer.Write(Html.ValidationMessageFor(m => m.Value).ToHtmlString());
|
|
|
|
|
+ Html.DevExpress().SpinEditFor(m => m.Value, t =>
|
|
|
|
|
+ {
|
|
|
|
|
+ t.Width = new Unit(90, UnitType.Percentage);
|
|
|
|
|
+ t.Properties.DecimalPlaces = 2;
|
|
|
|
|
+ t.Properties.NumberType = SpinEditNumberType.Float;
|
|
|
|
|
+ t.Properties.DisplayFormatString = "c2";
|
|
|
|
|
+ t.Properties.ClientSideEvents.ValueChanged = "function (s, e) { calculateValue(); }";
|
|
|
|
|
+ }).Render();
|
|
|
|
|
+ }
|
|
|
|
|
+ ViewContext.Writer.Write("</div>");
|
|
|
|
|
+
|
|
|
|
|
+ ViewContext.Writer.Write("<div class='inlineModelProperty' style='width: 16%'>");
|
|
|
|
|
+ {
|
|
|
|
|
+ ViewContext.Writer.Write(Html.CustomLabelFor(m => m.Value, "Bewertung (%):"));
|
|
|
|
|
+ ViewContext.Writer.Write(Html.ValidationMessageFor(m => m.Value).ToHtmlString());
|
|
|
|
|
+ Html.DevExpress().SpinEditFor(m => m.Percentage, t =>
|
|
|
|
|
+ {
|
|
|
|
|
+ t.Width = new Unit(88, UnitType.Percentage);
|
|
|
|
|
+ t.Properties.DecimalPlaces = 0;
|
|
|
|
|
+ t.Properties.MaxValue = 100;
|
|
|
|
|
+ t.Properties.MinValue = 0;
|
|
|
|
|
+ t.Properties.NumberType = SpinEditNumberType.Integer;
|
|
|
|
|
+ t.Properties.DisplayFormatString = "{0:n0} %";
|
|
|
|
|
+ t.Properties.ClientSideEvents.ValueChanged = "function (s, e) { calculateValue(); }";
|
|
|
|
|
+ }).Render();
|
|
|
|
|
+ }
|
|
|
|
|
+ ViewContext.Writer.Write("</div>");
|
|
|
|
|
+ ViewContext.Writer.Write("<div class='inlineModelProperty' style='width: 22%'>");
|
|
|
|
|
+ {
|
|
|
|
|
+ ViewContext.Writer.Write(Html.CustomLabelFor(m => m.Value, "Wert:"));
|
|
|
|
|
+ Html.DevExpress().SpinEdit(t =>
|
|
|
|
|
+ {
|
|
|
|
|
+ t.Name = "Sum";
|
|
|
|
|
+ t.Width = new Unit(100, UnitType.Percentage);
|
|
|
|
|
+ t.ClientEnabled = false;
|
|
|
|
|
+ t.Properties.DecimalPlaces = 2;
|
|
|
|
|
+ t.Properties.NumberType = SpinEditNumberType.Float;
|
|
|
|
|
+ t.Properties.DisplayFormatString = "c2";
|
|
|
|
|
+ }).Render();
|
|
|
|
|
+ }
|
|
|
|
|
+ ViewContext.Writer.Write("</div>");
|
|
|
|
|
+ }
|
|
|
|
|
+ ViewContext.Writer.Write("</div>");
|
|
|
|
|
|
|
|
ViewContext.Writer.Write("<div class='inlineModelPropertyContainer'>");
|
|
ViewContext.Writer.Write("<div class='inlineModelPropertyContainer'>");
|
|
|
{
|
|
{
|
|
|
- ViewContext.Writer.Write("<div class='inlineModelProperty' style='width: 33%'>");
|
|
|
|
|
|
|
+ ViewContext.Writer.Write("<div class='inlineModelProperty' style='width: 50%'>");
|
|
|
{
|
|
{
|
|
|
- ViewContext.Writer.Write(Html.CustomLabelFor(m => m.StatusId, "Status:"));
|
|
|
|
|
- ViewContext.Writer.Write(Html.ValidationMessageFor(m => m.StatusId).ToHtmlString());
|
|
|
|
|
|
|
+ ViewContext.Writer.Write(Html.CustomLabelFor(m => m.AppendixId, "Nachtrag:"));
|
|
|
|
|
|
|
|
- Session.Add("DeviationStatusesComboBoxSettings", new Action<ComboBoxSettings>(a =>
|
|
|
|
|
|
|
+ Session.Add("DeviationAppendicesComboBoxSettings", new Action<ComboBoxSettings>(a =>
|
|
|
{
|
|
{
|
|
|
a.Width = new Unit(95, UnitType.Percentage);
|
|
a.Width = new Unit(95, UnitType.Percentage);
|
|
|
a.Properties.ValueType = typeof(int);
|
|
a.Properties.ValueType = typeof(int);
|
|
@@ -170,35 +305,38 @@
|
|
|
a.CallbackRouteValues = new
|
|
a.CallbackRouteValues = new
|
|
|
{
|
|
{
|
|
|
Controller = "DataCallback",
|
|
Controller = "DataCallback",
|
|
|
- Action = "StatusesComboBox",
|
|
|
|
|
- SettingsKey = "DeviationStatusesComboBoxSettings",
|
|
|
|
|
|
|
+ Action = "AppendicesComboBox",
|
|
|
|
|
+ SettingsKey = "DeviationAppendicesComboBoxSettings",
|
|
|
Model = serializedModel,
|
|
Model = serializedModel,
|
|
|
Type = Model.GetType().FullName
|
|
Type = Model.GetType().FullName
|
|
|
};
|
|
};
|
|
|
}));
|
|
}));
|
|
|
- ViewData.Add("StatusesComboBoxSettings", "DeviationStatusesComboBoxSettings");
|
|
|
|
|
- Html.RenderPartial("~/Views/Shared/DataEditorTemplates/_StatusesComboBox.cshtml", Model, ViewData);
|
|
|
|
|
|
|
+ ViewData.Add("AppendicesComboBoxSettings", "DeviationAppendicesComboBoxSettings");
|
|
|
|
|
+ Html.RenderPartial("~/Views/Shared/DataEditorTemplates/_AppendicesComboBox.cshtml", Model, ViewData);
|
|
|
|
|
+ }
|
|
|
|
|
+ ViewContext.Writer.Write("</div>");
|
|
|
|
|
|
|
|
- if (userContext.CurrentUser.HasFunction("Deviation-Claims-Edit"))
|
|
|
|
|
|
|
+ ViewContext.Writer.Write("<div class='inlineModelProperty' style='width: 50%'>");
|
|
|
|
|
+ {
|
|
|
|
|
+ ViewContext.Writer.Write(Html.CustomLabelFor(m => m.AppendixDate, "Einreichdatum NT:"));
|
|
|
|
|
+ ViewContext.Writer.Write(Html.ValidationMessageFor(m => m.AppendixDate).ToHtmlString());
|
|
|
|
|
+ Html.DevExpress().DateEditFor(m => m.AppendixDate, t =>
|
|
|
{
|
|
{
|
|
|
- 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();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ t.Width = new Unit(100, UnitType.Percentage);
|
|
|
|
|
+ }).Render();
|
|
|
}
|
|
}
|
|
|
ViewContext.Writer.Write("</div>");
|
|
ViewContext.Writer.Write("</div>");
|
|
|
|
|
+ }
|
|
|
|
|
+ ViewContext.Writer.Write("</div>");
|
|
|
|
|
|
|
|
- ViewContext.Writer.Write("<div class='inlineModelProperty' style='width: 33%'>");
|
|
|
|
|
|
|
+ ViewContext.Writer.Write("<div class='inlineModelPropertyContainer'>");
|
|
|
|
|
+ {
|
|
|
|
|
+ ViewContext.Writer.Write("<div class='inlineModelProperty' style='width: 50%'>");
|
|
|
{
|
|
{
|
|
|
- ViewContext.Writer.Write(Html.CustomLabelFor(m => m.DisturbanceId, "Verzögerung:"));
|
|
|
|
|
- ViewContext.Writer.Write(Html.ValidationMessageFor(m => m.DisturbanceId).ToHtmlString());
|
|
|
|
|
|
|
+ ViewContext.Writer.Write(Html.CustomLabelFor(m => m.StatusId, "VA-Status:"));
|
|
|
|
|
+ ViewContext.Writer.Write(Html.ValidationMessageFor(m => m.StatusId).ToHtmlString());
|
|
|
|
|
|
|
|
- Session.Add("DeviationDisturbancesComboBoxSettings", new Action<ComboBoxSettings>(a =>
|
|
|
|
|
|
|
+ Session.Add("DeviationStatusesComboBoxSettings", new Action<ComboBoxSettings>(a =>
|
|
|
{
|
|
{
|
|
|
a.Width = new Unit(95, UnitType.Percentage);
|
|
a.Width = new Unit(95, UnitType.Percentage);
|
|
|
a.Properties.ValueType = typeof(int);
|
|
a.Properties.ValueType = typeof(int);
|
|
@@ -210,37 +348,77 @@
|
|
|
a.CallbackRouteValues = new
|
|
a.CallbackRouteValues = new
|
|
|
{
|
|
{
|
|
|
Controller = "DataCallback",
|
|
Controller = "DataCallback",
|
|
|
- Action = "DisturbancesComboBox",
|
|
|
|
|
- SettingsKey = "DeviationDisturbancesComboBoxSettings",
|
|
|
|
|
|
|
+ Action = "StatusesComboBox",
|
|
|
|
|
+ SettingsKey = "DeviationStatusesComboBoxSettings",
|
|
|
Model = serializedModel,
|
|
Model = serializedModel,
|
|
|
Type = Model.GetType().FullName
|
|
Type = Model.GetType().FullName
|
|
|
};
|
|
};
|
|
|
}));
|
|
}));
|
|
|
- ViewData.Add("DisturbancesComboBoxSettings", "DeviationDisturbancesComboBoxSettings");
|
|
|
|
|
- Html.RenderPartial("~/Views/Shared/DataEditorTemplates/_DisturbancesComboBox.cshtml", Model, ViewData);
|
|
|
|
|
|
|
+ ViewData.Add("StatusesComboBoxSettings", "DeviationStatusesComboBoxSettings");
|
|
|
|
|
+ Html.RenderPartial("~/Views/Shared/DataEditorTemplates/_StatusesComboBox.cshtml", Model, ViewData);
|
|
|
|
|
|
|
|
if (userContext.CurrentUser.HasFunction("Deviation-Claims-Edit"))
|
|
if (userContext.CurrentUser.HasFunction("Deviation-Claims-Edit"))
|
|
|
{
|
|
{
|
|
|
Html.DevExpress().HyperLink(t =>
|
|
Html.DevExpress().HyperLink(t =>
|
|
|
{
|
|
{
|
|
|
- t.Name = "devHyperLinkDisturbanceEventReceiver";
|
|
|
|
|
|
|
+ t.Name = "devHyperLinkStatusEventReceiver";
|
|
|
t.Properties.Text = "Hinzufügen";
|
|
t.Properties.Text = "Hinzufügen";
|
|
|
t.NavigateUrl = "#";
|
|
t.NavigateUrl = "#";
|
|
|
- t.Properties.ClientSideEvents.Click = "function (s, e) { addDisturbance(); }";
|
|
|
|
|
|
|
+ t.Properties.ClientSideEvents.Click = "function (s, e) { addStatus(); }";
|
|
|
t.Style.Add("line-height", "24px");
|
|
t.Style.Add("line-height", "24px");
|
|
|
}).Render();
|
|
}).Render();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
ViewContext.Writer.Write("</div>");
|
|
ViewContext.Writer.Write("</div>");
|
|
|
|
|
|
|
|
- ViewContext.Writer.Write("<div class='inlineModelProperty' style='width: 34%'>");
|
|
|
|
|
|
|
+ //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());
|
|
|
|
|
+
|
|
|
|
|
+ // Session.Add("DeviationDisturbancesComboBoxSettings", new Action<ComboBoxSettings>(a =>
|
|
|
|
|
+ // {
|
|
|
|
|
+ // 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: 50%'>");
|
|
|
{
|
|
{
|
|
|
ViewContext.Writer.Write(Html.CustomLabelFor(m => m.KindId, "Art:"));
|
|
ViewContext.Writer.Write(Html.CustomLabelFor(m => m.KindId, "Art:"));
|
|
|
ViewContext.Writer.Write(Html.ValidationMessageFor(m => m.KindId).ToHtmlString());
|
|
ViewContext.Writer.Write(Html.ValidationMessageFor(m => m.KindId).ToHtmlString());
|
|
|
|
|
|
|
|
Session.Add("DeviationKindsComboBoxSettings", new Action<ComboBoxSettings>(a =>
|
|
Session.Add("DeviationKindsComboBoxSettings", new Action<ComboBoxSettings>(a =>
|
|
|
{
|
|
{
|
|
|
- a.Width = new Unit(95, UnitType.Percentage);
|
|
|
|
|
|
|
+ a.Width = new Unit(100, UnitType.Percentage);
|
|
|
a.Properties.ValueType = typeof(int);
|
|
a.Properties.ValueType = typeof(int);
|
|
|
a.Properties.ValueField = "Id";
|
|
a.Properties.ValueField = "Id";
|
|
|
a.Properties.TextField = "Description";
|
|
a.Properties.TextField = "Description";
|