public void ClearItem() { try { txnREBA_Codigo.Text = "0"; cmbREBA_Tipo.ComboStrSelectedValue = null; txaENTC_CodTransportista.ClearValue(); mdtREBA_FecIni.NSFecha = null; mdtREBA_FecFin.NSFecha = null; mdtREBA_FecCalc.NSFecha = null; cmbTIPO_CodMnd.TiposSelectedValue = null; txnREBA_Valor.Value = (Decimal)0.00; txnREBA_CostoFlete.Value = (Decimal)0.00; txnREBA_CostoFleteDes.Value = (Decimal)0.00; txnREBA_LimiteInf.Value = (Decimal)0.00; txnREBA_LimiteSup.Value = (Decimal)0.00; txnREBA_ValorPorcentaje.Value = (Decimal)0.00; BSGRR_Paquetes.DataSource = null; BSGRR_Paquetes.ResetBindings(true); BSGRR_Contratos.DataSource = null; BSGRR_Contratos.ResetBindings(true); } catch (Exception ex) { Infrastructure.WinForms.Controls.Dialogos.MostrarMensajeError(Presenter.Title, "Ha ocurrido un error limpiando el item.", ex); } }
public void SetItem() { try { if (Presenter != null && Presenter.Item != null) { txnREBA_Codigo.Text = Presenter.Item.REBA_Codigo.ToString(); if (!String.IsNullOrEmpty(Presenter.Item.REBA_Tipo)) { cmbREBA_Tipo.ComboStrSelectedValue = Presenter.Item.REBA_Tipo; } if (Presenter.Item.ENTC_CodTransportista.HasValue) { txaENTC_CodTransportista.SetValue(Presenter.Item.ENTC_CodTransportista.Value); } mdtREBA_FecIni.NSFecha = Presenter.Item.REBA_FecIni; mdtREBA_FecFin.NSFecha = Presenter.Item.REBA_FecFin; mdtREBA_FecCalc.NSFecha = Presenter.Item.REBA_FecCalc; cmbTIPO_CodMnd.TiposSelectedValue = Presenter.Item.TIPO_CodMND; if (!String.IsNullOrEmpty(Presenter.Item.REBA_Tipo) && Presenter.Item.REBA_Tipo == "R") { txnREBA_Valor.Value = Presenter.Item.REBA_Valor; } else if (!String.IsNullOrEmpty(Presenter.Item.REBA_Tipo) && Presenter.Item.REBA_Tipo == "G") { txnREBA_ValorPorcentaje.Value = Presenter.Item.REBA_Valor; } else { txnREBA_Valor.Value = Presenter.Item.REBA_Valor; } if (Presenter.Item.REBA_CostoFlete.HasValue) { txnREBA_CostoFlete.Value = Presenter.Item.REBA_CostoFlete.Value; } if (Presenter.Item.REBA_CostoFleteDes.HasValue) { txnREBA_CostoFleteDes.Value = Presenter.Item.REBA_CostoFleteDes.Value; } if (Presenter.Item.REBA_LimiteInf.HasValue) { txnREBA_LimiteInf.Value = Presenter.Item.REBA_LimiteInf.Value; } if (Presenter.Item.REBA_LimiteSup.HasValue) { txnREBA_LimiteSup.Value = Presenter.Item.REBA_LimiteSup.Value; } BSGRR_Paquetes.DataSource = Presenter.Item.ListGRR_Paquetes; BSGRR_Paquetes.ResetBindings(true); BSGRR_Contratos.DataSource = Presenter.Item.ListGRR_Contratos; BSGRR_Contratos.ResetBindings(true); ConfigureGrid(); EnabledItem(); } HashFormulario = Infrastructure.Client.FormClose.FormValidateChanges.iniciarComparacionFormulario(this); } catch (Exception ex) { Infrastructure.WinForms.Controls.Dialogos.MostrarMensajeError(Presenter.Title, "Ha ocurrido un error seteando el item.", ex); } }