/// <summary> /// Metodo Para Obtener lo el animal de reimplante /// </summary> internal ReimplanteInfo ObtenerAreteIndividual(AnimalInfo animalInfo, TipoMovimiento corte) { try { Logger.Info(); var parameters = AuxReimplante.ObtenerParametrosObtenerAreteIndividual(animalInfo, corte); var ds = Retrieve("ReimplanteGanado_ObtenerArete", parameters); ReimplanteInfo result = null; if (ValidateDataSet(ds)) { result = MapReimplanteDAL.ObtenerAreteIndividual(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); } }
internal DatosCompra ObtenerDatosCompra(AnimalInfo animalInfo) { try { Logger.Info(); var parameters = AuxReimplante.ObtenerParametrosDatosCompra(animalInfo.AnimalID, animalInfo.OrganizacionIDEntrada); var ds = Retrieve("ReimplanteGanado_ObtenerDatosCompra", parameters); DatosCompra result = null; if (ValidateDataSet(ds)) { result = MapReimplanteDAL.ObtenerDatosCompra(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); } }
/// <summary> /// Se valida corral destino si tiene punta chica /// </summary> /// <param name="corralOrigen"></param> /// <param name="corralDestino"></param> /// <param name="organizacionId"></param> /// <returns></returns> public CorralInfo ValidarCorralDestinoPuntaChica(string corralOrigen, string corralDestino, int organizacionId) { try { CorralInfo result = null; Logger.Info(); var parameters = AuxReimplante.ObtenerParametrosValidarCorralDestino(corralOrigen, corralDestino, organizacionId); var ds = Retrieve("ReimplanteGanado_ValidarCorralDestinoPuntaChica", parameters); if (ValidateDataSet(ds)) { result = MapReimplanteDAL.ObtenerExisteCorralDestinoPuntaChica(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); } }
/// <summary> /// Obtiene de la base de datos el numero de cabezas muertas para un lote /// </summary> /// <param name="cabezas"></param> /// <returns></returns> internal int ObtenerCabezasMuertas(CabezasCortadas cabezas) { var resp = 0; try { Dictionary <string, object> parametros = AuxReimplante.ObtenerParametrosCabezasMuertas(cabezas); DataSet ds = Retrieve("[dbo].[ReimplanteGanado_ObtenerCabezasMuertas]", parametros); if (ValidateDataSet(ds)) { resp = MapReimplanteDAL.ObtenerCabezasMuertas(ds); } } 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); } return(resp); }
/// <summary> /// Obtiene de la base de datos el numero de cabezas en enfermeria para un lote /// </summary> /// <param name="ganadoEnfermeria"></param> /// <param name="tipoMovimiento"></param> /// <returns></returns> internal int ObtenerCabezasEnEnfermeria(EntradaGanadoInfo ganadoEnfermeria, int tipoMovimiento) { var resp = 0; try { Dictionary <string, object> parametros = AuxReimplante.ObtenerParametrosCabezasEnEnfermeria(ganadoEnfermeria, tipoMovimiento); DataSet ds = Retrieve("[dbo].[ReimplanteGanado_ObtenerTotalGanadoEnEnfermeria]", parametros); if (ValidateDataSet(ds)) { resp = MapReimplanteDAL.ObtenerCabezasEnEnfermeria(ds); } } 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); } return(resp); }
internal bool ValidarReimplatePorAreteMetalico(AnimalInfo animal) { var resp = false; try { Logger.Info(); var parameters = AuxReimplante.ObtenerParametrosValidarReimplantePorAreteMetalico(animal); DataSet ds = Retrieve("ReimplanteGanado_ValidaReimplantePorAreteMetalico", parameters); if (ValidateDataSet(ds)) { resp = MapReimplanteDAL.ObtenerValidarReimplante(ds); } } 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); } return(resp); }
/// <summary> /// Metrodo Para Guardar en en la tabla Animal /// </summary> internal AnimalInfo ReasignarAreteMetalico(AnimalInfo animalInfo, int banderaGuardar) { try { Logger.Info(); var parameters = AuxReimplante.ObtenerParametrosReasignarAreteMetalico(animalInfo, banderaGuardar); var ds = Retrieve("ReimplanteGanado_ReasignarAreteMetalico", parameters); AnimalInfo result = null; if (ValidateDataSet(ds)) { result = MapReimplanteDAL.ObtenerDatosReimplante(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); } }
/// <summary> /// Funcion que permite obtener de la base de datos la Existencia de reimplantes configurados /// </summary> /// <returns></returns> internal bool ExisteProgramacionReimplate(int idOrganizacion) { var resp = false; try { Logger.Info(); var parameters = AuxReimplante.ObtenerParametrosExisteProgramacionReimplante(idOrganizacion); DataSet ds = Retrieve("ReimplanteGanado_ExisteProgramacionReimplante", parameters); if (ValidateDataSet(ds)) { resp = MapReimplanteDAL.ObtenerExisteProgramacionReimplante(ds); } } 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); } return(resp); }