Пример #1
0
        public virtual JsonResult AddNewDocument(string documentNumber)
        {
            var documentData = _viewModelMapperHelper.GetDocumentData(documentNumber);

            var document = new
            {
                DocumentNumber = documentNumber,
                Date           = documentData != null
                    ? FormatHelper.Format(documentData.Created.Value)
                    : FormatHelper.Format(DateTime.Now.Date),
                User = IDBContext.Current.UserName,
                Url  = MW.Domain.EntityHelpers.DownloadDocumentHelper.GetDocumentLink(documentNumber)
            };

            var result = Json(new { data = document }, JsonRequestBehavior.AllowGet);

            return(result);
        }