• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

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

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


Commit MetaInfo

Revisionbb888324b43146bdd91838fcff0522d5549480b9 (tree)
Zeit2021-06-01 06:55:19
Autoryoshy <yoshy@user...>
Commiteryoshy

Log Message

temp_20210601_0655

Ändern Zusammenfassung

Diff

--- a/App/Adaptor/Gateway/ViewModel/Dto/SearchRaceRowDto.cs
+++ b/App/Adaptor/Gateway/ViewModel/Dto/SearchRaceRowDto.cs
@@ -27,5 +27,7 @@ namespace UmaTest.App.Adaptor.Gateway.ViewModel.Dto
2727 public string RaceName => CodeHelper.GetInstance().GetRaceName(this, "不明");
2828
2929 public string GradeName => CodeHelper.GetInstance().GetName(CodeHelper.GRADE_CODE, Gradecd, "-");
30+
31+ public string CourseName => CodeHelper.GetInstance().GetTrackKubun(Trackcd, "不明") + Kyori;
3032 }
3133 }
--- a/App/Adaptor/Gateway/ViewModel/Dto/TokuRaceRowDto.cs
+++ b/App/Adaptor/Gateway/ViewModel/Dto/TokuRaceRowDto.cs
@@ -22,8 +22,12 @@ namespace UmaTest.App.Adaptor.Gateway.ViewModel.Dto
2222
2323 public string YearMonthDay { get => Year + "/" + Monthday.Substring(0, 2) + "/" + Monthday.Substring(2, 2); }
2424
25+ public string JyoName { get => CodeHelper.GetInstance().GetName(CodeHelper.JYO_CODE, Jyocd, 3, "不明"); }
26+
2527 public string RaceName => CodeHelper.GetInstance().GetRaceName(this, "不明");
2628
2729 public string GradeName => CodeHelper.GetInstance().GetName(CodeHelper.GRADE_CODE, Gradecd, "-");
30+
31+ public string CourseName => CodeHelper.GetInstance().GetTrackKubun(Trackcd, "不明") + Kyori;
2832 }
2933 }
--- a/App/Adaptor/Gateway/ViewModel/Dto/UmaRaceRowDto.cs
+++ b/App/Adaptor/Gateway/ViewModel/Dto/UmaRaceRowDto.cs
@@ -21,10 +21,14 @@ namespace UmaTest.App.Adaptor.Gateway.ViewModel.Dto
2121
2222 public string YearMonthDay { get => Year + "/" + Monthday.Substring(0, 2) + "/" + Monthday.Substring(2, 2); }
2323
24- public string RaceName => CodeHelper.GetInstance().GetRaceName(Race, "不明");
24+ public string JyoName { get => CodeHelper.GetInstance().GetName(CodeHelper.JYO_CODE, Jyocd, 3, "不明"); }
25+
26+ public string RaceName => Race != null ? CodeHelper.GetInstance().GetRaceName(Race, "不明") : string.Empty;
2527
2628 public string GradeName => CodeHelper.GetInstance().GetName(CodeHelper.GRADE_CODE, Race.Gradecd, "-");
2729
30+ public string CourseName => Race != null ? CodeHelper.GetInstance().GetTrackKubun(Race.Trackcd, "不明") + Race.Kyori : string.Empty;
31+
2832 public string Kimete => CodeHelper.GetInstance().GetName(CodeHelper.KYAKUSITU_KUBUN, Kyakusitukubun, "不明");
2933
3034 public string BataijyuFormatted
--- a/App/Adaptor/Gateway/ViewModel/IMainWindowViewModel.cs
+++ b/App/Adaptor/Gateway/ViewModel/IMainWindowViewModel.cs
@@ -10,6 +10,7 @@ namespace UmaTest.App.Adaptor.Gateway.ViewModel
1010 {
1111 public interface IMainWindowViewModel
1212 {
13+ string Caption { get; set; }
1314 ICommand CommandOpenHorseList { get; }
1415 ICommand CommandOpenTokuRaceList { get; }
1516 ICommand CommandSearchRace { get; }
@@ -19,11 +20,10 @@ namespace UmaTest.App.Adaptor.Gateway.ViewModel
1920 ISearchRaceViewProxy SearchRaceViewProxy { get; }
2021 ITokuRaceListProxy TokuRaceListProxy { get; }
2122 BindingList<UmaSummaryRowDto> UmaSummaryList { get; set; }
23+ EventObserver UmaSummaryListChangingEvent { get; set; }
2224
2325 event PropertyChangedEventHandler PropertyChanged;
2426
25- EventObserver UmaSummaryListChangingEvent { get; set; }
26-
2727 void RefreshModel(List<UmaSummaryRowDto> umaSummaryList, Dictionary<string, List<UmaRaceRowDto>> umaRaceMap);
2828 }
2929 }
\ No newline at end of file
--- a/App/Adaptor/Gateway/ViewModel/MainWindowViewModel.cs
+++ b/App/Adaptor/Gateway/ViewModel/MainWindowViewModel.cs
@@ -63,6 +63,14 @@ namespace UmaTest.App.Adaptor.Gateway.ViewModel
6363 EventSelectedHorseChanged = new EventHandler(OnSelectedHorseChanged);
6464 }
6565
66+ private string _caption;
67+
68+ public string Caption
69+ {
70+ get => _caption;
71+ set => PropertyChanged.RaiseIfSet(() => Caption, ref _caption, value);
72+ }
73+
6674 private BindingList<UmaSummaryRowDto> _umaSummaryList = new BindingList<UmaSummaryRowDto>();
6775
6876 public BindingList<UmaSummaryRowDto> UmaSummaryList
--- a/App/Adaptor/Presenter/AsyncLoadSelectedRaceUmaListPresenter.cs
+++ b/App/Adaptor/Presenter/AsyncLoadSelectedRaceUmaListPresenter.cs
@@ -22,6 +22,8 @@ namespace UmaTest.App.Gateway.Presenter
2222 private IMainWindowViewModel vm;
2323 private IStatusBarProxy statusBar;
2424
25+ private AsyncLoadSelectedRaceUmaListRequest req;
26+
2527 private List<UmaSummaryRowDto> umaSummaryList = new List<UmaSummaryRowDto>();
2628 private Dictionary<string, List<UmaRaceRowDto>> umaRaceMap = new Dictionary<string, List<UmaRaceRowDto>>();
2729
@@ -36,7 +38,7 @@ namespace UmaTest.App.Gateway.Presenter
3638 {
3739 return TaskHelper.RunWithUIAction<UseCaseResponse>(Task.Run<UseCaseResponse>(() =>
3840 {
39- AsyncLoadSelectedRaceUmaListRequest req = baseRes.Request as AsyncLoadSelectedRaceUmaListRequest;
41+ req = baseRes.Request as AsyncLoadSelectedRaceUmaListRequest;
4042 AsyncLoadSelectedRaceUmaListResponse res = baseRes as AsyncLoadSelectedRaceUmaListResponse;
4143
4244 IEnumerable<UmaInfo> horses = res.Horses;
@@ -156,6 +158,8 @@ namespace UmaTest.App.Gateway.Presenter
156158 {
157159 statusBar.SetStatusText("ビューモデルを更新中です...");
158160
161+ SearchRaceRowDto race = req.Race;
162+ vm.Caption = $"レース検索結果:[ {race.YearMonthDay} {race.JyoName}{int.Parse(race.Racenum)}R {race.RaceName} ({race.CourseName}m) ]";
159163 vm.RefreshModel(umaSummaryList, umaRaceMap);
160164 });
161165 }
--- a/App/Adaptor/Presenter/AsyncLoadTokuUmaListPresenter.cs
+++ b/App/Adaptor/Presenter/AsyncLoadTokuUmaListPresenter.cs
@@ -22,6 +22,7 @@ namespace UmaTest.App.Gateway.Presenter
2222 private IMainWindowViewModel vm;
2323 private IStatusBarProxy statusBar;
2424
25+ private AsyncLoadTokuUmaListRequest req;
2526 private List<UmaSummaryRowDto> umaSummaryList = new List<UmaSummaryRowDto>();
2627 private Dictionary<string, List<UmaRaceRowDto>> umaRaceMap = new Dictionary<string, List<UmaRaceRowDto>>();
2728
@@ -36,7 +37,7 @@ namespace UmaTest.App.Gateway.Presenter
3637 {
3738 return TaskHelper.RunWithUIAction<UseCaseResponse>(Task.Run<UseCaseResponse>(() =>
3839 {
39- AsyncLoadTokuUmaListRequest req = baseRes.Request as AsyncLoadTokuUmaListRequest;
40+ req = baseRes.Request as AsyncLoadTokuUmaListRequest;
4041 AsyncLoadTokuUmaListResponse res = baseRes as AsyncLoadTokuUmaListResponse;
4142
4243 List<string> kettoNums = res.KettoNums;
@@ -157,6 +158,10 @@ namespace UmaTest.App.Gateway.Presenter
157158 }),
158159 task =>
159160 {
161+ statusBar.SetStatusText("ビューモデルを更新中です...");
162+
163+ TokuRaceRowDto race = req.Race;
164+ vm.Caption = $"特別登録:[ {race.YearMonthDay} {race.JyoName}{int.Parse(race.Racenum)}R {race.RaceName} ({race.CourseName}m) ]";
160165 vm.RefreshModel(umaSummaryList, umaRaceMap);
161166 });
162167 }
--- a/App/Domain/Model/Repository/Database/Dto/OddsInfo.cs
+++ b/App/Domain/Model/Repository/Database/Dto/OddsInfo.cs
@@ -23,7 +23,7 @@ namespace UmaTest.App.Domain.Model.Repository.Database.Dto
2323
2424 try
2525 {
26- return (int.Parse(Tanodds) / 10.0f).ToString();
26+ return (int.Parse(Tanodds) / 10.0f).ToString("#.0");
2727 }
2828 catch (Exception)
2929 {
--- a/App/Domain/UseCase/Request/AsyncLoadSelectedRaceUmaListRequest.cs
+++ b/App/Domain/UseCase/Request/AsyncLoadSelectedRaceUmaListRequest.cs
@@ -12,12 +12,12 @@ namespace UmaTest.App.Domain.UseCase.Request
1212 {
1313 public class AsyncLoadSelectedRaceUmaListRequest : UseCaseRequest
1414 {
15- public AsyncLoadSelectedRaceUmaListRequest(NRace race)
15+ public AsyncLoadSelectedRaceUmaListRequest(SearchRaceRowDto race)
1616 {
1717 Race = race;
1818 }
1919
20- public NRace Race { get; private set; }
20+ public SearchRaceRowDto Race { get; private set; }
2121
2222
2323 protected override UseCaseResponse CreateResponse()
--- a/App/Domain/UseCase/Request/AsyncLoadTokuUmaListRequest.cs
+++ b/App/Domain/UseCase/Request/AsyncLoadTokuUmaListRequest.cs
@@ -12,12 +12,12 @@ namespace UmaTest.App.Domain.UseCase.Request
1212 {
1313 public class AsyncLoadTokuUmaListRequest : UseCaseRequest
1414 {
15- public AsyncLoadTokuUmaListRequest(NTokuRace race)
15+ public AsyncLoadTokuUmaListRequest(TokuRaceRowDto race)
1616 {
1717 Race = race;
1818 }
1919
20- public NTokuRace Race { get; private set; }
20+ public TokuRaceRowDto Race { get; private set; }
2121
2222
2323 protected override UseCaseResponse CreateResponse()
--- a/App/Presentation/View/MainWindow.cs
+++ b/App/Presentation/View/MainWindow.cs
@@ -138,6 +138,11 @@ namespace UmaTest.App.Presentation.View
138138 },
139139 new DataGridViewTextBoxColumn
140140 {
141+ DataPropertyName = "Konso.FutanFormatted",
142+ Name = "斤量",
143+ },
144+ new DataGridViewTextBoxColumn
145+ {
141146 DataPropertyName = "BataijyuFormatted",
142147 Name = "馬体重",
143148 },
@@ -153,6 +158,11 @@ namespace UmaTest.App.Presentation.View
153158 },
154159 new DataGridViewTextBoxColumn
155160 {
161+ DataPropertyName = "Konso.Kakuteijyuni",
162+ Name = "着順",
163+ },
164+ new DataGridViewTextBoxColumn
165+ {
156166 DataPropertyName = "Short.G1",
157167 Name = "短G1",
158168 },
@@ -254,9 +264,16 @@ namespace UmaTest.App.Presentation.View
254264 };
255265
256266 grid1Cols.Do(col => col.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter);
257-
258267 dataGridView1.Columns.AddRange(grid1Cols);
259268
269+ dataGridView1.Columns["調教師"].HeaderCell.Style.WrapMode = DataGridViewTriState.False;
270+ dataGridView1.Columns["馬体重"].HeaderCell.Style.WrapMode = DataGridViewTriState.False;
271+ dataGridView1.Columns["オッズ"].HeaderCell.Style.WrapMode = DataGridViewTriState.False;
272+
273+ dataGridView1.Columns["枠番"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
274+ dataGridView1.Columns["戦数"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
275+ dataGridView1.Columns["オッズ"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
276+
260277 //
261278 // Initialize DataGridView2
262279 //
@@ -276,6 +293,11 @@ namespace UmaTest.App.Presentation.View
276293 },
277294 new DataGridViewTextBoxColumn
278295 {
296+ DataPropertyName = "JyoName",
297+ Name = "場所",
298+ },
299+ new DataGridViewTextBoxColumn
300+ {
279301 DataPropertyName = "RaceName",
280302 Name = "レース名",
281303 },
@@ -286,8 +308,8 @@ namespace UmaTest.App.Presentation.View
286308 },
287309 new DataGridViewTextBoxColumn
288310 {
289- DataPropertyName = "Race.Kyori",
290- Name = "距離",
311+ DataPropertyName = "CourseName",
312+ Name = "コース",
291313 },
292314 new DataGridViewTextBoxColumn
293315 {
@@ -322,7 +344,7 @@ namespace UmaTest.App.Presentation.View
322344 new DataGridViewTextBoxColumn
323345 {
324346 DataPropertyName = "FutanFormatted",
325- Name = "負担",
347+ Name = "斤量",
326348 },
327349 new DataGridViewTextBoxColumn
328350 {
@@ -337,9 +359,14 @@ namespace UmaTest.App.Presentation.View
337359 };
338360
339361 grid2Cols.Do(col => col.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter);
340-
341362 dataGridView2.Columns.AddRange(grid2Cols);
342363
364+ dataGridView2.Columns["レース名"].HeaderCell.Style.WrapMode = DataGridViewTriState.False;
365+ dataGridView2.Columns["コース"].HeaderCell.Style.WrapMode = DataGridViewTriState.False;
366+ dataGridView2.Columns["馬体重"].HeaderCell.Style.WrapMode = DataGridViewTriState.False;
367+
368+ dataGridView2.Columns["枠番"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
369+
343370 //
344371 // Custom Type Descriptor for Child Entity Properties
345372 //
@@ -424,6 +451,9 @@ namespace UmaTest.App.Presentation.View
424451
425452 switch (args.PropertyName)
426453 {
454+ case "Caption":
455+ this.Text = AppConst.CAPTION + " - " + vm.Caption;
456+ break;
427457 case "UmaSummaryList":
428458 {
429459 bindingSource1.DataSource = vm.UmaSummaryList;
--- a/App/Presentation/View/SearchRaceView.cs
+++ b/App/Presentation/View/SearchRaceView.cs
@@ -107,8 +107,8 @@ namespace UmaTest.App.Presentation.View
107107 },
108108 new DataGridViewTextBoxColumn
109109 {
110- DataPropertyName = "Kyori",
111- Name = "距離",
110+ DataPropertyName = "CourseName",
111+ Name = "コース",
112112 },
113113 new DataGridViewTextBoxColumn
114114 {
--- a/App/Presentation/View/TokuRaceListView.cs
+++ b/App/Presentation/View/TokuRaceListView.cs
@@ -87,6 +87,16 @@ namespace UmaTest.App.Presentation.View
8787 },
8888 new DataGridViewTextBoxColumn
8989 {
90+ DataPropertyName = "JyoName",
91+ Name = "場所",
92+ },
93+ new DataGridViewTextBoxColumn
94+ {
95+ DataPropertyName = "Racenum",
96+ Name = "R",
97+ },
98+ new DataGridViewTextBoxColumn
99+ {
90100 DataPropertyName = "RaceName",
91101 Name = "レース名",
92102 },
@@ -97,8 +107,8 @@ namespace UmaTest.App.Presentation.View
97107 },
98108 new DataGridViewTextBoxColumn
99109 {
100- DataPropertyName = "Kyori",
101- Name = "距離",
110+ DataPropertyName = "CourseName",
111+ Name = "コース",
102112 },
103113 };
104114
--- a/Infra/Helper/CodeHelper.cs
+++ b/Infra/Helper/CodeHelper.cs
@@ -14,6 +14,7 @@ namespace UmaTest.Infra.Helper
1414 public static readonly string JYO_CODE = "2001";
1515 public static readonly string GRADE_CODE = "2003";
1616 public static readonly string JYOKEN_CODE = "2007";
17+ public static readonly string TRACK_CODE = "2009";
1718
1819 public static readonly string SEX_CODE = "2202";
1920
@@ -86,6 +87,48 @@ namespace UmaTest.Infra.Helper
8687 return GetName(CodeHelper.JYOKEN_CODE, jyokenCd, errorValue);
8788 }
8889
90+ public string GetTrackKubun(string trackCd, string errorValue)
91+ {
92+ string trackEngName = GetName(TRACK_CODE, trackCd, 2, errorValue);
93+
94+ if (trackCd.CompareTo("50") < 0)
95+ {
96+ return ExtractTurfDartKbn(trackEngName);
97+ }
98+ else
99+ {
100+ string turfDartKbn = (trackCd != "52") ? ExtractTurfDartKbn(trackEngName) : "芝ダ";
101+ return "障" + turfDartKbn;
102+ }
103+ }
104+
105+ private static string ExtractTurfDartKbn(string trackEngName)
106+ {
107+ if (string.IsNullOrEmpty(trackEngName))
108+ {
109+ return string.Empty;
110+ }
111+
112+ string turfDartKbn;
113+ switch (trackEngName.Substring(0, 1))
114+ {
115+ case "T":
116+ turfDartKbn = "芝";
117+ break;
118+ case "D":
119+ turfDartKbn = "ダ";
120+ break;
121+ case "S":
122+ turfDartKbn = "砂";
123+ break;
124+ default:
125+ turfDartKbn = "?";
126+ break;
127+ }
128+
129+ return turfDartKbn;
130+ }
131+
89132 public string GetName(string code, string value, string errorValue = ERROR_VALUE)
90133 {
91134 return GetName(code, value, 0, errorValue);
--- a/UmaTest.csproj
+++ b/UmaTest.csproj
@@ -102,6 +102,7 @@
102102 <Reference Include="System.Xml" />
103103 </ItemGroup>
104104 <ItemGroup>
105+ <Compile Include="App\Adaptor\Gateway\ViewModel\IMainWindowViewModel.cs" />
105106 <Compile Include="App\Domain\Model\Repository\Database\Dto\OddsInfo.cs" />
106107 <Compile Include="App\Domain\Model\Repository\Database\Dto\TokuUmaInfo.cs" />
107108 <Compile Include="App\Domain\Model\Repository\Database\Dto\UmaInfo.cs" />
@@ -116,7 +117,6 @@
116117 <Compile Include="App\Adaptor\Gateway\ViewModel\Dto\UmaRaceRowDto.cs" />
117118 <Compile Include="App\Adaptor\Gateway\ViewModel\Dto\UmaSummaryRowDto.cs" />
118119 <Compile Include="App\Adaptor\Gateway\UI\ITokuRaceListProxy.cs" />
119- <Compile Include="App\Adaptor\Gateway\ViewModel\IMainWindowViewModel.cs" />
120120 <Compile Include="App\Adaptor\Gateway\ViewModel\ISearchRaceViewModel.cs" />
121121 <Compile Include="App\Adaptor\Gateway\ViewModel\ITokuRaceListViewModel.cs" />
122122 <Compile Include="App\Adaptor\Gateway\ViewModel\SearchRaceViewModel.cs" />