Exemplo n.º 1
0
        /// <summary>
        /// Check processing
        /// </summary>
        /// <param name="inputObject">DataModel</param>
        /// <returns>ResultModel</returns>
        private void Check(UpdateDataModel inputObject)
        {
            // Local variable declaration
            AdminGroupRoleListDao adminGroupRoleListDao = null;
            MCodeCom mCodeCom = null;

            // Variable initialize
            adminGroupRoleListDao = new AdminGroupRoleListDao();
            mCodeCom = new MCodeCom();

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

            // Check valid
            int i = 0;
            foreach (var obj in inputObject.ListGroupRoles)
            {
                var dFlag = DataHelper.ToString(obj.DeleteFlag);

                if (DataCheckHelper.IsNull(obj.DeleteFlag))
                    throw new ExecuteException("E_MSG_00004", string.Format("Dữ liệu ({0})", i + 1));
                if (!mCodeCom.IsExist(Logics.GROUP_DELETE_FLAG, dFlag, false))
                    throw new DataNotExistException(string.Format("Dữ liệu ({0})", i + 1));
                if (!adminGroupRoleListDao.IsExistGroupRole(obj.GroupCd, obj.RoleCd))
                    throw new DataNotExistException(string.Format("Quyền ({0})", i + 1));
                i++;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Check processing.
        /// </summary>
        /// <param name="inputObject">DataModel</param>
        private void Check(InitDataModel inputObject)
        {
            // Local variable declaration
            var adminGroupRoleListDao = new AdminGroupRoleListDao();

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

            // Exist group
            if(!adminGroupRoleListDao.IsExistGroup(inputObject.GroupCd))
                throw new DataNotExistException("Nhóm");
        }
Exemplo n.º 3
0
        /// <summary>
        /// Update item to cart
        /// </summary>
        /// <param name="inputObject">DataModel</param>
        /// <returns>DataModel</returns>
        private UpdateDataModel UpdateInfo(UpdateDataModel inputObject)
        {
            // Local variable declaration
            UpdateDataModel getResult = null;
            AdminGroupRoleListDao adminGroupRoleListDao = null;

            // Variable initialize
            getResult = new UpdateDataModel();
            adminGroupRoleListDao = new AdminGroupRoleListDao();

            // Update data
            foreach (var obj in inputObject.ListGroupRoles)
            {
                adminGroupRoleListDao.UpdateGroupRole(obj);
            }
            // Submit data
            adminGroupRoleListDao.SubmitChanges();

            // Return value
            return getResult;
        }
Exemplo n.º 4
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;
            AdminGroupRoleListDao adminGroupRoleListDao = null;

            // Variable initialize
            getResult = new InitDataModel();
            mCodeCom = new MCodeCom();
            adminGroupRoleListDao = new AdminGroupRoleListDao();

            // Get data
            var listDeleteFlag = mCodeCom.GetListCode(Logics.GROUP_DELETE_FLAG, null, false, false);
            var listGroupRoles = adminGroupRoleListDao.GetListGroupRoles(inputObject.GroupCd);

            // Set value
            getResult.GroupCd = inputObject.GroupCd;
            getResult.ListDeleteFlag = listDeleteFlag;
            getResult.ListGroupRoles = listGroupRoles;

            // Return value
            return getResult;
        }