예제 #1
0
        /// <summary>
        ///    Se obtiene el proveedor
        /// </summary>
        /// <param name="noEmbarqueid"></param>
        /// <returns></returns>
        internal String ObtenerProveedor(int noEmbarqueid)
        {
            var resp = "";

            try
            {
                Dictionary <string, object> parametros = AuxCorteGanadoDAL.ObtenerParametrosNombreProveedor(noEmbarqueid);
                DataSet ds = Retrieve("[dbo].[CorteGanado_ObtenerNombreProveedor]", parametros);
                if (ValidateDataSet(ds))
                {
                    resp = MapCorteGanadoDAL.ObtenerNombreProveedor(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);
        }
예제 #2
0
        /// <summary>
        ///    Obtiene una Cantidad de Animales que se encuentran en enfermeria
        /// </summary>
        /// <param name="ganadoEnfermeria"></param>
        /// <param name="noTipoCorral"></param>
        /// <returns></returns>
        internal int ObtenerCabezasEnEnfermeria(EntradaGanadoInfo ganadoEnfermeria, int noTipoCorral)
        {
            var resp = 0;

            try
            {
                Dictionary <string, object> parametros = AuxCorteGanadoDAL.ObtenerParametrosCabezasEnEnfermeria(ganadoEnfermeria, noTipoCorral);
                DataSet ds = Retrieve("[dbo].[CorteGanado_ObtenerTotalGanadoEnEnfermeria]", parametros);
                if (ValidateDataSet(ds))
                {
                    resp = MapCorteGanadoDAL.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);
        }
예제 #3
0
        /// <summary>
        /// Obtener las partidas cortadas y sus sobrantes que lleva cortados
        /// </summary>
        /// <param name="paramCabezaSobrantesCortadas"></param>
        /// <returns></returns>
        internal IList <CabezasSobrantesPorEntradaInfo> ObtenerCabezasSobrantes(CabezasCortadas paramCabezaSobrantesCortadas)
        {
            IList <CabezasSobrantesPorEntradaInfo> result = null;

            try
            {
                Dictionary <string, object> parametros = AuxCorteGanadoDAL.ObtenerParametrosObtenerCabezasSobrantesCortadas(paramCabezaSobrantesCortadas);
                DataSet ds = Retrieve("[dbo].[CorteGanado_ObtenerTotalGanadoSobranteCortado]", parametros);
                if (ValidateDataSet(ds))
                {
                    result = MapCorteGanadoDAL.ObtenerCabezasSobrantesCortadas(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(result);
        }
예제 #4
0
        /// <summary>
        /// Metrodo Para obtener el total de cabezas Muertas
        /// </summary>
        internal int ObtenerCabezasMuertas(CabezasCortadas cabezasMuertas)
        {
            int result = 0;

            try
            {
                Dictionary <string, object> parametros = AuxCorteGanadoDAL.ObtenerParametrosObtenerCabezasMuertas(cabezasMuertas);
                DataSet ds = Retrieve("[dbo].[CorteGanado_ObtenerTotalGanadoMuerto]", parametros);
                if (ValidateDataSet(ds))
                {
                    result = MapCorteGanadoDAL.ObtenerCabezasCortadas(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(result);
        }
예제 #5
0
        internal AnimalInfo ExisteAreteMetalicoEnPartida(AnimalInfo animalInfo)
        {
            AnimalInfo result = null;

            try
            {
                Dictionary <string, object> parametros = AuxCorteGanadoDAL.ObtenerParametrosExisteAreteMetalicoEnPartida(animalInfo);
                DataSet ds = Retrieve("[dbo].[CorteGanado_ExisteAreteMetalicoEnPartida]", parametros);
                if (ValidateDataSet(ds))
                {
                    result = MapCorteGanadoDAL.ObtenerExisteExisteAreteEnPartida(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(result);
        }
예제 #6
0
        /// <summary>
        ///    Se valida que existan programacion corte de ganado
        /// </summary>
        internal bool ExisteProgramacionCorteGanado(int organizacionID)
        {
            var resp = false;

            try
            {
                var parametros = new Dictionary <string, object>
                {
                    { "@OrganizacionID", organizacionID }
                };
                DataSet ds = Retrieve("CorteGanado_ExisteProgramacionCorteGanado", parametros);
                if (ValidateDataSet(ds))
                {
                    resp = MapCorteGanadoDAL.ObtenerExisteProgramacionCorteGanado(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);
        }