Exemplo n.º 1
0
        public ActionResult HrDocs(string libraryName, string name, string folderPath)
        {

            var tempHrDocs = new HrDocs() { Name = name, LibraryName = libraryName, RelativePath = folderPath, };
            var hrDocs = HrDocsToHrDocsModel(HrDocsService.GetHrDocsItems(tempHrDocs));

            ViewBag.UploadPath = folderPath;
            ViewBag.LibraryName = libraryName;
            ViewBag.Name = name;

            return hrDocs.HasTopView ? View("HrDocsTopView", hrDocs) : View(hrDocs);
        }
Exemplo n.º 2
0
 public byte[] GetFileStream(HrDocs hrDocs)
 {
     return HrDocsDao.GetFileStream(hrDocs);
 }
Exemplo n.º 3
0
 public HrDocs GetHrDocsItems(HrDocs hrDocs)
 {
     return HrDocsDao.GetHrDocsItems(hrDocs);
 }
Exemplo n.º 4
0
 public FileResult PdfViewer(string documentName, string libraryName, string folderPath)
 {
     var hrdocs = new HrDocs { FolderPath = folderPath, LibraryName = libraryName, Name = documentName };
     var data = HrDocsService.GetFileStream(hrdocs);
     return File(data, "application/pdf");
 }
Exemplo n.º 5
0
        public virtual ActionResult OpenDocument(string folderPath, string libraryName, string name)
        {
            var hrdocs = new HrDocs() { FolderPath = folderPath, LibraryName = libraryName, Name = name };
            var extenstionArr = name.Split('.');
            var contentType = (extenstionArr.Length > 0)
                ? MimeTypeMap.GetMimeType(extenstionArr[extenstionArr.Length - 1])
                : "text/plain";

            var data = HrDocsService.GetFileStream(hrdocs);
            return File(data, contentType, name);
        }
Exemplo n.º 6
0
        private HrDocsModel HrDocsToHrDocsModel(HrDocs item)
        {
            var hrdocmodel = HrDocModelItem(item);

            foreach (var child in item.HrChild)
            {
                var hrDocsChlid = HrDocModelItem(child);

                foreach (var subchild in child.HrChild)
                {
                    hrDocsChlid.HrChild.Add(HrDocModelItem(subchild));
                }

                hrdocmodel.HrChild.Add(hrDocsChlid);
            }

            return hrdocmodel;
        }
Exemplo n.º 7
0
 private HrDocsModel HrDocModelItem(HrDocs item)
 {
     return new HrDocsModel()
            {
                Name = item.Name,
                PageTitle = item.PageTitle,
                LibraryName = item.LibraryName,
                Description = item.Description,
                ContentType = item.ContentType,
                FolderPath = item.FolderPath,
                RelativePath = item.RelativePath,
                ImgSrc = item.ImgSrc,
                HrChild = new List<HrDocsModel>(),
                Comment = item.Comment,
                HasTopView = item.HasTopView
            };
 }