Esempio n. 1
0
 /// <summary>
 /// Obtiene una coleccion de todos los storeEntity que cumplen con cierto patron
 /// </summary>
 /// <param name="propertyName">propiedad del storeEntity</param>
 /// <param name="expValue">patrón de busqueda</param>
 /// <param name="OperatorType">Tipo de operador de comparación</param>
 /// <returns>Colección de StoreEntity</returns>
 /// <exception cref="ArgumentNullException">
 /// Si <paramref name="propertyName"/> es null o vacio.
 /// <exception cref="ArgumentNullException">
 /// Si <paramref name="expValue"/> es null or vacío.
 /// </exception>
 /// <exception cref="UtnEmallBusinessLogicException">
 /// Si una UtnEmallDataAccessException ocurre en el DataModel.
 /// </exception>
 public Collection <StoreEntity> GetStoreWhere(string propertyName, object expValue, bool loadRelation, OperatorType operatorType)
 {
     try
     {
         return(storeDataAccess.LoadWhere(propertyName, expValue, loadRelation, operatorType));
     }
     catch (UtnEmallDataAccessException utnEmallDataAccessException)
     {
         throw new UtnEmallBusinessLogicException(utnEmallDataAccessException.Message, utnEmallDataAccessException);
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Get collection of all storeEntity that comply with certain pattern
        /// </summary>
        /// <param name="propertyName">property of storeEntity</param>
        /// <param name="expValue">pattern</param>
        /// <param name="loadRelation">true to load the relations</param>
        /// <param name="session">User's session identifier.</param>
        /// <returns>Collection of StoreEntity</returns>
        /// <exception cref="ArgumentNullException">
        /// if <paramref name="propertyName"/> is null or empty.
        /// <exception cref="ArgumentNullException">
        /// if <paramref name="expValue"/> is null or empty.
        /// </exception>
        /// <exception cref="UtnEmallBusinessLogicException">
        /// If an UtnEmallDataAccessException occurs in DataModel.
        /// </exception>
        public Collection <StoreEntity> GetStoreWhere(string propertyName, object expValue, bool loadRelation, OperatorType operatorType, string session)
        {
            bool permited = ValidationService.Instance.ValidatePermission(session, "read", "Store");

            if (!permited)
            {
                ExceptionDetail detail = new ExceptionDetail(new UtnEmall.Server.BusinessLogic.UtnEmallPermissionException("The user hasn't permissions to read an entity"));
                throw new FaultException <ExceptionDetail>(detail);
            }

            try
            {
                return(storeDataAccess.LoadWhere(propertyName, expValue, loadRelation, operatorType));
            }
            catch (UtnEmallDataAccessException utnEmallDataAccessException)
            {
                throw new UtnEmall.Server.BusinessLogic.UtnEmallBusinessLogicException(utnEmallDataAccessException.Message, utnEmallDataAccessException);
            }
        }