Example #1
0
 /// <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);
     }
 }
Example #2
0
 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);
     }
 }
Example #3
0
        /// <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);
            }
        }
Example #4
0
        /// <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);
        }
Example #5
0
        /// <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);
        }
Example #6
0
        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);
        }
Example #7
0
 /// <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);
     }
 }
Example #8
0
        /// <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);
        }