Exemple #1
0
        public JsonResult GetAllTransaction()
        {
            List <TrasactionWeb> trasactionWeb_ar = new List <TrasactionWeb>();
            List <Transaction>   transaction_ar   = _dataClient.Transaction.ToList();

            foreach (var transaction in transaction_ar)
            {
                string accountNameAcceptor = HomeModel.GetAccountNameCheckId(_dataClient, (int)transaction.CheckIdAcceptor);
                string accountNameDonor    = HomeModel.GetAccountNameCheckId(_dataClient, (int)transaction.CheckIdDonor);

                trasactionWeb_ar.Add(new TrasactionWeb()
                {
                    Id           = transaction.Id,
                    NameAcceptor = accountNameAcceptor,
                    NameDonor    = accountNameDonor,
                    Date         = (DateTime)transaction.Date,
                    Money        = (int)transaction.Money
                });
            }

            return(Json(trasactionWeb_ar, JsonRequestBehavior.AllowGet));
        }