///<summary> /// Obtiene el número de batch que deberá mostrarse en el texbox "txtBatch" /// Este dato se inicializado en 1, por rotomix y por día. /// </summary> /// <returns></returns> internal int CantidadBatch(int organizacionId, int rotoMix) { try { Logger.Info(); Dictionary <string, object> parameters = AuxFormulaDAL.CantidadBatch(organizacionId, rotoMix); DataSet ds = Retrieve("ProduccionFormula_ObtenerCantidadBatch", parameters); int result = 0; if (ValidateDataSet(ds)) { result = MapFormulaDAL.CantidadBatch(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 lista paginada /// </summary> /// <param name="pagina"></param> /// <param name="filtro"></param> /// <returns></returns> internal ResultadoInfo <FormulaInfo> ObtenerPorPagina(PaginacionInfo pagina, FormulaInfo filtro) { try { Dictionary <string, object> parameters = AuxFormulaDAL.ObtenerParametrosPorPagina(pagina, filtro); DataSet ds = Retrieve("Formula_ObtenerPorPagina", parameters); ResultadoInfo <FormulaInfo> result = null; if (ValidateDataSet(ds)) { result = MapFormulaDAL.ObtenerPorPagina(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 una lista de Formula /// </summary> /// <returns></returns> internal IList <FormulaInfo> ObtenerFormulasConfiguradas(EstatusEnum activo) { try { Logger.Info(); Dictionary <string, object> parameters = AuxFormulaDAL.ObtenerFormulasConfiguradas(activo); DataSet ds = Retrieve("Formula_ObtenerConfiguradas", parameters); IList <FormulaInfo> result = null; if (ValidateDataSet(ds)) { result = MapFormulaDAL.ObtenerParametrosFormulasConfiguradas(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 una lista de la tabla RotoMix para cargar el commobox del mismo nombre "RotoMix" /// </summary> /// <returns></returns> internal IList <RotoMixInfo> ObtenerRotoMixConfiguradas(int organizacionId) { try { Logger.Info(); Dictionary <string, object> parameters = AuxFormulaDAL.ObtenerRotoMixConfiguradas(organizacionId); DataSet ds = Retrieve("ProduccionFormula_ObtenerRotoMix", parameters); IList <RotoMixInfo> result = null; if (ValidateDataSet(ds)) { result = MapFormulaDAL.ObtenerRotoMixConfiguradas(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 la formula por su clave para /// opcion de Calidad pase a proceso /// </summary> /// <param name="formulaID"></param> /// <returns></returns> internal FormulaInfo ObtenerPorFormulaIDCalidadPaseProceso(int formulaID) { try { Logger.Info(); Dictionary <string, object> parameters = AuxFormulaDAL.ObtenerParametrosPorFormulaIDCalidadPaseProceso(formulaID); DataSet ds = Retrieve("Formula_ObtenerPorFormulaIDPaseCalidad", parameters); FormulaInfo result = null; if (ValidateDataSet(ds)) { result = MapFormulaDAL.ObtenerPorFormulaIDCalidadPaseProceso(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); } }
internal List <FormulaInfo> ObtenerFormulaDescripcionPorIDs(List <int> formulasID) { List <FormulaInfo> formulaInfo = new List <FormulaInfo>(); try { Logger.Info(); var ids = string.Join("|", formulasID.ToArray()); Dictionary <string, object> parameters = new Dictionary <string, object>(); parameters.Add("@ids", ids); DataSet ds = Retrieve("Formula_ObtenerFormulaDescripcionPorIDs", parameters); if (ValidateDataSet(ds)) { formulaInfo = MapFormulaDAL.ObtenerFormulaDescripcionPorIDs(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(formulaInfo); }
/// <summary> /// /// </summary> /// <param name="tipoFormulaId"></param> /// <returns></returns> internal IList <FormulaInfo> ObtenerPorFormulaId(int tipoFormulaId) { IList <FormulaInfo> formulaInfo = null; try { Logger.Info(); Dictionary <string, object> parameters = AuxFormulaDAL.ObtenerPorFormulaId(tipoFormulaId); DataSet ds = Retrieve("ServicioAlimento_ObtenerPorFormulaID", parameters); if (ValidateDataSet(ds)) { formulaInfo = MapFormulaDAL.ObtenerPorFormulaId(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(formulaInfo); }
/// <summary> /// Obtiene una lista de Formula /// </summary> /// <returns></returns> internal IList <FormulaInfo> ObtenerTodos() { try { Logger.Info(); DataSet ds = Retrieve("Formula_ObtenerTodos"); IList <FormulaInfo> result = null; if (ValidateDataSet(ds)) { result = MapFormulaDAL.ObtenerTodos(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 una lista filtrando por el estatus Activo = 1, Inactivo = 0 /// </summary> /// <returns></returns> internal IList <FormulaInfo> ObtenerTodos(EstatusEnum estatus) { try { Logger.Info(); Dictionary <string, object> parameters = AuxFormulaDAL.ObtenerTodos(estatus); using (IDataReader reader = RetrieveReader("Formula_ObtenerTodos", parameters)) { IList <FormulaInfo> result = null; if (ValidateDataReader(reader)) { result = MapFormulaDAL.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); } }