Exemplo n.º 1
0
 private void UpdateOrganisationPanel()
 {
     try
     {
         if (SelectedInventoryItem != null)
         {
             if (SelectedTipoActividad != null)
             {
                 OrganisationsView = new CollectionViewSource
                 {
                     Source = OrganisationsCollection
                              .Where(p => InventoryItemsCollection
                                     .Where(i => i.INVENTORY_ITEM_ID == SelectedInventoryItem.INVENTORY_ITEM_ID)
                                     .Any(a => a.ORGANIZATION_ID == p.Id)
                                     )
                              .Where(p => InventoryItemsCollection
                                     .Where(i => i.TIPO_ACTIVIDAD == SelectedTipoActividad.Id)
                                     .Any(a => a.ORGANIZATION_ID == p.Id))
                 }.View;
             }
             else
             {
                 OrganisationsView = new CollectionViewSource
                 {
                     Source = OrganisationsCollection
                              .Where(p => InventoryItemsCollection
                                     .Where(i => i.INVENTORY_ITEM_ID == SelectedInventoryItem.INVENTORY_ITEM_ID)
                                     .Any(a => a.ORGANIZATION_ID == p.Id)
                                     )
                 }.View;
             }
             SelectedOrganisation = (XX_OPM_BCI_ORGS_COMPLEJO)OrganisationsView.CurrentItem;
             UpdatePuntoOperacionPanel();
         }
     }
     catch (Exception ex)
     {
         showError(ex);
     }
 }
Exemplo n.º 2
0
 private void UpdateTiposActividadPanel()
 {
     try
     {
         if (SelectedInventoryItem != null)
         {
             TiposActividadView = new CollectionViewSource
             {
                 Source = TiposActividadCollection
                          .Where(p => InventoryItemsCollection
                                 .Where(i => i.INVENTORY_ITEM_ID == SelectedInventoryItem.INVENTORY_ITEM_ID)
                                 .Any(a => a.TIPO_ACTIVIDAD == p.Id))
             }.View;
             SelectedTipoActividad = null; //poner en null para disparar cambio de habilitacion de botones Bruto/Tara
             TiposActividadView.MoveCurrentToFirst();
             SelectedTipoActividad = (XX_OPM_BCI_TIPO_ACTIVIDAD)TiposActividadView.CurrentItem;
         }
     }
     catch (Exception ex)
     {
         showError(ex);
     }
 }