Commit a34f807c authored by 姜春辉's avatar 姜春辉

添加项目文件。

parent 486afed0
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{95149426-C9E2-4339-B345-67F73F134C2F}</ProjectGuid>
<OutputType>library</OutputType>
<RootNamespace>ClassAttendanceStatistics</RootNamespace>
<AssemblyName>ClassAttendanceStatistics</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="CommonServiceLocator, Version=2.0.2.0, Culture=neutral, PublicKeyToken=489b6accfaf20ef0, processorArchitecture=MSIL">
<HintPath>..\packages\CommonServiceLocator.2.0.2\lib\net45\CommonServiceLocator.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Develop.Extension.Wpf, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\ThirdAddons\Develop.Extension.Wpf.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="GalaSoft.MvvmLight, Version=5.4.1.0, Culture=neutral, PublicKeyToken=e7570ab207bcb616, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="GalaSoft.MvvmLight.Extras, Version=5.4.1.0, Culture=neutral, PublicKeyToken=669f0b5e8f868abf, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.Extras.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="GalaSoft.MvvmLight.Platform, Version=5.4.1.0, Culture=neutral, PublicKeyToken=5f873c45e98af8a1, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.Platform.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="GS.Terminal.Common, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\ThirdAddons\GS.Terminal.Common.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="GS.Unitive.Framework, Version=1.4.0.2, Culture=neutral, PublicKeyToken=769358b197600ab3, processorArchitecture=MSIL">
<HintPath>..\packages\GS.Unitive.Framework.1.4.0.2\lib\net40\GS.Unitive.Framework.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.8\lib\net45-full\log4net.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Data" />
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmLightLibs.5.4.1.1\lib\net45\System.Windows.Interactivity.dll</HintPath>
</Reference>
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<Compile Include="CourseAttendance\CourseAttendance.xaml.cs">
<DependentUpon>CourseAttendance.xaml</DependentUpon>
</Compile>
<Compile Include="CourseAttendance\CourseAttendanceViewModel.cs" />
<Compile Include="CourseAttendance\PageControl.cs" />
<Compile Include="Models\ClassItem.cs" />
<Compile Include="Models\LessonInfo.cs" />
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Compile Include="ResponseModel\ResponseModel.cs" />
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<None Include="README.md" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\GS.Terminal.DashBoard.Interface\GS.Terminal.DashBoard.Interface.csproj">
<Project>{A574B188-3BD5-41D7-A0A6-ABDDB19D090C}</Project>
<Name>GS.Terminal.DashBoard.Interface</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Page Include="CourseAttendance\CourseAttendance.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="CourseAttendance\Style.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Resource Include="CourseAttendance\images\bg.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="CourseAttendance\images\btn-left.png" />
<Resource Include="CourseAttendance\images\btn-riht.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="CourseAttendance\images\none.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>del /q "$(TargetDir)*.pdb"
md "$(SolutionDir)$(SolutionName)\bin\Debug\Addons\GS.Terminal.DashBoard.Logic\DashBoards"
xcopy /s /e /y "$(ProjectDir)bin\debug" "$(SolutionDir)$(SolutionName)\Addons\GS.Terminal.DashBoard.Logic\DashBoards"</PostBuildEvent>
</PropertyGroup>
</Project>
\ No newline at end of file
using GS.Terminal.DashBoard.Interface;
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace ClassAttendanceStatistics
{
/// <summary>
/// CourseAttendance.xaml 的交互逻辑
/// </summary>
[Export(typeof(IDashBoardPage))]
public partial class CourseAttendance : Page, IDashBoardPage
{
public CourseAttendance()
{
InitializeComponent();
}
public Guid PageID => new Guid("2434f42b-b9bf-4369-997d-88349e61572a");
public Uri Icon => null;
public PageViewModel BindDataContext()
{
var vm = new CourseAttendanceViewModel();
this.DataContext = vm;
return vm;
}
public object Clone()
{
return new CourseAttendance() { DataContext = DataContext };
}
public void Dispose()
{
this.DataContext = null;
}
}
}
using ClassAttendanceStatistics.Model;
using GalaSoft.MvvmLight.Command;
using GS.Terminal.Common.WebService;
using GS.Terminal.DashBoard.Interface;
using GS.Unitive.Framework.Core;
using GS.Unitive.Framework.Logging;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Develop.Extension.Wpf;
namespace ClassAttendanceStatistics
{
public class CourseAttendanceViewModel : PageViewModel
{
#region 字段
private static ILogWriter logger = AddonRuntime.Instance.LogWriter;
#endregion
#region 方法
public CourseAttendanceViewModel()
{
DayPager.OnPageChanged += DayPager_OnPageChanged;
}
public override void Enter()
{
}
public override void Leave()
{
}
public override bool Update()
{
return LoadData();
}
private bool LoadData()
{
var postResp = WebServiceCenter.Post<WebServiceResult<List<ResponseModel.ResponseModel>>>(new Uri(Source), new object());
//数据出错
if (postResp.HasError())
{
logger.Error(postResp.String4Log, null);
return false;
}
//数据正常
else
{
ConvertModel(postResp.result);
return true;
}
}
/// <summary>
/// 将数据模型转换为视图模型
/// </summary>
/// <param name="result"></param>
private void ConvertModel(List<ResponseModel.ResponseModel> result)
{
LessonList = new ObservableCollection<Model.LessonInfo>(result.OrderBy(s => s.CourseName).Select(s => (LessonInfo)s));
HasContent = (LessonList.Count == 0 ? false : true);
DayPager.TotalData = LessonList.Count;
if (HasContent && SelectedLesson == null)
{
SelectLessonCommand?.Execute(LessonList.FirstOrDefault());
}
}
private void DayPager_OnPageChanged(Pager obj)
{
ObservableCollection<LessonInfo> lessons = new ObservableCollection<LessonInfo>();
LessonList.OrderBy(s => s.CourseName).Skip(DayPager.PageSize * (DayPager.PageIndex - 1)).Take(7).ToList().ForEach((s) =>
{
lessons.Add(s);
});
//美工太狠毒了, 界面实在不会做了, 只能通过数据解决
if (lessons.Count < 7)
{
int addCount = 7 - lessons.Count;
for (int i = 0; i < addCount; i++)
{
lessons.Add(new LessonInfo());
}
}
LessonListShow = lessons;
SelectLessonCommand.Execute(LessonListShow?.FirstOrDefault());
}
#endregion
#region View绑定
private Pager _DayPager;
public Pager DayPager
{
get { return _DayPager ?? (_DayPager = new Pager(7)); }
set { _DayPager = value; RaisePropertyChanged("DayPager"); }
}
private ObservableCollection<LessonInfo> _LessonListShow;
/// <summary>
/// 用于显示当前课程列表
/// </summary>
public ObservableCollection<LessonInfo> LessonListShow
{
get { return _LessonListShow ?? (_LessonListShow = new ObservableCollection<LessonInfo>()); }
set { _LessonListShow = value; RaisePropertyChanged("LessonListShow"); }
}
private bool _HasContent;
/// <summary>
/// 是否有课程信息
/// </summary>
public bool HasContent
{
get { return _HasContent; }
set { _HasContent = value; RaisePropertyChanged("HasContent"); }
}
private ObservableCollection<ObservableCollection<ClassItem>> _ClassListShow;
/// <summary>
/// 中间List显示的课程信息
/// </summary>
public ObservableCollection<ObservableCollection<ClassItem>> ClassListShow
{
get { return _ClassListShow ?? (_ClassListShow = new ObservableCollection<ObservableCollection<ClassItem>>()); }
set { _ClassListShow = value; RaisePropertyChanged("ClassListShow"); }
}
#endregion
#region 数据支持
private LessonInfo _SelectedLesson;
/// <summary>
/// 当前课程中的所有信息
/// </summary>
public LessonInfo SelectedLesson
{
get { return _SelectedLesson; }
set { _SelectedLesson = value; RaisePropertyChanged("SelectedLesson"); }
}
private ObservableCollection<LessonInfo> _LessonList;
/// <summary>
/// 所有课程
/// </summary>
public ObservableCollection<LessonInfo> LessonList
{
get { return _LessonList ?? (_LessonList = new ObservableCollection<LessonInfo>()); }
set { _LessonList = value; RaisePropertyChanged("LessonList"); }
}
#endregion
#region 命令
public RelayCommand<LessonInfo> SelectLessonCommand => new RelayCommand<LessonInfo>((lessoninfo) =>
{
if (lessoninfo != null && !lessoninfo.IsSelected && lessoninfo.ClassList != null)
{
if (SelectedLesson != null) SelectedLesson.IsSelected = false;
lessoninfo.IsSelected = true;
SelectedLesson = lessoninfo;
//分页后显示到主界面
if (SelectedLesson.ClassList != null)
{
ClassListShow = PageControl.CutPage(SelectedLesson.ClassList, 14);
}
}
});
#endregion
}
}
#region << >>
/*----------------------------------------------------------------
* 项目名称 :ClassAttendanceStatistics.CourseAttendance
* 项目描述 :
* 类 名 称 :PageControl
* 类 描 述 :
* 所在的域 :DESKTOP-MNML8TD
* 命名空间 :ClassAttendanceStatistics.CourseAttendance
* 机器名称 :DESKTOP-MNML8TD
* CLR 版本 :4.0.30319.42000
* 作 者 :栾凤杰
* 创建时间 :2018/9/10 17:27:47
* 更新时间 :2018/9/10 17:27:47
* 版 本 号 :v1.0.0.0
*******************************************************************
* Copyright @ 青岛通软网络有限公司 2018. All rights reserved.
*******************************************************************
//----------------------------------------------------------------*/
#endregion
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ClassAttendanceStatistics
{
/// <summary>
/// 用于将数据分页
/// </summary>
public class PageControl
{
public static ObservableCollection<ObservableCollection<T>> CutPage<T>(ObservableCollection<T> data, int pageSize)
{
var DataCount = data.Count;
var PageCount = (int)Math.Ceiling((double)DataCount / pageSize);
ObservableCollection<ObservableCollection<T>> result = new ObservableCollection<ObservableCollection<T>>();
for (int i = 0; i < PageCount; i++)
{
result.Add(new ObservableCollection<T>(data.Skip(i * pageSize).Take(pageSize)));
}
return result;
}
}
}
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="TableHeadBg" Color="#1E4FA7FF"/>
<Style x:Key="MainBorder" TargetType="Border">
<Setter Property="BorderThickness" Value="3"/>
<Setter Property="BorderBrush" Value="#3270ae"/>
<Setter Property="CornerRadius" Value="5"/>
<Setter Property="Background" Value="White"/>
</Style>
<Style x:Key="MainFontStyle" TargetType="TextBlock">
<Setter Property="Padding" Value="0,3,0,0"/>
<Setter Property="FontSize" Value="26"/>
<Setter Property="FontFamily" Value="微软雅黑"/>
<Setter Property="TextAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="Foreground" Value="#454545"/>
</Style>
</ResourceDictionary>
\ No newline at end of file
#region << >>
/*----------------------------------------------------------------
* 项目名称 :ClassAttendanceStatistics.Models
* 项目描述 :
* 类 名 称 :ClassItem
* 类 描 述 :
* 所在的域 :DESKTOP-MNML8TD
* 命名空间 :ClassAttendanceStatistics.Models
* 机器名称 :DESKTOP-MNML8TD
* CLR 版本 :4.0.30319.42000
* 作 者 :栾凤杰
* 创建时间 :2018/9/7 11:27:53
* 更新时间 :2018/9/7 11:27:53
* 版 本 号 :v1.0.0.0
*******************************************************************
* Copyright @ 青岛通软网络有限公司 2018. All rights reserved.
*******************************************************************
//----------------------------------------------------------------*/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using GalaSoft.MvvmLight;
namespace ClassAttendanceStatistics.Model
{
/// <summary>
/// 本班详细
/// </summary>
public class ClassItem : ObservableObject
{
private Guid _ClassID;
/// <summary>
/// 班级ID
/// </summary>
public Guid ClassID
{
get { return _ClassID; }
set { _ClassID = value; RaisePropertyChanged("ClassID"); }
}
private string _ClassName;
/// <summary>
/// 班级名称
/// </summary>
public string ClassName
{
get { return _ClassName; }
set { _ClassName = value; RaisePropertyChanged("ClassName"); }
}
private int _ShiDao;
/// <summary>
/// 实到人数
/// </summary>
public int ShiDao
{
get { return _ShiDao; }
set { _ShiDao = value; RaisePropertyChanged("ShiDao"); }
}
private int _YingDao;
/// <summary>
/// 应到人数
/// </summary>
public int YingDao
{
get { return _YingDao; }
set { _YingDao = value; RaisePropertyChanged("YingDao"); }
}
private int _QingJia;
/// <summary>
/// 请假人数
/// </summary>
public int QingJia
{
get { return _QingJia; }
set { _QingJia = value; RaisePropertyChanged("QingJia"); }
}
private int _WeiDao;
/// <summary>
/// 未到人数
/// </summary>
public int WeiDao
{
get { return _WeiDao; }
set { _WeiDao = value; RaisePropertyChanged("WeiDao"); }
}
private int _ChiDao;
/// <summary>
/// 迟到人数
/// </summary>
public int ChiDao
{
get { return _ChiDao; }
set { _ChiDao = value; RaisePropertyChanged("ChiDao"); }
}
private int _MianQian;
/// <summary>
/// 免签人数
/// </summary>
public int MianQian
{
get { return _MianQian; }
set { _MianQian = value; RaisePropertyChanged("MianQian"); }
}
/// <summary>
/// 将数据模型打包为视图模型
/// </summary>
/// <param name="resp"></param>
/// <returns></returns>
public static explicit operator ClassItem(ResponseModel.ClassItem resp)
{
var classItem = new ClassItem();
classItem.ClassID = resp.ClassId;
classItem.ClassName = resp.ClassName;
classItem.ShiDao = resp.ShiDao;
classItem.YingDao = resp.YingDao;
classItem.QingJia = resp.QingJia;
classItem.WeiDao = resp.WeiDao;
classItem.ChiDao = resp.ChiDao;
classItem.MianQian = resp.MianQian;
return classItem;
}
}
}
#region << >>
/*----------------------------------------------------------------
* 项目名称 :ClassAttendanceStatistics.Models
* 项目描述 :
* 类 名 称 :ClassList
* 类 描 述 :
* 所在的域 :DESKTOP-MNML8TD
* 命名空间 :ClassAttendanceStatistics.Models
* 机器名称 :DESKTOP-MNML8TD
* CLR 版本 :4.0.30319.42000
* 作 者 :栾凤杰
* 创建时间 :2018/9/7 13:17:37
* 更新时间 :2018/9/7 13:17:37
* 版 本 号 :v1.0.0.0
*******************************************************************
* Copyright @ 青岛通软网络有限公司 2018. All rights reserved.
*******************************************************************
//----------------------------------------------------------------*/
#endregion
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using GalaSoft.MvvmLight;
namespace ClassAttendanceStatistics.Model
{
/// <summary>
/// 某节课的班级列表
/// </summary>
public class LessonInfo : ObservableObject
{
/// <summary>
/// 打卡时间
/// </summary>
public string LessonTime
{
get
{
if (KQStartTime != null || KQEndTime != null)
{
return $"打卡 {KQStartTime} {KQEndTime}";
}
else
{
return string.Empty;
}
}
}
private string _CourseName;
/// <summary>
/// 课程名称
/// </summary>
public string CourseName
{
get { return _CourseName; }
set { _CourseName = value; RaisePropertyChanged("CourseName"); }
}
private string _KQStartTime;
/// <summary>
/// 考勤开始时间
/// </summary>
public string KQStartTime
{
get { return _KQStartTime; }
set { _KQStartTime = value; RaisePropertyChanged("KQStartTime"); RaisePropertyChanged("LessonTime"); }
}
private string _KQEndTime;
/// <summary>
/// 考勤结束时间
/// </summary>
public string KQEndTime
{
get { return _KQEndTime; }
set { _KQEndTime = value; RaisePropertyChanged("KQEndTime"); RaisePropertyChanged("LessonTime"); }
}
private string _PublishTime;
/// <summary>
/// 课程发布时间
/// </summary>
public string PublishTime
{
get { return _PublishTime; }
set { _PublishTime = value; RaisePropertyChanged("PublishTime"); }
}
private ObservableCollection<ClassItem> _ClassList;
/// <summary>
/// 班级的集合
/// </summary>
public ObservableCollection<ClassItem> ClassList
{
get { return _ClassList; }
set { _ClassList = value; RaisePropertyChanged("ClassList"); }
}
private bool _IsSelected;
public bool IsSelected
{
get { return _IsSelected; }
set { _IsSelected = value; RaisePropertyChanged("IsSelected"); }
}
/// <summary>
/// 将数据模型打包为视图模型
/// </summary>
/// <param name="resp"></param>
/// <returns></returns>
public static explicit operator LessonInfo(ResponseModel.ResponseModel resp)
{
var lessonInfo = new LessonInfo();
lessonInfo.CourseName = resp.CourseName;
lessonInfo.KQStartTime = resp.KQStartTime;
lessonInfo.KQEndTime = resp.KQEndTime;
lessonInfo.PublishTime = resp.PublishTime.ToString("发布时间 yyyy-MM-dd HH:mm");
lessonInfo.ClassList = new ObservableCollection<ClassItem>();
resp.CLassList.ForEach((s) =>
{
lessonInfo.ClassList.Add((ClassItem)s);
});
return lessonInfo;
}
}
}
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("ClassAttendanceStatistics")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ClassAttendanceStatistics")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//将 ComVisible 设置为 false 将使此程序集中的类型
//对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
//若要开始生成可本地化的应用程序,请设置
//.csproj 文件中的 <UICulture>CultureYouAreCodingWith</UICulture>
//例如,如果您在源文件中使用的是美国英语,
//使用的是美国英语,请将 <UICulture> 设置为 en-US。 然后取消
//对以下 NeutralResourceLanguage 特性的注释。 更新
//以下行中的“en-US”以匹配项目文件中的 UICulture 设置。
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly:ThemeInfo(
ResourceDictionaryLocation.None, //主题特定资源词典所处位置
//(未在页面中找到资源时使用,
//或应用程序资源字典中找到时使用)
ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置
//(未在页面中找到资源时使用,
//、应用程序或任何主题专用资源字典中找到时使用)
)]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本: 4.0.30319.42000
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace ClassAttendanceStatistics.Properties {
/// <summary>
/// 强类型资源类,用于查找本地化字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// 返回此类使用的缓存 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if ((resourceMan == null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ClassAttendanceStatistics.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 覆盖当前线程的 CurrentUICulture 属性
/// 使用此强类型的资源类的资源查找。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace ClassAttendanceStatistics.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
\ No newline at end of file
**学校班级考勤统计**
- **CourseAttendance**
班级课程考勤统计组件
#region << >>
/*----------------------------------------------------------------
* 项目名称 :ClassAttendanceStatistics.ResponseModel
* 项目描述 :
* 类 名 称 :ResponseModel
* 类 描 述 :
* 所在的域 :DESKTOP-MNML8TD
* 命名空间 :ClassAttendanceStatistics.ResponseModel
* 机器名称 :DESKTOP-MNML8TD
* CLR 版本 :4.0.30319.42000
* 作 者 :栾凤杰
* 创建时间 :2018/9/9 14:04:37
* 更新时间 :2018/9/9 14:04:37
* 版 本 号 :v1.0.0.0
*******************************************************************
* Copyright @ 青岛通软网络有限公司 2018. All rights reserved.
*******************************************************************
//----------------------------------------------------------------*/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ClassAttendanceStatistics.ResponseModel
{
public class ResponseModel
{
public string CourseName { get; set; }
public string KQStartTime { get; set; }
public string KQEndTime { get; set; }
public DateTime PublishTime { get; set; }
public List<ClassItem> CLassList { get; set; }
}
public class ClassItem
{
public Guid ClassId { get; set; }
public string ClassName { get; set; }
public int ShiDao { get; set; }
public int YingDao { get; set; }
public int QingJia { get; set; }
public int WeiDao { get; set; }
public int ChiDao { get; set; }
public int MianQian { get; set; }
}
}
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="CommonServiceLocator" version="2.0.2" targetFramework="net452" />
<package id="GS.Unitive.Framework" version="1.4.0.2" targetFramework="net452" />
<package id="log4net" version="2.0.8" targetFramework="net452" />
<package id="MvvmLightLibs" version="5.4.1.1" targetFramework="net452" />
<package id="Newtonsoft.Json" version="10.0.2" targetFramework="net452" />
</packages>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DashBoard.ServiceModel
{
//班级环境实时数据测试地址:http://192.168.1.2:8019/Visualization/ClassNowEn.ashx
public class Class_ClassNowEn
{
/// <summary>
/// 最新刷新时间
/// </summary>
public DateTime UpdateTime { get; set; }
/// <summary>
/// 班级信息
/// </summary>
public List<ClassEnvironmental> ClassList { get; set; }
}
/// <summary>
/// 班级单位信息
/// </summary>
public class ClassEnvironmental
{
/// <summary>
/// 班级编号
/// </summary>
public int ClassID { get; set; }
/// <summary>
/// 班级名称
/// </summary>
public string ClassName { get; set; }
/// <summary>
/// 教室编号
/// </summary>
public string RoomNumber { get; set; }
/// <summary>
/// 教室名称
/// </summary>
public string RoomName { get; set; }
/// <summary>
/// 噪声
/// </summary>
public decimal ZaoSheng { get; set; }
/// <summary>
/// 温度
/// </summary>
public decimal WenDu { get; set; }
/// <summary>
/// 湿度
/// </summary>
public decimal ShiDu { get; set; }
/// <summary>
/// 光照
/// </summary>
public decimal GuangZhao { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DashBoard.ServiceModel
{
/// <summary>
/// 学生对象,包含学生、最后打卡记录以及进出状态(在校状态)
/// </summary>
public class Student
{
/// <summary>
/// 打卡编号
/// </summary>
public int ID { get; set; }
/// <summary>
/// 学生编号
/// </summary>
public int StudentID { get; set; }
/// <summary>
/// 学生姓名
/// </summary>
public string StudentName { get; set; }
/// <summary>
/// 最后打卡时间
/// </summary>
public DateTime RecordTime { get; set; }
/// <summary>
/// 学生状态
/// </summary>
public StateEnum StudentState { get; set; }
/// <summary>
/// 是否在校
/// </summary>
public bool InSchool { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}
/// <summary>
/// 在校情况
/// </summary>
public enum StateEnum
{
正常,
离校,
请假,
异常
}
}
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{A1F9EC7B-EA1E-4141-B380-51D03324433A}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DashBoard.ServiceModel</RootNamespace>
<AssemblyName>DashBoard.ServiceModel</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Class_ClassNowEn.cs" />
<Compile Include="Class_StudentState.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="School_RoomRoder.cs" />
<Compile Include="School_StudentState.cs" />
<Compile Include="School_SuSheState.cs" />
<Compile Include="School_TeacherLeave.cs" />
<Compile Include="SuShe_KaoQin.cs" />
<Compile Include="SuShe_PingFen.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="readme.txt" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("DashBoard.ServiceModel")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DashBoard.ServiceModel")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("a1f9ec7b-ea1e-4141-b380-51d03324433a")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DashBoard.ServiceModel
{
/// <summary>
/// 房间对象
/// </summary>
public class Room
{
/// <summary>
/// 房间ID
/// </summary>
public int RoomID { get; set; }
/// <summary>
/// 房间名称
/// </summary>
public string RoomName { get; set; }
/// <summary>
/// 房间时间段
/// </summary>
public List<TimeSlot> slot { get; set; }
}
public class TimeSlot
{
/// <summary>
/// 预约时间段ID
/// </summary>
public string DayTimeID { get; set; }
/// <summary>
/// 预约时间段
/// </summary>
public string DayTime { get; set; }
/// <summary>
/// 是否可预约,true可预约false不可预约
/// </summary>
public bool IsTrue { get; set; }
/// <summary>
/// 预约信息
/// </summary>
public Order order { get; set; }
}
/// <summary>
/// 预约信息
/// </summary>
public class Order
{
/// <summary>
/// 预约ID
/// </summary>
public int ID { get; set; }
/// <summary>
/// 预约房间ID
/// </summary>
public int OrderRoomID { get; set; }
/// <summary>
/// 预约房间名称
/// </summary>
public string OrderRoomName { get; set; }
/// <summary>
/// 预约人ID
/// </summary>
public string OrderUserID { get; set; }
/// <summary>
/// 预约人姓名
/// </summary>
public string OrderUserName { get; set; }
/// <summary>
/// 审核状态
/// </summary>
public OrderTypeEnum OrderType { get; set; }
/// <summary>
/// 预约日期
/// </summary>
public DateTime OrderStartTime { get; set; }
/// <summary>
/// 星期几
/// </summary>
public DayOfWeek WeedDay { get; set; }
/// <summary>
/// 预约时间段ID
/// </summary>
public string DayTimeID { get; set; }
/// <summary>
/// 预约时间段
/// </summary>
public string DayTime { get; set; }
/// <summary>
/// 预约事由
/// </summary>
public string Reason { get; set; }
}
/// <summary>
/// 审核状态0待审核1已审核预约通过2已审核预约未通过3超时自动取消
/// </summary>
public enum OrderTypeEnum
{
待审核 = 0,
已预约 = 1,
未预约 = 2,
超时取消 = 3,
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DashBoard.ServiceModel
{
// <summary>
/// 学生在校状况
/// </summary>
public class School_StudentState
{
/// <summary>
/// 全校学生数
/// </summary>
public int StudentCount
{
get
{
var total = GaoYi?.Total + GaoEr?.Total + GaoSan?.Total;
return total.HasValue ? total.Value : 0;
}
}
/// <summary>
/// 在校学生数
/// </summary>
public int InCount
{
get
{
var total = GaoYi?.In + GaoEr?.In + GaoSan?.In;
return total.HasValue ? total.Value : 0;
}
}
/// <summary>
/// 离校学生数
/// </summary>
public int OutCount
{
get
{
var total = GaoYi?.Out + GaoEr?.Out + GaoSan?.Out;
return total.HasValue ? total.Value : 0;
}
}
/// <summary>
/// 请假学生数
/// </summary>
public int LeaveCount
{
get
{
var total = GaoYi?.Leave + GaoEr?.Leave + GaoSan?.Leave;
return total.HasValue ? total.Value : 0;
}
}
/// <summary>
/// 高一
/// </summary>
public Grade GaoYi { get; set; }
/// <summary>
/// 高二
/// </summary>
public Grade GaoEr { get; set; }
/// <summary>
/// 高三
/// </summary>
public Grade GaoSan { get; set; }
}
/// <summary>
/// 级部
/// </summary>
public class Grade
{
/// <summary>
/// 级部ID
/// </summary>
public Guid ID { get; set; }
/// <summary>
/// 级部ID
/// </summary>
public string Name { get; set; }
/// <summary>
/// 级部总人数
/// </summary>
public int Total { get; set; }
/// <summary>
/// 在校人数
/// </summary>
public int In { get; set; }
/// <summary>
/// 离校人数
/// </summary>
public int Out { get; set; }
/// <summary>
/// 请假人数
/// </summary>
public int Leave { get; set; }
/// <summary>
/// 班级列表
/// </summary>
public List<Class> ClassList { get; set; } = new List<Class>();
}
/// <summary>
/// 班级
/// </summary>
public class Class
{
/// <summary>
/// 班级ID
/// </summary>
public Guid ClassID { get; set; }
/// <summary>
/// 班级名称
/// </summary>
public string ClassName { get; set; }
/// <summary>
/// 级部总人数
/// </summary>
public int Total { get; set; }
/// <summary>
/// 在校人数
/// </summary>
public int In { get; set; }
/// <summary>
/// 离校人数
/// </summary>
public int Out { get; set; }
/// <summary>
/// 请假人数
/// </summary>
public int Leave { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DashBoard.ServiceModel
{
//宿舍状态测试地址:http://192.168.1.2:8019/Visualization/SuSheState.ashx?Bui=a
//传参说明:?Bui=a a男生宿舍楼b女生宿舍楼y游泳馆
public class School_SuSheState
{
/// <summary>
/// 楼层编号
/// </summary>
public int FloorNumber { get; set; }
/// <summary>
/// 楼层房间信息集合
/// </summary>
public List<SuShe> list { get; set; }
}
/// <summary>
/// 楼层包含的房间信息
/// </summary>
public class SuShe
{
/// <summary>
/// 房间编号
/// </summary>
public Guid RoomID { get; set; }
/// <summary>
/// 房间名称
/// </summary>
public string RoomName { get; set; }
/// <summary>
/// 宿舍已安排人数
/// </summary>
public int Sum { get; set; }
/// <summary>
/// 在宿舍人数
/// </summary>
public int In { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DashBoard.ServiceModel
{
public class School_TeacherLeave
{
public Leave msg { get; set; }
}
/// <summary>
/// 请假信息
/// </summary>
public class Leave
{
/// <summary>
/// 编号
/// </summary>
public int ID { get; set; }
/// <summary>
/// 请假教师编号
/// </summary>
public string TeacherID { get; set; }
/// <summary>
/// 请假教师姓名
/// </summary>
public string TeacherName { get; set; }
/// <summary>
/// 请假类型
/// </summary>
public string Type { get; set; }
/// <summary>
/// 请假事由
/// </summary>
public string Reason { get; set; }
/// <summary>
/// 请假开始日期
/// </summary>
public DateTime StartDate { get; set; }
/// <summary>
/// 请假结束日期
/// </summary>
public DateTime EndDate { get; set; }
/// <summary>
/// 审核部门缩写编号
/// </summary>
public string DeptNo { get; set; }
/// <summary>
/// 审核部门名称
/// </summary>
public string DeptName { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DashBoard.ServiceModel
{
//宿舍考勤状态测试地址:http://192.168.1.2:8019/Visualization/SuSheState.ashx?DataType=kaoqin&RoomID=10000151&NowTime=02-11
//传参说明: DataType=kaoqin,返回考勤数据. RoomID=10000151,宿舍编号. NowTime=02-11,选择的日期. 三个参数必须要传
public class SuShe_KaoQin
{
/// <summary>
/// 床位id
/// </summary>
public int BidID { get; set; }
/// <summary>
/// 床位编号
/// </summary>
public string BidNumber { get; set; }
/// <summary>
/// 学生id
/// </summary>
public int StudentID { get; set; }
/// <summary>
/// 学生姓名
/// </summary>
public string StudentName { get; set; }
/// <summary>
/// 班级编号
/// </summary>
public Guid ClassID { get; set; }
/// <summary>
/// 班级名称
/// </summary>
public string ClassName { get; set; }
/// <summary>
/// 打卡时间
/// </summary>
public string RecordTime { get; set; }
/// <summary>
/// 考勤状态
/// </summary>
public string State { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DashBoard.ServiceModel
{
//宿舍评分测试地址:http://192.168.1.2:8019/Visualization/SuSheState.ashx?DataType=pingfen&RoomID=10000151&NowTime=02-08
//传参说明: DataType=pingfen,返回评分数据. RoomID=10000151,宿舍编号. NowTime=02-08,选择的日期. 三个参数必须要传
public class SuShe_PingFen
{
public decimal Sum { get; set; }
public List<PingFen> msg { get; set; }
}
public class PingFen
{
/// <summary>
/// 评分ID
/// </summary>
public int ID { get; set; }
/// <summary>
/// 评分对象
/// </summary>
public string Obj { get; set; }
/// <summary>
/// 评分类型ID
/// </summary>
public int ProjectID { get; set; }
/// <summary>
/// 评分类型名称
/// </summary>
public string ProjectName { get; set; }
/// <summary>
/// 评分分值
/// </summary>
public decimal Score { get; set; }
/// <summary>
/// 评分班级ID
/// </summary>
public int ClassID { get; set; }
/// <summary>
/// 评分班级名称
/// </summary>
public string ClassName { get; set; }
/// <summary>
/// 评分说明、备注
/// </summary>
public string Remark { get; set; }
}
}
http://192.168.1.2:8019/Visualization/StudentState.ashx 学生在校状态
数据模型School_StudentState.cs
http://192.168.1.2:8019/Visualization/RoomOrder.ashx?NowTime=03-11 房间预约
数据模型School_RoomRoder.cs
http://192.168.1.2:8019/Visualization/RoomOrderByID.ashx?OrderID=50 房间预约详情
数据模型School_RoomRoder.cs
http://192.168.1.2:8019/Visualization/TeacherLeave.ashx?NowTime=03-11 教师请假
数据模型School_TeacherLeave.cs
\ No newline at end of file
This diff is collapsed.
using GS.Terminal.LogicShell.Interface;
using GS.Unitive.Framework.Security.Core;
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace DashBoardView
{
/// <summary>
/// DashBoardMain.xaml 的交互逻辑
/// </summary>
[Export(typeof(IView))]
[UnitiveView("来访登记系统主界面", "", "c232bed7-f4c9-4bc8-a2f7-3898f9f69abf", null)]
public partial class DashBoardMain : Page, IView
{
public DashBoardMain()
{
InitializeComponent();
}
public void BindDataContext(IViewModel vm)
{
this.DataContext = vm;
}
public object Clone()
{
return this;
}
public void GoBack()
{
throw new NotImplementedException();
}
public void GoForward()
{
throw new NotImplementedException();
}
public void NavigateToContent(object content)
{
throw new NotImplementedException();
}
public void Reset()
{
throw new NotImplementedException();
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{CFBE64F7-4EB9-4057-8182-0EBC2C96FD60}</ProjectGuid>
<OutputType>library</OutputType>
<RootNamespace>DashBoardView</RootNamespace>
<AssemblyName>DashBoardView</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Develop.Extension.Wpf, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\ThirdAddons\Develop.Extension.Wpf.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="GS.Terminal.LogicShell.Attributes, Version=1.0.6822.32760, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\ThirdAddons\GS.Terminal.LogicShell\GS.Terminal.LogicShell.Attributes.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="GS.Terminal.LogicShell.Interface">
<HintPath>..\..\ThirdAddons\GS.Terminal.LogicShell\GS.Terminal.LogicShell.Interface.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="GS.Unitive.Framework.Security, Version=1.4.0.2, Culture=neutral, PublicKeyToken=769358b197600ab3, processorArchitecture=MSIL">
<HintPath>..\packages\GS.Unitive.Framework.Security.1.4.0.2\lib\net40\GS.Unitive.Framework.Security.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Data" />
<Reference Include="System.Windows.Interactivity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<Compile Include="DashBoardMain.xaml.cs">
<DependentUpon>DashBoardMain.xaml</DependentUpon>
</Compile>
<Compile Include="Head.xaml.cs">
<DependentUpon>Head.xaml</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<Page Include="DashBoardMain.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Head.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Resource Include="images\bg.jpg" />
</ItemGroup>
<ItemGroup>
<Resource Include="images\icon-dormitory.png" />
<Resource Include="images\icon-leave.png" />
<Resource Include="images\icon-reserve.png" />
<Resource Include="images\icon-students.png" />
<Resource Include="images\icon-waiting.png" />
<Resource Include="images\img-waiting.jpg" />
</ItemGroup>
<ItemGroup>
<Resource Include="images\countdown.png" />
<Resource Include="images\icon_clock.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="images\clockbg.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>del /q "$(TargetDir)*.pdb"
md "$(SolutionDir)$(SolutionName)\bin\Debug\Addons\GS.Terminal.LogicShell\Views"
xcopy /s /e /y "$(ProjectDir)bin\debug" "$(SolutionDir)$(SolutionName)\Addons\GS.Terminal.LogicShell\Views"</PostBuildEvent>
</PropertyGroup>
</Project>
\ No newline at end of file
<Page x:Class="DashBoardView.Head"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:DashBoardView"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300"
Title="Head">
<Page.Resources>
<Storyboard x:Key="clock" RepeatBehavior="Forever">
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="textBlock">
<DiscreteObjectKeyFrame KeyTime="0:0:0.5" Value="{x:Static Visibility.Hidden}"/>
<DiscreteObjectKeyFrame KeyTime="0:0:1" Value="{x:Static Visibility.Visible}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</Page.Resources>
<Page.Triggers>
<EventTrigger RoutedEvent="FrameworkElement.Loaded">
<BeginStoryboard Storyboard="{StaticResource clock}"/>
</EventTrigger>
</Page.Triggers>
<Grid>
<Border Width="248" Height="60" HorizontalAlignment="Right" Margin="0,0,20,0">
<Border.Background>
<ImageBrush ImageSource="images/clockbg.png" Stretch="None"/>
</Border.Background>
<Grid Margin="4">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="100"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.RowSpan="2">
<TextBlock Text="{Binding Hour}" FontSize="42" Foreground="White">
</TextBlock>
<TextBlock x:Name="textBlock" Text=":" FontSize="42" Foreground="White">
</TextBlock>
<TextBlock Text="{Binding Minute}" FontSize="42" Foreground="White">
</TextBlock>
</StackPanel>
<TextBlock Grid.Column="1" Text="{Binding Week}" FontSize="16" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBlock Grid.Column="1" Grid.Row="1" Text="{Binding Day}" FontSize="19" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Grid>
</Border>
</Grid>
</Page>
using GS.Terminal.LogicShell.Attributes;
using GS.Terminal.LogicShell.Interface;
using GS.Unitive.Framework.Security.Core;
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace DashBoardView
{
/// <summary>
/// Head.xaml 的交互逻辑
/// </summary>
[MainShellPartView(PartType.HEAD)]
[Export(typeof(IView))]
[UnitiveView("头部部分", "", "f8a999ce-b484-4df6-b688-8a793b730c6c", null)]
public partial class Head : Page, IView
{
public Head()
{
InitializeComponent();
}
public void BindDataContext(IViewModel vm)
{
this.DataContext = vm;
}
public object Clone()
{
return this;
}
public void GoBack()
{
throw new NotImplementedException();
}
public void GoForward()
{
throw new NotImplementedException();
}
public void NavigateToContent(object content)
{
throw new NotImplementedException();
}
public void Reset()
{
throw new NotImplementedException();
}
}
}
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("DashBoardView")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DashBoardView")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//将 ComVisible 设置为 false 将使此程序集中的类型
//对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
//若要开始生成可本地化的应用程序,请设置
//.csproj 文件中的 <UICulture>CultureYouAreCodingWith</UICulture>
//例如,如果您在源文件中使用的是美国英语,
//使用的是美国英语,请将 <UICulture> 设置为 en-US。 然后取消
//对以下 NeutralResourceLanguage 特性的注释。 更新
//以下行中的“en-US”以匹配项目文件中的 UICulture 设置。
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly:ThemeInfo(
ResourceDictionaryLocation.None, //主题特定资源词典所处位置
//(未在页面中找到资源时使用,
//或应用程序资源字典中找到时使用)
ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置
//(未在页面中找到资源时使用,
//、应用程序或任何主题专用资源字典中找到时使用)
)]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本: 4.0.30319.42000
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace DashBoardView.Properties {
/// <summary>
/// 强类型资源类,用于查找本地化字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// 返回此类使用的缓存 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if ((resourceMan == null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DashBoardView.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 覆盖当前线程的 CurrentUICulture 属性
/// 使用此强类型的资源类的资源查找。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace DashBoardView.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="GS.Unitive.Framework.Security" version="1.4.0.2" targetFramework="net452" />
<package id="Newtonsoft.Json" version="10.0.2" targetFramework="net452" />
</packages>
\ No newline at end of file
This diff is collapsed.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DashBoardViewModel
{
public partial class DashBoardMain
{
private bool _ShowLRButton = true;
/// <summary>
/// 是否显示左右切换按钮
/// </summary>
public bool ShowLRButton
{
get { return _ShowLRButton; }
set { _ShowLRButton = value; RaisePropertyChanged("ShowLRButton"); }
}
private bool _EnableCancelFullScreen = true;
/// <summary>
/// 是否允许取消全屏
/// </summary>
public bool EnableCancelFullScreen
{
get { return _EnableCancelFullScreen; }
set { _EnableCancelFullScreen = value; RaisePropertyChanged("EnableCancelFullScreen"); }
}
private bool _ShowDownCountLabel;
public bool ShowDownCountLabel
{
get { return _ShowDownCountLabel; }
set { _ShowDownCountLabel = value; RaisePropertyChanged("ShowDownCountLabel"); }
}
}
}
using GalaSoft.MvvmLight;
using GS.Terminal.LogicShell.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DashBoardViewModel
{
public partial class DashBoardMain : ViewModelBase, IViewModel, IViewModelBehavior
{
public string ViewID => "c232bed7-f4c9-4bc8-a2f7-3898f9f69abf";
public void NavigateInto(IViewModel from)
{
}
public void NavigateOut(IViewModel to)
{
}
public void Reset()
{
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{DEF5B6CC-F295-47CD-A6E0-8D981942AC27}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DashBoardViewModel</RootNamespace>
<AssemblyName>DashBoardViewModel</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="CommonServiceLocator, Version=2.0.2.0, Culture=neutral, PublicKeyToken=489b6accfaf20ef0, processorArchitecture=MSIL">
<HintPath>..\packages\CommonServiceLocator.2.0.2\lib\net45\CommonServiceLocator.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="GalaSoft.MvvmLight, Version=5.4.1.0, Culture=neutral, PublicKeyToken=e7570ab207bcb616, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="GalaSoft.MvvmLight.Extras, Version=5.4.1.0, Culture=neutral, PublicKeyToken=669f0b5e8f868abf, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.Extras.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="GalaSoft.MvvmLight.Platform, Version=5.4.1.0, Culture=neutral, PublicKeyToken=5f873c45e98af8a1, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.Platform.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="GS.Terminal.Common, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\ThirdAddons\GS.Terminal.Common.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="GS.Terminal.LogicShell.Attributes">
<HintPath>..\..\ThirdAddons\GS.Terminal.LogicShell\GS.Terminal.LogicShell.Attributes.dll</HintPath>
</Reference>
<Reference Include="GS.Terminal.LogicShell.Interface">
<HintPath>..\..\ThirdAddons\GS.Terminal.LogicShell\GS.Terminal.LogicShell.Interface.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Core" />
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmLightLibs.5.4.1.1\lib\net45\System.Windows.Interactivity.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="DashBoardMain.cs" />
<Compile Include="DashBoardMain.Logic.cs" />
<Compile Include="DashBoardMain.UI.cs" />
<Compile Include="Head.cs" />
<Compile Include="Locator.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Tools.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\GS.Terminal.DashBoard.Interface\GS.Terminal.DashBoard.Interface.csproj">
<Project>{a574b188-3bd5-41d7-a0a6-abddb19d090c}</Project>
<Name>GS.Terminal.DashBoard.Interface</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>del /q "$(TargetDir)*.pdb"
xcopy /s /e /y "$(ProjectDir)bin\debug" "$(SolutionDir)$(SolutionName)\Addons\GS.Terminal.LogicShell\ViewModels"</PostBuildEvent>
</PropertyGroup>
</Project>
\ No newline at end of file
using GalaSoft.MvvmLight;
using GS.Terminal.LogicShell.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DashBoardViewModel
{
public class Head : ViewModelBase, IViewModel
{
public Head()
{
Task.Run(async () =>
{
while (true)
{
var now = DateTime.Now;
Week = now.DayOfWeek.ToString();
Day = now.ToString("MM/dd");
Hour = now.ToString("HH");
Minute = now.ToString("mm");
await Task.Delay(1000);
}
});
}
public string ViewID => "f8a999ce-b484-4df6-b688-8a793b730c6c";
private string _Week;
public string Week
{
get { return _Week; }
set { _Week = value; RaisePropertyChanged("Week"); }
}
private string _Day;
public string Day
{
get { return _Day; }
set { _Day = value; RaisePropertyChanged("Day"); }
}
private string _Hour;
public string Hour
{
get { return _Hour; }
set { _Hour = value; RaisePropertyChanged("Hour"); }
}
private string _Minute;
public string Minute
{
get { return _Minute; }
set { _Minute = value; RaisePropertyChanged("Minute"); }
}
public void Reset()
{
}
}
}
using CommonServiceLocator;
using GalaSoft.MvvmLight.Ioc;
using GS.Terminal.LogicShell.Interface;
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DashBoardViewModel
{
[Export(typeof(ILocator))]
public class Locator : ILocator
{
public Locator()
{
ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default);
SimpleIoc.Default.Register<DashBoardMain>();
SimpleIoc.Default.Register<Head>();
}
public DashBoardMain Main { get { return ServiceLocator.Current.GetInstance<DashBoardMain>(); } }
public Head Head { get { return ServiceLocator.Current.GetInstance<Head>(); } }
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("DashBoardViewModel")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DashBoardViewModel")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("def5b6cc-f295-47cd-a6e0-8d981942ac27")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Imaging;
namespace DashBoardViewModel
{
class Tools
{
internal static BitmapEncoder SaveToImage(FrameworkElement ui, int width, int height)
{
try
{
System.IO.FileStream fs = new System.IO.FileStream("D:\\1.jpg", System.IO.FileMode.Create);
RenderTargetBitmap bmp = new RenderTargetBitmap(width, height, 96d, 96d,
PixelFormats.Pbgra32);
bmp.Render(ui);
BitmapEncoder encoder = new PngBitmapEncoder();
encoder.Frames.Add(BitmapFrame.Create(bmp));
encoder.Save(fs);
fs.Close();
return encoder;
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
return null;
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="CommonServiceLocator" version="2.0.2" targetFramework="net452" />
<package id="MvvmLightLibs" version="5.4.1.1" targetFramework="net452" />
</packages>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{A574B188-3BD5-41D7-A0A6-ABDDB19D090C}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>GS.Terminal.DashBoard.Interface</RootNamespace>
<AssemblyName>GS.Terminal.DashBoard.Interface</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="CommonServiceLocator, Version=2.0.2.0, Culture=neutral, PublicKeyToken=489b6accfaf20ef0, processorArchitecture=MSIL">
<HintPath>..\packages\CommonServiceLocator.2.0.2\lib\net45\CommonServiceLocator.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="GalaSoft.MvvmLight, Version=5.4.1.0, Culture=neutral, PublicKeyToken=e7570ab207bcb616, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="GalaSoft.MvvmLight.Extras, Version=5.4.1.0, Culture=neutral, PublicKeyToken=669f0b5e8f868abf, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.Extras.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="GalaSoft.MvvmLight.Platform, Version=5.4.1.0, Culture=neutral, PublicKeyToken=5f873c45e98af8a1, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.Platform.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="GS.Terminal.Common, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\ThirdAddons\GS.Terminal.Common.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="GS.Unitive.Framework, Version=1.4.0.2, Culture=neutral, PublicKeyToken=769358b197600ab3, processorArchitecture=MSIL">
<HintPath>..\packages\GS.Unitive.Framework.1.4.0.2\lib\net40\GS.Unitive.Framework.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.8\lib\net45-full\log4net.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmLightLibs.5.4.1.1\lib\net45\System.Windows.Interactivity.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="IDashBoardPage.cs" />
<Compile Include="IPageViewModel.cs" />
<Compile Include="PageViewModel.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Tools.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GS.Terminal.DashBoard.Interface
{
/// <summary>
/// 用来描述一个页面
/// </summary>
public interface IDashBoardPage : ICloneable, IDisposable
{
/// <summary>
/// 页面固定ID
/// </summary>
Guid PageID { get; }
/// <summary>
/// 主界面上菜单项的图标
/// </summary>
Uri Icon { get; }
/// <summary>
/// 页面标题
/// </summary>
string Title { get; }
/// <summary>
/// 页面自己处理viewmodel的绑定
/// </summary>
/// <returns>页面的viewmodel</returns>
PageViewModel BindDataContext();
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GS.Terminal.DashBoard.Interface
{
interface IPageViewModel
{
/// <summary>
/// 更新数据
/// </summary>
bool Update();
/// <summary>
/// 进入页面
/// </summary>
void Enter();
/// <summary>
/// 离开页面
/// </summary>
void Leave();
}
}
\ No newline at end of file
using GalaSoft.MvvmLight;
using GS.Terminal.Common.WebService;
using GS.Unitive.Framework.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GS.Terminal.DashBoard.Interface
{
public abstract class PageViewModel : ViewModelBase, IPageViewModel
{
public string Source { get; set; }
private WebServiceCenter webServiceCenter;
public WebServiceCenter WebServiceCenter
{
get
{
if (webServiceCenter == null)
webServiceCenter = new WebServiceCenter(AddonRuntime.Instance.LogWriter, string.Empty, string.Empty);
return webServiceCenter;
}
}
public abstract void Enter();
public abstract void Leave();
public abstract bool Update();
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("GS.Terminal.DashBoard.Interface")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("GS.Terminal.DashBoard.Interface")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("a574b188-3bd5-41d7-a0a6-abddb19d090c")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
using GS.Terminal.Common.WebService;
using GS.Unitive.Framework.Core;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Security.Cryptography;
using System.Security.Policy;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace GS.Terminal.DashBoard.Interface
{
public class Tools
{
private static WebServiceCenter _webServiceCenter;
static Tools()
{
if (!Directory.Exists(CacheDirectory))
{
Directory.CreateDirectory(CacheDirectory);
}
_webServiceCenter = new WebServiceCenter(AddonRuntime.Instance.LogWriter, string.Empty, string.Empty);
}
private static readonly string DefaultUserAgent = "GS.Terminal.DashBoard";
private static string CacheDirectory = Path.Combine(Application.StartupPath, "cache", "dashboard");
[Obsolete("新组件请直接使用WebServiceCenter.Post进行服务请求")]
public static bool Get<T>(Uri uri, out T entity)
{
entity = default(T);
var result = Get(uri, out string backData);
if (result)
{
entity = JsonConvert.DeserializeObject<T>(backData);
}
return result;
}
/// <summary>
/// 发送HTTP GET请求
/// </summary>
/// <param name="url"></param>
/// <param name="result"></param>
/// <returns></returns>
[Obsolete("新组件请直接使用WebServiceCenter.Post进行服务请求")]
public static bool Get(Uri url, out string result)
{
result = _webServiceCenter.Post(url, new { }, out bool haserror);
#region 由于新系统返回的结果被result包裹,为了兼容老的组件,这里过滤掉result
if (!haserror)
{
if (result.StartsWith("{\"result\":"))
{
result = result.Replace("{\"result\":", "");
result = result.Remove(result.Length - 1);
}
}
#endregion
return !haserror;
try
{
HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest;
request.ProtocolVersion = HttpVersion.Version10;
//request.Timeout = 1000 * 10;
request.Method = "GET";
request.ContentType = "text/html; charset=utf-8";
request.UserAgent = DefaultUserAgent;
var response = request.GetResponse() as HttpWebResponse;
using (var stream = response.GetResponseStream())
{
StreamReader _ResponseStream = new StreamReader(stream);
result = _ResponseStream.ReadToEnd();
stream.Close();
_ResponseStream.Close();
}
return true;
}
catch (Exception ee)
{
return false;
}
}
/// <summary>
/// 将内容写入缓存
/// </summary>
/// <param name="file">要存储的文件名称</param>
/// <param name="content">要写入的文件内容</param>
/// <returns>当缓存内容与要写入的内容一致时返回False,不一致时返回True</returns>
public static bool WriteCache(string file, string content)
{
var writeResult = false;
var fileFullPath = Path.Combine(CacheDirectory, file);
var cacheContent = ReadCache(file);
var cacheMD5 = GetMD5WithString(cacheContent);
var newMD5 = GetMD5WithString(content);
if (!cacheMD5.Equals(newMD5, StringComparison.CurrentCultureIgnoreCase))
{
if (!File.Exists(fileFullPath))
{
File.Create(fileFullPath).Dispose();
}
using (StreamWriter writer = new StreamWriter(fileFullPath))
{
writer.Write(content);
writeResult = true;
}
}
return writeResult;
}
/// <summary>
/// 读取缓存内容
/// </summary>
/// <param name="file">文件名称</param>
/// <returns></returns>
public static string ReadCache(string file)
{
var content = string.Empty;
var fileFullPath = Path.Combine(CacheDirectory, file);
if (File.Exists(fileFullPath))
{
using (StreamReader reader = new StreamReader(fileFullPath))
{
content = reader.ReadToEnd();
}
}
return content;
}
public static string GetMD5WithString(string sDataIn)
{
byte[] data = Encoding.GetEncoding("utf-8").GetBytes(sDataIn);
MD5 md5 = new MD5CryptoServiceProvider();
byte[] bytes = md5.ComputeHash(data);
return string.Join("", bytes.Select(ss => ss.ToString("x2")));
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="CommonServiceLocator" version="2.0.2" targetFramework="net452" />
<package id="GS.Unitive.Framework" version="1.4.0.2" targetFramework="net452" />
<package id="log4net" version="2.0.8" targetFramework="net452" />
<package id="MvvmLightLibs" version="5.4.1.1" targetFramework="net452" />
<package id="Newtonsoft.Json" version="10.0.2" targetFramework="net452" />
</packages>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?>
<Settings xmlns="urn:Chinags-Configuration" AddonName="GS.Terminal.Visitor.Logic">
<Dictionaries>
<Dict Caption="业务逻辑基本配置" Name="LogicConfig">
<Key Caption="界面切换的时间间隔(秒)" Choice="" Name="SwitchViewSecond" Value="30"/>
<Key Caption="是否显示菜单" Choice="" Name="ShowMenu" Value="true"/>
</Dict>
</Dictionaries>
<Structures>
<Structure Caption="仪表板配置" Name="DashBoardConfig">
<Declare>
<Property Caption="名称" Name="Name"/>
<Property Caption="ID" Name="DashBoardID"/>
<Property Caption="数据源地址" Name="Source"/>
<Property Caption="是否启用" Name="Enable"/>
<Property Caption="排序序号" Name="OrderIndex"/>
</Declare>
<Datas>
<!--班级考勤-->
<Data Name="班级考勤" DashBoardID="2434f42b-b9bf-4369-997d-88349e61572a" Source="http://192.168.1.5/Services/ClassAttendance/CourseAttendanceStatistics/Json" Enable="true" OrderIndex="1" />
<!--以下是可视化内容-->
<Data Name="学生在校状态" DashBoardID="28ef0db7-558f-4cb7-a1d3-afb0b5dc0623" Source="http://192.168.1.5/Services/HZEZDataSummary/SchoolAllStudentState/json" Enable="true" OrderIndex="1" />
<Data Name="房间预约" DashBoardID="dc9537ab-0480-45f0-a309-eec97b9fb734" Source="http://192.168.1.5/Services/HZEZDataSummary/SpecialClassroomOrderInfo/json" Enable="true" OrderIndex="2" />
<Data Name="宿舍状态" DashBoardID="f0eccb42-801c-462d-a98a-3de216314d51" Source="http://192.168.1.5/Services/HZEZDataSummary/GetSuSheData/json" Enable="true" OrderIndex="3" />
<Data Name="教师请假" DashBoardID="ddd2027a-d1d4-42ac-9313-8ce50d4b197f" Source="http://192.168.1.5/Services/HZEZDataSummary/TeacherLeaveList/json" Enable="true" OrderIndex="4" />
<Data Name="环境信息" DashBoardID="8a27048a-00ec-4906-8eb8-0fcd1d110436" Source="http://ykt.hz2hs.net.cn/Visualization/ClassNowEn.ashx" Enable="true" OrderIndex="5" />
</Datas>
</Structure>
</Structures>
</Settings>
\ No newline at end of file
using DashBoardViewModel;
using GS.Terminal.DashBoard.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GS.Terminal.DashBoard.Logic.Core
{
public class DashBoardCore
{
public DashBoardCore(IDashBoardPage[] dashBoardPages)
{
if (dashBoardPages != null)
foreach (var item in dashBoardPages)
{
var db = new Models.DashBoard();
db.ID = item.PageID;
db.Page = item;
db.ViewModel = item.BindDataContext();
var config = Program.setting.DashBoardConfig.Datas?.FirstOrDefault(ss => ss.DashBoardID == item.PageID);
if (config != null)
{
db.OrderIndex = config.OrderIndex;
db.Enable = config.Enable;
db.ViewModel.Source = config.Source;
}
DashBoards.Add(db);
}
}
public List<Models.DashBoard> DashBoards { get; set; } = new List<Models.DashBoard>();
/// <summary>
/// 将试图加载到界面
/// </summary>
public void doView()
{
var viewItems = DashBoards.Where(ss => ss.Enable)
.OrderBy(ss => ss.OrderIndex)
.Select(ss => new DashBoardItem()
{
ID = ss.Page.PageID,
Icon = ss.Page.Icon,
Title = ss.Page.Title,
ViewContent = ss.Page
}).ToList();
Program.locator.Main.InitDashBoard(viewItems);
}
private Task refreshTask;
/// <summary>
/// 开始刷新数据
/// </summary>
public void StartRefresh()
{
if (refreshTask == null)
{
refreshTask = new Task(async () =>
{
IsRefreshing = true;
do
{
DashBoards
.Where(ss => ss.Enable)
.ToList()
.ForEach(ss =>
{
try
{
ss.ViewModel.Update();
}
catch (Exception ee)
{
Program.logger.Error($"DashBoard数据刷新异常。", ee);
}
});
await Task.Delay(1000 * 60);
} while (IsRefreshing);
});
}
if (!IsRefreshing)
refreshTask.Start();
}
/// <summary>
/// 根据视图ID获取试图的ViewModel
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public PageViewModel GetViewModelByID(Guid viewid)
{
return DashBoards.FirstOrDefault(ss => ss.ID == viewid)?.ViewModel;
}
#region Property
private bool _IsRefreshing;
/// <summary>
/// 数据刷新线程是否正在运行中
/// </summary>
public bool IsRefreshing
{
get { return _IsRefreshing; }
set { _IsRefreshing = value; }
}
private int _SwitchSpan;
/// <summary>
/// 切换间隔
/// </summary>
public int SwitchSpan
{
get { return _SwitchSpan; }
set { _SwitchSpan = value; }
}
private bool _AutoSwitch;
/// <summary>
/// 是否自动播放
/// </summary>
public bool AutoSwitch
{
get { return _AutoSwitch; }
set
{
_AutoSwitch = value;
}
}
private int _AutoCloseSecond;
/// <summary>
/// 自动关闭时间
/// </summary>
public int AutoCloseSecond
{
get { return _AutoCloseSecond; }
set { _AutoCloseSecond = value; }
}
#endregion
}
}
using GS.Terminal.DashBoard.Interface;
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Hosting;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GS.Terminal.DashBoard.Logic.Core
{
public class DashBoardFinder
{
[ImportMany(typeof(IDashBoardPage))]
public IDashBoardPage[] DBPs;
public bool Find()
{
try
{
var aggregateCatalog = new AggregateCatalog();
DirectoryCatalog dc = new DirectoryCatalog(Program.addonContext.Addon.Location + "\\DashBoards", "*.dll");
aggregateCatalog.Catalogs.Add(dc);
CompositionContainer container = new CompositionContainer(aggregateCatalog);
container.ComposeParts(this);
return true;
}
catch (Exception ee)
{
Program.logger.Error("查找DashBoards出错", ee);
}
return false;
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{7F5D04DD-9328-40B5-A69E-7A6F99895073}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>GS.Terminal.DashBoard.Logic</RootNamespace>
<AssemblyName>GS.Terminal.DashBoard.Logic</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="CommonServiceLocator, Version=2.0.2.0, Culture=neutral, PublicKeyToken=489b6accfaf20ef0, processorArchitecture=MSIL">
<HintPath>..\packages\CommonServiceLocator.2.0.2\lib\net45\CommonServiceLocator.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="GalaSoft.MvvmLight, Version=5.4.1.0, Culture=neutral, PublicKeyToken=e7570ab207bcb616, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="GalaSoft.MvvmLight.Extras, Version=5.4.1.0, Culture=neutral, PublicKeyToken=669f0b5e8f868abf, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.Extras.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="GalaSoft.MvvmLight.Platform, Version=5.4.1.0, Culture=neutral, PublicKeyToken=5f873c45e98af8a1, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.Platform.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="GS.Terminal.Common, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\ThirdAddons\GS.Terminal.Common.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="GS.Terminal.LogicShell.Interface">
<HintPath>..\..\ThirdAddons\GS.Terminal.LogicShell\GS.Terminal.LogicShell.Interface.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="GS.Unitive.Framework, Version=1.4.0.2, Culture=neutral, PublicKeyToken=769358b197600ab3, processorArchitecture=MSIL">
<HintPath>..\packages\GS.Unitive.Framework.1.4.0.2\lib\net40\GS.Unitive.Framework.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.8\lib\net45-full\log4net.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Core" />
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmLightLibs.5.4.1.1\lib\net45\System.Windows.Interactivity.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="Core\DashBoardCore.cs" />
<Compile Include="Core\DashBoardFinder.cs" />
<Compile Include="LogicShell\Service.cs" />
<Compile Include="MainShell\Service.cs" />
<Compile Include="Models\DashBoard.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Setting\DashBoardConfig.cs" />
<Compile Include="Setting\GlobalSetting.cs" />
<Compile Include="Setting\LogicConfig.cs" />
<Compile Include="Setting\TerminalLocalSetting.cs" />
<Compile Include="ThemeAddon\Service.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="Config.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<SubType>Designer</SubType>
</Content>
<Content Include="Mapper.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DashBoardViewModel\DashBoardViewModel.csproj">
<Project>{def5b6cc-f295-47cd-a6e0-8d981942ac27}</Project>
<Name>DashBoardViewModel</Name>
</ProjectReference>
<ProjectReference Include="..\GS.Terminal.DashBoard.Interface\GS.Terminal.DashBoard.Interface.csproj">
<Project>{a574b188-3bd5-41d7-a0a6-abddb19d090c}</Project>
<Name>GS.Terminal.DashBoard.Interface</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>del /q "$(TargetDir)*.pdb"
xcopy /s /e /y "$(ProjectDir)bin\debug" "$(SolutionDir)$(SolutionName)\Addons\$(TargetName)"</PostBuildEvent>
</PropertyGroup>
</Project>
\ No newline at end of file
using GS.Terminal.LogicShell.Interface;
using GS.Unitive.Framework.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
namespace GS.Terminal.DashBoard.Logic.LogicShell
{
public class Service
{
private IAddonContext _addonContext;
private IViewHelperService _addonService;
public Service()
{
if (Program.addonContext != null)
{
_addonContext = Program.addonContext;
_addonService = _addonContext.GetFirstOrDefaultService<IViewHelperService>("GS.Terminal.LogicShell");
}
}
/// <summary>
/// 跳转页面
/// </summary>
/// <param name="vm"></param>
public void Show(IViewModel vm)
{
Application.Current.Dispatcher.BeginInvoke(new Action(() =>
{
_addonService?.ShowView(vm);
}));
}
/// <summary>
/// 跳转页面并在完成后执行回调
/// </summary>
/// <param name="vm"></param>
/// <param name="callback"></param>
public void Show(IViewModel vm, Action<object> callback)
{
Application.Current.Dispatcher.BeginInvoke(new Action(() =>
{
_addonService?.ShowView(vm, callback);
}));
}
/// <summary>
/// 跳转页面并在跳转完后后delay毫秒后执行回调
/// </summary>
/// <param name="vm"></param>
/// <param name="delay"></param>
/// <param name="callback"></param>
public void Show(IViewModel vm, int delay, Action<object> callback)
{
Application.Current.Dispatcher.BeginInvoke(new Action(() =>
{
_addonService.ShowView(vm, delay, callback);
}));
}
/// <summary>
/// 获取所有的ViewModel
/// </summary>
/// <returns></returns>
public IList<IViewModel> GetAllViewModel()
{
return _addonService?.GetAllViewModel();
}
}
}
using GS.Unitive.Framework.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GS.Terminal.DashBoard.Logic.MainShell
{
public class Service
{
private IAddonContext _addonContext;
private dynamic _addonService;
public Service()
{
if (Program.addonContext != null)
{
_addonContext = Program.addonContext;
_addonService = _addonContext.GetFirstOrDefaultService("GS.Terminal.MainShell", "GS.Terminal.MainShell.Services.UIService");
}
}
public void RegistBackgroundCommand(string cmd, Action action)
{
_addonService.RegistBackgroundCommand(cmd, action);
}
}
}
<?xml version="1.0" encoding="utf-8" ?>
<Extensibility xmlns="urn:Chinags-Extensibility-1.0" Name="数据仪表板业务逻辑插件" SymbolicName="GS.Terminal.Visitor.Logic" Version="1.0.0.0" StartLevel="999">
<License>dWQFG13hw6Mb8GfKDzviapq6qiVcsWqKwbjZxONSxhqjn/Z/3S6tn/QCEhZv50Faa4lwGY1/O5O35ZrNfRtcgD4+JU31wIQGfl3oDUZzoJ4R7l4Ivlim/rdPZqJ33WX8o9/qfUbbSCmJx3eFe87UMkXaLE+5Xpp7x+QNx3TRle0=</License>
<Activator Type="GS.Terminal.DashBoard.Logic.Program"/>
<Runtime>
<Assembly Path="GS.Terminal.DashBoard.Logic.dll" Share="true"/>
</Runtime>
<ObjectSpaces>
<!--<Channel ConnectionName="sqlite" ModelAssembly="GS.Terminal.Visitor.db" Name="localdb"/>-->
</ObjectSpaces>
</Extensibility>
\ No newline at end of file
using GS.Terminal.DashBoard.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GS.Terminal.DashBoard.Logic.Models
{
public class DashBoard
{
public Guid ID { get; set; }
public IDashBoardPage Page { get; set; }
public PageViewModel ViewModel { get; set; }
public bool Enable { get; set; }
public int OrderIndex { get; set; }
}
}
using DashBoardViewModel;
using GS.Unitive.Framework.Core;
using GS.Unitive.Framework.Logging;
using System;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GS.Terminal.DashBoard.Logic
{
public class Program : IAddonActivator
{
internal static IAddonContext addonContext;
internal static ILogWriter logger;
internal static Locator locator;
internal static LogicShell.Service LogicShellService;
internal static MainShell.Service MainShellService;
internal static ThemeAddon.Service ThemeService;
internal static Core.DashBoardFinder dbf;
internal static Core.DashBoardCore dbc;
internal static Setting.TerminalLocalSetting setting;
public void Start(IAddonContext Context)
{
addonContext = Context;
logger = Context.Logger;
dbf = new Core.DashBoardFinder();
AddonRuntime.Instance.onRuntimeCompleted += Instance_onRuntimeCompleted;
}
private void Instance_onRuntimeCompleted(object sender)
{
setting = new Setting.TerminalLocalSetting();
locator = new Locator();
LogicShellService = new LogicShell.Service();
MainShellService = new MainShell.Service();
ThemeService = new ThemeAddon.Service();
if (dbf.Find())
{
if (dbf.DBPs != null && dbf.DBPs.Length > 0)
{
dbc = new Core.DashBoardCore(dbf.DBPs);
dbc.doView();//加载DashBoard
}
else
{
logger.Error($"未找到DashBoard", null);
}
}
else
{
logger.Error($"查找DashBoard失败", null);
}
locator.Main.TurnSecond = setting.LogicConfig.SwitchViewSecond;
if (!setting.LogicConfig.ShowMenu)
{
/*
* 不显示菜单,直接显示内容页面
* 隐藏关闭按钮
*/
locator.Main.EnableCancelFullScreen = false;
locator.Main.ShowItem();
}
MainShellService.RegistBackgroundCommand("dashboard", () =>
{
LogicShellService.Show(locator.Main, arg => { dbc?.StartRefresh(); });
ThemeService.SetTheme("dashboard");
});
}
public void Stop(IAddonContext Context)
{
addonContext = null;
logger = null;
}
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("GS.Terminal.DashBoard.Logic")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("GS.Terminal.DashBoard.Logic")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("7f5d04dd-9328-40b5-a69e-7a6f99895073")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
using GS.Terminal.Common.LocalSetting;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GS.Terminal.DashBoard.Logic.Setting
{
public class DashBoardConfig : IStructureSetting<DashBoardItem>
{
public List<DashBoardItem> Datas { get; set; } = new List<DashBoardItem>();
public string StructureName => "DashBoardConfig";
}
public class DashBoardItem: IStructureSettingItem
{
public Guid DashBoardID { get; set; }
public string Source { get; set; }
public bool Enable { get; set; }
public int OrderIndex { get; set; }
}
}
using GS.Terminal.Common.LocalSetting;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GS.Terminal.DashBoard.Logic.Setting
{
public class GlobalSetting: IGlobalSetting
{
public string ServerIP { get; set; }
public string tCode { get; set; }
public string WebPath { get; set; }
}
}
using GS.Terminal.Common.LocalSetting;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GS.Terminal.DashBoard.Logic.Setting
{
public class LogicConfig : IDictSetting
{
public string DictName => "LogicConfig";
public int SwitchViewSecond { get; set; }
public bool ShowMenu { get; set; }
}
}
using GS.Terminal.Common.LocalSetting;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GS.Terminal.DashBoard.Logic.Setting
{
public class TerminalLocalSetting
{
public TerminalLocalSetting()
{
var properties = GetType().GetProperties();
foreach (var item in properties.Where(ss => !(ss.PropertyType.GetInterface(nameof(ISetting)) is null)))
{
item.SetValue(this, LocalSettingLoader.Load(item.PropertyType, Program.addonContext));
}
}
public LogicConfig LogicConfig { get; set; }
public GlobalSetting Global { get; set; }
public DashBoardConfig DashBoardConfig { get; set; }
}
}
using GS.Unitive.Framework.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GS.Terminal.DashBoard.Logic.ThemeAddon
{
public class Service
{
private IAddonContext _addonContext;
private dynamic _addonService;
public Service()
{
if (Program.addonContext != null)
{
_addonContext = Program.addonContext;
_addonService = _addonContext.GetFirstOrDefaultService("GS.Terminal.Theme", "GS.Terminal.Theme.Service");
}
}
public void SetTheme(string Name)
{
_addonService.SetTheme(Name);
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="CommonServiceLocator" version="2.0.2" targetFramework="net452" />
<package id="GS.Unitive.Framework" version="1.4.0.2" targetFramework="net452" />
<package id="log4net" version="2.0.8" targetFramework="net452" />
<package id="MvvmLightLibs" version="5.4.1.1" targetFramework="net452" />
<package id="Newtonsoft.Json" version="10.0.2" targetFramework="net452" />
</packages>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment