private void btnNovo_Click(object sender, EventArgs e) { frmServico frm = new frmServico(false, null); frm.ShowDialog(); AtualizaGrid(); }
private void UpdateCadastro() { try { var rowHandle = gridView1.FocusedRowHandle; var obj = gridView1.GetRowCellValue(rowHandle, "IDORDEM"); NOME = gridView1.GetRowCellValue(rowHandle, "NOME").ToString(); var status = gridView1.GetRowCellValue(rowHandle, "STATUS").ToString(); if (status == "F") { frmServico frm = new frmServico(true, obj.ToString()); frm.txtCodigoFcfo.Enabled = false; frm.simpleButton1.Enabled = false; frm.txtNomeCliente.Enabled = false; frm.txtSobrenome.Enabled = false; frm.txtDescricao.Enabled = false; frm.txtValorUnitario.Enabled = false; frm.txtQuantidade.Enabled = false; frm.txtValorTotal.Enabled = false; frm.txtTotalVenda.Enabled = false; frm.btnAdicionar.Enabled = false; frm.btnExcluir.Enabled = false; frm.txtObservacao.Enabled = false; frm.txtConclusao.Enabled = false; frm.btnOk.Enabled = false; frm.btnSalvar.Enabled = false; frm.btnSelecionaProduto.Enabled = false; frm.ShowDialog(); AtualizaGrid(); } else { frmServico frm = new frmServico(true, obj.ToString()); frm.ShowDialog(); AtualizaGrid(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }