• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

EveryDB2のデータベースを読み込んでWinFormでGUI表示するサンプル


Commit MetaInfo

Révision9b5f965b7402faf4769a4ec83932867924442ef4 (tree)
l'heure2021-06-07 00:43:47
Auteuryoshy <yoshy@user...>
Commiteryoshy

Message de Log

temp_20210607_0043

Change Summary

Modification

--- a/App/Adaptor/Gateway/ViewModel/Dto/RaceInfo.cs
+++ b/App/Adaptor/Gateway/ViewModel/Dto/RaceInfo.cs
@@ -14,5 +14,21 @@ namespace UmaTest.App.Adaptor.Gateway.ViewModel.Dto
1414 {
1515 BeanHelper.Copy(this, race);
1616 }
17+
18+ public string YearMonthDay => FormatHelper.FormatYearMonthDay(Year, Monthday);
19+
20+ public string JyoName => CodeHelper.GetInstance().GetName(CodeHelper.JYO_CODE, Jyocd, 3, "不明");
21+
22+ public string RaceNumFormatted => FormatHelper.SuppressZeroLeading(Racenum);
23+
24+ public string RaceName => CodeHelper.GetInstance().GetRaceName(this, "不明");
25+
26+ public string GradeName => CodeHelper.GetInstance().GetGradeName(this, "不明");
27+
28+ public string CourseName => CodeHelper.GetInstance().GetTurfDurtName(Trackcd, "不明") + Kyori;
29+
30+ public string TosuFormatted => FormatHelper.FormatTosu(this);
31+
32+ public string HassoTimeFormatted => FormatHelper.FormatTimeHHMM(Hassotime);
1733 }
1834 }
--- a/App/Adaptor/Gateway/ViewModel/Dto/SearchRaceRowDto.cs
+++ b/App/Adaptor/Gateway/ViewModel/Dto/SearchRaceRowDto.cs
@@ -9,31 +9,11 @@ using UmaTest.Infra.Helper;
99
1010 namespace UmaTest.App.Adaptor.Gateway.ViewModel.Dto
1111 {
12- public class SearchRaceRowDto : NRace
12+ public class SearchRaceRowDto : RaceInfo
1313 {
14- public SearchRaceRowDto()
14+ public SearchRaceRowDto(NRace race) : base(race)
1515 {
1616 }
1717
18- public SearchRaceRowDto(NRace race)
19- {
20- BeanHelper.Copy(this, race);
21- }
22-
23- public string YearMonthDay => FormatHelper.FormatYearMonthDay(Year, Monthday);
24-
25- public string JyoName => CodeHelper.GetInstance().GetName(CodeHelper.JYO_CODE, Jyocd, 3, "不明");
26-
27- public string RaceNumFormatted => FormatHelper.SuppressZeroLeading(Racenum);
28-
29- public string RaceName => CodeHelper.GetInstance().GetRaceName(this, "不明");
30-
31- public string GradeName => CodeHelper.GetInstance().GetGradeName(this, "不明");
32-
33- public string CourseName => CodeHelper.GetInstance().GetTurfDurtName(Trackcd, "不明") + Kyori;
34-
35- public string TosuFormatted => FormatHelper.FormatTosu(this);
36-
37- public string HassoTimeFormatted => FormatHelper.FormatTimeHHMM(Hassotime);
3818 }
3919 }
--- a/App/Adaptor/Gateway/ViewModel/Dto/UmaRaceRowDto.cs
+++ b/App/Adaptor/Gateway/ViewModel/Dto/UmaRaceRowDto.cs
@@ -25,7 +25,7 @@ namespace UmaTest.App.Adaptor.Gateway.ViewModel.Dto
2525 Kettonum = kettoNum;
2626 Bataijyu = bataijyu;
2727
28- Race = BeanHelper.CreateAndCopy<NRace>(tokuRace);
28+ Race = tokuRace.ToNRace();
2929
3030 InitProperties();
3131 }
--- a/App/Adaptor/Gateway/ViewModel/IMainWindowViewModel.cs
+++ b/App/Adaptor/Gateway/ViewModel/IMainWindowViewModel.cs
@@ -11,17 +11,19 @@ namespace UmaTest.App.Adaptor.Gateway.ViewModel
1111 {
1212 public interface IMainWindowViewModel
1313 {
14- string Caption { get; set; }
14+ string Caption { get; }
1515 ICommand CommandOpenHorseList { get; }
1616 ICommand CommandOpenTokuRaceList { get; }
1717 ICommand CommandSearchRace { get; }
1818 EventHandler EventSelectedHorseChanged { get; }
1919 IManualHorseListProxy ManualHorseListProxy { get; }
20- BindingList<UmaRaceRowDto> UmaRaceList { get; set; }
20+ BindingList<UmaRaceRowDto> UmaRaceList { get; }
2121 ISearchRaceViewProxy SearchRaceViewProxy { get; }
2222 ITokuRaceListProxy TokuRaceListProxy { get; }
23- BindingList<UmaSummaryRowDto> UmaSummaryList { get; set; }
24- EventObserver UmaSummaryListChangingEvent { get; set; }
23+ BindingList<UmaSummaryRowDto> UmaSummaryList { get; }
24+ EventObserver UmaSummaryListChangingEvent { get; set; }
25+
26+ RaceInfo Race { get; }
2527
2628 event PropertyChangedEventHandler PropertyChanged;
2729
--- a/App/Adaptor/Gateway/ViewModel/MainWindowViewModel.cs
+++ b/App/Adaptor/Gateway/ViewModel/MainWindowViewModel.cs
@@ -18,6 +18,7 @@ using UmaTest.App.Adaptor.Gateway.UI;
1818 using UmaTest.Infra.Adaptor.ViewModel;
1919 using System.Collections.ObjectModel;
2020 using UmaTest.App.Domain.Model.Repository.Database.Entity.EveryDB2;
21+using UmaTest.Infra.Helper;
2122
2223 namespace UmaTest.App.Adaptor.Gateway.ViewModel
2324 {
@@ -70,7 +71,7 @@ namespace UmaTest.App.Adaptor.Gateway.ViewModel
7071 public string Caption
7172 {
7273 get => _caption;
73- set => PropertyChanged.RaiseIfSet(() => Caption, ref _caption, value);
74+ private set => PropertyChanged.RaiseIfSet(() => Caption, ref _caption, value);
7475 }
7576
7677 private RaceInfo _race;
@@ -78,7 +79,7 @@ namespace UmaTest.App.Adaptor.Gateway.ViewModel
7879 public RaceInfo Race
7980 {
8081 get => _race;
81- set => PropertyChanged.RaiseIfSet(() => Race, ref _race, value);
82+ private set => PropertyChanged.RaiseIfSet(() => Race, ref _race, value);
8283 }
8384
8485 private BindingList<UmaSummaryRowDto> _umaSummaryList = new BindingList<UmaSummaryRowDto>();
@@ -86,7 +87,7 @@ namespace UmaTest.App.Adaptor.Gateway.ViewModel
8687 public BindingList<UmaSummaryRowDto> UmaSummaryList
8788 {
8889 get => _umaSummaryList;
89- set => PropertyChanged.RaiseIfSet(() => UmaSummaryList, ref _umaSummaryList, value);
90+ private set => PropertyChanged.RaiseIfSet(() => UmaSummaryList, ref _umaSummaryList, value);
9091 }
9192
9293 private BindingList<UmaRaceRowDto> _umaRaceList = new BindingList<UmaRaceRowDto>();
@@ -94,7 +95,7 @@ namespace UmaTest.App.Adaptor.Gateway.ViewModel
9495 public BindingList<UmaRaceRowDto> UmaRaceList
9596 {
9697 get => _umaRaceList;
97- set => PropertyChanged.RaiseIfSet(() => UmaRaceList, ref _umaRaceList, value);
98+ private set => PropertyChanged.RaiseIfSet(() => UmaRaceList, ref _umaRaceList, value);
9899 }
99100
100101 public void RefreshModel(IList<UmaSummaryRowDto> umaSummaryList, IDictionary<string, IList<UmaRaceRowDto>> umaRaceMap)
@@ -107,6 +108,23 @@ namespace UmaTest.App.Adaptor.Gateway.ViewModel
107108 if (race != null)
108109 {
109110 Race = new RaceInfo(race);
111+
112+ switch (race.Recordspec)
113+ {
114+ case "RA":
115+ string dataKbn = CodeHelper.GetInstance().GetName(CodeHelper.RACE_DATA_KUBUN, race.Datakubun, "不明");
116+ Caption = $"レース検索結果:[ {Race.YearMonthDay} {Race.JyoName}{FormatHelper.SuppressZeroLeading(Race.Racenum)}R {Race.RaceName} ({Race.CourseName}m) ] - {dataKbn}";
117+ break;
118+ case "TK":
119+ Caption = $"特別登録:[ {Race.YearMonthDay} {Race.JyoName}{FormatHelper.SuppressZeroLeading(Race.Racenum)}R {Race.RaceName} ({Race.CourseName}m) ]";
120+ break;
121+ default:
122+ break;
123+ }
124+ }
125+ else
126+ {
127+ Caption = $"仮想出馬表:[ {DateTime.Now} ]";
110128 }
111129
112130 _umaRaceMap = new ReadOnlyDictionary<string, IList<UmaRaceRowDto>>(umaRaceMap);
--- a/App/Adaptor/Presenter/AsyncLoadManualUmaListPresenter.cs
+++ b/App/Adaptor/Presenter/AsyncLoadManualUmaListPresenter.cs
@@ -80,7 +80,6 @@ namespace UmaTest.App.Gateway.Presenter
8080 }),
8181 task =>
8282 {
83- vm.Caption = $"仮想出馬表:[ {DateTime.Now} ]";
8483 vm.RefreshModel(umaSummaryList, umaRaceMap);
8584 });
8685 }
--- a/App/Adaptor/Presenter/AsyncLoadSelectedRaceUmaListPresenter.cs
+++ b/App/Adaptor/Presenter/AsyncLoadSelectedRaceUmaListPresenter.cs
@@ -66,10 +66,7 @@ namespace UmaTest.App.Gateway.Presenter
6666 }),
6767 task =>
6868 {
69- SearchRaceRowDto race = req.Race;
70- string dataKbn = CodeHelper.GetInstance().GetName(CodeHelper.RACE_DATA_KUBUN, race.Datakubun, "不明");
71- vm.Caption = $"レース検索結果:[ {race.YearMonthDay} {race.JyoName}{int.Parse(race.Racenum)}R {race.RaceName} ({race.CourseName}m) ] - {dataKbn}";
72- vm.RefreshModel(race, umaSummaryList, umaRaceMap);
69+ vm.RefreshModel(req.Race, umaSummaryList, umaRaceMap);
7370 });
7471 }
7572 }
--- a/App/Adaptor/Presenter/AsyncLoadTokuUmaListPresenter.cs
+++ b/App/Adaptor/Presenter/AsyncLoadTokuUmaListPresenter.cs
@@ -51,7 +51,7 @@ namespace UmaTest.App.Gateway.Presenter
5151 // FIXME
5252 UmaRaceRowDto zenso = umaRaceList.Count > 0 ? umaRaceList[0] : null;
5353 UmaRaceRowDto nisoMae = umaRaceList.Count > 1 ? umaRaceList[1] : null;
54- UmaRaceRowDto konso = new UmaRaceRowDto(req.Race, kettoNum, summaryDto?.Zenso.Bataijyu);
54+ UmaRaceRowDto konso = new UmaRaceRowDto(req.Race, kettoNum, zenso?.Bataijyu);
5555
5656 summaryDto.LoadUmaRaceList(konso, zenso, nisoMae);
5757 summaryDto.SenSuu = umaRaceList.Count.ToString();
@@ -63,9 +63,7 @@ namespace UmaTest.App.Gateway.Presenter
6363 }),
6464 task =>
6565 {
66- TokuRaceRowDto race = req.Race;
67- vm.Caption = $"特別登録:[ {race.YearMonthDay} {race.JyoName}{int.Parse(race.Racenum)}R {race.RaceName} ({race.CourseName}m) ]";
68- vm.RefreshModel(race.ToNRace(), umaSummaryList, umaRaceMap);
66+ vm.RefreshModel(req.Race.ToNRace(), umaSummaryList, umaRaceMap);
6967 });
7068 }
7169 }
--- a/App/Presentation/View/MainWindow.cs
+++ b/App/Presentation/View/MainWindow.cs
@@ -31,6 +31,8 @@ namespace UmaTest.App.Presentation.View
3131
3232 private bool isFormInitialized = false;
3333
34+ private RaceInfo raceInfo = null;
35+
3436 public MainWindow(IMainWindowViewModel vm, IStatusBarViewModel vmStatusBar, ICommandManager cm)
3537 {
3638 InitializeComponent();
@@ -799,6 +801,9 @@ namespace UmaTest.App.Presentation.View
799801 case "Caption":
800802 this.Text = AppConst.CAPTION + " - " + vm.Caption;
801803 break;
804+ case "Race":
805+ this.raceInfo = vm.Race;
806+ break;
802807 case "UmaSummaryList":
803808 {
804809 bindingSource1.DataSource = vm.UmaSummaryList;
--- a/Infra/Helper/BeanHelper.cs
+++ b/Infra/Helper/BeanHelper.cs
@@ -47,7 +47,7 @@ namespace UmaTest.Infra.Helper
4747 }
4848 }
4949
50- if (toProperty.PropertyType.IsAssignableFrom(fromValue.GetType()))
50+ if ( (fromValue == null) || toProperty.PropertyType.IsAssignableFrom(fromValue.GetType()) )
5151 {
5252 toProperty.SetValue(to, fromValue);
5353 }
--- a/Infra/Helper/CodeHelper.cs
+++ b/Infra/Helper/CodeHelper.cs
@@ -180,6 +180,11 @@ namespace UmaTest.Infra.Helper
180180
181181 public string GetTurfDurtName(string trackCd, string errorValue)
182182 {
183+ if (string.IsNullOrEmpty(trackCd))
184+ {
185+ return string.Empty;
186+ }
187+
183188 string trackEngName = GetName(TRACK_CODE, trackCd, 2, errorValue);
184189
185190 if (trackCd.CompareTo("50") < 0)
--- a/Infra/Helper/FormatHelper.cs
+++ b/Infra/Helper/FormatHelper.cs
@@ -105,7 +105,7 @@ namespace UmaTest.Infra.Helper
105105 return SuppressZeroLeading(race.Ninki);
106106 }
107107
108- if (!string.IsNullOrEmpty(race.OddsTanpuku.Tanninki) && (race.OddsTanpuku.Tanninki != "00"))
108+ if (!string.IsNullOrEmpty(race.OddsTanpuku?.Tanninki) && (race.OddsTanpuku.Tanninki != "00"))
109109 {
110110 return SuppressZeroLeading(race.OddsTanpuku.Tanninki);
111111 }