private void ConfigUI() { mzCEComprobanteTesoreria.ValueChanged += new System.EventHandler(this.mzCEComprobanteTesoreria_ValueChanged); string idValor = Convert.ToString(_row["IdValor"]); string idtdcomptesoreria = Convert.ToString(mzCEComprobanteTesoreria.Value); mz.erp.commontypes.data.tfi_ValoresExDataset data = (mz.erp.commontypes.data.tfi_ValoresExDataset)_data; mz.erp.businessrules.data.tfi_ValoresEx.GetVariablesAuxiliares(data, idValor, idtdcomptesoreria); this.gridEX1.DataSource = data.Pr_tfi_VariablesAuxiliaresWithValor_By_IdValorAndIdTDCompTesoreria; if (gridEX1.RowCount > 0) { gridEX1.Visible = true; lVariablesAuxiliares.Visible = true; this.gridEX1.CurrentTable.Columns[0].EditType = Janus.Windows.GridEX.EditType.NoEdit; this.gridEX1.CurrentTable.Columns[1].EditType = Janus.Windows.GridEX.EditType.NoEdit; this.gridEX1.CurrentTable.Columns[2].EditType = Janus.Windows.GridEX.EditType.NoEdit; } else { gridEX1.Visible = false; lVariablesAuxiliares.Visible = false; } if (_idTDCompTesoreria != "") { if (_idTDCompTesoreria.Equals(Constantes.IdBilletes)) { mzCEEntidad.Visible = false; txtNumero.Visible = false; //gridEX1.Enabled=true; txtFecha.Visible = false; txtFechaVencimiento.Visible = false; lNumero.Visible = false; lFechaVencimiento.Visible = false; lFecha.Visible = false; lEntidad.Visible = false; } else { mzCEEntidad.Visible = true; txtNumero.Visible = true; //gridEX1.Enabled=true; txtFecha.Visible = true; txtFechaVencimiento.Visible = true; lNumero.Visible = true; lFecha.Visible = true; lFechaVencimiento.Visible = true; lEntidad.Visible = true; } txtValor.Focus(); } }
protected override void FillControls() { if (_data != null) { try { mz.erp.commontypes.data.tfi_ValoresExDataset data = (mz.erp.commontypes.data.tfi_ValoresExDataset)_data; txtFecha.Text = Convert.ToString(_row["Fecha"]); if (( string )_row["IdTDCompTesoreria"] != "") { mzCEComprobanteTesoreria.Value = _idTDCompTesoreria; mzCEComprobanteTesoreria.Enabled = false; } txtNumero.Text = (string)_row["Numero"]; if ((( string )_row["IdEntidad"]) != "") { mzCEEntidad.Value = ( string )_row["IdEntidad"]; } txtFechaVencimiento.Text = Convert.ToString((System.DateTime)_row["FechaVencimiento"]); if (_defaultValue != 0) { if (_defaultValue < 0) { txtValor.Value = 0; } else { txtValor.Value = _defaultValue; } } else { txtValor.Value = Convert.ToDecimal(_row["Valor"]); } if ((( string )_row["IdMoneda"]) != "") { mzCEMoneda.Value = ( string )_row["IdMoneda"]; _idMoneda = ( string )_row["IdMoneda"]; mzCEMoneda.Enabled = false; } mz.erp.businessrules.data.tfi_ValoresEx.GetVariablesAuxiliares(data, (string)_row["IdValor"], (string)_row["IdTDCompTesoreria"]); this.gridEX1.DataSource = data.Pr_tfi_VariablesAuxiliaresWithValor_By_IdValorAndIdTDCompTesoreria; this.gridEX1.RootTable.Columns[0].EditType = Janus.Windows.GridEX.EditType.NoEdit; this.gridEX1.RootTable.Columns[1].EditType = Janus.Windows.GridEX.EditType.NoEdit; this.gridEX1.RootTable.Columns[2].EditType = Janus.Windows.GridEX.EditType.NoEdit; _valor = Factory.GetValor((string)_row["IdValor"], (string)mzCEComprobanteTesoreria.Value, (string)mzCEComprobanteTesoreria.Text, (string)mzCEMoneda.Value, (string)mzCEMoneda.Text, (string)mzCEEntidad.Value, mzCEEntidad.Text, txtNumero.Text, (DateTime)_row["Fecha"], (DateTime)_row["FechaVencimiento"], Convert.ToDecimal(txtValor.Value)); uneValorCotizado.Value = _valor.MontoCotizado; txtValor.Leave += new EventHandler(txtValor_Leave); uneValorCotizado.Leave += new EventHandler(uneValorCotizado_Leave); mzCEMoneda.ValueChanged += new EventHandler(mzCEMoneda_ValueChanged); } catch (Exception e) { Console.WriteLine(e.Message); ; } } }