private void Page_Loaded(object sender, RoutedEventArgs e)
 {
     TIMPORTE.Focus();
     BVOUCHER.Visibility           = Visibility.Hidden;
     imgEmailFirmaPanel.Visibility = Visibility.Hidden;
     LREFERENCIA.Content           = TypeUsuario.reference;
 }
        private void BSIGUIENTE_Click(object sender, RoutedEventArgs e)
        {
            BCOBRAR.Visibility  = Visibility.Visible;
            BVOUCHER.Visibility = Visibility.Hidden;

            if (string.IsNullOrWhiteSpace(TIMPORTE.Text))
            {
                Globales.MessageBoxMit("Ingrese un importe");
                TIMPORTE.Focus();
                return;
            }
            TREFERENCIA.Focus();
            double max     = 0.0;
            string propMax = Globales.GetDataXml("pcPropinaMax", TypeUsuario.CadenaXML);

            this.importe = double.Parse(this.TIMPORTE.Text);
            double importe_mas_propina = double.Parse(this.TTOTAL.Text);

            if (propMax != "LIBRE" && propMax != "")
            {
                double dPropmax = double.Parse(propMax);
                max = Math.Round(double.Parse(this.TIMPORTE.Text) * (dPropmax / 100));
                if (importe_mas_propina > max)
                {
                    Globales.MessageBoxMit(string.Format("El máximo de propina permitido es del {0} por favor verifique y vuelva a intentar", propMax));
                }
            }
            if (string.IsNullOrWhiteSpace(this.TTOTAL.Text))
            {
                Globales.MessageBoxMit("El total de importe no es válido.");
            }
            else
            {
                this.TCBODY.SelectedItem = this.TITEMCOBRO;
                this.TTOTALPAGO.Text     = this.TTOTAL.Text;
                this.TTOTALPAGO.Focus();
                this.propina_total = Math.Round(importe_mas_propina - this.importe, 2);
                //BSIGUIENTE.Visibility = Visibility.Hidden;
                TREFERENCIA.Focus();
                //BVOUCHER.Visibility = Visibility.Visible;
            }
        }
        private void OPT0_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrWhiteSpace(TIMPORTE.Text))
            {
                OPT0.IsChecked = true;
                Globales.MessageBoxMit("Ingrese un importe");
                TOTRO.IsEnabled = false;
                TIMPORTE.Focus();
                return;
            }
            string name  = ((RadioButton)sender).Name;
            double total = double.Parse(this.TIMPORTE.Text);

            this.TOTRO.Text      = string.Empty;
            this.TOTRO.IsEnabled = false;
            switch (name)
            {
            case "OPT0":
                if ((bool)this.OPT0.IsChecked)
                {
                    this.TTOTAL.Text = this.TIMPORTE.Text;
                }
                break;

            case "OPT5":
                if ((bool)this.OPT5.IsChecked)
                {
                    this.TTOTAL.Text = Globales.importe(Convert.ToString(Math.Round(total + (total * .05), 2)));
                }

                break;

            case "OPT10":
                if ((bool)this.OPT10.IsChecked)
                {
                    this.TTOTAL.Text = Globales.importe(Convert.ToString(Math.Round(total + (total * .10), 2)));
                }
                break;

            case "OPT15":
                if ((bool)this.OPT15.IsChecked)
                {
                    this.TTOTAL.Text = Globales.importe(Convert.ToString(Math.Round(total + (total * .15), 2)));
                }
                break;

            case "OPT20":
                if ((bool)this.OPT20.IsChecked)
                {
                    this.TTOTAL.Text = Globales.importe(Convert.ToString(Math.Round(total + (total * .20), 2)));
                }
                break;

            case "OPTOTRO":
                if ((bool)this.OPTOTRO.IsChecked)
                {
                    this.TTOTAL.Text     = string.Empty;
                    this.TOTRO.IsEnabled = true;
                    this.TOTRO.Focus();
                }
                break;
            }
            if (name != "OPTOTRO")
            {
                this.BSIGUIENTE.Focus();
            }
        }