コード例 #1
0
 private void btnGuardar_Click(object sender, EventArgs e)
 {
     if (x == 0)
     {
         if (!txtNombre.Text.Equals("") && !txtCor.Text.Equals("") && !txtTel.Text.Equals("") && !txtUbi.Text.Equals(""))
         {
             if (SQLCONN.NewProv(txtNombre.Text, txtTel.Text, txtTel.Text, txtUbi.Text))
             {
                 MessageBox.Show("Proveedor agregado");
                 dataGridView1.DataSource = SQLCONN.getprov();
                 clear();
                 habi(false);
             }
         }
         else
         {
             MessageBox.Show("Llene todos los campos");
         }
     }
     else
     {
         if (!txtNombre.Text.Equals("") && !txtCor.Text.Equals("") && !txtTel.Text.Equals("") && !txtUbi.Text.Equals(""))
         {
             if (SQLCONN.UpProv(txtNombre.Text, txtTel.Text, txtCor.Text, txtUbi.Text, dataGridView1.CurrentRow.Cells[0].Value.ToString()))
             {
                 MessageBox.Show("Proveedor Actualizado");
                 dataGridView1.DataSource = SQLCONN.getprov();
                 habi(false);
             }
         }
     }
 }
コード例 #2
0
        private void button4_Click(object sender, EventArgs e)
        {
            if (!txtNombre.Text.Equals("") && !txtCor.Text.Equals("") && !txtTel.Text.Equals("") && !txtUbi.Text.Equals(""))
            {
                String id = dataGridView1.CurrentRow.Cells[0].Value.ToString();
                if (SQLCONN.delprov(id))
                {
                    MessageBox.Show("Proveedor eliminado");

                    dataGridView1.DataSource = SQLCONN.getprov();
                }
            }
            else
            {
                MessageBox.Show("Seleccione un proveedor");
            }
        }
コード例 #3
0
 public proveedores()
 {
     InitializeComponent();
     dataGridView1.DataSource = SQLCONN.getprov();
     habi(false);
 }