Ejemplo n.º 1
0
        /// <summary>
        ///     Obtiene un CostoInfo por Id
        /// </summary>
        /// <param name="filtro"></param>
        /// <returns></returns>
        internal CostoInfo ObtenerPorClaveContable(CostoInfo filtro)
        {
            CostoInfo result = null;

            try
            {
                Logger.Info();
                Dictionary <string, object> parameters = AuxCostoDAL.ObtenerParametroPorClaveContable(filtro);
                DataSet ds = Retrieve("[dbo].[Costo_ObtenerPorClaveContable]", parameters);
                if (ValidateDataSet(ds))
                {
                    result = MapCostoDAL.ObtenerPorID(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);
        }