Beispiel #1
0
        private void btnGuardar_Click_2(object sender, EventArgs e)
        {
            Cliente Clientes = new Cliente();

            if (txtNombre.Text == "" || txtApellido.Text == "" || txtCorreo.Text == "" || txtCel.Text == "" ||
                txtEdad.Text == "" || txtDomi.Text == "")
            {
                MessageBox.Show("Debe Completar Todos los Campos", "Advertencia", MessageBoxButtons.OK,
                                MessageBoxIcon.Exclamation);
            }
            else
            {
                Clientes.Apellido  = txtApellido.Text;
                Clientes.Nombre    = txtNombre.Text;
                Clientes.Edad      = Convert.ToInt64(txtEdad.Text);
                Clientes.Fecha     = dtpFecha.Value.ToShortDateString();
                Clientes.Domicilio = txtDomi.Text;
                Clientes.Tel       = txtTel.Text;
                Clientes.Cel       = txtCel.Text;
                Clientes.Correo    = txtCorreo.Text;

                int resultado = ClienteDAL.AgregarCliente(Clientes);

                if (resultado > 0)
                {
                    MessageBox.Show("Paciente Cargado Corerectamente", "Cargado", MessageBoxButtons.OK,
                                    MessageBoxIcon.Information);
                    btnActu2.Enabled = false;


                    limpiar();
                }

                else
                {
                    MessageBox.Show("No se pudo Cargar el Paciente", "Error al Cargar", MessageBoxButtons.OK,
                                    MessageBoxIcon.Exclamation);
                }
            }
        }
Beispiel #2
0
 public string AgregarCliente(tb_cliente reg)
 {
     return(cliente.AgregarCliente(reg));
 }