Esempio n. 1
0
        public async void Firma()
        {
            string strPaso             = this.Requerimiento.Cpaso;
            string strCodCentroGestor  = this.Requerimiento.CcodCeCo;
            string strNumRequerimiento = Requerimiento.CnumRequerimiento.TrimEnd();

            bool res = await Application.Current.MainPage.DisplayAlert(
                "Firma",
                "Numero de Requerimiento: " + strNumRequerimiento.TrimEnd(),
                "Acepta", "Cancela");

            if (res == true)
            {
                strNumRequerimiento = Requerimiento.CnumRequerimiento.TrimEnd() +
                                      strPaso.TrimEnd() +
                                      Services.Helpers.UserSettings.CentroCosto_Gestor.TrimEnd();
                string url = "http://aplicacion.amsac.pe/aGESTION" +
                             "/api" +
                             "/Paso" +
                             "/" + strNumRequerimiento.TrimEnd();

                Services.WebService objS = new Services.WebService();
                var response             = objS.Get(url);
                var objME = Newtonsoft.Json.JsonConvert.DeserializeObject <Paso_Requerimiento>(response.Content);

                MainViewModel.GetInstance().Requerimientos = new RequerimientosViewModel(Services.Helpers.UserSettings.Empleado,
                                                                                         Services.Helpers.UserSettings.CentroCosto_Gestor
                                                                                         );
                await Application.Current.MainPage.Navigation.PushAsync(new RequerimientosPage());
            }
        }
        private String  VerificaUsuario(string strUsuario, string strContraseña)
        {
            string strLogUsuario  = "";
            string strCodEmpleado = "";

            if (strContraseña != "" || strUsuario != "")
            {
                Services.FN_CifradoDato objCifrado = new Services.FN_CifradoDato();

                strLogUsuario = strUsuario.TrimEnd();

                string url = "http://aplicacion.amsac.pe/aGESTION" +
                             "/api" +
                             "/Usuario" +
                             "/" + strLogUsuario.TrimEnd();

                Services.WebService objS = new Services.WebService();
                var response             = objS.Get(url);
                var objMU = Newtonsoft.Json.JsonConvert.DeserializeObject <Usuarios>(response.Content);


                if (objMU.tPasUsuario.TrimEnd() != "")
                {
                    string strClave = "";
                    strClave = objCifrado.Desencripta_Contraseña(objMU.tPasUsuario.TrimEnd(),
                                                                 objMU.tClaUsuario.Trim(),
                                                                 objMU.tVecUsuario
                                                                 );
                    if (strClave.TrimEnd() == strContraseña)
                    {
                        strCodEmpleado = objMU.cCodEmpleado;
                    }
                }
            }
            return(strCodEmpleado);
        }
Esempio n. 3
0
 protected override void OnStart()
 {
     _register   = _controller as RegisterController;
     _webService = _bootstrap.GetService(ServicesTypes.WebService) as Services.WebService;
 }
Esempio n. 4
0
        protected override void OnStart()
        {
            _webService = _bootstrap.GetService(ServicesTypes.WebService) as Services.WebService;

            input.text = _webService.GetUrl();
        }
        public async void Login()
        {
            if (string.IsNullOrEmpty(this.Usuario))
            {
                await Application.Current.MainPage.DisplayAlert(
                    "Error",
                    "Ingrese el Usuario.",
                    "Acepta");

                return;
            }

            if (string.IsNullOrEmpty(this.Password))
            {
                await Application.Current.MainPage.DisplayAlert(
                    "Error",
                    "Ingrese la Contraseña.",
                    "Acepta");

                this.Password = string.Empty;
                return;
            }

            this.isRunning = true;
            this.IsEnabled = false;

            string strCodEmpleado = this.VerificaUsuario(this.Usuario.ToUpper(), this.Password.ToUpper());

            if (string.IsNullOrEmpty(strCodEmpleado))
            {
                await Application.Current.MainPage.DisplayAlert(
                    "Error",
                    "Autentificación Invalida",
                    "Acepta");

                this.isRunning = false;
                this.IsEnabled = true;
                this.Password  = string.Empty;
                return;
            }

            string url = "http://aplicacion.amsac.pe/aGESTION" +
                         "/api" +
                         "/Empleado" +
                         "/" + strCodEmpleado.TrimEnd();

            Services.WebService objS = new Services.WebService();
            var response             = objS.Get(url);
            var objME = Newtonsoft.Json.JsonConvert.DeserializeObject <Empleados>(response.Content);

            this.isRunning = false;
            this.IsEnabled = true;

            if (this.IsRemember == false)
            {
                this.Usuario  = string.Empty;
                this.Password = string.Empty;
            }
            UserSettings.UserName           = this.Usuario;
            UserSettings.Password           = this.password;
            UserSettings.Empleado           = objME.CCodPersonal;
            UserSettings.CentroCosto_Gestor = objME.CCodCentroCosto;



            MainViewModel.GetInstance().Requerimientos = new RequerimientosViewModel(UserSettings.Empleado, UserSettings.CentroCosto_Gestor);
            await Application.Current.MainPage.Navigation.PushAsync(new RequerimientosPage());
        }
Esempio n. 6
0
 protected override void OnStart()
 {
     _webService = _bootstrap.GetService(ServicesTypes.WebService) as Services.WebService;
 }