public ActionResult GetPaymentRecordByInvoiceId(int InvoiceId, int Skip, string FileID) { try { string path = GlobalConst.ConstantChar.Blank; var getAllPayments = _payment.GetPaymentRecordByInvoiceId(InvoiceId, Skip, GlobalConst.Records.Take); PaymentViewModel PaymentViewModel = new PaymentViewModel(); PaymentViewModel.PaymentDetails = getAllPayments.PaymentDetails.Select(PaymentResult => new Payment().InjectFrom(PaymentResult)).Cast <Payment>().ToList(); foreach (Payment payment in PaymentViewModel.PaymentDetails) { path = Path.Combine(ConfigurationManager.AppSettings[GlobalConst.ConstantChar.StoragePath], FileID, payment.InvoiceId.ToString(), payment.PaymentId.ToString()); payment.CheckDownloadPath = path + GlobalConst.ConstantChar.DoubleSlash + payment.CheckUploadName; } PaymentViewModel.PaymentCount = getAllPayments.TotalCount; return(Json(PaymentViewModel, GlobalConst.ContentTypes.TextHtml)); } catch (Exception ex) { _arCommonService.CreateErrorLog(ex.Message, ex.StackTrace); return(View()); } }
public void Get_PaymentRecordByInvoiceId() { var getAllPayments = _IPaymentImplBL.GetPaymentRecordByInvoiceId(2, 0, 10); Assert.IsTrue(getAllPayments != null, "Unable to find"); }