Server Side:
var publicationTable = new List
// reportpricingservice.GetAll().ForEach(a=> publicationTable.Add(new object[]{a.ReportTypeId,a.TestTypeId,a.Price}));
reportpricingservice.GetAll().ForEach(a => publicationTable.Add(new {a.ReportTypeId, a.TestTypeId, a.Price }));
return (new JavaScriptSerializer()).Serialize(publicationTable);
Client side:
var reportpricings = <%= getReportPricing() %>;
function getprice(TestType,ReportType)
{
return $.grep(reportpricings, function (reportpricing)
{
return (reportpricing.ReportTypeId == ReportType && reportpricing.TestTypeId == TestType);
})[0].Price;
}
| |
This email has been checked for viruses by Avast antivirus software.
www.avast.com |