Commit bb9ea6b5 by wangonghui

CBA添加操作日志和足球世界杯开发

parent 506bb47c
......@@ -6,9 +6,28 @@ using System.Threading.Tasks;
namespace VIZ.TVP.CBA.Module
{
public class PluginConstant
public static class PluginConstant
{
public static string GroupName { get; set; } = "CBA";
/// <summary>
/// 加载数据
/// </summary>
public static string Operate_Load { get; set; } = "加载数据";
/// <summary>
/// 刷新数据
/// </summary>
public static string Opeate_Refresh { get; set; } = "刷新数据";
/// <summary>
/// 提示信息
/// </summary>
public static string Operate_Message { get; set; } = "推送数据更新时间";
}
}
......@@ -16,6 +16,8 @@ using System.Windows.Shapes;
using VIZ.Framework.Core;
using VIZ.Package.Domain;
using VIZ.Package.Module;
using VIZ.Package.Service;
using VIZ.Package.Storage;
namespace VIZ.TVP.CBA.Module
{
......@@ -45,7 +47,12 @@ namespace VIZ.TVP.CBA.Module
}
/// <summary>
/// 操作日志服务
/// </summary>
private RecordLogService recordLogService = new RecordLogService();
/// <summary>
/// 上版
/// </summary>
......@@ -55,6 +62,7 @@ namespace VIZ.TVP.CBA.Module
//DayMatchViewModel vm = thi DayMatchViewModel
//ApplicationDomainEx.PreviewConn.EndpointManager.Send("");
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_TAKE_TAKE);
if (conns.IsConnected && vm.MatchData != null)
{
//SCRIPT_INVOKE
......@@ -70,7 +78,8 @@ namespace VIZ.TVP.CBA.Module
/// <param name="conns">连接</param>
public void TakeContinue(ConnModel conns)
{
if(conns.IsConnected && vm.MatchData != null)
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_TAKE_CONTINUE);
if (conns.IsConnected && vm.MatchData != null)
{
conns.EndpointManager.Send(VizEngineCommands.STAGE_CONTINUE);
}
......@@ -91,6 +100,7 @@ namespace VIZ.TVP.CBA.Module
/// <param name="conns">连接</param>
public void TakeUpdate(ConnModel conns)
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_TAKE_UPDATE);
if (conns.IsConnected&& vm.MatchData!=null)
{
//SCRIPT_INVOKE
......@@ -104,7 +114,8 @@ namespace VIZ.TVP.CBA.Module
/// <param name="conn">连接</param>
public void PreviewIn(ConnModel conn)
{
if(conn.IsConnected && vm.MatchData != null)
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PREVIEW_PLAY);
if (conn.IsConnected && vm.MatchData != null)
{
//SCRIPT_INVOKE
conn.EndpointManager.Send(String.Format(VizEngineCommands.SCRIPT_INVOKE,"Data",vm.CombineMatchData()));
......@@ -183,6 +194,7 @@ namespace VIZ.TVP.CBA.Module
private void OnPreviewUpdate(ConnModel conn)
{
//this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PREVIEW_UPDATE);
if (conn.IsConnected)
{
vm.GetSchedule();
......@@ -194,6 +206,8 @@ namespace VIZ.TVP.CBA.Module
private void OnTakeUpdate(ConnModel conn)
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_TAKE_UPDATE);
if (conn.IsConnected)
{
vm.GetSchedule();
......@@ -214,6 +228,7 @@ namespace VIZ.TVP.CBA.Module
public void PreviewUpdate(ConnModel conn)
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PREVIEW_UPDATE);
if (conn.IsConnected && vm.MatchData != null)
{
//SCRIPT_INVOKE
......
......@@ -8,6 +8,8 @@ using VIZ.Framework.Core;
using log4net;
using VIZ.Package.Domain;
using VIZ.TVP.CBA.Module.Message.ViewModel;
using VIZ.Package.Service;
using VIZ.Package.Storage;
namespace VIZ.TVP.CBA.Module
{
......@@ -16,7 +18,12 @@ namespace VIZ.TVP.CBA.Module
/// <summary>
/// 日志
/// </summary>
private static ILog Log= LogManager.GetLogger(typeof(DayMatchViewModel));
private static ILog Log= LogManager.GetLogger(typeof(DayMatchViewModel));
/// <summary>
/// 操作日志服务
/// </summary>
private RecordLogService recordLogService = new RecordLogService();
public DayMatchViewModel()
......@@ -71,6 +78,7 @@ namespace VIZ.TVP.CBA.Module
/// </summary>
private void BtnCommand()
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human,"CBA日期:"+ PluginConstant.Operate_Load);
GetSchedule();
}
......@@ -80,6 +88,7 @@ namespace VIZ.TVP.CBA.Module
/// </summary>
private void BtmRoundCommand()
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, "CBA轮次:" + PluginConstant.Operate_Load);
SetRoundMatchData();
}
......@@ -331,6 +340,7 @@ namespace VIZ.TVP.CBA.Module
MessageLastRecordDate messageLastRecordDate = new MessageLastRecordDate();
private void PromptCmd()
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, "CBA赛程和轮次:" + PluginConstant.Operate_Message);
MessageLRDateViewModel vm = messageLastRecordDate.DataContext as MessageLRDateViewModel;
if (dayschedules != null)
......
......@@ -11,6 +11,8 @@ using System.Threading.Tasks;
using VIZ.Framework.Core;
using VIZ.Package.Domain;
using VIZ.Package.Module;
using VIZ.Package.Service;
using VIZ.Package.Storage;
namespace VIZ.TVP.CBA.Module
{
......@@ -19,9 +21,15 @@ namespace VIZ.TVP.CBA.Module
/// </summary>
public class DateHeaderViewModel : ViewModelBase
{
/// <summary>
/// 操作日志服务
/// </summary>
private RecordLogService recordLogService = new RecordLogService();
/// <summary>
/// 初始化构造函数
/// </summary>
public DateHeaderViewModel()
{
matchDate = DateTime.Today.ToShortDateString();
......@@ -133,6 +141,8 @@ namespace VIZ.TVP.CBA.Module
get { return mainDataConnection; }
set
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, "CBA查看主数据连接");
mainDataConnection = value;
this.RaisePropertyChanged(nameof(MainDataConnection));
......@@ -156,6 +166,7 @@ namespace VIZ.TVP.CBA.Module
get { return backDataConnection; }
set
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, "CBA查看备数据连接");
backDataConnection = value;
this.RaisePropertyChanged(nameof(BackDataConnection));
if(backDataConnection)
......@@ -249,6 +260,7 @@ namespace VIZ.TVP.CBA.Module
private void RefreshDayMatch()
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, "CBA查看赛程:" + PluginConstant.Operate_Load);
GetSchedule();
}
......@@ -264,9 +276,11 @@ namespace VIZ.TVP.CBA.Module
set
{
selectMatchData = value;
this.RaisePropertyChanged(nameof(SelectMatchData));
this.RaisePropertyChanged(nameof(SelectMatchData));
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, "CBA查看选择赛程:" + value.HomeTeamName+"VS"+ value.VisitingTeamName);
if(value==null)
if (value==null)
{
return;
}
......@@ -452,6 +466,9 @@ namespace VIZ.TVP.CBA.Module
private void BtmCommand()
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, "CBA查看球队积分:" + PluginConstant.Operate_Load);
var teamStands = JsonModel.PostTeamScoreData_Path();
if (teamStands == null) return;
TeamRanksModel = new ObservableCollection<Teamrank>();
......@@ -489,6 +506,10 @@ namespace VIZ.TVP.CBA.Module
private void RefreshTeamStats()
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, "CBA查看球队:" + PluginConstant.Operate_Load);
if (selectMatchData != null)
{
onAirDataModel = JsonModel.PostOnAirData_Path(selectMatchData.ScheduleID);
......@@ -648,7 +669,8 @@ namespace VIZ.TVP.CBA.Module
private void RefreshPlayer()
{
if(flag==0)
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, "CBA查看球队球员数据:" + PluginConstant.Opeate_Refresh);
if (flag==0)
{
SetHPlayerStats();
}
......@@ -725,6 +747,7 @@ namespace VIZ.TVP.CBA.Module
/// </summary>
private void UpDate()
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, "CBA查看赛程上一天:" + PluginConstant.Operate_Load);
MatchDate = Convert.ToDateTime(MatchDate).AddDays(-1).ToShortDateString();
GetSchedule();
......@@ -735,6 +758,7 @@ namespace VIZ.TVP.CBA.Module
/// </summary>
private void DownDate()
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, "CBA查看赛程下一天:" + PluginConstant.Operate_Load);
MatchDate = Convert.ToDateTime(MatchDate).AddDays(1).ToShortDateString();
GetSchedule();
}
......@@ -745,6 +769,8 @@ namespace VIZ.TVP.CBA.Module
/// </summary>
private void SetHPlayerStats()
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, "CBA查看主队球员:" + PluginConstant.Operate_Load);
if (SelectMatchData == null) return;
flag = 0;
ShowInfoPlayersStats = new ObservableCollection<PlayersStats>();
......@@ -803,6 +829,7 @@ namespace VIZ.TVP.CBA.Module
/// </summary>
private void SetAPlayerStats()
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, "CBA查看客队球员:" + PluginConstant.Operate_Load);
if (SelectMatchData == null) return;
flag = 1;
ShowInfoPlayersStats = new ObservableCollection<PlayersStats>();
......
......@@ -14,6 +14,8 @@ using System.Windows.Shapes;
using VIZ.Framework.Core;
using VIZ.Package.Domain;
using VIZ.Package.Module;
using VIZ.Package.Service;
using VIZ.Package.Storage;
namespace VIZ.TVP.CBA.Module
{
......@@ -25,6 +27,10 @@ namespace VIZ.TVP.CBA.Module
MvpPlayerViewModel vm = new MvpPlayerViewModel();
/// <summary>
/// 操作日志服务
/// </summary>
private RecordLogService recordLogService = new RecordLogService();
public MvpPlayerView()
{
......@@ -51,6 +57,7 @@ namespace VIZ.TVP.CBA.Module
private void MvplePlayerView_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
{
//this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, "打开mvp球员模板加载");
if (!string.IsNullOrEmpty(vm.ScheduleID) && !string.IsNullOrEmpty(vm.Matchtypeid))
{
vm.SetSingleData();
......@@ -78,6 +85,7 @@ namespace VIZ.TVP.CBA.Module
public void PreviewIn(ConnModel conn)
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PREVIEW_PLAY);
if (conn.IsConnected)
{
conn.EndpointManager.Send(String.Format(VizEngineCommands.SCRIPT_INVOKE, "mvpData", vm.CombineSingleData()));
......@@ -99,6 +107,7 @@ namespace VIZ.TVP.CBA.Module
public void TakeOut(ConnModel conns)
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_TAKE_OUT);
if (conns.IsConnected)
{
conns.EndpointManager.Send(VizEngineCommands.STAGE_CONTINUE);
......@@ -107,6 +116,7 @@ namespace VIZ.TVP.CBA.Module
public void TakeUpdate(ConnModel conns)
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_TAKE_UPDATE);
if (conns.IsConnected)
{
conns.EndpointManager.Send(String.Format(VizEngineCommands.SCRIPT_INVOKE, "mvpData", vm.CombineSingleData()));
......@@ -115,6 +125,8 @@ namespace VIZ.TVP.CBA.Module
public void TakIn(ConnModel conns)
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_TAKE_TAKE);
if (conns.IsConnected)
{
conns.EndpointManager.Send(String.Format(VizEngineCommands.SCRIPT_INVOKE, "mvpData", vm.CombineSingleData()));
......@@ -160,6 +172,7 @@ namespace VIZ.TVP.CBA.Module
private void OnPreviewUpdate(ConnModel conn)
{
//this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_TAKE_TAKE);
if (conn.IsConnected)
{
vm.BtnCommand();
......@@ -175,6 +188,7 @@ namespace VIZ.TVP.CBA.Module
private void OnTakeUpdate(ConnModel conn)
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_TAKE_UPDATE);
if (conn.IsConnected)
{
vm.BtnCommand();
......@@ -233,6 +247,7 @@ namespace VIZ.TVP.CBA.Module
public void PreviewUpdate(ConnModel conn)
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PREVIEW_UPDATE);
if (conn.IsConnected)
{
conn.EndpointManager.Send(String.Format(VizEngineCommands.SCRIPT_INVOKE, "mvpData", vm.CombineSingleData()));
......
......@@ -13,6 +13,8 @@ using VIZ.Package.Domain;
using System.Windows.Media;
using System.IO;
using VIZ.TVP.CBA.Module.Message.ViewModel;
using VIZ.Package.Service;
using VIZ.Package.Storage;
namespace VIZ.TVP.CBA.Module
{
......@@ -22,6 +24,12 @@ namespace VIZ.TVP.CBA.Module
//private static SinglePlayerViewModel _createInstance = null;
/// <summary>
/// 操作日志服务
/// </summary>
private RecordLogService recordLogService = new RecordLogService();
public static List<MvpPlayerViewModel> MvpPlayerViewModelInstance = new List<MvpPlayerViewModel>();
//{
// get
......@@ -940,6 +948,7 @@ namespace VIZ.TVP.CBA.Module
/// </summary>
public void BtnCommand()
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, "CBA:MVP球员:"+ PluginConstant.Opeate_Refresh);
onAirDataModel = JsonModel.PostOnAirData_Path(ScheduleID);
if (onAirDataModel == null) return;
MvpHomePlayerCompareNumDictionary.Clear();
......@@ -1988,7 +1997,7 @@ namespace VIZ.TVP.CBA.Module
MessageLastRecordDate messageLastRecordDate = new MessageLastRecordDate();
private void PromptCmd()
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, "CBA:MVP球员:" + PluginConstant.Operate_Message);
MessageLRDateViewModel vm = messageLastRecordDate.DataContext as MessageLRDateViewModel;
if (onAirDataModel != null)
{
......
......@@ -14,6 +14,8 @@ using System.Windows.Shapes;
using VIZ.Framework.Core;
using VIZ.Package.Domain;
using VIZ.Package.Module;
using VIZ.Package.Service;
using VIZ.Package.Storage;
using VIZ.TVP.CBA.Module;
namespace VIZ.TVP.CBA.Module
......@@ -25,6 +27,12 @@ namespace VIZ.TVP.CBA.Module
{
public NewPlayerComPareViewModel vm = new NewPlayerComPareViewModel();
/// <summary>
/// 操作日志服务
/// </summary>
private RecordLogService recordLogService = new RecordLogService();
public NewPlayerComPareView()
{
InitializeComponent();
......@@ -78,6 +86,7 @@ namespace VIZ.TVP.CBA.Module
public void PreviewIn(ConnModel conn)
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PREVIEW_PLAY);
if (conn.IsConnected)
{
conn.EndpointManager.Send(String.Format(VizEngineCommands.SCRIPT_INVOKE, "dqyData", vm.CombinePlayerCommand()));
......@@ -99,6 +108,7 @@ namespace VIZ.TVP.CBA.Module
public void TakeOut(ConnModel conns)
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_TAKE_OUT);
if (conns.IsConnected )
{
conns.EndpointManager.Send(VizEngineCommands.STAGE_CONTINUE);
......@@ -107,6 +117,7 @@ namespace VIZ.TVP.CBA.Module
public void TakeUpdate(ConnModel conns)
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_TAKE_UPDATE);
if (conns.IsConnected)
{
conns.EndpointManager.Send(String.Format(VizEngineCommands.SCRIPT_INVOKE, "dqyData", vm.CombinePlayerCommand()));
......@@ -115,6 +126,7 @@ namespace VIZ.TVP.CBA.Module
public void TakIn(ConnModel conns)
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_TAKE_TAKE);
if (conns.IsConnected)
{
conns.EndpointManager.Send(String.Format(VizEngineCommands.SCRIPT_INVOKE, "dqyData", vm.CombinePlayerCommand()));
......@@ -235,6 +247,7 @@ namespace VIZ.TVP.CBA.Module
public void PreviewUpdate(ConnModel conn)
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PREVIEW_UPDATE);
if (conn.IsConnected)
{
conn.EndpointManager.Send(String.Format(VizEngineCommands.SCRIPT_INVOKE, "dqyData", vm.CombinePlayerCommand()));
......
......@@ -16,12 +16,18 @@ using System.IO;
using VIZ.Package.Domain;
using VIZ.Package.Module;
using VIZ.TVP.CBA.Module.Message.ViewModel;
using VIZ.Package.Service;
using VIZ.Package.Storage;
namespace VIZ.TVP.CBA.Module
{
public class NewPlayerComPareViewModel : ViewModelBase
{
/// <summary>
/// 操作日志服务
/// </summary>
private RecordLogService recordLogService = new RecordLogService();
public NewPlayerComPareViewModel()
{
BtnCommand = new VCommand(BtnCmd);
......@@ -1505,6 +1511,9 @@ namespace VIZ.TVP.CBA.Module
public void BtnCmd()
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, "CBA球员对比:" + PluginConstant.Opeate_Refresh);
onAirDataModel = JsonModel.PostOnAirData_Path(ScheduleID);
if (onAirDataModel == null) return;
SetPlayer(false);
......@@ -1521,7 +1530,10 @@ namespace VIZ.TVP.CBA.Module
MessageLastRecordDate messageLastRecordDate = new MessageLastRecordDate();
private void PromptCmd()
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, "CBA球员对比:" + PluginConstant.Operate_Message);
MessageLRDateViewModel vm = messageLastRecordDate.DataContext as MessageLRDateViewModel;
if (onAirDataModel!=null)
{
......
......@@ -14,6 +14,8 @@ using System.Windows.Shapes;
using VIZ.Framework.Core;
using VIZ.Package.Domain;
using VIZ.Package.Module;
using VIZ.Package.Service;
using VIZ.Package.Storage;
namespace VIZ.TVP.CBA.Module
{
......@@ -25,7 +27,10 @@ namespace VIZ.TVP.CBA.Module
NewSinglePlayerViewModel vm = new NewSinglePlayerViewModel();
/// <summary>
/// 操作日志服务
/// </summary>
private RecordLogService recordLogService = new RecordLogService();
public NewSinglePlayerView()
{
InitializeComponent();
......@@ -78,6 +83,7 @@ namespace VIZ.TVP.CBA.Module
public void PreviewIn(ConnModel conn)
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PREVIEW_PLAY);
if (conn.IsConnected)
{
conn.EndpointManager.Send(String.Format(VizEngineCommands.SCRIPT_INVOKE, "dqyData", vm.CombineSingleData()));
......@@ -99,6 +105,7 @@ namespace VIZ.TVP.CBA.Module
public void TakeOut(ConnModel conns)
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_TAKE_OUT);
if (conns.IsConnected)
{
conns.EndpointManager.Send(VizEngineCommands.STAGE_CONTINUE);
......@@ -107,6 +114,7 @@ namespace VIZ.TVP.CBA.Module
public void TakeUpdate(ConnModel conns)
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_TAKE_UPDATE);
if (conns.IsConnected)
{
conns.EndpointManager.Send(String.Format(VizEngineCommands.SCRIPT_INVOKE, "dqyData", vm.CombineSingleData()));
......@@ -115,6 +123,7 @@ namespace VIZ.TVP.CBA.Module
public void TakIn(ConnModel conns)
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_TAKE_TAKE);
if (conns.IsConnected)
{
conns.EndpointManager.Send(String.Format(VizEngineCommands.SCRIPT_INVOKE, "dqyData", vm.CombineSingleData()));
......@@ -175,6 +184,7 @@ namespace VIZ.TVP.CBA.Module
private void OnTakeUpdate(ConnModel conn)
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_TAKE_UPDATE);
if (conn.IsConnected)
{
vm.BtnCommand();
......@@ -233,6 +243,7 @@ namespace VIZ.TVP.CBA.Module
public void PreviewUpdate(ConnModel conn)
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PREVIEW_UPDATE);
if (conn.IsConnected)
{
conn.EndpointManager.Send(String.Format(VizEngineCommands.SCRIPT_INVOKE, "dqyData", vm.CombineSingleData()));
......
......@@ -13,6 +13,8 @@ using System.Windows.Media;
using System.IO;
using VIZ.Package.Domain;
using VIZ.TVP.CBA.Module.Message.ViewModel;
using VIZ.Package.Service;
using VIZ.Package.Storage;
namespace VIZ.TVP.CBA.Module
{
......@@ -22,6 +24,11 @@ namespace VIZ.TVP.CBA.Module
//private static SinglePlayerViewModel _createInstance = null;
/// <summary>
/// 操作日志服务
/// </summary>
private RecordLogService recordLogService = new RecordLogService();
public static List<NewSinglePlayerViewModel> SinglePlayerViewModelInstance = new List<NewSinglePlayerViewModel>();
//{
// get
......@@ -519,6 +526,8 @@ namespace VIZ.TVP.CBA.Module
private void PromptCmd()
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, "CBA单球员数据:" + PluginConstant.Operate_Message);
MessageLRDateViewModel vm = messageLastRecordDate.DataContext as MessageLRDateViewModel;
if (onAirDataModel != null)
{
......@@ -1472,6 +1481,9 @@ namespace VIZ.TVP.CBA.Module
/// </summary>
public void BtnCommand()
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, "CBA单球员数据:" + PluginConstant.Opeate_Refresh);
onAirDataModel = JsonModel.PostOnAirData_Path(ScheduleID);
if (onAirDataModel == null) return;
MvpHomePlayerCompareNumDictionary.Clear();
......
......@@ -13,6 +13,8 @@ using System.Windows.Navigation;
using System.Windows.Shapes;
using VIZ.Framework.Core;
using VIZ.Package.Domain;
using VIZ.Package.Service;
using VIZ.Package.Storage;
namespace VIZ.TVP.CBA.Module
{
......@@ -22,6 +24,12 @@ namespace VIZ.TVP.CBA.Module
public partial class TeamStandingView : UserControl, IPluginView
{
TeamStandingViewModel vm = null;
/// <summary>
/// 操作日志服务
/// </summary>
private RecordLogService recordLogService = new RecordLogService();
public TeamStandingView()
{
InitializeComponent();
......@@ -53,7 +61,8 @@ namespace VIZ.TVP.CBA.Module
public void PreviewIn(ConnModel conn)
{
//Data
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PREVIEW_PLAY);
if (conn.IsConnected&&vm.TeamRanksModel!=null)
{
conn.EndpointManager.Send(String.Format(VizEngineCommands.SCRIPT_INVOKE, "Data", vm.CombineTeamStandingData()));
......@@ -68,6 +77,7 @@ namespace VIZ.TVP.CBA.Module
public void PreviewUpdate(ConnModel conn)
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PREVIEW_UPDATE);
if (conn.IsConnected && vm.TeamRanksModel != null)
{
conn.EndpointManager.Send(String.Format(VizEngineCommands.SCRIPT_INVOKE, "Data", vm.CombineTeamStandingData()));
......@@ -76,6 +86,8 @@ namespace VIZ.TVP.CBA.Module
public void TakeContinue(ConnModel conns)
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_TAKE_CONTINUE);
if (conns.IsConnected && vm.TeamRanksModel != null)
{
conns.EndpointManager.Send(VizEngineCommands.STAGE_CONTINUE);
......@@ -84,6 +96,8 @@ namespace VIZ.TVP.CBA.Module
public void TakeOut(ConnModel conns)
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_TAKE_OUT);
if (conns.IsConnected && vm.TeamRanksModel != null)
{
conns.EndpointManager.Send(VizEngineCommands.STAGE_CONTINUE);
......@@ -92,6 +106,8 @@ namespace VIZ.TVP.CBA.Module
public void TakeUpdate(ConnModel conns)
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_TAKE_UPDATE);
if (conns.IsConnected && vm.TeamRanksModel != null)
{
conns.EndpointManager.Send(String.Format(VizEngineCommands.SCRIPT_INVOKE, "Data", vm.CombineTeamStandingData()));
......@@ -100,6 +116,7 @@ namespace VIZ.TVP.CBA.Module
public void TakIn(ConnModel conns)
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_TAKE_TAKE);
if (conns.IsConnected && vm.TeamRanksModel != null)
{
conns.EndpointManager.Send(String.Format(VizEngineCommands.SCRIPT_INVOKE, "Data", vm.CombineTeamStandingData()));
......
......@@ -7,6 +7,9 @@ using System.Threading.Tasks;
using VIZ.Framework.Core;
using log4net;
using VIZ.TVP.CBA.Module.Message.ViewModel;
using VIZ.Package.Service;
using VIZ.Package.Domain;
using VIZ.Package.Storage;
namespace VIZ.TVP.CBA.Module
{
......@@ -15,7 +18,12 @@ namespace VIZ.TVP.CBA.Module
/// <summary>
/// 日志
/// </summary>
private static ILog Log= LogManager.GetLogger(typeof(TeamStandingViewModel));
private static ILog Log= LogManager.GetLogger(typeof(TeamStandingViewModel));
/// <summary>
/// 操作日志服务
/// </summary>
private RecordLogService recordLogService = new RecordLogService();
/// <summary>
/// 球队排名初始化排名
......@@ -148,7 +156,9 @@ namespace VIZ.TVP.CBA.Module
TeamRanks teamStands = null;
private void BtmCommand()
{
teamStands=new TeamRanks();
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, "CBA球队积分排名:" + PluginConstant.Operate_Load);
teamStands =new TeamRanks();
teamStands = JsonModel.PostTeamScoreData_Path();
if (teamStands == null) return;
TeamRanksModel = new ObservableCollection<Teamrank>();
......@@ -269,6 +279,9 @@ namespace VIZ.TVP.CBA.Module
private void PromptCmd()
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, "CBA球队积分排名:" + PluginConstant.Operate_Message);
MessageLRDateViewModel vm = messageLastRecordDate.DataContext as MessageLRDateViewModel;
if (teamStands != null)
{
......
......@@ -15,6 +15,8 @@ using System.Windows.Shapes;
using VIZ.Framework.Core;
using VIZ.Package.Domain;
using VIZ.Package.Module;
using VIZ.Package.Service;
using VIZ.Package.Storage;
namespace VIZ.TVP.CBA.Module
{
......@@ -24,6 +26,12 @@ namespace VIZ.TVP.CBA.Module
public partial class NewTeamStatsView : UserControl, IPluginView
{
public NewTeamStatsViewModel vm = new NewTeamStatsViewModel();
/// <summary>
/// 操作日志服务
/// </summary>
private RecordLogService recordLogService = new RecordLogService();
public NewTeamStatsView()
{
InitializeComponent();
......@@ -81,6 +89,7 @@ namespace VIZ.TVP.CBA.Module
public void PreviewIn(ConnModel conn)
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PREVIEW_PLAY);
if (conn.IsConnected)
{
conn.EndpointManager.Send(String.Format(VizEngineCommands.SCRIPT_INVOKE, "dqyData", vm.CombineTeamComData()));
......@@ -102,6 +111,7 @@ namespace VIZ.TVP.CBA.Module
public void TakeOut(ConnModel conns)
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_TAKE_OUT);
if (conns.IsConnected)
{
conns.EndpointManager.Send(VizEngineCommands.STAGE_CONTINUE);
......@@ -110,6 +120,9 @@ namespace VIZ.TVP.CBA.Module
public void TakeUpdate(ConnModel conns)
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_TAKE_UPDATE);
if (conns.IsConnected)
{
conns.EndpointManager.Send(string.Format(VizEngineCommands.SCRIPT_INVOKE, "dqyData", vm.CombineTeamComData()));
......@@ -118,6 +131,8 @@ namespace VIZ.TVP.CBA.Module
public void TakIn(ConnModel conns)
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_TAKE_TAKE);
if (conns.IsConnected)
{
conns.EndpointManager.Send(string.Format(VizEngineCommands.SCRIPT_INVOKE, "dqyData", vm.CombineTeamComData()));
......@@ -142,6 +157,7 @@ namespace VIZ.TVP.CBA.Module
private void OnTakeUpdate(ConnModel conn)
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_TAKE_UPDATE);
if (conn.IsConnected)
{
vm.BtnCmd();
......@@ -246,6 +262,8 @@ namespace VIZ.TVP.CBA.Module
public void PreviewUpdate(ConnModel conn)
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PREVIEW_UPDATE);
if (conn.IsConnected)
{
conn.EndpointManager.Send(String.Format(VizEngineCommands.SCRIPT_INVOKE, "dqyData", vm.CombineTeamComData()));
......
......@@ -12,6 +12,8 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using VIZ.Framework.Core;
using VIZ.Package.Domain;
using VIZ.Package.Service;
using VIZ.Package.Storage;
using VIZ.TVP.CBA.Module.Message.ViewModel;
namespace VIZ.TVP.CBA.Module
......@@ -22,7 +24,10 @@ namespace VIZ.TVP.CBA.Module
public static List<NewTeamStatsViewModel> TeamStatsViewModelInstance = new List<NewTeamStatsViewModel>();
/// <summary>
/// 操作日志服务
/// </summary>
private RecordLogService recordLogService = new RecordLogService();
public NewTeamStatsViewModel()
{
BtnCommand = new VCommand(BtnCmd);
......@@ -254,7 +259,7 @@ namespace VIZ.TVP.CBA.Module
MessageLastRecordDate messageLastRecordDate = new MessageLastRecordDate();
private void PromptCmd()
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, "CBA球队数据统计:" + PluginConstant.Operate_Message);
MessageLRDateViewModel vm = messageLastRecordDate.DataContext as MessageLRDateViewModel;
if (onAirDataModel != null)
{
......@@ -1266,6 +1271,9 @@ namespace VIZ.TVP.CBA.Module
public void BtnCmd()
{
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, "CBA球队数据统计:" + PluginConstant.Operate_Message);
onAirDataModel = JsonModel.PostOnAirData_Path(ScheduleID);
if (onAirDataModel == null) return;
Utils.NewSetHomeTeamDictionary(this);
......
......@@ -73,6 +73,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "70-Product", "70-Product",
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VIZ.Package", "..\VIZ.Package\VIZ.Package\VIZ.Package.csproj", "{5E259876-8FA4-4AD1-9D91-07A76ABC2A16}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VIZ.TVP.FTB.Module", "VIZ.TVP.FTB.Module\VIZ.TVP.FTB.Module.csproj", "{8768CECB-A595-4C41-99E2-FBA5096CB6A8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
......@@ -249,6 +251,14 @@ Global
{5E259876-8FA4-4AD1-9D91-07A76ABC2A16}.Release|Any CPU.Build.0 = Release|Any CPU
{5E259876-8FA4-4AD1-9D91-07A76ABC2A16}.Release|x64.ActiveCfg = Release|x64
{5E259876-8FA4-4AD1-9D91-07A76ABC2A16}.Release|x64.Build.0 = Release|x64
{8768CECB-A595-4C41-99E2-FBA5096CB6A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8768CECB-A595-4C41-99E2-FBA5096CB6A8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8768CECB-A595-4C41-99E2-FBA5096CB6A8}.Debug|x64.ActiveCfg = Debug|x64
{8768CECB-A595-4C41-99E2-FBA5096CB6A8}.Debug|x64.Build.0 = Debug|x64
{8768CECB-A595-4C41-99E2-FBA5096CB6A8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8768CECB-A595-4C41-99E2-FBA5096CB6A8}.Release|Any CPU.Build.0 = Release|Any CPU
{8768CECB-A595-4C41-99E2-FBA5096CB6A8}.Release|x64.ActiveCfg = Release|Any CPU
{8768CECB-A595-4C41-99E2-FBA5096CB6A8}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......@@ -275,6 +285,7 @@ Global
{327EA1F4-F23C-418A-A2EF-DA4F1039B333} = {2A0D4CA6-9E99-402E-B096-AC403D8386F7}
{E4912BCE-BC90-4457-9EE3-06435496D979} = {84456B23-B182-4B9D-84B1-3CACB1ADACF0}
{5E259876-8FA4-4AD1-9D91-07A76ABC2A16} = {6B4D3B9C-6988-432B-87BD-C3875FDAAE21}
{8768CECB-A595-4C41-99E2-FBA5096CB6A8} = {2A0D4CA6-9E99-402E-B096-AC403D8386F7}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DE6BF34A-A1A4-4829-88A8-3A4229F89708}
......
using log4net;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.TVP.FTB.Module
{
public static class JsonHelper
{
/// <summary>
/// 日志
/// </summary>
private static readonly ILog Log = LogManager.GetLogger(typeof(JsonHelper));
/// <summary>
/// 根据POST方法请求获取
/// </summary>
/// <param name="url"></param>
/// <param name="dic"></param>
/// <returns></returns>
public static string Post(string url, Dictionary<string, string> dic, string key)
{
string result = "";
try
{
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
req.Method = "POST";
req.ContentType = "application/x-www-form-urlencoded";
req.Headers.Add("App-Authorization", key);
StringBuilder builder = new StringBuilder();
int i = 0;
foreach (var item in dic)
{
if (i > 0)
builder.Append("&");
builder.AppendFormat("{0}={1}", item.Key, item.Value);
i++;
}
byte[] data = Encoding.UTF8.GetBytes(builder.ToString());
using (Stream reqStream = req.GetRequestStream())
{
reqStream.Write(data, 0, data.Length);
reqStream.Close();
}
//获取相应内容
HttpWebResponse resp = (HttpWebResponse)req.GetResponse();
Stream stream = resp.GetResponseStream();
using (StreamReader reader = new StreamReader(stream, Encoding.UTF8))
{
result = reader.ReadToEnd();
}
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
return result;
}
/// <summary>
/// 根据Get方法获取
/// </summary>
/// <param name="url"></param>
/// <returns></returns>
public static string GetResult(string url)
{
string data = "";
try
{
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
req.Headers["Accept-Encoding"] = "gzip,deflate";
req.AutomaticDecompression = DecompressionMethods.GZip;
HttpWebResponse resp = (HttpWebResponse)req.GetResponse();
Stream stream = resp.GetResponseStream();
//获取内容
using (StreamReader reader = new StreamReader(stream, Encoding.UTF8))
{
data = reader.ReadToEnd();
}
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
return data;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.TVP.FTB.Module
{
public class PluginConstant
{
public static string GroupName { get; set; } = "足球";
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.TVP.FTB.Module
{
public static class Utils
{
/// <summary>
/// MD5加密
/// </summary>
/// <param name="str"></param>
/// <returns></returns>
public static string GetMD5(string str)
{
//创建MD5对象
MD5 md5 = new MD5CryptoServiceProvider();
byte[] buffer = System.Text.Encoding.UTF8.GetBytes(str);
byte[] MD5Buffer = md5.ComputeHash(buffer);
string strNew = null;
for (int i = 0; i < MD5Buffer.Length; i++)
{
strNew += MD5Buffer[i].ToString("x2");//可以了解下ToString("")的格式问题
}
return strNew;
}
/// <summary>
/// 艾果的密钥加密
/// </summary>
/// <param name="appId"></param>
/// <param name="appKey"></param>
/// <returns></returns>
public static string GetKey(string appId, string appKey)
{
int random = new Random().Next(0, 100);
long timeStamp = DateToTicks(DateTime.Now);
string key = Convert.ToBase64String(Encoding.UTF8.GetBytes(string.Format("{0},{1},{2},{3}", appId, appKey, timeStamp, random)));
return key;
}
/// <summary>
/// 获取时间戳
/// </summary>
/// <param name="time"></param>
/// <returns></returns>
public static long DateToTicks(DateTime? time)
{
return ((time.HasValue ? time.Value.Ticks : DateTime.Parse("1990-01-01").Ticks) - 621355968000000000) / 10000;
}
}
}
using DevExpress.Mvvm.POCO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Core;
namespace VIZ.TVP.FTB.Module
{
/// <summary>
/// 赛程实体
/// </summary>
public class Dayschedule : ViewModelBase
{
public string round { get; set; }//轮次
public string dates { get; set; }//比赛日期
public string time { get; set; }//比赛时间
public string homeTeamLogo { get; set; }//主队队伍图片名称
public string homeTeamName { get; set; }//主队名称
public string homeTeamScore { get; set; }//主队得分
public string visitingTeamScore { get; set; }//客队得分
public string visitingTeamName { get; set; }//客队名称
public string visitingTeamLogo { get; set; }//客队队伍图片名称
public string matchId { get; set; }//赛程ID
public string competitionId { get; set; }// 赛事类型(德甲、意甲、英超等等)
public string competionIdName { get; set; } // 赛事类型(德甲、意甲、英超等等)
public string stadium { get; set; }//比赛场馆
public string status { get; set; }//赛程状态//1未开始,2进行中,4已结束,5延期
private HighLightEnum light = HighLightEnum.OffLight;
/// <summary>
///
/// </summary>
public HighLightEnum Light
{
get { return light; }
set { light = value; this.RaisePropertyChanged(nameof(Light)); }
}
private string selectLight = "不高亮";
public string SelectLight
{
get { return selectLight; }
set { selectLight = value; this.RaisePropertyChanged(nameof(SelectLight)); }
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.TVP.FTB.Module
{
public class Dayschedules
{
/// <summary>
/// 最后推送时间
/// </summary>
public string LastPushDataDateTime { get; set; }
public List<Dayschedule> dayschedule { get; set; }
}
}
<UserControl x:Class="VIZ.TVP.FTB.Module.FDayMatchView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
xmlns:dxrudex="http://schemas.devexpress.com/winfx/2008/xaml/reports/userdesignerextensions"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:core="clr-namespace:VIZ.Framework.Core;assembly=VIZ.Framework.Core"
xmlns:storage="clr-namespace:VIZ.TVP.FTB.Module"
mc:Ignorable="d"
d:DesignHeight="400"
d:DesignWidth="750"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch">
<UserControl.Resources>
<ResourceDictionary>
<core:Enum2EnumDescriptionConverter x:Key="Enum2EnumDescriptionConverter" EnumType="{x:Type storage:HighLightEnum}"></core:Enum2EnumDescriptionConverter>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="60"/>
<RowDefinition Height="40"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<WrapPanel Grid.Row="0" Width="750" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="-2,0,0,0" >
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="70"/>
<ColumnDefinition Width="175"/>
<ColumnDefinition Width="90"/>
<ColumnDefinition Width="80"/>
<ColumnDefinition Width="60"/>
<ColumnDefinition Width="130"/>
<ColumnDefinition Width="140"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="标题:" FontSize="16" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<dxe:TextEdit Grid.Column="1" Width="170" FontSize="16" HorizontalContentAlignment="Left"
HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding Title,Mode=TwoWay }"></dxe:TextEdit>
<TextBlock Grid.Column="2" TextBlock.TextAlignment="Center" Text="查询方式:" FontSize="16" VerticalAlignment="Center" Width="70" />
<dxe:ComboBoxEdit Grid.Column="3" Width="60" FontSize="14" ItemsSource="{Binding Path=ChooseMatchItems,Mode=TwoWay}"
SelectedItem="{Binding Path=SelectChooseMatchItem,Mode=TwoWay}" />
<TextBlock TextBlock.TextAlignment="Center" Text="日期:" Width="60" Grid.Column="4" FontSize="16" VerticalAlignment="Center"/>
<dxe:DateEdit Grid.Column="5" HorizontalAlignment="Center" FontSize="16" EditValue="{Binding MatchDate,Mode=TwoWay}"
ShowToday="False" ShowClearButton="False"
VerticalAlignment="Center" MaskUseAsDisplayFormat="True"
Width="120" IsEnabled="{Binding MateDateEnable,Mode=TwoWay}">
</dxe:DateEdit>
<WrapPanel Grid.Row="0" Grid.Column="6" HorizontalAlignment="Center" VerticalAlignment="Center">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="110"/>
<ColumnDefinition Width="30"/>
</Grid.ColumnDefinitions>
<Button Content="加载赛程" Command="{Binding BtnCmd}" HorizontalContentAlignment="Center"
Grid.Column="0" Width="100" Height="30" FontSize="14" IsEnabled="{Binding BtmEnable,Mode=TwoWay}" />
<dx:SimpleButton Grid.Row="1" Grid.Column="1" Glyph='/VIZ.TVP.FTB.Module;component/Image/PNG/Prompt2525.png' FontSize="16"
Command="{Binding PromptCommand}" HorizontalContentAlignment="Center" Width="30" Height="30" />
</Grid>
</WrapPanel>
</Grid>
</WrapPanel>
<WrapPanel Grid.Row="1" Width="750" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="-2,0,0,0" >
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="70"/>
<ColumnDefinition Width="175"/>
<ColumnDefinition Width="70"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="60"/>
<ColumnDefinition Width="130"/>
<ColumnDefinition Width="140"/>
</Grid.ColumnDefinitions>
<TextBlock TextBlock.TextAlignment="Center" Text="轮次:" Width="60" Grid.Column="4" FontSize="16" VerticalAlignment="Center"/>
<dxe:ComboBoxEdit Grid.Column="5" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="16"
Width="120" ItemsSource="{Binding Path=RoundMatchs,Mode=TwoWay}"
SelectedItem="{Binding Path=RoundMatchItem,Mode=TwoWay}" IsEnabled="{Binding RoundComEnable,Mode=TwoWay}">
</dxe:ComboBoxEdit>
<WrapPanel Grid.Row="0" Grid.Column="6" HorizontalAlignment="Center" VerticalAlignment="Center">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="110"/>
<ColumnDefinition Width="30"/>
</Grid.ColumnDefinitions>
<Button Grid.Row="0" Grid.Column="0" Content="加载轮次" FontSize="16"
Command="{Binding BtnRoundCmd}" HorizontalContentAlignment="Center"
Width="100" Height="30" IsEnabled="{Binding RoundBtnEnable,Mode=TwoWay}" />
</Grid>
</WrapPanel>
</Grid>
</WrapPanel>
<DockPanel Grid.Row="2" >
<ScrollViewer HorizontalScrollBarVisibility="Disabled"
VerticalScrollBarVisibility="Auto"
Name="PART_Options"
DockPanel.Dock="Right"
dx:ScrollBarExtensions.ScrollBarMode="TouchOverlap"
Focusable="False">
</ScrollViewer>
<dxg:GridControl x:Name="grid" ShowBorder="False" ItemsSource="{Binding Path= MatchData,Mode=TwoWay}">
<dxg:GridColumn FieldName="SelectLight" Header="" Width="112">
<dxg:GridColumn.EditSettings>
<dxe:ComboBoxEditSettings
ItemsSource="{Binding Source={x:Static Member=storage:StaticEnumInfos.EnumDescriptions}}" IsTextEditable="False" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn FieldName="dates" Header="日期" Width="112" />
<dxg:GridColumn FieldName="time" Header="时间" Width="112" />
<dxg:GridColumn FieldName="HomeTeamFlag" Header="主队国旗" Width="180" />
<dxg:GridColumn FieldName="HomeTeamName" Header="主队" Width="180" />
<dxg:GridColumn FieldName="HomeTeamScore" Header="主队得分" Width="180" />
<dxg:GridColumn FieldName="VisitingTeamScore" Header="客队得分" Width="180" />
<dxg:GridColumn FieldName="VisitingTeamName" Header="客队" Width="180" />
<dxg:GridColumn FieldName="VisitingTeamFlag" Header="客队国旗" Width="180" />
<dxg:GridControl.View>
<dxg:TableView AutoWidth="True" ShowGroupPanel="False"
BorderThickness="0"
ShowFilterPanelMode="Never"
AllowColumnFiltering="False"
AllowSorting="False"
IsColumnMenuEnabled="False" >
</dxg:TableView>
</dxg:GridControl.View>
</dxg:GridControl>
</DockPanel>
</Grid>
</UserControl>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
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 VIZ.TVP.FTB.Module
{
/// <summary>
/// Interaction logic for FDayMatchView.xaml
/// </summary>
public partial class FDayMatchView : UserControl
{
public FDayMatchView()
{
InitializeComponent();
}
}
}
using log4net;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Core;
namespace VIZ.TVP.FTB.Module
{
public class FDayMatchViewModel : ViewModelBase
{
/// <summary>
/// 日志
/// </summary>
private static ILog Log = LogManager.GetLogger(typeof(FDayMatchViewModel));
public FDayMatchViewModel()
{
//初始化方法
Init();
}
private string title = "今日赛程";
/// <summary>
/// 标题
/// </summary>
public string Title
{
get { return title; }
set { title = value; this.RaisePropertyChanged(nameof(Title)); }
}
private string selectChooseMatchItem = "日期";
public string SelectChooseMatchItem
{
get { return selectChooseMatchItem; }
set
{
selectChooseMatchItem = value;
this.RaisePropertyChanged(nameof(SelectChooseMatchItem));
if (selectChooseMatchItem == "日期")
{
RoundBtnEnable = false;
RoundComEnable = false;
MateDateEnable = true;
BtmEnable = true;
}
else if (selectChooseMatchItem == "轮次")
{
RoundBtnEnable = true;
RoundComEnable = true;
MateDateEnable = false;
BtmEnable = false;
}
}
}
/// <summary>
/// 赛程和轮次
/// </summary>
private ObservableCollection<string> chooseMatchItems;
public ObservableCollection<string> ChooseMatchItems
{
get { return chooseMatchItems; }
set { chooseMatchItems = value; this.RaisePropertyChanged(nameof(chooseMatchItems)); }
}
private int roundMatchItem;
public int RoundMatchItem
{
get { return roundMatchItem; }
set { roundMatchItem = value; this.RaisePropertyChanged(nameof(RoundMatchItem)); }
}
private ObservableCollection<int> roundMatch;
public ObservableCollection<int> RoundMatchs
{
get { return roundMatch; }
set { roundMatch = value; this.RaisePropertyChanged(nameof(RoundMatchs)); }
}
/// <summary>
/// 日期的可用性
/// </summary>
private bool mateDateEnable = true;
public bool MateDateEnable
{
get { return mateDateEnable; }
set { mateDateEnable = value; this.RaisePropertyChanged(nameof(MateDateEnable)); }
}
/// <summary>
/// 加载赛程可用性
/// </summary>
private bool btmEnable = true;
public bool BtmEnable
{
get { return btmEnable; }
set { btmEnable = value; this.RaisePropertyChanged(nameof(BtmEnable)); }
}
/// <summary>
/// 轮次选择可用性
/// </summary>
private bool roundComEnable = false;
public bool RoundComEnable
{
get { return roundComEnable; }
set { roundComEnable = value; this.RaisePropertyChanged(nameof(RoundComEnable)); }
}
private bool roundBtnEnable = false;
public bool RoundBtnEnable
{
get { return roundBtnEnable; }
set { roundBtnEnable = value; this.RaisePropertyChanged(nameof(RoundBtnEnable)); }
}
private string matchDate;
/// <summary>
///获取日期
/// </summary>
public string MatchDate
{
get { return matchDate; }
set { matchDate = value; this.RaisePropertyChanged(nameof(MatchDate)); }
}
public VCommand BtnCmd { get; set; }
public VCommand BtnMatchDayUp { get; set; }
public VCommand BtnRoundCmd { get; set; }
/// <summary>
/// 获取今日赛程
/// </summary>
private void BtnCommand()
{
// GetSchedule();
}
/// <summary>
/// 添加轮次刷新
/// </summary>
private void BtmRoundCommand()
{
// SetRoundMatchData();
}
#region 打开更新数据时间日志
/// <summary>
/// 打开数据更新日志
/// </summary>
public VCommand PromptCommand { get; set; }
MessageLastRecordDate messageLastRecordDate = new MessageLastRecordDate();
private void PromptCmd()
{
MessageLRDateViewModel vm = messageLastRecordDate.DataContext as MessageLRDateViewModel;
//if (dayschedules != null)
//{
// string onAirLastDate = $"赛程接口更新时间:{dayschedules.LastPushDataDateTime}";
// vm.OnErrorLogMessage(onAirLastDate);
//}
//if (roundSchedules != null)
//{
// string playerSeasonLastDate = $"轮次接口更新时间:{roundSchedules.LastPushDataDateTime}";
// vm.OnErrorLogMessage(playerSeasonLastDate);
//}
//if (TeamSeasonData != null)
//{
// string teamSeasonLastDate = $"球队赛季接口更新时间:{TeamSeasonData.LastPushDataDateTime}";
// vm.OnErrorLogMessage(teamSeasonLastDate);
//}
messageLastRecordDate.Visibility = System.Windows.Visibility.Visible;
messageLastRecordDate.WindowState = System.Windows.WindowState.Normal;
// messageLastRecordDate.ShowDialog();
}
#endregion
/// <summary>
/// 初始化方法
/// </summary>
private void Init()
{
BtnCmd = new VCommand(BtnCommand);
BtnRoundCmd = new VCommand(BtmRoundCommand);
PromptCommand = new VCommand(PromptCmd);
matchDate = DateTime.Today.ToShortDateString();
// GetSchedule();
RoundMatchs = new ObservableCollection<int>();
for (int i = 1; i < 43; i++)
{
RoundMatchs.Add(i);
}
roundMatchItem = 1;
chooseMatchItems = new ObservableCollection<string>() { "日期", "轮次" };
RoundComEnable = false;
RoundBtnEnable = false;
MateDateEnable = true;
BtmEnable = true; ;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.TVP.FTB.Module
{
public class TeamRanks
{
/// <summary>
/// 最后推送数据时间
/// </summary>
public string LastPushDataDateTime { get; set; } = "";
public List<Teamrank> teamrank { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.TVP.FTB.Module
{
/// <summary>
/// 排名对象
/// </summary>
public class Teamrank
{
public string rank { get; set; } // 排名
public string teamLogo { get; set; } //球队队伍图片名称
public string teamName { get; set; } //球队名称
public string matchNum { get; set; } //场次
public string winNum { get; set; }// 胜场总数
public string drawNum { get; set; }//平场总数
public string loseNum { get; set; } //负场总数
public string goalsNum { get; set; } //进球总数
public string loseGoalsNum { get; set; } //失球总数
public string score { get; set; } //积分
public string competitionId { get; set; } //赛事类型Id
public string competionIdName { get; set; } //赛事类型(德甲、意甲、英超等等)
}
}
<UserControl x:Class="VIZ.TVP.FTB.Module.FTeamStandingView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
xmlns:dxrudex="http://schemas.devexpress.com/winfx/2008/xaml/reports/userdesignerextensions"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:core="clr-namespace:VIZ.Framework.Core;assembly=VIZ.Framework.Core"
xmlns:storage="clr-namespace:VIZ.TVP.FTB.Module"
mc:Ignorable="d"
d:DesignHeight="800" d:DesignWidth="650">
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="197*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="60"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<WrapPanel Grid.Row="0" HorizontalAlignment="Center" VerticalAlignment="Center" Width="650" >
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="70"/>
<ColumnDefinition Width="175"/>
<ColumnDefinition Width="80"/>
<ColumnDefinition Width="180"/>
<ColumnDefinition Width="140"/>
<!--<ColumnDefinition Width="120"/>-->
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="标题:" FontSize="16" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<dxe:TextEdit Grid.Column="1" Width="170" FontSize="16" HorizontalContentAlignment="Left"
HorizontalAlignment="Left" VerticalAlignment="Center" Text="{Binding Title,Mode=TwoWay }"></dxe:TextEdit>
<WrapPanel Grid.Row="0" Grid.Column="4" HorizontalAlignment="Center" VerticalAlignment="Center">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="30"/>
</Grid.ColumnDefinitions>
<Button Grid.Column="0" Content="加载数据" FontSize="14" Width="90" Height="30" Command="{Binding BtnCmd}" />
<dx:SimpleButton Grid.Row="0" Grid.Column="1" Glyph='/VIZ.TVP.FTB.Module;component/Image/PNG/Prompt2525.png' FontSize="16"
Command="{Binding PromptCommand}" HorizontalContentAlignment="Center" Width="30" Height="30" />
</Grid>
</WrapPanel>
</Grid>
</WrapPanel>
<DockPanel Grid.Row="1">
<ScrollViewer HorizontalScrollBarVisibility="Disabled"
VerticalScrollBarVisibility="Auto"
Name="PART_Options"
DockPanel.Dock="Right"
dx:ScrollBarExtensions.ScrollBarMode="TouchOverlap"
Focusable="False">
</ScrollViewer>
<dxg:GridControl x:Name="grid" ShowBorder="False" ItemsSource="{Binding Path= TeamRanksModel,Mode=TwoWay}">
<dxg:GridColumn FieldName="" Header="排名" Width="112" />
<dxg:GridColumn FieldName="" Header="球队国旗" Width="112"/>
<dxg:GridColumn FieldName="" Header="球队名" Width="112" />
<dxg:GridColumn FieldName="" Header="场次" Width="180" />
<dxg:GridColumn FieldName="" Header="胜" Width="100" />
<dxg:GridColumn FieldName="" Header="平" Width="100"/>
<dxg:GridColumn FieldName="" Header="负" Width="100" />
<dxg:GridColumn FieldName="" Header="进/失" Width="180" />
<dxg:GridColumn FieldName="" Header="积分" Width="180" />
<dxg:GridControl.View>
<dxg:TableView AutoWidth="True" ShowGroupPanel="False"
BorderThickness="0"
ShowFilterPanelMode="Never"
AllowColumnFiltering="False"
AllowSorting="False"
IsColumnMenuEnabled="False" >
</dxg:TableView>
</dxg:GridControl.View>
</dxg:GridControl>
</DockPanel>
</Grid>
</UserControl>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
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 VIZ.TVP.FTB.Module
{
/// <summary>
/// Interaction logic for FTeamStandingView.xaml
/// </summary>
public partial class FTeamStandingView : UserControl
{
public FTeamStandingView()
{
InitializeComponent();
}
}
}
using log4net;
using VIZ.Framework.Core;
namespace VIZ.TVP.FTB.Module
{
/// <summary>
/// 足球积分排名ViewModel
/// </summary>
public class FTeamStandingViewModel : ViewModelBase
{
/// <summary>
/// 日志
/// </summary>
private static ILog Log = LogManager.GetLogger(typeof(FTeamStandingViewModel));
public FTeamStandingViewModel()
{
}
//private ObservableCollection<Teamrank> teamRanksModel;
//public ObservableCollection<Teamrank> TeamRanksModel
//{
// get { return teamRanksModel; }
// set { teamRanksModel = value; this.RaisePropertyChanged(nameof(TeamRanksModel)); }
//}
public VCommand BtnCmd { get; set; }
//TeamRanks teamStands = null;
private void BtmCommand()
{
//teamStands = new TeamRanks();
//teamStands = JsonModel.PostTeamScoreData_Path();
//if (teamStands == null) return;
//TeamRanksModel = new ObservableCollection<Teamrank>();
//int i = 1;
//foreach (var teamRank in teamStands.teamrank)
//{
// teamRank.Id = i;
// teamRank.WinningPercentageStr = (teamRank.WinningPercentage * 100).ToString("F1") + "%";
// if (teamRank.StreakType == 1)
// {
// teamRank.StreakName = "连胜";
// }
// else if (teamRank.StreakType == 0)
// {
// teamRank.StreakName = "连败";
// }
// TeamRanksModel.Add(teamRank);
// i++;
//}
}
//public string CombineTeamStandingData()
//{
// try
// {
// string data = "";
// data += title;
// data += "&";
// foreach (var tempTeamRankModel in TeamRanksModel)
// {
// data += tempTeamRankModel.Id.ToString().Replace(" ", "");
// data += "*";
// data += tempTeamRankModel.TeamCNAlias.Replace(" ", "");
// data += "*";
// data += tempTeamRankModel.Wins.ToString().Replace(" ", "");
// data += "*";
// data += tempTeamRankModel.Losses.ToString().Replace(" ", "");
// data += "*";
// data += tempTeamRankModel.WinningPercentageStr.ToString().Replace(" ", "");
// data += "*";
// data += tempTeamRankModel.Integral.ToString().Replace(" ", "");
// data += "*";
// data += tempTeamRankModel.StreakNumber.ToString().Replace(" ", "");
// data += "*";
// data += tempTeamRankModel.StreakName.Replace(" ", "");
// data += ";";
// }
// return data;
// }
// catch (Exception ex)
// {
// Log.Error(ex.Message);
// return "";
// }
//}
private string title = "球队积分排名";
public string Title
{
get { return title; }
set { title = value; this.RaisePropertyChanged(nameof(Title)); }
}
private void Init()
{
BtnCmd = new VCommand(BtmCommand);
PromptCommand = new VCommand(PromptCmd);
}
#region 打开更新数据时间日志
/// <summary>
/// 打开数据更新日志
/// </summary>
public VCommand PromptCommand { get; set; }
MessageLastRecordDate messageLastRecordDate = new MessageLastRecordDate();
private void PromptCmd()
{
MessageLRDateViewModel vm = messageLastRecordDate.DataContext as MessageLRDateViewModel;
//if (teamStands != null)
//{
// string onAirLastDate = $"直播接口更新时间:{teamStands.LastPushDataDateTime}";
// vm.OnErrorLogMessage(onAirLastDate);
//}
messageLastRecordDate.Visibility = System.Windows.Visibility.Visible;
messageLastRecordDate.WindowState = System.Windows.WindowState.Normal;
// messageLastRecordDate.ShowDialog();
}
#endregion
}
}
<dx:ThemedWindow
x:Class="VIZ.TVP.FTB.Module.MessageLastRecordDate"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
Title="查看数据更新时间" Height="800" Width="1000">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="30"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Button Width="80" Height="20" Content="清除" Command="{Binding Path=ClearCommand}" HorizontalAlignment="Left"></Button>
<TextBox x:Name="tb" IsReadOnly="True" AcceptsReturn="False" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto"
Grid.Row="1"></TextBox>
</Grid>
</dx:ThemedWindow>
using DevExpress.Xpf.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
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.Shapes;
namespace VIZ.TVP.FTB.Module
{
/// <summary>
/// Interaction logic for MessageLastRecordDate.xaml
/// </summary>
public partial class MessageLastRecordDate : ThemedWindow
{
public MessageLastRecordDate()
{
InitializeComponent();
}
}
}
using log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Core;
namespace VIZ.TVP.FTB.Module
{
public class MessageLRDateViewModel : ViewModelBase
{
/// <summary>
/// 日志
/// </summary>
private static readonly ILog log = LogManager.GetLogger(typeof(MessageLRDateViewModel));
public MessageLRDateViewModel()
{
//初始化命令
InitCommand();
}
/// <summary>
/// 初始化命令
/// </summary>
private void InitCommand()
{
this.ClearCommand = new VCommand(this.Clear);
}
// ==================================================================================
// Command
// ==================================================================================
#region ClearCommand -- 清除消息
/// <summary>
/// 清除消息
/// </summary>
public VCommand ClearCommand { get; set; }
/// <summary>
/// 清除
/// </summary>
private void Clear()
{
MessageLastRecordDate view = this.GetView<MessageLastRecordDate>();
if (view == null)
return;
view.tb.Clear();
}
#endregion
/// <summary>
/// 错误日志消息
/// </summary>
/// <param name="msg">消息</param>
public void OnErrorLogMessage(string msg)
{
WPFHelper.BeginInvoke(() =>
{
MessageLastRecordDate view = this.GetView<MessageLastRecordDate>();
if (view == null)
return;
string log = $"{DateTime.Now.ToString("HH:mm:ss")} {msg}";
view.tb.AppendText($"{log}\r\n");
view.tb.ScrollToEnd();
});
}
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("VIZ.TVP.FTB.Module")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("China")]
[assembly: AssemblyProduct("VIZ.TVP.FTB.Module")]
[assembly: AssemblyCopyright("Copyright © China 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("8768cecb-a595-4c41-99e2-fba5096cb6a8")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.TVP.FTB.Module
{ /// <summary>
/// 枚举辅助类
/// </summary>
public static class EnumHelper
{
/// <summary>
/// 获取枚举描述信息
/// </summary>
/// <param name="value">枚举值</param>
/// <returns>配置值</returns>
public static string GetDescriptionCBA(this Enum value)
{
if (value == null)
return string.Empty;
FieldInfo field = value.GetType().GetField(value.ToString());
if (field == null)
return string.Empty;
DescriptionAttribute attribute = field.GetCustomAttribute<DescriptionAttribute>(false);
if (attribute == null)
return string.Empty;
return attribute.Description;
}
/// <summary>
/// 获取枚举的枚举模型
/// </summary>
/// <typeparam name="TEnum">枚举类型</typeparam>
/// <returns>枚举模型列表</returns>
public static List<EnumModel> GetEnumModels<TEnum>()
{
Type type = typeof(TEnum);
return GetEnumModels(type);
}
/// <summary>
/// 获取枚举的枚举模型
/// </summary>
/// <typeparam name="TEnum">枚举类型</typeparam>
/// <returns>枚举模型列表</returns>
public static List<EnumModel> GetEnumModels(Type type)
{
if (!type.IsEnum)
throw new Exception($"type: {type.Name} is not enum.");
List<EnumModel> models = new List<EnumModel>();
Array names = Enum.GetNames(type);
foreach (object name in names)
{
if (name == null)
continue;
FieldInfo field = type.GetField(name.ToString());
if (field == null)
continue;
DescriptionAttribute attribute = field.GetCustomAttribute<DescriptionAttribute>(false);
if (attribute == null)
continue;
EnumModel model = new EnumModel();
model.Key = Enum.Parse(type, name.ToString());
model.Description = attribute.Description;
models.Add(model);
}
return models;
}
}
}
using DevExpress.Mvvm.POCO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Core;
namespace VIZ.TVP.FTB.Module
{
public class EnumModel : ModelBase
{
#region Key -- 枚举值
private object key;
/// <summary>
/// 枚举值
/// </summary>
public object Key
{
get { return key; }
set { key = value; this.RaisePropertyChanged(nameof(Key)); }
}
#endregion
#region Description -- 描述
private string description;
/// <summary>
/// 描述
/// </summary>
public string Description
{
get { return description; }
set { description = value; this.RaisePropertyChanged(nameof(Description)); }
}
#endregion
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.TVP.FTB.Module
{
public enum HighLightEnum
{
/// <summary>
/// 高亮
/// </summary>
[Description("高亮")]
OnLight = 0,
/// <summary>
/// 不高亮
/// </summary>
[Description("不高亮")]
OffLight = 1,
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.TVP.FTB.Module
{
public static class StaticEnumInfos
{
/// <summary>
/// 性别枚举模型集合
/// </summary>
public static List<EnumModel> EnumModels { get; } = EnumHelper.GetEnumModels<HighLightEnum>();
/// <summary>
/// 性别枚举描述集合
/// </summary>
public static List<string> EnumDescriptions { get; } = EnumHelper.GetEnumModels<HighLightEnum>().Select(p => p.Description).ToList();
}
}
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="log4net" version="2.0.14" targetFramework="net48" />
</packages>
\ No newline at end of file
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