예제 #1
0
 /// <summary>
 /// Obtiene la lista de cuenta de gastos de ganado
 /// </summary>
 /// <param name="inicio"></param>
 /// <param name="limite"></param>
 private void ObtenerListaPrecioProducto(int inicio, int limite)
 {
     try
     {
         var precioProductoPL       = new PrecioProductoPL();
         PrecioProductoInfo filtros = Contexto;
         var pagina = new PaginacionInfo {
             Inicio = inicio, Limite = limite
         };
         ResultadoInfo <PrecioProductoInfo> resultadoInfo = precioProductoPL.ObtenerPorPagina(pagina, filtros);
         if (resultadoInfo != null && resultadoInfo.Lista != null &&
             resultadoInfo.Lista.Count > 0)
         {
             gridDatos.ItemsSource       = resultadoInfo.Lista;
             ucPaginacion.TotalRegistros = resultadoInfo.TotalRegistros;
         }
         else
         {
             ucPaginacion.TotalRegistros = 0;
             ucPaginacion.AsignarValoresIniciales();
             gridDatos.ItemsSource = new List <PrecioProductoInfo>();
         }
     }
     catch (ExcepcionGenerica)
     {
         SkMessageBox.Show(Application.Current.Windows[ConstantesVista.WindowPrincipal], Properties.Resources.PrecioProducto_ErrorBuscar, MessageBoxButton.OK, MessageImage.Error);
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         SkMessageBox.Show(Application.Current.Windows[ConstantesVista.WindowPrincipal], Properties.Resources.PrecioProducto_ErrorBuscar, MessageBoxButton.OK, MessageImage.Error);
     }
 }