private void CamposInterface(Status status) { if (_FormaPgto == null) { _FormaPgto = new Dominio.FormaPagamento(); } TxtDescricao.Text = _FormaPgto.Descricao; if (status == Status.Inserindo) { this.EnabledCampos(true); LblStatus.Text = "Status : Inserindo"; } else if (status == Status.Editando) { this.EnabledCampos(true); LblStatus.Text = "Status : Editando"; } else if (status == Status.Excluindo) { this.EnabledCampos(false); LblStatus.Text = "Status : Excluindo"; } else { this.EnabledCampos(false); LblStatus.Text = "Status : Consultando"; } }
private void ctrNavigator1_CancelarAcao() { if (DGFormaPagamento.SelectedRows.Count > 0) { _FormaPgto = (Dominio.FormaPagamento)DGFormaPagamento.SelectedRows[0].DataBoundItem; } this.CamposInterface(Status.Consultando); }
private void DGFormaPagamento_SelectionChanged(object sender, EventArgs e) { if (this.DGFormaPagamento.Rows.Count > 0) { if (DGFormaPagamento.SelectedRows.Count > 0) { _FormaPgto = (Dominio.FormaPagamento)DGFormaPagamento.SelectedRows[0].DataBoundItem; if (ctrNavigator1.DataSource != null) { ctrNavigator1.Indice = DGFormaPagamento.SelectedRows[0].Index; } } } this.CamposInterface(Status.Consultando); }
private void ctrNavigator1_EventoNovo() { _FormaPgto = null; _FormaPgto = new Dominio.FormaPagamento(); this.CamposInterface(Status.Inserindo); }