示例#1
0
        /// <summary>
        /// Check processing
        /// </summary>
        /// <param name="inputObject">DataModel</param>
        /// <returns>DataModel</returns>
        private void Check(SaveDataModel inputObject)
        {
            // Local variable declaration
            AdminCategoryEntryDao adminCategoryEntryDao = null;
            MCodeCom mCodeCom = null;

            // Variable initialize
            adminCategoryEntryDao = new AdminCategoryEntryDao();
            mCodeCom = new MCodeCom();

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

            // Check valid
            var dFlag = DataHelper.ToString(inputObject.DeleteFlag);

            if (!mCodeCom.IsExist(Logics.GROUP_CATEGORY_DIV, inputObject.CategoryDiv, false))
                throw new DataNotExistException("Chủng loại");
            if (!mCodeCom.IsExist(Logics.GROUP_DELETE_FLAG, dFlag, false))
                throw new DataNotExistException("Dữ liệu");
            if (adminCategoryEntryDao.IsExistCategory(inputObject.CategoryCd))
                throw new DataExistException("Loại sản phẩm");
        }
示例#2
0
        /// <summary>
        /// Save infomation
        /// </summary>
        /// <param name="inputObject">DataModel</param>
        /// <returns>DataModel</returns>
        private SaveDataModel SaveInfo(SaveDataModel inputObject)
        {
            // Local variable declaration
            SaveDataModel saveResult = null;
            AdminCategoryEntryDao adminCategoryEntryDao = null;

            // Variable initialize
            saveResult = new SaveDataModel();
            adminCategoryEntryDao = new AdminCategoryEntryDao();

            // Insert data
            adminCategoryEntryDao.InsertCategory(inputObject);

            return saveResult;
        }