Commit f84f786d by liulongfei

排序逻辑

parent 074f0cd9
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.TVP.Golf.Domain
{
/// <summary>
/// 分组临时模型排序比较器
/// </summary>
public class GroupTempModelComparer : IComparer<GroupTempModel>
{
/// <summary>
/// 分组临时模型排序比较器
/// </summary>
/// <param name="playerRealModels">球员真实模型</param>
/// <param name="round">轮次</param>
public GroupTempModelComparer(List<PlayerRealModel> playerRealModels, int round)
{
this.PlayerRealModels = playerRealModels;
this.Round = round;
}
/// <summary>
/// 轮次
/// </summary>
public int Round { get; private set; }
/// <summary>
/// 球员真实模型
/// </summary>
public List<PlayerRealModel> PlayerRealModels { get; private set; }
/// <summary>
/// 比较
/// </summary>
public int Compare(GroupTempModel x, GroupTempModel y)
{
var real_players_X = this.PlayerRealModels.Where(p => p.TeamInfoModel == x.TeamInfo && p.PlayerInfoModel.Group == x.Group);
var real_players_Y = this.PlayerRealModels.Where(p => p.TeamInfoModel == y.TeamInfo && p.PlayerInfoModel.Group == y.Group);
// 杆数少 排名靠前
int total_x = real_players_X.Sum(p => p.Score);
int total_y = real_players_Y.Sum(p => p.Score);
if (total_x == total_y)
return 0;
else
return total_x < total_y ? -1 : 1;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.TVP.Golf.Domain
{
/// <summary>
/// 分组临时模型顶部排序比较器
/// </summary>
public class GroupTempModelTopComparer : IComparer<GroupTempModel>
{
/// <summary>
/// 分组临时模型顶部排序比较器
/// </summary>
/// <param name="playerRealModels">球员真实模型</param>
/// <param name="round">轮次</param>
public GroupTempModelTopComparer(List<PlayerRealModel> playerRealModels, int round)
{
this.PlayerRealModels = playerRealModels;
this.Round = round;
}
/// <summary>
/// 轮次
/// </summary>
public int Round { get; private set; }
/// <summary>
/// 球员真实模型
/// </summary>
public List<PlayerRealModel> PlayerRealModels { get; private set; }
/// <summary>
/// 比较
/// </summary>
public int Compare(GroupTempModel x, GroupTempModel y)
{
var real_players_X = this.PlayerRealModels.Where(p => p.TeamInfoModel == x.TeamInfo && p.PlayerInfoModel.Group == x.Group);
var real_players_Y = this.PlayerRealModels.Where(p => p.TeamInfoModel == y.TeamInfo && p.PlayerInfoModel.Group == y.Group);
// 1. 杆数少 排名靠前
int total_x = real_players_X.Sum(p => p.Score);
int total_y = real_players_Y.Sum(p => p.Score);
if (total_x != total_y)
return total_x < total_y ? -1 : 1;
// 2. 比较后9洞总成绩
int last_x = 0;
foreach (var real_player in real_players_X)
{
var real_round = real_player.Rounds.FirstOrDefault(p => p.No == this.Round);
if (real_round == null)
continue;
last_x += real_round.Scores.Skip(9).Sum(p => p.Strokes - p.Par);
}
int last_y = 0;
foreach (var real_player in real_players_Y)
{
var real_round = real_player.Rounds.FirstOrDefault(p => p.No == this.Round);
if (real_round == null)
continue;
last_y += real_round.Scores.Skip(9).Sum(p => p.Strokes - p.Par);
}
if (last_x != last_y)
return last_x < last_y ? -1 : 1;
// 3. 逐个比较第二轮每一洞成绩
for (int i = 18; i >= 1; --i)
{
int hole_result = this.CompareWithHole(x, y, 2, i);
if (hole_result != 0)
{
return hole_result;
}
}
return 0;
}
/// <summary>
/// 比较大小
/// </summary>
/// <param name="round">轮次</param>
private int CompareWithHole(GroupTempModel x, GroupTempModel y, int round, int hole)
{
var real_players_X = this.PlayerRealModels.Where(p => p.TeamInfoModel == x.TeamInfo && p.PlayerInfoModel.Group == x.Group);
var real_players_Y = this.PlayerRealModels.Where(p => p.TeamInfoModel == y.TeamInfo && p.PlayerInfoModel.Group == y.Group);
int total_x = 0;
foreach (var real_player in real_players_X)
{
RoundRealModel real_round = real_player.Rounds.FirstOrDefault(p => p.No == round);
if (real_round == null)
continue;
ScoreRealModel real_score = real_round.Scores.FirstOrDefault(p => p.Hole == hole);
if (real_score == null)
continue;
total_x += real_score.Strokes - real_score.Par;
}
int total_y = 0;
foreach (var real_player in real_players_Y)
{
RoundRealModel real_round = real_player.Rounds.FirstOrDefault(p => p.No == round);
if (real_round == null)
continue;
ScoreRealModel real_score = real_round.Scores.FirstOrDefault(p => p.Hole == hole);
if (real_score == null)
continue;
total_y += real_score.Strokes - real_score.Par;
}
if (total_x == total_y)
return 0;
else
return total_x < total_y ? -1 : 1;
}
}
}
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Routing;
namespace VIZ.TVP.Golf.Domain
{
/// <summary>
/// 队伍临时模型比较器
/// </summary>
public class TeamTempModelComparer : IComparer<TeamTempModel>
{
/// <summary>
/// 队伍临时模型比较器
/// </summary>
/// <param name="playerRealModels">球员真实模型</param>
public TeamTempModelComparer(List<PlayerRealModel> playerRealModels)
{
this.PlayerRealModels = playerRealModels;
}
/// <summary>
/// 队伍临时模型比较器
/// </summary>
/// <param name="playerRealModels">球员真实模型</param>
/// <param name="round">轮次</param>
public TeamTempModelComparer(List<PlayerRealModel> playerRealModels, int round)
{
this.PlayerRealModels = playerRealModels;
this.Round = round;
}
/// <summary>
/// 球员真实模型
/// </summary>
public List<PlayerRealModel> PlayerRealModels { get; private set; }
/// <summary>
/// 轮次
/// </summary>
public int? Round { get; private set; }
/// <summary>
/// 比较大小
/// </summary>
public int Compare(TeamTempModel x, TeamTempModel y)
{
return this.Round == null ? this.CompareAllRound(x, y) : this.CompareWithRound(x, y, this.Round.Value);
}
/// <summary>
/// 比较大小, 所有轮次
/// </summary>
/// <remarks>
/// 1. 杆数少排名靠前
/// 2. 杆数相同时则比较第二轮成绩
/// 3. 如果再次相同,则比较第二轮由18号洞往前推的每一洞
/// </remarks>
/// <returns></returns>
private int CompareAllRound(TeamTempModel x, TeamTempModel y)
{
var real_players_X = this.PlayerRealModels.Where(p => p.TeamInfoModel == x.TeamInfoModel);
var real_players_Y = this.PlayerRealModels.Where(p => p.TeamInfoModel == y.TeamInfoModel);
// 1. 杆数少排名靠前
int total_x = real_players_X.Sum(p => p.Score);
int total_y = real_players_Y.Sum(p => p.Score);
if (total_x != total_y)
{
return total_x < total_y ? -1 : 1;
}
// 2. 杆数相同时则比较第二轮成绩
int round_result = this.CompareWithRound(x, y, 2);
if (round_result != 0)
{
return total_x < total_y ? -1 : 1;
}
// 3. 逐个比较第二轮每一洞成绩
for (int i = 18; i >= 1; --i)
{
int hole_result = this.CompareWithHole(x, y, 2, i);
if (hole_result != 0)
{
return hole_result;
}
}
return 0;
}
/// <summary>
/// 比较大小
/// </summary>
/// <param name="round">轮次</param>
private int CompareWithRound(TeamTempModel x, TeamTempModel y, int round)
{
var real_players_X = this.PlayerRealModels.Where(p => p.TeamInfoModel == x.TeamInfoModel);
var real_players_Y = this.PlayerRealModels.Where(p => p.TeamInfoModel == y.TeamInfoModel);
int total_x = 0;
foreach (var real_player in real_players_X)
{
RoundRealModel real_round = real_player.Rounds.FirstOrDefault(p => p.No == round);
if (real_round != null)
{
total_x += real_round.Today;
}
}
int total_y = 0;
foreach (var real_player in real_players_Y)
{
RoundRealModel real_round = real_player.Rounds.FirstOrDefault(p => p.No == round);
if (real_round != null)
{
total_y += real_round.Today;
}
}
if (total_x == total_y)
return 0;
else return total_x < total_y ? -1 : 1;
}
/// <summary>
/// 比较大小
/// </summary>
/// <param name="round">轮次</param>
private int CompareWithHole(TeamTempModel x, TeamTempModel y, int round, int hole)
{
var real_players_X = this.PlayerRealModels.Where(p => p.TeamInfoModel == x.TeamInfoModel);
var real_players_Y = this.PlayerRealModels.Where(p => p.TeamInfoModel == y.TeamInfoModel);
int total_x = 0;
foreach (var real_player in real_players_X)
{
RoundRealModel real_round = real_player.Rounds.FirstOrDefault(p => p.No == round);
if (real_round == null)
continue;
ScoreRealModel real_score = real_round.Scores.FirstOrDefault(p => p.Hole == hole);
if (real_score == null)
continue;
total_x += real_score.Strokes - real_score.Par;
}
int total_y = 0;
foreach (var real_player in real_players_Y)
{
RoundRealModel real_round = real_player.Rounds.FirstOrDefault(p => p.No == round);
if (real_round == null)
continue;
ScoreRealModel real_score = real_round.Scores.FirstOrDefault(p => p.Hole == hole);
if (real_score == null)
continue;
total_y += real_score.Strokes - real_score.Par;
}
if (total_x == total_y)
return 0;
else
return total_x < total_y ? -1 : 1;
}
}
}
......@@ -98,15 +98,5 @@ namespace VIZ.TVP.Golf.Domain
/// 长版小组排名
/// </summary>
public const string LongGroupRanking = "LongGroupRanking";
/// <summary>
/// 人名条
/// </summary>
public const string NameBarView = "NameBarView";
/// <summary>
/// 底部人名条
/// </summary>
public const string NameBarBottomView = "NameBarBottomView";
}
}
......@@ -97,16 +97,16 @@ namespace VIZ.TVP.Golf.Domain
#endregion
#region PlayersStrokes -- 总杆数
#region PlayersScore -- 总得分
private string playersStrokes;
private string playersScore;
/// <summary>
/// 总杆数
/// </summary>
public string PlayersStrokes
public string PlayersScore
{
get { return playersStrokes; }
set { playersStrokes = value; this.RaisePropertyChanged(nameof(PlayersStrokes)); }
get { return playersScore; }
set { playersScore = value; this.RaisePropertyChanged(nameof(PlayersScore)); }
}
#endregion
......
......@@ -68,16 +68,16 @@ namespace VIZ.TVP.Golf.Domain
#endregion
#region Strokes -- 总杆数
#region Score -- 得分
private int strokes;
private int score;
/// <summary>
/// 总杆数
/// 得分
/// </summary>
public int Strokes
public int Score
{
get { return strokes; }
set { strokes = value; this.RaisePropertyChanged(nameof(Strokes)); }
get { return score; }
set { score = value; this.RaisePropertyChanged(nameof(Score)); }
}
#endregion
......
......@@ -82,16 +82,30 @@ namespace VIZ.TVP.Golf.Domain
#endregion
#region TotalStrokes -- 总杆数
#region TotalScoreValue -- 总得分值
private string totalStrokes;
private int totalScoreValue;
/// <summary>
/// 总得分值
/// </summary>
public int TotalScoreValue
{
get { return totalScoreValue; }
set { totalScoreValue = value; this.RaisePropertyChanged(nameof(TotalScoreValue)); }
}
#endregion
#region TotalScore -- 总得分
private string totalScore;
/// <summary>
/// 总杆数
/// </summary>
public string TotalStrokes
public string TotalScore
{
get { return totalStrokes; }
set { totalStrokes = value; this.RaisePropertyChanged(nameof(TotalStrokes)); }
get { return totalScore; }
set { totalScore = value; this.RaisePropertyChanged(nameof(TotalScore)); }
}
#endregion
......
......@@ -65,6 +65,9 @@
</ItemGroup>
<ItemGroup>
<Compile Include="ApplicationDomainEx.cs" />
<Compile Include="Comparer\GroupTempModelTopComparer.cs" />
<Compile Include="Comparer\GroupTempModelComparer.cs" />
<Compile Include="Comparer\TeamTempModelComparer.cs" />
<Compile Include="Enum\ViewKeys.cs" />
<Compile Include="Model\EntityModel\HoleInfoModel.cs" />
<Compile Include="Model\EntityModel\PlayerInfoModel.cs" />
......
......@@ -64,8 +64,10 @@
Content="分组洞信息版"></RadioButton>
<RadioButton x:Name="rb_BottomHoleInfo" GroupName="MAIN" Style="{StaticResource RadioButton_MainView}"
Content="底部洞信息版"></RadioButton>
<!-- 队伍排名 -->
<Rectangle Height="1" Fill="#44000000" Margin="0,5,0,5"></Rectangle>
<RadioButton x:Name="rb_BeforeMatchTeamRanking" GroupName="MAIN" Style="{StaticResource RadioButton_MainView}"
Content="赛前队伍排名"></RadioButton>
<RadioButton x:Name="rb_AfterMatchTeamRanking" GroupName="MAIN" Style="{StaticResource RadioButton_MainView}"
......@@ -74,7 +76,10 @@
Content="短版队伍排名"></RadioButton>
<RadioButton x:Name="rb_LongTeamRanking" GroupName="MAIN" Style="{StaticResource RadioButton_MainView}"
Content="长版队伍排名"></RadioButton>
<!-- 小组排名 -->
<Rectangle Height="1" Fill="#44000000" Margin="0,5,0,5"></Rectangle>
<RadioButton x:Name="rb_BeforeMatchGroupRanking" GroupName="MAIN" Style="{StaticResource RadioButton_MainView}"
Content="赛前分组排名"></RadioButton>
<RadioButton x:Name="rb_AfterMatchGroupRanking" GroupName="MAIN" Style="{StaticResource RadioButton_MainView}"
......
......@@ -32,13 +32,7 @@
<!-- 版子操作 -->
<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>
<!-- 版子信息 -->
......
......@@ -48,20 +48,13 @@
<Border Grid.Row="1" Padding="5" BorderBrush="#44000000" BorderThickness="1" Margin="5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="220"></RowDefinition>
<RowDefinition Height="80"></RowDefinition>
<RowDefinition Height="220"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="80"></RowDefinition>
</Grid.RowDefinitions>
<!-- 组信息 -->
<GroupBox Padding="10">
<GroupBox.Header>
<TextBlock Text="组信息" FontSize="18" FontWeight="Bold"></TextBlock>
</GroupBox.Header>
<local:GroupPickerPanelNoPlayer DataContext="{Binding Path=GroupPickerPanelModel}" Margin="5"></local:GroupPickerPanelNoPlayer>
</GroupBox>
<!-- 轮次 -->
<GroupBox Padding="10" Grid.Row="1">
<GroupBox Padding="10" Grid.Row="0">
<GroupBox.Header>
<TextBlock Text="轮次信息" FontSize="18" FontWeight="Bold"></TextBlock>
</GroupBox.Header>
......@@ -79,6 +72,13 @@
</StackPanel>
</Grid>
</GroupBox>
<!-- 组信息 -->
<GroupBox Padding="10" Grid.Row="1">
<GroupBox.Header>
<TextBlock Text="组信息" FontSize="18" FontWeight="Bold"></TextBlock>
</GroupBox.Header>
<local:GroupPickerPanelNoPlayer DataContext="{Binding Path=GroupPickerPanelModel}" Margin="5"></local:GroupPickerPanelNoPlayer>
</GroupBox>
<!-- 洞得分信息 -->
<GroupBox Padding="10" Grid.Row="2">
<GroupBox.Header>
......@@ -114,12 +114,12 @@
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<!-- 前18洞 -->
<!-- 前9洞 -->
<fcommon:LabelValue Style="{StaticResource LabelValue_Default}" LabelWidth="60"
Label="前18洞:" Text="{Binding Path=First18HoleStrokes,Mode=TwoWay}"></fcommon:LabelValue>
<!-- 后18洞 -->
Label="前9洞:" Text="{Binding Path=FirstHoleStrokes,Mode=TwoWay}"></fcommon:LabelValue>
<!-- 后9洞 -->
<fcommon:LabelValue Style="{StaticResource LabelValue_Default}" LabelWidth="60"
Label="后18洞:" Text="{Binding Path=Secend18HoleStrokes,Mode=TwoWay}" Grid.Column="1"></fcommon:LabelValue>
Label="后9洞:" Text="{Binding Path=SecendHoleStrokes,Mode=TwoWay}" Grid.Column="1"></fcommon:LabelValue>
<!-- 总计 -->
<fcommon:LabelValue Style="{StaticResource LabelValue_Default}" LabelWidth="60"
Label="总计:" Text="{Binding Path=TotalHoleStrokes,Mode=TwoWay}" Grid.Column="2"></fcommon:LabelValue>
......
......@@ -34,6 +34,11 @@ namespace VIZ.TVP.Golf.Module
// Field
// ===================================================================================
/// <summary>
/// 上下半场每场洞数
/// </summary>
public const int FIRST_SECEND_HOLE_COUNT = 9;
// ===================================================================================
// Property
// ===================================================================================
......@@ -80,30 +85,30 @@ namespace VIZ.TVP.Golf.Module
#endregion
#region First18HoleStrokes -- 18洞总杆数
#region FirstHoleStrokes -- 上半洞总杆数
private string first18HoleStrokes;
private string firstHoleStrokes;
/// <summary>
/// 前18洞总杆数
/// </summary>
public string First18HoleStrokes
public string FirstHoleStrokes
{
get { return first18HoleStrokes; }
set { first18HoleStrokes = value; this.RaisePropertyChanged(nameof(First18HoleStrokes)); }
get { return firstHoleStrokes; }
set { firstHoleStrokes = value; this.RaisePropertyChanged(nameof(FirstHoleStrokes)); }
}
#endregion
#region Secend18HoleStrokes -- 18洞中杆数
#region SecendHoleStrokes -- 下半洞总杆数
private string secend18HoleStrokes;
private string secendHoleStrokes;
/// <summary>
/// 后18洞中杆数
/// </summary>
public string Secend18HoleStrokes
public string SecendHoleStrokes
{
get { return secend18HoleStrokes; }
set { secend18HoleStrokes = value; this.RaisePropertyChanged(nameof(Secend18HoleStrokes)); }
get { return secendHoleStrokes; }
set { secendHoleStrokes = value; this.RaisePropertyChanged(nameof(SecendHoleStrokes)); }
}
#endregion
......@@ -205,19 +210,19 @@ namespace VIZ.TVP.Golf.Module
{
if (this.GroupHoleTempModels == null || this.GroupHoleTempModels.Count == 0)
{
this.First18HoleStrokes = null;
this.Secend18HoleStrokes = null;
this.FirstHoleStrokes = null;
this.SecendHoleStrokes = 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));
int first = this.GroupHoleTempModels.Take(FIRST_SECEND_HOLE_COUNT).Sum(p => ValueHelper.ConvertValue<int>(p.TotalStrokes));
int secend = this.GroupHoleTempModels.Skip(FIRST_SECEND_HOLE_COUNT).Take(FIRST_SECEND_HOLE_COUNT).Sum(p => ValueHelper.ConvertValue<int>(p.TotalStrokes));
this.First18HoleStrokes = first18.ToString();
this.Secend18HoleStrokes = secend18.ToString();
this.TotalHoleStrokes = (first18 + secend18).ToString();
this.FirstHoleStrokes = first.ToString();
this.SecendHoleStrokes = secend.ToString();
this.TotalHoleStrokes = (first + secend).ToString();
}
#endregion
......@@ -232,10 +237,18 @@ namespace VIZ.TVP.Golf.Module
/// <param name="list">真实球员模型</param>
private void UpdateGroupHoleTempModels(List<PlayerRealModel> list)
{
var players = ApplicationDomainEx.PlayerInfos.Where(p => p.Group == this.GroupPickerPanelModel.SelectedGroupInfo.Group);
var players = ApplicationDomainEx.PlayerInfos.Where(p => p.Group == this.GroupPickerPanelModel.SelectedGroupInfo.Group && p.TeamID == this.GroupPickerPanelModel.SelectedGroupInfo.TeamInfo.TeamID);
ObservableCollection<GroupHoleTempModel> groupHoleTempModels = new ObservableCollection<GroupHoleTempModel>();
if (this.SelectedRound == 0)
{
this.GroupHoleTempModels = groupHoleTempModels;
// 统计
this.Summary();
return;
}
foreach (HoleInfoModel holeInfo in ApplicationDomainEx.HoleInfos)
{
GroupHoleTempModel model = new GroupHoleTempModel();
......@@ -243,7 +256,6 @@ namespace VIZ.TVP.Golf.Module
model.Par = holeInfo.Par;
int total = 0;
foreach (PlayerInfoModel player in players)
{
PlayerRealModel player_real = list.FirstOrDefault(p => p.PlayerID == player.PlayerID);
......@@ -254,8 +266,12 @@ namespace VIZ.TVP.Golf.Module
if (round_real == null)
continue;
total += round_real.Today;
model.TotalStrokesDetail += $"{player.Name}: {round_real.Today} | ";
ScoreRealModel score_real = round_real.Scores.FirstOrDefault(p => p.Hole == holeInfo.HoleID);
if (score_real == null)
continue;
total += score_real.Strokes;
model.TotalStrokesDetail += $"{player.Name}: {score_real.Strokes} | ";
}
model.TotalStrokes = total.ToString();
......@@ -267,6 +283,10 @@ namespace VIZ.TVP.Golf.Module
// 统计
this.Summary();
// 更新其他信息
this.GroupPickerPanelModel.UpdatePlayersProperty();
}
}
}
......@@ -44,15 +44,34 @@
</Border>
<!-- 版子信息 -->
<Border Grid.Row="1" Padding="5" BorderBrush="#44000000" BorderThickness="1" Margin="5">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="80"></RowDefinition>
<RowDefinition Height="80"></RowDefinition>
<RowDefinition Height="220"></RowDefinition>
<RowDefinition Height="220"></RowDefinition>
</Grid.RowDefinitions>
<!-- 队伍1 -->
<GroupBox Padding="10">
<!-- 轮次 -->
<GroupBox Padding="10" Grid.Row="0">
<GroupBox.Header>
<TextBlock Text="轮次信息" FontSize="18" FontWeight="Bold"></TextBlock>
</GroupBox.Header>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="60"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Text="轮次:" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,5,0" Grid.Row="1"></TextBlock>
<StackPanel Grid.Column="1" Margin="5,0,10,0" HorizontalAlignment="Left" Orientation="Horizontal">
<ComboBox Height="30" Width="240" 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>
......@@ -75,20 +94,21 @@
</StackPanel>
</Grid>
</GroupBox>
<GroupBox Grid.Row="1" Padding="10">
<!-- 分组1 -->
<GroupBox Grid.Row="2" Padding="10">
<GroupBox.Header>
<TextBlock Text="分组1" FontSize="18" FontWeight="Bold"></TextBlock>
</GroupBox.Header>
<local:GroupPickerPanelNoPlayer DataContext="{Binding GroupPickerPanelModel1}"></local:GroupPickerPanelNoPlayer>
</GroupBox>
<GroupBox Grid.Row="2" Padding="10">
<!-- 分组2 -->
<GroupBox Grid.Row="3" Padding="10">
<GroupBox.Header>
<TextBlock Text="分组2" FontSize="18" FontWeight="Bold"></TextBlock>
</GroupBox.Header>
<local:GroupPickerPanelNoPlayer DataContext="{Binding GroupPickerPanelModel2}"></local:GroupPickerPanelNoPlayer>
</GroupBox>
</Grid>
</ScrollViewer>
</Border>
<!-- 示意图 -->
<Border Grid.Row="1" Grid.Column="1" Grid.RowSpan="2" Padding="5" BorderBrush="#44000000" BorderThickness="1" Margin="5">
......
......@@ -32,6 +32,20 @@ namespace VIZ.TVP.Golf.Module
// Property
// ===================================================================================
#region SelectedRound -- 选中的轮次
private int selectedRound;
/// <summary>
/// 选中的轮次
/// </summary>
public int SelectedRound
{
get { return selectedRound; }
set { selectedRound = value; this.RaisePropertyChanged(nameof(SelectedRound)); }
}
#endregion
#region Group -- 分组
private string group;
......@@ -113,11 +127,13 @@ namespace VIZ.TVP.Golf.Module
List<PlayerRealModel> list = this.realDataService.LoadPlayerRealModelFormLocal(vm.SelectedFile.FileName);
this.UpdatePlayerTempModel(this.GroupPickerPanelModel1?.Player1, list);
this.UpdatePlayerTempModel(this.GroupPickerPanelModel1?.Player2, list);
this.UpdatePlayerTempModel(this.GroupPickerPanelModel1?.Player1, this.SelectedRound, list);
this.UpdatePlayerTempModel(this.GroupPickerPanelModel1?.Player2, this.SelectedRound, list);
this.GroupPickerPanelModel1.UpdatePlayersProperty();
this.UpdatePlayerTempModel(this.GroupPickerPanelModel2?.Player1, list);
this.UpdatePlayerTempModel(this.GroupPickerPanelModel2?.Player2, list);
this.UpdatePlayerTempModel(this.GroupPickerPanelModel2?.Player1, this.SelectedRound, list);
this.UpdatePlayerTempModel(this.GroupPickerPanelModel2?.Player2, this.SelectedRound, list);
this.GroupPickerPanelModel2.UpdatePlayersProperty();
}
#endregion
......@@ -144,11 +160,11 @@ namespace VIZ.TVP.Golf.Module
{
List<PlayerRealModel> list = this.realDataService.LoadPlayerRealModelFormLocal(fileName);
this.UpdatePlayerTempModel(this.GroupPickerPanelModel1?.Player1, list);
this.UpdatePlayerTempModel(this.GroupPickerPanelModel1?.Player2, list);
this.UpdatePlayerTempModel(this.GroupPickerPanelModel1?.Player1, this.SelectedRound, list);
this.UpdatePlayerTempModel(this.GroupPickerPanelModel1?.Player2, this.SelectedRound, list);
this.UpdatePlayerTempModel(this.GroupPickerPanelModel2?.Player1, list);
this.UpdatePlayerTempModel(this.GroupPickerPanelModel2?.Player2, list);
this.UpdatePlayerTempModel(this.GroupPickerPanelModel2?.Player1, this.SelectedRound, list);
this.UpdatePlayerTempModel(this.GroupPickerPanelModel2?.Player2, this.SelectedRound, list);
});
});
}
......
......@@ -142,7 +142,7 @@ namespace VIZ.TVP.Golf.Module
}
temp_model.PlayersDisplayName = string.Join(" / ", temp_model.Players.Select(p => p.Name));
List<int> player_ids = temp_model.Players.Select(p => p.PlayerID).ToList();
temp_model.PlayersStrokes = list.Where(p => player_ids.Contains(p.PlayerID)).Sum(p => p.Strokes).ToString();
temp_model.PlayersScore = list.Where(p => player_ids.Contains(p.PlayerID)).Sum(p => p.Score).ToString();
temp_model.TeamLogo = ApplicationDomainEx.TeamInfos.FirstOrDefault(p => p.TeamID == team_group.Key)?.Logo;
groupTempModels.Add(temp_model);
......
<UserControl x:Class="VIZ.TVP.Golf.Module.NameBarBottomView"
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"
d:Background="White"
d:DataContext="{d:DesignInstance Type=local:NameBarBottomViewModel}"
mc:Ignorable="d"
d:DesignHeight="800" d:DesignWidth="1600">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/VIZ.TVP.Golf.Module.Resource;component/Style/IconButton/IconButton_Default.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
<core:String2ImageSourceConverter x:Key="String2ImageSourceConverter_team" Type="Relative" WorkPath="picture/team"></core:String2ImageSourceConverter>
<core:String2ImageSourceConverter x:Key="String2ImageSourceConverter_player" Type="Relative" WorkPath="picture/player"></core:String2ImageSourceConverter>
</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="220"></RowDefinition>
</Grid.RowDefinitions>
<!-- 组信息 -->
<GroupBox Padding="10">
<GroupBox.Header>
<TextBlock Text="组信息" FontSize="18" FontWeight="Bold"></TextBlock>
</GroupBox.Header>
<local:GroupPickerPanelNoPlayer DataContext="{Binding Path=GroupPickerPanelModel}" Margin="5"></local:GroupPickerPanelNoPlayer>
</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/NameBarBottom.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>
/// NameBarBottomView.xaml 的交互逻辑
/// </summary>
public partial class NameBarBottomView : UserControl
{
public NameBarBottomView()
{
InitializeComponent();
WPFHelper.BindingViewModel(this, new NameBarBottomViewModel());
}
}
}
<UserControl x:Class="VIZ.TVP.Golf.Module.NameBarView"
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"
d:Background="White"
d:DataContext="{d:DesignInstance Type=local:NameBarViewModel}"
mc:Ignorable="d"
d:DesignHeight="800" d:DesignWidth="1600">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/VIZ.TVP.Golf.Module.Resource;component/Style/IconButton/IconButton_Default.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
<core:String2ImageSourceConverter x:Key="String2ImageSourceConverter_team" Type="Relative" WorkPath="picture/team"></core:String2ImageSourceConverter>
<core:String2ImageSourceConverter x:Key="String2ImageSourceConverter_player" Type="Relative" WorkPath="picture/player"></core:String2ImageSourceConverter>
</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="220"></RowDefinition>
<RowDefinition Height="170"></RowDefinition>
<RowDefinition Height="100"></RowDefinition>
</Grid.RowDefinitions>
<!-- 组信息 -->
<GroupBox Padding="10">
<GroupBox.Header>
<TextBlock Text="组信息" FontSize="18" FontWeight="Bold"></TextBlock>
</GroupBox.Header>
<local:GroupPickerPanelNoPlayer DataContext="{Binding Path=GroupPickerPanelModel}" Margin="5"></local:GroupPickerPanelNoPlayer>
</GroupBox>
<!-- 洞信息 -->
<GroupBox Grid.Row="1" Padding="10">
<GroupBox.Header>
<TextBlock Text="洞信息" FontSize="18" FontWeight="Bold"></TextBlock>
</GroupBox.Header>
<local:HolePickerPanelNoPicture DataContext="{Binding Path=HolePickerPanelNoPictureModel}" Grid.Row="1"></local:HolePickerPanelNoPicture>
</GroupBox>
<!-- 其他信息 -->
<GroupBox Grid.Row="2" Padding="10">
<GroupBox.Header>
<TextBlock Text="其他信息" FontSize="18" FontWeight="Bold"></TextBlock>
</GroupBox.Header>
<local:DetailPanel DataContext="{Binding DetailPanelModel}"></local:DetailPanel>
</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/NameBar1.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>
/// NameBarView.xaml 的交互逻辑
/// </summary>
public partial class NameBarView : UserControl
{
public NameBarView()
{
InitializeComponent();
WPFHelper.BindingViewModel(this, new NameBarViewModel());
}
}
}
using System;
using System.Collections.Generic;
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 NameBarBottomViewModel : PackageViewModelBase
{
// ===================================================================================
// Property
// ===================================================================================
#region GroupPickerPanelModel -- 分组选择模型
private GroupPickerPanelModel groupPickerPanelModel = new GroupPickerPanelModel();
/// <summary>
/// 分组选择模型
/// </summary>
public GroupPickerPanelModel GroupPickerPanelModel
{
get { return groupPickerPanelModel; }
set { groupPickerPanelModel = value; this.RaisePropertyChanged(nameof(GroupPickerPanelModel)); }
}
#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.UpdatePlayerTempModel(this.GroupPickerPanelModel?.Player1, list);
this.UpdatePlayerTempModel(this.GroupPickerPanelModel?.Player2, 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.UpdatePlayerTempModel(this.GroupPickerPanelModel?.Player1, list);
this.UpdatePlayerTempModel(this.GroupPickerPanelModel?.Player2, list);
});
});
}
#endregion
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using VIZ.Framework.Core;
using VIZ.TVP.Golf.Domain;
using VIZ.TVP.Golf.Service;
namespace VIZ.TVP.Golf.Module
{
/// <summary>
/// 包装视图模型 -- 人名条
/// </summary>
public class NameBarViewModel : PackageViewModelBase
{
public NameBarViewModel()
{
}
// ===================================================================================
// Property
// ===================================================================================
#region GroupPickerPanelModel -- 分组选择模型
private GroupPickerPanelModel groupPickerPanelModel = new GroupPickerPanelModel();
/// <summary>
/// 分组选择模型
/// </summary>
public GroupPickerPanelModel GroupPickerPanelModel
{
get { return groupPickerPanelModel; }
set { groupPickerPanelModel = value; this.RaisePropertyChanged(nameof(GroupPickerPanelModel)); }
}
#endregion
#region HolePickerPanelNoPictureModel -- 洞选择模型
private HolePickerPanelNoPictureModel holePickerPanelNoPictureModel = new HolePickerPanelNoPictureModel();
/// <summary>
/// 洞选择模型
/// </summary>
public HolePickerPanelNoPictureModel HolePickerPanelNoPictureModel
{
get { return holePickerPanelNoPictureModel; }
set { holePickerPanelNoPictureModel = value; this.RaisePropertyChanged(nameof(HolePickerPanelNoPictureModel)); }
}
#endregion
#region DetailPanelModel -- 描述面板模型
private DetailPanelModel detailPanelModel = new DetailPanelModel();
/// <summary>
/// 描述面板模型
/// </summary>
public DetailPanelModel DetailPanelModel
{
get { return detailPanelModel; }
set { detailPanelModel = value; this.RaisePropertyChanged(nameof(DetailPanelModel)); }
}
#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.UpdatePlayerTempModel(this.GroupPickerPanelModel?.Player1, list);
this.UpdatePlayerTempModel(this.GroupPickerPanelModel?.Player2, 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.UpdatePlayerTempModel(this.GroupPickerPanelModel?.Player1, list);
this.UpdatePlayerTempModel(this.GroupPickerPanelModel?.Player2, list);
});
});
}
#endregion
}
}
......@@ -137,18 +137,32 @@ namespace VIZ.TVP.Golf.Module
/// 更新球员临时数据
/// </summary>
/// <param name="tempModel">临时模型</param>
/// <param name="round">轮次</param>
/// <param name="realModels">实时模型集合</param>
protected void UpdatePlayerTempModel(PlayerTempModel tempModel, List<PlayerRealModel> realModels)
protected void UpdatePlayerTempModel(PlayerTempModel tempModel, int round, List<PlayerRealModel> realModels)
{
if (tempModel == null || realModels == null || tempModel.PlayerID <= 0 || realModels.Count == 0)
return;
PlayerRealModel realModel = realModels.FirstOrDefault(p => p.PlayerID == tempModel.PlayerID);
if (realModel == null)
return;
if (realModel != null)
{
tempModel.Strokes = realModel.Strokes;
RoundRealModel roundModel = realModel.Rounds.FirstOrDefault(p => p.No == round);
if (roundModel == null)
return;
tempModel.Score = roundModel.Today;
}
/// <summary>
/// 获取得分字符串
/// </summary>
/// <param name="score">得分</param>
/// <returns>得分字符串</returns>
protected string GetScoreString(int score)
{
return score == 0 ? "E" : (score > 0 ? $"+{score}" : $"-{score}");
}
}
}
......@@ -47,28 +47,8 @@
<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">
......@@ -86,8 +66,8 @@
ItemsSource="{Binding Path=TeamTempModels}">
<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>
<DataGridTextColumn Header="队伍名称" Width="200" Binding="{Binding Path=Name}"></DataGridTextColumn>
<DataGridTextColumn Header="得分" Width="100" Binding="{Binding Path=TotalScore}"></DataGridTextColumn>
<DataGridComboBoxColumn x:Name="c1" Header="Logo" Width="240"
ItemsSource="{Binding Source={x:Static domain:TvpStaticResource.TeamLogos}}"
SelectedValueBinding="{Binding Path=Logo}"></DataGridComboBoxColumn>
......
......@@ -34,5 +34,31 @@ namespace VIZ.TVP.Golf.Module
// Private Function
// ===================================================================================
/// <summary>
/// 更新队伍临时模型
/// </summary>
/// <param name="list">球员真实模型</param>
protected override void UpdateTeamTempModels(List<PlayerRealModel> list)
{
List<TeamTempModel> teamTempModels = new List<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();
int total = real_players.Sum(p => p.Score);
temp_model.TotalScore = this.GetScoreString(total);
teamTempModels.Add(temp_model);
}
// 赛后比较所有的轮次
TeamTempModelComparer comparer = new TeamTempModelComparer(list);
teamTempModels.Sort(comparer);
this.TeamTempModels = teamTempModels.ToObservableCollection();
}
}
}
......@@ -47,29 +47,8 @@
<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>
......@@ -86,8 +65,8 @@
ItemsSource="{Binding Path=TeamTempModels}">
<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>
<DataGridTextColumn Header="队伍名称" Width="200" Binding="{Binding Path=Name}"></DataGridTextColumn>
<DataGridTextColumn Header="得分" Width="100" Binding="{Binding Path=TotalScore}"></DataGridTextColumn>
<DataGridComboBoxColumn x:Name="c1" Header="Logo" Width="240"
ItemsSource="{Binding Source={x:Static domain:TvpStaticResource.TeamLogos}}"
SelectedValueBinding="{Binding Path=Logo}"></DataGridComboBoxColumn>
......
......@@ -34,5 +34,40 @@ namespace VIZ.TVP.Golf.Module
// Private Function
// ===================================================================================
/// <summary>
/// 更新队伍临时模型
/// </summary>
/// <param name="list">球员真实模型</param>
protected override void UpdateTeamTempModels(List<PlayerRealModel> list)
{
List<TeamTempModel> teamTempModels = new List<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();
int total = 0;
foreach (PlayerRealModel real_player in real_players)
{
RoundRealModel real_round = real_player.Rounds.FirstOrDefault(p => p.No == 1);
if (real_round == null)
continue;
total += real_round.Today;
}
temp_model.TotalScore = this.GetScoreString(total);
teamTempModels.Add(temp_model);
}
// 赛前比较第一轮
TeamTempModelComparer comparer = new TeamTempModelComparer(list, 1);
teamTempModels.Sort(comparer);
this.TeamTempModels = teamTempModels.ToObservableCollection();
}
}
}
......@@ -86,9 +86,9 @@
ItemsSource="{Binding Path=TeamTempModels}">
<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"
<DataGridTextColumn Header="队伍名称" Width="200" Binding="{Binding Path=Name}"></DataGridTextColumn>
<DataGridTextColumn Header="得分" Width="100" Binding="{Binding Path=TotalScore}"></DataGridTextColumn>
<DataGridComboBoxColumn Header="Logo" Width="240"
ItemsSource="{Binding Source={x:Static domain:TvpStaticResource.TeamLogos}}"
SelectedValueBinding="{Binding Path=Logo}"></DataGridComboBoxColumn>
</DataGrid.Columns>
......
......@@ -86,8 +86,8 @@
ItemsSource="{Binding Path=TeamTempModels}">
<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>
<DataGridTextColumn Header="队伍名称" Width="200" Binding="{Binding Path=Name}"></DataGridTextColumn>
<DataGridTextColumn Header="得分" Width="100" Binding="{Binding Path=TotalScore}"></DataGridTextColumn>
<DataGridComboBoxColumn x:Name="c1" Header="Logo" Width="240"
ItemsSource="{Binding Source={x:Static domain:TvpStaticResource.TeamLogos}}"
SelectedValueBinding="{Binding Path=Logo}"></DataGridComboBoxColumn>
......
......@@ -34,13 +34,12 @@ namespace VIZ.TVP.Golf.Module
// ===================================================================================
/// <summary>
/// 更新临时模型
/// 更新队伍临时模型
/// </summary>
/// <param name="list">球员真实模型</param>
protected void UpdateGroupTempModels(List<PlayerRealModel> list)
protected override void UpdateTeamTempModels(List<PlayerRealModel> list)
{
ObservableCollection<TeamTempModel> teamTempModels = new ObservableCollection<TeamTempModel>();
List<TeamTempModel> temp_list = new List<TeamTempModel>();
List<TeamTempModel> teamTempModels = new List<TeamTempModel>();
foreach (TeamInfoModel info_model in ApplicationDomainEx.TeamInfos)
{
......@@ -49,17 +48,24 @@ namespace VIZ.TVP.Golf.Module
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();
temp_list.Add(temp_model);
int total = 0;
foreach (PlayerRealModel real_player in real_players)
{
RoundRealModel real_round = real_player.Rounds.FirstOrDefault(p => p.No == this.SelectedRound);
if (real_round == null)
continue;
total += real_round.Today;
}
temp_list = temp_list.Take(5).ToList();
foreach (TeamTempModel temp in temp_list)
{
teamTempModels.Add(temp);
temp_model.TotalScore = this.GetScoreString(total);
teamTempModels.Add(temp_model);
}
this.TeamTempModels = teamTempModels;
TeamTempModelComparer comparer = new TeamTempModelComparer(list, this.SelectedRound);
teamTempModels.Sort(comparer);
this.TeamTempModels = teamTempModels.Take(5).ToObservableCollection();
}
}
}
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
......@@ -127,7 +128,7 @@ namespace VIZ.TVP.Golf.Module
/// <param name="list">球员真实模型</param>
protected virtual void UpdateTeamTempModels(List<PlayerRealModel> list)
{
ObservableCollection<TeamTempModel> teamTempModels = new ObservableCollection<TeamTempModel>();
List<TeamTempModel> teamTempModels = new List<TeamTempModel>();
foreach (TeamInfoModel info_model in ApplicationDomainEx.TeamInfos)
{
......@@ -136,11 +137,24 @@ namespace VIZ.TVP.Golf.Module
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();
int total = 0;
foreach (PlayerRealModel real_player in real_players)
{
RoundRealModel real_round = real_player.Rounds.FirstOrDefault(p => p.No == this.SelectedRound);
if (real_round == null)
continue;
total += real_round.Today;
}
temp_model.TotalScore = this.GetScoreString(total);
teamTempModels.Add(temp_model);
}
this.TeamTempModels = teamTempModels;
TeamTempModelComparer comparer = new TeamTempModelComparer(list, this.SelectedRound);
teamTempModels.Sort(comparer);
this.TeamTempModels = teamTempModels.ToObservableCollection();
}
}
}
\ No newline at end of file
......@@ -137,18 +137,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Package\NameBar\View\NameBarBottomView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Widgets\Detail\DetailPanel.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Package\NameBar\View\NameBarView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Widgets\Group\GroupPickerPanelNoPlayer.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
......@@ -264,18 +256,10 @@
<Compile Include="Package\TeamInfo\View\TeamInfoView.xaml.cs">
<DependentUpon>TeamInfoView.xaml</DependentUpon>
</Compile>
<Compile Include="Package\NameBar\ViewModel\NameBarBottomViewModel.cs" />
<Compile Include="Package\NameBar\View\NameBarBottomView.xaml.cs">
<DependentUpon>NameBarBottomView.xaml</DependentUpon>
</Compile>
<Compile Include="Package\TeamRanking\TeamRankingViewModelBase.cs" />
<Compile Include="Widgets\Detail\DetailPanel.xaml.cs">
<DependentUpon>DetailPanel.xaml</DependentUpon>
</Compile>
<Compile Include="Package\NameBar\ViewModel\NameBarViewModel.cs" />
<Compile Include="Package\NameBar\View\NameBarView.xaml.cs">
<DependentUpon>NameBarView.xaml</DependentUpon>
</Compile>
<Compile Include="Setup\Provider\Setup\AppSetup_ClearLocalData.cs" />
<Compile Include="Widgets\Detail\DetailPanelModel.cs" />
<Compile Include="Widgets\Group\GroupPickerPanelNoPlayer.xaml.cs">
......
......@@ -11,7 +11,7 @@
d:Background="White"
d:DataContext="{d:DesignInstance Type=local:GroupPickerPanelModel}"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="700">
d:DesignHeight="300" d:DesignWidth="1000">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
......@@ -80,13 +80,13 @@
Margin="0,0,5,0"></TextBlock>
<TextBox Grid.Row="0" Grid.Column="1" Height="30" AcceptsReturn="False" TextWrapping="NoWrap" Padding="3"
Text="{Binding Player1.Name,Mode=TwoWay}" VerticalContentAlignment="Center"></TextBox>
<!-- 杆数 -->
<!-- 得分 -->
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Right" Grid.Row="1" Grid.Column="0" Margin="0,0,5,0" Orientation="Horizontal">
<Image Width="16" Height="16" Source="/VIZ.TVP.Golf.Module.Resource;component/Icons/refresh_16x16.png" Margin="0,0,5,0"></Image>
<TextBlock Text="杆数:" ></TextBlock>
<TextBlock Text="得分:" ></TextBlock>
</StackPanel>
<TextBox Grid.Row="1" Grid.Column="1" Height="30" AcceptsReturn="False" TextWrapping="NoWrap" Padding="3"
Text="{Binding Player1.Strokes,Mode=TwoWay}" VerticalContentAlignment="Center"></TextBox>
Text="{Binding Player1.Score,Mode=TwoWay}" VerticalContentAlignment="Center"></TextBox>
<!-- 照片 -->
<TextBlock Text="照片:" VerticalAlignment="Center" HorizontalAlignment="Right" Grid.Row="2" Grid.Column="0"
Margin="0,0,5,0"></TextBlock>
......@@ -117,13 +117,13 @@
Margin="0,0,5,0"></TextBlock>
<TextBox Grid.Row="0" Grid.Column="1" Height="30" AcceptsReturn="False" TextWrapping="NoWrap" Padding="3"
Text="{Binding Player2.Name,Mode=TwoWay}" VerticalContentAlignment="Center"></TextBox>
<!-- 杆数 -->
<!-- 得分 -->
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Right" Grid.Row="1" Grid.Column="0" Margin="0,0,5,0" Orientation="Horizontal">
<Image Width="16" Height="16" Source="/VIZ.TVP.Golf.Module.Resource;component/Icons/refresh_16x16.png" Margin="0,0,5,0"></Image>
<TextBlock Text="杆数:" ></TextBlock>
<TextBlock Text="得分:" ></TextBlock>
</StackPanel>
<TextBox Grid.Row="1" Grid.Column="1" Height="30" AcceptsReturn="False" TextWrapping="NoWrap" Padding="3"
Text="{Binding Player2.Strokes,Mode=TwoWay}" VerticalContentAlignment="Center"></TextBox>
Text="{Binding Player2.Score,Mode=TwoWay}" VerticalContentAlignment="Center"></TextBox>
<!-- 照片 -->
<TextBlock Text="照片:" VerticalAlignment="Center" HorizontalAlignment="Right" Grid.Row="2" Grid.Column="0"
Margin="0,0,5,0"></TextBlock>
......
......@@ -119,16 +119,16 @@ namespace VIZ.TVP.Golf.Module
#endregion
#region PlayersStrokes -- 组成员杆数
#region PlayersScore -- 组成员得分
private string playersStrokes;
private string playersScore;
/// <summary>
/// 组成员杆数
/// 组成员得分
/// </summary>
public string PlayersStrokes
public string PlayersScore
{
get { return playersStrokes; }
set { playersStrokes = value; this.RaisePropertyChanged(nameof(PlayersStrokes)); }
get { return playersScore; }
set { playersScore = value; this.RaisePropertyChanged(nameof(PlayersScore)); }
}
#endregion
......@@ -213,25 +213,21 @@ namespace VIZ.TVP.Golf.Module
this.Player1.PlayerID = 0;
this.Player1.Name = null;
this.Player1.HalfPicture = null;
this.Player1.Strokes = 0;
this.Player1.Score = 0;
this.Player2.PlayerID = 0;
this.Player2.Name = null;
this.Player2.HalfPicture = null;
this.Player2.Strokes = 0;
this.Player2.Score = 0;
this.PlayersDisplayName = null;
this.PlayersStrokes = null;
this.PlayersScore = null;
}
// ===================================================================================
// Private Action
// ===================================================================================
/// <summary>
/// 更新球员集合属性
/// </summary>
private void UpdatePlayersProperty()
public void UpdatePlayersProperty()
{
// 组成员
StringBuilder sb = new StringBuilder();
......@@ -250,8 +246,8 @@ namespace VIZ.TVP.Golf.Module
this.PlayersDisplayName = sb.ToString();
// 总杆数
int strokes = this.Player1?.Strokes ?? 0 + this.Player2?.Strokes ?? 0;
this.PlayersStrokes = strokes == 0 ? "E" : strokes > 0 ? $"+{strokes}" : $"-{strokes}";
int strokes = this.Player1?.Score ?? 0 + this.Player2?.Score ?? 0;
this.PlayersScore = strokes == 0 ? "E" : strokes > 0 ? $"+{strokes}" : $"-{strokes}";
}
}
}
......@@ -42,13 +42,13 @@
<TextBlock Text="成员:" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,5,0" Grid.Row="1"></TextBlock>
<TextBox Grid.Row="1" Grid.Column="1" Height="30" Margin="5,0,18,0" VerticalContentAlignment="Center"
Text="{Binding Path=PlayersDisplayName,Mode=TwoWay}" Padding="3"></TextBox>
<!-- 杆数 -->
<!-- 得分 -->
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Right" Grid.Row="2" Grid.Column="0" Margin="0,0,5,0" Orientation="Horizontal">
<Image Width="16" Height="16" Source="/VIZ.TVP.Golf.Module.Resource;component/Icons/refresh_16x16.png" Margin="0,0,5,0"></Image>
<TextBlock Text="杆数:" ></TextBlock>
<TextBlock Text="得分:" ></TextBlock>
</StackPanel>
<TextBox Grid.Row="2" Grid.Column="1" Height="30" Margin="5,0,18,0" VerticalContentAlignment="Center"
Text="{Binding Path=PlayersStrokes,Mode=TwoWay}" Padding="3"></TextBox>
Text="{Binding Path=PlayersScore,Mode=TwoWay}" Padding="3"></TextBox>
<!-- 球队Logo -->
<TextBlock Text="球队Logo:" VerticalAlignment="Center" HorizontalAlignment="Right" Grid.Row="3"></TextBlock>
<ComboBox Height="30" Margin="5,0,18,0" VerticalContentAlignment="Center" Grid.Row="3" Grid.Column="1"
......
......@@ -6,6 +6,7 @@ MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "00-Doc", "00-Doc", "{CAE00ECF-BA01-4461-AE78-617D2977BEA0}"
ProjectSection(SolutionItems) = preProject
高尔夫球数据获取api.xml = 高尔夫球数据获取api.xml
高尔夫球数据获取_test.xml = 高尔夫球数据获取_test.xml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "05-Lib", "05-Lib", "{5EC530D3-BA38-4C9A-AD51-4F458373A455}"
......
<tournament cn-name="2021第二十二届中国商学院高尔夫联盟“联盟杯”总决赛A组" en-name="2021第二十二届中国商学院高尔夫联盟“联盟杯”总决赛A组" cn-course="海口观澜湖高尔夫球会 -黑石球场" en-course="" begindate="2021-11-12" enddate="2021-11-13" status="finished" current-round="2" maxRound="2">
<tournament cn-name="2021第二十二届中国商学院高尔夫联盟“联盟杯”总决赛A组" en-name="2021第二十二届中国商学院高尔夫联盟“联盟杯”总决赛A组" cn-course="海口观澜湖高尔夫球会 -黑石球场" en-course="" begindate="2021-11-12" enddate="2021-11-13" status="finished" current-round="2" maxRound="2">
<players>
<player id="1" pl_tvlname="钟大伟" pl_tvsname="钟大伟" pl_sex="1" firstname="" lastname="" en-name="" cn-name="钟大伟" country="CHN" pro-am="PRO" status="competing" position="1" score="1" strokes="147">
<round no="1" matchnumber="21" matchnumberindex="3" teetime="00:01" startingtee="10" thru="18" today="-2" total="71" round-status="finished" player-status="competing">
<score hole="1" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="2" strokes="5" par="5" bunkers="" putts="" drive="" fairway=""/>
<score hole="3" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="4" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="5" strokes="2" par="3" bunkers="" putts="" drive="" fairway=""/>
<score hole="6" strokes="5" par="5" bunkers="" putts="" drive="" fairway=""/>
<score hole="7" strokes="3" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="8" strokes="3" par="3" bunkers="" putts="" drive="" fairway=""/>
<score hole="9" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="10" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="11" strokes="3" par="3" bunkers="" putts="" drive="" fairway=""/>
<score hole="12" strokes="5" par="5" bunkers="" putts="" drive="" fairway=""/>
<score hole="13" strokes="5" par="5" bunkers="" putts="" drive="" fairway=""/>
<score hole="14" strokes="5" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="15" strokes="4" par="3" bunkers="" putts="" drive="" fairway=""/>
<score hole="16" strokes="3" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="17" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="18" strokes="4" par="5" bunkers="" putts="" drive="" fairway=""/>
</round>
<round no="2" matchnumber="14" matchnumberindex="1" teetime="00:00" startingtee="1" thru="18" today="3" total="76" round-status="finished" player-status="competing">
<score hole="1" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="2" strokes="5" par="5" bunkers="" putts="" drive="" fairway=""/>
<score hole="3" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="4" strokes="6" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="5" strokes="3" par="3" bunkers="" putts="" drive="" fairway=""/>
<score hole="6" strokes="5" par="5" bunkers="" putts="" drive="" fairway=""/>
<score hole="7" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="8" strokes="3" par="3" bunkers="" putts="" drive="" fairway=""/>
<score hole="9" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="10" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="11" strokes="3" par="3" bunkers="" putts="" drive="" fairway=""/>
<score hole="12" strokes="5" par="5" bunkers="" putts="" drive="" fairway=""/>
<score hole="13" strokes="5" par="5" bunkers="" putts="" drive="" fairway=""/>
<score hole="14" strokes="5" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="15" strokes="3" par="3" bunkers="" putts="" drive="" fairway=""/>
<score hole="16" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="17" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="18" strokes="5" par="5" bunkers="" putts="" drive="" fairway=""/>
</round>
</player>
<player id="2" pl_tvlname="杜亮" pl_tvsname="杜亮" pl_sex="1" firstname="" lastname="" en-name="" cn-name="杜亮" country="CHN" pro-am="PRO" status="competing" position="2" score="5" strokes="151">
<round no="1" matchnumber="20" matchnumberindex="3" teetime="00:00" startingtee="10" thru="18" today="2" total="75" round-status="finished" player-status="competing">
<score hole="1" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="2" strokes="4" par="5" bunkers="" putts="" drive="" fairway=""/>
<score hole="3" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="4" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="5" strokes="3" par="3" bunkers="" putts="" drive="" fairway=""/>
<score hole="6" strokes="5" par="5" bunkers="" putts="" drive="" fairway=""/>
<score hole="7" strokes="5" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="8" strokes="3" par="3" bunkers="" putts="" drive="" fairway=""/>
<score hole="9" strokes="5" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="10" strokes="5" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="11" strokes="3" par="3" bunkers="" putts="" drive="" fairway=""/>
<score hole="12" strokes="5" par="5" bunkers="" putts="" drive="" fairway=""/>
<score hole="13" strokes="5" par="5" bunkers="" putts="" drive="" fairway=""/>
<score hole="14" strokes="5" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="15" strokes="3" par="3" bunkers="" putts="" drive="" fairway=""/>
<score hole="16" strokes="3" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="17" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="18" strokes="5" par="5" bunkers="" putts="" drive="" fairway=""/>
</round>
<round no="2" matchnumber="14" matchnumberindex="2" teetime="00:00" startingtee="1" thru="18" today="3" total="76" round-status="finished" player-status="competing">
<score hole="1" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="2" strokes="5" par="5" bunkers="" putts="" drive="" fairway=""/>
<score hole="3" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="4" strokes="6" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="5" strokes="3" par="3" bunkers="" putts="" drive="" fairway=""/>
<score hole="6" strokes="5" par="5" bunkers="" putts="" drive="" fairway=""/>
<score hole="7" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="8" strokes="3" par="3" bunkers="" putts="" drive="" fairway=""/>
<score hole="9" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="10" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="11" strokes="3" par="3" bunkers="" putts="" drive="" fairway=""/>
<score hole="12" strokes="5" par="5" bunkers="" putts="" drive="" fairway=""/>
<score hole="13" strokes="5" par="5" bunkers="" putts="" drive="" fairway=""/>
<score hole="14" strokes="5" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="15" strokes="3" par="3" bunkers="" putts="" drive="" fairway=""/>
<score hole="16" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="17" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="18" strokes="5" par="5" bunkers="" putts="" drive="" fairway=""/>
</round>
</player>
<player id="17" pl_tvlname="王义" pl_tvsname="王义" pl_sex="1" firstname="" lastname="" en-name="" cn-name="王义" country="CHN" pro-am="PRO" status="competing" position="T3" score="6" strokes="152">
<round no="1" matchnumber="21" matchnumberindex="1" teetime="00:00" startingtee="10" thru="18" today="0" total="73" round-status="finished" player-status="competing">
<score hole="1" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="2" strokes="5" par="5" bunkers="" putts="" drive="" fairway=""/>
<score hole="3" strokes="3" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="4" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="5" strokes="3" par="3" bunkers="" putts="" drive="" fairway=""/>
<score hole="6" strokes="4" par="5" bunkers="" putts="" drive="" fairway=""/>
<score hole="7" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="8" strokes="3" par="3" bunkers="" putts="" drive="" fairway=""/>
<score hole="9" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="10" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="11" strokes="4" par="3" bunkers="" putts="" drive="" fairway=""/>
<score hole="12" strokes="6" par="5" bunkers="" putts="" drive="" fairway=""/>
<score hole="13" strokes="5" par="5" bunkers="" putts="" drive="" fairway=""/>
<score hole="14" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="15" strokes="4" par="3" bunkers="" putts="" drive="" fairway=""/>
<score hole="16" strokes="3" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="17" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="18" strokes="5" par="5" bunkers="" putts="" drive="" fairway=""/>
</round>
<round no="2" matchnumber="20" matchnumberindex="3" teetime="00:00" startingtee="10" thru="18" today="6" total="79" round-status="finished" player-status="competing">
<score hole="1" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="2" strokes="6" par="5" bunkers="" putts="" drive="" fairway=""/>
<score hole="3" strokes="6" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="4" strokes="5" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="5" strokes="3" par="3" bunkers="" putts="" drive="" fairway=""/>
<score hole="6" strokes="5" par="5" bunkers="" putts="" drive="" fairway=""/>
<score hole="7" strokes="5" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="8" strokes="3" par="3" bunkers="" putts="" drive="" fairway=""/>
<score hole="9" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="10" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="11" strokes="3" par="3" bunkers="" putts="" drive="" fairway=""/>
<score hole="12" strokes="5" par="5" bunkers="" putts="" drive="" fairway=""/>
<score hole="13" strokes="6" par="5" bunkers="" putts="" drive="" fairway=""/>
<score hole="14" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="15" strokes="2" par="3" bunkers="" putts="" drive="" fairway=""/>
<score hole="16" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="17" strokes="5" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="18" strokes="5" par="5" bunkers="" putts="" drive="" fairway=""/>
</round>
</player>
<player id="18" pl_tvlname="郭立新" pl_tvsname="郭立新" pl_sex="1" firstname="" lastname="" en-name="" cn-name="郭立新" country="CHN" pro-am="PRO" status="competing" position="T3" score="6" strokes="152">
<round no="1" matchnumber="21" matchnumberindex="1" teetime="00:00" startingtee="10" thru="18" today="0" total="73" round-status="finished" player-status="competing">
<score hole="1" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="2" strokes="5" par="5" bunkers="" putts="" drive="" fairway=""/>
<score hole="3" strokes="3" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="4" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="5" strokes="3" par="3" bunkers="" putts="" drive="" fairway=""/>
<score hole="6" strokes="4" par="5" bunkers="" putts="" drive="" fairway=""/>
<score hole="7" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="8" strokes="3" par="3" bunkers="" putts="" drive="" fairway=""/>
<score hole="9" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="10" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="11" strokes="4" par="3" bunkers="" putts="" drive="" fairway=""/>
<score hole="12" strokes="6" par="5" bunkers="" putts="" drive="" fairway=""/>
<score hole="13" strokes="5" par="5" bunkers="" putts="" drive="" fairway=""/>
<score hole="14" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="15" strokes="4" par="3" bunkers="" putts="" drive="" fairway=""/>
<score hole="16" strokes="3" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="17" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="18" strokes="5" par="5" bunkers="" putts="" drive="" fairway=""/>
</round>
<round no="2" matchnumber="20" matchnumberindex="3" teetime="00:00" startingtee="10" thru="18" today="6" total="79" round-status="finished" player-status="competing">
<score hole="1" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="2" strokes="6" par="5" bunkers="" putts="" drive="" fairway=""/>
<score hole="3" strokes="6" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="4" strokes="5" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="5" strokes="3" par="3" bunkers="" putts="" drive="" fairway=""/>
<score hole="6" strokes="5" par="5" bunkers="" putts="" drive="" fairway=""/>
<score hole="7" strokes="5" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="8" strokes="3" par="3" bunkers="" putts="" drive="" fairway=""/>
<score hole="9" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="10" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="11" strokes="3" par="3" bunkers="" putts="" drive="" fairway=""/>
<score hole="12" strokes="5" par="5" bunkers="" putts="" drive="" fairway=""/>
<score hole="13" strokes="6" par="5" bunkers="" putts="" drive="" fairway=""/>
<score hole="14" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="15" strokes="2" par="3" bunkers="" putts="" drive="" fairway=""/>
<score hole="16" strokes="4" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="17" strokes="5" par="4" bunkers="" putts="" drive="" fairway=""/>
<score hole="18" strokes="5" par="5" bunkers="" putts="" drive="" fairway=""/>
</round>
</player>
</players>
</tournament>
\ 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