Beispiel #1
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);
        }
Beispiel #2
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);
        }
Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #5
0
        /// <summary>
        /// Metrodo Para Obtener pesos origen y llegada
        /// </summary>
        internal bool ObtenerPesosOrigenLlegada(int orgnizacionID, int corralOrigenID, int loteOrigenID)
        {
            bool result = false;

            try
            {
                Dictionary <string, object> parametros = AuxCorteGanadoDAL.ObtenerParametrosObteenerPesosOrigenLlegada(orgnizacionID, corralOrigenID, loteOrigenID);
                Update("CorteGanado_CierrePartidaPesoOrigenLLegada", parametros);
            }
            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);
        }
Beispiel #6
0
        /// <summary>
        /// Metrodo Para Registrar los movimientos en el almacen
        /// </summary>
        internal bool RegistrarMovimientosAlmacen(MovimientosAlmacen movimientosAlmacen)
        {
            bool result = false;

            try
            {
                Dictionary <string, object> parametros = AuxCorteGanadoDAL.ObtenerParametrosRegistrarMovimientosAlmacen(movimientosAlmacen);
                DataSet ds = Retrieve("[dbo].[usp_AlmMovimientos_Registrar]", parametros);
                if (ValidateDataSet(ds))
                {
                    //result = MapCorteGanadoDAL.ObteneRegistrarMovimientosAlmacen(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);
        }
Beispiel #7
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);
        }