From c3713906c5cc9d6190e62e2aa5fc5f2dcea4531f Mon Sep 17 00:00:00 2001
From: lx748 <576428496@qq.com>
Date: Fri, 28 Jun 2019 13:15:39 +0800
Subject: [PATCH] feature

---
 ServiceSite/BLL/AuthService/AuthService.cs    | 108 +++++++++
 ServiceSite/BLL/AuthService/IAuthService.cs   |  17 ++
 .../IOrganizationService.cs                   |  19 ++
 .../OrganizationService.cs                    | 213 ++++++++++++++++++
 .../BLL/SeaSky.TemplateProject.BLL.csproj     |   6 +
 ServiceSite/BLL/UserService/IUserService.cs   |  25 ++
 ServiceSite/BLL/UserService/UserService.cs    | 196 ++++++++++++++++
 .../DAL/AuthTable/AuthTableRepository.cs      |  26 +++
 .../DAL/AuthTable/IAuthTableRepository.cs     |  16 ++
 .../IOrganizationTableRepository.cs           |  16 ++
 .../OrganizationTableRepository.cs            |  40 ++++
 .../DAL/SeaSky.TemplateProject.DAL.csproj     |   6 +
 .../DAL/UserTable/IUserTableRepository.cs     |  16 ++
 .../DAL/UserTable/UserTableRepository.cs      |  41 ++++
 ServiceSite/Model/AuthModel/AuthInputModel.cs |  12 +
 ServiceSite/Model/AuthModel/AuthModel.cs      |  38 ++++
 .../Model/AuthModel/AuthOutputModel.cs        |  12 +
 .../OrganizationInputModel.cs                 |  12 +
 .../OrganizationModel/OrganizationModel.cs    |  41 ++++
 .../OrganizationOutputModel.cs                |  13 ++
 .../Model/SeaSky.TemplateProject.Model.csproj |   9 +
 ServiceSite/Model/UserModel/UserInputModel.cs |  12 +
 ServiceSite/Model/UserModel/UserModel.cs      |  36 +++
 .../Model/UserModel/UserOutputModel.cs        |  12 +
 .../WebApi/Controllers/AdminController.cs     | 136 +++++++++++
 .../WebApi/Controllers/Filters/UserFilter.cs  |  27 +++
 .../SeaSky.TemplateProject.WebApi.csproj      |  18 +-
 ServiceSite/WebApi/Views/Admin/Index.cshtml   |   7 +
 .../WebApi/Views/Shared/_Layout.cshtml        |  11 +-
 ServiceSite/WebApi/Web.config                 |  84 ++++---
 ServiceSite/WebApi/packages.config            |   1 -
 31 files changed, 1159 insertions(+), 67 deletions(-)
 create mode 100644 ServiceSite/BLL/AuthService/AuthService.cs
 create mode 100644 ServiceSite/BLL/AuthService/IAuthService.cs
 create mode 100644 ServiceSite/BLL/OrganizationService/IOrganizationService.cs
 create mode 100644 ServiceSite/BLL/OrganizationService/OrganizationService.cs
 create mode 100644 ServiceSite/BLL/UserService/IUserService.cs
 create mode 100644 ServiceSite/BLL/UserService/UserService.cs
 create mode 100644 ServiceSite/DAL/AuthTable/AuthTableRepository.cs
 create mode 100644 ServiceSite/DAL/AuthTable/IAuthTableRepository.cs
 create mode 100644 ServiceSite/DAL/OrganizationTable/IOrganizationTableRepository.cs
 create mode 100644 ServiceSite/DAL/OrganizationTable/OrganizationTableRepository.cs
 create mode 100644 ServiceSite/DAL/UserTable/IUserTableRepository.cs
 create mode 100644 ServiceSite/DAL/UserTable/UserTableRepository.cs
 create mode 100644 ServiceSite/Model/AuthModel/AuthInputModel.cs
 create mode 100644 ServiceSite/Model/AuthModel/AuthModel.cs
 create mode 100644 ServiceSite/Model/AuthModel/AuthOutputModel.cs
 create mode 100644 ServiceSite/Model/OrganizationModel/OrganizationInputModel.cs
 create mode 100644 ServiceSite/Model/OrganizationModel/OrganizationModel.cs
 create mode 100644 ServiceSite/Model/OrganizationModel/OrganizationOutputModel.cs
 create mode 100644 ServiceSite/Model/UserModel/UserInputModel.cs
 create mode 100644 ServiceSite/Model/UserModel/UserModel.cs
 create mode 100644 ServiceSite/Model/UserModel/UserOutputModel.cs
 create mode 100644 ServiceSite/WebApi/Controllers/AdminController.cs
 create mode 100644 ServiceSite/WebApi/Controllers/Filters/UserFilter.cs
 create mode 100644 ServiceSite/WebApi/Views/Admin/Index.cshtml

