/// <summary> /// Obtiene un lista paginada /// </summary> /// <param name="pagina"></param> /// <param name="filtro"></param> /// <returns></returns> internal ResultadoInfo <CostoInfo> ObtenerPorPaginaSinId(PaginacionInfo pagina, CostoInfo filtro) { ResultadoInfo <CostoInfo> costoLista = null; try { Dictionary <string, object> parameters = AuxCostoDAL.ObtenerParametrosPorPaginaSinId(pagina, filtro); DataSet ds = Retrieve("Costo_ObtenerPorPagina", parameters); if (ValidateDataSet(ds)) { costoLista = MapCostoDAL.ObtenerPorPagina(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(costoLista); }
/// <summary> /// Obtiene la informacion del centro de costo sap por costo id /// </summary> /// <param name="filtro"></param> /// <returns></returns> internal CentroCostoInfo ObtenerCentroCostoSAPPorCosto(CostoInfo filtro) { CentroCostoInfo result = null; try { Logger.Info(); Dictionary <string, object> parameters = AuxCostoDAL.ObtenerParametroCentroCostoSAPPorCosto(filtro); DataSet ds = Retrieve("[dbo].[Costo_ObtenerCentroCostoSAPPorCosto]", parameters); if (ValidateDataSet(ds)) { result = MapCostoDAL.ObtenerCentroCostoSAPPorCosto(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); }
/// <summary> /// Obtiene el flete por id /// </summary> /// <param name="idFlete"></param> /// <returns></returns> public List <FleteDetalleInfo> ObtenerPorFleteID(int idFlete) { try { Logger.Info(); Dictionary <string, object> parameters = AuxCostoDAL.ObtenerParametrosPorFleteID(idFlete); DataSet ds = Retrieve("ProgramacionFletes_ObtenerFletesDetallePorFleteID", parameters); List <FleteDetalleInfo> result = null; if (ValidateDataSet(ds)) { result = MapCostoDAL.ObtenerPorFleteID(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 un registro de Costo /// </summary> /// <param name="descripcion">Descripción de la Costo</param> /// <returns></returns> internal CostoInfo ObtenerPorDescripcion(string descripcion) { try { Logger.Info(); Dictionary <string, object> parameters = AuxCostoDAL.ObtenerParametrosPorDescripcion(descripcion); DataSet ds = Retrieve("Costo_ObtenerPorDescripcion", parameters); CostoInfo result = null; if (ValidateDataSet(ds)) { result = MapCostoDAL.ObtenerPorDescripcion(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> /// Metodo que crear un Costo /// </summary> /// <param name="info"></param> internal int Crear(CostoInfo info) { int infoId; try { Logger.Info(); Dictionary <string, object> parameters = AuxCostoDAL.ObtenerParametrosGuardado(info); infoId = Create("[dbo].[Costo_Crear]", parameters); } 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(infoId); }
/// <summary> /// Metodo que actualiza un Costo /// </summary> /// <param name="info"></param> internal void Actualizar(CostoInfo info) { try { Dictionary <string, object> parameters = AuxCostoDAL.ObtenerParametrosActualizar(info); Update("[dbo].[Costo_Actualizar]", parameters); } 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 una lista de Costos filtrando por el estatus Activo = 1, Inactivo = 0 /// </summary> /// <returns></returns> internal IList <CostoInfo> ObtenerTodos(EstatusEnum estatus) { try { Logger.Info(); Dictionary <string, object> parameters = AuxCostoDAL.ObtenerTodos(estatus); using (IDataReader reader = RetrieveReader("Costo_ObtenerTodos", parameters)) { IList <CostoInfo> result = null; if (ValidateDataReader(reader)) { result = MapCostoDAL.ObtenerTodos(reader); } if (Connection.State == ConnectionState.Open) { Connection.Close(); } 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); } }