コード例 #1
0
        private void dgvProveedores_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (modo != "user")
            {
                try
                {
                    DataGridViewRow  row = this.dgvProveedores.SelectedRows[0];
                    FrmEdProveedores frm = new FrmEdProveedores();
                    frm.ID           = row.Cells[0].Value.ToString();
                    frm.Nombre       = row.Cells[1].Value.ToString();
                    frm.Cedula       = row.Cells[2].Value.ToString();
                    frm.Tipo_Persona = row.Cells[3].Value.ToString();
                    frm.Balance      = row.Cells[4].Value.ToString();
                    frm.Estado       = row.Cells[5].Value.ToString();
                    frm.modo         = "U";
                    frm.conn         = conn;

                    frm.ShowDialog();
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Error al editar registro " + ex.Message);
                }
            }
        }
コード例 #2
0
        private void cmdAgregar_Click(object sender, EventArgs e)
        {
            FrmEdProveedores ff = new FrmEdProveedores();

            ff.modo = "C";
            ff.conn = conn;
            ff.ShowDialog();
        }