From 38cb16d9e789af1338fac4d6f2ca27b89c1d411c Mon Sep 17 00:00:00 2001 From: yubaolee Date: Thu, 30 Nov 2017 17:47:41 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B6=8A=E6=9D=A5=E8=B6=8A=E9=A1=BA=E4=BA=86~~?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Infrastructure/Response.cs | 1 + OpenAuth.App/AuthorizeApp.cs | 2 +- OpenAuth.App/CategoryApp.cs | 3 +- OpenAuth.App/OpenAuth.App.csproj | 13 +++--- OpenAuth.App/OrgManagerApp.cs | 6 +-- .../{ViewModel => Response}/CommandModel.cs | 2 +- .../ModuleElementVM.cs | 2 +- .../{ViewModel => Response}/ModuleView.cs | 6 +-- .../{ViewModel => Response}/RoleVM.cs | 2 +- .../{ViewModel => Response}/UserView.cs | 3 +- .../UserWithAccessedCtrls.cs | 3 +- OpenAuth.App/SSO/AuthUtil.cs | 2 +- OpenAuth.App/UserManagerApp.cs | 8 ++-- OpenAuth.App/ViewModel/GridData.cs | 41 ------------------- OpenAuth.App/WFFormService.cs | 18 ++++---- OpenAuth.App/WFProcessInstanceService.cs | 6 +-- OpenAuth.App/WFSchemeService.cs | 6 +-- .../Controllers/FlowDesignController.cs | 1 - OpenAuth.Mvc/Controllers/BaseController.cs | 2 +- .../Controllers/CategoriesController.cs | 2 +- .../Controllers/ModuleManagerController.cs | 2 +- .../Controllers/UserManagerController.cs | 2 +- .../Controllers/UserSessionController.cs | 4 +- OpenAuth.UnitTest/TestUser.cs | 2 +- .../Areas/SSO/Controllers/CheckController.cs | 2 +- 25 files changed, 48 insertions(+), 93 deletions(-) rename OpenAuth.App/{ViewModel => Response}/CommandModel.cs (95%) rename OpenAuth.App/{ViewModel => Response}/ModuleElementVM.cs (92%) rename OpenAuth.App/{ViewModel => Response}/ModuleView.cs (89%) rename OpenAuth.App/{ViewModel => Response}/RoleVM.cs (94%) rename OpenAuth.App/{ViewModel => Response}/UserView.cs (93%) rename OpenAuth.App/{ViewModel => Response}/UserWithAccessedCtrls.cs (94%) delete mode 100644 OpenAuth.App/ViewModel/GridData.cs diff --git a/Infrastructure/Response.cs b/Infrastructure/Response.cs index 385a115a..aa62d021 100644 --- a/Infrastructure/Response.cs +++ b/Infrastructure/Response.cs @@ -15,6 +15,7 @@ public Response() { Code = 200; + Message = "操作成功"; } } diff --git a/OpenAuth.App/AuthorizeApp.cs b/OpenAuth.App/AuthorizeApp.cs index de572b65..92498da9 100644 --- a/OpenAuth.App/AuthorizeApp.cs +++ b/OpenAuth.App/AuthorizeApp.cs @@ -1,6 +1,6 @@ using System.Linq; using Infrastructure; -using OpenAuth.App.ViewModel; +using OpenAuth.App.Response; using OpenAuth.Repository.Domain; using OpenAuth.Repository.Interface; diff --git a/OpenAuth.App/CategoryApp.cs b/OpenAuth.App/CategoryApp.cs index 6cbf68ab..da0e89bd 100644 --- a/OpenAuth.App/CategoryApp.cs +++ b/OpenAuth.App/CategoryApp.cs @@ -1,12 +1,11 @@ using System; using System.Collections.Generic; using System.Linq; -using OpenAuth.App; using OpenAuth.App.Request; using OpenAuth.App.Response; using OpenAuth.Repository.Domain; -namespace LwSolution.App +namespace OpenAuth.App { /// /// 分类管理 diff --git a/OpenAuth.App/OpenAuth.App.csproj b/OpenAuth.App/OpenAuth.App.csproj index 7c14f4f6..dde858c0 100644 --- a/OpenAuth.App/OpenAuth.App.csproj +++ b/OpenAuth.App/OpenAuth.App.csproj @@ -111,13 +111,12 @@ - - - - - - - + + + + + + diff --git a/OpenAuth.App/OrgManagerApp.cs b/OpenAuth.App/OrgManagerApp.cs index 1e917b36..625131ee 100644 --- a/OpenAuth.App/OrgManagerApp.cs +++ b/OpenAuth.App/OrgManagerApp.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; -using OpenAuth.App.ViewModel; +using OpenAuth.App.Response; using OpenAuth.Repository.Domain; using OpenAuth.Repository.Interface; @@ -99,10 +99,10 @@ namespace OpenAuth.App /// 得到部门的所有子部门 /// 如果orgId为0,表示取得所有部门 /// - public GridData LoadAllChildren(string orgId) + public TableData LoadAllChildren(string orgId) { var query = GetSubOrgs(orgId); - return new GridData + return new TableData { data = query.ToList(), count = query.Count(), diff --git a/OpenAuth.App/ViewModel/CommandModel.cs b/OpenAuth.App/Response/CommandModel.cs similarity index 95% rename from OpenAuth.App/ViewModel/CommandModel.cs rename to OpenAuth.App/Response/CommandModel.cs index 934870bd..c7781057 100644 --- a/OpenAuth.App/ViewModel/CommandModel.cs +++ b/OpenAuth.App/Response/CommandModel.cs @@ -11,7 +11,7 @@ using OptimaJet.Workflow.Core.Model; -namespace OpenAuth.App.ViewModel +namespace OpenAuth.App.Response { /// /// workflow命令 diff --git a/OpenAuth.App/ViewModel/ModuleElementVM.cs b/OpenAuth.App/Response/ModuleElementVM.cs similarity index 92% rename from OpenAuth.App/ViewModel/ModuleElementVM.cs rename to OpenAuth.App/Response/ModuleElementVM.cs index 009fa9be..60d828d1 100644 --- a/OpenAuth.App/ViewModel/ModuleElementVM.cs +++ b/OpenAuth.App/Response/ModuleElementVM.cs @@ -1,4 +1,4 @@ -namespace OpenAuth.App.ViewModel +namespace OpenAuth.App.Response { /// /// 用户ID diff --git a/OpenAuth.App/ViewModel/ModuleView.cs b/OpenAuth.App/Response/ModuleView.cs similarity index 89% rename from OpenAuth.App/ViewModel/ModuleView.cs rename to OpenAuth.App/Response/ModuleView.cs index 1d04f2d8..5b59ce4f 100644 --- a/OpenAuth.App/ViewModel/ModuleView.cs +++ b/OpenAuth.App/Response/ModuleView.cs @@ -1,8 +1,8 @@ -using Infrastructure; -using System.Collections.Generic; +using System.Collections.Generic; +using Infrastructure; using OpenAuth.Repository.Domain; -namespace OpenAuth.App.ViewModel +namespace OpenAuth.App.Response { public class ModuleView { diff --git a/OpenAuth.App/ViewModel/RoleVM.cs b/OpenAuth.App/Response/RoleVM.cs similarity index 94% rename from OpenAuth.App/ViewModel/RoleVM.cs rename to OpenAuth.App/Response/RoleVM.cs index 61b89626..c7ee0bb7 100644 --- a/OpenAuth.App/ViewModel/RoleVM.cs +++ b/OpenAuth.App/Response/RoleVM.cs @@ -15,7 +15,7 @@ using Infrastructure; using OpenAuth.Repository.Domain; -namespace OpenAuth.App.ViewModel +namespace OpenAuth.App.Response { public partial class RoleVM { diff --git a/OpenAuth.App/ViewModel/UserView.cs b/OpenAuth.App/Response/UserView.cs similarity index 93% rename from OpenAuth.App/ViewModel/UserView.cs rename to OpenAuth.App/Response/UserView.cs index 67d4c789..60830ac0 100644 --- a/OpenAuth.App/ViewModel/UserView.cs +++ b/OpenAuth.App/Response/UserView.cs @@ -2,8 +2,7 @@ using Infrastructure; using OpenAuth.Repository.Domain; - -namespace OpenAuth.App.ViewModel +namespace OpenAuth.App.Response { public class UserView { diff --git a/OpenAuth.App/ViewModel/UserWithAccessedCtrls.cs b/OpenAuth.App/Response/UserWithAccessedCtrls.cs similarity index 94% rename from OpenAuth.App/ViewModel/UserWithAccessedCtrls.cs rename to OpenAuth.App/Response/UserWithAccessedCtrls.cs index 174ce503..8096c779 100644 --- a/OpenAuth.App/ViewModel/UserWithAccessedCtrls.cs +++ b/OpenAuth.App/Response/UserWithAccessedCtrls.cs @@ -15,8 +15,7 @@ using System.Collections.Generic; using OpenAuth.Repository.Domain; - -namespace OpenAuth.App.ViewModel +namespace OpenAuth.App.Response { /// /// 视图模型 diff --git a/OpenAuth.App/SSO/AuthUtil.cs b/OpenAuth.App/SSO/AuthUtil.cs index bd93b307..29cb0d60 100644 --- a/OpenAuth.App/SSO/AuthUtil.cs +++ b/OpenAuth.App/SSO/AuthUtil.cs @@ -14,7 +14,7 @@ using System; using System.Configuration; using System.Web; using Infrastructure; -using OpenAuth.App.ViewModel; +using OpenAuth.App.Response; namespace OpenAuth.App.SSO { diff --git a/OpenAuth.App/UserManagerApp.cs b/OpenAuth.App/UserManagerApp.cs index 45d43d92..1e76348d 100644 --- a/OpenAuth.App/UserManagerApp.cs +++ b/OpenAuth.App/UserManagerApp.cs @@ -1,8 +1,8 @@ -using OpenAuth.App.ViewModel; -using System; +using System; using System.Collections.Generic; using System.Linq; using OpenAuth.App.Request; +using OpenAuth.App.Response; using OpenAuth.Repository.Domain; @@ -22,7 +22,7 @@ namespace OpenAuth.App /// /// 加载一个部门及子部门全部用户 /// - public GridData Load(QueryUserListReq request) + public TableData Load(QueryUserListReq request) { IEnumerable users; int records = 0; @@ -52,7 +52,7 @@ namespace OpenAuth.App userviews.Add(uv); } - return new GridData + return new TableData { count = records, data = userviews, diff --git a/OpenAuth.App/ViewModel/GridData.cs b/OpenAuth.App/ViewModel/GridData.cs deleted file mode 100644 index b1cb30bb..00000000 --- a/OpenAuth.App/ViewModel/GridData.cs +++ /dev/null @@ -1,41 +0,0 @@ -// *********************************************************************** -// Assembly : FundationAdmin -// Author : yubaolee -// Created : 03-09-2016 -// -// Last Modified By : yubaolee -// Last Modified On : 03-09-2016 -// *********************************************************************** -// -// 版权所有(C) Microsoft 2015 -// -// B-JUIDataGrid的数据格式 -// *********************************************************************** - -namespace OpenAuth.App.ViewModel -{ - /// - /// jqGrid的返回值 - /// - public class GridData - { - /// - /// 状态码 - /// - public int code; - /// - /// 操作消息 - /// - public string msg; - - /// - /// 总记录条数 - /// - public int count; - - /// - /// 数据内容 - /// - public dynamic data; - } -} \ No newline at end of file diff --git a/OpenAuth.App/WFFormService.cs b/OpenAuth.App/WFFormService.cs index ca3d89d3..4742303a 100644 --- a/OpenAuth.App/WFFormService.cs +++ b/OpenAuth.App/WFFormService.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; using System.Linq; -using OpenAuth.App.ViewModel; +using OpenAuth.App.Response; using OpenAuth.Repository.Domain; using OpenAuth.Repository.Interface; @@ -29,9 +29,9 @@ namespace OpenAuth.App _unitWork.Delete(u =>keyValue.Contains(u.Id)); } - public GridData Load(int pageCurrent, int pageSize) + public TableData Load(int pageCurrent, int pageSize) { - var result = new GridData + var result = new TableData { count = _unitWork.Find(null).Count(), data = _unitWork.Find(pageCurrent, pageSize, "ModifyDate descending", null).ToList() @@ -42,18 +42,18 @@ namespace OpenAuth.App } public void SaveForm(string keyValue, WFFrmMain entity) - { - + { + if (string.IsNullOrEmpty(keyValue)) { _unitWork.Add(entity); } else { - entity.Id = keyValue; - _unitWork.Update(u =>u.Id, entity); - } - _unitWork.Save(); + entity.Id = keyValue; + _unitWork.Update(u =>u.Id, entity); + } + _unitWork.Save(); } } } diff --git a/OpenAuth.App/WFProcessInstanceService.cs b/OpenAuth.App/WFProcessInstanceService.cs index 57902b18..ad404c31 100644 --- a/OpenAuth.App/WFProcessInstanceService.cs +++ b/OpenAuth.App/WFProcessInstanceService.cs @@ -3,8 +3,8 @@ using System.Collections.Generic; using System.Linq; using Infrastructure; using OpenAuth.App.Extention; +using OpenAuth.App.Response; using OpenAuth.App.SSO; -using OpenAuth.App.ViewModel; using OpenAuth.Repository.Domain; using OpenAuth.Repository.Interface; @@ -298,10 +298,10 @@ namespace OpenAuth.App } #endregion - public GridData Load(string userid, string type, int pageCurrent, int pageSize) + public TableData Load(string userid, string type, int pageCurrent, int pageSize) { //todo:待办/已办/我的 - var result = new GridData(); + var result = new TableData(); result.count = _unitWork.Find(u => u.CreateUserId == userid).Count(); if (type == "inbox") //待办事项 diff --git a/OpenAuth.App/WFSchemeService.cs b/OpenAuth.App/WFSchemeService.cs index 44557e3a..56c29745 100644 --- a/OpenAuth.App/WFSchemeService.cs +++ b/OpenAuth.App/WFSchemeService.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; -using OpenAuth.App.ViewModel; +using OpenAuth.App.Response; using OpenAuth.Repository.Domain; using OpenAuth.Repository.Interface; @@ -102,9 +102,9 @@ namespace OpenAuth.App return _unitWork.Find(null).ToList(); } - public GridData Load(int pageCurrent, int pageSize) + public TableData Load(int pageCurrent, int pageSize) { - var result = new GridData(); + var result = new TableData(); result.count = _unitWork.Find(null).Count(); result.data = _unitWork.Find(pageCurrent, pageSize, "ModifyDate descending", null).ToList(); diff --git a/OpenAuth.Mvc/Areas/FlowManage/Controllers/FlowDesignController.cs b/OpenAuth.Mvc/Areas/FlowManage/Controllers/FlowDesignController.cs index 73ed9206..275483b5 100644 --- a/OpenAuth.Mvc/Areas/FlowManage/Controllers/FlowDesignController.cs +++ b/OpenAuth.Mvc/Areas/FlowManage/Controllers/FlowDesignController.cs @@ -6,7 +6,6 @@ using System.Web.UI.WebControls; using Infrastructure; using OpenAuth.App; using OpenAuth.App.SSO; -using OpenAuth.App.ViewModel; using OpenAuth.Mvc.Controllers; using OpenAuth.Repository.Domain; diff --git a/OpenAuth.Mvc/Controllers/BaseController.cs b/OpenAuth.Mvc/Controllers/BaseController.cs index b1aacd5e..7242067f 100644 --- a/OpenAuth.Mvc/Controllers/BaseController.cs +++ b/OpenAuth.Mvc/Controllers/BaseController.cs @@ -19,8 +19,8 @@ using System.Reflection; using System.Web; using System.Web.Mvc; using Infrastructure; +using OpenAuth.App.Response; using OpenAuth.App.SSO; -using OpenAuth.App.ViewModel; namespace OpenAuth.Mvc.Controllers { diff --git a/OpenAuth.Mvc/Controllers/CategoriesController.cs b/OpenAuth.Mvc/Controllers/CategoriesController.cs index e563f685..815b795f 100644 --- a/OpenAuth.Mvc/Controllers/CategoriesController.cs +++ b/OpenAuth.Mvc/Controllers/CategoriesController.cs @@ -2,7 +2,7 @@ using System.Web.Http; using System.Web.Mvc; using Infrastructure; -using LwSolution.App; +using OpenAuth.App; using OpenAuth.App.Request; using OpenAuth.App.Response; using OpenAuth.Repository.Domain; diff --git a/OpenAuth.Mvc/Controllers/ModuleManagerController.cs b/OpenAuth.Mvc/Controllers/ModuleManagerController.cs index 393d7c46..caddb0ce 100644 --- a/OpenAuth.Mvc/Controllers/ModuleManagerController.cs +++ b/OpenAuth.Mvc/Controllers/ModuleManagerController.cs @@ -1,13 +1,13 @@ using Infrastructure; using OpenAuth.App; using OpenAuth.App.SSO; -using OpenAuth.App.ViewModel; using OpenAuth.Mvc.Models; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Web.Mvc; +using OpenAuth.App.Response; using OpenAuth.Repository.Domain; namespace OpenAuth.Mvc.Controllers diff --git a/OpenAuth.Mvc/Controllers/UserManagerController.cs b/OpenAuth.Mvc/Controllers/UserManagerController.cs index 45465296..ed20f228 100644 --- a/OpenAuth.Mvc/Controllers/UserManagerController.cs +++ b/OpenAuth.Mvc/Controllers/UserManagerController.cs @@ -5,7 +5,7 @@ using System.Web.Mvc; using Infrastructure; using OpenAuth.App; using OpenAuth.App.Request; -using OpenAuth.App.ViewModel; +using OpenAuth.App.Response; using OpenAuth.Mvc.Models; namespace OpenAuth.Mvc.Controllers diff --git a/OpenAuth.Mvc/Controllers/UserSessionController.cs b/OpenAuth.Mvc/Controllers/UserSessionController.cs index 6064b0b6..10caf514 100644 --- a/OpenAuth.Mvc/Controllers/UserSessionController.cs +++ b/OpenAuth.Mvc/Controllers/UserSessionController.cs @@ -1,8 +1,8 @@ using System.Linq; using System.Web.Mvc; using Infrastructure; +using OpenAuth.App.Response; using OpenAuth.App.SSO; -using OpenAuth.App.ViewModel; namespace OpenAuth.Mvc.Controllers { @@ -28,7 +28,7 @@ namespace OpenAuth.Mvc.Controllers { query = query.Where(u => u.ParentId == pId).ToList(); } - var data = new GridData + var data = new TableData { data = query, count = query.Count(), diff --git a/OpenAuth.UnitTest/TestUser.cs b/OpenAuth.UnitTest/TestUser.cs index 72eb4823..52e965be 100644 --- a/OpenAuth.UnitTest/TestUser.cs +++ b/OpenAuth.UnitTest/TestUser.cs @@ -2,7 +2,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using OpenAuth.App; using OpenAuth.App.Request; -using OpenAuth.App.ViewModel; +using OpenAuth.App.Response; namespace OpenAuth.UnitTest { diff --git a/OpenAuth.WebApi/Areas/SSO/Controllers/CheckController.cs b/OpenAuth.WebApi/Areas/SSO/Controllers/CheckController.cs index 1d271de2..85b190bb 100644 --- a/OpenAuth.WebApi/Areas/SSO/Controllers/CheckController.cs +++ b/OpenAuth.WebApi/Areas/SSO/Controllers/CheckController.cs @@ -16,7 +16,7 @@ using Infrastructure.Cache; using OpenAuth.App; using OpenAuth.App.SSO; using System.Web.Mvc; -using OpenAuth.App.ViewModel; +using OpenAuth.App.Response; namespace OpenAuth.WebApi.Areas.SSO.Controllers {