Exemple #1
0
        public ResponseResult <SynchronizationConfig> GetByUserId(int id)
        {
            var service = GetService <SynchronizationConfigService>();
            var result  = service.GetByUserId(id);

            return(ResponseResult <SynchronizationConfig> .GenSuccessResponse(result));
        }
        public ResponseResult <int> Insert(ShipInfo ship)
        {
            var service = GetService <ShipInfoService>();
            var result  = service.Add(ship);

            return(ResponseResult <int> .GenSuccessResponse(result));
        }
        public ResponseResult <bool> Delete(DeleteModel delModel)
        {
            var userService = GetService <SysUserService>();
            var result      = userService.Delete(delModel);

            return(ResponseResult <bool> .GenSuccessResponse(result));
        }
Exemple #4
0
        public ResponseResult <bool> Add(SysRoleMenu model)
        {
            _roleMenuService = GetService <RoleMenuService>();
            var vIsSuess = _roleMenuService.Add(model) > 0;

            return(ResponseResult <bool> .GenSuccessResponse(vIsSuess));
        }
        public ResponseResult <SysUser> SuperLogin(string loginName, string password)
        {
            var service = GetService <SysUserService>();
            var result  = service.GetList();

            return(ResponseResult <SysUser> .GenSuccessResponse(result));
        }
Exemple #6
0
        public ResponseResult <SysMenu> GetModelById(int id)
        {
            var menuService = GetService <MenuService>();
            var result      = menuService.GetModelById(id);

            return(ResponseResult <SysMenu> .GenSuccessResponse(result));
        }
        public ResponseResult <int> Insert(SysUser user)
        {
            var service = GetService <SysUserService>();
            var result  = service.Add(user);

            return(ResponseResult <int> .GenSuccessResponse(result));
        }
        public ResponseResult <List <SysUser> > GetList()
        {
            var service = GetService <SysUserService>();
            var result  = service.GetModelById(0);

            return(ResponseResult <List <SysUser> > .GenSuccessResponse(result));
        }
        public ResponseResult <bool> ChangePassword(SysUser model)
        {
            var userService = GetService <SysUserService>();
            var vIsSuess    = userService.ChangePassword(model);

            return(ResponseResult <bool> .GenSuccessResponse(vIsSuess));
        }
Exemple #10
0
        public ResponseResult <List <SysMenuPermission> > GetMenuPermissionList(int id)
        {
            var userService = GetService <MenuPermissionService>();
            var result      = userService.GetMenuPermissionList(id);

            return(ResponseResult <List <SysMenuPermission> > .GenSuccessResponse(result));
        }
        public ResponseResult <List <SysUser> > GetList(int id)
        {
            var userService = GetService <SysUserService>();
            var result      = userService.GetList();

            return(ResponseResult <List <SysUser> > .GenSuccessResponse(result));
        }
        public ResponseResult <SysUser> GetModelById(int id)
        {
            var userService = GetService <SysUserService>();
            var userInfo    = userService.GetModelById(id);

            return(ResponseResult <SysUser> .GenSuccessResponse(userInfo));
        }
Exemple #13
0
        public ResponseResult <bool> Update(SysMenuPermission model)
        {
            var sysMenuPermissionService = GetService <MenuPermissionService>();
            var vIsSuess = sysMenuPermissionService.Update(model);

            return(ResponseResult <bool> .GenSuccessResponse(vIsSuess));
        }
Exemple #14
0
        public ResponseResult <List <SysMenu> > GetSysMenuList(QueryMenuModel query)
        {
            var menuService = GetService <MenuService>();
            var result      = menuService.GetSysMenuList(query);

            return(ResponseResult <List <SysMenu> > .GenSuccessResponse(result));
        }
        public ResponseResult <ShipInfo> GetModelById(int id)
        {
            var service = GetService <ShipInfoService>();
            var result  = service.GetModelById(id);

            result.PlatName = EnumHelper.GetEnumByValue <ApiPlatform>(result.Plat).GetDescription();
            return(ResponseResult <ShipInfo> .GenSuccessResponse(result));
        }
        public ResponseResult <bool> SaveUserMenuPermissions(UserMenuPermission userMenuPermissionVm)
        {
            // 更新权限 同步更新缓存
            var token = Request.Token();

            var userService = GetService <SysUserService>();
            var result      = userService.SaveUserPermission(userMenuPermissionVm);

            return(ResponseResult <bool> .GenSuccessResponse(result));
        }
        public ResponseResult <PagedListData <List <SysUser> > > GetUserListByQuery(QueryUserModel query)
        {
            PagedListData <List <SysUser> > model = new PagedListData <List <SysUser> >();

            var userService = GetService <SysUserService>();
            var result      = userService.GetUserListByQuery(query);

            model.PagingData = result.PagingData?.ToList();
            model.PagingInfo = result.PagingInfo;
            return(ResponseResult <PagedListData <List <SysUser> > > .GenSuccessResponse(model));
        }