diff --git a/ServiceSite/BLL/AuthService/AuthService.cs b/ServiceSite/BLL/AuthService/AuthService.cs
new file mode 100644
index 0000000..0ddced5
--- /dev/null
+++ b/ServiceSite/BLL/AuthService/AuthService.cs
@@ -0,0 +1,108 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Microsoft.Practices.Unity;
+using SeaSky.StandardLib.MyModel;
+using SeaSky.TemplateProject.DAL;
+using SeaSky.TemplateProject.Model;
+using SeaSky.TemplateProject.Model.Enum;
+
+namespace SeaSky.TemplateProject.BLL
+{
+    public class AuthService : IAuthService
+    {
+        [Dependency]
+        public IAuthTableRepository AuthTableRepository { get; set; }
+
+        /// <summary>
+        /// 鍒涘缓鏉冮檺
+        /// </summary>
+        /// <param name="auth"></param>
+        /// <returns></returns>
+        public BaseResultModel<AuthOutputModel> CreateAuth(AuthInputModel auth)
+        {
+            try
+            {
+                if (auth.OrganizationID == null || auth.OrganizationID == Guid.Empty)
+                {
+                    return new ErrorResultModel<AuthOutputModel>(EnumErrorCode.鍙傛暟鏍¢獙鏈€氳繃,"缁勭粐ID涓嶈兘涓虹┖");
+                }
+                if (auth.UserID == null || auth.UserID == Guid.Empty)
+                {
+                    return new ErrorResultModel<AuthOutputModel>(EnumErrorCode.鍙傛暟鏍¢獙鏈€氳繃, "鐢ㄦ埛ID涓嶈兘涓虹┖");
+                }
+               DataTable dt =  AuthTableRepository.ListTable(new AuthInputModel() { OrganizationID = auth.OrganizationID, UserID = auth.UserID });
+                if (dt.Rows.Count > 0)
+                {
+                    return new ErrorResultModel<AuthOutputModel>(EnumErrorCode.鍙傛暟鏍¢獙鏈€氳繃, "鐢ㄦ埛鍜岀粍缁囧叧绯诲敮涓€");
+                }
+                SuccessResultModel<AuthOutputModel> model = new SuccessResultModel<AuthOutputModel>();
+                model.Data = AuthTableRepository.InsertAndReturn(auth);
+                return model;
+            }
+            catch (Exception e)
+            {
+                LogWriter.WriteLog(EnumLogLevel.Error,"CreateAuth","","","",e);
+                return new ErrorResultModel<AuthOutputModel>(EnumErrorCode.绯荤粺寮傚父, "绯荤粺寮傚父");
+            }
+        }
+
+        /// <summary>
+        /// 鏌ヨ鐢ㄦ埛鏉冮檺
+        /// </summary>
+        /// <param name="userId"></param>
+        /// <returns></returns>
+        public BaseResultModel<List<AuthOutputModel>> ListAuthByUser(Guid userId)
+        {
+            try
+            {
+                if (userId == null || userId == Guid.Empty)
+                {
+                    return new ErrorResultModel<List<AuthOutputModel>>(EnumErrorCode.鍙傛暟鏍¢獙鏈€氳繃, "鐢ㄦ埛ID涓嶈兘涓虹┖");
+                }
+                SuccessResultModel<List<AuthOutputModel>> model = new SuccessResultModel<List<AuthOutputModel>>();
+                model.Data = AuthTableRepository.List(new AuthInputModel() { UserID = userId }).ToList<AuthOutputModel>();
+                return model;
+            }
+            catch (Exception e)
+            {
+                LogWriter.WriteLog(EnumLogLevel.Error, "ListAuthByUser", "", "", "", e);
+                return new ErrorResultModel<List<AuthOutputModel>>(EnumErrorCode.绯荤粺寮傚父, "绯荤粺寮傚父");
+            }
+            throw new NotImplementedException();
+        }
+
+        /// <summary>
+        /// 鍒犻櫎鏉冮檺
+        /// </summary>
+        /// <param name="userId"></param>
+        /// <param name="organizationId"></param>
+        /// <returns></returns>
+        public BaseResultModel<int> RemoveAuth(Guid userId, Guid organizationId)
+        {
+            try
+            {
+                if (organizationId == null || organizationId == Guid.Empty)
+                {
+                    return new ErrorResultModel<int>(EnumErrorCode.鍙傛暟鏍¢獙鏈€氳繃, "缁勭粐ID涓嶈兘涓虹┖");
+                }
+                if (userId == null || userId == Guid.Empty)
+                {
+                    return new ErrorResultModel<int>(EnumErrorCode.鍙傛暟鏍¢獙鏈€氳繃, "鐢ㄦ埛ID涓嶈兘涓虹┖");
+                }
+                SuccessResultModel<int> model = new SuccessResultModel<int>();
+                model.Data = AuthTableRepository.DeleteWithModel(new AuthInputModel() { UserID = userId,OrganizationID=organizationId});
+                return model;
+            }
+            catch (Exception e)
+            {
+                LogWriter.WriteLog(EnumLogLevel.Error, "RemoveAuth", "", "", "", e);
+                return new ErrorResultModel<int>(EnumErrorCode.绯荤粺寮傚父, "绯荤粺寮傚父");
+            }
+        }
+        
+    }
+}
diff --git a/ServiceSite/BLL/AuthService/IAuthService.cs b/ServiceSite/BLL/AuthService/IAuthService.cs
new file mode 100644
index 0000000..04ec82f
--- /dev/null
+++ b/ServiceSite/BLL/AuthService/IAuthService.cs
@@ -0,0 +1,17 @@
+锘縰sing SeaSky.StandardLib.MyModel;
+using SeaSky.TemplateProject.Model;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace SeaSky.TemplateProject.BLL
+{
+    public interface IAuthService
+    {
+        BaseResultModel<List<AuthOutputModel>> ListAuthByUser(Guid? userId);
+        BaseResultModel<AuthOutputModel> CreateAuth(AuthInputModel auth);
+        BaseResultModel<int> RemoveAuth(Guid userId, Guid organizationId);
+    }
+}
diff --git a/ServiceSite/BLL/OrganizationService/IOrganizationService.cs b/ServiceSite/BLL/OrganizationService/IOrganizationService.cs
new file mode 100644
index 0000000..6448352
--- /dev/null
+++ b/ServiceSite/BLL/OrganizationService/IOrganizationService.cs
@@ -0,0 +1,19 @@
+锘縰sing SeaSky.StandardLib.MyModel;
+using SeaSky.TemplateProject.Model;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace SeaSky.TemplateProject.BLL
+{
+    public interface IOrganizationService
+    {
+        BaseResultModel<OrganizationOutputModel> CreateOrganization(OrganizationInputModel organization);
+        BaseResultModel<OrganizationOutputModel> ModifyOrganization(OrganizationInputModel organization);
+        BaseResultModel<int> RemoveOrganization(Guid organizationId);
+        BaseResultModel<List<OrganizationOutputModel>> ListAllOrganizationTree();
+        BaseResultModel<List<OrganizationOutputModel>> ListOrganizationByAuth(Guid? userId);
+    }
+}
diff --git a/ServiceSite/BLL/OrganizationService/OrganizationService.cs b/ServiceSite/BLL/OrganizationService/OrganizationService.cs
new file mode 100644
index 0000000..bff718a
--- /dev/null
+++ b/ServiceSite/BLL/OrganizationService/OrganizationService.cs
@@ -0,0 +1,213 @@
+锘縰sing Microsoft.Practices.Unity;
+using SeaSky.StandardLib.MyModel;
+using SeaSky.TemplateProject.DAL;
+using SeaSky.TemplateProject.Model;
+using SeaSky.TemplateProject.Model.Enum;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace SeaSky.TemplateProject.BLL
+{
+    public class OrganizationService : IOrganizationService
+    {
+        [Dependency]
+        public IOrganizationTableRepository OrganizationTableRepository { get; set; }
+        private List<OrganizationOutputModel> TreeAll = new List<OrganizationOutputModel>();
+        private string RootNodeNo = "0000000";//鏍硅妭鐐圭紪鍙�
+
+        /// <summary>
+        /// 鍒涘缓缁勭粐
+        /// </summary>
+        /// <param name="organization"></param>
+        /// <returns></returns>
+        public BaseResultModel<OrganizationOutputModel> CreateOrganization(OrganizationInputModel organization)
+        {
+            try
+            {
+                if (string.IsNullOrEmpty(organization.OrganizationName))
+                {
+                    return new ErrorResultModel<OrganizationOutputModel>(EnumErrorCode.鍙傛暟鏍¢獙鏈€氳繃, "缁勭粐鍚嶄笉鑳戒负绌�");
+                }
+                if (string.IsNullOrEmpty(organization.OrganizationNo))
+                {
+                    return new ErrorResultModel<OrganizationOutputModel>(EnumErrorCode.鍙傛暟鏍¢獙鏈€氳繃, "缁勭粐缂栧彿涓嶈兘涓虹┖");
+                }
+                if (OrganizationTableRepository.SelectWithModel(new OrganizationInputModel() { OrganizationNo = organization.OrganizationNo }) != null)
+                {
+                    return new ErrorResultModel<OrganizationOutputModel>(EnumErrorCode.鍙傛暟鏍¢獙鏈€氳繃, "缁勭粐缂栧彿涓嶈兘閲嶅");
+                }
+                if (string.IsNullOrEmpty(organization.ParentNo))
+                {
+                    organization.ParentNo = RootNodeNo;
+                }
+                SuccessResultModel<OrganizationOutputModel> model = new SuccessResultModel<OrganizationOutputModel>();
+                model.Data = OrganizationTableRepository.InsertAndReturn(organization);
+                return model;
+            }
+            catch (Exception e)
+            {
+                LogWriter.WriteLog(EnumLogLevel.Error, "CreateOrganization", "", "", "", e);
+                return new ErrorResultModel<OrganizationOutputModel>(EnumErrorCode.绯荤粺寮傚父, "绯荤粺寮傚父");
+            }
+        }
+        /// <summary>
+        /// 鑾峰彇鍏ㄩ儴缁勭粐
+        /// </summary>
+        /// <returns>杩斿洖鏍戠粨鏋�</returns>
+        public BaseResultModel<List<OrganizationOutputModel>> ListAllOrganizationTree()
+        {
+            try
+            {
+                SuccessResultModel<List<OrganizationOutputModel>> model = new SuccessResultModel<List<OrganizationOutputModel>>();
+                TreeAll = OrganizationTableRepository.List().ToList<OrganizationOutputModel>();
+                List<OrganizationOutputModel> tree = TreeAll.Where(p => p.ParentNo != null && p.ParentNo == RootNodeNo).ToList();
+                foreach (OrganizationOutputModel item in tree)
+                {
+                    item.ChildrenOrganizationList = GetChildrenNode(item);
+                }
+                model.Data = tree;
+                return model;
+            }
+            catch (Exception e)
+            {
+                LogWriter.WriteLog(EnumLogLevel.Error, "ListAllOrganizationTree", "", "", "", e);
+                return new ErrorResultModel<List<OrganizationOutputModel>>(EnumErrorCode.绯荤粺寮傚父, "绯荤粺寮傚父");
+            }
+        }
+
+        /// <summary>
+        /// 閫氳繃鏉冮檺杩斿洖缁勭粐
+        /// </summary>
+        /// <param name="userId"></param>
+        /// <returns>杩斿洖鏍戠粨鏋�</returns>
+        public BaseResultModel<List<OrganizationOutputModel>> ListOrganizationByAuth(Guid? userId)
+        {
+            try
+            {
+                if (userId == null || userId == Guid.Empty)
+                {
+                    return new ErrorResultModel<List<OrganizationOutputModel>>(EnumErrorCode.鍙傛暟鏍¢獙鏈€氳繃, "鐢ㄦ埛ID涓嶈兘涓虹┖");
+                }
+                SuccessResultModel<List<OrganizationOutputModel>> model = new SuccessResultModel<List<OrganizationOutputModel>>();
+                TreeAll = OrganizationTableRepository.List().ToList<OrganizationOutputModel>();
+                List<OrganizationOutputModel> TreeAuth = new List<OrganizationOutputModel>();
+                TreeAuth = OrganizationTableRepository.ListOrganizationByAuth(userId).ToList<OrganizationOutputModel>();
+                List<OrganizationOutputModel> tree = new List<OrganizationOutputModel>();
+                foreach (OrganizationOutputModel item in TreeAuth)
+                {
+                    item.ChildrenOrganizationList = GetChildrenNode(item);
+                    tree.Add(GetParentNode(item));
+                }
+                tree = tree.Distinct().ToList();
+                model.Data = tree;
+                return model;
+            }
+            catch (Exception e)
+            {
+                LogWriter.WriteLog(EnumLogLevel.Error, "ListOrganizationByAuth", "", "", "", e);
+                return new ErrorResultModel<List<OrganizationOutputModel>>(EnumErrorCode.绯荤粺寮傚父, "绯荤粺寮傚父");
+            }
+            throw new NotImplementedException();
+        }
+
+        /// <summary>
+        /// 淇敼缁勭粐
+        /// </summary>
+        /// <param name="organization"></param>
+        /// <returns></returns>
+        public BaseResultModel<OrganizationOutputModel> ModifyOrganization(OrganizationInputModel organization)
+        {
+            try
+            {
+                if (String.IsNullOrEmpty(organization.OrganizationNo))
+                {
+                    return new ErrorResultModel<OrganizationOutputModel>(EnumErrorCode.鍙傛暟鏍¢獙鏈€氳繃,"缁勭粐缂栧彿涓嶈兘涓虹┖");
+                }
+                if (String.IsNullOrEmpty(organization.OrganizationName))
+                {
+                    return new ErrorResultModel<OrganizationOutputModel>(EnumErrorCode.鍙傛暟鏍¢獙鏈€氳繃, "缁勭粐鍚嶇О涓嶈兘涓虹┖");
+                }
+                OrganizationOutputModel organizationOld =  OrganizationTableRepository.SelectWithModel(new OrganizationInputModel() { OrganizationNo = organization.OrganizationNo });
+                if (organizationOld == null || organizationOld.OrganizationID == organization.OrganizationID)
+                {
+                    SuccessResultModel<OrganizationOutputModel> model = new SuccessResultModel<OrganizationOutputModel>();
+                    model.Data = OrganizationTableRepository.UpdateWithKeysAndReturn(organization);
+                    return model;
+                }
+                else
+                {
+                    return new ErrorResultModel<OrganizationOutputModel>(EnumErrorCode.鍙傛暟鏍¢獙鏈€氳繃, "缁勭粐缂栧彿涓嶈兘閲嶅");
+                }
+            }
+            catch (Exception e)
+            {
+                LogWriter.WriteLog(EnumLogLevel.Error, "ModifyOrganization", "", "", "", e);
+                return new ErrorResultModel<OrganizationOutputModel>(EnumErrorCode.绯荤粺寮傚父, "绯荤粺寮傚父");
+            }
+        }
+
+        /// <summary>
+        /// 鍒犻櫎缁勭粐
+        /// </summary>
+        /// <param name="organizationId"></param>
+        /// <returns></returns>
+        public BaseResultModel<int> RemoveOrganization(Guid organizationId)
+        {
+            try
+            {
+                if (organizationId == null || organizationId == Guid.Empty)
+                {
+                    return new ErrorResultModel<int>(EnumErrorCode.鍙傛暟鏍¢獙鏈€氳繃, "缁勭粐ID涓嶈兘涓虹┖");
+                }
+
+                SuccessResultModel<int> model = new SuccessResultModel<int>();
+                model.Data = OrganizationTableRepository.DeleteWithKeys(new OrganizationOutputModel() { OrganizationID = organizationId});
+                return model;
+            }
+            catch (Exception e)
+            {
+                LogWriter.WriteLog(EnumLogLevel.Error, "RemoveOrganization", "", "", "", e);
+                return new ErrorResultModel<int>(EnumErrorCode.绯荤粺寮傚父, "绯荤粺寮傚父");
+            }
+        }
+
+        /// <summary>
+        /// 鑾峰彇瀛愯妭鐐�
+        /// </summary>
+        /// <param name="organization"></param>
+        /// <returns></returns>
+        private List<OrganizationOutputModel> GetChildrenNode(OrganizationOutputModel organization)
+        {
+            List<OrganizationOutputModel> children = TreeAll.Where(p => p.ParentNo == organization.OrganizationNo).ToList();
+            foreach (OrganizationOutputModel item in children)
+            {
+                item.ChildrenOrganizationList = GetChildrenNode(item);
+            }
+            return children;
+        }
+
+        /// <summary>
+        /// 鑾峰彇鐖惰妭鐐�
+        /// </summary>
+        /// <param name="organization"></param>
+        /// <returns></returns>
+        private OrganizationOutputModel GetParentNode(OrganizationOutputModel organization)
+        {
+            if (organization.ParentNo != null)
+            {
+                OrganizationOutputModel parent = TreeAll.Where(p => p.OrganizationNo == organization.ParentNo).FirstOrDefault();
+                if (parent.ChildrenOrganizationList == null)
+                {
+                    parent.ChildrenOrganizationList = new List<OrganizationOutputModel>();
+                }
+                parent.ChildrenOrganizationList.Add(organization);
+                parent = GetParentNode(parent);
+                return parent;
+            }
+            return organization;
+        }
+    }
+}
diff --git a/ServiceSite/BLL/SeaSky.TemplateProject.BLL.csproj b/ServiceSite/BLL/SeaSky.TemplateProject.BLL.csproj
index 6ac414b..46dacef 100644
--- a/ServiceSite/BLL/SeaSky.TemplateProject.BLL.csproj
+++ b/ServiceSite/BLL/SeaSky.TemplateProject.BLL.csproj
@@ -63,10 +63,16 @@
   </ItemGroup>
   <ItemGroup>
     <Compile Include="ApplicationContext.cs" />
