Пример #1
0
        public App()
        {
            MessagingCenter.Subscribe <InicioSesion>(this, "Autenticado", (sender) =>
            {
                Sesion();
            });

            MessagingCenter.Subscribe <CambioContrasenia>(this, "Autenticado", (sender) =>
            {
                Sesion();
            });

            MessagingCenter.Subscribe <MiPerfil>(this, "NoAutenticado", (sender) =>
            {
                Settings.session_access_token  = String.Empty;
                Settings.session_token_type    = String.Empty;
                Settings.session_refresh_token = String.Empty;
                Settings.session_expires_in    = String.Empty;
                Settings.session_scope         = String.Empty;
                Settings.session_carne         = String.Empty;
                Settings.session_nombre        = String.Empty;
                Settings.session_role          = string.Empty;
                MainPage = new InicioSesion();
            });

            ManejadorDatos = new ManejadorDatos(new ServicioWeb());
            if (string.IsNullOrEmpty((Settings.session_access_token)))
            {
                MainPage = new InicioSesion();
            }
            else
            {
                MainPage = new PrincipalTP();
            }
        }
Пример #2
0
        public App()
        {
            MessagingCenter.Subscribe <Views.Menu.MainPage>(this, "noAutenticado", (sender) =>
            {
                MainPage = new LoginPage();
            });

            MessagingCenter.Subscribe <LoginPage>(this, "Autenticado", (sender) =>
            {
                MainPage = new MainPage();
                MessagingCenter.Send <App>(this, "Autenticado");
            });

            MessagingCenter.Subscribe <Registro>(this, "Autenticado", (sender) =>
            {
                MainPage = new MainPage();
                MessagingCenter.Send <App>(this, "Autenticado");
            });

            MessagingCenter.Subscribe <Forget>(this, "Autenticado", (sender) =>
            {
                MainPage = new MainPage();
                MessagingCenter.Send <App>(this, "Autenticado");
            });

            ManejadorDatos = new ManejadorDatos(new DataStore());
            Task.Run(() => CargaInicial());
            if (!string.IsNullOrEmpty(Settings.session_access_token))
            {
                MainPage = new MainPage();
            }
            else
            {
                MainPage = new TutorialPage();
            }


            DependencyService.Get <IService>().Start();
            Constants.FechaInicio = DateTime.Now;
            Constants.FechaFinal  = DateTime.Now.AddMinutes(5);


            MessagingCenter.Subscribe <string>(this, "hello", async sender =>
            {
                System.Diagnostics.Debug.WriteLine(sender);
                RegistarIncidente Peticion = new RegistarIncidente()
                {
                    duracion     = new Random().Next(1, 100),
                    fechaInicio  = Constants.fechaInicioIncidencia,
                    idaccion     = new Random().Next(1, 5),
                    idaplicacion = Constants.idAplicacionIncidencia,
                    idevento     = 16,
                };
                RegistarIncidenteResponse Respuesta = await ManejadorDatos.RegistrarIncidenteAsync(Peticion);
            });
        }
Пример #3
0
        public App()
        {
            MessagingCenter.Subscribe <Pages.Menu.Menu>(this, "logout", (sender) =>
            {
                MainPage = new Login();
            });
            MessagingCenter.Subscribe <Login>(this, "Login", (sender) =>
            {
                MainPage = new RootPagina();
                Settings.session_Session_Token = "1";
                Settings.session_idUsuario     = "1";
            });

            MessagingCenter.Subscribe <LoginVerificacion>(this, "Login", (sender) =>
            {
                MainPage = new RootPagina();
                Settings.session_Session_Token = "1";
                Settings.session_idUsuario     = "1";
            });


            if (string.IsNullOrEmpty(Settings.session_SubscriptionKey))
            {
                Settings.session_SubscriptionKey = Constantes.SubscriptionKey;
            }

            if (string.IsNullOrEmpty(Settings.session_MetodoPago))
            {
                Settings.session_MetodoPago = "tarjeta";
            }

            ManejadorDatos = new ManejadorDatos(new ServicioWeb());

            if (!string.IsNullOrEmpty(Settings.session_Session_Token))
            {
                MainPage = new RootPagina();
            }
            else
            {
                MainPage = new Login();
            }
        }