Exemple #18
0
        public ResponseResult <bool> Delete(int roleId)
        {
            if (roleId <= 0)
            {
                return(ResponseResult <bool> .GenSuccessResponse(false));
            }
            _roleMenuService = GetService <RoleMenuService>();
            var result = _roleMenuService.DeleteRoleMenus(roleId);

            return(ResponseResult <bool> .GenSuccessResponse(result));
        }
 public ResponseResult <bool> Delete(DeleteModel model)
 {
     try
     {
         var service  = GetService <ShipInfoService>();
         var vIsSuess = service.DeleteById(model.Id);
         return(ResponseResult <bool> .GenSuccessResponse(vIsSuess));
     }
     catch (Exception ex)
     {
         return(ResponseResult <bool> .GenFaildResponse(ex.Message));
     }
 }
 public ResponseResult <List <SysUser> > GetAllList()
 {
     try
     {
         var service = GetService <SysUserService>();
         var result  = service.GetAllList();
         return(ResponseResult <List <SysUser> > .GenSuccessResponse(result));
     }
     catch (Exception ex)
     {
         return(ResponseResult <List <SysUser> > .GenFaildResponse(ex.Message));
     }
 }
 public ResponseResult <int> Add(SysUser model)
 {
     try
     {
         var userService = GetService <SysUserService>();
         var vIsSuess    = userService.Add(model);
         return(ResponseResult <int> .GenSuccessResponse(vIsSuess));
     }
     catch (Exception ex)
     {
         return(ResponseResult <int> .GenFaildResponse(ex.Message));
     }
 }
Exemple #22
0
        public ResponseResult <bool> Save(SynchronizationConfig cfg)
        {
            var service = GetService <SynchronizationConfigService>();

            if (cfg.Id <= 0)
            {
                return(ResponseResult <bool> .GenSuccessResponse(service.Add(cfg) > 0));
            }
            else
            {
                return(ResponseResult <bool> .GenSuccessResponse(service.Update(cfg)));
            }
        }
Exemple #23
0
        public ResponseResult <bool> Delete(DeleteModel delModel)
        {
            var idparts = delModel.DelString.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);

            if (idparts.Length < 1)
            {
                return(ResponseResult <bool> .GenSuccessResponse(false));
            }
            var sysMenuPermissionService = GetService <MenuPermissionService>();
            var result = sysMenuPermissionService.Delete(delModel);

            return(ResponseResult <bool> .GenSuccessResponse(result));
        }
Exemple #24
0
 public ResponseResult <bool> Update(SysMenu model)
 {
     try
     {
         var menuService = GetService <MenuService>();
         var vIsSuess    = menuService.Update(model);
         return(ResponseResult <bool> .GenSuccessResponse(vIsSuess));
     }
     catch (Exception ex)
     {
         return(ResponseResult <bool> .GenFaildResponse(ex.Message));
     }
 }
Exemple #25
0
        public ResponseResult <bool> SaveRoleMenuPermissions(RoleMenuPermissionViewModel roleMenuPermissionVm)
        {
            var roleMenuList       = roleMenuPermissionVm.RoleMenuViewModel;
            var rolePermissionList = roleMenuPermissionVm.RolePermissionViewModel;

            if ((roleMenuList == null || roleMenuList.Count <= 0) && (rolePermissionList == null || rolePermissionList.Count <= 0))
            {
                return(ResponseResult <bool> .GenSuccessResponse(false));
            }
            var roleId = roleMenuList.FirstOrDefault().RoleId;

            if (roleId <= 0)
            {
                return(ResponseResult <bool> .GenSuccessResponse(false));
            }

            _roleMenuService       = GetService <RoleMenuService>();
            _rolePermissionService = GetService <RolePermissionService>();

            using (TransactionScope ts = new TransactionScope())
            {
                var result = false;
                try
                {
                    //先删除角色菜单记录,再添加新的
                    result = _roleMenuService.DeleteRoleMenus((int)roleId);
                    foreach (var roleMenu in roleMenuList)
                    {
                        result &= _roleMenuService.Add(roleMenu) > 0;
                    }

                    //先删除角色操作记录,在添加新的
                    result &= _rolePermissionService.DeleteRolePermissions((int)roleId);
                    foreach (var rolePermission in rolePermissionList)
                    {
                        result &= _rolePermissionService.Add(rolePermission) > 0;
                    }

                    ts.Complete();
                }
                catch (Exception ex)
                {
                    result = false;
                    ts.Dispose();
                }

                return(ResponseResult <bool> .GenSuccessResponse(result));
            }
        }