+    <Compile Include="AuthService\AuthService.cs" />
+    <Compile Include="AuthService\IAuthService.cs" />
     <Compile Include="LogWriter.cs" />
+    <Compile Include="OrganizationService\IOrganizationService.cs" />
+    <Compile Include="OrganizationService\OrganizationService.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="TestService\ITestService.cs" />
     <Compile Include="TestService\TestService.cs" />
+    <Compile Include="UserService\IUserService.cs" />
+    <Compile Include="UserService\UserService.cs" />
   </ItemGroup>
   <ItemGroup />
   <ItemGroup>
diff --git a/ServiceSite/BLL/UserService/IUserService.cs b/ServiceSite/BLL/UserService/IUserService.cs
new file mode 100644
index 0000000..f50091a
--- /dev/null
+++ b/ServiceSite/BLL/UserService/IUserService.cs
@@ -0,0 +1,25 @@
+锘縰sing SeaSky.StandardLib.MyModel;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using SeaSky.TemplateProject.Model;
+
+namespace SeaSky.TemplateProject.BLL
+{
+    public interface IUserService
+    {
+        BaseResultModel<UserOutputModel> GetUser(Guid? userId);
+
+        BaseResultModel<UserOutputModel> GetUser(string jobNo);
+
+        BaseResultModel<PageModel<UserOutputModel>> ListUser(UserInputModel user);
+
+        BaseResultModel<UserOutputModel> CreateUser(UserInputModel user);
+
+        BaseResultModel<int> RemoveUser(Guid userId);
+
+        BaseResultModel<UserOutputModel> ModifyUser(UserInputModel user);
+    }
+}
diff --git a/ServiceSite/BLL/UserService/UserService.cs b/ServiceSite/BLL/UserService/UserService.cs
new file mode 100644
index 0000000..e1eb7cb
--- /dev/null
+++ b/ServiceSite/BLL/UserService/UserService.cs
@@ -0,0 +1,196 @@
+锘縰sing SeaSky.StandardLib.MyModel;
+using SeaSky.TemplateProject.DAL;
+using SeaSky.TemplateProject.Model;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Microsoft.Practices.Unity;
+using SeaSky.TemplateProject.Model.Enum;
+
+namespace SeaSky.TemplateProject.BLL
+{
+    public class UserService : IUserService
+    {
+        [Dependency]
+        // 渚濊禆娉ㄥ叆
+        public IUserTableRepository UserTableRepository { get; set; }
+
+        /// <summary>
+        /// 鍒涘缓鐢ㄦ埛
+        /// </summary>
+        /// <param name="user"></param>
+        /// <returns></returns>
+        public BaseResultModel<UserOutputModel> CreateUser(UserInputModel user)
+        {
+            try
+            {
+                if (string.IsNullOrEmpty(user.JobNo))
+                {
+                    return new ErrorResultModel<UserOutputModel>(EnumErrorCode.鍙傛暟鏍¢獙鏈€氳繃, "宸ュ彿涓嶈兘涓虹┖");
+                }
+                if (string.IsNullOrEmpty(user.RealName))
+                {
+                    return new ErrorResultModel<UserOutputModel>(EnumErrorCode.鍙傛暟鏍¢獙鏈€氳繃, "鐢ㄦ埛鍚嶇О涓嶈兘涓虹┖");
+                }
+                user.RealName.Trim();
+                UserOutputModel temp = UserTableRepository.SelectWithModel(new UserInputModel { JobNo = user.JobNo });
+                if (temp == null)
+                {
+                    SuccessResultModel<UserOutputModel> model = new SuccessResultModel<UserOutputModel>();
+                    model.Data = UserTableRepository.InsertAndReturn(user);
+                    return model;
+                }
+                else
+                {
+                    return new ErrorResultModel<UserOutputModel>(EnumErrorCode.鍙傛暟鏍¢獙鏈€氳繃, "宸ュ彿涓嶈兘閲嶅");
+                }
+            }
+            catch (Exception e)
+            {
+                LogWriter.WriteLog(EnumLogLevel.Error, "CreateUser", "", "", "", e);
+                return new ErrorResultModel<UserOutputModel>(EnumErrorCode.绯荤粺寮傚父, "绯荤粺寮傚父");
+            }
+        }
+
+        /// <summary>
+        /// 鐢╱serID鏌ヨ鐢ㄦ埛
+        /// </summary>
+        /// <param name="userId"></param>
+        /// <returns></returns>
+        public BaseResultModel<UserOutputModel> GetUser(Guid? userId)
+        {
+            try
+            {
+                if (userId == null || userId == Guid.Empty)
+                {
+                    return new ErrorResultModel<UserOutputModel>(EnumErrorCode.鍙傛暟鏍¢獙鏈€氳繃, "Id涓嶈兘涓虹┖");
+                }
+                UserInputModel user = new UserInputModel();
+                user.UserID = userId;
+                SuccessResultModel<UserOutputModel> model = new SuccessResultModel<UserOutputModel>();
+                model.Data = UserTableRepository.SelectWithKeys(user);
+                return model;
+            }
+            catch (Exception e)
+            {
+                LogWriter.WriteLog(EnumLogLevel.Error, "GetUser", "", "", "", e);
+                return new ErrorResultModel<UserOutputModel>(EnumErrorCode.绯荤粺寮傚父, "绯荤粺寮傚父");
+            }
+            throw new NotImplementedException();
+        }
+
+        /// <summary>
+        /// 鐢ㄥ伐鍙锋煡璇㈢敤鎴�
+        /// </summary>
+        /// <param name="jobNo"></param>
+        /// <returns></returns>
+        public BaseResultModel<UserOutputModel> GetUser(string jobNo)
+        {
+            try
+            {
+                if (string.IsNullOrEmpty(jobNo))
+                {
+                    return new ErrorResultModel<UserOutputModel>(EnumErrorCode.鍙傛暟鏍¢獙鏈€氳繃, "宸ュ彿涓嶈兘涓虹┖");
+                }
+                UserInputModel user = new UserInputModel();
+                user.JobNo = jobNo;
+                SuccessResultModel<UserOutputModel> model = new SuccessResultModel<UserOutputModel>();
+                model.Data = UserTableRepository.SelectWithModel(user);
+                return model;
+            }
+            catch (Exception e)
+            {
+                LogWriter.WriteLog(EnumLogLevel.Error, "GetUser", "", "", "", e);
+                return new ErrorResultModel<UserOutputModel>(EnumErrorCode.绯荤粺寮傚父, "绯荤粺寮傚父");
+            }
+        }
+
+        /// <summary>
+        /// 鏌ヨ鐢ㄦ埛
+        /// </summary>
+        /// <param name="user"></param>
+        /// <returns></returns>
+        public BaseResultModel<PageModel<UserOutputModel>> ListUser(UserInputModel user)
+        {
+            try
+            {
+                SuccessResultModel<PageModel<UserOutputModel>> model = new SuccessResultModel<PageModel<UserOutputModel>>();
+                model.Data = UserTableRepository.ListPage(user);
+                return model;
+            }
+            catch (Exception e)
+            {
+                LogWriter.WriteLog(EnumLogLevel.Error, "ListUser", "", "", "", e);
+                return new ErrorResultModel<PageModel<UserOutputModel>>(EnumErrorCode.绯荤粺寮傚父, "绯荤粺寮傚父");
+            }
+        }
+
+        /// <summary>
+        /// 淇敼鐢ㄦ埛
+        /// </summary>
+        /// <param name="user"></param>
+        /// <returns></returns>
+        public BaseResultModel<UserOutputModel> ModifyUser(UserInputModel user)
+        {
+            try
+            {
+                if (user.UserID == null || user.UserID == Guid.Empty)
+                {
+                    return new ErrorResultModel<UserOutputModel>(EnumErrorCode.鍙傛暟鏍¢獙鏈€氳繃, "ID涓嶈兘涓虹┖");
+                }
+                if (string.IsNullOrEmpty(user.JobNo))
+                {
+                    return new ErrorResultModel<UserOutputModel>(EnumErrorCode.鍙傛暟鏍¢獙鏈€氳繃, "宸ュ彿涓嶈兘涓虹┖");
+                }
+                if (string.IsNullOrEmpty(user.RealName))
+                {
+                    return new ErrorResultModel<UserOutputModel>(EnumErrorCode.鍙傛暟鏍¢獙鏈€氳繃, "鐢ㄦ埛鍚嶇О涓嶈兘涓虹┖");
+                }
+                user.RealName.Trim();
+                UserOutputModel temp = UserTableRepository.SelectWithModel(new UserInputModel { JobNo = user.JobNo });
+                if (temp == null || temp.UserID == user.UserID)
+                {
+                    SuccessResultModel<UserOutputModel> model = new SuccessResultModel<UserOutputModel>();
+                    model.Data = UserTableRepository.UpdateWithKeysAndReturn(user);
+                    return model;
+                }
+                else
+                {
+                    return new ErrorResultModel<UserOutputModel>(EnumErrorCode.鍙傛暟鏍¢獙鏈€氳繃, "宸ュ彿涓嶈兘閲嶅");
+                }
+            }
+            catch (Exception e)
+            {
+                LogWriter.WriteLog(EnumLogLevel.Error, "ModifyUser", "", "", "", e);
+                return new ErrorResultModel<UserOutputModel>(EnumErrorCode.绯荤粺寮傚父, "绯荤粺寮傚父");
+            }
+        }
+
+        /// <summary>
+        /// 鍒犻櫎鐢ㄦ埛
+        /// </summary>
+        /// <param name="userId"></param>
+        /// <returns></returns>
+        public BaseResultModel<int> RemoveUser(Guid userId)
+        {
+            try
+            {
+                if (userId == null || userId == Guid.Empty)
+                {
+                    return new ErrorResultModel<int>(EnumErrorCode.鍙傛暟鏍¢獙鏈€氳繃, "ID涓嶈兘涓虹┖");
+                }
+                SuccessResultModel<int> model = new SuccessResultModel<int>();
+                model.Data = UserTableRepository.DeleteWithKeys(new UserInputModel { UserID = userId });
+                return model;
+            }
+            catch (Exception e)
+            {
+                LogWriter.WriteLog(EnumLogLevel.Error, "ModifyUser", "", "", "", e);
+                return new ErrorResultModel<int>(EnumErrorCode.绯荤粺寮傚父, "绯荤粺寮傚父");
+            }
+        }
+
+    }
+}
diff --git a/ServiceSite/DAL/AuthTable/AuthTableRepository.cs b/ServiceSite/DAL/AuthTable/AuthTableRepository.cs
new file mode 100644
index 0000000..7570442
--- /dev/null
+++ b/ServiceSite/DAL/AuthTable/AuthTableRepository.cs
@@ -0,0 +1,26 @@
+锘縰sing Microsoft.Practices.Unity;
+using SeaSky.StandardLib.MyBaseClass;
+using SeaSky.TemplateProject.Model;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace SeaSky.TemplateProject.DAL
+{
+    public class AuthTableRepository:DALPageBase<AuthModel,AuthOutputModel>, IAuthTableRepository
+    {
+        [Dependency]
+        public IUnityContainer Containet { get; set; }
+
+        public AuthTableRepository() : base("TemplateProject", DatabaseMode.SqlClient)
+        {
+        }
+
+        public override string GetOperater()
+        {
+            return ServiceContext.Current.UserName;
+        }
+    }
+}
diff --git a/ServiceSite/DAL/AuthTable/IAuthTableRepository.cs b/ServiceSite/DAL/AuthTable/IAuthTableRepository.cs
new file mode 100644
index 0000000..4982005
--- /dev/null
+++ b/ServiceSite/DAL/AuthTable/IAuthTableRepository.cs
@@ -0,0 +1,16 @@
+锘縰sing SeaSky.StandardLib.MyBaseClass;
+using SeaSky.StandardLib.MyModel;
+using SeaSky.TemplateProject.Model;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace SeaSky.TemplateProject.DAL
+{
+    public interface IAuthTableRepository:IDALPageBase<AuthModel,AuthOutputModel>, IDALBase<AuthModel,AuthOutputModel>
+    {
+       // BaseResultModel<List<>>
+    }
+}
diff --git a/ServiceSite/DAL/OrganizationTable/IOrganizationTableRepository.cs b/ServiceSite/DAL/OrganizationTable/IOrganizationTableRepository.cs
new file mode 100644
index 0000000..c178a85
--- /dev/null
+++ b/ServiceSite/DAL/OrganizationTable/IOrganizationTableRepository.cs
@@ -0,0 +1,16 @@
+锘縰sing SeaSky.StandardLib.MyBaseClass;
+using SeaSky.StandardLib.MyModel;
+using SeaSky.TemplateProject.Model;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace SeaSky.TemplateProject.DAL
+{
+    public interface IOrganizationTableRepository: IDALBase<OrganizationModel,OrganizationOutputModel>, IDALPageBase<OrganizationModel, OrganizationOutputModel>
+    {
+       List<OrganizationOutputModel> ListOrganizationByAuth(Guid? userId);
+    }
+}
diff --git a/ServiceSite/DAL/OrganizationTable/OrganizationTableRepository.cs b/ServiceSite/DAL/OrganizationTable/OrganizationTableRepository.cs
new file mode 100644
index 0000000..6b67287
--- /dev/null
+++ b/ServiceSite/DAL/OrganizationTable/OrganizationTableRepository.cs
@@ -0,0 +1,40 @@
+锘縰sing Microsoft.Practices.Unity;
+using SeaSky.StandardLib.MyBaseClass;
+using SeaSky.TemplateProject.Model;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Microsoft.Practices.Unity;
+using SeaSky.StandardLib.MyModel;
+using System.Collections.ObjectModel;
+using System.Data;
+using System.Data.SqlClient;
+
+namespace SeaSky.TemplateProject.DAL
+{
+    public class OrganizationTableRepository : DALPageBase<OrganizationModel, OrganizationOutputModel>, IOrganizationTableRepository
+    {
+        [Dependency]
+        public IUnityContainer Container { get; set; }
+
+        public OrganizationTableRepository() : base("TemplateProject", DatabaseMode.SqlClient)
+        {
+        }
+
+        public override string GetOperater()
+        {
+            return ServiceContext.Current.UserName;
+        }
+
+        public List<OrganizationOutputModel> ListOrganizationByAuth(Guid? userId)
+        {
+            string sql = "select * from tb_organization t1 join tb_auth t2 on t1.OrganizationID = t2.OrganizationID where t2.UserID = @userId";
+            Collection<IDataParameter> param = new Collection<IDataParameter>() {
+                new SqlParameter("userId",userId)
+            };
+            return base.List(sql,param).ToList();
+        }
+    }
+}
diff --git a/ServiceSite/DAL/SeaSky.TemplateProject.DAL.csproj b/ServiceSite/DAL/SeaSky.TemplateProject.DAL.csproj
index 50e0e00..97f0c23 100644
--- a/ServiceSite/DAL/SeaSky.TemplateProject.DAL.csproj
+++ b/ServiceSite/DAL/SeaSky.TemplateProject.DAL.csproj
@@ -55,11 +55,17 @@
     <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="AuthTable\AuthTableRepository.cs" />
