예제 #1
0
        private void botonGestionarMetodo_Click(object sender, RoutedEventArgs e)
        {
            Popup popup = new Popup();
            VerMetodoPagoPopup metodoPopup = new VerMetodoPagoPopup(popup);

            popup.Child  = metodoPopup;
            popup.IsOpen = true;
        }
        private async void botonAgregar_Click(object sender, RoutedEventArgs e)
        {
            DateTime dateTime  = new DateTime();
            string   fechaVenc = texBoxFechaVencimiento.Text + "-01";

            if (texBoxFechaVencimiento.Text.Length != 0 && textNumero.Text.Length != 0)
            {
                try
                {
                    dateTime = DateTime.ParseExact(fechaVenc, "yyyy-MM-dd", null);
                    MetodoPago metodo = new MetodoPago();
                    metodo.Marca            = comboMetodo.SelectionBoxItem.ToString();
                    metodo.Numero           = textNumero.Text;
                    metodo.FechaVencimiento = dateTime;
                    BufferUsuario.Usuario   = await servicioAei.agregarMetodoPagoAsync(metodo, BufferUsuario.Usuario);

                    if (BufferUsuario.Usuario != null)
                    {
                        popup.IsOpen = false;
                        Popup popupp           = new Popup();
                        VerMetodoPagoPopup ver = new VerMetodoPagoPopup(popupp);
                        popupp.IsOpen = true;
                        MessageDialog mensajeError = new MessageDialog("Operación exitosa");
                        mensajeError.ShowAsync();
                    }
                }
                catch
                {
                    MessageDialog mensajeError = new MessageDialog("Error en la fecha no tiene el formato indicada");
                    mensajeError.ShowAsync();
                }
            }
            else
            {
                MessageDialog mensajeError = new MessageDialog("Error todos los campos son obligatorios");
                mensajeError.ShowAsync();
            }
        }
        private async void botonAgregar_Click(object sender, RoutedEventArgs e)
        {
            DateTime dateTime = new DateTime();
            string fechaVenc = texBoxFechaVencimiento.Text + "-01";
            if (texBoxFechaVencimiento.Text.Length != 0 && textNumero.Text.Length != 0)
            {
                try
                {
                    dateTime = DateTime.ParseExact(fechaVenc, "yyyy-MM-dd", null);
                    MetodoPago metodo = new MetodoPago();
                    metodo.Marca = comboMetodo.SelectionBoxItem.ToString();
                    metodo.Numero = textNumero.Text;
                    metodo.FechaVencimiento = dateTime;
                    BufferUsuario.Usuario = await servicioAei.agregarMetodoPagoAsync(metodo, BufferUsuario.Usuario);
                    if (BufferUsuario.Usuario != null)
                    {
                        popup.IsOpen = false;
                        Popup popupp = new Popup();
                        VerMetodoPagoPopup ver = new VerMetodoPagoPopup(popupp);
                        popupp.IsOpen = true;
                        MessageDialog mensajeError = new MessageDialog("Operación exitosa");
                        mensajeError.ShowAsync();
                    }
                }
                catch
                {
                    MessageDialog mensajeError = new MessageDialog("Error en la fecha no tiene el formato indicada");
                    mensajeError.ShowAsync();
                }
            }
            else
            {
                MessageDialog mensajeError = new MessageDialog("Error todos los campos son obligatorios");
                mensajeError.ShowAsync();

            }
        }
예제 #4
0
 private void botonGestionarMetodo_Click(object sender, RoutedEventArgs e)
 {
     Popup popup = new Popup();
     VerMetodoPagoPopup metodoPopup = new VerMetodoPagoPopup(popup);
     popup.Child = metodoPopup;
     popup.IsOpen = true;
 }