Beispiel #1
0
        /// <summary>
        /// 更新组
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public async Task <byte[]> UpdateEntityByGroup(byte[] entity)
        {
            var Group  = ZipTools.DecompressionObject(entity) as tb_Group;
            var result = await new GroupManager().UpdateEntity(Group);

            return(ZipTools.CompressionObject(result));
        }
Beispiel #2
0
        /// <summary>
        /// 检查组是否存在
        /// </summary>
        /// <param name="search"></param>
        /// <returns></returns>
        public async Task <byte[]> ExistEntityByGroup(byte[] search)
        {
            var Group  = ZipTools.DecompressionObject(search) as tb_Group;
            var result = await new GroupManager().ExistEntity(Group);

            return(ZipTools.CompressionObject(result));
        }
Beispiel #3
0
        /// <summary>
        /// 更新字典
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public async Task <byte[]> UpdateEntityByDic(byte[] entity)
        {
            var dic    = ZipTools.DecompressionObject(entity) as tb_Dictionary;
            var result = await new DictionaryManager().UpdateEntity(dic);

            return(ZipTools.CompressionObject(result));
        }
Beispiel #4
0
        public async Task <byte[]> AddEntityByUser(byte[] entity)
        {
            var User    = ZipTools.DecompressionObject(entity) as tb_User;
            var NewUser = await new UserManager().AddEntity(User);

            return(ZipTools.CompressionObject(NewUser));
        }
Beispiel #5
0
        /// <summary>
        /// 更新菜单
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public async Task <byte[]> UpdateEntityByMenu(byte[] entity)
        {
            var Menu   = ZipTools.DecompressionObject(entity) as tb_Menu;
            var result = await new MenuManager().UpdateEntity(Menu);

            return(ZipTools.CompressionObject(result));
        }
Beispiel #6
0
        /// <summary>
        /// 批量更新
        /// </summary>
        /// <param name="MenusBytes"></param>
        /// <returns></returns>
        public async Task <byte[]> UpdateMenus(byte[] MenusBytes)
        {
            var MenuList = ZipTools.DecompressionObject(MenusBytes) as List <tb_Menu>;
            var result   = await new MenuManager().UpdateMenus(MenuList);

            return(ZipTools.CompressionObject(result));
        }
Beispiel #7
0
        public async Task <byte[]> UpdateEntityByUser(byte[] entity)
        {
            var User   = ZipTools.DecompressionObject(entity) as tb_User;
            var result = await new UserManager().UpdateEntity(User);

            return(ZipTools.CompressionObject(result));
        }
Beispiel #8
0
        public async Task <byte[]> GetModelsByUser(byte[] search)
        {
            var UserSearch = ZipTools.DecompressionObject(search) as tb_User;
            var UserList   = await new UserManager().GetModels(UserSearch);

            return(ZipTools.CompressionObject(UserList));
        }
        /// <summary>
        /// 检查用户登录凭证,验证通过才允许访问后台数据.
        /// </summary>
        /// <param name="loginer">用户登录凭证</param>
        /// <returns></returns>
        public static Loginer ValidateLoginer(byte[] loginer)
        {
            //用户登录信息的长度小于伪码长度,数据包无效!
            if (loginer.Length < PREFIX_LEN + SUFFIX_LEN)
            {
                return(null);
            }

            try
            {
                //用户登录信息的长度
                byte[] objectArrar = new byte[loginer.Length - (PREFIX_LEN + SUFFIX_LEN)];

                //复制用户登录信息的数据包(去掉前后伪码)
                Array.Copy(loginer, PREFIX_LEN, objectArrar, 0, objectArrar.Length);

                //转换为用户对象
                Loginer user = (Loginer)ZipTools.DecompressionObject(objectArrar);
                if (user.Account.Length >= 1) //系统限制用户帐号的长度必须大于或等于1位
                {
                    return(user);             //转换成功,返回用户对象.
                }
                else
                {
                    throw new Exception("用户帐号不正确!");
                }
            }
            catch
            {
                throw new Exception("验证用户资料失败!");
            }
        }
