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

150 lines
6.6 KiB
Plaintext

@model GODATA.Models.UserInventory.UserInventory
<script src="~/Scripts/jquery.validate.unobtrusive.min.js"></script>
@using (Ajax.BeginForm("ManagePrincipleDealerInventory_EditPrincipleDealer", "UserInventory", new AjaxOptions { HttpMethod = "POST", OnBegin = "onBeginEditPrincipleDealer", OnSuccess = "onSuccessEditPrincipleDealer" }))
{
@Html.ValidationSummary(true)
@Html.HiddenFor(model => model.StateName, new { id = "stateName" })
@Html.HiddenFor(model => model.ObjectId)
<div>
<table class="themeTable" id="tblUserInventory" cellpadding="5" cellspacing="0" width="100%">
<tbody>
<tr>
<td class="tableCelllabel bordernone">
<span class="darktxt">
@Html.LabelFor(model => model.OrganizationId)
</span>
<span class="error" style="color: red">* </span>
</td>
<td class="tableCellinfo bordernone SelectDD">
@Html.DropDownListFor(model => model.OrganizationId, (IEnumerable<SelectListItem>)ViewBag.OrganizationList, "-Select-", new { @id = "ddOrganization", @onchange = "LoadStateListRegionWise(id, 'ddState','ddCity')" })
@*@Html.DropDownListFor(model => model.OrganizationId, (IEnumerable<SelectListItem>)ViewBag.OrganizationList, "-Select-", new { @id = "ddOrganization"})*@
@Html.ValidationMessageFor(model => model.OrganizationId)
</td>
<td class="tableCelllabel">
<span class="darktxt">Principal Dealer Name</span><span class="error" style="color: red"> * </span>
</td>
<td class="tableCellinfo">
@Html.TextBoxFor(model => model.FirstName)
@Html.ValidationMessageFor(model => model.FirstName)
</td>
</tr>
<tr>
<td class="tableCelllabel">
<span class="darktxt">
@Html.LabelFor(model => model.State)</span>
</td>
<td class="tableCellinfo SelectDD">
@Html.DropDownListFor(model => model.State, (IEnumerable<SelectListItem>)ViewBag.StateList, "-Select-", new { @id = "ddState", @onchange = "LoadCityList()" })
@Html.ValidationMessageFor(model => model.State)
</td>
<td class="tableCelllabel">
<span class="darktxt">
@Html.LabelFor(model => model.City)</span>
</td>
<td class="tableCellinfo SelectDD">
@Html.DropDownListFor(model => model.City, (IEnumerable<SelectListItem>)ViewBag.CityList, "-Select-", new { @id = "ddCity" })
@*<select id="ddCity" name="City">
<option value="-Select-">-Select-</option>
</select>*@
@Html.ValidationMessageFor(model => model.City)
</td>
</tr>
<tr>
<td class="tableCelllabel">
<span class="darktxt">
@Html.LabelFor(model => model.PrincipleDealerContactNo)</span>
</td>
<td class="tableCellinfo">
@Html.TextBoxFor(model => model.PrincipleDealerContactNo)
@Html.ValidationMessageFor(model => model.PrincipleDealerContactNo)
</td>
<td class="tableCelllabel">
<span class="darktxt">
@Html.LabelFor(model => model.UserName)</span><span class="error" style="color: red"> * </span>
</td>
<td class="tableCellinfo">
@Html.TextBoxFor(model => model.UserName, new { @readonly = "readonly", @class = "disable_btn" })
<span id="spanUserName" class="error" style="display: none">This user already exist!</span>
@Html.ValidationMessageFor(model => model.UserName)
</td>
</tr>
<tr>
<td class="tableCelllabel">
<span class="darktxt">
@Html.LabelFor(model => model.ChildDealerList)</span>
</td>
<td class="tableCellinfo comboboxdiv" colspan="3">
@(Html.Kendo().MultiSelectFor(model => model.ChildDealerList)
.Name("ChildDealerList").Placeholder("-Select-").Filter("contains")
.BindTo(new SelectList(ViewBag.DealerList, "Value", "Text"))
)
<span id="spanChildDealerList" class="error" style="display: none">*</span>
@Html.ValidationMessageFor(model => model.ChildDealerList)
</td>
</tr>
</tbody>
</table>
</div>
<br />
<div class="Create_Wrp">
<input type="submit" value="Update" class="button_blue" style="margin-top: 0px; width: auto; overflow: hidden; height: 27px; line-height: 9px;" />
<input type="button" value="Cancel" class="button_blue" style="background: #ee2e22 !important; margin-top: 0px; width: auto; overflow: hidden; height: 27px; line-height: 9px;" onclick="btnCancelAddUser();" />
</div>
}
<script>
$(document).ready(function () {
var ChildDealerList = '@Html.Raw(Json.Encode(ViewBag.ChildDealerList))';
ChildDealerList = JSON.parse(ChildDealerList);
console.log(ChildDealerList);
$("#ChildDealerList").data("kendoMultiSelect").value(ChildDealerList);
});
//on begin
function onBeginEditPrincipleDealer() {
$("#spanUser").hide();
$("#spanChildDealerList").hide();
if ($("#ChildDealerList").data("kendoMultiSelect").value() == "") {
$("#spanChildDealerList").show();
return false;
}
return true;
}
</script>
<style type="text/css">
.SelectDD select {
width: 173px;
padding: 6px 0px;
font-family: 'HermesFB Regular';
font-family: Arial;
text-indent: 3px;
}
.width17 {
width: 17px !important;
}
.comboboxdiv .k-multiselect.k-header {
width: 73%;
}
#ChildDealerList_taglist .k-button {
background-color: #e3e3e3 !important;
}
</style>