private void button1_Click(object sender, EventArgs e)
        {
            DataTable DT = new DataTable();

            DT = this.cp.Proveedores_RUC(textBoxRuc.Text);
            if (cp.existeProveedor((this.textBoxRuc.Text), "RUC").Equals("vacio"))
            {
                MessageBox.Show("Proveedor no se encuentra registrado");
                this.textBoxRuc.Text                  = "";
                this.textBoxRuc.Text                  = "";
                this.textBoxRazonSocial.Text          = "";
                this.textBoxMarca.Text                = "";
                this.textBoxCorreo.Text               = "";
                this.textBoxTelefonoConvencional.Text = "";
                this.textBoxTelefonoCelular.Text      = "";
            }
            else
            {
                this.textBoxRazonSocial.Text          = DT.Rows[0].ItemArray[1].ToString();
                this.textBoxMarca.Text                = DT.Rows[0].ItemArray[2].ToString();
                this.textBoxCorreo.Text               = DT.Rows[0].ItemArray[3].ToString();
                this.textBoxTelefonoConvencional.Text = DT.Rows[0].ItemArray[4].ToString();
                this.textBoxTelefonoCelular.Text      = DT.Rows[0].ItemArray[5].ToString();
                this.botonEliminar.Enabled            = true;
            }
        }
Beispiel #2
0
        private void botonIngresar_MouseClick_1(object sender, MouseEventArgs e)
        {
            String           ruc         = this.textBoxRuc.Text;
            String           razonSocial = this.textBoxRazonSocial.Text;
            String           direccion   = this.textBoxDireccion.Text;
            String           correo      = this.textBoxCorreo.Text;
            String           telfconv    = this.textBoxTelefonoConvencional.Text;
            String           telfCel     = this.textBoxTelefonoCelular.Text;
            controlProveedor cp          = new controlProveedor();

            if (cp.existeProveedor((this.textBoxRuc.Text), "RUC").Equals("vacio"))
            {
                cp.RregistrarProveedor(ruc, razonSocial, direccion, correo, telfconv, telfCel);
                //MessageBox.Show("Proveedor registrado correctamente");
                textBoxCorreo.Text               = "";
                textBoxRazonSocial.Text          = "";
                textBoxDireccion.Text            = "";
                textBoxRuc.Text                  = "";
                textBoxTelefonoCelular.Text      = "";
                textBoxTelefonoConvencional.Text = "";
            }
            else
            {
                MessageBox.Show("Proveedor ya se encuentra registrado");
            }
        }
Beispiel #3
0
 private void botonConsultar_Click(object sender, EventArgs e)
 {
     if (cp.existeProveedor((this.textCorreoProveedor.Text), "correo").Equals("vacio"))
     {
         MessageBox.Show("Proveedor no se encuentra registrado");
         this.textCorreoProveedor.Text = "";
     }
     else
     {
         cargarTabla();
     }
 }
Beispiel #4
0
 private void textRuc_Leave(object sender, EventArgs e)
 {
     if (v.RucPersonaNatural(textBoxRuc.Text))
     {
         if (!cp.existeProveedor((this.textBoxRuc.Text), "RUC").Equals("vacio"))
         {
             MessageBox.Show("Proveedor ya se encuentra registrado");
             return;
         }
     }
     else
     {
         if (this.botonRegresar.Focused)
         {
             this.Visible = false;
             mp.Visible   = true;
         }
         else
         {
             if (textBoxRuc.Text == String.Empty)
             {
                 MessageBox.Show("Ingrese un valor para la entrada actual");
             }
             else
             {
                 if (textBoxRuc.TextLength < 13)
                 {
                     MessageBox.Show("Número de RUC incompleto");
                     textBoxTelefonoCelular.Enabled      = false;
                     textBoxTelefonoConvencional.Enabled = false;
                     textBoxRazonSocial.Enabled          = false;
                     textBoxCorreo.Enabled    = false;
                     textBoxDireccion.Enabled = false;
                 }
                 else
                 {
                     MessageBox.Show("RUC incorrecto");
                 }
             }
         }
     }
 }