public JsonResult Nexttostep8(string manu)
{
var supllst = (from i in dbh.Items
join s in dbh.SupplierLists on i.ID equals s.ItemID
join sa in dbh.Suppliers on s.SupplierID equals sa.ID
where i.ItemLookupCode == "050326120180"
select new
{
sa.SupplierName,
s.ReorderNumber,
s.MinimumOrder,
s.MasterPackQuantity,
s.Cost,
sa.CustomText5
}).ToList();
foreach (var item in supllst)
{
var i = new suppliersmodel();
i.SupplierName = item.SupplierName;
i.ReorderNumber = item.ReorderNumber;
i.MinimumOrder = item.MinimumOrder;
i.MasterPackQuantity = item.MasterPackQuantity;
i.Customtext5 = item.CustomText5;
if (item.CustomText5 == "LOCAL")
{
i.Cost = item.Cost;
i.LocalCost = item.Cost;
}
else
{
i.Cost = item.Cost;
i.LocalCost = item.Cost * Convert.ToDecimal(0.84);
}
lstsupliers.Add(i);
}
return Json(lstsupliers, JsonRequestBehavior.AllowGet);
}
Here is my ajax call example:function Nexttostepeight() {
var manu = $("#textmanufactureid").val();
$.ajax({
type: "POST",
url: "/PIM/Nexttostep8",
dataType: "json",
data: { manu: manu },
success: function (data) {
$('#step7').css('backgroundColor', '#2ECCFA')
$('#step7').addClass('disabled');
$('ul.setup-panel li:eq(7)').removeClass('disabled');
$('ul.setup-panel li a[href="#step-8"]').trigger('click');
$("#manufacturerprogresid").show().html("<strong>MANUFACTURER:</strong> " + manu);
debugger;
var suplier = '';
for (var i = 0; i < data.length; i++) {
var dt1 = data[0].SupplierName;
var dt2 = data[1].ReorderNumber;
var dt3 = data[2].MinimumOrder;
var dt4 = data[3].MasterPackQuantity;
var dt5 = data[4].Customtext5;
var dt6 = data[5].Cost;
var dt7 = data[6].LocalCost;
}
}
});
}
The issue I'm facing here is - I'm getting the first properties just fine, but the rest come with error.The successor to Active Server Pages, ASP.NET websites utilize the .NET framework to produce dynamic, data and content-driven web applications and services. ASP.NET code can be written using any .NET supported language. As of 2009, ASP.NET can also apply the Model-View-Controller (MVC) pattern to web applications
TRUSTED BY