private void btnNovo_Click(object sender, EventArgs e) { IUContrato tela = new IUContrato(0, this, null); tela.Show(); this.Hide(); }
private void dgvDados_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { int id = Convert.ToInt32(dgvDados.Rows[e.RowIndex].Cells[0].Value.ToString()); IUContrato tela = new IUContrato(id, this, null); tela.Show(); this.Hide(); }
public IUServico(int id, Form lista, IUContrato contr, IUConfigMovimento config) { InitializeComponent(); oDAO = new ServicoDAO(); obj = new Servicos(); this.lista = lista; this.contr = contr; this.config = config; cboTipoCobranca.SelectedIndex = 0; if (id != 0) { obj = oDAO.GetById(id); txtIdServico.Text = obj.Idservico.ToString(); txtDescricao.Text = obj.Descricao; txtQuantidade.Value = obj.Quantidade; txtVCarro.Text = obj.ValorCarro.ToString(); txtVMoto.Text = obj.ValorMoto.ToString(); txtVOutros.Text = obj.ValorOutros.ToString(); chkAtivo.Checked = (obj.Ativo == 1) ? true : false; switch (obj.TipoCobranca) { case 'H': { cboTipoCobranca.SelectedIndex = 0; break; } case 'I': { cboTipoCobranca.SelectedIndex = 1; break; } case 'D': { cboTipoCobranca.SelectedIndex = 2; break; } case 'M': { cboTipoCobranca.SelectedIndex = 3; break; } } btnLimpar.Enabled = false; } }
private void btnEditar_Click(object sender, EventArgs e) { if (dgvDados.SelectedRows.Count == 1) { int id = Convert.ToInt32(dgvDados.CurrentRow.Cells[0].Value.ToString()); IUContrato tela = new IUContrato(id, this, null); tela.Show(); this.Hide(); } else { MessageBox.Show("Selecione apenas um Registro!!!"); } }
public BuscaServico(IUContrato contr, IUConfigMovimento config) { InitializeComponent(); this.contr = contr; this.config = config; }