Commit 96cb7990 by liulongfei

版子制作

parent f8f09504
...@@ -49,31 +49,40 @@ namespace VIZ.TVP.Golf.Domain ...@@ -49,31 +49,40 @@ namespace VIZ.TVP.Golf.Domain
/// </summary> /// </summary>
public const string ChampionView = "ChampionView"; public const string ChampionView = "ChampionView";
/// <summary>
/// 分组洞信息版
/// </summary>
public const string GroupHoleInfoView = "GroupHoleInfoView";
/// <summary> /// <summary>
/// 人名条 /// 底部洞信息版
/// </summary> /// </summary>
public const string NameBarView = "NameBarView"; public const string BottomHoleInfoView = "BottomHoleInfoView";
/// <summary> /// <summary>
/// 底部人名条 /// 赛前球队排名
/// </summary> /// </summary>
public const string NameBarBottomView = "NameBarBottomView"; public const string BeforeMatchTeamRanking = "BeforeMatchTeamRanking";
/// <summary> /// <summary>
/// 底部洞信息版 /// 赛后球队排名
/// </summary> /// </summary>
public const string BottomHoleInfoView = "BottomHoleInfoView"; public const string AfterMatchTeamRanking = "AfterMatchTeamRanking";
/// <summary> /// <summary>
/// 底部队伍信息 /// 人名条
/// </summary> /// </summary>
public const string BottomTeamInfoView = "BottomTeamInfoView"; public const string NameBarView = "NameBarView";
/// <summary>
/// 底部人名条
/// </summary>
public const string NameBarBottomView = "NameBarBottomView";
/// <summary> /// <summary>
/// 底部信息版 /// 底部队伍信息
/// </summary> /// </summary>
public const string BottomInformationView = "BottomInformationView"; public const string BottomTeamInfoView = "BottomTeamInfoView";
/// <summary> /// <summary>
/// 中间球员排名 /// 中间球员排名
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Core;
namespace VIZ.TVP.Golf.Domain
{
/// <summary>
/// 分组洞临时模型
/// </summary>
public class GroupHoleTempModel : ModelBase
{
#region HoleID -- 洞编号
private string holeID;
/// <summary>
/// 洞编号
/// </summary>
public string HoleID
{
get { return holeID; }
set { holeID = value; this.RaisePropertyChanged(nameof(HoleID)); }
}
#endregion
#region Par -- 标准杆
private int par;
/// <summary>
/// 标准杆
/// </summary>
public int Par
{
get { return par; }
set { par = value; this.RaisePropertyChanged(nameof(Par)); }
}
#endregion
#region TotalStrokes -- 总杆数
private string totalStrokes;
/// <summary>
/// 总杆数
/// </summary>
public string TotalStrokes
{
get { return totalStrokes; }
set { totalStrokes = value; this.RaisePropertyChanged(nameof(TotalStrokes)); }
}
#endregion
#region TotalStrokesDetail -- 总杆数描述
private string totalStrokesDetail;
/// <summary>
/// 总杆数描述
/// </summary>
public string TotalStrokesDetail
{
get { return totalStrokesDetail; }
set { totalStrokesDetail = value; this.RaisePropertyChanged(nameof(TotalStrokesDetail)); }
}
#endregion
}
}
...@@ -13,6 +13,20 @@ namespace VIZ.TVP.Golf.Domain ...@@ -13,6 +13,20 @@ namespace VIZ.TVP.Golf.Domain
/// </summary> /// </summary>
public class GroupTempModel : ModelBase public class GroupTempModel : ModelBase
{ {
#region Group -- 分组信息
private string group;
/// <summary>
/// 分组
/// </summary>
public string Group
{
get { return group; }
set { group = value; this.RaisePropertyChanged(nameof(Group)); }
}
#endregion
#region TeamInfo -- 队伍信息 #region TeamInfo -- 队伍信息
private TeamInfoModel teamInfo; private TeamInfoModel teamInfo;
...@@ -40,5 +54,47 @@ namespace VIZ.TVP.Golf.Domain ...@@ -40,5 +54,47 @@ namespace VIZ.TVP.Golf.Domain
} }
#endregion #endregion
#region TeamLogo -- 队伍Logo
private string teamLogo;
/// <summary>
/// 队伍Logo
/// </summary>
public string TeamLogo
{
get { return teamLogo; }
set { teamLogo = value; this.RaisePropertyChanged(nameof(TeamLogo)); }
}
#endregion
#region PlayersDisplayName -- 显示名称
private string playersDisplayName;
/// <summary>
/// 显示名称
/// </summary>
public string PlayersDisplayName
{
get { return playersDisplayName; }
set { playersDisplayName = value; this.RaisePropertyChanged(nameof(PlayersDisplayName)); }
}
#endregion
#region PlayersStrokes -- 总杆数
private string playersStrokes;
/// <summary>
/// 总杆数
/// </summary>
public string PlayersStrokes
{
get { return playersStrokes; }
set { playersStrokes = value; this.RaisePropertyChanged(nameof(PlayersStrokes)); }
}
#endregion
} }
} }
...@@ -72,7 +72,7 @@ namespace VIZ.TVP.Golf.Domain ...@@ -72,7 +72,7 @@ namespace VIZ.TVP.Golf.Domain
/// 从球员信息模型中获取数据 /// 从球员信息模型中获取数据
/// </summary> /// </summary>
/// <param name="model">球员信息模型</param> /// <param name="model">球员信息模型</param>
public void FromTeamInfo(PlayerInfoModel model) public void FromInfoModel(PlayerInfoModel model)
{ {
this.PlayerID = model.PlayerID; this.PlayerID = model.PlayerID;
this.Name = model.Name; this.Name = model.Name;
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Core;
namespace VIZ.TVP.Golf.Domain
{
/// <summary>
/// 队伍临时模型
/// </summary>
public class TeamTempModel : ModelBase
{
#region TeamInfoModel -- 队伍信息
private TeamInfoModel teamInfoModel;
/// <summary>
/// 队伍信息模型
/// </summary>
public TeamInfoModel TeamInfoModel
{
get { return teamInfoModel; }
set { teamInfoModel = value; this.RaisePropertyChanged(nameof(TeamInfoModel)); }
}
#endregion
#region TeamID -- 队伍编号
private int teamID;
/// <summary>
/// 队伍编号
/// </summary>
public int TeamID
{
get { return teamID; }
set { teamID = value; this.RaisePropertyChanged(nameof(TeamID)); }
}
#endregion
#region Logo -- 队伍Logo
private string logo;
/// <summary>
/// 队伍Logo
/// </summary>
public string Logo
{
get { return logo; }
set { logo = value; this.RaisePropertyChanged(nameof(Logo)); }
}
#endregion
#region Name -- 队伍名称
private string name;
/// <summary>
/// 队伍名称
/// </summary>
public string Name
{
get { return name; }
set { name = value; this.RaisePropertyChanged(nameof(Name)); }
}
#endregion
#region Position -- 排名
private string position;
/// <summary>
/// 排名
/// </summary>
public string Position
{
get { return position; }
set { position = value; this.RaisePropertyChanged(nameof(Position)); }
}
#endregion
#region TotalStrokes -- 总杆数
private string totalStrokes;
/// <summary>
/// 总杆数
/// </summary>
public string TotalStrokes
{
get { return totalStrokes; }
set { totalStrokes = value; this.RaisePropertyChanged(nameof(TotalStrokes)); }
}
#endregion
/// <summary>
/// 从信息源初始化
/// </summary>
/// <param name="model">队伍信息模型</param>
public void FromInfoModel(TeamInfoModel model)
{
this.TeamInfoModel = model;
this.TeamID = model.TeamID;
this.Logo = model.Logo;
this.Name = model.Name;
}
}
}
...@@ -34,6 +34,16 @@ namespace VIZ.TVP.Golf.Domain ...@@ -34,6 +34,16 @@ namespace VIZ.TVP.Golf.Domain
public static ObservableCollection<string> Groups { get; set; } = new ObservableCollection<string>(); public static ObservableCollection<string> Groups { get; set; } = new ObservableCollection<string>();
/// <summary> /// <summary>
/// 轮次集合
/// </summary>
public static ObservableCollection<int> Rounds { get; set; } = new ObservableCollection<int>();
/// <summary>
/// 轮次描述
/// </summary>
public static Dictionary<int, string> RoundsDetail { get; set; } = new Dictionary<int, string>();
/// <summary>
/// 描述信息结合 /// 描述信息结合
/// </summary> /// </summary>
public static ObservableCollection<string> Details { get; set; } = new ObservableCollection<string>(); public static ObservableCollection<string> Details { get; set; } = new ObservableCollection<string>();
......
...@@ -71,12 +71,14 @@ ...@@ -71,12 +71,14 @@
<Compile Include="Model\EntityModel\TeamInfoModel.cs" /> <Compile Include="Model\EntityModel\TeamInfoModel.cs" />
<Compile Include="Model\EntityModel\TournamentInfoModel.cs" /> <Compile Include="Model\EntityModel\TournamentInfoModel.cs" />
<Compile Include="Model\TempModel\FileTempModel.cs" /> <Compile Include="Model\TempModel\FileTempModel.cs" />
<Compile Include="Model\TempModel\GroupHoleTempModel.cs" />
<Compile Include="Model\TempModel\GroupTempModel.cs" /> <Compile Include="Model\TempModel\GroupTempModel.cs" />
<Compile Include="Model\RealModel\PlayerRealModel.cs" /> <Compile Include="Model\RealModel\PlayerRealModel.cs" />
<Compile Include="Model\RealModel\RoundRealModel.cs" /> <Compile Include="Model\RealModel\RoundRealModel.cs" />
<Compile Include="Model\RealModel\ScoreRealModel.cs" /> <Compile Include="Model\RealModel\ScoreRealModel.cs" />
<Compile Include="Model\RealModel\TeamRealModel.cs" /> <Compile Include="Model\RealModel\TeamRealModel.cs" />
<Compile Include="Model\TempModel\PlayerTempModel.cs" /> <Compile Include="Model\TempModel\PlayerTempModel.cs" />
<Compile Include="Model\TempModel\TeamTempModel.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TvpStaticResource.cs" /> <Compile Include="TvpStaticResource.cs" />
</ItemGroup> </ItemGroup>
......
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using VIZ.TVP.Golf.Domain;
namespace VIZ.TVP.Golf.Module.Resource
{
/// <summary>
/// 轮次2轮次描述转化器
/// </summary>
public class Round2RoundDetailConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (!(value is int))
return null;
int key = (int)value;
TvpStaticResource.RoundsDetail.TryGetValue(key, out string detail);
return detail;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:fcommon="clr-namespace:VIZ.Framework.Common;assembly=VIZ.Framework.Common">
<Style x:Key="LabelValue_Default" TargetType="fcommon:LabelValue">
<Setter Property="FocusVisualStyle" Value="{x:Null}"></Setter>
<Setter Property="Height" Value="30"></Setter>
<Setter Property="LabelWidth" Value="60"></Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="fcommon:LabelValue">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock VerticalAlignment="Center" Margin="0,0,10,0"
Text="{TemplateBinding Label}" Width="{TemplateBinding LabelWidth}" TextAlignment="Right"></TextBlock>
<TextBox Grid.Column="1" AcceptsReturn="False" TextWrapping="NoWrap"
Text="{Binding Text,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type fcommon:LabelValue}},Mode=TwoWay}" VerticalContentAlignment="Center"></TextBox>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
\ No newline at end of file
...@@ -76,6 +76,10 @@ ...@@ -76,6 +76,10 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="Style\LabelValue\LabelValue_Default.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Style\RadioButton\RadioButton_MainView.xaml"> <Page Include="Style\RadioButton\RadioButton_MainView.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
...@@ -87,6 +91,7 @@ ...@@ -87,6 +91,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Converter\PlayerInfos2DetailConverter.cs" /> <Compile Include="Converter\PlayerInfos2DetailConverter.cs" />
<Compile Include="Converter\Round2RoundDetailConverter.cs" />
<Compile Include="Properties\AssemblyInfo.cs"> <Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>
......
...@@ -58,6 +58,7 @@ ...@@ -58,6 +58,7 @@
SelectedValue="{Binding Path=SelectedHoleInfo,Mode=TwoWay}"> SelectedValue="{Binding Path=SelectedHoleInfo,Mode=TwoWay}">
<DataGrid.Columns> <DataGrid.Columns>
<DataGridTextColumn Header="编号" Width="80" Binding="{Binding Path=HoleID,Mode=TwoWay}"></DataGridTextColumn> <DataGridTextColumn Header="编号" Width="80" Binding="{Binding Path=HoleID,Mode=TwoWay}"></DataGridTextColumn>
<DataGridTextColumn Header="标准杆" Width="80" Binding="{Binding Path=Par,Mode=TwoWay}"></DataGridTextColumn>
<DataGridComboBoxColumn Header="Logo" Width="240" <DataGridComboBoxColumn Header="Logo" Width="240"
ItemsSource="{Binding Source={x:Static domain:TvpStaticResource.HolePictures}}" ItemsSource="{Binding Source={x:Static domain:TvpStaticResource.HolePictures}}"
SelectedValueBinding="{Binding Path=Picture}"></DataGridComboBoxColumn> SelectedValueBinding="{Binding Path=Picture}"></DataGridComboBoxColumn>
......
...@@ -60,15 +60,19 @@ ...@@ -60,15 +60,19 @@
Content="小组信息"></RadioButton> Content="小组信息"></RadioButton>
<RadioButton x:Name="rb_ChampionView" GroupName="MAIN" Style="{StaticResource RadioButton_MainView}" <RadioButton x:Name="rb_ChampionView" GroupName="MAIN" Style="{StaticResource RadioButton_MainView}"
Content="冠军版"></RadioButton> Content="冠军版"></RadioButton>
<RadioButton x:Name="rb_GroupHoleInfoView" GroupName="MAIN" Style="{StaticResource RadioButton_MainView}"
Content="分组洞信息版"></RadioButton>
<RadioButton x:Name="rb_BottomHoleInfoView" GroupName="MAIN" Style="{StaticResource RadioButton_MainView}"
Content="底部洞信息版"></RadioButton>
<RadioButton x:Name="rb_BeforeMatchTeamRankingView" GroupName="MAIN" Style="{StaticResource RadioButton_MainView}"
Content="赛前队伍排名"></RadioButton>
<RadioButton x:Name="rb_AfterMatchTeamRankingView" GroupName="MAIN" Style="{StaticResource RadioButton_MainView}"
Content="赛后队伍排名"></RadioButton>
<RadioButton x:Name="rb_NameBarView" GroupName="MAIN" Style="{StaticResource RadioButton_MainView}" <RadioButton x:Name="rb_NameBarView" GroupName="MAIN" Style="{StaticResource RadioButton_MainView}"
Content="人名条"></RadioButton> Content="人名条"></RadioButton>
<RadioButton x:Name="rb_NameBarBottomView" GroupName="MAIN" Style="{StaticResource RadioButton_MainView}" <RadioButton x:Name="rb_NameBarBottomView" GroupName="MAIN" Style="{StaticResource RadioButton_MainView}"
Content="底部人名条"></RadioButton> Content="底部人名条"></RadioButton>
<RadioButton x:Name="rb_BottomHoleInfoView" GroupName="MAIN" Style="{StaticResource RadioButton_MainView}"
Content="底部洞信息版"></RadioButton>
<RadioButton x:Name="rb_BottomInformationView" GroupName="MAIN" Style="{StaticResource RadioButton_MainView}"
Content="底部信息版"></RadioButton>
<RadioButton x:Name="rb_CenterPlayerRanking" GroupName="MAIN" Style="{StaticResource RadioButton_MainView}" <RadioButton x:Name="rb_CenterPlayerRanking" GroupName="MAIN" Style="{StaticResource RadioButton_MainView}"
Content="中部球员排名"></RadioButton> Content="中部球员排名"></RadioButton>
<RadioButton x:Name="rb_CenterTeamRanking" GroupName="MAIN" Style="{StaticResource RadioButton_MainView}" <RadioButton x:Name="rb_CenterTeamRanking" GroupName="MAIN" Style="{StaticResource RadioButton_MainView}"
...@@ -93,16 +97,20 @@ ...@@ -93,16 +97,20 @@
IsSelected="{Binding ElementName=rb_GroupInfoView,Path=IsChecked,Mode=OneWay}"></fcommon:NavigationItemControl> IsSelected="{Binding ElementName=rb_GroupInfoView,Path=IsChecked,Mode=OneWay}"></fcommon:NavigationItemControl>
<fcommon:NavigationItemControl Key="{x:Static Member=domain:ViewKeys.ChampionView}" ViewType="{x:Type local:ChampionView}" <fcommon:NavigationItemControl Key="{x:Static Member=domain:ViewKeys.ChampionView}" ViewType="{x:Type local:ChampionView}"
IsSelected="{Binding ElementName=rb_ChampionView,Path=IsChecked,Mode=OneWay}"></fcommon:NavigationItemControl> IsSelected="{Binding ElementName=rb_ChampionView,Path=IsChecked,Mode=OneWay}"></fcommon:NavigationItemControl>
<fcommon:NavigationItemControl Key="{x:Static Member=domain:ViewKeys.GroupHoleInfoView}" ViewType="{x:Type local:GroupHoleInfoView}"
IsSelected="{Binding ElementName=rb_GroupHoleInfoView,Path=IsChecked,Mode=OneWay}"></fcommon:NavigationItemControl>
<fcommon:NavigationItemControl Key="{x:Static Member=domain:ViewKeys.BottomHoleInfoView}" ViewType="{x:Type local:BottomHoleInfoView}"
IsSelected="{Binding ElementName=rb_BottomHoleInfoView,Path=IsChecked,Mode=OneWay}"></fcommon:NavigationItemControl>
<fcommon:NavigationItemControl Key="{x:Static Member=domain:ViewKeys.BeforeMatchTeamRanking}" ViewType="{x:Type local:BeforeMatchTeamRankingView}"
IsSelected="{Binding ElementName=rb_BeforeMatchTeamRankingView,Path=IsChecked,Mode=OneWay}"></fcommon:NavigationItemControl>
<fcommon:NavigationItemControl Key="{x:Static Member=domain:ViewKeys.AfterMatchTeamRanking}" ViewType="{x:Type local:AfterMatchTeamRankingView}"
IsSelected="{Binding ElementName=rb_AfterMatchTeamRankingView,Path=IsChecked,Mode=OneWay}"></fcommon:NavigationItemControl>
<fcommon:NavigationItemControl Key="{x:Static Member=domain:ViewKeys.NameBarView}" ViewType="{x:Type local:NameBarView}" <fcommon:NavigationItemControl Key="{x:Static Member=domain:ViewKeys.NameBarView}" ViewType="{x:Type local:NameBarView}"
IsSelected="{Binding ElementName=rb_NameBarView,Path=IsChecked,Mode=OneWay}"></fcommon:NavigationItemControl> IsSelected="{Binding ElementName=rb_NameBarView,Path=IsChecked,Mode=OneWay}"></fcommon:NavigationItemControl>
<fcommon:NavigationItemControl Key="{x:Static Member=domain:ViewKeys.NameBarBottomView}" ViewType="{x:Type local:NameBarBottomView}" <fcommon:NavigationItemControl Key="{x:Static Member=domain:ViewKeys.NameBarBottomView}" ViewType="{x:Type local:NameBarBottomView}"
IsSelected="{Binding ElementName=rb_NameBarBottomView,Path=IsChecked,Mode=OneWay}"></fcommon:NavigationItemControl> IsSelected="{Binding ElementName=rb_NameBarBottomView,Path=IsChecked,Mode=OneWay}"></fcommon:NavigationItemControl>
<fcommon:NavigationItemControl Key="{x:Static Member=domain:ViewKeys.BottomHoleInfoView}" ViewType="{x:Type local:BottomHoleInfoView}"
IsSelected="{Binding ElementName=rb_BottomHoleInfoView,Path=IsChecked,Mode=OneWay}"></fcommon:NavigationItemControl>
<fcommon:NavigationItemControl Key="{x:Static Member=domain:ViewKeys.BottomInformationView}" ViewType="{x:Type local:BottomInformationView}"
IsSelected="{Binding ElementName=rb_BottomInformationView,Path=IsChecked,Mode=OneWay}"></fcommon:NavigationItemControl>
<fcommon:NavigationItemControl Key="{x:Static Member=domain:ViewKeys.CenterPlayerRanking}" ViewType="{x:Type local:CenterPlayerRankingView}" <fcommon:NavigationItemControl Key="{x:Static Member=domain:ViewKeys.CenterPlayerRanking}" ViewType="{x:Type local:CenterPlayerRankingView}"
IsSelected="{Binding ElementName=rb_CenterPlayerRanking,Path=IsChecked,Mode=OneWay}"></fcommon:NavigationItemControl> IsSelected="{Binding ElementName=rb_CenterPlayerRanking,Path=IsChecked,Mode=OneWay}"></fcommon:NavigationItemControl>
<fcommon:NavigationItemControl Key="{x:Static Member=domain:ViewKeys.CenterTeamRanking}" ViewType="{x:Type local:CenterTeamRankingView}" <fcommon:NavigationItemControl Key="{x:Static Member=domain:ViewKeys.CenterTeamRanking}" ViewType="{x:Type local:CenterTeamRankingView}"
......
...@@ -12,6 +12,7 @@ using System.Windows.Media; ...@@ -12,6 +12,7 @@ using System.Windows.Media;
using System.Windows.Media.Imaging; using System.Windows.Media.Imaging;
using System.Windows.Navigation; using System.Windows.Navigation;
using System.Windows.Shapes; using System.Windows.Shapes;
using VIZ.Framework.Core;
namespace VIZ.TVP.Golf.Module namespace VIZ.TVP.Golf.Module
{ {
...@@ -23,6 +24,8 @@ namespace VIZ.TVP.Golf.Module ...@@ -23,6 +24,8 @@ namespace VIZ.TVP.Golf.Module
public MainView() public MainView()
{ {
InitializeComponent(); InitializeComponent();
WPFHelper.BindingViewModel(this, new MainViewModel());
} }
} }
} }
using System; using log4net;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.Linq; using System.Linq;
......
<UserControl x:Class="VIZ.TVP.Golf.Module.BottomInformationView" <UserControl x:Class="VIZ.TVP.Golf.Module.AfterMatchTeamRankingView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
...@@ -6,15 +6,19 @@ ...@@ -6,15 +6,19 @@
xmlns:local="clr-namespace:VIZ.TVP.Golf.Module" xmlns:local="clr-namespace:VIZ.TVP.Golf.Module"
xmlns:toolkit="http://schemas.xceed.com/wpf/xaml/toolkit" xmlns:toolkit="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:fcommon="clr-namespace:VIZ.Framework.Common;assembly=VIZ.Framework.Common" xmlns:fcommon="clr-namespace:VIZ.Framework.Common;assembly=VIZ.Framework.Common"
xmlns:domain="clr-namespace:VIZ.TVP.Golf.Domain;assembly=VIZ.TVP.Golf.Domain"
xmlns:core="clr-namespace:VIZ.Framework.Core;assembly=VIZ.Framework.Core"
xmlns:resource="clr-namespace:VIZ.TVP.Golf.Module.Resource;assembly=VIZ.TVP.Golf.Module.Resource"
d:Background="White" d:Background="White"
d:DataContext="{d:DesignInstance Type=local:BottomInformationViewModel}" d:DataContext="{d:DesignInstance Type=local:BeforeMatchTeamRankingViewModel}"
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="1200"> d:DesignHeight="800" d:DesignWidth="1700">
<UserControl.Resources> <UserControl.Resources>
<ResourceDictionary> <ResourceDictionary>
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/VIZ.TVP.Golf.Module.Resource;component/Style/IconButton/IconButton_Default.xaml"></ResourceDictionary> <ResourceDictionary Source="/VIZ.TVP.Golf.Module.Resource;component/Style/IconButton/IconButton_Default.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
<resource:Round2RoundDetailConverter x:Key="Round2RoundDetailConverter"></resource:Round2RoundDetailConverter>
</ResourceDictionary> </ResourceDictionary>
</UserControl.Resources> </UserControl.Resources>
...@@ -32,28 +36,66 @@ ...@@ -32,28 +36,66 @@
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<fcommon:IconButton Style="{StaticResource IconButton_Default}" <fcommon:IconButton Style="{StaticResource IconButton_Default}"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/db_16x16.png" Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/db_16x16.png"
Content="加载本地数据"></fcommon:IconButton> Content="加载本地数据" Command="{Binding Path=LoadLocalDataCommand}"></fcommon:IconButton>
<fcommon:IconButton Style="{StaticResource IconButton_Default}" Margin="5,0,0,0"
IsEnabled="{Binding Path=IsLoadRemoteDataEnabled,Mode=OneWay}"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/refresh_16x16.png"
Content="刷新实时数据" Command="{Binding Path=LoadRemoteDataCommand}"></fcommon:IconButton>
</StackPanel> </StackPanel>
</Border> </Border>
<!-- 版子信息 --> <!-- 版子信息 -->
<Border Grid.Row="1" Padding="5" BorderBrush="#44000000" BorderThickness="1" Margin="5"> <Border Grid.Row="1" Padding="5" BorderBrush="#44000000" BorderThickness="1" Margin="5">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="60"></RowDefinition> <RowDefinition Height="100"></RowDefinition>
<RowDefinition Height="240"></RowDefinition> <RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<!-- 轮次信息 -->
<GroupBox Padding="10">
<GroupBox.Header>
<TextBlock Text="轮次信息" FontSize="18" FontWeight="Bold"></TextBlock>
</GroupBox.Header>
<Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="80"></ColumnDefinition> <ColumnDefinition Width="30"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition> <ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<!-- 标题 --> <TextBlock Text="轮次:" VerticalAlignment="Center" HorizontalAlignment="Right" Grid.Row="1"></TextBlock>
<TextBlock Text="标题:" HorizontalAlignment="Right" VerticalAlignment="Top"
Margin="0,10,10,0" Grid.Row="0"></TextBlock> <StackPanel Grid.Column="1" Margin="10,0,10,0" HorizontalAlignment="Left" Orientation="Horizontal">
<TextBox Grid.Column="1" Padding="3" AcceptsReturn="True" Margin="5"></TextBox> <ComboBox Height="30" Width="220" VerticalContentAlignment="Center"
<!-- 内容 --> SelectedValue="{Binding Path=SelectedRound,Mode=TwoWay}"
<TextBlock Text="内容:" HorizontalAlignment="Right" VerticalAlignment="Top" ItemsSource="{Binding Source={x:Static domain:TvpStaticResource.Rounds}}"></ComboBox>
Margin="0,10,10,0" Grid.Row="1"></TextBlock> </StackPanel>
<TextBox Grid.Column="1" Padding="3" AcceptsReturn="True" Margin="5" Grid.Row="1"></TextBox> </Grid>
</GroupBox>
<!-- 排名 -->
<GroupBox Padding="10" Grid.Row="1">
<GroupBox.Header>
<TextBlock Text="排名" FontSize="18" FontWeight="Bold"></TextBlock>
</GroupBox.Header>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="30"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Image Width="16" Height="16" Source="/VIZ.TVP.Golf.Module.Resource;component/Icons/refresh_16x16.png"
VerticalAlignment="Top" Margin="0,5,0,0"></Image>
<DataGrid Grid.Column="1" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" CanUserSortColumns="False"
ItemsSource="{Binding Path=GroupTempModels}">
<DataGrid.Columns>
<DataGridTextColumn Header="排名" Width="100" Binding="{Binding Path=Position}" IsReadOnly="True"></DataGridTextColumn>
<DataGridTextColumn Header="队伍名称" Width="100" Binding="{Binding Path=Name}"></DataGridTextColumn>
<DataGridTextColumn Header="总杆数" Width="100" Binding="{Binding Path=TotalStrokes}"></DataGridTextColumn>
<DataGridComboBoxColumn x:Name="c1" Header="Logo" Width="240"
ItemsSource="{Binding Source={x:Static domain:TvpStaticResource.TeamLogos}}"
SelectedValueBinding="{Binding Path=Logo}"></DataGridComboBoxColumn>
</DataGrid.Columns>
</DataGrid>
</Grid>
</GroupBox>
</Grid> </Grid>
</Border> </Border>
<!-- 示意图 --> <!-- 示意图 -->
...@@ -63,7 +105,7 @@ ...@@ -63,7 +105,7 @@
<RowDefinition Height="300"></RowDefinition> <RowDefinition Height="300"></RowDefinition>
<RowDefinition Height="80"></RowDefinition> <RowDefinition Height="80"></RowDefinition>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Image Source="pack://SiteOfOrigin:,,,/images/BottomInformation.jpg" /> <Image Source="pack://SiteOfOrigin:,,,/images/AfterMatchTeamRanking.jpg" />
<StackPanel Orientation="Horizontal" Grid.Row="1"> <StackPanel Orientation="Horizontal" Grid.Row="1">
<fcommon:IconButton Style="{StaticResource IconButton_Red}" Margin="10,0,0,0" <fcommon:IconButton Style="{StaticResource IconButton_Red}" Margin="10,0,0,0"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/up_16x16.png" Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/up_16x16.png"
......
...@@ -17,15 +17,15 @@ using VIZ.Framework.Core; ...@@ -17,15 +17,15 @@ using VIZ.Framework.Core;
namespace VIZ.TVP.Golf.Module namespace VIZ.TVP.Golf.Module
{ {
/// <summary> /// <summary>
/// BottomInformationView.xaml 的交互逻辑 /// AfterMatchTeamRankingView.xaml 的交互逻辑
/// </summary> /// </summary>
public partial class BottomInformationView : UserControl public partial class AfterMatchTeamRankingView : UserControl
{ {
public BottomInformationView() public AfterMatchTeamRankingView()
{ {
InitializeComponent(); InitializeComponent();
WPFHelper.BindingViewModel(this, new BottomInformationViewModel()); WPFHelper.BindingViewModel(this, new AfterMatchTeamRankingViewModel());
} }
} }
} }
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using VIZ.Framework.Core;
using VIZ.TVP.Golf.Domain;
namespace VIZ.TVP.Golf.Module
{
/// <summary>
/// 包装视图模型 -- 赛后队伍排名
/// </summary>
public class AfterMatchTeamRankingViewModel : TeamRankingViewModelBase
{
public AfterMatchTeamRankingViewModel()
{
}
// ===================================================================================
// Property
// ===================================================================================
// ===================================================================================
// Command
// ===================================================================================
// ===================================================================================
// Private Function
// ===================================================================================
}
}
<UserControl x:Class="VIZ.TVP.Golf.Module.BeforeMatchTeamRankingView"
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:VIZ.TVP.Golf.Module"
xmlns:toolkit="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:fcommon="clr-namespace:VIZ.Framework.Common;assembly=VIZ.Framework.Common"
xmlns:domain="clr-namespace:VIZ.TVP.Golf.Domain;assembly=VIZ.TVP.Golf.Domain"
xmlns:core="clr-namespace:VIZ.Framework.Core;assembly=VIZ.Framework.Core"
xmlns:resource="clr-namespace:VIZ.TVP.Golf.Module.Resource;assembly=VIZ.TVP.Golf.Module.Resource"
d:Background="White"
d:DataContext="{d:DesignInstance Type=local:BeforeMatchTeamRankingViewModel}"
mc:Ignorable="d"
d:DesignHeight="800" d:DesignWidth="1700">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/VIZ.TVP.Golf.Module.Resource;component/Style/IconButton/IconButton_Default.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
<resource:Round2RoundDetailConverter x:Key="Round2RoundDetailConverter"></resource:Round2RoundDetailConverter>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="600"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<!-- 版子操作 -->
<Border Grid.Row="0" Grid.ColumnSpan="2" BorderBrush="#44000000" Background="#66b6f2e3" BorderThickness="1" Margin="5" Padding="5">
<StackPanel Orientation="Horizontal">
<fcommon:IconButton Style="{StaticResource IconButton_Default}"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/db_16x16.png"
Content="加载本地数据" Command="{Binding Path=LoadLocalDataCommand}"></fcommon:IconButton>
<fcommon:IconButton Style="{StaticResource IconButton_Default}" Margin="5,0,0,0"
IsEnabled="{Binding Path=IsLoadRemoteDataEnabled,Mode=OneWay}"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/refresh_16x16.png"
Content="刷新实时数据" Command="{Binding Path=LoadRemoteDataCommand}"></fcommon:IconButton>
</StackPanel>
</Border>
<!-- 版子信息 -->
<Border Grid.Row="1" Padding="5" BorderBrush="#44000000" BorderThickness="1" Margin="5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="100"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<!-- 轮次信息 -->
<GroupBox Padding="10">
<GroupBox.Header>
<TextBlock Text="轮次信息" FontSize="18" FontWeight="Bold"></TextBlock>
</GroupBox.Header>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="30"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Text="轮次:" VerticalAlignment="Center" HorizontalAlignment="Right" Grid.Row="1"></TextBlock>
<StackPanel Grid.Column="1" Margin="10,0,10,0" HorizontalAlignment="Left" Orientation="Horizontal">
<ComboBox Height="30" Width="220" VerticalContentAlignment="Center"
SelectedValue="{Binding Path=SelectedRound,Mode=TwoWay}"
ItemsSource="{Binding Source={x:Static domain:TvpStaticResource.Rounds}}"></ComboBox>
</StackPanel>
</Grid>
</GroupBox>
<!-- 排名 -->
<GroupBox Padding="10" Grid.Row="1">
<GroupBox.Header>
<TextBlock Text="排名" FontSize="18" FontWeight="Bold"></TextBlock>
</GroupBox.Header>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="30"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Image Width="16" Height="16" Source="/VIZ.TVP.Golf.Module.Resource;component/Icons/refresh_16x16.png"
VerticalAlignment="Top" Margin="0,5,0,0"></Image>
<DataGrid Grid.Column="1" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" CanUserSortColumns="False"
ItemsSource="{Binding Path=GroupTempModels}">
<DataGrid.Columns>
<DataGridTextColumn Header="排名" Width="100" Binding="{Binding Path=Position}" IsReadOnly="True"></DataGridTextColumn>
<DataGridTextColumn Header="队伍名称" Width="100" Binding="{Binding Path=Name}"></DataGridTextColumn>
<DataGridTextColumn Header="总杆数" Width="100" Binding="{Binding Path=TotalStrokes}"></DataGridTextColumn>
<DataGridComboBoxColumn x:Name="c1" Header="Logo" Width="240"
ItemsSource="{Binding Source={x:Static domain:TvpStaticResource.TeamLogos}}"
SelectedValueBinding="{Binding Path=Logo}"></DataGridComboBoxColumn>
</DataGrid.Columns>
</DataGrid>
</Grid>
</GroupBox>
</Grid>
</Border>
<!-- 示意图 -->
<Border Grid.Row="1" Grid.Column="1" Grid.RowSpan="2" Padding="5" BorderBrush="#44000000" BorderThickness="1" Margin="5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="300"></RowDefinition>
<RowDefinition Height="80"></RowDefinition>
</Grid.RowDefinitions>
<Image Source="pack://SiteOfOrigin:,,,/images/BeforeMatchTeamRanking.jpg" />
<StackPanel Orientation="Horizontal" Grid.Row="1">
<fcommon:IconButton Style="{StaticResource IconButton_Red}" Margin="10,0,0,0"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/up_16x16.png"
Content="上版子"></fcommon:IconButton>
<fcommon:IconButton Style="{StaticResource IconButton_Red}" Margin="10,0,0,0"
Icon="/VIZ.TVP.Golf.Module.Resource;component/Icons/down_16x16.png"
Content="下版子"></fcommon:IconButton>
</StackPanel>
</Grid>
</Border>
</Grid>
</UserControl>
using System;
using System.Collections.Generic;
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;
using VIZ.Framework.Core;
namespace VIZ.TVP.Golf.Module
{
/// <summary>
/// BeforeMatchTeamRankingView.xaml 的交互逻辑
/// </summary>
public partial class BeforeMatchTeamRankingView : UserControl
{
public BeforeMatchTeamRankingView()
{
InitializeComponent();
WPFHelper.BindingViewModel(this, new BeforeMatchTeamRankingViewModel());
}
}
}
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using VIZ.Framework.Core;
using VIZ.TVP.Golf.Domain;
namespace VIZ.TVP.Golf.Module
{
/// <summary>
/// 包装视图模型 -- 赛前队伍排名
/// </summary>
public class BeforeMatchTeamRankingViewModel : TeamRankingViewModelBase
{
public BeforeMatchTeamRankingViewModel()
{
}
// ===================================================================================
// Property
// ===================================================================================
// ===================================================================================
// Command
// ===================================================================================
// ===================================================================================
// Private Function
// ===================================================================================
}
}
...@@ -43,7 +43,6 @@ ...@@ -43,7 +43,6 @@
</Border> </Border>
<!-- 版子信息 --> <!-- 版子信息 -->
<Border Grid.Row="1" Padding="5" BorderBrush="#44000000" BorderThickness="1" Margin="5"> <Border Grid.Row="1" Padding="5" BorderBrush="#44000000" BorderThickness="1" Margin="5">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="220"></RowDefinition> <RowDefinition Height="220"></RowDefinition>
...@@ -55,24 +54,9 @@ ...@@ -55,24 +54,9 @@
<GroupBox.Header> <GroupBox.Header>
<TextBlock Text="洞信息" FontSize="18" FontWeight="Bold"></TextBlock> <TextBlock Text="洞信息" FontSize="18" FontWeight="Bold"></TextBlock>
</GroupBox.Header> </GroupBox.Header>
<local:HolePickerPanel DataContext="{Binding Path=HolePickerPanelModel}"></local:HolePickerPanel> <local:HolePickerPanel DataContext="{Binding HolePickerPanelModel}"></local:HolePickerPanel>
</GroupBox>
<!-- 分组 1 -->
<GroupBox Grid.Row="1" Padding="10">
<GroupBox.Header>
<TextBlock Text="分组1" FontSize="18" FontWeight="Bold"></TextBlock>
</GroupBox.Header>
<local:GroupPickerPanel DataContext="{Binding GroupPickerPanelModel_1}"></local:GroupPickerPanel>
</GroupBox>
<!-- 分组 2 -->
<GroupBox Grid.Row="2" Padding="10">
<GroupBox.Header>
<TextBlock Text="分组2" FontSize="18" FontWeight="Bold"></TextBlock>
</GroupBox.Header>
<local:GroupPickerPanel DataContext="{Binding GroupPickerPanelModel_2}"></local:GroupPickerPanel>
</GroupBox> </GroupBox>
</Grid> </Grid>
</ScrollViewer>
</Border> </Border>
<!-- 示意图 --> <!-- 示意图 -->
<Border Grid.Row="1" Grid.Column="1" Grid.RowSpan="2" Padding="5" BorderBrush="#44000000" BorderThickness="1" Margin="5"> <Border Grid.Row="1" Grid.Column="1" Grid.RowSpan="2" Padding="5" BorderBrush="#44000000" BorderThickness="1" Margin="5">
......
...@@ -45,34 +45,6 @@ namespace VIZ.TVP.Golf.Module ...@@ -45,34 +45,6 @@ namespace VIZ.TVP.Golf.Module
#endregion #endregion
#region GroupPickerPanelModel_1 -- 分组选择面板视图模型 1
private GroupPickerPanelModel groupPickerPanelModel_1 = new GroupPickerPanelModel();
/// <summary>
/// 分组选择面板视图模型 1
/// </summary>
public GroupPickerPanelModel GroupPickerPanelModel_1
{
get { return groupPickerPanelModel_1; }
set { groupPickerPanelModel_1 = value; this.RaisePropertyChanged(nameof(GroupPickerPanelModel_1)); }
}
#endregion
#region GroupPickerPanelModel_2 -- 分组选择面板视图模型 2
private GroupPickerPanelModel groupPickerPanelModel_2 = new GroupPickerPanelModel();
/// <summary>
/// 分组选择面板视图模型 2
/// </summary>
public GroupPickerPanelModel GroupPickerPanelModel_2
{
get { return groupPickerPanelModel_2; }
set { groupPickerPanelModel_2 = value; this.RaisePropertyChanged(nameof(GroupPickerPanelModel_2)); }
}
#endregion
// =================================================================================== // ===================================================================================
// Command // Command
// =================================================================================== // ===================================================================================
...@@ -96,25 +68,7 @@ namespace VIZ.TVP.Golf.Module ...@@ -96,25 +68,7 @@ namespace VIZ.TVP.Golf.Module
/// </summary> /// </summary>
protected override void LoadLocalData() protected override void LoadLocalData()
{ {
RealDataWindow window = new RealDataWindow();
window.ShowDialog();
RealDataViewModel vm = window.realDataView.DataContext as RealDataViewModel;
if (vm == null)
return;
if (!vm.IsEnter)
return;
List<PlayerRealModel> list = this.realDataService.LoadPlayerRealModelFormLocal(vm.SelectedFile.FileName);
// 分组 1
this.UpdatePlayerTempModel(this.GroupPickerPanelModel_1?.Player1, list);
this.UpdatePlayerTempModel(this.GroupPickerPanelModel_1?.Player2, list);
// 分组 2
this.UpdatePlayerTempModel(this.GroupPickerPanelModel_2?.Player1, list);
this.UpdatePlayerTempModel(this.GroupPickerPanelModel_2?.Player2, list);
} }
#endregion #endregion
...@@ -126,30 +80,7 @@ namespace VIZ.TVP.Golf.Module ...@@ -126,30 +80,7 @@ namespace VIZ.TVP.Golf.Module
/// </summary> /// </summary>
protected override void LoadRemoteData() protected override void LoadRemoteData()
{ {
Task.Run(() =>
{
string fileName = this.realDataService.DownLoadData(INTERFACE_TOURNAMENT);
if (string.IsNullOrWhiteSpace(fileName))
{
MessageBox.Show("加载远程数据失败!");
return;
}
WPFHelper.BeginInvoke(() =>
{
List<PlayerRealModel> list = this.realDataService.LoadPlayerRealModelFormLocal(fileName);
// 分组 1
this.UpdatePlayerTempModel(this.GroupPickerPanelModel_1?.Player1, list);
this.UpdatePlayerTempModel(this.GroupPickerPanelModel_1?.Player2, list);
// 分组 2
this.UpdatePlayerTempModel(this.GroupPickerPanelModel_2?.Player1, list);
this.UpdatePlayerTempModel(this.GroupPickerPanelModel_2?.Player2, list);
});
});
} }
#endregion #endregion
......
using System;
using System.Collections.Generic;
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;
using VIZ.Framework.Core;
namespace VIZ.TVP.Golf.Module
{
/// <summary>
/// GroupHoleInfoView.xaml 的交互逻辑
/// </summary>
public partial class GroupHoleInfoView : UserControl
{
public GroupHoleInfoView()
{
InitializeComponent();
WPFHelper.BindingViewModel(this, new GroupHoleInfoViewModel());
}
}
}
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Documents;
using VIZ.Framework.Core;
using VIZ.TVP.Golf.Domain;
namespace VIZ.TVP.Golf.Module
{
/// <summary>
/// 分组洞信息视图模型
/// </summary>
public class GroupHoleInfoViewModel : PackageViewModelBase
{
public GroupHoleInfoViewModel()
{
// 初始化命令
this.InitCommand();
}
/// <summary>
/// 初始化命令
/// </summary>
private void InitCommand()
{
this.SummaryCommand = new VCommand(this.Summary);
}
// ===================================================================================
// Field
// ===================================================================================
// ===================================================================================
// Property
// ===================================================================================
#region SelectedRound -- 选中的轮次
private int selectedRound;
/// <summary>
/// 选中的轮次
/// </summary>
public int SelectedRound
{
get { return selectedRound; }
set { selectedRound = value; this.RaisePropertyChanged(nameof(SelectedRound)); }
}
#endregion
#region GroupPickerPanelModel -- 分组选择面板模型
private GroupPickerPanelModel groupPickerPanelModel = new GroupPickerPanelModel();
/// <summary>
/// 分组选择面板模型
/// </summary>
public GroupPickerPanelModel GroupPickerPanelModel
{
get { return groupPickerPanelModel; }
set { groupPickerPanelModel = value; this.RaisePropertyChanged(nameof(GroupPickerPanelModel)); }
}
#endregion
#region GroupHoleTempModels -- 分组临时模型集合
private ObservableCollection<GroupHoleTempModel> groupHoleTempModels;
/// <summary>
/// 分组临时模型
/// </summary>
public ObservableCollection<GroupHoleTempModel> GroupHoleTempModels
{
get { return groupHoleTempModels; }
set { groupHoleTempModels = value; this.RaisePropertyChanged(nameof(GroupHoleTempModels)); }
}
#endregion
#region First18HoleStrokes -- 18洞总杆数
private string first18HoleStrokes;
/// <summary>
/// 前18洞总杆数
/// </summary>
public string First18HoleStrokes
{
get { return first18HoleStrokes; }
set { first18HoleStrokes = value; this.RaisePropertyChanged(nameof(First18HoleStrokes)); }
}
#endregion
#region Secend18HoleStrokes -- 18洞中杆数
private string secend18HoleStrokes;
/// <summary>
/// 后18洞中杆数
/// </summary>
public string Secend18HoleStrokes
{
get { return secend18HoleStrokes; }
set { secend18HoleStrokes = value; this.RaisePropertyChanged(nameof(Secend18HoleStrokes)); }
}
#endregion
#region TotalHoleStrokes -- 总计杆数
private string totalHoleStrokes;
/// <summary>
/// 总计杆数
/// </summary>
public string TotalHoleStrokes
{
get { return totalHoleStrokes; }
set { totalHoleStrokes = value; this.RaisePropertyChanged(nameof(TotalHoleStrokes)); }
}
#endregion
// ===================================================================================
// Command
// ===================================================================================
#region SendCommand -- 发送命令
/// <summary>
/// 执行发送命令
/// </summary>
protected override void Send()
{
}
#endregion
#region LoadLocalDataCommand -- 加载本地数据命令
/// <summary>
/// 加载本地数据
/// </summary>
protected override void LoadLocalData()
{
RealDataWindow window = new RealDataWindow();
window.ShowDialog();
RealDataViewModel vm = window.realDataView.DataContext as RealDataViewModel;
if (vm == null)
return;
if (!vm.IsEnter)
return;
List<PlayerRealModel> list = this.realDataService.LoadPlayerRealModelFormLocal(vm.SelectedFile.FileName);
this.UpdateGroupHoleTempModels(list);
}
#endregion
#region LoadRemoteDataCommand -- 加载远程数据命令
/// <summary>
/// 加载远程数据
/// </summary>
protected override void LoadRemoteData()
{
Task.Run(() =>
{
string fileName = this.realDataService.DownLoadData(INTERFACE_TOURNAMENT);
if (string.IsNullOrWhiteSpace(fileName))
{
MessageBox.Show("加载远程数据失败!");
return;
}
WPFHelper.BeginInvoke(() =>
{
List<PlayerRealModel> list = this.realDataService.LoadPlayerRealModelFormLocal(fileName);
this.UpdateGroupHoleTempModels(list);
});
});
}
#endregion
#region SummaryCommand -- 汇总计算
/// <summary>
/// 汇总计算
/// </summary>
public VCommand SummaryCommand { get; set; }
/// <summary>
/// 汇总
/// </summary>
private void Summary()
{
if (this.GroupHoleTempModels == null || this.GroupHoleTempModels.Count == 0)
{
this.First18HoleStrokes = null;
this.Secend18HoleStrokes = null;
this.TotalHoleStrokes = null;
return;
}
int first18 = this.GroupHoleTempModels.Take(18).Sum(p => ValueHelper.ConvertValue<int>(p.TotalStrokes));
int secend18 = this.GroupHoleTempModels.Skip(18).Take(18).Sum(p => ValueHelper.ConvertValue<int>(p.TotalStrokes));
this.First18HoleStrokes = first18.ToString();
this.Secend18HoleStrokes = secend18.ToString();
this.TotalHoleStrokes = (first18 + secend18).ToString();
}
#endregion
// ===================================================================================
// Action
// ===================================================================================
/// <summary>
/// 更新数据
/// </summary>
/// <param name="list">真实球员模型</param>
private void UpdateGroupHoleTempModels(List<PlayerRealModel> list)
{
var players = ApplicationDomainEx.PlayerInfos.Where(p => p.Group == this.GroupPickerPanelModel.SelectedGroupInfo.Group);
ObservableCollection<GroupHoleTempModel> groupHoleTempModels = new ObservableCollection<GroupHoleTempModel>();
foreach (HoleInfoModel holeInfo in ApplicationDomainEx.HoleInfos)
{
GroupHoleTempModel model = new GroupHoleTempModel();
model.HoleID = holeInfo.HoleID.ToString();
model.Par = holeInfo.Par;
int total = 0;
foreach (PlayerInfoModel player in players)
{
PlayerRealModel player_real = list.FirstOrDefault(p => p.PlayerID == player.PlayerID);
if (player_real == null)
continue;
RoundRealModel round_real = player_real.Rounds.FirstOrDefault(p => p.No == this.SelectedRound);
if (round_real == null)
continue;
total += round_real.Today;
model.TotalStrokesDetail += $"{player.Name}: {round_real.Today} | ";
}
model.TotalStrokes = total.ToString();
groupHoleTempModels.Add(model);
}
this.GroupHoleTempModels = groupHoleTempModels;
}
}
}
...@@ -79,13 +79,13 @@ ...@@ -79,13 +79,13 @@
<GroupBox.Header> <GroupBox.Header>
<TextBlock Text="分组1" FontSize="18" FontWeight="Bold"></TextBlock> <TextBlock Text="分组1" FontSize="18" FontWeight="Bold"></TextBlock>
</GroupBox.Header> </GroupBox.Header>
<local:GroupPickerPanelNoPlayer DataContext="{Binding GroupPickerPaneNoPlayerModel1}"></local:GroupPickerPanelNoPlayer> <local:GroupPickerPanelNoPlayer DataContext="{Binding GroupPickerPanelModel1}"></local:GroupPickerPanelNoPlayer>
</GroupBox> </GroupBox>
<GroupBox Grid.Row="2" Padding="10"> <GroupBox Grid.Row="2" Padding="10">
<GroupBox.Header> <GroupBox.Header>
<TextBlock Text="分组2" FontSize="18" FontWeight="Bold"></TextBlock> <TextBlock Text="分组2" FontSize="18" FontWeight="Bold"></TextBlock>
</GroupBox.Header> </GroupBox.Header>
<local:GroupPickerPanelNoPlayer DataContext="{Binding GroupPickerPaneNoPlayerModel2}"></local:GroupPickerPanelNoPlayer> <local:GroupPickerPanelNoPlayer DataContext="{Binding GroupPickerPanelModel2}"></local:GroupPickerPanelNoPlayer>
</GroupBox> </GroupBox>
</Grid> </Grid>
</ScrollViewer> </ScrollViewer>
......
...@@ -46,30 +46,30 @@ namespace VIZ.TVP.Golf.Module ...@@ -46,30 +46,30 @@ namespace VIZ.TVP.Golf.Module
#endregion #endregion
#region GroupPickerPaneNoPlayerModel1 -- 分组选择面板模型1 #region GroupPickerPanelModel -- 分组选择面板模型1
private GroupPickerPaneNoPlayerModel groupPickerPaneNoPlayerModel1 = new GroupPickerPaneNoPlayerModel(); private GroupPickerPanelModel groupPickerPanelModel1 = new GroupPickerPanelModel();
/// <summary> /// <summary>
/// 分组选择面板模型1 /// 分组选择面板模型1
/// </summary> /// </summary>
public GroupPickerPaneNoPlayerModel GroupPickerPaneNoPlayerModel1 public GroupPickerPanelModel GroupPickerPanelModel1
{ {
get { return groupPickerPaneNoPlayerModel1; } get { return groupPickerPanelModel1; }
set { groupPickerPaneNoPlayerModel1 = value; this.RaisePropertyChanged(nameof(GroupPickerPaneNoPlayerModel1)); } set { groupPickerPanelModel1 = value; this.RaisePropertyChanged(nameof(GroupPickerPanelModel)); }
} }
#endregion #endregion
#region GroupPickerPaneNoPlayerModel2 -- 分组选择面板模型2 #region GroupPickerPanelModel -- 分组选择面板模型2
private GroupPickerPaneNoPlayerModel groupPickerPaneNoPlayerModel2 = new GroupPickerPaneNoPlayerModel(); private GroupPickerPanelModel groupPickerPanelModel2 = new GroupPickerPanelModel();
/// <summary> /// <summary>
/// 分组选择面板模型2 /// 分组选择面板模型2
/// </summary> /// </summary>
public GroupPickerPaneNoPlayerModel GroupPickerPaneNoPlayerModel2 public GroupPickerPanelModel GroupPickerPanelModel2
{ {
get { return groupPickerPaneNoPlayerModel2; } get { return groupPickerPanelModel2; }
set { groupPickerPaneNoPlayerModel2 = value; this.RaisePropertyChanged(nameof(GroupPickerPaneNoPlayerModel2)); } set { groupPickerPanelModel2 = value; this.RaisePropertyChanged(nameof(GroupPickerPanelModel2)); }
} }
#endregion #endregion
...@@ -113,13 +113,11 @@ namespace VIZ.TVP.Golf.Module ...@@ -113,13 +113,11 @@ namespace VIZ.TVP.Golf.Module
List<PlayerRealModel> list = this.realDataService.LoadPlayerRealModelFormLocal(vm.SelectedFile.FileName); List<PlayerRealModel> list = this.realDataService.LoadPlayerRealModelFormLocal(vm.SelectedFile.FileName);
this.UpdatePlayerTempModel(this.GroupPickerPaneNoPlayerModel1?.Player1, list); this.UpdatePlayerTempModel(this.GroupPickerPanelModel1?.Player1, list);
this.UpdatePlayerTempModel(this.GroupPickerPaneNoPlayerModel1?.Player2, list); this.UpdatePlayerTempModel(this.GroupPickerPanelModel1?.Player2, list);
this.GroupPickerPaneNoPlayerModel1.UpdatePlayersStrokes();
this.UpdatePlayerTempModel(this.GroupPickerPaneNoPlayerModel2?.Player1, list); this.UpdatePlayerTempModel(this.GroupPickerPanelModel2?.Player1, list);
this.UpdatePlayerTempModel(this.GroupPickerPaneNoPlayerModel2?.Player2, list); this.UpdatePlayerTempModel(this.GroupPickerPanelModel2?.Player2, list);
this.GroupPickerPaneNoPlayerModel2.UpdatePlayersStrokes();
} }
#endregion #endregion
...@@ -146,13 +144,11 @@ namespace VIZ.TVP.Golf.Module ...@@ -146,13 +144,11 @@ namespace VIZ.TVP.Golf.Module
{ {
List<PlayerRealModel> list = this.realDataService.LoadPlayerRealModelFormLocal(fileName); List<PlayerRealModel> list = this.realDataService.LoadPlayerRealModelFormLocal(fileName);
this.UpdatePlayerTempModel(this.GroupPickerPaneNoPlayerModel1?.Player1, list); this.UpdatePlayerTempModel(this.GroupPickerPanelModel1?.Player1, list);
this.UpdatePlayerTempModel(this.GroupPickerPaneNoPlayerModel1?.Player2, list); this.UpdatePlayerTempModel(this.GroupPickerPanelModel1?.Player2, list);
this.GroupPickerPaneNoPlayerModel1.UpdatePlayersStrokes();
this.UpdatePlayerTempModel(this.GroupPickerPaneNoPlayerModel2?.Player1, list); this.UpdatePlayerTempModel(this.GroupPickerPanelModel2?.Player1, list);
this.UpdatePlayerTempModel(this.GroupPickerPaneNoPlayerModel2?.Player2, list); this.UpdatePlayerTempModel(this.GroupPickerPanelModel2?.Player2, list);
this.GroupPickerPaneNoPlayerModel2.UpdatePlayersStrokes();
}); });
}); });
} }
...@@ -187,13 +183,11 @@ namespace VIZ.TVP.Golf.Module ...@@ -187,13 +183,11 @@ namespace VIZ.TVP.Golf.Module
model.Players.Add(player); model.Players.Add(player);
} }
this.GroupPickerPaneNoPlayerModel1.UpdateByGroupTempModel(model); this.GroupPickerPanelModel1.UpdateByGroupTempModel(model);
this.GroupPickerPaneNoPlayerModel1.UpdatePlayersStrokes();
} }
else else
{ {
this.GroupPickerPaneNoPlayerModel1.ClearProperty(); this.GroupPickerPanelModel1.ClearProperty();
this.GroupPickerPaneNoPlayerModel1.ClearPlayersStrokes();
} }
if (teams.Count > 1) if (teams.Count > 1)
...@@ -206,13 +200,11 @@ namespace VIZ.TVP.Golf.Module ...@@ -206,13 +200,11 @@ namespace VIZ.TVP.Golf.Module
model.Players.Add(player); model.Players.Add(player);
} }
this.GroupPickerPaneNoPlayerModel2.UpdateByGroupTempModel(model); this.GroupPickerPanelModel2.UpdateByGroupTempModel(model);
this.GroupPickerPaneNoPlayerModel2.UpdatePlayersStrokes();
} }
else else
{ {
this.GroupPickerPaneNoPlayerModel2.ClearProperty(); this.GroupPickerPanelModel2.ClearProperty();
this.GroupPickerPaneNoPlayerModel2.ClearPlayersStrokes();
} }
} }
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
<GroupBox.Header> <GroupBox.Header>
<TextBlock Text="组信息" FontSize="18" FontWeight="Bold"></TextBlock> <TextBlock Text="组信息" FontSize="18" FontWeight="Bold"></TextBlock>
</GroupBox.Header> </GroupBox.Header>
<local:GroupPickerPanelNoPlayer DataContext="{Binding Path=GroupPickerPaneNoPlayerModel}" Margin="5"></local:GroupPickerPanelNoPlayer> <local:GroupPickerPanelNoPlayer DataContext="{Binding Path=GroupPickerPanelModel}" Margin="5"></local:GroupPickerPanelNoPlayer>
</GroupBox> </GroupBox>
</Grid> </Grid>
</Border> </Border>
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
<GroupBox.Header> <GroupBox.Header>
<TextBlock Text="组信息" FontSize="18" FontWeight="Bold"></TextBlock> <TextBlock Text="组信息" FontSize="18" FontWeight="Bold"></TextBlock>
</GroupBox.Header> </GroupBox.Header>
<local:GroupPickerPanelNoPlayer DataContext="{Binding Path=GroupPickerPaneNoPlayerModel}" Margin="5"></local:GroupPickerPanelNoPlayer> <local:GroupPickerPanelNoPlayer DataContext="{Binding Path=GroupPickerPanelModel}" Margin="5"></local:GroupPickerPanelNoPlayer>
</GroupBox> </GroupBox>
<!-- 洞信息 --> <!-- 洞信息 -->
<GroupBox Grid.Row="1" Padding="10"> <GroupBox Grid.Row="1" Padding="10">
......
...@@ -18,16 +18,16 @@ namespace VIZ.TVP.Golf.Module ...@@ -18,16 +18,16 @@ namespace VIZ.TVP.Golf.Module
// Property // Property
// =================================================================================== // ===================================================================================
#region GroupPickerPaneNoPlayerModel -- 分组选择模型 #region GroupPickerPanelModel -- 分组选择模型
private GroupPickerPaneNoPlayerModel groupPickerPaneNoPlayerModel = new GroupPickerPaneNoPlayerModel(); private GroupPickerPanelModel groupPickerPanelModel = new GroupPickerPanelModel();
/// <summary> /// <summary>
/// 分组选择模型 /// 分组选择模型
/// </summary> /// </summary>
public GroupPickerPaneNoPlayerModel GroupPickerPaneNoPlayerModel public GroupPickerPanelModel GroupPickerPanelModel
{ {
get { return groupPickerPaneNoPlayerModel; } get { return groupPickerPanelModel; }
set { groupPickerPaneNoPlayerModel = value; this.RaisePropertyChanged(nameof(GroupPickerPaneNoPlayerModel)); } set { groupPickerPanelModel = value; this.RaisePropertyChanged(nameof(GroupPickerPanelModel)); }
} }
#endregion #endregion
...@@ -67,10 +67,8 @@ namespace VIZ.TVP.Golf.Module ...@@ -67,10 +67,8 @@ namespace VIZ.TVP.Golf.Module
List<PlayerRealModel> list = this.realDataService.LoadPlayerRealModelFormLocal(vm.SelectedFile.FileName); List<PlayerRealModel> list = this.realDataService.LoadPlayerRealModelFormLocal(vm.SelectedFile.FileName);
this.UpdatePlayerTempModel(this.GroupPickerPaneNoPlayerModel?.Player1, list); this.UpdatePlayerTempModel(this.GroupPickerPanelModel?.Player1, list);
this.UpdatePlayerTempModel(this.GroupPickerPaneNoPlayerModel?.Player2, list); this.UpdatePlayerTempModel(this.GroupPickerPanelModel?.Player2, list);
this.GroupPickerPaneNoPlayerModel.UpdatePlayersStrokes();
} }
#endregion #endregion
...@@ -97,10 +95,8 @@ namespace VIZ.TVP.Golf.Module ...@@ -97,10 +95,8 @@ namespace VIZ.TVP.Golf.Module
{ {
List<PlayerRealModel> list = this.realDataService.LoadPlayerRealModelFormLocal(fileName); List<PlayerRealModel> list = this.realDataService.LoadPlayerRealModelFormLocal(fileName);
this.UpdatePlayerTempModel(this.GroupPickerPaneNoPlayerModel?.Player1, list); this.UpdatePlayerTempModel(this.GroupPickerPanelModel?.Player1, list);
this.UpdatePlayerTempModel(this.GroupPickerPaneNoPlayerModel?.Player2, list); this.UpdatePlayerTempModel(this.GroupPickerPanelModel?.Player2, list);
this.GroupPickerPaneNoPlayerModel.UpdatePlayersStrokes();
}); });
}); });
} }
......
...@@ -24,16 +24,16 @@ namespace VIZ.TVP.Golf.Module ...@@ -24,16 +24,16 @@ namespace VIZ.TVP.Golf.Module
// Property // Property
// =================================================================================== // ===================================================================================
#region GroupPickerPaneNoPlayerModel -- 分组选择模型 #region GroupPickerPanelModel -- 分组选择模型
private GroupPickerPaneNoPlayerModel groupPickerPaneNoPlayerModel = new GroupPickerPaneNoPlayerModel(); private GroupPickerPanelModel groupPickerPanelModel = new GroupPickerPanelModel();
/// <summary> /// <summary>
/// 分组选择模型 /// 分组选择模型
/// </summary> /// </summary>
public GroupPickerPaneNoPlayerModel GroupPickerPaneNoPlayerModel public GroupPickerPanelModel GroupPickerPanelModel
{ {
get { return groupPickerPaneNoPlayerModel; } get { return groupPickerPanelModel; }
set { groupPickerPaneNoPlayerModel = value; this.RaisePropertyChanged(nameof(GroupPickerPaneNoPlayerModel)); } set { groupPickerPanelModel = value; this.RaisePropertyChanged(nameof(GroupPickerPanelModel)); }
} }
#endregion #endregion
...@@ -101,10 +101,8 @@ namespace VIZ.TVP.Golf.Module ...@@ -101,10 +101,8 @@ namespace VIZ.TVP.Golf.Module
List<PlayerRealModel> list = this.realDataService.LoadPlayerRealModelFormLocal(vm.SelectedFile.FileName); List<PlayerRealModel> list = this.realDataService.LoadPlayerRealModelFormLocal(vm.SelectedFile.FileName);
this.UpdatePlayerTempModel(this.GroupPickerPaneNoPlayerModel?.Player1, list); this.UpdatePlayerTempModel(this.GroupPickerPanelModel?.Player1, list);
this.UpdatePlayerTempModel(this.GroupPickerPaneNoPlayerModel?.Player2, list); this.UpdatePlayerTempModel(this.GroupPickerPanelModel?.Player2, list);
this.GroupPickerPaneNoPlayerModel.UpdatePlayersStrokes();
} }
#endregion #endregion
...@@ -131,10 +129,8 @@ namespace VIZ.TVP.Golf.Module ...@@ -131,10 +129,8 @@ namespace VIZ.TVP.Golf.Module
{ {
List<PlayerRealModel> list = this.realDataService.LoadPlayerRealModelFormLocal(fileName); List<PlayerRealModel> list = this.realDataService.LoadPlayerRealModelFormLocal(fileName);
this.UpdatePlayerTempModel(this.GroupPickerPaneNoPlayerModel?.Player1, list); this.UpdatePlayerTempModel(this.GroupPickerPanelModel?.Player1, list);
this.UpdatePlayerTempModel(this.GroupPickerPaneNoPlayerModel?.Player2, list); this.UpdatePlayerTempModel(this.GroupPickerPanelModel?.Player2, list);
this.GroupPickerPaneNoPlayerModel.UpdatePlayersStrokes();
}); });
}); });
} }
......
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows;
using VIZ.Framework.Core; using VIZ.Framework.Core;
using VIZ.TVP.Golf.Domain;
namespace VIZ.TVP.Golf.Module namespace VIZ.TVP.Golf.Module
{ {
/// <summary> /// <summary>
/// 包装视图模型 -- 底部信息版 /// 队伍排名视图模型基类
/// </summary> /// </summary>
public class BottomInformationViewModel : PackageViewModelBase public abstract class TeamRankingViewModelBase : PackageViewModelBase
{ {
public BottomInformationViewModel()
{
}
// =================================================================================== // ===================================================================================
// Property // Property
// =================================================================================== // ===================================================================================
#region Title -- 标题 #region SelectedRound -- 选中的轮次
private string title; private int selectedRound;
/// <summary> /// <summary>
/// 标题 /// 选中的轮次信息
/// </summary> /// </summary>
public string Title public int SelectedRound
{ {
get { return title; } get { return selectedRound; }
set { title = value; this.RaisePropertyChanged(nameof(Title)); } set { selectedRound = value; this.RaisePropertyChanged(nameof(SelectedRound)); }
} }
#endregion #endregion
#region Content -- 内容 #region GroupTempModels -- 分组临时模型集合
private string content; private ObservableCollection<TeamTempModel> groupTempModels;
/// <summary> /// <summary>
/// 内容 /// 分组临时模型集合
/// </summary> /// </summary>
public string Content public ObservableCollection<TeamTempModel> GroupTempModels
{ {
get { return content; } get { return groupTempModels; }
set { content = value; this.RaisePropertyChanged(nameof(Content)); } set { groupTempModels = value; this.RaisePropertyChanged(nameof(GroupTempModels)); }
} }
#endregion #endregion
...@@ -53,10 +52,6 @@ namespace VIZ.TVP.Golf.Module ...@@ -53,10 +52,6 @@ namespace VIZ.TVP.Golf.Module
// Command // Command
// =================================================================================== // ===================================================================================
// ===================================================================================
// Command
// ===================================================================================
#region SendCommand -- 发送命令 #region SendCommand -- 发送命令
/// <summary> /// <summary>
...@@ -69,7 +64,6 @@ namespace VIZ.TVP.Golf.Module ...@@ -69,7 +64,6 @@ namespace VIZ.TVP.Golf.Module
#endregion #endregion
#region LoadLocalDataCommand -- 加载本地数据命令 #region LoadLocalDataCommand -- 加载本地数据命令
/// <summary> /// <summary>
...@@ -77,7 +71,19 @@ namespace VIZ.TVP.Golf.Module ...@@ -77,7 +71,19 @@ namespace VIZ.TVP.Golf.Module
/// </summary> /// </summary>
protected override void LoadLocalData() protected override void LoadLocalData()
{ {
RealDataWindow window = new RealDataWindow();
window.ShowDialog();
RealDataViewModel vm = window.realDataView.DataContext as RealDataViewModel;
if (vm == null)
return;
if (!vm.IsEnter)
return;
List<PlayerRealModel> list = this.realDataService.LoadPlayerRealModelFormLocal(vm.SelectedFile.FileName);
this.UpdateGroupTempModels(list);
} }
#endregion #endregion
...@@ -89,9 +95,52 @@ namespace VIZ.TVP.Golf.Module ...@@ -89,9 +95,52 @@ namespace VIZ.TVP.Golf.Module
/// </summary> /// </summary>
protected override void LoadRemoteData() protected override void LoadRemoteData()
{ {
Task.Run(() =>
{
string fileName = this.realDataService.DownLoadData(INTERFACE_TOURNAMENT);
if (string.IsNullOrWhiteSpace(fileName))
{
MessageBox.Show("加载远程数据失败!");
return;
}
WPFHelper.BeginInvoke(() =>
{
List<PlayerRealModel> list = this.realDataService.LoadPlayerRealModelFormLocal(fileName);
this.UpdateGroupTempModels(list);
});
});
} }
#endregion #endregion
// ===================================================================================
// Private Function
// ===================================================================================
/// <summary>
/// 更新组临时模型
/// </summary>
/// <param name="list">球员真实模型</param>
private void UpdateGroupTempModels(List<PlayerRealModel> list)
{
ObservableCollection<TeamTempModel> groupTempModels = new ObservableCollection<TeamTempModel>();
foreach (TeamInfoModel info_model in ApplicationDomainEx.TeamInfos)
{
TeamTempModel temp_model = new TeamTempModel();
temp_model.FromInfoModel(info_model);
var real_players = list.Where(p => p.TeamInfoModel != null && p.TeamInfoModel.TeamID == temp_model.TeamID).ToList();
temp_model.TotalStrokes = real_players.Sum(p => p.Strokes).ToString();
groupTempModels.Add(temp_model);
}
this.GroupTempModels = groupTempModels;
}
} }
} }
\ No newline at end of file
...@@ -47,6 +47,9 @@ namespace VIZ.TVP.Golf.Module ...@@ -47,6 +47,9 @@ namespace VIZ.TVP.Golf.Module
// 初始化分组信息 // 初始化分组信息
this.InitGroups(); this.InitGroups();
// 初始化轮次信息
this.InitRounds();
// 初始化描述信息 // 初始化描述信息
this.InitDetails(); this.InitDetails();
...@@ -128,6 +131,26 @@ namespace VIZ.TVP.Golf.Module ...@@ -128,6 +131,26 @@ namespace VIZ.TVP.Golf.Module
} }
/// <summary> /// <summary>
/// 初始化轮次
/// </summary>
private void InitRounds()
{
Dictionary<int, string> roundsDetail = new Dictionary<int, string>();
roundsDetail.Add(1, "First Round");
roundsDetail.Add(2, "Final Rund");
ObservableCollection<int> rounds = new ObservableCollection<int>();
foreach (var kv in roundsDetail)
{
rounds.Add(kv.Key);
}
TvpStaticResource.Rounds = rounds;
TvpStaticResource.RoundsDetail = roundsDetail;
}
/// <summary>
/// 初始化秒速信息 /// 初始化秒速信息
/// </summary> /// </summary>
private void InitDetails() private void InitDetails()
......
...@@ -93,6 +93,14 @@ ...@@ -93,6 +93,14 @@
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Page Include="Package\AfterMatchTeamRanking\View\AfterMatchTeamRankingView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Package\GroupHoleInfo\View\GroupHoleInfoView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Package\Champion\View\ChampionView.xaml"> <Page Include="Package\Champion\View\ChampionView.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
...@@ -149,7 +157,7 @@ ...@@ -149,7 +157,7 @@
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</Page> </Page>
<Page Include="Package\BottomInformation\View\BottomInformationView.xaml"> <Page Include="Package\BeforeMatchTeamRanking\View\BeforeMatchTeamRankingView.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
...@@ -195,6 +203,14 @@ ...@@ -195,6 +203,14 @@
</Page> </Page>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Package\AfterMatchTeamRanking\ViewModel\AfterMatchTeamRankingViewModel.cs" />
<Compile Include="Package\AfterMatchTeamRanking\View\AfterMatchTeamRankingView.xaml.cs">
<DependentUpon>AfterMatchTeamRankingView.xaml</DependentUpon>
</Compile>
<Compile Include="Package\GroupHoleInfo\ViewModel\GroupHoleInfoViewModel.cs" />
<Compile Include="Package\GroupHoleInfo\View\GroupHoleInfoView.xaml.cs">
<DependentUpon>GroupHoleInfoView.xaml</DependentUpon>
</Compile>
<Compile Include="Package\Champion\ViewModel\ChampionViewModel.cs" /> <Compile Include="Package\Champion\ViewModel\ChampionViewModel.cs" />
<Compile Include="Package\Champion\View\ChampionView.xaml.cs"> <Compile Include="Package\Champion\View\ChampionView.xaml.cs">
<DependentUpon>ChampionView.xaml</DependentUpon> <DependentUpon>ChampionView.xaml</DependentUpon>
...@@ -211,6 +227,7 @@ ...@@ -211,6 +227,7 @@
<Compile Include="Package\NameBar\View\NameBarBottomView.xaml.cs"> <Compile Include="Package\NameBar\View\NameBarBottomView.xaml.cs">
<DependentUpon>NameBarBottomView.xaml</DependentUpon> <DependentUpon>NameBarBottomView.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="Package\TeamRankingViewModelBase.cs" />
<Compile Include="Widgets\Detail\DetailPanel.xaml.cs"> <Compile Include="Widgets\Detail\DetailPanel.xaml.cs">
<DependentUpon>DetailPanel.xaml</DependentUpon> <DependentUpon>DetailPanel.xaml</DependentUpon>
</Compile> </Compile>
...@@ -220,7 +237,6 @@ ...@@ -220,7 +237,6 @@
</Compile> </Compile>
<Compile Include="Setup\Provider\Setup\AppSetup_ClearLocalData.cs" /> <Compile Include="Setup\Provider\Setup\AppSetup_ClearLocalData.cs" />
<Compile Include="Widgets\Detail\DetailPanelModel.cs" /> <Compile Include="Widgets\Detail\DetailPanelModel.cs" />
<Compile Include="Widgets\Group\GroupPickerPaneNoPlayerModel.cs" />
<Compile Include="Widgets\Group\GroupPickerPanelNoPlayer.xaml.cs"> <Compile Include="Widgets\Group\GroupPickerPanelNoPlayer.xaml.cs">
<DependentUpon>GroupPickerPanelNoPlayer.xaml</DependentUpon> <DependentUpon>GroupPickerPanelNoPlayer.xaml</DependentUpon>
</Compile> </Compile>
...@@ -248,9 +264,9 @@ ...@@ -248,9 +264,9 @@
<Compile Include="Package\BottomHoleInfo\View\BottomHoleInfoView.xaml.cs"> <Compile Include="Package\BottomHoleInfo\View\BottomHoleInfoView.xaml.cs">
<DependentUpon>BottomHoleInfoView.xaml</DependentUpon> <DependentUpon>BottomHoleInfoView.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="Package\BottomInformation\ViewModel\BottomInformationViewModel.cs" /> <Compile Include="Package\BeforeMatchTeamRanking\ViewModel\BeforeMatchTeamRankingViewModel.cs" />
<Compile Include="Package\BottomInformation\View\BottomInformationView.xaml.cs"> <Compile Include="Package\BeforeMatchTeamRanking\View\BeforeMatchTeamRankingView.xaml.cs">
<DependentUpon>BottomInformationView.xaml</DependentUpon> <DependentUpon>BeforeMatchTeamRankingView.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="Information\Hole\Controller\HoleListController.cs" /> <Compile Include="Information\Hole\Controller\HoleListController.cs" />
<Compile Include="Information\Hole\Controller\IHoleListSupport.cs" /> <Compile Include="Information\Hole\Controller\IHoleListSupport.cs" />
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.UI.HtmlControls;
using VIZ.Framework.Core;
using VIZ.TVP.Golf.Domain;
namespace VIZ.TVP.Golf.Module
{
/// <summary>
/// 组选择面板视图模型
/// </summary>
public class GroupPickerPaneNoPlayerModel : GroupPickerPanelModel
{
/// <summary>
/// 组选择面板视图模型
/// </summary>
public GroupPickerPaneNoPlayerModel()
{
}
// ===================================================================================
// Property
// ===================================================================================
#region PlayersDisplayName -- 组成员显示名称
private string playersDisplayName;
/// <summary>
/// 组成员显示名称
/// </summary>
public string PlayersDisplayName
{
get { return playersDisplayName; }
set { playersDisplayName = value; this.RaisePropertyChanged(nameof(PlayersDisplayName)); }
}
#endregion
#region PlayersStrokes -- 组成员杆数
private string playersStrokes;
/// <summary>
/// 组成员杆数
/// </summary>
public string PlayersStrokes
{
get { return playersStrokes; }
set { playersStrokes = value; this.RaisePropertyChanged(nameof(PlayersStrokes)); }
}
#endregion
// ===================================================================================
// Command
// ===================================================================================
#region SelectGroupCommand -- 选择分组命令
/// <summary>
/// 选择分组
/// </summary>
protected override void SelectGroup()
{
base.SelectGroup();
this.UpdatePlayersStrokes();
}
#endregion
// ===================================================================================
// Action
// ===================================================================================
/// <summary>
/// 更新球员总杆数
/// </summary>
public void UpdatePlayersStrokes()
{
// 组成员
StringBuilder sb = new StringBuilder();
if (this.Player1 != null)
{
sb.Append(this.Player1.Name);
}
if (this.Player2 != null)
{
sb.Append(" / ");
sb.Append(this.Player2.Name);
}
this.PlayersDisplayName = sb.ToString();
// 总杆数
int strokes = this.Player1?.Strokes ?? 0 + this.Player2?.Strokes ?? 0;
this.PlayersStrokes = strokes == 0 ? "E" : strokes > 0 ? $"+{strokes}" : $"-{strokes}";
}
/// <summary>
/// 清理球员总杆数
/// </summary>
public void ClearPlayersStrokes()
{
this.PlayersDisplayName = null;
this.PlayersStrokes = null;
}
}
}
...@@ -63,6 +63,20 @@ namespace VIZ.TVP.Golf.Module ...@@ -63,6 +63,20 @@ namespace VIZ.TVP.Golf.Module
#endregion #endregion
#region SelectedGroupInfo -- 选中的分组信息
private GroupTempModel selectedGroupInfo;
/// <summary>
/// 选中的分组信息
/// </summary>
public GroupTempModel SelectedGroupInfo
{
get { return selectedGroupInfo; }
set { selectedGroupInfo = value; this.RaisePropertyChanged(nameof(SelectedGroupInfo)); }
}
#endregion
#region Player1 -- 队员1 #region Player1 -- 队员1
private PlayerTempModel player1 = new PlayerTempModel(); private PlayerTempModel player1 = new PlayerTempModel();
...@@ -91,6 +105,34 @@ namespace VIZ.TVP.Golf.Module ...@@ -91,6 +105,34 @@ namespace VIZ.TVP.Golf.Module
#endregion #endregion
#region PlayersDisplayName -- 组成员显示名称
private string playersDisplayName;
/// <summary>
/// 组成员显示名称
/// </summary>
public string PlayersDisplayName
{
get { return playersDisplayName; }
set { playersDisplayName = value; this.RaisePropertyChanged(nameof(PlayersDisplayName)); }
}
#endregion
#region PlayersStrokes -- 组成员杆数
private string playersStrokes;
/// <summary>
/// 组成员杆数
/// </summary>
public string PlayersStrokes
{
get { return playersStrokes; }
set { playersStrokes = value; this.RaisePropertyChanged(nameof(PlayersStrokes)); }
}
#endregion
// =================================================================================== // ===================================================================================
// Command // Command
// =================================================================================== // ===================================================================================
...@@ -112,15 +154,19 @@ namespace VIZ.TVP.Golf.Module ...@@ -112,15 +154,19 @@ namespace VIZ.TVP.Golf.Module
GroupPickerViewModel vm = window.groupPickerView.DataContext as GroupPickerViewModel; GroupPickerViewModel vm = window.groupPickerView.DataContext as GroupPickerViewModel;
if (vm == null || !vm.IsEnter) if (vm == null || !vm.IsEnter)
{
this.SelectedGroupInfo = null;
return; return;
}
this.SelectedGroupInfo = vm.SelectedGroupInfo;
this.UpdateByGroupTempModel(vm.SelectedGroupInfo); this.UpdateByGroupTempModel(vm.SelectedGroupInfo);
} }
#endregion #endregion
// =================================================================================== // ===================================================================================
// Action // Public Action
// =================================================================================== // ===================================================================================
/// <summary> /// <summary>
...@@ -152,6 +198,8 @@ namespace VIZ.TVP.Golf.Module ...@@ -152,6 +198,8 @@ namespace VIZ.TVP.Golf.Module
this.Player2.Name = player.Name; this.Player2.Name = player.Name;
this.Player2.HalfPicture = player.HalfPicture; this.Player2.HalfPicture = player.HalfPicture;
} }
this.UpdatePlayersProperty();
} }
/// <summary> /// <summary>
...@@ -171,6 +219,39 @@ namespace VIZ.TVP.Golf.Module ...@@ -171,6 +219,39 @@ namespace VIZ.TVP.Golf.Module
this.Player2.Name = null; this.Player2.Name = null;
this.Player2.HalfPicture = null; this.Player2.HalfPicture = null;
this.Player2.Strokes = 0; this.Player2.Strokes = 0;
this.PlayersDisplayName = null;
this.PlayersStrokes = null;
}
// ===================================================================================
// Private Action
// ===================================================================================
/// <summary>
/// 更新球员集合属性
/// </summary>
private void UpdatePlayersProperty()
{
// 组成员
StringBuilder sb = new StringBuilder();
if (this.Player1 != null)
{
sb.Append(this.Player1.Name);
}
if (this.Player2 != null)
{
sb.Append(" / ");
sb.Append(this.Player2.Name);
}
this.PlayersDisplayName = sb.ToString();
// 总杆数
int strokes = this.Player1?.Strokes ?? 0 + this.Player2?.Strokes ?? 0;
this.PlayersStrokes = strokes == 0 ? "E" : strokes > 0 ? $"+{strokes}" : $"-{strokes}";
} }
} }
} }
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
xmlns:domain="clr-namespace:VIZ.TVP.Golf.Domain;assembly=VIZ.TVP.Golf.Domain" xmlns:domain="clr-namespace:VIZ.TVP.Golf.Domain;assembly=VIZ.TVP.Golf.Domain"
xmlns:core="clr-namespace:VIZ.Framework.Core;assembly=VIZ.Framework.Core" xmlns:core="clr-namespace:VIZ.Framework.Core;assembly=VIZ.Framework.Core"
d:Background="White" d:Background="White"
d:DataContext="{d:DesignInstance Type=local:GroupPickerPaneNoPlayerModel}" d:DataContext="{d:DesignInstance Type=local:GroupPickerPanelModel}"
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="700"> d:DesignHeight="300" d:DesignWidth="700">
<UserControl.Resources> <UserControl.Resources>
......
...@@ -162,7 +162,9 @@ namespace VIZ.TVP.Golf.Module ...@@ -162,7 +162,9 @@ namespace VIZ.TVP.Golf.Module
foreach (var group in groups) foreach (var group in groups)
{ {
GroupTempModel model = new GroupTempModel(); GroupTempModel model = new GroupTempModel();
model.Group = group.Key;
model.TeamInfo = this.SelectedTeamInfo; model.TeamInfo = this.SelectedTeamInfo;
model.TeamLogo = this.SelectedTeamInfo.Logo;
foreach (PlayerInfoModel item in group) foreach (PlayerInfoModel item in group)
{ {
model.Players.Add(item); model.Players.Add(item);
......
...@@ -121,7 +121,7 @@ namespace VIZ.TVP.Golf.Module ...@@ -121,7 +121,7 @@ namespace VIZ.TVP.Golf.Module
foreach (PlayerInfoModel item in query) foreach (PlayerInfoModel item in query)
{ {
PlayerTempModel model = new PlayerTempModel(); PlayerTempModel model = new PlayerTempModel();
model.FromTeamInfo(item); model.FromInfoModel(item);
models.Add(model); models.Add(model);
} }
......
...@@ -135,6 +135,9 @@ ...@@ -135,6 +135,9 @@
<None Include="config\config.ini"> <None Include="config\config.ini">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<None Include="config\log.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="packages.config" /> <None Include="packages.config" />
<None Include="Properties\Settings.settings"> <None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator> <Generator>SettingsSingleFileGenerator</Generator>
...@@ -344,5 +347,25 @@ ...@@ -344,5 +347,25 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Include="images\GroupHoleInfo.jpg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<None Include="images\BeforeMatchTeamRanking.jpg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<None Include="images\AfterMatchTeamRanking.jpg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<None Include="images\ShortTeamRanking.jpg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> </Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?>
<log4net>
<appender name="errorAppender" type="log4net.Appender.RollingFileAppender">
<filter type="log4net.Filter.LevelMatchFilter">
<levelToMatch value="ERROR" />
</filter>
<filter type="log4net.Filter.DenyAllFilter" />
<file value="Logs\err.log" />
<encoding value="utf-8"/>
<preserveLogFileNameExtension value="true" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyyMMdd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
</layout>
</appender>
<appender name="infoAppender" type="log4net.Appender.RollingFileAppender">
<filter type="log4net.Filter.LevelMatchFilter">
<levelToMatch value="INFO" />
</filter>
<filter type="log4net.Filter.DenyAllFilter" />
<file value="Logs\info.log" />
<encoding value="utf-8"/>
<preserveLogFileNameExtension value="true" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyyMMdd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
</layout>
</appender>
<appender name="debugAppender" type="log4net.Appender.RollingFileAppender">
<filter type="log4net.Filter.LevelMatchFilter">
<levelToMatch value="DEBUG" />
</filter>
<filter type="log4net.Filter.DenyAllFilter" />
<file value="Logs\debug.log" />
<encoding value="utf-8"/>
<preserveLogFileNameExtension value="true" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyyMMdd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
</layout>
</appender>
<appender name="perfAppender" type="log4net.Appender.RollingFileAppender">
<filter type="log4net.Filter.LevelMatchFilter">
<levelToMatch value="INFO" />
</filter>
<filter type="log4net.Filter.DenyAllFilter" />
<file value="Logs\perf.log" />
<encoding value="utf-8"/>
<preserveLogFileNameExtension value="true" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyyMMdd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date %logger - %message%newline" />
</layout>
</appender>
<root>
<level value="ALL" />
<appender-ref ref="errorAppender" />
<appender-ref ref="infoAppender" />
<appender-ref ref="debugAppender" />
</root>
<logger name="Performance" additivity="false">
<level value="ALL" />
<appender-ref ref="perfAppender" />
</logger>
</log4net>
\ No newline at end of file

110 KB | W: | H:

46.5 KB | W: | H:

VIZ.TVP.Golf/images/BottomHoleInfo.jpg
VIZ.TVP.Golf/images/BottomHoleInfo.jpg
VIZ.TVP.Golf/images/BottomHoleInfo.jpg
VIZ.TVP.Golf/images/BottomHoleInfo.jpg
  • 2-up
  • Swipe
  • Onion skin
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