Exemplo n.º 1
0
        public IActionResult NAVTestConnection()
        {
            Config  config = ConfigJSON.Read();
            NavSync sync   = new NavSync(_context, _mapper, _userManager, _roleManager, _cache, Configuration);
            var     result = sync.TestNavConnection();

            if (result is string && result != "Success")
            {
                return(StatusCode(500, result));
            }
            if (result.Count() > 0)
            {
                return(Ok(result));
            }
            else
            {
                return(StatusCode(500, result));
            }
        }
Exemplo n.º 2
0
        public IActionResult SchedulerStart(string name)
        {
            if (!string.IsNullOrEmpty(name))
            {
                NavSync    sync   = new NavSync(_context, _mapper, _userManager, _roleManager, _cache, Configuration);
                Type       t      = sync.GetType();
                MethodInfo method = t.GetMethod(name);
                var        result = (bool)method.Invoke(sync, null);

                if (result)
                {
                    return(Ok());
                }
                else
                {
                    return(StatusCode(500));
                }
            }
            return(StatusCode(400));
        }