+    <Compile Include="AuthTable\IAuthTableRepository.cs" />
+    <Compile Include="OrganizationTable\IOrganizationTableRepository.cs" />
+    <Compile Include="OrganizationTable\OrganizationTableRepository.cs" />
     <Compile Include="TestTable\ITestTableRepository.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="ServiceContext.cs" />
     <Compile Include="TestTable\TestTable44Repository.cs" />
     <Compile Include="TestTable\TestTableRepository.cs" />
+    <Compile Include="UserTable\IUserTableRepository.cs" />
+    <Compile Include="UserTable\UserTableRepository.cs" />
   </ItemGroup>
   <ItemGroup>
     <ProjectReference Include="..\Model\SeaSky.TemplateProject.Model.csproj">
diff --git a/ServiceSite/DAL/UserTable/IUserTableRepository.cs b/ServiceSite/DAL/UserTable/IUserTableRepository.cs
new file mode 100644
index 0000000..8315404
--- /dev/null
+++ b/ServiceSite/DAL/UserTable/IUserTableRepository.cs
@@ -0,0 +1,16 @@
+锘縰sing SeaSky.StandardLib.MyBaseClass;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using SeaSky.TemplateProject.Model;
+using SeaSky.StandardLib.MyModel;
+
+namespace SeaSky.TemplateProject.DAL
+{
+    public interface IUserTableRepository:IDALBase<UserModel,UserOutputModel>,IDALPageBase<UserModel,UserOutputModel>
+    {
+        PageModel<UserOutputModel> ListPage(UserInputModel model);
+    }
+}
diff --git a/ServiceSite/DAL/UserTable/UserTableRepository.cs b/ServiceSite/DAL/UserTable/UserTableRepository.cs
new file mode 100644
index 0000000..b5b8566
--- /dev/null
+++ b/ServiceSite/DAL/UserTable/UserTableRepository.cs
@@ -0,0 +1,41 @@
+锘縰sing Microsoft.Practices.Unity;
+using SeaSky.StandardLib.MyBaseClass;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using SeaSky.TemplateProject.Model;
+using SeaSky.StandardLib.MyModel;
+using System.Collections.ObjectModel;
+using System.Data;
+using System.Data.SqlClient;
+
+namespace SeaSky.TemplateProject.DAL
+{
+    public class UserTableRepository: DALPageBase<UserModel,UserOutputModel>,IUserTableRepository
+    {
+        [Dependency]
+        public IUnityContainer Containet { get; set; }
+
+        public UserTableRepository():base("TemplateProject", DatabaseMode.SqlClient)
+        {
+        }
+
+        public override string GetOperater()
+        {
+            return ServiceContext.Current.UserName;
+        }
+
+        public PageModel<UserOutputModel> ListPage(UserInputModel model)
+        {
+            string sql = "select * from tb_user where RealName like '%'+@realName+'%' and JobNo like '%'+@jobNo+'%'";
+            string orderby = "order by CreateTime desc";
+            Collection<IDataParameter> param = new Collection<IDataParameter>() {
+                new SqlParameter("realName",model.RealName),
+                new SqlParameter("jobNo",model.JobNo)
+            };
+            return base.ListPage(sql,model.PageNO??1,model.PageSize??12,param,orderby);
+        }
+    }
+}
diff --git a/ServiceSite/Model/AuthModel/AuthInputModel.cs b/ServiceSite/Model/AuthModel/AuthInputModel.cs
new file mode 100644
index 0000000..815cf75
--- /dev/null
+++ b/ServiceSite/Model/AuthModel/AuthInputModel.cs
@@ -0,0 +1,12 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace SeaSky.TemplateProject.Model
+{
+    public class AuthInputModel:AuthModel
+    {
+    }
+}
diff --git a/ServiceSite/Model/AuthModel/AuthModel.cs b/ServiceSite/Model/AuthModel/AuthModel.cs
new file mode 100644
index 0000000..e9d53ce
--- /dev/null
+++ b/ServiceSite/Model/AuthModel/AuthModel.cs
@@ -0,0 +1,38 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using SeaSky.StandardLib.MyAttribute;
+using SeaSky.StandardLib.MyModel;
+
+namespace SeaSky.TemplateProject.Model
+{
+    [DBTableInfo("tb_auth")]
+    [Serializable]
+    public class AuthModel:BasePageModel
+    {
+        public Guid? AuthID { get =>authId; set =>authId= value; }
+        public Guid OrganizationID { get =>organizationId; set =>organizationId= value; }
+        public Guid UserID { get =>userId; set =>userId= value; }
+        public int QueryAuth { get =>queryAuth; set =>queryAuth= value; }
+        public int EditAuth { get =>editAuth; set =>editAuth= value; }
+
+        #region private property
+        [DBFieldInfo(ColumnName = "AuthID", IsIdentity = false, IsKey = true, SqlDbType = SqlDbType.UniqueIdentifier
+           , OrderIndex = -1, OrderAsc = true)]
+        protected Guid? authId;
+        [DBFieldInfo(ColumnName = "OrganizationID", IsIdentity = false, IsKey = false, SqlDbType = SqlDbType.UniqueIdentifier
+           , OrderIndex = -1, OrderAsc = true)]
+        protected Guid organizationId;
+        [DBFieldInfo(ColumnName = "UserID", IsIdentity = false, IsKey = false, SqlDbType = SqlDbType.UniqueIdentifier
+           , OrderIndex = -1, OrderAsc = true)]
+        protected Guid userId;
+        [DBFieldInfo(ColumnName = "QueryAuth", IsIdentity = false, IsKey = false, SqlDbType = SqlDbType.Int, DefaultValue = 0, OrderIndex = -1, OrderAsc = true)]
+        protected int queryAuth;
+        [DBFieldInfo(ColumnName = "EditAuth", IsIdentity = false, IsKey = false, SqlDbType = SqlDbType.Int, DefaultValue = 0, OrderIndex = -1, OrderAsc = true)]
+        protected int editAuth;
+        #endregion
+    }
+}
diff --git a/ServiceSite/Model/AuthModel/AuthOutputModel.cs b/ServiceSite/Model/AuthModel/AuthOutputModel.cs
new file mode 100644
index 0000000..542ebf4
--- /dev/null
+++ b/ServiceSite/Model/AuthModel/AuthOutputModel.cs
@@ -0,0 +1,12 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace SeaSky.TemplateProject.Model
+{
+    public class AuthOutputModel:AuthModel
+    {
+    }
+}
diff --git a/ServiceSite/Model/OrganizationModel/OrganizationInputModel.cs b/ServiceSite/Model/OrganizationModel/OrganizationInputModel.cs
new file mode 100644
index 0000000..5e2f9e1
--- /dev/null
+++ b/ServiceSite/Model/OrganizationModel/OrganizationInputModel.cs
@@ -0,0 +1,12 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace SeaSky.TemplateProject.Model
+{
+    public class OrganizationInputModel:OrganizationModel
+    {
+    }
+}
diff --git a/ServiceSite/Model/OrganizationModel/OrganizationModel.cs b/ServiceSite/Model/OrganizationModel/OrganizationModel.cs
new file mode 100644
index 0000000..b8aad71
--- /dev/null
+++ b/ServiceSite/Model/OrganizationModel/OrganizationModel.cs
@@ -0,0 +1,41 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using SeaSky.StandardLib.MyAttribute;
+using SeaSky.StandardLib.MyModel;
+
+namespace SeaSky.TemplateProject.Model
+{
+    [DBTableInfo("tb_organization")]
+    [Serializable]
+    public class OrganizationModel:BasePageModel
+    {
+        public Guid? OrganizationID { get => organizationId; set => organizationId = value; }
+        public string OrganizationNo { get => organizationNo; set => organizationNo = value; }
+        public string OrganizationName { get => organizationName; set => organizationName = value; }
+        public string ParentNo { get => parentNo; set => parentNo = value; }
+        #region private property
+        [DBFieldInfo(ColumnName = "OrganizationID", IsIdentity = false, IsKey = true, SqlDbType = SqlDbType.UniqueIdentifier
+            , OrderIndex = -1, OrderAsc = true)]
+        protected Guid? organizationId;
+        [DBFieldInfo(ColumnName = "OrganizationNo", IsIdentity = false, IsKey = false, SqlDbType = SqlDbType.NVarChar
+           , LikeEqual = EnumLikeMode.AllLike
+           , DefaultValue = ""
+           , OrderIndex = 0, OrderAsc = true)]
+        protected string organizationNo;
+        [DBFieldInfo(ColumnName = "OrganizationName", IsIdentity = false, IsKey = false, SqlDbType = SqlDbType.NVarChar
+           , LikeEqual = EnumLikeMode.AllLike
+           , DefaultValue = ""
+           , OrderIndex = 0, OrderAsc = true)]
+        protected string organizationName;
+        [DBFieldInfo(ColumnName = "parentNo", IsIdentity = false, IsKey = false, SqlDbType = SqlDbType.NVarChar
+           , LikeEqual = EnumLikeMode.AllLike
+           , DefaultValue = ""
+           , OrderIndex = 0, OrderAsc = true)]
+        protected string parentNo;
+        #endregion
+    }
+}
diff --git a/ServiceSite/Model/OrganizationModel/OrganizationOutputModel.cs b/ServiceSite/Model/OrganizationModel/OrganizationOutputModel.cs
new file mode 100644
index 0000000..93e15fa
--- /dev/null
+++ b/ServiceSite/Model/OrganizationModel/OrganizationOutputModel.cs
@@ -0,0 +1,13 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace SeaSky.TemplateProject.Model
+{
+    public class OrganizationOutputModel:OrganizationModel
+    {
+        public List<OrganizationOutputModel> ChildrenOrganizationList { get; set; }
+    }
+}
diff --git a/ServiceSite/Model/SeaSky.TemplateProject.Model.csproj b/ServiceSite/Model/SeaSky.TemplateProject.Model.csproj
index c826d3e..3ba5639 100644
--- a/ServiceSite/Model/SeaSky.TemplateProject.Model.csproj
+++ b/ServiceSite/Model/SeaSky.TemplateProject.Model.csproj
@@ -46,11 +46,20 @@
     <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="AuthModel\AuthInputModel.cs" />
