Ejemplo n.º 1
0
        public IActionResult Evaluation()
        {
            var cacheKey = "bookingList";

            if (!_memoryCache.TryGetValue(cacheKey, out bookingList))
            {
                return(View());
            }
            ;
            var controller = new EvaluationController();

            return(View(controller.Evaluation(bookingList)));
        }
Ejemplo n.º 2
0
        public IActionResult exportData(string cKey)
        {
            string _filename;
            object obj;
            string json;

            if (cKey == "eva")
            {
                var controller = new EvaluationController();
                List <ConnectorTypeEvaluationViewModel> EvaList = controller.Evaluation(getBookingList());
                _filename = "evaluation";
                obj       = EvaList;
            }
            else
            {
                _filename = "bookings";
                obj       = getBookingList();
            }
            json = JsonSerializer.Serialize(obj, options);
            string filename = string.Concat(DateTime.Now.ToString("yyyyddMM"), _filename, "-exported", ".json");

            //System.IO.File.WriteAllText($"wwwroot/APP_DATA/{filename}", json);
            return(download(filename, json));
        }