/// <summary> /// Obtiene la lista de tratamientos especificada para corte /// </summary> /// <param name="tratamientoInfo"></param> /// <param name="bMetafilaxia"></param> /// <returns></returns> internal IList <TratamientoInfo> ObtenerTipoTratamientosCorte(TratamientoInfo tratamientoInfo, Metafilaxia bMetafilaxia) { try { Logger.Info(); var tratamientoDAL = new TratamientoDAL(); IList <TratamientoInfo> lista = null; IList <TratamientoInfo> resultTrataamientos = tratamientoDAL.ObtenerTratamientosCorte(tratamientoInfo, bMetafilaxia); if (resultTrataamientos != null) { //Eliminar los tratamientos repetidos lista = EliminarTratamientosRepetidos(resultTrataamientos); var productoDal = new ProductoDAL(); ResultadoInfo <ProductoInfo> result = productoDal.ObtenerProductosPorTratamientoPorXML(lista.ToList()); if (result != null && result.Lista != null && result.Lista.Any()) { lista.ForEach(prod => { prod.Productos = result.Lista.Where(id => id.TratamientoID == prod.TratamientoID). Select(p => p).ToList(); }); } } return(lista); } catch (ExcepcionGenerica) { throw; } catch (Exception ex) { Logger.Error(ex); throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex); } }
/// <summary> /// Obtiene la lista de tratamientos por tipo /// </summary> /// <param name="tratamientoInfo"></param> /// <param name="bMetafilaxia"></param> /// <returns></returns> public IList <TratamientoInfo> ObtenerTipoTratamientosCorte(TratamientoInfo tratamientoInfo, Metafilaxia bMetafilaxia) { try { Logger.Info(); var tratamientoBL = new TratamientoBL(); IList <TratamientoInfo> result = tratamientoBL.ObtenerTipoTratamientosCorte(tratamientoInfo, bMetafilaxia); return(result); } catch (ExcepcionGenerica) { throw; } catch (Exception ex) { Logger.Error(ex); throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex); } }
internal static Dictionary <string, object> ObtenerTipoTratamientos(TratamientoInfo tratamiento, Metafilaxia bMetafilaxia) { try { Logger.Info(); var parametros = new Dictionary <string, object> { { "@OrganizacionID", tratamiento.OrganizacionId }, { "@Sexo", tratamiento.Sexo.ToString()[0] }, { "@Peso", tratamiento.Peso }, { "@Metafilaxia", bMetafilaxia } }; return(parametros); } catch (Exception ex) { Logger.Error(ex); throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex); } }
internal IList <TratamientoInfo> ObtenerTratamientosCorte(TratamientoInfo tratamientoInfo, Metafilaxia bMetafilaxia) { try { IList <TratamientoInfo> result = null; Logger.Info(); Dictionary <string, object> parameters = AuxTratamientoDAL.ObtenerTipoTratamientos(tratamientoInfo, bMetafilaxia); DataSet ds = Retrieve("TratamientoGanado_Obtener", parameters); if (ValidateDataSet(ds)) { result = MapTratamientoDAL.ObtenerTipoTratamientos(ds); } return(result); } catch (SqlException ex) { Logger.Error(ex); throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex); } catch (DataException ex) { Logger.Error(ex); throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex); } catch (Exception ex) { Logger.Error(ex); throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex); } }