Beispiel #1
0
        private void BTN_Nuevo_Cliente_Click(object sender, RoutedEventArgs e)
        {
            this.Hide();
            FRM_NuevoCliente paginaNC = new FRM_NuevoCliente();

            paginaNC.ShowDialog();
            this.Close();
        }
Beispiel #2
0
        private void btn_buscar_Click(object sender, RoutedEventArgs e)
        {
            string identificacion = txtCedula.Text;
            bool   esCedula       = identificacion.Length == 10;

            if (esCedula)
            {
                identificacion = identificacion + "001";
            }
            if (VERIFICA_IDENTIFICACION.VerificaIdentificacion(identificacion) == false || identificacion.Length < 13)
            {
                MessageBox.Show("Verifique identificación del cliente");
                return;
            }
            else
            {
                DataTable respuesta = clientes.BuscarPorCedula(txtCedula.Text);
                if (respuesta.Rows.Count > 0)
                {
                    var fila = respuesta.Rows[0].ItemArray;
                    idCliente         = fila[0].ToString();
                    txtNombre.Text    = fila[1].ToString();
                    txtTelefono.Text  = fila[3].ToString();
                    txtDireccion.Text = fila[4].ToString();
                    txtCorreo.Text    = fila[5].ToString();
                }
                else
                {
                    MessageBox.Show("Cliente no registrado, proceda a ingresar sus datos");
                    nuevoCliente = new FRM_NuevoCliente(this);
                    if (esCedula)
                    {
                        nuevoCliente.cmb_tipocliente.SelectedIndex = 0;
                    }
                    else
                    {
                        nuevoCliente.cmb_tipocliente.SelectedIndex = 1;
                    }
                    nuevoCliente.TXT_IDENTIFICACION_CLIENTE.Text = txtCedula.Text;
                    nuevoCliente.ShowDialog();
                }
                btnCF.IsEnabled = true;
            }
        }