Ejemplo n.º 1
0
        private void FuncionesBotones(String botonAction, Boton boton)
        {
            FragmentoConfiguration fragmentoConfiguration = new FragmentoConfiguration();

            String regexCodigoDato = "\\d.*\\d";
            Regex  regex           = new Regex(regexCodigoDato, RegexOptions.IgnoreCase);

            if (botonAction.Equals("Pagar"))
            {
                Intent intent = new Intent(Activity, typeof(PanelDePago));
                StartActivity(intent);
            }
            //Algunos volver en ciertos teclados cierran un fragment, no una actividad
            //los que tengan Label vacío cierran fragment, los que no, cierran actividades
            else if (botonAction.Equals("Volver") && boton.getLabel().Length == 0)
            {
                Fragment fragmentoBotoneraPrincipal = FragmentManager.FindFragmentByTag("BOTONERA_PRINCIPAL");
                fragmentoConfiguration.removeFragment(fragmentoBotoneraPrincipal, FragmentManager);
            }
            else if (botonAction.Equals("Volver"))
            {
                Activity.Finish();
            }
            else if (boton.getCategorias().Equals("Categorias"))
            {
                FragmentoBotoneraPrincipal fragmentoBotoneraPrincipal = new FragmentoBotoneraPrincipal(boton.getDato());

                fragmentoConfiguration.replaceFragments(fragmentoBotoneraPrincipal, Resource.Id.fragment_container, "BOTONERA_PRINCIPAL", FragmentManager);
                Toast.MakeText(Application.Context, boton.getDato(), ToastLength.Short).Show();
            }
            //Si un boton posee un dato, y ese dato posee solo números, se trata de un PRODUCTO
            //Se usa la expresión regular declarada arriba y se compara con el dato de un botón
            else if (regex.Match(boton.getDato()).Success)
            {
                AccionBotonArticulo(boton);
            }
            boton.GetButtonLayout().SetBackgroundColor(new Android.Graphics.Color(Application.Context.GetColor(Resource.Color.colorPrimaryDark)));
        }
Ejemplo n.º 2
0
        private void AccionBotonArticulo(Boton boton)
        {
            SolicitudAgregarArticulo agregarArticulo = new SolicitudAgregarArticulo(Solicitud.AgregarItem, boton.getDato());

            Reactor.Instancia.Procesar(agregarArticulo);
        }