Exemple #26
0
 public ResponseResult <PagedListData <List <SysExceptionLog> > > GetExceptionLogPageList(QueryExceptionLogModel pages)
 {
     try
     {
         pages.PageSize  = pages.PageSize == 0 ? 15 : pages.PageSize;
         pages.PageIndex = pages.PageIndex < 1 ? 1 : pages.PageIndex;
         var service = GetService <SysExceptionLogService>();
         var result  = service.GetListByQuery(pages);
         return(ResponseResult <PagedListData <List <SysExceptionLog> > > .GenSuccessResponse(result));
     }
     catch (Exception ex)
     {
         return(ResponseResult <PagedListData <List <SysExceptionLog> > > .GenFaildResponse(ex.Message));
     }
 }
 public ResponseResult <List <ShipInfo> > GetAll(int id)
 {
     try
     {
         var service = GetService <ShipInfoService>();
         var result  = service.GetShipsByUserId(id)?.ToList();
         foreach (var item in result)
         {
             item.PlatName = EnumHelper.GetEnumByValue <ApiPlatform>(item.Plat).GetDescription();
         }
         return(ResponseResult <List <ShipInfo> > .GenSuccessResponse(result));
     }
     catch (Exception ex)
     {
         return(ResponseResult <List <ShipInfo> > .GenFaildResponse(ex.Message));
     }
 }
Exemple #28
0
        public ResponseResult <List <MonitorIndicatorRecord> > GetTodayRealMonitorIndicator(int id)
        {
            var result  = new List <MonitorIndicatorRecord>();
            var service = GetService <MonitorIndicatorRecordService>();

            foreach (var item in DashBoardIndicatorModel.DailyMonitor)
            {
                var list = service.QueryLastRecord(id, item);
                if (list != null && list.Any())
                {
                    result.Add(list.First());
                }
                else
                {
                    result.Add(new MonitorIndicatorRecord());
                }
            }
            return(ResponseResult <List <MonitorIndicatorRecord> > .GenSuccessResponse(result));
        }
Exemple #29
0
        public ResponseResult <List <SysMenuPermission> > GetMenuPermissionsList(SysMenu menuModel)
        {
            try
            {
                ResultCode code = ResultCode.Success;
                var        sysMenuPermissionService = GetService <MenuPermissionService>();
                var        listResult = sysMenuPermissionService.GetSysMenuPermissionsByMenu(menuModel);
                if (listResult == null)
                {
                    code = ResultCode.MenuCodeIsNull;
                    return(ResponseResult <List <SysMenuPermission> > .GenFaildResponse(code));
                }

                return(ResponseResult <List <SysMenuPermission> > .GenSuccessResponse(listResult));
            }
            catch (Exception ex)
            {
                return(ResponseResult <List <SysMenuPermission> > .GenFaildResponse(ex.Message));
            }
        }
Exemple #30
0
        public ResponseResult <List <SysMenu> > GetMenuPermissionsListByUserId(SysUser userModel)
        {
            try
            {
                ResultCode code        = ResultCode.Success;
                var        menuService = GetService <MenuService>();
                var        listResult  = menuService.GetMenuPermissionsListByUserId(userModel.Id);
                if (listResult == null)
                {
                    code = ResultCode.MenuCodeIsNull;
                    return(ResponseResult <List <SysMenu> > .GenFaildResponse(code));
                }

                return(ResponseResult <List <SysMenu> > .GenSuccessResponse(listResult));
            }
            catch (Exception ex)
            {
                return(ResponseResult <List <SysMenu> > .GenFaildResponse(ex.Message));
            }
        }