Beispiel #1
0
        public PartialViewResult Index([FromQuery(Name = "Id")] string Id)
        {
            Models.DataManager.DataManagaerView dataManagaerView = new Models.DataManager.DataManagaerView();
            dataManagaerView.Id = Id;

            string text = System.IO.File.ReadAllText(Location.ConfLocation);
            Conf   conf = JsonConvert.DeserializeObject <Conf>(text);

            TransformedData main = new TransformedData();

            main.Load(conf.TransformedDataPath + "\\" + Id + "\\main.csv");
            main.Table.RemoveAt(0);

            dataManagaerView.TransformedData = main;

            return(PartialView(dataManagaerView));
        }
Beispiel #2
0
        public PartialViewResult Index([FromQuery(Name = "Id")] string Id)
        {
            string text = System.IO.File.ReadAllText(Location.ConfLocation);
            Conf   conf = JsonConvert.DeserializeObject <Conf>(text);

            Models.App.AppView appView = new Models.App.AppView();
            appView.Id = Id;

            TransformedData transformedData = new TransformedData();

            transformedData.Load(conf.TransformedDataPath + "\\" + Id + "\\main.csv");
            FilterOptions filterOptions = transformedData.GetFilterOptions();

            appView.FilterOptions = filterOptions;
            appView.Max           = transformedData.getMaxValor();
            appView.Min           = transformedData.getMinValor();

            return(PartialView(appView));
        }
Beispiel #3
0
        public async Task <string> UploadConcatTransformedData([FromQuery(Name = "Id")] string Id)
        {
            string text = System.IO.File.ReadAllText(Location.ConfLocation);
            Conf   conf = JsonConvert.DeserializeObject <Conf>(text);

            var file     = Request.Form.Files[0];
            var filePath = Path.Combine(conf.TransformedDataPath + "/" + Id, "add.csv");

            using (var fileStream = new FileStream(filePath, FileMode.Create))
            {
                await file.CopyToAsync(fileStream);
            }

            TransformedData main = new TransformedData();

            main.Load(conf.TransformedDataPath + "\\" + Id + "\\main.csv");

            TransformedData add = new TransformedData();

            add.Load(conf.TransformedDataPath + "\\" + Id + "\\add.csv");

            main.Concat(add);

            System.IO.File.Delete(conf.TransformedDataPath + "\\" + Id + "\\main.csv");
            System.IO.File.Delete(conf.TransformedDataPath + "\\" + Id + "\\add.csv");

            string content = "";

            foreach (string[] line in main.Table)
            {
                content += string.Join(";", line) + Environment.NewLine;
            }

            System.IO.File.WriteAllText(conf.TransformedDataPath + "\\" + Id + "\\main.csv", content);

            return("ok");
        }