Exemple #1
0
        public ResponseMessage List(long ProjectID)
        {
            // 判断是否有权限
            var userproject = _UserManage.GetUserProject(_TenantManage.user.ID, ProjectID);

            if (userproject == null)
            {
                return(new ResponseMessage(MessageResult.Error, "项目不存在"));
            }
            // 获取项目列表
            var list = _DBConnectManage.GetListByProjectID(ProjectID);

            //return new string[] { "value1", "value2" };
            return(new ResponseMessage(MessageResult.Success, "", list.Where(m => m.IsDelete == 0)));
        }
Exemple #2
0
        public ResponseMessage Update([FromBody] Project model)
        {
            if (model == null)
            {
                return(new ResponseMessage(MessageResult.Error, "更新失败"));
            }
            // 判断是否有权限
            var userproject = _UserManage.GetUserProject(_TenantManage.user.ID, model.ID);

            if (userproject == null)
            {
                return(new ResponseMessage(MessageResult.Error, "项目不存在"));
            }
            if (_ProjectManage.Update(model))
            {
                return(new ResponseMessage(MessageResult.Success, "更新成功"));
            }
            return(new ResponseMessage(MessageResult.Error, "更新失败"));
        }
Exemple #3
0
        public ResponseMessage List(long ProjectID)
        {
            // 判断是否有权限
            var userproject = _UserManage.GetUserProject(_TenantManage.user.ID, ProjectID);

            if (userproject == null)
            {
                return(new ResponseMessage(MessageResult.Error, "项目不存在"));
            }
            // 获取项目列表
            var list = _PageManage.GetListByProjectID(ProjectID);

            //return new string[] { "value1", "value2" };
            return(new ResponseMessage(MessageResult.Success, "", list.Select(m => new
            {
                m.ID,
                m.ProjectID,
                m.Title,
                m.IsPublic,
                m.OrderBy
            })));
        }