or
01.using System;02.using System.Collections.Generic;03.using System.Linq;04.using System.Web;05.using Airbus.Asam.Contracts;06.using Airbus.Asam.BusinessObjects;07. 08.namespace Customer.Asam.Presentation.Supplier.ViewModels09.{10. public class TempPP11. {12. public Boolean isInDB { get; set; }13. public string ID { get; set; }14. public string PPSRCAPPLICATION { get; set; }15. public string PPREF { get; set; }16. public string PPSITE { get; set; }17. public string DESCRIPTION { get; set; }18. public System.DateTime DATEFROM { get; set; }19. public System.DateTime DATETO { get; set; }20. public string PPLEVEL { get; set; }21. public Nullable<decimal> QUOTA { get; set; }22. }23.}@model Customer.Asam.Presentation.Supplier.ViewModels.ARRViewmodel@using Customer.Asam.Resources@using Customer.Asam.Presentation.Supplier.Common@using (Html.BeginForm("Create_Step3", "", FormMethod.Get, new { @id = "FORM_ARR_3" })){ <div> <h2>@Asam_Strings.TITLE_CREATE_ARR_STEP 3 @Asam_Strings.TITLE_CREATE_ARR_PREVENTION_PLAN</h2> @Asam_Strings.LABEL_PP_REFERENCE @(Html.Kendo().DropDownList() .HtmlAttributes(new { style = "width: 250px" }) .BindTo(Model.tempPP) .Name("tempPP") //The name of the combobox is mandatory. It specifies the "id" attribute of the widget. .DataTextField("PPREF") //Specifies which property of the Product to be used by the combobox as a text. .DataValueField("ID") //Specifies which property of the Product to be used by the combobox as a value. .Events(e => e .Select(@<text> function(e) { e.preventDefault(); var dataItem = this.dataItem(e.item.index()); if (e.item.index() > 0) { var grid = $("#RefPP").data("kendoGrid"); grid.dataSource.add(dataItem); } } </text>)) ) <script> function indexPP(dataItem) { var data = $("#RefPP").data("kendoGrid").dataSource.data(); return data.indexOf(dataItem); } </script> @(Html.Kendo().Grid(Model.RefPP) .Name("RefPP") .DataSource(dataSource => dataSource .Ajax() .PageSize(1) .ServerOperation(false) ) .Columns(column => { column.Bound(c => c.PPREF) .ClientTemplate("#= PPREF # " + "<input type='hidden' name='RefPP[#= indexPP(data)#].PPREF' value='#= PPREF #' />" + "<input type='hidden' name='RefPP[#= indexPP(data)#].PPSRCAPPLICATION' value='#= PPSRCAPPLICATION #' />" + "<input type='hidden' name='RefPP[#= indexPP(data)#].PPSITE' value='#= PPSITE #' />" + "<input type='hidden' name='RefPP[#= indexPP(data)#].DESCRIPTION' value='#= DESCRIPTION #' />" + "<input type='hidden' name='RefPP[#= indexPP(data)#].DATEFROM' value='#= DATEFROM #' />" + "<input type='hidden' name='RefPP[#= indexPP(data)#].DATEFROM' value='#= DATEFROM #' />" + "<input type='hidden' name='RefPP[#= indexPP(data)#].DATETO' value='#= DATETO #' />" + "<input type='hidden' name='RefPP[#= indexPP(data)#].QUOTA' value='#= QUOTA #' />"); column.Bound(c => c.PPSITE); column.Bound(c => c.DESCRIPTION); column.Bound(c => c.DATEFROM) .Format("{0:dd/MM/yyyy}"); column.Bound(c => c.DATETO) .Format("{0:dd/MM/yyyy}"); column.Bound(c => c.QUOTA); } ) ) </div>}
<div class="form-group"> @Html.LabelFor(model => model.locationCode, new { @class = "control-label col-md-2" }) <div class="col-md-10"> @(Html.Kendo().ComboBox() .Name("locationCode") .Filter(FilterType.Contains) .DataTextField("Text") .DataValueField("Value") .BindTo(Model.Locations) .Suggest(true) ) @Html.ValidationMessageFor(model => model.locationCode) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.loadType, new { @class = "control-label col-md-2" }) <div class="col-md-10"> @(Html.Kendo().ComboBox() .Name("loadType") .Filter(FilterType.Contains) .DataTextField("Text") .DataValueField("Value") .BindTo(Model.LoadTypes) .Suggest(true) ) @Html.ValidationMessageFor(model => model.loadType) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.loadDescrip, new { @class = "control-label col-md-2" }) <div class="col-md-10"> @(Html.Kendo().ComboBox() .Name("loadDescription") .Filter(FilterType.Contains) .DataTextField("DocCode") .DataValueField("DocCode") .DataSource(source => { source.Read(read => { read.Action("GetCascadeDocumentNumbers", "DockDoor") .Data("filterLoadDescription"); }) .ServerFiltering(true); }) .Enable(false) .AutoBind(false) .CascadeFrom("loadType") ) <script> function filterLoadDescription() { return { locCode: $("#locationCode").val(), loadType: $("#loadType").val(), docNumFilter: $("#loadDescription").data("kendoComboBox").input.val() }; } </script> @Html.ValidationMessageFor(model => model.loadDescrip) </div> </div>public JsonResult GetCascadeDocumentNumbers(string locCode, string loadType, string docNumFilter){ if (loadType != "OPEN" && loadType != "GENERIC") { var docNums = db.GetCurrentDocumentNumbers(locCode, loadType).AsEnumerable(); if (!string.IsNullOrWhiteSpace(docNumFilter)) { docNums = docNums.Where(x => x.Contains(docNumFilter)); } return Json(docNums.Select(x => new { DocCode = x.ToString() }), JsonRequestBehavior.AllowGet); } return Json(string.Empty, JsonRequestBehavior.AllowGet);}