コード例 #1
0
        public IActionResult ShowFile(string pid, string fid)
        {
            DSActions dsa     = new DSActions(_env);
            var       fi      = dsa.GetFileInfo(fid);
            var       url     = HttpContext.Request.Host.ToString();
            string    fileurl = "https://" + url + fi["path"];

            ViewBag._file    = fileurl;
            ViewBag._doctype = fi["type"];

            var docinfo = dsa.GetFileProperties(pid, fid);
            var _html   = docinfo.html;

            if (docinfo.Count > 0)
            {
                if (fi["type"].ToString() == "UNKNOWN")
                {
                    _html += "<a class='btn btn-primary float-right ml-2' href='/classify/" + pid + "/" + fid + "/" + docinfo[0].docProps["doc.type"].Value.ToString() + "'>Accept Classification</a>";
                }
                else
                {
                    _html += "<a class='btn btn-primary float-right ml-2' href='/classify/" + pid + "/" + fid + "/" + docinfo[0].docProps["doc.type"].Value.ToString() + "'>Update Classification</a>";
                }
            }

            ViewBag._html = _html;
            ViewBag.pID   = pid;
            ViewBag.fID   = fid;
            return(View("File"));
        }
コード例 #2
0
        public IActionResult DeletePortfolio(string pid)
        {
            DSActions dsa = new DSActions(_env);

            ViewBag._ds = dsa.DelPortfolio(pid);
            return(View("Index"));
        }
コード例 #3
0
        public IActionResult Save(string pName, string cName)
        {
            DSActions dsa = new DSActions(_env);

            ViewBag._ds = dsa.SavePortfolio(pName, cName);
            return(View("Index"));
        }
コード例 #4
0
        public IActionResult Index()
        {
            DSActions dsa = new DSActions(_env);

            ViewBag._ds = dsa.GetDataSet();
            return(View());
        }
コード例 #5
0
        public IActionResult Files(string id)
        {
            DSActions dsa = new DSActions(_env);

            ViewBag._ds = dsa.GetDataSet();
            ViewBag.pID = id;
            return(View());
        }
コード例 #6
0
        public IActionResult DeleteFile(string pid, string fid)
        {
            DSActions dsa = new DSActions(_env);

            ViewBag._ds = dsa.DeleteFile(pid, fid);
            ViewBag.pID = pid;
            return(View("Files"));
        }
コード例 #7
0
        public IActionResult upload(string id)
        {
            //List<IFormFile> files
            var       files = Request.Form.Files;
            DSActions dsa   = new DSActions(_env);

            dsa.SaveFiles(id, files);
            ViewBag._ds = dsa.GetDataSet();
            ViewBag.pID = id;
            return(View("Files"));
        }
コード例 #8
0
        public IActionResult SaveFileClassification(string pid, string fid, string ftype)
        {
            DSActions dsa = new DSActions(_env);
            var       fi  = dsa.SaveFileClassification(fid, ftype);

            ViewBag._file    = fi["path"];
            ViewBag._doctype = fi["type"];
            string _html = "<h5 class='text-warning'>Document Classified as : <span class='text-success'>" + fi["type"].ToString() + "</span></h5>";

            ViewBag._html = _html;
            ViewBag.pID   = pid;
            ViewBag.fID   = fid;
            return(View("File"));
        }
コード例 #9
0
        public IActionResult CheckFileCompliance(string pid, string fid)
        {
            DSActions dsa     = new DSActions(_env);
            var       fi      = dsa.GetFileInfo(fid);
            var       url     = HttpContext.Request.Host.ToString();
            string    fileurl = "https://" + url + fi["path"];

            ViewBag._file    = fileurl;
            ViewBag._doctype = fi["type"];

            ViewBag._html = dsa.CheckFileProperties(pid, fid);
            ViewBag.pID   = pid;
            ViewBag.fID   = fid;
            return(View("File"));
        }
コード例 #10
0
        public IActionResult ClassifyFile(string pid, string fid)
        {
            DSActions dsa = new DSActions(_env);
            var       fi  = dsa.GetFileInfo(fid);

            ViewBag._file = fi["path"];

            docu3cAPIClient d3      = new docu3cAPIClient();
            var             url     = HttpContext.Request.Host.ToString();
            string          fileurl = "https://" + url + fi["path"];

            //Used for testing ONLY.
            //fileurl = "https://docworksweb.azurewebsites.net/data/1593383499/ACC_XFR_Abraham%20C%20Diaz_.pdf";

            var docinfo = d3.ClassifyDocument("comp", fileurl);

            docinfo.html = docu3cAPIClient.SetDocHTML(docinfo);

            dsa.SaveFileProperties(pid, fid, docinfo);

            var _html = docinfo.html;

            if (docinfo.Count > 0)
            {
                if (fi["type"].ToString() == "UNKNOWN")
                {
                    _html += "<a class='btn btn-primary float-right ml-2' href='/classify/" + pid + "/" + fid + "/" + docinfo[0].docProps["doc.type"].Value.ToString() + "'>Accept Classification</a>";
                }
                else
                {
                    _html += "<a class='btn btn-primary float-right ml-2' href='/classify/" + pid + "/" + fid + "/" + docinfo[0].docProps["doc.type"].Value.ToString() + "'>Update Classification</a>";
                }
            }

            ViewBag._html = _html;
            ViewBag.pID   = pid;
            ViewBag.fID   = fid;
            return(View("File"));
        }