18 |
--------------------------------------------------------------------------------
/CorePlugin/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/NewPlugins/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/WebPlugins/WebPlugins.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp3.1
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Common/Global/UIGlobal.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 |
8 | public partial class UIGlobal
9 | {
10 | ///
11 | /// 运行UI线程
12 | ///
13 | ///
14 | public static void RunUIAction(Action action)
15 | {
16 | Application.Current.Dispatcher.Invoke(action);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Common/Global/Singleton.cs:
--------------------------------------------------------------------------------
1 | using System.Collections;
2 | using System;
3 |
4 | public class Singleton : IDisposable where T : new()
5 | {
6 | private static T instance;
7 |
8 | public static T Instance
9 | {
10 | get
11 | {
12 | if (instance == null)
13 | {
14 | instance = new T();
15 | }
16 | return instance;
17 | }
18 | }
19 |
20 | public virtual void Dispose()
21 | {
22 |
23 | }
24 | }
--------------------------------------------------------------------------------
/Common/Events/Codes.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace Common.Events
8 | {
9 | public class Codes
10 | {
11 | ///
12 | /// 没有阅读的邮件
13 | ///
14 | public const ushort EmailNotReadChanged = 1001;
15 | ///
16 | /// 通知数量改变
17 | ///
18 | public const ushort NoticeNotReadCountChanged = 1002;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Common/CoreDBContext.cs:
--------------------------------------------------------------------------------
1 |
2 | using CoreDBModels;
3 | using System.Data.Entity;
4 |
5 | namespace Common
6 | {
7 | public class CoreDBContext : DbContext
8 | {
9 | public CoreDBContext() : base(DBConnections.Get("CoreConnectionStr"))
10 | {
11 | }
12 |
13 | public DbSet Logs { get; set; }//日志
14 |
15 | public DbSet Department { get; set; }//部门
16 | public DbSet DepartmentPosition { get; set; }//职位
17 |
18 | public DbSet User { get; set; }//用户
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Client/Events/EmailNotReadChangedEventObserver.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace Client.Events
8 | {
9 | public class EmailChangedMessage
10 | {
11 | ///
12 | /// 未读条目
13 | ///
14 | public bool HasNotReadEmail { get; set; }
15 | }
16 |
17 | public class EmailNotReadChangedEventObserver : ObserverBase
18 | {
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Common/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace Common
10 | {
11 | ///
12 | /// App.xaml 的交互逻辑
13 | ///
14 | public partial class App : Application
15 | {
16 | public App()
17 | {
18 | Startup += App_Startup;
19 | }
20 |
21 | private void App_Startup(object sender, StartupEventArgs e)
22 | {
23 |
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Client/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/CoreDBModels/Log.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel.DataAnnotations;
3 | using System.ComponentModel.DataAnnotations.Schema;
4 |
5 | namespace CoreDBModels
6 | {
7 | ///
8 | /// 日志
9 | ///
10 | public class Log
11 | {
12 | [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
13 | public int Id { get; set; }
14 |
15 | public int LogType { get; set; }//日志类型
16 | public string LogStr { get; set; }//日志内容
17 |
18 | public int Creator { get; set; }//创建人
19 | public DateTime CreateTime { get; set; }//创建时间
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/CoreDBModels/RolePlugins.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel.DataAnnotations;
3 | using System.ComponentModel.DataAnnotations.Schema;
4 |
5 | namespace CoreDBModels
6 | {
7 | ///
8 | /// 角色插件权限
9 | ///
10 | public class RolePlugins
11 | {
12 | [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
13 | public int Id { get; set; }
14 |
15 | public int RoleId { get; set; }//角色Id
16 | [MaxLength(200)]
17 | public string Pages { get; set; }//页面Id 以,分隔
18 |
19 | public DateTime UpdateTime { get; set; }//最后更新时间
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Client/Pages/Welcome.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/CoreDBModels/CoreSetting.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel.DataAnnotations;
3 | using System.ComponentModel.DataAnnotations.Schema;
4 |
5 | namespace CoreDBModels
6 | {
7 | ///
8 | /// 基础设置
9 | ///
10 | public class CoreSetting
11 | {
12 | [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
13 | public int Id { get; set; }
14 |
15 | public int MaxLogCount { get; set; }
16 |
17 | [MaxLength(500)]
18 | public string APIUrl { get; set; }//插件更新的基础路径
19 | [MaxLength(20)]
20 | public string LoginTitle { get; set; }//登录页标题
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/WebPlugins/Models/PluginsModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 |
6 | namespace WebPlugins.Models
7 | {
8 | ///
9 | /// 插件信息
10 | ///
11 | public class PluginsModel
12 | {
13 | ///
14 | /// 插件Id
15 | ///
16 | public int Id { get; set; }
17 | ///
18 | /// 插件名称
19 | ///
20 | public string Name { get; set; }
21 | ///
22 | /// 插件中的必要文件数量
23 | ///
24 | public int FileCount { get; set; }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/WebPlugins/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) .NET Foundation. All rights reserved.
2 |
3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4 | these files except in compliance with the License. You may obtain a copy of the
5 | License at
6 |
7 | http://www.apache.org/licenses/LICENSE-2.0
8 |
9 | Unless required by applicable law or agreed to in writing, software distributed
10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the
12 | specific language governing permissions and limitations under the License.
13 |
--------------------------------------------------------------------------------
/CoreDBModels/PositionChangeLog.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel.DataAnnotations;
3 | using System.ComponentModel.DataAnnotations.Schema;
4 |
5 |
6 | namespace CoreDBModels
7 | {
8 | ///
9 | /// 职位更改日志
10 | ///
11 | public class PositionChangeLog
12 | {
13 | [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
14 | public int Id { get; set; }
15 |
16 | public int OldId { get; set; }//原职位Id
17 | public int NewId { get; set; }//新职位Id
18 | [MaxLength(200)]
19 | public string Remark { get; set; }//变动备注
20 | public DateTime StartTime { get; set; }//生效时间
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/NewPlugins/Pages/Index.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/CoreDBModels/Email.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel.DataAnnotations;
3 | using System.ComponentModel.DataAnnotations.Schema;
4 |
5 | namespace CoreDBModels
6 | {
7 | ///
8 | /// 邮件
9 | ///
10 | public class Email
11 | {
12 | [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
13 | public int Id { get; set; }
14 | public int FromId { get; set; }//发送用户Id
15 | public int EmailType { get; set; }//通知类型 0:按用户 1:按角色 2:全部
16 | public string Content { get; set; }//内容
17 | public string Title { get; set; }//标题
18 | public DateTime SendTime { get; set; }//发送时间
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/CoreDBModels/UserPlugins.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel.DataAnnotations;
3 | using System.ComponentModel.DataAnnotations.Schema;
4 |
5 | namespace CoreDBModels
6 | {
7 | ///
8 | /// 作为用户权限外的权限
9 | ///
10 | public class UserPlugins
11 | {
12 | [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
13 | public int Id { get; set; }
14 |
15 | public int UserId { get; set; }//用户Id
16 | public string IncreasePages { get; set; }//在基础权限上增加的页面Id 以,分隔
17 | public string DecrementPages { get; set; }//在基础权限上减少的页面Id 以,分隔
18 |
19 | public DateTime UpdateTime { get; set; }//最后更新时间
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/CoreDBModels/Role.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel.DataAnnotations;
3 | using System.ComponentModel.DataAnnotations.Schema;
4 |
5 | namespace CoreDBModels
6 | {
7 | ///
8 | /// 角色表
9 | ///
10 | public class Role
11 | {
12 | [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
13 | public int Id { get; set; }
14 | [MaxLength(50)]
15 | public string Name { get; set; }
16 |
17 | public bool IsDel { get; set; }
18 | public int DelUser { get; set; }
19 | [MaxLength(50)]
20 | public string DelUserName { get; set; }
21 | public DateTime DelTime { get; set; }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Common/MyControls/IconComboBox.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Client/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using Client.CurrGlobal;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Configuration;
5 | using System.Data;
6 | using System.Linq;
7 | using System.Threading.Tasks;
8 | using System.Windows;
9 |
10 | namespace Client
11 | {
12 | ///
13 | /// App.xaml 的交互逻辑
14 | ///
15 | public partial class App : Application
16 | {
17 | public App()
18 | {
19 | Startup += App_Startup;
20 | }
21 |
22 | private void App_Startup(object sender, StartupEventArgs e)
23 | {
24 | GlobalEvent.OnClientStart();
25 | Global.SoftStartTime = DateTime.Now;
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/Client/Pages/Welcome.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace Client.Pages
17 | {
18 | ///
19 | /// Welcome.xaml 的交互逻辑
20 | ///
21 | public partial class Welcome : Page
22 | {
23 | public Welcome()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/Common/Utils/PhoneNumberCommon.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace Common.Utils
8 | {
9 | ///
10 | /// 手机号验证
11 | ///
12 | public class PhoneNumberCommon
13 | {
14 | ///
15 | /// 11位电话号是否合格(当前只验证位数)
16 | ///
17 | ///
18 | ///
19 | public static bool IsPhoneNumber11(string _phoneNum)
20 | {
21 | if (_phoneNum.Length == 11)
22 | {
23 | return true;
24 | }
25 | return false;
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/NewPlugins/Pages/Index.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace NewPlugins.Pages
17 | {
18 | ///
19 | /// Index.xaml 的交互逻辑
20 | ///
21 | public partial class Index : Page
22 | {
23 | public Index()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/WebPlugins/ConfigConnection.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using Microsoft.Extensions.Configuration;
6 | using System.IO;
7 |
8 | namespace WebPlugins
9 | {
10 | public class ConfigConnection
11 | {
12 | public static string GetSqlConnStr(string connsectionName)
13 | {
14 | ConfigurationBuilder configurationBuilder = new ConfigurationBuilder();//创建ConfigurationBuilder对象
15 | configurationBuilder.SetBasePath(Directory.GetCurrentDirectory()).AddJsonFile("appsettings.json");
16 | var configuration = configurationBuilder.Build();
17 | return configuration[connsectionName];
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Client/Migrations/Configuration.cs:
--------------------------------------------------------------------------------
1 | namespace Client.Migrations
2 | {
3 | using System;
4 | using System.Data.Entity;
5 | using System.Data.Entity.Migrations;
6 | using System.Linq;
7 |
8 | internal sealed class Configuration : DbMigrationsConfiguration
9 | {
10 | public Configuration()
11 | {
12 | AutomaticMigrationsEnabled = false;
13 | }
14 |
15 | protected override void Seed(CoreDBContext context)
16 | {
17 | // This method will be called after migrating to the latest version.
18 |
19 | // You can use the DbSet.AddOrUpdate() helper extension method
20 | // to avoid creating duplicate seed data.
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Common/Global/LogType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | ///
8 | /// 日志类型
9 | ///
10 | public class LogType
11 | {
12 | ///
13 | /// 系统日志
14 | ///
15 | public const int System = 0;
16 | ///
17 | /// 授权日志
18 | ///
19 | public const int Authorization = 1;
20 | ///
21 | /// 正常操作记录
22 | ///
23 | public const int Info = 2;
24 | ///
25 | /// 插件更新
26 | ///
27 | public const int PluginsUpdate = 3;
28 | ///
29 | /// 系统错误
30 | ///
31 | public int SystemError = 4;
32 | }
33 |
--------------------------------------------------------------------------------
/Common/Utils/ColorHelper.cs:
--------------------------------------------------------------------------------
1 |
2 |
3 | using System.Windows.Media;
4 |
5 | public class ColorHelper
6 | {
7 | ///
8 | /// 将#xxxxxx类型转换为SolidColorBrush
9 | ///
10 | ///
11 | ///
12 | public static SolidColorBrush ConvertToSolidColorBrush(string _colorStr)
13 | {
14 | return new SolidColorBrush(ConvertToColor(_colorStr));
15 | }
16 |
17 | ///
18 | /// 将#xxxxxx类型转换为Color
19 | ///
20 | ///
21 | ///
22 | public static Color ConvertToColor(string _colorStr)
23 | {
24 | return (Color)ColorConverter.ConvertFromString(_colorStr);
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/CorePlugin/Pages/Manager/Setting.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace CorePlugin.Pages.Manager
17 | {
18 | ///
19 | /// Setting.xaml 的交互逻辑
20 | ///
21 | public partial class Setting : Page
22 | {
23 | public Setting()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/Common/MyControls/InfoBorder.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace Common.MyControls
17 | {
18 | ///
19 | /// UserControl1.xaml 的交互逻辑
20 | ///
21 | public partial class InfoBorder : UserControl
22 | {
23 | public InfoBorder()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/Common/Utils/PromotionCodeCommon.cs:
--------------------------------------------------------------------------------
1 |
2 | using System.Linq;
3 |
4 | namespace Common.Utils
5 | {
6 | ///
7 | /// 推广码
8 | ///
9 | public class PromotionCodeCommon
10 | {
11 | ///
12 | /// 生成新的编号
13 | ///
14 | ///
15 | ///
16 | public static string GetCode(int _id)
17 | {
18 | int minCodeLength = 4;
19 |
20 | if (_id.ToString().Length <= minCodeLength)
21 | {
22 | return _id.ToString().AutoLengthStr(minCodeLength);
23 | }
24 | else
25 | {
26 | return _id.ToString();
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/Common/MyControls/EditMenuItem.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace Common.MyControls
17 | {
18 | ///
19 | /// EditMenuItem.xaml 的交互逻辑
20 | ///
21 | public partial class EditMenuItem : UserControl
22 | {
23 | public EditMenuItem()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/WebPlugins/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "iisSettings": {
3 | "windowsAuthentication": false,
4 | "anonymousAuthentication": true,
5 | "iisExpress": {
6 | "applicationUrl": "http://localhost:22144",
7 | "sslPort": 44332
8 | }
9 | },
10 | "profiles": {
11 | "IIS Express": {
12 | "commandName": "IISExpress",
13 | "launchBrowser": true,
14 | "environmentVariables": {
15 | "ASPNETCORE_ENVIRONMENT": "Development"
16 | }
17 | },
18 | "WebPlugins": {
19 | "commandName": "Project",
20 | "launchBrowser": true,
21 | "applicationUrl": "https://localhost:5001;http://localhost:5000",
22 | "environmentVariables": {
23 | "ASPNETCORE_ENVIRONMENT": "Development"
24 | }
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Common/Extensions/ListExtensions.cs:
--------------------------------------------------------------------------------
1 |
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 |
6 | public static class ListExtensions
7 | {
8 | ///
9 | /// List string 转List int
10 | ///
11 | ///
12 | ///
13 | public static List String2Int(this List list)
14 | {
15 | return list.Select(x => Convert.ToInt32(x)) .ToList();
16 | }
17 | ///
18 | /// List int 转List string
19 | ///
20 | ///
21 | ///
22 | public static List Int2String(this List list)
23 | {
24 | return list.Select(x => Convert.ToString(x)).ToList();
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Common/Global/MainWindowGlobal.cs:
--------------------------------------------------------------------------------
1 |
2 | using CoreDBModels;
3 | using System.Collections.Generic;
4 |
5 | namespace Common
6 | {
7 | ///
8 | /// 主窗体公用
9 | ///
10 | public class MainWindowGlobal
11 | {
12 | public static BaseMainWindow MainWindow=null;
13 | ///
14 | /// 当前窗体中的插件
15 | ///
16 | public static List CurrPlugins = new List();
17 | ///
18 | /// 当前窗体中的模块
19 | ///
20 | public static List CurrPluginsModules = new List();
21 | ///
22 | /// 当前窗体中的页面
23 | ///
24 | public static List CurrModulePages = new List();
25 |
26 |
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/WebPlugins/Program.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Hosting;
2 | using Microsoft.Extensions.Configuration;
3 | using Microsoft.Extensions.Hosting;
4 | using Microsoft.Extensions.Logging;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Threading.Tasks;
9 |
10 | namespace WebPlugins
11 | {
12 | public class Program
13 | {
14 | public static void Main(string[] args)
15 | {
16 | CreateHostBuilder(args).Build().Run();
17 | }
18 |
19 | public static IHostBuilder CreateHostBuilder(string[] args) =>
20 | Host.CreateDefaultBuilder(args)
21 | .ConfigureWebHostDefaults(webBuilder =>
22 | {
23 | webBuilder.UseStartup();
24 | });
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/CoreDBModels/PluginsModule.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel.DataAnnotations;
3 | using System.ComponentModel.DataAnnotations.Schema;
4 |
5 | namespace CoreDBModels
6 | {
7 | ///
8 | /// 插件模块
9 | ///
10 | public class PluginsModule
11 | {
12 | [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
13 | public int Id { get; set; }
14 |
15 | public int PluginsId { get; set; }
16 | ///
17 | /// 模块名称
18 | ///
19 | [MaxLength(50)]
20 | public string ModuleName { get; set; }
21 | [MaxLength(20)]
22 | public string Icon { get; set; }
23 | public int Order { get; set; }
24 |
25 | [NotMapped]
26 | public string DLLName { get; set; }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/Common/Extensions/DbContextExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Data.Entity;
3 |
4 | public static class DbContextExtensions
5 | {
6 | ///
7 | /// 判断数据表是否存在
8 | ///
9 | /// 表名称
10 | ///
11 | public static bool ExisTable(this DbContext _context, string _tableName)
12 | {
13 | var countResult = _context.Database.SqlQuery(typeof(int),
14 | $"SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE' AND TABLE_NAME='{_tableName}'")
15 | .ToListAsync().Result;
16 | if (countResult == null || countResult.Count == 0) return false;
17 | int count = 0;
18 | if (!int.TryParse(countResult[0].ToString(), out count)) return false;
19 | return count > 0;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/CoreDBModels/EmailSendTo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel.DataAnnotations;
3 | using System.ComponentModel.DataAnnotations.Schema;
4 |
5 |
6 | namespace CoreDBModels
7 | {
8 | ///
9 | /// 邮件发送信息
10 | ///
11 | public class EmailSendTo
12 | {
13 | [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
14 | public int Id { get; set; }
15 | public int EmailId { get; set; }//邮件
16 | public string EmailTitle { get; set; }//邮件标题
17 | public int UserId { get; set; }//用户Id ====UserId 与 RoleId 同时=0的时候 就是发送给所有人的
18 | public int RoleId { get; set; }//角色Id
19 | public bool IsRead { get; set; }//是否阅读
20 | public string UserReadTime { get; set; }//阅读时间(只有UserId>0时 使用)
21 | public DateTime SendTime { get; set; }//发送时间
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Common/Global/ConnectionData.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | ///
4 | /// 数据库连接字符串集合
5 | ///
6 | public class DBConnections
7 | {
8 | static Dictionary Strs = new Dictionary();
9 |
10 | static DBConnections()
11 | {
12 |
13 | }
14 |
15 | public static void Set(string _key, string _value)
16 | {
17 | if (Strs.ContainsKey(_key)) Strs[_key] = _value;
18 | else Strs.Add(_key, _value);
19 | }
20 |
21 | ///
22 | /// 获取连接字符串 默认返回本机
23 | ///
24 | ///
25 | ///
26 | public static string Get(string _key)
27 | {
28 | if (Strs.ContainsKey(_key)) return Strs[_key];
29 | return @"Data Source=.;Initial Catalog=ZDB;User ID=sa;Password=123456;";
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/Common/Base/BaseUIModel.cs:
--------------------------------------------------------------------------------
1 |
2 | using System.ComponentModel;
3 |
4 | namespace Common
5 | {
6 | public class BaseUIModel : INotifyPropertyChanged
7 | {
8 | private bool isChecked = false;
9 | public bool IsChecked
10 | {
11 | get => isChecked;
12 | set
13 | {
14 | isChecked = value;
15 | NotifyPropertyChanged("IsChecked");
16 | }
17 | }
18 |
19 | public event PropertyChangedEventHandler PropertyChanged;
20 | ///
21 | /// 通知属性更改(列表会自动更新)
22 | ///
23 | ///
24 | public void NotifyPropertyChanged(string propertyName)
25 | {
26 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Client/Timers/BaseTimer.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace Client.Timers
8 | {
9 | public abstract class BaseTimer
10 | {
11 | ///
12 | /// 是否已开始
13 | ///
14 | public bool IsStarted = false;
15 |
16 | public System.Threading.Timer timer;
17 |
18 | ///
19 | /// 开始
20 | ///
21 | /// 毫秒
22 | public virtual void Start(int _milliseconds = 1000)
23 | {
24 | if (IsStarted) return;
25 | IsStarted = true;//已成功运行
26 | timer = new System.Threading.Timer(OnTimer,null,0, _milliseconds);
27 | }
28 |
29 | public abstract void OnTimer(object state);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/CoreDBModels/ModulePage.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel.DataAnnotations;
3 | using System.ComponentModel.DataAnnotations.Schema;
4 |
5 | namespace CoreDBModels
6 | {
7 | ///
8 | /// 插件中的页面
9 | ///
10 | public class ModulePage
11 | {
12 | [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
13 | public int Id { get; set; }
14 |
15 | public int PluginsId { get; set; }//插件Id
16 | public int ModuleId { get; set; }//模块Id
17 | [MaxLength(50)]
18 | public string PageName { get; set; }//页面名称
19 | [MaxLength(500)]
20 | public string PagePath { get; set; }//页面路径
21 | [MaxLength(20)]
22 | public string Icon { get; set; }
23 | public int Order { get; set; }//排序
24 |
25 | [NotMapped]
26 | public string FullPath { get; set; }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/Common/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/CorePlugin/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/NewPlugins/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/Client/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Common/Utils/ObjectComparerCommon.cs:
--------------------------------------------------------------------------------
1 | using ObjectsComparer;
2 | using System.Collections.Generic;
3 |
4 | namespace Common.Utils
5 | {
6 | ///
7 | /// 对象比较
8 | ///
9 | ///
10 | public class ObjectComparerCommon where T:class
11 | {
12 | ///
13 | /// 比较
14 | ///
15 | ///
16 | ///
17 | ///
18 | ///
19 | public bool Compare(T _t1,T _t2,out IEnumerable differences)
20 | {
21 | return new ObjectsComparer.Comparer().Compare(_t1, _t2, out differences);
22 | }
23 | public bool Compare(T _t1, T _t2)
24 | {
25 | return new ObjectsComparer.Comparer().Compare(_t1, _t2);
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/Common/Extensions/DateTimeExtensions.cs:
--------------------------------------------------------------------------------
1 |
2 | using System;
3 |
4 |
5 | public static class DateTimeExtensions
6 | {
7 | public static DateTime FormatYYYYMMDD2DateTime(this DateTime _time)
8 | {
9 | return Convert.ToDateTime(_time.ToString("yyyy-MM-dd"));
10 | }
11 |
12 | public static string FormatYYYYMMDD2String(this DateTime _time)
13 | {
14 | return _time.ToString("yyyy-MM-dd");
15 | }
16 |
17 | public static DateTime MinDate(this DateTime _time)
18 | {
19 | return Convert.ToDateTime(_time.ToString("yyyy-MM-dd 00:00:00"));
20 | }
21 |
22 |
23 | public static DateTime MaxDate(this DateTime _time)
24 | {
25 | return Convert.ToDateTime(_time.ToString("yyyy-MM-dd 23:59:59"));
26 | }
27 |
28 | public static DateTime CurrMonthMinDate(this DateTime _time)
29 | {
30 | return Convert.ToDateTime(_time.ToString("yyyy-MM-01 00:00:00"));
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Client/Migrations/202206270757195_init.Designer.cs:
--------------------------------------------------------------------------------
1 | //
2 | namespace Client.Migrations
3 | {
4 | using System.CodeDom.Compiler;
5 | using System.Data.Entity.Migrations;
6 | using System.Data.Entity.Migrations.Infrastructure;
7 | using System.Resources;
8 |
9 | [GeneratedCode("EntityFramework.Migrations", "6.4.4")]
10 | public sealed partial class init : IMigrationMetadata
11 | {
12 | private readonly ResourceManager Resources = new ResourceManager(typeof(init));
13 |
14 | string IMigrationMetadata.Id
15 | {
16 | get { return "202206270757195_init"; }
17 | }
18 |
19 | string IMigrationMetadata.Source
20 | {
21 | get { return null; }
22 | }
23 |
24 | string IMigrationMetadata.Target
25 | {
26 | get { return Resources.GetString("Target"); }
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Client/Windows/ChangePlugins.xaml:
--------------------------------------------------------------------------------
1 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Client/Migrations/202204220707272_removelog.Designer.cs:
--------------------------------------------------------------------------------
1 | //
2 | namespace CorePlugin.Migrations
3 | {
4 | using System.CodeDom.Compiler;
5 | using System.Data.Entity.Migrations;
6 | using System.Data.Entity.Migrations.Infrastructure;
7 | using System.Resources;
8 |
9 | [GeneratedCode("EntityFramework.Migrations", "6.4.4")]
10 | public sealed partial class removelog : IMigrationMetadata
11 | {
12 | private readonly ResourceManager Resources = new ResourceManager(typeof(removelog));
13 |
14 | string IMigrationMetadata.Id
15 | {
16 | get { return "202204220707272_removelog"; }
17 | }
18 |
19 | string IMigrationMetadata.Source
20 | {
21 | get { return null; }
22 | }
23 |
24 | string IMigrationMetadata.Target
25 | {
26 | get { return Resources.GetString("Target"); }
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/WebPlugins/Views/Shared/Error.cshtml:
--------------------------------------------------------------------------------
1 | @model ErrorViewModel
2 | @{
3 | ViewData["Title"] = "Error";
4 | }
5 |
6 |
Error.
7 |
An error occurred while processing your request.
8 |
9 | @if (Model.ShowRequestId)
10 | {
11 |
12 | Request ID:@Model.RequestId
13 |
14 | }
15 |
16 |
Development Mode
17 |
18 | Swapping to Development environment will display more detailed information about the error that occurred.
19 |
20 |
21 | The Development environment shouldn't be enabled for deployed applications.
22 | It can result in displaying sensitive information from exceptions to end users.
23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development
24 | and restarting the app.
25 |