Exemplo n.º 1
0
        public dynamic GetInfo(int Id)
        {
            PaymentRequest model = new PaymentRequest();

            try
            {
                model = _paymentRequestService.GetObjectById(Id);
            }
            catch (Exception ex)
            {
                LOG.Error("GetInfo", ex);
                Dictionary <string, string> Errors = new Dictionary <string, string>();
                Errors.Add("Generic", "Error " + ex);

                return(Json(new
                {
                    Errors
                }, JsonRequestBehavior.AllowGet));
            }

            return(Json(new
            {
                model.Id,
                model.Code,
                model.ContactId,
                Contact = _contactService.GetObjectById(model.ContactId).Name,
                model.Description,
                model.RequestedDate,
                model.DueDate,
                model.Amount,
                model.Errors
            }, JsonRequestBehavior.AllowGet));
        }