|
|
@@ -10,9 +10,77 @@
|
|
|
|
|
|
<script>
|
|
|
var textSeparator = ", ";
|
|
|
+ var isDragging = false;
|
|
|
+ var dragStartY = 0;
|
|
|
+ var isScrolling = false;
|
|
|
+ var scrollInterval = null;
|
|
|
+ var deleteId = null;
|
|
|
+
|
|
|
+ $(document).ready(function () {
|
|
|
+ $(window).mouseup(function () {
|
|
|
+ isDragging = false;
|
|
|
+ });
|
|
|
+ $(window).mousemove(function (e) {
|
|
|
+ if (isDragging) {
|
|
|
+ var offset = e.clientY - dragStartY;
|
|
|
+ var scrollOffset = $("#siteTreeContainer").scrollTop();
|
|
|
+ if (isDragging) {
|
|
|
+ var result = scrollOffset + (offset / 10);
|
|
|
+ $("#siteTreeContainer").scrollTop(result);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ function saveSite() {
|
|
|
+ var form = $("#siteEditForm");
|
|
|
+ $(form).submit(function (e) {
|
|
|
+ $.ajax({
|
|
|
+ type: "POST",
|
|
|
+ url: '@Url.Action("EditSite", "Site")',
|
|
|
+ data: form.serialize(),
|
|
|
+ success: function (response) {
|
|
|
+ setTimeout(function () {
|
|
|
+ $(".siteEditContainer").remove();
|
|
|
+ if (response == "success") {
|
|
|
+ devGridViewSite.PerformCallback();
|
|
|
+ } else {
|
|
|
+ $("body").append(response);
|
|
|
+ }
|
|
|
+ }, 200);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ e.preventDefault();
|
|
|
+ });
|
|
|
+ form.submit();
|
|
|
+ }
|
|
|
+
|
|
|
+ function saveSiteForAppend() {
|
|
|
+ devPopupControlSaveForAppend.Hide();
|
|
|
+ var form = $("#siteEditForm");
|
|
|
+ $(form).submit(function (e) {
|
|
|
+ $.ajax({
|
|
|
+ type: "POST",
|
|
|
+ url: '@Url.Action("EditSiteForAppend", "Site")',
|
|
|
+ data: form.serialize(),
|
|
|
+ success: function (response) {
|
|
|
+ setTimeout(function () {
|
|
|
+ $(".siteEditContainer").remove();
|
|
|
+ $("body").append(response);
|
|
|
+ }, 200);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ e.preventDefault();
|
|
|
+ });
|
|
|
+ form.submit();
|
|
|
+ }
|
|
|
|
|
|
function addAppendixToSite(siteId) {
|
|
|
if (!siteId) return;
|
|
|
+ if (siteId == -1) {
|
|
|
+ devPopupControlSaveForAppend.Show();
|
|
|
+ return;
|
|
|
+ }
|
|
|
$.ajax({
|
|
|
url: '@Url.Action("AppendAppendixToSite", "Appendix")',
|
|
|
data: { SiteId: siteId },
|
|
|
@@ -79,6 +147,42 @@
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ function confirmDeleteDeviation(id) {
|
|
|
+ if (!id) return;
|
|
|
+ deleteId = id;
|
|
|
+ $.ajax({
|
|
|
+ type: "GET",
|
|
|
+ url: '@Url.Action("GetDeviation", "Deviation")',
|
|
|
+ data: { Id: id },
|
|
|
+ success: function (response) {
|
|
|
+ if (response == "notFound") return;
|
|
|
+ var deviation = JSON.parse(response);
|
|
|
+ var popupControl = MVCxClientPopupControl.Cast(devPopupControlDeleteDeviation);
|
|
|
+ popupControl.SetHeaderText(popupControl.GetHeaderText().replace("{deviation}", deviation.CustomNumber));
|
|
|
+ $(".dialogTextDeviation").text($(".dialogTextDeviation").text().replace("{deviation}", deviation.CustomNumber));
|
|
|
+ popupControl.Show();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ function deleteDeviation() {
|
|
|
+ $.ajax({
|
|
|
+ type: "POST",
|
|
|
+ url: '@Url.Action("DeleteDeviation", "Deviation")',
|
|
|
+ data: { Id: deleteId },
|
|
|
+ success: function (response) {
|
|
|
+ var popupControl = MVCxClientPopupControl.Cast(devPopupControlDeleteDeviation);
|
|
|
+ popupControl.Hide();
|
|
|
+ setTimeout(function () {
|
|
|
+ devTreeListSiteDeviationAppendices.PerformCallback();
|
|
|
+ }, 200);
|
|
|
+ },
|
|
|
+ error: function () {
|
|
|
+ alert("error occured");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
function editAppendix(id) {
|
|
|
if (!id) return;
|
|
|
$.ajax({
|
|
|
@@ -96,6 +200,76 @@
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ function confirmDeleteAppendix(id) {
|
|
|
+ if (!id) return;
|
|
|
+ deleteId = id;
|
|
|
+ $.ajax({
|
|
|
+ type: "GET",
|
|
|
+ url: '@Url.Action("GetAppendix", "Appendix")',
|
|
|
+ data: { Id: id },
|
|
|
+ success: function (response) {
|
|
|
+ if (response == "notFound") return;
|
|
|
+ var appendix = JSON.parse(response);
|
|
|
+ var popupControl = MVCxClientPopupControl.Cast(devPopupControlDeleteAppendix);
|
|
|
+ popupControl.SetHeaderText(popupControl.GetHeaderText().replace("{appendix}", appendix.CustomNumber));
|
|
|
+ $(".dialogTextAppendix").text($(".dialogTextAppendix").text().replace("{appendix}", appendix.CustomNumber));
|
|
|
+ popupControl.Show();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ function deleteAppendix() {
|
|
|
+ $.ajax({
|
|
|
+ type: "POST",
|
|
|
+ url: '@Url.Action("DeleteAppendix", "Appendix")',
|
|
|
+ data: { Id: deleteId },
|
|
|
+ success: function (response) {
|
|
|
+ var popupControl = MVCxClientPopupControl.Cast(devPopupControlDeleteAppendix);
|
|
|
+ popupControl.Hide();
|
|
|
+ setTimeout(function () {
|
|
|
+ devTreeListSiteDeviationAppendices.PerformCallback();
|
|
|
+ }, 200);
|
|
|
+ },
|
|
|
+ error: function () {
|
|
|
+ alert("error occured");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ function startSiteTreeNodeDrag(s, e) {
|
|
|
+ if (!s || !e) return;
|
|
|
+ if (e.nodeKey.startsWith("a")) {
|
|
|
+ e.cancel = true;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ dragStartY = e.htmlEvent.clientY;
|
|
|
+ isDragging = true;
|
|
|
+ var source = e.nodeKey;
|
|
|
+ }
|
|
|
+
|
|
|
+ function endSiteTreeNodeDrag(s, e) {
|
|
|
+ if (!s || !e) return;
|
|
|
+ isDragging = false;
|
|
|
+ var sourceKey = e.nodeKey;
|
|
|
+ var targetKey = devTreeListSiteDeviationAppendices.GetNodeKeyByRow(e.targetElement);
|
|
|
+ if (!sourceKey || !targetKey) return;
|
|
|
+ $.ajax({
|
|
|
+ type: "POST",
|
|
|
+ url: '@Url.Action("AssignDeviationToEntity", "Site")',
|
|
|
+ data: { SiteId: @Model.Id, SourceKey: sourceKey, TargetKey: targetKey },
|
|
|
+ success: function (response) {
|
|
|
+ if (response == "success") {
|
|
|
+ setTimeout(function () {
|
|
|
+ devTreeListSiteDeviationAppendices.PerformCallback();
|
|
|
+ }, 200);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error: function () {
|
|
|
+ alert("error occured");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
function onDeviationSaveSuccess() {
|
|
|
devTreeListSiteDeviationAppendices.PerformCallback();
|
|
|
}
|
|
|
@@ -105,39 +279,30 @@
|
|
|
}
|
|
|
|
|
|
function onListBoxSelectionChanged(s, e) {
|
|
|
- if (e.index == 0)
|
|
|
- e.isSelected ? s.SelectAll() : s.UnselectAll();
|
|
|
updateSelectAllItemState();
|
|
|
updateText();
|
|
|
}
|
|
|
- function updateSelectAllItemState() {
|
|
|
- isAllSelected() ? UserValues.SelectIndices([0]) : UserValues.UnselectIndices([0]);
|
|
|
- }
|
|
|
- function isAllSelected() {
|
|
|
- for (var i = 1; i < UserValues.GetItemCount(); i++)
|
|
|
- if (!UserValues.GetItem(i).selected)
|
|
|
- return false;
|
|
|
- return true;
|
|
|
- }
|
|
|
+
|
|
|
function updateText() {
|
|
|
var selectedItems = UserValues.GetSelectedItems();
|
|
|
devDropDownListUserValues.SetText(getSelectedItemsText(selectedItems));
|
|
|
}
|
|
|
+
|
|
|
function synchronizeListBoxValues(s, e) {
|
|
|
UserValues.UnselectAll();
|
|
|
var texts = s.GetText().split(textSeparator);
|
|
|
var values = getValuesByTexts(texts);
|
|
|
UserValues.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);
|
|
|
+ texts.push(items[i].text);
|
|
|
return texts.join(textSeparator);
|
|
|
}
|
|
|
+
|
|
|
function getValuesByTexts(texts) {
|
|
|
var actualValues = [];
|
|
|
var item;
|
|
|
@@ -152,158 +317,193 @@
|
|
|
|
|
|
<style>
|
|
|
.siteTreeList { }
|
|
|
- .siteTreeList > tbody > tr > td > table > tbody > tr:nth-child(2n) { background-color: #F7F7F7; }
|
|
|
- .siteTreeList > tbody > tr > td > table > tbody > tr:nth-child(2n) > td:first-child { background-color: #F7F7F7; }
|
|
|
+ /*.siteTreeList > tbody > tr > td > table > tbody > tr:nth-child(2n) { background-color: #F7F7F7; }
|
|
|
+ .siteTreeList > tbody > tr > td > table > tbody > tr:nth-child(2n) > td:first-child { background-color: #F7F7F7; }*/
|
|
|
+ .siteTreeList a { text-decoration: none; }
|
|
|
+ .siteTreeList a:hover { text-decoration: underline; }
|
|
|
.siteEditLayoutTable { width: 100%; }
|
|
|
.siteEditLayoutTable > tbody > tr > td { width: 50%; padding-right: 8px; vertical-align: top }
|
|
|
</style>
|
|
|
|
|
|
@Html.DevExpress().PopupControl(s =>
|
|
|
-{
|
|
|
- s.Name = "devPopupControlEditSite";
|
|
|
-
|
|
|
- if (Model.Id == -1)
|
|
|
- s.HeaderText = "Neue Baustelle erstellen";
|
|
|
- else
|
|
|
- s.HeaderText = "\"" + Model.CustomNumber + "\" bearbeiten";
|
|
|
-
|
|
|
- s.Modal = true;
|
|
|
- s.Width = new Unit(1000, UnitType.Pixel);
|
|
|
- //s.Height = new Unit(700, UnitType.Pixel);
|
|
|
- s.CloseAction = CloseAction.CloseButton;
|
|
|
- s.PopupHorizontalAlign = PopupHorizontalAlign.WindowCenter;
|
|
|
- s.PopupVerticalAlign = PopupVerticalAlign.TopSides;
|
|
|
- s.PopupVerticalOffset = 10;
|
|
|
- s.AllowDragging = true;
|
|
|
- s.AllowResize = false;
|
|
|
- s.ShowMaximizeButton = true;
|
|
|
- s.ShowFooter = false;
|
|
|
- s.ShowOnPageLoad = true;
|
|
|
- s.SetContent(() =>
|
|
|
{
|
|
|
- using (Html.BeginForm("EditSite", "Site", FormMethod.Post, new { id = "siteEditForm" }))
|
|
|
- {
|
|
|
- ViewContext.Writer.Write("<div class='editFormWrapper'>");
|
|
|
+ s.Name = "devPopupControlEditSite";
|
|
|
|
|
|
- ViewContext.Writer.Write("<input type=\"hidden\" value=\"" + Model.Id + "\" id=\"Id\" name=\"Id\" />");
|
|
|
+ if (Model.Id == -1)
|
|
|
+ s.HeaderText = "Neue Baustelle erstellen";
|
|
|
+ else
|
|
|
+ s.HeaderText = "\"" + Model.CustomNumber + "\" bearbeiten";
|
|
|
|
|
|
- ViewContext.Writer.Write("<table class=\"siteEditLayoutTable\"><tbody><tr><td>");
|
|
|
+ s.Modal = true;
|
|
|
+ s.Width = new Unit(1000, UnitType.Pixel);
|
|
|
+ s.CloseAction = CloseAction.CloseButton;
|
|
|
+ s.PopupHorizontalAlign = PopupHorizontalAlign.WindowCenter;
|
|
|
+ s.PopupVerticalAlign = PopupVerticalAlign.TopSides;
|
|
|
+ s.PopupVerticalOffset = 10;
|
|
|
+ s.AllowDragging = true;
|
|
|
+ s.AllowResize = false;
|
|
|
+ s.ShowMaximizeButton = true;
|
|
|
+ s.ShowFooter = false;
|
|
|
+ s.ShowOnPageLoad = true;
|
|
|
+ s.SetContent(() =>
|
|
|
+ {
|
|
|
+ using (Html.BeginForm("EditSite", "Site", FormMethod.Post, new { id = "siteEditForm" }))
|
|
|
{
|
|
|
- ViewContext.Writer.Write("<div class='inlineModelPropertyContainer'>");
|
|
|
+ ViewContext.Writer.Write("<div class='editFormWrapper'>");
|
|
|
+
|
|
|
+ ViewContext.Writer.Write("<input type=\"hidden\" value=\"" + Model.Id + "\" id=\"Id\" name=\"Id\" />");
|
|
|
+
|
|
|
+ ViewContext.Writer.Write("<table class=\"siteEditLayoutTable\"><tbody><tr><td>");
|
|
|
{
|
|
|
- ViewContext.Writer.Write("<div class='inlineModelProperty' style='width: 30%'>");
|
|
|
+ ViewContext.Writer.Write("<div class='inlineModelPropertyContainer'>");
|
|
|
{
|
|
|
- ViewContext.Writer.Write(Html.CustomLabelFor(m => m.CustomNumber, "Kostenstelle:"));
|
|
|
- ViewContext.Writer.Write(Html.ValidationMessageFor(m => m.CustomNumber).ToHtmlString());
|
|
|
- Html.DevExpress().TextBoxFor(m => m.CustomNumber, t =>
|
|
|
+ ViewContext.Writer.Write("<div class='inlineModelProperty' style='width: 30%'>");
|
|
|
{
|
|
|
- t.Width = new Unit(90, UnitType.Percentage);
|
|
|
- }).Render();
|
|
|
- }
|
|
|
- ViewContext.Writer.Write("</div>");
|
|
|
- ViewContext.Writer.Write("<div class='inlineModelProperty' style='width: 70%'>");
|
|
|
- {
|
|
|
- ViewContext.Writer.Write(Html.CustomLabelFor(m => m.Description, "Bauvorhaben:"));
|
|
|
- ViewContext.Writer.Write(Html.ValidationMessageFor(m => m.Description).ToHtmlString());
|
|
|
- Html.DevExpress().TextBoxFor(m => m.Description, t =>
|
|
|
+ ViewContext.Writer.Write(Html.CustomLabelFor(m => m.CustomNumber, "Kostenstelle:"));
|
|
|
+ ViewContext.Writer.Write(Html.ValidationMessageFor(m => m.CustomNumber).ToHtmlString());
|
|
|
+ Html.DevExpress().TextBoxFor(m => m.CustomNumber, t =>
|
|
|
+ {
|
|
|
+ t.Width = new Unit(90, UnitType.Percentage);
|
|
|
+ }).Render();
|
|
|
+ }
|
|
|
+ ViewContext.Writer.Write("</div>");
|
|
|
+ ViewContext.Writer.Write("<div class='inlineModelProperty' style='width: 70%'>");
|
|
|
{
|
|
|
- t.Width = new Unit(99, UnitType.Percentage);
|
|
|
- }).Render();
|
|
|
+ ViewContext.Writer.Write(Html.CustomLabelFor(m => m.Description, "Bauvorhaben:"));
|
|
|
+ ViewContext.Writer.Write(Html.ValidationMessageFor(m => m.Description).ToHtmlString());
|
|
|
+ Html.DevExpress().TextBoxFor(m => m.Description, t =>
|
|
|
+ {
|
|
|
+ t.Width = new Unit(99, UnitType.Percentage);
|
|
|
+ }).Render();
|
|
|
+ }
|
|
|
+ ViewContext.Writer.Write("</div>");
|
|
|
}
|
|
|
ViewContext.Writer.Write("</div>");
|
|
|
- }
|
|
|
- ViewContext.Writer.Write("</div>");
|
|
|
|
|
|
- ViewContext.Writer.Write("<div class='inlineModelPropertyContainer'>");
|
|
|
- {
|
|
|
- ViewContext.Writer.Write("<div class='inlineModelProperty' style='width: 52%'>");
|
|
|
+ ViewContext.Writer.Write("<div class='inlineModelPropertyContainer'>");
|
|
|
{
|
|
|
- ViewContext.Writer.Write(Html.CustomLabelFor(m => m.Start, "Start:"));
|
|
|
- ViewContext.Writer.Write(Html.ValidationMessageFor(m => m.Start).ToHtmlString());
|
|
|
- Html.DevExpress().DateEditFor(m => m.Start, t =>
|
|
|
+ ViewContext.Writer.Write("<div class='inlineModelProperty' style='width: 52%'>");
|
|
|
{
|
|
|
- t.Width = new Unit(95, UnitType.Percentage);
|
|
|
- }).Render();
|
|
|
- }
|
|
|
- ViewContext.Writer.Write("</div>");
|
|
|
+ ViewContext.Writer.Write(Html.CustomLabelFor(m => m.Start, "Start:"));
|
|
|
+ ViewContext.Writer.Write(Html.ValidationMessageFor(m => m.Start).ToHtmlString());
|
|
|
+ Html.DevExpress().DateEditFor(m => m.Start, t =>
|
|
|
+ {
|
|
|
+ t.Width = new Unit(95, UnitType.Percentage);
|
|
|
+ }).Render();
|
|
|
+ }
|
|
|
+ ViewContext.Writer.Write("</div>");
|
|
|
|
|
|
- ViewContext.Writer.Write("<div class='inlineModelProperty' style='width: 48%'>");
|
|
|
- {
|
|
|
- ViewContext.Writer.Write(Html.CustomLabelFor(m => m.End, "Ende:"));
|
|
|
- ViewContext.Writer.Write(Html.ValidationMessageFor(m => m.End).ToHtmlString());
|
|
|
- Html.DevExpress().DateEditFor(m => m.End, t =>
|
|
|
+ ViewContext.Writer.Write("<div class='inlineModelProperty' style='width: 48%'>");
|
|
|
{
|
|
|
- t.Width = new Unit(98, UnitType.Percentage);
|
|
|
- }).Render();
|
|
|
+ ViewContext.Writer.Write(Html.CustomLabelFor(m => m.End, "Ende:"));
|
|
|
+ Html.DevExpress().DateEditFor(m => m.End, t =>
|
|
|
+ {
|
|
|
+ t.Width = new Unit(98, UnitType.Percentage);
|
|
|
+ }).Render();
|
|
|
+ }
|
|
|
+ ViewContext.Writer.Write("</div>");
|
|
|
}
|
|
|
ViewContext.Writer.Write("</div>");
|
|
|
}
|
|
|
- ViewContext.Writer.Write("</div>");
|
|
|
- }
|
|
|
- ViewContext.Writer.Write("</td><td>");
|
|
|
- {
|
|
|
- ViewContext.Writer.Write(Html.CustomLabelFor(m => m.Start, "Benutzer:"));
|
|
|
- Html.DevExpress().DropDownEdit(t =>
|
|
|
+ ViewContext.Writer.Write("</td><td>");
|
|
|
{
|
|
|
- t.Name = "devDropDownListUserValues";
|
|
|
- t.Width = new Unit(100, UnitType.Percentage);
|
|
|
- t.Text = Model.UserDescription;
|
|
|
-
|
|
|
- t.SetDropDownWindowTemplateContent(l =>
|
|
|
+ ViewContext.Writer.Write(Html.CustomLabelFor(m => m.UserValues, "Benutzer:"));
|
|
|
+ ViewContext.Writer.Write(Html.ValidationMessageFor(m => m.UserValues).ToHtmlString());
|
|
|
+ Html.DevExpress().DropDownEdit(t =>
|
|
|
{
|
|
|
- Html.DevExpress().ListBox(lb =>
|
|
|
+ t.Name = "devDropDownListUserValues";
|
|
|
+ t.Width = new Unit(100, UnitType.Percentage);
|
|
|
+ t.Text = Model.UserDescription;
|
|
|
+
|
|
|
+ t.SetDropDownWindowTemplateContent(l =>
|
|
|
{
|
|
|
- lb.Name = "UserValues";
|
|
|
- lb.Width = new Unit(100, UnitType.Percentage);
|
|
|
- lb.Height = new Unit(250, UnitType.Pixel);
|
|
|
- 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) =>
|
|
|
+ Html.DevExpress().ListBox(lb =>
|
|
|
{
|
|
|
- var listBox = sender as MVCxListBox;
|
|
|
-
|
|
|
- foreach (ListEditItem listItem in listBox.Items)
|
|
|
+ lb.Name = "UserValues";
|
|
|
+ lb.Width = new Unit(100, UnitType.Percentage);
|
|
|
+ lb.Height = new Unit(250, UnitType.Pixel);
|
|
|
+ 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) =>
|
|
|
{
|
|
|
- if (Model.UserValues == null || !Model.UserValues.Any(m => m == (int)listItem.Value)) continue;
|
|
|
-
|
|
|
- listItem.Selected = true;
|
|
|
- }
|
|
|
- };
|
|
|
- lb.Properties.ClientSideEvents.SelectedIndexChanged = "function (s, e) { onListBoxSelectionChanged(s, e); }";
|
|
|
- }).BindList(ViewData["AllUsers"]).Render();
|
|
|
-
|
|
|
- t.Properties.ClientSideEvents.TextChanged = "function (s, e) { synchronizeListBoxValues(s, e); }";
|
|
|
- t.Properties.ClientSideEvents.DropDown = "function (s, e) { synchronizeListBoxValues(s, e); }";
|
|
|
- });
|
|
|
- }).Render();
|
|
|
- }
|
|
|
- ViewContext.Writer.Write("</td></tr></tbody></table>");
|
|
|
+ var listBox = sender as MVCxListBox;
|
|
|
|
|
|
+ foreach (ListEditItem listItem in listBox.Items)
|
|
|
+ {
|
|
|
+ if (Model.UserValues == null || !Model.UserValues.Any(m => m == (int)listItem.Value)) continue;
|
|
|
|
|
|
- ViewContext.Writer.Write(Html.CustomLabelFor(m => m.Deviations, "Vertragsabweichungen / Nachträge:"));
|
|
|
+ listItem.Selected = true;
|
|
|
+ }
|
|
|
+ };
|
|
|
+ lb.Properties.ClientSideEvents.SelectedIndexChanged = "function (s, e) { onListBoxSelectionChanged(s, e); }";
|
|
|
+ }).BindList(ViewData["AllUsers"]).Render();
|
|
|
+
|
|
|
+ t.Properties.ClientSideEvents.TextChanged = "function (s, e) { synchronizeListBoxValues(s, e); }";
|
|
|
+ t.Properties.ClientSideEvents.DropDown = "function (s, e) { synchronizeListBoxValues(s, e); }";
|
|
|
+ });
|
|
|
+ }).Render();
|
|
|
+ }
|
|
|
+ ViewContext.Writer.Write("</td></tr></tbody></table>");
|
|
|
|
|
|
- ViewContext.Writer.Write("<div style='width: 100%; overflow: auto; max-height: 450px; border: 1px solid #d0d0d0'>");
|
|
|
- {
|
|
|
- ViewContext.Writer.Write(Html.Partial("~/Views/Sites/_SiteEditTreePartial.cshtml", Model).ToHtmlString());
|
|
|
- }
|
|
|
- ViewContext.Writer.Write("</div>");
|
|
|
|
|
|
- ViewContext.Writer.Write("</div>");
|
|
|
+ ViewContext.Writer.Write(Html.CustomLabelFor(m => m.Deviations, "Vertragsabweichungen / Nachträge:"));
|
|
|
|
|
|
- Html.RenderPartial(
|
|
|
- "~/Views/Shared/_PopupButtonPanel.cshtml",
|
|
|
- new GreenTree.Nachtragsmanagement.Web.Models.Global.PopupModel
|
|
|
+ ViewContext.Writer.Write("<div id=\"siteTreeContainer\" style='width: 100%; overflow: auto; max-height: 450px; border: 1px solid #d0d0d0'>");
|
|
|
{
|
|
|
- PopupName = "devPopupControlEditSite",
|
|
|
- AcceptFunction = "function (s, e) { saveSite(); }"
|
|
|
+ ViewContext.Writer.Write(Html.Partial("~/Views/Sites/_SiteEditTreePartial.cshtml", Model).ToHtmlString());
|
|
|
}
|
|
|
- );
|
|
|
- }
|
|
|
- });
|
|
|
- s.Styles.Content.Paddings.Padding = new Unit(0);
|
|
|
- s.Styles.ModalBackground.Opacity = 0;
|
|
|
-}).GetHtml()
|
|
|
+ ViewContext.Writer.Write("</div>");
|
|
|
+
|
|
|
+ ViewContext.Writer.Write("</div>");
|
|
|
+
|
|
|
+ Html.RenderPartial(
|
|
|
+ "~/Views/Shared/_PopupButtonPanel.cshtml",
|
|
|
+ new GreenTree.Nachtragsmanagement.Web.Models.Global.PopupModel
|
|
|
+ {
|
|
|
+ PopupName = "devPopupControlEditSite",
|
|
|
+ AcceptFunction = "function (s, e) { saveSite(); }"
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }
|
|
|
+ });
|
|
|
+ s.Styles.Content.Paddings.Padding = new Unit(0);
|
|
|
+ s.Styles.ModalBackground.Opacity = 0;
|
|
|
+ }).GetHtml()
|
|
|
+
|
|
|
+ @Html.Partial("~/Views/Shared/_PopupDialogYesNo.cshtml", new GreenTree.Nachtragsmanagement.Web.Models.Global.YesNoDialogModel
|
|
|
+{
|
|
|
+ PopupName = "devPopupControlSaveForAppend",
|
|
|
+ Content = "<div class='dialogTextSaveForAppend' style='padding: 12px'>Damit ein Nachtrag für die Baustelle erfasst werden kann, " +
|
|
|
+ "muss Sie zunächst gespeichert werden. Soll die Baustelle jetzt gespeichert werden?</div>",
|
|
|
+ HeaderText = "Baustelle speichern",
|
|
|
+ YesFunction = "function (s, e) { saveSiteForAppend(); }",
|
|
|
+ YesButtonName = "devButtonSaveForAppendYes",
|
|
|
+ NoButtonName = "devButtonSaveForAppendNo"
|
|
|
+})
|
|
|
+
|
|
|
+ @Html.Partial("~/Views/Shared/_PopupDialogYesNo.cshtml", new GreenTree.Nachtragsmanagement.Web.Models.Global.YesNoDialogModel
|
|
|
+ {
|
|
|
+ PopupName = "devPopupControlDeleteAppendix",
|
|
|
+ Content = "<div class='dialogTextAppendix' style='padding: 12px'>Sind Sie sicher, dass Sie den Nachtrag \"{appendix}\" und " +
|
|
|
+ "alle zugehörigen Vertragsabweichungen löschen möchten? Der Vorgang kann nicht rückgängig gemacht werden.</div>",
|
|
|
+ HeaderText = "\"{appendix}\" löschen",
|
|
|
+ YesFunction = "function (s, e) { deleteAppendix(); }",
|
|
|
+ YesButtonName = "devButtonDeleteAppendixYes",
|
|
|
+ NoButtonName = "devButtonDeleteAppendixNo"
|
|
|
+ })
|
|
|
+
|
|
|
+ @Html.Partial("~/Views/Shared/_PopupDialogYesNo.cshtml", new GreenTree.Nachtragsmanagement.Web.Models.Global.YesNoDialogModel
|
|
|
+ {
|
|
|
+ PopupName = "devPopupControlDeleteDeviation",
|
|
|
+ Content = "<div class='dialogTextDeviation' style='padding: 12px'>Sind Sie sicher, dass Sie die Vertragsabweichung \"{deviation}\" " +
|
|
|
+ "löschen möchten? Der Vorgang kann nicht rückgängig gemacht werden.</div>",
|
|
|
+ HeaderText = "\"{deviation}\" löschen",
|
|
|
+ YesFunction = "function (s, e) { deleteDeviation(); }",
|
|
|
+ YesButtonName = "devButtonDeleteDeviationYes",
|
|
|
+ NoButtonName = "devButtonDeleteDeviationNo"
|
|
|
+ })
|
|
|
+
|
|
|
</div>
|