Exemple #1
0
        /// <summary>
        /// Get infomation
        /// </summary>
        /// <param name="inputObject">DataModel</param>
        /// <returns>DataModel</returns>
        private InitDataModel GetInfo(InitDataModel inputObject)
        {
            // Local variable declaration
            InitDataModel     getResult         = null;
            MCodeCom          mCodeCom          = null;
            AdminUserEntryDao adminUserEntryDao = null;

            // Variable initialize
            getResult         = new InitDataModel();
            mCodeCom          = new MCodeCom();
            adminUserEntryDao = new AdminUserEntryDao();

            // Get data
            var listCity       = mCodeCom.GetListCity(false, false);
            var listDeleteFlag = mCodeCom.GetListCode(Logics.GROUP_DELETE_FLAG, null, false, false);
            var listGroup      = mCodeCom.GetListGroup(false, false);
            var user           = new User();

            if (!IsAdd)
            {
                user = adminUserEntryDao.GetSingle(inputObject.UserCd);
            }

            // Set value
            getResult.ListCity       = listCity;
            getResult.ListDeleteFlag = listDeleteFlag;
            getResult.ListGroup      = listGroup;
            getResult.User           = user;

            // Return value
            return(getResult);
        }
Exemple #2
0
        /// <summary>
        /// Check processing
        /// </summary>
        /// <param name="inputObject">DataModel</param>
        /// <returns>DataModel</returns>
        private void Check(InitDataModel inputObject)
        {
            // Local variable declaration
            var adminUserEntryDao = new AdminUserEntryDao();

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

            // Check valid
            if (!IsAdd)
            {
                if (DataCheckHelper.IsNull(inputObject.UserCd))
                {
                    throw new ExecuteException("E_MSG_DATA_00004", "Mã tài khoản");
                }

                if (!adminUserEntryDao.IsExist(inputObject.UserCd))
                {
                    throw new DataNotExistException("Tài khoản");
                }
            }
        }
Exemple #3
0
        /// <summary>
        /// Check processing
        /// </summary>
        /// <param name="inputObject">DataModel</param>
        /// <returns>DataModel</returns>
        private void Check(SaveDataModel inputObject)
        {
            // Local variable declaration
            var adminUserEntryDao = new AdminUserEntryDao();

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

            // Check valid
            if (IsEdit && !adminUserEntryDao.IsExist(inputObject.UserCd))
            {
                throw new DataNotExistException("Tài khoản");
            }
        }
Exemple #4
0
        /// <summary>
        /// Save infomation
        /// </summary>
        /// <param name="inputObject">DataModel</param>
        /// <returns>DataModel</returns>
        private SaveDataModel SaveInfo(SaveDataModel inputObject)
        {
            // Local variable declaration
            SaveDataModel     saveResult        = null;
            AdminUserEntryDao adminUserEntryDao = null;

            // Variable initialize
            saveResult        = new SaveDataModel();
            adminUserEntryDao = new AdminUserEntryDao();

            if (IsAdd)
            {
                adminUserEntryDao.Insert(inputObject);        // Insert
            }
            else
            {
                adminUserEntryDao.Update(inputObject);  // Update
            }
            // Return value
            return(saveResult);
        }