private void FormMesas_Load(object sender, EventArgs e) { controle.MesaDB tabela = new controle.MesaDB(); tabela.consultar(bs); lbIdMesa.DataBindings.Add(new Binding("Text", bs, "idmesa")); lbVagas.DataBindings.Add(new Binding("Text", bs, "vagas")); Binding bStatus = new Binding("Text", bs, "status"); bStatus.Format += bStatus_Format; lbSituacao.DataBindings.Add(bStatus); }
private void btnEdit_Click(object sender, EventArgs e) { FormFichaMesa ficha = new FormFichaMesa(); ficha.Registro = (modelo.mesa)bs.Current; ficha.ShowDialog(); if (ficha.Registro != null) { controle.MesaDB tabela = new controle.MesaDB(); tabela.consultar(bs); bs.ResetBindings(false); } }
private void btnAdd_Click(object sender, EventArgs e) { FormFichaMesa ficha = new FormFichaMesa(); ficha.Registro = null; ficha.ShowDialog(); if (ficha.Registro != null) { controle.MesaDB tabela = new controle.MesaDB(); tabela.consultar(bs); bs.MoveLast(); bs.ResetBindings(false); } }