protected string GetAttachmentUrl(IDataItemContainer cont) { var p = cont.DataItem as AffiliatePaymentReportData; if (p != null) { return(DiskStorage.PaymentsAttachmentUrl(HccApp.CurrentStore.Id, p.FileName)); } return(string.Empty); }
private List <AffiliatePaymentsViewModel.PaymentViewModel> GetPayments(Affiliate aff, DateTime start, DateTime end, int pageNumber, int pageSize, out int totalRowCount) { var payments = HccApp.ContactServices.AffiliatePayments.FindAllPaged(aff.Id, start, end, pageNumber, pageSize, out totalRowCount) .Select(p => new AffiliatePaymentsViewModel.PaymentViewModel { Amount = p.PaymentAmount.ToString("c"), AttachmentUrl = string.IsNullOrEmpty(p.FileName) ? string.Empty : DiskStorage.PaymentsAttachmentUrl(HccApp.CurrentStore.Id, p.FileName), Notes = p.Notes }) .ToList(); return(payments); }