Пример #1
0
        public HttpResponseMessage GetAllAttachments(AttachmentDataViewModel attachmentviewmodel)
        {
            GetAttachmentsResponse response = docrepositoryService.GetAllAttachments(new GetAttachmentsRequest()
            {
                ContactId     = attachmentviewmodel.ContactID,
                Limit         = 5,
                PageNumber    = attachmentviewmodel.PageNumber,
                Page          = attachmentviewmodel.PageName,
                OpportunityID = attachmentviewmodel.OpportunityID,
                DateFormat    = this.DateFormat
            });

            return(Request.BuildResponse(response));
        }
Пример #2
0
        /// <summary>
        /// Gets all attachments.
        /// </summary>
        /// <param name="attachmentviewmodel">The attachmentviewmodel.</param>
        /// <returns></returns>
        public ActionResult GetAllAttachments(AttachmentDataViewModel attachmentviewmodel)
        {
            GetAttachmentsResponse response = attachmentService.GetAllAttachments(new GetAttachmentsRequest()
            {
                ContactId     = attachmentviewmodel.ContactID,
                Limit         = 5,
                PageNumber    = attachmentviewmodel.PageNumber,
                Page          = attachmentviewmodel.PageName,
                OpportunityID = attachmentviewmodel.OpportunityID,
                DateFormat    = this.Identity.ToDateFormat()
            });

            return(Json(
                       new DataSourceResult
            {
                Data = response.Attachments,
                Total = response.TotalRecords
            },
                       JsonRequestBehavior.AllowGet));
        }