Exemple #1
0
        public void SetItem(CAJ006LiquidacionAgentesPresenter.TBusqueda x_opcion)
        {
            try
            {
                if (!String.IsNullOrEmpty(Presenter.Item.LIQU_Estado))
                {
                    cmbLIQU_Estado.ConstantesSelectedValue = Presenter.Item.LIQU_Estado;
                }
                else
                {
                    cmbLIQU_Estado.SelectedIndex = 0;
                }
                if (!String.IsNullOrEmpty(Presenter.Item.LIQU_Codigo))
                {
                    txaLIQU_Codigo.AyudaValueChanged -= txaLIQU_Codigo_AyudaValueChanged;
                    txaLIQU_Codigo.SetValue(Presenter.Item.LIQU_Codigo, Presenter.Item.LIQU_Codigo);
                    txaLIQU_Codigo.AyudaValueChanged += txaLIQU_Codigo_AyudaValueChanged;
                }
                else
                {
                    txaLIQU_Codigo.AyudaValueChanged -= txaLIQU_Codigo_AyudaValueChanged;
                    txaLIQU_Codigo.ClearValue();
                    txaLIQU_Codigo.AyudaValueChanged += txaLIQU_Codigo_AyudaValueChanged;
                }
                if (!String.IsNullOrEmpty(Presenter.Item.LIQU_Glosa))
                {
                    txtLIQU_Glosa.Text = Presenter.Item.LIQU_Glosa;
                }
                else
                {
                    txtLIQU_Glosa.Clear();
                }
                if (Presenter.Item.ENTC_Codigo != null)
                {
                    txaENTC_Codigo.SetEntidad(Presenter.Item.ENTC_Codigo);
                } //else { txaENTC_Codigo.Clear(); }
                if (Presenter.Item.LIQU_Fecha != null)
                {
                    dtpLIQU_Fecha.NSFecha = Presenter.Item.LIQU_Fecha;
                }
                else
                {
                    dtpLIQU_Fecha.NSClear();
                }
                if (!String.IsNullOrEmpty(Presenter.Item.LIQU_Estado))
                {
                    cmbLIQU_Estado.ConstantesSelectedValue = Presenter.Item.LIQU_Estado;
                    switch (Presenter.Item.LIQU_Estado)
                    {
                    case "A":
                        cmbUnidadNegocio.Enabled = true;
                        txtLIQU_Glosa.ReadOnly   = false;
                        txaENTC_Codigo.Enabled   = true;
                        dtpLIQU_Fecha.Enabled    = true;
                        break;

                    case "C":
                        cmbUnidadNegocio.Enabled = false;
                        txtLIQU_Glosa.ReadOnly   = true;
                        txaENTC_Codigo.Enabled   = false;
                        dtpLIQU_Fecha.Enabled    = false;
                        break;

                    case "X":
                        cmbUnidadNegocio.Enabled = false;
                        txtLIQU_Glosa.ReadOnly   = true;
                        txaENTC_Codigo.Enabled   = false;
                        dtpLIQU_Fecha.Enabled    = false;
                        break;

                    default:
                        cmbUnidadNegocio.Enabled = false;
                        txtLIQU_Glosa.ReadOnly   = true;
                        txaENTC_Codigo.Enabled   = false;
                        dtpLIQU_Fecha.Enabled    = false;
                        break;
                    }
                }

                GetFiltros();
                Presenter.Actualizar(x_opcion, chkIncluirPendientes.Checked);
                //if (x_opcion == CAJ006LiquidacionAgentesPresenter.TBusqueda.Apertura)
                //{
                //    btnLiquidar.Enabled = true;
                //    btnAprobar.Enabled = true;
                //    btnAnular.Enabled = true;
                //    btnImprimir.Enabled = true;
                //    btnConciliar.Enabled = true;
                //}
            }
            catch (Exception)
            { throw; }
        }
Exemple #2
0
        public void ShowItems(CAJ006LiquidacionAgentesPresenter.TBusqueda x_opcion)
        {
            try
            {
                BSItems.DataSource = Presenter.Item.ListCtaCte;

                grdItems.DataSource    = BSItems;
                navItems.BindingSource = BSItems;
                BSItems.ResetBindings(true);

                if (grdItems.RowCount > 0)
                {
                    grdItems.Enabled = true;
                    grdItems.BestFitColumns();
                    grdItems.ReadOnly     = false;
                    grdItems.AllowEditRow = true;
                    grdItems.Columns["Seleccionar"].ReadOnly = false;
                    grdItems.Columns["Seleccionar"].Width    = 90;

                    switch (x_opcion)
                    {
                    case CAJ006LiquidacionAgentesPresenter.TBusqueda.Normal:
                        btnNuevo.Enabled     = true;
                        btnLiquidar.Enabled  = true;
                        btnAprobar.Enabled   = false;
                        btnAnular.Enabled    = false;
                        btnImprimir.Enabled  = false;
                        btnConciliar.Enabled = true;
                        break;

                    case CAJ006LiquidacionAgentesPresenter.TBusqueda.Apertura:
                        ShowControlesApertura();
                        break;

                    default:
                        btnNuevo.Enabled     = true;
                        btnLiquidar.Enabled  = false;
                        btnAprobar.Enabled   = false;
                        btnAnular.Enabled    = false;
                        btnImprimir.Enabled  = false;
                        btnConciliar.Enabled = false;
                        grdItems.ReadOnly    = true;
                        break;
                    }
                    //Infrastructure.WinForms.Controls.GridAutoFit.Fit(this.grdItems);
                }
                else
                {
                    grdItems.Enabled = false;
                    switch (x_opcion)
                    {
                    case CAJ006LiquidacionAgentesPresenter.TBusqueda.Normal:
                        btnNuevo.Enabled     = true;
                        btnLiquidar.Enabled  = false;
                        btnAprobar.Enabled   = false;
                        btnAnular.Enabled    = false;
                        btnImprimir.Enabled  = false;
                        btnConciliar.Enabled = false;
                        break;

                    case CAJ006LiquidacionAgentesPresenter.TBusqueda.Apertura:
                        ShowControlesApertura();
                        btnLiquidar.Enabled  = false;
                        btnImprimir.Enabled  = false;
                        btnConciliar.Enabled = false;
                        break;

                    default:
                        btnNuevo.Enabled     = true;
                        btnLiquidar.Enabled  = false;
                        btnAprobar.Enabled   = false;
                        btnAnular.Enabled    = false;
                        btnImprimir.Enabled  = false;
                        btnConciliar.Enabled = false;
                        break;
                    }
                }

                //grdItems.ShowFilteringRow = false;
                //grdItems.EnableFiltering = false;
                //grdItems.MasterTemplate.EnableFiltering = false;
                //grdItems.EnableGrouping = false;
                //grdItems.MasterTemplate.EnableGrouping = false;
                //grdItems.EnableSorting = false;
                //grdItems.MasterTemplate.EnableCustomSorting = false;
            }
            catch (Exception ex)
            { Infrastructure.WinForms.Controls.Dialogos.MostrarMensajeError(Presenter.Title, "Ha ocurrido un error cargando los items.", ex); }
        }