+    <Compile Include="AuthModel\AuthModel.cs" />
+    <Compile Include="AuthModel\AuthOutputModel.cs" />
     <Compile Include="Enum\EnumLogLevel.cs" />
+    <Compile Include="OrganizationModel\OrganizationInputModel.cs" />
+    <Compile Include="OrganizationModel\OrganizationModel.cs" />
+    <Compile Include="OrganizationModel\OrganizationOutputModel.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="Test\TestInputModel.cs" />
     <Compile Include="Test\TestModel.cs" />
     <Compile Include="Test\TestOutputModel.cs" />
+    <Compile Include="UserModel\UserInputModel.cs" />
+    <Compile Include="UserModel\UserModel.cs" />
+    <Compile Include="UserModel\UserOutputModel.cs" />
   </ItemGroup>
   <ItemGroup />
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
diff --git a/ServiceSite/Model/UserModel/UserInputModel.cs b/ServiceSite/Model/UserModel/UserInputModel.cs
new file mode 100644
index 0000000..7664431
--- /dev/null
+++ b/ServiceSite/Model/UserModel/UserInputModel.cs
@@ -0,0 +1,12 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace SeaSky.TemplateProject.Model
+{
+    public class UserInputModel:UserModel
+    {
+    }
+}
diff --git a/ServiceSite/Model/UserModel/UserModel.cs b/ServiceSite/Model/UserModel/UserModel.cs
new file mode 100644
index 0000000..4e6089d
--- /dev/null
+++ b/ServiceSite/Model/UserModel/UserModel.cs
@@ -0,0 +1,36 @@
+锘縰sing SeaSky.StandardLib.MyAttribute;
+using SeaSky.StandardLib.MyModel;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace SeaSky.TemplateProject.Model
+{
+    [DBTableInfo("tb_user")]
+    [Serializable]
+    public class UserModel:BasePageModel
+    {
+        public Guid? UserID { get => userId; set => userId = value; }
+        public string JobNo { get => jobNo; set => jobNo = value; }
+        public string RealName { get => realName; set => realName = value; }
+        public bool? IsSysAdmin { get => isSysAdmin; set => isSysAdmin = value; }
+        public string Remark { get => remark; set => remark = value; }
+
+        #region private property
+        [DBFieldInfo(ColumnName = "UserID", IsIdentity = false, IsKey = true, SqlDbType = SqlDbType.UniqueIdentifier
+            , OrderIndex = -1, OrderAsc = true)]
+        protected Guid? userId;
+        [DBFieldInfo(ColumnName = "JobNo", IsIdentity = false, IsKey = false, SqlDbType = SqlDbType.NVarChar, LikeEqual = EnumLikeMode.AllLike, DefaultValue = "", OrderIndex = 0, OrderAsc = true)]
+        protected string jobNo;
+        [DBFieldInfo(ColumnName = "RealName", IsIdentity = false, IsKey = false, SqlDbType = SqlDbType.NVarChar, LikeEqual = EnumLikeMode.AllLike, DefaultValue = "" , OrderIndex = 0, OrderAsc = true)]
+        protected string realName;
+        [DBFieldInfo(ColumnName = "IsSysAdmin", IsIdentity = false, IsKey = false, SqlDbType = SqlDbType.Int , DefaultValue = 0, OrderIndex = -1, OrderAsc = true)]
+        protected bool? isSysAdmin;
+        [DBFieldInfo(ColumnName = "Remark", IsIdentity = false, IsKey = false, SqlDbType = SqlDbType.NVarChar, DefaultValue = "", LikeEqual = EnumLikeMode.AllLike, OrderIndex = 0, OrderAsc = true)]
+        protected string remark;
+        #endregion
+    }
+}
diff --git a/ServiceSite/Model/UserModel/UserOutputModel.cs b/ServiceSite/Model/UserModel/UserOutputModel.cs
new file mode 100644
index 0000000..9ff8c67
--- /dev/null
+++ b/ServiceSite/Model/UserModel/UserOutputModel.cs
@@ -0,0 +1,12 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace SeaSky.TemplateProject.Model
+{
+    public class UserOutputModel:UserModel
+    {
+    }
+}
diff --git a/ServiceSite/WebApi/Controllers/AdminController.cs b/ServiceSite/WebApi/Controllers/AdminController.cs
new file mode 100644
index 0000000..68c15f9
--- /dev/null
+++ b/ServiceSite/WebApi/Controllers/AdminController.cs
@@ -0,0 +1,136 @@
+锘縰sing SeaSky.StandardLib.MyModel;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using SeaSky.TemplateProject.Model;
+using SeaSky.TemplateProject.BLL;
+using Microsoft.Practices.Unity;
+using System.Web.Http;
+
+namespace SeaSky.TemplateProject.WebApi.Controllers
+{
+    [UserFilter]
+    public class AdminController : ApiController
+    {
+        IOrganizationService OrganizationService = ApplicationContext.Current.UnityContainer.Resolve<IOrganizationService>();
+        IUserService UserService = ApplicationContext.Current.UnityContainer.Resolve<IUserService>();
+        IAuthService AuthService = ApplicationContext.Current.UnityContainer.Resolve<IAuthService>();
+
+        #region 鐢ㄦ埛绠$悊
+        public BaseResultModel<PageModel<UserOutputModel>> ListUser(UserInputModel user)
+        {
+            if (user == null)
+            {
+                return new ErrorResultModel<PageModel<UserOutputModel>>(EnumErrorCode.鍙傛暟鏍¢獙鏈€氳繃, "鍏ュ弬涓虹┖锛�");
+
+
+            }
+
+            return UserService.ListUser(user);
+        }
+
+        public BaseResultModel<UserOutputModel> CreateUser(UserInputModel user)
+        {
+            if (user == null)
+            {
+                return new ErrorResultModel<UserOutputModel>(EnumErrorCode.鍙傛暟鏍¢獙鏈€氳繃, "鍏ュ弬涓虹┖锛�");
+            }
+            return UserService.CreateUser(user);
+        }
+
+        public BaseResultModel<UserOutputModel> ModifyUser(UserInputModel user)
+        {
+            if (user == null)
+            {
+                return new ErrorResultModel<UserOutputModel>(EnumErrorCode.鍙傛暟鏍¢獙鏈€氳繃, "鍏ュ弬涓虹┖锛�");
+                
+
+
+
+
+
+
+            }
+            return UserService.ModifyUser(user);
+        }
+
+        public BaseResultModel<int> RemoveUser(Guid userId)
+        {
+            return UserService.RemoveUser(userId);
+        }
+
+        public BaseResultModel<UserOutputModel> GetUser(Guid? userId)
+        {
+            return UserService.GetUser(userId);
+        }
+
+        public BaseResultModel<UserOutputModel> GetUser(string jobNo)
+        {
+            return UserService.GetUser(jobNo);
+        }
+        #endregion
+
+        #region 缁勭粐绠$悊
+        public BaseResultModel<List<OrganizationOutputModel>> ListAllOrganizationTree()
+        {
+            return OrganizationService.ListAllOrganizationTree();
+        }
+
+        public BaseResultModel<List<OrganizationOutputModel>> ListOrganizationByAuth()
+        {
+            if (HttpContext.Current.Session["UserID"] != null)
+            {
+                Guid userId = Guid.Parse(HttpContext.Current.Session["UserID"].ToString());
+                return OrganizationService.ListOrganizationByAuth(userId);
+            }
+            return new ErrorResultModel<List<OrganizationOutputModel>>(EnumErrorCode.鏈櫥鍏�,"session杩囨湡 璇烽噸鏂扮櫥褰�");
+        }
+
+        public BaseResultModel<OrganizationOutputModel> CreateOrganization(OrganizationInputModel organization)
+        {
+            if (organization == null)
+            {
+                return new ErrorResultModel<OrganizationOutputModel>(EnumErrorCode.鍙傛暟鏍¢獙鏈€氳繃, "鍏ュ弬涓虹┖锛�");
+            }
+            return OrganizationService.CreateOrganization(organization);
+        }
+
+        public BaseResultModel<OrganizationOutputModel> ModifyOrganization(OrganizationInputModel organization)
+        {
+            if (organization == null)
+            {
+                return new ErrorResultModel<OrganizationOutputModel>(EnumErrorCode.鍙傛暟鏍¢獙鏈€氳繃, "鍏ュ弬涓虹┖锛�");
+            }
+            return OrganizationService.ModifyOrganization(organization);
+        }
+
+        public BaseResultModel<int> RemoveOrganizarion(Guid organizationId)
+        {
+            return OrganizationService.RemoveOrganization(organizationId);
+        }
+        #endregion
+
+        #region 鏉冮檺绠$悊
+        public BaseResultModel<List<AuthOutputModel>> ListAuthByUser(Guid? userId)
+        {
+            return AuthService.ListAuthByUser(userId);
+        }
+
+        public BaseResultModel<AuthOutputModel> CreateAuth(AuthInputModel auth)
+        {
+            if (auth == null)
+            {
+                return new ErrorResultModel<AuthOutputModel>(EnumErrorCode.鍙傛暟鏍¢獙鏈€氳繃, "鍏ュ弬涓虹┖锛�");
+            }
+            return AuthService.CreateAuth(auth);
+        }
+
+        public BaseResultModel<int> RemoveAuth(Guid userId, Guid organizationId)
+        {
+            return AuthService.RemoveAuth(userId,organizationId);
+        }
+        #endregion
+
+    }
+}
\ No newline at end of file
diff --git a/ServiceSite/WebApi/Controllers/Filters/UserFilter.cs b/ServiceSite/WebApi/Controllers/Filters/UserFilter.cs
new file mode 100644
index 0000000..ca1c147
--- /dev/null
+++ b/ServiceSite/WebApi/Controllers/Filters/UserFilter.cs
@@ -0,0 +1,27 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Net.Http;
+using System.Web;
+using System.Web.Http;
+using System.Web.Http.Controllers;
+using System.Web.Http.Filters;
+using System.Web.Mvc;
+using SeaSky.TemplateProject.Model;
+
+namespace SeaSky.TemplateProject.WebApi.Controllers
+{
+    public class UserFilter: AuthorizationFilterAttribute
+    {
+        public override void OnAuthorization(HttpActionContext actionContext)
+        {
+            UserModel user = HttpContext.Current.Session["User"] as UserModel??new UserModel();
+            //if (user.IsSysAdmin==null||user.IsSysAdmin==false)
+            if(false)
+            {
+                actionContext.Response = actionContext.Request.CreateErrorResponse(HttpStatusCode.Unauthorized, new HttpError("娌℃湁鏉冮檺"));
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/ServiceSite/WebApi/SeaSky.TemplateProject.WebApi.csproj b/ServiceSite/WebApi/SeaSky.TemplateProject.WebApi.csproj
index 3586dba..fea0614 100644
--- a/ServiceSite/WebApi/SeaSky.TemplateProject.WebApi.csproj
+++ b/ServiceSite/WebApi/SeaSky.TemplateProject.WebApi.csproj
@@ -1,6 +1,5 @@
 锘�<?xml version="1.0" encoding="utf-8"?>
 <Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <Import Project="..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.0\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props" Condition="Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.0\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" />
   <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
   <PropertyGroup>
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -144,9 +143,6 @@
     <Reference Include="Microsoft.AspNet.TelemetryCorrelation">
       <HintPath>..\packages\Microsoft.AspNet.TelemetryCorrelation.1.0.0\lib\net45\Microsoft.AspNet.TelemetryCorrelation.dll</HintPath>
     </Reference>
-    <Reference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform">
-      <HintPath>..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.0\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll</HintPath>
-    </Reference>
   </ItemGroup>
   <ItemGroup>
     <Compile Include="App_Start\BundleConfig.cs" />
@@ -184,6 +180,8 @@
     <Compile Include="Authentication\RequestLoginAttribute.cs" />
     <Compile Include="Authentication\RequestAuthorizeAttribute.cs" />
     <Compile Include="Common\CrosHeader.cs" />
+    <Compile Include="Controllers\AdminController.cs" />
+    <Compile Include="Controllers\Filters\UserFilter.cs" />
     <Compile Include="Controllers\HomeController.cs" />
     <Compile Include="Controllers\ValuesController.cs" />
     <Compile Include="Global.asax.cs">
@@ -216,7 +214,9 @@
     <Content Include="Areas\HelpPage\Views\Help\DisplayTemplates\CollectionModelDescription.cshtml" />
     <Content Include="Areas\HelpPage\Views\Help\DisplayTemplates\ApiGroup.cshtml" />
     <Content Include="Areas\HelpPage\Views\Help\Api.cshtml" />
-    <Content Include="Web.config" />
+    <Content Include="Web.config">
+      <SubType>Designer</SubType>
+    </Content>
     <Content Include="Web.Debug.config">
       <DependentUpon>Web.config</DependentUpon>
     </Content>
@@ -232,11 +232,13 @@
   </ItemGroup>
   <ItemGroup>
     <Folder Include="App_Data\" />
+    <Folder Include="Content\" />
   </ItemGroup>
   <ItemGroup>
     <Content Include="Log4net.config" />
     <None Include="packages.config" />
     <None Include="Properties\PublishProfiles\FolderProfile.pubxml" />
+    <Content Include="Views\Admin\Index.cshtml" />
   </ItemGroup>
   <ItemGroup>
     <ProjectReference Include="..\BLL\SeaSky.TemplateProject.BLL.csproj">
@@ -276,12 +278,6 @@
       </FlavorProperties>
     </VisualStudio>
   </ProjectExtensions>
-  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
-    <PropertyGroup>
-      <ErrorText>杩欏彴璁$畻鏈轰笂缂哄皯姝ら」鐩紩鐢ㄧ殑 NuGet 绋嬪簭鍖呫€備娇鐢ㄢ€淣uGet 绋嬪簭鍖呰繕鍘熲€濆彲涓嬭浇杩欎簺绋嬪簭鍖呫€傛湁鍏虫洿澶氫俊鎭紝璇峰弬瑙� http://go.microsoft.com/fwlink/?LinkID=322105銆傜己灏戠殑鏂囦欢鏄� {0}銆�</ErrorText>
-    </PropertyGroup>
-    <Error Condition="!Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.0\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.0\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props'))" />
-  </Target>
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
        Other similar extension points exist, see Microsoft.Common.targets.
   <Target Name="BeforeBuild">
diff --git a/ServiceSite/WebApi/Views/Admin/Index.cshtml b/ServiceSite/WebApi/Views/Admin/Index.cshtml
new file mode 100644
index 0000000..a2fb36c
--- /dev/null
+++ b/ServiceSite/WebApi/Views/Admin/Index.cshtml
@@ -0,0 +1,7 @@
+锘�
+@{
+    ViewBag.Title = "Index";
+}
+
+<h2>Index</h2>
+
diff --git a/ServiceSite/WebApi/Views/Shared/_Layout.cshtml b/ServiceSite/WebApi/Views/Shared/_Layout.cshtml
index 146f576..b1d6a56 100644
--- a/ServiceSite/WebApi/Views/Shared/_Layout.cshtml
+++ b/ServiceSite/WebApi/Views/Shared/_Layout.cshtml
@@ -6,17 +6,10 @@
     <meta name="viewport" content="width=device-width" />
     <title>@ViewBag.Title</title>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <link href="/Content/styles.css" rel="stylesheet" />
 </head>
 <body>
-    <div class="navbar navbar-inverse navbar-fixed-top">
-        <div class="container">
-            <div class="navbar-collapse collapse">
-                <ul class="nav navbar-nav">
-                    <li>@Html.ActionLink("API", "Index", "Help", new { area = "" }, null)</li>
-                </ul>
-            </div>
-        </div>
-    </div>
+    
     <div class="container body-content">
         @RenderBody()
         <hr />
diff --git a/ServiceSite/WebApi/Web.config b/ServiceSite/WebApi/Web.config
index d5d3974..a23d79c 100644
--- a/ServiceSite/WebApi/Web.config
+++ b/ServiceSite/WebApi/Web.config
@@ -5,90 +5,82 @@
   -->
 <configuration>
   <configSections>
-    <section name="unity"
-           type="Microsoft.Practices.Unity.Configuration.UnityConfigurationSection, Microsoft.Practices.Unity.Configuration" />
+    <section name="unity" type="Microsoft.Practices.Unity.Configuration.UnityConfigurationSection, Microsoft.Practices.Unity.Configuration" />
   </configSections>
   <connectionStrings>
     <add name="BaseConn" connectionString="Database=SeaSky_TemplateProject;Server=192.168.1.44;Integrated Security=false;MultipleActiveResultSets=true;uid=sa;password=123456" providerName="System.Data.SqlClient" />
-    <add name="TemplateProject" connectionString="Database=TestDB;Server=.;Integrated Security=false;MultipleActiveResultSets=true;uid=sa;password=SeaSky" providerName="System.Data.SqlClient" />
+    <add name="TemplateProject" connectionString="Data Source=.;Initial Catalog=Seasky_Test;Integrated Security=True" providerName="System.Data.SqlClient" />
   </connectionStrings>
   <appSettings>
-    <add key="webpages:Version" value="3.0.0.0"/>
-    <add key="webpages:Enabled" value="false"/>
-    <add key="ClientValidationEnabled" value="true"/>
-    <add key="UnobtrusiveJavaScriptEnabled" value="true"/>
+    <add key="webpages:Version" value="3.0.0.0" />
+    <add key="webpages:Enabled" value="false" />
+    <add key="ClientValidationEnabled" value="true" />
+    <add key="UnobtrusiveJavaScriptEnabled" value="true" />
   </appSettings>
   <system.web>
-    <compilation debug="true" targetFramework="4.6.1"/>
-    <httpRuntime targetFramework="4.6.1"/>
+    <compilation debug="true" targetFramework="4.6.1" />
+    <httpRuntime targetFramework="4.6.1" />
     <sessionState mode="InProc" timeout="30" />
   </system.web>
   <system.webServer>
     <handlers>
-      <remove name="ExtensionlessUrlHandler-Integrated-4.0"/>
-      <remove name="OPTIONSVerbHandler"/>
-      <remove name="TRACEVerbHandler"/>
-      <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler"
-        preCondition="integratedMode,runtimeVersionv4.0"/>
+      <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
+      <remove name="OPTIONSVerbHandler" />
+      <remove name="TRACEVerbHandler" />
+      <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
     </handlers>
     <modules>
-      <remove name="TelemetryCorrelationHttpModule"/>
-      <add name="TelemetryCorrelationHttpModule"
-        type="Microsoft.AspNet.TelemetryCorrelation.TelemetryCorrelationHttpModule, Microsoft.AspNet.TelemetryCorrelation"
-        preCondition="integratedMode,managedHandler"/>
+      <remove name="TelemetryCorrelationHttpModule" />
+      <add name="TelemetryCorrelationHttpModule" type="Microsoft.AspNet.TelemetryCorrelation.TelemetryCorrelationHttpModule, Microsoft.AspNet.TelemetryCorrelation" preCondition="integratedMode,managedHandler" />
     </modules>
   </system.webServer>
   <runtime>
     <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
       <dependentAssembly>
-        <assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f"/>
-        <bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2"/>
+        <assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" />
+        <bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2" />
       </dependentAssembly>
       <dependentAssembly>
-        <assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51"/>
-        <bindingRedirect oldVersion="0.0.0.0-4.0.2.1" newVersion="4.0.2.1"/>
+        <assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.2.1" newVersion="4.0.2.1" />
       </dependentAssembly>
       <dependentAssembly>
-        <assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed"/>
-        <bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0"/>
+        <assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" />
+        <bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0" />
       </dependentAssembly>
       <dependentAssembly>
-        <assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35"/>
-        <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0"/>
+        <assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" />
+        <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
       </dependentAssembly>
       <dependentAssembly>
-        <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35"/>
-        <bindingRedirect oldVersion="1.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930"/>
+        <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
+        <bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930" />
       </dependentAssembly>
       <dependentAssembly>
-        <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35"/>
-        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
+        <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
+        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
       </dependentAssembly>
       <dependentAssembly>
-        <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35"/>
-        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
+        <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
+        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
       </dependentAssembly>
       <dependentAssembly>
-        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
-        <bindingRedirect oldVersion="1.0.0.0-5.2.4.0" newVersion="5.2.4.0"/>
+        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
+        <bindingRedirect oldVersion="1.0.0.0-5.2.4.0" newVersion="5.2.4.0" />
       </dependentAssembly>
     </assemblyBinding>
   </runtime>
-  <system.codedom>
-    <compilers>
-      <compiler language="c#;cs;csharp" extension=".cs"
-        type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
-        warningLevel="4" compilerOptions="/langversion:default /nowarn:1659;1699;1701"/>
-      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"
-        type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
-        warningLevel="4" compilerOptions="/langversion:default /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+"/>
-    </compilers>
-  </system.codedom>
   <unity>
     <containers>
       <container name="defaultContainer">
-        <register type="SeaSky.TemplateProject.BLL.ITestService,SeaSky.TemplateProject.BLL" mapTo="SeaSky.TemplateProject.BLL.TestService,SeaSky.TemplateProject.BLL"/>
-        <register type="SeaSky.TemplateProject.DAL.ITestTableRepository,SeaSky.TemplateProject.DAL" mapTo="SeaSky.TemplateProject.DAL.TestTableRepository,SeaSky.TemplateProject.DAL"/>
+        <register type="SeaSky.TemplateProject.BLL.ITestService,SeaSky.TemplateProject.BLL" mapTo="SeaSky.TemplateProject.BLL.TestService,SeaSky.TemplateProject.BLL" />
+        <register type="SeaSky.TemplateProject.DAL.ITestTableRepository,SeaSky.TemplateProject.DAL" mapTo="SeaSky.TemplateProject.DAL.TestTableRepository,SeaSky.TemplateProject.DAL" />
+        <register type="SeaSky.TemplateProject.BLL.IUserService,SeaSky.TemplateProject.BLL" mapTo="SeaSky.TemplateProject.BLL.UserService,SeaSky.TemplateProject.BLL" />
+        <register type="SeaSky.TemplateProject.DAL.IUserTableRepository,SeaSky.TemplateProject.DAL" mapTo="SeaSky.TemplateProject.DAL.UserTableRepository,SeaSky.TemplateProject.DAL" />
+        <register type="SeaSky.TemplateProject.BLL.IOrganizationService,SeaSky.TemplateProject.BLL" mapTo="SeaSky.TemplateProject.BLL.OrganizationService,SeaSky.TemplateProject.BLL" />
+        <register type="SeaSky.TemplateProject.DAL.IOrganizationTableRepository,SeaSky.TemplateProject.DAL" mapTo="SeaSky.TemplateProject.DAL.OrganizationTableRepository,SeaSky.TemplateProject.DAL" />
+        <register type="SeaSky.TemplateProject.BLL.IAuthService,SeaSky.TemplateProject.BLL" mapTo="SeaSky.TemplateProject.BLL.AuthService,SeaSky.TemplateProject.BLL" />
+        <register type="SeaSky.TemplateProject.DAL.IAuthTableRepository,SeaSky.TemplateProject.DAL" mapTo="SeaSky.TemplateProject.DAL.AuthTableRepository,SeaSky.TemplateProject.DAL" />
       </container>
     </containers>
   </unity>
diff --git a/ServiceSite/WebApi/packages.config b/ServiceSite/WebApi/packages.config
index 2192fb4..8d4d221 100644
--- a/ServiceSite/WebApi/packages.config
+++ b/ServiceSite/WebApi/packages.config
@@ -20,7 +20,6 @@
   <package id="Microsoft.AspNet.WebApi.WebHost.zh-Hans" version="5.2.4" targetFramework="net461" />
   <package id="Microsoft.AspNet.WebPages" version="3.2.4" targetFramework="net461" />
   <package id="Microsoft.AspNet.WebPages.zh-Hans" version="3.2.4" targetFramework="net461" />
-  <package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="2.0.0" targetFramework="net461" />
   <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net461" />
   <package id="Modernizr" version="2.8.3" targetFramework="net461" />
   <package id="Newtonsoft.Json" version="11.0.1" targetFramework="net461" />
-- 
GitLab