private Collection<OpeningStockType> GetStockDetails(string json) { Collection<OpeningStockType> details = new Collection<OpeningStockType>(); JavaScriptSerializer jss = new JavaScriptSerializer(); dynamic result = jss.Deserialize<dynamic>(json); if (result != null) { foreach (dynamic item in result) { OpeningStockType detail = new OpeningStockType(); detail.ItemCode = item[0]; detail.StoreName = item[2]; detail.Quantity = Conversion.TryCastInteger(item[3]); detail.UnitName = item[4]; detail.Amount = Conversion.TryCastDecimal(item[5]); details.Add(detail); } } return details; }
private Collection <OpeningStockType> GetStockDetails(string json) { Collection <OpeningStockType> details = new Collection <OpeningStockType>(); JavaScriptSerializer jss = new JavaScriptSerializer(); dynamic result = jss.Deserialize <dynamic>(json); if (result != null) { foreach (dynamic item in result) { OpeningStockType detail = new OpeningStockType(); detail.ItemCode = item[0]; detail.StoreName = item[2]; detail.Quantity = Conversion.TryCastInteger(item[3]); detail.UnitName = item[4]; detail.Amount = Conversion.TryCastDecimal(item[5]); details.Add(detail); } } return(details); }