Exemplo n.º 1
0
        public FileResult downloadXfer(string id)
        {
            JObject xfer = DataFactory.GetXfer(id, directory);

            string dir      = FileFactory.ValidateDirectory(directory, XferFactory.FileType.Xfer);
            string fileName = id + XferFactory.GetTypeExtension(XferFactory.FileType.Xfer);
            string path     = dir + "\\";

            IFileProvider provider   = new PhysicalFileProvider(path);
            IFileInfo     fileInfo   = provider.GetFileInfo(fileName);
            var           readStream = fileInfo.CreateReadStream();
            var           mimeType   = "text/plain";

            return(File(readStream, mimeType, xfer.GetValue("name").ToString() + ".xfer"));
        }
Exemplo n.º 2
0
        private JObject GetOUMapping(string source, string destination)
        {
            string ouMapID = source + "-" + destination;

            JObject ouMapping = DataFactory.GetOUMapping(ouMapID, directory);

            JObject ouMapped = new JObject();

            if (ouMapping != null)
            {
                //TODO: Validate the ouMapping file with the ouSource and ouDest
                ouMapped = XferFactory.verifyOuMapping(ouMapping, source, destination, directory);
            }
            else
            {
                //Auto Map source and destination
                ouMapped = XferFactory.OUAutoMap(source, destination, directory);
            }

            return(ouMapped);
        }
Exemplo n.º 3
0
        public IActionResult LoadJobMeta(string id, string name, string source, string destination, string sourceType, string destinationType)
        {
            JObject ouLevels = DataFactory.GetOrgUnitLevels(source, directory);
            JObject jobs     = XferFactory.jobAutoMap(source, destination, sourceType, destinationType, directory);
            JObject job      = DataFactory.GetJob(id, directory);

            if (job != null)
            {
                JArray mappedJobs = (JArray)job.GetValue("jobs");
                jobs["mapped"] = mappedJobs;

                JObject meta = (JObject)job.GetValue("meta");
                ViewBag.meta = meta;
            }



            ViewBag.ouLevels = ouLevels;
            ViewBag.jobs     = jobs;

            return(PartialView("~/Views/Job/Partial/JobMeta.cshtml"));
        }