• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

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

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


コミットメタ情報

リビジョンfaada8b7d130cfd1f9c2af248abeb70aa0b1559f (tree)
日時2021-06-06 23:53:43
作者yoshy <yoshy@user...>
コミッターyoshy

ログメッセージ

temp_20210606_0337

変更サマリ

差分

--- a/App/Adaptor/Gateway/ViewModel/Dto/SearchRaceRowDto.cs
+++ b/App/Adaptor/Gateway/ViewModel/Dto/SearchRaceRowDto.cs
@@ -32,7 +32,7 @@ namespace UmaTest.App.Adaptor.Gateway.ViewModel.Dto
3232
3333 public string CourseName => CodeHelper.GetInstance().GetTurfDurtName(Trackcd, "不明") + Kyori;
3434
35- public string SyussoTosuFormatted => FormatHelper.SuppressZeroLeading(Syussotosu);
35+ public string TosuFormatted => FormatHelper.FormatTosu(this);
3636
3737 public string HassoTimeFormatted => FormatHelper.FormatTimeHHMM(Hassotime);
3838 }
--- a/App/Adaptor/Gateway/ViewModel/Dto/TokuRaceRowDto.cs
+++ b/App/Adaptor/Gateway/ViewModel/Dto/TokuRaceRowDto.cs
@@ -32,6 +32,6 @@ namespace UmaTest.App.Adaptor.Gateway.ViewModel.Dto
3232
3333 public string CourseName => CodeHelper.GetInstance().GetTurfDurtName(Trackcd, "不明") + Kyori;
3434
35- public string TorokuTosuFormatted => FormatHelper.SuppressZeroLeading(Torokutosu);
35+ public string TosuFormatted => FormatHelper.FormatTosu(this);
3636 }
3737 }
--- a/App/Adaptor/Gateway/ViewModel/Dto/UmaRaceRowDto.cs
+++ b/App/Adaptor/Gateway/ViewModel/Dto/UmaRaceRowDto.cs
@@ -59,11 +59,11 @@ namespace UmaTest.App.Adaptor.Gateway.ViewModel.Dto
5959
6060 BabaJyotaiFormatted = FormatHelper.FormatBabaJyotai(Race);
6161
62- NinkiFormatted = FormatHelper.SuppressZeroLeading(Ninki);
62+ NinkiFormatted = FormatHelper.FormatNinki(this);
6363
6464 TsukaJyuni = FormatHelper.FormatTsukaJyuni(this);
6565
66- KakuteiJyuniFormatted = FormatHelper.SuppressZeroLeading(Kakuteijyuni);
66+ JyuniFormatted = FormatHelper.FormatJyuni(this);
6767
6868 Kimete = CodeHelper.GetInstance().GetName(CodeHelper.KYAKUSITU_KUBUN, Kyakusitukubun, "不明");
6969
@@ -116,7 +116,7 @@ namespace UmaTest.App.Adaptor.Gateway.ViewModel.Dto
116116
117117 public string TsukaJyuni { get; private set; }
118118
119- public string KakuteiJyuniFormatted { get; private set; }
119+ public string JyuniFormatted { get; private set; }
120120
121121 public string Kimete { get; private set; }
122122
--- a/App/Adaptor/Gateway/ViewModel/Dto/UmaSummaryRowDto.cs
+++ b/App/Adaptor/Gateway/ViewModel/Dto/UmaSummaryRowDto.cs
@@ -72,8 +72,7 @@ namespace UmaTest.App.Adaptor.Gateway.ViewModel.Dto
7272 {
7373 Chichi = Konso.Chichi;
7474 }
75-
76- if (Zenso?.Chichi != null)
75+ else if (Zenso?.Chichi != null)
7776 {
7877 Chichi = Zenso.Chichi;
7978 }
@@ -82,7 +81,7 @@ namespace UmaTest.App.Adaptor.Gateway.ViewModel.Dto
8281 {
8382 HahaChichi = Konso.HahaChichi;
8483 }
85- if (Zenso?.HahaChichi != null)
84+ else if (Zenso?.HahaChichi != null)
8685 {
8786 HahaChichi = Zenso.HahaChichi;
8887 }
@@ -91,8 +90,7 @@ namespace UmaTest.App.Adaptor.Gateway.ViewModel.Dto
9190 {
9291 BataijyuFormatted = Konso.BataijyuFormatted;
9392 }
94-
95- if (!string.IsNullOrEmpty(Zenso?.Bataijyu))
93+ else if (!string.IsNullOrEmpty(Zenso?.Bataijyu))
9694 {
9795 if (string.IsNullOrEmpty(Konso?.Bataijyu) || (Konso?.Bataijyu == "0000"))
9896 {
--- a/App/Domain/Model/Repository/Database/Dao/NUmaRaceDao.cs
+++ b/App/Domain/Model/Repository/Database/Dao/NUmaRaceDao.cs
@@ -47,11 +47,11 @@ namespace UmaTest.App.Domain.Model.Repository.Database.Dao
4747
4848 string sql = DbHelper.GetResourceSQLFile(this);
4949
50- Func<NUmaRace, NRace, KisyuInfo, ChokyosiInfo, OddsInfo, NHansyoku, NHansyoku, AppUmaRaceStddev, UmaRaceInfo> mapper =
50+ Func<NUmaRace, NRace, KisyuInfo, ChokyosiInfo, OddsInfo, NHansyoku, NHansyoku, UmaRaceStat, UmaRaceInfo> mapper =
5151 (ur, r, k, c, o, h1, h5, dev) => new UmaRaceInfo(ur, r, k, c, o, h1, h5, dev);
5252
5353 Type[] mapTypes = new Type[] { typeof(NUmaRace), typeof(NRace), typeof(KisyuInfo),
54- typeof(ChokyosiInfo), typeof(OddsInfo), typeof(NHansyoku), typeof(NHansyoku), typeof(AppUmaRaceStddev) };
54+ typeof(ChokyosiInfo), typeof(OddsInfo), typeof(NHansyoku), typeof(NHansyoku), typeof(UmaRaceStat) };
5555
5656 IEnumerable<UmaRaceInfo> races = db.Query<UmaRaceInfo>(
5757 mapTypes, mapper, sql, new { KettoNums = kettoNumList.ToArray() });
--- a/App/Domain/Model/Repository/Database/Dto/UmaRaceInfo.cs
+++ b/App/Domain/Model/Repository/Database/Dto/UmaRaceInfo.cs
@@ -16,7 +16,7 @@ namespace UmaTest.App.Domain.Model.Repository.Database.Dto
1616 {
1717 }
1818
19- public UmaRaceInfo(NUmaRace ur, NRace r, KisyuInfo kisyu, ChokyosiInfo chokyo, OddsInfo oddsTanpuku, NHansyoku chichi, NHansyoku hahachichi, AppUmaRaceStddev stat)
19+ public UmaRaceInfo(NUmaRace ur, NRace r, KisyuInfo kisyu, ChokyosiInfo chokyo, OddsInfo oddsTanpuku, NHansyoku chichi, NHansyoku hahachichi, UmaRaceStat stat)
2020 {
2121 BeanHelper.Copy(this, ur);
2222 Race = r;
@@ -26,7 +26,6 @@ namespace UmaTest.App.Domain.Model.Repository.Database.Dto
2626 Chichi = chichi;
2727 HahaChichi = hahachichi;
2828 Stat = stat;
29- Logger.Debug($"AppUmaRaceStddev: {stat.Jyocd}-{stat.Kyori}-{stat.Trackcd}-{stat.Gradecd}-{stat.Syubetucd}-{stat.Kaishudate}-{stat.TimeAvg}-{stat.Harontimel3Avg}-{stat.Avgharontimeminus3Avg}");
3029 }
3130
3231 [Ignore]
@@ -48,6 +47,6 @@ namespace UmaTest.App.Domain.Model.Repository.Database.Dto
4847 public NHansyoku HahaChichi { get; set; }
4948
5049 [Ignore]
51- public AppUmaRaceStddev Stat { get; set; }
50+ public UmaRaceStat Stat { get; set; }
5251 }
5352 }
--- /dev/null
+++ b/App/Domain/Model/Repository/Database/Dto/UmaRaceStat.cs
@@ -0,0 +1,16 @@
1+using PetaPoco;
2+using System;
3+using System.Collections.Generic;
4+using System.Linq;
5+using System.Text;
6+using System.Threading.Tasks;
7+using UmaTest.App.Domain.Model.Repository.Database.Entity.EveryDB2;
8+
9+namespace UmaTest.App.Domain.Model.Repository.Database.Dto
10+{
11+ public class UmaRaceStat : AppUmaRaceStddev
12+ {
13+ [Ignore]
14+ public string Key => $"{Jyocd}-{Kyori}-{Trackcd}-{Gradecd}-{Syubetucd}-{Kaishudate}";
15+ }
16+}
--- a/App/Presentation/View/MainWindow.cs
+++ b/App/Presentation/View/MainWindow.cs
@@ -168,7 +168,7 @@ namespace UmaTest.App.Presentation.View
168168 },
169169 new DataGridViewTextBoxColumn
170170 {
171- DataPropertyName = "Konso.KakuteiJyuniFormatted",
171+ DataPropertyName = "Konso.JyuniFormatted",
172172 Name = "着順",
173173 },
174174 new DataGridViewTextBoxColumn
@@ -223,7 +223,7 @@ namespace UmaTest.App.Presentation.View
223223 },
224224 new DataGridViewTextBoxColumn
225225 {
226- DataPropertyName = "Zenso.KakuteiJyuniFormatted",
226+ DataPropertyName = "Zenso.JyuniFormatted",
227227 Name = "前走着順",
228228 },
229229 new DataGridViewTextBoxColumn
@@ -308,7 +308,7 @@ namespace UmaTest.App.Presentation.View
308308 },
309309 new DataGridViewTextBoxColumn
310310 {
311- DataPropertyName = "NisoMae.KakuteiJyuniFormatted",
311+ DataPropertyName = "NisoMae.JyuniFormatted",
312312 Name = "前々走着順",
313313 },
314314 new DataGridViewTextBoxColumn
@@ -607,7 +607,7 @@ namespace UmaTest.App.Presentation.View
607607 },
608608 new DataGridViewTextBoxColumn
609609 {
610- DataPropertyName = "KakuteiJyuniFormatted",
610+ DataPropertyName = "JyuniFormatted",
611611 Name = "着順",
612612 },
613613 new DataGridViewTextBoxColumn
@@ -662,16 +662,6 @@ namespace UmaTest.App.Presentation.View
662662 },
663663 new DataGridViewTextBoxColumn
664664 {
665- DataPropertyName = "StatCnt",
666- Name = "統計件数",
667- },
668- new DataGridViewTextBoxColumn
669- {
670- DataPropertyName = "StatOriginDate",
671- Name = "統計開始日",
672- },
673- new DataGridViewTextBoxColumn
674- {
675665 DataPropertyName = "StatPCIFormatted",
676666 Name = "Avg. ペース変化",
677667 },
@@ -685,6 +675,21 @@ namespace UmaTest.App.Presentation.View
685675 DataPropertyName = "StatHaronTimeL3Formatted",
686676 Name = "Avg.上3F",
687677 },
678+ new DataGridViewTextBoxColumn
679+ {
680+ DataPropertyName = "StatCnt",
681+ Name = "統計件数",
682+ },
683+ new DataGridViewTextBoxColumn
684+ {
685+ DataPropertyName = "Stat.Key",
686+ Name = "統計キー",
687+ },
688+ //new DataGridViewTextBoxColumn
689+ //{
690+ // DataPropertyName = "StatOriginDate",
691+ // Name = "統計開始日",
692+ //},
688693 };
689694
690695 grid2Cols.Do(col => col.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter);
@@ -751,6 +756,12 @@ namespace UmaTest.App.Presentation.View
751756 typeof(UmaRaceInfo)
752757 );
753758
759+ // 馬レース情報.統計情報
760+ TypeDescriptor.AddProvider(
761+ new NestedTypeDescriptionProvider<UmaRaceStat>(TypeDescriptor.GetProvider(typeof(UmaRaceInfo))),
762+ typeof(UmaRaceInfo)
763+ );
764+
754765 // 馬サマリ行.繁殖馬情報
755766 TypeDescriptor.AddProvider(
756767 new NestedTypeDescriptionProvider<NHansyoku>(TypeDescriptor.GetProvider(typeof(UmaSummaryRowDto))),
--- a/App/Presentation/View/SearchRaceView.cs
+++ b/App/Presentation/View/SearchRaceView.cs
@@ -112,7 +112,7 @@ namespace UmaTest.App.Presentation.View
112112 },
113113 new DataGridViewTextBoxColumn
114114 {
115- DataPropertyName = "SyussoTosuFormatted",
115+ DataPropertyName = "TosuFormatted",
116116 Name = "頭数",
117117 },
118118 new DataGridViewTextBoxColumn
--- a/App/Presentation/View/TokuRaceListView.cs
+++ b/App/Presentation/View/TokuRaceListView.cs
@@ -112,7 +112,7 @@ namespace UmaTest.App.Presentation.View
112112 },
113113 new DataGridViewTextBoxColumn
114114 {
115- DataPropertyName = "TorokuTosuFormatted",
115+ DataPropertyName = "TosuFormatted",
116116 Name = "頭数",
117117 },
118118 };
--- a/Infra/Helper/CodeHelper.cs
+++ b/Infra/Helper/CodeHelper.cs
@@ -17,6 +17,8 @@ namespace UmaTest.Infra.Helper
1717 public static readonly string TRACK_CODE = "2009";
1818 public static readonly string BABA_JYOTAI_CODE = "2010";
1919
20+ public static readonly string IJYO_CODE = "2101";
21+
2022 public static readonly string SEX_CODE = "2202";
2123
2224 public static readonly string TOZAI_CODE = "2301";
@@ -63,18 +65,27 @@ namespace UmaTest.Infra.Helper
6365
6466 public string GetRaceName(NRace race, string errorValue)
6567 {
66- return race != null ? GetRaceName(race.Hondai, race.Jyokencd5, errorValue) : string.Empty;
68+ return race != null ? GetRaceName(race.Hondai, race.Gradecd, race.Jyokencd5, errorValue) : string.Empty;
6769 }
6870
6971 public string GetRaceName(NTokuRace race, string errorValue)
7072 {
71- return race != null ? GetRaceName(race.Hondai, race.Jyokencd5, errorValue) : string.Empty;
73+ return race != null ? GetRaceName(race.Hondai, race.Gradecd, race.Jyokencd5, errorValue) : string.Empty;
7274 }
7375
74- private string GetRaceName(string hondai, string jyokenCd, string errorValue)
76+ private string GetRaceName(string hondai, string gradeCd, string jyokenCd, string errorValue)
7577 {
7678 if (!String.IsNullOrEmpty(hondai))
7779 {
80+ if (gradeCd == "E")
81+ {
82+ string jyokenName = GetJyokenName(jyokenCd);
83+ if (jyokenName != RACE_CLASS_OPEN)
84+ {
85+ hondai = $"{hondai} ({jyokenName})";
86+ }
87+ }
88+
7889 return hondai;
7990 }
8091
@@ -125,7 +136,12 @@ namespace UmaTest.Infra.Helper
125136 return gradeName;
126137 }
127138
128- switch(jyokenCd)
139+ return GetJyokenName(jyokenCd);
140+ }
141+
142+ private static string GetJyokenName(string jyokenCd)
143+ {
144+ switch (jyokenCd)
129145 {
130146 case "701":
131147 case "702":
--- a/Infra/Helper/FormatHelper.cs
+++ b/Infra/Helper/FormatHelper.cs
@@ -4,6 +4,8 @@ using System.Globalization;
44 using System.Linq;
55 using System.Text;
66 using System.Threading.Tasks;
7+using UmaTest.App.Adaptor.Gateway.ViewModel.Dto;
8+using UmaTest.App.Domain.Model.Repository.Database.Dto;
79 using UmaTest.App.Domain.Model.Repository.Database.Entity.EveryDB2;
810
911 namespace UmaTest.Infra.Helper
@@ -71,6 +73,46 @@ namespace UmaTest.Infra.Helper
7173 return (toDate.Subtract(fromDate).Days / 7).ToString();
7274 }
7375
76+ internal static string FormatJyuni(UmaRaceInfo race)
77+ {
78+ if (race == null)
79+ {
80+ return string.Empty;
81+ }
82+
83+ if (!string.IsNullOrEmpty(race.Kakuteijyuni) && (race.Kakuteijyuni != "00"))
84+ {
85+ return SuppressZeroLeading(race.Kakuteijyuni);
86+ }
87+
88+ if (!string.IsNullOrEmpty(race.Ijyocd) && (race.Ijyocd != "0"))
89+ {
90+ return CodeHelper.GetInstance().GetName(CodeHelper.IJYO_CODE, race.Ijyocd, 1, "不明");
91+ }
92+
93+ return NODATA;
94+ }
95+
96+ public static string FormatNinki(UmaRaceInfo race)
97+ {
98+ if (race == null)
99+ {
100+ return string.Empty;
101+ }
102+
103+ if (!string.IsNullOrEmpty(race.Ninki) && (race.Ninki != "00") )
104+ {
105+ return SuppressZeroLeading(race.Ninki);
106+ }
107+
108+ if (!string.IsNullOrEmpty(race.OddsTanpuku.Tanninki) && (race.OddsTanpuku.Tanninki != "00"))
109+ {
110+ return SuppressZeroLeading(race.OddsTanpuku.Tanninki);
111+ }
112+
113+ return NODATA;
114+ }
115+
74116 public static bool TryParseYYYYMMDD(string strDate, out DateTime outDate)
75117 {
76118 return DateTime.TryParseExact(strDate, "yyyyMMdd", CultureInfo.InvariantCulture, DateTimeStyles.None, out outDate);
@@ -469,6 +511,16 @@ namespace UmaTest.Infra.Helper
469511 return string.Empty;
470512 }
471513
514+ public static string FormatTosu(NTokuRace race)
515+ {
516+ if (race == null)
517+ {
518+ return NODATA;
519+ }
520+
521+ return FormatTosu(null, race?.Torokutosu);
522+ }
523+
472524 public static string FormatTosu(NRace race)
473525 {
474526 if (race == null)
@@ -476,22 +528,26 @@ namespace UmaTest.Infra.Helper
476528 return NODATA;
477529 }
478530
479- string syussoTosuu = SuppressZeroLeading(race?.Syussotosu);
531+ return FormatTosu(race?.Syussotosu, race?.Torokutosu);
532+ }
480533
481- if ( !string.IsNullOrEmpty(syussoTosuu) && (syussoTosuu != NODATA) )
534+ private static string FormatTosu(string syussotosu, string torokutosu)
535+ {
536+ string syussoTosuuFormatted = SuppressZeroLeading(syussotosu);
537+
538+ if (!string.IsNullOrEmpty(syussoTosuuFormatted) && (syussoTosuuFormatted != NODATA))
482539 {
483- return syussoTosuu;
540+ return syussoTosuuFormatted;
484541 }
485542
486- string torokuTosuu = SuppressZeroLeading(race?.Torokutosu);
543+ string torokuTosuuFormatted = SuppressZeroLeading(torokutosu);
487544
488- if ( !string.IsNullOrEmpty(torokuTosuu) && (torokuTosuu != NODATA) )
545+ if (!string.IsNullOrEmpty(torokuTosuuFormatted) && (torokuTosuuFormatted != NODATA))
489546 {
490- return torokuTosuu;
547+ return torokuTosuuFormatted;
491548 }
492549
493550 return string.Empty;
494551 }
495-
496552 }
497553 }
--- a/Resources/Sql/NUmaRaceDao_FindAllRacesByKettoNumListAsync.sql
+++ b/Resources/Sql/NUmaRaceDao_FindAllRacesByKettoNumListAsync.sql
@@ -18,6 +18,7 @@ select distinct
1818 else 'OP'
1919 end
2020 end
21+ when 'L' then 'E'
2122 else r.gradecd
2223 end as gradecd
2324 , r.syubetucd
@@ -70,6 +71,7 @@ AND vur.gradecd = case r.gradecd
7071 else 'OP'
7172 end
7273 end
74+ when 'L' then 'E'
7375 else r.gradecd
7476 end
7577 AND r.syubetucd = vur.syubetucd
--- a/Resources/Sql/uma_race_stddev2.sql
+++ b/Resources/Sql/uma_race_stddev2.sql
@@ -19,6 +19,7 @@ select
1919 else 'OP'
2020 end
2121 end
22+ when 'L' then 'E'
2223 else r.gradecd
2324 end as gradecd
2425 , r.syubetucd
--- a/UmaTest.csproj
+++ b/UmaTest.csproj
@@ -108,6 +108,7 @@
108108 <Compile Include="App\Domain\Model\Repository\Database\Dto\OddsInfo.cs" />
109109 <Compile Include="App\Domain\Model\Repository\Database\Dto\TokuUmaInfo.cs" />
110110 <Compile Include="App\Domain\Model\Repository\Database\Dto\KisyuInfo.cs" />
111+ <Compile Include="App\Domain\Model\Repository\Database\Dto\UmaRaceStat.cs" />
111112 <Compile Include="App\Domain\Model\Repository\Database\Dto\UmaRaceWithUmaInfo.cs" />
112113 <Compile Include="Infra\Adaptor\Controller\EventObserver.cs" />
113114 <Compile Include="App\Adaptor\Gateway\UI\IManualHorseListProxy.cs" />