Ejemplo n.º 1
0
        public static ApiResponse LoadNotificationsSync(CoreDispatcher dispatcher, Action<ApiResponse> callback)
        {
            ApiManager manager = new ApiManager();
            manager.Callback = null;
            manager.AddParameter("method", "getNotifications");
            manager.AddParameter("event_id", "12");

            return manager.Execute();
        }
Ejemplo n.º 2
0
        public void SearchEncuesta(int idEvent)
        {
            ApiManager manager = new ApiManager();
            manager.Callback = CallCompleted;
            manager.AddParameter("method", "getSurveyQuestions");
            manager.AddParameter("event_id", idEvent.ToString());
            manager.AddParameter("quiztype_id", "2");
            manager.AddParameter("assist_id", SettingsManager.LoggedUserSingleton.id.ToString());
            //manager.AddParameter("random", new Random().Next(1000).ToString());

            manager.Execute(Dispatcher);
        }
Ejemplo n.º 3
0
        public MainPage()
        {
            this.InitializeComponent();

            this.NavigationCacheMode = NavigationCacheMode.Required;

            ApiManager manager = new ApiManager();
            manager.Callback = CallCompleted;
            manager.AddParameter("method", "getEventById");
            manager.AddParameter("id", "12");

            manager.Execute(Dispatcher);
        }
Ejemplo n.º 4
0
        public void SearchUser(string userCode)
        {
            SetAssistRequest request = new SetAssistRequest()
            {
                code = userCode,
                event_id = SettingsManager.EventSingleton.id,
                id = 0,
                status = 1
            };
            ApiManager manager = new ApiManager();
            manager.Callback = CallCompleted;
            manager.AddParameter("method", "setAssist");
            manager.AddParameter("entity", JsonConvert.SerializeObject(request));

            manager.Execute(Dispatcher);
        }
Ejemplo n.º 5
0
        public void PostConsulta(int idEvent)
        {
            ApiManager manager = new ApiManager();

            SetUserQuestionRequest entity = new SetUserQuestionRequest();

            entity.anonymous = (bool) chkAnonima.IsChecked ? 1 : 0;
            entity.assist_id = SettingsManager.LoggedUserSingleton.id;
            entity.des = txtMensaje.Text;
            entity.event_id = idEvent;
            entity.id = 0;
            entity.status = 0;

            manager.Callback = CallCompleted;
            manager.AddParameter("method", "setUserQuestion");
            manager.AddParameter("entity", JsonConvert.SerializeObject(entity));

            manager.Execute(Dispatcher);
        }
Ejemplo n.º 6
0
        public void GetEvent(int idEvent)
        {
            ApiManager manager = new ApiManager();
            manager.Callback = CallCompleted;
            manager.AddParameter("method", "getEventById");
            manager.AddParameter("id", idEvent.ToString());

            manager.Execute();

        }
Ejemplo n.º 7
0
        private void btnTrivia_Click(object sender, RoutedEventArgs e)
        {
            var dateDiff = DateTime.Now.Subtract(answerReceived);

            segundosEnResponder = int.Parse(Math.Round(dateDiff.TotalSeconds).ToString());

            BotonTrivia clickedButton = (BotonTrivia)sender;

            SetAnswerLogRequest request = new SetAnswerLogRequest()
            {
                event_id = SettingsManager.EventSingleton.id,
                aid = clickedButton.AnswerId,
                qid = clickedButton.QuestionId,
                anonymous = 0,
                anscorrect = (clickedButton.IsCorrect) ? 1 : 0,
                assist_id = SettingsManager.LoggedUserSingleton.id,
                delay = int.Parse(Math.Round(dateDiff.TotalMilliseconds).ToString())
            };

            ApiManager manager = new ApiManager();
            manager.BaseUrl = SettingsManager.EventSingleton.website;
            manager.Callback = SetAnswerCallCompleted;
            manager.AddParameter("method", "setAnswerLog");
            manager.AddParameter("entity", JsonConvert.SerializeObject(request));

            manager.Execute(Dispatcher);

        }
Ejemplo n.º 8
0
        public void GetTrivia()
        {
            stackOptions.Children.Clear();

            ApiManager manager = new ApiManager();
            manager.BaseUrl = SettingsManager.EventSingleton.website;

            manager.Callback = CallCompleted;
            manager.AddParameter("method", "getTrvQuestion");
            manager.AddParameter("event_id", SettingsManager.EventSingleton.id.ToString());
            manager.AddParameter("quiztype_id", "1");
            manager.AddParameter("assist_id", SettingsManager.LoggedUserSingleton.id.ToString());
            //manager.AddParameter("random", new Random().Next(1000).ToString());

            manager.Execute(Dispatcher);
        }
Ejemplo n.º 9
0
        public void SetEncuesta()
        {
            ApiManager manager = new ApiManager();
            List<SetSurveyLogs> respuestasEncuesta = ArmarRespuestas();

            if (respuestasEncuesta != null)
            {
                List<SetSurveyLogs> respuestas = respuestasEncuesta;
                manager.Callback = CallCompletedPost;
                manager.AddParameter("method", "setSurveyLogs");
                manager.AddParameter("entity", JsonConvert.SerializeObject(respuestas));

                manager.Execute(Dispatcher);
            }
            else
            {
                var dialog = new MessageDialog("Por favor conteste todas las preguntas.");
                dialog.ShowAsync();
            }
        }
Ejemplo n.º 10
0
        public void SearchSchecule(int idEvent)
        {
            ApiManager manager = new ApiManager();
            manager.Callback = CallCompleted;
            manager.AddParameter("method", "getSchedule");
            manager.AddParameter("event_id", idEvent.ToString());

            manager.Execute(Dispatcher);
        }