Beispiel #1
0
        public string Get([FromQuery(Name = "token")] string token, string identifier)
        {
            try {
                TeamManager teamManager = new TeamManager(Server.TeamServer.ObjectManager, Server.TeamServer.TokenIssuer.ValidateToken(token));
                Team        team        = teamManager.LookupTeam(identifier);

                return(ControllerUtils.SerializeObject(team, new List <string>(new string[] { "Identifier", "Name" })));
            }
            catch (Exception exception) {
                return("Error: " + exception.Message);
            }
        }
        public string Get([FromQuery(Name = "token")] string token, string identifier)
        {
            try {
                TaskManager     taskManager = new TaskManager(Server.TeamServer.ObjectManager, Server.TeamServer.TokenIssuer.ElevateToken(token));
                Model.Task.Task task        = taskManager.LookupTask(identifier);

                return(ControllerUtils.SerializeObject(task, new List <string>(new string[] { "Identifier", "Which", "What", "When", "Active" })));
            }
            catch (Exception exception) {
                return("Error: " + exception.Message);
            }
        }
Beispiel #3
0
        public string Get([FromQuery(Name = "token")] string token, string identifier)
        {
            try {
                SessionManager sessionManager = new SessionManager(Server.TeamServer.ObjectManager, Server.TeamServer.TokenIssuer.ValidateToken(token));
                Lap            lap            = sessionManager.LookupLap(identifier);

                return(ControllerUtils.SerializeObject(lap, new List <string>(new string[] { "Identifier", "Nr" })));
            }
            catch (Exception exception) {
                return("Error: " + exception.Message);
            }
        }
Beispiel #4
0
        public string Get([FromQuery(Name = "token")] string token, string identifier)
        {
            try {
                AccountManager accountManager = new AccountManager(Server.TeamServer.ObjectManager, Server.TeamServer.TokenIssuer.ElevateToken(token));
                Account        account        = accountManager.LookupAccount(identifier);

                return(ControllerUtils.SerializeObject(account, new List <string>(new string[] { "Identifier", "Name", "EMail", "Virgin", "Contract", "ContractMinutes", "AvailableMinutes" })));
            }
            catch (Exception exception) {
                return("Error: " + exception.Message);
            }
        }
Beispiel #5
0
        public string Get([FromQuery(Name = "token")] string token, string identifier)
        {
            try {
                SessionManager sessionManager = new SessionManager(Server.TeamServer.ObjectManager, Server.TeamServer.TokenIssuer.ValidateToken(token));
                Session        session        = sessionManager.LookupSession(identifier);

                return(ControllerUtils.SerializeObject(session, new List <string>(new string[] { "Identifier", "Name", "Duration", "Started", "Finished", "Car", "Track" })));
            }
            catch (Exception exception) {
                return("Error: " + exception.Message);
            }
        }