示例#1
0
 private void SeleccionarItem()
 {
     try
     {
         if (Presenter != null)
         {
             if (BSItems != null && BSItems.Current != null && BSItems.Current is Entities.Cab_Operacion)
             {
                 Presenter.ItemLView = ((Entities.Cab_Operacion)BSItems.Current);
                 Presenter.CargarServicios(Presenter.ItemLView.COPE_Codigo);
                 BSItemsServicvios.DataSource    = Presenter.ItemsServicios;
                 grdItemsServicios.DataSource    = BSItemsServicvios;
                 navItemsServicios.BindingSource = BSItemsServicvios;
                 BSItemsServicvios.ResetBindings(true);
                 Presenter.Position = BSItems.Position;
                 //Infrastructure.WinFormsControls.GridAutoFit.Fit(grdItemsServicios);
                 //grdItemsServicios.ShowFilteringRow = false;
                 //grdItemsServicios.ShowGroupPanel = false;
             }
             else
             {
                 Presenter.ItemLView = null;
             }
         }
     }
     catch (Exception ex)
     { Infrastructure.WinFormsControls.Dialogos.MostrarMensajeError(Presenter.Title, "Ha ocurrido un error al seleccionar el item.", ex); }
 }
示例#2
0
 public void ShowItems()
 {
     try
     {
         BSItems.DataSource     = Presenter.ItemsCab_Operacion;
         grdItems.DataSource    = BSItems;
         navItems.BindingSource = BSItems;
         BSItems.ResetBindings(true);
         if (grdItems.RowCount > 0)
         {
             grdItems.Enabled    = true;
             btnExportar.Enabled = true;
             Infrastructure.WinFormsControls.GridAutoFit.Fit(this.grdItems);
             grdItemsServicios.Enabled = true;
         }
         else
         {
             grdItems.Enabled                = false;
             btnExportar.Enabled             = false;
             BSItemsServicvios.DataSource    = null;
             grdItemsServicios.DataSource    = BSItemsServicvios;
             navItemsServicios.BindingSource = BSItemsServicvios;
             BSItemsServicvios.ResetBindings(true);
             grdItemsServicios.Enabled = false;
         }
     }
     catch (Exception ex)
     { Infrastructure.WinFormsControls.Dialogos.MostrarMensajeError(Presenter.Title, Infrastructure.Aspect.Constants.Mensajes.ShowItems, ex); }
 }