Beispiel #10
0
        public async Task <byte[]> GetPagingModelsByUser(int pageIndex, int pageSize, byte[] search, bool Asc = false)
        {
            var UserSearch = ZipTools.DecompressionObject(search) as tb_User;
            var UserList   = await new UserManager().GetPagingModels(pageIndex, pageSize, UserSearch, Asc);

            return(ZipTools.CompressionObject(UserList));
        }
Beispiel #11
0
        public async Task <ServiceResponse> UpdateEntity(tb_Group entity)
        {
            var bytes = await Server.UpdateEntityByGroupAsync(ZipTools.CompressionObject(entity));

            ServiceResponse response = ZipTools.DecompressionObject(bytes) as ServiceResponse;

            return(response);
        }
Beispiel #12
0
        public async Task <ServiceResponse> Remove(int id)
        {
            var bytes = await Server.RemovebyGroupAsync(id);

            ServiceResponse response = ZipTools.DecompressionObject(bytes) as ServiceResponse;

            return(response);
        }
Beispiel #13
0
        public async Task <ServiceResponse> GetPagingModels(int pageIndex, int pageSize, tb_Group search, bool Asc = false)
        {
            var bytes = await Server.GetPagingModelsByUserAsync(pageIndex, pageSize, ZipTools.CompressionObject(search), Asc);

            ServiceResponse response = ZipTools.DecompressionObject(bytes) as ServiceResponse;

            return(response);
        }
Beispiel #14
0
        public async Task <ServiceResponse> GetModels(tb_Group search)
        {
            var bytes = await Server.GetModelsByGroupAsync(ZipTools.CompressionObject(search));

            ServiceResponse response = ZipTools.DecompressionObject(bytes) as ServiceResponse;

            return(response);
        }
Beispiel #15
0
        public async Task <ServiceResponse> GetGroupUsers(string groupID)
        {
            var bytes = await Server.GetGroupUsersAsync(groupID);

            ServiceResponse response = ZipTools.DecompressionObject(bytes) as ServiceResponse;

            return(response);
        }
Beispiel #16
0
        public async Task <ServiceResponse> UpdateMenus(List <tb_Menu> tb_Menus)
        {
            byte[] bytes = await Server.UpdateMenusAsync(ZipTools.CompressionObject(tb_Menus));

            ServiceResponse response = ZipTools.DecompressionObject(bytes) as ServiceResponse;

            return(response);
        }
Beispiel #17
0
        public async Task <ServiceResponse> UpdateEntity(tb_Dictionary entity)
        {
            byte[] bytes = await Server.UpdateEntityByDicAsync(ZipTools.CompressionObject(entity));

            ServiceResponse response = ZipTools.DecompressionObject(bytes) as ServiceResponse;

            return(response);
        }
Beispiel #18
0
        public async Task <ServiceResponse> GetDictionarys()
        {
            var bytes = await Server.GetDictionarysAsync();

            ServiceResponse response = ZipTools.DecompressionObject(bytes) as ServiceResponse;

            return(response);
        }
Beispiel #19
0
        /// <summary>
        /// 登录系统
        /// </summary>
        /// <param name="account">账户</param>
        /// <param name="password">密码</param>
        /// <returns></returns>
        public async Task <ServiceResponse> Login(string account, string password)
        {
            byte[] bytes = await Server.LoginAsync(account, password);

            ServiceResponse response = ZipTools.DecompressionObject(bytes) as ServiceResponse;

            return(response);
        }
Beispiel #20
0
        public async Task <ServiceResponse> GetModelByAccount(string account)
        {
            var bytes = await Server.GetModelByAccountAsync(account);

            ServiceResponse response = ZipTools.DecompressionObject(bytes) as ServiceResponse;

            return(response);
        }
