EOS/Views/Ticket/EditEscalation.cshtml
Nidhi Bhargava f0c1ab20e1 code push
2025-09-04 16:25:07 +05:30

369 lines
20 KiB
Plaintext

@model IEnumerable<GODATA.Models.Ticket.EscalationMatrix>
<link href="~/Content/css/jquery.tagsinput.css" rel="stylesheet" />
@*<script src="~/Scripts/jquery.tagsinput.js"></script>*@
@*<script src="~/Scripts/jquery.validate.unobtrusive.min.js"></script>*@
@Scripts.Render("~/bundles/jsTagsInput")
@foreach (var item in Model)
{
@*<div>*@
using (Ajax.BeginForm("UpdateEscalation", "Ticket", new AjaxOptions { HttpMethod = "POST", OnBegin = "onBeginEditEscalation", OnSuccess = "onSuccessEditEscalation" }))
{
@Html.ValidationSummary(true)
<input type="hidden" name="StateName" id="stateName" />@*
@Html.HiddenFor(model => item.StateName, new { id = "stateName" })
*@
<input type="hidden" name="region_name" id="regionName" />
<input type="hidden" name="oldContactNo" id="oldContactNo" />
@Html.Hidden("organization_id", item.organization_id)
@Html.Hidden("id", item.id)
@*<input type="hidden" name="BlindSpot" id="blindSpot" />*@
<div>
<table class="themeTable" cellpadding="5" cellspacing="0" width="100%">
<tbody>
<tr>
<td class="tableCelllabel">
<span class="darktxt">@Html.LabelFor(model => item.organization_name)</span>
</td>
<td class="tableCellinfo SelectDD">
<input type="text" name="organization_name" id="OrganizationName" value="@item.organization_name" class="disable_btn " data-val="true" data-val-required="*" readonly />
<span class="field-validation-valid" data-valmsg-for="organization_name" data-valmsg-replace="true"></span>
@*@Html.TextBoxFor(model => item.OrganizationName, new { @class = "disable_btn k-textbox", @readonly = "readonly" })*@
</td>
<td class="tableCelllabel">
<span class="darktxt">@Html.LabelFor(model => item.dealer_name)</span>
</td>
<td class="tableCellinfo SelectDD">
<input type="text" name="dealerName2" id="DealerName" value="@item.dealer_name (@item.dealer_name_id)" title="@item.dealer_name (@item.dealer_name_id)" class="disable_btn " data-val="true" data-val-required="*" readonly />
<input type="hidden" name="dealer_name" id="DealerId" value="@item.dealer_name_id" class="disable_btn " />
<span class="field-validation-valid" data-valmsg-for="dealer_name" data-valmsg-replace="true"></span>
@*@Html.TextBoxFor(model => item.DealerName, new { @class = "disable_btn k-textbox", @readonly = "readonly" })*@
</td>
</tr>
<tr>
<td class="tableCelllabel">
<span class="darktxt">@Html.LabelFor(model => item.manager_name)</span>
</td>
<td class="tableCellinfo SelectDD">
@* <input type="text" name="ManagerName" id="ManagerName" value="@item.ManagerName" />
@Html.ValidationMessageFor(model => item.ManagerName)*@
<input class="" data-val="true" data-val-required="*" id="ManagerName" name="manager_name" type="text" value="@item.manager_name">
<span id="spanManagerName" style="display: none; color: red;">*</span>
<span class="field-validation-valid" data-valmsg-for="manager_name" data-valmsg-replace="true"></span>
@*@Html.TextBoxFor(model => item.ManagerName, new { @class = " k-textbox", @readonly = "readonly" })*@
</td>
<td class="tableCelllabel">
<span class="darktxt">@Html.LabelFor(model => item.manager_level)</span>
</td>
<td class="tableCellinfo SelectDD">
@*<input type="text" name="ManagerLevel" id="ManagerLevel" value="@item.ManagerLevel" class=" k-textbox" />*@
<select id="ddManagerLevel" name="manager_level" data-val="true" data-val-required="*">
<option value="-Select-">-Select-</option>
</select>
<span id="spanManagerLevel" style="display: none; color: red;">*</span>
<span class="field-validation-valid" data-valmsg-for="manager_level" data-valmsg-replace="true"></span>
@*@Html.DropDownListFor(model => item.ManagerLevel, (IEnumerable<SelectListItem>)ViewBag.Service, "-Select-", new { @id = "ddManagerLevel" })*@
@*@Html.TextBoxFor(model => item.ManagerLevel, new { @class = " k-textbox", @readonly = "readonly" })*@
</td>
</tr>
<tr>
<td class="tableCelllabel">
<span class="darktxt">@Html.LabelFor(model => item.state)</span>
</td>
<td class="tableCellinfo SelectDD">
@* <input type="text" name="State" id="State" value="@item.State" class=" k-textbox" />*@
<select id="ddStateList" name="state" data-val="true" data-val-required="*" onchange="onChangeState()">
<option value="-Select-">-Select-</option>
@foreach (var item2 in (IEnumerable<SelectListItem>)ViewBag.StateList)
{
<option value="@item2.Value">@item2.Text</option>
}
</select>
<span id="spanState" style="display: none; color: red;">*</span>
<span class="field-validation-valid" data-valmsg-for="state" data-valmsg-replace="true"></span>
@*@Html.DropDownListFor(model => item.State, (IEnumerable<SelectListItem>)ViewBag.StateList, "-Select-", new { @id = "ddStateList", @onchange = "onChangeState()" })*@
@*@Html.TextBoxFor(model => item.ManagerName, new { @class = " k-textbox", @readonly = "readonly" })*@
</td>
<td class="tableCelllabel">
<span class="darktxt">@Html.LabelFor(model => item.city)</span>
</td>
<td class="tableCellinfo SelectDD">
@* <input type="text" name="City" id="City" value="@item.City" class=" k-textbox" />*@
<select id="ddCityList" name="city" data-val="true" data-val-required="*">
<option value="-Select-">-Select-</option>
</select>
<span id="spanCity" style="display: none; color: red;">*</span>
<span class="field-validation-valid" data-valmsg-for="city" data-valmsg-replace="true"></span>
@*@Html.DropDownListFor(model => item.City, (IEnumerable<SelectListItem>)ViewBag.Service, "-Select-", new { @id = "ddCityList" })*@
@*@Html.TextBoxFor(model => item.ManagerLevel, new { @class = " k-textbox", @readonly = "readonly" })*@
</td>
</tr>
<tr>
<td class="tableCelllabel">
<span class="darktxt">@Html.LabelFor(model => item.van_type)</span>
</td>
<td class="tableCellinfo SelectDD">
@*<input type="text" name="VanType" id="VanType" value="@item.VanType" class=" k-textbox" />*@
<select id="ddVehicleType" name="VehicleTaggingList" data-val="true" data-val-required="*">
<option value="-Select-">-Select-</option>
</select>
<span id="spanProductVariant" style="display: none; color: red;">*</span>
<span class="field-validation-valid" data-valmsg-for="VehicleTaggingList" data-valmsg-replace="true"></span>
@*@Html.DropDownListFor(model => item.VanType, (IEnumerable<SelectListItem>)ViewBag.Service, "-Select-", new { @id = "ddVehicleType" })*@
@*@Html.TextBoxFor(model => item.VanType, new { @class = " k-textbox", @readonly = "readonly" })*@
</td>
<td class="tableCelllabel">
<span class="darktxt">@Html.LabelFor(model => item.notification_type)</span>
</td>
<td class="tableCellinfo ">
<input type="checkbox" checked="checked" name="EmailType" value="email" id="chkEmail">
<span>Email</span>
<input type="checkbox" checked="checked" name="SMSType" value="sms" id="chkSms" style="margin-left: 10px;">
<span>SMS</span>
<span id="spanNotificationType" style="display: none; color: red;">*</span>
</td>
</tr>
<tr>
<td class="tableCelllabel">
<span class="darktxt">@Html.LabelFor(model => item.alarm_age)</span>
</td>
<td class="tableCellinfo ">
<input type="text" name="alarm_age" id="AlarmAge" value="@item.alarm_age" class=" " />
@*@Html.TextBoxFor(model => item.AlarmAge, new { @class = " k-textbox", @readonly = "readonly" })*@
</td>
<td class="tableCelllabel">
<span class="darktxt">@Html.LabelFor(model => item.alarm_age_sla_not_met)</span>
</td>
<td class="tableCellinfo ">
<input type="text" name="alarm_age_sla_not_met" id="AlarmAgeSlaNotMet" value="@item.alarm_age_sla_not_met" class=" " />
@*@Html.TextBoxFor(model => item.AlarmAgeSlaNotMet, new { @class = " ", @readonly = "readonly" })*@
</td>
</tr>
<tr>
<td class="tableCelllabel">
<span class="darktxt">@Html.LabelFor(model => item.alarm_age_ticket_not_closed)</span>
</td>
<td class="tableCellinfo ">
<input type="text" name="alarm_age_ticket_not_closed" id="AlarmAgeTicketNotClosed" value="@item.alarm_age_ticket_not_closed" class=" " />
@*@Html.TextBoxFor(model => item.AlarmAgeTicketNotClosed, new { @class = " k-textbox", @readonly = "readonly" })*@
</td>
<td class="tableCelllabel">
<span class="darktxt">@Html.LabelFor(model => item.alarm_age_van_not_live)</span>
</td>
<td class="tableCellinfo ">
<input type="text" name="alarm_age_van_not_live" id="AlarmAgeVanNotLive" value="@item.alarm_age_van_not_live" class=" "/>
@*@Html.TextBoxFor(model => item.AlarmAgeSlaNotMet, new { @class = " k-textbox", @readonly = "readonly" })*@
</td>
</tr>
<tr>
<td class="tableCelllabel">
<span class="darktxt">@Html.LabelFor(model => item.alarm_age_eicher_promise_48hrs)</span>
</td>
<td class="tableCellinfo ">
<input type="text" name="alarm_age_eicher_promise_48hrs" id="AlarmAgeEicherPromise48Hrs" value="@item.alarm_age_eicher_promise_48hrs" class="" />
@*@Html.TextBoxFor(model => item.AlarmAgeTicketNotClosed, new { @class = " k-textbox", @readonly = "readonly" })*@
</td>
<td class="tableCelllabel">
<span class="darktxt"></span>
</td>
<td class="tableCellinfo "></td>
</tr>
@* <div class="editor-label">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td width="350">
<table>
<tr>
<td>
<div class="LeftTD_Panel">@Html.LabelFor(model => item.BlindSpot)</div>
</td>
<td class="editor-field">
@{
var yesOptions = item.BlindSpot == "yes" ? new { @checked = "checked"} : null;
var noOptions = item.BlindSpot == "yes" ? null : new { @checked = "checked"};
}
@Html.RadioButtonFor(modelItem => item.BlindSpot, true, yesOptions) Yes
@Html.RadioButtonFor(modelItem => item.BlindSpot, false, noOptions) No
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>*@
<tr>
<td class="tableCelllabel">
<span class="darktxt">
@Html.LabelFor(model => item.emails)</span>
</td>
<td class="tableCellinfo" colspan="3" style="width: 81%;">
<input type="text" name="emails" id="Emails" value="@item.emails" class=" " />
@*@Html.TextBoxFor(model => item.Emails, new { @id = "Emails" })*@
<span id="spanEmail" style="display: none; color: red;">*</span>
@Html.ValidationMessageFor(model => item.emails)
@*@Html.ValidationMessageFor(model => item.Emails)*@
</td>
</tr>
<tr>
<td class="tableCelllabel">
<span class="darktxt">
@Html.LabelFor(model => item.phones)</span>
<div class="tooltip">
<img id="img_help" src="~/Content/css/images/help_favicon.png" height="20" width="20" alt="help" />
<span>Only 10 digits
<br />
Ex. 9999999999
</span>
</div>
</td>
<td class="tableCellinfo" colspan="3" style="width: 81%;">
<input type="text" name="phones" id="Phones" value="@item.phones" class=" " />
@*@Html.TextBoxFor(model => item.Phones, new { @id = "Phones" })*@
<span id="spanPhoneNo" style="display: none; color: red;">*</span>
@Html.ValidationMessageFor(model => item.phones)
@*@Html.ValidationMessageFor(model => item.Phones)*@
</td>
</tr>
<tr>
<tr>
<td class="tableCelllabel">
<span class="darktxt">@Html.LabelFor(model => item.editEscalationAll)</span>
</td>
<td class="tableCellinfo ">
<input type="checkbox" name="editEscalationAll" id="editEscalationAll" style="margin-left: 3px;" />
@*@Html.TextBoxFor(model => item.AlarmAgeTicketNotClosed, new { @class = " k-textbox", @readonly = "readonly" })*@
</td>
</tr>
</tr>
</tbody>
</table>
</div>
<br />
<div class="CreateWrp">
<input type="submit" value="Update " class="button_blue" style="margin: 0px; height: 13px; width: auto;" />
<input type="reset" value="Reset " class="button_blue" style="display: none; margin: 0px; height: 13px; width: auto;" />
<input type="button" value="Cancel " class="button_blue" style="background: #ee2e22 !important; margin: 0px; height: 13px; width: auto;" onclick='closeWindow("#divEditEscalation")' />
</div>
}
@*</div>@*
@foreach (var item in @Model)
{
*@
<script>
// $('#Emails').tagsInput();
$('#Emails').tagsInput({
type: 'email'
});
// $('#Phones').tagsInput();
$('#Phones').tagsInput({
type: 'phone'
});
var notficationType = '@item.notification_type';
var splitType = notficationType.split(',');
if (splitType[0].toLowerCase() == "email") {
$("#chkEmail").prop("checked", true);
}
else if (splitType[0].toLowerCase() == "sms") {
$("#chkSms").prop("checked", true);
}
else { }
if (splitType.length > 1)
if (splitType[1].toLowerCase() == "sms") {
$("#chkSms").prop("checked", true);
}
else if (splitType[1].toLowerCase() == "email") {
$("#chkEmail").prop("checked", true);
}
$("input[type=radio]").css('width', 'auto');
//bindVehicleProductVariant();
bindManagerLevel();
LoadStateListRegionWise('organization_id', 'ddStateList', 'ddCityList');
$("#ddManagerLevel").val('@ViewBag.ManagerLevel');
//$("#ddStateList").text('@ViewBag.State');
@* $("#ddVehicleType").val('@ViewBag.ProductVariant');*@
$("#oldContactNo").val('@ViewBag.OldContacts');
setTimeout(function () {
//set selected state
var stateName = '@ViewBag.State';
var dd = document.getElementById('ddStateList');
for (var i = 0; i < dd.options.length; i++) {
if (dd.options[i].text === stateName) {
dd.selectedIndex = i;
onChangeState();
setTimeout(function () { $("#ddCityList").val('@ViewBag.City'); }, 2000);
}
}
}, 1000);
$(document).ready(function () {
console.log(@Html.Raw(Json.Encode(@ViewBag.ProductVariant)));
$('#ddVehicleType').kendoMultiSelect({
dataSource: vehicleProductVariantList,
dataTextField: 'Text',
dataValueField: 'Value',
filter: 'contains',
placeholder: "-Select-"
}).data("kendoMultiSelect");
setTimeout(function () {
$("#ddVehicleType").data("kendoMultiSelect").value(@Html.Raw(Json.Encode(@ViewBag.ProductVariant)));
}, 500);
});
</script>
}
<style type="text/css">
.SelectDD select { width: 171px; padding: 0px 0px; text-indent: 3px; }
.themeTable tbody td { width: 24% !important; }
div.k-window { /*height: 500px;*/ box-shadow: 20px 20px 30px #555 !important; border-radius: 0; padding-top: 0 !important; }
.k-window-titlebar { border-radius: 0px !important; }
.k-i-close { background-color: #fff; border-radius: 2px; width: inherit !important; }
.k-window-titlebar.k-header { background: url("/Content/css/images/infowindow_head-bg.png") repeat-x left top; height: 18px !important; background-color: transparent !important; line-height: 16px; }
.tableCellinfo .text-box { width: 164px; }
input[type=checkbox] { display: inline-block; }
.autoSize { width: auto; }
div.tagsinput { float: left !important; width: 96% !important; }
div.tagsinput span.tag { border: 1px solid #77a8d1; background: #d2e2f0; color: #505050; }
div.tagsinput span.tag a { color: #77a8d1; display: -webkit-inline-box !important; }
div.tooltip span { border-radius: 4px; box-shadow: 5px 5px 8px #ccc; margin-left: 5px; margin-top: -18px; width: 122px; }
#Emails_tag { width: 200px; }
</style>