Beispiel #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.PanelDeVenta);

            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("tecladoPagos");
            FragmentoConfiguration     fragmentos = new FragmentoConfiguration();

            fragmentos.AddFragment(Resource.Id.fragment_container, fragmentoBotoneraPrincipal, "BotoneraPrincipal", FragmentManager);
            fragmentos.AddFragment(Resource.Id.panel, new FragmentoPanelDePago(), "VistaOperador", FragmentManager);

            panel = FindViewById <FrameLayout>(Resource.Id.panel);
        }
Beispiel #2
0
        public void setGesture(MotionEvent e)
        {
            FragmentoConfiguration fragmentoConfiguration = new FragmentoConfiguration();
            bool tirillaDePagoShowing = FragmentIsShowing("TIRILLA_DE_PAGO");
            int  MIN_DISTANCE         = 500;

            switch (e.Action)
            {
            case MotionEventActions.Down:
                y1 = e.GetY();
                break;

            case MotionEventActions.Up:
                y2 = e.GetY();
                float deltaY = y2 - y1;
                if (Math.Abs(deltaY) > MIN_DISTANCE)
                {
                    if (y2 > y1 && !tirillaDePagoShowing)
                    {
                        FragmentoTirillaDePago fragmentoTirillaDePago = new FragmentoTirillaDePago();
                        fragmentoConfiguration.replaceFragments(fragmentoTirillaDePago, Resource.Id.panel, "TIRILLA_DE_PAGO", FragmentManager);
                    }
                    else if (y1 > y2 && tirillaDePagoShowing)
                    {
                        FragmentoTirillaDePago frag = (FragmentoTirillaDePago)FragmentManager.FindFragmentByTag("TIRILLA_DE_PAGO");
                        fragmentoConfiguration.removeFragment(frag, FragmentManager);
                    }
                }
                break;
            }
        }
        private void ShowTirillaDePago_Click(object sender, EventArgs e)
        {
            FragmentoConfiguration fragmentoConfiguration = new FragmentoConfiguration();

            if (!fragmentoConfiguration.fragmentIsShowing("TIRILLA_DE_PAGO", FragmentManager))
            {
                FragmentoTirillaDePago tirillaDePago = new FragmentoTirillaDePago();
                fragmentoConfiguration.replaceFragments(tirillaDePago, Resource.Id.panel, "TIRILLA_DE_PAGO", FragmentManager);
            }
        }
Beispiel #4
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)));
        }
Beispiel #5
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);
        }
Beispiel #6
0
        /*public void AddProductToTirilla()
         * {
         *  listaProductos = ((PanelDeVenta)this.Activity).articulosComprados;
         *
         *  var adapter = new TirillaCustomAdapter(((PanelDeVenta)this.Activity), listaProductos);
         *  productos.Adapter = adapter;
         * }
         */

        private void BackToPanel_Click(object sender, EventArgs e)
        {
            FragmentoConfiguration fragmentoConfiguration = new FragmentoConfiguration();

            fragmentoConfiguration.removeFragment(this, FragmentManager);
        }
Beispiel #7
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Use this to return your custom view for this Fragment
            // return inflater.Inflate(Resource.Layout.YourFragment, container, false);

            View rootView = inflater.Inflate(Resource.Layout.FragmentoNumberPad, container, false);

            Button but = rootView.FindViewById <Button>(Resource.Id.sell);

            int[] idButtons = { Resource.Id.number1, Resource.Id.number2,  Resource.Id.number3, Resource.Id.escape,
                                Resource.Id.number4, Resource.Id.number5,  Resource.Id.number6, Resource.Id.borrar,
                                Resource.Id.number7, Resource.Id.number8,  Resource.Id.number9, Resource.Id.multiplicar,
                                Resource.Id.number0, Resource.Id.number00, Resource.Id.punto,   Resource.Id.aceptar };

            List <Button>          numberButtons          = new List <Button>();
            FragmentoConfiguration fragmentoConfiguration = new FragmentoConfiguration();

            //Si la tirilla de pago NO se está mostrando, los botones no tienen funcionalidad así se corrige
            //el bug que causa que los botones funcionen aunque exista un fragment encima de ellos
            for (int index = 0; index < idButtons.Length; index++)
            {
                // Si el boton se encuentra en al posición 3,7,11 o 15, corresponde a una tecla de función
                // por lo tanto se le asigna la función que corresponda.
                // En cualquier otro caso, el botón corresponde a un número o signo, por lo que se agrega
                // la función que cambia el texto del artículo
                switch (index)
                {
                case 3:
                    break;

                case 7:
                    ImageButton buttonEsc = rootView.FindViewById <ImageButton>(idButtons[index]);
                    buttonEsc.Click += delegate
                    {
                        if (!fragmentoConfiguration.fragmentIsShowing("TIRILLA_DE_PAGO", FragmentManager))
                        {
                            ((PanelDeVenta)Activity).deleteArticleCodeText();
                        }
                    };
                    break;

                case 11:
                    break;

                case 15:
                    break;

                default:
                    Button button = rootView.FindViewById <Button>(idButtons[index]);
                    button.Click += delegate
                    {
                        if (!fragmentoConfiguration.fragmentIsShowing("TIRILLA_DE_PAGO", FragmentManager))
                        {
                            ((PanelDeVenta)this.Activity).updateArticleCodeText(button.Text);
                        }
                    };
                    break;
                }
            }



            return(rootView);
        }
Beispiel #8
0
        public Boolean FragmentIsShowing(string fragmentTag)
        {
            FragmentoConfiguration fragmentoConfiguration = new FragmentoConfiguration();

            return(fragmentoConfiguration.fragmentIsShowing(fragmentTag, FragmentManager));
        }