Example #1
0
        /// <summary>
        /// Check processing
        /// </summary>
        /// <param name="inputObject">DataModel</param>
        /// <returns>DataModel</returns>
        private void Check(SaveDataModel inputObject)
        {
            // Local variable declaration
            AdminBannerEntryDao adminBannerEntryDao = null;

            // Variable initialize
            adminBannerEntryDao = new AdminBannerEntryDao();

            // Check role
            if (!PageHelper.AuthRole(Logics.RL_BANNERS))
                throw new ExecuteException("E_MSG_00013");

            // Check valid
            if (IsAdd && adminBannerEntryDao.IsExistBanner(inputObject.BannerCd))
                throw new DataExistException("Banner");
            if (IsEdit && !adminBannerEntryDao.IsExistBanner(inputObject.BannerCd))
                throw new DataNotExistException("Banner");
        }
Example #2
0
        /// <summary>
        /// Check processing
        /// </summary>
        /// <param name="inputObject">DataModel</param>
        /// <returns>DataModel</returns>
        private void Check(InitDataModel inputObject)
        {
            // Local variable declaration
            AdminBannerEntryDao adminBannerEntryDao = null;

            // Variable initialize
            adminBannerEntryDao = new AdminBannerEntryDao();

            // Check role
            if (!PageHelper.AuthRole(Logics.RL_BANNERS))
                throw new ExecuteException("E_MSG_00013");

            // Check valid
            if (!IsAdd)
            {
                if (DataCheckHelper.IsNull(inputObject.BannerCd))
                    throw new ExecuteException("E_MSG_DATA_00004", "Mã banner");

                if (!adminBannerEntryDao.IsExistBanner(inputObject.BannerCd))
                    throw new DataNotExistException("Banner");
            }
        }