by using following angular code(in debugging with breakpoint) am getting list of data in d.data(Name:'Madhu',Address:'Upal'...)
but in x am getting only Name,Address...etc.if i expand name only,
how to get value there and bind in receiptsviewmodel
JS
$scope.GetAccountBalance = function (index, c) {
for ( var x in d.data)
{
$scope.ReceiptsViewModel=x;
$scope.ReceiptsViewModel.PendingAmount = $scope.ReceiptsViewModel.Amount - $scope.ReceiptsViewModel.AmountAdjusted;
}
}
my cs
public JsonResult GetPendings(int? pendingID)
{
string eid = pendingID.ToString();
TestDemoEntities db = new TestDemoEntities();
var data = (from ap in db.Accounting_PendingBills
join apa in db.Accounting_PendingBillsAdjusted on ap.BillRef equals apa.TowardsBillRef
group apa by new { ap.BillDate, ap.Amount, ap.Party, apa.TowardsBillRef } into g
select new
{
BillDate = g.Key.BillDate,
Party = g.Key.Party,
Amount = g.Key.Amount,
BillNumber = g.Key.TowardsBillRef,
AmountAdjusted = g.Sum(aa => aa.AmountAdjusted)
}).Where(ap => ap.Party == eid).FirstOrDefault();
// }).Where(ap => ap.Party == eid).ToList();
return Json(data, JsonRequestBehavior.AllowGet);
}