Пример #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)));
        }
Пример #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here
            SetContentView(Resource.Layout.PanelDeVenta);

            panelVenta = new ModelPanelVenta(this);
            Entorno.Instancia.Vista.PanelVentas = panelVenta;

            SolicitudIniciarSesion solicitud2 = new SolicitudIniciarSesion(Redsis.EVA.Client.Core.Enums.Solicitud.IniciarSesion, "1010", "1010");

            //SolicitudPanelVenta solicitudPanel = new SolicitudPanelVenta(Redsis.EVA.Client.Core.Enums.Paneles.PanelVenta);

            ISharedPreferences preferences = PreferenceManager.GetDefaultSharedPreferences(this);
            String             orientation = preferences.GetString("Orientation", "");

            if (orientation.Equals("1"))
            {
                SetContentView(Resource.Layout.PanelDeVenta);
            }
            else
            {
                SetContentView(Resource.Layout.PanelDeVenta2);
            }

            FragmentoBotoneraPrincipal fragmentoBotoneraPrincipal = new FragmentoBotoneraPrincipal("principal");

            FragmentoConfiguration fragmentoConfiguration = new FragmentoConfiguration();

            fragmentoConfiguration.AddFragment(Resource.Id.fragment_container, fragmentoBotoneraPrincipal, "BotoneraPrincipal", FragmentManager);
            fragmentoConfiguration.AddFragment(Resource.Id.numberPadFragment, new FragmentoNumberPad(), "NumberPad", FragmentManager);
            fragmentoConfiguration.AddFragment(Resource.Id.operatorView, new FragmentoVistaOperador(), "VistaOperador", FragmentManager);

            panel = FindViewById <FrameLayout>(Resource.Id.panel);
        }