Beispiel #21
0
        public async Task <ServiceResponse> ExistEntity(tb_User entity)
        {
            byte[] result = await Server.ExistEntityByUserAsync(ZipTools.CompressionObject(entity));

            ServiceResponse response = ZipTools.DecompressionObject(result) as ServiceResponse;

            return(response);
        }
Beispiel #22
0
        /// <summary>
        /// 检查字典是否存在
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public async Task <byte[]> ExistEntityByDicType(byte[] entity)
        {
            var dic    = ZipTools.DecompressionObject(entity) as tb_DictionaryType;
            var result = await new DictionaryTypeManager().ExistEntity(dic);

            byte[] bytes = ZipTools.CompressionObject(result);
            return(bytes);
        }
Beispiel #23
0
        /// <summary>
        /// 获取表列表
        /// </summary>
        /// <returns></returns>
        public async Task <ServiceResponse> GetUvs()
        {
            var result = await Server.GetUvsAsync();

            ServiceResponse response = ZipTools.DecompressionObject(result) as ServiceResponse;

            return(response);
        }
Beispiel #24
0
        /// <summary>
        /// 条件查询数据
        /// </summary>
        /// <param name="search"></param>
        /// <returns></returns>
        public async Task <byte[]> GetModelsByGroup(byte[] search)
        {
            var Group      = ZipTools.DecompressionObject(search) as tb_Group;
            var gpFuncList = await new GroupManager().GetModels(Group);

            byte[] bytes = ZipTools.CompressionObject(gpFuncList);
            return(bytes);
        }
Beispiel #25
0
        public async Task <ServiceResponse> GetTableStructs(string tableName, string nameSpace, string desc)
        {
            var result = await Server.GetTableStatusAsync(tableName, nameSpace, desc);

            ServiceResponse response = ZipTools.DecompressionObject(result) as ServiceResponse;

            return(response);
        }
Beispiel #26
0
        public async Task <ServiceResponse> ExistEntity(tb_Menu entity)
        {
            var bytes = await Server.ExistEntityByMenuAsync(ZipTools.CompressionObject(entity));

            ServiceResponse response = ZipTools.DecompressionObject(bytes) as ServiceResponse;

            return(response);
        }
Beispiel #27
0
        /// <summary>
        /// 查询字典数据
        /// </summary>
        /// <param name="search"></param>
        /// <returns></returns>
        public async Task <byte[]> GetModelsByDic(byte[] search)
        {
            var DicSearch = ZipTools.DecompressionObject(search) as tb_Dictionary;
            var DicList   = await new DictionaryManager().GetModels(DicSearch);

            byte[] bytes = ZipTools.CompressionObject(DicList);
            return(bytes);
        }
Beispiel #28
0
        /// <summary>
        /// 查询菜单列表
        /// </summary>
        /// <param name="search"></param>
        /// <returns></returns>
        public async Task <byte[]> GetModelsByMenu(byte[] search)
        {
            var MenuSearch = ZipTools.DecompressionObject(search) as tb_Menu;
            var MenuList   = await new MenuManager().GetModels(MenuSearch);

            byte[] bytes = ZipTools.CompressionObject(MenuList);
            return(bytes);
        }
Beispiel #29
0
        /// <summary>
        /// 新增字典
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public async Task <byte[]> AddEntityByDic(byte[] entity)
        {
            var dic    = ZipTools.DecompressionObject(entity) as tb_Dictionary;
            var NewDic = await new DictionaryManager().AddEntity(dic);

            byte[] bytes = ZipTools.CompressionObject(NewDic);
            return(bytes);
        }
Beispiel #30
0
        public async Task <ServiceResponse> AddEntity(tb_DictionaryType entity)
        {
            var bytes = await Server.AddEntityByDicAsync(ZipTools.CompressionObject(entity));

            ServiceResponse response = ZipTools.DecompressionObject(bytes) as ServiceResponse;

            return(response);
        }