EveryDB2のデータベースを読み込んでWinFormでGUI表示するサンプル
Revision | 6c2a4b618f1560088ca4e08e8c95ccff79d1606e (tree) |
---|---|
Zeit | 2021-05-29 18:41:06 |
Autor | yoshy <yoshy@user...> |
Commiter | yoshy |
temp_20210529_1840
@@ -19,6 +19,8 @@ namespace UmaTest.App.Adaptor.Gateway.ViewModel.Dto | ||
19 | 19 | BeanHelper.Copy(this, umaRace); |
20 | 20 | } |
21 | 21 | |
22 | + public string YearMonthDay { get => Year + "/" + Monthday.Substring(0, 2) + "/" + Monthday.Substring(2, 2); } | |
23 | + | |
22 | 24 | public string RaceName => !String.IsNullOrEmpty(Race.Hondai) |
23 | 25 | ? Race.Hondai |
24 | 26 | : CodeHelper.GetInstance().GetName(CodeHelper.JYOKEN_CODE1, Race.Jyokencd1, "不明"); |
@@ -18,13 +18,18 @@ namespace UmaTest.App.Adaptor.Gateway.ViewModel.Dto | ||
18 | 18 | public UmaSummaryRowDto(NUma uma) |
19 | 19 | { |
20 | 20 | BeanHelper.Copy(this, uma); |
21 | + Wakuban = "仮"; | |
21 | 22 | } |
22 | 23 | |
23 | 24 | public UmaSummaryRowDto(NToku uma) |
24 | 25 | { |
25 | 26 | BeanHelper.Copy(this, uma); |
27 | + Wakuban = "仮"; | |
26 | 28 | } |
27 | 29 | |
30 | + public string Wakuban { get; set; } | |
31 | + public string Umaban { get; set; } | |
32 | + | |
28 | 33 | public string SexAge |
29 | 34 | { |
30 | 35 | get |
@@ -41,6 +41,9 @@ namespace UmaTest.App.Gateway.Presenter | ||
41 | 41 | |
42 | 42 | List<string> kettoNums = res.KettoNums; |
43 | 43 | |
44 | + int umaban = 0; | |
45 | + string oldBamei = String.Empty; ; | |
46 | + | |
44 | 47 | foreach (string kettoNum in kettoNums) |
45 | 48 | { |
46 | 49 | Logger.Info($"血統登録番号: {kettoNum}"); |
@@ -55,8 +58,16 @@ namespace UmaTest.App.Gateway.Presenter | ||
55 | 58 | |
56 | 59 | statusBar.SetStatusText($"血統登録番号: {kettoNum}, 馬名: {uma.Bamei} の情報をレンダリング中です..."); |
57 | 60 | |
61 | + if (oldBamei != uma.Bamei) | |
62 | + { | |
63 | + umaban++; | |
64 | + oldBamei = uma.Bamei; | |
65 | + } | |
66 | + | |
58 | 67 | summaryDto = new UmaSummaryRowDto(uma); |
59 | 68 | |
69 | + summaryDto.Umaban = umaban.ToString("00"); | |
70 | + | |
60 | 71 | foreach (ChakudosuuSummary chakudosuu in res.Summaries[kettoNum]) |
61 | 72 | { |
62 | 73 | if (chakudosuu.Chakudosuu == "0.0.0.0") |
@@ -22,9 +22,6 @@ namespace UmaTest.App.Domain.Model.Repository.Database.Dto | ||
22 | 22 | } |
23 | 23 | |
24 | 24 | [Ignore] |
25 | - public string YearMonthDay { get => Year + "/" + Monthday.Substring(0,2) + "/" + Monthday.Substring(2,2); } | |
26 | - | |
27 | - [Ignore] | |
28 | 25 | public NRace Race { get; set; } |
29 | 26 | } |
30 | 27 | } |
@@ -48,7 +48,20 @@ namespace UmaTest.App.Domain.UseCase.Interactor | ||
48 | 48 | |
49 | 49 | Dictionary<string, NUma> horses = await logicUma.LoadHorsesByBameiListAsync(req.HorseList); |
50 | 50 | |
51 | - List<string> kettoNums = horses.Select(h => h.Value.Kettonum).OrderBy(k => k).ToList(); | |
51 | + List<string> kettoNums = new List<string>(); | |
52 | + | |
53 | + foreach (string bamei in bameiList) | |
54 | + { | |
55 | + foreach (NUma uma in horses.Values) | |
56 | + { | |
57 | + if (uma.Bamei == bamei) | |
58 | + { | |
59 | + kettoNums.Add(uma.Kettonum); | |
60 | + } | |
61 | + } | |
62 | + } | |
63 | + | |
64 | + // List<string> kettoNums = horses.Select(h => h.Value.Kettonum).OrderBy(k => k).ToList(); | |
52 | 65 | |
53 | 66 | statusBarProxy.SetStatusText("馬に紐付くレース情報を読み込んでいます..."); |
54 | 67 |
@@ -72,6 +72,16 @@ namespace UmaTest.App.Presentation.View | ||
72 | 72 | { |
73 | 73 | new DataGridViewTextBoxColumn |
74 | 74 | { |
75 | + DataPropertyName = "Wakuban", | |
76 | + Name = "枠番", | |
77 | + }, | |
78 | + new DataGridViewTextBoxColumn | |
79 | + { | |
80 | + DataPropertyName = "Umaban", | |
81 | + Name = "馬番", | |
82 | + }, | |
83 | + new DataGridViewTextBoxColumn | |
84 | + { | |
75 | 85 | DataPropertyName = "Bamei", |
76 | 86 | Name = "馬名", |
77 | 87 | }, |