From 1a1c8e71fcd14858f595029f089b2d4a00202b32 Mon Sep 17 00:00:00 2001
From: ogi <Administrator@S-OGI-PC>
Date: Fri, 05 Dec 2025 09:24:16 +0900
Subject: [PATCH] プロジェクトファイルを追加。
---
HotelPms.Client.Blazor/Pages/UseDetail/PersonInfo.razor | 297
HotelPms.Share/Util/SystemCommon.cs | 47
HotelPms.Client.Blazor/ViewModel/UsePerson.cs | 50
HotelPms.SourceFactory/FormTableAccessCreator.resx | 60
HotelPms.WinForm.Master/HotelPms.WinForm.Master.csproj | 18
HotelPms.Share.Windows/Report/FormTypeSelect.resx | 863
HotelPms.SourceFactory/Util/EnvironmentSetting.cs | 105
Document/HotelCommonDB設計.xlsx | 0
HotelPms.Share.Windows/Component/GlassButton.cs | 845
HotelPms.Client.Blazor/wwwroot/appsettings.json | 11
HotelPms.WinForm/View/Menu.Designer.cs | 138
Protos/item.proto | 87
MudBlazorTemplates1/Pages/FetchData.razor | 52
MudBlazorTemplates1/MudBlazorTemplates1.csproj | 20
HotelPms.Share.Windows/Component/DataGridViewEx.cs | 534
HotelPms.WinForm.Master/Demo.cs | 295
ProtosExpan/UseInfo/Use.cs | 336
HotelPms.Share.Windows/UI/Colors.cs | 836
ProtosExpan/UseInfo/UseRoom.cs | 389
HotelPms.Data.Common/Interface/Master/IMaster.cs | 8
HotelPms.Share/Data/PostgreSqlNet.cs | 381
HotelPms.Share.Windows/Component/DataGridViewEx.resx | 129
HotelPms.DataAccessGrpc.Client/PayDivAccess.cs | 267
HotelPms.SourceFactory/FormScript.cs | 32
HotelPms.Client.Blazor/Shared/NavMenu.razor | 40
HotelPms.Share.Windows/Component/Design/DesignPanel.cs | 610
MudBlazorTemplates1/MudBlazorTemplates1.sln | 25
HotelPms.SourceFactory/FormScript.Designer.cs | 203
HotelPms.SourceFactory/Util/Setting.cs | 21
Document/システム構成図.xlsx | 0
HotelPms.Client.Blazor/Services/ServiceCollectionExtensions.cs | 14
HotelPms.SourceFactory/Util/CommonFunc.cs | 523
HotelPms.Data.Common/Dtos/MessageDto.cs | 73
ProtosExpan/Master/RoomCell.cs | 298
HotelPms.Client.Blazor/Shared/LoginLayout.razor | 19
HotelPms.DataAccessGrpc.Client/UseAlloAccess.cs | 267
MudBlazorTemplates1/_Imports.razor | 11
Document/HotelPmsDB設計_利用.xlsx | 0
HotelPms.Client.Blazor/Pages/Pages/Master/RoomStatus/Crud.razor | 363
HotelPms.Data.Server/HotelPms.Data.Server.csproj | 92
HotelPms.Share.Windows/Component/GridSelInfo.cs | 25
HotelPms.Share.Windows/Util/FormBase.cs | 647
HotelPms.Share.Windows/Report/GridExcel.cs | 260
HotelPms.GrpcService/Services/UsePersonFreeService.cs | 369
HotelPms.Share.Windows/Component/PropertyDialog/FormInputType.resx | 120
HotelPms.Client.Blazor/ViewModel/Sale.cs | 63
HotelPms.Client.Blazor/Dialog/SelectColor.razor | 70
HotelPms.Share.Windows/GraphicsApi/Overlap.cs | 295
Protos/datarequest.proto | 17
HotelPms.WinForm/View/UseInput/Detail.Designer.cs | 346
HotelPms.Client.Blazor/Util/WindowDimensions.cs | 7
HotelPms.Client.Blazor/wwwroot/service-worker.published.js | 48
HotelPms.Share.Windows/Util/ComboBoxItem.cs | 83
HotelPms.Share.Windows/Component/Calendar.cs | 1014
HotelPms.SourceFactory/FormEdge.Designer.cs | 171
HotelPms.WinForm.Common/Properties/Resources.resx | 133
Document/Git.xlsx | 0
HotelPms.Client.Blazor/ViewModel/ColSettingRow.cs | 47
HotelPms.SourceFactory/ExcelCopy.resx | 63
HotelPms.DataAccessGrpc.Client/BuildingAccess.cs | 273
HotelPms.DataAccessGrpc.Client/ReceiptAccess.cs | 267
HotelPms.Client.Blazor/wwwroot/index.html | 53
HotelPms.SourceFactory/Util/BOMStream.cs | 0
HotelPms.DataAccessDirect.Server/DemoAccess.cs | 73
HotelPms.Client.Blazor/ViewModel/Use.cs | 41
HotelPms.Client.Blazor/Pages/UseDetail/SaleInput.razor.cs | 648
Document/Memo.txt | 21
HotelPms.Data.Server/ProtosExpan/CustomTypes/Readme.txt | 1
HotelPms.GrpcService/Services/RoomViewLayoutService.cs | 369
ProtosExpan/UseInfo/PayDiv.cs | 224
HotelPms.GrpcService/Services/UseDetailService.cs | 369
HotelPms.Share.Windows/Component/PropertyEditor/InputTypeEditor.cs | 48
HotelPms.Client.Blazor/ViewModel/Demo.cs | 30
ProtosExpan/Master/OptionTable.cs | 43
ProtosExpan/Master/RoomTypeTable.cs | 42
HotelPms.GrpcService/Services/GrpcTableService.cs | 310
HotelPms.Client.Blazor/Shared/Error.razor | 17
HotelPms.Share.Windows/Tool/DBLogin.resx | 120
HotelPms.GrpcService/Util/Excel.cs | 69
HotelPms.SourceFactory/Template/Detail.txt | 201
HotelPms.GrpcService/Services/GreeterService.cs | 22
HotelPms.GrpcService/Services/PayDivService.cs | 369
HotelPms.Share.Windows/Util/ValueChangeListener.cs | 245
HotelPms.GrpcService/Hubs/NotifyHub.cs | 27
Protos/demo.proto | 49
HotelPms.Client.Blazor/HotelPms.Client.Blazor.sln | 25
HotelPms.DataAccessGrpc.Client/RoomViewLayoutAccess.cs | 294
ProtosExpan/Master/OutputItemTable.cs | 43
HotelPms.WinApp/Program.cs | 37
Protos/customTypes.proto | 21
HotelPms.SourceFactory/FormEdge.cs | 190
HotelPms.SourceFactory/FormScript.resx | 60
HotelPms.Client.Blazor/Pages/Pages/Master/Demo/Crud.razor | 358
HotelPms.Client.Blazor/Util/ElementReferenceEx.cs | 49
HotelPms.Share.Windows/Component/TabMark.cs | 727
HotelPms.SourceFactory/PivotTables.xlsx | 0
HotelPms.DataAccessGrpc.Client/RoomViewTabAccess.cs | 273
HotelPms.Share.Windows/Tool/CalendarSelector.cs | 55
HotelPms.Share.Windows/Component/ComboBoxItem.cs | 44
HotelPms.SourceFactory/FormTableAccessCreator.Designer.cs | 85
HotelPms.WinApp/HotelPms.WinApp.csproj | 22
HotelPms.SourceFactory/Template/BeanFileMode.txt | 116
HotelPms.Client.Blazor/wwwroot/images/avatar_jonny.jpg | 0
HotelPms.Share.Windows/Report/Member/PrintRow.cs | 53
HotelPms.Client.Blazor/ViewModel/Receipt.cs | 29
HotelPms.DataAccessGrpc.Client/UsePersonAccess.cs | 262
ProtosExpan/UseInfo/Rental.cs | 200
HotelPms.Client.Blazor/Pages/UseDetail/Component1.razor | 5
HotelPms.Client.Blazor/wwwroot/js/NavMenuFix.js | 3
HotelPms.DataAccessGrpc.Client/UsePersonTelAccess.cs | 262
HotelPms.WinForm.Common/Resources/find.png | 0
HotelPms.Client.Blazor/Models/ChatUser.cs | 14
HotelPms.Share.Windows/Util/GeneralSub.cs | 0
HotelPms.GrpcService/Services/BuildingService.cs | 369
MudBlazorTemplates1/wwwroot/sample-data/weather.json | 27
HotelPms.Client.Blazor/Pages/Pages/Authentication/Login.razor | 40
HotelPms.Data.Common/Pagination/PagingRequest.cs | 25
HotelPms.Share.Windows/UI/Palette.cs | 15
ProtosExpan/Master/RoomStatusTable.cs | 43
HotelPms.GrpcService/Services/UseRoomService.cs | 369
HotelPms.DataAccessGrpc.Client/RoomCellAccess.cs | 273
HotelPms.SourceFactory/PostgreSqlDemo.resx | 60
ProtosExpan/UseInfo/Sale.cs | 540
HotelPms.Share.Windows/Component/PanelEx.cs | 499
HotelPms.SourceFactory/ExcelToTable.resx | 63
HotelPms.SourceFactory/PostgreSqlDemo.Designer.cs | 233
HotelPms.Client.Blazor/Util/IGlobalLoadingSpinner.cs | 12
HotelPms.DataAccessGrpc.Client/UseRoomAccess.cs | 263
HotelPms.Share.Windows/Util/JapaneseDateTime.cs | 182
ProtosExpan/Master/HotelTable.cs | 43
ProtosExpan/UseInfo/UsePersonFree.cs | 159
ProtosExpan/Master/Hotel.cs | 266
HotelPms.Client.Blazor/Services/JsInputCoreService.cs | 24
HotelPms.Client.Blazor/Pages/UseDetail/OtherInfo.razor | 291
HotelPms.Data.Client/ProtosExpan/Master/Demo.Expan.cs | 28
HotelPms.DataAccessDirect.Client/HotelPms.DataAccessDirect.Client.csproj | 14
HotelPms.VerUp/Application/Core.cs | 12
HotelPms.Share.Windows/Report/GridXml.cs | 88
ProtosExpan/Master/Building.cs | 261
HotelPms.DataAccessGrpc.Client/ArrangeAccess.cs | 267
HotelPms.Share/Data/Script/DataBaseCreator.cs | 76
HotelPms.Share.Windows/Component/IPanelEx.cs | 25
HotelPms.VerUp/Util/ConfigData.cs | 42
HotelPms.SourceFactory/Form1.Designer.cs | 104
MudBlazorTemplates1/App.razor | 11
ProtosExpan/GrpcTable.cs | 210
HotelPms.Client.Blazor/Models/SaleInputRow.cs | 216
HotelPms.DataAccessDirect.Client/DemoAccess.cs | 140
HotelPms.Share.Windows/Component/ITextBoxArray.cs | 21
HotelPms.Client.Blazor/wwwroot/css/laststyle.css | 33
HotelPms.SourceFactory/PostgreSqlDemo.cs | 49
HotelPms.Share.Windows/Component/CalendarEventHandler.cs | 10
HotelPms.Client.Blazor/Pages/Pages/Utility/WasmLoading.razor | 30
HotelPms.Client.Blazor/ViewModel/Rental.cs | 29
HotelPms.SourceFactory/TableToExcel.Designer.cs | 360
HotelPms.Data.Common/Auth/WeatherForecast.cs | 15
HotelPms.SourceFactory/Table/SqlFactory.cs | 207
ProtosExpan/UseInfo/Sale.Client.cs | 46
HotelPms.Client.Blazor/ViewModel/RoomViewLayout.cs | 29
HotelPms.Client.Blazor/wwwroot/icon-512.png | 0
HotelPms.SourceFactory/FormGdi.resx | 60
HotelPms.WinForm.Common/Util/EnvironmentSetting.cs | 66
HotelPms.Client.Blazor/Pages/Pages/Master/Building/Detail.razor | 285
HotelPms.Share/IO/OperationLog.cs | 315
HotelPms.Share/Util/SystemStorage.cs | 76
HotelPms.SourceFactory/BeanCreator.cs | 525
Protos/roomstatus.proto | 53
HotelPms.Share/IO/LogInfo.cs | 31
MudBlazorTemplates1/Properties/launchSettings.json | 30
HotelPms.Share/Util/ServiceCore.cs | 434
HotelPms.SourceFactory/ExcelCopy.Designer.cs | 233
HotelPms.Client.Blazor/Services/JsInputCoreEventArgs.cs | 57
HotelPms.Client.Blazor/Pages/UseDetail/ResvInfo.razor | 81
HotelPms.GrpcService/Services/RentalService.cs | 369
MudBlazorTemplates1/wwwroot/manifest.json | 16
HotelPms.DataAccessGrpc.Client/OutputAccess.cs | 279
HotelPms.GrpcService/Services/ItemService.cs | 373
HotelPms.Client.Blazor/ViewModel/Output.cs | 29
HotelPms.Share.Windows/Report/FormTypeSelect.cs | 46
Protos/roomtype.proto | 56
HotelPms.Client.Blazor/Pages/Pages/Master/RoomStatus/Detail.razor | 277
HotelPms.SourceFactory/Template/BeanFileMode_ProtoEx.txt | 98
HotelPms.Client.Blazor/Pages/Pages/RoomView/List.razor | 480
HotelPms.GrpcService/Services/PayService.cs | 369
HotelPms.GrpcService/Services/RoomTypeService.cs | 368
HotelPms.SourceFactory/Util/TypeScriptFactory.cs | 46
HotelPms.Client.Blazor/Pages/UseDetail/RoomTypeInput.razor | 64
HotelPms.Share/Xml/ConfigXml.cs | 164
ProtosExpan/UseInfo/Use.Client.cs | 60
HotelPms.Share/NetWork/SubdirectoryHandler.cs | 25
HotelPms.Share.Windows/Tool/CalendarSelectorOne.Designer.cs | 113
HotelPms.Share.Windows/Tool/MstList.designer.cs | 171
HotelPms.SourceFactory/FormExProperty.cs | 53
HotelPms.WinForm.Common/Interface/IMasterCtrl.cs | 16
ProtosExpan/UseInfo/UseMemo.cs | 169
HotelPms.SourceFactory/Template/Detail.designer.txt | 84
Protos/usefree.proto | 43
HotelPms.Client.Blazor/Pages/Applications/Chat/ChatChannels.razor | 33
ProtosExpan/Master/RoomViewLayout.cs | 319
HotelPms.SourceFactory/Template/BeanFileMode_ProtoEx_Service.txt | 368
HotelPms.Client.Blazor/wwwroot/images/yado-oh-pro.jpg | 0
HotelPms.WinForm.Master/Demo.resx | 60
HotelPms.Share.Windows/Tool/DebugMonitor.designer.cs | 188
HotelPms.GrpcService/HotelPms.GrpcService.csproj | 23
HotelPms.WinForm.Common/Resources/ooopic_1462956507.png | 0
HotelPms.Client.Blazor/wwwroot/js/NetCallJs.js | 153
HotelPms.SourceFactory/FormMain.Designer.cs | 645
HotelPms.Share.Windows/Report/ReportBase.cs | 148
HotelPms.SourceFactory/ExcelCopy.cs | 66
HotelPms.Client.Blazor/ViewModel/PayDiv.cs | 29
HotelPms.Share.Windows/Service/Setting.cs | 73
HotelPms.Client.Blazor/Shared/MainLayout.razor | 87
ProtosExpan/UseInfo/UseAllo.Server.cs | 40
HotelPms.GrpcService/Services/FileService.cs | 79
HotelPms.SourceFactory/Form2.cs | 20
ProtosExpan/UseInfo/UseDetail.Server.cs | 16
HotelPms.Client.Blazor/Models/ReadOnlyRow.cs | 54
HotelPms.Client.Blazor/Models/ChatMessage.cs | 9
HotelPms.GrpcService/appsettings.json | 25
HotelPms.Share.Windows/Tool/DataSelector.resx | 95
HotelPms.Client.Blazor/ViewModel/Option.cs | 29
HotelPms.Share.Windows/Component/RemovePeekMessage.cs | 200
Document/Sql/列設定追加.sql | 26
HotelPms.GrpcService/Services/ReceiptService.cs | 369
HotelPms.Share.Windows/Tool/MstList.resx | 60
HotelPms.WinForm.Common/MasterBase.Designer.cs | 355
HotelPms.Share.Windows/Component/FunctionKeyBar.cs | 210
HotelPms.Share/Util/DynamicJsonConverter.cs | 160
HotelPms.Share.Windows/Tool/ExitDialog.cs | 92
HotelPms.Share.Windows/Component/ControlPropertyEx.cs | 34
HotelPms.Share.Windows/Tool/CalendarSelectorOne.resx | 60
Protos/building.proto | 53
HotelPms.Client.Blazor/ViewModel/UsePersonFree.cs | 29
MudBlazorTemplates1/wwwroot/service-worker.js | 4
HotelPms.GrpcService/Services/GrpcSetService.cs | 120
HotelPms.Share.Windows/Component/FocusInfo.cs | 27
HotelPms.SourceFactory/FormGdi.Designer.cs | 196
HotelPms.SourceFactory/Util/TestBean.cs | 14
HotelPms.Share.Windows/Component/CalendarEventArgs.cs | 20
HotelPms.Share.Windows/Tool/ExitDialog.resx | 99
HotelPms.Share/Data/DBConnectItem.cs | 83
HotelPms.Client.Blazor/wwwroot/sample-data/sample.pdf | 0
HotelPms.Client.Blazor/wwwroot/favicon.ico | 0
HotelPms.Data.Server/ProtosExpan/Master/Output.Expan.cs | 15
HotelPms.Share/Data/Script/MsSql/SP_GetCreateTableScript.sql | 74
Protos/useroom.proto | 74
HotelPms.SourceFactory/Form2.resx | 120
MudBlazorTemplates1/Shared/NavMenu.razor | 5
Protos/rental.proto | 45
HotelPms.Share.Windows/Util/FormBase.resx | 60
HotelPms.Client.Blazor/Pages/Pages/Authentication/Forgot.razor | 17
HotelPms.Share/Data/RecordBase.cs | 79
HotelPms.Client.Blazor/Util/DefaultGlobalLoadingSpinner.cs | 55
HotelPms.SourceFactory/FormTableAccessCreator.cs | 28
Protos/grpctable.proto | 34
HotelPms.Client.Blazor/ViewModel/UseAllo.cs | 29
HotelPms.Client.Blazor/ViewModel/ColSettingData.cs | 119
HotelPms.Data.Common/GrpcEnum.cs | 60
HotelPms.Share.Windows/Component/MaterialButton.cs | 269
HotelPms.Client.Blazor/ViewModel/RoomCell.cs | 29
HotelPms.Share.Windows/Util/MouseMessageFilter.cs | 31
HotelPms.Share/Util/ObjectEx.cs | 135
ProtosExpan/UseInfo/UseAllo.cs | 160
HotelPms.Share.Windows/Util/InputItem.cs | 180
HotelPms.Share/Util/MessageEventArgs.cs | 60
HotelPms.Client.Blazor/Models/UseRoomRow.cs | 45
.editorconfig | 136
HotelPms.Client.Blazor/ViewModel/UseInput.cs | 755
HotelPms.GrpcService/Services/RoomStatusService.cs | 369
HotelPms.Share.Windows/Util/CTextBoxArray.cs | 680
ProtosExpan/UseInfo/Pay.cs | 280
ProtosExpan/UseInfo/UsePerson.cs | 428
Protos/outputitem.proto | 47
HotelPms.GrpcService/appsettings.Development.json | 8
HotelPms.SourceFactory/Template/ViewModel.txt | 21
MudBlazorTemplates1/wwwroot/index.html | 28
MudBlazorTemplates1/wwwroot/icon-512.png | 0
HotelPms.DataAccessGrpc.Client/OptionAccess.cs | 268
HotelPms.Client.Blazor/ViewModel/RoomViewTab.cs | 29
HotelPms.Client.Blazor/wwwroot/css/site.css | 143
HotelPms.Client.Blazor/ViewModel/OutputItem.cs | 29
HotelPms.Share.Windows/HotelPms.Share.Windows.csproj | 43
Document/Etc/Backup20220701.zip | 0
HotelPms.Client.Blazor/Pages/Pages/Authentication/Reset.razor | 35
HotelPms.Client.Blazor/wwwroot/manifest.json | 21
HotelPms.Share.Windows/Report/OutputStyle.cs | 174
Protos/option.proto | 42
Protos/pay.proto | 54
HotelPms.Client.Blazor/Pages/UseDetail/RoomTypeInput.razor.cs | 599
HotelPms.SourceFactory/Template/BeanFileMode_ProtoEx_Table.txt | 42
Document/Config.json | 25
Protos/useperson.proto | 72
HotelPms.Client.Blazor/Models/RoomTypeBase.cs | 16
HotelPms.Share.Windows/Report/GridReport.cs | 347
HotelPms.Client.Blazor/Dialog/SelectList.razor | 128
HotelPms.Share.Windows/Tool/DebugMonitor.cs | 85
HotelPms.DataAccessDirect.Server/HotelPms.DataAccessDirect.Server.csproj | 14
HotelPms.GrpcService/Services/SaleDivService.cs | 369
HotelPms.Share.Windows/GraphicsApi/PointD.cs | 39
HotelPms.SourceFactory/Template/Proto3MsgAll.txt | 31
Protos/useallo.proto | 42
ProtosExpan/Master/RoomViewTabTable.cs | 43
HotelPms.Client.Blazor/Util/FakeData.cs | 898
HotelPms.Data.Client/Interface/Access/IDemo.cs | 16
ProtosExpan/UseInfo/Use.Server.cs | 353
HotelPms.Share.Windows/Component/ControlEx.cs | 43
HotelPms.Client.Blazor/Pages/Personal/Dashboard.razor | 173
HotelPms.Share.Windows/UI/Theme.cs | 13
ProtosExpan/Master/RoomViewTab.cs | 177
HotelPms.WinForm.Common/HotelPms.WinForm.Common.csproj | 44
HotelPms.Data.Client/ProtosExpan/Master/RoomViewUse.cs | 66
HotelPms.WinForm/HotelPms.WinForm.csproj | 26
HotelPms.GrpcService/Util/Setting.cs | 49
HotelPms.SourceFactory/FormMain.resx | 132
HotelPms.Client.Blazor/Pages/Applications/Email/Email.razor | 61
HotelPms.Share.Windows/Report/TrueFontFactory.cs | 1084
HotelPms.Share.Windows/Service/MonitorSetting.cs | 73
HotelPms.SourceFactory/Form1.cs | 20
HotelPms.SourceFactory/FormSignalR.Designer.cs | 151
HotelPms.sln | 150
HotelPms.Share.Windows/Animations/AnimationDirection.cs | 12
HotelPms.Share.Windows/Report/Border.cs | 55
HotelPms.SourceFactory/FileEdit/EditData.cs | 29
HotelPms.SourceFactory/BeanCreator.resx | 270
HotelPms.Share.Windows/Report/RowStyle.cs | 13
HotelPms.Share/Util/DictionarySetting.cs | 54
Document/Etc/部屋別一覧.png | 0
HotelPms.Share.Windows/Component/PropertyDialog/FormInputType.cs | 81
Protos/usepersontel.proto | 44
HotelPms.Data.Common/Util/SyncConfig.cs | 15
HotelPms.Client.Blazor/ViewModel/SaleDiv.cs | 29
Protos/roomcell.proto | 57
HotelPms.Client.Blazor/Pages/Applications/Chat/UserMessage.razor | 28
HotelPms.Share/Data/TableAccessBase.cs | 75
Document/Sql/Import HotelPms.sql | 155
HotelPms.Client.Blazor/ViewModel/UseDetail.cs | 52
HotelPms.Share/Data/IRecord.cs | 15
HotelPms.SourceFactory/HotelPms.SourceFactory.csproj | 62
HotelPms.Share.Windows/Component/LoadingPanel.cs | 203
HotelPms.DataAccessGrpc.Client/UseMemoAccess.cs | 267
HotelPms.Client.Blazor/Util/BoundingClientRect.cs | 14
HotelPms.Share/NetWork/TcpIP.cs | 93
HotelPms.Client.Blazor/wwwroot/service-worker.js | 4
HotelPms.Share.Windows/Component/CountButton.cs | 214
HotelPms.Share.Windows/GraphicsApi/RegionFormAPI.cs | 118
HotelPms.Data.Client/GrpcClient.cs | 173
HotelPms.Client.Blazor/wwwroot/js/browser-resize.js | 24
HotelPms.Share.Windows/Util/CTextBoxArrayBaseEventArgs.cs | 28
MudBlazorTemplates1/Shared/MainLayout.razor | 34
HotelPms.Share.Windows/Report/GridStyle.cs | 68
ProtosExpan/CustomTypes/Date.cs | 128
ProtosExpan/Master/OutputTable.cs | 43
HotelPms.Client.Blazor/Util/EnvironmentSetting.cs | 143
HotelPms.Share.Windows/Report/Cell.cs | 45
HotelPms.GrpcService/Services/UsePersonService.cs | 369
Protos/grpcdict.proto | 12
Document/HotelPmsDB設計_マスタ.xlsx | 0
HotelPms.GrpcService/Services/UseService.cs | 158
HotelPms.Client.Blazor/Pages/Applications/Email/Inbox.razor | 63
HotelPms.DataAccessGrpc.Client/RoomStatusAccess.cs | 284
HotelPms.Share.Windows/GraphicsApi/ColorType.cs | 26
HotelPms.Client.Blazor/Pages/Applications/Chat/Chat.razor | 112
HotelPms.Client.Blazor/Pages/Applications/Chat/User.razor | 37
HotelPms.Client.Blazor/Services/JsInputCoreCallBack.cs | 36
HotelPms.Share/Data/Script/MsSql/GetTableDefine.sql | 53
ProtosExpan/Master/OutputItem.cs | 201
HotelPms.Client.Blazor/Util/EditGridFocusEventArgs.cs | 18
HotelPms.Data.Server/ProtosExpan/Master/Option.Expan.cs | 24
HotelPms.Client.Blazor/wwwroot/js/browser-resize-cls.js | 18
HotelPms.DataAccessGrpc.Client/HotelAccess.cs | 269
Protos/dataresult.proto | 8
HotelPms.DataAccessGrpc.Client/SaleAccess.cs | 268
HotelPms.Share.Windows/Report/PrintGdiPlus.cs | 265
HotelPms.WinForm.Common/MasterBase.cs | 394
HotelPms.Share/HotelPms.Share.csproj | 26
HotelPms.Share.Windows/Util/NPOIExcel.cs | 400
HotelPms.Client.Blazor/Models/EditRow.cs | 89
HotelPms.Share/Data/DataAccessDirectBase.cs | 14
HotelPms.Share.Windows/Tool/MstList.cs | 664
ProtosExpan/Master/DemoTable.cs | 43
HotelPms.SourceFactory/FormGdi.cs | 351
HotelPms.SourceFactory/FormSignalR.resx | 60
HotelPms.Client.Blazor/Util/OptionCore.cs | 67
HotelPms.Share.Windows/Resources/load.gif | 0
HotelPms.Client.Blazor/ViewModel/Building.cs | 28
HotelPms.Share.Windows/Report/ReportControl.cs | 33
HotelPms.Client.Blazor/wwwroot/sample-data/1.pdf | 0
HotelPms.Client.Blazor/Dialog/ColSetting.razor | 599
HotelPms.SourceFactory/FormSignalR.cs | 81
HotelPms.Share.Windows/GraphicsApi/GdiPlus.cs | 175
HotelPms.Share.Windows/Util/ValueChangeEventArgs.cs | 71
HotelPms.SourceFactory/TableToExcel.resx | 63
HotelPms.Data.Common/Auth/LoginModel.cs | 15
HotelPms.Client.Blazor/Pages/Personal/Account.razor | 216
HotelPms.Client.Blazor/ViewModel/UseRoom.cs | 29
HotelPms.Share/Util/ScriptCreator.cs | 165
HotelPms.SourceFactory/Template/BeanFileMode_tsinterface.txt | 13
HotelPms.SourceFactory/sample.json | 26
HotelPms.Client.Blazor/Dialog/MessageBox.razor | 59
Protos/use.proto | 48
HotelPms.Data.Client/Util/GrpcClientInterceptor.cs | 92
HotelPms.GrpcService/Services/ArrangeService.cs | 369
Protos/paydiv.proto | 49
HotelPms.Client.Blazor/Models/RoomViewData.cs | 368
HotelPms.Client.Blazor/ViewModel/ValidField.cs | 139
HotelPms.Share.Windows/Report/Member/PageHeader.cs | 16
ProtosExpan/Master/RoomType.cs | 287
HotelPms.Share.Windows/Component/CTextBox.cs | 886
HotelPms.Client.Blazor/ViewModel/ValidEventArgs.cs | 23
HotelPms.GrpcService/Services/HotelService.cs | 369
HotelPms.Data.Server/ProtosExpan/UseInfo/Readme.txt | 1
ProtosExpan/UseInfo/SaleDiv.cs | 294
HotelPms.Data.Common/Auth/LoginResult.cs | 9
HotelPms.Client.Blazor/App.razor | 27
HotelPms.Client.Blazor/Pages/Applications/Chat/ChatUsers.razor | 22
HotelPms.SourceFactory/FormReport.Designer.cs | 707
ProtosExpan/GrpcSet.cs | 24
HotelPms.Client.Blazor/Models/RoomStatusSetting.cs | 150
HotelPms.VerUp/Util/Config.cs | 8
Document/Etc/列設定.png | 0
HotelPms.Client.Blazor/Util/MudBlazorExpandEx.cs | 48
HotelPms.SourceFactory/FormReport.resx | 120
HotelPms.Share/Data/Script/MsSql/SP_CloseDBConnect.sql | 46
Protos/arrange.proto | 51
HotelPms.GrpcService/Services/SaleService.cs | 368
HotelPms.SourceFactory/FormExProperty.Designer.cs | 105
HotelPms.WinForm.Common/Resources/ooopic_1463994291.png | 0
HotelPms.Client.Blazor/ViewModel/Pay.cs | 29
HotelPms.Data.Client/HotelPms.Data.Client.csproj | 128
Protos/sqlwhere.proto | 7
HotelPms.Client.Blazor/Models/MudBlazorAdminDashboard.cs | 134
HotelPms.Share.Windows/Report/GridCsv.cs | 125
HotelPms.Data.Common/PmsEnum.cs | 270
Protos/roomviewlayout.proto | 59
HotelPms.Client.Blazor/Services/AuthService.cs | 78
ProtosExpan/UseInfo/UseDetail.cs | 448
HotelPms.GrpcService/Services/UseMemoService.cs | 369
HotelPms.Share.Windows/Tool/CalendarSelector.resx | 60
HotelPms.Client.Blazor/Models/SaleChildRow.cs | 75
HotelPms.Client.Blazor/Util/Message.cs | 25
HotelPms.Share.Windows/Report/Member/PageFooter.cs | 13
HotelPms.DataAccessGrpc.Client/HotelPms.DataAccessGrpc.Client.csproj | 14
HotelPms.Client.Blazor/wwwroot/images/AdminDashboardTemplate.png | 0
HotelPms.Share/IO/IOutputLog.cs | 15
ProtosExpan/Master/Demo.cs | 225
HotelPms.Client.Blazor/Pages/Pages/Master/Demo/Detail.razor | 244
MudBlazorTemplates1/Pages/Counter.razor | 17
ProtosExpan/UseInfo/Receipt.cs | 378
HotelPms.DataAccessGrpc.Client/UseAccess.cs | 114
HotelPms.Share.Windows/Util/InputItemEventArgs.cs | 34
ProtosExpan/Master/Item.cs | 597
HotelPms.SourceFactory/FormValid.cs | 156
HotelPms.SourceFactory/Template/Proto3Master.txt | 39
HotelPms.WinForm.Master/Demo.Designer.cs | 577
HotelPms.Client.Blazor/ViewModel/ValidModelEx.cs | 731
HotelPms.SourceFactory/Template/DataAccessFileMode.txt | 268
HotelPms.SourceFactory/FileEdit/Item.cs | 32
HotelPms.Share.Windows/Util/InputCtrl.cs | 870
HotelPms.SourceFactory/FormEdge.resx | 63
HotelPms.GrpcService/Services/OptionService.cs | 369
HotelPms.Data.Common/HotelPms.Data.Common.csproj | 13
HotelPms.Client.Blazor/ViewModel/UseMemo.cs | 29
HotelPms.Client.Blazor/Dialog/SelectDate.razor | 64
HotelPms.Share.Windows/Component/PanelEx.resx | 120
HotelPms.Data.Client/ProtosExpan/Master/Readme.txt | 1
HotelPms.GrpcService/Services/UseAlloService.cs | 369
HotelPms.Share.Windows/Tool/DataSelector.Designer.cs | 174
ProtosExpan/Master/ItemTable.cs | 42
HotelPms.Client.Blazor/_Imports.razor | 19
HotelPms.Data.Client/ProtosExpan/Master/RoomViewLayout.Expan.cs | 29
Protos/hotel.proto | 54
HotelPms.Client.Blazor/Util/ApiAuthenticationStateProvider.cs | 102
HotelPms.Client.Blazor/wwwroot/sample-data/2.pdf | 0
HotelPms.SourceFactory/FormValid.resx | 60
HotelPms.SourceFactory/Program.cs | 21
HotelPms.SourceFactory/TableToExcel.cs | 246
HotelPms.Client.Blazor/Pages/Pages/Utility/Faq.razor | 65
HotelPms.Client.Blazor/wwwroot/icon-192.png | 0
HotelPms.DataAccessGrpc.Client/DemoAccess.cs | 289
HotelPms.GrpcService/Services/OutputService.cs | 476
HotelPms.Share.Windows/Component/TextBoxFurigana.cs | 320
HotelPms.Client.Blazor/Util/JSInteropEx.cs | 62
HotelPms.GrpcService/Controllers/LoginController.cs | 51
ProtosExpan/Master/Output.cs | 240
HotelPms.WinForm/View/UseInput/Detail.resx | 60
HotelPms.Share.Windows/Util/UnhandledExceptionListener.cs | 57
HotelPms.Share/IO/FileOperation.cs | 265
HotelPms.Share.Windows/Animations/AnimationManager.cs | 364
HotelPms.Client.Blazor/Util/BusinessEnum.cs | 9
HotelPms.DataAccessGrpc.Client/RentalAccess.cs | 267
ProtosExpan/UseInfo/UseFree.cs | 170
HotelPms.SourceFactory/FormReport.cs | 367
ProtosExpan/UseInfo/UseDetail.Client.cs | 60
HotelPms.Share.Windows/Component/ButtonFlat.cs | 177
HotelPms.Share.Windows/Tool/DebugMonitor.resx | 123
HotelPms.Client.Blazor/ViewModel/UseFree.cs | 29
Protos/greet.proto | 19
HotelPms.Share.Windows/Report/ColumnStyle.cs | 35
HotelPms.Client.Blazor/wwwroot/bg1.jpg | 0
HotelPms.Share.Windows/Tool/ExitDialog.designer.cs | 148
HotelPms.Client.Blazor/ViewModel/RoomType.cs | 38
ProtosExpan/Master/RoomStatus.cs | 258
HotelPms.GrpcService/Services/UseFreeService.cs | 369
HotelPms.Share.Windows/Component/PropertyDialog/FormInputType.designer.cs | 274
HotelPms.DataAccessGrpc.Client/AuthAccess.cs | 62
HotelPms.Share.Windows/Animations/Animations.cs | 53
Protos/roomviewtab.proto | 45
HotelPms.Share.Windows/Component/AntLabel.cs | 168
HotelPms.Share.Windows/Tool/DBLogin.cs | 155
HotelPms.Share.Windows/GraphicsApi/Geometry.cs | 119
HotelPms.GrpcService/Program.cs | 178
HotelPms.GrpcService/.config/dotnet-tools.json | 12
HotelPms.Client.Blazor/wwwroot/images/FrontGateWay.jpg | 0
HotelPms.WinForm.Common/MasterBase.resx | 60
HotelPms.Share.Windows/Report/FormReport .cs | 157
HotelPms.Share/Data/Script/Field.cs | 61
HotelPms.Data.Client/ProtosExpan/CustomTypes/Readme.txt | 1
HotelPms.Share.Windows/Component/RoundButton.cs | 77
HotelPms.Client.Blazor/ViewModel/UsePersonTel.cs | 29
HotelPms.Client.Blazor/Dialog/MessageContext.razor | 12
ProtosExpan/CustomTypes/DecimalValue.cs | 80
HotelPms.Client.Blazor/Models/RoomViewMenu.cs | 184
MudBlazorTemplates1/wwwroot/service-worker.published.js | 48
Protos/output.proto | 53
HotelPms.Share/Data/SqlBrokerListener.cs | 245
HotelPms.DataAccessGrpc.Client/UsePersonFreeAccess.cs | 267
HotelPms.WinForm/View/Menu.resx | 60
HotelPms.Client.Blazor/wwwroot/sample-data/weather.json | 27
HotelPms.Share/Data/DataAccess.cs | 45
HotelPms.Client.Blazor/Services/IAuthService.cs | 11
HotelPms.Share.Windows/Component/GlassButton.designer.cs | 57
HotelPms.Client.Blazor/Util/ElementBase.cs | 8
HotelPms.SourceFactory/BeanCreator.designer.cs | 1018
HotelPms.Client.Blazor/ViewModel/Arrange.cs | 29
HotelPms.Share.Windows/Properties/Resources.Designer.cs | 73
HotelPms.Share.Windows/Tool/DBLogin.designer.cs | 201
HotelPms.SourceFactory/Util/EnumFactory.cs | 50
HotelPms.DataAccessGrpc.Client/AddressAccess.Expan.cs | 42
HotelPms.Share.Windows/Report/IReport.cs | 17
HotelPms.Client.Blazor/Pages/Pages/Authentication/Register.razor | 43
ProtosExpan/Master/Option.cs | 148
HotelPms.Share.Windows/Properties/Resources.resx | 124
HotelPms.DataAccessGrpc.Client/SaleDivAccess.cs | 267
Protos/usememo.proto | 43
HotelPms.Client.Blazor/HotelPms.Client.Blazor.csproj | 29
HotelPms.WinForm.Common/Util/Setting.cs | 21
HotelPms.Data.Client/ProtosExpan/Master/RoomViewAtt.cs | 30
MudBlazorTemplates1/Program.cs | 13
HotelPms.Client.Blazor/Pages/UseDetail/SaleInput.razor.css | 3
HotelPms.Client.Blazor/Pages/UseDetail/Component2.razor | 5
HotelPms.DataAccessGrpc.Client/PayAccess.cs | 267
Protos/salediv.proto | 56
HotelPms.Data.Client/ProtosExpan/UseInfo/Readme.txt | 1
HotelPms.Share.Windows/Component/Design/DesignItem.cs | 396
HotelPms.WinForm.Common/Resources/avatar5.png | 0
ProtosExpan/UseInfo/UsePersonTel.cs | 179
HotelPms.Client.Blazor/Util/MasterCore.cs | 140
HotelPms.Client.Blazor/Util/CacheStorage.cs | 99
HotelPms.Client.Blazor/Pages/Pages/Master/Building/Crud.razor | 370
HotelPms.Share.Windows/Component/DataGridViewEx.designer.cs | 92
HotelPms.Client.Blazor/Models/FeeDtailRow.cs | 8
HotelPms.SourceFactory/FormExProperty.resx | 60
HotelPms.SourceFactory/Template/Proto3Msg.txt | 16
HotelPms.Share/Util/CConvert.cs | 0
HotelPms.GrpcService/Services/OutputItemService.cs | 369
HotelPms.Share/Data/MsSqlNet.cs | 843
Protos/sale.proto | 81
HotelPms.DataAccessGrpc.Client/OutputItemAccess.cs | 273
HotelPms.Client.Blazor/ViewModel/ValidModel.cs | 915
Protos/reportcol.proto | 40
MudBlazorTemplates1/Pages/Index.razor | 7
HotelPms.Share.Windows/Tool/CalendarSelector.Designer.cs | 112
ProtosExpan/UseInfo/UseRoom.Client.cs | 169
HotelPms.SourceFactory/FileEdit/Core.cs | 70
HotelPms.Client.Blazor/Util/ScrollPosition.cs | 10
HotelPms.Client.Blazor/wwwroot/images/logo_foot.gif | 0
ProtosExpan/Master/BuildingTable.cs | 43
HotelPms.GrpcService/Services/DemoService.cs | 369
HotelPms.Data.Client/GrpcFactory.cs | 79
HotelPms.Client.Blazor/Util/GrpcSubDirHandler.cs | 69
HotelPms.Share.Windows/Component/TabMarkFormatEventArgs.cs | 86
Protos/file.proto | 19
HotelPms.Client.Blazor/ViewModel/RoomStatus.cs | 28
HotelPms.Share.Windows/Report/CellStyle.cs | 72
Protos/receipt.proto | 64
HotelPms.WinForm/View/Menu.cs | 41
HotelPms.SourceFactory/FormValid.Designer.cs | 142
HotelPms.WinForm/View/UseInput/Detail.cs | 74
HotelPms.Client.Blazor/Shared/PersonCard.razor | 16
HotelPms.Share/Xml/SysXmlMgr.cs | 223
HotelPms.GrpcService/Services/UsePersonTelService.cs | 369
HotelPms.WinForm.Common/Util/Config.cs | 75
HotelPms.Client.Blazor/Pages/UseDetail/Input.razor | 1183
HotelPms.Share/Xml/XmlOperation.cs | 135
HotelPms.SourceFactory/ExcelToTable.cs | 90
HotelPms.Data.Server/ProtosExpan/Master/Readme.txt | 1
HotelPms.SourceFactory/Form1.resx | 120
HotelPms.GrpcService/Services/RoomViewTabService.cs | 369
ProtosExpan/Master/RoomCellTable.cs | 43
ProtosExpan/Master/RoomViewLayoutTable.cs | 43
HotelPms.Share.Windows/Component/GradientLabel.cs | 43
HotelPms.Share.Windows/Tool/DataSelector.cs | 352
HotelPms.Share/Data/Script/TableCreator.cs | 127
HotelPms.Client.Blazor/Program.cs | 98
HotelPms.VerUp/DataBase/DBCore.cs | 197
HotelPms.Share.Windows/Tool/CalendarSelectorOne.cs | 63
HotelPms.Client.Blazor/wwwroot/js/InputCore.js | 187
HotelPms.Share.Windows/Component/TreeMenu.cs | 727
HotelPms.Client.Blazor/Util/UseCore.cs | 10
HotelPms.Data.Server/ProtosExpan/Master/ReportCol.cs | 155
HotelPms.Share.Windows/Component/AntLabel.resx | 126
HotelPms.SourceFactory/Template/BeanFileMode_ts.txt | 13
HotelPms.Client.Blazor/Pages/UseDetail/Component2.razor.css | 5
HotelPms.Client.Blazor/Models/RoomTypeInputRow.cs | 124
HotelPms.SourceFactory/ExcelToTable.Designer.cs | 289
Protos/loginresult.proto | 17
Document/Sql/Partition.sql | 44
Protos/usedetail.proto | 79
ProtosExpan/UseInfo/Arrange.cs | 259
HotelPms.Client.Blazor/Properties/launchSettings.json | 41
HotelPms.Share.Windows/Report/FetchEventArgs.cs | 37
HotelPms.Client.Blazor/ViewModel/Hotel.cs | 29
HotelPms.Client.Blazor/Pages/UseDetail/SaleInput.razor | 349
HotelPms.SourceFactory/Form2.Designer.cs | 39
Document/SystemCenterDB設計.xlsx | 0
HotelPms.Share/Data/SqlDataChangeEventArgs.cs | 41
MudBlazorTemplates1/wwwroot/favicon.ico | 0
HotelPms.GrpcService/Services/AuthService.cs | 67
Protos/grpcset.proto | 19
HotelPms.Data.Common/Pagination/PagingRespone.cs | 10
HotelPms.Share.Windows/GraphicsApi/Star.cs | 90
HotelPms.Share.Windows/Component/Design/DesignItemCollection.cs | 180
HotelPms.Data.Common/Util/UseSql.cs | 153
HotelPms.WinForm.Common/Properties/Resources.Designer.cs | 103
HotelPms.Share.Windows/Report/Member/PrintSection.cs | 60
HotelPms.Share/Data/Script/ResourceFile.cs | 35
HotelPms.Share.Windows/Util/FormBase.Designer.cs | 82
HotelPms.DataAccessGrpc.Client/RoomTypeAccess.cs | 272
HotelPms.SourceFactory/FormMain.cs | 724
HotelPms.Client.Blazor/Pages/Parameter/UseInputArgs.cs | 44
HotelPms.Client.Blazor/Pages/UseDetail/Component1.razor.css | 4
Protos/usepersonfree.proto | 42
HotelPms.Share/Util/MessageEventHandler.cs | 16
HotelPms.Share.Windows/Report/ReportFactory.cs | 107
HotelPms.DataAccessGrpc.Client/UseDetailAccess.cs | 267
HotelPms.Client.Blazor/Services/BrowserResizeService.cs | 28
HotelPms.GrpcService/Services/RoomCellService.cs | 369
HotelPms.Client.Blazor/Pages/Applications/Email/EmailNavList.razor | 31
HotelPms.DataAccessGrpc.Client/ItemAccess.cs | 293
HotelPms.DataAccessGrpc.Client/UseFreeAccess.cs | 267
HotelPms.Client.Blazor/Util/SystemEnum.cs | 67
HotelPms.GrpcService/Properties/launchSettings.json | 13
HotelPms.Client.Blazor/Pages/UseDetail/CompanyInfo.razor | 308
HotelPms.Share.Windows/Report/FormTypeSelect.designer.cs | 270
HotelPms.Client.Blazor/ViewModel/Item.cs | 69
HotelPms.VerUp/HotelPms.VerUp.csproj | 13
656 files changed, 92,773 insertions(+), 0 deletions(-)
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..188a782
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,136 @@
+[*.cs]
+
+# CS8622: パラメーターの型における参照型の NULL 値の許容が、ターゲット デリゲートと一致しません。おそらく、NULL 値の許容の属性が原因です。
+dotnet_diagnostic.CS8622.severity = none
+csharp_indent_labels = one_less_than_current
+csharp_space_around_binary_operators = before_and_after
+csharp_using_directive_placement = outside_namespace:silent
+csharp_style_conditional_delegate_call = true:suggestion
+csharp_style_var_for_built_in_types = false:silent
+csharp_style_var_when_type_is_apparent = false:silent
+csharp_style_var_elsewhere = false:silent
+csharp_prefer_simple_using_statement = true:suggestion
+csharp_prefer_braces = true:silent
+csharp_style_namespace_declarations = block_scoped:silent
+csharp_style_prefer_switch_expression = true:suggestion
+csharp_style_prefer_pattern_matching = true:silent
+
+[*.{cs,vb}]
+tab_width = 4
+indent_size = 4
+dotnet_style_operator_placement_when_wrapping = beginning_of_line
+end_of_line = crlf
+dotnet_style_qualification_for_field = false:silent
+dotnet_style_qualification_for_property = false:silent
+dotnet_style_qualification_for_method = false:silent
+dotnet_style_qualification_for_event = false:silent
+dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
+dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
+dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
+dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
+[*.cs]
+#### 命名スタイル ####
+
+# 名前付けルール
+
+dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
+dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
+dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
+
+dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
+dotnet_naming_rule.types_should_be_pascal_case.symbols = types
+dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
+
+dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
+dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
+dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
+
+# 記号の仕様
+
+dotnet_naming_symbols.interface.applicable_kinds = interface
+dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
+dotnet_naming_symbols.interface.required_modifiers =
+
+dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
+dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
+dotnet_naming_symbols.types.required_modifiers =
+
+dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
+dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
+dotnet_naming_symbols.non_field_members.required_modifiers =
+
+# 命名スタイル
+
+dotnet_naming_style.begins_with_i.required_prefix = I
+dotnet_naming_style.begins_with_i.required_suffix =
+dotnet_naming_style.begins_with_i.word_separator =
+dotnet_naming_style.begins_with_i.capitalization = pascal_case
+
+dotnet_naming_style.pascal_case.required_prefix =
+dotnet_naming_style.pascal_case.required_suffix =
+dotnet_naming_style.pascal_case.word_separator =
+dotnet_naming_style.pascal_case.capitalization = pascal_case
+
+dotnet_naming_style.pascal_case.required_prefix =
+dotnet_naming_style.pascal_case.required_suffix =
+dotnet_naming_style.pascal_case.word_separator =
+dotnet_naming_style.pascal_case.capitalization = pascal_case
+
+# CS8604: Null 参照引数の可能性があります。
+dotnet_diagnostic.CS8604.severity = none
+
+# CS8600: Null リテラルまたは Null の可能性がある値を Null 非許容型に変換しています。
+dotnet_diagnostic.CS8600.severity = none
+
+# CS8602: null 参照の可能性があるものの逆参照です。
+dotnet_diagnostic.CS8602.severity = none
+
+# error WFO1000: プロパティ 'XXXXXXXX' は、プロパティ コンテンツのコード シリアル化を構成しません
+dotnet_diagnostic.WFO1000.severity = silent
+[*.vb]
+#### 命名スタイル ####
+
+# 名前付けルール
+
+dotnet_naming_rule.interface_should_be_i_で始まる.severity = suggestion
+dotnet_naming_rule.interface_should_be_i_で始まる.symbols = interface
+dotnet_naming_rule.interface_should_be_i_で始まる.style = i_で始まる
+
+dotnet_naming_rule.型_should_be_パスカル_ケース.severity = suggestion
+dotnet_naming_rule.型_should_be_パスカル_ケース.symbols = 型
+dotnet_naming_rule.型_should_be_パスカル_ケース.style = パスカル_ケース
+
+dotnet_naming_rule.フィールド以外のメンバー_should_be_パスカル_ケース.severity = suggestion
+dotnet_naming_rule.フィールド以外のメンバー_should_be_パスカル_ケース.symbols = フィールド以外のメンバー
+dotnet_naming_rule.フィールド以外のメンバー_should_be_パスカル_ケース.style = パスカル_ケース
+
+# 記号の仕様
+
+dotnet_naming_symbols.interface.applicable_kinds = interface
+dotnet_naming_symbols.interface.applicable_accessibilities = public, friend, private, protected, protected_friend, private_protected
+dotnet_naming_symbols.interface.required_modifiers =
+
+dotnet_naming_symbols.型.applicable_kinds = class, struct, interface, enum
+dotnet_naming_symbols.型.applicable_accessibilities = public, friend, private, protected, protected_friend, private_protected
+dotnet_naming_symbols.型.required_modifiers =
+
+dotnet_naming_symbols.フィールド以外のメンバー.applicable_kinds = property, event, method
+dotnet_naming_symbols.フィールド以外のメンバー.applicable_accessibilities = public, friend, private, protected, protected_friend, private_protected
+dotnet_naming_symbols.フィールド以外のメンバー.required_modifiers =
+
+# 命名スタイル
+
+dotnet_naming_style.i_で始まる.required_prefix = I
+dotnet_naming_style.i_で始まる.required_suffix =
+dotnet_naming_style.i_で始まる.word_separator =
+dotnet_naming_style.i_で始まる.capitalization = pascal_case
+
+dotnet_naming_style.パスカル_ケース.required_prefix =
+dotnet_naming_style.パスカル_ケース.required_suffix =
+dotnet_naming_style.パスカル_ケース.word_separator =
+dotnet_naming_style.パスカル_ケース.capitalization = pascal_case
+
+dotnet_naming_style.パスカル_ケース.required_prefix =
+dotnet_naming_style.パスカル_ケース.required_suffix =
+dotnet_naming_style.パスカル_ケース.word_separator =
+dotnet_naming_style.パスカル_ケース.capitalization = pascal_case
diff --git a/Document/Config.json b/Document/Config.json
new file mode 100644
index 0000000..0b46261
--- /dev/null
+++ b/Document/Config.json
@@ -0,0 +1,25 @@
+{
+ "Desc": "0.ExeFile(Sql更新、Create Table,Create Indexなど) 1.ExeCommand(SQL文直接発行) 2.View(Create View文(旧Viewを自動削除)) 3.Procedure(Create Procedure文(旧Proctrueを自動削除)) 4.Fuction(Create Fuction文(旧Fuctionを自動削除))",
+ "Data": [
+ {
+ "Name": "InitDB.sql",
+ "Type": 0
+ },
+ {
+ "Name": "UPDATE AA SET BB = 1",
+ "Type": 1
+ },
+ {
+ "Name": "View1.sql",
+ "Type": 2
+ },
+ {
+ "Name": "Procedure1.sql",
+ "Type": 3
+ },
+ {
+ "Name": "Fuction1.sql",
+ "Type": 4
+ }
+ ]
+}
\ No newline at end of file
diff --git a/Document/Etc/Backup20220701.zip b/Document/Etc/Backup20220701.zip
new file mode 100644
index 0000000..d7e3f32
--- /dev/null
+++ b/Document/Etc/Backup20220701.zip
Binary files differ
diff --git "a/Document/Etc/\345\210\227\350\250\255\345\256\232.png" "b/Document/Etc/\345\210\227\350\250\255\345\256\232.png"
new file mode 100644
index 0000000..dae3797
--- /dev/null
+++ "b/Document/Etc/\345\210\227\350\250\255\345\256\232.png"
Binary files differ
diff --git "a/Document/Etc/\351\203\250\345\261\213\345\210\245\344\270\200\350\246\247.png" "b/Document/Etc/\351\203\250\345\261\213\345\210\245\344\270\200\350\246\247.png"
new file mode 100644
index 0000000..caee134
--- /dev/null
+++ "b/Document/Etc/\351\203\250\345\261\213\345\210\245\344\270\200\350\246\247.png"
Binary files differ
diff --git a/Document/Git.xlsx b/Document/Git.xlsx
new file mode 100644
index 0000000..94f7ad6
--- /dev/null
+++ b/Document/Git.xlsx
Binary files differ
diff --git "a/Document/HotelCommonDB\350\250\255\350\250\210.xlsx" "b/Document/HotelCommonDB\350\250\255\350\250\210.xlsx"
new file mode 100644
index 0000000..866292f
--- /dev/null
+++ "b/Document/HotelCommonDB\350\250\255\350\250\210.xlsx"
Binary files differ
diff --git "a/Document/HotelPmsDB\350\250\255\350\250\210_\343\203\236\343\202\271\343\202\277.xlsx" "b/Document/HotelPmsDB\350\250\255\350\250\210_\343\203\236\343\202\271\343\202\277.xlsx"
new file mode 100644
index 0000000..eb1ce8c
--- /dev/null
+++ "b/Document/HotelPmsDB\350\250\255\350\250\210_\343\203\236\343\202\271\343\202\277.xlsx"
Binary files differ
diff --git "a/Document/HotelPmsDB\350\250\255\350\250\210_\345\210\251\347\224\250.xlsx" "b/Document/HotelPmsDB\350\250\255\350\250\210_\345\210\251\347\224\250.xlsx"
new file mode 100644
index 0000000..410487f
--- /dev/null
+++ "b/Document/HotelPmsDB\350\250\255\350\250\210_\345\210\251\347\224\250.xlsx"
Binary files differ
diff --git a/Document/Memo.txt b/Document/Memo.txt
new file mode 100644
index 0000000..5e6aaf1
--- /dev/null
+++ b/Document/Memo.txt
@@ -0,0 +1,21 @@
+�@�����e�[�u���쐬�A�ύX�i��lj��A�f�[�^�^�A�T�C�Y�ύX�j
+����폜���Ȃ�
+
+ALTER SEQUENCE dbo.SeqUseID RESTART WITH 0
+ALTER SEQUENCE dbo.SeqUsePerson RESTART WITH 0
+
+���C���{�C�X�Ή�
+���p�쐬���A�T�ō��敪����������A�A���A��ېō��݉\�A���̌�`�F�b�N���s���ׂ�
+
+���p�ۑ����˃o�b�N�O���E���h�����ŗ̎����쐬�A�X�V���s��
+
+���Ȗڎ��
+0.�h����{
+1.���A��{
+2.�h���lj�
+3.���A�lj�
+4.����
+
+�X�ɁuSubKind�v
+10--19�F�h����{����ʂȂ�
+20--29�F���A��{�����
\ No newline at end of file
diff --git a/Document/Sql/Import HotelPms.sql b/Document/Sql/Import HotelPms.sql
new file mode 100644
index 0000000..a152e10
--- /dev/null
+++ b/Document/Sql/Import HotelPms.sql
@@ -0,0 +1,155 @@
+USE [HotelPms]
+GO
+
+--�����^�C�v
+INSERT INTO [dbo].[M_RoomType]
+ ([ID]
+ ,[Name]
+ ,[ShortName]
+ ,[Kind]
+ ,[SortID]
+ ,[Visible]
+ ,[TypeListVisible]
+ ,[TypeListAlertCount]
+ ,[TypeListAlertColor]
+ ,[WebType]
+ ,[SendRate]
+ ,[SendLimit]
+ ,[Memo]
+ ,[UpdateDate]
+ ,[UpdateLoginID]
+ ,[UpdatePcName]
+ ,[UpdateID])
+SELECT [RoomTypeNo]
+ ,[RoomTypeName]
+ ,[RoomTypeShortName]
+ ,case when [RoomKind] = 5 then 3 else [RoomKind] - 1 end
+ ,[RoomTypeDispNo]
+ ,[RoomTypeDispFlg]
+ ,[TypeListDispFlg]
+ ,[TypeListRemainCount]
+ ,[TypeListRemainColor]
+ ,[NetGroupCode]
+ ,[SendRate]
+ ,[SendLimit]
+ ,[Memo]
+ ,[UpdateDate]
+ ,[UpdatePerson]
+ ,''
+ ,0
+ FROM [BHotelHW].[dbo].[M_RoomType]
+
+
+ INSERT INTO [dbo].[M_Room]
+ ([ID]
+ ,[TypeID]
+ ,[SortID]
+ ,[Floor]
+ ,[Name]
+ ,[Capacity]
+ ,[PBXID]
+ ,[RfgID]
+ ,[PTVID]
+ ,[Visible]
+ ,[OpeFlg]
+ ,[SignID]
+ ,[GradeID]
+ ,[BuildingID]
+ ,[HallType1]
+ ,[HallType2]
+ ,[Memo]
+ ,[UpdateDate]
+ ,[UpdateLoginID]
+ ,[UpdatePcName]
+ ,[UpdateID])
+SELECT [RoomNo]
+ ,[RoomTypeNo]
+ ,[DispSort]
+ ,[Floor]
+ ,[RoomName]
+ ,[Capacity]
+ ,[PBXNo]
+ ,[RefrigeratorNo]
+ ,[PTVNo]
+ ,[RoomDispFlg]
+ ,[OpeFlg]
+ ,[SignCode]
+ ,[GradeNo]
+ ,[BuildingNo]
+ ,[HallType]
+ ,[HallType2]
+ ,[Memo]
+ ,[UpdateDate]
+ ,[UpdatePerson]
+ ,''
+ ,0
+ FROM [BHotelHW].[dbo].[M_Room]
+ go
+
+
+ INSERT INTO [dbo].[M_RoomViewLayout]
+ ([TabID]
+ ,[Row]
+ ,[Col]
+ ,[RoomID]
+ ,[DisplayName]
+ ,[RowHeight]
+ ,[ColWidth]
+ ,[BackColor]
+ ,[ForeColor]
+ ,[Floor]
+ ,[FontName]
+ ,[FontSize]
+ ,[FontBold]
+ ,[FontItalic]
+ ,[FontUnderline]
+ ,[TextAlign]
+ ,[UpdateDate]
+ ,[UpdateLoginID]
+ ,[UpdatePcName]
+ ,[UpdateID])
+ select
+ [TabNo]
+ ,[Row]
+ ,[Col]
+ ,[RoomNo]
+ ,[DisplayName]
+ ,[RowHeight]
+ ,[ColWidth]
+ ,[BackColor]
+ ,[ForeColor]
+ ,[Floor]
+ ,[FontName]
+ ,[FontSize]
+ ,[FontBold]
+ ,[FontItalic]
+ ,[FontUnderline]
+ ,[TextAlign]
+ ,[UpdateDate]
+ ,[UpdatePerson]
+ ,''
+ ,0
+ FROM [BHotelHW].[dbo].[M_GuestRoomDisplay]
+ GO
+
+ --�����A�J���}�A#�J�n
+
+ update [M_RoomViewLayout] set ForeColor = '#FFFFFF' where ForeColor='16777215'
+ update [M_RoomViewLayout] set BackColor = '#FFFFFF' where BackColor='16777215'
+
+ update [M_RoomViewLayout] set ForeColor = '#FFFF00' where ForeColor='16776960'
+ update [M_RoomViewLayout] set BackColor = '#FFFF00' where BackColor='16776960'
+
+ update [M_RoomViewLayout] set ForeColor = '#00FF00' where ForeColor='65280'
+ update [M_RoomViewLayout] set BackColor = '#00FF00' where BackColor='65280'
+
+ INSERT INTO [dbo].[M_RoomViewTab]
+ ([ID]
+ ,[Name]
+ ,[UpdateDate]
+ ,[UpdateLoginID]
+ ,[UpdatePcName]
+ ,[UpdateID])
+select TabNo,TabName,UpdateDate,UpdatePerson,'',0
+ FROM [BHotelHW].[dbo].M_GuestRoomTab
+GO
\ No newline at end of file
diff --git a/Document/Sql/Partition.sql b/Document/Sql/Partition.sql
new file mode 100644
index 0000000..e0822d5
--- /dev/null
+++ b/Document/Sql/Partition.sql
@@ -0,0 +1,44 @@
+ALTER DATABASE HotelPms REMOVE FILE IntFileGroup01
+ALTER DATABASE HotelPms REMOVE FILE IntFileGroup02
+ALTER DATABASE HotelPms REMOVE FILE IntFileGroup03
+ALTER DATABASE HotelPms REMOVE FILE IntFileGroup04
+ALTER DATABASE HotelPms REMOVE FILE IntFileGroup05
+ALTER DATABASE HotelPms REMOVE FILE IntFileGroup06
+ALTER DATABASE HotelPms REMOVE FILE IntFileGroup07
+ALTER DATABASE HotelPms REMOVE FILE IntFileGroup08
+ALTER DATABASE HotelPms REMOVE FILE IntFileGroup09
+ALTER DATABASE HotelPms REMOVE FILE IntFileGroup10
+
+ALTER DATABASE HotelPms REMOVE FILEGROUP IntFileGroup01
+ALTER DATABASE HotelPms REMOVE FILEGROUP IntFileGroup02
+ALTER DATABASE HotelPms REMOVE FILEGROUP IntFileGroup03
+ALTER DATABASE HotelPms REMOVE FILEGROUP IntFileGroup04
+ALTER DATABASE HotelPms REMOVE FILEGROUP IntFileGroup05
+ALTER DATABASE HotelPms REMOVE FILEGROUP IntFileGroup06
+ALTER DATABASE HotelPms REMOVE FILEGROUP IntFileGroup07
+ALTER DATABASE HotelPms REMOVE FILEGROUP IntFileGroup08
+ALTER DATABASE HotelPms REMOVE FILEGROUP IntFileGroup09
+ALTER DATABASE HotelPms REMOVE FILEGROUP IntFileGroup10
+
+ALTER DATABASE HotelPms REMOVE FILE DateFileGroup01
+ALTER DATABASE HotelPms REMOVE FILE DateFileGroup02
+ALTER DATABASE HotelPms REMOVE FILE DateFileGroup03
+ALTER DATABASE HotelPms REMOVE FILE DateFileGroup04
+ALTER DATABASE HotelPms REMOVE FILE DateFileGroup05
+ALTER DATABASE HotelPms REMOVE FILE DateFileGroup06
+ALTER DATABASE HotelPms REMOVE FILE DateFileGroup07
+ALTER DATABASE HotelPms REMOVE FILE DateFileGroup08
+ALTER DATABASE HotelPms REMOVE FILE DateFileGroup09
+ALTER DATABASE HotelPms REMOVE FILE DateFileGroup10
+
+ALTER DATABASE HotelPms REMOVE FILEGROUP DateFileGroup01
+ALTER DATABASE HotelPms REMOVE FILEGROUP DateFileGroup02
+ALTER DATABASE HotelPms REMOVE FILEGROUP DateFileGroup03
+ALTER DATABASE HotelPms REMOVE FILEGROUP DateFileGroup04
+ALTER DATABASE HotelPms REMOVE FILEGROUP DateFileGroup05
+ALTER DATABASE HotelPms REMOVE FILEGROUP DateFileGroup06
+ALTER DATABASE HotelPms REMOVE FILEGROUP DateFileGroup07
+ALTER DATABASE HotelPms REMOVE FILEGROUP DateFileGroup08
+ALTER DATABASE HotelPms REMOVE FILEGROUP DateFileGroup09
+ALTER DATABASE HotelPms REMOVE FILEGROUP DateFileGroup10
+
diff --git "a/Document/Sql/\345\210\227\350\250\255\345\256\232\350\277\275\345\212\240.sql" "b/Document/Sql/\345\210\227\350\250\255\345\256\232\350\277\275\345\212\240.sql"
new file mode 100644
index 0000000..e1f0961
--- /dev/null
+++ "b/Document/Sql/\345\210\227\350\250\255\345\256\232\350\277\275\345\212\240.sql"
@@ -0,0 +1,26 @@
+--INSERT INTO S_ReportCol
+--SELECT 10001,name,'' FROM HotelPms.sys.columns WHERE object_id = OBJECT_ID('HotelPms.dbo.M_Building')
+
+DELETE FROM S_ReportCol WHERE ReportID = 10000;
+
+INSERT INTO S_ReportCol
+SELECT 10000,A.column_id, A.name, CASE WHEN b.value IS NULL THEN A.name ELSE CAST(b.value AS NVARCHAR) END,GETDATE(),0,'',0 FROM HotelPms.sys.columns A
+LEFT JOIN HotelPms.sys.extended_properties B ON A.object_id = B.major_id AND A.column_id = B.minor_id AND B.name='MS_Description'
+WHERE object_id = OBJECT_ID('HotelPms.dbo.M_Demo')
+
+
+DELETE FROM S_ReportCol WHERE ReportID = 10001;
+
+INSERT INTO S_ReportCol
+SELECT 10001,A.column_id, A.name, CASE WHEN b.value IS NULL THEN A.name ELSE CAST(b.value AS NVARCHAR) END,GETDATE(),0,'',0 FROM HotelPms.sys.columns A
+LEFT JOIN HotelPms.sys.extended_properties B ON A.object_id = B.major_id AND A.column_id = B.minor_id AND B.name='MS_Description'
+WHERE object_id = OBJECT_ID('HotelPms.dbo.M_Building')
+
+DELETE FROM S_ReportCol WHERE ReportID = 10002;
+
+INSERT INTO S_ReportCol
+SELECT 10002,A.column_id, A.name, CASE WHEN b.value IS NULL THEN A.name ELSE CAST(b.value AS NVARCHAR) END,GETDATE(),0,'',0 FROM HotelPms.sys.columns A
+LEFT JOIN HotelPms.sys.extended_properties B ON A.object_id = B.major_id AND A.column_id = B.minor_id AND B.name='MS_Description'
+WHERE object_id = OBJECT_ID('HotelPms.dbo.M_RoomStatus')
+
+--EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'����' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'M_Building', @level2type=N'COLUMN',@level2name=N'Name'
\ No newline at end of file
diff --git "a/Document/SystemCenterDB\350\250\255\350\250\210.xlsx" "b/Document/SystemCenterDB\350\250\255\350\250\210.xlsx"
new file mode 100644
index 0000000..2127c46
--- /dev/null
+++ "b/Document/SystemCenterDB\350\250\255\350\250\210.xlsx"
Binary files differ
diff --git "a/Document/\343\202\267\343\202\271\343\203\206\343\203\240\346\247\213\346\210\220\345\233\263.xlsx" "b/Document/\343\202\267\343\202\271\343\203\206\343\203\240\346\247\213\346\210\220\345\233\263.xlsx"
new file mode 100644
index 0000000..4d7a789
--- /dev/null
+++ "b/Document/\343\202\267\343\202\271\343\203\206\343\203\240\346\247\213\346\210\220\345\233\263.xlsx"
Binary files differ
diff --git a/HotelPms.Client.Blazor/App.razor b/HotelPms.Client.Blazor/App.razor
new file mode 100644
index 0000000..57b44fc
--- /dev/null
+++ b/HotelPms.Client.Blazor/App.razor
@@ -0,0 +1,27 @@
+@using Microsoft.AspNetCore.Authorization
+@inject IGlobalLoadingSpinner globalLoadingSpinner
+<Router AppAssembly="@typeof(App).Assembly">
+ <Found Context="routeData">
+ <RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
+ </Found>
+ <NotFound>
+ <PageTitle>Not found</PageTitle>
+ <LayoutView Layout="@typeof(MainLayout)">
+ <p role="alert">Sorry, there's nothing at this address.</p>
+ </LayoutView>
+ </NotFound>
+</Router>
+@code
+{
+ protected override void OnInitialized()
+ {
+ base.OnInitialized();
+ }
+
+ protected async override Task OnAfterRenderAsync(bool firstRender)
+ {
+ await base.OnAfterRenderAsync(firstRender);
+ await globalLoadingSpinner.HideLogoAsync();
+ await globalLoadingSpinner.HideAsync();
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.Client.Blazor/Dialog/ColSetting.razor b/HotelPms.Client.Blazor/Dialog/ColSetting.razor
new file mode 100644
index 0000000..e749425
--- /dev/null
+++ b/HotelPms.Client.Blazor/Dialog/ColSetting.razor
@@ -0,0 +1,599 @@
+@inject GrpcChannel Channel
+@inject IJSRuntime JSRuntime
+@inject IDialogService DialogService
+@using HotelPms.Client.Blazor.Util
+@using HotelPms.Client.Blazor.ViewModel
+@using HotelPms.Data.Common
+@using static HotelPms.Client.Blazor.Util.SystemEnum
+@if(Data != null)
+{
+<MudDialog Style="width: 800px;">
+ <DialogContent>
+ <MudGrid Justify="Justify.Center">
+ <MudItem xs="6">
+ <MudTextField Margin="Margin.Normal" @bind-Value="Data.ReportName" Label="帳票名" Variant="Variant.Outlined" ReadOnly="true"></MudTextField>
+ </MudItem>
+ <MudItem xs="@(mode == 0 ? 6 : 5)">
+ <MudTextField @ref="txtOutputName" T="string" Error="@txtOutputNameError" ErrorText="@txtOutputNameErrorText" Margin="Margin.Normal" @bind-Value="Data.OutputName" Label="出力パターン" Variant="Variant.Outlined" OnBlur="OutputNameLeave"></MudTextField>
+ </MudItem>
+ @if (mode == 1)
+ {
+ <MudItem xs="1" Style="margin: auto">
+ <MudTooltip Text="削除" Placement="Placement.Top">
+ <MudFab Icon="@Icons.Material.Filled.Close" Color="MudBlazor.Color.Error" Size="@Size.Medium" IconSize="@Size.Medium" OnClick="@(()=>RemoveOutput())" />
+ </MudTooltip>
+ </MudItem>
+ }
+ <MudItem xs="6">
+ <MudGrid>
+ <MudItem xs="12">
+ <label style="
+ box-shadow: 0 2px 7px @(mode == 0 ? "#4caf50" : "#304FFE");
+ display: inline-flex;
+ width: 150px;
+ justify-content: center;
+ border-radius: 2em;
+ color: white;
+ border:2px solid;
+ align-items: center;
+ padding:8px;
+ letter-spacing: 2px;
+ font-size:medium;
+ background-color: @(mode == 0 ? "#4caf50" : "#304FFE");">
+ <MudIcon Icon="@Icons.Material.Filled.GridView" Size="@Size.Small"/>@(mode == 0 ? "新規モード" : "変更モード")
+ </label>
+ <!-- <MudChip Size="Size.Large" Icon="@Icons.Material.Filled.GridView" Color="MudBlazor.Color.Secondary" Style="width: 150px;">新規</MudChip> -->
+ </MudItem>
+ <MudItem xs="9">
+ <MudTextField Margin="Margin.Dense" @bind-Value="Data.Sort1" Label="第一ソート" Variant="Variant.Outlined" ReadOnly="true" Adornment=" Adornment.End" AdornmentIcon="@Icons.Filled.Search" AdornmentColor="MudBlazor.Color.Secondary" OnAdornmentClick="@(()=>SetSort(1))"></MudTextField>
+ </MudItem>
+ <MudItem xs="3">
+ <MudTooltip Text="解除" Placement="Placement.Top">
+ <MudFab Icon="@Icons.Material.Filled.DomainDisabled" Color="MudBlazor.Color.Primary" Size="@Size.Small" IconSize="@Size.Small" OnClick="@(()=>ClearSort(1))" />
+ </MudTooltip>
+ </MudItem>
+ <MudItem xs="9">
+ <MudTextField Margin="Margin.Dense" @bind-Value="Data.Sort2" Label="第二ソート" Variant="Variant.Outlined" ReadOnly="true" Adornment=" Adornment.End" AdornmentIcon="@Icons.Filled.Search" AdornmentColor="MudBlazor.Color.Secondary" OnAdornmentClick="@(()=>SetSort(2))"></MudTextField>
+ </MudItem>
+ <MudItem xs="3">
+ <MudTooltip Text="解除" Placement="Placement.Top">
+ <MudFab Icon="@Icons.Material.Filled.DomainDisabled" Color="MudBlazor.Color.Primary" Size="@Size.Small" IconSize="@Size.Small" OnClick="@(()=>ClearSort(2))" />
+ </MudTooltip>
+ </MudItem>
+ </MudGrid>
+ </MudItem>
+ <MudItem xs="6">
+ <MudPaper Width="100%" Height="200px;" Style="overflow:auto;">
+ <MudList Clickable="true" Dense="true" @bind-SelectedItem="SelectedOutput">
+ @foreach(HotelPms.Data.Master.Output item in Data.OutputList)
+ {
+ <MudListItem Text="@item.Name" Value="@item.Name" Tag = "@item"/>
+ }
+ </MudList>
+ </MudPaper>
+ </MudItem>
+ <MudItem xs="4">
+ <MudText Typo="Typo.h5" GutterBottom="true">項目一覧</MudText>
+ <MudPaper Width="100%" Height="220px;" Style="overflow:auto;">
+ <MudList Clickable="true" Dense="true" @bind-SelectedItem="SelectedCol">
+ @foreach(string item in Data.OrgColList)
+ {
+ <MudListItem Text="@item" Value="@item"/>
+ }
+ </MudList>
+ </MudPaper>
+ </MudItem>
+ <MudItem xs="2">
+ <MudButton Variant="Variant.Filled" EndIcon="@Icons.Material.Filled.ArrowForward" Color="MudBlazor.Color.Primary" Class="mt-10" Style="width: 110px;" OnClick="AddCol">追加</MudButton>
+ <MudButton Variant="Variant.Filled" EndIcon="@Icons.Material.Filled.ArrowForwardIos" Color="MudBlazor.Color.Primary" Class="mt-2" Style="width: 110px;" OnClick="AddAllCol">一括</MudButton>
+ <MudButton Variant="Variant.Filled" EndIcon="@Icons.Material.Filled.Remove" Color="MudBlazor.Color.Primary" Class="mt-2" Style="width: 110px;" OnClick="DelCol">削除</MudButton>
+ <MudButton Variant="Variant.Filled" EndIcon="@Icons.Material.Filled.ArrowUpward" Color="MudBlazor.Color.Primary" Class="mt-2" Style="width: 110px;" OnClick="UpCol">一つ上</MudButton>
+ <MudButton Variant="Variant.Filled" EndIcon="@Icons.Material.Filled.ArrowDownward" Color="MudBlazor.Color.Primary" Class="mt-2" Style="width: 110px;" OnClick="DownCol">一つ下</MudButton>
+ </MudItem>
+ <MudItem xs="6">
+ <MudGrid>
+ <MudItem xs="7">
+ <MudText Typo="Typo.h5">出力項目</MudText>
+ </MudItem>
+ <MudItem xs="5">
+ <MudButton Variant="Variant.Filled" EndIcon="@Icons.Material.Filled.Clear" Color="MudBlazor.Color.Primary" Style="width: 110px;" OnClick="ClearCol">クリア</MudButton>
+ </MudItem>
+ <MudItem xs="12">
+ <MudTable id="@tableOwnerID" Items="@Data.Rows" Dense="true" Hover="true" ReadOnly="false" FixedHeader="true" Height="200px;" Striped ="true" T="ColSettingRow" OnRowClick="OnRowClick">
+ <ColGroup>
+ <col />
+ <col style="width:50px;" />
+ <col style="width:100px;" />
+ </ColGroup>
+ <HeaderContent>
+ <MudTh>項目</MudTh>
+ <MudTh>固定</MudTh>
+ <MudTh>列幅</MudTh>
+ </HeaderContent>
+ <RowTemplate>
+ <MudTd DataLabel="項目" Class="@context.ClassName">@context.Name</MudTd>
+ <MudTd DataLabel="固定" Class="@context.ClassName"><MudCheckBox Checked="@context.Frozen" Dense="true" T="bool" CheckedChanged="((v)=>CheckedChanged(v, context))"></MudCheckBox></MudTd>
+ <MudTd DataLabel="列幅" Class="@context.ClassName">
+ <MudNumericField @bind-Value="@context.Width" Required Min="1" TextChanged="TextChanged" />
+ </MudTd>
+ </RowTemplate>
+ </MudTable>
+ </MudItem>
+ </MudGrid>
+ </MudItem>
+ </MudGrid>
+ </DialogContent>
+ <DialogActions>
+ <MudGrid Spacing="2" Justify="Justify.Center" Class="my-3">
+ <MudItem>
+ <MudButton Variant="Variant.Filled" Color="MudBlazor.Color.Primary" OnClick="Save" StartIcon="@Icons.Filled.Save" Style="width: 180px; height: 40px;">保存</MudButton>
+ </MudItem>
+ <MudItem>
+ <MudButton Variant="Variant.Filled" Color="MudBlazor.Color.Primary" OnClick="Close" StartIcon="@Icons.Filled.Close" Style="width: 180px; height: 40px;">キャンセル</MudButton>
+ </MudItem>
+ </MudGrid>
+ </DialogActions>
+</MudDialog>
+}
+
+<style>
+#col-setting-grid .mud-input-control>.mud-input-control-input-container>div.mud-input.mud-input-text {
+ margin-top: 0px;
+}
+
+#col-setting-grid .mud-input>input.mud-input-root,div.mud-input-slot.mud-input-root {
+ padding: 0 0 7px;
+}
+
+#col-setting-grid .mud-table-cell .mud-checkbox {
+ margin: -2px;
+}
+
+#col-setting-grid .mud-table-cell {
+ padding: 6px 6px 6px 6px;
+ padding-inline-start: 6px;padding-inline-end: 6px;
+}
+
+#col-setting-grid .tr-select {
+ color: var(--mud-palette-primary);
+ background-color: var(--mud-palette-primary-hover);
+ <!-- background-color: rgba(223,235,242, 0.77); -->
+}
+
+</style>
+
+@code {
+ [CascadingParameter] MudDialogInstance MudDialog { get; set; }
+ [Parameter]public ColSettingData Data { get; set; }
+ private int mode = 0; //0.新規 1.変更
+ private string selectCol = string.Empty;
+ private int selectRowID = -1;
+ private List<string> colListCopy = new List<string>();
+ private string tableOwnerID = "col-setting-grid";
+ private DataTable sortTable = new DataTable();
+ private MudTextField<string> txtOutputName;
+ private bool txtOutputNameError = false;
+ private string txtOutputNameErrorText = string.Empty;
+ private OutputAccess outputAccess;
+ private HotelPms.Data.Master.Output outputEdit = null;
+
+ private MudListItem selectedOutput;
+
+ /// <summary>
+ /// bindValue対応
+ /// </summary>
+ MudListItem SelectedOutput
+ {
+ get { return selectedOutput; }
+ set
+ {
+ selectedOutput = value;
+ SelectedItemChanged(selectedOutput);
+ }
+ }
+
+ private MudListItem selectedCol;
+
+ /// <summary>
+ /// bindValue対応
+ /// </summary>
+ MudListItem SelectedCol
+ {
+ get { return selectedCol; }
+ set
+ {
+ selectedCol = value;
+ SelectedColChanged(selectedCol);
+ }
+ }
+
+ /// <summary>
+ /// ※長い時間の処理をここに入れるな
+ /// </summary>
+ protected override void OnInitialized()
+ {
+ if(outputAccess == null) { outputAccess = new OutputAccess(Channel); }
+
+ if (Data.OrgColList.Count > 0 && colListCopy.Count == 0)
+ {
+ colListCopy.AddRange(Data.OrgColList);
+ selectCol = Data.OrgColList[0]; //初期値
+
+ //ソート選択用
+ sortTable.Columns.Add("項目ID");
+ sortTable.Columns.Add("項目名");
+ int id = 1;
+ foreach(string item in colListCopy)
+ {
+ DataRow row = sortTable.NewRow();
+ sortTable.Rows.Add(row);
+ row.ItemArray = new object[] { id, item };
+ id++;
+ }
+ }
+ base.OnInitialized();
+ }
+
+ private void SelectedItemChanged(MudListItem item)
+ {
+ EnvironmentSetting.Debug($"SelectedItemChanged⇒Begin:{DateTime.Now.ToString("HH:mm:ss fff")}");
+ Data.OutputName = item?.Text;
+
+ outputEdit = (item?.Tag as HotelPms.Data.Master.Output);
+ Data.OutputID = outputEdit.ID;
+ mode = 1; //変更モードへ
+
+ //列の表示
+ Dictionary<string , int> dict = new Dictionary<string, int>();
+ Data.Rows.Clear();
+ int id = 0;
+ foreach(HotelPms.Data.Master.OutputItem outputItem in outputEdit.Items)
+ {
+ Data.Rows.Add(new ColSettingRow
+ {
+ ID = ++id,
+ Name = outputItem.Name,
+ Width = (int)outputItem.Width,
+ Frozen = id <= outputEdit.FixedID,
+ });
+ dict.Add(outputItem.Name, 0);
+ }
+ selectRowID = -1;
+
+ selectCol = string.Empty;
+ Data.OrgColList.Clear();
+ foreach (string col in colListCopy)
+ {
+ if (dict.ContainsKey(col)) { continue; }
+ Data.OrgColList.Add(col);
+ }
+
+ if (Data.OrgColList.Count > 0)
+ {
+ selectCol = Data.OrgColList[0]; //初期値
+ }
+
+ EnvironmentSetting.Debug($"SelectedItemChanged⇒End:{DateTime.Now.ToString("HH:mm:ss fff")}");
+ }
+
+ /// <summary>
+ /// 列選択
+ /// </summary>
+ /// <param name="item"></param>
+ private void SelectedColChanged(MudListItem item)
+ {
+ selectCol = item?.Text;
+ }
+
+ /// <summary>
+ /// 行選択
+ /// </summary>
+ /// <param name="e"></param>
+ private void OnRowClick(TableRowClickEventArgs<ColSettingRow> e)
+ {
+ foreach(ColSettingRow row in Data.Rows)
+ {
+ if (row.ID == e.Item.ID)
+ {
+ row.Select();
+ selectRowID = row.ID - 1;
+ }
+ else
+ {
+ row.ClassName = "";
+ }
+ }
+
+ //MudDialog.Close(DialogResult.Ok(e.Item));
+ }
+
+ /// <summary>
+ /// ソート設定
+ /// </summary>
+ /// <param name="index"></param>
+ private async void SetSort(int index)
+ {
+ var parameters = new DialogParameters { ["Data"]=sortTable };
+ var dialog = DialogService.Show<SelectList>($"第{(index == 1 ? "一" : "二")}ソート順設定", parameters);
+ var ret = await dialog.Result;
+ if (!ret.Cancelled)
+ {
+ var row = ret.Data as DataRow;
+ if(index == 1)
+ {
+ Data.Sort1 = row[1].ToString();
+ }
+ else
+ {
+ Data.Sort2 = row[1].ToString();
+ }
+ StateHasChanged();
+ }
+ }
+
+ /// <summary>
+ /// ソート解除
+ /// </summary>
+ /// <param name="index">1.第一ソート 2.第二ソート</param>
+ private void ClearSort(int index)
+ {
+ if (index == 1)
+ {
+ Data.Sort1 = string.Empty;
+ }
+ else
+ {
+ Data.Sort2 = string.Empty;
+ }
+ }
+
+ private void TextChanged(string value)
+ {
+ //foreach(ColSettingRow row in Data.Rows)
+ //{
+ // row.Width = CConvert.ToInt(value);
+ //}
+ }
+
+ private void CheckedChanged(bool value, ColSettingRow curRow)
+ {
+ foreach(ColSettingRow row in Data.Rows)
+ {
+ if (row.ID < curRow.ID)
+ {
+ if (value) { row.Frozen = value; }
+ }
+ else if (row.ID == curRow.ID)
+ {
+ row.Frozen = value;
+ }
+ else
+ {
+ row.Frozen = false;
+ }
+ }
+ }
+
+ /// <summary>
+ /// パターン名のチェック
+ /// </summary>
+ /// <param name="value"></param>
+ /// <returns></returns>
+ private bool IsVaildOutputName(string value)
+ {
+ if (string.IsNullOrEmpty(value))
+ {
+ txtOutputNameError = true;
+ txtOutputNameErrorText = "名称を入力してください。";
+ return false;
+ }
+ else
+ {
+ txtOutputNameError = false;
+ txtOutputNameErrorText = string.Empty;
+ return true;
+ }
+ }
+
+ private void OutputNameLeave(FocusEventArgs e)
+ {
+ IsVaildOutputName(Data.OutputName);
+ }
+
+ private async Task RemoveOutput()
+ {
+ var parameters = new DialogParameters { ["MsgType"]=EMessageType.YesNo, ["Title"]="削除" ,["Data"]= new List<string> { $"「{outputEdit.Name}」を削除しますか?" } };
+ var dialog = DialogService.Show<MessageBox>(string.Empty, parameters);
+ var result = await dialog.Result;
+ if (result.Cancelled)
+ {
+ return;
+ }
+
+ await outputAccess.RemoveAsync($" MachineName = '{outputEdit.MachineName}' AND UserName = '{outputEdit.UserName}' AND ReportID = {outputEdit.ReportID} AND ID = {outputEdit.ID}");
+ MudDialog.Close(DialogResult.Ok("2"));
+ }
+
+ /// <summary>
+ /// 登録
+ /// </summary>
+ private async void Save()
+ {
+ //チェック
+ if (!IsVaildOutputName(Data.OutputName))
+ {
+ await txtOutputName.FocusAsync();
+ return;
+ }
+
+ if(Data.Rows.Count == 0)
+ {
+ await DialogService.ShowMessageBox("出力項目一覧","出力項目を選択してください。");
+ return;
+ }
+
+ //Outputの登録
+ HotelPms.Data.Master.Output output = mode == 1 ? outputEdit : new HotelPms.Data.Master.Output
+ {
+ MachineName = "localhost",
+ UserName = "Web",
+ ReportID = Data.ReportID,
+ ID = Data.OutputID,
+ Name = Data.OutputName,
+ FixedID = 0,
+ Sort = $"{Data.Sort1},{Data.Sort2}",
+ };
+
+ if(mode == 1)
+ {
+ output.Name = Data.OutputName;
+ output.Sort = $"{Data.Sort1},{Data.Sort2}";
+ output.Items.Clear();
+ }
+
+ int maxFixedID = 0;
+ foreach(ColSettingRow row in Data.Rows)
+ {
+ if(row.Frozen && row.ID > maxFixedID) { maxFixedID = row.ID; }
+ Data.Master.OutputItem detail = new Data.Master.OutputItem
+ {
+ Name = row.Name,
+ Width = row.Width,
+ };
+ output.Items.Add(detail);
+ }
+
+ output.FixedID = maxFixedID;
+ DataResult result = mode == 0 ? await outputAccess.AddAsync(output) : await outputAccess.UpdateAsync(output);
+
+ MudDialog.Close(DialogResult.Ok("1"));
+ //if (mode == 0)
+ //{
+ // mode = 1; //変更モードへ
+ // Data.OutputList.Add(output); //明細あり
+ //}
+ //StateHasChanged();
+ }
+
+ /// <summary>
+ /// 画面閉じる
+ /// </summary>
+ private void Close()
+ {
+ MudDialog.Cancel();
+ }
+
+ /// <summary>
+ /// 列追加
+ /// </summary>
+ private void AddCol()
+ {
+ if(selectCol.Length == 0) { return; }
+ int index = Data.OrgColList.IndexOf(selectCol);
+ Data.OrgColList.RemoveAt(index);
+ Data.Rows.Add(new ColSettingRow
+ {
+ ID = Data.Rows.Count + 1,
+ Name = selectCol,
+ });
+
+ //mud-selected-item
+ if (index >= Data.OrgColList.Count)
+ {
+ selectCol = Data.OrgColList.Count == 0 ? string.Empty : Data.OrgColList[index - 1];
+ }
+ else
+ {
+ selectCol = Data.OrgColList[index];
+ }
+ }
+
+ /// <summary>
+ /// 列全部追加
+ /// </summary>
+ private void AddAllCol()
+ {
+ int id = Data.Rows.Count;
+ foreach(string item in Data.OrgColList)
+ {
+ id++;
+ Data.Rows.Add(new ColSettingRow
+ {
+ ID = id,
+ Name = item,
+ });
+ }
+
+ Data.OrgColList.Clear();
+ selectCol = string.Empty;
+ }
+
+ /// <summary>
+ /// 列削除
+ /// </summary>
+ private void DelCol()
+ {
+ if (selectRowID == -1) { return; }
+ Data.OrgColList.Add(Data.Rows[selectRowID].Name);
+ Data.Rows.RemoveAt(selectRowID);
+ if (selectRowID >= Data.Rows.Count)
+ {
+ selectRowID = Data.Rows.Count - 1;
+ if (selectRowID >= 0) { Data.Rows[selectRowID].Select(); }
+ }
+ else
+ {
+ Data.Rows[selectRowID].Select();
+
+ //以降のIDを更新
+ int id = selectRowID;
+ for (int i = selectRowID; i < Data.Rows.Count; i++)
+ {
+ Data.Rows[i].ID = ++id;
+ }
+ }
+ }
+
+ private async void UpCol()
+ {
+ if (selectRowID <= 0) { return; }
+ //上と⇒情報交換
+ Data.Rows[selectRowID].ID -= 1;
+ Data.Rows[selectRowID - 1].ID += 1;
+
+ ColSettingRow bkRow = Data.Rows[selectRowID - 1].DeepClone();
+ Data.Rows[selectRowID].CopyTo(Data.Rows[selectRowID - 1]);
+ bkRow.CopyTo(Data.Rows[selectRowID]);
+ selectRowID--;
+ await JSRuntime.SetTRTop(tableOwnerID, selectRowID);
+ StateHasChanged();
+ }
+
+ private async void DownCol()
+ {
+ if (selectRowID == Data.Rows.Count - 1) { return; }
+ //下と⇒情報交換
+ Data.Rows[selectRowID].ID += 1;
+ Data.Rows[selectRowID + 1].ID -= 1;
+
+ ColSettingRow bkRow = Data.Rows[selectRowID + 1].DeepClone();
+ Data.Rows[selectRowID].CopyTo(Data.Rows[selectRowID + 1]);
+ bkRow.CopyTo(Data.Rows[selectRowID]);
+ selectRowID++;
+ await JSRuntime.SetTRTop(tableOwnerID, selectRowID);
+ }
+
+
+
+ /// <summary>
+ /// 列クリア
+ /// </summary>
+ private void ClearCol()
+ {
+ Data.OrgColList.Clear();
+ Data.OrgColList.AddRange(colListCopy);
+ Data.Rows.Clear();
+ selectCol = Data.OrgColList.Count == 0 ? string.Empty : Data.OrgColList[0];
+ selectRowID = -1;
+ }
+}
diff --git a/HotelPms.Client.Blazor/Dialog/MessageBox.razor b/HotelPms.Client.Blazor/Dialog/MessageBox.razor
new file mode 100644
index 0000000..66159f5
--- /dev/null
+++ b/HotelPms.Client.Blazor/Dialog/MessageBox.razor
@@ -0,0 +1,59 @@
+@using static HotelPms.Client.Blazor.Util.SystemEnum
+<MudDialog Style="width: 300px;">
+ <TitleContent>
+ <MudText Typo="Typo.h6">
+ <MudIcon Icon="@Icons.Material.Filled.Info" Class="mr-3 mb-n1"/>
+ @Title
+ </MudText>
+ </TitleContent>
+ <DialogContent>
+ <MudGrid Justify="Justify.FlexStart" Class="align-center my-n3">
+ @foreach(string item in Data)
+ {
+ <MudItem xs="12" Class="py-1">
+ <MudText Color="@Color.Default">@item</MudText>
+ </MudItem>
+ }
+ </MudGrid>
+ </DialogContent>
+ <DialogActions>
+ <MudGrid Spacing="2" Justify="Justify.Center" Class="my-3">
+ <MudItem>
+ <MudButton Variant="Variant.Filled" Color="MudBlazor.Color.Error" OnClick="Save" StartIcon="@Icons.Filled.Done" Style="width: 100px; height: 40px;">@GetText1()</MudButton>
+ </MudItem>
+ @if (MsgType == EMessageType.OKCancel || MsgType == EMessageType.YesNo)
+ {
+ <MudItem>
+ <MudButton Variant="Variant.Filled" Color="MudBlazor.Color.Primary" OnClick="Close" StartIcon="@Icons.Filled.Close" Style="width: 100px; height: 40px;">@GetText2()</MudButton>
+ </MudItem>
+ }
+ </MudGrid>
+ </DialogActions>
+</MudDialog>
+
+@code {
+ [CascadingParameter] MudDialogInstance MudDialog { get; set; }
+ [Parameter] public EMessageType MsgType { get; set; }
+ [Parameter] public string Title { get; set; }
+ [Parameter] public List<string> Data { get; set; }
+
+ private string GetText1()
+ {
+ return MsgType == EMessageType.YesNo ? "はい" : "OK";
+ }
+
+ private string GetText2()
+ {
+ return MsgType == EMessageType.YesNo ? "いいえ" : "キャンセル";
+ }
+
+ private void Close()
+ {
+ MudDialog.Cancel();
+ }
+
+ private void Save()
+ {
+ MudDialog.Close(DialogResult.Ok("OK"));
+ }
+}
diff --git a/HotelPms.Client.Blazor/Dialog/MessageContext.razor b/HotelPms.Client.Blazor/Dialog/MessageContext.razor
new file mode 100644
index 0000000..8c9f49b
--- /dev/null
+++ b/HotelPms.Client.Blazor/Dialog/MessageContext.razor
@@ -0,0 +1,12 @@
+<MudGrid Justify="Justify.FlexStart" Class="align-center my-n3">
+ <MudItem xs="12" Class="py-1">
+ <MudText Typo="Typo.h5" Color="@Color.Default">該当データが存在しません。</MudText>
+ </MudItem>
+ <MudItem xs="12" Class="py-1">
+ <MudText Typo="Typo.h6" Color="@Color.Default">@Text</MudText>
+ </MudItem>
+</MudGrid>
+
+@code {
+ [Parameter] public string Text { get; set; }
+}
diff --git a/HotelPms.Client.Blazor/Dialog/SelectColor.razor b/HotelPms.Client.Blazor/Dialog/SelectColor.razor
new file mode 100644
index 0000000..4d0b472
--- /dev/null
+++ b/HotelPms.Client.Blazor/Dialog/SelectColor.razor
@@ -0,0 +1,70 @@
+@using static HotelPms.Client.Blazor.Util.SystemEnum
+<MudDialog Style="width: 360px;">
+ <TitleContent>
+ <MudText Typo="Typo.h6">
+ <MudIcon Icon="@Icons.Material.Filled.ColorLens" Class="mr-3 mb-n1"/>
+ @Title
+ </MudText>
+ </TitleContent>
+ <DialogContent>
+ <MudPaper Class="pa-4 mb-4">
+ <MudStack Row="true" Justify="Justify.Center" Spacing="5" AlignItems="AlignItems.Center">
+ <MudText Typo="Typo.body1">元色</MudText>
+ <MudText Typo="Typo.body1">@m_OrgData</MudText>
+ <MudPaper Class="pa-3" Style="@($"background-color: {m_OrgData};")"></MudPaper>
+ </MudStack>
+ </MudPaper>
+ <MudColorPicker @ref="colorPicker" @bind-Text="Data" Style="@($"color: {Data};")" DisableToolbar="false" PickerVariant="PickerVariant.Static" ColorPickerMode="ColorPickerMode.HEX" />
+ </DialogContent>
+ <DialogActions>
+ <MudGrid Spacing="2" Justify="Justify.Center" Class="my-3">
+ <MudItem>
+ <MudButton Variant="Variant.Filled" Color="MudBlazor.Color.Primary" OnClick="Save" StartIcon="@Icons.Filled.Done" Style="width: 100px; height: 40px;">OK</MudButton>
+ </MudItem>
+ <MudItem>
+ <MudButton Variant="Variant.Filled" Color="MudBlazor.Color.Error" OnClick="Close" StartIcon="@Icons.Filled.Close" Style="width: 100px; height: 40px;">戻る</MudButton>
+ </MudItem>
+ </MudGrid>
+ </DialogActions>
+</MudDialog>
+
+@code {
+ [CascadingParameter] MudDialogInstance MudDialog { get; set; }
+ [Parameter] public string Title { get; set; }
+ private bool isFirst = true;
+ private MudColorPicker colorPicker;
+ private string m_OrgData = string.Empty;
+
+ private string m_Data = string.Empty;
+ [Parameter] public string Data
+ {
+ get { return m_Data; }
+ set
+ {
+ m_Data = value;
+ if (isFirst) { m_OrgData = m_Data; }
+ }
+ }
+
+ protected override void OnAfterRender(bool firstRender)
+ {
+ if (firstRender)
+ {
+ isFirst = false;
+ }
+ }
+
+ private void ToDate()
+ {
+ }
+
+ private void Close()
+ {
+ MudDialog.Cancel();
+ }
+
+ private void Save()
+ {
+ MudDialog.Close(DialogResult.Ok(Data));
+ }
+}
diff --git a/HotelPms.Client.Blazor/Dialog/SelectDate.razor b/HotelPms.Client.Blazor/Dialog/SelectDate.razor
new file mode 100644
index 0000000..0266d90
--- /dev/null
+++ b/HotelPms.Client.Blazor/Dialog/SelectDate.razor
@@ -0,0 +1,64 @@
+@using static HotelPms.Client.Blazor.Util.SystemEnum
+<MudDialog Style="width: 360px;">
+ <TitleContent>
+ <MudText Typo="Typo.h6">
+ <MudIcon Icon="@Icons.Material.Filled.DateRange" Class="mr-3 mb-n1"/>
+ @Title
+ </MudText>
+ </TitleContent>
+ <DialogContent>
+ <MudDatePicker @ref="_picker" PickerVariant="PickerVariant.Static" TitleDateFormat = "MM月dd日" @bind-Date="Data"/>
+ </DialogContent>
+ <DialogActions>
+ <MudGrid Spacing="2" Justify="Justify.Center" Class="my-3">
+ <MudItem>
+ <MudButton Variant="Variant.Filled" Color="MudBlazor.Color.Primary" OnClick="ToDate" StartIcon="@Icons.Filled.Done" Style="width: 100px; height: 40px;">本日</MudButton>
+ </MudItem>
+ <MudItem>
+ <MudButton Variant="Variant.Filled" Color="MudBlazor.Color.Error" OnClick="Close" StartIcon="@Icons.Filled.Close" Style="width: 100px; height: 40px;">戻る</MudButton>
+ </MudItem>
+ </MudGrid>
+ </DialogActions>
+</MudDialog>
+
+@code {
+ [CascadingParameter] MudDialogInstance MudDialog { get; set; }
+ [Parameter] public string Title { get; set; }
+ MudDatePicker _picker;
+ private bool isFirst = true;
+ private DateTime? m_Data;
+
+ [Parameter] public DateTime? Data
+ {
+ get { return m_Data; }
+ set
+ {
+ m_Data = value;
+ if (!isFirst) { Save(); }
+ }
+ }
+
+ protected override void OnAfterRender(bool firstRender)
+ {
+ if (firstRender)
+ {
+ isFirst = false;
+ _picker.GoToDate();
+ }
+ }
+
+ private void ToDate()
+ {
+ _picker.GoToDate(DateTime.Today);
+ }
+
+ private void Close()
+ {
+ MudDialog.Cancel();
+ }
+
+ private void Save()
+ {
+ MudDialog.Close(DialogResult.Ok(CConvert.ToDateString(Data)));
+ }
+}
diff --git a/HotelPms.Client.Blazor/Dialog/SelectList.razor b/HotelPms.Client.Blazor/Dialog/SelectList.razor
new file mode 100644
index 0000000..7561a2c
--- /dev/null
+++ b/HotelPms.Client.Blazor/Dialog/SelectList.razor
@@ -0,0 +1,128 @@
+@using static HotelPms.Client.Blazor.Util.SystemEnum
+@inject IJSRuntime JSRuntime
+<MudDialog Style="width: 600px;">
+ <DialogContent>
+ <MudTable @onkeydown="KeyHandler" @onfocus="Enter" @onblur="Leave" tabindex="0" id="select-list-grid" Style="cursor: pointer;" Items="@Data.AsEnumerable()" Dense="true" Hover="true" ReadOnly="true" Filter="new Func<DataRow,bool>(FilterFunc)" @bind-SelectedItem="selectedItem" Height="300px" FixedHeader="true" Striped="true" T="DataRow" OnRowClick="@((e) => OnRowClick(e))">
+ <ToolBarContent>
+ <MudTextField Margin="Margin.Dense" @bind-Value="searchKey" Label="フィルター" Variant="Variant.Outlined" Adornment="Adornment.End" AdornmentIcon="@Icons.Material.Filled.Search" IconSize="Size.Medium" Class="mt-0"></MudTextField>
+ </ToolBarContent>
+ <ColGroup>
+ <col style="width:150px;" />
+ <col />
+ </ColGroup>
+ <HeaderContent>
+ <MudTh>コード</MudTh>
+ <MudTh>名称</MudTh>
+ </HeaderContent>
+ <RowTemplate>
+ <MudTd Class="@SelectRow(context)">@context[0]</MudTd>
+ <MudTd Class="@SelectRow(context)">@context[1]</MudTd>
+ </RowTemplate>
+ </MudTable>
+ </DialogContent>
+ <DialogActions>
+ <MudGrid Spacing="2" Justify="Justify.Center" Class="my-3">
+ <MudItem>
+ <MudButton Variant="Variant.Filled" Color="MudBlazor.Color.Primary" OnClick="Close" StartIcon="@Icons.Filled.Close" Style="width: 180px; height: 40px;">キャンセル</MudButton>
+ </MudItem>
+ </MudGrid>
+ </DialogActions>
+</MudDialog>
+
+<style>
+ #select-list-grid .tr-select {
+ color: var(--mud-palette-primary);
+ background-color: var(--mud-palette-primary-hover);
+ <!-- background-color: rgba(223,235,242, 0.77); -->
+ }
+
+ :focus {
+ outline: none;
+ }
+</style>
+
+@code {
+ [CascadingParameter] MudDialogInstance? MudDialog { get; set; }
+ [Parameter] public DataTable? Data { get; set; }
+ private string? searchKey;
+ private DataRow? selectedItem;
+ private int selectRowIndex = 0;
+
+ private void Enter(FocusEventArgs e)
+ {
+ EnvironmentSetting.Debug($"Enter");
+ }
+
+ private void Leave(FocusEventArgs e)
+ {
+ EnvironmentSetting.Debug($"Leave");
+ }
+
+ private async Task KeyHandler(KeyboardEventArgs e)
+ {
+ ElementBase element = await JSRuntime.GetActiveElement();
+ EnvironmentSetting.Debug($"{e.Code}.{e.Key}.{element.Id}");
+
+ if (element.Id != "select-list-grid") { return; }
+ if (e.Key == "ArrowUp")
+ {
+ if (selectRowIndex == 0) { return; }
+ selectRowIndex--;
+ }
+ else if (e.Key == "ArrowDown")
+ {
+ if (selectRowIndex == Data.Rows.Count - 1) { return; }
+ selectRowIndex++;
+ }
+ else if (e.Key == "Enter")
+ {
+ MudDialog.Close(DialogResult.Ok(selectedItem));
+ return;
+ }
+ selectedItem = Data.Rows[selectRowIndex];
+ }
+
+ protected override void OnAfterRender(bool firstRender)
+ {
+ EnvironmentSetting.Debug(DateTime.Now.ToString("HH:mm:ss fff"));
+ base.OnAfterRender(firstRender);
+ }
+
+ private string SelectRow(DataRow row)
+ {
+ if (selectedItem == null) { selectedItem = Data.Rows[0]; selectRowIndex = 0; }
+ if (row.Equals(selectedItem))
+ {
+ return "tr-select";
+ }
+ else
+ {
+ return string.Empty;
+ }
+ }
+
+ protected override async Task OnAfterRenderAsync(bool firstRender)
+ {
+ if(firstRender)
+ {
+ await JSRuntime.SetFocusByKey("#select-list-grid");
+ }
+ }
+
+ private bool FilterFunc(DataRow row)
+ {
+ if (string.IsNullOrWhiteSpace(searchKey)) { return true; }
+ if (row[1].ToString().Contains(searchKey)) { return true; }
+ return false;
+ }
+
+ private void OnRowClick(TableRowClickEventArgs<DataRow> e)
+ {
+ MudDialog.Close(DialogResult.Ok(e.Item));
+ }
+
+ private void Close()
+ {
+ MudDialog.Cancel();
+ }
+}
diff --git a/HotelPms.Client.Blazor/HotelPms.Client.Blazor.csproj b/HotelPms.Client.Blazor/HotelPms.Client.Blazor.csproj
new file mode 100644
index 0000000..eae6486
--- /dev/null
+++ b/HotelPms.Client.Blazor/HotelPms.Client.Blazor.csproj
@@ -0,0 +1,29 @@
+<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
+
+ <PropertyGroup>
+ <TargetFramework>net9.0</TargetFramework>
+ <Nullable>enable</Nullable>
+ <ImplicitUsings>enable</ImplicitUsings>
+ <BrowserLinkEnabled>false</BrowserLinkEnabled>
+ <BlazorEnableDebugging>false</BlazorEnableDebugging>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <PackageReference Include="Blazored.LocalStorage" Version="4.5.0" />
+ <PackageReference Include="BootstrapBlazor.PdfReader" Version="9.0.0" />
+ <PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="9.0.3" />
+ <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.3" />
+ <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="9.0.3" PrivateAssets="all" />
+ <PackageReference Include="MudBlazor" Version="6.20.0" />
+ <PackageReference Include="Grpc.Net.Client" Version="2.70.0" />
+ <PackageReference Include="Grpc.Net.Client.Web" Version="2.70.0" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <ProjectReference Include="..\HotelPms.Data.Client\HotelPms.Data.Client.csproj" />
+ <ProjectReference Include="..\HotelPms.Data.Common\HotelPms.Data.Common.csproj" />
+ <ProjectReference Include="..\HotelPms.DataAccessGrpc.Client\HotelPms.DataAccessGrpc.Client.csproj" />
+ <ProjectReference Include="..\HotelPms.Share\HotelPms.Share.csproj" />
+ </ItemGroup>
+
+</Project>
\ No newline at end of file
diff --git a/HotelPms.Client.Blazor/HotelPms.Client.Blazor.sln b/HotelPms.Client.Blazor/HotelPms.Client.Blazor.sln
new file mode 100644
index 0000000..93704d1
--- /dev/null
+++ b/HotelPms.Client.Blazor/HotelPms.Client.Blazor.sln
@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.0.31717.71
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HotelPms.Client.Blazor", "HotelPms.Client.Blazor.csproj", "{5A64CB49-14B4-4B87-949A-07F94D386752}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {5A64CB49-14B4-4B87-949A-07F94D386752}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {5A64CB49-14B4-4B87-949A-07F94D386752}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {5A64CB49-14B4-4B87-949A-07F94D386752}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {5A64CB49-14B4-4B87-949A-07F94D386752}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {662F361C-B2AE-471D-98B5-033B8E245CA4}
+ EndGlobalSection
+EndGlobal
\ No newline at end of file
diff --git a/HotelPms.Client.Blazor/Models/ChatMessage.cs b/HotelPms.Client.Blazor/Models/ChatMessage.cs
new file mode 100644
index 0000000..079058f
--- /dev/null
+++ b/HotelPms.Client.Blazor/Models/ChatMessage.cs
@@ -0,0 +1,9 @@
+
+namespace HotelPms.Client.Blazor.Shared
+{
+ public class ChatMessage
+ {
+ public string UserName { get; set; }
+ public string Message { get; set; }
+ }
+}
diff --git a/HotelPms.Client.Blazor/Models/ChatUser.cs b/HotelPms.Client.Blazor/Models/ChatUser.cs
new file mode 100644
index 0000000..074fe51
--- /dev/null
+++ b/HotelPms.Client.Blazor/Models/ChatUser.cs
@@ -0,0 +1,14 @@
+using MudBlazor;
+
+namespace HotelPms.Client.Blazor.Shared
+{
+ public class ChatUser
+ {
+ public string UserName { get; set; }
+ public string UserRoleColor { get; set; }
+ public Color OnlineStatus { get; set; }
+ public bool Spotify { get; set; }
+ public string AvatarUrl { get; set; }
+ public Color AvatarColor { get; set; }
+ }
+}
diff --git a/HotelPms.Client.Blazor/Models/EditRow.cs b/HotelPms.Client.Blazor/Models/EditRow.cs
new file mode 100644
index 0000000..ae78996
--- /dev/null
+++ b/HotelPms.Client.Blazor/Models/EditRow.cs
@@ -0,0 +1,89 @@
+using HotelPms.Client.Blazor.ViewModel;
+using HotelPms.Share.Util;
+using System.Text.Json.Serialization;
+using static HotelPms.Client.Blazor.Models.RoomTypeInputRow;
+
+namespace HotelPms.Client.Blazor.Models
+{
+ public abstract class EditRow : IDisposable
+ {
+ #region ★★★★★ Property ★★★★★
+
+ /// <summary>
+ /// Guid
+ /// </summary>
+ public string ID { get; set; } = string.Empty;
+
+ /// <summary>
+ /// 行の対象項目情報
+ /// </summary>
+ [JsonIgnore(Condition = JsonIgnoreCondition.Always)]
+ public List<ValidField> Cells { get; set; } = new List<ValidField>();
+
+ /// <summary>
+ /// 現在使っている列
+ /// </summary>
+ public int ActiveCol { get; set; } = 0;
+
+ /// <summary>
+ /// 列の明細を展開かどうか
+ /// </summary>
+ public bool ShowDetails { get; set; } = false;
+
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public EditRow()
+ {
+ ID = Guid.NewGuid().ToString();
+ }
+
+ // Disposable types implement a finalizer.
+ ~EditRow()
+ {
+ Dispose(false);
+ }
+
+ protected virtual void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ // Dispose managed resources
+ }
+
+ // Free native resources
+ }
+
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+
+ #endregion
+
+
+ /// <summary>
+ /// データ返す
+ /// </summary>
+ /// <param name="index"></param>
+ /// <returns></returns>
+ public string GetCellText(int index)
+ {
+ return Cells[index].Text;
+ }
+
+ public void SetCellText(int index, string text)
+ {
+ Cells[index].Text = text;
+ }
+
+ /// <summary>
+ /// 値変更あり
+ /// </summary>
+ /// <param name="inputText"></param>
+ /// <returns></returns>
+ public abstract bool IsValueChanged(int index, string inputText);
+ }
+}
diff --git a/HotelPms.Client.Blazor/Models/FeeDtailRow.cs b/HotelPms.Client.Blazor/Models/FeeDtailRow.cs
new file mode 100644
index 0000000..59765b1
--- /dev/null
+++ b/HotelPms.Client.Blazor/Models/FeeDtailRow.cs
@@ -0,0 +1,8 @@
+namespace HotelPms.Client.Blazor.Models
+{
+ public class FeeDtailRow
+ {
+ public string Name { get; set; }
+ public string Value { get; set; }
+ }
+}
diff --git a/HotelPms.Client.Blazor/Models/MudBlazorAdminDashboard.cs b/HotelPms.Client.Blazor/Models/MudBlazorAdminDashboard.cs
new file mode 100644
index 0000000..956c267
--- /dev/null
+++ b/HotelPms.Client.Blazor/Models/MudBlazorAdminDashboard.cs
@@ -0,0 +1,134 @@
+using MudBlazor;
+
+namespace HotelPms.Client.Blazor.Shared
+{
+ public class MudBlazorAdminDashboard : MudTheme
+ {
+ public MudBlazorAdminDashboard()
+ {
+ Palette = new Palette()
+ {
+ Primary = Colors.Blue.Darken1,
+ Secondary = Colors.DeepPurple.Accent2,
+ Background = Colors.Grey.Lighten5,
+ //AppbarBackground = Colors.Indigo.Darken1,
+ AppbarBackground = "#395FAC",
+ //AppbarBackground = Colors.Blue.Darken1,
+ DrawerBackground = "#FFF",
+ //DrawerBackground = "#24343B",
+ HoverOpacity = 0.2,
+ DrawerText = "rgba(0,0,0, 0.7)",
+ Success = "#06d79c"
+ };
+
+ LayoutProperties = new LayoutProperties()
+ {
+ DefaultBorderRadius = "6px",
+ DrawerWidthLeft = "240px",
+ DrawerWidthRight = "240px",
+ };
+
+ Typography = new Typography()
+ {
+ Default = new Default()
+ {
+ FontFamily = new[] { "Montserrat", "Helvetica", "Arial", "sans-serif" },
+ FontSize = ".875rem",
+ FontWeight = 400,
+ LineHeight = 1.43,
+ LetterSpacing = ".01071em"
+ },
+ H1 = new H1()
+ {
+ FontFamily = new[] { "Montserrat", "Helvetica", "Arial", "sans-serif" },
+ FontSize = "6rem",
+ FontWeight = 300,
+ LineHeight = 1.167,
+ LetterSpacing = "-.01562em"
+ },
+ H2 = new H2()
+ {
+ FontFamily = new[] { "Montserrat", "Helvetica", "Arial", "sans-serif" },
+ FontSize = "3.75rem",
+ FontWeight = 300,
+ LineHeight = 1.2,
+ LetterSpacing = "-.00833em"
+ },
+ H3 = new H3()
+ {
+ FontFamily = new[] { "Montserrat", "Helvetica", "Arial", "sans-serif" },
+ FontSize = "3rem",
+ FontWeight = 400,
+ LineHeight = 1.167,
+ LetterSpacing = "0"
+ },
+ H4 = new H4()
+ {
+ FontFamily = new[] { "Montserrat", "Helvetica", "Arial", "sans-serif" },
+ FontSize = "2.125rem",
+ FontWeight = 400,
+ LineHeight = 1.235,
+ LetterSpacing = ".00735em"
+ },
+ H5 = new H5()
+ {
+ FontFamily = new[] { "Montserrat", "Helvetica", "Arial", "sans-serif" },
+ FontSize = "1.5rem",
+ FontWeight = 400,
+ LineHeight = 1.334,
+ LetterSpacing = "0"
+ },
+ H6 = new H6()
+ {
+ FontFamily = new[] { "Montserrat", "Helvetica", "Arial", "sans-serif" },
+ FontSize = "1.25rem",
+ FontWeight = 400,
+ LineHeight = 1.6,
+ LetterSpacing = ".0075em"
+ },
+ Button = new Button()
+ {
+ FontFamily = new[] { "Montserrat", "Helvetica", "Arial", "sans-serif" },
+ FontSize = ".875rem",
+ FontWeight = 500,
+ LineHeight = 1.75,
+ LetterSpacing = ".02857em"
+ },
+ Body1 = new Body1()
+ {
+ FontFamily = new[] { "Montserrat", "Helvetica", "Arial", "sans-serif" },
+ FontSize = "1rem",
+ FontWeight = 400,
+ LineHeight = 1.5,
+ LetterSpacing = ".00938em"
+ },
+ Body2 = new Body2()
+ {
+ FontFamily = new[] { "Montserrat", "Helvetica", "Arial", "sans-serif" },
+ FontSize = ".875rem",
+ FontWeight = 400,
+ LineHeight = 1.43,
+ LetterSpacing = ".01071em"
+ },
+ Caption = new Caption()
+ {
+ FontFamily = new[] { "Montserrat", "Helvetica", "Arial", "sans-serif" },
+ FontSize = ".75rem",
+ FontWeight = 400,
+ LineHeight = 1.66,
+ LetterSpacing = ".03333em"
+ },
+ Subtitle2 = new Subtitle2()
+ {
+ FontFamily = new[] { "Montserrat", "Helvetica", "Arial", "sans-serif" },
+ FontSize = ".875rem",
+ FontWeight = 500,
+ LineHeight = 1.57,
+ LetterSpacing = ".00714em"
+ }
+ };
+ Shadows = new Shadow();
+ ZIndex = new ZIndex();
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/Models/ReadOnlyRow.cs b/HotelPms.Client.Blazor/Models/ReadOnlyRow.cs
new file mode 100644
index 0000000..34674d8
--- /dev/null
+++ b/HotelPms.Client.Blazor/Models/ReadOnlyRow.cs
@@ -0,0 +1,54 @@
+using HotelPms.Client.Blazor.ViewModel;
+using HotelPms.Share.Util;
+using static HotelPms.Client.Blazor.Models.RoomTypeInputRow;
+
+namespace HotelPms.Client.Blazor.Models
+{
+ public abstract class ReadOnlyRow : IDisposable
+ {
+ #region ★★★★★ Property ★★★★★
+
+ /// <summary>
+ /// Guid
+ /// </summary>
+ public string ID { get; set; } = string.Empty;
+
+ /// <summary>
+ /// 行の対象項目情報
+ /// </summary>
+ public List<string> Cells { get; set; } = new List<string>();
+
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public ReadOnlyRow()
+ {
+ ID = Guid.NewGuid().ToString();
+ }
+
+ // Disposable types implement a finalizer.
+ ~ReadOnlyRow()
+ {
+ Dispose(false);
+ }
+
+ protected virtual void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ // Dispose managed resources
+ }
+
+ // Free native resources
+ }
+
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+
+ #endregion
+ }
+}
diff --git a/HotelPms.Client.Blazor/Models/RoomStatusSetting.cs b/HotelPms.Client.Blazor/Models/RoomStatusSetting.cs
new file mode 100644
index 0000000..678361b
--- /dev/null
+++ b/HotelPms.Client.Blazor/Models/RoomStatusSetting.cs
@@ -0,0 +1,150 @@
+using Grpc.Net.Client;
+using HotelPms.Client.Blazor.Util;
+using HotelPms.Data.Common;
+using HotelPms.Data.Master;
+using HotelPms.DataAccessGrpc.Client;
+using HotelPms.Share.Data;
+using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
+using System.Data;
+
+namespace HotelPms.Client.Blazor.Models;
+
+/// <summary>
+/// M_RoomStatusを管理する
+/// SignalRより更新通知を届く予定
+/// Redis订阅
+/// </summary>
+public class RoomStatusSetting : IDisposable
+{
+ private static object syncObj = new object();
+ private static RoomStatusSetting m_Instance;
+ public static async Task<RoomStatusSetting> Instance()
+ {
+ bool isNew = false;
+ lock (syncObj)
+ {
+ if (m_Instance == null)
+ {
+ m_Instance = new RoomStatusSetting();
+ isNew = true;
+ }
+ }
+ if(isNew) { await m_Instance.GetData(); }
+ return m_Instance;
+
+ }
+
+ public void Dispose()
+ {
+
+ }
+
+ public RoomStatusSetting()
+ {
+ }
+
+ /// <summary>
+ /// SignalRより更新通知を届く予定
+ /// SortID順
+ /// </summary>
+ public List<RoomStatus> BufferStorage { get; set; } = new List<RoomStatus>();
+
+ /// <summary>
+ /// ID⇒BufferStorage.Index
+ /// </summary>
+ private Dictionary<int, int> m_IDMap = new Dictionary<int, int>();
+
+ /// <summary>
+ /// 空室のID
+ /// </summary>
+ public int Vacancy { get; set; } = 0;
+
+ /// <summary>
+ /// 清掃指示のID
+ /// </summary>
+ public int InstructClean { get; set; } = 0;
+
+ /// <summary>
+ /// 点検中のID
+ /// </summary>
+ public int MaidCheck { get; set; } = 0;
+
+ public void ClearBuffer()
+ {
+ BufferStorage.Clear();
+ m_IDMap.Clear();
+ }
+
+ public async Task GetData()
+ {
+ ClearBuffer();
+ using RoomStatusAccess access = new RoomStatusAccess(EnvironmentSetting.GrpcChannel);
+ var data = await access.GetDataAsync(string.Empty);
+ int i = 0;
+ foreach(RoomStatus item in data.Rows)
+ {
+ m_IDMap.Add(item.ID, i++);
+ BufferStorage.Add(item);
+ if (item.MaidType == (int)EMaidType.Vacancy) { Vacancy = item.ID; }
+ else if (item.MaidType == (int)EMaidType.Instruct) { InstructClean = item.ID; }
+ else if (item.MaidType == (int)EMaidType.Check) { MaidCheck = item.ID; }
+ EnvironmentSetting.Debug(item.ToText());
+ }
+ }
+
+ /// <summary>
+ /// 現在のIDより次のIDを取得する
+ /// </summary>
+ /// <param name="id"></param>
+ /// <returns></returns>
+ public RoomStatus Next(int id)
+ {
+ try
+ {
+ if (BufferStorage.Count == 0) { return null; }
+
+ int idx = m_IDMap[id];
+ if (idx == (BufferStorage.Count - 1))
+ {
+ return BufferStorage[0];
+ }
+ else
+ {
+ return BufferStorage[idx + 1];
+ }
+ }
+ catch
+ {
+ return null;
+ }
+ }
+
+ /// <summary>
+ /// 現在IDより前のIDを取得する
+ /// </summary>
+ /// <param name=""></param>
+ /// <param name=""></param>
+ /// <returns></returns>
+ public RoomStatus Prev(int id)
+ {
+ try
+ {
+ if (BufferStorage.Count == 0) { return null; }
+
+ int idx = m_IDMap[id];
+ if (idx == 0)
+ {
+ return BufferStorage[BufferStorage.Count - 1];
+ }
+ else
+ {
+ return BufferStorage[idx - 1];
+ }
+ }
+ catch
+ {
+ return null;
+ }
+ }
+}
+
diff --git a/HotelPms.Client.Blazor/Models/RoomTypeBase.cs b/HotelPms.Client.Blazor/Models/RoomTypeBase.cs
new file mode 100644
index 0000000..eecb66d
--- /dev/null
+++ b/HotelPms.Client.Blazor/Models/RoomTypeBase.cs
@@ -0,0 +1,16 @@
+using HotelPms.Share.Util;
+using System.Data;
+
+namespace HotelPms.Client.Blazor.Models;
+
+public class RoomTypeBase
+{
+ public int Kind { get; set; } = 0;
+ public string Name { get; set; } = string.Empty;
+
+ public RoomTypeBase(DataRow row)
+ {
+ Kind = CConvert.ToInt(row["Kind"]);
+ Name = CConvert.ToString(row["Name"]);
+ }
+}
diff --git a/HotelPms.Client.Blazor/Models/RoomTypeInputRow.cs b/HotelPms.Client.Blazor/Models/RoomTypeInputRow.cs
new file mode 100644
index 0000000..8c5ef40
--- /dev/null
+++ b/HotelPms.Client.Blazor/Models/RoomTypeInputRow.cs
@@ -0,0 +1,124 @@
+using HotelPms.Client.Blazor.Util;
+using HotelPms.Data.UseInfo;
+using HotelPms.Share.Util;
+using Microsoft.AspNetCore.Components.Forms;
+using Microsoft.JSInterop;
+using MudBlazor;
+using System.Text.Json.Serialization;
+using static HotelPms.Client.Blazor.Util.SystemEnum;
+
+namespace HotelPms.Client.Blazor.Models
+{
+ /// <summary>
+ /// 利用日毎
+ /// 空白行が必要のため、
+ /// 全部文字列にする
+ /// </summary>
+ public class RoomTypeInputRow : EditRow
+ {
+ public enum ColType : int
+ {
+ ID = 0,
+ Name,
+ Count,
+ }
+
+ public RoomTypeInputRow()
+ {
+ Cells.Add(new ViewModel.ValidField { Name = ColType.ID.ToString(), MaxLenth = 3, InputChar = EInputChar.Num });
+ Cells.Add(new ViewModel.ValidField { Name = ColType.Name.ToString() });
+ Cells.Add(new ViewModel.ValidField { Name = ColType.Count.ToString(), MaxLenth = 3, InputChar = EInputChar.Num });
+ }
+
+ protected override void Dispose(bool disposing)
+ {
+ if (!disposing)
+ {
+ base.Dispose(false);
+ }
+ }
+
+ /// <summary>
+ /// 関連伝票情報
+ /// </summary>
+ [JsonIgnore(Condition = JsonIgnoreCondition.Always)]
+ public List<UseRoom> DataList { get; set; } = new List<UseRoom>();
+
+ /// <summary>
+ /// 値変更あり
+ /// </summary>
+ /// <param name="inputText"></param>
+ /// <returns></returns>
+ public override bool IsValueChanged(int index, string inputText)
+ {
+ if (index == (int)ColType.ID)
+ {
+ if (DataList.Count == 0) { return true; }
+ return CConvert.ToInt(inputText) != DataList[0].RoomTypeID;
+ }
+ else if (index == (int)ColType.Count)
+ {
+ return CConvert.ToInt(inputText) != DataList.Count;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ /// <summary>
+ /// DOMの表示値
+ /// </summary>
+ /// <param name="index"></param>
+ /// <param name="JSRuntime"></param>
+ /// <returns></returns>
+ public async Task<string> GetInputValue(int index, IJSRuntime JSRuntime)
+ {
+ return await Cells[index].Ref.GetInputValue(JSRuntime);
+ }
+
+ /// <summary>
+ /// 表示の値の復元
+ /// </summary>
+ /// <param name="index"></param>
+ public void RestoreText(ColType index)
+ {
+ SetCellText((int)index, GetDataField((int)index));
+ }
+
+ /// <summary>
+ /// データの値
+ /// </summary>
+ /// <param name="index"></param>
+ /// <returns></returns>
+ public string GetDataField(int index)
+ {
+ if (index == (int)ColType.ID)
+ {
+ return DataList.Count == 0 ? string.Empty : DataList[0].RoomTypeID.ToString();
+ }
+ else if (index == (int)ColType.Count)
+ {
+ return DataList.Count.ToString();
+ }
+ else
+ {
+ return string.Empty;
+ }
+ }
+
+ public void SetDataField(int index, string inputText)
+ {
+ if (index == (int)ColType.ID)
+ {
+ foreach(UseRoom item in DataList)
+ {
+ item.RoomTypeID = CConvert.ToInt(inputText);
+ }
+ }
+ else if (index == (int)ColType.Count)
+ {
+ }
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/Models/RoomViewData.cs b/HotelPms.Client.Blazor/Models/RoomViewData.cs
new file mode 100644
index 0000000..0c50d65
--- /dev/null
+++ b/HotelPms.Client.Blazor/Models/RoomViewData.cs
@@ -0,0 +1,368 @@
+using Grpc.Net.Client;
+using HotelPms.Client.Blazor.Util;
+using HotelPms.Data.Master;
+using HotelPms.DataAccessGrpc.Client;
+using HotelPms.Share.Util;
+using Microsoft.VisualBasic;
+using MudBlazor;
+using System.Collections.Concurrent;
+using System.Data;
+using System.Text;
+using System.Threading.Channels;
+using static MudBlazor.CategoryTypes;
+using static System.Net.Mime.MediaTypeNames;
+
+namespace HotelPms.Client.Blazor.Models
+{
+ /// <summary>
+ /// 客室状況を持つデータ
+ /// </summary>
+ public class RoomViewData
+ {
+ /// <summary>
+ /// 現在選択されているTabのインデックス
+ /// </summary>
+ public int ActiveTabIndex { get; set; } = 0;
+
+ /// <summary>
+ /// 全部行数
+ /// </summary>
+ public int RowCount { get; set; } = 0;
+
+ /// <summary>
+ /// 全部列数
+ /// </summary>
+ public int ColCount { get; set; } = 0;
+
+ /// <summary>
+ /// 部屋タブ一覧
+ /// </summary>
+ public List<RoomViewTab> Tabs { get; set; } = new List<RoomViewTab>();
+
+ /// <summary>
+ /// 選択されているタブのレイアウトデータ
+ /// 行⇒列
+ /// </summary>
+ public List<List<RoomViewLayout>> Data { get; set; } = new List<List<RoomViewLayout>>();
+
+ /// <summary>
+ /// 現在のセルレイアウト
+ /// </summary>
+ public List<RoomCell> Cells { get; set; } = new List<RoomCell>();
+
+ /// <summary>
+ /// Tab毎のレイアウトを持つ
+ /// M_RoomCellを編集されたら、SignalRより受信し、更新される
+ /// </summary>
+ public ConcurrentDictionary<int, List<RoomCell>> CellsBuffer = new ConcurrentDictionary<int, List<RoomCell>>();
+
+ /// <summary>
+ /// 部屋ID, 部屋属性データ
+ /// </summary>
+ public Dictionary<int, RoomViewAtt> RoomData = new Dictionary<int, RoomViewAtt>();
+
+ /// <summary>
+ /// 部屋ID, [SortKey, 利用データ]
+ /// </summary>
+ public Dictionary<int, SortedDictionary<string, RoomViewUse>> UseData = new Dictionary<int, SortedDictionary<string, RoomViewUse>>();
+
+ /// <summary>
+ /// メニュー
+ /// </summary>
+ public RoomViewMenu Menu = new RoomViewMenu();
+
+ /// <summary>
+ /// 現在の利用日
+ /// </summary>
+ public DateTime UseDate { get; set; } = DateTime.Today;
+
+ public RoomViewData()
+ {
+ }
+
+ /// <summary>
+ /// 表示Tabのデータクリア
+ /// </summary>
+ private void Clear()
+ {
+ Data.Clear();
+ RoomData.Clear();
+ UseData.Clear();
+ RowCount = 0;
+ ColCount = 0;
+ }
+
+ /// <summary>
+ /// 客室状況画面初期化
+ /// </summary>
+ /// <returns></returns>
+ public async Task Init()
+ {
+ using RoomViewLayoutAccess access = new RoomViewLayoutAccess(EnvironmentSetting.GrpcChannel);
+ using DataSet ds = await access.GetRoomViewData($"NULL,0,1");
+
+ //データを取得してから、クリア:データを取得時、画面再表示されないように
+ Clear();
+
+ //レイアウトデータ
+ SetLayoutData(ds.Tables[0]);
+
+ //部屋状態・属性
+ SetRoomData(ds.Tables[1]);
+
+ //部屋の利用データ
+ SetUseData(ds.Tables[2]);
+
+ //レイアウト
+ SetRoomCell(ds.Tables[3]);
+
+ //ホテル日
+ UseDate = (DateTime)ds.Tables[4].Rows[0][0];
+
+ //Tab一覧
+ SetTabs(ds.Tables[5]);
+ }
+
+ /// <summary>
+ /// 表示用データ
+ /// </summary>
+ /// <param name="channel"></param>
+ /// <returns></returns>
+ public async Task GetData(DateTime useDate, bool tabChanged)
+ {
+ Clear();
+ int tabID = Tabs[ActiveTabIndex].ID;
+ using RoomViewLayoutAccess access = new RoomViewLayoutAccess(EnvironmentSetting.GrpcChannel);
+ using DataSet ds = await access.GetRoomViewData($"{CConvert.ToDateString(useDate)},{tabID},{(tabChanged ? 2 : 0)}");
+
+ //レイアウトデータ
+ SetLayoutData(ds.Tables[0]);
+
+ //部屋状態・属性
+ SetRoomData(ds.Tables[1]);
+
+ //部屋の利用データ
+ SetUseData(ds.Tables[2]);
+
+ //レイアウト
+ if (tabChanged) { SetRoomCell(ds.Tables[3]); }
+ }
+
+ /// <summary>
+ /// セルのレイアウト情報取得
+ /// </summary>
+ /// <param name="table"></param>
+ private void SetRoomCell(DataTable table)
+ {
+ List<RoomCell> list;
+ if (CellsBuffer.TryGetValue(ActiveTabIndex, out list))
+ {
+ Cells = list;
+ return;
+ }
+
+ list = new List<RoomCell>();
+ foreach (DataRow row in table.Rows)
+ {
+ RoomCell item = new RoomCell();
+ item.ConvertDataRow(row);
+ list.Add(item);
+ }
+ CellsBuffer[ActiveTabIndex] = list;
+ Cells = list;
+ }
+
+ /// <summary>
+ /// Tabの情報
+ /// </summary>
+ /// <param name="table"></param>
+ private void SetTabs(DataTable table)
+ {
+ Tabs.Clear();
+ foreach (DataRow row in table.Rows)
+ {
+ RoomViewTab item = new RoomViewTab();
+ item.ConvertDataRow(row);
+ Tabs.Add(item);
+ }
+ }
+
+ /// <summary>
+ /// レイアウトデータ
+ /// </summary>
+ /// <param name="table"></param>
+ private void SetLayoutData(DataTable table)
+ {
+ List<RoomViewLayout> rowData = new List<RoomViewLayout>();
+ foreach (DataRow row in table.Rows)
+ {
+ RoomViewLayout item = new RoomViewLayout();
+ item.Read(row);
+
+ if (item.Row > RowCount) { RowCount = item.Row; }
+ if (item.Col > ColCount) { ColCount = item.Col; }
+ if (item.Col == 1)
+ {
+ //改行
+ rowData = new List<RoomViewLayout>();
+ Data.Add(rowData);
+ }
+
+ //行毎の各列
+ rowData.Add(item);
+ }
+ }
+
+ /// <summary>
+ /// 部屋状態・属性
+ /// </summary>
+ /// <param name="table"></param>
+ private void SetRoomData(DataTable table)
+ {
+ foreach (DataRow row in table.Rows)
+ {
+ RoomViewAtt room = new RoomViewAtt();
+ room.Read(row);
+ RoomData.Add(room.RoomID, room);
+ }
+ }
+
+ /// <summary>
+ /// 部屋の利用データ
+ /// </summary>
+ /// <param name="table"></param>
+ private void SetUseData(DataTable table)
+ {
+ foreach (DataRow row in table.Rows)
+ {
+ RoomViewUse use = new RoomViewUse();
+ use.Read(row);
+
+ SortedDictionary<string, RoomViewUse> dict;
+ if (!UseData.TryGetValue(use.RoomID, out dict))
+ {
+ dict = new SortedDictionary<string, RoomViewUse>();
+ UseData.Add(use.RoomID, dict);
+ }
+
+ dict.Add(use.SortKey, use);
+ }
+ }
+
+ /// <summary>
+ /// セルのアイテム毎の表示文言
+ /// </summary>
+ /// <param name="roomCell"></param>
+ /// <param name="roomID"></param>
+ /// <returns></returns>
+ public string GetText(Data.Master.RoomCell roomCell, int roomID)
+ {
+ try
+ {
+ if (roomCell.ID == 0) { return roomCell.Content; }
+ else if (roomCell.ID == 1) { return roomID.ToString(); }
+ else if (roomCell.ID == 9) { return RoomData.ContainsKey(roomID) ? RoomData[roomID].RoomName : string.Empty; }
+ else
+ {
+ return UseData.ContainsKey(roomID) ? UseData[roomID].FirstOrDefault().Value.UseData[$"F{roomCell.ID}"] : string.Empty;
+ }
+ }
+ catch
+ {
+ return $"error:{roomCell.ID}";
+ }
+ }
+
+ /// <summary>
+ /// セル色
+ /// </summary>
+ /// <param name="item"></param>
+ /// <returns></returns>
+ public string GetCellColor(Data.Master.RoomViewLayout item)
+ {
+ int roomID = item.RoomID;
+ StringBuilder text = new StringBuilder();
+ //優先順位:部屋状態>利用状態>固定色
+ string backColor = item.BackColor, foreColor = item.ForeColor;
+ if (roomID > 0)
+ {
+ int maidType = RoomData.ContainsKey(roomID) ? RoomData[roomID].MaidType : 0;
+ if (maidType > 0)
+ {
+ foreColor = RoomData[roomID].ForeColor;
+ backColor = RoomData[roomID].BackColor;
+ }
+ else if (UseData.ContainsKey(roomID))
+ {
+ var use = UseData[roomID].FirstOrDefault().Value;
+ foreColor = use.ForeColor;
+ backColor = use.BackColor;
+ }
+ }
+ text.Append($"color:{CConvert.ToHtmlColor(foreColor)};");
+ text.Append($"background:{CConvert.ToHtmlColor(backColor)};");
+ return text.ToString();
+ }
+
+ /// <summary>
+ /// セルのアイテム毎のスタイル
+ /// </summary>
+ /// <param name="roomCell"></param>
+ /// <returns></returns>
+ public string GetRoomCellStyle(Data.Master.RoomCell roomCell)
+ {
+ StringBuilder text = new StringBuilder();
+ text.Append("position: absolute;");
+ text.Append($"left: {roomCell.Left}px;");
+ text.Append($"top: {roomCell.Top}px;");
+ text.Append($"width:{roomCell.Width}px;");
+ text.Append($"height:{roomCell.Heigh}px;");
+ text.Append($"font-family:{roomCell.FontName};");
+ text.Append($"font-size:{roomCell.FontSize}pt;");
+ if (roomCell.FontItalic) { text.Append("font-style:italic;"); }
+ if (roomCell.FontBold) { text.Append("font-weight:bold;"); }
+ string backColor = roomCell.BackColor, foreColor = roomCell.ForeColor;
+ text.Append($"color:{CConvert.ToHtmlColor(foreColor)};");
+ if (!CConvert.IsTransparent(backColor)) { text.Append($"background:{CConvert.ToHtmlColor(backColor)};"); }
+
+ if(roomCell.FontUnderline)
+ {
+ text.Append("text-decoration: underline;");
+ text.Append("text-underline-offset: 0.2em;");
+ }
+
+ return text.ToString();
+ }
+
+ /// <summary>
+ /// セルの文字寄せ
+ /// </summary>
+ /// <param name="roomCell"></param>
+ /// <returns></returns>
+ public Align ToTextAlignCSS(Data.Master.RoomCell roomCell)
+ {
+ //TopLeft = 1,
+ //TopCenter = 2,
+ //TopRight = 4,
+ //MiddleLeft = 16,
+ //MiddleCenter = 32,
+ //MiddleRight = 64,
+ //BottomLeft = 256,
+ //BottomCenter = 512,
+ //BottomRight = 1024,
+
+ if (roomCell.TextAlign == 1 || roomCell.TextAlign == 16 || roomCell.TextAlign == 256)
+ {
+ return Align.Left;
+ }
+ else if (roomCell.TextAlign == 4 || roomCell.TextAlign == 64 || roomCell.TextAlign == 1024)
+ {
+ return Align.Right;
+ }
+ else
+ {
+ return Align.Center;
+ }
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/Models/RoomViewMenu.cs b/HotelPms.Client.Blazor/Models/RoomViewMenu.cs
new file mode 100644
index 0000000..44903d4
--- /dev/null
+++ b/HotelPms.Client.Blazor/Models/RoomViewMenu.cs
@@ -0,0 +1,184 @@
+using Grpc.Core;
+using Grpc.Net.Client;
+using HotelPms.Client.Blazor.Util;
+using HotelPms.DataAccessGrpc.Client;
+using HotelPms.Share.Util;
+using Microsoft.VisualBasic;
+using MudBlazor;
+using System.ComponentModel;
+using System.Data;
+using System.Threading.Channels;
+
+namespace HotelPms.Client.Blazor.Models
+{
+ public class RoomViewMenu
+ {
+ /// <summary>
+ /// 客室状況メニュー
+ /// </summary>
+ public enum EType : int
+ {
+ [Description("予約登録")]
+ Resv = 0,
+ [Description("チェックイン")]
+ CheckIn,
+ [Description("伝票登録")]
+ SlipInput,
+ [Description("チェックアウト")]
+ CheckOut,
+ [Description("外出")]
+ Out,
+ [Description("延長")]
+ Exten,
+ [Description("清掃指示")]
+ Maid,
+ [Description("清掃完了")]
+ Finish,
+ [Description("顧客詳細")]
+ Customer,
+ [Description("PBX連動情報")]
+ PBX,
+ [Description("ウェイクアップ")]
+ WakeUp,
+ [Description("インジケーター同期")]
+ Indicator,
+ [Description("選択キャンセル")]
+ UnSel,
+ }
+
+ public static int ItemCount = 13;
+
+ public static string[] IconData = new string[]
+ {
+ Icons.Material.Filled.Book,
+ Icons.Material.Filled.Login,
+ Icons.Material.Filled.ModeEdit,
+ Icons.Material.Filled.Logout,
+ Icons.Material.Filled.DirectionsRun,
+ Icons.Material.Filled.WatchLater,
+ Icons.Material.Filled.Face,
+ Icons.Material.Filled.Gamepad,
+ Icons.Material.Filled.CancelPresentation,
+ Icons.Material.Filled.Icecream,
+ Icons.Material.Filled.Javascript,
+ Icons.Material.Filled.Kayaking,
+ Icons.Material.Filled.Cancel
+ };
+
+ public string[] Text { get; set; } = new string[ItemCount];
+
+ public bool[] Disable { get; set; } = new bool[ItemCount];
+
+ public double Height { get; set; } = 19.74D + 468.26D + 48D; //ヘッダー:48D
+ public double Width { get; set; } = 250D;
+ public string WidthCss { get => $"{Width}px"; }
+
+ public string DisplayCss { get; set; } = "display: none;";
+
+ /// <summary>
+ /// メニュー行の高さ
+ /// </summary>
+ private static double ItemHeight = 36.02D;
+
+ private DateTime UseDate { get; set; }
+
+ public int RoomID { get; set; } = 0;
+
+ /// <summary>
+ /// 現在の部屋状態
+ /// </summary>
+ public int RoomStatus { get; set; } = 0;
+
+ public int UseStatus { get; set; } = 0;
+
+ public RoomViewMenu()
+ {
+
+ }
+
+ /// <summary>
+ /// 部屋状態の更新
+ /// </summary>
+ /// <param name="next"></param>
+ /// <returns></returns>
+ public async Task<bool> SetRoomStatus(bool next)
+ {
+ Data.Master.RoomStatus item = next ? (await RoomStatusSetting.Instance()).Next(RoomStatus) : (await RoomStatusSetting.Instance()).Prev(RoomStatus);
+ using RoomStatusAccess access = new RoomStatusAccess(EnvironmentSetting.GrpcChannel);
+ var ret = await access.UpdateRoomStatus(UseDate, RoomID, item.ID);
+ return ret != null;
+ }
+
+ private async Task<string> GetText(int type)
+ {
+ if(type == (int)EType.Maid)
+ {
+ Data.Master.RoomStatus item = (await RoomStatusSetting.Instance()).Prev(RoomStatus);
+ return item == null ? string.Empty : item.Name; //前の状態
+ }
+ else if (type == (int)EType.Finish)
+ {
+ Data.Master.RoomStatus item = (await RoomStatusSetting.Instance()).Next(RoomStatus);
+ return item == null ? string.Empty : item.Name; //次の状態
+ }
+ else
+ {
+ return ((EType)type).ToDescription();
+ }
+ }
+
+ /// <summary>
+ /// 指定利用日、部屋IDのメニューを開く
+ /// メニューアイテムの高さ:36.02px
+ /// </summary>
+ /// <param name="useDate"></param>
+ /// <param name="roomID"></param>
+ public async Task Show(GrpcChannel channel, DateTime useDate, int roomID)
+ {
+ RoomID = roomID;
+ UseDate = useDate;
+ EnvironmentSetting.Debug($"GetData begin:{DateTime.Now.ToString("HH:mm:ss fff")}");
+ using RoomViewLayoutAccess access = new RoomViewLayoutAccess(channel);
+ using DataTable data = await access.GetRoomState($"{CConvert.ToDateString(UseDate)},{roomID}");
+ EnvironmentSetting.Debug($"GetData end:{DateTime.Now.ToString("HH:mm:ss fff")}");
+ RoomStatus = CConvert.ToInt(data.Rows[0]["RoomStatus"]);
+ int vacancyID = (await RoomStatusSetting.Instance()).Vacancy;
+ if (RoomStatus == 0) { RoomStatus = vacancyID; }
+ UseStatus = CConvert.ToInt(data.Rows[0]["UseStatus"]);
+
+ foreach (DataColumn col in data.Columns)
+ {
+ EnvironmentSetting.Debug($"{col.ColumnName}={data.Rows[0][col.ColumnName]}");
+ }
+
+ Height = 19.74D + 468.26D + 48D;
+ for (int i= 0; i< ItemCount; i++)
+ {
+ Text[i] = await GetText(i);
+
+ if (RoomStatus == vacancyID && UseStatus == 0)
+ {
+ //空室
+ switch(i)
+ {
+ case (int)EType.SlipInput:
+ case (int)EType.CheckOut:
+ case (int)EType.Out:
+ case (int)EType.Exten:
+ case (int)EType.Customer:
+ case (int)EType.PBX:
+ case (int)EType.WakeUp:
+ case (int)EType.Indicator:
+ Disable[i] = true;
+ Height -= ItemHeight;
+ break;
+ default:
+ Disable[i] = false;
+ break;
+ }
+ }
+ }
+ //
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/Models/SaleChildRow.cs b/HotelPms.Client.Blazor/Models/SaleChildRow.cs
new file mode 100644
index 0000000..93968fe
--- /dev/null
+++ b/HotelPms.Client.Blazor/Models/SaleChildRow.cs
@@ -0,0 +1,75 @@
+using MudBlazor;
+using static HotelPms.Client.Blazor.Util.SystemEnum;
+using System.Xml.Linq;
+using System.Text.Json.Serialization;
+using HotelPms.Data.UseInfo;
+using HotelPms.Share.Util;
+using static HotelPms.Client.Blazor.Models.RoomTypeInputRow;
+
+namespace HotelPms.Client.Blazor.Models
+{
+ /// <summary>
+ /// 売上伝票のパック明細情報
+ /// </summary>
+ public class SaleChildRow : ReadOnlyRow
+ {
+ public enum ColType : int
+ {
+ /// <summary>
+ /// 部屋タイプ(ReadOnly 全部選択時表示・部屋選択時非表示)
+ /// </summary>
+ RoomType = 0,
+ /// <summary>
+ /// 部屋番号(ReadOnly 全部選択時表示・部屋選択時非表示)
+ /// </summary>
+ RoomID,
+ /// <summary>
+ /// 科目名称
+ /// </summary>
+ ItemName,
+ /// <summary>
+ /// 人数
+ /// </summary>
+ PersonCount,
+ /// <summary>
+ /// 内女
+ /// </summary>
+ Woman,
+ /// <summary>
+ /// 単価
+ /// </summary>
+ UnitPrice,
+ /// <summary>
+ /// 割引(Endキーより、理由や%設定)
+ /// </summary>
+ DiscountSummary,
+ /// <summary>
+ /// 合計金額
+ /// </summary>
+ TotalSummary,
+ /// <summary>
+ /// 集計日
+ /// </summary>
+ SumDate,
+ /// <summary>
+ /// 列合計
+ /// </summary>
+ Count,
+ }
+ public SaleChildRow()
+ {
+ for (int i = 0; i < (int)ColType.Count; i++) { Cells.Add(string.Empty); }
+ }
+
+ protected override void Dispose(bool disposing)
+ {
+ if (!disposing)
+ {
+ base.Dispose(false);
+ }
+ }
+
+ [JsonIgnore(Condition = JsonIgnoreCondition.Always)]
+ public List<Sale> DataList { get; set; } = new List<Sale>();
+ }
+}
diff --git a/HotelPms.Client.Blazor/Models/SaleInputRow.cs b/HotelPms.Client.Blazor/Models/SaleInputRow.cs
new file mode 100644
index 0000000..8336fc8
--- /dev/null
+++ b/HotelPms.Client.Blazor/Models/SaleInputRow.cs
@@ -0,0 +1,216 @@
+using MudBlazor;
+using static HotelPms.Client.Blazor.Util.SystemEnum;
+using System.Xml.Linq;
+using System.Text.Json.Serialization;
+using HotelPms.Data.UseInfo;
+using HotelPms.Share.Util;
+using Microsoft.JSInterop;
+using HotelPms.Client.Blazor.Util;
+using Microsoft.VisualBasic;
+using System.Globalization;
+
+namespace HotelPms.Client.Blazor.Models
+{
+ /// <summary>
+ /// 売上伝票入力情報
+ /// </summary>
+ public class SaleInputRow : EditRow
+ {
+ public enum ColType : int
+ {
+ /// <summary>
+ /// 部屋タイプ(ReadOnly 全部選択時表示・部屋選択時非表示)
+ /// </summary>
+ RoomType = 0,
+ /// <summary>
+ /// 部屋番号(ReadOnly 全部選択時表示・部屋選択時非表示)
+ /// </summary>
+ RoomID,
+ /// <summary>
+ /// 科目名称
+ /// </summary>
+ ItemName,
+ /// <summary>
+ /// 人数
+ /// </summary>
+ PersonCount,
+ /// <summary>
+ /// 内女
+ /// </summary>
+ Woman,
+ /// <summary>
+ /// 単価
+ /// </summary>
+ UnitPrice,
+ /// <summary>
+ /// 割引(Endキーより、理由や%設定)
+ /// </summary>
+ DiscountSummary,
+ /// <summary>
+ /// 合計金額
+ /// </summary>
+ TotalSummary,
+ /// <summary>
+ /// 集計日
+ /// </summary>
+ SumDate,
+ /// <summary>
+ /// 頁
+ /// </summary>
+ Page,
+ /// <summary>
+ /// 詳細(ボタン)
+ /// </summary>
+ Detail,
+ /// <summary>
+ /// ソートキー(非表示)
+ /// </summary>
+ SortKey,
+ }
+ public SaleInputRow()
+ {
+ Cells.Add(new ViewModel.ValidField { Name = ColType.RoomType.ToString() });
+ Cells.Add(new ViewModel.ValidField { Name = ColType.RoomID.ToString() });
+ Cells.Add(new ViewModel.ValidField { Name = ColType.ItemName.ToString(), MaxLenth = 50, ShowStyle = EShowStyle.ShowList });
+ Cells.Add(new ViewModel.ValidField { Name = ColType.PersonCount.ToString(), MaxLenth = 3, InputChar = EInputChar.Num });
+ Cells.Add(new ViewModel.ValidField { Name = ColType.Woman.ToString(), MaxLenth = 3, InputChar = EInputChar.Num });
+ Cells.Add(new ViewModel.ValidField { Name = ColType.UnitPrice.ToString(), MaxLenth = 19, InputChar = EInputChar.Num });
+ Cells.Add(new ViewModel.ValidField { Name = ColType.DiscountSummary.ToString(), MaxLenth = 19, InputChar = EInputChar.Num, ShowStyle = EShowStyle.ShowList });
+ Cells.Add(new ViewModel.ValidField { Name = ColType.TotalSummary.ToString(), MaxLenth = 19, InputChar = EInputChar.Num });
+ Cells.Add(new ViewModel.ValidField { Name = ColType.SumDate.ToString(), MaxLenth = 10, InputChar = EInputChar.Num | EInputChar.Slash, ShowStyle = EShowStyle.ShowList });
+ Cells.Add(new ViewModel.ValidField { Name = ColType.Page.ToString(), MaxLenth = 3, InputChar = EInputChar.Num });
+ Cells.Add(new ViewModel.ValidField { Name = ColType.Detail.ToString(), MaxLenth = 3, InputChar = EInputChar.Num });
+ Cells.Add(new ViewModel.ValidField { Name = ColType.SortKey.ToString(), Disabled = true });
+ }
+
+ protected override void Dispose(bool disposing)
+ {
+ if (!disposing)
+ {
+ base.Dispose(false);
+ }
+ }
+
+ /// <summary>
+ /// 関連伝票情報
+ /// </summary>
+ [JsonIgnore(Condition = JsonIgnoreCondition.Always)]
+ public List<Sale> DataList { get; set; } = new List<Sale>();
+
+ /// <summary>
+ /// 一番若い伝票情報返す
+ /// </summary>
+ /// <returns></returns>
+ public Sale GetSale()
+ {
+ if (DataList.Count == 0) { return null; }
+ return DataList[0];
+ }
+
+ /// <summary>
+ /// 値変更あり
+ /// </summary>
+ /// <param name="inputText"></param>
+ /// <returns></returns>
+ public override bool IsValueChanged(int index, string inputText)
+ {
+ if (index == (int)ColType.ItemName)
+ {
+ if (DataList.Count == 0) { return inputText.Length > 0; } //新規行の場合、入力したら、変更あり
+ return inputText.CompareTo(DataList[0].ItemName) != 0;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ /// <summary>
+ /// DOMの表示値
+ /// </summary>
+ /// <param name="index"></param>
+ /// <param name="JSRuntime"></param>
+ /// <returns></returns>
+ public async Task<string> GetInputValue(int index, IJSRuntime JSRuntime)
+ {
+ return await Cells[index].Ref.GetInputValue(JSRuntime);
+ }
+
+ /// <summary>
+ /// 表示の値の復元
+ /// </summary>
+ /// <param name="index"></param>
+ public void RestoreText(SaleInputRow.ColType index)
+ {
+ SetCellText((int)index, GetDataField((int)index));
+ }
+
+ /// <summary>
+ /// データの値
+ /// </summary>
+ /// <param name="index"></param>
+ /// <returns></returns>
+ public string GetDataField(int index)
+ {
+ if (index == (int)ColType.ItemName)
+ {
+ return DataList.Count == 0 ? string.Empty : DataList[0].ItemName;
+ }
+ else
+ {
+ return string.Empty;
+ }
+ }
+
+ public void SetItem(HotelPms.Data.Master.Item item)
+ {
+ foreach (Sale sale in DataList)
+ {
+ sale.ItemID = item.ID;
+ sale.ItemName = item.Name;
+ sale.ItemKind = item.Kind;
+ }
+ }
+
+ public void SetDataField(int index, string inputText)
+ {
+ if (index == (int)ColType.ItemName)
+ {
+ foreach (Sale item in DataList)
+ {
+ item.ItemName = inputText;
+ }
+ }
+ else
+ {
+ }
+ }
+
+ /// <summary>
+ /// 売上伝票より表示データの作成
+ /// </summary>
+ /// <param name=""></param>
+ public async Task<bool> Add(Data.UseInfo.Sale item)
+ {
+ try
+ {
+ DataList.Add(item);
+ SetCellText((int)ColType.RoomType, await MasterCore.GetRoomTypeName((item.Parent as Data.UseInfo.UseRoom).RoomTypeID));
+ SetCellText((int)ColType.RoomID, (item.Parent as Data.UseInfo.UseRoom).RoomID.ToString());
+ SetCellText((int)ColType.ItemName, item.ItemName);
+ SetCellText((int)ColType.PersonCount, item.PersonCount.ToString());
+ SetCellText((int)ColType.Woman, item.InFemale.ToString());
+ SetCellText((int)ColType.UnitPrice, item.Price.ToText("N0"));
+ SetCellText((int)ColType.DiscountSummary, item.DiscountSummary.ToText("N0"));
+ SetCellText((int)ColType.TotalSummary, item.TotalSummary.ToText("N0"));
+ SetCellText((int)ColType.SumDate, item.UseDate.ToText());
+ SetCellText((int)ColType.Page, item.ReceiptPage.ToString());
+ return true;
+ }
+ catch
+ {
+ return false;
+ }
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/Models/UseRoomRow.cs b/HotelPms.Client.Blazor/Models/UseRoomRow.cs
new file mode 100644
index 0000000..0351c78
--- /dev/null
+++ b/HotelPms.Client.Blazor/Models/UseRoomRow.cs
@@ -0,0 +1,45 @@
+using HotelPms.Data.UseInfo;
+
+namespace HotelPms.Client.Blazor.Models
+{
+ /// <summary>
+ /// 利用日、部屋毎データ
+ /// </summary>
+ public class UseRoomRow
+ {
+ /// <summary>
+ /// 部屋番号
+ /// </summary>
+ public string RoomID { get; set; } = string.Empty;
+
+ /// <summary>
+ /// 部屋代表者名
+ /// </summary>
+ public string Name { get; set; } = string.Empty;
+
+ /// <summary>
+ /// 利用状態記号
+ /// </summary>
+ public string UseStatus { get; set; } = string.Empty;
+
+ /// <summary>
+ /// 代表者
+ /// </summary>
+ public bool Representative { get; set; } = false;
+
+ /// <summary>
+ /// ソート順
+ /// </summary>
+ public string SortKey { get; set; } = string.Empty;
+
+ /// <summary>
+ /// 一括行
+ /// </summary>
+ public bool AllSel { get; set; } = false;
+
+ /// <summary>
+ /// 利用部屋
+ /// </summary>
+ public UseRoom UseRoom { get; set; }
+ }
+}
diff --git a/HotelPms.Client.Blazor/Pages/Applications/Chat/Chat.razor b/HotelPms.Client.Blazor/Pages/Applications/Chat/Chat.razor
new file mode 100644
index 0000000..6b2873e
--- /dev/null
+++ b/HotelPms.Client.Blazor/Pages/Applications/Chat/Chat.razor
@@ -0,0 +1,112 @@
+@page "/application/chat"
+
+<div class="d-flex flex-grow-1 flex-row">
+ <MudHidden Breakpoint="Breakpoint.SmAndDown">
+ <MudPaper Class="pa-3 mr-6" MinWidth="250px">
+ <MudButton EndIcon="@Icons.Material.Filled.Add" Color="MudBlazor.Color.Secondary" FullWidth="true">Create Channel</MudButton>
+ <ChatChannels />
+ </MudPaper>
+ </MudHidden>
+ <MudPaper Class="py-4 flex-grow-1">
+ <MudToolBar Dense="true">
+ <MudHidden Breakpoint="Breakpoint.MdAndUp">
+ <MudIconButton OnClick="@(() => OpenDrawer(Anchor.Left))" Icon="@Icons.Material.Outlined.Menu" Color="MudBlazor.Color.Inherit" Class="mr-2 ml-n2" />
+ </MudHidden>
+ <MudText Typo="Typo.h6" Inline="true" Class="mr-2">#</MudText>
+ <MudText Typo="Typo.h6">chat</MudText>
+ <MudSpacer />
+ <MudIconButton Icon="@Icons.Material.Outlined.Notifications" />
+ <MudIconButton Icon="@Icons.Material.Outlined.PushPin" />
+ <MudHidden Breakpoint="Breakpoint.MdAndUp">
+ <MudIconButton OnClick="@(() => OpenDrawer(Anchor.Right))" Icon="@Icons.Material.Outlined.PeopleAlt" Color="MudBlazor.Color.Inherit" Class="ml-3" />
+ </MudHidden>
+ </MudToolBar>
+ <div class="d-flex flex-column px-4" style="max-height:800px; overflow:scroll;">
+ @foreach (var message in chatMessages)
+ {
+ <UserMessage UserName="@message.UserName" Message="@message.Message" ChatUser="@GetUser(message.UserName)" />
+ }
+ </div>
+ <MudPaper Class="d-flex flex-row px-2 mx-4" Style="background-color: var(--mud-palette-background-grey);">
+ <MudIconButton Icon="@Icons.Material.Filled.AddCircle"></MudIconButton>
+ <MudTextField T="string" Placeholder="Message #chat" DisableUnderLine="true" Class="mt-n2 mx-4"></MudTextField>
+ <MudIconButton Icon="@IconGift"></MudIconButton>
+ <MudIconButton Icon="@IconGif"></MudIconButton>
+ <MudIconButton Icon="@Icons.Material.Outlined.Sick" Color="MudBlazor.Color.Warning"></MudIconButton>
+ </MudPaper>
+ </MudPaper>
+ <MudHidden Breakpoint="Breakpoint.SmAndDown">
+ <MudPaper Class="pa-3 pb-16 ml-6" MinWidth="250px">
+ <ChatUsers chatUsers="chatUsers" />
+ </MudPaper>
+ </MudHidden>
+</div>
+
+<MudDrawer @bind-Open="@open" Anchor="@ChatDrawer" Elevation="1" Variant="@DrawerVariant.Temporary">
+ @if (ChatDrawer == Anchor.Left)
+ {
+ <MudButton EndIcon="@Icons.Material.Filled.Add" Color="MudBlazor.Color.Secondary" Class="mx-4 mt-6 mb-4">Create Channel</MudButton>
+ <ChatChannels />
+ }
+ else if (ChatDrawer == Anchor.Right)
+ {
+ <div class="pa-3">
+ <ChatUsers chatUsers="chatUsers" />
+ </div>
+ }
+</MudDrawer>
+
+@code
+{
+ bool open;
+ Anchor ChatDrawer { get; set; }
+
+ ChatUser[] chatUsers = new ChatUser[]
+{
+ new ChatUser { UserName = "Garderoben", UserRoleColor = Colors.DeepPurple.Accent4, OnlineStatus = Color.Success, Spotify = true, AvatarUrl = "https://avatars2.githubusercontent.com/u/10367109?s=460&u=2abf95f9e01132e8e2915def42895ffe99c5d2c6&v=4"},
+ new ChatUser { UserName = "Henon", UserRoleColor = Colors.DeepPurple.Accent4, OnlineStatus = Color.Success, Spotify = false, AvatarUrl = "https://avatars.githubusercontent.com/u/44090?s=460&v=4"},
+ new ChatUser { UserName = "Flaflo", UserRoleColor = Colors.Red.Accent3, OnlineStatus = Color.Success, Spotify = true, AvatarUrl = "https://avatars.githubusercontent.com/u/12973684?s=460&u=ea557f04c5d9c54f902f8c700292baefe59217d0&v=4"},
+ new ChatUser { UserName = "porkopek", UserRoleColor = Colors.Red.Accent3, OnlineStatus = Color.Warning, Spotify = false, AvatarUrl = "https://avatars.githubusercontent.com/u/13745954?s=460&u=81ef9118f63113ad64bde35add178cbd9ca3bb38&v=4"},
+ new ChatUser { UserName = "mike-gh", UserRoleColor = Colors.Red.Accent3, OnlineStatus = Color.Warning, Spotify = false, AvatarColor = Color.Success},
+ new ChatUser { UserName = "tungi52", UserRoleColor = Colors.Red.Accent3, OnlineStatus = Color.Warning, Spotify = false, AvatarColor = Color.Success},
+ new ChatUser { UserName = "svenovic", UserRoleColor = Colors.Red.Accent3, OnlineStatus = Color.Dark, Spotify = false, AvatarColor = Color.Success},
+ new ChatUser { UserName = "Artroxa", UserRoleColor = Colors.BlueGrey.Lighten1, OnlineStatus = Color.Success, Spotify = false, AvatarUrl = "https://avatars2.githubusercontent.com/u/71094850?s=460&u=66c16f5bb7d27dc751f6759a82a3a070c8c7fe4b&v=4"},
+ new ChatUser { UserName = "II ARROWS", UserRoleColor = Colors.BlueGrey.Lighten1, OnlineStatus = Color.Success, Spotify = false, AvatarUrl = "https://avatars.githubusercontent.com/u/14835013?s=460&u=8d9acfca411be6941ceb44f710c4357857350c2a&v=4"},
+ new ChatUser { UserName = "rangsk", UserRoleColor = Colors.BlueGrey.Lighten1, OnlineStatus = Color.Success, Spotify = false, AvatarUrl = "https://avatars.githubusercontent.com/u/10701249?s=460&u=f806998af6e29fd4402736ba2efc2649adae9e39&v=4"},
+ new ChatUser { UserName = "Svarta Änkan", UserRoleColor = Colors.BlueGrey.Lighten1, OnlineStatus = Color.Error, Spotify = true, AvatarColor = Color.Error},
+ new ChatUser { UserName = "TommyG", UserRoleColor = Colors.BlueGrey.Lighten1, OnlineStatus = Color.Warning, Spotify = false, AvatarUrl = "https://avatars.githubusercontent.com/u/4773183?s=460&u=7d0ebb28e29ae5103a74070471ffd506cdbf03fd&v=4"},
+};
+
+ ChatMessage[] chatMessages = new ChatMessage[]
+ {
+ new ChatMessage { UserName = "Garderoben", Message = "What is CSS?"},
+ new ChatMessage { UserName = "Henon", Message = "idk?"},
+ new ChatMessage { UserName = "Garderoben", Message = "me neither, anyone else?"},
+ new ChatMessage { UserName = "Artroxa", Message = "lololololol"},
+ new ChatMessage { UserName = "svenovic", Message = "Cascading Style Sheets"},
+ new ChatMessage { UserName = "rangsk", Message = "CSS is a style sheet language used for describing the presentation of a document written in a markup language such as HTML."},
+ new ChatMessage { UserName = "II ARROWS", Message = "We're on a mission from Glod."},
+ new ChatMessage { UserName = "TommyG", Message = "Wth dude, i love Terry Pratchett"},
+ new ChatMessage { UserName = "tungi52", Message = "Did you guys read his discworld book series?"},
+ new ChatMessage { UserName = "TommyG", Message = "Yeah! It's great!"},
+ new ChatMessage { UserName = "Garderoben", Message = "no more talk about books, this is very serious coder chat!"},
+ new ChatMessage { UserName = "Artroxa", Message = "Yes, blazor is cool coding for cool kids" },
+ new ChatMessage { UserName = "Flaflo", Message = "@Garderoben hey have you even started working on issue #294 on git?"},
+ new ChatMessage { UserName = "Henon", Message = "Don't worry Flaflo, i took care of it."},
+ };
+
+ public ChatUser GetUser(string username)
+ {
+ var chatUser = chatUsers.FirstOrDefault(x => x.UserName == username);
+ return chatUser;
+ }
+
+ void OpenDrawer(Anchor anchor)
+ {
+ ChatDrawer = anchor;
+ open = true;
+ }
+
+ public string IconGift { get; set; } = "<path d=\"M22,12V20A2,2 0 0,1 20,22H4A2,2 0 0,1 2,20V12A1,1 0 0,1 1,11V8A2,2 0 0,1 3,6H6.17C6.06,5.69 6,5.35 6,5A3,3 0 0,1 9,2C10,2 10.88,2.5 11.43,3.24V3.23L12,4L12.57,3.23V3.24C13.12,2.5 14,2 15,2A3,3 0 0,1 18,5C18,5.35 17.94,5.69 17.83,6H21A2,2 0 0,1 23,8V11A1,1 0 0,1 22,12M4,20H11V12H4V20M20,20V12H13V20H20M9,4A1,1 0 0,0 8,5A1,1 0 0,0 9,6A1,1 0 0,0 10,5A1,1 0 0,0 9,4M15,4A1,1 0 0,0 14,5A1,1 0 0,0 15,6A1,1 0 0,0 16,5A1,1 0 0,0 15,4M3,8V10H11V8H3M13,8V10H21V8H13Z\" />";
+ public string IconGif { get; set; } = "<path d=\"M11,8H13V16H11V8M7.67,8H4.33C3.53,8 3,8.67 3,9.33V14.67C3,15.33 3.53,16 4.33,16H7.67C8.47,16 9,15.33 9,14.67V12H7V14H5V10H9V9.33C9,8.67 8.47,8 7.67,8M21,10V8H15V16H17V14H19.5V12H17V10H21Z\" />";
+}
\ No newline at end of file
diff --git a/HotelPms.Client.Blazor/Pages/Applications/Chat/ChatChannels.razor b/HotelPms.Client.Blazor/Pages/Applications/Chat/ChatChannels.razor
new file mode 100644
index 0000000..6469e39
--- /dev/null
+++ b/HotelPms.Client.Blazor/Pages/Applications/Chat/ChatChannels.razor
@@ -0,0 +1,33 @@
+<MudList Clickable="true">
+ <MudListItem Text="Information" InitiallyExpanded="true" Dense="true" Class="mt-4">
+ <NestedList>
+ <MudListItem Dense="true"># info-and-rules</MudListItem>
+ <MudListItem Dense="true"># news-feed</MudListItem>
+ <MudListItem Dense="true"># breaking-changes</MudListItem>
+ </NestedList>
+ </MudListItem>
+ <MudListItem Text="Mudblazor" InitiallyExpanded="true" Dense="true" Class="mt-4">
+ <NestedList>
+ <MudListItem Dense="true" Style="font-weight:500;"># chat</MudListItem>
+ <MudListItem Dense="true"># help</MudListItem>
+ <MudListItem Dense="true"># development</MudListItem>
+ </NestedList>
+ </MudListItem>
+ <MudListItem Text="Contributors" InitiallyExpanded="true" Dense="true" Class="mt-4">
+ <NestedList>
+ <MudListItem Dense="true"># contributors-info</MudListItem>
+ <MudListItem Dense="true"># contributors-chat</MudListItem>
+ </NestedList>
+ </MudListItem>
+ <MudListItem Text="Core Team" InitiallyExpanded="true" Dense="true" Class="mt-4">
+ <NestedList>
+ <MudListItem Dense="true"># core-team-info</MudListItem>
+ <MudListItem Dense="true"># core-team-chat</MudListItem>
+ <MudListItem Dense="true"># moderator-only</MudListItem>
+ </NestedList>
+ </MudListItem>
+</MudList>
+
+@code {
+
+}
diff --git a/HotelPms.Client.Blazor/Pages/Applications/Chat/ChatUsers.razor b/HotelPms.Client.Blazor/Pages/Applications/Chat/ChatUsers.razor
new file mode 100644
index 0000000..0f2d86e
--- /dev/null
+++ b/HotelPms.Client.Blazor/Pages/Applications/Chat/ChatUsers.razor
@@ -0,0 +1,22 @@
+
+<MudList Clickable="true">
+ <MudListSubheader Class="ml-n2 mb-n4"><b>CORE TEAM - 2</b></MudListSubheader>
+ @foreach (var user in chatUsers.Where(x => x.UserRoleColor == Colors.DeepPurple.Accent4))
+ {
+ <User UserName="@user.UserName" UserRoleColor="@user.UserRoleColor" OnlineStatus="@user.OnlineStatus" ListeningToSpotify="@user.Spotify" AvatarUrl="@user.AvatarUrl" />
+ }
+ <MudListSubheader Class="ml-n2 mt-4 mb-n4"><b>CONTRIBUTION TEAM - 5</b></MudListSubheader>
+ @foreach (var user in chatUsers.Where(x => x.UserRoleColor == Colors.Red.Accent3))
+ {
+ <User UserName="@user.UserName" UserRoleColor="@user.UserRoleColor" OnlineStatus="@user.OnlineStatus" ListeningToSpotify="@user.Spotify" AvatarUrl="@user.AvatarUrl" AvatarColor="@user.AvatarColor" />
+ }
+ <MudListSubheader Class="ml-n2 mt-4 mb-n4"><b>ONLINE - 5</b></MudListSubheader>
+ @foreach (var user in chatUsers.Where(x => x.UserRoleColor == Colors.BlueGrey.Lighten1))
+ {
+ <User UserName="@user.UserName" UserRoleColor="@user.UserRoleColor" OnlineStatus="@user.OnlineStatus" ListeningToSpotify="@user.Spotify" AvatarUrl="@user.AvatarUrl" AvatarColor="@user.AvatarColor" />
+ }
+</MudList>
+
+@code {
+ [Parameter] public ChatUser[] chatUsers { get; set; }
+}
diff --git a/HotelPms.Client.Blazor/Pages/Applications/Chat/User.razor b/HotelPms.Client.Blazor/Pages/Applications/Chat/User.razor
new file mode 100644
index 0000000..dea5cb6
--- /dev/null
+++ b/HotelPms.Client.Blazor/Pages/Applications/Chat/User.razor
@@ -0,0 +1,37 @@
+
+<MudListItem Class="pa-0 px-2">
+ <div class="d-flex flex-row mt-n1 mb-n1">
+ <div class="mr-4">
+ <MudBadge Dot="true" Overlap="true" Color="@OnlineStatus" Bordered="true" Class="my-2" Origin="Origin.BottomCenter">
+ @if (!String.IsNullOrEmpty(AvatarUrl))
+ {
+ <MudAvatar Image="@AvatarUrl" />
+ }
+ else
+ {
+ <MudAvatar Color="@AvatarColor">
+ <MudIcon Icon="@DiscordIcon" Style="font-size: 1.8rem;" ViewBox="0 0 48 48" />
+ </MudAvatar>
+ }
+ </MudBadge>
+ </div>
+ <div>
+ <MudText Typo="Typo.body2" Style="@($"color:{@UserRoleColor};")" Class="mt-3 mb-n2"><b>@UserName</b></MudText>
+ @if (ListeningToSpotify)
+ {
+ <MudText Typo="Typo.caption">Listening to <b>Spotify</b></MudText>
+ }
+ </div>
+ </div>
+</MudListItem>
+
+@code {
+ [Parameter] public string UserName { get; set; }
+ [Parameter] public string AvatarUrl { get; set; }
+ [Parameter] public Color OnlineStatus { get; set; }
+ [Parameter] public Color AvatarColor { get; set; }
+ [Parameter] public string UserRoleColor { get; set; }
+ [Parameter] public bool ListeningToSpotify { get; set; }
+
+ public string DiscordIcon = "<path d=\"M40 12s-4.586-3.59-10-4l-.488.977C34.406 10.176 36.652 11.89 39 14c-4.047-2.066-8.04-4-15-4-6.96 0-10.953 1.934-15 4 2.348-2.11 5.02-4.016 9.488-5.023L18 8c-5.68.535-10 4-10 4s-5.121 7.426-6 22c5.16 5.953 13 6 13 6l1.64-2.184C13.856 36.848 10.716 35.121 8 32c3.238 2.45 8.125 5 16 5s12.762-2.55 16-5c-2.715 3.121-5.855 4.848-8.64 5.816L33 40s7.84-.047 13-6c-.879-14.574-6-22-6-22zM17.5 30c-1.934 0-3.5-1.79-3.5-4s1.566-4 3.5-4 3.5 1.79 3.5 4-1.566 4-3.5 4zm13 0c-1.934 0-3.5-1.79-3.5-4s1.566-4 3.5-4 3.5 1.79 3.5 4-1.566 4-3.5 4z\"/>";
+}
diff --git a/HotelPms.Client.Blazor/Pages/Applications/Chat/UserMessage.razor b/HotelPms.Client.Blazor/Pages/Applications/Chat/UserMessage.razor
new file mode 100644
index 0000000..c86843b
--- /dev/null
+++ b/HotelPms.Client.Blazor/Pages/Applications/Chat/UserMessage.razor
@@ -0,0 +1,28 @@
+
+<div class="d-flex flex-row my-4">
+ <div class="mr-4">
+ @if (!String.IsNullOrEmpty(ChatUser.AvatarUrl))
+ {
+ <MudAvatar Image="@ChatUser.AvatarUrl" />
+ }
+ else
+ {
+ <MudAvatar Color="@ChatUser.AvatarColor">
+ <MudIcon Icon="@DiscordIcon" Style="font-size: 1.8rem;" ViewBox="0 0 48 48" />
+ </MudAvatar>
+ }
+ </div>
+ <div>
+ <MudText Typo="Typo.body1" Style="@($"color:{@ChatUser.UserRoleColor};")"><b>@UserName</b></MudText>
+ <MudText Typo="Typo.body2">@Message</MudText>
+ </div>
+</div>
+
+
+@code {
+ [Parameter] public string UserName { get; set; }
+ [Parameter] public string Message { get; set; }
+ [Parameter] public ChatUser ChatUser { get; set; }
+
+ public string DiscordIcon = "<path d=\"M40 12s-4.586-3.59-10-4l-.488.977C34.406 10.176 36.652 11.89 39 14c-4.047-2.066-8.04-4-15-4-6.96 0-10.953 1.934-15 4 2.348-2.11 5.02-4.016 9.488-5.023L18 8c-5.68.535-10 4-10 4s-5.121 7.426-6 22c5.16 5.953 13 6 13 6l1.64-2.184C13.856 36.848 10.716 35.121 8 32c3.238 2.45 8.125 5 16 5s12.762-2.55 16-5c-2.715 3.121-5.855 4.848-8.64 5.816L33 40s7.84-.047 13-6c-.879-14.574-6-22-6-22zM17.5 30c-1.934 0-3.5-1.79-3.5-4s1.566-4 3.5-4 3.5 1.79 3.5 4-1.566 4-3.5 4zm13 0c-1.934 0-3.5-1.79-3.5-4s1.566-4 3.5-4 3.5 1.79 3.5 4-1.566 4-3.5 4z\"/>";
+}
diff --git a/HotelPms.Client.Blazor/Pages/Applications/Email/Email.razor b/HotelPms.Client.Blazor/Pages/Applications/Email/Email.razor
new file mode 100644
index 0000000..e60c74b
--- /dev/null
+++ b/HotelPms.Client.Blazor/Pages/Applications/Email/Email.razor
@@ -0,0 +1,61 @@
+@page "/application/email/{folder?}"
+@inject NavigationManager navigationManager
+
+<MudHidden Breakpoint="Breakpoint.SmAndDown">
+ <MudText Typo="Typo.h5" Color="MudBlazor.Color.Primary" Class="mb-4">Email Application</MudText>
+</MudHidden>
+<MudHidden Breakpoint="Breakpoint.MdAndUp">
+ <MudPaper Class="d-flex align-center py-1 mb-4">
+ <MudIconButton OnClick="@(() => OpenDrawer())" Icon="@Icons.Material.Outlined.Menu" Color="MudBlazor.Color.Inherit" Class="ml-3 mr-2" />
+ <MudText Typo="Typo.h6" Color="MudBlazor.Color.Primary">Email Application</MudText>
+ </MudPaper>
+</MudHidden>
+<div class="d-flex flex-grow-1 flex-row">
+ <MudHidden Breakpoint="Breakpoint.SmAndDown">
+ <MudPaper Class="px-3 py-6 mr-6" MinWidth="250px">
+ <MudButton Variant="Variant.Filled" Color="MudBlazor.Color.Primary" Size="Size.Large" Class="my-2" FullWidth="true">Compose</MudButton>
+ <EmailNavList folder="@folder" />
+ </MudPaper>
+ </MudHidden>
+ <MudPaper Class="py-4 flex-grow-1">
+ <MudToolBar Dense="true" DisableGutters="true">
+ <MudCheckBox T="bool" Label="Select All" Class="ml-2" />
+ <MudSpacer />
+ <MudIconButton Icon="@Icons.Material.Outlined.NavigateBefore" Class="mx-2" />
+ <MudIconButton Icon="@Icons.Material.Outlined.NavigateNext" Class="mr-4" />
+ </MudToolBar>
+ @if (folder == "inbox")
+ {
+ <Inbox />
+ }
+ else
+ {
+ <MudText Align="Align.Center" Class="mt-16">No Emails :(</MudText>
+ }
+ </MudPaper>
+</div>
+<MudDrawer @bind-Open="@open" Anchor="@Anchor.Left" Elevation="1" Variant="@DrawerVariant.Temporary">
+ <MudButton Variant="Variant.Filled" Color="MudBlazor.Color.Primary" Size="Size.Large" Class="mx-4 mt-6 mb-4">Compose</MudButton>
+ <EmailNavList folder="@folder" />
+</MudDrawer>
+
+
+@code
+{
+ bool open;
+
+ [Parameter] public string folder { get; set; }
+
+ protected override void OnInitialized()
+ {
+ if (String.IsNullOrEmpty(folder))
+ {
+ folder = "inbox";
+ }
+ }
+
+ void OpenDrawer()
+ {
+ open = true;
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.Client.Blazor/Pages/Applications/Email/EmailNavList.razor b/HotelPms.Client.Blazor/Pages/Applications/Email/EmailNavList.razor
new file mode 100644
index 0000000..513e115
--- /dev/null
+++ b/HotelPms.Client.Blazor/Pages/Applications/Email/EmailNavList.razor
@@ -0,0 +1,31 @@
+<MudList Clickable="true">
+ <MudListItem Href="application/email/inbox" Text="Inbox" Icon="@Icons.Material.Outlined.Inbox" Dense="true" Class="@GetClass("inbox")" />
+ <MudListItem Href="application/email/sent" Text="Sent" Icon="@Icons.Material.Outlined.Send" Dense="true" Class="@GetClass("sent")" />
+ <MudListItem Href="application/email/drafts" Text="Drafts" Icon="@Icons.Material.Outlined.Drafts" Dense="true" Class="@GetClass("drafts")" />
+ <MudListItem Href="application/email/starred" Text="Starred" Icon="@Icons.Material.Outlined.StarRate" Dense="true" Class="@GetClass("starred")" />
+ <MudListItem Href="application/email/trash" Text="Trash" Icon="@Icons.Material.Outlined.Delete" Dense="true" Class="@GetClass("trash")" />
+ <MudListSubheader Class="mt-6 mb-n4">
+ Labels
+ </MudListSubheader>
+ <MudListItem Text="Work" Icon="@Icons.Material.Outlined.Label" IconColor="MudBlazor.Color.Info" Dense="true" Class="my-2 rounded" />
+ <MudListItem Text="Invoices" Icon="@Icons.Material.Outlined.Label" IconColor="MudBlazor.Color.Success" Dense="true" Class="my-2 rounded" />
+ <MudListItem Text="Social" Icon="@Icons.Material.Outlined.Label" IconColor="MudBlazor.Color.Warning" Dense="true" Class="my-2 rounded" />
+ <MudListItem Text="Orders" Icon="@Icons.Material.Outlined.Label" IconColor="MudBlazor.Color.Error" Dense="true" Class="my-2 rounded" />
+</MudList>
+
+@code {
+
+ [Parameter] public string folder { get; set; }
+
+ public string GetClass(string _folder)
+ {
+ if (folder == _folder)
+ {
+ return "my-2 rounded mud-primary-text";
+ }
+ else
+ {
+ return "my-2 rounded";
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/Pages/Applications/Email/Inbox.razor b/HotelPms.Client.Blazor/Pages/Applications/Email/Inbox.razor
new file mode 100644
index 0000000..5d2f6c8
--- /dev/null
+++ b/HotelPms.Client.Blazor/Pages/Applications/Email/Inbox.razor
@@ -0,0 +1,63 @@
+
+<MudList Clickable="true">
+ <MudListItem>
+ <div class="d-flex flex-row">
+ <MudCheckBox T="bool" />
+ <div class="ml-6">
+ <MudText Typo="Typo.subtitle1">Re:Office Meeting</MudText>
+ <MudText Typo="Typo.subtitle2">Boss Mcbossman</MudText>
+ <MudText Typo="Typo.body2">During the last meeting we discussed several points that i've summarized in this E-mail...</MudText>
+ </div>
+ </div>
+ </MudListItem>
+ <MudListItem>
+ <div class="d-flex flex-row">
+ <MudCheckBox T="bool" />
+ <div class="ml-6">
+ <MudText Typo="Typo.subtitle1">Lunch Meeting</MudText>
+ <MudText Typo="Typo.subtitle2">Henon</MudText>
+ <MudText Typo="Typo.body2">Would you be available for a lunch meeting as we have alot of git issues that needs resolving.</MudText>
+ </div>
+ </div>
+ </MudListItem>
+ <MudListItem>
+ <div class="d-flex flex-row">
+ <MudCheckBox T="bool" />
+ <div class="ml-6">
+ <MudText Typo="Typo.subtitle1">RE:RE:Job Opportunity</MudText>
+ <MudText Typo="Typo.subtitle2">Headhunters INC</MudText>
+ <MudText Typo="Typo.body2">A developer position just opened up at Newgrounds HQ and given your work on mudblazor, I think you’d be a great fit...</MudText>
+ </div>
+ </div>
+ </MudListItem>
+ <MudListItem>
+ <div class="d-flex flex-row">
+ <MudCheckBox T="bool" />
+ <div class="ml-6">
+ <MudText Typo="Typo.subtitle1">Development Update</MudText>
+ <MudText Typo="Typo.subtitle2">Black Matter Pty Ltd</MudText>
+ <MudText Typo="Typo.body2">This week we're pleased to be sharing with you our updated Early Access Roadmap for 2021!</MudText>
+ </div>
+ </div>
+ </MudListItem>
+ <MudListItem>
+ <div class="d-flex flex-row">
+ <MudCheckBox T="bool" />
+ <div class="ml-6">
+ <MudText Typo="Typo.subtitle1">IT servicedesk</MudText>
+ <MudText Typo="Typo.subtitle2">Mudblazor INC</MudText>
+ <MudText Typo="Typo.body2">Regarding "I can't login to my DashBoard account" It should be resolved now. </MudText>
+ </div>
+ </div>
+ </MudListItem>
+ <MudListItem>
+ <div class="d-flex flex-row">
+ <MudCheckBox T="bool" />
+ <div class="ml-6">
+ <MudText Typo="Typo.subtitle1">[Garderoben/MudBlazor] Final release!</MudText>
+ <MudText Typo="Typo.subtitle2">Jonny Larsson@Github</MudText>
+ <MudText Typo="Typo.body2">No more MudBlazor updates, development has met a screeching halt!</MudText>
+ </div>
+ </div>
+ </MudListItem>
+</MudList>
diff --git a/HotelPms.Client.Blazor/Pages/Pages/Authentication/Forgot.razor b/HotelPms.Client.Blazor/Pages/Pages/Authentication/Forgot.razor
new file mode 100644
index 0000000..a388971
--- /dev/null
+++ b/HotelPms.Client.Blazor/Pages/Pages/Authentication/Forgot.razor
@@ -0,0 +1,17 @@
+@page "/pages/authentication/forgot-password"
+@layout LoginLayout
+
+
+
+<MudText Typo="Typo.h4" GutterBottom="true">Forgot Password?</MudText>
+
+<MudText Typo="Typo.subtitle2">Enter the email address linked to your account and you will recieve an email containing a link to reset your password.</MudText>
+
+<MudTextField T="string" Label="E-mail" Variant="Variant.Outlined" Class="my-4"></MudTextField>
+
+<MudButton Variant="Variant.Filled" Color="MudBlazor.Color.Primary" Link="pages/authentication/reset-password" Size="Size.Large" FullWidth="true" Class="mt-3">Reset Password</MudButton>
+
+
+@code {
+
+}
diff --git a/HotelPms.Client.Blazor/Pages/Pages/Authentication/Login.razor b/HotelPms.Client.Blazor/Pages/Pages/Authentication/Login.razor
new file mode 100644
index 0000000..320f234
--- /dev/null
+++ b/HotelPms.Client.Blazor/Pages/Pages/Authentication/Login.razor
@@ -0,0 +1,40 @@
+@page "/"
+@page "/pages/authentication/login"
+@layout LoginLayout
+
+
+
+
+<MudText Typo="Typo.h4" GutterBottom="true">ホテルシステム</MudText>
+<MudText>Don't have an account? <MudLink Href="pages/authentication/register">Sign Up</MudLink></MudText>
+<MudTextField T="string" Value="@("staff@mudblazor.com")" Label="アカウント" Variant="Variant.Outlined" Class="my-6"></MudTextField>
+<MudTextField @bind-Value="@Password" Label="パスワード" Variant="Variant.Outlined" InputType="@PasswordInput" Adornment="Adornment.End" AdornmentIcon="@PasswordInputIcon" OnAdornmentClick="TogglePasswordVisibility" />
+<div Class="d-flex justify-space-between align-center">
+ <MudCheckBox T="bool" Label="Remember me?" Color="MudBlazor.Color.Primary" Class="ml-n1 my-3"></MudCheckBox>
+ <MudLink Href="pages/authentication/forgot-password">Forgot pwd?</MudLink>
+</div>
+<MudButton Variant="Variant.Filled" Color="MudBlazor.Color.Primary" Link="@($"{EnvironmentSetting.SiteSubDir}roomview/list")" Size="Size.Large" FullWidth="true">ログイン</MudButton>
+
+@code {
+ string Password { get; set; } = "BMWvBPJXZu";
+
+ bool PasswordVisibility;
+ InputType PasswordInput = InputType.Password;
+ string PasswordInputIcon = Icons.Material.Filled.VisibilityOff;
+
+ void TogglePasswordVisibility()
+ {
+ @if (PasswordVisibility)
+ {
+ PasswordVisibility = false;
+ PasswordInputIcon = Icons.Material.Filled.VisibilityOff;
+ PasswordInput = InputType.Password;
+ }
+ else
+ {
+ PasswordVisibility = true;
+ PasswordInputIcon = Icons.Material.Filled.Visibility;
+ PasswordInput = InputType.Text;
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/Pages/Pages/Authentication/Register.razor b/HotelPms.Client.Blazor/Pages/Pages/Authentication/Register.razor
new file mode 100644
index 0000000..e87afa9
--- /dev/null
+++ b/HotelPms.Client.Blazor/Pages/Pages/Authentication/Register.razor
@@ -0,0 +1,43 @@
+@page "/pages/authentication/register"
+@layout LoginLayout
+
+
+
+
+<MudText Typo="Typo.h4" GutterBottom="true">Sign Up</MudText>
+<MudText>Already have an account? <MudLink Href="pages/authentication/login">Sign In</MudLink></MudText>
+
+<MudTextField T="string" Label="Username" Variant="Variant.Outlined" Class="my-4"></MudTextField>
+
+<MudTextField T="string" Label="E-mail" Variant="Variant.Outlined"></MudTextField>
+
+<MudTextField @bind-Value="@Password" Label="Password" Variant="Variant.Outlined" InputType="@PasswordInput" Adornment="Adornment.End" AdornmentIcon="@PasswordInputIcon" OnAdornmentClick="TogglePasswordVisibility" Class="mt-4"/>
+
+<MudCheckBox @bind-Checked="@AgreeToTerms" Label="I agree to the terms and privacy" Color="MudBlazor.Color.Primary" Class="ml-n1 my-3"></MudCheckBox>
+
+<MudButton Variant="Variant.Filled" Color="MudBlazor.Color.Primary" Disabled="@(!AgreeToTerms)" Link="pages/authentication/login" Size="Size.Large" FullWidth="true">Register</MudButton>
+
+@code {
+ string Password { get; set; }
+ public bool AgreeToTerms { get; set; }
+
+ bool PasswordVisibility;
+ InputType PasswordInput = InputType.Password;
+ string PasswordInputIcon = Icons.Material.Filled.VisibilityOff;
+
+ void TogglePasswordVisibility()
+ {
+ @if (PasswordVisibility)
+ {
+ PasswordVisibility = false;
+ PasswordInputIcon = Icons.Material.Filled.VisibilityOff;
+ PasswordInput = InputType.Password;
+ }
+ else
+ {
+ PasswordVisibility = true;
+ PasswordInputIcon = Icons.Material.Filled.Visibility;
+ PasswordInput = InputType.Text;
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/Pages/Pages/Authentication/Reset.razor b/HotelPms.Client.Blazor/Pages/Pages/Authentication/Reset.razor
new file mode 100644
index 0000000..0a14660
--- /dev/null
+++ b/HotelPms.Client.Blazor/Pages/Pages/Authentication/Reset.razor
@@ -0,0 +1,35 @@
+@page "/pages/authentication/reset-password"
+@layout LoginLayout
+
+
+
+
+ <MudText Typo="Typo.h4" GutterBottom="true">Set new password</MudText>
+
+ <MudTextField @bind-Value="@Password" Label="New Password" Variant="Variant.Outlined" InputType="@PasswordInput" Adornment="Adornment.End" AdornmentIcon="@PasswordInputIcon" OnAdornmentClick="TogglePasswordVisibility" Class="my-4" />
+
+ <MudButton Variant="Variant.Filled" Color="MudBlazor.Color.Primary" Link="pages/authentication/login" Size="Size.Large" FullWidth="true" Class="mt-2">Set New Password</MudButton>
+
+@code {
+ string Password { get; set; }
+
+ bool PasswordVisibility;
+ InputType PasswordInput = InputType.Password;
+ string PasswordInputIcon = Icons.Material.Filled.VisibilityOff;
+
+ void TogglePasswordVisibility()
+ {
+ @if (PasswordVisibility)
+ {
+ PasswordVisibility = false;
+ PasswordInputIcon = Icons.Material.Filled.VisibilityOff;
+ PasswordInput = InputType.Password;
+ }
+ else
+ {
+ PasswordVisibility = true;
+ PasswordInputIcon = Icons.Material.Filled.Visibility;
+ PasswordInput = InputType.Text;
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/Pages/Pages/Master/Building/Crud.razor b/HotelPms.Client.Blazor/Pages/Pages/Master/Building/Crud.razor
new file mode 100644
index 0000000..7ada279
--- /dev/null
+++ b/HotelPms.Client.Blazor/Pages/Pages/Master/Building/Crud.razor
@@ -0,0 +1,370 @@
+@page "/master/building/crud"
+@inject GrpcChannel Channel
+@inject IJSRuntime JSRuntime
+@using HotelPms.Data.Common
+@using HotelPms.Data.Common.Pagination
+@using Google.Protobuf.WellKnownTypes
+@using System.Text.Json
+@using ViewModel = HotelPms.Client.Blazor.ViewModel
+@using static HotelPms.Client.Blazor.Util.SystemEnum
+@inject IDialogService DialogService
+@inject NavigationManager NavigationManager
+
+<MudGrid Spacing="5" Class="align-center">
+ <MudItem>
+ <MudText Typo="Typo.h3">館マスタ設定【@EnvironmentSetting.ClientID】</MudText>
+ </MudItem>
+@* <MudItem>
+ <MudProgressCircular Class="@(loading ? "d-flex" : "d-none")" Color="MudBlazor.ColorInfo" Indeterminate="true" />
+ </MudItem>
+*@</MudGrid>
+@if(defColSetting != null)
+{
+<MudGrid Spacing="@spacing" Justify="Justify.FlexStart" Class="align-center mt-2 mb-5">
+ <MudItem>
+ <MudButton Variant="Variant.Filled" Style ="@buttonStyle" StartIcon="@Icons.Filled.Add" OnClick="Add">新規</MudButton>
+ </MudItem>
+ <MudItem>
+ <MudButton Variant="Variant.Filled" Style ="@buttonStyle" StartIcon="@Icons.Filled.Print" OnClick="Output">出力</MudButton>
+ </MudItem>
+ <MudItem>
+ <MudButton Variant="Variant.Filled" Style ="@buttonStyle" StartIcon="@Icons.Filled.PostAdd" OnClick="SetCol">列設定</MudButton>
+ </MudItem>
+ <MudItem>
+ <MudButton Variant="Variant.Filled" Style ="@buttonStyle" StartIcon="@Icons.Filled.Input">インポート</MudButton>
+ </MudItem>
+</MudGrid>
+<MudGrid Class="@(loading ? "d-none" : "d-flex")">
+ <MudItem xs="12">
+ <MudTable ServerData="@(new Func<TableState, Task<TableData<HotelPms.Data.Master.Building>>>(GetData))" id="idBuildingGrid"
+ @ref="table" FixedHeader="true" Breakpoint="Breakpoint.Sm" Height="650px" Hover="true" Bordered="true" Striped="true" Dense="true" HorizontalScrollbar="true">
+ <ToolBarContent>
+ <MudTextField Class="mr-2" Margin="Margin.Dense" @bind-Value="searchKey" Label="フィルター" Variant="Variant.Outlined" Adornment="Adornment.End" AdornmentIcon="@Icons.Filled.Search" AdornmentColor="MudBlazor.Color.Secondary" Style="ime-mode: active;" OnAdornmentClick="Search" />
+ <MudSelect Margin="Margin.Dense" T="KeyValuePair<int,string>" Value="@selectPattern" Label="列設定パターン" Variant="Variant.Outlined" ToStringFunc="@PatternConverter" AnchorOrigin="Origin.TopCenter" ValueChanged="PatternChanged">
+ @foreach (KeyValuePair<int,string> pattern in defColSetting.SelectList)
+ {
+ <MudSelectItem Value="@pattern" />
+ }
+ </MudSelect>
+ <MudSpacer />
+ @if(existsData)
+ {
+ <MudTablePager PageSizeOptions="@EnvironmentSetting.CountOfPage" RowsPerPageString="頁毎表示行数 " Style="border-top: none;" />
+ }
+ </ToolBarContent>
+ <ColGroup>
+ <col style="@EnvironmentSetting.GetOpeColWidthCss()" />
+ @foreach(HotelPms.Data.Master.OutputItem w in defColSetting.Items)
+ {
+ <col style="@EnvironmentSetting.GetWidthCss((int)w.Width)" />
+ }
+ </ColGroup>
+ <HeaderContent>
+ <MudTh Style="text-align: center;">操作</MudTh>
+ @foreach(HotelPms.Data.Master.OutputItem th in defColSetting.Items)
+ {
+ <MudTh>@th.Name</MudTh>
+ }
+ </HeaderContent>
+ <RowTemplate>
+ <MudTd>
+ <MudGrid Spacing="@spacing" Justify="Justify.Center" Class="align-center">
+ <MudItem>
+ <MudButton Variant="Variant.Filled" Style ="@buttonStyleEdit" StartIcon="@Icons.Filled.Edit" OnClick="@(e => Edit(context, e))">編集</MudButton>
+ </MudItem>
+ <MudItem>
+ <MudButton Variant="Variant.Filled" Style ="@buttonStyleDelete" StartIcon="@Icons.Filled.Delete" OnClick="@(e => Delete(context, e))">削除</MudButton>
+ </MudItem>
+ </MudGrid>
+ </MudTd>
+ @foreach(HotelPms.Data.Master.OutputItem td in defColSetting.Items)
+ {
+ <MudTd DataLabel="@GetFieldName(td.Name)">@context.GetField(GetFieldName(td.Name))</MudTd>
+ }
+ </RowTemplate>
+ </MudTable>
+ </MudItem>
+</MudGrid>
+}
+
+@code {
+ [CascadingParameter]
+ public Error Error { get; set; }
+ private int spacing { get; set; } = 1;
+ private string buttonStyle = $"color:{Colors.Shades.White};background-color:{Colors.Green.Darken2};width: 150px; height: 40px;";
+ private string buttonStyleEdit = $"color:{Colors.Shades.White};background-color:{Colors.Indigo.Darken2};width: 100px; height: 40px;";
+ private string buttonStyleDelete = $"color:{Colors.Shades.White};background-color:{Colors.Red.Darken2};width: 100px; height: 40px;";
+ private MudTable<HotelPms.Data.Master.Building> table;
+ private PagingRequest pagingRequest = new PagingRequest();
+ private string searchKey;
+ private bool loading = true;
+ private ViewModel.Building? viewModel;
+ private bool existsData = false;
+ private HotelPms.Data.Master.Output defColSetting = null;
+ private KeyValuePair<int, string> selectPattern;
+
+ private Func<KeyValuePair<int, string>, string> PatternConverter = p => p.Value;
+
+ private async Task PatternChanged(KeyValuePair<int, string> e)
+ {
+ selectPattern = e;
+ EnvironmentSetting.Debug($"{selectPattern.Key}.{selectPattern.Value}");
+ await LoadColSetting();
+ await table.ReloadServerData(); //⇒Raise GetDataイベント
+ await SetGridWidth();
+ }
+
+ protected override async Task OnInitializedAsync()
+ {
+ EnvironmentSetting.Debug($"【{DateTime.Now.ToString("HH:mm:ss fff")}】館マスタ⇒OnInitializedAsync.Begin");
+ viewModel = new ViewModel.Building(JSRuntime);
+ await LoadColSetting();
+ EnvironmentSetting.Debug($"【{DateTime.Now.ToString("HH:mm:ss fff")}】館マスタ⇒OnInitializedAsync.End");
+ }
+
+ private async Task LoadColSetting()
+ {
+ using (OutputAccess access = new OutputAccess(Channel))
+ {
+ EnvironmentSetting.Debug($"【{DateTime.Now.ToString("HH:mm:ss fff")}】selectPattern.Key = {selectPattern.Key}");
+ defColSetting = await access.GetDefColSetting(Environment.MachineName, EnvironmentSetting.UserName, (int)EReportID.Building, selectPattern.Key);
+ if (selectPattern.Key == 0) { selectPattern = defColSetting.SelectList.FirstOrDefault(); } //絶対ある
+ }
+ }
+
+ private async Task SetGridWidth()
+ {
+ if (defColSetting != null && !loading)
+ {
+ int total = EnvironmentSetting.MasterOpeColWidth;
+ foreach (HotelPms.Data.Master.OutputItem w in defColSetting.Items)
+ {
+ total += (int)w.Width;
+ }
+ await JSRuntime.SetGridWidth("idBuildingGrid", $"{total}px"); //列幅設定値に固定する
+ EnvironmentSetting.Debug($"館マスタ⇒SetGridWidth");
+ }
+ }
+
+ protected override async Task OnAfterRenderAsync(bool firstRender)
+ {
+ EnvironmentSetting.Debug($"【{DateTime.Now.ToString("HH:mm:ss fff")}】館マスタ⇒OnAfterRenderAsync.Begin firstRender={firstRender}");
+ await SetGridWidth();
+ EnvironmentSetting.Debug($"【{DateTime.Now.ToString("HH:mm:ss fff")}】館マスタ⇒OnAfterRenderAsync.End firstRender={firstRender}");
+ }
+
+ private string GetFieldName(string name)
+ {
+ return defColSetting.FieldMap.ContainsKey(name) ? defColSetting.FieldMap[name] : name;
+ }
+
+ /// <summary>
+ /// サーバーデータの読込
+ /// </summary>
+ /// <param name="state"></param>
+ /// <returns></returns>
+ private async Task<TableData<HotelPms.Data.Master.Building>> GetData(TableState state)
+ {
+ loading = true;
+ pagingRequest.OrderBy = viewModel.GetOrderSql();
+ pagingRequest.PageSize = state.PageSize;
+ pagingRequest.PageNumber = state.Page + 1;
+ using (BuildingAccess access = new BuildingAccess(Channel))
+ {
+ var dataPage = await access.GetPageData(pagingRequest);
+ if (dataPage.ErrNo == 0)
+ {
+ PagingRespone pagingRespone = JsonSerializer.Deserialize<PagingRespone>(dataPage.Tag);
+ existsData = pagingRespone.TotalRow > 0;
+ loading = false;
+ StateHasChanged();
+
+ return new TableData<HotelPms.Data.Master.Building>
+ {
+ Items = dataPage.Rows,
+ TotalItems = pagingRespone.TotalRow
+ };
+ }
+ else if (dataPage.ErrNo == 401)
+ {
+ Error.ProcessError(new Exception("aaaa"));
+
+ NavigationManager.NavigateTo("/user/login", false);
+ return new TableData<HotelPms.Data.Master.Building>
+ {
+ Items = null,
+ TotalItems = 0
+ };
+ }
+ else
+ {
+ var parameters = new DialogParameters { ["MsgType"] = EMessageType.OK, ["Title"] = "データ読込", ["Data"] = new List<string> { "データ読込に失敗しました。", $"{dataPage.ErrNo}.{dataPage.ErrData}" } };
+ var dialog = DialogService.Show<MessageBox>(string.Empty, parameters);
+ await dialog.Result;
+ existsData = false;
+ loading = false;
+ StateHasChanged();
+
+ return new TableData<HotelPms.Data.Master.Building>
+ {
+ Items = null,
+ TotalItems = 0
+ };
+ }
+ }
+ }
+
+ /// <summary>
+ /// 検索
+ /// </summary>
+ private async Task Search()
+ {
+ if(searchKey == null) { searchKey = string.Empty; }
+ pagingRequest.Filter = viewModel.GetFilterSql(searchKey);
+ await table.ReloadServerData(); //⇒Raise GetDataイベント
+ }
+
+ /// <summary>
+ /// 新規作成
+ /// </summary>
+ private async Task Add()
+ {
+ viewModel.Clear();
+ viewModel.JSRuntime = JSRuntime;
+ viewModel.EditMode = (int)EMasterEditStatus.Create;
+ viewModel.GetField("ID").Disabled = false;
+ var parameters = new DialogParameters { ["Data"]=viewModel };
+ var dialog = DialogService.Show<Detail>("詳細情報", parameters);
+ var result = await dialog.Result;
+
+ if (!result.Cancelled)
+ {
+ //ViewModel.Building ret = result.Data as ViewModel.Building;
+ await table.ReloadServerData(); //⇒Raise GetDataイベント
+ }
+ }
+
+ /// <summary>
+ /// 出力
+ /// </summary>
+ private async Task Output()
+ {
+ loading = true;
+ PagingRequest request = new PagingRequest();
+ pagingRequest.CopyTo(request);
+ request.PageSize = 1;
+ request.PageNumber = -1;
+ using (BuildingAccess access = new BuildingAccess(Channel))
+ {
+ var data = await access.OutputStream(request);
+ if (data != null)
+ {
+ await JSRuntime.SaveAsFileAsync("data", data.Content.ToByteArray(), "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", false);
+ }
+ }
+ loading = false;
+ }
+
+ private async Task SetCol()
+ {
+ ViewModel.ColSettingData data = await ViewModel.ColSettingData.Create((int)EReportID.Building, Channel);
+ if (data != null)
+ {
+ var parameters = new DialogParameters { ["Data"] = data };
+ var dialog = DialogService.Show<ColSetting>("列情報設定", parameters);
+ var result = await dialog.Result;
+ if (!result.Cancelled)
+ {
+ await LoadColSetting();
+ await table.ReloadServerData(); //⇒Raise GetDataイベント
+ await SetGridWidth();
+ }
+ }
+ }
+
+ /// <summary>
+ /// 編集
+ /// </summary>
+ /// <param name="item"></param>
+ /// <param name="args"></param>
+ private async Task Edit(HotelPms.Data.Master.Building item, MouseEventArgs args)
+ {
+ viewModel.Clear();
+ viewModel.JSRuntime = JSRuntime;
+ viewModel.EditMode = (int)EMasterEditStatus.Update;
+ viewModel.GetField("ID").Disabled = true;
+ for (int i = 0; i < viewModel.Fields.Count; i++)
+ {
+ viewModel.SetField(viewModel.Fields[i].Name, item.GetField(viewModel.Fields[i].Name).ToString());
+ }
+
+/*
+ viewModel.SetField("ID", item.ID.ToString());
+ viewModel.SetField("Name", item.Name);
+ viewModel.SetField("ShortName", item.ShortName);
+ viewModel.SetField("ZipCode", item.ZipCode);
+ viewModel.SetField("Tel", item.Tel);
+ viewModel.SetField("Fax", item.Fax);
+ viewModel.SetField("Address1", item.Address1);
+ viewModel.SetField("Address2", item.Address2);
+*/
+
+ var parameters = new DialogParameters { ["Data"]=viewModel };
+ var dialog = DialogService.Show<Detail>("詳細情報", parameters);
+ var result = await dialog.Result;
+
+ if (!result.Cancelled)
+ {
+ //ViewModel.Building ret = result.Data as ViewModel.Building;
+ await table.ReloadServerData(); //⇒Raise GetDataイベント
+ }
+ }
+
+
+ /// <summary>
+ /// 削除処理
+ /// </summary>
+ /// <param name="item"></param>
+ /// <param name="args"></param>
+ /// <returns></returns>
+ private async Task Delete(HotelPms.Data.Master.Building item, MouseEventArgs args)
+ {
+ var parameters = new DialogParameters { ["MsgType"]=EMessageType.YesNo, ["Title"]="削除" ,["Data"]=Message.GetConfirmForRemove($"{item.ID}.{item.Name}") };
+ var dialog = DialogService.Show<MessageBox>(string.Empty, parameters);
+ var result = await dialog.Result;
+ if (result.Cancelled)
+ {
+ return;
+ }
+
+ using (BuildingAccess access = new BuildingAccess(Channel))
+ {
+ var resultData = await access.RemoveAsync($"ID={item.ID}");
+ if(resultData.ErrNo == 0)
+ {
+ await table.ReloadServerData(); //⇒Raise GetDataイベント
+ }
+ else
+ {
+ parameters = new DialogParameters { ["MsgType"] = EMessageType.OK, ["Title"] = "DB更新エラー", ["Data"] = new List<string> { "削除に失敗しました。", $"{resultData.ErrNo}.{resultData.ErrData}" } };
+ dialog = DialogService.Show<MessageBox>(string.Empty, parameters);
+ await dialog.Result;
+ }
+ }
+ }
+
+ /// <summary>
+ /// グリッドの選択イベント
+ /// </summary>
+ /// <param name="row"></param>
+ private void SelectionChangedEvent(object row)
+ {
+ if (row == null)
+ {
+ //未選択
+ }
+ else
+ {
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/Pages/Pages/Master/Building/Detail.razor b/HotelPms.Client.Blazor/Pages/Pages/Master/Building/Detail.razor
new file mode 100644
index 0000000..d9ff900
--- /dev/null
+++ b/HotelPms.Client.Blazor/Pages/Pages/Master/Building/Detail.razor
@@ -0,0 +1,285 @@
+@using System.ComponentModel.DataAnnotations
+@using System.Text.RegularExpressions
+@using System.Reflection
+@using HotelPms.Client.Blazor.ViewModel
+@using HotelPms.Data.Common
+@using HotelPms.Data.Common.Interface.Master
+@using HotelPms.DataAccessGrpc.Client
+@using HotelPms.Share.IO
+@using HotelPms.Share.Util
+@using ViewModel = HotelPms.Client.Blazor.ViewModel
+@using static HotelPms.Client.Blazor.Util.SystemEnum
+@inject IJSRuntime JSRuntime
+
+<MudDialog Style="width: 800px;">
+ <TitleContent>
+ <MudText Typo="Typo.h6">
+ <MudIcon Icon="@Icons.Material.Filled.Dvr" Class="mr-3 mb-n1"/>
+ 館マスタ詳細
+ </MudText>
+ </TitleContent>
+ <DialogContent>
+ <MudGrid Justify="Justify.FlexStart" Class="align-center">
+ @if (errorAll.Length > 0)
+ {
+ <MudItem xs="12">
+ <MudText Color="@Color.Error">@errorAll</MudText>
+ </MudItem>
+ }
+
+ @foreach(var field in Data.Fields)
+ {
+ <MudItem xs="@field.WidthUnit">
+ <MudTextField @bind-Value="field.Text" Error="@field.Error" ErrorText="@field.ErrorText" @ref="field.Ref" T="string" Label="@field.Caption"
+ AutoFocus = "@((field.Index == 0 && Data.EditMode == (int)EMasterEditStatus.Create) || (field.Index == 1 && Data.EditMode == (int)EMasterEditStatus.Update))"
+ OnKeyDown="@(e => Data.KeyDown(field.Index, e))" KeyDownPreventDefault="@Data.KeyDownPreventDefault"
+ OnKeyPress="@(e => Data.KeyPress(field.Index, e))" KeyPressPreventDefault="@Data.KeyPressPreventDefault"
+ OnBlur="@(e => Data.Leave(field.Index, e))"
+ @onfocus="(e => Data.Enter(field.Index, e))" Margin="Margin.Dense" MaxLength="@field.MaxLenth"
+ Adornment="@(field.ShowStyle == EShowStyle.ShowList ? Adornment.End : Adornment.None)"
+ AdornmentIcon="@(field.ShowStyle == EShowStyle.ShowList ? Icons.Material.Filled.ListAlt : string.Empty)"
+ OnAdornmentClick="@(() => ShowListAction(field))" Disabled="@field.Disabled" />
+ </MudItem>
+
+ if (field.NewLine)
+ {
+ <MudItem xs="@(12 - field.WidthUnit)"></MudItem>
+ }
+ }
+ </MudGrid>
+ </DialogContent>
+ <DialogActions>
+ <MudGrid Spacing="2" Justify="Justify.Center" Class="my-3">
+ <MudItem>
+ <MudButton @ref="btnSave" Variant="Variant.Filled" Color="MudBlazor.Color.Primary" OnClick="Save" StartIcon="@Icons.Filled.Save" Class="focus-button" Style="width: 120px; height: 40px;">保存</MudButton>
+ </MudItem>
+ <MudItem>
+ <MudButton Variant="Variant.Filled" Color="MudBlazor.Color.Primary" OnClick="Close" StartIcon="@Icons.Filled.Close" Class="focus-button" Style="width: 120px; height: 40px;">閉じる</MudButton>
+ </MudItem>
+ </MudGrid>
+ </DialogActions>
+</MudDialog>
+
+@*<style>
+ /* 伪类选择器 :focus-within */
+ /* 它表示一个元素获得焦点,或,该元素的后代元素获得焦点。划重点,它或它的后代获得焦点。 */
+ /* 这也就意味着,它或它的后代获得焦点,都可以触发 :focus-within。 */
+ .focus-button:focus-within {
+ border: 1px solid;
+ border-color: #00FF00;
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(0, 255, 0, 0.6);
+ -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(0, 255, 0, 0.6);
+ box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.075), 0px 0px 8px rgba(0, 255, 0, 0.6);
+ }
+</style>
+*@
+
+@code {
+ [Inject] private IDialogService DialogService { get; set; }
+ [Inject] private GrpcChannel Channel { get; set; }
+ [CascadingParameter] MudDialogInstance MudDialog { get; set; }
+ [Parameter] public ViewModel.Building Data { get; set; }
+ private string errorAll = string.Empty;
+ private MudButton btnSave;
+
+ protected override void OnInitialized()
+ {
+ Data.Refresh = new Action(StateHasChanged); //メイン画面の更新
+ Data.BeforeAutoNextFocus += BeforeAutoNextFocus;
+ Data.BusinessValid += BusinessValid;
+ Data.ShowList += ShowList;
+ }
+
+ private async void ShowList(ValidField sender, ValidEventArgs e)
+ {
+ await ShowListAction(sender);
+ }
+
+ /// <summary>
+ /// 業務チェックを行う
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ /// <returns></returns>
+ private async Task<bool> BusinessValid(ValidField sender, ValidEventArgs e)
+ {
+ if (sender.Name == "ID")
+ {
+ using (BuildingAccess access = new BuildingAccess(Channel))
+ {
+ bool ret = await access.ExistsAsync(CConvert.ToInt(e.Text));
+ EnvironmentSetting.Debug($"access.Exists:{ret}");
+ if(Data.EditMode == (int)EMasterEditStatus.Create && ret)
+ {
+ if (e.EnterPush)
+ {
+ sender.Error = true;
+ sender.ErrorText = "当該データが既に存在します。";
+ }
+ else
+ {
+ sender.Error = false;
+ sender.ErrorText = string.Empty;
+ }
+ //StateHasChanged();
+ return false;
+ }
+ else if(Data.EditMode == (int)EMasterEditStatus.Update && !ret)
+ {
+ if (e.EnterPush)
+ {
+ sender.Error = true;
+ sender.ErrorText = "当該データが存在しません。";
+ }
+ else
+ {
+ sender.Error = false;
+ sender.ErrorText = string.Empty;
+ }
+ //StateHasChanged();
+ return false;
+ }
+ }
+ }
+
+ sender.Error = false;
+ sender.ErrorText = string.Empty;
+ //StateHasChanged();
+ return true;
+ }
+
+ /// <summary>
+ /// フォーカスを移動
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ /// <returns></returns>
+ private async Task<bool> BeforeAutoNextFocus(ValidField sender, ValidEventArgs e)
+ {
+ if (sender.Index == Data.Fields.Count - 1 && e.EnterPush)
+ {
+ await btnSave.FocusAsync(); //ここから非同期処理
+ return false;
+ }
+ return true;
+ }
+
+ /// <summary>
+ /// Endキー
+ /// </summary>
+ /// <param name="item"></param>
+ private async Task ShowListAction(ViewModel.ValidField item)
+ {
+ if (item.Name == "ZipCode")
+ {
+ if(item.Text.Length == 0) { return; }
+ using (DataTable data = await HotelPms.DataAccessGrpc.Client.AddressAccess.GetPostNoSearch(Channel, item.Text))
+ {
+ if (data.Rows.Count == 0)
+ {
+ await DialogService.ShowMessageBox($"{item.Caption}検索","該当データがありません。",yesText: "OK");
+ return;
+ }
+
+ if (data.Rows.Count > 1000)
+ {
+ await DialogService.ShowMessageBox($"{item.Caption}検索","対象データが1000件以上超えていますので、更に条件を調整してください。",yesText: "OK");
+ return;
+ }
+
+ var parameters = new DialogParameters { ["Data"] = data };
+ var dialog = DialogService.Show<SelectList>($"{item.Caption}検索", parameters);
+ var ret = await dialog.Result;
+ if (!ret.Cancelled)
+ {
+ var row = ret.Data as DataRow;
+ item.Text = row[0].ToString();
+ Data.GetField("Address2").Text = row[1].ToString();
+ StateHasChanged();
+ }
+ }
+ }
+ else if (item.Name == "Address2")
+ {
+ if(item.Text.Length == 0) { return; }
+ using (DataTable data = await HotelPms.DataAccessGrpc.Client.AddressAccess.GetAddressSearch(Channel, item.Text))
+ {
+ if (data.Rows.Count == 0)
+ {
+ await DialogService.ShowMessageBox($"{item.Caption}検索","該当データがありません。",yesText: "OK");
+ return;
+ }
+
+ if (data.Rows.Count > 1000)
+ {
+ await DialogService.ShowMessageBox($"{item.Caption}検索","対象データが1000件以上超えていますので、更に条件を調整してください。",yesText: "OK");
+ return;
+ }
+
+ var parameters = new DialogParameters { ["Data"] = data };
+ var dialog = DialogService.Show<SelectList>($"{item.Caption}検索", parameters);
+ var ret = await dialog.Result;
+ if (!ret.Cancelled)
+ {
+ var row = ret.Data as DataRow;
+ Data.GetField("ZipCode").Text = row[0].ToString();
+ item.Text = row[1].ToString();
+ StateHasChanged();
+ }
+ }
+ }
+ else
+ {
+ await DialogService.ShowMessageBox(
+ "Warning",
+ "未実装!",
+ yesText: "OK", cancelText: "Cancel");
+ }
+ }
+
+ /// <summary>
+ /// 画面閉じる
+ /// </summary>
+ private void Close()
+ {
+ MudDialog.Cancel();
+ }
+
+ /// <summary>
+ /// 保存
+ /// </summary>
+ private async void Save()
+ {
+ if (!await Data.IsValidAll())
+ {
+ //errorAll = Data.ErrText;
+ return;
+ }
+
+ //データ保存
+ using (BuildingAccess access = new BuildingAccess(Channel))
+ {
+ HotelPms.Data.Master.Building item = new HotelPms.Data.Master.Building()
+ {
+ ID = CConvert.ToInt(Data.GetField("ID").Text),
+ Name = Data.GetField("Name").Text,
+ ShortName = Data.GetField("ShortName").Text,
+ ZipCode = Data.GetField("ZipCode").Text,
+ Tel = Data.GetField("Tel").Text,
+ Fax = Data.GetField("Fax").Text,
+ Address2 = Data.GetField("Address2").Text,
+ };
+ //IMaster im = item as IMaster;
+
+ var result = Data.EditMode == (int)EMasterEditStatus.Create ? await access.AddAsync(item) : await access.UpdateAsync(item);
+ if(result.ErrNo != 0)
+ {
+ errorAll = $"更新に失敗しました。";
+ OperationLog.Instance.WriteLog($"Building.Save:{result.ErrNo}.{result.ErrData}");
+ return;
+ }
+ }
+
+ MudDialog.Close(DialogResult.Ok(Data));
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.Client.Blazor/Pages/Pages/Master/Demo/Crud.razor b/HotelPms.Client.Blazor/Pages/Pages/Master/Demo/Crud.razor
new file mode 100644
index 0000000..335cd1f
--- /dev/null
+++ b/HotelPms.Client.Blazor/Pages/Pages/Master/Demo/Crud.razor
@@ -0,0 +1,358 @@
+@page "/master/demo/crud"
+@inject GrpcChannel Channel
+@inject IJSRuntime JSRuntime
+@using HotelPms.Data.Common
+@using HotelPms.Data.Common.Pagination
+@using Google.Protobuf.WellKnownTypes
+@using System.Text.Json
+@using ViewModel = HotelPms.Client.Blazor.ViewModel
+@using static HotelPms.Client.Blazor.Util.SystemEnum
+@inject IDialogService DialogService
+@inject NavigationManager NavigationManager
+
+<MudGrid Spacing="5" Class="align-center">
+ <MudItem>
+ <MudText Typo="Typo.h3">デモ設定【@EnvironmentSetting.ClientID】</MudText>
+ </MudItem>
+</MudGrid>
+@if (defColSetting != null)
+{
+ <MudGrid Spacing="@spacing" Justify="Justify.FlexStart" Class="align-center mt-2 mb-5">
+ <MudItem>
+ <MudButton Variant="Variant.Filled" Style="@buttonStyle" StartIcon="@Icons.Filled.Add" OnClick="Add">新規</MudButton>
+ </MudItem>
+ <MudItem>
+ <MudButton Variant="Variant.Filled" Style="@buttonStyle" StartIcon="@Icons.Filled.Print" OnClick="Output">出力</MudButton>
+ </MudItem>
+ <MudItem>
+ <MudButton Variant="Variant.Filled" Style="@buttonStyle" StartIcon="@Icons.Filled.PostAdd" OnClick="SetCol">列設定</MudButton>
+ </MudItem>
+ <MudItem>
+ <MudButton Variant="Variant.Filled" Style="@buttonStyle" StartIcon="@Icons.Filled.Input">インポート</MudButton>
+ </MudItem>
+ </MudGrid>
+
+
+ <MudGrid Class="@(loading ? "d-none" : "d-flex")">
+ <MudItem xs="12">
+ <MudTable ServerData="@(new Func<TableState, Task<TableData<HotelPms.Data.Master.Demo>>>(GetData))" id="idDemoGrid"
+ @ref="table" FixedHeader="true" Breakpoint="Breakpoint.Sm" Height="650px" Hover="true" Bordered="true" Striped="true" Dense="true" HorizontalScrollbar="true" Elevation=4 >
+
+ <ToolBarContent>
+ <MudTextField Class="mr-2" Margin="Margin.Dense" @bind-Value="searchKey" Label="フィルター" Variant="Variant.Filled" Adornment="Adornment.End" AdornmentIcon="@Icons.Filled.Search" AdornmentColor="MudBlazor.Color.Secondary" Style="ime-mode: active;background-color:#DCEBF2" OnAdornmentClick="Search" />
+ <MudSelect Margin="Margin.Dense" T="KeyValuePair<int,string>" Value="@selectPattern" Label="列設定パターン" Variant="Variant.Filled" Style="background-color:#DCEBF2" ToStringFunc="@PatternConverter" AnchorOrigin="Origin.BottomLeft" TransformOrigin="Origin.TopLeft" ValueChanged="PatternChanged">
+ @foreach (KeyValuePair<int, string> pattern in defColSetting.SelectList)
+ {
+ <MudSelectItem Value="@pattern" />
+ }
+ </MudSelect>
+ <MudSpacer />
+ @if (existsData)
+ {
+ <MudTablePager PageSizeOptions="@EnvironmentSetting.CountOfPage" RowsPerPageString="頁毎表示行数 " Style="border-top: none;background-color:#DCEBF2" />
+ }
+ </ToolBarContent>
+
+ <ColGroup>
+
+ @foreach (HotelPms.Data.Master.OutputItem w in defColSetting.Items)
+ {
+ <col style="@EnvironmentSetting.GetWidthCss((int)w.Width)" />
+ }
+ <col style="@EnvironmentSetting.GetOpeColWidthCss()" />
+ </ColGroup>
+ <HeaderContent>
+
+ @foreach (HotelPms.Data.Master.OutputItem th in defColSetting.Items)
+ {
+ <MudTh>@th.Name</MudTh>
+ }
+ <MudTh Style="text-align: center;">操作</MudTh>
+ </HeaderContent>
+ <RowTemplate>
+
+ @foreach (HotelPms.Data.Master.OutputItem td in defColSetting.Items)
+ {
+ <MudTd DataLabel="@GetFieldName(td.Name)">@context.GetFieldString(GetFieldName(td.Name))</MudTd>
+ }
+
+ <MudTd>
+ <MudGrid Spacing="@spacing" Justify="Justify.Center" Class="align-center">
+ <MudItem>
+ <MudButton Variant="Variant.Filled" Style="@buttonStyleEdit" StartIcon="@Icons.Filled.Edit" OnClick="@(e => Edit(context, e))">編集</MudButton>
+ </MudItem>
+ <MudItem>
+ <MudButton Variant="Variant.Filled" Style="@buttonStyleDelete" StartIcon="@Icons.Filled.Delete" OnClick="@(e => Delete(context, e))">削除</MudButton>
+ </MudItem>
+ </MudGrid>
+ </MudTd>
+ </RowTemplate>
+ </MudTable>
+ </MudItem>
+ </MudGrid>
+}
+
+@code {
+ private int spacing { get; set; } = 1;
+ //private string buttonStyle = $"color:{Colors.Shades.White};background-color:{Colors.Green.Darken2};width: 150px; height: 40px;";
+ private string buttonStyle = $"color:{Colors.Shades.White};background-color:#58A85D;width: 150px; height: 40px;";
+ //private string buttonStyleEdit = $"color:{Colors.Shades.White};background-color:{Colors.Indigo.Darken2};width: 100px; height: 40px;";
+ private string buttonStyleEdit = $"color:{Colors.Shades.White};background-color:#3693A8;width: 100px; height: 40px;";
+ //private string buttonStyleDelete = $"color:{Colors.Shades.White};background-color:{Colors.Red.Darken2};width: 100px; height: 40px;";
+ private string buttonStyleDelete = $"color:{Colors.Shades.White};background-color:#F58066;width: 100px; height: 40px;";
+ private MudTable<HotelPms.Data.Master.Demo> table;
+ private PagingRequest pagingRequest = new PagingRequest();
+ private string searchKey;
+ private bool loading = true;
+ private ViewModel.Demo? viewModel;
+ private bool existsData = false;
+ private HotelPms.Data.Master.Output defColSetting = null;
+ private KeyValuePair<int, string> selectPattern;
+
+ private Func<KeyValuePair<int, string>, string> PatternConverter = p => p.Value;
+
+ private async Task PatternChanged(KeyValuePair<int, string> e)
+ {
+ selectPattern = e;
+ EnvironmentSetting.Debug($"{selectPattern.Key}.{selectPattern.Value}");
+ await LoadColSetting();
+ await table.ReloadServerData(); //⇒Raise GetDataイベント
+ await SetGridWidth();
+ }
+
+ protected override async Task OnInitializedAsync()
+ {
+ EnvironmentSetting.Debug($"【{DateTime.Now.ToString("HH:mm:ss fff")}】デモマスタ⇒OnInitializedAsync.Begin");
+ viewModel = new ViewModel.Demo(JSRuntime);
+ await LoadColSetting();
+ EnvironmentSetting.Debug($"【{DateTime.Now.ToString("HH:mm:ss fff")}】デモマスタ⇒OnInitializedAsync.End");
+ }
+
+ private async Task LoadColSetting()
+ {
+ using (OutputAccess access = new OutputAccess(Channel))
+ {
+ EnvironmentSetting.Debug($"【{DateTime.Now.ToString("HH:mm:ss fff")}】selectPattern.Key = {selectPattern.Key}");
+ defColSetting = await access.GetDefColSetting(Environment.MachineName, EnvironmentSetting.UserName, (int)EReportID.Demo, selectPattern.Key);
+ if (selectPattern.Key == 0) { selectPattern = defColSetting.SelectList.FirstOrDefault(); } //絶対ある
+ }
+ }
+
+ private async Task SetGridWidth()
+ {
+ if (defColSetting != null && !loading)
+ {
+ int total = EnvironmentSetting.MasterOpeColWidth;
+ foreach (HotelPms.Data.Master.OutputItem w in defColSetting.Items)
+ {
+ total += (int)w.Width;
+ }
+ await JSRuntime.SetGridWidth("idDemoGrid", $"{total}px"); //列幅設定値に固定する
+ EnvironmentSetting.Debug($"デモマスタ⇒SetGridWidth");
+ }
+ }
+
+ protected override async Task OnAfterRenderAsync(bool firstRender)
+ {
+ EnvironmentSetting.Debug($"【{DateTime.Now.ToString("HH:mm:ss fff")}】デモマスタ⇒OnAfterRenderAsync.Begin firstRender={firstRender}");
+ await SetGridWidth();
+ EnvironmentSetting.Debug($"【{DateTime.Now.ToString("HH:mm:ss fff")}】デモマスタ⇒OnAfterRenderAsync.End firstRender={firstRender}");
+ }
+
+ private string GetFieldName(string name)
+ {
+ return defColSetting.FieldMap.ContainsKey(name) ? defColSetting.FieldMap[name] : name;
+ }
+
+ /// <summary>
+ /// サーバーデータの読込
+ /// </summary>
+ /// <param name="state"></param>
+ /// <returns></returns>
+ private async Task<TableData<HotelPms.Data.Master.Demo>> GetData(TableState state)
+ {
+ loading = true;
+ pagingRequest.OrderBy = viewModel.GetOrderSql();
+ pagingRequest.PageSize = state.PageSize;
+ pagingRequest.PageNumber = state.Page + 1;
+ using (DemoAccess access = new DemoAccess(Channel))
+ {
+ var dataPage = await access.GetPageData(pagingRequest);
+ if (dataPage.ErrNo == 0)
+ {
+ PagingRespone pagingRespone = JsonSerializer.Deserialize<PagingRespone>(dataPage.Tag);
+ existsData = pagingRespone.TotalRow > 0;
+ loading = false;
+ StateHasChanged();
+
+ return new TableData<HotelPms.Data.Master.Demo>
+ {
+ Items = dataPage.Rows,
+ TotalItems = pagingRespone.TotalRow
+ };
+ }
+ else if (dataPage.ErrNo == 401)
+ {
+ NavigationManager.NavigateTo("pages/authentication/login", false);
+
+ return new TableData<HotelPms.Data.Master.Demo>
+ {
+ Items = null,
+ TotalItems = 0
+ };
+ }
+ else
+ {
+ var parameters = new DialogParameters { ["MsgType"] = EMessageType.OK, ["Title"] = "データ読込", ["Data"] = new List<string> { "データ読込に失敗しました。", $"{dataPage.ErrNo}.{dataPage.ErrData}" } };
+ var dialog = DialogService.Show<MessageBox>(string.Empty, parameters);
+ await dialog.Result;
+ existsData = false;
+ loading = false;
+ StateHasChanged();
+
+ return new TableData<HotelPms.Data.Master.Demo>
+ {
+ Items = null,
+ TotalItems = 0
+ };
+ }
+ }
+ }
+
+ /// <summary>
+ /// 検索
+ /// </summary>
+ private async Task Search()
+ {
+ if (searchKey == null) { searchKey = string.Empty; }
+ pagingRequest.Filter = viewModel.GetFilterSql(searchKey);
+ await table.ReloadServerData(); //⇒Raise GetDataイベント
+ }
+
+ /// <summary>
+ /// 新規作成
+ /// </summary>
+ private void Add()
+ {
+ //viewModel = new ViewModel.Demo(JSRuntime);
+
+ viewModel.Clear();
+ viewModel.EditMode = (int)EMasterEditStatus.Create;
+
+ CacheStorage.Instance.Set(CacheStorage.Key.ViewModel, viewModel); //簡単&乱暴
+ NavigationManager.NavigateTo($"master/demo/detail/0", false);
+ }
+
+ /// <summary>
+ /// 出力
+ /// </summary>
+ private async Task Output()
+ {
+ loading = true;
+ PagingRequest request = new PagingRequest();
+ pagingRequest.CopyTo(request);
+ request.PageSize = 1;
+ request.PageNumber = -1;
+ using (DemoAccess access = new DemoAccess(Channel))
+ {
+ var data = await access.OutputStream(request);
+ if (data != null)
+ {
+ await JSRuntime.SaveAsFileAsync("data", data.Content.ToByteArray(), "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", false);
+ }
+ }
+ loading = false;
+ }
+
+ private async Task SetCol()
+ {
+ ViewModel.ColSettingData data = await ViewModel.ColSettingData.Create((int)EReportID.Demo, Channel);
+ if (data != null)
+ {
+ var parameters = new DialogParameters { ["Data"] = data };
+ var dialog = DialogService.Show<ColSetting>("列情報設定", parameters);
+ var result = await dialog.Result;
+ if (!result.Cancelled)
+ {
+ await LoadColSetting();
+ await table.ReloadServerData(); //⇒Raise GetDataイベント
+ await SetGridWidth();
+ }
+ }
+ }
+
+ /// <summary>
+ /// 編集
+ /// </summary>
+ /// <param name="item"></param>
+ /// <param name="args"></param>
+ private async Task Edit(HotelPms.Data.Master.Demo item, MouseEventArgs args)
+ {
+ //viewModel = new ViewModel.Demo(JSRuntime)
+ //{
+ // EditMode = (int)EMasterEditStatus.Update,
+ //};
+
+ viewModel.Clear();
+ viewModel.EditMode = (int)EMasterEditStatus.Update;
+ viewModel.GetField("ID").Disabled = true;
+ for (int i = 0; i < viewModel.Fields.Count; i++)
+ {
+ viewModel.SetField(viewModel.Fields[i].Name, item.GetFieldString(viewModel.Fields[i].Name).ToString());
+ if (viewModel.Fields[i].Name == "FBit")
+ {
+ viewModel.Fields[i].DispText = ((EVisible)CConvert.ToInt(viewModel.Fields[i].Text)).ToDescription<EVisible>();
+ }
+ }
+
+ CacheStorage.Instance.Set(CacheStorage.Key.ViewModel, viewModel); //簡単&乱暴
+ NavigationManager.NavigateTo($"master/demo/detail/{item.ID}", false);
+ }
+
+ /// <summary>
+ /// 削除処理
+ /// </summary>
+ /// <param name="item"></param>
+ /// <param name="args"></param>
+ /// <returns></returns>
+ private async Task Delete(HotelPms.Data.Master.Demo item, MouseEventArgs args)
+ {
+ var parameters = new DialogParameters { ["MsgType"] = EMessageType.YesNo, ["Title"] = "削除", ["Data"] = Message.GetConfirmForRemove($"{item.ID}.{item.Name}") };
+ var dialog = DialogService.Show<MessageBox>(string.Empty, parameters);
+ var result = await dialog.Result;
+ if (result.Cancelled)
+ {
+ return;
+ }
+
+ using (DemoAccess access = new DemoAccess(Channel))
+ {
+ var resultData = await access.RemoveAsync($"ID={item.ID}");
+ if (resultData.ErrNo == 0)
+ {
+ await table.ReloadServerData(); //⇒Raise GetDataイベント
+ }
+ else
+ {
+ parameters = new DialogParameters { ["MsgType"] = EMessageType.OK, ["Title"] = "DB更新エラー", ["Data"] = new List<string> { "削除に失敗しました。", $"{resultData.ErrNo}.{resultData.ErrData}" } };
+ dialog = DialogService.Show<MessageBox>(string.Empty, parameters);
+ await dialog.Result;
+ }
+ }
+ }
+
+ /// <summary>
+ /// グリッドの選択イベント
+ /// </summary>
+ /// <param name="row"></param>
+ private void SelectionChangedEvent(object row)
+ {
+ if (row == null)
+ {
+ //未選択
+ }
+ else
+ {
+ }
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.Client.Blazor/Pages/Pages/Master/Demo/Detail.razor b/HotelPms.Client.Blazor/Pages/Pages/Master/Demo/Detail.razor
new file mode 100644
index 0000000..4fd065a
--- /dev/null
+++ b/HotelPms.Client.Blazor/Pages/Pages/Master/Demo/Detail.razor
@@ -0,0 +1,244 @@
+@page "/master/demo/detail/{id:int}"
+@inject GrpcChannel Channel
+@inject IJSRuntime JSRuntime
+@inject NavigationManager NavigationManager
+@using HotelPms.Share.IO
+@using HotelPms.Share.Util
+@using HotelPms.Data.Common
+@using ViewModel = HotelPms.Client.Blazor.ViewModel
+@using static HotelPms.Client.Blazor.Util.SystemEnum
+<MudGrid Spacing="1" Justify="Justify.FlexStart" Class="align-center mt-2 mb-5">
+ <MudItem>
+ <MudButton @ref="btnSave" Variant="Variant.Filled" Color="MudBlazor.Color.Primary" OnClick="Save" StartIcon="@Icons.Filled.Save" Class="focus-button" Style="width: 120px; height: 40px;">保存</MudButton>
+ </MudItem>
+ <MudItem>
+ <MudButton Variant="Variant.Filled" Color="MudBlazor.Color.Primary" OnClick="Close" StartIcon="@Icons.Filled.Close" Class="focus-button" Style="width: 120px; height: 40px;">閉じる</MudButton>
+ </MudItem>
+</MudGrid>
+@if (Data != null)
+{
+ <MudGrid Justify="Justify.FlexStart" Class="align-center">
+ @if (errorAll.Length > 0)
+ {
+ <MudItem xs="12">
+ <MudText Color="@Color.Error">@errorAll</MudText>
+ </MudItem>
+ }
+
+ @foreach(var field in Data.Fields)
+ {
+ <MudItem xs="@field.WidthUnit">
+ <MudTextField @bind-Value="field.Text" Error="@field.Error" ErrorText="@field.ErrorText" @ref="field.Ref" T="string" Label="@field.Caption"
+ AutoFocus = "@((field.Index == 0 && Data.EditMode == (int)EMasterEditStatus.Create) || (field.Index == 1 && Data.EditMode == (int)EMasterEditStatus.Update))"
+ OnKeyDown="@(e => Data.KeyDown(field.Index, e))" KeyDownPreventDefault="@Data.KeyDownPreventDefault"
+ OnKeyPress="@(e => Data.KeyPress(field.Index, e))" KeyPressPreventDefault="@Data.KeyPressPreventDefault"
+ OnBlur="@(e => Data.Leave(field.Index, e))"
+ @onfocus="(e => Data.Enter(field.Index, e))" Margin="Margin.Dense" MaxLength="@field.MaxLenth"
+ Adornment="@(field.ShowStyle == EShowStyle.ShowList ? Adornment.End : Adornment.None)"
+ AdornmentIcon="@(field.ShowStyle == EShowStyle.ShowList ? Icons.Material.Filled.ListAlt : string.Empty)"
+ OnAdornmentClick="@(() => ShowListAction(field))" Disabled="@field.Disabled" />
+ </MudItem>
+
+ if (field.DispNameEnabled)
+ {
+ <MudItem xs="@field.DispWidthUnit">
+ <MudField Variant="Variant.Filled" Margin="Margin.Dense">@field.DispText</MudField>
+ </MudItem>
+ }
+
+ if (field.NewLine)
+ {
+ <MudItem xs="@(12 - field.WidthUnit)"></MudItem>
+ }
+ }
+ </MudGrid>
+}
+
+@code {
+ [Parameter]public int ID { get; set; }
+ [Inject] private IDialogService? DialogService { get; set; }
+ private ViewModel.Demo? Data;
+ private string errorAll = string.Empty;
+ private MudButton? btnSave;
+
+ /// <summary>
+ /// onfocusの変数化可能になった
+ /// </summary>
+ protected override void OnInitialized()
+ {
+ Data = CacheStorage.Instance.Get(CacheStorage.Key.ViewModel) as ViewModel.Demo; //簡単&乱暴
+ Data.Refresh = new Action(StateHasChanged); //メイン画面の更新
+ Data.BeforeAutoNextFocus += BeforeAutoNextFocus;
+ Data.BusinessValid += BusinessValid;
+ Data.ShowList += ShowList;
+ }
+
+ private async void ShowList(ViewModel.ValidField sender, ViewModel.ValidEventArgs e)
+ {
+ await ShowListAction(sender);
+ }
+
+ /// <summary>
+ /// 業務チェックを行う
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ /// <returns></returns>
+ private async Task<bool> BusinessValid(ViewModel.ValidField sender, ViewModel.ValidEventArgs e)
+ {
+ if (sender.Name == "ID")
+ {
+ using (DemoAccess access = new DemoAccess(Channel))
+ {
+ bool ret = await access.ExistsAsync(CConvert.ToInt(e.Text));
+ EnvironmentSetting.Debug($"access.Exists:{ret}");
+ if (Data.EditMode == (int)EMasterEditStatus.Create && ret)
+ {
+ if (e.EnterPush)
+ {
+ sender.Error = true;
+ sender.ErrorText = "当該データが既に存在します。";
+ }
+ else
+ {
+ sender.Error = false;
+ sender.ErrorText = string.Empty;
+ }
+ //StateHasChanged();
+ return false;
+ }
+ else if (Data.EditMode == (int)EMasterEditStatus.Update && !ret)
+ {
+ if (e.EnterPush)
+ {
+ sender.Error = true;
+ sender.ErrorText = "当該データが存在しません。";
+ }
+ else
+ {
+ sender.Error = false;
+ sender.ErrorText = string.Empty;
+ }
+ //StateHasChanged();
+ return false;
+ }
+ }
+ }
+ else if (sender.Name == "FBit")
+ {
+ sender.DispText = ((EVisible)CConvert.ToInt(e.Text)).ToDescription<EVisible>();
+ }
+
+ sender.Error = false;
+ sender.ErrorText = string.Empty;
+ //StateHasChanged();
+ return true;
+ }
+
+ /// <summary>
+ /// フォーカスを移動
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ /// <returns></returns>
+ private async Task<bool> BeforeAutoNextFocus(ViewModel.ValidField sender, ViewModel.ValidEventArgs e)
+ {
+ if (sender.Index == Data.Fields.Count - 1 && e.EnterPush)
+ {
+ await btnSave.FocusAsync(); //ここから非同期処理
+ return false;
+ }
+ return true;
+ }
+
+ /// <summary>
+ /// Endキー
+ /// </summary>
+ /// <param name="item"></param>
+ private async Task ShowListAction(ViewModel.ValidField item)
+ {
+ if (item.Name == "FBit")
+ {
+ if (item.Text.Length == 0) { return; }
+ using (DataTable data = CConvert.GetEnumTypeList<EVisible>())
+ {
+ var parameters = new DialogParameters { ["Data"] = data };
+ var dialog = DialogService.Show<SelectList>($"{item.Caption}検索", parameters);
+ var ret = await dialog.Result;
+ if (!ret.Cancelled)
+ {
+ var row = ret.Data as DataRow;
+ item.Text = row[0].ToString();
+ item.DispText = row[1].ToString();
+ StateHasChanged();
+ }
+ }
+ }
+ else if (item.Name == "FDate")
+ {
+ var parameters = new DialogParameters { ["Title"] = $"{item.Caption}選択", ["Data"] = CConvert.ToDateTime(item.Text) };
+ var dialog = DialogService.Show<SelectDate>(string.Empty, parameters);
+ var ret = await dialog.Result;
+ if (!ret.Cancelled)
+ {
+ EnvironmentSetting.Debug(ret.Data.ToString());
+ item.Text = ret.Data.ToString();
+ StateHasChanged();
+ }
+ }
+ else
+ {
+ await DialogService.ShowMessageBox(
+ "Warning",
+ "未実装!",
+ yesText: "OK", cancelText: "Cancel");
+ }
+ }
+
+ /// <summary>
+ /// 保存
+ /// </summary>
+ private async void Save()
+ {
+ if (!await Data.IsValidAll())
+ {
+ //errorAll = Data.ErrText;
+ return;
+ }
+
+ //データ保存
+ using (DemoAccess access = new DemoAccess(Channel))
+ {
+ HotelPms.Data.Master.Demo item = new HotelPms.Data.Master.Demo()
+ {
+ ID = CConvert.ToInt(Data.GetField("ID").Text),
+ Name = Data.GetField("Name").Text,
+ FInt = CConvert.ToInt(Data.GetField("FInt").Text),
+ FTinyInt = CConvert.ToInt(Data.GetField("FTinyInt").Text),
+ FSmallInt = CConvert.ToInt(Data.GetField("FSmallInt").Text),
+ FFloat = CConvert.ToInt(Data.GetField("FFloat").Text),
+ FBit = CConvert.ToBool(Data.GetField("FBit").Text),
+ FDecimal = CConvert.ToDecimal(Data.GetField("FDecimal").Text),
+ FDate = CConvert.ToDateTime(Data.GetField("FDate").Text),
+ };
+
+ var result = Data.EditMode == (int)EMasterEditStatus.Create ? await access.AddAsync(item) : await access.UpdateAsync(item);
+ if(result.ErrNo != 0)
+ {
+ errorAll = $"更新に失敗しました。";
+ OperationLog.Instance.WriteLog($"Demo.Save:{result.ErrNo}.{result.ErrData}");
+ return;
+ }
+ }
+
+ NavigationManager.NavigateTo($"master/demo/crud", false);
+ }
+
+ /// <summary>
+ /// 前の頁に戻る
+ /// </summary>
+ private void Close()
+ {
+ NavigationManager.NavigateTo($"master/demo/crud", false);
+ }
+}
diff --git a/HotelPms.Client.Blazor/Pages/Pages/Master/RoomStatus/Crud.razor b/HotelPms.Client.Blazor/Pages/Pages/Master/RoomStatus/Crud.razor
new file mode 100644
index 0000000..e109c0c
--- /dev/null
+++ b/HotelPms.Client.Blazor/Pages/Pages/Master/RoomStatus/Crud.razor
@@ -0,0 +1,363 @@
+@page "/master/roomstatus/crud"
+@inject GrpcChannel Channel
+@inject IJSRuntime JSRuntime
+@using HotelPms.Data.Common
+@using HotelPms.Data.Common.Pagination
+@using Google.Protobuf.WellKnownTypes
+@using System.Text.Json
+@using ViewModel = HotelPms.Client.Blazor.ViewModel
+@using static HotelPms.Client.Blazor.Util.SystemEnum
+@inject IDialogService DialogService
+@inject NavigationManager NavigationManager
+
+<MudGrid Spacing="5" Class="align-center">
+ <MudItem>
+ <MudText Typo="Typo.h3">部屋状態マスタ設定【@EnvironmentSetting.ClientID】</MudText>
+ </MudItem>
+@* <MudItem>
+ <MudProgressCircular Class="@(loading ? "d-flex" : "d-none")" Color="MudBlazor.ColorInfo" Indeterminate="true" />
+ </MudItem>
+*@</MudGrid>
+@if(defColSetting != null)
+{
+<MudGrid Spacing="@spacing" Justify="Justify.FlexStart" Class="align-center mt-2 mb-5">
+ <MudItem>
+ <MudButton Variant="Variant.Filled" Style ="@buttonStyle" StartIcon="@Icons.Filled.Add" OnClick="Add">新規</MudButton>
+ </MudItem>
+ <MudItem>
+ <MudButton Variant="Variant.Filled" Style ="@buttonStyle" StartIcon="@Icons.Filled.Print" OnClick="Output">出力</MudButton>
+ </MudItem>
+ <MudItem>
+ <MudButton Variant="Variant.Filled" Style ="@buttonStyle" StartIcon="@Icons.Filled.PostAdd" OnClick="SetCol">列設定</MudButton>
+ </MudItem>
+ <MudItem>
+ <MudButton Variant="Variant.Filled" Style ="@buttonStyle" StartIcon="@Icons.Filled.Input">インポート</MudButton>
+ </MudItem>
+</MudGrid>
+<MudGrid Class="@(loading ? "d-none" : "d-flex")">
+ <MudItem xs="12">
+ <MudTable ServerData="@(new Func<TableState, Task<TableData<HotelPms.Data.Master.RoomStatus>>>(GetData))" id="idRoomStatusGrid"
+ @ref="table" FixedHeader="true" Breakpoint="Breakpoint.Sm" Height="650px" Hover="true" Bordered="true" Striped="true" Dense="true" HorizontalScrollbar="true">
+ <ToolBarContent>
+ <MudTextField Class="mr-2" Margin="Margin.Dense" @bind-Value="searchKey" Label="フィルター" Variant="Variant.Outlined" Adornment="Adornment.End" AdornmentIcon="@Icons.Filled.Search" AdornmentColor="MudBlazor.Color.Secondary" Style="ime-mode: active;" OnAdornmentClick="Search" />
+ <MudSelect Margin="Margin.Dense" T="KeyValuePair<int,string>" Value="@selectPattern" Label="列設定パターン" Variant="Variant.Outlined" ToStringFunc="@PatternConverter" AnchorOrigin="Origin.BottomLeft" TransformOrigin="Origin.TopLeft" ValueChanged="PatternChanged">
+ @foreach (KeyValuePair<int,string> pattern in defColSetting.SelectList)
+ {
+ <MudSelectItem Value="@pattern" />
+ }
+ </MudSelect>
+ <MudSpacer />
+ @if(existsData)
+ {
+ <MudTablePager PageSizeOptions="@EnvironmentSetting.CountOfPage" RowsPerPageString="頁毎表示行数 " Style="border-top: none;" />
+ }
+ </ToolBarContent>
+ <ColGroup>
+ <col style="@EnvironmentSetting.GetOpeColWidthCss()" />
+ @foreach(HotelPms.Data.Master.OutputItem w in defColSetting.Items)
+ {
+ <col style="@EnvironmentSetting.GetWidthCss((int)w.Width)" />
+ }
+ </ColGroup>
+ <HeaderContent>
+ <MudTh Style="text-align: center;">操作</MudTh>
+ @foreach(HotelPms.Data.Master.OutputItem th in defColSetting.Items)
+ {
+ <MudTh>@th.Name</MudTh>
+ }
+ </HeaderContent>
+ <RowTemplate>
+ <MudTd>
+ <MudGrid Spacing="@spacing" Justify="Justify.Center" Class="align-center">
+ <MudItem>
+ <MudButton Variant="Variant.Filled" Style ="@buttonStyleEdit" StartIcon="@Icons.Filled.Edit" OnClick="@(e => Edit(context, e))">編集</MudButton>
+ </MudItem>
+ <MudItem>
+ <MudButton Variant="Variant.Filled" Style ="@buttonStyleDelete" StartIcon="@Icons.Filled.Delete" OnClick="@(e => Delete(context, e))">削除</MudButton>
+ </MudItem>
+ </MudGrid>
+ </MudTd>
+ @foreach(HotelPms.Data.Master.OutputItem td in defColSetting.Items)
+ {
+ <MudTd DataLabel="@GetFieldName(td.Name)">@context.GetField(GetFieldName(td.Name))</MudTd>
+ }
+ </RowTemplate>
+ </MudTable>
+ </MudItem>
+</MudGrid>
+}
+
+@code {
+ [CascadingParameter]
+ public Error Error { get; set; }
+ private int spacing { get; set; } = 1;
+ private string buttonStyle = $"color:{Colors.Shades.White};background-color:{Colors.Green.Darken2};width: 150px; height: 40px;";
+ private string buttonStyleEdit = $"color:{Colors.Shades.White};background-color:{Colors.Indigo.Darken2};width: 100px; height: 40px;";
+ private string buttonStyleDelete = $"color:{Colors.Shades.White};background-color:{Colors.Red.Darken2};width: 100px; height: 40px;";
+ private MudTable<HotelPms.Data.Master.RoomStatus> table;
+ private PagingRequest pagingRequest = new PagingRequest();
+ private string searchKey;
+ private bool loading = true;
+ private ViewModel.RoomStatus? viewModel;
+ private bool existsData = false;
+ private HotelPms.Data.Master.Output defColSetting = null;
+ private KeyValuePair<int, string> selectPattern;
+
+ private Func<KeyValuePair<int, string>, string> PatternConverter = p => p.Value;
+
+ private async Task PatternChanged(KeyValuePair<int, string> e)
+ {
+ selectPattern = e;
+ EnvironmentSetting.Debug($"{selectPattern.Key}.{selectPattern.Value}");
+ await LoadColSetting();
+ await table.ReloadServerData(); //⇒Raise GetDataイベント
+ await SetGridWidth();
+ }
+
+ protected override async Task OnInitializedAsync()
+ {
+ EnvironmentSetting.Debug($"【{DateTime.Now.ToString("HH:mm:ss fff")}】館マスタ⇒OnInitializedAsync.Begin");
+ viewModel = new ViewModel.RoomStatus(JSRuntime);
+ await LoadColSetting();
+ EnvironmentSetting.Debug($"【{DateTime.Now.ToString("HH:mm:ss fff")}】館マスタ⇒OnInitializedAsync.End");
+ }
+
+ private async Task LoadColSetting()
+ {
+ using (OutputAccess access = new OutputAccess(Channel))
+ {
+ EnvironmentSetting.Debug($"【{DateTime.Now.ToString("HH:mm:ss fff")}】selectPattern.Key = {selectPattern.Key}");
+ defColSetting = await access.GetDefColSetting(Environment.MachineName, EnvironmentSetting.UserName, (int)EReportID.RoomStatus, selectPattern.Key);
+ if (selectPattern.Key == 0) { selectPattern = defColSetting.SelectList.FirstOrDefault(); } //絶対ある
+ }
+ }
+
+ private async Task SetGridWidth()
+ {
+ if (defColSetting != null && !loading)
+ {
+ int total = EnvironmentSetting.MasterOpeColWidth;
+ foreach (HotelPms.Data.Master.OutputItem w in defColSetting.Items)
+ {
+ total += (int)w.Width;
+ }
+ await JSRuntime.SetGridWidth("idRoomStatusGrid", $"{total}px"); //列幅設定値に固定する
+ EnvironmentSetting.Debug($"館マスタ⇒SetGridWidth");
+ }
+ }
+
+ protected override async Task OnAfterRenderAsync(bool firstRender)
+ {
+ EnvironmentSetting.Debug($"【{DateTime.Now.ToString("HH:mm:ss fff")}】館マスタ⇒OnAfterRenderAsync.Begin firstRender={firstRender}");
+ await SetGridWidth();
+ EnvironmentSetting.Debug($"【{DateTime.Now.ToString("HH:mm:ss fff")}】館マスタ⇒OnAfterRenderAsync.End firstRender={firstRender}");
+ }
+
+ private string GetFieldName(string name)
+ {
+ return defColSetting.FieldMap.ContainsKey(name) ? defColSetting.FieldMap[name] : name;
+ }
+
+ /// <summary>
+ /// サーバーデータの読込
+ /// </summary>
+ /// <param name="state"></param>
+ /// <returns></returns>
+ private async Task<TableData<HotelPms.Data.Master.RoomStatus>> GetData(TableState state)
+ {
+ loading = true;
+ pagingRequest.OrderBy = viewModel.GetOrderSql();
+ pagingRequest.PageSize = state.PageSize;
+ pagingRequest.PageNumber = state.Page + 1;
+ using (RoomStatusAccess access = new RoomStatusAccess(Channel))
+ {
+ var dataPage = await access.GetPageData(pagingRequest);
+ if (dataPage.ErrNo == 0)
+ {
+ PagingRespone pagingRespone = JsonSerializer.Deserialize<PagingRespone>(dataPage.Tag);
+ existsData = pagingRespone.TotalRow > 0;
+ loading = false;
+ StateHasChanged();
+
+ return new TableData<HotelPms.Data.Master.RoomStatus>
+ {
+ Items = dataPage.Rows,
+ TotalItems = pagingRespone.TotalRow
+ };
+ }
+ else if (dataPage.ErrNo == 401)
+ {
+ Error.ProcessError(new Exception("aaaa"));
+
+ NavigationManager.NavigateTo("/user/login", false);
+ return new TableData<HotelPms.Data.Master.RoomStatus>
+ {
+ Items = null,
+ TotalItems = 0
+ };
+ }
+ else
+ {
+ var parameters = new DialogParameters { ["MsgType"] = EMessageType.OK, ["Title"] = "データ読込", ["Data"] = new List<string> { "データ読込に失敗しました。", $"{dataPage.ErrNo}.{dataPage.ErrData}" } };
+ var dialog = DialogService.Show<MessageBox>(string.Empty, parameters);
+ await dialog.Result;
+ existsData = false;
+ loading = false;
+ StateHasChanged();
+
+ return new TableData<HotelPms.Data.Master.RoomStatus>
+ {
+ Items = null,
+ TotalItems = 0
+ };
+ }
+ }
+ }
+
+ /// <summary>
+ /// 検索
+ /// </summary>
+ private async Task Search()
+ {
+ if(searchKey == null) { searchKey = string.Empty; }
+ pagingRequest.Filter = viewModel.GetFilterSql(searchKey);
+ await table.ReloadServerData(); //⇒Raise GetDataイベント
+ }
+
+ /// <summary>
+ /// 新規作成
+ /// </summary>
+ private async Task Add()
+ {
+ viewModel.Clear();
+ viewModel.JSRuntime = JSRuntime;
+ viewModel.EditMode = (int)EMasterEditStatus.Create;
+ viewModel.GetField("ID").Disabled = false;
+ var parameters = new DialogParameters { ["Data"]=viewModel };
+ var dialog = DialogService.Show<Detail>("詳細情報", parameters);
+ var result = await dialog.Result;
+
+ if (!result.Cancelled)
+ {
+ //ViewModel.RoomStatus ret = result.Data as ViewModel.RoomStatus;
+ await table.ReloadServerData(); //⇒Raise GetDataイベント
+ }
+ }
+
+ /// <summary>
+ /// 出力
+ /// </summary>
+ private async Task Output()
+ {
+ loading = true;
+ PagingRequest request = new PagingRequest();
+ pagingRequest.CopyTo(request);
+ request.PageSize = 1;
+ request.PageNumber = -1;
+ using (RoomStatusAccess access = new RoomStatusAccess(Channel))
+ {
+ var data = await access.OutputStream(request);
+ if (data != null)
+ {
+ await JSRuntime.SaveAsFileAsync("data", data.Content.ToByteArray(), "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", false);
+ }
+ }
+ loading = false;
+ }
+
+ private async Task SetCol()
+ {
+ ViewModel.ColSettingData data = await ViewModel.ColSettingData.Create((int)EReportID.RoomStatus, Channel);
+ if (data != null)
+ {
+ var parameters = new DialogParameters { ["Data"] = data };
+ var dialog = DialogService.Show<ColSetting>("列情報設定", parameters);
+ var result = await dialog.Result;
+ if (!result.Cancelled)
+ {
+ await LoadColSetting();
+ await table.ReloadServerData(); //⇒Raise GetDataイベント
+ await SetGridWidth();
+ }
+ }
+ }
+
+ /// <summary>
+ /// 編集
+ /// </summary>
+ /// <param name="item"></param>
+ /// <param name="args"></param>
+ private async Task Edit(HotelPms.Data.Master.RoomStatus item, MouseEventArgs args)
+ {
+ viewModel.Clear();
+ viewModel.JSRuntime = JSRuntime;
+ viewModel.EditMode = (int)EMasterEditStatus.Update;
+ viewModel.GetField("ID").Disabled = true;
+ for (int i = 0; i < viewModel.Fields.Count; i++)
+ {
+ viewModel.SetField(viewModel.Fields[i].Name, item.GetField(viewModel.Fields[i].Name).ToString());
+ if (viewModel.Fields[i].Name == "MaidType")
+ {
+ viewModel.Fields[i].DispText = ((EMaidType)CConvert.ToInt(viewModel.Fields[i].Text)).ToDescription<EMaidType>();
+ }
+ }
+
+ var parameters = new DialogParameters { ["Data"]=viewModel };
+ var dialog = DialogService.Show<Detail>("詳細情報", parameters);
+ var result = await dialog.Result;
+
+ if (!result.Cancelled)
+ {
+ //ViewModel.RoomStatus ret = result.Data as ViewModel.RoomStatus;
+ await table.ReloadServerData(); //⇒Raise GetDataイベント
+ }
+ }
+
+
+ /// <summary>
+ /// 削除処理
+ /// </summary>
+ /// <param name="item"></param>
+ /// <param name="args"></param>
+ /// <returns></returns>
+ private async Task Delete(HotelPms.Data.Master.RoomStatus item, MouseEventArgs args)
+ {
+ var parameters = new DialogParameters { ["MsgType"]=EMessageType.YesNo, ["Title"]="削除" ,["Data"]=Message.GetConfirmForRemove($"{item.ID}.{item.Name}") };
+ var dialog = DialogService.Show<MessageBox>(string.Empty, parameters);
+ var result = await dialog.Result;
+ if (result.Cancelled)
+ {
+ return;
+ }
+
+ using (RoomStatusAccess access = new RoomStatusAccess(Channel))
+ {
+ var resultData = await access.RemoveAsync($"ID={item.ID}");
+ if(resultData.ErrNo == 0)
+ {
+ await table.ReloadServerData(); //⇒Raise GetDataイベント
+ }
+ else
+ {
+ parameters = new DialogParameters { ["MsgType"] = EMessageType.OK, ["Title"] = "DB更新エラー", ["Data"] = new List<string> { "削除に失敗しました。", $"{resultData.ErrNo}.{resultData.ErrData}" } };
+ dialog = DialogService.Show<MessageBox>(string.Empty, parameters);
+ await dialog.Result;
+ }
+ }
+ }
+
+ /// <summary>
+ /// グリッドの選択イベント
+ /// </summary>
+ /// <param name="row"></param>
+ private void SelectionChangedEvent(object row)
+ {
+ if (row == null)
+ {
+ //未選択
+ }
+ else
+ {
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/Pages/Pages/Master/RoomStatus/Detail.razor b/HotelPms.Client.Blazor/Pages/Pages/Master/RoomStatus/Detail.razor
new file mode 100644
index 0000000..4c48db2
--- /dev/null
+++ b/HotelPms.Client.Blazor/Pages/Pages/Master/RoomStatus/Detail.razor
@@ -0,0 +1,277 @@
+@using System.ComponentModel.DataAnnotations
+@using System.Text.RegularExpressions
+@using System.Reflection
+@using HotelPms.Client.Blazor.ViewModel
+@using HotelPms.Data.Common
+@using HotelPms.Data.Common.Interface.Master
+@using HotelPms.DataAccessGrpc.Client
+@using HotelPms.Share.IO
+@using HotelPms.Share.Util
+@using ViewModel = HotelPms.Client.Blazor.ViewModel
+@using static HotelPms.Client.Blazor.Util.SystemEnum
+@inject IJSRuntime JSRuntime
+
+<MudDialog Style="width: 900px;">
+ <TitleContent>
+ <MudText Typo="Typo.h6">
+ <MudIcon Icon="@Icons.Material.Filled.Dvr" Class="mr-3 mb-n1"/>
+ 部屋状態マスタ詳細
+ </MudText>
+ </TitleContent>
+ <DialogContent>
+ <MudGrid Justify="Justify.FlexStart" Class="align-center">
+ @if (errorAll.Length > 0)
+ {
+ <MudItem xs="12">
+ <MudText Color="@Color.Error">@errorAll</MudText>
+ </MudItem>
+ }
+
+ @foreach (var field in Data.Fields)
+ {
+ <MudItem xs="@field.WidthUnit">
+ <MudTextField @bind-Value="field.Text" Error="@field.Error" ErrorText="@field.ErrorText" @ref="field.Ref" T="string" Label="@field.Caption"
+ AutoFocus="@((field.Index == 0 && Data.EditMode == (int)EMasterEditStatus.Create) || (field.Index == 1 && Data.EditMode == (int)EMasterEditStatus.Update))"
+ OnKeyDown="@(e => Data.KeyDown(field.Index, e))" KeyDownPreventDefault="@Data.KeyDownPreventDefault"
+ OnKeyPress="@(e => Data.KeyPress(field.Index, e))" KeyPressPreventDefault="@Data.KeyPressPreventDefault"
+ OnBlur="@(e => Data.Leave(field.Index, e))"
+ @onfocus="(e => Data.Enter(field.Index, e))" Margin="Margin.Dense" maxlength="@field.MaxLenth"
+ Adornment="@(field.ShowStyle == EShowStyle.ShowList ? Adornment.End : Adornment.None)"
+ AdornmentIcon="@(field.ShowStyle == EShowStyle.ShowList ? Icons.Material.Filled.ListAlt : string.Empty)"
+ OnAdornmentClick="@(() => ShowListAction(field))" Disabled="@field.Disabled" />
+ </MudItem>
+
+ if (field.DispNameEnabled)
+ {
+ if (field.Name == "ForeColor" || field.Name == "BackColor")
+ {
+ <MudItem xs="@field.DispWidthUnit">
+ <MudPaper Class="pa-3" Style="@($"background-color: {field.Text};")"></MudPaper>
+ </MudItem>
+ }
+ else
+ {
+ <MudItem xs="@field.DispWidthUnit">
+ <MudField Variant="Variant.Text" Margin="Margin.Dense">@field.DispText</MudField>
+ </MudItem>
+ }
+ }
+
+ if (field.NewLine)
+ {
+ <MudItem xs="@(12 - field.WidthUnit)"></MudItem>
+ }
+ }
+ </MudGrid>
+ </DialogContent>
+ <DialogActions>
+ <MudGrid Spacing="2" Justify="Justify.Center" Class="my-3">
+ <MudItem>
+ <MudButton @ref="btnSave" Variant="Variant.Filled" Color="MudBlazor.Color.Primary" OnClick="Save" StartIcon="@Icons.Filled.Save" Class="focus-button" Style="width: 120px; height: 40px;">保存</MudButton>
+ </MudItem>
+ <MudItem>
+ <MudButton Variant="Variant.Filled" Color="MudBlazor.Color.Primary" OnClick="Close" StartIcon="@Icons.Filled.Close" Class="focus-button" Style="width: 120px; height: 40px;">閉じる</MudButton>
+ </MudItem>
+ </MudGrid>
+ </DialogActions>
+</MudDialog>
+
+@*<style>
+ /* 伪类选择器 :focus-within */
+ /* 它表示一个元素获得焦点,或,该元素的后代元素获得焦点。划重点,它或它的后代获得焦点。 */
+ /* 这也就意味着,它或它的后代获得焦点,都可以触发 :focus-within。 */
+ .focus-button:focus-within {
+ border: 1px solid;
+ border-color: #00FF00;
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(0, 255, 0, 0.6);
+ -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(0, 255, 0, 0.6);
+ box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.075), 0px 0px 8px rgba(0, 255, 0, 0.6);
+ }
+</style>
+*@
+
+@code {
+ [Inject] private IDialogService DialogService { get; set; }
+ [Inject] private GrpcChannel Channel { get; set; }
+ [CascadingParameter] MudDialogInstance MudDialog { get; set; }
+ [Parameter] public ViewModel.RoomStatus Data { get; set; }
+ private string errorAll = string.Empty;
+ private MudButton btnSave;
+
+ protected override void OnInitialized()
+ {
+ Data.Refresh = new Action(StateHasChanged); //メイン画面の更新
+ Data.BeforeAutoNextFocus += BeforeAutoNextFocus;
+ Data.BusinessValid += BusinessValid;
+ Data.ShowList += ShowList;
+ }
+
+ private async void ShowList(ValidField sender, ValidEventArgs e)
+ {
+ await ShowListAction(sender);
+ }
+
+ /// <summary>
+ /// 業務チェックを行う
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ /// <returns></returns>
+ private async Task<bool> BusinessValid(ValidField sender, ValidEventArgs e)
+ {
+ if (sender.Name == "ID")
+ {
+ using (RoomStatusAccess access = new RoomStatusAccess(Channel))
+ {
+ bool ret = await access.ExistsAsync(CConvert.ToInt(e.Text));
+ EnvironmentSetting.Debug($"access.Exists:{ret}");
+ if(Data.EditMode == (int)EMasterEditStatus.Create && ret)
+ {
+ if (e.EnterPush)
+ {
+ sender.Error = true;
+ sender.ErrorText = "当該データが既に存在します。";
+ }
+ else
+ {
+ sender.Error = false;
+ sender.ErrorText = string.Empty;
+ }
+ //StateHasChanged();
+ return false;
+ }
+ else if(Data.EditMode == (int)EMasterEditStatus.Update && !ret)
+ {
+ if (e.EnterPush)
+ {
+ sender.Error = true;
+ sender.ErrorText = "当該データが存在しません。";
+ }
+ else
+ {
+ sender.Error = false;
+ sender.ErrorText = string.Empty;
+ }
+ //StateHasChanged();
+ return false;
+ }
+ }
+ }
+ else if (sender.Name == "MaidType")
+ {
+ sender.DispText = ((EMaidType)CConvert.ToInt(e.Text)).ToDescription<EMaidType>();
+ }
+
+ sender.Error = false;
+ sender.ErrorText = string.Empty;
+ //StateHasChanged();
+ return true;
+ }
+
+ /// <summary>
+ /// フォーカスを移動
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ /// <returns></returns>
+ private async Task<bool> BeforeAutoNextFocus(ValidField sender, ValidEventArgs e)
+ {
+ if (sender.Index == Data.Fields.Count - 1 && e.EnterPush)
+ {
+ await btnSave.FocusAsync(); //ここから非同期処理
+ return false;
+ }
+ return true;
+ }
+
+ /// <summary>
+ /// Endキー
+ /// </summary>
+ /// <param name="item"></param>
+ private async Task ShowListAction(ViewModel.ValidField item)
+ {
+ if (item.Name == "MaidType")
+ {
+ if(item.Text.Length == 0) { return; }
+ using (DataTable data = CConvert.GetEnumTypeList<EMaidType>())
+ {
+ var parameters = new DialogParameters { ["Data"] = data };
+ var dialog = DialogService.Show<SelectList>($"{item.Caption}検索", parameters);
+ var ret = await dialog.Result;
+ if (!ret.Cancelled)
+ {
+ var row = ret.Data as DataRow;
+ item.Text = row[0].ToString();
+ item.DispText = row[1].ToString();
+ StateHasChanged();
+ }
+ }
+ }
+ else if (item.Name == "ForeColor" || item.Name == "BackColor")
+ {
+ var parameters = new DialogParameters { ["Title"] = $"{item.Caption}選択", ["Data"] = item.Text };
+ var dialog = DialogService.Show<SelectColor>(string.Empty, parameters);
+ var ret = await dialog.Result;
+ if (!ret.Cancelled)
+ {
+ EnvironmentSetting.Debug(ret.Data.ToString());
+ item.Text = ret.Data.ToString();
+ StateHasChanged();
+ }
+ }
+ else
+ {
+ await DialogService.ShowMessageBox(
+ "Warning",
+ "未実装!",
+ yesText: "OK", cancelText: "Cancel");
+ }
+ }
+
+ /// <summary>
+ /// 画面閉じる
+ /// </summary>
+ private void Close()
+ {
+ MudDialog.Cancel();
+ }
+
+ /// <summary>
+ /// 保存
+ /// </summary>
+ private async void Save()
+ {
+ if (!await Data.IsValidAll())
+ {
+ //errorAll = Data.ErrText;
+ return;
+ }
+
+ //データ保存
+ using RoomStatusAccess access = new RoomStatusAccess(Channel);
+ HotelPms.Data.Master.RoomStatus item = new HotelPms.Data.Master.RoomStatus()
+ {
+ ID = CConvert.ToInt(Data.GetField("ID").Text),
+ Name = Data.GetField("Name").Text,
+ ShortName = Data.GetField("ShortName").Text,
+ EnName = Data.GetField("EnName").Text,
+ SortID = CConvert.ToInt(Data.GetField("SortID").Text),
+ ForeColor = Data.GetField("ForeColor").Text,
+ BackColor = Data.GetField("BackColor").Text,
+ MaidType = CConvert.ToInt(Data.GetField("MaidType").Text),
+ Memo = Data.GetField("Memo").Text,
+ };
+ //IMaster im = item as IMaster;
+
+ var result = Data.EditMode == (int)EMasterEditStatus.Create ? await access.AddAsync(item) : await access.UpdateAsync(item);
+ if (result.ErrNo != 0)
+ {
+ errorAll = $"更新に失敗しました。";
+ OperationLog.Instance.WriteLog($"RoomStatus.Save:{result.ErrNo}.{result.ErrData}");
+ return;
+ }
+
+
+ MudDialog.Close(DialogResult.Ok(Data));
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.Client.Blazor/Pages/Pages/RoomView/List.razor b/HotelPms.Client.Blazor/Pages/Pages/RoomView/List.razor
new file mode 100644
index 0000000..16e4c16
--- /dev/null
+++ b/HotelPms.Client.Blazor/Pages/Pages/RoomView/List.razor
@@ -0,0 +1,480 @@
+@page "/roomview/list"
+@inject GrpcChannel Channel
+@inject IJSRuntime JSRuntime
+@inject IGlobalLoadingSpinner LoadingSpinner
+@using Grpc.Net.Client.Web
+@using HotelPms.Client.Blazor.Models
+@using HotelPms.Client.Blazor.Services
+@using HotelPms.Data.Common
+@using HotelPms.Data.Common.Pagination
+@using Google.Protobuf.WellKnownTypes
+@using System.Text.Json
+@using System.Text
+@using ViewModel = HotelPms.Client.Blazor.ViewModel
+@using static HotelPms.Client.Blazor.Util.SystemEnum
+@inject IDialogService DialogService
+@inject NavigationManager NavigationManager
+@*@implements IDisposable*@
+@implements IAsyncDisposable
+
+<h3>客室状況</h3>
+<MudGrid Spacing="@spacing" Justify="Justify.FlexStart" Class="align-center mt-1 mb-1">
+ <MudItem>
+ <MudDatePicker Label="利用日" Editable="true" @bind-Date="useDate" Placeholder="利用日" />
+ </MudItem>
+ <MudItem>
+ <MudButton Variant="Variant.Filled" Style="@buttonStyle" StartIcon="@Icons.Filled.ReadMore" OnClick="ReadHotelDate">ホテル日</MudButton>
+ </MudItem>
+ <MudItem>
+ <MudButton Variant="Variant.Filled" Style="@buttonStyle" StartIcon="@Icons.Filled.ReadMore" OnClick="Read">読込</MudButton>
+ </MudItem>
+ <MudItem>
+ <MudButton Variant="Variant.Filled" Style="@buttonStyle" StartIcon="@Icons.Filled.PostAdd" OnClick="ColSetting">列設定</MudButton>
+ </MudItem>
+ <MudItem>
+ <MudButton Variant="Variant.Filled" Style="@buttonStyle" StartIcon="@Icons.Filled.Input">インポート</MudButton>
+ </MudItem>
+</MudGrid>
+<MudTabs Elevation="4" Rounded="true" Color="@Color.Success" PrevIcon="@Icons.Filled.SkipPrevious" NextIcon="@Icons.Filled.SkipNext" SliderColor="@Color.Error" ActivePanelIndexChanged="TabChanged">
+ @foreach (Data.Master.RoomViewTab tab in roomViewData.Tabs)
+ {
+ <MudTabPanel Text="@tab.Name" />
+ }
+</MudTabs>
+@if (visibled)
+{
+ <div id="scrollTable" class="pt-2" @ref="scrollDiv">
+ <div class="table">
+ <div class="table-column-group">
+ @for (var i = 0; i < roomViewData.ColCount; i++)
+ {
+ var col = i;
+ <div class="table-column" style="@($"width:{roomViewData.Data[0][col].ColWidth}px;")"></div>
+ }
+ </div>
+ <div class="table-row-group">
+ @for (var r = 0; r < roomViewData.RowCount; r++)
+ {
+ var row = r;
+ //EnvironmentSetting.Debug(row);
+
+ <ul class="table-row" style="@($"height:{roomViewData.Data[row][0].RowHeight}px;")">
+ @for (var i = 0; i < roomViewData.ColCount; i++)
+ {
+ var col = i; //大事!!!そうじゃないと、iは最後の値しかない
+ HotelPms.Data.Master.RoomViewLayout item = roomViewData.Data[row][col];
+ if (item.RoomID > 0)
+ {
+ <li @ref="cellLi" class="table-cell" style="position:relative;@roomViewData.GetCellColor(item)" @onmousedown="async(e) => await CellMouseDown(cellLi, item.RoomID, e)">
+ @* <MudBadge Color="MudBlazor.ColorSuccess" Overlap="true" Bordered="true" Style="position: absolute;left: 5px;top: 150px;">
+ <MudAvatar Image="images/avatar_jonny.jpg" />
+ </MudBadge>
+ <MudText Style="position: absolute;left: 5px;top: 5px;color: blue;">@roomViewData.Data[row][col].RoomID</MudText>*@
+ @foreach (Data.Master.RoomCell cell in roomViewData.Cells)
+ {
+ Data.Master.RoomCell roomCell = cell;
+ //EnvironmentSetting.Debug(roomCell.ToText());
+ var text = roomViewData.GetText(roomCell, item.RoomID);
+ //EnvironmentSetting.Debug(text);
+ <MudText Align="roomViewData.ToTextAlignCSS(roomCell)" Style="@roomViewData.GetRoomCellStyle(roomCell)">@text</MudText>
+ }
+ </li>
+ }
+ else
+ {
+ <li class="table-cell" style="@(item.DisplayName.Length == 0 ? "visibility:hidden;" : string.Empty)position:relative;@roomViewData.GetCellColor(item)">
+ <MudText Align="Align.Center" Style="@($"font-family:{item.FontName};font-size:{item.FontSize}pt;color:{CConvert.ToHtmlColor(item.ForeColor)};")">@item.DisplayName</MudText>
+ </li>
+ }
+ }
+ </ul>
+ }
+ </div>
+ </div>
+ </div>
+ <MudPaper id="menuPop" Class="room-memu" Width="@roomViewData.Menu.WidthCss" Style="@roomViewData.Menu.DisplayCss">
+ <MudList Clickable="true" Dense=true @bind-SelectedItem="SelectedMenuItem" @bind-SelectedValue="SelectedMenuValue">
+ <MudListSubheader Class="pa-0 ma-0">
+ <MudStack Row="true">
+ <MudIconButton Icon="@Icons.Filled.FastRewind" Color="MudBlazor.Color.Primary"></MudIconButton>
+ <MudStack Style="width: 100%" Spacing="0">
+ <MudPaper Elevation="0" Style="text-align:center;">中村 真一</MudPaper>
+ <MudPaper Elevation="0" Style="text-align:center;">1/10</MudPaper>
+ </MudStack>
+ <MudIconButton Icon="@Icons.Filled.FastForward" Color="MudBlazor.Color.Primary"></MudIconButton>
+ </MudStack>
+ </MudListSubheader>
+ @foreach (RoomViewMenu.EType item in System.Enum.GetValues(typeof(RoomViewMenu.EType)))
+ {
+ if (roomViewData.Menu.Disable[(int)item]) { continue; }
+ if (item == RoomViewMenu.EType.Out || item == RoomViewMenu.EType.Maid || item == RoomViewMenu.EType.Customer)
+ {
+ <MudDivider />
+ }
+
+ <MudListItem Text="@roomViewData.Menu.Text[(int)item]" Value="(int)item" Icon="@RoomViewMenu.IconData[(int)item]" OnClick="() => MenuClick(item)" />
+ }
+ </MudList>
+ </MudPaper>
+}
+else
+{
+ <p>読込中...</p>
+}
+
+
+<style>
+ #scrollTable {
+ background-color: #fff;
+ overflow: auto; /*必需*/
+ }
+
+ ul {
+ margin: 0;
+ padding: 0;
+ list-style: none;
+ }
+
+ .table {
+ display: table;
+ border: none;
+ border-spacing: 5px;
+ width: max-content;
+ }
+
+ .table-caption {
+ display: table-caption;
+ margin: 0;
+ padding: 0;
+ font-size: 16px;
+ }
+
+ .table-column-group {
+ display: table-column-group;
+ }
+
+ .table-column {
+ display: table-column;
+ }
+
+ .table-row-group {
+ display: table-row-group;
+ }
+
+ .table-row {
+ display: table-row;
+ height: 200px;
+ }
+
+ .table-cell {
+ display: table-cell;
+ padding: 5px;
+ border-radius: 5px;
+ border: 1px solid #018EE8;
+ background-color: #fff;
+ cursor: pointer;
+ background-size: cover;
+ list-style-type: none;
+ box-shadow: 0 3px 4px rgba(0,0,0,0.4);
+ transition: 0.1s ease-out;
+ }
+
+ .table-cell:hover {
+/* border-radius: 5px; */
+ border: 1px solid #ff0000;
+/* transition: filter .3s;
+ filter: brightness(1.3) contrast(110%);*/
+ transform: scale(1.05);
+ }
+
+ .table-header-group {
+ display: table-header-group;
+ background: #eee;
+ font-weight: bold;
+ }
+
+ .table-footer-group {
+ display: table-footer-group;
+ }
+
+ .room-memu {
+ position: absolute;
+ }
+
+ /* 样式二 */
+ /*---滚动条默认显示样式--*/
+/* ::-webkit-scrollbar-thumb {
+ background-color: #696969;
+ height: 50px;
+ outline-offset: -2px;
+ outline: 2px solid #fff;
+ border-radius: 4px;
+ border: 2px solid #fff;
+ cursor: default;
+ }*/
+ /*---鼠标点击滚动条显示样式--*/
+/* ::-webkit-scrollbar-thumb:hover {
+ background-color: #3060FA;
+ height: 50px;
+ border-radius: 4px;
+ cursor: pointer;
+ }*/
+ /*---滚动条大小--*/
+/* ::-webkit-scrollbar {
+ width: 15px;
+ height: 15px;
+ }*/
+ /*---滚动框背景样式--*/
+/* ::-webkit-scrollbar-track-piece {
+ background-color: #fff;
+ border-radius: 0;
+ }*/
+
+/* ::-webkit-scrollbar-thumb:active {
+ height: 50px;
+ background-color: #000;
+ border-radius: 4px;
+ }*/
+</style>
+
+@code {
+ DateTime? useDate;
+ private int spacing { get; set; } = 3;
+ private string buttonStyle = $"color:{Colors.Shades.White};background-color:{Colors.Green.Darken2};width: 150px; height: 40px;";
+ private RoomViewData roomViewData = new RoomViewData();
+ private bool visibled = false;
+ private ElementReference scrollDiv;
+ private ElementReference cellLi;
+ private int InnerHeight = 0;
+ private int InnerWidth = 0;
+
+ private MudListItem SelectedMenuItem { get; set; }
+ private object SelectedMenuValue { get; set; } = 0;
+
+ private DateTime GetUseDate() => useDate ?? DateTime.Today;
+ private bool renderUI = true;
+ private IJSObjectReference? module;
+
+ protected override async Task OnInitializedAsync()
+ {
+ await LoadingSpinner.ShowAsync();
+ // 下記一気で全部取得する
+ //useDate = await EnvironmentSetting.GetHotelDate(); // ⇒ShouldRender:1
+ //await roomViewData.InitTabs(); // ⇒ShouldRender:2
+ //await roomViewData.GetRoomCell(); // ⇒ShouldRender:3
+ //await roomViewData.GetData(GetUseDate()); // ⇒ShouldRender:4
+ await roomViewData.Init(); // ⇒ShouldRender:1
+ useDate = roomViewData.UseDate; // ⇒ShouldRender:2
+
+ EnvironmentSetting.Debug($"【{DateTime.Now.ToString("HH:mm:ss fff")}】Resized開始");
+ BrowserResizeService.OnResize += BrowserHasResized;
+
+ //DotNet.invokeMethodAsync('{ASSEMBLY NAME}', '{.NET METHOD ID}', {ARGUMENTS});
+ //await JSRuntime.InvokeAsync<object>("browserResize.registerResizeCallback");
+
+
+ //InnerHeight = await BrowserResizeService.GetInnerHeight(JSRuntime);
+ //InnerWidth = await BrowserResizeService.GetInnerWidth(JSRuntime);
+ EnvironmentSetting.Debug($"【{DateTime.Now.ToString("HH:mm:ss fff")}】Resized終了");
+ visibled = true;
+ await LoadingSpinner.HideAsync();
+ }
+
+ protected override bool ShouldRender()
+ {
+ EnvironmentSetting.Debug($"【{DateTime.Now.ToString("HH:mm:ss fff")}】ShouldRender開始:{renderUI}");
+ if(renderUI)
+ {
+ renderUI = false; //重複ShouldRenderを回避する
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ protected override async Task OnAfterRenderAsync(bool firstRender)
+ {
+ EnvironmentSetting.Debug($"【{DateTime.Now.ToString("HH:mm:ss fff")}】OnAfterRenderAsync開始:{firstRender}");
+ renderUI = true;
+ if(firstRender)
+ {
+ module = await JSRuntime.InvokeAsync<IJSObjectReference>("import", "./js/browser-resize.js");
+ await module.InvokeAsync<object>("registerResizeCallback");
+
+ InnerHeight = await module.InvokeAsync<int>("getInnerHeight");
+ InnerWidth = await module.InvokeAsync<int>("getInnerWidth");
+ }
+ //return base.OnAfterRenderAsync(firstRender);
+ }
+
+ //public void Dispose()
+ //{
+ // BrowserResizeService.OnResize -= BrowserHasResized;
+ //}
+
+ async ValueTask IAsyncDisposable.DisposeAsync()
+ {
+ if (module is not null)
+ {
+ BrowserResizeService.OnResize -= BrowserHasResized;
+ await module.InvokeAsync<object>("removeResizeCallback");
+ await module.DisposeAsync();
+ }
+ }
+
+ private async Task BrowserHasResized()
+ {
+ EnvironmentSetting.Debug($"【{DateTime.Now.ToString("HH:mm:ss fff")}】BrowserHasResized開始");
+ //InnerHeight = await BrowserResizeService.GetInnerHeight(JSRuntime);
+ //InnerWidth = await BrowserResizeService.GetInnerWidth(JSRuntime);
+ InnerHeight = await module.InvokeAsync<int>("getInnerHeight");
+ InnerWidth = await module.InvokeAsync<int>("getInnerWidth");
+ EnvironmentSetting.Debug($"【{DateTime.Now.ToString("HH:mm:ss fff")}】BrowserHasResized終了");
+
+ StateHasChanged();
+ }
+
+ private async Task CellMouseDown(ElementReference sender, int roomID, MouseEventArgs e)
+ {
+ if(e.Button != 0) { return; } //0.左 1.中 2.右
+ EnvironmentSetting.Debug("CellMouseDown Start:" + DateTime.Now.ToString("HH:mm:ss fff"));
+ renderUI = false; //↓画面再表示しないように
+ await roomViewData.Menu.Show(Channel, GetUseDate(), roomID); //ここの画面再表示しないように
+
+ double x = e.ClientX, y = e.ClientY;
+ if (e.ClientX + roomViewData.Menu.Width > InnerWidth)
+ {
+ x = InnerWidth - roomViewData.Menu.Width;
+ }
+ if (e.ClientY + roomViewData.Menu.Height > InnerHeight)
+ {
+ y = InnerHeight - roomViewData.Menu.Height;
+ }
+ x += (e.PageX - e.ClientX);
+ y += (e.PageY - e.ClientY); //scroll
+
+ var a = (await RoomStatusSetting.Instance()).Vacancy;
+
+#if false
+ //↓0.8秒かかる
+ //var browser = await JSRuntime.GetWindowSize(); //非表示の時にall 0
+ //EnvironmentSetting.Debug(DateTime.Now.ToString("HH:mm:ss fff"));
+
+ //double x = e.ClientX, y = e.ClientY;
+ //if (e.ClientX + menuWidth > browser.Width)
+ //{
+ // x = browser.Width - menuWidth;
+ //}
+ //if (e.ClientY + menuHeight > browser.Height)
+ //{
+ // y = browser.Height - menuHeight;
+ //}
+ //y += (e.PageY - e.ClientY); //scroll
+#endif
+
+ renderUI = true;
+ roomViewData.Menu.DisplayCss = $"display:block; left: {x}px; top: {y}px";
+ EnvironmentSetting.Debug($"MouseEventArgs:OffsetX={e.OffsetX},OffsetY={e.OffsetY},ClientX={e.ClientX},ClientY={e.ClientY},PageX={e.PageX},PageY={e.PageY},ScreenX={e.ScreenX},ScreenY={e.ScreenY}");
+
+#if false
+ //EnvironmentSetting.Debug($"WindowWidth={browser.Width},WindowHeight={browser.Height}");
+ //EnvironmentSetting.Debug($"cellRect:AbsoluteLeft={cellRect.AbsoluteLeft},AbsoluteTop={cellRect.AbsoluteTop},WindowWidth={cellRect.WindowWidth},WindowHeight={cellRect.WindowHeight}");
+ //EnvironmentSetting.Debug($"ownerRect:AbsoluteLeft={ownerRect.AbsoluteLeft},AbsoluteTop={ownerRect.AbsoluteTop},ScrollX={ownerRect.ScrollX},ScrollY={ownerRect.ScrollY},WindowWidth={ownerRect.WindowWidth},WindowHeight={ownerRect.WindowHeight}");
+ //EnvironmentSetting.Debug($"menuRect:{menuRect.X},{menuRect.Y},{menuRect.Width},{menuRect.Height}");
+ //EnvironmentSetting.Debug(menudisplay);
+ //StateHasChanged(); //0.7秒かかる
+#endif
+
+ EnvironmentSetting.Debug("CellMouseDown End:" + DateTime.Now.ToString("HH: mm:ss fff"));
+ }
+
+ private async void MenuClick(RoomViewMenu.EType index)
+ {
+ EnvironmentSetting.Debug($"MenuClick:{index}");
+ roomViewData.Menu.DisplayCss = "display: none;";
+
+ if (index == RoomViewMenu.EType.Maid)
+ {
+ var ret = await roomViewData.Menu.SetRoomStatus(false);
+ }
+ else if (index == RoomViewMenu.EType.Finish)
+ {
+ var ret = await roomViewData.Menu.SetRoomStatus(true);
+ }
+ else if (index == RoomViewMenu.EType.Resv)
+ {
+ // new Guid キー
+ //Guid key = Guid.NewGuid();
+ //CacheStorage.Instance.Set(key.ToString(), "Dataだよ"); //簡単&乱暴
+ //if (module is not null)
+ //{
+ // BrowserResizeService.OnResize -= BrowserHasResized;
+ // await module.InvokeAsync<object>("removeResizeCallback");
+ // await module.DisposeAsync();
+ // module = null;
+ //}
+ NavigationManager.NavigateTo($"usedetail/input", new NavigationOptions
+ {
+ ForceLoad = false,
+ ReplaceHistoryEntry = false,
+ HistoryEntryState = new Parameter.UseInputArgs { Guid = Guid.NewGuid().ToString(), CinDate = CConvert.ToDateString(useDate) }.ToJson(),
+ });
+ return;
+ }
+
+ await ShowTab();
+ StateHasChanged();
+ }
+
+ private void ColSetting()
+ {
+ roomViewData.Tabs.RemoveAt(0);
+ StateHasChanged();
+ }
+
+ private async Task ShowTab(int index = -1)
+ {
+ await LoadingSpinner.ShowAsync();
+ visibled = false;
+ if (index >= 0) { roomViewData.ActiveTabIndex = index; }
+ EnvironmentSetting.Debug($"ActiveTabIndex = {roomViewData.ActiveTabIndex}");
+ await roomViewData.GetData(GetUseDate(), index >= 0);
+ visibled = true;
+ await LoadingSpinner.HideAsync();
+ }
+
+ private async Task ReadHotelDate()
+ {
+ useDate = await EnvironmentSetting.GetHotelDate();
+ await ShowTab();
+ }
+
+ private async Task Read()
+ {
+ // GrpcChannelOptions options = new GrpcChannelOptions()
+ // {
+ // MaxReceiveMessageSize = int.MaxValue,
+ // HttpHandler = new GrpcWebHandler(new HttpClientHandler())
+ // };
+ // using (var Channel = GrpcChannel.ForAddress("https://ginbow.eu.org", options))
+ // {
+ // HelloRequest request = new HelloRequest();
+ // request.Name = "aaa";
+ // var client = new Greeter.GreeterClient(Channel);
+ // EnvironmentSetting.Debug($"開始");
+ // HelloReply reply = await client.SayHelloAsync(request);
+ // EnvironmentSetting.Debug($"Response: {reply.ToString()}");
+ // //Console.WriteLine($"Response: {reply.ToString()}");
+ // }
+
+
+ await ShowTab();
+ }
+
+ private async Task TabChanged(int index)
+ {
+ await ShowTab(index);
+ }
+}
diff --git a/HotelPms.Client.Blazor/Pages/Pages/Utility/Faq.razor b/HotelPms.Client.Blazor/Pages/Pages/Utility/Faq.razor
new file mode 100644
index 0000000..369368a
--- /dev/null
+++ b/HotelPms.Client.Blazor/Pages/Pages/Utility/Faq.razor
@@ -0,0 +1,65 @@
+@page "/pages/utility/faq"
+
+<MudText Typo="Typo.h5" Color="MudBlazor.Color.Primary" Class="mb-4">FAQ</MudText>
+<MudGrid>
+ <MudItem xs="12" sm="12" md="10">
+ <MudPaper Class="px-4 pb-3 mb-8">
+ <MudTextField T="string" Placeholder="Search" DisableUnderLine="true" Adornment="Adornment.End" AdornmentIcon="@Icons.Filled.Search"></MudTextField>
+ </MudPaper>
+ </MudItem>
+ <MudItem xs="12" sm="12" md="2"></MudItem>
+ <MudItem xs="12" sm="12" md="10">
+ <MudText Typo="Typo.h6" GutterBottom="true">General</MudText>
+ <MudExpansionPanels >
+ <MudExpansionPanel Text="How do i install MudBlazor?">
+ <MudText Typo="Typo.body2">Please check the installation instructions <MudLink Href="https://mudblazor.com/getting-started/installation">here</MudLink></MudText>
+ </MudExpansionPanel>
+ <MudExpansionPanel Text="Whats the purpose of this template">
+ <MudText Typo="Typo.body2">Mostly for demonstration purposes but can be stripped and used for any project, in any way.</MudText>
+ </MudExpansionPanel>
+ <MudExpansionPanel Text="How can i get help regarding MudBlazor?">
+ <MudText Typo="Typo.body2">You can find links to our community chats on our main <MudLink Href="https://mudblazor.com/">website</MudLink></MudText>
+ </MudExpansionPanel>
+ <MudExpansionPanel Text="I have a question or a problem regarding this template">
+ <MudText Typo="Typo.body2">While we dont offer any real support, you can always try to ask for help in one of our community groups.</MudText>
+ </MudExpansionPanel>
+ <MudExpansionPanel Text="You guys are awesome, how can i support you?">
+ <MudText Typo="Typo.body2">Helping out others who have questions regarding Mudblazor in our Discord or Gitter chat is highly appreciated! Adding and fixing issues, working on new features that we have planned or you can donate over at <MudLink Href="https://opencollective.com/mudblazor">our Open Collective page.</MudLink></MudText>
+ </MudExpansionPanel>
+ </MudExpansionPanels>
+
+ <MudText Typo="Typo.h6" GutterBottom="true" Class="mt-8">Licensing</MudText>
+ <MudExpansionPanels >
+ <MudExpansionPanel Text="Unlimited">
+ <MudText Typo="Typo.body2">Do what you want, its MIT.</MudText>
+ </MudExpansionPanel>
+ <MudExpansionPanel Text="Commercial">
+ <MudText Typo="Typo.body2">Duuude, i said MIT!</MudText>
+ </MudExpansionPanel>
+ <MudExpansionPanel Text="Personal">
+ <MudText Typo="Typo.body2">M.I.T</MudText>
+ </MudExpansionPanel>
+ </MudExpansionPanels>
+
+ <MudText Typo="Typo.h6" GutterBottom="true" Class="mt-8">Refund Policy</MudText>
+ <MudExpansionPanels >
+ <MudExpansionPanel Text="Can i refund MudBlazor?">
+ <MudText Typo="Typo.body2">No you cant, since its a open source, MIT project and is free to use.</MudText>
+ </MudExpansionPanel>
+ <MudExpansionPanel Text="What if i still want a refund?">
+ <MudText Typo="Typo.body2">Well you'r out of luck here.</MudText>
+ </MudExpansionPanel>
+ </MudExpansionPanels>
+ </MudItem>
+ <MudItem xs="12" sm="12" md="2">
+ <MudText Typo="Typo.h6" GutterBottom="true">Categorys</MudText>
+ <MudButton Variant="Variant.Text" Color="MudBlazor.Color.Secondary" Class="d-flex">General</MudButton>
+ <MudButton Variant="Variant.Text" Color="MudBlazor.Color.Secondary" Class="d-flex">Licenses</MudButton>
+ <MudButton Variant="Variant.Text" Color="MudBlazor.Color.Secondary" Class="d-flex">Refund Policy</MudButton>
+ </MudItem>
+</MudGrid>
+
+@code
+{
+
+}
diff --git a/HotelPms.Client.Blazor/Pages/Pages/Utility/WasmLoading.razor b/HotelPms.Client.Blazor/Pages/Pages/Utility/WasmLoading.razor
new file mode 100644
index 0000000..90483d4
--- /dev/null
+++ b/HotelPms.Client.Blazor/Pages/Pages/Utility/WasmLoading.razor
@@ -0,0 +1,30 @@
+@inherits LayoutComponentBase
+
+@page "/pages/utility/wasm-loading"
+
+<style>
+ @keyframes slide {0% {transform: translateX(-25%);}100% {transform: translateX(25%);}}
+ .mud-wasm{animation:slide 3s ease-in-out infinite alternate;background-image:linear-gradient(-60deg,#594ae2 50%,#7467ef 50%);bottom:0;left:-50%;opacity:.5;position:fixed;right:-50%;top:0;z-index:-1}.mud-wasm-cont{left:50%;padding:10vmin;position:fixed;text-align:center;top:50%;transform:translate(-50%,-50%)}
+</style>
+<div style="height:100%;width:100%;margin:0;position:fixed;">
+ <div class="mud-wasm"></div>
+ <div class="mud-wasm" style="animation-direction:alternate-reverse;animation-duration:4s;"></div>
+ <div class="mud-wasm" style="animation-duration:5s;"></div>
+ <div class="mud-wasm-cont ">
+ <svg width="100%" height="100%" viewBox="0 0 1653 1049" xmlns="http://www.w3.org/2000/svg">
+ <path fill="#7467EF" d="M0.15,572.58V0.16L495.9,286.37v190.81L165.4,286.37v381.62L0.15,572.58z"></path>
+ <path fill="#594AE2" d="M495.9,286.37L991.65,0.16v572.43l-330.5,190.81l-165.25-95.4l330.5-190.81V286.37L495.9,477.18V286.37z"></path>
+ <path fill="#7467EF" d="M495.9,667.99V858.8l330.5,190.81V858.8L495.9,667.99z"></path>
+ <path fill="#594AE2" d="M826.4,1049.6l495.75-286.21V0.37l-165.25,95.4v572.21L826.4,858.8V1049.6z"></path>
+ <path fill="#7467ef" d="M1495,467.85l-165.25,95.41,157.47,91.52,165.25-95.38Z"></path>
+ <path fill="#7467EF" d="M1322.15,763.39l-165.25,95.4l330.5,190.81V858.8L1322.15,763.39z"></path>
+ <path fill="#7467EF" d="M1322.13,0.38l-165.25,95.4l330.29,190.83l165.25-95.38L1322.13,0.38z"></path>
+ <path fill="#594AE2" d="M1652.43,191.21l-165.25,95.41v762.99l165.25-95.4L1652.43,191.21z"></path>
+ </svg>
+ </div>
+</div>
+
+@code
+{
+
+}
diff --git a/HotelPms.Client.Blazor/Pages/Parameter/UseInputArgs.cs b/HotelPms.Client.Blazor/Pages/Parameter/UseInputArgs.cs
new file mode 100644
index 0000000..46ceaa0
--- /dev/null
+++ b/HotelPms.Client.Blazor/Pages/Parameter/UseInputArgs.cs
@@ -0,0 +1,44 @@
+using HotelPms.Share.Util;
+using System.Text.Json.Serialization;
+
+namespace HotelPms.Client.Blazor.Pages.Parameter
+{
+ /// <summary>
+ /// Input.razorのパラメータ
+ /// </summary>
+ public class UseInputArgs
+ {
+ /// <summary>
+ /// 画面の識別ID
+ /// </summary>
+ public string Guid { get; set; } = string.Empty;
+
+ /// <summary>
+ /// 利用ID
+ /// </summary>
+ public int ID { get; set; } = 0;
+
+ /// <summary>
+ /// チェックイン日
+ /// </summary>
+ public string CinDate { get; set; } = string.Empty;
+
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public List<int>? RoomIDList { get; set; }
+
+ public string ToJson()
+ {
+ return CConvert.ToJsonText(this);
+ }
+
+ /// <summary>
+ /// Jsonから
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public static UseInputArgs FromJson(string data)
+ {
+ return CConvert.ToInstanceFromJson<UseInputArgs>(data);
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/Pages/Personal/Account.razor b/HotelPms.Client.Blazor/Pages/Personal/Account.razor
new file mode 100644
index 0000000..d7eaa20
--- /dev/null
+++ b/HotelPms.Client.Blazor/Pages/Personal/Account.razor
@@ -0,0 +1,216 @@
+@page "/personal/account"
+
+@inject ISnackbar Snackbar
+@using System.Text.RegularExpressions
+@using System.ComponentModel.DataAnnotations
+
+<MudText Typo="Typo.h5" Color="MudBlazor.Color.Primary" Class="mb-4">Account</MudText>
+<MudTabs Elevation="1" Rounded="true" PanelClass="mt-6">
+ <MudTabPanel Text="General">
+ <MudGrid>
+ <MudItem xs="12" sm="4" md="3">
+ <MudCard >
+ <MudCardHeader>
+ <CardHeaderContent>
+ <MudText>Public Profile</MudText>
+ </CardHeaderContent>
+ </MudCardHeader>
+ <MudCardContent>
+ <div class="d-flex justify-center mb-4">
+ <MudAvatar Image="@AvatarImageLink" Style="height:100px; width:100px;">
+ @if(AvatarImageLink == null)
+ {
+ <MudIcon Icon="@AvatarIcon" Size="Size.Large"></MudIcon>
+ }
+ </MudAvatar>
+
+ </div>
+ <MudText Align="Align.Center">@FirstName @LastName</MudText>
+ <MudText Align="Align.Center">@JobTitle</MudText>
+ </MudCardContent>
+ <MudCardActions Class="d-flex justify-center">
+ <MudButton OnClick="DeletePicture" Color="@AvatarButtonColor">@AvatarButtonText</MudButton>
+ </MudCardActions>
+ </MudCard>
+ </MudItem>
+ <MudItem xs="12" sm="8" md="9">
+ <MudCard >
+ <MudCardHeader>
+ <CardHeaderContent>
+ <MudText>Profile Details</MudText>
+ </CardHeaderContent>
+ </MudCardHeader>
+ <MudCardContent>
+ <MudGrid>
+ <MudItem xs="12" md="6">
+ <MudTextField @bind-Value="FirstName" Label="First Name" Variant="Variant.Outlined" />
+ </MudItem>
+ <MudItem xs="12" md="6">
+ <MudTextField @bind-Value="LastName" Label="First Name" Variant="Variant.Outlined" />
+ </MudItem>
+ <MudItem xs="12" md="6">
+ <MudTextField @bind-Value="JobTitle" Label="Job Title" Variant="Variant.Outlined" />
+ </MudItem>
+ <MudItem xs="12" md="6">
+ <MudTextField @bind-Value="Email" Label="Email" Variant="Variant.Outlined" HelperText="Dont worry, we shall not spam!" InputType="InputType.Email" />
+ </MudItem>
+ <MudItem xs="12">
+ <MudText>
+ <b>Visible Only To Friends</b>
+ </MudText>
+ <MudText Typo="Typo.body2">
+ Means that only your friends will be able to see your contact details.
+ </MudText>
+ <MudSwitch @bind-Checked="@FriendSwitch" Color="MudBlazor.Color.Secondary" />
+ </MudItem>
+ </MudGrid>
+ </MudCardContent>
+ <MudCardActions Class="pb-4 pl-4">
+ <MudButton Variant="Variant.Filled" Color="MudBlazor.Color.Primary" Class="ml-auto" @onclick="@(() => SaveChanges("Profile details saved", Severity.Success))">Save Changes</MudButton>
+ </MudCardActions>
+ </MudCard>
+ </MudItem>
+ </MudGrid>
+ </MudTabPanel>
+ <MudTabPanel Text="Notifications">
+ <MudCard>
+ <MudCardHeader>
+ <CardHeaderContent>
+ <MudText>Notifications</MudText>
+ </CardHeaderContent>
+ </MudCardHeader>
+ <MudCardContent>
+ <MudGrid>
+ <MudItem xs="12" sm="4">
+ <MudText>
+ <b>Email</b>
+ </MudText>
+ <MudText Typo="Typo.body2">
+ What type of system notifications you want to recieve to your email.
+ </MudText>
+ <div class="d-flex flex-column mt-6">
+ <MudCheckBox @bind-Checked="@NotificationEmail_1" Label="Threat Detection" Color="MudBlazor.Color.Primary"></MudCheckBox>
+ <MudCheckBox @bind-Checked="@NotificationEmail_2" Label="Server Errors" Color="MudBlazor.Color.Error"></MudCheckBox>
+ <MudCheckBox @bind-Checked="@NotificationEmail_3" Label="Server Warnings" Color="MudBlazor.Color.Warning"></MudCheckBox>
+ <MudCheckBox @bind-Checked="@NotificationEmail_4" Label="Spam" Color="MudBlazor.Color.Success"></MudCheckBox>
+ </div>
+ </MudItem>
+ <MudItem xs="12" sm="8">
+ <MudText>
+ <b>Chat</b>
+ </MudText>
+ <MudText Typo="Typo.body2">
+ What type of system notifications you want to recieve in the phone application.
+ </MudText>
+ <div class="d-flex flex-column mt-6">
+ <MudCheckBox @bind-Checked="@NotificationChat_1" Label="Threat Detection" Color="MudBlazor.Color.Primary"></MudCheckBox>
+ <MudCheckBox @bind-Checked="@NotificationChat_2" Label="Server Errors" Color="MudBlazor.Color.Error"></MudCheckBox>
+ <MudCheckBox @bind-Checked="@NotificationChat_3" Label="Server Warnings" Color="MudBlazor.Color.Warning"></MudCheckBox>
+ <MudCheckBox @bind-Checked="@NotificationChat_4" Label="Spam" Color="MudBlazor.Color.Success"></MudCheckBox>
+ </div>
+ </MudItem>
+ </MudGrid>
+ </MudCardContent>
+ <MudCardActions Class="pb-4 pl-4">
+ <MudButton Variant="Variant.Filled" Color="MudBlazor.Color.Primary" Class="ml-auto" @onclick="@(() => SaveChanges("Notification settings saved", Severity.Success))">Save Changes</MudButton>
+ </MudCardActions>
+ </MudCard>
+ </MudTabPanel>
+ <MudTabPanel Text="Security">
+ <MudForm @ref="form">
+ <MudCard>
+ <MudCardHeader>
+ <CardHeaderContent>
+ <MudText>Change Password</MudText>
+ </CardHeaderContent>
+ </MudCardHeader>
+ <MudCardContent>
+ <MudGrid>
+ <MudItem xs="12" md="6">
+ <MudTextField T="string" Label="Password" Variant="Variant.Outlined" InputType="InputType.Password" @ref="pwField1" Validation="@(new Func<string, IEnumerable<string>>(PasswordStrength))" Required="true" RequiredError="Password is required!" />
+ </MudItem>
+ <MudItem xs="12" md="6">
+ <MudTextField T="string" Label="Password Confirmation" Variant="Variant.Outlined" InputType="InputType.Password" Validation="@(new Func<string, string>(PasswordMatch))" />
+ </MudItem>
+ <MudItem xs="12">
+ <MudTextField T="string" Label="Current Password" Variant="Variant.Outlined" InputType="InputType.Password" />
+ </MudItem>
+ </MudGrid>
+ </MudCardContent>
+ <MudCardActions Class="pb-4 pl-4">
+ <MudButton Variant="Variant.Filled" Color="MudBlazor.Color.Primary" Class="ml-auto" @onclick="@(() => SaveChanges("Current Password is incorrect", Severity.Error))">Change Password</MudButton>
+ </MudCardActions>
+ </MudCard>
+ </MudForm>
+ </MudTabPanel>
+</MudTabs>
+
+@code {
+ public string AvatarImageLink { get; set; } = "images/FrontGateWay.jpg";
+ public string AvatarIcon { get; set; }
+ public string AvatarButtonText { get; set; } = "Delete Picture";
+ public Color AvatarButtonColor { get; set; } = Color.Error;
+ public string FirstName { get; set; } = "FrontGateWay";
+ public string LastName { get; set; } = "";
+ public string JobTitle { get; set; } = "NavcⅡ";
+ public string Email { get; set; } = "Youcanprobably@findout.com";
+ public bool FriendSwitch { get; set; } = true;
+ public bool NotificationEmail_1 { get; set; } = true;
+ public bool NotificationEmail_2 { get; set; }
+ public bool NotificationEmail_3 { get; set; }
+ public bool NotificationEmail_4 { get; set; } = true;
+ public bool NotificationChat_1 { get; set; }
+ public bool NotificationChat_2 { get; set; } = true;
+ public bool NotificationChat_3 { get; set; } = true;
+ public bool NotificationChat_4 { get; set; }
+
+ void DeletePicture()
+ {
+ if(!String.IsNullOrEmpty(AvatarImageLink))
+ {
+ AvatarImageLink = null;
+ AvatarIcon = Icons.Material.Outlined.SentimentVeryDissatisfied;
+ AvatarButtonText = "Upload Picture";
+ AvatarButtonColor = Color.Primary;
+ }
+ else
+ {
+ return;
+ }
+ }
+
+ void SaveChanges(string message, Severity severity)
+ {
+ Snackbar.Add(message, severity, config =>
+ {
+ config.ShowCloseIcon = false;
+ });
+ }
+
+ MudForm form;
+ MudTextField<string> pwField1;
+
+ private IEnumerable<string> PasswordStrength(string pw)
+ {
+ if (string.IsNullOrWhiteSpace(pw))
+ {
+ yield return "Password is required!";
+ yield break;
+ }
+ if (pw.Length < 8)
+ yield return "Password must be at least of length 8";
+ if (!Regex.IsMatch(pw, @"[A-Z]"))
+ yield return "Password must contain at least one capital letter";
+ if (!Regex.IsMatch(pw, @"[a-z]"))
+ yield return "Password must contain at least one lowercase letter";
+ if (!Regex.IsMatch(pw, @"[0-9]"))
+ yield return "Password must contain at least one digit";
+ }
+
+ private string PasswordMatch(string arg)
+ {
+ if (pwField1.Value != arg)
+ return "Passwords don't match";
+ return null;
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.Client.Blazor/Pages/Personal/Dashboard.razor b/HotelPms.Client.Blazor/Pages/Personal/Dashboard.razor
new file mode 100644
index 0000000..df071bd
--- /dev/null
+++ b/HotelPms.Client.Blazor/Pages/Personal/Dashboard.razor
@@ -0,0 +1,173 @@
+@page "/personal/dashboard"
+@using System.ComponentModel;
+@using BootstrapBlazor.Components
+@using HotelPms.Client.Blazor.Pages.UseDetail
+
+<div class="dh">全局のCSSスタイル</div>
+<Component1></Component1>
+<Component2></Component2>
+<PdfReader FileName=@Filename Height="500px" />
+<MudText Typo="Typo.h5" Color="MudBlazor.Color.Primary" Class="mb-4">Dashboard</MudText>
+<MudGrid>
+ <MudItem xs="12" sm="6" md="3">
+ <MudPaper Class="d-flex flex-row pt-6 pb-4" Style="height:100px;">
+ <MudIcon Icon="@Icons.Material.Filled.Euro" Color="MudBlazor.Color.Primary" Class="mx-4" Style="width:54px; height:54px;"></MudIcon>
+ <div>
+ <MudText Typo="Typo.subtitle1" Class="mud-text-secondary mb-n1">Total Cost</MudText>
+ <MudText Typo="Typo.h5">3,125,000</MudText>
+ </div>
+ </MudPaper>
+ </MudItem>
+ <MudItem xs="12" sm="6" md="3">
+ <MudPaper Class="d-flex flex-row pt-6 pb-4" Style="height:100px;">
+ <MudIcon Icon="@Icons.Material.Filled.Layers" Color="MudBlazor.Color.Secondary" Class="mx-4" Style="width:54px; height:54px;"></MudIcon>
+ <div>
+ <MudText Typo="Typo.subtitle1" Class="mud-text-secondary mb-n1">Graphite on roof</MudText>
+ <MudText Typo="Typo.h5">150,000</MudText>
+ </div>
+ </MudPaper>
+ </MudItem>
+ <MudItem xs="12" sm="6" md="3">
+ <MudPaper Class="d-flex flex-row pt-6 pb-4" Style="height:100px;">
+ <MudIcon Icon="@Icons.Material.Filled.Public" Color="MudBlazor.Color.Success" Class="mx-4" Style="width:54px; height:54px;"></MudIcon>
+ <div>
+ <MudText Typo="Typo.subtitle1" Class="mud-text-secondary mb-n1">Global Spread</MudText>
+ <MudText Typo="Typo.h5">12%</MudText>
+ </div>
+ </MudPaper>
+ </MudItem>
+ <MudItem xs="12" sm="6" md="3">
+ <MudPaper Class="d-flex flex-row pt-6 pb-4" Style="height:100px;">
+ <MudIcon Icon="@Icons.Custom.Uncategorized.Radioactive" Color="MudBlazor.Color.Warning" Class="mx-4" Style="width:54px; height:54px;"></MudIcon>
+ <div>
+ <MudText Typo="Typo.subtitle1" Class="mud-text-secondary mb-n1">Roentgen</MudText>
+ <MudText Typo="Typo.h5">3,6</MudText>
+ </div>
+ </MudPaper>
+ </MudItem>
+ <MudItem xs="12" sm="8">
+ <MudPaper Class="pa-4" Style="height:300px;">
+ Charts comming soon ish...
+ </MudPaper>
+ </MudItem>
+ <MudItem xs="12" sm="4">
+ <MudPaper Class="pa-4" Style="height:300px;">
+ Charts comming soon ish...
+ </MudPaper>
+ </MudItem>
+ <MudItem xs="12" sm="12" md="6">
+ <MudCard Style="height:100%;">
+ <MudCardHeader>
+ <CardHeaderContent>
+ <MudText Typo="Typo.h6">Earning Report</MudText>
+ </CardHeaderContent>
+ </MudCardHeader>
+ <MudCardContent Class="px-0">
+ <MudSimpleTable Elevation="0" Hover="true">
+ <thead>
+ <tr>
+ <th>Name</th>
+ <th>Priority</th>
+ <th>Earnings</th>
+ </tr>
+ </thead>
+ <tbody>
+ @foreach (var report in earningReports.OrderBy(x=>x.Name))
+ {
+ <tr>
+ <td>
+ <div class="d-flex flex-row">
+ <MudAvatar Image="@report.Avatar" Class="mud-elevation-25" />
+ <div class="ml-6">
+ <MudText Typo="Typo.subtitle2">@report.Name</MudText>
+ <MudText Typo="Typo.body2">@report.Title</MudText>
+ </div>
+ </div>
+ </td>
+ <td><MudChip Label="true" Color="@report.Severity" Size="MudBlazor.Size.Small" Class="ml-auto mud-elevation-25">@report.SeverityTitle</MudChip></td>
+ <td><MudText>@report.Salary</MudText></td>
+ </tr>
+ }
+ </tbody>
+ </MudSimpleTable>
+ </MudCardContent>
+ </MudCard>
+ </MudItem>
+ <MudItem xs="12" sm="12" md="6">
+ <MudCard Style="height:100%;">
+ <MudCardHeader>
+ <CardHeaderContent>
+ <MudText Typo="Typo.h6">Recent incidents</MudText>
+ </CardHeaderContent>
+ </MudCardHeader>
+ <MudCardContent Class="px-0">
+ <MudList Clickable="true">
+ <MudListItem>
+ <div class="d-flex flex-row">
+ <MudAvatar Class="mud-elevation-25">
+ <MudIcon Icon="@Icons.Custom.Brands.GitHub" Class="mx-4" />
+ </MudAvatar>
+ <div class="ml-6">
+ <MudText Typo="Typo.subtitle2">Issues rising</MudText>
+ <MudText Typo="Typo.body2">Issues is almost reaching 100</MudText>
+ </div>
+ <MudChip Label="true" Color="MudBlazor.Color.Error" Size="MudBlazor.Size.Small" Class="ml-auto mud-elevation-25">Danger</MudChip>
+ </div>
+ </MudListItem>
+ <MudListItem>
+ <div class="d-flex flex-row">
+ <MudAvatar Class="mud-elevation-25">
+ <MudIcon Icon="@Icons.Custom.Uncategorized.Radioactive" Class="mx-4" />
+ </MudAvatar>
+ <div class="ml-6">
+ <MudText Typo="Typo.subtitle2">Incident in plant number 4</MudText>
+ <MudText Typo="Typo.body2">Fire in reactor core</MudText>
+ </div>
+ <MudChip Label="true" Color="MudBlazor.Color.Info" Size="MudBlazor.Size.Small" Class="ml-auto mud-elevation-25">Minor</MudChip>
+ </div>
+ </MudListItem>
+ <MudListItem>
+ <div class="d-flex flex-row">
+ <MudAvatar Class="mud-elevation-25">
+ <MudIcon Icon="@Icons.Material.Filled.Person" Class="mx-4" />
+ </MudAvatar>
+ <div class="ml-6">
+ <MudText Typo="Typo.subtitle2">Occupational injury</MudText>
+ <MudText Typo="Typo.body2">Employee broke a finger while writing some code</MudText>
+ </div>
+ <MudChip Label="true" Color="MudBlazor.Color.Success" Size="MudBlazor.Size.Small" Class="ml-auto mud-elevation-25">Dismissed</MudChip>
+ </div>
+ </MudListItem>
+ </MudList>
+ </MudCardContent>
+ </MudCard>
+ </MudItem>
+</MudGrid>
+<style>
+ .dh {
+ color: green;
+ font-family: Tahoma, Geneva, Verdana, sans-serif;
+ }
+</style>
+
+@code {
+ [DisplayName("the file in the wwwroot relative path or url")]
+ private string Filename { get; set; } = "/sample-data/2.pdf";
+
+ EarningReport[] earningReports = new EarningReport[]
+ {
+ new EarningReport { Name = "Lunees", Title = "Reactor Engineer", Avatar = "https://avatars2.githubusercontent.com/u/71094850?s=460&u=66c16f5bb7d27dc751f6759a82a3a070c8c7fe4b&v=4", Salary = "$0.99", Severity = MudBlazor.Color.Success, SeverityTitle = "Low"},
+ new EarningReport { Name = "Mikes-gh", Title = "Developer", Avatar = "https://avatars.githubusercontent.com/u/16208742?s=120&v=4", Salary = "$19.12K", Severity = MudBlazor.Color.Secondary, SeverityTitle = "Medium"},
+ new EarningReport { Name = "Garderoben", Title = "CSS Magician", Avatar = "https://avatars2.githubusercontent.com/u/10367109?s=460&u=2abf95f9e01132e8e2915def42895ffe99c5d2c6&v=4", Salary = "$1337", Severity = MudBlazor.Color.Primary, SeverityTitle = "High"},
+ };
+
+ class EarningReport
+ {
+ public string Avatar;
+ public string Name;
+ public string Title;
+ public MudBlazor.Color Severity;
+ public string SeverityTitle;
+ public string Salary;
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.Client.Blazor/Pages/UseDetail/CompanyInfo.razor b/HotelPms.Client.Blazor/Pages/UseDetail/CompanyInfo.razor
new file mode 100644
index 0000000..9fa9aac
--- /dev/null
+++ b/HotelPms.Client.Blazor/Pages/UseDetail/CompanyInfo.razor
@@ -0,0 +1,308 @@
+@using System.ComponentModel.DataAnnotations
+@using System.Text.RegularExpressions
+@using System.Reflection
+@using HotelPms.Client.Blazor.ViewModel
+@using HotelPms.Data.Common
+@using HotelPms.Data.Common.Interface.Master
+@using HotelPms.DataAccessGrpc.Client
+@using HotelPms.Share.IO
+@using HotelPms.Share.Util
+@using ViewModel = HotelPms.Client.Blazor.ViewModel
+@using static HotelPms.Client.Blazor.Util.SystemEnum
+@inject IJSRuntime JSRuntime
+
+<MudCard Style="@Style" Elevation="6">
+ <MudCardHeader Class="mb-0 pb-0">
+ <CardHeaderContent>
+ <MudText Typo="Typo.body1">会社情報</MudText>
+ </CardHeaderContent>
+ <CardHeaderActions>
+ <MudIconButton Icon="@Icons.Material.Filled.Search" Color="MudBlazor.Color.Default" Title="法人検索" />
+ <MudIconButton Icon="@Icons.Material.Filled.Cancel" Color="MudBlazor.Color.Default" Title="法人解除" />
+ </CardHeaderActions>
+ </MudCardHeader>
+ <MudCardContent Class="mt-0 pt-0 mb-0 pb-0">
+ <MudGrid Spacing="3" Justify="Justify.FlexStart" Class="align-center mt-0 pt-0 mb-0 pb-0">
+ @foreach (var field in Data.GetGroup(ViewModel.UseInput.GroupKey.Company))
+ {
+ EnvironmentSetting.Debug($"Index={field.Index},Text={field.Text},Error={field.Error},ErrorText={field.ErrorText}");
+ if (field.DispNameEnabled)
+ {
+ <MudItem lg="@field.WidthUnit" Class="@rowSpaceStyle">
+ <MudGrid Spacing="0" Justify="Justify.FlexStart" Class="align-center mt-0 pt-0 mb-0 pb-0">
+ <MudItem xs="@(12 - field.DispWidthUnit)" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudTextField Class="input-pink" @bind-Value="field.Text" Error="@field.Error" ErrorText="@field.ErrorText" @ref="field.Ref" T="string" Label="@field.Caption"
+ AutoFocus="@(field.Index == 0)" Margin="Margin.Dense" MaxLength="@field.MaxLenth" Disabled="@field.Disabled" ReadOnly="@field.ReadOnly"
+ id="@($"{Data.ID}-{field.Index}")" data-guid="@Data.ID" data-valid-index="@field.Index" data-valid-name="@field.Name" data-valid-org-text="@field.OrgText" data-valid-text="@field.Text"
+ data-valid-input-char="@((int)field.InputChar)" data-valid-show-style="@((int)field.ShowStyle)" data-valid-thousand-format="@field.ThousandFormat"/>
+ </MudItem>
+ <MudItem xs="@field.DispWidthUnit" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudField Margin="Margin.Dense">@field.DispText</MudField>
+ </MudItem>
+ </MudGrid>
+ </MudItem>
+ }
+ else
+ {
+ <MudItem lg="@field.WidthUnit" Class="@rowSpaceStyle">
+ <MudTextField @bind-Value="field.Text" Error="@field.Error" ErrorText="@field.ErrorText" @ref="field.Ref" T="string" Label="@field.Caption"
+ AutoFocus="@(field.Index == 0)" Margin="Margin.Dense" MaxLength="@field.MaxLenth" Disabled="@field.Disabled" ReadOnly="@field.ReadOnly"
+ id="@($"{Data.ID}-{field.Index}")" data-guid="@Data.ID" data-valid-index="@field.Index" data-valid-name="@field.Name" data-valid-org-text="@field.OrgText" data-valid-text="@field.Text"
+ data-valid-input-char="@((int)field.InputChar)" data-valid-show-style="@((int)field.ShowStyle)" data-valid-thousand-format="@field.ThousandFormat"/>
+ </MudItem>
+ }
+ }
+ <MudItem lg="12" Class="@rowSpaceStyle">
+ <MudGrid Spacing="0" Justify="Justify.FlexStart" Class="align-center mt-0 pt-0 mb-0 pb-0">
+ <MudItem xs="3" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudCheckBox T="bool" Label="団体" Color="MudBlazor.Color.Primary"></MudCheckBox>
+ </MudItem>
+ <MudItem xs="3" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudCheckBox T="bool" Label="会社" Color="MudBlazor.Color.Primary"></MudCheckBox>
+ </MudItem>
+ <MudItem xs="3" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudCheckBox T="bool" Label="氏名" Color="MudBlazor.Color.Primary"></MudCheckBox>
+ </MudItem>
+ <MudItem xs="3" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudCheckBox T="bool" Label="編集" Color="MudBlazor.Color.Error"></MudCheckBox>
+ </MudItem>
+ </MudGrid>
+ </MudItem>
+ </MudGrid>
+ </MudCardContent>
+</MudCard>
+
+@*<style>
+ /* 伪类选择器 :focus-within */
+ /* 它表示一个元素获得焦点,或,该元素的后代元素获得焦点。划重点,它或它的后代获得焦点。 */
+ /* 这也就意味着,它或它的后代获得焦点,都可以触发 :focus-within。 */
+ .focus-button:focus-within {
+ border: 1px solid;
+ border-color: #00FF00;
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(0, 255, 0, 0.6);
+ -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(0, 255, 0, 0.6);
+ box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.075), 0px 0px 8px rgba(0, 255, 0, 0.6);
+ }
+</style>
+*@
+
+@code {
+ [Inject] private IDialogService DialogService { get; set; }
+ [Inject] private GrpcChannel Channel { get; set; }
+ [CascadingParameter] MudDialogInstance MudDialog { get; set; }
+ [Parameter] public ViewModel.UseInput? Data { get; set; }
+ [Parameter] public EventCallback<ValidField> ParentShowList { get; set; }
+ [Parameter] public string Style { get; set; }
+
+ private string errorAll = string.Empty;
+ private MudButton btnSave;
+ private string rowSpaceStyle = "mt-2 pt-0 mb-0 pb-0";
+
+ protected override void OnInitialized()
+ {
+ //Data.Refresh = new Action(StateHasChanged); //メイン画面の更新
+ //Data.BeforeAutoNextFocus += BeforeAutoNextFocus;
+ //Data.BusinessValid += BusinessValid;
+ //Data.ShowList += ShowList;
+ }
+
+ private async void ShowList(ValidField sender, ValidEventArgs e)
+ {
+ await ParentShowList.InvokeAsync(sender);
+ //await ShowListAction(sender);
+ }
+
+ /// <summary>
+ /// 業務チェックを行う
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ /// <returns></returns>
+ private async Task<bool> BusinessValid(ValidField sender, ValidEventArgs e)
+ {
+ if (sender.Name == "ID")
+ {
+ using (BuildingAccess access = new BuildingAccess(Channel))
+ {
+ bool ret = await access.ExistsAsync(CConvert.ToInt(e.Text));
+ EnvironmentSetting.Debug($"access.Exists:{ret}");
+ if(Data.EditMode == (int)EMasterEditStatus.Create && ret)
+ {
+ if (e.EnterPush)
+ {
+ sender.Error = true;
+ sender.ErrorText = "当該データが既に存在します。";
+ }
+ else
+ {
+ sender.Error = false;
+ sender.ErrorText = string.Empty;
+ }
+ //StateHasChanged();
+ return false;
+ }
+ else if(Data.EditMode == (int)EMasterEditStatus.Update && !ret)
+ {
+ if (e.EnterPush)
+ {
+ sender.Error = true;
+ sender.ErrorText = "当該データが存在しません。";
+ }
+ else
+ {
+ sender.Error = false;
+ sender.ErrorText = string.Empty;
+ }
+ //StateHasChanged();
+ return false;
+ }
+ }
+ }
+
+ sender.Error = false;
+ sender.ErrorText = string.Empty;
+ //StateHasChanged();
+ return true;
+ }
+
+ /// <summary>
+ /// フォーカスを移動
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ /// <returns></returns>
+ private async Task<bool> BeforeAutoNextFocus(ValidField sender, ValidEventArgs e)
+ {
+ if (sender.Index == Data.Fields.Count - 1 && e.EnterPush)
+ {
+ await btnSave.FocusAsync(); //ここから非同期処理
+ return false;
+ }
+ return true;
+ }
+
+ /// <summary>
+ /// Endキー
+ /// </summary>
+ /// <param name="item"></param>
+ private async Task ShowListAction(ViewModel.ValidField item)
+ {
+ if (item.Name == "ZipCode")
+ {
+ if(item.Text.Length == 0) { return; }
+ using (DataTable data = await HotelPms.DataAccessGrpc.Client.AddressAccess.GetPostNoSearch(Channel, item.Text))
+ {
+ if (data.Rows.Count == 0)
+ {
+ await DialogService.ShowMessageBox($"{item.Caption}検索","該当データがありません。",yesText: "OK");
+ return;
+ }
+
+ if (data.Rows.Count > 1000)
+ {
+ await DialogService.ShowMessageBox($"{item.Caption}検索","対象データが1000件以上超えていますので、更に条件を調整してください。",yesText: "OK");
+ return;
+ }
+
+ var parameters = new DialogParameters { ["Data"] = data };
+ var dialog = DialogService.Show<SelectList>($"{item.Caption}検索", parameters);
+ var ret = await dialog.Result;
+ if (!ret.Cancelled)
+ {
+ var row = ret.Data as DataRow;
+ item.Text = row[0].ToString();
+ Data.GetField("Address2").Text = row[1].ToString();
+ StateHasChanged();
+ }
+ }
+ }
+ else if (item.Name == "Address2")
+ {
+ if(item.Text.Length == 0) { return; }
+ using (DataTable data = await HotelPms.DataAccessGrpc.Client.AddressAccess.GetAddressSearch(Channel, item.Text))
+ {
+ if (data.Rows.Count == 0)
+ {
+ await DialogService.ShowMessageBox($"{item.Caption}検索","該当データがありません。",yesText: "OK");
+ return;
+ }
+
+ if (data.Rows.Count > 1000)
+ {
+ await DialogService.ShowMessageBox($"{item.Caption}検索","対象データが1000件以上超えていますので、更に条件を調整してください。",yesText: "OK");
+ return;
+ }
+
+ var parameters = new DialogParameters { ["Data"] = data };
+ var dialog = DialogService.Show<SelectList>($"{item.Caption}検索", parameters);
+ var ret = await dialog.Result;
+ if (!ret.Cancelled)
+ {
+ var row = ret.Data as DataRow;
+ Data.GetField("ZipCode").Text = row[0].ToString();
+ item.Text = row[1].ToString();
+ StateHasChanged();
+ }
+ }
+ }
+ else
+ {
+ //await DialogService.ShowMessageBox(
+ // "Warning",
+ // "未実装!",
+ // yesText: "OK", cancelText: "Cancel");
+ }
+ }
+
+ /// <summary>
+ /// 画面閉じる
+ /// </summary>
+ private void Close()
+ {
+ MudDialog.Cancel();
+ }
+
+ public void SetResvNo(string no)
+ {
+ Data.GetField("ResvNo").Text = no;
+ StateHasChanged();
+ }
+
+ /// <summary>
+ /// 保存
+ /// </summary>
+ private async void Save()
+ {
+ if (!await Data.IsValidAll())
+ {
+ //errorAll = Data.ErrText;
+ return;
+ }
+
+ //データ保存
+ using (BuildingAccess access = new BuildingAccess(Channel))
+ {
+ HotelPms.Data.Master.Building item = new HotelPms.Data.Master.Building()
+ {
+ ID = CConvert.ToInt(Data.GetField("ID").Text),
+ Name = Data.GetField("Name").Text,
+ ShortName = Data.GetField("ShortName").Text,
+ ZipCode = Data.GetField("ZipCode").Text,
+ Tel = Data.GetField("Tel").Text,
+ Fax = Data.GetField("Fax").Text,
+ Address2 = Data.GetField("Address2").Text,
+ };
+ //IMaster im = item as IMaster;
+
+ var result = Data.EditMode == (int)EMasterEditStatus.Create ? await access.AddAsync(item) : await access.UpdateAsync(item);
+ if(result.ErrNo != 0)
+ {
+ errorAll = $"更新に失敗しました。";
+ OperationLog.Instance.WriteLog($"Building.Save:{result.ErrNo}.{result.ErrData}");
+ return;
+ }
+ }
+
+ MudDialog.Close(DialogResult.Ok(Data));
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.Client.Blazor/Pages/UseDetail/Component1.razor b/HotelPms.Client.Blazor/Pages/UseDetail/Component1.razor
new file mode 100644
index 0000000..dbc2b17
--- /dev/null
+++ b/HotelPms.Client.Blazor/Pages/UseDetail/Component1.razor
@@ -0,0 +1,5 @@
+<h3>Component1</h3>
+<div class="dh">CSS隔離テスト①</div>
+@code {
+
+}
diff --git a/HotelPms.Client.Blazor/Pages/UseDetail/Component1.razor.css b/HotelPms.Client.Blazor/Pages/UseDetail/Component1.razor.css
new file mode 100644
index 0000000..aba1ad1
--- /dev/null
+++ b/HotelPms.Client.Blazor/Pages/UseDetail/Component1.razor.css
@@ -0,0 +1,4 @@
+.dh {
+ color: brown;
+ font-family: Tahoma, Geneva, Verdana, sans-serif;
+}
diff --git a/HotelPms.Client.Blazor/Pages/UseDetail/Component2.razor b/HotelPms.Client.Blazor/Pages/UseDetail/Component2.razor
new file mode 100644
index 0000000..dbc2b17
--- /dev/null
+++ b/HotelPms.Client.Blazor/Pages/UseDetail/Component2.razor
@@ -0,0 +1,5 @@
+<h3>Component1</h3>
+<div class="dh">CSS隔離テスト①</div>
+@code {
+
+}
diff --git a/HotelPms.Client.Blazor/Pages/UseDetail/Component2.razor.css b/HotelPms.Client.Blazor/Pages/UseDetail/Component2.razor.css
new file mode 100644
index 0000000..81dba93
--- /dev/null
+++ b/HotelPms.Client.Blazor/Pages/UseDetail/Component2.razor.css
@@ -0,0 +1,5 @@
+.dh {
+ color: #00ffff;
+ font-family: Tahoma, Geneva, Verdana, sans-serif;
+ font-size: 72px;
+}
diff --git a/HotelPms.Client.Blazor/Pages/UseDetail/Input.razor b/HotelPms.Client.Blazor/Pages/UseDetail/Input.razor
new file mode 100644
index 0000000..41cf408
--- /dev/null
+++ b/HotelPms.Client.Blazor/Pages/UseDetail/Input.razor
@@ -0,0 +1,1183 @@
+@page "/usedetail/input"
+@inject GrpcChannel Channel
+@inject IJSRuntime JSRuntime
+@inject IGlobalLoadingSpinner LoadingSpinner
+@using HotelPms.Client.Blazor.Models
+@using HotelPms.Client.Blazor.Services
+@using HotelPms.Data.Common
+@using HotelPms.Data.Common.Pagination
+@using Google.Protobuf.WellKnownTypes
+@using System.Text.Json
+@using System.Text
+@using ViewModel = HotelPms.Client.Blazor.ViewModel
+@using static HotelPms.Client.Blazor.Util.SystemEnum
+@inject IDialogService DialogService
+@inject NavigationManager NavigationManager
+@implements IDisposable
+@inject ISnackbar Snackbar
+
+<h3>詳細画面</h3>
+<MudGrid Spacing="1" Justify="Justify.FlexStart" Class="align-center mt-3 mb-3">
+ <MudItem lg="1" Class="mt-0 pt-0">
+ <MudButton @ref="btnSave" Variant="Variant.Filled" Style="@buttonStyle" StartIcon="@Icons.Filled.ReadMore" OnClick="Save">登録</MudButton>
+ </MudItem>
+ <MudItem lg="1" Class="mt-0 pt-0">
+ <MudButton Variant="Variant.Filled" Style="@buttonStyle" StartIcon="@Icons.Filled.Input" OnClick="Refresh">再表示</MudButton>
+ </MudItem>
+ <MudItem lg="1" Class="mt-0 pt-0">
+ <MudButton Variant="Variant.Filled" Style="@buttonStyle" StartIcon="@Icons.Filled.ReadMore" OnClick="UseSearch">利用検索</MudButton>
+ </MudItem>
+ <MudItem lg="1" Class="mt-0 pt-0">
+ <MudButton Variant="Variant.Filled" Style="@buttonStyle" StartIcon="@Icons.Filled.PostAdd">新規</MudButton>
+ </MudItem>
+ <MudItem lg="1" Class="mt-0 pt-0">
+ <MudButton Variant="Variant.Filled" Style="@buttonStyle" StartIcon="@Icons.Filled.Input">顧客検索</MudButton>
+ </MudItem>
+ <MudItem lg="1" Class="mt-0 pt-0">
+ <MudButton Variant="Variant.Filled" Style="@buttonStyle" StartIcon="@Icons.Filled.Input">伝票入力</MudButton>
+ </MudItem>
+ <MudItem lg="1" Class="mt-0 pt-0">
+ <MudButton Variant="Variant.Filled" Style="@buttonStyle" StartIcon="@Icons.Filled.Input">タイプ別残室</MudButton>
+ </MudItem>
+ <MudItem lg="1" Class="mt-0 pt-0">
+ <MudButton Variant="Variant.Filled" Style="@buttonStyle" StartIcon="@Icons.Filled.Input">団体調整</MudButton>
+ </MudItem>
+ <MudItem lg="1" Class="mt-0 pt-0">
+ <MudButton Variant="Variant.Filled" Style="@buttonStyle" StartIcon="@Icons.Filled.Input">顧客履歴</MudButton>
+ </MudItem>
+ <MudItem lg="1" Class="mt-0 pt-0">
+ <MudButton Variant="Variant.Filled" Style="@buttonStyle" StartIcon="@Icons.Filled.Input">領収書</MudButton>
+ </MudItem>
+ <MudItem lg="1" Class="mt-0 pt-0">
+ <MudButton Variant="Variant.Filled" Style="@buttonStyle" StartIcon="@Icons.Filled.Input">VOID</MudButton>
+ </MudItem>
+ <MudItem lg="1" Class="mt-0 pt-0">
+ <MudButton Variant="Variant.Filled" Style="@buttonStyle" StartIcon="@Icons.Filled.Input">キャンセル</MudButton>
+ </MudItem>
+
+ <MudItem lg="1" Class="mt-0 pt-0">
+ <MudButton Variant="Variant.Filled" Style="@buttonStyle" StartIcon="@Icons.Filled.Input">付箋</MudButton>
+ </MudItem>
+ <MudItem lg="1" Class="mt-0 pt-0">
+ <MudButton Variant="Variant.Filled" Style="@buttonStyle" StartIcon="@Icons.Filled.Input">レジスト</MudButton>
+ </MudItem>
+ <MudItem lg="1" Class="mt-0 pt-0">
+ <MudButton Variant="Variant.Filled" Style="@buttonStyle" StartIcon="@Icons.Filled.Input">コピー</MudButton>
+ </MudItem>
+ <MudItem lg="1" Class="mt-0 pt-0">
+ <MudButton Variant="Variant.Filled" Style="@buttonStyle" StartIcon="@Icons.Filled.Input">見積書</MudButton>
+ </MudItem>
+</MudGrid>
+<MudExpansionPanels MultiExpansion="true">
+ <MudExpansionPanel Text="基本情報" IsInitiallyExpanded="true" Class="mt-0 mb-1">
+ <MudGrid Spacing="2" Justify="Justify.FlexStart" Class="align-center mb-1">
+ <MudItem lg="3">
+ <ResvInfo Data="@Data" @ref="m_GroupResv" Style="@baseInfoStyle" RowSpaceStyle="@rowSpaceStyle" />
+ </MudItem>
+ <MudItem lg="3">
+ <PersonInfo Data="@Data" ParentShowList="CallBackShowList" @ref="m_GroupPerson" Style="@baseInfoStyle" />
+ </MudItem>
+ <MudItem lg="3">
+ <CompanyInfo Data="@Data" ParentShowList="CallBackShowList" @ref="m_GroupCompany" Style="@baseInfoStyle" />
+ </MudItem>
+ <MudItem lg="3">
+ <OtherInfo Data="@Data" ParentShowList="CallBackShowList" @ref="m_GroupOther" Style="@baseInfoStyle" />
+ </MudItem>
+ </MudGrid>
+ </MudExpansionPanel>
+ <MudExpansionPanel Text="詳細情報" IsInitiallyExpanded="true" Class="mt-0 mb-1">
+ <MudGrid Spacing="1" Justify="Justify.FlexStart" Class="align-top mt-0 pt-0 mb-0 pb-0">
+ <MudItem lg="3" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudGrid Spacing="1" Justify="Justify.FlexStart" Class="align-top mt-0 pt-0 mb-0 pb-0">
+ <MudItem lg="12" Class="mt-0 pt-0 mb-3 pb-0">
+ <MudPaper Class="pa-2">
+ <MudStack Spacing="1">
+ <MudStack Row="true">
+ <MudText Typo="Typo.h6">利用日</MudText>
+ <MudText Typo="Typo.h6">@Data.UseDate</MudText>
+ <MudText Typo="Typo.h6">@CConvert.ToDateString(Data.UseDate, "(ddd)")</MudText>
+ </MudStack>
+ <MudStack Row="true" Spacing="0" Justify="Justify.Center" Style="width: 280px;" Class="slip-row-center">
+ <MudIconButton Icon="@Icons.Filled.FastRewind" Color="MudBlazor.Color.Primary"></MudIconButton>
+ <MudTextField T="int" @bind-Value="@Data.CurrentStay" Mask="@(new PatternMask("000"))" Margin="Margin.Dense" />
+ <MudTextField T="string" Text = "/" ReadOnly="true" Margin="Margin.Dense" Style="width: 30px;" />
+ <MudTextField T="string" Text="999" ReadOnly="true" Margin="Margin.Dense" Style="width: 80px;" />
+ <MudIconButton Icon="@Icons.Filled.FastForward" Color="MudBlazor.Color.Primary"></MudIconButton>
+ </MudStack>
+ </MudStack>
+ </MudPaper>
+ </MudItem>
+ <MudItem lg="12" Class="mt-0 pt-0 mb-3 pb-0">
+ <RoomTypeInput Data="@Data" OnRefresh="@RoomTypeChange"></RoomTypeInput>
+ </MudItem>
+ <MudItem lg="12" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudCard Style="height: 100%" Elevation="4">
+ <MudCardHeader Class="mb-0 pb-0">
+ <CardHeaderContent>
+ <MudText Typo="Typo.body1">部屋一覧</MudText>
+ </CardHeaderContent>
+ </MudCardHeader>
+ <MudCardContent Class="mt-0 pt-0 mb-0 pb-1">
+ <MudTable id="gdi-room-list" T="UseRoomRow" Items="@Data.UseRoomList" @ref="mudUseRoomTable" @bind-SelectedItem="Data.SelUseRoomRow" RowClassFunc="@SelectedRowClassFunc" OnRowClick="RowClickEvent" Dense="true" Hover="true" ReadOnly="false" FixedHeader="true" Height="248px" Striped="true" Elevation="0">
+ <ColGroup>
+ <col style="width:70px;" />
+ <col />
+ <col style="width:50px;" />
+ <col style="width:50px;" />
+ </ColGroup>
+ <HeaderContent>
+ <MudTh>部屋</MudTh>
+ <MudTh>氏名</MudTh>
+ <MudTh>状</MudTh>
+ <MudTh>代</MudTh>
+ </HeaderContent>
+ <RowTemplate>
+ <MudTd DataLabel="部屋">@context.RoomID</MudTd>
+ <MudTd DataLabel="氏名">@context.Name</MudTd>
+ <MudTd DataLabel="状">@context.UseStatus</MudTd>
+ @if(context.AllSel)
+ {
+ <MudTd DataLabel="代"></MudTd>
+ }
+ else
+ {
+ <MudTd DataLabel="代"><MudCheckBox Checked="@context.Representative" Dense="true" T="bool"></MudCheckBox></MudTd>
+ }
+ </RowTemplate>
+ </MudTable>
+ </MudCardContent>
+ </MudCard>
+ </MudItem>
+ </MudGrid>
+ </MudItem>
+ <MudItem lg="9" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudTabs Class="mt-0 mb-0" Elevation="4" Rounded="true" Color="@Color.Success" PrevIcon="@Icons.Filled.SkipPrevious" NextIcon="@Icons.Filled.SkipNext" SliderColor="@Color.Error" ActivePanelIndexChanged="TabChanged">
+ <MudTabPanel Text="料金情報">
+ <SaleInput @ref="saleInput" Data="@Data" OnRefresh="@RefreshSaleInput"></SaleInput>
+ </MudTabPanel>
+ <MudTabPanel Text="拡張情報">
+ <MudGrid Spacing="1" Justify="Justify.FlexStart" Class="align-center mb-0 mt-1 pb-0">
+ <MudItem lg="3">
+ <MudCard Style="@addInfoStyle" Elevation="4">
+ <MudCardHeader Class="mb-0 pb-0">
+ <CardHeaderContent>
+ <MudText Typo="Typo.body1">予約追加情報</MudText>
+ </CardHeaderContent>
+ </MudCardHeader>
+ <MudCardContent Class="mt-0 pt-0 mb-0 pb-0">
+ <MudGrid Spacing="3" Justify="Justify.FlexStart" Class="align-center mt-0 pt-0 mb-0 pb-0">
+ <MudItem lg="12" Class="@rowSpaceStyle">
+ <MudGrid Spacing="1" Justify="Justify.FlexStart" Class="align-center mt-0 pt-0 mb-0 pb-0">
+ <MudItem xs="4" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudTextField T="string" Label="自由集計" Margin="Margin.Dense" MaxLength="50" />
+ </MudItem>
+ <MudItem xs="8" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudField Margin="Margin.Dense"></MudField>
+ </MudItem>
+ </MudGrid>
+ </MudItem>
+ <MudItem lg="12" Class="@rowSpaceStyle">
+ <MudGrid Spacing="1" Justify="Justify.FlexStart" Class="align-center mt-0 pt-0 mb-0 pb-0">
+ <MudItem xs="4" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudTextField T="string" Label="自由集計" Margin="Margin.Dense" MaxLength="50" />
+ </MudItem>
+ <MudItem xs="8" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudField Margin="Margin.Dense"></MudField>
+ </MudItem>
+ </MudGrid>
+ </MudItem>
+ <MudItem lg="12" Class="@rowSpaceStyle">
+ <MudGrid Spacing="1" Justify="Justify.FlexStart" Class="align-center mt-0 pt-0 mb-0 pb-0">
+ <MudItem xs="4" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudTextField T="string" Label="自由集計" Margin="Margin.Dense" MaxLength="50" />
+ </MudItem>
+ <MudItem xs="8" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudField Margin="Margin.Dense"></MudField>
+ </MudItem>
+ </MudGrid>
+ </MudItem>
+ <MudItem lg="12" Class="@rowSpaceStyle">
+ <MudGrid Spacing="1" Justify="Justify.FlexStart" Class="align-center mt-0 pt-0 mb-0 pb-0">
+ <MudItem xs="4" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudTextField T="string" Label="自由集計" Margin="Margin.Dense" MaxLength="50" />
+ </MudItem>
+ <MudItem xs="8" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudField Margin="Margin.Dense"></MudField>
+ </MudItem>
+ </MudGrid>
+ </MudItem>
+ <MudItem lg="12" Class="@rowSpaceStyle">
+ <MudGrid Spacing="1" Justify="Justify.FlexStart" Class="align-center mt-0 pt-0 mb-0 pb-0">
+ <MudItem xs="4" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudTextField T="string" Label="自由集計" Margin="Margin.Dense" MaxLength="50" />
+ </MudItem>
+ <MudItem xs="8" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudField Margin="Margin.Dense"></MudField>
+ </MudItem>
+ </MudGrid>
+ </MudItem>
+ <MudItem lg="12" Class="@rowSpaceStyle">
+ <MudGrid Spacing="1" Justify="Justify.FlexStart" Class="align-center mt-0 pt-0 mb-0 pb-0">
+ <MudItem xs="4" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudTextField T="string" Label="自由集計" Margin="Margin.Dense" MaxLength="50" />
+ </MudItem>
+ <MudItem xs="8" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudField Margin="Margin.Dense"></MudField>
+ </MudItem>
+ </MudGrid>
+ </MudItem>
+ <MudItem lg="12" Class="@rowSpaceStyle">
+ <MudGrid Spacing="1" Justify="Justify.FlexStart" Class="align-center mt-0 pt-0 mb-0 pb-0">
+ <MudItem xs="4" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudTextField T="string" Label="自由集計" Margin="Margin.Dense" MaxLength="50" />
+ </MudItem>
+ <MudItem xs="8" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudField Margin="Margin.Dense"></MudField>
+ </MudItem>
+ </MudGrid>
+ </MudItem>
+ </MudGrid>
+ </MudCardContent>
+ </MudCard>
+ </MudItem>
+ <MudItem lg="3">
+ <MudCard Style="@addInfoStyle" Elevation="4">
+ <MudCardHeader Class="mb-0 pb-0">
+ <CardHeaderContent>
+ <MudText Typo="Typo.body1">個人追加情報</MudText>
+ </CardHeaderContent>
+ </MudCardHeader>
+ <MudCardContent Class="mt-0 pt-0 mb-0 pb-0">
+ <MudGrid Spacing="3" Justify="Justify.FlexStart" Class="align-center mt-0 pt-0 mb-0 pb-0">
+ <MudItem lg="12" Class="@rowSpaceStyle">
+ <MudGrid Spacing="1" Justify="Justify.FlexStart" Class="align-center mt-0 pt-0 mb-0 pb-0">
+ <MudItem xs="8" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudTextField T="string" Label="電話番号②" Margin="Margin.Dense" MaxLength="50" />
+ </MudItem>
+ <MudItem xs="4" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudTextField T="string" Label="区分" Margin="Margin.Dense" MaxLength="50" ReadOnly="true" />
+ </MudItem>
+ </MudGrid>
+ </MudItem>
+ <MudItem lg="12" Class="@rowSpaceStyle">
+ <MudTextField T="string" Label="郵便番号" MaxLength="50" Margin="Margin.Dense" />
+ </MudItem>
+ <MudItem lg="12" Class="@rowSpaceStyle">
+ <MudGrid Spacing="1" Justify="Justify.FlexStart" Class="align-center mt-0 pt-0 mb-0 pb-0">
+ <MudItem xs="8" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudTextField T="string" Label="都道府県" Margin="Margin.Dense" MaxLength="50" />
+ </MudItem>
+ <MudItem xs="4" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudTextField T="string" Label="DM" Margin="Margin.Dense" MaxLength="50" ReadOnly="true" />
+ </MudItem>
+ </MudGrid>
+ </MudItem>
+ <MudItem lg="12" Class="@rowSpaceStyle">
+ <MudTextField T="string" Label="市区町村" Margin="Margin.Dense" MaxLength="50" />
+ </MudItem>
+ <MudItem lg="12" Class="@rowSpaceStyle">
+ <MudTextField T="string" Label="町域" MaxLength="50" Margin="Margin.Dense" />
+ </MudItem>
+ <MudItem lg="12" Class="@rowSpaceStyle">
+ <MudTextField T="string" Label="番地" Margin="Margin.Dense" MaxLength="50" />
+ </MudItem>
+ <MudItem lg="12" Class="@rowSpaceStyle">
+ <MudTextField T="string" Label="メール" Margin="Margin.Dense" MaxLength="50" />
+ </MudItem>
+ <MudItem lg="12" Class="@rowSpaceStyle">
+ <MudGrid Spacing="1" Justify="Justify.FlexStart" Class="align-center mt-0 pt-0 mb-0 pb-0">
+ <MudItem xs="8" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudTextField T="string" Label="パスポート" Margin="Margin.Dense" MaxLength="50" />
+ </MudItem>
+ <MudItem xs="4" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudTextField T="string" Label="性別" Margin="Margin.Dense" MaxLength="50" ReadOnly="true" />
+ </MudItem>
+ </MudGrid>
+ </MudItem>
+ <MudItem lg="12" Class="@rowSpaceStyle">
+ <MudGrid Spacing="1" Justify="Justify.FlexStart" Class="align-center mt-0 pt-0 mb-0 pb-0">
+ <MudItem xs="6" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudDatePicker Label="誕生日" Margin="Margin.Dense" Editable="true" @bind-Date="useDate" />
+ </MudItem>
+ <MudItem xs="6" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudDatePicker Label="記念日" Margin="Margin.Dense" Editable="true" @bind-Date="useDate" />
+ </MudItem>
+ </MudGrid>
+ </MudItem>
+ </MudGrid>
+ </MudCardContent>
+ </MudCard>
+ </MudItem>
+ <MudItem lg="3">
+ <MudCard Style="@addInfoStyle" Elevation="4">
+ <MudCardHeader Class="mb-0 pb-0">
+ <CardHeaderContent>
+ <MudText Typo="Typo.body1">会社追加情報</MudText>
+ </CardHeaderContent>
+ </MudCardHeader>
+ <MudCardContent Class="mt-0 pt-0 mb-0 pb-0">
+ <MudGrid Spacing="3" Justify="Justify.FlexStart" Class="align-center mt-0 pt-0 mb-0 pb-0">
+ <MudItem lg="12" Class="@rowSpaceStyle">
+ <MudTextField T="string" Label="所属" Margin="Margin.Dense" MaxLength="50" />
+ </MudItem>
+ <MudItem lg="12" Class="@rowSpaceStyle">
+ <MudTextField T="string" Label="役職" MaxLength="50" Margin="Margin.Dense" />
+ </MudItem>
+ <MudItem lg="12" Class="@rowSpaceStyle">
+ <MudTextField T="string" Label="郵便番号" MaxLength="50" Margin="Margin.Dense" />
+ </MudItem>
+ <MudItem lg="12" Class="@rowSpaceStyle">
+ <MudTextField T="string" Label="都道府県" Margin="Margin.Dense" MaxLength="50" />
+ </MudItem>
+ <MudItem lg="12" Class="@rowSpaceStyle">
+ <MudTextField T="string" Label="市区町村" Margin="Margin.Dense" MaxLength="50" />
+ </MudItem>
+ <MudItem lg="12" Class="@rowSpaceStyle">
+ <MudTextField T="string" Label="町域" MaxLength="50" Margin="Margin.Dense" />
+ </MudItem>
+ <MudItem lg="12" Class="@rowSpaceStyle">
+ <MudTextField T="string" Label="番地" Margin="Margin.Dense" MaxLength="50" />
+ </MudItem>
+ <MudItem lg="12" Class="@rowSpaceStyle">
+ <MudTextField T="string" Label="法人備考" Lines="4" MaxLength="500" Margin="Margin.Dense" />
+ </MudItem>
+ </MudGrid>
+ </MudCardContent>
+ </MudCard>
+ </MudItem>
+ <MudItem lg="3">
+ <MudCard Style="@addInfoStyle" Elevation="4">
+ <MudCardHeader Class="mb-0 pb-0">
+ <CardHeaderContent>
+ <MudText Typo="Typo.body1">顧客自由集計</MudText>
+ </CardHeaderContent>
+ </MudCardHeader>
+ <MudCardContent Class="mt-0 pt-0 mb-0 pb-0">
+ <MudGrid Spacing="3" Justify="Justify.FlexStart" Class="align-center mt-0 pt-0 mb-0 pb-0">
+ <MudItem lg="12" Class="@rowSpaceStyle">
+ <MudGrid Spacing="1" Justify="Justify.FlexStart" Class="align-center mt-0 pt-0 mb-0 pb-0">
+ <MudItem xs="4" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudTextField T="string" Label="自由集計" Margin="Margin.Dense" MaxLength="50" />
+ </MudItem>
+ <MudItem xs="8" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudField Margin="Margin.Dense"></MudField>
+ </MudItem>
+ </MudGrid>
+ </MudItem>
+ <MudItem lg="12" Class="@rowSpaceStyle">
+ <MudGrid Spacing="1" Justify="Justify.FlexStart" Class="align-center mt-0 pt-0 mb-0 pb-0">
+ <MudItem xs="4" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudTextField T="string" Label="自由集計" Margin="Margin.Dense" MaxLength="50" />
+ </MudItem>
+ <MudItem xs="8" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudField Margin="Margin.Dense"></MudField>
+ </MudItem>
+ </MudGrid>
+ </MudItem>
+ <MudItem lg="12" Class="@rowSpaceStyle">
+ <MudGrid Spacing="1" Justify="Justify.FlexStart" Class="align-center mt-0 pt-0 mb-0 pb-0">
+ <MudItem xs="4" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudTextField T="string" Label="自由集計" Margin="Margin.Dense" MaxLength="50" />
+ </MudItem>
+ <MudItem xs="8" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudField Margin="Margin.Dense"></MudField>
+ </MudItem>
+ </MudGrid>
+ </MudItem>
+ <MudItem lg="12" Class="@rowSpaceStyle">
+ <MudGrid Spacing="1" Justify="Justify.FlexStart" Class="align-center mt-0 pt-0 mb-0 pb-0">
+ <MudItem xs="4" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudTextField T="string" Label="自由集計" Margin="Margin.Dense" MaxLength="50" />
+ </MudItem>
+ <MudItem xs="8" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudField Margin="Margin.Dense"></MudField>
+ </MudItem>
+ </MudGrid>
+ </MudItem>
+ <MudItem lg="12" Class="@rowSpaceStyle">
+ <MudGrid Spacing="1" Justify="Justify.FlexStart" Class="align-center mt-0 pt-0 mb-0 pb-0">
+ <MudItem xs="4" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudTextField T="string" Label="自由集計" Margin="Margin.Dense" MaxLength="50" />
+ </MudItem>
+ <MudItem xs="8" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudField Margin="Margin.Dense"></MudField>
+ </MudItem>
+ </MudGrid>
+ </MudItem>
+ <MudItem lg="12" Class="@rowSpaceStyle">
+ <MudGrid Spacing="1" Justify="Justify.FlexStart" Class="align-center mt-0 pt-0 mb-0 pb-0">
+ <MudItem xs="4" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudTextField T="string" Label="自由集計" Margin="Margin.Dense" MaxLength="50" />
+ </MudItem>
+ <MudItem xs="8" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudField Margin="Margin.Dense"></MudField>
+ </MudItem>
+ </MudGrid>
+ </MudItem>
+ <MudItem lg="12" Class="@rowSpaceStyle">
+ <MudGrid Spacing="1" Justify="Justify.FlexStart" Class="align-center mt-0 pt-0 mb-0 pb-0">
+ <MudItem xs="4" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudTextField T="string" Label="自由集計" Margin="Margin.Dense" MaxLength="50" />
+ </MudItem>
+ <MudItem xs="8" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudField Margin="Margin.Dense"></MudField>
+ </MudItem>
+ </MudGrid>
+ </MudItem>
+ </MudGrid>
+ </MudCardContent>
+ </MudCard>
+ </MudItem>
+ </MudGrid>
+ </MudTabPanel>
+ </MudTabs>
+ </MudItem>
+ </MudGrid>
+ </MudExpansionPanel>
+ <MudExpansionPanel Text="メモ" IsInitiallyExpanded="true" Class="mt-0 mb-1">
+ <MudDynamicTabs Elevation="4" Rounded="true" ApplyEffectsToContainer="true" PanelClass="px-4 py-6" AddTab="AddTabCallback" CloseTab="@((panel) => CloseTabCallback(panel))" @bind-ActivePanelIndex="_index" AddIconToolTip="Click here to add a new tab" CloseIconToolTip="Close this tab. All data will be lost">
+ @foreach (var item in _tabs)
+ {
+ <MudTabPanel Text="@item.Name" Tag="@item.Id">
+ <MudTextField @ref="multilineReference" T="string" Lines="3" Variant="Variant.Outlined" Text="@item.Content" Adornment="Adornment.End" AdornmentIcon="@Icons.Filled.Api" OnAdornmentClick="@(() => multilineReference.SelectAsync())" />
+ </MudTabPanel>
+ }
+ </MudDynamicTabs>
+ </MudExpansionPanel>
+ <MudExpansionPanel Text="備考" IsInitiallyExpanded="true" Class="mt-0 mb-1">
+ <MudTextField @ref="multilineReference" T="string" Lines="3" Variant="Variant.Outlined" Text="" Adornment="Adornment.End" AdornmentIcon="@Icons.Filled.Api" OnAdornmentClick="@(() => multilineReference.SelectAsync())" />
+ </MudExpansionPanel>
+ <MudExpansionPanel Text="前回情報" IsInitiallyExpanded="true" Class="mt-0 mb-1">
+ Panel Three Content
+ </MudExpansionPanel>
+</MudExpansionPanels>
+
+<style>
+ .selected {
+ background-color: #1E88E5 !important;
+ }
+
+ .selected > td {
+ color: white !important;
+ }
+
+ .selected > td .mud-input {
+ color: white !important;
+ }
+
+ .slip-row > .mud-input-control > .mud-input-control-input-container > div.mud-input.mud-input-text {
+ margin-top: 0px;
+ }
+
+ .slip-row-center > .mud-input-control > .mud-input-control-input-container > div.mud-input.mud-input-text {
+ margin-top: 0px;
+ }
+
+ .slip-row-right > .mud-input-control > .mud-input-control-input-container > div.mud-input.mud-input-text {
+ margin-top: 0px;
+ }
+
+ .slip-row-center > .mud-input-control > .mud-input-control-input-container > div > input {
+ text-align: center;
+ }
+
+ .slip-row-right > input {
+ text-align: right;
+ }
+</style>
+
+@code {
+ #region 定義
+
+ [Inject] public IJsInputCoreService JsInputCore { get; set; }
+ private Parameter.UseInputArgs m_Para;
+ private ViewModel.UseInput Data;
+
+ private int spacing { get; set; } = 3;
+ private string buttonStyle = $"color:{Colors.Shades.White};background-color:{Colors.Green.Darken2};width: 130px; height: 35px;";
+ private bool renderUI = true;
+ private string rowSpaceStyle = "mt-2 pt-0 mb-0 pb-0";
+ private string baseInfoStyle = "height: 480px";
+ private string addInfoStyle = "height: 600px";
+
+ private ResvInfo m_GroupResv; //基本情報
+ private PersonInfo m_GroupPerson;
+ private CompanyInfo m_GroupCompany;
+ private OtherInfo m_GroupOther;
+
+ private static RenderFragment RenderMessage(string text) =>@<MessageContext Text="@text" />;
+
+ DateTime? useDate;
+ private MudButton btnSave;
+ private MudTextField<string> multilineReference;
+ private SaleInput saleInput;
+
+ #endregion
+
+ #region Class Event
+
+ /// <summary>
+ /// サーバーと通信しないべき
+ /// </summary>
+ protected override void OnInitialized()
+ {
+ Data = new ViewModel.UseInput(JSRuntime);
+ Data.ErrRefresh = new Action(StateHasChanged); //メイン画面の更新
+ Data.BeforeAutoNextFocus += BeforeAutoNextFocus;
+ Data.BusinessValid += BusinessValid;
+ Data.ShowList += ShowList;
+
+ base.OnInitialized();
+ Restore();
+ }
+
+ /// <summary>
+ /// 一つイベント処理に一回サーバーを通信の原則に基づいて、
+ /// 設定など一回でまとめて取得する
+ /// </summary>
+ /// <returns></returns>
+ protected override async Task OnInitializedAsync()
+ {
+ Console.WriteLine($"パラメータ:{NavigationManager.HistoryEntryState}");
+ if (!string.IsNullOrEmpty(NavigationManager.HistoryEntryState)) { m_Para = Parameter.UseInputArgs.FromJson(NavigationManager.HistoryEntryState); }
+ if(m_Para == null) { m_Para = new(); }
+
+ if (m_Para.ID == 0)
+ {
+ //初期化
+ if (!await Data.CreateDefault(new(m_Para.CinDate), 1))
+ {
+ return;
+ }
+ }
+ else
+ {
+ //取得
+ //Use → ViewModel.UseInput (新規の場合、初期値など)
+ Data.Use = await FakeData.CreateUse();
+ Data.UseDetail = Data.Use.DetailList[0];
+ }
+ Data.UseDate = m_Para.CinDate;
+ Data.SetUseDetailToForm();
+ Data.InitGrid();
+
+ //CreateFakeData();
+ }
+
+
+ protected override bool ShouldRender()
+ {
+ EnvironmentSetting.Debug($"【{DateTime.Now.ToString("HH:mm:ss fff")}】ShouldRender開始:{renderUI}");
+ if (renderUI)
+ {
+ renderUI = false; //重複ShouldRenderを回避する
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ protected override async Task OnAfterRenderAsync(bool firstRender)
+ {
+ EnvironmentSetting.Debug($"【{DateTime.Now.ToString("HH:mm:ss fff")}】OnAfterRenderAsync開始:{firstRender}");
+ if (firstRender)
+ {
+ await JsInputCore.Init(Data.ID);
+ }
+
+ renderUI = true;
+ if (_updateIndex == true)
+ {
+ _index = _tabs.Count - 1;
+ StateHasChanged();
+ _updateIndex = false;
+ }
+ }
+
+ public async void Dispose()
+ {
+ try
+ {
+ await JsInputCore.Dispose(Data.ID);
+ Data.Dispose(); //必ず解放する
+ }
+ catch { }
+ }
+
+
+ #endregion
+
+ #region Control Event
+
+ #region 上段ボタン処理
+
+ /// <summary>
+ /// 登録
+ /// </summary>
+ /// <returns></returns>
+ private async Task Save()
+ {
+ await LoadingSpinner.ShowAsync();
+ //m_GroupResv.SetResvNo("R_" + DateTime.Now.ToString("HHmmssfff"));
+
+ //ViewModel.UseInputの全体チェック
+
+ //ViewModel.UseInput→Use(一括でgRPCデータ作成)
+
+ //DB更新へ
+ using DataAccessGrpc.Client.UseAccess useAccess = new(EnvironmentSetting.GrpcChannel);
+ DataResult result = await useAccess.SetDataAsync(Data.Use);
+ await LoadingSpinner.HideAsync();
+ }
+
+ /// <summary>
+ /// 再表示
+ /// </summary>
+ /// <returns></returns>
+ private async Task Refresh()
+ {
+ using DataAccessGrpc.Client.UseAccess useAccess = new(EnvironmentSetting.GrpcChannel);
+ var use = await useAccess.GetDataAsync("52");
+ Console.WriteLine(use.DetailList[0].ResvNo);
+ m_GroupResv.SetResvNo(use.DetailList[0].ResvNo);
+ }
+
+ /// <summary>
+ /// 利用検索
+ /// </summary>
+ private void UseSearch()
+ {
+ Console.WriteLine(Data.GetAutoCode());
+ }
+
+ #endregion
+
+ #region ViewModel Event
+
+ private async Task<bool> ShowList(ViewModel.ValidField sender, ViewModel.ValidEventArgs e)
+ {
+ return await ShowListAction(sender, e);
+ }
+
+ /// <summary>
+ /// 業務チェックを行う
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ /// <returns></returns>
+ private async Task<bool> BusinessValid(ViewModel.ValidField sender, ViewModel.ValidEventArgs e)
+ {
+ try
+ {
+ //e.EnterPush:true→enter, false→mouse
+ if (sender.Name == "ResvNo")
+ {
+ //チェック
+ }
+ else if (sender.Name == "ResvType")
+ {
+ sender.DispText = CConvert.GetEnumDescription<EResvType>(CConvert.ToInt(sender.Text));
+ if(sender.DispText.Length == 0)
+ {
+ sender.Error = true;
+ Message.Show(RenderMessage("該当データが存在しません。"));
+ //sender.ErrorText = "コード存在しません。";
+ return false;
+ }
+ }
+ else if (sender.Name == "GroupType")
+ {
+ sender.DispText = CConvert.GetEnumDescription<EGroupType>(CConvert.ToInt(sender.Text));
+ if(sender.DispText.Length == 0)
+ {
+ sender.Error = true;
+ Message.Show(RenderMessage("該当データが存在しません。"));
+ //sender.ErrorText = "コード存在しません。";
+ return false;
+ }
+ }
+ else if (sender.Name == "RoomID")
+ {
+ //Use.RoomID = CConvert.ToInt(sender.Text);
+ }
+ else if (sender.Name == "SalesLoginID")
+ {
+ sender.DispText = await MasterCore.GetSaleLoginName(CConvert.ToInt(sender.Text));
+ if(sender.DispText.Length == 0)
+ {
+ sender.Error = true;
+ Message.Show(RenderMessage("該当データが存在しません。"));
+ //sender.ErrorText = "コード存在しません。";
+ return false;
+ }
+ }
+ else if (sender.Name == "CinDate")
+ {
+ //Use.CinDate = sender.Text;
+ }
+ else if (sender.Name == "CinTime")
+ {
+ //Use.CinTime = sender.Text;
+ }
+ else if (sender.Name == "Stay")
+ {
+ //Use.Stay = CConvert.ToInt(sender.Text);
+ }
+ else if (sender.Name == "CoutDate")
+ {
+ //Use.CoutDate = sender.Text;
+ }
+ else if (sender.Name == "CoutTime")
+ {
+ //Use.CoutTime = sender.Text;
+ }
+ else if (sender.Name == "GroupName")
+ {
+ //Use.GroupName = sender.Text;
+ }
+ else if (sender.Name == "MemberNo")
+ {
+ //Use.MemberNo = sender.Text;
+ }
+ else if (sender.Name == "Tel")
+ {
+ //Use.Tel = sender.Text;
+ }
+ else if (sender.Name == "TelKind")
+ {
+ //Use.TelKind = sender.Text;
+ }
+ else if (sender.Name == "Name")
+ {
+ //Use.Name = sender.Text;
+ }
+ else if (sender.Name == "Kana")
+ {
+ //Use.Kana = sender.Text;
+ }
+ else if (sender.Name == "ResvName")
+ {
+ //Use.ResvName = sender.Text;
+ }
+ else if (sender.Name == "ResvKana")
+ {
+ //Use.ResvKana = sender.Text;
+ }
+ else if (sender.Name == "ResvTel")
+ {
+ //Use.ResvTel = sender.Text;
+ }
+ else if (sender.Name == "CorpID")
+ {
+ //Use.CorpID = CConvert.ToInt(sender.Text);
+ }
+ else if (sender.Name == "CorpName")
+ {
+ //Use.CorpName = sender.Text;
+ }
+ else if (sender.Name == "CorpKana")
+ {
+ //Use.CorpKana = sender.Text;
+ }
+ else if (sender.Name == "CorpTel")
+ {
+ //Use.CorpTel = sender.Text;
+ }
+ else if (sender.Name == "CorpFax")
+ {
+ //Use.CorpFax = sender.Text;
+ }
+ else if (sender.Name == "ReceiptName")
+ {
+ //Use.ReceiptName = sender.Text;
+ }
+ else if (sender.Name == "AreaID")
+ {
+ //Use.AreaID = CConvert.ToInt(sender.Text);
+ }
+ else if (sender.Name == "CharacterType")
+ {
+ //Use.CharacterType = CConvert.ToInt(sender.Text);
+ }
+ else if (sender.Name == "CustomerRig")
+ {
+ //Use.CustomerRig = CConvert.ToInt(sender.Text);
+ }
+ else if (sender.Name == "AgentID")
+ {
+ //Use.AgentID = CConvert.ToInt(sender.Text);
+ }
+ else if (sender.Name == "AgentBranchID")
+ {
+ //Use.AgentBranchID = CConvert.ToInt(sender.Text);
+ }
+ else if (sender.Name == "PlanID")
+ {
+ //Use.PlanID = CConvert.ToInt(sender.Text);
+ }
+ else if (sender.Name == "RoomAssign")
+ {
+ //Use.RoomAssign = CConvert.ToInt(sender.Text);
+ }
+ else if (sender.Name == "ZipCode")
+ {
+ //Use.ZipCode = sender.Text;
+ }
+ else if (sender.Name == "Prefecture")
+ {
+ //Use.Prefecture = sender.Text;
+ }
+ else if (sender.Name == "Address2")
+ {
+ //Use.Address2 = sender.Text;
+ }
+ else if (sender.Name == "Address3")
+ {
+ //Use.Address3 = sender.Text;
+ }
+ else if (sender.Name == "Address4")
+ {
+ //Use.Address4 = sender.Text;
+ }
+ else if (sender.Name == "Mail")
+ {
+ //Use.Mail = sender.Text;
+ }
+ else if (sender.Name == "PassportNo")
+ {
+ //Use.PassportNo = sender.Text;
+ }
+ else if (sender.Name == "Sex")
+ {
+ //Use.Sex = CConvert.ToInt(sender.Text);
+ }
+ else if (sender.Name == "BirthDay")
+ {
+ //Use.BirthDay = sender.Text;
+ }
+ else if (sender.Name == "Anniversary")
+ {
+ //Use.Anniversary = sender.Text;
+ }
+ else if (sender.Name == "CorpZipCode")
+ {
+ //Use.CorpZipCode = sender.Text;
+ }
+ else if (sender.Name == "CorpPrefecture")
+ {
+ //Use.CorpPrefecture = sender.Text;
+ }
+ else if (sender.Name == "CorpAddress2")
+ {
+ //Use.CorpAddress2 = sender.Text;
+ }
+ else if (sender.Name == "CorpAddress3")
+ {
+ //Use.CorpAddress3 = sender.Text;
+ }
+ else if (sender.Name == "CorpAddress4")
+ {
+ //Use.CorpAddress4 = sender.Text;
+ }
+ else if (sender.Name == "CorpMemo")
+ {
+ //Use.CorpMemo = sender.Text;
+ }
+ else if (sender.Name == "Memo")
+ {
+ //Use.Memo = sender.Text;
+ }
+ else if (sender.Name == "Remark")
+ {
+ //Use.Remark = sender.Text;
+ }
+
+ //データ設定
+ if (!e.IsAll) { Data.SetDataField(sender); }
+
+ sender.Error = false;
+ sender.ErrorText = string.Empty;
+ //StateHasChanged();
+ return true;
+ }
+ catch(Exception ex)
+ {
+ EnvironmentSetting.Debug($"BusinessValid:{ex.Message}");
+ if (e.EnterPush)
+ {
+ sender.Error = true;
+ sender.ErrorText = ex.Message;
+ }
+ else
+ {
+ sender.Error = false;
+ sender.ErrorText = string.Empty;
+ }
+ return false;
+ }
+ finally
+ {
+ StateHasChanged();
+ }
+ }
+
+ /// <summary>
+ /// フォーカスを移動
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ /// <returns></returns>
+ private async Task<bool> BeforeAutoNextFocus(ViewModel.ValidField sender, ViewModel.ValidEventArgs e)
+ {
+ if (sender.Index == Data.Fields.Count - 1 && e.EnterPush)
+ {
+ await btnSave.FocusAsync(); //ここから非同期処理
+ return false;
+ }
+ return true;
+ }
+
+ /// <summary>
+ /// データ一覧取得
+ /// コード、名称
+ /// </summary>
+ /// <param name="type"></param>
+ /// <returns></returns>
+ private async Task<DataTable> GetListData(string type)
+ {
+ if (type == "ResvType") { return CConvert.GetEnumTypeList<EResvType>(); }
+ else if (type == "GroupType") { return CConvert.GetEnumTypeList<EGroupType>(); }
+ else if (type == "SalesLoginID") { return await MasterCore.GetSalesLoginList(); }
+ else { return null; }
+ }
+
+ /// <summary>
+ /// Endキー
+ /// </summary>
+ /// <param name="item"></param>
+ private async Task<bool> ShowListAction(ViewModel.ValidField item, ViewModel.ValidEventArgs e)
+ {
+ if (item.Name == "ResvType" || item.Name == "GroupType" || item.Name == "SalesLoginID")
+ {
+ if (item.Text.Length == 0) { return false; }
+ using DataTable data = await GetListData(item.Name);
+ if (data.Rows.Count == 0) { return false; }
+ var parameters = new DialogParameters { ["Data"] = data };
+ var dialog = DialogService.Show<SelectList>($"{item.Caption}検索", parameters);
+ var ret = await dialog.Result;
+ if (!ret.Cancelled)
+ {
+ var row = ret.Data as DataRow;
+ item.Text = row[0].ToString();
+ item.DispText = row[1].ToString();
+ e.Cancel = false;
+ StateHasChanged();
+ }
+ else
+ {
+ e.Cancel = true;
+ }
+ }
+ else if (item.Name == "CinDate" || item.Name == "CoutDate")
+ {
+ var parameters = new DialogParameters { ["Title"] = $"{item.Caption}選択", ["Data"] = CConvert.ToDateTime(item.Text) };
+ var dialog = DialogService.Show<SelectDate>(string.Empty, parameters);
+ var ret = await dialog.Result;
+ if (!ret.Cancelled)
+ {
+ EnvironmentSetting.Debug(ret.Data.ToString());
+ item.Text = ret.Data.ToString();
+ StateHasChanged();
+ }
+ }
+ else
+ {
+ //await DialogService.ShowMessageBox(
+ // "Warning",
+ // "未実装!",
+ // yesText: "OK", cancelText: "Cancel");
+ }
+ return true;
+ }
+
+ #endregion
+
+ #endregion
+
+ #region Private Method
+ #endregion
+
+ #region public Method
+ #endregion
+
+ //↓メモ
+ private class TabView
+ {
+ public String Name { get; set; }
+ public String Content { get; set; }
+ public Guid Id { get; set; }
+ }
+
+ private List<TabView> _tabs = new();
+ private int _index = 0;
+ private bool _updateIndex = false;
+
+ private void AddTabCallback()
+ {
+ _tabs.Add(new TabView { Name = "Dynamic Content", Content = "A new tab", Id = Guid.NewGuid() });
+ //the tab becomes available after it is rendered. Hence, we can't set the index here
+ _updateIndex = true;
+ }
+
+ private void CloseTabCallback(MudTabPanel panel)
+ {
+ var tabView = _tabs.FirstOrDefault(x => x.Id == (Guid)panel.Tag);
+ if(tabView != null)
+ {
+ _tabs.Remove(tabView);
+ }
+ }
+
+ private void Restore()
+ {
+ _tabs.Clear();
+ _tabs.Add(new TabView { Content = "First tab content", Name = "Tab A", Id = Guid.NewGuid() });
+ _tabs.Add(new TabView { Content = "Second tab content", Name = "Tab B", Id = Guid.NewGuid() });
+ _tabs.Add(new TabView { Content = "Third tab content", Name = "Tab C", Id = Guid.NewGuid() });
+ }
+ //↑メモ
+
+ private SaleInputRow selectedItem1 = null;
+ private List<string> editEvents = new();
+ private string searchString = "";
+
+ private int selRow = 0;
+ private int selectedRowNumber = -1;
+ private MudTable<UseRoomRow> mudUseRoomTable;
+
+ private void Leave()
+ {
+ //EnvironmentSetting.Debug($"Leave:{e.Type}");
+ }
+
+ private void Enter()
+ {
+ //EnvironmentSetting.Debug($"Enter:{e.Type}");
+ }
+
+ private void KeyDown()
+ {
+ //EnvironmentSetting.Debug($"KeyDown:{e.Key}");
+ }
+
+ private void KeyPress()
+ {
+ //EnvironmentSetting.Debug($"KeyPress:{e.Key}");
+ }
+
+
+
+ /// <summary>
+ /// Select前
+ /// </summary>
+ /// <param name="tableRowClickEventArgs"></param>
+ private void RowClickEvent(TableRowClickEventArgs<UseRoomRow> tableRowClickEventArgs)
+ {
+ EnvironmentSetting.Debug($"RowClickEvent:{tableRowClickEventArgs.Item.RoomID}");
+ //StateHasChanged();
+ }
+
+ private string SelectedRowClassFunc(UseRoomRow element, int rowNumber)
+ {
+ EnvironmentSetting.Debug($"SelectedRowClassFunc:{rowNumber}");
+ //if (selectedRowNumber == rowNumber)
+ //{
+ // selRow = rowNumber;
+ // selectedRowNumber = -1;
+ // return string.Empty;
+ //}
+ //else
+ if (mudUseRoomTable.SelectedItem != null && mudUseRoomTable.SelectedItem.Equals(element))
+ {
+ selRow = rowNumber;
+ selectedRowNumber = rowNumber;
+ return "selected";
+ }
+ else
+ {
+ return string.Empty;
+ }
+ }
+
+ private void ClearEventLog()
+ {
+ editEvents.Clear();
+ }
+
+ private void AddEditionEvent(string message)
+ {
+ editEvents.Add(message);
+ StateHasChanged();
+ }
+
+ private void BackupItem(object element)
+ {
+ //AddEditionEvent($"RowEditPreview event: made a backup of Element {((SaleInputRow)element).ItemName}");
+ }
+
+ private void ItemHasBeenCommitted(object element)
+ {
+ //AddEditionEvent($"RowEditCommit event: Changes to Element {((SaleInputRow)element).ItemName} committed");
+ }
+
+ private void ResetItemToOriginalValues(object element)
+ {
+ //AddEditionEvent($"RowEditCancel event: Editing of Element {((SaleInputRow)element).ItemName} cancelled");
+ }
+
+ private async void CallBackShowList(ViewModel.ValidField sender)
+ {
+ await ShowListAction(sender, new ViewModel.ValidEventArgs());
+ }
+
+ private void CreateFakeData()
+ {
+ List<SaleInputRow> list = new List<SaleInputRow>();
+ var slip = new SaleInputRow();
+ slip.Cells[(int)SaleInputRow.ColType.RoomType].Text = "SA";
+ slip.Cells[(int)SaleInputRow.ColType.RoomID].Text = "101";
+ slip.Cells[(int)SaleInputRow.ColType.ItemName].Text = "宿泊基本料金";
+ slip.Cells[(int)SaleInputRow.ColType.UnitPrice].Text = "10,000";
+ slip.Cells[(int)SaleInputRow.ColType.PersonCount].Text = "1";
+ slip.Cells[(int)SaleInputRow.ColType.Woman].Text = "1";
+ slip.Cells[(int)SaleInputRow.ColType.DiscountSummary].Text = "0";
+ slip.Cells[(int)SaleInputRow.ColType.TotalSummary].Text = "10,000";
+ slip.Cells[(int)SaleInputRow.ColType.SumDate].Text = CConvert.ToDateString(DateTime.Now);
+ slip.Cells[(int)SaleInputRow.ColType.Page].Text = "1";
+ slip.Cells[(int)SaleInputRow.ColType.SortKey].Text = "1";
+ slip.DataList.Add(new());
+ list.Add(slip);
+
+ //空白行
+ slip = new SaleInputRow();
+ list.Add(slip);
+ Data.SaleList = list;
+ }
+
+ private void RefreshSaleInput()
+ {
+ StateHasChanged();
+ }
+
+ private void RoomTypeChange()
+ {
+ saleInput.Refresh("RoomTypeChange");
+ }
+
+ private void TabChanged(int index)
+ {
+
+ }
+}
diff --git a/HotelPms.Client.Blazor/Pages/UseDetail/OtherInfo.razor b/HotelPms.Client.Blazor/Pages/UseDetail/OtherInfo.razor
new file mode 100644
index 0000000..a52e960
--- /dev/null
+++ b/HotelPms.Client.Blazor/Pages/UseDetail/OtherInfo.razor
@@ -0,0 +1,291 @@
+@using System.ComponentModel.DataAnnotations
+@using System.Text.RegularExpressions
+@using System.Reflection
+@using HotelPms.Client.Blazor.ViewModel
+@using HotelPms.Data.Common
+@using HotelPms.Data.Common.Interface.Master
+@using HotelPms.DataAccessGrpc.Client
+@using HotelPms.Share.IO
+@using HotelPms.Share.Util
+@using ViewModel = HotelPms.Client.Blazor.ViewModel
+@using static HotelPms.Client.Blazor.Util.SystemEnum
+@inject IJSRuntime JSRuntime
+
+<MudCard Style="@Style" Elevation="6">
+ <MudCardHeader Class="mb-0 pb-0">
+ <CardHeaderContent>
+ <MudText Typo="Typo.body1">その他</MudText>
+ </CardHeaderContent>
+ <CardHeaderActions>
+ <MudIconButton Icon="@Icons.Material.Filled.Help" Color="MudBlazor.Color.Default" Title="Help" />
+ </CardHeaderActions>
+ </MudCardHeader>
+ <MudCardContent Class="mt-0 pt-0 mb-0 pb-0">
+ <MudGrid Spacing="3" Justify="Justify.FlexStart" Class="align-center mt-0 pt-0 mb-0 pb-0">
+ @foreach (var field in Data.GetGroup(ViewModel.UseInput.GroupKey.Other))
+ {
+ EnvironmentSetting.Debug($"Index={field.Index},Text={field.Text},Error={field.Error},ErrorText={field.ErrorText}");
+ if (field.DispNameEnabled)
+ {
+ <MudItem lg="@field.WidthUnit" Class="@rowSpaceStyle">
+ <MudGrid Spacing="0" Justify="Justify.FlexStart" Class="align-center mt-0 pt-0 mb-0 pb-0">
+ <MudItem xs="@(12 - field.DispWidthUnit)" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudTextField Class="input-pink" @bind-Value="field.Text" Error="@field.Error" ErrorText="@field.ErrorText" @ref="field.Ref" T="string" Label="@field.Caption"
+ AutoFocus="@(field.Index == 0)" Margin="Margin.Dense" MaxLength="@field.MaxLenth" Disabled="@field.Disabled" ReadOnly="@field.ReadOnly"
+ id="@($"{Data.ID}-{field.Index}")" data-guid="@Data.ID" data-valid-index="@field.Index" data-valid-name="@field.Name" data-valid-org-text="@field.OrgText" data-valid-text="@field.Text"
+ data-valid-input-char="@((int)field.InputChar)" data-valid-show-style="@((int)field.ShowStyle)" data-valid-thousand-format="@field.ThousandFormat"/>
+ </MudItem>
+ <MudItem xs="@field.DispWidthUnit" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudField Margin="Margin.Dense">@field.DispText</MudField>
+ </MudItem>
+ </MudGrid>
+ </MudItem>
+ }
+ else
+ {
+ <MudItem lg="@field.WidthUnit" Class="@rowSpaceStyle">
+ <MudTextField @bind-Value="field.Text" Error="@field.Error" ErrorText="@field.ErrorText" @ref="field.Ref" T="string" Label="@field.Caption"
+ AutoFocus="@(field.Index == 0)" Margin="Margin.Dense" MaxLength="@field.MaxLenth" Disabled="@field.Disabled" ReadOnly="@field.ReadOnly"
+ id="@($"{Data.ID}-{field.Index}")" data-guid="@Data.ID" data-valid-index="@field.Index" data-valid-name="@field.Name" data-valid-org-text="@field.OrgText" data-valid-text="@field.Text"
+ data-valid-input-char="@((int)field.InputChar)" data-valid-show-style="@((int)field.ShowStyle)" data-valid-thousand-format="@field.ThousandFormat"/>
+ </MudItem>
+ }
+ }
+ </MudGrid>
+ </MudCardContent>
+</MudCard>
+
+@*<style>
+ /* 伪类选择器 :focus-within */
+ /* 它表示一个元素获得焦点,或,该元素的后代元素获得焦点。划重点,它或它的后代获得焦点。 */
+ /* 这也就意味着,它或它的后代获得焦点,都可以触发 :focus-within。 */
+ .focus-button:focus-within {
+ border: 1px solid;
+ border-color: #00FF00;
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(0, 255, 0, 0.6);
+ -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(0, 255, 0, 0.6);
+ box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.075), 0px 0px 8px rgba(0, 255, 0, 0.6);
+ }
+</style>
+*@
+
+@code {
+ [Inject] private IDialogService DialogService { get; set; }
+ [Inject] private GrpcChannel Channel { get; set; }
+ [CascadingParameter] MudDialogInstance MudDialog { get; set; }
+ [Parameter] public ViewModel.UseInput? Data { get; set; }
+ [Parameter] public EventCallback<ValidField> ParentShowList { get; set; }
+ [Parameter] public string Style { get; set; }
+
+ private string errorAll = string.Empty;
+ private MudButton btnSave;
+ private string rowSpaceStyle = "mt-2 pt-0 mb-0 pb-0";
+
+ protected override void OnInitialized()
+ {
+ //Data.Refresh = new Action(StateHasChanged); //メイン画面の更新
+ //Data.BeforeAutoNextFocus += BeforeAutoNextFocus;
+ //Data.BusinessValid += BusinessValid;
+ //Data.ShowList += ShowList;
+ }
+
+ private async void ShowList(ValidField sender, ValidEventArgs e)
+ {
+ await ParentShowList.InvokeAsync(sender);
+ //await ShowListAction(sender);
+ }
+
+ /// <summary>
+ /// 業務チェックを行う
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ /// <returns></returns>
+ private async Task<bool> BusinessValid(ValidField sender, ValidEventArgs e)
+ {
+ if (sender.Name == "ID")
+ {
+ using (BuildingAccess access = new BuildingAccess(Channel))
+ {
+ bool ret = await access.ExistsAsync(CConvert.ToInt(e.Text));
+ EnvironmentSetting.Debug($"access.Exists:{ret}");
+ if(Data.EditMode == (int)EMasterEditStatus.Create && ret)
+ {
+ if (e.EnterPush)
+ {
+ sender.Error = true;
+ sender.ErrorText = "当該データが既に存在します。";
+ }
+ else
+ {
+ sender.Error = false;
+ sender.ErrorText = string.Empty;
+ }
+ //StateHasChanged();
+ return false;
+ }
+ else if(Data.EditMode == (int)EMasterEditStatus.Update && !ret)
+ {
+ if (e.EnterPush)
+ {
+ sender.Error = true;
+ sender.ErrorText = "当該データが存在しません。";
+ }
+ else
+ {
+ sender.Error = false;
+ sender.ErrorText = string.Empty;
+ }
+ //StateHasChanged();
+ return false;
+ }
+ }
+ }
+
+ sender.Error = false;
+ sender.ErrorText = string.Empty;
+ //StateHasChanged();
+ return true;
+ }
+
+ /// <summary>
+ /// フォーカスを移動
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ /// <returns></returns>
+ private async Task<bool> BeforeAutoNextFocus(ValidField sender, ValidEventArgs e)
+ {
+ if (sender.Index == Data.Fields.Count - 1 && e.EnterPush)
+ {
+ await btnSave.FocusAsync(); //ここから非同期処理
+ return false;
+ }
+ return true;
+ }
+
+ /// <summary>
+ /// Endキー
+ /// </summary>
+ /// <param name="item"></param>
+ private async Task ShowListAction(ViewModel.ValidField item)
+ {
+ if (item.Name == "ZipCode")
+ {
+ if(item.Text.Length == 0) { return; }
+ using (DataTable data = await HotelPms.DataAccessGrpc.Client.AddressAccess.GetPostNoSearch(Channel, item.Text))
+ {
+ if (data.Rows.Count == 0)
+ {
+ await DialogService.ShowMessageBox($"{item.Caption}検索","該当データがありません。",yesText: "OK");
+ return;
+ }
+
+ if (data.Rows.Count > 1000)
+ {
+ await DialogService.ShowMessageBox($"{item.Caption}検索","対象データが1000件以上超えていますので、更に条件を調整してください。",yesText: "OK");
+ return;
+ }
+
+ var parameters = new DialogParameters { ["Data"] = data };
+ var dialog = DialogService.Show<SelectList>($"{item.Caption}検索", parameters);
+ var ret = await dialog.Result;
+ if (!ret.Cancelled)
+ {
+ var row = ret.Data as DataRow;
+ item.Text = row[0].ToString();
+ Data.GetField("Address2").Text = row[1].ToString();
+ StateHasChanged();
+ }
+ }
+ }
+ else if (item.Name == "Address2")
+ {
+ if(item.Text.Length == 0) { return; }
+ using (DataTable data = await HotelPms.DataAccessGrpc.Client.AddressAccess.GetAddressSearch(Channel, item.Text))
+ {
+ if (data.Rows.Count == 0)
+ {
+ await DialogService.ShowMessageBox($"{item.Caption}検索","該当データがありません。",yesText: "OK");
+ return;
+ }
+
+ if (data.Rows.Count > 1000)
+ {
+ await DialogService.ShowMessageBox($"{item.Caption}検索","対象データが1000件以上超えていますので、更に条件を調整してください。",yesText: "OK");
+ return;
+ }
+
+ var parameters = new DialogParameters { ["Data"] = data };
+ var dialog = DialogService.Show<SelectList>($"{item.Caption}検索", parameters);
+ var ret = await dialog.Result;
+ if (!ret.Cancelled)
+ {
+ var row = ret.Data as DataRow;
+ Data.GetField("ZipCode").Text = row[0].ToString();
+ item.Text = row[1].ToString();
+ StateHasChanged();
+ }
+ }
+ }
+ else
+ {
+ await DialogService.ShowMessageBox(
+ "Warning",
+ "未実装!",
+ yesText: "OK", cancelText: "Cancel");
+ }
+ }
+
+ /// <summary>
+ /// 画面閉じる
+ /// </summary>
+ private void Close()
+ {
+ MudDialog.Cancel();
+ }
+
+ public void SetResvNo(string no)
+ {
+ Data.GetField("ResvNo").Text = no;
+ StateHasChanged();
+ }
+
+ /// <summary>
+ /// 保存
+ /// </summary>
+ private async void Save()
+ {
+ if (!await Data.IsValidAll())
+ {
+ //errorAll = Data.ErrText;
+ return;
+ }
+
+ //データ保存
+ using (BuildingAccess access = new BuildingAccess(Channel))
+ {
+ HotelPms.Data.Master.Building item = new HotelPms.Data.Master.Building()
+ {
+ ID = CConvert.ToInt(Data.GetField("ID").Text),
+ Name = Data.GetField("Name").Text,
+ ShortName = Data.GetField("ShortName").Text,
+ ZipCode = Data.GetField("ZipCode").Text,
+ Tel = Data.GetField("Tel").Text,
+ Fax = Data.GetField("Fax").Text,
+ Address2 = Data.GetField("Address2").Text,
+ };
+ //IMaster im = item as IMaster;
+
+ var result = Data.EditMode == (int)EMasterEditStatus.Create ? await access.AddAsync(item) : await access.UpdateAsync(item);
+ if(result.ErrNo != 0)
+ {
+ errorAll = $"更新に失敗しました。";
+ OperationLog.Instance.WriteLog($"Building.Save:{result.ErrNo}.{result.ErrData}");
+ return;
+ }
+ }
+
+ MudDialog.Close(DialogResult.Ok(Data));
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.Client.Blazor/Pages/UseDetail/PersonInfo.razor b/HotelPms.Client.Blazor/Pages/UseDetail/PersonInfo.razor
new file mode 100644
index 0000000..8c425a4
--- /dev/null
+++ b/HotelPms.Client.Blazor/Pages/UseDetail/PersonInfo.razor
@@ -0,0 +1,297 @@
+@using System.ComponentModel.DataAnnotations
+@using System.Text.RegularExpressions
+@using System.Reflection
+@using HotelPms.Client.Blazor.ViewModel
+@using HotelPms.Data.Common
+@using HotelPms.Data.Common.Interface.Master
+@using HotelPms.DataAccessGrpc.Client
+@using HotelPms.Share.IO
+@using HotelPms.Share.Util
+@using ViewModel = HotelPms.Client.Blazor.ViewModel
+@using static HotelPms.Client.Blazor.Util.SystemEnum
+@inject IJSRuntime JSRuntime
+
+<MudCard Style="@Style" Elevation="6">
+ <MudCardHeader Class="mb-0 pb-0">
+ <CardHeaderAvatar>
+ <MudTooltip Text="顧客割当" Color="MudBlazor.Color.Tertiary" Placement="Placement.Top" Arrow="true">
+ <MudAvatar Color="MudBlazor.Color.Secondary">済</MudAvatar>
+ </MudTooltip>
+ </CardHeaderAvatar>
+ <CardHeaderContent>
+ <MudText Typo="Typo.body1">個人情報</MudText>
+ </CardHeaderContent>
+ <CardHeaderActions>
+ <MudIconButton Icon="@Icons.Material.Filled.Search" Color="MudBlazor.Color.Default" Title="顧客検索" />
+ <MudIconButton Icon="@Icons.Material.Filled.Cancel" Color="MudBlazor.Color.Default" Title="顧客解除" />
+ </CardHeaderActions>
+ </MudCardHeader>
+ <MudCardContent Class="mt-0 pt-0 mb-0 pb-0">
+ <MudGrid Spacing="3" Justify="Justify.FlexStart" Class="align-center mt-0 pt-0 mb-0 pb-0">
+ @foreach (var field in Data.GetGroup(ViewModel.UseInput.GroupKey.Person))
+ {
+ EnvironmentSetting.Debug($"Index={field.Index},Text={field.Text},Error={field.Error},ErrorText={field.ErrorText}");
+ if (field.DispNameEnabled)
+ {
+ <MudItem lg="@field.WidthUnit" Class="@rowSpaceStyle">
+ <MudGrid Spacing="0" Justify="Justify.FlexStart" Class="align-center mt-0 pt-0 mb-0 pb-0">
+ <MudItem xs="@(12 - field.DispWidthUnit)" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudTextField Class="input-pink" @bind-Value="field.Text" Error="@field.Error" ErrorText="@field.ErrorText" @ref="field.Ref" T="string" Label="@field.Caption"
+ AutoFocus="@(field.Index == 0)" Margin="Margin.Dense" MaxLength="@field.MaxLenth" Disabled="@field.Disabled" ReadOnly="@field.ReadOnly"
+ id="@($"{Data.ID}-{field.Index}")" data-guid="@Data.ID" data-valid-index="@field.Index" data-valid-name="@field.Name" data-valid-org-text="@field.OrgText" data-valid-text="@field.Text"
+ data-valid-input-char="@((int)field.InputChar)" data-valid-show-style="@((int)field.ShowStyle)" data-valid-thousand-format="@field.ThousandFormat"/>
+ </MudItem>
+ <MudItem xs="@field.DispWidthUnit" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudField Margin="Margin.Dense">@field.DispText</MudField>
+ </MudItem>
+ </MudGrid>
+ </MudItem>
+ }
+ else
+ {
+ <MudItem lg="@field.WidthUnit" Class="@rowSpaceStyle">
+ <MudTextField Class="@(field.ShowStyle == EShowStyle.ShowList ? "input-pink" : string.Empty)" @bind-Value="field.Text" Error="@field.Error" ErrorText="@field.ErrorText" @ref="field.Ref" T="string" Label="@field.Caption"
+ AutoFocus="@(field.Index == 0)" Margin="Margin.Dense" MaxLength="@field.MaxLenth" Disabled="@field.Disabled" ReadOnly="@field.ReadOnly"
+ id="@($"{Data.ID}-{field.Index}")" data-guid="@Data.ID" data-valid-index="@field.Index" data-valid-name="@field.Name" data-valid-org-text="@field.OrgText" data-valid-text="@field.Text"
+ data-valid-input-char="@((int)field.InputChar)" data-valid-show-style="@((int)field.ShowStyle)" data-valid-thousand-format="@field.ThousandFormat"/>
+ </MudItem>
+ }
+ }
+ </MudGrid>
+ </MudCardContent>
+</MudCard>
+
+@*<style>
+ /* 伪类选择器 :focus-within */
+ /* 它表示一个元素获得焦点,或,该元素的后代元素获得焦点。划重点,它或它的后代获得焦点。 */
+ /* 这也就意味着,它或它的后代获得焦点,都可以触发 :focus-within。 */
+ .focus-button:focus-within {
+ border: 1px solid;
+ border-color: #00FF00;
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(0, 255, 0, 0.6);
+ -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(0, 255, 0, 0.6);
+ box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.075), 0px 0px 8px rgba(0, 255, 0, 0.6);
+ }
+</style>
+*@
+
+@code {
+ [Inject] private IDialogService DialogService { get; set; }
+ [Inject] private GrpcChannel Channel { get; set; }
+ [CascadingParameter] MudDialogInstance MudDialog { get; set; }
+ [Parameter] public ViewModel.UseInput? Data { get; set; }
+ [Parameter] public EventCallback<ValidField> ParentShowList { get; set; }
+ [Parameter] public string Style { get; set; }
+
+ private string errorAll = string.Empty;
+ private MudButton btnSave;
+ private string rowSpaceStyle = "mt-2 pt-0 mb-0 pb-0";
+
+ protected override void OnInitialized()
+ {
+ //Data.Refresh = new Action(StateHasChanged); //メイン画面の更新
+ //Data.BeforeAutoNextFocus += BeforeAutoNextFocus;
+ //Data.BusinessValid += BusinessValid;
+ //Data.ShowList += ShowList;
+ }
+
+ private async void ShowList(ValidField sender, ValidEventArgs e)
+ {
+ await ParentShowList.InvokeAsync(sender);
+ //await ShowListAction(sender);
+ }
+
+ /// <summary>
+ /// 業務チェックを行う
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ /// <returns></returns>
+ private async Task<bool> BusinessValid(ValidField sender, ValidEventArgs e)
+ {
+ if (sender.Name == "ID")
+ {
+ using (BuildingAccess access = new BuildingAccess(Channel))
+ {
+ bool ret = await access.ExistsAsync(CConvert.ToInt(e.Text));
+ EnvironmentSetting.Debug($"access.Exists:{ret}");
+ if(Data.EditMode == (int)EMasterEditStatus.Create && ret)
+ {
+ if (e.EnterPush)
+ {
+ sender.Error = true;
+ sender.ErrorText = "当該データが既に存在します。";
+ }
+ else
+ {
+ sender.Error = false;
+ sender.ErrorText = string.Empty;
+ }
+ //StateHasChanged();
+ return false;
+ }
+ else if(Data.EditMode == (int)EMasterEditStatus.Update && !ret)
+ {
+ if (e.EnterPush)
+ {
+ sender.Error = true;
+ sender.ErrorText = "当該データが存在しません。";
+ }
+ else
+ {
+ sender.Error = false;
+ sender.ErrorText = string.Empty;
+ }
+ //StateHasChanged();
+ return false;
+ }
+ }
+ }
+
+ sender.Error = false;
+ sender.ErrorText = string.Empty;
+ //StateHasChanged();
+ return true;
+ }
+
+ /// <summary>
+ /// フォーカスを移動
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ /// <returns></returns>
+ private async Task<bool> BeforeAutoNextFocus(ValidField sender, ValidEventArgs e)
+ {
+ if (sender.Index == Data.Fields.Count - 1 && e.EnterPush)
+ {
+ await btnSave.FocusAsync(); //ここから非同期処理
+ return false;
+ }
+ return true;
+ }
+
+ /// <summary>
+ /// Endキー
+ /// </summary>
+ /// <param name="item"></param>
+ private async Task ShowListAction(ViewModel.ValidField item)
+ {
+ if (item.Name == "ZipCode")
+ {
+ if(item.Text.Length == 0) { return; }
+ using (DataTable data = await HotelPms.DataAccessGrpc.Client.AddressAccess.GetPostNoSearch(Channel, item.Text))
+ {
+ if (data.Rows.Count == 0)
+ {
+ await DialogService.ShowMessageBox($"{item.Caption}検索","該当データがありません。",yesText: "OK");
+ return;
+ }
+
+ if (data.Rows.Count > 1000)
+ {
+ await DialogService.ShowMessageBox($"{item.Caption}検索","対象データが1000件以上超えていますので、更に条件を調整してください。",yesText: "OK");
+ return;
+ }
+
+ var parameters = new DialogParameters { ["Data"] = data };
+ var dialog = DialogService.Show<SelectList>($"{item.Caption}検索", parameters);
+ var ret = await dialog.Result;
+ if (!ret.Cancelled)
+ {
+ var row = ret.Data as DataRow;
+ item.Text = row[0].ToString();
+ Data.GetField("Address2").Text = row[1].ToString();
+ StateHasChanged();
+ }
+ }
+ }
+ else if (item.Name == "Address2")
+ {
+ if(item.Text.Length == 0) { return; }
+ using (DataTable data = await HotelPms.DataAccessGrpc.Client.AddressAccess.GetAddressSearch(Channel, item.Text))
+ {
+ if (data.Rows.Count == 0)
+ {
+ await DialogService.ShowMessageBox($"{item.Caption}検索","該当データがありません。",yesText: "OK");
+ return;
+ }
+
+ if (data.Rows.Count > 1000)
+ {
+ await DialogService.ShowMessageBox($"{item.Caption}検索","対象データが1000件以上超えていますので、更に条件を調整してください。",yesText: "OK");
+ return;
+ }
+
+ var parameters = new DialogParameters { ["Data"] = data };
+ var dialog = DialogService.Show<SelectList>($"{item.Caption}検索", parameters);
+ var ret = await dialog.Result;
+ if (!ret.Cancelled)
+ {
+ var row = ret.Data as DataRow;
+ Data.GetField("ZipCode").Text = row[0].ToString();
+ item.Text = row[1].ToString();
+ StateHasChanged();
+ }
+ }
+ }
+ else
+ {
+ await DialogService.ShowMessageBox(
+ "Warning",
+ "未実装!",
+ yesText: "OK", cancelText: "Cancel");
+ }
+ }
+
+ /// <summary>
+ /// 画面閉じる
+ /// </summary>
+ private void Close()
+ {
+ MudDialog.Cancel();
+ }
+
+ public void SetResvNo(string no)
+ {
+ Data.GetField("ResvNo").Text = no;
+ StateHasChanged();
+ }
+
+ /// <summary>
+ /// 保存
+ /// </summary>
+ private async void Save()
+ {
+ if (!await Data.IsValidAll())
+ {
+ //errorAll = Data.ErrText;
+ return;
+ }
+
+ //データ保存
+ using (BuildingAccess access = new BuildingAccess(Channel))
+ {
+ HotelPms.Data.Master.Building item = new HotelPms.Data.Master.Building()
+ {
+ ID = CConvert.ToInt(Data.GetField("ID").Text),
+ Name = Data.GetField("Name").Text,
+ ShortName = Data.GetField("ShortName").Text,
+ ZipCode = Data.GetField("ZipCode").Text,
+ Tel = Data.GetField("Tel").Text,
+ Fax = Data.GetField("Fax").Text,
+ Address2 = Data.GetField("Address2").Text,
+ };
+ //IMaster im = item as IMaster;
+
+ var result = Data.EditMode == (int)EMasterEditStatus.Create ? await access.AddAsync(item) : await access.UpdateAsync(item);
+ if(result.ErrNo != 0)
+ {
+ errorAll = $"更新に失敗しました。";
+ OperationLog.Instance.WriteLog($"Building.Save:{result.ErrNo}.{result.ErrData}");
+ return;
+ }
+ }
+
+ MudDialog.Close(DialogResult.Ok(Data));
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.Client.Blazor/Pages/UseDetail/ResvInfo.razor b/HotelPms.Client.Blazor/Pages/UseDetail/ResvInfo.razor
new file mode 100644
index 0000000..4ae1f88
--- /dev/null
+++ b/HotelPms.Client.Blazor/Pages/UseDetail/ResvInfo.razor
@@ -0,0 +1,81 @@
+@using System.ComponentModel.DataAnnotations
+@using System.Text.RegularExpressions
+@using System.Reflection
+@using HotelPms.Client.Blazor.ViewModel
+@using HotelPms.Data.Common
+@using HotelPms.Data.Common.Interface.Master
+@using HotelPms.DataAccessGrpc.Client
+@using HotelPms.Share.IO
+@using HotelPms.Share.Util
+@using ViewModel = HotelPms.Client.Blazor.ViewModel
+@using static HotelPms.Client.Blazor.Util.SystemEnum
+@inject IJSRuntime JSRuntime
+
+<MudCard Style="@Style" Elevation="6">
+ <MudCardHeader Class="mb-0 pb-0">
+ <CardHeaderContent>
+ <MudText Typo="Typo.body1">予約情報</MudText>
+ </CardHeaderContent>
+ <CardHeaderActions>
+ <MudIconButton Icon="@Icons.Material.Filled.HomeRepairService" Color="MudBlazor.Color.Default" />
+ </CardHeaderActions>
+ </MudCardHeader>
+ <MudCardContent Class="mt-0 pt-0 mb-0 pb-0">
+ <MudGrid Spacing="3" Justify="Justify.FlexStart" Class="align-center mt-0 pt-0 mb-0 pb-0">
+ @foreach (var field in Data.GetGroup(ViewModel.UseInput.GroupKey.Resv))
+ {
+ EnvironmentSetting.Debug($"Index={field.Index},Text={field.Text},Error={field.Error},ErrorText={field.ErrorText}");
+ if (field.DispNameEnabled)
+ {
+ <MudItem lg="@field.WidthUnit" Class="@RowSpaceStyle">
+ <MudGrid Spacing="0" Justify="Justify.FlexStart" Class="align-center mt-0 pt-0 mb-0 pb-0">
+ <MudItem xs="@(12 - field.DispWidthUnit)" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudTextField Class="input-pink" @bind-Value="field.Text" Error="@field.Error" ErrorText="@field.ErrorText" @ref="field.Ref" T="string" Label="@field.Caption"
+ AutoFocus="@(field.Index == 0)" Margin="Margin.Dense" MaxLength="@field.MaxLenth" Disabled="@field.Disabled" ReadOnly="@field.ReadOnly"
+ id="@($"{Data.ID}-{field.Index}")" data-guid="@Data.ID" data-valid-index="@field.Index" data-valid-name="@field.Name" data-valid-org-text="@field.OrgText" data-valid-text="@field.Text"
+ data-valid-input-char="@((int)field.InputChar)" data-valid-show-style="@((int)field.ShowStyle)" data-valid-thousand-format="@field.ThousandFormat"/>
+ </MudItem>
+ <MudItem xs="@field.DispWidthUnit" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudField Margin="Margin.Dense">@field.DispText</MudField>
+ </MudItem>
+ </MudGrid>
+ </MudItem>
+ }
+ else
+ {
+ <MudItem lg="@field.WidthUnit" Class="@RowSpaceStyle">
+ <MudTextField Class="@(field.InputStyle == EInputStyle.Date ? "input-pink" : string.Empty)" @bind-Value="field.Text" Error="@field.Error" ErrorText="@field.ErrorText" @ref="field.Ref" T="string" Label="@field.Caption"
+ AutoFocus="@(field.Index == 0)" Margin="Margin.Dense" MaxLength="@field.MaxLenth" Disabled="@field.Disabled" ReadOnly="@field.ReadOnly"
+ id="@($"{Data.ID}-{field.Index}")" data-guid="@Data.ID" data-valid-index="@field.Index" data-valid-name="@field.Name" data-valid-org-text="@field.OrgText" data-valid-text="@field.Text"
+ data-valid-input-char="@((int)field.InputChar)" data-valid-show-style="@((int)field.ShowStyle)" data-valid-thousand-format="@field.ThousandFormat"/>
+ </MudItem>
+
+ if (field.NewLine)
+ {
+ <MudItem xs="@(12 - field.WidthUnit)"></MudItem>
+ }
+ }
+ }
+ </MudGrid>
+ </MudCardContent>
+</MudCard>
+
+@code {
+ [Parameter] public ViewModel.UseInput? Data { get; set; }
+ [Parameter] public string Style { get; set; }
+ [Parameter] public string RowSpaceStyle { get; set; }
+
+ /// <summary>
+ /// コントロール再表示
+ /// </summary>
+ public void Refresh()
+ {
+ StateHasChanged();
+ }
+
+ public void SetResvNo(string no)
+ {
+ Data.GetField("ResvNo").Text = no;
+ StateHasChanged();
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.Client.Blazor/Pages/UseDetail/RoomTypeInput.razor b/HotelPms.Client.Blazor/Pages/UseDetail/RoomTypeInput.razor
new file mode 100644
index 0000000..26335f7
--- /dev/null
+++ b/HotelPms.Client.Blazor/Pages/UseDetail/RoomTypeInput.razor
@@ -0,0 +1,64 @@
+@using System.ComponentModel.DataAnnotations
+@using System.Text.RegularExpressions
+@using System.Reflection
+@using HotelPms.Client.Blazor.Models;
+@using HotelPms.Client.Blazor.ViewModel
+@using HotelPms.Data.Common
+@using HotelPms.Data.Common.Interface.Master
+@using HotelPms.DataAccessGrpc.Client
+@using HotelPms.Share.IO
+@using HotelPms.Share.Util
+@using ViewModel = HotelPms.Client.Blazor.ViewModel
+@using static HotelPms.Client.Blazor.Util.SystemEnum
+@inject IJSRuntime JSRuntime
+@inject IDialogService DialogService
+@inject ISnackbar Snackbar
+
+<MudCard Style="height: 100%" Elevation="4">
+ <MudCardHeader Class="mb-0 pb-0">
+ <CardHeaderContent>
+ <MudText Typo="Typo.body1">タイプ・室数</MudText>
+ </CardHeaderContent>
+ </MudCardHeader>
+ <MudCardContent Class="mt-0 pt-0 mb-0 pb-1">
+ <MudTable Class="edit-grid" id="gdi-roomtype-list" T="RoomTypeInputRow" Items="@Data.RoomTypeList" @ref="mudRoomTypeInputTable" @bind-SelectedItem="m_SelRoomTypeInputRow" Dense="true" ReadOnly="false" FixedHeader="true" Height="200px" Striped="true" Elevation="0" Outlined="true">
+ <ColGroup>
+ <col style="width:80px;" />
+ <col />
+ <col style="width:80px;" />
+ </ColGroup>
+ <HeaderContent>
+ <MudTh>ID</MudTh>
+ <MudTh>名称</MudTh>
+ <MudTh>室数</MudTh>
+ </HeaderContent>
+ <RowTemplate>
+ <MudTd DataLabel="ID" Class="slip-row pr-0 pl-1">
+ <MudTextField class="input-pink input-center" @ref="@context.Cells[(int)RoomTypeInputRow.ColType.ID].Ref" @bind-Value="@context.Cells[(int)RoomTypeInputRow.ColType.ID].Text" Margin="Margin.Dense"
+ OnKeyPress="@(e => KeyPress((int)RoomTypeInputRow.ColType.ID, context, e))"
+ KeyPressPreventDefault="@keyPressPreventDefault"
+ OnKeyDown="@(e => KeyDown((int)RoomTypeInputRow.ColType.ID, context, e))"
+ KeyDownPreventDefault="@keyDownPreventDefault"
+ OnBlur="@(e => Leave((int)RoomTypeInputRow.ColType.ID, context, e))"
+ @onfocus="(e => Enter((int)RoomTypeInputRow.ColType.ID, context, e))"
+ MaxLength="7" />
+ </MudTd>
+ <MudTd DataLabel="名称" Class="slip-row pr-0 pl-1"><MudTextField id="txtInputRoomTypeName" @bind-Value="@context.Cells[(int)RoomTypeInputRow.ColType.Name].Text" Margin="Margin.Dense" ReadOnly="true" /></MudTd>
+ <MudTd DataLabel="室数" Class="slip-row pr-2 pl-1">
+ <MudTextField class="input-pink input-center" @ref="@context.Cells[(int)RoomTypeInputRow.ColType.Count].Ref" @bind-Value="@context.Cells[(int)RoomTypeInputRow.ColType.Count].Text" Margin="Margin.Dense"
+ OnKeyPress="@(e => KeyPress((int)RoomTypeInputRow.ColType.Count, context, e))"
+ KeyPressPreventDefault="@keyPressPreventDefault"
+ OnKeyDown="@(e => KeyDown((int)RoomTypeInputRow.ColType.Count, context, e))"
+ KeyDownPreventDefault="@keyDownPreventDefault"
+ OnBlur="@(e => Leave((int)RoomTypeInputRow.ColType.Count, context, e))"
+ @onfocus="(e => Enter((int)RoomTypeInputRow.ColType.ID, context, e))"
+ MaxLength="7" />
+ </MudTd>
+ </RowTemplate>
+ </MudTable>
+ </MudCardContent>
+</MudCard>
+
+@code {
+ private static RenderFragment RenderMessage(string text) =>@<MessageContext Text="@text" />;
+}
\ No newline at end of file
diff --git a/HotelPms.Client.Blazor/Pages/UseDetail/RoomTypeInput.razor.cs b/HotelPms.Client.Blazor/Pages/UseDetail/RoomTypeInput.razor.cs
new file mode 100644
index 0000000..5a00719
--- /dev/null
+++ b/HotelPms.Client.Blazor/Pages/UseDetail/RoomTypeInput.razor.cs
@@ -0,0 +1,599 @@
+using Grpc.Core;
+using HotelPms.Client.Blazor.Dialog;
+using HotelPms.Client.Blazor.Models;
+using HotelPms.Client.Blazor.Util;
+using HotelPms.Data.Common;
+using HotelPms.Share.IO;
+using HotelPms.Share.Util;
+using Microsoft.AspNetCore.Components;
+using Microsoft.AspNetCore.Components.Web;
+using MudBlazor;
+using System.Data;
+using static HotelPms.Client.Blazor.Util.SystemEnum;
+using static System.Net.Mime.MediaTypeNames;
+
+namespace HotelPms.Client.Blazor.Pages.UseDetail;
+
+public partial class RoomTypeInput : ComponentBase
+{
+ #region ★★★★★ Parameter ★★★★★
+
+ [Parameter] public ViewModel.UseInput? Data { get; set; }
+
+ /// <summary>
+ /// 親Pageの再表示
+ /// </summary>
+ [Parameter] public Action OnRefresh { get; set; }
+
+ #endregion
+
+ #region ★★★★★ Declare ★★★★★
+ /// <summary>
+ /// 异步锁
+ /// ■ロック追加前
+ /// Leave⇒Start
+ /// Leave⇒Row:1 Col:0 enterPush:False, orgText:, text:1
+ /// 【10:07:06 046】SendAsync begin:10:07:06 046
+ /// 【10:07:06 047】SendAsync Url⇒/HotelPms.Data.GrpcTableCore/GetData
+ /// Enter⇒Row:0 Col:0 Text:1
+ /// 【10:07:06 095】SendAsync End:10:07:06 095
+ /// 該当部屋タイプが既に存在します。
+ /// Leave⇒End
+ ///
+ /// ■追加後
+ /// Leave⇒Start
+ /// Leave⇒Row:1 Col:0 enterPush:False, text:1
+ /// 【10:26:02 811】SendAsync begin:10:26:02 811
+ /// 【10:26:02 811】SendAsync Url⇒/HotelPms.Data.GrpcTableCore/GetData
+ /// 【10:26:02 860】SendAsync End:10:26:02 860
+ /// 該当部屋タイプが既に存在します。
+ /// Leave⇒End
+ /// Enter⇒Row:0 Col:0
+ ///
+ /// Semaphore(int initialCount, int maximumCount);
+ /// initialCount代表还分配几个线程,比如是1,那就是还能允许一个线程继续跑锁起来的代码
+ /// maximumCount代表最大允许数, 比如是1, 那就是进去1个线程, 就会锁起来
+ /// </summary>
+ private System.Threading.SemaphoreSlim slimlock = new SemaphoreSlim(1, 1);
+
+ private int selRow = 0;
+ private int selectedRowNumber = -1;
+ private MudTable<RoomTypeInputRow> mudRoomTypeInputTable;
+
+ private bool keyDownPreventDefault = false;
+ private bool keyPressPreventDefault = false;
+ private bool enterPush = false;
+ private bool arrowUpPush = false;
+
+ private EditGridFocusEventArgs m_CurrentFocusData = new EditGridFocusEventArgs();
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+
+ private RoomTypeInputRow m_SelRoomTypeInputRow = null;
+
+ /// <summary>
+ /// 選択されている行
+ /// </summary>
+ public RoomTypeInputRow SelRoomTypeInputRow
+ {
+ get { return m_SelRoomTypeInputRow; }
+ set
+ {
+ m_SelRoomTypeInputRow = value;
+ EnvironmentSetting.Debug($"Change:{m_SelRoomTypeInputRow.ID}");
+ }
+ }
+
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ protected override void OnInitialized()
+ {
+ //EnvironmentSetting.Debug($"【{DateTime.Now.ToString("HH:mm:ss fff")}】RoomTypeInput.OnInitialized開始:");
+ base.OnInitialized();
+ }
+
+ protected override void OnAfterRender(bool firstRender)
+ {
+ //EnvironmentSetting.Debug($"【{DateTime.Now.ToString("HH:mm:ss fff")}】RoomTypeInput.OnAfterRender開始:{firstRender}");
+ base.OnAfterRender(firstRender);
+ }
+
+ protected override async Task OnAfterRenderAsync(bool firstRender)
+ {
+ await slimlock.WaitAsync();
+ EnvironmentSetting.Debug($"RoomTypeInput.OnAfterRenderAsync開始:{firstRender}");
+ await ShowFocus();
+ EnvironmentSetting.Debug($"RoomTypeInput.OnAfterRenderAsync終了:{firstRender}");
+ slimlock.Release();
+ }
+
+ protected override void OnParametersSet()
+ {
+ //EnvironmentSetting.Debug($"【{DateTime.Now.ToString("HH:mm:ss fff")}】RoomTypeInput.OnParametersSet開始:");
+ base.OnParametersSet();
+ }
+
+ protected override bool ShouldRender()
+ {
+ EnvironmentSetting.Debug($"RoomTypeInput.ShouldRender開始:");
+ return base.ShouldRender();
+ }
+
+ #endregion
+
+ #region ★★★★★ Control Event ★★★★★
+
+ private async Task Enter(int index, RoomTypeInputRow data, FocusEventArgs e)
+ {
+ await slimlock.WaitAsync();
+ int rowIdx = GetRowIndex(data);
+ Console.WriteLine($"Enter⇒Row:{rowIdx} Col:{index}");
+ slimlock.Release();
+ }
+
+ private async Task Leave(int index, RoomTypeInputRow data, FocusEventArgs e)
+ {
+ string text = string.Empty;
+ try
+ {
+ await slimlock.WaitAsync();
+ Console.WriteLine($"Leave⇒Start");
+ int rowIdx = GetRowIndex(data);
+ text = data.GetCellText(index);
+ Console.WriteLine($"Leave⇒Row:{rowIdx} Col:{index} enterPush:{enterPush}, text:{text}");
+
+ if (enterPush)
+ {
+ //Enterキーを押した時にも既にチェック済
+ enterPush = false;
+ }
+ else
+ {
+ //値変更したら、イベント発生
+ if (!data.IsValueChanged(index, text))
+ {
+ //必須判断:初期表示時:OrgTextは空白のため、値変更しないまま
+ return;
+ }
+
+ //通常チェックを行う
+ if (!await IsValid(index, text, data, false))
+ {
+ return;
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ OperationLog.Instance.WriteLog(ex.Message);
+ }
+ finally
+ {
+ //Refresh(); //UI更新(binding値変更通知)
+ Console.WriteLine($"Leave⇒End");
+ slimlock.Release();
+ }
+ }
+
+ /// <summary>
+ /// ※Backspaceここに来る
+ /// </summary>
+ /// <param name="index"></param>
+ /// <param name="data"></param>
+ /// <param name="e"></param>
+ /// <returns></returns>
+ private async Task KeyDown(int index, RoomTypeInputRow data, KeyboardEventArgs e)
+ {
+ if (e.Key == "ArrowUp")
+ {
+ try
+ {
+ EnvironmentSetting.Debug($"ArrowUp:{index}");
+ if (SetAutoNextFocus(index, false, data))
+ {
+ //BlazorのBugでEnterのパラメータ変数できない!
+ //Uncaught Error: System.ArgumentException: There is no event handler associated with this event. EventId: '290'. (Parameter 'eventHandlerId')
+ //mkArtakMSFT modified the milestones: Next sprint planning, 6.0-preview4 on 20 Mar ← Net6.0-preview4対応だそう
+ keyDownPreventDefault = true;
+ arrowUpPush = true;
+ }
+ else
+ {
+ keyDownPreventDefault = false;
+ arrowUpPush = false;
+ }
+ }
+ catch (Exception ex)
+ {
+ OperationLog.Instance.WriteLog($"KeyDown:{ex.Message}");
+ }
+ finally
+ {
+ Refresh("KeyDown⇒↑"); //UI更新(binding値変更通知)
+ }
+ }
+ else if (e.Key == "End")
+ {
+ if (data.Cells[index].ShowStyle == EShowStyle.ShowList)
+ {
+ data.ActiveCol = index;
+ if (index == (int)RoomTypeInputRow.ColType.ID)
+ {
+ using DataTable dt = await MasterCore.GetRoomTypeList();
+ var parameters = new DialogParameters { ["Data"] = dt };
+ var dialog = DialogService.Show<SelectList>($"部屋タイプ一覧", parameters);
+ var ret = await dialog.Result;
+ if (!ret.Cancelled)
+ {
+ var row = ret.Data as DataRow;
+ EnvironmentSetting.Debug(row[0].ToString());
+ data.Cells[index].Text = row[0].ToString();
+ data.Cells[(int)RoomTypeInputRow.ColType.Name].Text = row[1].ToString();
+ await KeyPress(index, data, new KeyboardEventArgs { Key = "Enter" });
+ //Refresh("KeyDown⇒End");
+ }
+ }
+ }
+ }
+ else if (e.Key == "Delete")
+ {
+ if (index == (int)RoomTypeInputRow.ColType.ID)
+ {
+ int rowIdx = GetRowIndex(data);
+ List<RoomTypeInputRow> list = (Data.RoomTypeList as List<RoomTypeInputRow>);
+ bool isLastRow = rowIdx == (list.Count - 1);
+ if (isLastRow) { return; }
+ SetFocus(rowIdx, (int)RoomTypeInputRow.ColType.ID);
+ EnvironmentSetting.Debug($"削除前件数:{list.Count}");
+ list.Remove(data);
+ EnvironmentSetting.Debug($"削除後件数:{list.Count}");
+ keyDownPreventDefault = false;
+ arrowUpPush = false;
+ }
+ }
+ else
+ {
+ keyDownPreventDefault = false;
+ arrowUpPush = false;
+ }
+ }
+
+ /// <summary>
+ /// ※Backspaceここに来ない
+ /// </summary>
+ /// <param name="index"></param>
+ /// <param name="data"></param>
+ /// <param name="e"></param>
+ /// <returns></returns>
+ private async Task KeyPress(int index, RoomTypeInputRow data, KeyboardEventArgs e)
+ {
+ if (e.Key == "Enter")
+ {
+ try
+ {
+ int rowIdx = GetRowIndex(data);
+ Console.WriteLine($"Row:{rowIdx} Col:{index}");
+ Console.WriteLine("Data:" + CConvert.ToJsonText<RoomTypeInputRow>(data));
+
+ //※その時、Fields[index].Textの値まだ変っていない!!!!!
+ string text = await data.GetInputValue(index, JSRuntime);
+ EnvironmentSetting.Debug($"Return:{index}⇒{text}");
+ keyPressPreventDefault = true; //イベント中止
+ enterPush = true; //Enterを押した知らせ
+
+ //値変更したら、イベント発生
+ if (data.IsValueChanged(index, text))
+ {
+ //通常チェックを行う
+ if (!await IsValid(index, text, data, true)) { return; }
+ }
+ else
+ {
+ //必須判断:初期表示時:OrgTextは空白のため、値変更しないまま
+ if (text.Trim().Length == 0)
+ {
+ //最終行となるはず
+ }
+ }
+
+ if (!SetAutoNextFocus(index, true, data)) { return; }
+ }
+ catch (Exception ex)
+ {
+ EnvironmentSetting.Debug(ex.Message);
+ }
+ finally
+ {
+ Refresh("KeyPress⇒Enter"); //UI更新(binding値変更通知)
+ }
+ }
+ else
+ {
+ if (CConvert.IsNumPress(e.Key))
+ {
+ keyPressPreventDefault = false;
+ }
+ else
+ {
+ keyPressPreventDefault = true; //入力禁止(※:IMEモードで入力したものをここでは通らないため、防げない)
+ }
+ enterPush = false;
+ }
+ }
+
+ #endregion
+
+ #region ★★★★★ Private Method ★★★★★
+
+ private RenderFragment RenderWidget(string msg) => builder =>
+ {
+ builder.OpenComponent(0, typeof(MessageContext));
+ builder.AddAttribute(1, "Text", msg);
+ builder.CloseComponent();
+ };
+
+ /// <summary>
+ /// フォーカス移動準備
+ /// </summary>
+ /// <param name="row"></param>
+ /// <param name="col"></param>
+ /// <param name="action">EditModeの場合、自動で次のフォーカス移動する</param>
+ private void SetFocus(int row, int col, EditGridFocusEventArgs.ActionType action = EditGridFocusEventArgs.ActionType.Focus)
+ {
+ EnvironmentSetting.Debug($"フォーカス移動準備:開始⇒Row:{row},Col:{col},Action:{action},Enabled:{m_CurrentFocusData.Enabled}");
+ m_CurrentFocusData.Row = row;
+ m_CurrentFocusData.Col = col;
+ m_CurrentFocusData.Action = action;
+ m_CurrentFocusData.Enabled = true;
+ EnvironmentSetting.Debug($"フォーカス移動準備:完了⇒Row:{row},Col:{col},Action:{action},Enabled:{m_CurrentFocusData.Enabled}");
+ }
+
+ /// <summary>
+ /// OnAfterRenderAsync時フォーカスを設定
+ /// </summary>
+ private async Task<bool> ShowFocus()
+ {
+ try
+ {
+ EnvironmentSetting.Debug($"SaleInput.FocusAsync行Before:Row={m_CurrentFocusData.Row},Col={m_CurrentFocusData.Col},Action={m_CurrentFocusData.Action},Enabled={m_CurrentFocusData.Enabled}");
+ if (!m_CurrentFocusData.Enabled)
+ {
+ EnvironmentSetting.Debug($"OnAfterRenderAsync⇒return false");
+ return false;
+ }
+ m_CurrentFocusData.Enabled = false;
+
+ EnvironmentSetting.Debug($"ShowFocus処理:Row={m_CurrentFocusData.Row},Col={m_CurrentFocusData.Col},Action={m_CurrentFocusData.Action},Enabled={m_CurrentFocusData.Enabled}");
+ if (m_CurrentFocusData.Action == EditGridFocusEventArgs.ActionType.Focus && m_CurrentFocusData.Row != -1 && m_CurrentFocusData.Col != -1)
+ {
+ //この時点Grid編集状態ですので、フォーカス可能になる
+ EnvironmentSetting.Debug($"フォーカスへ開始:Row = {m_CurrentFocusData.Row}, Col = {m_CurrentFocusData.Col}");
+ await (Data.RoomTypeList as List<RoomTypeInputRow>)[m_CurrentFocusData.Row].Cells[m_CurrentFocusData.Col].Ref.FocusAsync(); //ここに再度OnAfterRenderAsyncに入るが、EnabledはFalseのため、ShowFocusの動作がしない
+ EnvironmentSetting.Debug($"フォーカスへ完了:Row = {m_CurrentFocusData.Row}, Col = {m_CurrentFocusData.Col}");
+ }
+ return true;
+ }
+ catch (Exception ex)
+ {
+ EnvironmentSetting.Debug(ex.Message);
+ return false;
+ }
+ }
+
+
+
+ private int GetRowIndex(RoomTypeInputRow data)
+ {
+ return (Data.RoomTypeList as List<RoomTypeInputRow>).IndexOf(data);
+ }
+
+ /// <summary>
+ /// フォーカス移動
+ /// </summary>
+ /// <param name="index">列Index</param>
+ /// <param name="isEnter"></param>
+ /// <returns></returns>
+ private bool SetAutoNextFocus(int index, bool isEnter, RoomTypeInputRow data)
+ {
+ try
+ {
+ int rowIdx = GetRowIndex(data);
+ List<RoomTypeInputRow> list = (Data.RoomTypeList as List<RoomTypeInputRow>);
+ if (isEnter)
+ {
+ if (index == (int)RoomTypeInputRow.ColType.ID)
+ {
+ SetFocus(rowIdx, (int)RoomTypeInputRow.ColType.Count);
+ }
+ else
+ {
+ if (rowIdx == -1)
+ {
+ //削除された場合
+ //await list[list.Count - 1].RefID.FocusAsync();
+ }
+ else
+ {
+ if (rowIdx < (list.Count - 1))
+ {
+ SetFocus(rowIdx + 1, (int)RoomTypeInputRow.ColType.ID);
+ }
+ }
+ }
+ }
+ else
+ {
+ if (index == (int)RoomTypeInputRow.ColType.ID)
+ {
+ if (rowIdx > 0) { SetFocus(rowIdx - 1, (int)RoomTypeInputRow.ColType.Count); }
+ }
+ else
+ {
+ SetFocus(rowIdx, (int)RoomTypeInputRow.ColType.ID);
+ }
+ }
+ return true;
+ }
+ catch
+ {
+ return false;
+ }
+ }
+
+ /// <summary>
+ /// 入力されたIDが存在したかどうか
+ /// </summary>
+ /// <param name="rowIdx"></param>
+ /// <param name="id"></param>
+ /// <returns></returns>
+ private bool IsExistsID(int rowIdx, int id)
+ {
+ List<RoomTypeInputRow> list = (Data.RoomTypeList as List<RoomTypeInputRow>);
+ int i = 0;
+ foreach (RoomTypeInputRow row in list)
+ {
+ if (i == rowIdx) { continue; }
+ if (CConvert.ToInt(row.ID) == id)
+ {
+ return true;
+ }
+ i++;
+ }
+ return false;
+ }
+
+ /// <summary>
+ /// 業務チェック
+ /// </summary>
+ /// <param name="index"></param>
+ /// <param name="inputText"></param>
+ /// <param name="data"></param>
+ /// <param name="isEnter"></param>
+ /// <returns></returns>
+ private async Task<bool> IsValid(int index, string inputText, RoomTypeInputRow data, bool isEnter)
+ {
+ int rowIdx = GetRowIndex(data);
+ //最終行判断
+ List<RoomTypeInputRow> list = (Data.RoomTypeList as List<RoomTypeInputRow>);
+ bool isLastRow = rowIdx == (list.Count - 1);
+
+ if (index == (int)RoomTypeInputRow.ColType.ID)
+ {
+ int id = CConvert.ToInt(inputText);
+ RoomTypeBase typeBase = await MasterCore.GetRoomTypeBase(id);
+ if (typeBase == null)
+ {
+ if (isEnter)
+ {
+ Message.Show(RenderMessage("該当データが存在しません。"));
+ }
+ else
+ {
+ Console.WriteLine("該当データが存在しません。");
+ }
+ data.RestoreText(RoomTypeInputRow.ColType.ID);
+ return false;
+ }
+
+ if (IsExistsID(rowIdx, id))
+ {
+ if (isEnter)
+ {
+ Message.Show(RenderMessage("該当部屋タイプが既に存在します。"));
+ }
+ else
+ {
+ Console.WriteLine("該当部屋タイプが既に存在します。");
+ }
+ data.RestoreText(RoomTypeInputRow.ColType.ID);
+ return false;
+ }
+ data.SetCellText((int)RoomTypeInputRow.ColType.Name, typeBase.Name);
+
+ if (isLastRow)
+ {
+ //新規
+ data.SetCellText((int)RoomTypeInputRow.ColType.Count, "1");
+
+ //UseRoomを追加:当日
+ var useRoom = await Data.CreateUseRoom(id, typeBase.Kind);
+ data.DataList.Add(useRoom);
+
+ //一番したの新規行表示
+ list.Add(new RoomTypeInputRow());
+ }
+ else
+ {
+ //部屋タイプ変更(データ更新)
+ foreach (var item in data.DataList)
+ {
+ item.RoomTypeID = id;
+ item.RoomKind = typeBase.Kind;
+ }
+
+ //画面表示更新
+ data.SetCellText((int)RoomTypeInputRow.ColType.ID, id.ToString());
+ }
+ }
+ else if (index == (int)RoomTypeInputRow.ColType.Count)
+ {
+ if (isLastRow) { return false; }
+ //0の場合、完全に削除する
+ int orgCount = data.DataList.Count;
+ int newCount = CConvert.ToInt(inputText);
+
+ //UseRoomの±
+ int count = newCount - orgCount;
+ if (count > 0)
+ {
+ for (int i = 0; i < count; i++)
+ {
+ var useRoom = await Data.CreateUseRoom(data.DataList[0].RoomTypeID, data.DataList[0].RoomKind);
+ data.DataList.Add(useRoom);
+ }
+ }
+ else
+ {
+ Data.RemoveUseRoom(data.DataList, -count);
+ }
+
+ if (newCount == 0)
+ {
+ list.Remove(data);
+ if (rowIdx >= list.Count)
+ {
+ SetFocus(list.Count - 1, (int)RoomTypeInputRow.ColType.ID);
+ }
+ else
+ {
+ SetFocus(rowIdx, (int)RoomTypeInputRow.ColType.ID);
+ }
+ return false;
+ }
+
+ data.SetCellText(index, CConvert.ToInt(inputText).ToString());
+ }
+ return true;
+ }
+
+ #endregion
+
+ #region ★★★★★ Public Method ★★★★★
+
+ /// <summary>
+ /// コントロール再表示
+ /// </summary>
+ public void Refresh(string type)
+ {
+ EnvironmentSetting.Debug($"再表示へ開始:{type}");
+ StateHasChanged();
+ EnvironmentSetting.Debug($"再表示へ終了:{type}");
+ if(OnRefresh != null) { OnRefresh(); }
+ }
+
+ #endregion
+}
diff --git a/HotelPms.Client.Blazor/Pages/UseDetail/SaleInput.razor b/HotelPms.Client.Blazor/Pages/UseDetail/SaleInput.razor
new file mode 100644
index 0000000..8678006
--- /dev/null
+++ b/HotelPms.Client.Blazor/Pages/UseDetail/SaleInput.razor
@@ -0,0 +1,349 @@
+@using System.ComponentModel.DataAnnotations
+@using System.Text.RegularExpressions
+@using System.Reflection
+@using HotelPms.Client.Blazor.Models;
+@using HotelPms.Client.Blazor.ViewModel
+@using HotelPms.Data.Common
+@using HotelPms.Data.Common.Interface.Master
+@using HotelPms.DataAccessGrpc.Client
+@using HotelPms.Share.IO
+@using HotelPms.Share.Util
+@using ViewModel = HotelPms.Client.Blazor.ViewModel
+@using static HotelPms.Client.Blazor.Util.SystemEnum
+@inject IJSRuntime JSRuntime
+@inject IDialogService DialogService
+@inject ISnackbar Snackbar
+
+<MudCard Elevation="4">
+ <MudCardHeader>
+ <CardHeaderContent>
+ <MudText Typo="Typo.body1">Address Details for <strong>伝票</strong></MudText>
+ <MudButton Variant="Variant.Filled" StartIcon="@Icons.Filled.ReadMore" OnClick="Save">登録</MudButton>
+ </CardHeaderContent>
+ </MudCardHeader>
+ <MudCardContent Class="mt-0 pt-0 mb-0 pb-3">
+ <MudTable Class="edit-grid pr-0" id="SaleInputTable" @ref="_table" T="SaleInputRow" Items="@Data.SaleList" Dense="true" Hover="true" ReadOnly="false" FixedHeader="true" Height="480px" Striped="true"
+ @bind-SelectedItem="selectedItem1" Elevation = "0">
+ <ToolBarContent>
+ <MudText Typo="Typo.body1">伝票情報</MudText>
+ <MudTextField T="string" Margin="Margin.Dense" />
+ <MudSpacer />
+ <MudTextField @bind-Value="searchString" Margin="Margin.Dense" Placeholder="Search" Adornment="Adornment.Start" AdornmentIcon="@Icons.Material.Filled.Search" IconSize="Size.Medium" Class="mt-0"></MudTextField>
+ </ToolBarContent>
+ <ColGroup>
+ <col style="width:50px;" />
+ <col style="width:100px;" />
+ <col />
+ <col style="width:70px;" />
+ <col style="width:70px;" />
+ <col style="width:100px;" />
+ <col style="width:80px;" />
+ <col style="width:130px;" />
+ <col style="width:100px;" />
+ <col style="width:50px;" />
+ <col style="width:60px;" />
+ </ColGroup>
+ <HeaderContent>
+ <MudTh>TYPE</MudTh>
+ <MudTh>部屋No</MudTh>
+ <MudTh>科目名称</MudTh>
+ <MudTh Style="text-align:center">人数</MudTh>
+ <MudTh Style="text-align:center">内女</MudTh>
+ <MudTh>基本単価</MudTh>
+ <MudTh>割引</MudTh>
+ <MudTh Style="text-align:right">合計金額</MudTh>
+ <MudTh>集計日</MudTh>
+ <MudTh>頁</MudTh>
+ <MudTh>詳細</MudTh>
+ </HeaderContent>
+ <RowTemplate>
+ <MudTd DataLabel="TYPE">@context.Cells[(int)SaleInputRow.ColType.RoomType].Text</MudTd>
+ <MudTd DataLabel="部屋No">@context.Cells[(int)SaleInputRow.ColType.RoomID].Text</MudTd>
+ <MudTd DataLabel="科目名称" Class="slip-row pr-0 pl-1">
+ <MudTextField class="input-pink" id="txtItemName" @ref="@context.Cells[(int)SaleInputRow.ColType.ItemName].Ref" @bind-Value="@context.Cells[(int)SaleInputRow.ColType.ItemName].Text" Margin="Margin.Dense"
+ OnKeyPress="@(e => KeyPress((int)SaleInputRow.ColType.ItemName, context, e))"
+ KeyPressPreventDefault="@keyPressPreventDefault"
+ OnKeyDown="@(e => KeyDown((int)SaleInputRow.ColType.ItemName, context, e))"
+ KeyDownPreventDefault="@keyDownPreventDefault"
+ OnBlur="@(e => Leave((int)SaleInputRow.ColType.ItemName, context, e))"
+ @onfocus="(e => Enter((int)SaleInputRow.ColType.ItemName, context, e))" />
+ </MudTd>
+ <MudTd DataLabel="人数" Class="slip-row pr-0 pl-1">
+ <MudTextField class="input-center" @ref="@context.Cells[(int)SaleInputRow.ColType.PersonCount].Ref" @bind-Value="@context.Cells[(int)SaleInputRow.ColType.PersonCount].Text" Margin="Margin.Dense"
+ OnKeyPress="@(e => KeyPress((int)SaleInputRow.ColType.PersonCount, context, e))"
+ KeyPressPreventDefault="@keyPressPreventDefault"
+ OnKeyDown="@(e => KeyDown((int)SaleInputRow.ColType.PersonCount, context, e))"
+ KeyDownPreventDefault="@keyDownPreventDefault"
+ OnBlur="@(e => Leave((int)SaleInputRow.ColType.PersonCount, context, e))"
+ @onfocus="(e => Enter((int)SaleInputRow.ColType.PersonCount, context, e))" />
+ </MudTd>
+ <MudTd DataLabel="内女" Class="slip-row pr-0 pl-1">
+ <MudTextField class="input-center" @ref="@context.Cells[(int)SaleInputRow.ColType.Woman].Ref" @bind-Value="@context.Cells[(int)SaleInputRow.ColType.Woman].Text" Margin="Margin.Dense"
+ OnKeyPress="@(e => KeyPress((int)SaleInputRow.ColType.Woman, context, e))"
+ KeyPressPreventDefault="@keyPressPreventDefault"
+ OnKeyDown="@(e => KeyDown((int)SaleInputRow.ColType.Woman, context, e))"
+ KeyDownPreventDefault="@keyDownPreventDefault"
+ OnBlur="@(e => Leave((int)SaleInputRow.ColType.Woman, context, e))"
+ @onfocus="(e => Enter((int)SaleInputRow.ColType.Woman, context, e))" />
+ </MudTd>
+ <MudTd DataLabel="基本単価" Class="slip-row pr-0 pl-1">
+ <MudTextField class="input-right" @ref="@context.Cells[(int)SaleInputRow.ColType.UnitPrice].Ref" @bind-Value="@context.Cells[(int)SaleInputRow.ColType.UnitPrice].Text" Margin="Margin.Dense"
+ OnKeyPress="@(e => KeyPress((int)SaleInputRow.ColType.UnitPrice, context, e))"
+ KeyPressPreventDefault="@keyPressPreventDefault"
+ OnKeyDown="@(e => KeyDown((int)SaleInputRow.ColType.UnitPrice, context, e))"
+ KeyDownPreventDefault="@keyDownPreventDefault"
+ OnBlur="@(e => Leave((int)SaleInputRow.ColType.UnitPrice, context, e))"
+ @onfocus="(e => Enter((int)SaleInputRow.ColType.UnitPrice, context, e))" />
+ </MudTd>
+ <MudTd DataLabel="割引" Class="slip-row pr-0 pl-1">
+ <MudTextField class="input-pink input-right" @ref="@context.Cells[(int)SaleInputRow.ColType.DiscountSummary].Ref" @bind-Value="@context.Cells[(int)SaleInputRow.ColType.DiscountSummary].Text" Margin="Margin.Dense"
+ OnKeyPress="@(e => KeyPress((int)SaleInputRow.ColType.DiscountSummary, context, e))"
+ KeyPressPreventDefault="@keyPressPreventDefault"
+ OnKeyDown="@(e => KeyDown((int)SaleInputRow.ColType.DiscountSummary, context, e))"
+ KeyDownPreventDefault="@keyDownPreventDefault"
+ OnBlur="@(e => Leave((int)SaleInputRow.ColType.DiscountSummary, context, e))"
+ @onfocus="(e => Enter((int)SaleInputRow.ColType.DiscountSummary, context, e))" />
+ </MudTd>
+ <MudTd DataLabel="合計金額" Class="slip-row pr-0 pl-1">
+ <MudTextField class="input-right" @ref="@context.Cells[(int)SaleInputRow.ColType.TotalSummary].Ref" ReadOnly="true" @bind-Value="@context.Cells[(int)SaleInputRow.ColType.TotalSummary].Text" Margin="Margin.Dense"
+ OnKeyPress="@(e => KeyPress((int)SaleInputRow.ColType.TotalSummary, context, e))"
+ KeyPressPreventDefault="@keyPressPreventDefault"
+ OnKeyDown="@(e => KeyDown((int)SaleInputRow.ColType.TotalSummary, context, e))"
+ KeyDownPreventDefault="@keyDownPreventDefault"
+ OnBlur="@(e => Leave((int)SaleInputRow.ColType.TotalSummary, context, e))"
+ @onfocus="(e => Enter((int)SaleInputRow.ColType.TotalSummary, context, e))" />
+ </MudTd>
+ <MudTd DataLabel="集計日" Class="slip-row pr-0 pl-1">
+ <MudTextField class="input-pink input-center" @ref="@context.Cells[(int)SaleInputRow.ColType.SumDate].Ref" @bind-Value="@context.Cells[(int)SaleInputRow.ColType.SumDate].Text" Margin="Margin.Dense"
+ OnKeyPress="@(e => KeyPress((int)SaleInputRow.ColType.SumDate, context, e))"
+ KeyPressPreventDefault="@keyPressPreventDefault"
+ OnKeyDown="@(e => KeyDown((int)SaleInputRow.ColType.SumDate, context, e))"
+ KeyDownPreventDefault="@keyDownPreventDefault"
+ OnBlur="@(e => Leave((int)SaleInputRow.ColType.SumDate, context, e))"
+ @onfocus="(e => Enter((int)SaleInputRow.ColType.SumDate, context, e))" />
+ </MudTd>
+ <MudTd DataLabel="頁" Class="slip-row pr-0 pl-1">
+ <MudTextField class="input-center" @ref="@context.Cells[(int)SaleInputRow.ColType.Page].Ref" @bind-Value="@context.Cells[(int)SaleInputRow.ColType.Page].Text" Margin="Margin.Dense"
+ OnKeyPress="@(e => KeyPress((int)SaleInputRow.ColType.Page, context, e))"
+ KeyPressPreventDefault="@keyPressPreventDefault"
+ OnKeyDown="@(e => KeyDown((int)SaleInputRow.ColType.Page, context, e))"
+ KeyDownPreventDefault="@keyDownPreventDefault"
+ OnBlur="@(e => Leave((int)SaleInputRow.ColType.Page, context, e))"
+ @onfocus="(e => Enter((int)SaleInputRow.ColType.Page, context, e))" />
+ </MudTd>
+ <MudTd>
+ <div style="display: flex; gap: 10px;">
+ <MudTooltip Text="Commit Edit">
+ <MudIconButton Size="Size.Small" Icon="@Icons.Filled.ReadMore" OnClick="@(e => DetailClick(context))"></MudIconButton>
+ </MudTooltip>
+ </div>
+ </MudTd>
+ </RowTemplate>
+ <ChildRowContent>
+ @if (context.ShowDetails)
+ {
+ <MudTr>
+ <td colspan="11">
+ <MudCard Class="mt-2 ml-5 mr-2 mb-2" Elevation="1">
+ <MudCardContent>
+ @if (context.ActiveCol == (int)SaleInputRow.ColType.Detail)
+ {
+ <MudGrid Spacing="3" Justify="Justify.FlexStart">
+ <MudItem lg="12" Class="mt-1 pt-1 mb-0 pb-0">
+ <MudStack Spacing="5" Row="true">
+ <MudText Typo="Typo.body2">パック明細情報</MudText>
+ <MudLink Href="#" Underline="Underline.Always" Typo="Typo.body2">追加</MudLink>
+ </MudStack>
+ </MudItem>
+ <MudItem lg="12" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudTable id="SaleChildTable" Class="pr-0 mt-0 pt-0" Items="@SaleChildList" Dense="true" Hover="true" ReadOnly="true" Height="105px" Striped="true" HorizontalScrollbar="true" Elevation="0">
+ <ColGroup>
+ <col style="width:50px;" />
+ <col style="width:100px;" />
+ <col />
+ <col style="width:70px;" />
+ <col style="width:70px;" />
+ <col style="width:100px;" />
+ <col style="width:80px;" />
+ <col style="width:130px;" />
+ <col style="width:100px;" />
+ <col style="width:50px;" />
+ </ColGroup>
+ <HeaderContent>
+ <MudTh>TYPE</MudTh>
+ <MudTh>部屋No</MudTh>
+ <MudTh>科目名称</MudTh>
+ <MudTh Style="text-align:center">人数</MudTh>
+ <MudTh Style="text-align:center">内女</MudTh>
+ <MudTh>基本単価</MudTh>
+ <MudTh>割引</MudTh>
+ <MudTh Style="text-align:right">合計金額</MudTh>
+ <MudTh>集計日</MudTh>
+ </HeaderContent>
+ <RowTemplate Context = "childItem">
+ <MudTd DataLabel="TYPE" Class="table-row"><MudText Typo="Typo.body2">@childItem.Cells[(int)SaleChildRow.ColType.RoomType]</MudText></MudTd>
+ <MudTd DataLabel="部屋No">@childItem.Cells[(int)SaleChildRow.ColType.RoomID]</MudTd>
+ <MudTd DataLabel="科目名称">@childItem.Cells[(int)SaleChildRow.ColType.ItemName]</MudTd>
+ <MudTd DataLabel="人数">@childItem.Cells[(int)SaleChildRow.ColType.PersonCount]</MudTd>
+ <MudTd DataLabel="内女">@childItem.Cells[(int)SaleChildRow.ColType.Woman]</MudTd>
+ <MudTd DataLabel="基本単価">@childItem.Cells[(int)SaleChildRow.ColType.UnitPrice]</MudTd>
+ <MudTd DataLabel="割引">@childItem.Cells[(int)SaleChildRow.ColType.DiscountSummary]</MudTd>
+ <MudTd DataLabel="合計金額">@childItem.Cells[(int)SaleChildRow.ColType.TotalSummary]</MudTd>
+ <MudTd DataLabel="集計日">@childItem.Cells[(int)SaleChildRow.ColType.SumDate]</MudTd>
+ <MudTd>
+ </MudTd>
+ </RowTemplate>
+ </MudTable>
+ <MudDivider DividerType="DividerType.FullWidth" Class="my-1" />
+ </MudItem>
+ <MudItem lg="10" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudGrid Spacing="3" Justify="Justify.FlexStart">
+ <MudItem lg="3">
+ <MudGrid Spacing="1" Justify="Justify.FlexStart">
+ <MudItem xs="9">
+ <MudGrid Spacing="0" Justify="Justify.FlexStart">
+ <MudItem xs="5">
+ <MudTextField Class="input-pink" @bind-Value="searchString" T="string" Label="サ料" AutoFocus="true" Margin="Margin.Dense" MaxLength="10" />
+ </MudItem>
+ <MudItem xs="7">
+ <MudField Margin="Margin.Dense">なし</MudField>
+ </MudItem>
+ </MudGrid>
+ </MudItem>
+ <MudItem xs="3">
+ <MudTextField @bind-Value="searchString" T="string" Label="サ率" Margin="Margin.Dense" MaxLength="10" />
+ </MudItem>
+ </MudGrid>
+ </MudItem>
+ <MudItem lg="6">
+ <MudGrid Spacing="1" Justify="Justify.FlexStart">
+ <MudItem xs="5">
+ <MudGrid Spacing="0" Justify="Justify.FlexStart">
+ <MudItem xs="5">
+ <MudTextField Class="input-pink" @bind-Value="searchString" T="string" Label="消費税" Margin="Margin.Dense" MaxLength="10" />
+ </MudItem>
+ <MudItem xs="7">
+ <MudField Margin="Margin.Dense">なし</MudField>
+ </MudItem>
+ </MudGrid>
+ </MudItem>
+ <MudItem xs="2">
+ <MudTextField @bind-Value="searchString" T="string" Label="税率" Margin="Margin.Dense" MaxLength="10" />
+ </MudItem>
+ <MudItem xs="5">
+ <MudGrid Spacing="0" Justify="Justify.FlexStart">
+ <MudItem xs="5">
+ <MudTextField Class="input-pink" @bind-Value="searchString" T="string" Label="タイプ" Margin="Margin.Dense" MaxLength="10" />
+ </MudItem>
+ <MudItem xs="7">
+ <MudField Margin="Margin.Dense">軽減税</MudField>
+ </MudItem>
+ </MudGrid>
+ </MudItem>
+ </MudGrid>
+ </MudItem>
+ <MudItem lg="3">
+ <MudGrid Spacing="0" Justify="Justify.FlexStart">
+ <MudItem xs="5">
+ <MudTextField Class="input-pink" @bind-Value="searchString" T="string" Label="入湯税" Margin="Margin.Dense" MaxLength="10" />
+ </MudItem>
+ <MudItem xs="7">
+ <MudField Margin="Margin.Dense">なし</MudField>
+ </MudItem>
+ </MudGrid>
+ </MudItem>
+ <MudItem lg="12">
+ <MudGrid Spacing="3" Justify="Justify.FlexStart">
+ <MudItem xs="4">
+ <MudGrid Spacing="1" Justify="Justify.FlexStart">
+ <MudItem xs="8">
+ <MudGrid Spacing="0" Justify="Justify.FlexStart">
+ <MudItem xs="5">
+ <MudTextField Class="input-pink" @bind-Value="searchString" T="string" Label="宿泊税" Margin="Margin.Dense" MaxLength="10" />
+ </MudItem>
+ <MudItem xs="7">
+ <MudField Margin="Margin.Dense">なし</MudField>
+ </MudItem>
+ </MudGrid>
+ </MudItem>
+ <MudItem xs="4">
+ <MudTextField @bind-Value="searchString" T="string" Label="宿泊税額" Margin="Margin.Dense" MaxLength="10" />
+ </MudItem>
+ </MudGrid>
+ </MudItem>
+ <MudItem xs="3">
+ <MudGrid Spacing="0" Justify="Justify.FlexStart">
+ <MudItem xs="5">
+ <MudTextField Class="input-pink" @bind-Value="searchString" T="string" Label="端数区分" Margin="Margin.Dense" MaxLength="10" />
+ </MudItem>
+ <MudItem xs="6">
+ <MudField Margin="Margin.Dense">なし</MudField>
+ </MudItem>
+ </MudGrid>
+ </MudItem>
+ <MudItem xs="3">
+ <MudGrid Spacing="0" Justify="Justify.FlexStart">
+ <MudItem xs="5">
+ <MudTextField Class="input-pink" @bind-Value="searchString" T="string" Label="印字区分" Margin="Margin.Dense" MaxLength="10" />
+ </MudItem>
+ <MudItem xs="7">
+ <MudField Margin="Margin.Dense">なし</MudField>
+ </MudItem>
+ </MudGrid>
+ </MudItem>
+ <MudItem xs="2">
+ <MudTextField Class="input-pink" @bind-Value="searchString" T="string" Label="集計日" Margin="Margin.Dense" MaxLength="7" />
+ </MudItem>
+ </MudGrid>
+ </MudItem>
+ </MudGrid>
+ </MudItem>
+ <MudItem lg="2" Class="mt-0 pt-0 mb-0 pb-0">
+ <MudGrid Spacing="1" Justify="Justify.FlexStart" Class="pt-2 pb-2">
+ @foreach(var feeItem in FeeDetailList)
+ {
+ <MudItem xs="5" Class="pt-0 pb-0">
+ <MudText Typo="Typo.body1" Align="Align.Left">@feeItem.Name</MudText>
+ </MudItem>
+ <MudItem xs="7" Class="pt-0 pb-0">
+ <MudText Typo="Typo.body1" Align="Align.Right">@feeItem.Value</MudText>
+ </MudItem>
+ }
+ </MudGrid>
+ </MudItem>
+ </MudGrid>
+ }
+ else if (context.ActiveCol == (int)SaleInputRow.ColType.ItemName)
+ {
+
+ }
+ </MudCardContent>
+ </MudCard>
+ </td>
+ <td></td>
+ </MudTr>
+ }
+ </ChildRowContent>
+ </MudTable>
+ </MudCardContent>
+</MudCard>
+
+<style>
+ div.slip-edit th:last-child {
+ display: none;
+ }
+
+ div.slip-edit td:last-child {
+ display: none;
+ }
+
+ div.slip-edit .mud-table-cell:nth-last-child(2) {
+ padding: 6px 2px 6px 16px;
+ padding-inline-start: 16px;
+ padding-inline-end: 2px;
+ }
+</style>
+
+@code {
+ private static RenderFragment RenderMessage(string text) =>@<MessageContext Text="@text" />;
+}
\ No newline at end of file
diff --git a/HotelPms.Client.Blazor/Pages/UseDetail/SaleInput.razor.cs b/HotelPms.Client.Blazor/Pages/UseDetail/SaleInput.razor.cs
new file mode 100644
index 0000000..16b9d06
--- /dev/null
+++ b/HotelPms.Client.Blazor/Pages/UseDetail/SaleInput.razor.cs
@@ -0,0 +1,648 @@
+using HotelPms.Client.Blazor.Dialog;
+using HotelPms.Client.Blazor.Models;
+using HotelPms.Client.Blazor.Util;
+using HotelPms.Data.Common;
+using HotelPms.Share.IO;
+using HotelPms.Share.Util;
+using Microsoft.AspNetCore.Components;
+using Microsoft.AspNetCore.Components.Web;
+using MudBlazor;
+using static HotelPms.Client.Blazor.Util.SystemEnum;
+
+namespace HotelPms.Client.Blazor.Pages.UseDetail;
+
+public partial class SaleInput : ComponentBase
+{
+ [Parameter] public ViewModel.UseInput? Data { get; set; }
+ [Parameter] public Action OnRefresh { get; set; }
+
+ private System.Threading.SemaphoreSlim slimlock = new SemaphoreSlim(1, 1);
+
+ private IEnumerable<FeeDtailRow> FeeDetailList = new List<FeeDtailRow>();
+
+ private IEnumerable<SaleChildRow> SaleChildList = new List<SaleChildRow>();
+
+ private SaleInputRow selectedItem1 = null;
+ private List<string> editEvents = new();
+ private string searchString = "";
+ private string RowSpaceStyle = "mt-2 pt-0 mb-0 pb-0";
+ private MudTable<SaleInputRow> _table;
+
+ private bool keyDownPreventDefault = false;
+ private bool keyPressPreventDefault = false;
+ private bool enterPush = false;
+ private bool arrowUpPush = false;
+
+ private EditGridFocusEventArgs m_CurrentFocusData = new EditGridFocusEventArgs();
+
+ protected override void OnInitialized()
+ {
+ //EnvironmentSetting.Debug($"SaleInput.OnInitialized開始:");
+ base.OnInitialized();
+ }
+
+ protected override void OnAfterRender(bool firstRender)
+ {
+ //EnvironmentSetting.Debug($"SaleInput.OnAfterRender開始:{firstRender}");
+ base.OnAfterRender(firstRender);
+ }
+
+ protected override async Task OnAfterRenderAsync(bool firstRender)
+ {
+ await slimlock.WaitAsync();
+ EnvironmentSetting.Debug($"SaleInput.OnAfterRenderAsync開始:{firstRender}");
+ await ShowFocus();
+ EnvironmentSetting.Debug($"SaleInput.OnAfterRenderAsync終了:{firstRender}");
+ slimlock.Release();
+ }
+
+ /// <summary>
+ /// フォーカス移動準備
+ /// </summary>
+ /// <param name="row"></param>
+ /// <param name="col"></param>
+ /// <param name="action">EditModeの場合、自動で次のフォーカス移動する</param>
+ private void SetFocus(int row, int col, EditGridFocusEventArgs.ActionType action = EditGridFocusEventArgs.ActionType.Focus)
+ {
+ EnvironmentSetting.Debug($"フォーカス移動準備:開始⇒Row:{row},Col:{col},Action:{action},Enabled:{m_CurrentFocusData.Enabled}");
+ m_CurrentFocusData.Row = row;
+ m_CurrentFocusData.Col = col;
+ m_CurrentFocusData.Action = action;
+ m_CurrentFocusData.Enabled = true;
+ EnvironmentSetting.Debug($"フォーカス移動準備:完了⇒Row:{row},Col:{col},Action:{action},Enabled:{m_CurrentFocusData.Enabled}");
+ }
+
+ /// <summary>
+ /// OnAfterRenderAsync時フォーカスを設定
+ /// </summary>
+ private async Task<bool> ShowFocus()
+ {
+ try
+ {
+ EnvironmentSetting.Debug($"SaleInput.FocusAsync行Before:Row={m_CurrentFocusData.Row},Col={m_CurrentFocusData.Col},Action={m_CurrentFocusData.Action},Enabled={m_CurrentFocusData.Enabled}");
+ if (!m_CurrentFocusData.Enabled)
+ {
+ EnvironmentSetting.Debug($"OnAfterRenderAsync⇒return false");
+ return false;
+ }
+ m_CurrentFocusData.Enabled = false;
+
+ EnvironmentSetting.Debug($"ShowFocus処理:Row={m_CurrentFocusData.Row},Col={m_CurrentFocusData.Col},Action={m_CurrentFocusData.Action},Enabled={m_CurrentFocusData.Enabled}");
+ if (m_CurrentFocusData.Action == EditGridFocusEventArgs.ActionType.Focus && m_CurrentFocusData.Row != -1 && m_CurrentFocusData.Col != -1)
+ {
+ //この時点Grid編集状態ですので、フォーカス可能になる
+ EnvironmentSetting.Debug($"フォーカスへ開始:Row = {m_CurrentFocusData.Row}, Col = {m_CurrentFocusData.Col}");
+ await (Data.SaleList as List<SaleInputRow>)[m_CurrentFocusData.Row].Cells[m_CurrentFocusData.Col].Ref.FocusAsync(); //ここに再度OnAfterRenderAsyncに入るが、EnabledはFalseのため、ShowFocusの動作がしない
+ EnvironmentSetting.Debug($"フォーカスへ完了:Row = {m_CurrentFocusData.Row}, Col = {m_CurrentFocusData.Col}");
+ }
+ return true;
+ }
+ catch(Exception ex)
+ {
+ EnvironmentSetting.Debug(ex.Message);
+ return false;
+ }
+ }
+
+ //protected override async Task OnAfterRenderAsync(bool firstRender)
+ //{
+ // EnvironmentSetting.Debug($"SaleInput.OnAfterRenderAsync開始:{firstRender}");
+ // //await ShowFocus();
+ // //await JSInteropEx.DelGridCol(JSRuntime, "SaleInputTable", 11);
+ //}
+
+ protected override void OnParametersSet()
+ {
+ EnvironmentSetting.Debug($"SaleInput.OnParametersSet開始:");
+ base.OnParametersSet();
+ }
+
+ protected override bool ShouldRender()
+ {
+ EnvironmentSetting.Debug($"SaleInput.ShouldRender開始:");
+ return base.ShouldRender();
+ }
+
+ private async Task KeyPress(int index, SaleInputRow data, KeyboardEventArgs e)
+ {
+ //if (e.Key == "Enter")
+ //{
+ // List<SaleInputRow> list = (Data.SaleList as List<SaleInputRow>);
+ // int rowIdx = list.IndexOf(selectedItem1);
+
+ // // https://bytemeta.vip/repo/MudBlazor/MudBlazor/issues/4192
+ // // https://github.com/MudBlazor/MudBlazor/issues/3292
+ // SaleInputRow newitem = (rowIdx == list.Count - 1) ? list[0] : list[rowIdx + 1];
+ // _table.SetSelectedItem(newitem);
+ // _table.SetEditingItem(newitem);
+ // await Task.Delay(50); //画面更新のため
+ // await newitem.Cells[(int)SaleInputRow.ColType.ItemName].Ref.FocusAsync(); //OnAfterRenderAsyncへ
+ //}
+
+ if (e.Key == "Enter")
+ {
+ try
+ {
+ int rowIdx = GetRowIndex(data);
+ Console.WriteLine($"Row:{rowIdx} Col:{index}");
+ Console.WriteLine("Data:" + CConvert.ToJsonText<SaleInputRow>(data));
+
+ //※その時、Fields[index].Textの値まだ変っていない!!!!!
+ string text = await data.GetInputValue(index, JSRuntime);
+ EnvironmentSetting.Debug($"Return:{index}⇒{text}");
+ keyPressPreventDefault = true; //イベント中止
+ enterPush = true; //Enterを押した知らせ
+
+ //通常チェックを行う
+ if (!await IsValid(index, text, data, true)) { return; }
+
+ if (!SetAutoNextFocus(index, true, data)) { return; }
+ }
+ catch (Exception ex)
+ {
+ OperationLog.Instance.WriteLog($"KeyPress:{ex.Message}");
+ }
+ finally
+ {
+ Refresh("KeyPress"); //UI更新(binding値変更通知)
+ }
+ }
+ else
+ {
+ if (index == (int)SaleInputRow.ColType.PersonCount || index == (int)SaleInputRow.ColType.UnitPrice)
+ {
+ if (CConvert.IsNumPress(e.Key))
+ {
+ keyPressPreventDefault = false;
+ }
+ else
+ {
+ keyPressPreventDefault = true; //入力禁止(※:IMEモードで入力したものをここでは通らないため、防げない)
+ }
+ }
+ else
+ {
+ keyPressPreventDefault = false;
+ }
+ enterPush = false;
+ }
+ }
+
+ /// <summary>
+ /// フォーカス移動
+ /// </summary>
+ /// <param name="index">列Index</param>
+ /// <param name="isEnter"></param>
+ /// <returns></returns>
+ private bool SetAutoNextFocus(int index, bool isEnter, SaleInputRow data)
+ {
+ try
+ {
+ int rowIdx = GetRowIndex(data);
+ List<SaleInputRow> list = (Data.SaleList as List<SaleInputRow>);
+ if (isEnter)
+ {
+ if (rowIdx == -1) { return true; } //削除された場合
+
+ if (index == (int)SaleInputRow.ColType.Page)
+ {
+ if (rowIdx < (list.Count - 1))
+ {
+ //OnAfterRenderAsync:閲覧状態且つ新規行表示⇒編集状態⇒次項目へフォーカス
+ SetFocus(rowIdx + 1, (int)SaleInputRow.ColType.ItemName);
+ }
+ }
+ else if (index == (int)SaleInputRow.ColType.DiscountSummary)
+ {
+ SetFocus(rowIdx, index + 2);
+ }
+ else
+ {
+ SetFocus(rowIdx, index + 1);
+ }
+ }
+ else
+ {
+ if (index == (int)SaleInputRow.ColType.ItemName)
+ {
+ if (rowIdx > 0)
+ {
+ SetFocus(rowIdx - 1, (int)SaleInputRow.ColType.ItemName);
+ }
+ }
+ else if (index == (int)SaleInputRow.ColType.SumDate)
+ {
+ SetFocus(rowIdx, index - 2);
+ }
+ else
+ {
+ SetFocus(rowIdx, index - 1);
+ }
+ }
+ return true;
+ }
+ catch
+ {
+ return false;
+ }
+ }
+
+ private void DetailClick(SaleInputRow data)
+ {
+ //Snackbar.Add("詳細表示");
+ List<FeeDtailRow> list = FeeDetailList as List<FeeDtailRow>;
+ list.Clear();
+ list.Add(new() { Name = "本体額", Value = "10,000000" });
+ list.Add(new() { Name = "サービス", Value = "2,000" });
+ list.Add(new() { Name = "消費税", Value = "100" });
+ list.Add(new() { Name = "入湯税", Value = "250" });
+ list.Add(new() { Name = "宿泊税", Value = "400" });
+ list.Add(new() { Name = "合 計", Value = "16,850" });
+
+ List<SaleChildRow> listChild = SaleChildList as List<SaleChildRow>;
+ listChild.Clear();
+ SaleChildRow row = new();
+ row.Cells[0] = "S";
+ row.Cells[1] = "101";
+ row.Cells[2] = "基本料金";
+ listChild.Add(row);
+
+ row = new();
+ row.Cells[0] = "S";
+ row.Cells[1] = "101";
+ row.Cells[2] = "朝食";
+ listChild.Add(row);
+
+ data.ActiveCol = (int)SaleInputRow.ColType.Detail;
+ data.ShowDetails = !data.ShowDetails;
+ }
+
+ private void OnCommitEditButtonClicked(MouseEventArgs e)
+ {
+ _table.RowEditCommit?.Invoke(_table.SelectedItem);
+ _table.OnCommitEditClick.InvokeAsync(e);
+ _table.SetSelectedItem(null);
+ }
+
+ private async Task Save()
+ {
+ (Data.SaleList as List<SaleInputRow>).Add(new());
+ //SaleInputRow newitem = (Data.SaleList as List<SaleInputRow>)[5];
+ ////await Task.Delay(50);
+ //_table.SetSelectedItem(newitem);
+ //_table.SetEditingItem(newitem);
+ await Task.Delay(50);
+ //await newitem.Cells[(int)SaleInputRow.ColType.ItemName].Ref.FocusAsync();
+ }
+
+ private async Task KeyDown(int index, SaleInputRow data, KeyboardEventArgs e)
+ {
+ if (e.Key == "ArrowUp")
+ {
+ try
+ {
+ EnvironmentSetting.Debug($"ArrowUp:{index}");
+ if (SetAutoNextFocus(index, false, data))
+ {
+ //BlazorのBugでEnterのパラメータ変数できない!
+ //Uncaught Error: System.ArgumentException: There is no event handler associated with this event. EventId: '290'. (Parameter 'eventHandlerId')
+ //mkArtakMSFT modified the milestones: Next sprint planning, 6.0-preview4 on 20 Mar ← Net6.0-preview4対応だそう
+ keyDownPreventDefault = true;
+ arrowUpPush = true;
+ }
+ else
+ {
+ keyDownPreventDefault = false;
+ arrowUpPush = false;
+ }
+ }
+ catch (Exception ex)
+ {
+ OperationLog.Instance.WriteLog($"KeyDown:{ex.Message}");
+ }
+ finally
+ {
+ Refresh("KeyDown⇒↑"); //UI更新(binding値変更通知)
+ }
+ }
+ else if (e.Key == "End")
+ {
+ if (data.Cells[index].ShowStyle == EShowStyle.ShowList)
+ {
+ data.ActiveCol = index;
+ if (index == (int)SaleInputRow.ColType.SumDate)
+ {
+ var parameters = new DialogParameters { ["Title"] = $"集計日選択", ["Data"] = CConvert.ToDateTime(data.Cells[index].Text) };
+ var dialog = DialogService.Show<SelectDate>(string.Empty, parameters);
+ var ret = await dialog.Result;
+ if (!ret.Cancelled)
+ {
+ EnvironmentSetting.Debug(ret.Data.ToString());
+ data.Cells[index].Text = ret.Data.ToString();
+ //StateHasChanged();
+ }
+ }
+ else
+ {
+ data.ShowDetails = !data.ShowDetails;
+ }
+ }
+ }
+ else if (e.Key == "Delete")
+ {
+ if (index == (int)SaleInputRow.ColType.ItemName)
+ {
+ int rowIdx = GetRowIndex(data);
+ List<SaleInputRow> list = (Data.SaleList as List<SaleInputRow>);
+ bool isLastRow = rowIdx == (list.Count - 1);
+ if (isLastRow) { return; }
+ SetFocus(rowIdx, (int)SaleInputRow.ColType.ItemName);
+ EnvironmentSetting.Debug($"削除前件数:{list.Count}");
+ list.Remove(data);
+ EnvironmentSetting.Debug($"削除後件数:{list.Count}");
+ keyDownPreventDefault = false;
+ arrowUpPush = false;
+ }
+ }
+ else
+ {
+ keyDownPreventDefault = false;
+ arrowUpPush = false;
+ }
+
+ }
+
+ private async Task Enter(int index, SaleInputRow data, FocusEventArgs e)
+ {
+ await slimlock.WaitAsync();
+ int rowIdx = GetRowIndex(data);
+ Console.WriteLine($"Enter⇒Row:{rowIdx} Col:{index}");
+ slimlock.Release();
+ //ここは必ずUI更新
+ }
+
+ private async Task Leave(int index, SaleInputRow data, FocusEventArgs e)
+ {
+ string text = string.Empty;
+ try
+ {
+ await slimlock.WaitAsync();
+ Console.WriteLine($"Leave⇒Start");
+ int rowIdx = GetRowIndex(data);
+ text = data.GetCellText(index);
+ Console.WriteLine($"Leave⇒Row:{rowIdx} Col:{index} enterPush:{enterPush}, text:{text}");
+
+ if (enterPush)
+ {
+ //Enterキーを押した時にも既にチェック済
+ enterPush = false;
+ }
+ else
+ {
+ //値変更したら、イベント発生
+ if (!data.IsValueChanged(index, text))
+ {
+ //必須判断:初期表示時:OrgTextは空白のため、値変更しないまま
+ return;
+ }
+
+ //通常チェックを行う
+ if (!await IsValid(index, text, data, false))
+ {
+ return;
+ }
+
+ //Refresh("Leave(変更あり)"); //UI更新(binding値変更通知)
+ }
+ }
+ catch (Exception ex)
+ {
+ OperationLog.Instance.WriteLog($"Leave:{ex.Message}");
+ }
+ finally
+ {
+ //Refresh(); //UI更新(binding値変更通知)
+ Console.WriteLine($"Leave⇒End");
+ slimlock.Release();
+
+ //ここは必ずUI更新
+ }
+ }
+
+ private int GetRowIndex(SaleInputRow data)
+ {
+ return (Data.SaleList as List<SaleInputRow>).IndexOf(data);
+ }
+
+ /// <summary>
+ /// 業務チェック処理
+ /// </summary>
+ /// <param name="index"></param>
+ /// <param name="inputText"></param>
+ /// <param name="data"></param>
+ /// <param name="isEnter"></param>
+ /// <returns></returns>
+ private async Task<bool> IsValid(int index, string inputText, SaleInputRow data, bool isEnter)
+ {
+ int rowIdx = GetRowIndex(data);
+ //最終行判断
+ List<SaleInputRow> list = (Data.SaleList as List<SaleInputRow>);
+ bool isLastRow = rowIdx == (list.Count - 1);
+
+ if (index == (int)SaleInputRow.ColType.ItemName)
+ {
+ if (!await IsValidItemName(rowIdx, inputText, data, isEnter, isLastRow, true))
+ {
+ return false;
+ }
+ }
+ else if(index == (int)SaleInputRow.ColType.SumDate)
+ {
+ }
+ else
+ {
+
+ }
+ return true;
+ }
+
+
+
+ private RenderFragment RenderWidget(string msg) => builder =>
+ {
+ builder.OpenComponent(0, typeof(MessageContext));
+ builder.AddAttribute(1, "Text", msg);
+ builder.CloseComponent();
+ };
+
+ /// <summary>
+ ///
+ /// </summary>
+ /// <param name="inputText"></param>
+ /// <param name="data"></param>
+ /// <param name="isEnter"></param>
+ /// <param name="isLastRow">Trueの場合、必ずID</param>
+ /// <param name="isAny">True:ID or Name False:ID</param>
+ /// <returns></returns>
+ private async Task<bool> IsValidItemName(int rowIdx, string inputText, SaleInputRow data, bool isEnter, bool isLastRow, bool isAny)
+ {
+ if (inputText.Trim().Length == 0) { return true; }
+ HotelPms.Data.UseInfo.Sale curSale = data.GetSale();
+ bool nameChanged = false;
+
+ if (isLastRow)
+ {
+ if (!CanCreateSale()) { return true; }
+ }
+ else
+ {
+ //変更されたかどうか
+ bool isChanged = false;
+ if (isAny)
+ {
+ //直接入力する(数字の場合、ItemIDで扱う)
+ if (CConvert.IsWholeNumber(inputText))
+ {
+ if (curSale.IsReadOnly()) { return true; }
+ if (inputText.PadLeft(50, '0') != curSale.ItemID.PadLeft(50, '0')) { isChanged = true; } else { data.RestoreText(SaleInputRow.ColType.ItemName); }
+ }
+ else
+ {
+ if (inputText != curSale.ItemName) { isChanged = true; nameChanged = true; }
+ }
+ }
+ else
+ {
+ //Endキーより別の科目を選択など
+ if (inputText != curSale.ItemID) { isChanged = true; }
+ }
+ if (!isChanged) { return true; } //変更しなかったら
+ }
+
+ if (!RaiseValueChanged((int)SaleInputRow.ColType.ItemName, data)) { return false; } //変更イベント通知
+
+ //名称変更のみ
+ if (nameChanged)
+ {
+ data.SetDataField((int)SaleInputRow.ColType.ItemName, inputText);
+ return true;
+ }
+
+ //入力値はItemIDと処理する
+ HotelPms.Data.Master.Item item = await MasterCore.GetItem(inputText);
+ if (item == null)
+ {
+ //科目が存在しない
+ if (isEnter) { Message.Show(RenderMessage(inputText)); }
+ data.RestoreText(SaleInputRow.ColType.ItemName);
+ return false;
+ }
+
+ if (isLastRow)
+ {
+ int saleID = await EnvironmentSetting.GetSeq(ESeqType.Sale);
+ int taxRate = await EnvironmentSetting.GetTaxRate(Data.SelUseRoomRow.UseRoom.UseDate.ToText(), item.TaxType);
+ curSale = Data.SelUseRoomRow.UseRoom.AddSaleByItem(saleID, taxRate, item); //選択された部屋より追加
+ data.DataList[rowIdx] = curSale;
+ }
+ else
+ {
+ //既存行の科目変更
+ if (curSale.ItemKind == (int)EItemKind.StayBase || curSale.ItemKind == (int)EItemKind.DayUseBase)
+ {
+ if (item.Kind != (int)EItemKind.StayBase && item.Kind != (int)EItemKind.DayUseBase)
+ {
+ if (isEnter) { Message.Show(RenderMessage("基本科目を入力してください。")); }
+ data.RestoreText(SaleInputRow.ColType.ItemName);
+ return false;
+ }
+ }
+ else
+ {
+ if (item.Kind == (int)EItemKind.StayBase || item.Kind == (int)EItemKind.DayUseBase)
+ {
+ if (isEnter) { Message.Show(RenderMessage("追加科目を入力してください。")); }
+ data.RestoreText(SaleInputRow.ColType.ItemName);
+ return false;
+ }
+ }
+
+ HotelPms.Data.UseInfo.UseRoom useRoom;
+ HotelPms.Data.UseInfo.Sale newSale;
+ if (Data.SaleDispType == ESaleDispType.Normal)
+ {
+ useRoom = curSale.Parent as HotelPms.Data.UseInfo.UseRoom;
+ useRoom.RemoveSale(curSale);
+ int saleID = await EnvironmentSetting.GetSeq(ESeqType.Sale);
+ int taxRate = await EnvironmentSetting.GetTaxRate(useRoom.UseDate.ToText(), item.TaxType);
+ newSale = useRoom.AddSaleByItem(saleID, taxRate, item, curSale);
+ data.DataList.Clear();
+ data.DataList.Add(newSale);
+ }
+ else
+ {
+ //まとめモードの変更
+ List<HotelPms.Data.UseInfo.Sale> copyList = new List<HotelPms.Data.UseInfo.Sale>();
+ copyList.AddRange(data.DataList);
+ foreach (HotelPms.Data.UseInfo.Sale tagSlip in copyList)
+ {
+ curSale = tagSlip as HotelPms.Data.UseInfo.Sale;
+ useRoom = curSale.Parent as HotelPms.Data.UseInfo.UseRoom;
+ useRoom.RemoveSale(curSale); //元の伝票を削除
+ int saleID = await EnvironmentSetting.GetSeq(ESeqType.Sale);
+ int taxRate = await EnvironmentSetting.GetTaxRate(useRoom.UseDate.ToText(), item.TaxType);
+ newSale = useRoom.AddSaleByItem(saleID, taxRate, item, curSale); //新伝票の追加
+ int orgSlipIndex = data.DataList.IndexOf(curSale);
+ data.DataList[orgSlipIndex] = newSale; //切替える
+ }
+ }
+ }
+
+
+ data.SetDataField((int)SaleInputRow.ColType.ItemName, item.Name);
+
+ //画面表示(イベントを起こすため、必ず一番最後)
+ data.Cells[(int)SaleInputRow.ColType.ItemName].Text = item.Name;
+
+ //新規行追加
+ if (isLastRow)
+ {
+ //OnAfterRenderAsync:閲覧状態且つ新規行表示⇒編集状態⇒次項目へフォーカス
+ SetFocus(rowIdx, (int)SaleInputRow.ColType.PersonCount);
+ EnvironmentSetting.Debug($"新規行追加⇒開始");
+ (Data.SaleList as List<SaleInputRow>).Add(new());
+ EnvironmentSetting.Debug($"新規行追加⇒終了");
+ return false; //次の列SetAutoNextFocus行かない
+ }
+ return true;
+ }
+
+ /// <summary>
+ /// 新規伝票可能かどうか
+ /// </summary>
+ /// <returns></returns>
+ private bool CanCreateSale()
+ {
+ return true;
+ }
+
+ /// <summary>
+ /// 値変更
+ /// </summary>
+ public bool RaiseValueChanged(int index, SaleInputRow data)
+ {
+ return true;
+ }
+
+ /// <summary>
+ /// コントロール再表示
+ /// </summary>
+ public void Refresh(string type)
+ {
+ EnvironmentSetting.Debug($"再表示へ開始:{type}");
+ StateHasChanged();
+ EnvironmentSetting.Debug($"再表示へ終了:{type}");
+ //await InvokeAsync(StateHasChanged);
+ //OnRefresh?.Invoke();
+ }
+}
diff --git a/HotelPms.Client.Blazor/Pages/UseDetail/SaleInput.razor.css b/HotelPms.Client.Blazor/Pages/UseDetail/SaleInput.razor.css
new file mode 100644
index 0000000..9690473
--- /dev/null
+++ b/HotelPms.Client.Blazor/Pages/UseDetail/SaleInput.razor.css
@@ -0,0 +1,3 @@
+/*::deep .mud-typography-body2 {
+ font-size: 3rem;
+}*/
diff --git a/HotelPms.Client.Blazor/Program.cs b/HotelPms.Client.Blazor/Program.cs
new file mode 100644
index 0000000..647a39c
--- /dev/null
+++ b/HotelPms.Client.Blazor/Program.cs
@@ -0,0 +1,98 @@
+using Blazored.LocalStorage;
+using Grpc.Core;
+using Grpc.Net.Client;
+using Grpc.Net.Client.Web;
+using HotelPms.Client.Blazor;
+using HotelPms.Client.Blazor.Services;
+using HotelPms.Client.Blazor.Util;
+using Microsoft.AspNetCore.Components;
+using Microsoft.AspNetCore.Components.Authorization;
+using Microsoft.AspNetCore.Components.Web;
+using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
+using MudBlazor;
+using MudBlazor.Services;
+
+
+AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
+
+static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
+{
+ EnvironmentSetting.Debug("CurrentDomain_UnhandledException");
+}
+
+var builder = WebAssemblyHostBuilder.CreateDefault(args);
+builder.RootComponents.Add<App>("#app");
+builder.RootComponents.Add<HeadOutlet>("head::after");
+
+builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
+builder.Services.AddMudServices(config =>
+{
+ config.SnackbarConfiguration.PositionClass = Defaults.Classes.Position.TopCenter;
+
+ config.SnackbarConfiguration.PreventDuplicates = false;
+ config.SnackbarConfiguration.NewestOnTop = false;
+ config.SnackbarConfiguration.ShowCloseIcon = true;
+ config.SnackbarConfiguration.VisibleStateDuration = 10000;
+ config.SnackbarConfiguration.HideTransitionDuration = 500;
+ config.SnackbarConfiguration.ShowTransitionDuration = 500;
+ config.SnackbarConfiguration.SnackbarVariant = Variant.Filled;
+});
+builder.Services.AddBlazoredLocalStorage();
+builder.Services.AddSingleton<IGlobalLoadingSpinner, DefaultGlobalLoadingSpinner>();
+builder.Services.AddAuthorizationCore();
+builder.Services.AddScoped<AuthenticationStateProvider, ApiAuthenticationStateProvider>();
+builder.Services.AddScoped<IAuthService, AuthService>();
+
+EnvironmentSetting.IsDevelopment = builder.HostEnvironment.IsDevelopment();
+EnvironmentSetting.Init(builder.Configuration);
+EnvironmentSetting.ServiceCollection = builder.Services;
+
+builder.Services.AddSingleton(services =>
+{
+ if (EnvironmentSetting.BackendUrl.Length == 0)
+ {
+ var navigationManager = services.GetRequiredService<NavigationManager>();
+ EnvironmentSetting.BackendUrl = navigationManager.BaseUri;
+ }
+
+ var loadingSpinner = services.GetService<IGlobalLoadingSpinner>();
+ var handler = new GrpcSubDirHandler(new HttpClientHandler(), loadingSpinner, EnvironmentSetting.SubDir);
+ GrpcWebHandler httpHandler = new GrpcWebHandler(GrpcWebMode.GrpcWebText, handler); //Base64
+ //GrpcWebHandler httpHandler = new GrpcWebHandler(GrpcWebMode.GrpcWeb, handler);
+
+ //拦截器(当grpc客户端每次发起请求会通过这里获取http头信息,可以再里面判定过期)
+ var credentials = CallCredentials.FromInterceptor((context, metadata) =>
+ {
+ if (!string.IsNullOrEmpty(ApiAuthenticationStateProvider.AccessToken))
+ {
+ EnvironmentSetting.Debug($"CallCredentials.FromInterceptor:Bearer {ApiAuthenticationStateProvider.AccessToken}");
+ metadata.Add("Authorization", $"Bearer {ApiAuthenticationStateProvider.AccessToken}");
+ }
+ return Task.CompletedTask;
+ });
+
+
+ GrpcChannel channel = GrpcChannel.ForAddress(EnvironmentSetting.BackendUrl, new GrpcChannelOptions
+ {
+ HttpHandler = httpHandler,
+ Credentials = ChannelCredentials.Create(new SslCredentials(), credentials)
+ });
+
+ //using Grpc.Core.Interceptors; //必须引入
+
+ //var channel = GrpcChannel.ForAddress("https://localhost:5001");
+ //// 完整写法
+ //var invoker = channel.CreateCallInvoker().Intercept(new GRPCClientLoggingInterceptor());
+ //var client = new Greeter.GreeterClient(invoker);
+ //await client.SayHelloAsync(new HelloRequest() { Name = "长安书小妆" });
+
+ EnvironmentSetting.GrpcChannel = channel;
+ return channel;
+});
+
+builder.Services.AddJsInputCore();
+
+var host = builder.Build();
+EnvironmentSetting.ServiceProvider = host.Services;
+await host.RunAsync();
+//await builder.Build().RunAsync();
diff --git a/HotelPms.Client.Blazor/Properties/launchSettings.json b/HotelPms.Client.Blazor/Properties/launchSettings.json
new file mode 100644
index 0000000..d73ad22
--- /dev/null
+++ b/HotelPms.Client.Blazor/Properties/launchSettings.json
@@ -0,0 +1,41 @@
+{
+ "$schema": "http://json.schemastore.org/launchsettings.json",
+ "iisSettings": {
+ "windowsAuthentication": false,
+ "anonymousAuthentication": true,
+ "iisExpress": {
+ "applicationUrl": "http://localhost:4005",
+ "sslPort": 44322
+ }
+ },
+ "profiles": {
+ "http": {
+ "commandName": "Project",
+ "dotnetRunMessages": true,
+ "launchBrowser": true,
+ "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
+ "applicationUrl": "http://localhost:5220",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ },
+ "https": {
+ "commandName": "Project",
+ "dotnetRunMessages": true,
+ "launchBrowser": true,
+ "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
+ "applicationUrl": "https://localhost:7295;http://localhost:5220",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ },
+ "IIS Express": {
+ "commandName": "IISExpress",
+ "launchBrowser": true,
+ "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/Services/AuthService.cs b/HotelPms.Client.Blazor/Services/AuthService.cs
new file mode 100644
index 0000000..6aa89a5
--- /dev/null
+++ b/HotelPms.Client.Blazor/Services/AuthService.cs
@@ -0,0 +1,78 @@
+using Blazored.LocalStorage;
+using HotelPms.Client.Blazor.Util;
+using HotelPms.Data;
+using Grpc.Net.Client;
+using Microsoft.AspNetCore.Components;
+using Microsoft.AspNetCore.Components.Authorization;
+using System.Net.Http;
+using System.Net.Http.Headers;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Channels;
+using System.Threading.Tasks;
+using HotelPms.DataAccessGrpc.Client;
+
+namespace HotelPms.Client.Blazor.Services
+{
+ internal class AuthService : IAuthService
+ {
+ private readonly GrpcChannel Channel;
+ private readonly AuthenticationStateProvider _authenticationStateProvider;
+ private readonly ILocalStorageService _localStorage;
+
+ public AuthService(GrpcChannel channel,
+ AuthenticationStateProvider authenticationStateProvider,
+ ILocalStorageService localStorage)
+ {
+ Channel = channel;
+ _authenticationStateProvider = authenticationStateProvider;
+ _localStorage = localStorage;
+ }
+
+ public async Task<LoginResult> Login(string loginID, string passwordl)
+ {
+ using (AuthAccess access = new AuthAccess(Channel))
+ {
+ LoginResult result = await access.LoginAsync(loginID, passwordl);
+ var options = new JsonSerializerOptions
+ {
+ WriteIndented = true
+ };
+
+ if (result.ErrNo != 0)
+ {
+ return result;
+ }
+
+
+ await _localStorage.SetItemAsync("authToken", result.AccessToKen);
+ ((ApiAuthenticationStateProvider)_authenticationStateProvider).MarkUserAsAuthenticated(result.AccessToKen);
+ ApiAuthenticationStateProvider.AccessToken = result.AccessToKen;
+
+ return result;
+ }
+ }
+
+ public async Task<LoginResult> Logout(string loginID)
+ {
+ using (AuthAccess access = new AuthAccess(Channel))
+ {
+ LoginResult result = await access.LogoutAsync(loginID);
+ var options = new JsonSerializerOptions
+ {
+ WriteIndented = true
+ };
+
+ if (result.ErrNo != 0)
+ {
+ return result;
+ }
+
+ await _localStorage.RemoveItemAsync("authToken");
+ ((ApiAuthenticationStateProvider)_authenticationStateProvider).MarkUserAsLoggedOut();
+ ApiAuthenticationStateProvider.AccessToken = null;
+ return result;
+ }
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/Services/BrowserResizeService.cs b/HotelPms.Client.Blazor/Services/BrowserResizeService.cs
new file mode 100644
index 0000000..4ba4b33
--- /dev/null
+++ b/HotelPms.Client.Blazor/Services/BrowserResizeService.cs
@@ -0,0 +1,28 @@
+using Microsoft.JSInterop;
+using System;
+using System.Threading.Tasks;
+
+namespace HotelPms.Client.Blazor.Services
+{
+ public class BrowserResizeService
+ {
+ public static event Func<Task> OnResize;
+
+ [JSInvokable]
+ public static async Task OnBrowserResize()
+ {
+ //if (OnResize == null) { return; }
+ await OnResize?.Invoke();
+ }
+
+ public static async ValueTask<int> GetInnerHeight(IJSRuntime JSRuntime)
+ {
+ return await JSRuntime.InvokeAsync<int>("browserResize.getInnerHeight");
+ }
+
+ public static async ValueTask<int> GetInnerWidth(IJSRuntime JSRuntime)
+ {
+ return await JSRuntime.InvokeAsync<int>("browserResize.getInnerWidth");
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/Services/IAuthService.cs b/HotelPms.Client.Blazor/Services/IAuthService.cs
new file mode 100644
index 0000000..7cd6e74
--- /dev/null
+++ b/HotelPms.Client.Blazor/Services/IAuthService.cs
@@ -0,0 +1,11 @@
+using HotelPms.Data;
+using System.Threading.Tasks;
+
+namespace HotelPms.Client.Blazor.Services
+{
+ internal interface IAuthService
+ {
+ Task<LoginResult> Login(string loginID, string password);
+ Task<LoginResult> Logout(string loginID);
+ }
+}
diff --git a/HotelPms.Client.Blazor/Services/JsInputCoreCallBack.cs b/HotelPms.Client.Blazor/Services/JsInputCoreCallBack.cs
new file mode 100644
index 0000000..577bdbe
--- /dev/null
+++ b/HotelPms.Client.Blazor/Services/JsInputCoreCallBack.cs
@@ -0,0 +1,36 @@
+using HotelPms.Client.Blazor.Util;
+using HotelPms.Client.Blazor.ViewModel;
+using Microsoft.JSInterop;
+
+namespace HotelPms.Client.Blazor.Services
+{
+ public static class JsInputCoreCallBack
+ {
+ [JSInvokable]
+ public static async Task<JsInputCoreEventArgs> InputCoreEvent(JsInputCoreEventArgs args)
+ {
+ EnvironmentSetting.Debug($"InputCoreEvent:{args.ToString()}");
+
+ //次のフォーカス移動先判断する
+ args.ResultNo = 9;
+ args.NextFocus = string.Empty;
+ if (ValidModelEx.Storage.TryGetValue(args.ID, out ValidModelEx validModelEx))
+ {
+ if (args.EventName == "focus")
+ {
+ validModelEx.Enter(args.Index, args);
+ }
+ else if (args.EventName == "keyup")
+ {
+ await validModelEx.KeyUp(args.Index, args);
+ }
+ else if (args.EventName == "blur")
+ {
+ await validModelEx.Leave(args.Index, args);
+ }
+ }
+
+ return await Task.FromResult(args);
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/Services/JsInputCoreEventArgs.cs b/HotelPms.Client.Blazor/Services/JsInputCoreEventArgs.cs
new file mode 100644
index 0000000..875983b
--- /dev/null
+++ b/HotelPms.Client.Blazor/Services/JsInputCoreEventArgs.cs
@@ -0,0 +1,57 @@
+namespace HotelPms.Client.Blazor.Services
+{
+ public class JsInputCoreEventArgs
+ {
+ /// <summary>
+ /// Guid
+ /// </summary>
+ public string ID { get; set; } = string.Empty;
+
+ /// <summary>
+ /// コントロールのIndex
+ /// </summary>
+ public int Index { get; set; }
+
+ /// <summary>
+ /// コントロール名
+ /// </summary>
+ public string Name { get; set; } = string.Empty;
+
+ /// <summary>
+ /// イベント名
+ /// </summary>
+ public string EventName { get; set; } = string.Empty;
+
+ /// <summary>
+ /// イベントキー
+ /// </summary>
+ public string Key { get; set; } = string.Empty;
+
+ /// <summary>
+ /// フォーカスされた時の値
+ /// </summary>
+ public string OrgText { get; set; } = string.Empty;
+
+ /// <summary>
+ /// 現時点の値
+ /// </summary>
+ public string Text { get; set; } = string.Empty;
+
+ /// <summary>
+ /// 次のフォーカス移動対象ID
+ /// </summary>
+ public string NextFocus { get; set; } = string.Empty;
+
+ /// <summary>
+ /// 0.正常
+ /// 1.正常(入力キャンセル【例:排他ロック取得できない場合】)
+ /// 9.NG
+ /// </summary>
+ public int ResultNo { get; set; } = 0;
+
+ public override string ToString()
+ {
+ return $"ResultNo={ResultNo},ID={ID},Index={Index},Name={Name},EventName={EventName},Key={Key},OrgText={OrgText},Text={Text}";
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/Services/JsInputCoreService.cs b/HotelPms.Client.Blazor/Services/JsInputCoreService.cs
new file mode 100644
index 0000000..24f1fc0
--- /dev/null
+++ b/HotelPms.Client.Blazor/Services/JsInputCoreService.cs
@@ -0,0 +1,24 @@
+using System.Threading.Tasks;
+using Microsoft.JSInterop;
+
+namespace HotelPms.Client.Blazor.Services
+{
+ public interface IJsInputCoreService
+ {
+ ValueTask Init(string guid);
+ ValueTask Dispose(string guid);
+ }
+
+ public class JsInputCoreService : IJsInputCoreService
+ {
+ private readonly IJSRuntime _jsRuntime;
+
+ public JsInputCoreService(IJSRuntime jsRuntime)
+ {
+ _jsRuntime = jsRuntime;
+ }
+
+ public ValueTask Init(string guid) => _jsRuntime.InvokeVoidAsync("inputCore.init", guid);
+ public ValueTask Dispose(string guid) => _jsRuntime.InvokeVoidAsync("inputCore.dispose", guid);
+ }
+}
diff --git a/HotelPms.Client.Blazor/Services/ServiceCollectionExtensions.cs b/HotelPms.Client.Blazor/Services/ServiceCollectionExtensions.cs
new file mode 100644
index 0000000..c8f2552
--- /dev/null
+++ b/HotelPms.Client.Blazor/Services/ServiceCollectionExtensions.cs
@@ -0,0 +1,14 @@
+using Microsoft.Extensions.DependencyInjection.Extensions;
+using MudBlazor;
+
+namespace HotelPms.Client.Blazor.Services
+{
+ public static class ServiceCollectionExtensions
+ {
+ public static IServiceCollection AddJsInputCore(this IServiceCollection services)
+ {
+ services.TryAddTransient<IJsInputCoreService, JsInputCoreService>();
+ return services;
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/Shared/Error.razor b/HotelPms.Client.Blazor/Shared/Error.razor
new file mode 100644
index 0000000..309e590
--- /dev/null
+++ b/HotelPms.Client.Blazor/Shared/Error.razor
@@ -0,0 +1,17 @@
+@using Microsoft.Extensions.Logging
+@inject ILogger<Error> Logger
+
+<CascadingValue Value=this>
+ @ChildContent
+</CascadingValue>
+
+@code {
+ [Parameter]
+ public RenderFragment ChildContent { get; set; }
+
+ public void ProcessError(Exception ex)
+ {
+ Logger.LogError("Error:ProcessError - Type: {Type} Message: {Message}",
+ ex.GetType(), ex.Message);
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.Client.Blazor/Shared/LoginLayout.razor b/HotelPms.Client.Blazor/Shared/LoginLayout.razor
new file mode 100644
index 0000000..f5493b5
--- /dev/null
+++ b/HotelPms.Client.Blazor/Shared/LoginLayout.razor
@@ -0,0 +1,19 @@
+@inherits LayoutComponentBase
+
+
+<MudThemeProvider Theme="_currentTheme" />
+<MudSnackbarProvider />
+
+<MudContainer MaxWidth="MaxWidth.Small" Class="d-flex align-center" Style="height: 100vh;">
+ <div class="d-flex flex-column mud-width-full">
+ <MudPaper Elevation="25" Class="pa-8" Width="100%" MaxWidth="500px">
+ <MudIcon Icon="@Icons.Custom.Brands.TikTok" Size="Size.Large" Style="width:100px; height:100px;" />
+ @Body
+ </MudPaper>
+ <MudAlert Severity="Severity.Info" Class="mt-8 mud-width-full" Style="max-width:500px;" >テストログイン画面</MudAlert>
+ </div>
+</MudContainer>
+
+@code {
+ private MudTheme _currentTheme = new MudBlazorAdminDashboard();
+}
\ No newline at end of file
diff --git a/HotelPms.Client.Blazor/Shared/MainLayout.razor b/HotelPms.Client.Blazor/Shared/MainLayout.razor
new file mode 100644
index 0000000..0e9b6bb
--- /dev/null
+++ b/HotelPms.Client.Blazor/Shared/MainLayout.razor
@@ -0,0 +1,87 @@
+@inherits LayoutComponentBase
+
+
+<MudThemeProvider Theme="_theme" />
+<MudDialogProvider
+ MaxWidth="MaxWidth.Large"
+ DisableBackdropClick="true"
+/>
+<MudSnackbarProvider Style = "width: 500px" />
+
+<MudLayout>
+ <MudAppBar Elevation="25">
+ <MudHidden Breakpoint="Breakpoint.SmAndDown">
+ <MudImage Src="images/FrontGateWay.jpg" Width="40" Height="40"Class="rounded-lg ma-4"/>
+ </MudHidden>
+ <MudHidden Breakpoint="Breakpoint.MdAndUp">
+ <MudIconButton Icon="@Icons.Material.Outlined.Menu" Color="MudBlazor.Color.Inherit" Edge="Edge.Start" OnClick="@((e) => DrawerToggle())" />
+ </MudHidden>
+ <MudHidden Breakpoint="Breakpoint.Xs">
+ <MudText Typo="Typo.h6" Class="ml-4">ホテルシステム</MudText>
+ </MudHidden>
+ <MudHidden Breakpoint="Breakpoint.Xs" Invert="true">
+ <MudText Typo="Typo.subtitle2">ホテルシステム</MudText>
+ </MudHidden>
+ <MudSpacer />
+ <MudMenu Icon="@Icons.Material.Outlined.Translate" Color="MudBlazor.Color.Inherit" AnchorOrigin="Origin.BottomCenter" TransformOrigin="Origin.TopCenter" Dense="true">
+ <MudMenuItem>日本語</MudMenuItem>
+ <MudMenuItem>英語</MudMenuItem>
+ <MudMenuItem>その他</MudMenuItem>
+ </MudMenu>
+ <MudMenu Icon="@Icons.Material.Outlined.Widgets" Color="MudBlazor.Color.Inherit" AnchorOrigin="Origin.BottomCenter" TransformOrigin="Origin.TopCenter" Dense="true">
+ <MudMenuItem Link="https://www.navc2.co.jp">NavcⅡ</MudMenuItem>
+ <MudMenuItem Link="https://github.com/Garderoben/HotelPms.Client.Blazors">Source Code</MudMenuItem>
+ </MudMenu>
+ <MudMenu AnchorOrigin="Origin.BottomCenter" TransformOrigin="Origin.TopCenter" Dense="true" Class="mt-1 ml-4">
+ <ActivatorContent>
+ <MudAvatar Image="images/FrontGateWay.jpg" />
+ </ActivatorContent>
+ <ChildContent>
+ <PersonCard Class="mt-n2" />
+ <MudDivider Class="mb-2" />
+ <MudListItem Text="Account" Icon="@Icons.Material.Outlined.Person" Href="personal/account" />
+ <MudListItem Text="Logout" Icon="@Icons.Material.Outlined.Login" Href="pages/authentication/login" />
+ </ChildContent>
+ </MudMenu>
+ </MudAppBar>
+ <MudDrawer @bind-Open="_drawerOpen" Elevation="25" ClipMode="DrawerClipMode.Always">
+ <NavMenu />
+ </MudDrawer>
+ <MudMainContent>
+ <MudHidden Breakpoint="Breakpoint.SmAndDown">
+ <MudToolBar DisableGutters="true">
+ <MudIconButton Icon="@Icons.Material.Outlined.Menu" Color="MudBlazor.Color.Inherit" OnClick="@((e) => DrawerToggle())" Class="ml-3" />
+ <MudBreadcrumbs Items="_items"></MudBreadcrumbs>
+ <MudSpacer />
+ <MudButton Variant="Variant.Text" Link="https://mudblazor.com/" Style="color:#594AE2;">MudBlazor</MudButton>
+ <MudButton Variant="Variant.Text" Link="https://github.com/Garderoben/HotelPms.Client.Blazors" Style="color:#424242;" Class="mr-3">Source Code</MudButton>
+ </MudToolBar>
+ </MudHidden>
+ <MudContainer MaxWidth="MaxWidth.False" Class="mt-4">
+ @Body
+ </MudContainer>
+ </MudMainContent>
+</MudLayout>
+
+
+@code {
+ private MudBlazorAdminDashboard _theme = new ();
+
+ public bool _drawerOpen = true;
+
+ void DrawerToggle()
+ {
+ _drawerOpen = !_drawerOpen;
+ }
+
+ protected override void OnInitialized()
+ {
+ StateHasChanged();
+ }
+
+ private List<BreadcrumbItem> _items = new List<BreadcrumbItem>
+ {
+ new BreadcrumbItem("Personal", href: "#"),
+ new BreadcrumbItem("Dashboard", href: "#"),
+ };
+}
\ No newline at end of file
diff --git a/HotelPms.Client.Blazor/Shared/NavMenu.razor b/HotelPms.Client.Blazor/Shared/NavMenu.razor
new file mode 100644
index 0000000..e2b0dc9
--- /dev/null
+++ b/HotelPms.Client.Blazor/Shared/NavMenu.razor
@@ -0,0 +1,40 @@
+<PersonCard Style="background-color: var(--mud-palette-drawer-background);color: var(--mud-palette-drawer-text);"/>
+<MudNavMenu>
+ <MudText Typo="Typo.subtitle2" Color="MudBlazor.Color.Inherit" Class="ml-4 my-3">設定</MudText>
+ <MudNavLink Href="@($"{EnvironmentSetting.SiteSubDir}roomview/list")" Icon="@Icons.Material.Outlined.ViewList">客室状況</MudNavLink>
+ <MudNavLink Href="@($"{EnvironmentSetting.SiteSubDir}personal/dashboard")" Icon="@Icons.Material.Outlined.Dashboard">環境設定</MudNavLink>
+ <MudNavGroup Title="マスタ設定" Icon="@Icons.Material.Outlined.AssignmentInd" HideExpandIcon="true">
+ <MudNavLink Href="@($"{EnvironmentSetting.SiteSubDir}master/demo/crud")" Icon="@Icons.Material.Outlined.Person">デモ</MudNavLink>
+ <MudNavLink Href="@($"{EnvironmentSetting.SiteSubDir}master/building/crud")" Icon="@Icons.Material.Outlined.Dashboard">館情報</MudNavLink>
+ <MudNavLink Href="@($"{EnvironmentSetting.SiteSubDir}personal/account")" Icon="@Icons.Material.Outlined.Person">部屋タイプ</MudNavLink>
+ <MudNavLink Href="@($"{EnvironmentSetting.SiteSubDir}master/roomstatus/crud")" Icon="@Icons.Material.Outlined.Person">部屋状態</MudNavLink>
+ </MudNavGroup>
+
+ <MudText Typo="Typo.subtitle2" Color="MudBlazor.Color.Inherit" Class="ml-4 my-3">Personal</MudText>
+ <MudNavLink Href="@($"{EnvironmentSetting.SiteSubDir}personal/dashboard")" Match="NavLinkMatch.All" Icon="@Icons.Material.Outlined.Dashboard">Dashboard</MudNavLink>
+ <MudNavLink Href="@($"{EnvironmentSetting.SiteSubDir}personal/account")" Icon="@Icons.Material.Outlined.Person">Account</MudNavLink>
+
+ <MudText Typo="Typo.subtitle2" Color="MudBlazor.Color.Inherit" Class="ml-4 my-3">App Examples</MudText>
+ <MudNavLink Href="@($"{EnvironmentSetting.SiteSubDir}application/email")" Match="NavLinkMatch.Prefix" Icon="@Icons.Material.Outlined.Email">Email</MudNavLink>
+ <MudNavLink Href="@($"{EnvironmentSetting.SiteSubDir}application/chat")" Icon="@Icons.Material.Outlined.Forum">Chat</MudNavLink>
+ <MudNavLink Href="@($"{EnvironmentSetting.SiteSubDir}application/todo")" Icon="@Icons.Custom.Uncategorized.AlertSuccess" Disabled="true">Todo</MudNavLink>
+ <MudNavLink Href="@($"{EnvironmentSetting.SiteSubDir}application/users")" Icon="@Icons.Material.Outlined.PeopleAlt" Disabled="true">Users</MudNavLink>
+
+ <MudText Typo="Typo.subtitle2" Color="MudBlazor.Color.Inherit" Class="ml-4 my-3">Pages</MudText>
+ <MudNavGroup Title="Authentication" Icon="@Icons.Material.Outlined.AssignmentInd" HideExpandIcon="true">
+ <MudNavLink Href="@($"{EnvironmentSetting.SiteSubDir}pages/authentication/login")" Icon="@Icons.Material.Outlined.InsertDriveFile">Login</MudNavLink>
+ <MudNavLink Href="@($"{EnvironmentSetting.SiteSubDir}pages/authentication/register")" Icon="@Icons.Material.Outlined.InsertDriveFile">Register</MudNavLink>
+ <MudNavLink Href="@($"{EnvironmentSetting.SiteSubDir}pages/authentication/forgot-password")" Icon="@Icons.Material.Outlined.InsertDriveFile">Forgot Password</MudNavLink>
+ <MudNavLink Href="@($"{EnvironmentSetting.SiteSubDir}pages/authentication/reset-password")" Icon="@Icons.Material.Outlined.InsertDriveFile">Reset Password</MudNavLink>
+ </MudNavGroup>
+ <MudNavGroup Title="Error" Icon="@AlertAssignmentIcon" HideExpandIcon="true">
+ <MudNavLink Href="@($"{EnvironmentSetting.SiteSubDir}pages/error/404")" Icon="@Icons.Material.Outlined.InsertDriveFile">404</MudNavLink>
+ </MudNavGroup>
+ <MudNavGroup Title="Utility" Icon="@Icons.Material.Outlined.Assignment" HideExpandIcon="true">
+ <MudNavLink Href="@($"{EnvironmentSetting.SiteSubDir}pages/utility/faq")" Icon="@Icons.Material.Outlined.InsertDriveFile">Faq</MudNavLink>
+ </MudNavGroup>
+</MudNavMenu>
+
+@code {
+ string AlertAssignmentIcon { get; set; } = "<path d=\"M19,3A2,2 0 0,1 21,5V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V5A2,2 0 0,1 5,3H9.18C9.6,1.84 10.7,1 12,1C13.3,1 14.4,1.84 14.82,3H19M12,3A1,1 0 0,0 11,4A1,1 0 0,0 12,5A1,1 0 0,0 13,4A1,1 0 0,0 12,3M7,7V5H5V19H19V5H17V7H7M11,9H13V13.5H11V9M11,15H13V17H11V15Z\" />";
+}
\ No newline at end of file
diff --git a/HotelPms.Client.Blazor/Shared/PersonCard.razor b/HotelPms.Client.Blazor/Shared/PersonCard.razor
new file mode 100644
index 0000000..92082cc
--- /dev/null
+++ b/HotelPms.Client.Blazor/Shared/PersonCard.razor
@@ -0,0 +1,16 @@
+<MudCard Elevation="0" Square="true" Class="@Class" Style="@Style">
+ <MudCardHeader>
+ <CardHeaderAvatar>
+ <MudAvatar Image="images/logo_foot.gif" />
+ </CardHeaderAvatar>
+ <CardHeaderContent>
+ <MudText Typo="Typo.body2">FrontGateWay</MudText>
+ <MudText Typo="Typo.caption">NavcⅡ</MudText>
+ </CardHeaderContent>
+ </MudCardHeader>
+</MudCard>
+
+@code {
+ [Parameter] public string Class { get; set; }
+ [Parameter] public string Style { get; set; }
+}
\ No newline at end of file
diff --git a/HotelPms.Client.Blazor/Util/ApiAuthenticationStateProvider.cs b/HotelPms.Client.Blazor/Util/ApiAuthenticationStateProvider.cs
new file mode 100644
index 0000000..eac2a51
--- /dev/null
+++ b/HotelPms.Client.Blazor/Util/ApiAuthenticationStateProvider.cs
@@ -0,0 +1,102 @@
+using Blazored.LocalStorage;
+using Microsoft.AspNetCore.Components.Authorization;
+using System.Security.Claims;
+using System.Text.Json;
+
+namespace HotelPms.Client.Blazor.Util
+{
+ public class ApiAuthenticationStateProvider : AuthenticationStateProvider
+ {
+ public static string? AccessToken { get; set; }
+
+ private readonly ILocalStorageService _localStorage;
+
+ public ApiAuthenticationStateProvider(ILocalStorageService localStorage)
+ {
+ _localStorage = localStorage;
+ }
+
+ public override async Task<AuthenticationState> GetAuthenticationStateAsync()
+ {
+ var savedToken = await _localStorage.GetItemAsync<string>("authToken");
+ EnvironmentSetting.Debug($"GetAuthenticationStateAsync:{savedToken}");
+
+ if (string.IsNullOrWhiteSpace(savedToken))
+ {
+ return new AuthenticationState(new ClaimsPrincipal(new ClaimsIdentity()));
+ }
+
+ if (string.IsNullOrEmpty(AccessToken))
+ {
+ EnvironmentSetting.Debug($"初次认证");
+ //判断savedToken过期?
+ //return new AuthenticationState(new ClaimsPrincipal(new ClaimsIdentity()));
+ }
+
+ //_httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("bearer", savedToken);
+ AccessToken = savedToken;
+ EnvironmentSetting.Debug($"AccessToken:{AccessToken}");
+
+ return new AuthenticationState(new ClaimsPrincipal(new ClaimsIdentity(ParseClaimsFromJwt(savedToken), "jwt")));
+ }
+
+ public void MarkUserAsAuthenticated(string token)
+ {
+ var authenticatedUser = new ClaimsPrincipal(new ClaimsIdentity(ParseClaimsFromJwt(token), "jwt"));
+ var authState = Task.FromResult(new AuthenticationState(authenticatedUser));
+ NotifyAuthenticationStateChanged(authState);
+ }
+
+ public void MarkUserAsLoggedOut()
+ {
+ var anonymousUser = new ClaimsPrincipal(new ClaimsIdentity());
+ var authState = Task.FromResult(new AuthenticationState(anonymousUser));
+ NotifyAuthenticationStateChanged(authState);
+ }
+
+ private IEnumerable<Claim> ParseClaimsFromJwt(string jwt)
+ {
+ var claims = new List<Claim>();
+ var payload = jwt.Split('.')[1];
+ var jsonBytes = ParseBase64WithoutPadding(payload);
+ var keyValuePairs = JsonSerializer.Deserialize<Dictionary<string, object>>(jsonBytes);
+
+ keyValuePairs.TryGetValue(ClaimTypes.Role, out object roles);
+
+ if (roles != null)
+ {
+ if (roles.ToString().Trim().StartsWith("["))
+ {
+ var parsedRoles = JsonSerializer.Deserialize<string[]>(roles.ToString());
+
+ foreach (var parsedRole in parsedRoles)
+ {
+ EnvironmentSetting.Debug("parsedRole:" + parsedRole);
+ claims.Add(new Claim(ClaimTypes.Role, parsedRole));
+ }
+ }
+ else
+ {
+ EnvironmentSetting.Debug(roles.ToString());
+ claims.Add(new Claim(ClaimTypes.Role, roles.ToString()));
+ }
+
+ keyValuePairs.Remove(ClaimTypes.Role);
+ }
+
+ claims.AddRange(keyValuePairs.Select(kvp => new Claim(kvp.Key, kvp.Value.ToString())));
+
+ return claims;
+ }
+
+ private byte[] ParseBase64WithoutPadding(string base64)
+ {
+ switch (base64.Length % 4)
+ {
+ case 2: base64 += "=="; break;
+ case 3: base64 += "="; break;
+ }
+ return Convert.FromBase64String(base64);
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/Util/BoundingClientRect.cs b/HotelPms.Client.Blazor/Util/BoundingClientRect.cs
new file mode 100644
index 0000000..cc5430b
--- /dev/null
+++ b/HotelPms.Client.Blazor/Util/BoundingClientRect.cs
@@ -0,0 +1,14 @@
+namespace HotelPms.Client.Blazor.Util
+{
+ public class BoundingClientRect
+ {
+ public double X { get; set; }
+ public double Y { get; set; }
+ public double Width { get; set; }
+ public double Height { get; set; }
+ public double Top { get; set; }
+ public double Right { get; set; }
+ public double Bottom { get; set; }
+ public double Left { get; set; }
+ }
+}
diff --git a/HotelPms.Client.Blazor/Util/BusinessEnum.cs b/HotelPms.Client.Blazor/Util/BusinessEnum.cs
new file mode 100644
index 0000000..3e3a8ec
--- /dev/null
+++ b/HotelPms.Client.Blazor/Util/BusinessEnum.cs
@@ -0,0 +1,9 @@
+using MudBlazor;
+using System.ComponentModel;
+
+namespace HotelPms.Client.Blazor.Util
+{
+ public class BusinessEnum
+ {
+ }
+}
diff --git a/HotelPms.Client.Blazor/Util/CacheStorage.cs b/HotelPms.Client.Blazor/Util/CacheStorage.cs
new file mode 100644
index 0000000..b8d9a23
--- /dev/null
+++ b/HotelPms.Client.Blazor/Util/CacheStorage.cs
@@ -0,0 +1,99 @@
+using System.Collections.Concurrent;
+
+namespace HotelPms.Client.Blazor.Util
+{
+ /// <summary>
+ /// バッファー保存用メモリDB
+ /// </summary>
+ public class CacheStorage : IDisposable
+ {
+ public enum Key : int
+ {
+ /// <summary>
+ /// マスタ設定画面などViewModel伝送用
+ /// </summary>
+ ViewModel = 0,
+ RoomTypeName,
+ RoomName,
+ }
+
+
+ private static CacheStorage m_Instance;
+ public static CacheStorage Instance
+ {
+ get
+ {
+ if (m_Instance == null) { m_Instance = new CacheStorage(); }
+ return m_Instance;
+ }
+ }
+
+ /// <summary>
+ /// バッファー保存用メモリDB
+ /// </summary>
+ public ConcurrentDictionary<string, object> Data { get; set; } = new ConcurrentDictionary<string, object>();
+
+ public void Dispose()
+ {
+ Data.Clear();
+ }
+
+ public object Get(Key key)
+ {
+ return Get(key.ToString());
+ }
+
+ public object Get(string key)
+ {
+ try
+ {
+ Data.TryGetValue(key, out object value);
+ return value;
+ }
+ catch
+ {
+ return null;
+ }
+ }
+
+ public void Set(Key key, object value)
+ {
+ Set(key.ToString(), value);
+ }
+
+ public void Set(string key, object value)
+ {
+ Data[key] = value;
+ }
+
+ /// <summary>
+ /// マスタデータ
+ /// </summary>
+ /// <param name="id"></param>
+ /// <param name="value"></param>
+ public void SetMasterName(Key key, int id, string value)
+ {
+ ConcurrentDictionary<int, string> dict = Get(key) as ConcurrentDictionary<int, string>;
+ if (dict == null)
+ {
+ dict = new ConcurrentDictionary<int, string>();
+ Set(key, dict);
+ }
+ dict[id] = value;
+ }
+
+ /// <summary>
+ /// 存在しなかったら、nullで返す
+ /// </summary>
+ /// <param name="key"></param>
+ /// <param name="id"></param>
+ /// <returns></returns>
+ public string GetMasterName(Key key, int id)
+ {
+ ConcurrentDictionary<int, string> dict = Get(key) as ConcurrentDictionary<int, string>;
+ if (dict == null) { return string.Empty; }
+ if (!dict.ContainsKey(id)) { return string.Empty; }
+ return dict[id];
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/Util/DefaultGlobalLoadingSpinner.cs b/HotelPms.Client.Blazor/Util/DefaultGlobalLoadingSpinner.cs
new file mode 100644
index 0000000..2e197d2
--- /dev/null
+++ b/HotelPms.Client.Blazor/Util/DefaultGlobalLoadingSpinner.cs
@@ -0,0 +1,55 @@
+using Microsoft.JSInterop;
+
+namespace HotelPms.Client.Blazor.Util
+{
+ /// <summary>
+ /// 汎用待ち画面
+ /// </summary>
+ public class DefaultGlobalLoadingSpinner : IGlobalLoadingSpinner
+ {
+ static object Locker = new object();
+ int SpinnerCount = 1;
+
+ IJSRuntime _jsRuntime;
+
+ public DefaultGlobalLoadingSpinner(IJSRuntime jsRuntime)
+ {
+ _jsRuntime = jsRuntime;
+ }
+
+ public async Task ShowAsync()
+ {
+ EnvironmentSetting.Debug($"Locker Start:{DateTime.Now.ToString("HH:mm:ss fff")}");
+ lock (Locker)
+ {
+ SpinnerCount++;
+ }
+
+ EnvironmentSetting.Debug($"InvokeVoidAsync Start:{DateTime.Now.ToString("HH:mm:ss fff")}");
+ await this._jsRuntime.InvokeVoidAsync("NetCallJs.showGlobalLoadingSpinner"); //0.5秒
+ EnvironmentSetting.Debug($"InvokeVoidAsync End:{DateTime.Now.ToString("HH:mm:ss fff")}");
+ }
+
+ public async Task HideAsync()
+ {
+ lock (Locker)
+ {
+ SpinnerCount--;
+ if (SpinnerCount < 0)
+ {
+ SpinnerCount = 0;
+ }
+ }
+
+ if (SpinnerCount == 0)
+ {
+ await this._jsRuntime.InvokeVoidAsync("NetCallJs.hideGlobalLoadingSpinner");
+ }
+ }
+
+ public async Task HideLogoAsync()
+ {
+ await this._jsRuntime.InvokeVoidAsync("NetCallJs.hideGlobalLoadingSpinnerLogo");
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/Util/EditGridFocusEventArgs.cs b/HotelPms.Client.Blazor/Util/EditGridFocusEventArgs.cs
new file mode 100644
index 0000000..c4df97a
--- /dev/null
+++ b/HotelPms.Client.Blazor/Util/EditGridFocusEventArgs.cs
@@ -0,0 +1,18 @@
+namespace HotelPms.Client.Blazor.Util;
+
+/// <summary>
+/// EditGridのフォーカス制御
+/// </summary>
+public class EditGridFocusEventArgs : EventArgs
+{
+ public enum ActionType : int
+ {
+ Focus = 0,
+ //EditMode,
+ }
+
+ public int Row { get; set; } = -1;
+ public int Col { get; set; } = -1;
+ public ActionType Action { get; set; } = ActionType.Focus;
+ public bool Enabled { get; set; } = false;
+}
diff --git a/HotelPms.Client.Blazor/Util/ElementBase.cs b/HotelPms.Client.Blazor/Util/ElementBase.cs
new file mode 100644
index 0000000..5f6a9e0
--- /dev/null
+++ b/HotelPms.Client.Blazor/Util/ElementBase.cs
@@ -0,0 +1,8 @@
+namespace HotelPms.Client.Blazor.Util
+{
+ public class ElementBase
+ {
+ public string Id { get; set; }
+ public string TagName { get; set; }
+ }
+}
diff --git a/HotelPms.Client.Blazor/Util/ElementReferenceEx.cs b/HotelPms.Client.Blazor/Util/ElementReferenceEx.cs
new file mode 100644
index 0000000..1980f52
--- /dev/null
+++ b/HotelPms.Client.Blazor/Util/ElementReferenceEx.cs
@@ -0,0 +1,49 @@
+using Microsoft.AspNetCore.Components;
+using Microsoft.JSInterop;
+using System.Reflection;
+
+namespace HotelPms.Client.Blazor.Util
+{
+ public static class ElementReferenceEx
+ {
+ private static readonly PropertyInfo jsRuntimeProperty = typeof(WebElementReferenceContext).GetProperty("JSRuntime", BindingFlags.Instance | BindingFlags.NonPublic);
+
+ internal static IJSRuntime GetJSRuntime(this ElementReference elementReference)
+ {
+ if (elementReference.Context is not WebElementReferenceContext context)
+ {
+ return null;
+ }
+
+ return (IJSRuntime)jsRuntimeProperty.GetValue(context);
+ }
+
+ /// <summary>
+ /// input[text] or textarea
+ /// </summary>
+ /// <param name="elementReference"></param>
+ /// <returns></returns>
+ public static ValueTask<string> GetInputValue(this ElementReference elementReference)
+ {
+ return elementReference.GetJSRuntime()?.InvokeAsync<string>("NetCallJs.getInputValue", elementReference) ?? ValueTask.FromResult(string.Empty);
+ }
+
+ /// <summary>
+ /// input[text] or textarea
+ /// </summary>
+ /// <param name="elementReference"></param>
+ /// <param name="value"></param>
+ /// <returns></returns>
+ public static ValueTask SetInputValue(this ElementReference elementReference, string value) => elementReference.GetJSRuntime()?.InvokeVoidAsync("NetCallJs.setInputValue", elementReference, value) ?? ValueTask.CompletedTask;
+
+ public static ValueTask<BoundingClientRect> GetClientRect(this ElementReference elementReference)
+ {
+ return elementReference.GetJSRuntime()?.InvokeAsync<BoundingClientRect>("NetCallJs.getClientRect", elementReference) ?? ValueTask.FromResult(new BoundingClientRect());
+ }
+
+ public static ValueTask<ScrollPosition> GetScroll(this ElementReference elementReference)
+ {
+ return elementReference.GetJSRuntime()?.InvokeAsync<ScrollPosition>("NetCallJs.getScroll", elementReference) ?? ValueTask.FromResult(new ScrollPosition());
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/Util/EnvironmentSetting.cs b/HotelPms.Client.Blazor/Util/EnvironmentSetting.cs
new file mode 100644
index 0000000..ddacad6
--- /dev/null
+++ b/HotelPms.Client.Blazor/Util/EnvironmentSetting.cs
@@ -0,0 +1,143 @@
+using Grpc.Net.Client;
+using HotelPms.Data.Client;
+using HotelPms.Data.Common;
+using HotelPms.DataAccessGrpc.Client;
+using HotelPms.Share.Util;
+
+namespace HotelPms.Client.Blazor.Util
+{
+ public class EnvironmentSetting
+ {
+ /// <summary>
+ /// どこでも取得できるように
+ /// </summary>
+ public static IServiceCollection ServiceCollection { get; set; }
+
+ public static IServiceProvider ServiceProvider { get; set; }
+
+ /// <summary>
+ /// どこでも取得できるように
+ /// </summary>
+ public static GrpcChannel GrpcChannel { get; set; }
+
+ /// <summary>
+ /// 端末ID
+ /// </summary>
+ public static string ClientID = string.Empty;
+
+ /// <summary>
+ /// マスタ設定一覧の頁毎表示行設定
+ /// </summary>
+ public static int[] CountOfPage = new int[] { 5, 10, 50, 100, 999999 };
+
+ /// <summary>
+ /// マスタ設定一覧画面の操作列幅
+ /// </summary>
+ public const int MasterOpeColWidth = 250;
+
+ /// <summary>
+ /// マスタ設定一覧画面の操作列幅のCSS
+ /// </summary>
+ /// <returns></returns>
+ public static string GetOpeColWidthCss()
+ {
+ return GetWidthCss(MasterOpeColWidth);
+ }
+
+ /// <summary>
+ /// 幅CSSの取得
+ /// </summary>
+ /// <param name="width"></param>
+ /// <returns></returns>
+ public static string GetWidthCss(int width)
+ {
+ return $"width: {width}px;";
+ }
+
+ /// <summary>
+ /// データ設定関係のUserName
+ /// </summary>
+ public static string UserName { get; set; } = "Web";
+
+ /// <summary>
+ /// バックグラウンドのイメージ
+ /// </summary>
+ public static string BackgroundImage { get; set; } = "/bg1.jpg";
+
+ /// <summary>
+ /// gRPCのroot URL
+ /// </summary>
+ public static string BackendUrl { get; set; } = string.Empty;
+
+ /// <summary>
+ /// gRPCのサブDir
+ /// </summary>
+ public static string SubDir { get; set; } = string.Empty;
+
+ /// <summary>
+ /// サイトのサブPath
+ /// 例:「/pms/」後ろに「/」が必要
+ /// index.htmlの<base Href>と一致するもの
+ /// </summary>
+ public static string SiteSubDir { get; set; } = string.Empty;
+
+ public static bool IsDevelopment { get; set; } = false;
+
+ /// <summary>
+ /// appsettings.jsonを読む
+ /// </summary>
+ /// <param name="config"></param>
+ public static void Init(IConfiguration config)
+ {
+ ClientID = Guid.NewGuid().ToString();
+ BackendUrl = CConvert.ToString(config["BackendUrl"]);
+ SubDir = CConvert.ToString(config["SubDir"]);
+ SiteSubDir = CConvert.ToString(config["SiteSubDir"]);
+ EnvironmentSetting.Debug($"ClientID={ClientID},BackendUrl={BackendUrl},SubDir={SubDir},SiteSubDir={SiteSubDir}");
+ }
+
+ /// <summary>
+ /// ホテル日取得
+ /// </summary>
+ /// <param name="channel"></param>
+ /// <returns></returns>
+ public static async Task<DateTime> GetHotelDate()
+ {
+ using HotelAccess access = new DataAccessGrpc.Client.HotelAccess(GrpcChannel);
+ return await access.GetHotelDate();
+ }
+
+ /// <summary>
+ /// 採番
+ /// </summary>
+ /// <param name="type"></param>
+ /// <returns></returns>
+ public static async Task<int> GetSeq(ESeqType type)
+ {
+ Data.GrpcTable table = await GrpcClient.GetTableAsync(GrpcChannel, (int)ETableActionType.Sequence, ((int)type).ToString());
+ return CConvert.ToInt(table.GetValue(typeof(System.Int32)));
+ }
+
+ /// <summary>
+ /// 消費税率の取得
+ /// </summary>
+ /// <param name="date">利用日</param>
+ /// <param name="type">0.消費税 1.軽減税</param>
+ /// <returns></returns>
+ public static async Task<int> GetTaxRate(string date, int type)
+ {
+ Data.GrpcTable table = await GrpcClient.GetTableAsync(GrpcChannel, (int)ETableActionType.TaxRate, $"{date},{type}");
+ return CConvert.ToInt(table.GetValue(typeof(System.Int32)));
+ }
+
+ /// <summary>
+ /// システム全体ログON/OFF制御
+ /// </summary>
+ /// <param name="text"></param>
+ public static void Debug(string text)
+ {
+ if(!IsDevelopment) { return; }
+ Console.WriteLine($"【{DateTime.Now.ToString("HH:mm:ss fff")}】{text}");
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/Util/FakeData.cs b/HotelPms.Client.Blazor/Util/FakeData.cs
new file mode 100644
index 0000000..88f9fd9
--- /dev/null
+++ b/HotelPms.Client.Blazor/Util/FakeData.cs
@@ -0,0 +1,898 @@
+using customTypes;
+using HotelPms.Data.Common;
+using HotelPms.Data.UseInfo;
+using HotelPms.Share.Util;
+
+namespace HotelPms.Client.Blazor.Util;
+
+public class FakeData
+{
+ /// <summary>
+ /// 二部屋三泊三人(シングル、ツイン)
+ /// </summary>
+ /// <returns></returns>
+ public static async Task<Data.UseInfo.Use> CreateUse()
+ {
+ Data.UseInfo.Use use = new Data.UseInfo.Use
+ {
+ ID = await EnvironmentSetting.GetSeq(ESeqType.Use),
+ ResvType = (int)EResvType.Reserve,
+ GroupType = (int)EGroupType.Group,
+ GroupName = "長嶺中学校",
+ GroupKana = "ナガミネチュウガッコウ",
+ ReceiptPrtWay = 0,
+ PayWay = 1,
+ CreateDate = CConvert.ToTimestamp(DateTime.Now.Date),
+ CreateLoginID = 1,
+ CreatePcName = Environment.MachineName,
+ CreateClass = 1,
+ UpdateDate = CConvert.ToTimestamp(DateTime.Now),
+ UpdateLoginID = 789,
+ UpdatePcName = Environment.MachineName,
+ UpdateClass = 2
+ };
+
+ #region UsePerson
+
+ HotelPms.Data.UseInfo.UsePerson person = new()
+ {
+ ID = use.ID,
+ PersonID = await EnvironmentSetting.GetSeq(ESeqType.UsePerson),
+ Name = "小木 太郎",
+ Kana = "オギ タロウ",
+ Anniversary = new("1995/05/01"),
+ CustomerID = 1,
+ MemberNo = "A001",
+ ReceiptName = "小木 太郎だぞ",
+ ZipCode = "864-5210",
+ Prefecture = "熊本県",
+ Address2 = "熊本市東区",
+ Address3 = "西春駅3丁目",
+ Address4 = "16-255",
+ Mail = "aaaa@iiuu",
+ PassportNo = "95278888",
+ Sex = 1,
+ BirthDay =new("1975/07/31"),
+ CharacterType = 3,
+ RankID = 0,
+ CorpID = 1001,
+ CorpKana = "カブシキカイシャ",
+ CorpName = "(株)小木不動産",
+ CorpZipCode = "987-6778",
+ CorpPrefecture = "福岡県",
+ CorpAddress2 = "福岡市東区",
+ CorpAddress3 = "健軍町6丁目",
+ CorpAddress4 = "16-988",
+ CorpMail = "ooooo@yahoo.co.jp",
+ HonorificTitleID = 3,
+ Memo = "アレルギー:なし",
+ AreaID = 56,
+ };
+ use.PersonlList.Add(person);
+
+ UsePersonFree personFree = new()
+ {
+ ID = use.ID,
+ PersonID = person.PersonID,
+ TypeID = 1,
+ DataValue = "ABC",
+ };
+ person.FreeList.Add(personFree);
+
+ personFree = new()
+ {
+ ID = use.ID,
+ PersonID = person.PersonID,
+ TypeID = 2,
+ DataValue = "DEF",
+ };
+ person.FreeList.Add(personFree);
+
+ UsePersonTel personTel = new()
+ {
+ ID = use.ID,
+ PersonID = person.PersonID,
+ Tel = "090-1111-2222",
+ Kind = (int)ETelKind.Tel,
+ SearchKey = "09011112222",
+ SortID = 3,
+ };
+ person.TelList.Add(personTel);
+
+ person = new()
+ {
+ ID = use.ID,
+ PersonID = await EnvironmentSetting.GetSeq(ESeqType.UsePerson),
+ Name = "小木 花子",
+ Kana = "オギ ハナコ",
+ Anniversary = new("1985/05/21"),
+ CustomerID = 3,
+ MemberNo = "A002",
+ ReceiptName = "小木 花子だぞ",
+ ZipCode = "864-5210",
+ Prefecture = "熊本県",
+ Address2 = "熊本市東区",
+ Address3 = "西春駅3丁目",
+ Address4 = "16-255",
+ Mail = "hanako@iiuu",
+ PassportNo = "95279999",
+ Sex = 2,
+ BirthDay = new("1978/07/31"),
+ CharacterType = 3,
+ AreaID = 56,
+ };
+ use.PersonlList.Add(person);
+
+ personFree = new()
+ {
+ ID = use.ID,
+ PersonID = person.PersonID,
+ TypeID = 1,
+ DataValue = "DDD",
+ };
+ person.FreeList.Add(personFree);
+
+ personFree = new()
+ {
+ ID = use.ID,
+ PersonID = person.PersonID,
+ TypeID = 2,
+ DataValue = "5",
+ };
+ person.FreeList.Add(personFree);
+
+ personTel = new()
+ {
+ ID = use.ID,
+ PersonID = person.PersonID,
+ Tel = "090-8888-9999",
+ Kind = (int)ETelKind.Mobile,
+ SearchKey = "09088889999",
+ SortID = 3,
+ };
+ person.TelList.Add(personTel);
+
+ person = new()
+ {
+ ID = use.ID,
+ PersonID = await EnvironmentSetting.GetSeq(ESeqType.UsePerson),
+ Name = "田中 真紀子",
+ Kana = "オギ マココ",
+ Anniversary = new("1995/02/28"),
+ CustomerID = 6,
+ MemberNo = "A008",
+ ReceiptName = "田中 真紀子だぞ",
+ ZipCode = "864-5212",
+ Prefecture = "熊本県",
+ Address2 = "熊本市西区",
+ Address3 = "大塚駅3丁目",
+ Address4 = "16-305",
+ Mail = "tanaka@iiuu",
+ PassportNo = "95272222",
+ Sex = 2,
+ BirthDay = new("1997/07/31"),
+ CharacterType = 3,
+ AreaID = 56,
+ };
+ use.PersonlList.Add(person);
+
+ personFree = new()
+ {
+ ID = use.ID,
+ PersonID = person.PersonID,
+ TypeID = 1,
+ DataValue = "6",
+ };
+ person.FreeList.Add(personFree);
+
+ personFree = new()
+ {
+ ID = use.ID,
+ PersonID = person.PersonID,
+ TypeID = 2,
+ DataValue = "8",
+ };
+ person.FreeList.Add(personFree);
+
+ personTel = new()
+ {
+ ID = use.ID,
+ PersonID = person.PersonID,
+ Tel = "090-6666-9999",
+ Kind = (int)ETelKind.Mobile,
+ SearchKey = "09066669999",
+ SortID = 3,
+ };
+ person.TelList.Add(personTel);
+
+ #endregion
+
+ #region UseDetail①
+
+ UseDetail useDetail = new()
+ {
+ ID = use.ID,
+ DetailID = await EnvironmentSetting.GetSeq(ESeqType.UseDetail),
+ UseStatus = (int)EUseStatus.Resv,
+ SubStatus = 0,
+ ExtenStatus = 0,
+ CinDate = new("2022/12/16"),
+ CinTime = 1500,
+ Stay = 3,
+ CoutDate = new("2022/12/19"),
+ CoutTime = 1000,
+ AgentID = 301,
+ AgentBranchID = 1,
+ ResvNo = string.Empty,
+ ResvDate = CConvert.ToTimestamp(DateTime.Parse("2022/12/16 10:25:20")),
+ ResvHotelDate = new("2022/12/16"),
+ ResvType = (int)EResvType.Reserve,
+ ResvPersonID = 2,
+ SalesLoginID = 12,
+ PayType = 0,
+ PayItemID = "9001",
+ PayAgentID = 0,
+ PayAgentBranchID = 0,
+ RoomAssign = false,
+ CreateDate = CConvert.ToTimestamp(DateTime.Now.Date),
+ CreateLoginID = 1,
+ CreatePcName = Environment.MachineName,
+ CreateClass = 1,
+ UpdateDate = CConvert.ToTimestamp(DateTime.Now),
+ UpdateLoginID = 789,
+ UpdatePcName = Environment.MachineName,
+ UpdateClass = 2
+ };
+ use.DetailList.Add(useDetail);
+
+ UseMemo useMemo = new()
+ {
+ ID = use.ID,
+ DetailID = useDetail.DetailID,
+ TypeID = 1,
+ Context = "朝食メモ",
+ Alert = false,
+ };
+ useDetail.MemoList.Add(useMemo);
+
+ useMemo = new()
+ {
+ ID = use.ID,
+ DetailID = useDetail.DetailID,
+ TypeID = 2,
+ Context = "会場メモ",
+ Alert = false,
+ };
+ useDetail.MemoList.Add(useMemo);
+
+ UseFree useFree = new()
+ {
+ ID = use.ID,
+ DetailID = useDetail.DetailID,
+ UseDate = Date.MinUseDate,
+ TypeID = 2,
+ DataValue = "ccvv",
+ };
+ useDetail.FreeList.Add(useFree);
+
+ #region 1泊
+
+ UseRoom useRoom = new()
+ {
+ ID = use.ID,
+ DetailID = useDetail.DetailID,
+ UseDate = new("2022/12/16"),
+ BeginTime = 0,
+ EndTime = 0,
+ RoomTypeID = 1,
+ RoomKind = (int)ERoomKind.Normal,
+ RoomID = 101,
+ AgentID = 0,
+ AgentBranchID = 0,
+ PersionCount = 0,
+ Adult = 2,
+ ChildA = 0,
+ ChildB = 0,
+ ChildC = 0,
+ ChildD = 0,
+ ChildE = 0,
+ ChildF = 0,
+ Infant = 0,
+ InFemaleAdult = 1,
+ InFemaleChildA = 0,
+ InFemaleChildB = 0,
+ InFemaleChildC = 0,
+ InFemaleChildD = 0,
+ InFemaleChildE = 0,
+ InFemaleChildF = 0,
+ InFemaleInfant = 0,
+ };
+ useDetail.UseRoomList.Add(useRoom);
+
+ UseAllo useAllo = new()
+ {
+ ID = use.ID,
+ DetailID = useDetail.DetailID,
+ UseDate = new("2022/12/16"),
+ PersonID = use.PersonlList[0].PersonID,
+ };
+ useRoom.UseAlloList.Add(useAllo);
+
+ useAllo = new()
+ {
+ ID = use.ID,
+ DetailID = useDetail.DetailID,
+ UseDate = new("2022/12/16"),
+ PersonID = use.PersonlList[1].PersonID,
+ };
+ useRoom.UseAlloList.Add(useAllo);
+
+ useFree = new()
+ {
+ ID = use.ID,
+ DetailID = useDetail.DetailID,
+ UseDate = new("2022/12/16"),
+ TypeID = 2,
+ DataValue = "ccvv",
+ };
+ useRoom.FreeList.Add(useFree);
+
+ Sale sale = new()
+ {
+ ID = use.ID,
+ DetailID = useDetail.DetailID,
+ UseDate = new customTypes.Date(20221216),
+ SaleID = await EnvironmentSetting.GetSeq(ESeqType.Sale),
+ ReceiptID = 0,
+ ItemID = "1001",
+ ItemName = "宿泊料金",
+ Price = 10000,
+ Amount = 1,
+ Summary = 10000,
+ ServiceIOType = 1,
+ ServiceSummary = 1500,
+ ServiceRate = 15,
+ TaxType = 0,
+ TaxIOType = 1,
+ TaxSummary = 100,
+ TaxRate = 10,
+ BathTaxIOType = 1,
+ BathTaxType = 0,
+ BathTaxUnitPrice = 150,
+ BathTaxSummary = 150,
+ AccTaxIOType = 1,
+ AccTaxSummary = 200,
+ TotalSummary = 18000,
+ DiscountRate = 0,
+ DiscountSummary = 1000,
+ DiscountID = 1,
+ Pack = false,
+ PackChild = false,
+ PackSaleID = 0,
+ PersonType = 0,
+ PersonCount = 2,
+ InFemale = 1,
+ UseType = 0,
+ BaseAmount = 0,
+ PersonRef = false,
+ ReceiptItemName = string.Empty,
+ ReceiptPrtType = 0,
+ ReceiptPage = 0,
+ SrcType = 0,
+ FixturesID = string.Empty,
+ };
+ useRoom.SaleList.Add(sale);
+
+ sale = new()
+ {
+ ID = use.ID,
+ DetailID = useDetail.DetailID,
+ UseDate = new customTypes.Date(20221216),
+ SaleID = await EnvironmentSetting.GetSeq(ESeqType.Sale),
+ ReceiptID = 0,
+ ItemID = "3001",
+ ItemName = "ドライヤー",
+ Price = 100,
+ Amount = 1,
+ Summary = 100,
+ ServiceIOType = 0,
+ ServiceSummary = 0,
+ ServiceRate = 0,
+ TaxType = 0,
+ TaxIOType = 1,
+ TaxSummary = 0,
+ TaxRate = 0,
+ BathTaxIOType = 1,
+ BathTaxType = 0,
+ BathTaxUnitPrice = 0,
+ BathTaxSummary = 0,
+ AccTaxIOType = 1,
+ AccTaxSummary = 0,
+ TotalSummary = 100,
+ DiscountRate = 0,
+ DiscountSummary = 10,
+ DiscountID = 1,
+ Pack = false,
+ PackChild = false,
+ PackSaleID = 0,
+ PersonType = 0,
+ PersonCount = 2,
+ InFemale = 1,
+ UseType = 0,
+ BaseAmount = 0,
+ PersonRef = false,
+ ReceiptItemName = string.Empty,
+ ReceiptPrtType = 0,
+ ReceiptPage = 0,
+ SrcType = 0,
+ FixturesID = "1",
+ };
+ useRoom.SaleList.Add(sale);
+
+ Pay pay = new()
+ {
+ ID = use.ID,
+ DetailID = useDetail.DetailID,
+ UseDate = new customTypes.Date(20221216),
+ PayID = await EnvironmentSetting.GetSeq(ESeqType.Pay),
+ ReceiptID = 0,
+ PayType = 0,
+ ItemID = "9001",
+ ItemName = "前受金",
+ PaySummary = 18000,
+ PackSaleID = 0,
+ ReceiptItemName = string.Empty,
+ ReceiptPrtType = 0,
+ ReceiptPage = 0,
+ AgentID = 0,
+ AgentBranchID = 0,
+ CustomerID = 0,
+ };
+ useRoom.PayList.Add(pay);
+
+ #endregion
+
+ #region 2泊
+
+ useRoom = new()
+ {
+ ID = use.ID,
+ DetailID = useDetail.DetailID,
+ UseDate = new("2022/12/17"),
+ BeginTime = 0,
+ EndTime = 0,
+ RoomTypeID = 1,
+ RoomKind = (int)ERoomKind.Normal,
+ RoomID = 101,
+ AgentID = 0,
+ AgentBranchID = 0,
+ PersionCount = 0,
+ Adult = 2,
+ ChildA = 0,
+ ChildB = 0,
+ ChildC = 0,
+ ChildD = 0,
+ ChildE = 0,
+ ChildF = 0,
+ Infant = 0,
+ InFemaleAdult = 1,
+ InFemaleChildA = 0,
+ InFemaleChildB = 0,
+ InFemaleChildC = 0,
+ InFemaleChildD = 0,
+ InFemaleChildE = 0,
+ InFemaleChildF = 0,
+ InFemaleInfant = 0,
+ };
+ useDetail.UseRoomList.Add(useRoom);
+
+ useAllo = new()
+ {
+ ID = use.ID,
+ DetailID = useDetail.DetailID,
+ UseDate = new("2022/12/17"),
+ PersonID = use.PersonlList[0].PersonID,
+ };
+ useRoom.UseAlloList.Add(useAllo);
+
+ useAllo = new()
+ {
+ ID = use.ID,
+ DetailID = useDetail.DetailID,
+ UseDate = new("2022/12/17"),
+ PersonID = use.PersonlList[1].PersonID,
+ };
+ useRoom.UseAlloList.Add(useAllo);
+
+ useFree = new()
+ {
+ ID = use.ID,
+ DetailID = useDetail.DetailID,
+ UseDate = new("2022/12/17"),
+ TypeID = 2,
+ DataValue = "ccvv",
+ };
+ useRoom.FreeList.Add(useFree);
+
+ sale = new()
+ {
+ ID = use.ID,
+ DetailID = useDetail.DetailID,
+ UseDate = new customTypes.Date(20221217),
+ SaleID = await EnvironmentSetting.GetSeq(ESeqType.Sale),
+ ReceiptID = 0,
+ ItemID = "1001",
+ ItemName = "宿泊料金",
+ Price = 10000,
+ Amount = 1,
+ Summary = 10000,
+ ServiceIOType = 1,
+ ServiceSummary = 1500,
+ ServiceRate = 15,
+ TaxType = 0,
+ TaxIOType = 1,
+ TaxSummary = 100,
+ TaxRate = 10,
+ BathTaxIOType = 1,
+ BathTaxType = 0,
+ BathTaxUnitPrice = 150,
+ BathTaxSummary = 150,
+ AccTaxIOType = 1,
+ AccTaxSummary = 200,
+ TotalSummary = 18000,
+ DiscountRate = 0,
+ DiscountSummary = 1000,
+ DiscountID = 1,
+ Pack = false,
+ PackChild = false,
+ PackSaleID = 0,
+ PersonType = 0,
+ PersonCount = 2,
+ InFemale = 1,
+ UseType = 0,
+ BaseAmount = 0,
+ PersonRef = false,
+ ReceiptItemName = string.Empty,
+ ReceiptPrtType = 0,
+ ReceiptPage = 0,
+ SrcType = 0,
+ FixturesID = string.Empty,
+ };
+ useRoom.SaleList.Add(sale);
+
+ sale = new()
+ {
+ ID = use.ID,
+ DetailID = useDetail.DetailID,
+ UseDate = new(20221217),
+ SaleID = await EnvironmentSetting.GetSeq(ESeqType.Sale),
+ ReceiptID = 0,
+ ItemID = "3001",
+ ItemName = "ドライヤー",
+ Price = 100,
+ Amount = 1,
+ Summary = 100,
+ ServiceIOType = 0,
+ ServiceSummary = 0,
+ ServiceRate = 0,
+ TaxType = 0,
+ TaxIOType = 1,
+ TaxSummary = 0,
+ TaxRate = 0,
+ BathTaxIOType = 1,
+ BathTaxType = 0,
+ BathTaxUnitPrice = 0,
+ BathTaxSummary = 0,
+ AccTaxIOType = 1,
+ AccTaxSummary = 0,
+ TotalSummary = 100,
+ DiscountRate = 0,
+ DiscountSummary = 10,
+ DiscountID = 1,
+ Pack = false,
+ PackChild = false,
+ PackSaleID = 0,
+ PersonType = 0,
+ PersonCount = 2,
+ InFemale = 1,
+ UseType = 0,
+ BaseAmount = 0,
+ PersonRef = false,
+ ReceiptItemName = string.Empty,
+ ReceiptPrtType = 0,
+ ReceiptPage = 0,
+ SrcType = 0,
+ FixturesID = "1",
+ };
+ useRoom.SaleList.Add(sale);
+
+ pay = new()
+ {
+ ID = use.ID,
+ DetailID = useDetail.DetailID,
+ UseDate = new(20221217),
+ PayID = await EnvironmentSetting.GetSeq(ESeqType.Pay),
+ ReceiptID = 0,
+ PayType = 0,
+ ItemID = "9001",
+ ItemName = "前受金",
+ PaySummary = 18000,
+ PackSaleID = 0,
+ ReceiptItemName = string.Empty,
+ ReceiptPrtType = 0,
+ ReceiptPage = 0,
+ AgentID = 0,
+ AgentBranchID = 0,
+ CustomerID = 0,
+ };
+ useRoom.PayList.Add(pay);
+
+ #endregion
+
+ #region 3泊
+
+ useRoom = new()
+ {
+ ID = use.ID,
+ DetailID = useDetail.DetailID,
+ UseDate = new("2022/12/18"),
+ BeginTime = 0,
+ EndTime = 0,
+ RoomTypeID = 1,
+ RoomKind = (int)ERoomKind.Normal,
+ RoomID = 101,
+ AgentID = 0,
+ AgentBranchID = 0,
+ PersionCount = 0,
+ Adult = 2,
+ ChildA = 0,
+ ChildB = 0,
+ ChildC = 0,
+ ChildD = 0,
+ ChildE = 0,
+ ChildF = 0,
+ Infant = 0,
+ InFemaleAdult = 1,
+ InFemaleChildA = 0,
+ InFemaleChildB = 0,
+ InFemaleChildC = 0,
+ InFemaleChildD = 0,
+ InFemaleChildE = 0,
+ InFemaleChildF = 0,
+ InFemaleInfant = 0,
+ };
+ useDetail.UseRoomList.Add(useRoom);
+
+ useAllo = new()
+ {
+ ID = use.ID,
+ DetailID = useDetail.DetailID,
+ UseDate = new("2022/12/18"),
+ PersonID = use.PersonlList[0].PersonID,
+ };
+ useRoom.UseAlloList.Add(useAllo);
+
+ useAllo = new()
+ {
+ ID = use.ID,
+ DetailID = useDetail.DetailID,
+ UseDate = new("2022/12/18"),
+ PersonID = use.PersonlList[1].PersonID,
+ };
+ useRoom.UseAlloList.Add(useAllo);
+
+ useFree = new()
+ {
+ ID = use.ID,
+ DetailID = useDetail.DetailID,
+ UseDate = new("2022/12/18"),
+ TypeID = 2,
+ DataValue = "ccvv",
+ };
+ useRoom.FreeList.Add(useFree);
+
+ sale = new()
+ {
+ ID = use.ID,
+ DetailID = useDetail.DetailID,
+ UseDate = new(20221218),
+ SaleID = await EnvironmentSetting.GetSeq(ESeqType.Sale),
+ ReceiptID = 0,
+ ItemID = "1001",
+ ItemName = "宿泊料金",
+ Price = 10000,
+ Amount = 1,
+ Summary = 10000,
+ ServiceIOType = 1,
+ ServiceSummary = 1500,
+ ServiceRate = 15,
+ TaxType = 0,
+ TaxIOType = 1,
+ TaxSummary = 100,
+ TaxRate = 10,
+ BathTaxIOType = 1,
+ BathTaxType = 0,
+ BathTaxUnitPrice = 150,
+ BathTaxSummary = 150,
+ AccTaxIOType = 1,
+ AccTaxSummary = 200,
+ TotalSummary = 18000,
+ DiscountRate = 0,
+ DiscountSummary = 1000,
+ DiscountID = 1,
+ Pack = false,
+ PackChild = false,
+ PackSaleID = 0,
+ PersonType = 0,
+ PersonCount = 2,
+ InFemale = 1,
+ UseType = 0,
+ BaseAmount = 0,
+ PersonRef = false,
+ ReceiptItemName = string.Empty,
+ ReceiptPrtType = 0,
+ ReceiptPage = 0,
+ SrcType = 0,
+ FixturesID = string.Empty,
+ };
+ useRoom.SaleList.Add(sale);
+
+ sale = new()
+ {
+ ID = use.ID,
+ DetailID = useDetail.DetailID,
+ UseDate = new(20221218),
+ SaleID = await EnvironmentSetting.GetSeq(ESeqType.Sale),
+ ReceiptID = 0,
+ ItemID = "3001",
+ ItemName = "ドライヤー",
+ Price = 100,
+ Amount = 1,
+ Summary = 100,
+ ServiceIOType = 0,
+ ServiceSummary = 0,
+ ServiceRate = 0,
+ TaxType = 0,
+ TaxIOType = 1,
+ TaxSummary = 0,
+ TaxRate = 0,
+ BathTaxIOType = 1,
+ BathTaxType = 0,
+ BathTaxUnitPrice = 0,
+ BathTaxSummary = 0,
+ AccTaxIOType = 1,
+ AccTaxSummary = 0,
+ TotalSummary = 100,
+ DiscountRate = 0,
+ DiscountSummary = 10,
+ DiscountID = 1,
+ Pack = false,
+ PackChild = false,
+ PackSaleID = 0,
+ PersonType = 0,
+ PersonCount = 2,
+ InFemale = 1,
+ UseType = 0,
+ BaseAmount = 0,
+ PersonRef = false,
+ ReceiptItemName = string.Empty,
+ ReceiptPrtType = 0,
+ ReceiptPage = 0,
+ SrcType = 0,
+ FixturesID = "1",
+ };
+ useRoom.SaleList.Add(sale);
+
+ pay = new()
+ {
+ ID = use.ID,
+ DetailID = useDetail.DetailID,
+ UseDate = new(20221218),
+ PayID = await EnvironmentSetting.GetSeq(ESeqType.Pay),
+ ReceiptID = 0,
+ PayType = 0,
+ ItemID = "9001",
+ ItemName = "前受金",
+ PaySummary = 18000,
+ PackSaleID = 0,
+ ReceiptItemName = string.Empty,
+ ReceiptPrtType = 0,
+ ReceiptPage = 0,
+ AgentID = 0,
+ AgentBranchID = 0,
+ CustomerID = 0,
+ };
+ useRoom.PayList.Add(pay);
+
+ #endregion
+
+ Rental rental = new()
+ {
+ ID = use.ID,
+ DetailID = useDetail.DetailID,
+ BeginDate = new("2022/12/16"),
+ FixturesID = "1",
+ Amount = 1,
+ ReturnPlanDate = new("2022/12/19"),
+ ReturnStatus = false,
+ ReturnStuffID = 0,
+ };
+ useDetail.RentalList.Add(rental);
+
+ #endregion
+
+ use.DetailID = useDetail.DetailID; //代表
+
+ #region UseDetail②
+
+ useDetail = new()
+ {
+ ID = use.ID,
+ DetailID = await EnvironmentSetting.GetSeq(ESeqType.UseDetail),
+ UseStatus = (int)EUseStatus.Resv,
+ SubStatus = 0,
+ ExtenStatus = 0,
+ CinDate = new("2022/12/16"),
+ CinTime = 1500,
+ Stay = 3,
+ CoutDate = new("2022/12/19"),
+ CoutTime = 1000,
+ AgentID = 301,
+ AgentBranchID = 1,
+ ResvNo = string.Empty,
+ ResvDate = CConvert.ToTimestamp(DateTime.Parse("2022/12/16 10:25:20")),
+ ResvHotelDate = new("2022/12/16"),
+ ResvType = (int)EResvType.Reserve,
+ ResvPersonID = 2,
+ SalesLoginID = 12,
+ PayType = 0,
+ PayItemID = "9001",
+ PayAgentID = 0,
+ PayAgentBranchID = 0,
+ RoomAssign = false,
+ CreateDate = CConvert.ToTimestamp(DateTime.Now.Date),
+ CreateLoginID = 1,
+ CreatePcName = Environment.MachineName,
+ CreateClass = 1,
+ UpdateDate = CConvert.ToTimestamp(DateTime.Now),
+ UpdateLoginID = 789,
+ UpdatePcName = Environment.MachineName,
+ UpdateClass = 2
+ };
+ use.DetailList.Add(useDetail);
+
+ useMemo = new()
+ {
+ ID = use.ID,
+ DetailID = useDetail.DetailID,
+ TypeID = 1,
+ Context = "朝食メモいいいいいおおおおお",
+ Alert = true,
+ };
+ useDetail.MemoList.Add(useMemo);
+
+
+ #endregion
+
+
+ useMemo = new()
+ {
+ ID = use.ID,
+ TypeID = 2,
+ Context = "会場メモだよ",
+ Alert = false,
+ };
+ use.MemoList.Add(useMemo);
+
+ useFree = new()
+ {
+ ID = use.ID,
+ UseDate = Date.MinUseDate,
+ TypeID = 2,
+ DataValue = "UUIDSFUD",
+ };
+ use.FreeList.Add(useFree);
+ return use;
+ }
+}
+
diff --git a/HotelPms.Client.Blazor/Util/GrpcSubDirHandler.cs b/HotelPms.Client.Blazor/Util/GrpcSubDirHandler.cs
new file mode 100644
index 0000000..018e86a
--- /dev/null
+++ b/HotelPms.Client.Blazor/Util/GrpcSubDirHandler.cs
@@ -0,0 +1,69 @@
+#region Copyright notice and license
+
+// Copyright 2019 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net.Http;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace HotelPms.Client.Blazor.Util
+{
+ /// <summary>
+ /// A delegating handler that will add a subdirectory to the URI of gRPC requests.
+ /// </summary>
+ public class GrpcSubDirHandler : DelegatingHandler
+ {
+ private readonly string _subdirectory;
+ private readonly IGlobalLoadingSpinner _loadingSpinnerService;
+
+ public GrpcSubDirHandler(HttpMessageHandler innerHandler, IGlobalLoadingSpinner loadingSpinnerService, string subdirectory) : base(innerHandler)
+ {
+ _subdirectory = subdirectory;
+ _loadingSpinnerService = loadingSpinnerService;
+ }
+
+ protected async override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
+ {
+ //发送请求之前显示加载指示器
+ //EnvironmentSetting.Debug($"ShowAsync begin:{DateTime.Now.ToString("HH:mm:ss fff")}");
+ //await _loadingSpinnerService.ShowAsync(); //0.5秒
+
+ EnvironmentSetting.Debug($"SendAsync begin:{DateTime.Now.ToString("HH:mm:ss fff")}");
+ //发送请求
+ if (request.RequestUri != null && _subdirectory.Length > 0)
+ {
+ var url = $"{request.RequestUri.Scheme}://{request.RequestUri.Host}{_subdirectory}{request.RequestUri.AbsolutePath}";
+ EnvironmentSetting.Debug($"SendAsync Url⇒{url}");
+ request.RequestUri = new Uri(url, UriKind.Absolute);
+ }
+ else
+ {
+ EnvironmentSetting.Debug($"SendAsync Url⇒{request.RequestUri.AbsolutePath}");
+ }
+ var response = await base.SendAsync(request, cancellationToken);
+
+ EnvironmentSetting.Debug($"SendAsync End:{DateTime.Now.ToString("HH:mm:ss fff")}");
+ //收到结果之后隐藏加载指示器
+ //await _loadingSpinnerService.HideAsync();
+ //EnvironmentSetting.Debug($"HideAsync End:{DateTime.Now.ToString("HH:mm:ss fff")}");
+ return response;
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/Util/IGlobalLoadingSpinner.cs b/HotelPms.Client.Blazor/Util/IGlobalLoadingSpinner.cs
new file mode 100644
index 0000000..6b596b8
--- /dev/null
+++ b/HotelPms.Client.Blazor/Util/IGlobalLoadingSpinner.cs
@@ -0,0 +1,12 @@
+using System.Threading.Tasks;
+
+namespace HotelPms.Client.Blazor.Util
+{
+ public interface IGlobalLoadingSpinner
+ {
+ Task ShowAsync();
+ Task HideAsync();
+
+ Task HideLogoAsync();
+ }
+}
diff --git a/HotelPms.Client.Blazor/Util/JSInteropEx.cs b/HotelPms.Client.Blazor/Util/JSInteropEx.cs
new file mode 100644
index 0000000..7e7e326
--- /dev/null
+++ b/HotelPms.Client.Blazor/Util/JSInteropEx.cs
@@ -0,0 +1,62 @@
+using Microsoft.JSInterop;
+
+namespace HotelPms.Client.Blazor.Util
+{
+ public static class JSInteropEx
+ {
+ public static async Task SaveAsFileAsync(this IJSRuntime js, string fileName, byte[] data, string type = "application/octet-stream", bool useBom = false)
+ {
+ await js.InvokeAsync<object>("NetCallJs.saveAsFile", fileName, type, Convert.ToBase64String(data), useBom);
+ }
+
+ public static async Task SetTRTop(this IJSRuntime js, string ownerID, int rowIndex)
+ {
+ await js.InvokeAsync<object>("NetCallJs.setTRTop", ownerID, rowIndex);
+ }
+
+ public static async Task SetGridWidth(this IJSRuntime js, string ownerID, string width)
+ {
+ await js.InvokeAsync<object>("NetCallJs.setTableWidth", ownerID, width);
+ }
+
+ public static async Task DelGridCol(this IJSRuntime js, string ownerID, int colIndex)
+ {
+ await js.InvokeAsync<object>("NetCallJs.delTableCol", ownerID, colIndex);
+ }
+
+ public static async Task SetGridStyle(this IJSRuntime js, string ownerID, string style)
+ {
+ await js.InvokeAsync<object>("NetCallJs.setTableStyle", ownerID, style);
+ }
+
+ public static async Task RemoveGridClass(this IJSRuntime js, string ownerID, string className)
+ {
+ await js.InvokeAsync<object>("NetCallJs.removeTableClass", ownerID, className);
+ }
+
+ public static async Task<BoundingClientRect> GetClientRectByID(this IJSRuntime js, string id)
+ {
+ return await js.InvokeAsync<BoundingClientRect>("NetCallJs.getClientRectByID", id);
+ }
+
+ /// <summary>
+ /// 注意:約0.8秒かかる
+ /// </summary>
+ /// <param name="js"></param>
+ /// <returns></returns>
+ public static async Task<WindowDimensions> GetWindowSize(this IJSRuntime js)
+ {
+ return await js.InvokeAsync<WindowDimensions>("NetCallJs.getWindowSize");
+ }
+
+ public static async Task<ElementBase> GetActiveElement(this IJSRuntime js)
+ {
+ return await js.InvokeAsync<ElementBase>("NetCallJs.getActiveElement");
+ }
+
+ public static async Task SetFocusByKey(this IJSRuntime js, string key)
+ {
+ await js.InvokeAsync<object>("NetCallJs.setFocusByKey", key);
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/Util/MasterCore.cs b/HotelPms.Client.Blazor/Util/MasterCore.cs
new file mode 100644
index 0000000..84434dd
--- /dev/null
+++ b/HotelPms.Client.Blazor/Util/MasterCore.cs
@@ -0,0 +1,140 @@
+using Grpc.Net.Client;
+using HotelPms.Client.Blazor.Models;
+using HotelPms.Data.Client;
+using HotelPms.Data.Common;
+using HotelPms.Data.Master;
+using HotelPms.DataAccessGrpc.Client;
+using HotelPms.Share.IO;
+using HotelPms.Share.Util;
+using System.Data;
+
+namespace HotelPms.Client.Blazor.Util
+{
+ public class MasterCore
+ {
+ /// <summary>
+ /// マスタ名称取得
+ /// </summary>
+ /// <param name="tableName">「M_」なし</param>
+ /// <param name="id"></param>
+ /// <returns></returns>
+ public static async Task<string> GetName(string tableName, int id)
+ {
+ Data.GrpcTable table = await GrpcClient.GetTableAsync(EnvironmentSetting.GrpcChannel, (int)ETableActionType.MasterName, $"{tableName},{id}");
+ return CConvert.ToString(table.GetValue(typeof(string)));
+ }
+
+ public static async Task<string> GetSaleLoginName(int id)
+ {
+ Data.GrpcTable table = await GrpcClient.GetTableAsync(EnvironmentSetting.GrpcChannel, (int)ETableActionType.SalesLoginName, $"{id}");
+ return CConvert.ToString(table.GetValue(typeof(string)));
+ }
+
+ /// <summary>
+ /// 部屋タイプ名称
+ /// </summary>
+ /// <param name="id"></param>
+ /// <returns></returns>
+ public static async Task<string> GetRoomTypeName(int id)
+ {
+ string name = CacheStorage.Instance.GetMasterName(CacheStorage.Key.RoomTypeName, id);
+ if (name.Length > 0) { return name; }
+ name = await GetName("RoomType", id);
+ if (name.Length > 0) { CacheStorage.Instance.SetMasterName(CacheStorage.Key.RoomTypeName, id, name); }
+ return name;
+ }
+
+ /// <summary>
+ /// 部屋タイプ基本情報の取得
+ /// </summary>
+ /// <param name="id"></param>
+ /// <returns></returns>
+ public static async Task<RoomTypeBase> GetRoomTypeBase(int id)
+ {
+ try
+ {
+ Data.GrpcTable table = await GrpcClient.GetTableAsync(EnvironmentSetting.GrpcChannel, (int)ETableActionType.RoomTypeBase, id.ToString());
+ if (table.Rows.Count == 0) { return null; }
+ using DataTable data = table.ToDataTable();
+ return new RoomTypeBase(data.Rows[0]);
+ }
+ catch(Exception ex)
+ {
+ OperationLog.Instance.WriteLog($"GetRoomTypeBase:{ex.Message}");
+ return null;
+ }
+ }
+
+ /// <summary>
+ /// 選択一覧用部屋タイプマスタを取得する
+ /// </summary>
+ /// <returns></returns>
+ public static async Task<DataTable> GetRoomTypeList()
+ {
+ try
+ {
+ Data.GrpcTable table = await GrpcClient.GetTableAsync(EnvironmentSetting.GrpcChannel, (int)ETableActionType.RoomTypeList, string.Empty);
+ return table.ToDataTable();
+ }
+ catch (Exception ex)
+ {
+ OperationLog.Instance.WriteLog($"GetRoomTypeList:{ex.Message}");
+ return null;
+ }
+ }
+
+ public static async Task<DataTable> GetSalesLoginList()
+ {
+ try
+ {
+ Data.GrpcTable table = await GrpcClient.GetTableAsync(EnvironmentSetting.GrpcChannel, (int)ETableActionType.SalesLoginList, string.Empty);
+ return table.ToDataTable();
+ }
+ catch (Exception ex)
+ {
+ OperationLog.Instance.WriteLog($"GetSalesLoginList:{ex.Message}");
+ return null;
+ }
+ }
+
+ /// <summary>
+ /// 科目マスタの情報を取得する
+ /// </summary>
+ /// <param name="id"></param>
+ /// <returns></returns>
+ public static async Task<Item> GetItem(string id)
+ {
+ try
+ {
+ using ItemAccess access = new DataAccessGrpc.Client.ItemAccess(EnvironmentSetting.GrpcChannel);
+ return await access.GetItemAsync(id);
+ }
+ catch (Exception ex)
+ {
+ OperationLog.Instance.WriteLog($"GetItem:{ex.Message}");
+ return null;
+ }
+ }
+
+ /// <summary>
+ /// 部屋タイプ、人数の基本料金を取得する
+ /// </summary>
+ /// <param name="roomTypeID"></param>
+ /// <param name="personCount"></param>
+ /// <param name="useDate"></param>
+ /// <returns></returns>
+ public static async Task<Item> GetBaseItem(int roomTypeID, int personCount, string useDate)
+ {
+ try
+ {
+ using ItemAccess access = new DataAccessGrpc.Client.ItemAccess(EnvironmentSetting.GrpcChannel);
+ return await access.GetBaseItem(roomTypeID, personCount, useDate);
+ }
+ catch (Exception ex)
+ {
+ OperationLog.Instance.WriteLog($"GetBaseItem:{ex.Message}");
+ return null;
+ }
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/Util/Message.cs b/HotelPms.Client.Blazor/Util/Message.cs
new file mode 100644
index 0000000..d550566
--- /dev/null
+++ b/HotelPms.Client.Blazor/Util/Message.cs
@@ -0,0 +1,25 @@
+using Microsoft.AspNetCore.Components;
+using MudBlazor;
+
+namespace HotelPms.Client.Blazor.Util
+{
+ public static class Message
+ {
+ public static List<string> GetConfirmForRemove(string adding)
+ {
+ return new List<string> { "削除しますか?", adding };
+ }
+
+ public static void Show(RenderFragment fragment)
+ {
+ ISnackbar snack = EnvironmentSetting.ServiceProvider.GetService<ISnackbar>();
+ snack.Add(fragment, Severity.Error);
+ }
+
+ public static void Show(string text)
+ {
+ ISnackbar snack = EnvironmentSetting.ServiceProvider.GetService<ISnackbar>();
+ snack.Add("該当データが存在しません。", Severity.Warning);
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/Util/MudBlazorExpandEx.cs b/HotelPms.Client.Blazor/Util/MudBlazorExpandEx.cs
new file mode 100644
index 0000000..3c20160
--- /dev/null
+++ b/HotelPms.Client.Blazor/Util/MudBlazorExpandEx.cs
@@ -0,0 +1,48 @@
+using Microsoft.AspNetCore.Components;
+using Microsoft.JSInterop;
+using MudBlazor;
+using System.Reflection;
+
+namespace HotelPms.Client.Blazor.Util
+{
+ public static class MudBlazorExpandEx
+ {
+ internal static ElementReference GetRef<T>(this MudTextField<T> source)
+ {
+ Type type = source.GetType();
+ BindingFlags flag = BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public;
+ FieldInfo ff = type.GetField("_elementReference", flag);
+ object mudInput = ff.GetValue(source);
+ type = mudInput.GetType();
+ ff = type.GetField("_elementReference", flag);
+ object _elementReference = ff.GetValue(mudInput); //input or textarea
+ return (ElementReference)_elementReference;
+ }
+
+ public static ValueTask<string> GetInputValue<T>(this MudTextField<T> source, IJSRuntime JSRuntime)
+ {
+ try
+ {
+ ElementReference e = source.InputReference.ElementReference;
+ return JSRuntime.InvokeAsync<string>("NetCallJs.getInputValue", e);
+ }
+ catch
+ {
+ return ValueTask.FromResult(string.Empty);
+ }
+ }
+
+ public static ValueTask SetInputValue<T>(this MudTextField<T> source, IJSRuntime JSRuntime, string value)
+ {
+ try
+ {
+ ElementReference e = source.InputReference.ElementReference;
+ return JSRuntime.InvokeVoidAsync("NetCallJs.setInputValue", e, value);
+ }
+ catch
+ {
+ return ValueTask.CompletedTask;
+ }
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/Util/OptionCore.cs b/HotelPms.Client.Blazor/Util/OptionCore.cs
new file mode 100644
index 0000000..e976b5d
--- /dev/null
+++ b/HotelPms.Client.Blazor/Util/OptionCore.cs
@@ -0,0 +1,67 @@
+using System.Collections.Concurrent;
+
+namespace HotelPms.Client.Blazor.Util
+{
+ public class OptionCore : IDisposable
+ {
+ public enum GroupKey : int
+ {
+ System = 0,
+ }
+
+ public enum Key: int
+ {
+ System_CinTime = 0,
+ System_CoutTime,
+ System_CinTimeDayUse,
+ System_CoutTimeDayUse,
+ }
+
+ private static OptionCore m_Instance;
+ public static OptionCore Instance
+ {
+ get
+ {
+ if (m_Instance == null) { m_Instance = new OptionCore(); }
+ return m_Instance;
+ }
+ }
+
+ /// <summary>
+ /// バッファー保存用メモリDB
+ /// </summary>
+ public ConcurrentDictionary<string, string> Data { get; set; } = new ConcurrentDictionary<string, string>();
+
+ /// <summary>
+ /// [Group,[Key, Value]]
+ /// </summary>
+ public ConcurrentDictionary<string, ConcurrentDictionary<string, string>> DefaultData { get; set; } = new ConcurrentDictionary<string, ConcurrentDictionary<string, string>>();
+
+ public void Dispose()
+ {
+ Data.Clear();
+ }
+
+ public OptionCore()
+ {
+ InitDefault();
+ }
+
+ /// <summary>
+ /// 初期値
+ /// </summary>
+ private void InitDefault()
+ {
+ #region システム
+
+ ConcurrentDictionary<string, string> itemDict = new();
+ DefaultData[GroupKey.System.ToString()] = itemDict;
+ itemDict[Key.System_CinTime.ToString()] = "1500";
+ itemDict[Key.System_CoutTime.ToString()] = "1000";
+ itemDict[Key.System_CinTimeDayUse.ToString()] = "0900";
+ itemDict[Key.System_CoutTimeDayUse.ToString()] = "1000";
+
+ #endregion
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/Util/ScrollPosition.cs b/HotelPms.Client.Blazor/Util/ScrollPosition.cs
new file mode 100644
index 0000000..822ec2f
--- /dev/null
+++ b/HotelPms.Client.Blazor/Util/ScrollPosition.cs
@@ -0,0 +1,10 @@
+namespace HotelPms.Client.Blazor.Util
+{
+ public class ScrollPosition
+ {
+ public double ScrollTop { get; set; }
+ public double ScrollLeft { get; set; }
+ public double WindowWidth { get; set; }
+ public double WindowHeight { get; set; }
+ }
+}
diff --git a/HotelPms.Client.Blazor/Util/SystemEnum.cs b/HotelPms.Client.Blazor/Util/SystemEnum.cs
new file mode 100644
index 0000000..8760482
--- /dev/null
+++ b/HotelPms.Client.Blazor/Util/SystemEnum.cs
@@ -0,0 +1,67 @@
+using System.ComponentModel;
+
+namespace HotelPms.Client.Blazor.Util
+{
+ public class SystemEnum
+ {
+ [Flags()]
+ public enum EInputChar
+ {
+ None = 0x1, //特になし
+ Num = 0x2, //数字
+ Alpha_S = 0x4, //アルファベット小
+ Alpha_C = 0x8, //アルファベット大
+ Kana = 0x10, //カナ
+ Half = 0x20, //半角
+ Full = 0x40, //全角
+ Num_FieldClear = 0x80, //入力最大桁超えたらクリア
+ Plus_FieldClear = 0x100,//"+"キーでクリア
+ Space = 0x200, //空白
+ Colon = 0x400, //":"を可能
+ Subtract = 0x800, //"-"
+ DotSendKeys = 0x1000, //"."→"000"とする
+ Dot = 0x2000, //"."
+ Slash = 0x4000, //"/"
+ Comma = 0x8000, //"," カンマ
+
+ Alpha = Alpha_S | Alpha_C,//アルファベット小+アルファベット大
+ NumAlpha = Num | Alpha | Space,//数字+アルファベット+空白
+ ANK = NumAlpha | Kana, //数字+アルファベット+空白+カナ
+ Time = Num | Colon, //時間用 "12:30"
+ }
+
+ [Flags()]
+ public enum EShowStyle
+ {
+ None = 0x1, //特になし
+ ZeroPad = 0x2, //桁数未満だったら"0"を頭に追加
+ ThousandSeparator = 0x4,//金額時の3桁ごとの"," 例1,000,000
+ ShowList = 0x8, //ENDキーで一覧選択画面があり
+ }
+
+ /// <summary>
+ /// 入力スタイル
+ /// </summary>
+ public enum EInputStyle : int
+ {
+ /// <summary>
+ /// 通常
+ /// </summary>
+ [Description("通常")]
+ Normal = 0,
+ /// 時刻
+ /// </summary>
+ [Description("時刻(HH:mm)")]
+ Time,
+ [Description("日付(yyyy/MM/dd)")]
+ Date,
+ }
+
+ public enum EMessageType : int
+ {
+ OK = 0,
+ OKCancel,
+ YesNo,
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/Util/UseCore.cs b/HotelPms.Client.Blazor/Util/UseCore.cs
new file mode 100644
index 0000000..8dc6065
--- /dev/null
+++ b/HotelPms.Client.Blazor/Util/UseCore.cs
@@ -0,0 +1,10 @@
+namespace HotelPms.Client.Blazor.Util
+{
+ /// <summary>
+ /// クライアント側利用情報の関連操作
+ /// </summary>
+ public class UseCore
+ {
+
+ }
+}
diff --git a/HotelPms.Client.Blazor/Util/WindowDimensions.cs b/HotelPms.Client.Blazor/Util/WindowDimensions.cs
new file mode 100644
index 0000000..2fa74af
--- /dev/null
+++ b/HotelPms.Client.Blazor/Util/WindowDimensions.cs
@@ -0,0 +1,7 @@
+namespace HotelPms.Client.Blazor.Util;
+
+public class WindowDimensions
+{
+ public int Width { get; set; }
+ public int Height { get; set; }
+}
diff --git a/HotelPms.Client.Blazor/ViewModel/Arrange.cs b/HotelPms.Client.Blazor/ViewModel/Arrange.cs
new file mode 100644
index 0000000..d8533d9
--- /dev/null
+++ b/HotelPms.Client.Blazor/ViewModel/Arrange.cs
@@ -0,0 +1,29 @@
+using HotelPms.Share.Util;
+using Microsoft.JSInterop;
+using System.ComponentModel.DataAnnotations;
+using static HotelPms.Client.Blazor.Util.SystemEnum;
+
+namespace HotelPms.Client.Blazor.ViewModel
+{
+ /// <summary>
+ /// 画面表示・編集用
+ /// </summary>
+ public class Arrange : ValidModel
+ {
+ /// <summary>
+ /// 初期化
+ /// </summary>
+ public Arrange(IJSRuntime js) : base(js)
+ {
+
+ Add(new ValidField() { Name = "ID", Caption = "ID", Required = true, InputChar = EInputChar.Num, MaxLenth = 7, GridOrder = 1 });
+ Add(new ValidField() { Name = "ShortName", Caption = "略称", Required = true, MaxLenth = 10, InputChar = EInputChar.Half, GridFilter = true });
+ Add(new ValidField() { Name = "Name", Caption = "名称", Required = true, MaxLenth = 50, InputChar = EInputChar.None, GridFilter = true });
+ Add(new ValidField() { Name = "Tel", Caption = "電話番号", Required = true, MaxLenth = 50, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "Fax", Caption = "FAX", Required = true, MaxLenth = 50, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "ZipCode", Caption = "郵便番号", Required = true, MaxLenth = 10, ShowStyle = EShowStyle.ShowList, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "Address1", Caption = "住所①", Required = false, MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "Address2", Caption = "住所②", Required = false, MaxLenth = 50, InputChar = EInputChar.None });
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/ViewModel/Building.cs b/HotelPms.Client.Blazor/ViewModel/Building.cs
new file mode 100644
index 0000000..b187f8f
--- /dev/null
+++ b/HotelPms.Client.Blazor/ViewModel/Building.cs
@@ -0,0 +1,28 @@
+using HotelPms.Share.Util;
+using Microsoft.JSInterop;
+using System.ComponentModel.DataAnnotations;
+using static HotelPms.Client.Blazor.Util.SystemEnum;
+
+namespace HotelPms.Client.Blazor.ViewModel
+{
+ /// <summary>
+ /// 画面表示・編集用
+ /// </summary>
+ public class Building : ValidModel
+ {
+ /// <summary>
+ /// 初期化
+ /// </summary>
+ public Building(IJSRuntime js) : base(js)
+ {
+
+ Add(new ValidField() { Name = "ID", Caption = "ID", Required = true, InputChar = EInputChar.Num, MaxLenth = 7, GridOrder = 1, WidthUnit = 4, NewLine = true });
+ Add(new ValidField() { Name = "ShortName", Caption = "略称", Required = true, MaxLenth = 10, InputChar = EInputChar.Half, GridFilter = true, WidthUnit = 4 });
+ Add(new ValidField() { Name = "Name", Caption = "名称", Required = true, MaxLenth = 50, InputChar = EInputChar.None, GridFilter = true, WidthUnit = 8 });
+ Add(new ValidField() { Name = "Tel", Caption = "電話番号", Required = true, MaxLenth = 50, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "Fax", Caption = "FAX", Required = true, MaxLenth = 50, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "ZipCode", Caption = "郵便番号", Required = true, MaxLenth = 10, ShowStyle = EShowStyle.ShowList, InputChar = EInputChar.Num | EInputChar.Subtract, WidthUnit = 5, NewLine = true });
+ Add(new ValidField() { Name = "Address2", Caption = "住所②", Required = false, MaxLenth = 50, ShowStyle = EShowStyle.ShowList, InputChar = EInputChar.None, WidthUnit = 12 });
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/ViewModel/ColSettingData.cs b/HotelPms.Client.Blazor/ViewModel/ColSettingData.cs
new file mode 100644
index 0000000..476ea6e
--- /dev/null
+++ b/HotelPms.Client.Blazor/ViewModel/ColSettingData.cs
@@ -0,0 +1,119 @@
+using HotelPms.Client.Blazor.Util;
+using HotelPms.Data;
+using HotelPms.Data.Common;
+using Grpc.Net.Client;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Threading.Channels;
+using System.Threading.Tasks;
+using HotelPms.Data.Client;
+
+namespace HotelPms.Client.Blazor.ViewModel
+{
+ public class ColSettingData
+ {
+ /// <summary>
+ /// 帳票ID
+ /// </summary>
+ public int ReportID { get; set; } = 0;
+
+ /// <summary>
+ /// 帳票名
+ /// </summary>
+ public string ReportName { get; set; }
+
+ /// <summary>
+ /// 項目一覧(S_ReportCol)
+ /// </summary>
+ public List<string> OrgColList { get; set; }
+
+ /// <summary>
+ /// 出力パターンID
+ /// </summary>
+ public int OutputID { get; set; }
+
+ /// <summary>
+ /// 出力パターン名
+ /// </summary>
+ public string OutputName { get; set; }
+
+ /// <summary>
+ /// 出力パターン候補一覧
+ /// </summary>
+ internal List<HotelPms.Data.Master.Output> OutputList { get; set; }
+
+ /// <summary>
+ /// 第一ソート順
+ /// </summary>
+ public string Sort1 { get; set; }
+
+ /// <summary>
+ /// 第二ソート順
+ /// </summary>
+ public string Sort2 { get; set; }
+
+ public List<ColSettingRow> Rows { get; set; }
+
+
+ /// <summary>
+ /// 帳票設定データの作成
+ /// </summary>
+ /// <param name="reportID"></param>
+ /// <param name="channel"></param>
+ /// <returns></returns>
+ public static async Task<ColSettingData> Create(int reportID, GrpcChannel channel)
+ {
+ string name = string.Empty;
+ GrpcSet grpcSet = await GrpcClient.GetDataSet(channel, (int)ESetActionType.ColSetting, $"{Environment.MachineName},{EnvironmentSetting.UserName},{reportID}");
+ if (grpcSet.ErrNo != 0) { return null; }
+
+ using (DataTable dataTable = grpcSet.Tables[0].ToDataTable())
+ {
+ if (dataTable.Rows.Count > 0)
+ {
+ name = dataTable.Rows[0]["Name"].ToString();
+ }
+ }
+
+ List<string> list = new List<string>();
+ using (DataTable dataTable = grpcSet.Tables[3].ToDataTable())
+ {
+ foreach(DataColumn col in dataTable.Columns)
+ {
+ list.Add(col.ColumnName);
+ }
+ }
+
+ //取得する(列設定情報)
+ ColSettingData data = new ColSettingData
+ {
+ ReportID = reportID,
+ ReportName = name,
+ OutputList = grpcSet.Tables[1].Convert<HotelPms.Data.Master.Output>(),
+ OrgColList = list,
+ Rows = new List<ColSettingRow>(),
+ };
+
+ //Dict化
+ Dictionary<int, HotelPms.Data.Master.Output> dict = new Dictionary<int, HotelPms.Data.Master.Output>();
+ foreach (HotelPms.Data.Master.Output item in data.OutputList) { dict.Add(item.ID, item); }
+
+ //明細
+ using (DataTable detail = grpcSet.Tables[2].ToDataTable())
+ {
+ foreach (DataRow row in detail.Rows)
+ {
+ Data.Master.OutputItem outputItem = new Data.Master.OutputItem();
+ outputItem.ConvertDataRow(row);
+ Data.Master.Output parent = null;
+ if (!dict.TryGetValue(outputItem.OutputID, out parent)) { continue; }
+ parent.Items.Add(outputItem);
+ }
+ }
+
+ return data;
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/ViewModel/ColSettingRow.cs b/HotelPms.Client.Blazor/ViewModel/ColSettingRow.cs
new file mode 100644
index 0000000..a1a9399
--- /dev/null
+++ b/HotelPms.Client.Blazor/ViewModel/ColSettingRow.cs
@@ -0,0 +1,47 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace HotelPms.Client.Blazor.ViewModel
+{
+ public class ColSettingRow
+ {
+ public int ID { get; set; }
+
+ public string Name { get; set; } = string.Empty;
+ public bool Frozen { get; set; } = false;
+
+ public int Width { get; set; } = 100;
+
+ public string ClassName { get; set; } = string.Empty;
+
+ /// <summary>
+ /// 選択する
+ /// </summary>
+ public void Select()
+ {
+ ClassName = "tr-select";
+ }
+
+ public ColSettingRow DeepClone()
+ {
+ ColSettingRow item = new ColSettingRow();
+ item.ID = ID;
+ item.Name = Name;
+ item.Frozen = Frozen;
+ item.Width = Width;
+ item.ClassName = ClassName;
+ return item;
+ }
+
+ public void CopyTo(ColSettingRow item)
+ {
+ item.ID = ID;
+ item.Name = Name;
+ item.Frozen = Frozen;
+ item.Width = Width;
+ item.ClassName = ClassName;
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/ViewModel/Demo.cs b/HotelPms.Client.Blazor/ViewModel/Demo.cs
new file mode 100644
index 0000000..549a9b7
--- /dev/null
+++ b/HotelPms.Client.Blazor/ViewModel/Demo.cs
@@ -0,0 +1,30 @@
+using HotelPms.Share.Util;
+using Microsoft.JSInterop;
+using System.ComponentModel.DataAnnotations;
+using static HotelPms.Client.Blazor.Util.SystemEnum;
+
+namespace HotelPms.Client.Blazor.ViewModel
+{
+ /// <summary>
+ /// 画面表示・編集用
+ /// </summary>
+ public class Demo : ValidModel
+ {
+ /// <summary>
+ /// 初期化
+ /// </summary>
+ public Demo(IJSRuntime js) : base(js)
+ {
+
+ Add(new ValidField() { Name = "ID", Caption = "ID", Required = true, InputChar = EInputChar.Num, MaxLenth = 7, GridOrder = 1, NewLine = true });
+ Add(new ValidField() { Name = "Name", Caption = "名称", Required = true, MaxLenth = 50, InputChar = EInputChar.None, GridFilter = true });
+ Add(new ValidField() { Name = "FInt", Caption = "数字", Required = false, MaxLenth = 7, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "FTinyInt", Caption = "数字", Required = false, MaxLenth = 3, Range = "[0,255]", InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "FSmallInt", Caption = "SmallInt数字", Required = false, MaxLenth = 6, Range = "[-32768,32767]", InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "FFloat", Caption = "Float数字", Required = false, MaxLenth = 10, InputChar = EInputChar.Num | EInputChar.Dot });
+ Add(new ValidField() { Name = "FBit", Caption = "FBit", Required = false, MaxLenth = 1, Range = "[0,1]", InputChar = EInputChar.Num, DispNameEnabled = true, ShowStyle = EShowStyle.ShowList, WidthUnit = 1, DispWidthUnit = 5 });
+ Add(new ValidField() { Name = "FDecimal", Caption = "金額", Required = false, MaxLenth = 16, ShowStyle = EShowStyle.ThousandSeparator, ThousandFormat = "N2", InputChar = EInputChar.Num | EInputChar.Subtract | EInputChar.Dot });
+ Add(new ValidField() { Name = "FDate", Caption = "日付", Required = false, MaxLenth = 10, InputChar = EInputChar.Num | EInputChar.Slash, ShowStyle = EShowStyle.ShowList, InputStyle = EInputStyle.Date });
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/ViewModel/Hotel.cs b/HotelPms.Client.Blazor/ViewModel/Hotel.cs
new file mode 100644
index 0000000..5348570
--- /dev/null
+++ b/HotelPms.Client.Blazor/ViewModel/Hotel.cs
@@ -0,0 +1,29 @@
+using HotelPms.Share.Util;
+using Microsoft.JSInterop;
+using System.ComponentModel.DataAnnotations;
+using static HotelPms.Client.Blazor.Util.SystemEnum;
+
+namespace HotelPms.Client.Blazor.ViewModel
+{
+ /// <summary>
+ /// 画面表示・編集用
+ /// </summary>
+ public class Hotel : ValidModel
+ {
+ /// <summary>
+ /// 初期化
+ /// </summary>
+ public Hotel(IJSRuntime js) : base(js)
+ {
+
+ Add(new ValidField() { Name = "ID", Caption = "ID", Required = true, InputChar = EInputChar.Num, MaxLenth = 7, GridOrder = 1 });
+ Add(new ValidField() { Name = "ShortName", Caption = "略称", Required = true, MaxLenth = 10, InputChar = EInputChar.Half, GridFilter = true });
+ Add(new ValidField() { Name = "Name", Caption = "名称", Required = true, MaxLenth = 50, InputChar = EInputChar.None, GridFilter = true });
+ Add(new ValidField() { Name = "Tel", Caption = "電話番号", Required = true, MaxLenth = 50, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "Fax", Caption = "FAX", Required = true, MaxLenth = 50, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "ZipCode", Caption = "郵便番号", Required = true, MaxLenth = 10, ShowStyle = EShowStyle.ShowList, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "Address1", Caption = "住所①", Required = false, MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "Address2", Caption = "住所②", Required = false, MaxLenth = 50, InputChar = EInputChar.None });
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/ViewModel/Item.cs b/HotelPms.Client.Blazor/ViewModel/Item.cs
new file mode 100644
index 0000000..148b5f0
--- /dev/null
+++ b/HotelPms.Client.Blazor/ViewModel/Item.cs
@@ -0,0 +1,69 @@
+using HotelPms.Share.Util;
+using Microsoft.JSInterop;
+using System.ComponentModel.DataAnnotations;
+using static HotelPms.Client.Blazor.Util.SystemEnum;
+
+namespace HotelPms.Client.Blazor.ViewModel;
+
+/// <summary>
+/// 画面表示・編集用
+/// </summary>
+public class Item : ValidModel
+{
+ /// <summary>
+ /// 初期化
+ /// </summary>
+ public Item(IJSRuntime js) : base(js)
+ {
+
+ Add(new ValidField() { Name = "ID", Caption = "科目ID", MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "Name", Caption = "科目名称", MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "EnName", Caption = "英語名", MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "Name2", Caption = "その他言語", MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "ReceiptName", Caption = "領収書名称", MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "RoomTypeID", Caption = "部屋タイプID", MaxLenth = 2, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "PersonCount", Caption = "人数", MaxLenth = 2, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "Price", Caption = "単価", MaxLenth = 9, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "DiscountRate", Caption = "割引率", MaxLenth = 5, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "DiscountSummary", Caption = "割引額", MaxLenth = 9, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "DiscountID", Caption = "割引理由", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "ServiceIOType", Caption = "サービス料区分", MaxLenth = 2, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "ServiceRate", Caption = "サービス率", MaxLenth = 5, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "TaxType", Caption = "消費税種類", MaxLenth = 2, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "TaxIOType", Caption = "消費税区分", MaxLenth = 2, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "BathTaxIOType", Caption = "入湯税区分", MaxLenth = 2, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "AccTaxIOType", Caption = "宿泊税区分", MaxLenth = 2, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "SaleSectionID", Caption = "売上部門ID", MaxLenth = 2, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "SumSectionID", Caption = "集計部門ID", MaxLenth = 2, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "Kind", Caption = "科目種別", MaxLenth = 2, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "NextDay", Caption = "翌日計上フラグ", MaxLenth = 1, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "AgentID", Caption = "エージェントID", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "AgentBranchID", Caption = "支店ID", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "PointFlg", Caption = "ポイント計上対象", MaxLenth = 1, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "PointInTax", Caption = "ポイント計上税込区分", MaxLenth = 1, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "PointRate", Caption = "ポイント計上係数", MaxLenth = 5, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "PointPrice", Caption = "ポイント計上単価", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "PointSumType", Caption = "ポイント計上方式", MaxLenth = 2, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "Point", Caption = "調整ポイント", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "DayUse", Caption = "日帰フラグ", MaxLenth = 1, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "ReceiptPrtType", Caption = "領収書印字区分", MaxLenth = 2, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "LongStayFlg", Caption = "連泊引継フラグ", MaxLenth = 1, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "RentalType", Caption = "貸出手配区分", MaxLenth = 2, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "TraderID", Caption = "手配業者", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "TraderMemo", Caption = "手配メモ", MaxLenth = 100, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "PackFlg", Caption = "パックフラグ", MaxLenth = 1, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "SortID", Caption = "表示順", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "Fraction", Caption = "端数区分", MaxLenth = 2, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "InRoomSales", Caption = "基本料金計上フラグ", MaxLenth = 1, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "MealType", Caption = "食事区分", MaxLenth = 2, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "UseType", Caption = "一人単価", MaxLenth = 2, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "PersonType", Caption = "人物種類", MaxLenth = 2, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "Parking", Caption = "駐車場フラグ", MaxLenth = 1, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "HallFee", Caption = "会場料金フラグ", MaxLenth = 1, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "UpdateDate", Caption = "更新日時", MaxLenth = 10, InputChar = EInputChar.Num | EInputChar.Slash, InputStyle = EInputStyle.Date });
+ Add(new ValidField() { Name = "UpdateLoginID", Caption = "更新担当者", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "UpdatePcName", Caption = "更新端末", MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "UpdateID", Caption = "更新ID", MaxLenth = 7, InputChar = EInputChar.Num });
+ }
+}
+
diff --git a/HotelPms.Client.Blazor/ViewModel/Option.cs b/HotelPms.Client.Blazor/ViewModel/Option.cs
new file mode 100644
index 0000000..59c5319
--- /dev/null
+++ b/HotelPms.Client.Blazor/ViewModel/Option.cs
@@ -0,0 +1,29 @@
+using HotelPms.Share.Util;
+using Microsoft.JSInterop;
+using System.ComponentModel.DataAnnotations;
+using static HotelPms.Client.Blazor.Util.SystemEnum;
+
+namespace HotelPms.Client.Blazor.ViewModel
+{
+ /// <summary>
+ /// 画面表示・編集用
+ /// </summary>
+ public class Option : ValidModel
+ {
+ /// <summary>
+ /// 初期化
+ /// </summary>
+ public Option(IJSRuntime js) : base(js)
+ {
+
+ Add(new ValidField() { Name = "ID", Caption = "ID", Required = true, InputChar = EInputChar.Num, MaxLenth = 7, GridOrder = 1 });
+ Add(new ValidField() { Name = "ShortName", Caption = "略称", Required = true, MaxLenth = 10, InputChar = EInputChar.Half, GridFilter = true });
+ Add(new ValidField() { Name = "Name", Caption = "名称", Required = true, MaxLenth = 50, InputChar = EInputChar.None, GridFilter = true });
+ Add(new ValidField() { Name = "Tel", Caption = "電話番号", Required = true, MaxLenth = 50, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "Fax", Caption = "FAX", Required = true, MaxLenth = 50, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "ZipCode", Caption = "郵便番号", Required = true, MaxLenth = 10, ShowStyle = EShowStyle.ShowList, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "Address1", Caption = "住所①", Required = false, MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "Address2", Caption = "住所②", Required = false, MaxLenth = 50, InputChar = EInputChar.None });
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/ViewModel/Output.cs b/HotelPms.Client.Blazor/ViewModel/Output.cs
new file mode 100644
index 0000000..0646d1f
--- /dev/null
+++ b/HotelPms.Client.Blazor/ViewModel/Output.cs
@@ -0,0 +1,29 @@
+using HotelPms.Share.Util;
+using Microsoft.JSInterop;
+using System.ComponentModel.DataAnnotations;
+using static HotelPms.Client.Blazor.Util.SystemEnum;
+
+namespace HotelPms.Client.Blazor.ViewModel
+{
+ /// <summary>
+ /// 画面表示・編集用
+ /// </summary>
+ public class Output : ValidModel
+ {
+ /// <summary>
+ /// 初期化
+ /// </summary>
+ public Output(IJSRuntime js) : base(js)
+ {
+
+ Add(new ValidField() { Name = "ID", Caption = "ID", Required = true, InputChar = EInputChar.Num, MaxLenth = 7, GridOrder = 1 });
+ Add(new ValidField() { Name = "ShortName", Caption = "略称", Required = true, MaxLenth = 10, InputChar = EInputChar.Half, GridFilter = true });
+ Add(new ValidField() { Name = "Name", Caption = "名称", Required = true, MaxLenth = 50, InputChar = EInputChar.None, GridFilter = true });
+ Add(new ValidField() { Name = "Tel", Caption = "電話番号", Required = true, MaxLenth = 50, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "Fax", Caption = "FAX", Required = true, MaxLenth = 50, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "ZipCode", Caption = "郵便番号", Required = true, MaxLenth = 10, ShowStyle = EShowStyle.ShowList, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "Address1", Caption = "住所①", Required = false, MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "Address2", Caption = "住所②", Required = false, MaxLenth = 50, InputChar = EInputChar.None });
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/ViewModel/OutputItem.cs b/HotelPms.Client.Blazor/ViewModel/OutputItem.cs
new file mode 100644
index 0000000..1d40f9d
--- /dev/null
+++ b/HotelPms.Client.Blazor/ViewModel/OutputItem.cs
@@ -0,0 +1,29 @@
+using HotelPms.Share.Util;
+using Microsoft.JSInterop;
+using System.ComponentModel.DataAnnotations;
+using static HotelPms.Client.Blazor.Util.SystemEnum;
+
+namespace HotelPms.Client.Blazor.ViewModel
+{
+ /// <summary>
+ /// 画面表示・編集用
+ /// </summary>
+ public class OutputItem : ValidModel
+ {
+ /// <summary>
+ /// 初期化
+ /// </summary>
+ public OutputItem(IJSRuntime js) : base(js)
+ {
+
+ Add(new ValidField() { Name = "ID", Caption = "ID", Required = true, InputChar = EInputChar.Num, MaxLenth = 7, GridOrder = 1 });
+ Add(new ValidField() { Name = "ShortName", Caption = "略称", Required = true, MaxLenth = 10, InputChar = EInputChar.Half, GridFilter = true });
+ Add(new ValidField() { Name = "Name", Caption = "名称", Required = true, MaxLenth = 50, InputChar = EInputChar.None, GridFilter = true });
+ Add(new ValidField() { Name = "Tel", Caption = "電話番号", Required = true, MaxLenth = 50, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "Fax", Caption = "FAX", Required = true, MaxLenth = 50, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "ZipCode", Caption = "郵便番号", Required = true, MaxLenth = 10, ShowStyle = EShowStyle.ShowList, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "Address1", Caption = "住所①", Required = false, MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "Address2", Caption = "住所②", Required = false, MaxLenth = 50, InputChar = EInputChar.None });
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/ViewModel/Pay.cs b/HotelPms.Client.Blazor/ViewModel/Pay.cs
new file mode 100644
index 0000000..187b3da
--- /dev/null
+++ b/HotelPms.Client.Blazor/ViewModel/Pay.cs
@@ -0,0 +1,29 @@
+using HotelPms.Share.Util;
+using Microsoft.JSInterop;
+using System.ComponentModel.DataAnnotations;
+using static HotelPms.Client.Blazor.Util.SystemEnum;
+
+namespace HotelPms.Client.Blazor.ViewModel
+{
+ /// <summary>
+ /// 画面表示・編集用
+ /// </summary>
+ public class Pay : ValidModel
+ {
+ /// <summary>
+ /// 初期化
+ /// </summary>
+ public Pay(IJSRuntime js) : base(js)
+ {
+
+ Add(new ValidField() { Name = "ID", Caption = "ID", Required = true, InputChar = EInputChar.Num, MaxLenth = 7, GridOrder = 1 });
+ Add(new ValidField() { Name = "ShortName", Caption = "略称", Required = true, MaxLenth = 10, InputChar = EInputChar.Half, GridFilter = true });
+ Add(new ValidField() { Name = "Name", Caption = "名称", Required = true, MaxLenth = 50, InputChar = EInputChar.None, GridFilter = true });
+ Add(new ValidField() { Name = "Tel", Caption = "電話番号", Required = true, MaxLenth = 50, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "Fax", Caption = "FAX", Required = true, MaxLenth = 50, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "ZipCode", Caption = "郵便番号", Required = true, MaxLenth = 10, ShowStyle = EShowStyle.ShowList, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "Address1", Caption = "住所①", Required = false, MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "Address2", Caption = "住所②", Required = false, MaxLenth = 50, InputChar = EInputChar.None });
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/ViewModel/PayDiv.cs b/HotelPms.Client.Blazor/ViewModel/PayDiv.cs
new file mode 100644
index 0000000..15e7e64
--- /dev/null
+++ b/HotelPms.Client.Blazor/ViewModel/PayDiv.cs
@@ -0,0 +1,29 @@
+using HotelPms.Share.Util;
+using Microsoft.JSInterop;
+using System.ComponentModel.DataAnnotations;
+using static HotelPms.Client.Blazor.Util.SystemEnum;
+
+namespace HotelPms.Client.Blazor.ViewModel
+{
+ /// <summary>
+ /// 画面表示・編集用
+ /// </summary>
+ public class PayDiv : ValidModel
+ {
+ /// <summary>
+ /// 初期化
+ /// </summary>
+ public PayDiv(IJSRuntime js) : base(js)
+ {
+
+ Add(new ValidField() { Name = "ID", Caption = "ID", Required = true, InputChar = EInputChar.Num, MaxLenth = 7, GridOrder = 1 });
+ Add(new ValidField() { Name = "ShortName", Caption = "略称", Required = true, MaxLenth = 10, InputChar = EInputChar.Half, GridFilter = true });
+ Add(new ValidField() { Name = "Name", Caption = "名称", Required = true, MaxLenth = 50, InputChar = EInputChar.None, GridFilter = true });
+ Add(new ValidField() { Name = "Tel", Caption = "電話番号", Required = true, MaxLenth = 50, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "Fax", Caption = "FAX", Required = true, MaxLenth = 50, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "ZipCode", Caption = "郵便番号", Required = true, MaxLenth = 10, ShowStyle = EShowStyle.ShowList, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "Address1", Caption = "住所①", Required = false, MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "Address2", Caption = "住所②", Required = false, MaxLenth = 50, InputChar = EInputChar.None });
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/ViewModel/Receipt.cs b/HotelPms.Client.Blazor/ViewModel/Receipt.cs
new file mode 100644
index 0000000..e48bbc4
--- /dev/null
+++ b/HotelPms.Client.Blazor/ViewModel/Receipt.cs
@@ -0,0 +1,29 @@
+using HotelPms.Share.Util;
+using Microsoft.JSInterop;
+using System.ComponentModel.DataAnnotations;
+using static HotelPms.Client.Blazor.Util.SystemEnum;
+
+namespace HotelPms.Client.Blazor.ViewModel
+{
+ /// <summary>
+ /// 画面表示・編集用
+ /// </summary>
+ public class Receipt : ValidModel
+ {
+ /// <summary>
+ /// 初期化
+ /// </summary>
+ public Receipt(IJSRuntime js) : base(js)
+ {
+
+ Add(new ValidField() { Name = "ID", Caption = "ID", Required = true, InputChar = EInputChar.Num, MaxLenth = 7, GridOrder = 1 });
+ Add(new ValidField() { Name = "ShortName", Caption = "略称", Required = true, MaxLenth = 10, InputChar = EInputChar.Half, GridFilter = true });
+ Add(new ValidField() { Name = "Name", Caption = "名称", Required = true, MaxLenth = 50, InputChar = EInputChar.None, GridFilter = true });
+ Add(new ValidField() { Name = "Tel", Caption = "電話番号", Required = true, MaxLenth = 50, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "Fax", Caption = "FAX", Required = true, MaxLenth = 50, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "ZipCode", Caption = "郵便番号", Required = true, MaxLenth = 10, ShowStyle = EShowStyle.ShowList, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "Address1", Caption = "住所①", Required = false, MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "Address2", Caption = "住所②", Required = false, MaxLenth = 50, InputChar = EInputChar.None });
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/ViewModel/Rental.cs b/HotelPms.Client.Blazor/ViewModel/Rental.cs
new file mode 100644
index 0000000..36f7941
--- /dev/null
+++ b/HotelPms.Client.Blazor/ViewModel/Rental.cs
@@ -0,0 +1,29 @@
+using HotelPms.Share.Util;
+using Microsoft.JSInterop;
+using System.ComponentModel.DataAnnotations;
+using static HotelPms.Client.Blazor.Util.SystemEnum;
+
+namespace HotelPms.Client.Blazor.ViewModel
+{
+ /// <summary>
+ /// 画面表示・編集用
+ /// </summary>
+ public class Rental : ValidModel
+ {
+ /// <summary>
+ /// 初期化
+ /// </summary>
+ public Rental(IJSRuntime js) : base(js)
+ {
+
+ Add(new ValidField() { Name = "ID", Caption = "ID", Required = true, InputChar = EInputChar.Num, MaxLenth = 7, GridOrder = 1 });
+ Add(new ValidField() { Name = "ShortName", Caption = "略称", Required = true, MaxLenth = 10, InputChar = EInputChar.Half, GridFilter = true });
+ Add(new ValidField() { Name = "Name", Caption = "名称", Required = true, MaxLenth = 50, InputChar = EInputChar.None, GridFilter = true });
+ Add(new ValidField() { Name = "Tel", Caption = "電話番号", Required = true, MaxLenth = 50, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "Fax", Caption = "FAX", Required = true, MaxLenth = 50, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "ZipCode", Caption = "郵便番号", Required = true, MaxLenth = 10, ShowStyle = EShowStyle.ShowList, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "Address1", Caption = "住所①", Required = false, MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "Address2", Caption = "住所②", Required = false, MaxLenth = 50, InputChar = EInputChar.None });
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/ViewModel/RoomCell.cs b/HotelPms.Client.Blazor/ViewModel/RoomCell.cs
new file mode 100644
index 0000000..0478aae
--- /dev/null
+++ b/HotelPms.Client.Blazor/ViewModel/RoomCell.cs
@@ -0,0 +1,29 @@
+using HotelPms.Share.Util;
+using Microsoft.JSInterop;
+using System.ComponentModel.DataAnnotations;
+using static HotelPms.Client.Blazor.Util.SystemEnum;
+
+namespace HotelPms.Client.Blazor.ViewModel
+{
+ /// <summary>
+ /// 画面表示・編集用
+ /// </summary>
+ public class RoomCell : ValidModel
+ {
+ /// <summary>
+ /// 初期化
+ /// </summary>
+ public RoomCell(IJSRuntime js) : base(js)
+ {
+
+ Add(new ValidField() { Name = "ID", Caption = "ID", Required = true, InputChar = EInputChar.Num, MaxLenth = 7, GridOrder = 1 });
+ Add(new ValidField() { Name = "ShortName", Caption = "略称", Required = true, MaxLenth = 10, InputChar = EInputChar.Half, GridFilter = true });
+ Add(new ValidField() { Name = "Name", Caption = "名称", Required = true, MaxLenth = 50, InputChar = EInputChar.None, GridFilter = true });
+ Add(new ValidField() { Name = "Tel", Caption = "電話番号", Required = true, MaxLenth = 50, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "Fax", Caption = "FAX", Required = true, MaxLenth = 50, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "ZipCode", Caption = "郵便番号", Required = true, MaxLenth = 10, ShowStyle = EShowStyle.ShowList, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "Address1", Caption = "住所①", Required = false, MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "Address2", Caption = "住所②", Required = false, MaxLenth = 50, InputChar = EInputChar.None });
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/ViewModel/RoomStatus.cs b/HotelPms.Client.Blazor/ViewModel/RoomStatus.cs
new file mode 100644
index 0000000..ad2017f
--- /dev/null
+++ b/HotelPms.Client.Blazor/ViewModel/RoomStatus.cs
@@ -0,0 +1,28 @@
+using HotelPms.Share.Util;
+using Microsoft.JSInterop;
+using System.ComponentModel.DataAnnotations;
+using static HotelPms.Client.Blazor.Util.SystemEnum;
+
+namespace HotelPms.Client.Blazor.ViewModel;
+
+/// <summary>
+/// 画面表示・編集用
+/// </summary>
+public class RoomStatus : ValidModel
+{
+ /// <summary>
+ /// 初期化
+ /// </summary>
+ public RoomStatus(IJSRuntime js) : base(js)
+ {
+ Add(new ValidField() { Name = "ID", Caption = "ID", Required = true, InputChar = EInputChar.Num, MaxLenth = 7, GridOrder = 1 });
+ Add(new ValidField() { Name = "ShortName", Caption = "略称", Required = true, MaxLenth = 10, InputChar = EInputChar.Half, GridFilter = true });
+ Add(new ValidField() { Name = "Name", Caption = "名称", Required = true, MaxLenth = 50, InputChar = EInputChar.None, GridFilter = true });
+ Add(new ValidField() { Name = "EnName", Caption = "英語名称", Required = true, MaxLenth = 50, InputChar = EInputChar.None, GridFilter = true });
+ Add(new ValidField() { Name = "SortID", Caption = "表示順", Required = true, MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "ForeColor", Caption = "文字色", Required = true, MaxLenth = 20, InputChar = EInputChar.None, DispNameEnabled = true, ShowStyle = EShowStyle.ShowList, WidthUnit = 4, DispWidthUnit = 2 });
+ Add(new ValidField() { Name = "BackColor", Caption = "背景色", Required = true, MaxLenth = 20, InputChar = EInputChar.None, DispNameEnabled = true, ShowStyle = EShowStyle.ShowList, WidthUnit = 4, DispWidthUnit = 2 });
+ Add(new ValidField() { Name = "MaidType", Caption = "種類", Required = false, MaxLenth = 1, Range = "[0,3]", InputChar = EInputChar.Num, DispNameEnabled = true, ShowStyle = EShowStyle.ShowList, WidthUnit = 2, DispWidthUnit = 4 });
+ Add(new ValidField() { Name = "Memo", Caption = "メモ", Required = false, MaxLenth = 500, InputChar = EInputChar.None });
+ }
+}
diff --git a/HotelPms.Client.Blazor/ViewModel/RoomType.cs b/HotelPms.Client.Blazor/ViewModel/RoomType.cs
new file mode 100644
index 0000000..15c012c
--- /dev/null
+++ b/HotelPms.Client.Blazor/ViewModel/RoomType.cs
@@ -0,0 +1,38 @@
+using HotelPms.Share.Util;
+using Microsoft.JSInterop;
+using System.ComponentModel.DataAnnotations;
+using static HotelPms.Client.Blazor.Util.SystemEnum;
+
+namespace HotelPms.Client.Blazor.ViewModel;
+
+/// <summary>
+/// 画面表示・編集用
+/// </summary>
+public class RoomType : ValidModel
+{
+ /// <summary>
+ /// 初期化
+ /// </summary>
+ public RoomType(IJSRuntime js) : base(js)
+ {
+
+ Add(new ValidField() { Name = "ID", Caption = "ID", MaxLenth = 2, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "Name", Caption = "名称", MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "ShortName", Caption = "略称", MaxLenth = 10, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "Kind", Caption = "種類", MaxLenth = 2, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "SortID", Caption = "表示順", MaxLenth = 2, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "Visible", Caption = "表示・非表示", MaxLenth = 1, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "TypeListVisible", Caption = "表示・非表示", MaxLenth = 1, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "TypeListAlertCount", Caption = "残室数の警告数", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "TypeListAlertColor", Caption = "残室数の警告文字色", MaxLenth = 20, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "WebType", Caption = "Webサイト側の部屋タイプ", MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "SendRate", Caption = "送信率", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "SendLimit", Caption = "自社残る残室数", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "Memo", Caption = "部屋タイプメモ", MaxLenth = 500, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "UpdateDate", Caption = "更新日時", MaxLenth = 10, InputChar = EInputChar.Num | EInputChar.Slash, InputStyle = EInputStyle.Date });
+ Add(new ValidField() { Name = "UpdateLoginID", Caption = "更新担当者", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "UpdatePcName", Caption = "更新端末", MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "UpdateID", Caption = "更新ID", MaxLenth = 7, InputChar = EInputChar.Num });
+ }
+}
+
diff --git a/HotelPms.Client.Blazor/ViewModel/RoomViewLayout.cs b/HotelPms.Client.Blazor/ViewModel/RoomViewLayout.cs
new file mode 100644
index 0000000..fef246f
--- /dev/null
+++ b/HotelPms.Client.Blazor/ViewModel/RoomViewLayout.cs
@@ -0,0 +1,29 @@
+using HotelPms.Share.Util;
+using Microsoft.JSInterop;
+using System.ComponentModel.DataAnnotations;
+using static HotelPms.Client.Blazor.Util.SystemEnum;
+
+namespace HotelPms.Client.Blazor.ViewModel
+{
+ /// <summary>
+ /// 画面表示・編集用
+ /// </summary>
+ public class RoomViewLayout : ValidModel
+ {
+ /// <summary>
+ /// 初期化
+ /// </summary>
+ public RoomViewLayout(IJSRuntime js) : base(js)
+ {
+
+ Add(new ValidField() { Name = "ID", Caption = "ID", Required = true, InputChar = EInputChar.Num, MaxLenth = 7, GridOrder = 1 });
+ Add(new ValidField() { Name = "ShortName", Caption = "略称", Required = true, MaxLenth = 10, InputChar = EInputChar.Half, GridFilter = true });
+ Add(new ValidField() { Name = "Name", Caption = "名称", Required = true, MaxLenth = 50, InputChar = EInputChar.None, GridFilter = true });
+ Add(new ValidField() { Name = "Tel", Caption = "電話番号", Required = true, MaxLenth = 50, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "Fax", Caption = "FAX", Required = true, MaxLenth = 50, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "ZipCode", Caption = "郵便番号", Required = true, MaxLenth = 10, ShowStyle = EShowStyle.ShowList, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "Address1", Caption = "住所①", Required = false, MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "Address2", Caption = "住所②", Required = false, MaxLenth = 50, InputChar = EInputChar.None });
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/ViewModel/RoomViewTab.cs b/HotelPms.Client.Blazor/ViewModel/RoomViewTab.cs
new file mode 100644
index 0000000..18f675f
--- /dev/null
+++ b/HotelPms.Client.Blazor/ViewModel/RoomViewTab.cs
@@ -0,0 +1,29 @@
+using HotelPms.Share.Util;
+using Microsoft.JSInterop;
+using System.ComponentModel.DataAnnotations;
+using static HotelPms.Client.Blazor.Util.SystemEnum;
+
+namespace HotelPms.Client.Blazor.ViewModel
+{
+ /// <summary>
+ /// 画面表示・編集用
+ /// </summary>
+ public class RoomViewTab : ValidModel
+ {
+ /// <summary>
+ /// 初期化
+ /// </summary>
+ public RoomViewTab(IJSRuntime js) : base(js)
+ {
+
+ Add(new ValidField() { Name = "ID", Caption = "ID", Required = true, InputChar = EInputChar.Num, MaxLenth = 7, GridOrder = 1 });
+ Add(new ValidField() { Name = "ShortName", Caption = "略称", Required = true, MaxLenth = 10, InputChar = EInputChar.Half, GridFilter = true });
+ Add(new ValidField() { Name = "Name", Caption = "名称", Required = true, MaxLenth = 50, InputChar = EInputChar.None, GridFilter = true });
+ Add(new ValidField() { Name = "Tel", Caption = "電話番号", Required = true, MaxLenth = 50, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "Fax", Caption = "FAX", Required = true, MaxLenth = 50, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "ZipCode", Caption = "郵便番号", Required = true, MaxLenth = 10, ShowStyle = EShowStyle.ShowList, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "Address1", Caption = "住所①", Required = false, MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "Address2", Caption = "住所②", Required = false, MaxLenth = 50, InputChar = EInputChar.None });
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/ViewModel/Sale.cs b/HotelPms.Client.Blazor/ViewModel/Sale.cs
new file mode 100644
index 0000000..fbc303c
--- /dev/null
+++ b/HotelPms.Client.Blazor/ViewModel/Sale.cs
@@ -0,0 +1,63 @@
+using HotelPms.Share.Util;
+using Microsoft.JSInterop;
+using System.ComponentModel.DataAnnotations;
+using static HotelPms.Client.Blazor.Util.SystemEnum;
+
+namespace HotelPms.Client.Blazor.ViewModel;
+
+/// <summary>
+/// 画面表示・編集用
+/// </summary>
+public class Sale : ValidModel
+{
+ /// <summary>
+ /// 初期化
+ /// </summary>
+ public Sale(IJSRuntime js) : base(js)
+ {
+
+ Add(new ValidField() { Name = "ID", Caption = "利用毎唯一な識別ID", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "DetailID", Caption = "連泊部屋連番", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "UseDate", Caption = "利用日", MaxLenth = 10, InputChar = EInputChar.Num | EInputChar.Slash, InputStyle = EInputStyle.Date });
+ Add(new ValidField() { Name = "SaleID", Caption = "売上連番", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "ReceiptID", Caption = "領収書ID", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "ItemID", Caption = "科目ID", MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "ItemName", Caption = "科目名称", MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "Price", Caption = "単価", MaxLenth = 9, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "Amount", Caption = "数量", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "Summary", Caption = "本体額", MaxLenth = 9, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "ServiceIOType", Caption = "サービス料区分", MaxLenth = 2, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "ServiceSummary", Caption = "サービス料", MaxLenth = 9, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "ServiceRate", Caption = "サービス率", MaxLenth = 5, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "TaxType", Caption = "消費税種類", MaxLenth = 2, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "TaxIOType", Caption = "消費税区分", MaxLenth = 2, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "TaxSummary", Caption = "消費税", MaxLenth = 9, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "TaxRate", Caption = "消費税率", MaxLenth = 5, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "BathTaxIOType", Caption = "入湯税区分", MaxLenth = 2, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "BathTaxType", Caption = "入湯税種類", MaxLenth = 2, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "BathTaxUnitPrice", Caption = "入湯税単価", MaxLenth = 9, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "BathTaxSummary", Caption = "入湯税", MaxLenth = 9, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "AccTaxIOType", Caption = "宿泊税区分", MaxLenth = 2, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "AccTaxSummary", Caption = "宿泊税", MaxLenth = 9, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "TotalSummary", Caption = "売上合計", MaxLenth = 9, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "DiscountRate", Caption = "割引き率", MaxLenth = 5, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "DiscountSummary", Caption = "割引き額", MaxLenth = 9, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "DiscountID", Caption = "割引理由", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "Pack", Caption = "パックかどうか", MaxLenth = 1, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "PackChild", Caption = "パックの内訳かどうか", MaxLenth = 1, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "PackSaleID", Caption = "パック親ID", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "PersonType", Caption = "人物種類", MaxLenth = 2, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "PersonCount", Caption = "人数", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "InFemale", Caption = "内女", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "UseType", Caption = "科目使用種類", MaxLenth = 2, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "BaseAmount", Caption = "基本数量", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "PersonRef", Caption = "人数連動があるかどうか", MaxLenth = 1, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "ReceiptItemName", Caption = "領収書印字名", MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "ReceiptPrtType", Caption = "領収書印字区分", MaxLenth = 2, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "ReceiptPage", Caption = "領収書印字頁", MaxLenth = 2, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "SrcType", Caption = "生成元", MaxLenth = 2, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "FixturesID", Caption = "備品ID", MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "ItemKind", Caption = "科目種別", MaxLenth = 2, InputChar = EInputChar.Num });
+ }
+}
+
diff --git a/HotelPms.Client.Blazor/ViewModel/SaleDiv.cs b/HotelPms.Client.Blazor/ViewModel/SaleDiv.cs
new file mode 100644
index 0000000..0f8cd43
--- /dev/null
+++ b/HotelPms.Client.Blazor/ViewModel/SaleDiv.cs
@@ -0,0 +1,29 @@
+using HotelPms.Share.Util;
+using Microsoft.JSInterop;
+using System.ComponentModel.DataAnnotations;
+using static HotelPms.Client.Blazor.Util.SystemEnum;
+
+namespace HotelPms.Client.Blazor.ViewModel
+{
+ /// <summary>
+ /// 画面表示・編集用
+ /// </summary>
+ public class SaleDiv : ValidModel
+ {
+ /// <summary>
+ /// 初期化
+ /// </summary>
+ public SaleDiv(IJSRuntime js) : base(js)
+ {
+
+ Add(new ValidField() { Name = "ID", Caption = "ID", Required = true, InputChar = EInputChar.Num, MaxLenth = 7, GridOrder = 1 });
+ Add(new ValidField() { Name = "ShortName", Caption = "略称", Required = true, MaxLenth = 10, InputChar = EInputChar.Half, GridFilter = true });
+ Add(new ValidField() { Name = "Name", Caption = "名称", Required = true, MaxLenth = 50, InputChar = EInputChar.None, GridFilter = true });
+ Add(new ValidField() { Name = "Tel", Caption = "電話番号", Required = true, MaxLenth = 50, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "Fax", Caption = "FAX", Required = true, MaxLenth = 50, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "ZipCode", Caption = "郵便番号", Required = true, MaxLenth = 10, ShowStyle = EShowStyle.ShowList, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "Address1", Caption = "住所①", Required = false, MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "Address2", Caption = "住所②", Required = false, MaxLenth = 50, InputChar = EInputChar.None });
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/ViewModel/Use.cs b/HotelPms.Client.Blazor/ViewModel/Use.cs
new file mode 100644
index 0000000..a154803
--- /dev/null
+++ b/HotelPms.Client.Blazor/ViewModel/Use.cs
@@ -0,0 +1,41 @@
+using Microsoft.JSInterop;
+using static HotelPms.Client.Blazor.Util.SystemEnum;
+
+namespace HotelPms.Client.Blazor.ViewModel;
+
+/// <summary>
+/// 画面表示・編集用
+/// </summary>
+public class Use : ValidModel
+{
+ /// <summary>
+ /// 初期化
+ /// </summary>
+ public Use(IJSRuntime js) : base(js)
+ {
+
+ Add(new ValidField() { Name = "ID", Caption = "利用毎唯一な識別ID", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "DetailID", Caption = "代表連泊部屋ID", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "ResvType", Caption = "予約区分", MaxLenth = 2, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "GroupType", Caption = "団体区分", MaxLenth = 2, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "GroupName", Caption = "団体名称", MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "GroupKana", Caption = "団体カナ", MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "ReceiptPrtWay", Caption = "領収書出力方式", MaxLenth = 2, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "PayWay", Caption = "支払い方式", MaxLenth = 2, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "CancelHotelDate", Caption = "キャンセル日", MaxLenth = 10, InputChar = EInputChar.Num | EInputChar.Slash, InputStyle = EInputStyle.Date });
+ Add(new ValidField() { Name = "CancelDate", Caption = "キャンセル日時", MaxLenth = 10, InputChar = EInputChar.Num | EInputChar.Slash, InputStyle = EInputStyle.Date });
+ Add(new ValidField() { Name = "CancelLoginID", Caption = "キャンセル担当者", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "CancelName", Caption = "キャンセル申込者", MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "CancelReason", Caption = "キャンセル理由", MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "CreateDate", Caption = "作成日時", MaxLenth = 10, InputChar = EInputChar.Num | EInputChar.Slash, InputStyle = EInputStyle.Date });
+ Add(new ValidField() { Name = "CreateLoginID", Caption = "作成担当者", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "CreatePcName", Caption = "作成端末", MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "CreateClass", Caption = "作成機能ID", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "UpdateDate", Caption = "更新日時", MaxLenth = 10, InputChar = EInputChar.Num | EInputChar.Slash, InputStyle = EInputStyle.Date });
+ Add(new ValidField() { Name = "UpdateLoginID", Caption = "更新担当者", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "UpdatePcName", Caption = "更新端末", MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "UpdateClass", Caption = "更新機能ID", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "UpdateID", Caption = "更新ID", MaxLenth = 7, InputChar = EInputChar.Num });
+ }
+}
+
diff --git a/HotelPms.Client.Blazor/ViewModel/UseAllo.cs b/HotelPms.Client.Blazor/ViewModel/UseAllo.cs
new file mode 100644
index 0000000..fe5e3b7
--- /dev/null
+++ b/HotelPms.Client.Blazor/ViewModel/UseAllo.cs
@@ -0,0 +1,29 @@
+using HotelPms.Share.Util;
+using Microsoft.JSInterop;
+using System.ComponentModel.DataAnnotations;
+using static HotelPms.Client.Blazor.Util.SystemEnum;
+
+namespace HotelPms.Client.Blazor.ViewModel
+{
+ /// <summary>
+ /// 画面表示・編集用
+ /// </summary>
+ public class UseAllo : ValidModel
+ {
+ /// <summary>
+ /// 初期化
+ /// </summary>
+ public UseAllo(IJSRuntime js) : base(js)
+ {
+
+ Add(new ValidField() { Name = "ID", Caption = "ID", Required = true, InputChar = EInputChar.Num, MaxLenth = 7, GridOrder = 1 });
+ Add(new ValidField() { Name = "ShortName", Caption = "略称", Required = true, MaxLenth = 10, InputChar = EInputChar.Half, GridFilter = true });
+ Add(new ValidField() { Name = "Name", Caption = "名称", Required = true, MaxLenth = 50, InputChar = EInputChar.None, GridFilter = true });
+ Add(new ValidField() { Name = "Tel", Caption = "電話番号", Required = true, MaxLenth = 50, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "Fax", Caption = "FAX", Required = true, MaxLenth = 50, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "ZipCode", Caption = "郵便番号", Required = true, MaxLenth = 10, ShowStyle = EShowStyle.ShowList, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "Address1", Caption = "住所①", Required = false, MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "Address2", Caption = "住所②", Required = false, MaxLenth = 50, InputChar = EInputChar.None });
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/ViewModel/UseDetail.cs b/HotelPms.Client.Blazor/ViewModel/UseDetail.cs
new file mode 100644
index 0000000..6c18291
--- /dev/null
+++ b/HotelPms.Client.Blazor/ViewModel/UseDetail.cs
@@ -0,0 +1,52 @@
+using Microsoft.JSInterop;
+using static HotelPms.Client.Blazor.Util.SystemEnum;
+
+namespace HotelPms.Client.Blazor.ViewModel;
+
+/// <summary>
+/// 画面表示・編集用
+/// </summary>
+public class UseDetail : ValidModel
+{
+ /// <summary>
+ /// 初期化
+ /// </summary>
+ public UseDetail(IJSRuntime js) : base(js)
+ {
+
+ Add(new ValidField() { Name = "ID", Caption = "利用毎唯一な識別ID", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "DetailID", Caption = "連泊部屋連番", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "UseStatus", Caption = "利用状態", MaxLenth = 2, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "SubStatus", Caption = "利用状態の小分類", MaxLenth = 2, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "ExtenStatus", Caption = "延長状態", MaxLenth = 2, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "CinDate", Caption = "チェックイン日", MaxLenth = 10, InputChar = EInputChar.Num | EInputChar.Slash, InputStyle = EInputStyle.Date });
+ Add(new ValidField() { Name = "CinTime", Caption = "チェックイン時間", MaxLenth = 2, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "Stay", Caption = "泊数", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "CoutDate", Caption = "チェックアウト日", MaxLenth = 10, InputChar = EInputChar.Num | EInputChar.Slash, InputStyle = EInputStyle.Date });
+ Add(new ValidField() { Name = "CoutTime", Caption = "チェックアウト時間", MaxLenth = 2, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "AgentID", Caption = "エージェントID", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "AgentBranchID", Caption = "支店ID", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "ResvNo", Caption = "予約番号", MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "ResvDate", Caption = "予約日時", MaxLenth = 10, InputChar = EInputChar.Num | EInputChar.Slash, InputStyle = EInputStyle.Date });
+ Add(new ValidField() { Name = "ResvHotelDate", Caption = "予約ホテル日", MaxLenth = 10, InputChar = EInputChar.Num | EInputChar.Slash, InputStyle = EInputStyle.Date });
+ Add(new ValidField() { Name = "ResvType", Caption = "予約区分", MaxLenth = 2, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "ResvPersonID", Caption = "予約者", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "SalesLoginID", Caption = "営業担当", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "PayType", Caption = "精算種類", MaxLenth = 2, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "PayItemID", Caption = "精算科目ID", MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "PayAgentID", Caption = "精算科目の業者ID", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "PayAgentBranchID", Caption = "精算科目の業者支店ID", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "LimitDate", Caption = "予約・見積期限", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "RoomAssign", Caption = "指定部屋", MaxLenth = 1, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "CreateDate", Caption = "作成日時", MaxLenth = 10, InputChar = EInputChar.Num | EInputChar.Slash, InputStyle = EInputStyle.Date });
+ Add(new ValidField() { Name = "CreateLoginID", Caption = "作成担当者", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "CreatePcName", Caption = "作成端末", MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "CreateClass", Caption = "作成機能ID", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "UpdateDate", Caption = "更新日時", MaxLenth = 10, InputChar = EInputChar.Num | EInputChar.Slash, InputStyle = EInputStyle.Date });
+ Add(new ValidField() { Name = "UpdateLoginID", Caption = "更新担当者", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "UpdatePcName", Caption = "更新端末", MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "UpdateClass", Caption = "更新機能ID", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "UpdateID", Caption = "更新ID", MaxLenth = 7, InputChar = EInputChar.Num });
+ }
+}
+
diff --git a/HotelPms.Client.Blazor/ViewModel/UseFree.cs b/HotelPms.Client.Blazor/ViewModel/UseFree.cs
new file mode 100644
index 0000000..a38e408
--- /dev/null
+++ b/HotelPms.Client.Blazor/ViewModel/UseFree.cs
@@ -0,0 +1,29 @@
+using HotelPms.Share.Util;
+using Microsoft.JSInterop;
+using System.ComponentModel.DataAnnotations;
+using static HotelPms.Client.Blazor.Util.SystemEnum;
+
+namespace HotelPms.Client.Blazor.ViewModel
+{
+ /// <summary>
+ /// 画面表示・編集用
+ /// </summary>
+ public class UseFree : ValidModel
+ {
+ /// <summary>
+ /// 初期化
+ /// </summary>
+ public UseFree(IJSRuntime js) : base(js)
+ {
+
+ Add(new ValidField() { Name = "ID", Caption = "ID", Required = true, InputChar = EInputChar.Num, MaxLenth = 7, GridOrder = 1 });
+ Add(new ValidField() { Name = "ShortName", Caption = "略称", Required = true, MaxLenth = 10, InputChar = EInputChar.Half, GridFilter = true });
+ Add(new ValidField() { Name = "Name", Caption = "名称", Required = true, MaxLenth = 50, InputChar = EInputChar.None, GridFilter = true });
+ Add(new ValidField() { Name = "Tel", Caption = "電話番号", Required = true, MaxLenth = 50, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "Fax", Caption = "FAX", Required = true, MaxLenth = 50, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "ZipCode", Caption = "郵便番号", Required = true, MaxLenth = 10, ShowStyle = EShowStyle.ShowList, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "Address1", Caption = "住所①", Required = false, MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "Address2", Caption = "住所②", Required = false, MaxLenth = 50, InputChar = EInputChar.None });
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/ViewModel/UseInput.cs b/HotelPms.Client.Blazor/ViewModel/UseInput.cs
new file mode 100644
index 0000000..b192020
--- /dev/null
+++ b/HotelPms.Client.Blazor/ViewModel/UseInput.cs
@@ -0,0 +1,755 @@
+using customTypes;
+using HotelPms.Client.Blazor.Models;
+using HotelPms.Client.Blazor.Pages.UseDetail;
+using HotelPms.Client.Blazor.Shared;
+using HotelPms.Client.Blazor.Util;
+using HotelPms.Data.Common;
+using HotelPms.Data.UseInfo;
+using HotelPms.DataAccessGrpc.Client;
+using HotelPms.Share.IO;
+using HotelPms.Share.Util;
+using Microsoft.JSInterop;
+using System.ComponentModel;
+using System.Text;
+using System.Text.Json;
+using static HotelPms.Client.Blazor.Util.SystemEnum;
+
+namespace HotelPms.Client.Blazor.ViewModel;
+
+/// <summary>
+/// 利用情報詳細入力画面用
+/// </summary>
+public class UseInput : ValidModelEx
+{
+ public enum GroupKey : int
+ {
+ [Description("予約情報")]
+ Resv = 0,
+ [Description("個人情報")]
+ Person,
+ [Description("会社情報")]
+ Company,
+ [Description("その他")]
+ Other,
+ [Description("予約追加情報")]
+ ResvAdd,
+ [Description("個人追加情報")]
+ PersonAdd,
+ [Description("会社追加情報")]
+ CompanyAdd,
+ [Description("顧客追加情報")]
+ CustomerAdd,
+ }
+
+ /// <summary>
+ /// 利用情報
+ /// </summary>
+ public Data.UseInfo.Use Use { get; set; }
+
+ /// <summary>
+ /// 現在選択されている利用明細
+ /// </summary>
+ public Data.UseInfo.UseDetail UseDetail { get; set; }
+
+ /// <summary>
+ /// 現在の伝票表示区分
+ /// </summary>
+ public ESaleDispType SaleDispType { get; set; } = ESaleDispType.Normal;
+
+ /// <summary>
+ /// 現在選択されている利用日
+ /// yyyy/MM/dd
+ /// </summary>
+ public string UseDate { get; set; } = string.Empty;
+
+ /// <summary>
+ /// 現在選択されている利用日の泊数
+ /// </summary>
+ public int CurrentStay { get; set; } = 1;
+
+ /// <summary>
+ /// 部屋タイプ情報入力
+ /// </summary>
+ public IEnumerable<RoomTypeInputRow> RoomTypeList { get; set; } = new List<RoomTypeInputRow>();
+
+ private UseRoomRow m_SelUseRoomRow = null;
+
+ /// <summary>
+ /// 選択されている利用部屋
+ /// </summary>
+ public UseRoomRow SelUseRoomRow
+ {
+ get { return m_SelUseRoomRow; }
+ set
+ {
+ m_SelUseRoomRow = value;
+ EnvironmentSetting.Debug($"Change:{m_SelUseRoomRow.RoomID}");
+ }
+ }
+
+ /// <summary>
+ /// 利用部屋一覧
+ /// </summary>
+ public IEnumerable<UseRoomRow> UseRoomList { get; set; } = new List<UseRoomRow>();
+
+ /// <summary>
+ /// 伝票一覧
+ /// </summary>
+ public IEnumerable<SaleInputRow> SaleList { get; set; } = new List<SaleInputRow>();
+
+ /// <summary>
+ /// 入金一覧
+ /// </summary>
+ public IEnumerable<string> PayList { get; set; } = new List<string>();
+
+ /// <summary>
+ /// グループ毎返す
+ /// </summary>
+ /// <param name="key"></param>
+ /// <returns></returns>
+ public List<ValidField> GetGroup(GroupKey key)
+ {
+ List<ValidField> list = new List<ValidField>();
+ if (key == GroupKey.Resv) { for (int i = 0; i <= 11; i++) { list.Add(Fields[i]); } }
+ else if (key == GroupKey.Person) { for (int i = 12; i <= 19; i++) { list.Add(Fields[i]); } }
+ else if (key == GroupKey.Company) { for (int i = 20; i <= 25; i++) { list.Add(Fields[i]); } }
+ else if (key == GroupKey.Other) { for (int i = 26; i <= 32; i++) { list.Add(Fields[i]); } }
+ return list;
+ }
+
+ /// <summary>
+ /// 初期化
+ /// </summary>
+ public UseInput(IJSRuntime js) : base(js)
+ {
+ // 0 ~ 10
+ Add(new ValidField() { Name = "ResvNo", Caption = "予約番号", MaxLenth = 50, WidthUnit = 12 });
+ Add(new ValidField() { Name = "ResvType", Caption = "予約区分", Required = true, MaxLenth = 2, InputChar = EInputChar.Num, DispNameEnabled = true, ShowStyle = EShowStyle.ShowList, DispWidthUnit = 6 });
+ Add(new ValidField() { Name = "GroupType", Caption = "団体区分", Required = true, MaxLenth = 2, InputChar = EInputChar.Num, ShowStyle = EShowStyle.ShowList, DispNameEnabled = true, DispWidthUnit = 6 });
+ Add(new ValidField() { Name = "RoomID", Caption = "部屋No", MaxLenth = 7, InputChar = EInputChar.Num, WidthUnit = 5 });
+ Add(new ValidField() { Name = "SalesLoginID", Caption = "営業", MaxLenth = 7, InputChar = EInputChar.Num, ShowStyle = EShowStyle.ShowList, WidthUnit = 7, DispNameEnabled = true, DispWidthUnit = 8 });
+ Add(new ValidField() { Name = "CinDate", Caption = "チェックイン日", MaxLenth = 10, InputChar = EInputChar.Num | EInputChar.Slash, InputStyle = EInputStyle.Date });
+ Add(new ValidField() { Name = "CinTime", Caption = "到着時間", MaxLenth = 5, InputChar = EInputChar.Num | EInputChar.Colon, InputStyle = EInputStyle.Time });
+ Add(new ValidField() { Name = "Stay", Caption = "泊数", MaxLenth = 3, InputChar = EInputChar.Num, WidthUnit = 6, NewLine = true });
+ Add(new ValidField() { Name = "CoutDate", Caption = "チェックアウト日", MaxLenth = 10, InputChar = EInputChar.Num | EInputChar.Slash, InputStyle = EInputStyle.Date });
+ Add(new ValidField() { Name = "CoutTime", Caption = "出発時間", MaxLenth = 5, InputChar = EInputChar.Num | EInputChar.Colon, InputStyle = EInputStyle.Time });
+ Add(new ValidField() { Name = "GroupName", Caption = "団体名称", MaxLenth = 50 });
+ Add(new ValidField() { Name = "GroupKana", Caption = "団体カナ", MaxLenth = 50 });
+
+ // 11 ~ 18
+ Add(new ValidField() { Name = "MemberNo", Caption = "会員番号", MaxLenth = 50, WidthUnit = 12 });
+ Add(new ValidField() { Name = "Tel", Caption = "電話番号", MaxLenth = 50, InputChar = EInputChar.Num | EInputChar.Subtract, WidthUnit = 8 });
+ Add(new ValidField() { Name = "TelKind", Caption = "区分", Required = true, MaxLenth = 50, ShowStyle = EShowStyle.ShowList, ReadOnly = true, WidthUnit = 4 });
+ Add(new ValidField() { Name = "Name", Required = true, Caption = "氏名", MaxLenth = 50, WidthUnit = 12 });
+ Add(new ValidField() { Name = "Kana", Required = true, Caption = "カナ", MaxLenth = 50, WidthUnit = 12 });
+ Add(new ValidField() { Name = "ResvName", Caption = "予約者名", MaxLenth = 50, WidthUnit = 12 });
+ Add(new ValidField() { Name = "ResvKana", Caption = "カナ", MaxLenth = 50, WidthUnit = 12 });
+ Add(new ValidField() { Name = "ResvTel", Caption = "電話番号", InputChar = EInputChar.Num | EInputChar.Subtract, MaxLenth = 50, WidthUnit = 12 });
+
+ // 19 ~ 24
+ Add(new ValidField() { Name = "CorpID", Caption = "法人顧客", MaxLenth = 7, InputChar = EInputChar.Num, ShowStyle = EShowStyle.ShowList, WidthUnit = 12 });
+ Add(new ValidField() { Name = "CorpName", Caption = "会社名", MaxLenth = 50, WidthUnit = 12 });
+ Add(new ValidField() { Name = "CorpKana", Caption = "カナ", MaxLenth = 50, WidthUnit = 12 });
+ Add(new ValidField() { Name = "CorpTel", Caption = "会社電話", MaxLenth = 50, WidthUnit = 12 });
+ Add(new ValidField() { Name = "CorpFax", Caption = "会社FAX", MaxLenth = 50, WidthUnit = 12 });
+ Add(new ValidField() { Name = "ReceiptName", Caption = "宛名", MaxLenth = 50, InputChar = EInputChar.None, WidthUnit = 12 });
+
+ // 25 ~ 31
+ Add(new ValidField() { Name = "AreaID", Caption = "地域", MaxLenth = 7, InputChar = EInputChar.Num, ShowStyle = EShowStyle.ShowList, DispWidthUnit = 8, DispNameEnabled = true, WidthUnit = 12 });
+ Add(new ValidField() { Name = "CharacterType", Caption = "人物フラグ", MaxLenth = 7, InputChar = EInputChar.Num, ShowStyle = EShowStyle.ShowList, DispWidthUnit = 8, DispNameEnabled = true, WidthUnit = 12 });
+ Add(new ValidField() { Name = "CustomerRig", Caption = "顧客登録", MaxLenth = 1, InputChar = EInputChar.Num, ShowStyle = EShowStyle.ShowList, DispWidthUnit = 8, DispNameEnabled = true, WidthUnit = 12 });
+ Add(new ValidField() { Name = "AgentID", Caption = "エージェント", MaxLenth = 7, InputChar = EInputChar.Num, ShowStyle = EShowStyle.ShowList, DispWidthUnit = 8, DispNameEnabled = true, WidthUnit = 12 });
+ Add(new ValidField() { Name = "AgentBranchID", Caption = "支店", MaxLenth = 7, InputChar = EInputChar.Num, ShowStyle = EShowStyle.ShowList, DispWidthUnit = 8, DispNameEnabled = true, WidthUnit = 12 });
+ Add(new ValidField() { Name = "PlanID", Caption = "プラン", MaxLenth = 7, InputChar = EInputChar.Num, ShowStyle = EShowStyle.ShowList, DispWidthUnit = 8, DispNameEnabled = true, WidthUnit = 12 });
+ Add(new ValidField() { Name = "RoomAssign", Caption = "部屋指定", MaxLenth = 1, InputChar = EInputChar.Num, ShowStyle = EShowStyle.ShowList, DispWidthUnit = 8, DispNameEnabled = true, WidthUnit = 12 });
+
+ // 予約追加情報(自由集計)
+
+ // 個人追加情報
+ Add(new ValidField() { Name = "ZipCode", Caption = "郵便番号", MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "Prefecture", Caption = "都道府県", MaxLenth = 20, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "Address2", Caption = "市区町村", MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "Address3", Caption = "町域", MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "Address4", Caption = "番地", MaxLenth = 100, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "Mail", Caption = "メール", MaxLenth = 100, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "PassportNo", Caption = "パスポート", MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "Sex", Caption = "性別", MaxLenth = 2, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "BirthDay", Caption = "誕生日", MaxLenth = 10, InputChar = EInputChar.Num | EInputChar.Slash, InputStyle = EInputStyle.Date });
+ Add(new ValidField() { Name = "Anniversary", Caption = "記念日", MaxLenth = 10, InputChar = EInputChar.Num | EInputChar.Slash, InputStyle = EInputStyle.Date });
+
+ // 会社追加情報
+ //Add(new ValidField() { Name = "ResvTel", Caption = "所属", MaxLenth = 50 });
+ //Add(new ValidField() { Name = "ResvTel", Caption = "役職", MaxLenth = 50 });
+ Add(new ValidField() { Name = "CorpZipCode", Caption = "法人郵便番号", MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "CorpPrefecture", Caption = "都道府県", MaxLenth = 20, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "CorpAddress2", Caption = "市区町村", MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "CorpAddress3", Caption = "町域", MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "CorpAddress4", Caption = "番地", MaxLenth = 100, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "CorpMemo", Caption = "法人備考", MaxLenth = 500, InputChar = EInputChar.None });
+
+ // 顧客追加情報 (顧客自由集計 GroupID使用)
+
+
+ //追加電話番号はGridリストへ
+
+ // 複数想定(リスト)
+ Add(new ValidField() { Name = "Memo", Caption = "メモ", MaxLenth = 1000 });
+ Add(new ValidField() { Name = "Remark", Caption = "備考", MaxLenth = 1000 });
+ }
+
+ /// <summary>
+ /// 画面初期化
+ /// </summary>
+ public void InitGrid()
+ {
+ InitRoomTypeInput();
+ }
+
+ public async void InitRoomTypeInput()
+ {
+ List<RoomTypeInputRow> list = RoomTypeList as List<RoomTypeInputRow>;
+ List<UseRoomRow> roomList = UseRoomList as List<UseRoomRow>;
+
+ SortedDictionary<int, RoomTypeInputRow> typeDt = new SortedDictionary<int, RoomTypeInputRow>(); //まとめる
+ //UseRoomより取得する
+ List<Data.UseInfo.UseRoom> useRoomList = Use.GetUseRoomList(UseDate);
+ foreach (var item in useRoomList)
+ {
+ RoomTypeInputRow row;
+ if (!typeDt.TryGetValue(item.RoomTypeID, out row))
+ {
+ row = new();
+ row.SetCellText((int)RoomTypeInputRow.ColType.ID, item.RoomTypeID.ToString());
+ row.SetCellText((int)RoomTypeInputRow.ColType.Name, await MasterCore.GetRoomTypeName(item.RoomTypeID));
+ row.SetCellText((int)RoomTypeInputRow.ColType.Count, "0");
+ typeDt.Add(item.RoomTypeID, row);
+ }
+ row.SetCellText((int)RoomTypeInputRow.ColType.Count, CConvert.ToString(CConvert.ToInt(row.GetCellText((int)RoomTypeInputRow.ColType.Count)) + 1));
+ row.DataList.Add(item);
+
+ //部屋一覧
+ UseRoomRow roomRow = new UseRoomRow
+ {
+ RoomID = item.RoomID.ToString(),
+ Name = item.UseAlloList.Count == 0 ? string.Empty : item.UseAlloList[0].Person?.Name,
+ Representative = true,
+ UseStatus = (item.Parent as Data.UseInfo.UseDetail).UseStatus.ToString(),
+ };
+ roomRow.UseRoom = item;
+ roomList.Add(roomRow);
+ }
+
+ //常に空行追加
+ list.Add(new());
+
+ //部屋一覧初期選択データ
+ if (roomList.Count > 0)
+ {
+ if (roomList.Count > 1)
+ {
+ UseRoomRow roomRow = new UseRoomRow
+ {
+ RoomID = "",
+ Name = "(一括)",
+ Representative = false,
+ UseStatus = "",
+ };
+ roomRow.UseRoom = roomList[0].UseRoom;
+ roomList.Insert(0, roomRow);
+ }
+
+ SelUseRoomRow = roomList[0];
+ }
+ }
+
+ /// <summary>
+ /// 入力項目→Data
+ /// </summary>
+ /// <param name="field"></param>
+ public void SetDataField(ValidField field)
+ {
+ #region 利用情報
+
+ if (field.Name == "ResvType")
+ {
+ Use.ResvType = CConvert.ToInt(field.Text);
+ }
+ else if (field.Name == "GroupType")
+ {
+ Use.GroupType = CConvert.ToInt(field.Text);
+ }
+ else if (field.Name == "GroupName")
+ {
+ Use.GroupName = field.Text;
+ }
+ else if (field.Name == "GroupKana")
+ {
+ Use.GroupKana = field.Text;
+ }
+
+ #endregion
+
+ #region 利用明細情報
+
+ if (UseDetail != null)
+ {
+ if (field.Name == "ResvNo")
+ {
+ UseDetail.ResvNo = field.Text;
+ }
+ else if (field.Name == "SalesLoginID")
+ {
+ UseDetail.SalesLoginID = CConvert.ToInt(field.Text);
+ }
+ else if (field.Name == "CinDate")
+ {
+ UseDetail.CinDate = new customTypes.Date(field.Text);
+ }
+ else if (field.Name == "CinTime")
+ {
+ UseDetail.CinTime = CConvert.ToInt(field.Text.Replace(":", string.Empty));
+ }
+ else if (field.Name == "Stay")
+ {
+ UseDetail.Stay = CConvert.ToInt(field.Text);
+ }
+ else if (field.Name == "CoutDate")
+ {
+ UseDetail.CoutDate = new customTypes.Date(field.Text);
+ }
+ else if (field.Name == "CoutTime")
+ {
+ UseDetail.CoutTime = CConvert.ToInt(field.Text.Replace(":", string.Empty));
+ }
+ }
+
+ #endregion
+
+ if (field.Name == "MemberNo")
+ {
+ //Use.MemberNo = field.Text;
+ }
+ else if (field.Name == "Tel")
+ {
+ //Use.Tel = field.Text;
+ }
+ else if (field.Name == "TelKind")
+ {
+ //Use.TelKind = field.Text;
+ }
+ else if (field.Name == "Name")
+ {
+ //Use.Name = field.Text;
+ }
+ else if (field.Name == "Kana")
+ {
+ //Use.Kana = field.Text;
+ }
+ else if (field.Name == "ResvName")
+ {
+ //Use.ResvName = field.Text;
+ }
+ else if (field.Name == "ResvKana")
+ {
+ //Use.ResvKana = field.Text;
+ }
+ else if (field.Name == "ResvTel")
+ {
+ //Use.ResvTel = field.Text;
+ }
+ else if (field.Name == "CorpID")
+ {
+ //Use.CorpID = CConvert.ToInt(field.Text);
+ }
+ else if (field.Name == "CorpName")
+ {
+ //Use.CorpName = field.Text;
+ }
+ else if (field.Name == "CorpKana")
+ {
+ //Use.CorpKana = field.Text;
+ }
+ else if (field.Name == "CorpTel")
+ {
+ //Use.CorpTel = field.Text;
+ }
+ else if (field.Name == "CorpFax")
+ {
+ //Use.CorpFax = field.Text;
+ }
+ else if (field.Name == "ReceiptName")
+ {
+ //Use.ReceiptName = field.Text;
+ }
+ else if (field.Name == "AreaID")
+ {
+ //Use.AreaID = CConvert.ToInt(field.Text);
+ }
+ else if (field.Name == "CharacterType")
+ {
+ //Use.CharacterType = CConvert.ToInt(field.Text);
+ }
+ else if (field.Name == "CustomerRig")
+ {
+ //Use.CustomerRig = CConvert.ToInt(field.Text);
+ }
+ else if (field.Name == "AgentID")
+ {
+ //Use.AgentID = CConvert.ToInt(field.Text);
+ }
+ else if (field.Name == "AgentBranchID")
+ {
+ //Use.AgentBranchID = CConvert.ToInt(field.Text);
+ }
+ else if (field.Name == "PlanID")
+ {
+ //Use.PlanID = CConvert.ToInt(field.Text);
+ }
+ else if (field.Name == "RoomAssign")
+ {
+ //Use.RoomAssign = CConvert.ToInt(field.Text);
+ }
+ else if (field.Name == "ZipCode")
+ {
+ //Use.ZipCode = field.Text;
+ }
+ else if (field.Name == "Prefecture")
+ {
+ //Use.Prefecture = field.Text;
+ }
+ else if (field.Name == "Address2")
+ {
+ //Use.Address2 = field.Text;
+ }
+ else if (field.Name == "Address3")
+ {
+ //Use.Address3 = field.Text;
+ }
+ else if (field.Name == "Address4")
+ {
+ //Use.Address4 = field.Text;
+ }
+ else if (field.Name == "Mail")
+ {
+ //Use.Mail = field.Text;
+ }
+ else if (field.Name == "PassportNo")
+ {
+ //Use.PassportNo = field.Text;
+ }
+ else if (field.Name == "Sex")
+ {
+ //Use.Sex = CConvert.ToInt(field.Text);
+ }
+ else if (field.Name == "BirthDay")
+ {
+ //Use.BirthDay = field.Text;
+ }
+ else if (field.Name == "Anniversary")
+ {
+ //Use.Anniversary = field.Text;
+ }
+ else if (field.Name == "CorpZipCode")
+ {
+ //Use.CorpZipCode = field.Text;
+ }
+ else if (field.Name == "CorpPrefecture")
+ {
+ //Use.CorpPrefecture = field.Text;
+ }
+ else if (field.Name == "CorpAddress2")
+ {
+ //Use.CorpAddress2 = field.Text;
+ }
+ else if (field.Name == "CorpAddress3")
+ {
+ //Use.CorpAddress3 = field.Text;
+ }
+ else if (field.Name == "CorpAddress4")
+ {
+ //Use.CorpAddress4 = field.Text;
+ }
+ else if (field.Name == "CorpMemo")
+ {
+ //Use.CorpMemo = field.Text;
+ }
+ else if (field.Name == "Memo")
+ {
+ //Use.Memo = field.Text;
+ }
+ else if (field.Name == "Remark")
+ {
+ //Use.Remark = field.Text;
+ }
+ }
+
+ /// <summary>
+ /// 現在表示されている利用明細を画面へ表示する
+ /// </summary>
+ public void SetUseDetailToForm()
+ {
+ //利用情報
+ SetField("ResvType", Use.ResvType.ToString(), CConvert.GetEnumDescription<EResvType>(Use.ResvType));
+ SetField("GroupType", Use.GroupType.ToString(), CConvert.GetEnumDescription<EGroupType>(Use.GroupType));
+ SetField("GroupName", Use.GroupName);
+ SetField("GroupKana", Use.GroupKana);
+
+ //利用明細
+ SetField("ResvNo", UseDetail.ResvNo.ToString());
+ SetField("SalesLoginID", UseDetail.SalesLoginID.ToString(), string.Empty);
+ SetField("CinDate", UseDetail.CinDate.ToText());
+ SetField("CinTime", CConvert.ToTime(UseDetail.CinTime));
+ SetField("Stay", UseDetail.Stay.ToString());
+ SetField("CoutDate", UseDetail.CoutDate.ToText());
+ SetField("CoutTime", CConvert.ToTime(UseDetail.CoutTime));
+
+ if (UseDetail.UseRoomList.Count > 0)
+ {
+ HotelPms.Data.UseInfo.UseRoom useRoom = UseDetail.UseRoomList[0];
+ SetField("RoomID", useRoom.RoomID.ToString());
+
+ //利用者特定
+ if (useRoom.UseAlloList.Count > 0 && useRoom.UseAlloList[0].Person != null)
+ {
+ HotelPms.Data.UseInfo.UsePerson usePerson = useRoom.UseAlloList[0].Person;
+ SetField("MemberNo", usePerson.MemberNo);
+ SetField("Name", usePerson.Name);
+ SetField("Kana", usePerson.Kana);
+ SetField("ReceiptName", usePerson.ReceiptName);
+ SetField("CorpID", usePerson.CorpID.ToString());
+ SetField("CorpName", usePerson.CorpName);
+ SetField("CorpKana", usePerson.CorpKana);
+
+ string tel = string.Empty;
+ int telKind = 0;
+ string corpTel = string.Empty;
+ string corpFax = string.Empty;
+ if (usePerson.TelList.Count > 0)
+ {
+ foreach (HotelPms.Data.UseInfo.UsePersonTel personTel in usePerson.TelList)
+ {
+ if ((personTel.Kind == (int)ETelKind.Tel || personTel.Kind == (int)ETelKind.Mobile) && tel.Length == 0)
+ {
+ tel = personTel.Tel;
+ telKind = personTel.Kind;
+ }
+ else if (personTel.Kind == (int)ETelKind.CorpTel && corpTel.Length == 0)
+ {
+ corpTel = personTel.Tel;
+ }
+ else if (personTel.Kind == (int)ETelKind.CorpFax && corpFax.Length == 0)
+ {
+ corpFax = personTel.Tel;
+ }
+ }
+ }
+
+ SetField("Tel", tel);
+ if (tel.Length == 0)
+ {
+ SetField("TelKind", string.Empty, string.Empty);
+ }
+ else
+ {
+ SetField("TelKind", telKind.ToString(), ((ETelKind)telKind).ToDescription());
+ }
+ SetField("CorpTel", corpTel);
+ SetField("CorpFax", corpFax);
+ }
+ }
+
+ //予約者情報
+ if (UseDetail.ResvPerson != null)
+ {
+ SetField("ResvName", UseDetail.ResvPerson.Name.ToString());
+ SetField("ResvKana", UseDetail.ResvPerson.Kana.ToString());
+ if (UseDetail.ResvPerson.TelList.Count > 0)
+ {
+ SetField("ResvTel", UseDetail.ResvPerson.TelList[0].Tel.ToString());
+ }
+ else
+ {
+ SetField("ResvTel", string.Empty);
+ }
+ }
+ }
+
+ /// <summary>
+ /// 自動ソースコード生成
+ /// </summary>
+ /// <returns></returns>
+ public string GetAutoCode()
+ {
+ StringBuilder text = new StringBuilder();
+ foreach (ViewModel.ValidField item in Fields)
+ {
+ if (item.Index > 0) { text.Append("else "); }
+ text.AppendLine($"if (sender.Name == \"{item.Name}\")");
+ text.AppendLine("{");
+ if (item.InputChar == EInputChar.Num)
+ {
+ text.AppendLine($" //Use.{item.Name} = CConvert.ToInt(sender.Text);");
+ }
+ else
+ {
+ text.AppendLine($" //Use.{item.Name} = sender.Text;");
+ }
+ text.AppendLine("}");
+ }
+ return text.ToString();
+ }
+
+ /// <summary>
+ /// 利用情報新規作成
+ /// </summary>
+ /// <returns></returns>
+ public async Task<bool> CreateDefault(Date cinDate, int stay)
+ {
+ try
+ {
+ Use = new()
+ {
+ ID = await EnvironmentSetting.GetSeq(ESeqType.Use),
+ ResvType = (int)EResvType.Reserve,
+ GroupType = (int)EGroupType.Person,
+ ReceiptPrtWay = 0,
+ PayWay = 1,
+ //CreateDate = CConvert.ToTimestamp(DateTime.Now.Date),
+ //CreateLoginID = 1,
+ //CreatePcName = Environment.MachineName,
+ //CreateClass = 1,
+ //UpdateDate = CConvert.ToTimestamp(DateTime.Now),
+ //UpdateLoginID = 789,
+ //UpdatePcName = Environment.MachineName,
+ //UpdateClass = 2
+ };
+
+ #region 代表利用明細
+
+ Data.UseInfo.UseDetail useDetail = new()
+ {
+ ID = Use.ID,
+ DetailID = await EnvironmentSetting.GetSeq(ESeqType.UseDetail),
+ UseStatus = (int)EUseStatus.Resv,
+ SubStatus = 0,
+ ExtenStatus = 0,
+ CinDate = cinDate,
+ CinTime = 1500,
+ Stay = stay,
+ CoutDate = cinDate.Add(stay),
+ CoutTime = 1000,
+ ResvType = Use.ResvType,
+ //CreateDate = Use.CreateDate,
+ //CreateLoginID = Use.CreateLoginID,
+ //CreatePcName = Use.CreatePcName,
+ //CreateClass = Use.CreateClass,
+ //UpdateDate = Use.UpdateDate,
+ //UpdateLoginID = Use.UpdateLoginID,
+ //UpdatePcName = Use.UpdatePcName,
+ //UpdateClass = Use.UpdateClass
+ };
+ Use.DetailList.Add(useDetail);
+ UseDetail = useDetail; //現在選択されている利用明細
+
+ #endregion
+
+ return true;
+ }
+ catch (Exception ex)
+ {
+ OperationLog.Instance.WriteLog($"CreateDefault:{ex.Message}");
+ return false;
+ }
+ }
+
+ public void RemoveUseRoom(List<Data.UseInfo.UseRoom> list, int count)
+ {
+ try
+ {
+ //Parentが必要!!
+ int i = 0;
+ List<Data.UseInfo.UseRoom> delList = new List<Data.UseInfo.UseRoom>();
+ foreach(var item in list)
+ {
+ delList.Add(item);
+ i++;
+ if (i == count) { break; }
+ }
+
+ foreach(var item in delList)
+ {
+ (item.Parent as Data.UseInfo.UseDetail).UseRoomList.Remove(item);
+ list.Remove(item);
+ }
+ }
+ catch (Exception ex)
+ {
+ OperationLog.Instance.WriteLog($"RemoveUseRoom:{ex.Message}");
+ }
+ }
+
+ /// <summary>
+ /// 部屋を作成する
+ /// </summary>
+ /// <param name="typeID"></param>
+ /// <param name="kind"></param>
+ /// <returns></returns>
+ public async Task<Data.UseInfo.UseRoom> CreateUseRoom(int typeID, int kind)
+ {
+ try
+ {
+ Data.UseInfo.UseDetail detail = Use.GetDetailWithoutUseRoom(UseDate);
+ if (detail == null)
+ {
+ detail = new()
+ {
+ ID = Use.ID,
+ DetailID = await EnvironmentSetting.GetSeq(ESeqType.UseDetail),
+ UseStatus = (int)EUseStatus.Resv,
+ SubStatus = 0,
+ ExtenStatus = 0,
+ CinDate = new(UseDate),
+ CinTime = 1500,
+ Stay = 1,
+ CoutDate = new customTypes.Date(UseDate).Add(1),
+ CoutTime = 1000,
+ ResvType = Use.ResvType,
+ };
+ Use.DetailList.Add(detail);
+ }
+ else
+ {
+ detail.SetUseRange(UseDate); // 利用期間以外だったら、伸びる
+ }
+
+ //UseRoom作成
+ Data.UseInfo.UseRoom useRoom = new()
+ {
+ ID = Use.ID,
+ DetailID = detail.DetailID,
+ UseDate = new(UseDate),
+ RoomTypeID = typeID,
+ RoomKind = kind,
+ };
+ detail.UseRoomList.Add(useRoom);
+ useRoom.Parent = detail;
+
+ //基本伝票(部屋料金)作成
+ HotelPms.Data.Master.Item item = await MasterCore.GetBaseItem(useRoom.RoomTypeID, 0, UseDate);
+ int saleID = await EnvironmentSetting.GetSeq(ESeqType.Sale);
+ int taxRate = await EnvironmentSetting.GetTaxRate(useRoom.UseDate.ToText(), item.TaxType);
+ var saleItem = useRoom.AddSaleByItem(saleID, taxRate, item);
+
+ //料金の画面表示
+ SaleInputRow saleRow = new();
+ await saleRow.Add(saleItem);
+ (SaleList as List<SaleInputRow>).Add(saleRow);
+ return useRoom;
+ }
+ catch (Exception ex)
+ {
+ OperationLog.Instance.WriteLog($"CreateUseRoom:{ex.Message}");
+ return null;
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/ViewModel/UseMemo.cs b/HotelPms.Client.Blazor/ViewModel/UseMemo.cs
new file mode 100644
index 0000000..b98f97f
--- /dev/null
+++ b/HotelPms.Client.Blazor/ViewModel/UseMemo.cs
@@ -0,0 +1,29 @@
+using HotelPms.Share.Util;
+using Microsoft.JSInterop;
+using System.ComponentModel.DataAnnotations;
+using static HotelPms.Client.Blazor.Util.SystemEnum;
+
+namespace HotelPms.Client.Blazor.ViewModel
+{
+ /// <summary>
+ /// 画面表示・編集用
+ /// </summary>
+ public class UseMemo : ValidModel
+ {
+ /// <summary>
+ /// 初期化
+ /// </summary>
+ public UseMemo(IJSRuntime js) : base(js)
+ {
+
+ Add(new ValidField() { Name = "ID", Caption = "ID", Required = true, InputChar = EInputChar.Num, MaxLenth = 7, GridOrder = 1 });
+ Add(new ValidField() { Name = "ShortName", Caption = "略称", Required = true, MaxLenth = 10, InputChar = EInputChar.Half, GridFilter = true });
+ Add(new ValidField() { Name = "Name", Caption = "名称", Required = true, MaxLenth = 50, InputChar = EInputChar.None, GridFilter = true });
+ Add(new ValidField() { Name = "Tel", Caption = "電話番号", Required = true, MaxLenth = 50, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "Fax", Caption = "FAX", Required = true, MaxLenth = 50, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "ZipCode", Caption = "郵便番号", Required = true, MaxLenth = 10, ShowStyle = EShowStyle.ShowList, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "Address1", Caption = "住所①", Required = false, MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "Address2", Caption = "住所②", Required = false, MaxLenth = 50, InputChar = EInputChar.None });
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/ViewModel/UsePerson.cs b/HotelPms.Client.Blazor/ViewModel/UsePerson.cs
new file mode 100644
index 0000000..362e7b2
--- /dev/null
+++ b/HotelPms.Client.Blazor/ViewModel/UsePerson.cs
@@ -0,0 +1,50 @@
+using Microsoft.JSInterop;
+using static HotelPms.Client.Blazor.Util.SystemEnum;
+
+namespace HotelPms.Client.Blazor.ViewModel;
+
+/// <summary>
+/// 画面表示・編集用
+/// </summary>
+public class UsePerson : ValidModel
+{
+ /// <summary>
+ /// 初期化
+ /// </summary>
+ public UsePerson(IJSRuntime js) : base(js)
+ {
+
+ Add(new ValidField() { Name = "ID", Caption = "利用毎唯一な識別ID", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "PersonID", Caption = "利用者ID", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "CustomerID", Caption = "顧客ID", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "MemberNo", Caption = "会員番号", MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "Kana", Caption = "カナ", MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "Name", Caption = "氏名", MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "ReceiptName", Caption = "宛名", MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "ZipCode", Caption = "郵便番号", MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "Prefecture", Caption = "都道府県", MaxLenth = 20, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "Address2", Caption = "都市", MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "Address3", Caption = "市町村", MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "Address4", Caption = "番地など", MaxLenth = 100, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "Mail", Caption = "メール", MaxLenth = 100, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "PassportNo", Caption = "パスポート", MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "Sex", Caption = "性別", MaxLenth = 2, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "BirthDay", Caption = "誕生日", MaxLenth = 10, InputChar = EInputChar.Num | EInputChar.Slash, InputStyle = EInputStyle.Date });
+ Add(new ValidField() { Name = "Anniversary", Caption = "記念日", MaxLenth = 10, InputChar = EInputChar.Num | EInputChar.Slash, InputStyle = EInputStyle.Date });
+
+ Add(new ValidField() { Name = "RankID", Caption = "タンクID", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "CorpID", Caption = "法人ID", MaxLenth = 7, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "CorpKana", Caption = "法人カナ", MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "CorpName", Caption = "法人名称", MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "CorpZipCode", Caption = "法人郵便番号", MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "CorpPrefecture", Caption = "都道府県", MaxLenth = 20, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "CorpAddress2", Caption = "都市", MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "CorpAddress3", Caption = "市町村", MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "CorpAddress4", Caption = "番地など", MaxLenth = 100, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "CorpMail", Caption = "法人メール", MaxLenth = 100, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "HonorificTitleID", Caption = "敬称ID", MaxLenth = 2, InputChar = EInputChar.Num });
+ Add(new ValidField() { Name = "Memo", Caption = "備考", MaxLenth = 500, InputChar = EInputChar.None });
+
+ }
+}
+
diff --git a/HotelPms.Client.Blazor/ViewModel/UsePersonFree.cs b/HotelPms.Client.Blazor/ViewModel/UsePersonFree.cs
new file mode 100644
index 0000000..ac7779e
--- /dev/null
+++ b/HotelPms.Client.Blazor/ViewModel/UsePersonFree.cs
@@ -0,0 +1,29 @@
+using HotelPms.Share.Util;
+using Microsoft.JSInterop;
+using System.ComponentModel.DataAnnotations;
+using static HotelPms.Client.Blazor.Util.SystemEnum;
+
+namespace HotelPms.Client.Blazor.ViewModel
+{
+ /// <summary>
+ /// 画面表示・編集用
+ /// </summary>
+ public class UsePersonFree : ValidModel
+ {
+ /// <summary>
+ /// 初期化
+ /// </summary>
+ public UsePersonFree(IJSRuntime js) : base(js)
+ {
+
+ Add(new ValidField() { Name = "ID", Caption = "ID", Required = true, InputChar = EInputChar.Num, MaxLenth = 7, GridOrder = 1 });
+ Add(new ValidField() { Name = "ShortName", Caption = "略称", Required = true, MaxLenth = 10, InputChar = EInputChar.Half, GridFilter = true });
+ Add(new ValidField() { Name = "Name", Caption = "名称", Required = true, MaxLenth = 50, InputChar = EInputChar.None, GridFilter = true });
+ Add(new ValidField() { Name = "Tel", Caption = "電話番号", Required = true, MaxLenth = 50, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "Fax", Caption = "FAX", Required = true, MaxLenth = 50, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "ZipCode", Caption = "郵便番号", Required = true, MaxLenth = 10, ShowStyle = EShowStyle.ShowList, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "Address1", Caption = "住所①", Required = false, MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "Address2", Caption = "住所②", Required = false, MaxLenth = 50, InputChar = EInputChar.None });
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/ViewModel/UsePersonTel.cs b/HotelPms.Client.Blazor/ViewModel/UsePersonTel.cs
new file mode 100644
index 0000000..5bd8a1a
--- /dev/null
+++ b/HotelPms.Client.Blazor/ViewModel/UsePersonTel.cs
@@ -0,0 +1,29 @@
+using HotelPms.Share.Util;
+using Microsoft.JSInterop;
+using System.ComponentModel.DataAnnotations;
+using static HotelPms.Client.Blazor.Util.SystemEnum;
+
+namespace HotelPms.Client.Blazor.ViewModel
+{
+ /// <summary>
+ /// 画面表示・編集用
+ /// </summary>
+ public class UsePersonTel : ValidModel
+ {
+ /// <summary>
+ /// 初期化
+ /// </summary>
+ public UsePersonTel(IJSRuntime js) : base(js)
+ {
+
+ Add(new ValidField() { Name = "ID", Caption = "ID", Required = true, InputChar = EInputChar.Num, MaxLenth = 7, GridOrder = 1 });
+ Add(new ValidField() { Name = "ShortName", Caption = "略称", Required = true, MaxLenth = 10, InputChar = EInputChar.Half, GridFilter = true });
+ Add(new ValidField() { Name = "Name", Caption = "名称", Required = true, MaxLenth = 50, InputChar = EInputChar.None, GridFilter = true });
+ Add(new ValidField() { Name = "Tel", Caption = "電話番号", Required = true, MaxLenth = 50, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "Fax", Caption = "FAX", Required = true, MaxLenth = 50, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "ZipCode", Caption = "郵便番号", Required = true, MaxLenth = 10, ShowStyle = EShowStyle.ShowList, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "Address1", Caption = "住所①", Required = false, MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "Address2", Caption = "住所②", Required = false, MaxLenth = 50, InputChar = EInputChar.None });
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/ViewModel/UseRoom.cs b/HotelPms.Client.Blazor/ViewModel/UseRoom.cs
new file mode 100644
index 0000000..b50f983
--- /dev/null
+++ b/HotelPms.Client.Blazor/ViewModel/UseRoom.cs
@@ -0,0 +1,29 @@
+using HotelPms.Share.Util;
+using Microsoft.JSInterop;
+using System.ComponentModel.DataAnnotations;
+using static HotelPms.Client.Blazor.Util.SystemEnum;
+
+namespace HotelPms.Client.Blazor.ViewModel
+{
+ /// <summary>
+ /// 画面表示・編集用
+ /// </summary>
+ public class UseRoom : ValidModel
+ {
+ /// <summary>
+ /// 初期化
+ /// </summary>
+ public UseRoom(IJSRuntime js) : base(js)
+ {
+
+ Add(new ValidField() { Name = "ID", Caption = "ID", Required = true, InputChar = EInputChar.Num, MaxLenth = 7, GridOrder = 1 });
+ Add(new ValidField() { Name = "ShortName", Caption = "略称", Required = true, MaxLenth = 10, InputChar = EInputChar.Half, GridFilter = true });
+ Add(new ValidField() { Name = "Name", Caption = "名称", Required = true, MaxLenth = 50, InputChar = EInputChar.None, GridFilter = true });
+ Add(new ValidField() { Name = "Tel", Caption = "電話番号", Required = true, MaxLenth = 50, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "Fax", Caption = "FAX", Required = true, MaxLenth = 50, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "ZipCode", Caption = "郵便番号", Required = true, MaxLenth = 10, ShowStyle = EShowStyle.ShowList, InputChar = EInputChar.Num | EInputChar.Subtract });
+ Add(new ValidField() { Name = "Address1", Caption = "住所①", Required = false, MaxLenth = 50, InputChar = EInputChar.None });
+ Add(new ValidField() { Name = "Address2", Caption = "住所②", Required = false, MaxLenth = 50, InputChar = EInputChar.None });
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/ViewModel/ValidEventArgs.cs b/HotelPms.Client.Blazor/ViewModel/ValidEventArgs.cs
new file mode 100644
index 0000000..c189411
--- /dev/null
+++ b/HotelPms.Client.Blazor/ViewModel/ValidEventArgs.cs
@@ -0,0 +1,23 @@
+namespace HotelPms.Client.Blazor.ViewModel
+{
+ public class ValidEventArgs : EventArgs
+ {
+ public bool Cancel { get; set; } = false;
+
+ /// <summary>
+ /// Enterキーを押したかどうか
+ /// </summary>
+ public bool EnterPush { get; set; } = false;
+
+ /// <summary>
+ /// 全体チェックかどうか
+ /// </summary>
+ public bool IsAll { get; set; } = false;
+
+ public bool ResetOrgValue { get; set; } = false;
+
+ public string Text { get; set; }
+
+ public object Tag { get; set; }
+ }
+}
diff --git a/HotelPms.Client.Blazor/ViewModel/ValidField.cs b/HotelPms.Client.Blazor/ViewModel/ValidField.cs
new file mode 100644
index 0000000..d86df12
--- /dev/null
+++ b/HotelPms.Client.Blazor/ViewModel/ValidField.cs
@@ -0,0 +1,139 @@
+using MudBlazor;
+using static HotelPms.Client.Blazor.Util.SystemEnum;
+
+namespace HotelPms.Client.Blazor.ViewModel
+{
+ public class ValidField
+ {
+ public int Index { get; set; } = -1;
+
+ public MudTextField<string> Ref { get; set; }
+
+ /// <summary>
+ /// コード・名称の制御有効かどうか
+ /// </summary>
+ public bool DispNameEnabled { get; set; } = false;
+
+ /// <summary>
+ /// 表示名称
+ /// </summary>
+ public string DispText { get; set; } = String.Empty;
+
+ /// <summary>
+ /// 表示名称の幅
+ /// </summary>
+ public int DispWidthUnit { get; set; } = 6;
+
+ /// <summary>
+ /// コード・名称の制御の
+ /// 名称表示コントロール
+ /// </summary>
+ public MudField RefDispName { get; set; }
+
+
+ /// <summary>
+ /// 名称(キーとして使用)
+ /// DBの列名と一致すること
+ /// </summary>
+ public string Name { get; set; } = string.Empty;
+
+ public string Caption { get; set; } = string.Empty;
+
+ //private string m_Text = string.Empty;
+
+ /// <summary>
+ /// @bind-Value用項目
+ /// </summary>
+ public string Text { get; set; } = string.Empty;
+
+ /// <summary>
+ /// フォーカス入る時点の値の退避
+ /// </summary>
+ public string OrgText { get; set; } = string.Empty;
+
+ /// <summary>
+ /// DB中の値
+ /// </summary>
+ public object Value { get; set; }
+
+ /// <summary>
+ /// 必要な時使う
+ /// </summary>
+ public object Tag { get; set; }
+
+ public bool Error { get; set; }
+
+ /// <summary>
+ /// 使用不可
+ /// </summary>
+ public bool Disabled { get; set; }
+
+ /// <summary>
+ /// 一覧検索時のフィルター対象かどうか
+ /// </summary>
+ public bool GridFilter { get; set; }
+
+ /// <summary>
+ /// 一覧表示時の順番
+ /// </summary>
+ public int GridOrder { get; set; }
+
+ /// <summary>
+ /// 入力エラーメッセージ
+ /// </summary>
+ public string ErrorText { get; set; } = string.Empty;
+
+ /// <summary>
+ /// 入力必須かどうか
+ /// </summary>
+ public bool Required { get; set; }
+
+ public EInputChar InputChar { get; set; } = EInputChar.None;
+
+
+ public EShowStyle ShowStyle { get; set; } = EShowStyle.None;
+
+ public string ThousandFormat { get; set; } = "N0";
+
+ public EInputStyle InputStyle { get; set; } = EInputStyle.Normal;
+
+ public int MaxLenth { get; set; } = 50;
+
+ /// <summary>
+ /// 入力範囲
+ /// "'A','E','F'" OR "'1','2','21'" OR "[1,10]" OR "(1,10)" OR "[1,10)" OR "(1,10]"
+ /// ※空白の時しない
+ /// </summary>
+ public string Range { get; set; } = string.Empty;
+
+ /// <summary>
+ /// textareaかどうか
+ /// </summary>
+ public bool MultiLine { get; set; }
+
+ /// <summary>
+ /// xsモードで一行最大12単位
+ /// </summary>
+ public int WidthUnit { get; set; } = 6;
+
+ /// <summary>
+ /// 配置した後に改行するかしないか
+ /// </summary>
+ public bool NewLine { get; set; } = false;
+
+ public bool ReadOnly { get; set; } = false;
+
+ /// <summary>
+ /// 値をクリアする
+ /// </summary>
+ public void Clear()
+ {
+ Disabled = false;
+ Text = string.Empty;
+ Value = null;
+ OrgText = string.Empty;
+ Error = false;
+ ErrorText = string.Empty;
+ }
+ }
+}
diff --git a/HotelPms.Client.Blazor/ViewModel/ValidModel.cs b/HotelPms.Client.Blazor/ViewModel/ValidModel.cs
new file mode 100644
index 0000000..f8ac3c7
--- /dev/null
+++ b/HotelPms.Client.Blazor/ViewModel/ValidModel.cs
@@ -0,0 +1,915 @@
+using HotelPms.Client.Blazor.Pages.UseDetail;
+using HotelPms.Client.Blazor.Util;
+using HotelPms.Share.IO;
+using HotelPms.Share.Util;
+using Microsoft.AspNetCore.Components.Web;
+using Microsoft.JSInterop;
+using System.Collections.Concurrent;
+using System.Reflection.Metadata;
+using System.Text;
+
+namespace HotelPms.Client.Blazor.ViewModel
+{
+ /// <summary>
+ /// ViewModelとして使って、
+ /// Windows Fromスタイルの入力チェック方式
+ /// </summary>
+ public abstract class ValidModel : IDisposable
+ {
+ #region ★★★★★ Declartions ★★★★★
+
+ public delegate void ValidEventHandler(ValidField sender, ValidEventArgs e);
+ public delegate Task<bool> ValidResultEventHandler(ValidField sender, ValidEventArgs e);
+
+ public event ValidResultEventHandler BeforeAutoNextFocus;
+ public event ValidEventHandler AfterAutoNextFocus;
+ public event ValidEventHandler AfterEnter;
+ public event ValidEventHandler AfterLeave;
+ public event ValidResultEventHandler ValueChanged;
+ public event ValidEventHandler ShowList;
+ public event ValidResultEventHandler BusinessValid;
+
+ public static string Chr_Num = "0123456789";
+ public static string Chr_Alpha_S = "abcdefghijklmnopqrstuvwxyz ";
+ public static string Chr_Alpha_C = "ABCDEFGHIJKLMNOPQRSTUVWXYZ ";
+ public static string Chr_Kana = "ヲァィゥェォャュョッーアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワン゙゚ ";
+ public static string Chr_Alpha = Chr_Alpha_S + Chr_Alpha_C;
+ public static string Chr_NumAlpha = Chr_Num + Chr_Alpha;
+ public static string Chr_ANK = Chr_NumAlpha + Chr_Kana;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+
+ public IJSRuntime JSRuntime { get; set; }
+
+ public List<ValidField> Fields { get; set; } = new List<ValidField>();
+ private Dictionary<string, ValidField> dict = new Dictionary<string, ValidField>();
+
+ /// <summary>
+ /// UIを更新するため、親画面よりCallBackを受ける
+ /// </summary>
+ public Action Refresh { get; set; }
+
+ /// <summary>
+ /// Enterキーを押したかどうか
+ /// </summary>
+ public bool EnterPush { get; set; }
+
+ /// <summary>
+ /// Upキー押したかどうか
+ /// </summary>
+ public bool ArrowUpPush { get; set; }
+
+ public bool KeyDownPreventDefault { get; set; }
+ public bool KeyPressPreventDefault { get; set; }
+
+ /// <summary>
+ /// 0.新規 1.編集 2.削除
+ /// </summary>
+ public int EditMode { get; set; }
+
+ /// <summary>
+ /// 全体のエラー
+ /// </summary>
+ public string ErrText { get; set; }
+
+ /// <summary>
+ /// 一覧表示の検索キー対象項目一覧
+ /// </summary>
+ public List<string> FilterFields { get; set; } = new List<string>();
+
+ /// <summary>
+ /// 一覧表示の順番対象項目一覧
+ /// </summary>
+ public SortedList<int, string> OrderFields { get; set; } = new SortedList<int, string>();
+
+ /// <summary>
+ /// Guid
+ /// </summary>
+ public string ID { get; set; } = string.Empty;
+
+ /*
+ ■ロック追加前
+ Leave⇒Start
+ Leave⇒Row:1 Col:0 enterPush:False, orgText:, text:1
+ 【10:07:06 046】SendAsync begin:10:07:06 046
+ 【10:07:06 047】SendAsync Url⇒/HotelPms.Data.GrpcTableCore/GetData
+ Enter⇒Row:0 Col:0 Text:1
+ 【10:07:06 095】SendAsync End:10:07:06 095
+ 該当部屋タイプが既に存在します。
+ Leave⇒End
+
+ ■追加後
+ Leave⇒Start
+ Leave⇒Row:1 Col:0 enterPush:False, text:1
+ 【10:26:02 811】SendAsync begin:10:26:02 811
+ 【10:26:02 811】SendAsync Url⇒/HotelPms.Data.GrpcTableCore/GetData
+ 【10:26:02 860】SendAsync End:10:26:02 860
+ 該当部屋タイプが既に存在します。
+ Leave⇒End
+ Enter⇒Row:0 Col:0
+
+ Semaphore (int initialCount, int maximumCount);
+ initialCount代表还分配几个线程,比如是1,那就是还能允许一个线程继续跑锁起来的代码
+ maximumCount代表最大允许数,比如是1,那就是进去1个线程,就会锁起来
+ */
+ private System.Threading.SemaphoreSlim slimlock = new SemaphoreSlim(1, 1);
+
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public ValidModel(IJSRuntime js)
+ {
+ JSRuntime = js;
+ ID = Guid.NewGuid().ToString();
+ }
+
+ public void Dispose()
+ {
+ }
+
+ #endregion
+
+ #region ★★★★★ Control Event ★★★★★
+
+ /// <summary>
+ /// ①フォーカス入る
+ /// ※BlazorのBugでEnterのパラメータ変数できない
+ /// </summary>
+ /// <param name="index"></param>
+ public async Task Enter(int index, FocusEventArgs e)
+ {
+ await slimlock.WaitAsync();
+ EnvironmentSetting.Debug($"Enter:{index}⇒OrgText={Fields[index].OrgText},Text={Fields[index].Text}");
+
+ Fields[index].OrgText = Fields[index].Text;
+ if ((Fields[index].ShowStyle & SystemEnum.EShowStyle.ThousandSeparator) == SystemEnum.EShowStyle.ThousandSeparator && Fields[index].Text.Length > 0)
+ {
+ Fields[index].Text = Fields[index].Text.Replace(",", string.Empty); //コントロールの値連動する
+ //await Fields[index].Ref.SetInputValue(JSRuntime, Fields[index].Text);
+ }
+
+ if (AfterEnter != null) { AfterEnter(Fields[index], new ValidEventArgs()); }
+ if (Refresh != null) { Refresh(); } //UI更新(binding値変更通知)
+ slimlock.Release();
+ }
+
+ /// <summary>
+ /// ※IMEでもここに通る
+ /// 例:「おぎ」を打つ時、[O]⇒e.Key="Proess"、e.KeyCode="KeyO"、e.Type="KeyDown"
+ /// ②Enter⇒KeyDown⇒KeyPress⇒Leave
+ /// </summary>
+ /// <param name="index"></param>
+ /// <param name="e"></param>
+ /// <returns></returns>
+ public async Task KeyDown(int index, KeyboardEventArgs e)
+ {
+ if (e.Key == "ArrowUp")
+ {
+ try
+ {
+ EnvironmentSetting.Debug($"ArrowUp:{index}");
+ if (await SetAutoNextFocus(index, false))
+ {
+ //BlazorのBugでEnterのパラメータ変数できない!
+ //Uncaught Error: System.ArgumentException: There is no event handler associated with this event. EventId: '290'. (Parameter 'eventHandlerId')
+ //mkArtakMSFT modified the milestones: Next sprint planning, 6.0-preview4 on 20 Mar ← Net6.0-preview4対応だそう
+ KeyDownPreventDefault = true;
+ ArrowUpPush = true;
+ }
+ else
+ {
+ KeyDownPreventDefault = false;
+ ArrowUpPush = false;
+ }
+ }
+ catch { }
+ finally
+ {
+ if (Refresh != null) { Refresh(); } //UI更新(binding値変更通知)
+ }
+ }
+ else if (e.Key == "End")
+ {
+ if (ShowList != null) { ShowList(Fields[index], new ValidEventArgs()); }
+ }
+ else
+ {
+ KeyDownPreventDefault = false;
+ ArrowUpPush = false;
+ }
+ }
+
+ /// <summary>
+ /// ※注意:IMEモードではここに通らない
+ /// e.Codeだと、二つEnterが違う
+ /// ※※注意:ここで@bind-Valueを変更しても、直ぐにinputへ反映しない
+ /// 必ずjs側で強制的にtextをセットする
+ /// 整合性を保るため、@bind-Valueも同じでセットする
+ /// </summary>
+ /// <param name="index"></param>
+ /// <param name="e"></param>
+ /// <returns></returns>
+ public async Task KeyPress(int index, KeyboardEventArgs e)
+ {
+ if (e.Key == "Enter")
+ {
+ try
+ {
+ //※その時、Fields[index].Textの値まだ変っていない!!!!!
+ string text = await Fields[index].Ref.GetInputValue(JSRuntime);
+ EnvironmentSetting.Debug($"Return:{index}⇒{text}");
+
+ //値変更したら、イベント発生
+ if (await IsValueChanged(index, text, true))
+ {
+ //通常チェックを行う
+ if (!await IsCorrectText(index, text, true)) { return; }
+
+ //業務チェックを行う
+ ValidEventArgs vea = new ValidEventArgs() { Text = text, EnterPush = true };
+ bool bvRet = await BusinessValid(Fields[index], vea);
+ EnvironmentSetting.Debug($"BusinessValid結果(Enter):{bvRet},Error:{Fields[index].Error},index={index}");
+ KeyPressPreventDefault = true; //イベント中止
+ EnterPush = true; //Enterを押した知らせ
+ if (bvRet) { SetOrgText(index, text); } else { return; } //BusinessValid結果:OK⇒OrgTextを反映する NG⇒前へ進まない
+ }
+ else
+ {
+ //必須判断:初期表示時:OrgTextは空白のため、値変更しないまま
+ if (text.Trim().Length == 0 && Fields[index].Required)
+ {
+ Fields[index].Error = true;
+ Fields[index].ErrorText = "内容を入力してください。";
+ return;
+ }
+ }
+
+ if (!await SetAutoNextFocus(index, true)) { return; }
+ }
+ catch { }
+ finally
+ {
+ if (Refresh != null) { Refresh(); } //UI更新(binding値変更通知)
+ }
+ }
+ else
+ {
+ if (TextKeyPress(index, e.Key))
+ {
+ KeyPressPreventDefault = false;
+ }
+ else
+ {
+ KeyPressPreventDefault = true; //入力禁止(※:IMEモードで入力したものをここでは通らないため、防げない)
+ }
+ EnterPush = false;
+ }
+ }
+
+ /// <summary>
+ /// そのタイミングbind反映したはず
+ /// </summary>
+ /// <param name="index"></param>
+ /// <returns></returns>
+ //private async Task LeaveMud(int index)
+ public async Task Leave(int index, FocusEventArgs e)
+ {
+ string text = string.Empty;
+ try
+ {
+ await slimlock.WaitAsync();
+ EnvironmentSetting.Debug($"Leave:{index}⇒OrgText={Fields[index].OrgText},Text={Fields[index].Text}");
+
+ text = Fields[index].Text;
+
+ if (EnterPush)
+ {
+ //Enterキーを押した時にも既にチェック済
+ EnterPush = false;
+ }
+ else
+ {
+ //値変更したら、イベント発生
+ if (!await IsValueChanged(index, text, false))
+ {
+ //必須判断:初期表示時:OrgTextは空白のため、値変更しないまま
+ Fields[index].Error = false;
+ Fields[index].ErrorText = string.Empty;
+ return;
+ }
+
+
+ //通常チェックを行う
+ if (await IsCorrectText(index, text, false))
+ {
+ //業務チェックを行う
+ ValidEventArgs vea = new ValidEventArgs() { Text = text };
+ bool bvRet = await BusinessValid(Fields[index], vea);
+ EnvironmentSetting.Debug($"BusinessValid結果:{bvRet},Error:{Fields[index].Error},index={index}");
+ if (!bvRet)
+ {
+ Fields[index].Error = true;
+ }
+ }
+ }
+
+ if (Fields[index].Error)
+ {
+ EnvironmentSetting.Debug($"元値に復元する↓:Error={Fields[index].Error},index={index}");
+ //エラーの場合、元値に復元する
+ //await Fields[index].Ref.SetInputValue(JSRuntime, Fields[index].OrgText);
+ Fields[index].Text = Fields[index].OrgText;
+ Fields[index].Error = false;
+ Fields[index].ErrorText = string.Empty;
+ EnvironmentSetting.Debug($"元値に復元する↑:Error={Fields[index].Error},ErrorText={Fields[index].ErrorText},Text={Fields[index].Text},index={index}");
+ return;
+ }
+
+ SetOrgText(index, text);
+ }
+ catch (Exception ex)
+ {
+ OperationLog.Instance.WriteLog(ex.Message);
+ }
+ finally
+ {
+ if ((Fields[index].ShowStyle & SystemEnum.EShowStyle.ThousandSeparator) == SystemEnum.EShowStyle.ThousandSeparator && text.Length > 0)
+ {
+ text = CConvert.ToThousandSeparator(CConvert.ToDecimal(text), Fields[index].ThousandFormat); //コントロールの値連動する (小数点!!!!)
+ await SetText(index, text, false);
+ }
+
+ if (AfterLeave != null) { AfterLeave(Fields[index], new ValidEventArgs()); }
+ if (ArrowUpPush) { ArrowUpPush = false; }
+ if (Refresh != null) { Refresh(); } //UI更新(binding値変更通知)
+ slimlock.Release();
+ }
+ }
+
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+
+ private async Task<bool> SetAutoNextFocus(int index, bool isEnter)
+ {
+ try
+ {
+ if (BeforeAutoNextFocus != null)
+ {
+ ValidEventArgs args = new ValidEventArgs() { EnterPush = isEnter };
+ if (!await BeforeAutoNextFocus(Fields[index], args)) { return false; }
+ }
+
+ int hitIdx = -1;
+ if (isEnter)
+ {
+ for (int i = index + 1; i < Fields.Count; i++)
+ {
+ if (!Fields[i].Disabled)
+ {
+ hitIdx = i;
+ break;
+ }
+ }
+
+ if (hitIdx == -1) { return false; }
+ }
+ else
+ {
+ if (index == 0) { return true; }
+
+ for (int i = index - 1; i >= 0; i--)
+ {
+ if (!Fields[i].Disabled)
+ {
+ hitIdx = i;
+ break;
+ }
+ }
+
+ if (hitIdx == -1) { return false; }
+ }
+ await Fields[hitIdx].Ref.FocusAsync();
+ return true;
+ }
+ catch
+ {
+ return false;
+ }
+ finally
+ {
+ if (AfterAutoNextFocus != null) { AfterAutoNextFocus(Fields[index], new ValidEventArgs() { EnterPush = isEnter }); }
+ }
+ }
+
+ /// <summary>
+ /// ※注意:IME起動時、ここに通らない
+ /// </summary>
+ /// <param name="index"></param>
+ /// <param name="Key"></param>
+ /// <returns></returns>
+ private bool TextKeyPress(int index, string Key)
+ {
+ try
+ {
+ SystemEnum.EInputChar inputType = Fields[index].InputChar;
+ if (inputType == SystemEnum.EInputChar.None)
+ {
+ return true;
+ }
+
+ char hKeyAscii = Key[0];
+
+ if (hKeyAscii == 8)
+ {
+ return true;
+ }
+ else if (hKeyAscii == "'"[0])
+ {
+ hKeyAscii = (char)0;
+ return false;
+ }
+ else if (hKeyAscii == 13)
+ {
+ //hKeyAscii = (char)0;
+ return false;
+ }
+
+ if ((inputType & SystemEnum.EInputChar.Num) == SystemEnum.EInputChar.Num)
+ {
+ if ('0' <= hKeyAscii && hKeyAscii <= '9')
+ {
+ return true;
+ }
+ }
+
+ if ((inputType & SystemEnum.EInputChar.Dot) == SystemEnum.EInputChar.Dot)
+ {
+ if (hKeyAscii == '.')
+ {
+ return true;
+ }
+ }
+
+ if ((inputType & SystemEnum.EInputChar.Slash) == SystemEnum.EInputChar.Slash)
+ {
+ if (hKeyAscii == '/')
+ {
+ return true;
+ }
+ }
+
+ if ((inputType & SystemEnum.EInputChar.Colon) == SystemEnum.EInputChar.Colon)
+ {
+ if (hKeyAscii == ':')
+ {
+ return true;
+ }
+ }
+
+ if ((inputType & SystemEnum.EInputChar.Subtract) == SystemEnum.EInputChar.Subtract)
+ {
+ if (hKeyAscii == '-')
+ {
+ return true;
+ }
+ }
+
+ if ((inputType & SystemEnum.EInputChar.Comma) == SystemEnum.EInputChar.Comma)
+ {
+ if (hKeyAscii == ',')
+ {
+ return true;
+ }
+ }
+
+ if ((inputType & SystemEnum.EInputChar.Space) == SystemEnum.EInputChar.Space)
+ {
+ if (hKeyAscii == ' ')
+ {
+ return true;
+ }
+ }
+
+ if ((inputType & SystemEnum.EInputChar.Alpha_C) == SystemEnum.EInputChar.Alpha_C)
+ {
+ if ('A' <= hKeyAscii && hKeyAscii <= 'Z')
+ {
+ return true;
+ }
+ }
+
+ if ((inputType & SystemEnum.EInputChar.Alpha_S) == SystemEnum.EInputChar.Alpha_S)
+ {
+ if ('a' <= hKeyAscii && hKeyAscii <= 'z')
+ {
+ return true;
+ }
+ }
+
+ if ((inputType & SystemEnum.EInputChar.Kana) == SystemEnum.EInputChar.Kana)
+ {
+ if ('ヲ' <= hKeyAscii && hKeyAscii <= '゚')
+ {
+ return true;
+ }
+ }
+
+ if ((inputType & SystemEnum.EInputChar.Half) == SystemEnum.EInputChar.Half)
+ {
+ if (hKeyAscii >= 0 && hKeyAscii <= 255)
+ {
+ return true;
+ }
+ }
+ if ((inputType & SystemEnum.EInputChar.Full) == SystemEnum.EInputChar.Full)
+ {
+ if (hKeyAscii < 0 || hKeyAscii > 255)
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+ catch
+ {
+ return false;
+ }
+ }
+
+ private async Task<bool> IsValueChanged(int index, string inputText, bool isEnter)
+ {
+ string newInputValue = string.Empty;
+ if ((Fields[index].ShowStyle & SystemEnum.EShowStyle.ThousandSeparator) == SystemEnum.EShowStyle.ThousandSeparator && inputText.Length > 0)
+ {
+ newInputValue = CConvert.ToThousandSeparator(CConvert.ToDecimal(inputText), Fields[index].ThousandFormat); //※OrgTextはカンマ区切りのまま
+ }
+ else
+ {
+ newInputValue = inputText;
+ }
+
+ EnvironmentSetting.Debug($"CheckValueChanged:{index}⇒inputText={newInputValue},OrgText={Fields[index].OrgText}");
+ if (newInputValue.Equals(Fields[index].OrgText))
+ {
+ return false;
+ }
+
+ //値変更したかどうか
+ if (ValueChanged != null)
+ {
+ //string saveText = inputText;
+ ValidEventArgs vce = new ValidEventArgs() { Text = inputText, EnterPush = isEnter };
+ if (!await ValueChanged(Fields[index], vce))
+ {
+ //元の値に戻す
+ if (vce.ResetOrgValue)
+ {
+ await SetText(index, Fields[index].OrgText, isEnter);
+ }
+ return false; //外から強制的に値変らないようにする
+ }
+ //await SetText(index, saveText, isEnter); //変更された恐れがあるため
+ }
+ return true;
+ }
+
+ private async Task SetText(int index, string text, bool updateRef)
+ {
+ Fields[index].Text = text;
+ if (updateRef) { await Fields[index].Ref.SetInputValue(JSRuntime, text); }
+ }
+
+ private void SetOrgText(int index, string inputText)
+ {
+ if ((Fields[index].ShowStyle & SystemEnum.EShowStyle.ThousandSeparator) == SystemEnum.EShowStyle.ThousandSeparator)
+ {
+ Fields[index].OrgText = CConvert.ToThousandSeparator(CConvert.ToDecimal(inputText), Fields[index].ThousandFormat); //※OrgTextはカンマ区切りのまま
+ }
+ else
+ {
+ Fields[index].OrgText = inputText;
+ }
+ }
+
+ private bool IsCorrectValue(int index, string inputText)
+ {
+ string wsChkStr = "";
+ SystemEnum.EInputChar wlErrFlg = 0;
+ try
+ {
+ string text = (Fields[index].ShowStyle & SystemEnum.EShowStyle.ThousandSeparator) == SystemEnum.EShowStyle.ThousandSeparator ? inputText.Replace(",", string.Empty) : inputText;
+
+ SystemEnum.EInputChar inputType = Fields[index].InputChar;
+ //半角チェック
+ if ((inputType & SystemEnum.EInputChar.Half) == SystemEnum.EInputChar.Half && !CConvert.IsHalf(text))
+ {
+ Fields[index].Error = true;
+ Fields[index].ErrorText = "半角入力してください。";
+ return false;
+ }
+
+ //全角チェック
+ if ((inputType & SystemEnum.EInputChar.Full) == SystemEnum.EInputChar.Full && !CConvert.IsFull(text))
+ {
+ Fields[index].Error = true;
+ Fields[index].ErrorText = "全角入力してください。";
+ return false;
+ }
+
+ //数字
+ if ((inputType & SystemEnum.EInputChar.Num) == SystemEnum.EInputChar.Num)
+ {
+ wsChkStr = wsChkStr + Chr_Num;
+ wlErrFlg = wlErrFlg | SystemEnum.EInputChar.Num;
+ }
+
+ //.
+ if ((inputType & SystemEnum.EInputChar.Dot) == SystemEnum.EInputChar.Dot)
+ {
+ wsChkStr = wsChkStr + ".";
+ wlErrFlg = wlErrFlg | SystemEnum.EInputChar.Dot;
+ }
+
+ //[/]
+ if ((inputType & SystemEnum.EInputChar.Slash) == SystemEnum.EInputChar.Slash)
+ {
+ wsChkStr = wsChkStr + "/";
+ wlErrFlg = wlErrFlg | SystemEnum.EInputChar.Slash;
+ }
+
+ //Space
+ if ((inputType & SystemEnum.EInputChar.Space) == SystemEnum.EInputChar.Space)
+ {
+ wsChkStr = wsChkStr + " ";
+ wlErrFlg = wlErrFlg | SystemEnum.EInputChar.Space;
+ }
+
+ //-
+ if ((inputType & SystemEnum.EInputChar.Subtract) == SystemEnum.EInputChar.Subtract)
+ {
+ wsChkStr = wsChkStr + "-";
+ wlErrFlg = wlErrFlg | SystemEnum.EInputChar.Subtract;
+ }
+
+ //:
+ if ((inputType & SystemEnum.EInputChar.Colon) == SystemEnum.EInputChar.Colon)
+ {
+ wsChkStr = wsChkStr + ":";
+ wlErrFlg = wlErrFlg | SystemEnum.EInputChar.Colon;
+ }
+
+ //,
+ if ((inputType & SystemEnum.EInputChar.Comma) == SystemEnum.EInputChar.Comma)
+ {
+ wsChkStr = wsChkStr + ",";
+ wlErrFlg = wlErrFlg | SystemEnum.EInputChar.Colon;
+ }
+
+ //小英
+ if ((inputType & SystemEnum.EInputChar.Alpha_C) == SystemEnum.EInputChar.Alpha_C)
+ {
+ wsChkStr = wsChkStr + Chr_Alpha_C;
+ wlErrFlg = wlErrFlg | SystemEnum.EInputChar.Alpha_C;
+ }
+
+ //大英
+ if ((inputType & SystemEnum.EInputChar.Alpha_S) == SystemEnum.EInputChar.Alpha_S)
+ {
+ wsChkStr = wsChkStr + Chr_Alpha_S;
+ wlErrFlg = wlErrFlg | SystemEnum.EInputChar.Alpha_S;
+ }
+
+ //カナ
+ if ((inputType & SystemEnum.EInputChar.Kana) == SystemEnum.EInputChar.Kana)
+ {
+ wsChkStr = wsChkStr + Chr_Kana;
+ wlErrFlg = wlErrFlg | SystemEnum.EInputChar.Kana;
+ }
+ if (wsChkStr.Length > 0)
+ {
+ if (CConvert.IsInOwnStr(text, wsChkStr) == false)
+ {
+ Fields[index].Error = true;
+ if (wlErrFlg == SystemEnum.EInputChar.Num)
+ {
+ Fields[index].ErrorText = "数字を入力してください。";
+ }
+ else if (wlErrFlg == SystemEnum.EInputChar.Kana)
+ {
+ Fields[index].ErrorText = "半角カナを入力してください。";
+ }
+ else if (wlErrFlg == SystemEnum.EInputChar.Alpha_S)
+ {
+ Fields[index].ErrorText = "小英文字を入力してください。";
+ }
+ else if (wlErrFlg == SystemEnum.EInputChar.Alpha_C)
+ {
+ Fields[index].ErrorText = "大英文字を入力してください。";
+ }
+ else
+ {
+ Fields[index].ErrorText = "正しい値を入力してください。";
+ }
+ return false;
+ }
+ }
+ return true;
+ }
+ catch (Exception ex)
+ {
+ OperationLog.Instance.WriteLog($"IsCorrectValue:{ex.Message}");
+ return false;
+ }
+ }
+
+ private async Task<bool> IsCorrectText(int index, string inputText, bool isEnter)
+ {
+ //必須判断
+ if (inputText.Trim().Length == 0 && Fields[index].Required)
+ {
+ Fields[index].Error = true;
+ Fields[index].ErrorText = "内容を入力してください。";
+ return false;
+ }
+
+ //入力文字判断
+ if (!IsCorrectValue(index, inputText)) { return false; }
+
+ //日付判断
+ if (Fields[index].InputStyle == SystemEnum.EInputStyle.Date)
+ {
+ if (!CConvert.IsDate(CConvert.ToInt(inputText.Replace("/", string.Empty).Replace("-", string.Empty)).ToString().PadLeft(8, '0')))
+ {
+ Fields[index].Error = true;
+ Fields[index].ErrorText = "正しい日付を入力してください。";
+ return false;
+ }
+ }
+
+ //範囲判断
+ if (Fields[index].Range.Length > 0)
+ {
+ if (CConvert.IsOutOfRange(inputText, Fields[index].Range))
+ {
+ Fields[index].Error = true;
+ Fields[index].ErrorText = "入力範囲以外です。";
+ return false;
+ }
+ }
+
+ //「0」詰合
+ if (inputText.Length > 0)
+ {
+ if ((Fields[index].ShowStyle & SystemEnum.EShowStyle.ZeroPad) == SystemEnum.EShowStyle.ZeroPad)
+ {
+ string text = inputText.PadLeft(Fields[index].MaxLenth, '0');
+ await SetText(index, text, isEnter);
+ }
+ }
+ return true;
+ }
+
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+
+ public void Add(ValidField field)
+ {
+ field.Index = Fields.Count;
+ Fields.Add(field);
+ dict.Add(field.Name, field);
+ if (field.GridFilter) { FilterFields.Add(field.Name); }
+ if (field.GridOrder > 0) { OrderFields.Add(field.GridOrder, field.Name); }
+ }
+
+ public void RemoveAt(int index)
+ {
+ string key = Fields[index].Name;
+ if (Fields[index].GridFilter) { FilterFields.Remove(key); }
+ if (Fields[index].GridOrder > 0) { OrderFields.Remove(Fields[index].GridOrder); }
+ dict.Remove(key);
+ Fields.RemoveAt(index);
+ for (int i = index; i < Fields.Count; i++) { Fields[i].Index -= 1; }
+ }
+
+ public void Remove(ValidField field)
+ {
+ RemoveAt(field.Index);
+ }
+
+ public void Remove(string key)
+ {
+ ValidField field = dict[key];
+ RemoveAt(field.Index);
+ }
+
+ public ValidField GetField(string key)
+ {
+ return dict[key];
+ }
+
+ public void SetField(string key, string value)
+ {
+ dict[key].Text = value;
+ }
+
+ public void Clear()
+ {
+ ErrText = string.Empty;
+ EnterPush = false;
+ ArrowUpPush = false;
+ KeyDownPreventDefault = false;
+ KeyPressPreventDefault = false;
+
+ foreach (ValidField field in Fields)
+ {
+ field.Clear();
+ }
+ }
+
+ public async Task<bool> IsValidAll()
+ {
+ try
+ {
+ ErrText = string.Empty;
+ foreach (ValidField field in Fields)
+ {
+ string text = await field.Ref.GetInputValue(JSRuntime); //この時点ValidField.Textまだ反映していない
+ if (!await IsCorrectText(field.Index, text, false))
+ {
+ ErrText = field.ErrorText;
+ return false;
+ }
+
+ if (BusinessValid != null)
+ {
+ ValidEventArgs e = new ValidEventArgs() { Text = text, IsAll = true };
+ if (!await BusinessValid(field, e))
+ {
+ ErrText = field.ErrorText;
+ return false;
+ }
+ }
+ }
+
+ return true;
+ }
+ catch
+ {
+ return false;
+ }
+ finally
+ {
+ if (Refresh != null) { Refresh(); }
+ }
+ }
+
+ /// <summary>
+ /// マスタメンテナンス画面のフィルター条件文返す
+ /// </summary>
+ /// <param name="key"></param>
+ /// <returns></returns>
+ public string GetFilterSql(string key)
+ {
+ if (string.IsNullOrEmpty(key) || FilterFields.Count == 0) { return string.Empty; }
+
+ StringBuilder sql = new StringBuilder();
+ sql.Append("(");
+ for (int i = 0; i < FilterFields.Count; i++)
+ {
+ if (i > 0) { sql.Append(" OR "); }
+ sql.Append($"{FilterFields[i]} LIKE N''%{CConvert.ToSql(key)}%''");
+ }
+ sql.Append(")");
+ return CConvert.ToBase64(sql.ToString());
+ }
+
+ /// <summary>
+ /// マスタメンテナンス画面の一覧の順番
+ /// </summary>
+ /// <returns></returns>
+ public string GetOrderSql()
+ {
+ if (OrderFields.Count == 0) { return string.Empty; }
+ StringBuilder sql = new StringBuilder();
+ bool isFirst = true;
+ foreach (KeyValuePair<int, string> item in OrderFields)
+ {
+ if (isFirst) { isFirst = false; } else { sql.Append(","); }
+ sql.Append(item.Value);
+ }
+ return sql.ToString();
+ }
+
+
+
+
+ #endregion
+
+ }
+}
diff --git a/HotelPms.Client.Blazor/ViewModel/ValidModelEx.cs b/HotelPms.Client.Blazor/ViewModel/ValidModelEx.cs
new file mode 100644
index 0000000..0958dfe
--- /dev/null
+++ b/HotelPms.Client.Blazor/ViewModel/ValidModelEx.cs
@@ -0,0 +1,731 @@
+using HotelPms.Client.Blazor.Pages.UseDetail;
+using HotelPms.Client.Blazor.Services;
+using HotelPms.Client.Blazor.Util;
+using HotelPms.Share.IO;
+using HotelPms.Share.Util;
+using Microsoft.AspNetCore.Components.Forms;
+using Microsoft.AspNetCore.Components.Web;
+using Microsoft.JSInterop;
+using System.Collections.Concurrent;
+using System.Reflection.Metadata;
+using System.Text;
+
+namespace HotelPms.Client.Blazor.ViewModel
+{
+ /// <summary>
+ /// ViewModelExとして使って、
+ /// Windows Fromスタイルの入力チェック方式
+ /// C# Call jsは遅いため、逆にjsよりCallBackと使用する
+ /// ※@bind-value使わない
+ /// </summary>
+ public abstract class ValidModelEx : IDisposable
+ {
+ #region ★★★★★ Declartions ★★★★★
+
+ public delegate void ValidEventHandler(ValidField sender, ValidEventArgs e);
+ public delegate Task<bool> ValidResultEventHandler(ValidField sender, ValidEventArgs e);
+
+ public event ValidResultEventHandler BeforeAutoNextFocus;
+ public event ValidEventHandler AfterAutoNextFocus;
+ public event ValidEventHandler AfterEnter;
+ public event ValidEventHandler AfterLeave;
+ public event ValidResultEventHandler ValueChanged;
+ public event ValidResultEventHandler ShowList;
+ public event ValidResultEventHandler BusinessValid;
+
+ public static string Chr_Num = "0123456789";
+ public static string Chr_Alpha_S = "abcdefghijklmnopqrstuvwxyz ";
+ public static string Chr_Alpha_C = "ABCDEFGHIJKLMNOPQRSTUVWXYZ ";
+ public static string Chr_Kana = "ヲァィゥェォャュョッーアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワン゙゚ ";
+ public static string Chr_Alpha = Chr_Alpha_S + Chr_Alpha_C;
+ public static string Chr_NumAlpha = Chr_Num + Chr_Alpha;
+ public static string Chr_ANK = Chr_NumAlpha + Chr_Kana;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+
+ /// <summary>
+ /// ID毎のインスタンス格納
+ /// </summary>
+ public static ConcurrentDictionary<string, ValidModelEx> Storage { get; set; } = new ConcurrentDictionary<string, ValidModelEx>();
+
+ public IJSRuntime JSRuntime { get; set; }
+
+ public List<ValidField> Fields { get; set; } = new List<ValidField>();
+ private Dictionary<string, ValidField> dict = new Dictionary<string, ValidField>();
+
+ public Action ErrRefresh { get; set; }
+
+ /// <summary>
+ /// Enterキーを押したかどうか
+ /// </summary>
+ public bool EnterPush { get; set; }
+
+ /// <summary>
+ /// Upキー押したかどうか
+ /// </summary>
+ public bool ArrowUpPush { get; set; }
+
+ /// <summary>
+ /// 0.新規 1.編集 2.削除
+ /// </summary>
+ public int EditMode { get; set; }
+
+ /// <summary>
+ /// 全体のエラー
+ /// </summary>
+ public string ErrText { get; set; }
+
+ /// <summary>
+ /// 一覧表示の検索キー対象項目一覧
+ /// </summary>
+ public List<string> FilterFields { get; set; } = new List<string>();
+
+ /// <summary>
+ /// 一覧表示の順番対象項目一覧
+ /// </summary>
+ public SortedList<int, string> OrderFields { get; set; } = new SortedList<int, string>();
+
+ /// <summary>
+ /// Guid
+ /// </summary>
+ public string ID { get; set; } = string.Empty;
+
+ public bool DisableKeyboard { get; set; } = false;
+
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public ValidModelEx(IJSRuntime js)
+ {
+ JSRuntime = js;
+ ID = Guid.NewGuid().ToString();
+ Storage[ID] = this;
+ }
+
+ public void Dispose()
+ {
+ Storage.TryRemove(ID, out ValidModelEx model);
+ }
+
+ #endregion
+
+ #region ★★★★★ Control Event ★★★★★
+
+ /// <summary>
+ /// ①フォーカス入る
+ /// ※BlazorのBugでEnterのパラメータ変数できない
+ /// </summary>
+ /// <param name="index"></param>
+ public void Enter(int index, JsInputCoreEventArgs e)
+ {
+ EnvironmentSetting.Debug($"Enter:{index}⇒OrgText={e.OrgText},Text={e.Text}");
+
+ Fields[index].OrgText = e.OrgText;
+ if ((Fields[index].ShowStyle & SystemEnum.EShowStyle.ThousandSeparator) == SystemEnum.EShowStyle.ThousandSeparator && Fields[index].Text.Length > 0)
+ {
+ Fields[index].Text = Fields[index].Text.Replace(",", string.Empty); //コントロールの値連動する
+ }
+ e.ResultNo = 0;
+
+ if (AfterEnter != null) { AfterEnter(Fields[index], new ValidEventArgs()); }
+ }
+
+ /// <summary>
+ /// ※IMEでもここに通る
+ /// 例:「おぎ」を打つ時、[O]⇒e.Key="Proess"、e.KeyCode="KeyO"、e.Type="KeyDown"
+ /// ②Enter⇒KeyDown⇒KeyPress⇒Leave
+ /// </summary>
+ /// <param name="index"></param>
+ /// <param name="e"></param>
+ /// <returns></returns>
+ public async Task KeyUp(int index, JsInputCoreEventArgs e)
+ {
+ if(DisableKeyboard) { return; }
+
+ if (e.Key == "ArrowUp")
+ {
+ try
+ {
+ EnvironmentSetting.Debug($"KeyUp⇒ArrowUp:{index}");
+ if (!await SetAutoNextFocus(index, false, e)) { return; }
+ e.ResultNo = 0;
+ }
+ catch { }
+ finally
+ {
+ }
+ }
+ else if (e.Key == "End")
+ {
+ EnvironmentSetting.Debug($"KeyUp⇒End:{index}");
+ if (ShowList != null)
+ {
+ DisableKeyboard = true;
+ ValidEventArgs eventArgs = new();
+ bool ret = await ShowList(Fields[index], eventArgs);
+ DisableKeyboard = false;
+ if (!eventArgs.Cancel) { await SetAutoNextFocus(index, true, e); }
+ }
+ e.Text = Fields[index].Text;
+ e.ResultNo = 0;
+ }
+ else if (e.Key == "Enter")
+ {
+ await KeyEnter(index, e);
+ }
+ }
+
+ /// <summary>
+ /// ※注意:IMEモードではここに通らない
+ /// e.Codeだと、二つEnterが違う
+ /// ※※注意:ここで@bind-Valueを変更しても、直ぐにinputへ反映しない
+ /// 必ずjs側で強制的にtextをセットする
+ /// 整合性を保るため、@bind-Valueも同じでセットする
+ /// </summary>
+ /// <param name="index"></param>
+ /// <param name="e"></param>
+ /// <returns></returns>
+ public async Task KeyEnter(int index, JsInputCoreEventArgs e)
+ {
+ try
+ {
+ FormatInput(index, e);
+ string text = e.Text;
+ EnvironmentSetting.Debug($"Return:{index}⇒{text}");
+
+ //値変更したら、イベント発生
+ if (await IsValueChanged(index, text, true, e))
+ {
+ //通常チェックを行う
+ Fields[index].Error = false;
+ Fields[index].ErrorText = string.Empty;
+ if (!IsCorrectText(index, text, true)) { return; }
+
+ bool bvRet = true;
+ if (BusinessValid != null)
+ {
+ //業務チェックを行う
+ ValidEventArgs vea = new ValidEventArgs() { Text = text, EnterPush = true };
+ bvRet = await BusinessValid(Fields[index], vea);
+ EnvironmentSetting.Debug($"BusinessValid結果(Enter):{bvRet},Error:{Fields[index].Error},index={index}");
+ }
+ EnterPush = true; //Enterを押した知らせ
+ if (bvRet) { SetOrgText(index, text); } else { return; } //BusinessValid結果:OK⇒OrgTextを反映する NG⇒前へ進まない
+ Fields[index].Text = text; //入力値確定
+ e.ResultNo = 0;
+ }
+ else
+ {
+ //必須判断:初期表示時:OrgTextは空白のため、値変更しないまま
+ if (text.Trim().Length == 0 && Fields[index].Required)
+ {
+ Fields[index].Error = true;
+ Fields[index].ErrorText = "内容を入力してください。";
+ return;
+ }
+ e.ResultNo = 1;
+ }
+
+ if (!await SetAutoNextFocus(index, true, e)) { e.ResultNo = 9; return; }
+ }
+ catch { }
+ finally
+ {
+ if (ErrRefresh != null && Fields[index].Error)
+ {
+ EnvironmentSetting.Debug($"Error:{Fields[index].Error},ErrorText={Fields[index].ErrorText}");
+ ErrRefresh();
+ }
+ }
+ }
+
+ public void FormatInput(int index, JsInputCoreEventArgs e)
+ {
+ try
+ {
+ if (Fields[index].InputStyle == SystemEnum.EInputStyle.Date)
+ {
+ e.Text = CConvert.ParseDate(e.Text, Fields[index].OrgText);
+ }
+ else if (Fields[index].InputStyle == SystemEnum.EInputStyle.Time)
+ {
+ e.Text = CConvert.ParseTime(e.Text, Fields[index].OrgText);
+ }
+ }
+ catch { }
+ }
+
+ /// <summary>
+ /// そのタイミングbind反映したはず
+ /// </summary>
+ /// <param name="index"></param>
+ /// <returns></returns>
+ //private async Task LeaveMud(int index)
+ public async Task Leave(int index, JsInputCoreEventArgs e)
+ {
+ string text = string.Empty;
+ bool refresh = false;
+ try
+ {
+ EnvironmentSetting.Debug($"Leave:{index}⇒OrgText={Fields[index].OrgText},Text={Fields[index].Text}");
+ FormatInput(index, e);
+ text = e.Text;
+
+ if (EnterPush)
+ {
+ //Enterキーを押した時にも既にチェック済
+ EnterPush = false;
+ }
+ else
+ {
+ //値変更したら、イベント発生
+ if (!await IsValueChanged(index, text, false, e))
+ {
+ //必須判断:初期表示時:OrgTextは空白のため、値変更しないまま
+ Fields[index].Error = false;
+ Fields[index].ErrorText = string.Empty;
+ e.ResultNo = 1;
+ return;
+ }
+
+ //通常チェックを行う
+ Fields[index].Error = false;
+ Fields[index].ErrorText = string.Empty;
+ if (IsCorrectText(index, text, false))
+ {
+ if (BusinessValid != null)
+ {
+ //業務チェックを行う
+ ValidEventArgs vea = new ValidEventArgs() { Text = text };
+ bool bvRet = await BusinessValid(Fields[index], vea);
+ EnvironmentSetting.Debug($"BusinessValid結果:{bvRet},Error:{Fields[index].Error},index={index}");
+ if (!bvRet)
+ {
+ Fields[index].Error = true;
+ }
+ }
+ }
+ }
+
+ if (Fields[index].Error)
+ {
+ EnvironmentSetting.Debug($"元値に復元する↓:Error={Fields[index].Error},index={index}");
+ //エラーの場合、元値に復元する
+ Fields[index].Text = Fields[index].OrgText;
+ e.Text = Fields[index].OrgText;
+ Fields[index].Error = false;
+ Fields[index].ErrorText = string.Empty;
+ EnvironmentSetting.Debug($"元値に復元する↑:Error={Fields[index].Error},ErrorText={Fields[index].ErrorText},Text={Fields[index].Text},index={index}");
+ refresh = true;
+ return;
+ }
+
+ Fields[index].Text = text; //確定
+ e.Text = text;
+ SetOrgText(index, text);
+ e.ResultNo = 0;
+ }
+ catch (Exception ex)
+ {
+ OperationLog.Instance.WriteLog(ex.Message);
+ }
+ finally
+ {
+ if ((Fields[index].ShowStyle & SystemEnum.EShowStyle.ThousandSeparator) == SystemEnum.EShowStyle.ThousandSeparator && text.Length > 0)
+ {
+ text = CConvert.ToThousandSeparator(CConvert.ToDecimal(text), Fields[index].ThousandFormat); //コントロールの値連動する (小数点!!!!)
+ Fields[index].Text = text;
+ e.Text = text;
+ }
+ else if ((Fields[index].ShowStyle & SystemEnum.EShowStyle.ZeroPad) == SystemEnum.EShowStyle.ZeroPad && text.Length > 0)
+ {
+ text = text.PadLeft(Fields[index].MaxLenth, '0');
+ Fields[index].Text = text;
+ e.Text = text;
+ }
+
+ if (AfterLeave != null) { AfterLeave(Fields[index], new ValidEventArgs()); }
+ if (ArrowUpPush) { ArrowUpPush = false; }
+ if (refresh && ErrRefresh != null) { ErrRefresh(); }
+ }
+ }
+
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+
+ private async Task<bool> SetAutoNextFocus(int index, bool isEnter, JsInputCoreEventArgs e)
+ {
+ try
+ {
+ if (BeforeAutoNextFocus != null)
+ {
+ ValidEventArgs args = new ValidEventArgs() { EnterPush = isEnter };
+ if (!await BeforeAutoNextFocus(Fields[index], args)) { return false; }
+ }
+
+ int hitIdx = -1;
+ if (isEnter)
+ {
+ for (int i = index + 1; i < Fields.Count; i++)
+ {
+ if (!Fields[i].Disabled)
+ {
+ hitIdx = i;
+ break;
+ }
+ }
+
+ if (hitIdx == -1) { return false; }
+ }
+ else
+ {
+ if (index == 0) { return true; }
+
+ for (int i = index - 1; i >= 0; i--)
+ {
+ if (!Fields[i].Disabled)
+ {
+ hitIdx = i;
+ break;
+ }
+ }
+
+ if (hitIdx == -1) { return false; }
+ }
+ e.NextFocus = $"{e.ID}-{hitIdx}";
+ return true;
+ }
+ catch
+ {
+ return false;
+ }
+ finally
+ {
+ if (AfterAutoNextFocus != null) { AfterAutoNextFocus(Fields[index], new ValidEventArgs() { EnterPush = isEnter }); }
+ }
+ }
+
+ private async Task<bool> IsValueChanged(int index, string inputText, bool isEnter, JsInputCoreEventArgs e)
+ {
+ string newInputValue = string.Empty;
+ if ((Fields[index].ShowStyle & SystemEnum.EShowStyle.ThousandSeparator) == SystemEnum.EShowStyle.ThousandSeparator && inputText.Length > 0)
+ {
+ newInputValue = CConvert.ToThousandSeparator(CConvert.ToDecimal(inputText), Fields[index].ThousandFormat); //※OrgTextはカンマ区切りのまま
+ }
+ else
+ {
+ newInputValue = inputText;
+ }
+
+ EnvironmentSetting.Debug($"CheckValueChanged:{index}⇒inputText={newInputValue},OrgText={Fields[index].OrgText}");
+ if (newInputValue.Equals(Fields[index].OrgText))
+ {
+ return false;
+ }
+
+ //値変更したかどうか
+ if (ValueChanged != null)
+ {
+ ValidEventArgs vce = new ValidEventArgs() { Text = inputText, EnterPush = isEnter };
+ if (!await ValueChanged(Fields[index], vce))
+ {
+ //元の値に戻す
+ if (vce.ResetOrgValue)
+ {
+ //※元の値に戻す且つフォーカス移動必要
+ Fields[index].Text = Fields[index].OrgText;
+ e.Text = Fields[index].OrgText;
+ }
+ return false; //外から強制的に値変らないようにする
+ }
+ }
+ return true;
+ }
+
+ private void SetOrgText(int index, string inputText)
+ {
+ if ((Fields[index].ShowStyle & SystemEnum.EShowStyle.ThousandSeparator) == SystemEnum.EShowStyle.ThousandSeparator)
+ {
+ Fields[index].OrgText = CConvert.ToThousandSeparator(CConvert.ToDecimal(inputText), Fields[index].ThousandFormat); //※OrgTextはカンマ区切りのまま
+ }
+ else
+ {
+ Fields[index].OrgText = inputText;
+ }
+ }
+
+ private bool IsCorrectValue(int index, string inputText)
+ {
+ string wsChkStr = "";
+ SystemEnum.EInputChar wlErrFlg = 0;
+ try
+ {
+ string text = (Fields[index].ShowStyle & SystemEnum.EShowStyle.ThousandSeparator) == SystemEnum.EShowStyle.ThousandSeparator ? inputText.Replace(",", string.Empty) : inputText;
+
+ SystemEnum.EInputChar inputType = Fields[index].InputChar;
+ //半角チェック
+ if ((inputType & SystemEnum.EInputChar.Half) == SystemEnum.EInputChar.Half && !CConvert.IsHalf(text))
+ {
+ Fields[index].Error = true;
+ Fields[index].ErrorText = "半角入力してください。";
+ return false;
+ }
+
+ //全角チェック
+ if ((inputType & SystemEnum.EInputChar.Full) == SystemEnum.EInputChar.Full && !CConvert.IsFull(text))
+ {
+ Fields[index].Error = true;
+ Fields[index].ErrorText = "全角入力してください。";
+ return false;
+ }
+
+ //数字
+ if ((inputType & SystemEnum.EInputChar.Num) == SystemEnum.EInputChar.Num)
+ {
+ wsChkStr = wsChkStr + Chr_Num;
+ wlErrFlg = wlErrFlg | SystemEnum.EInputChar.Num;
+ }
+
+ //.
+ if ((inputType & SystemEnum.EInputChar.Dot) == SystemEnum.EInputChar.Dot)
+ {
+ wsChkStr = wsChkStr + ".";
+ wlErrFlg = wlErrFlg | SystemEnum.EInputChar.Dot;
+ }
+
+ //[/]
+ if ((inputType & SystemEnum.EInputChar.Slash) == SystemEnum.EInputChar.Slash)
+ {
+ wsChkStr = wsChkStr + "/";
+ wlErrFlg = wlErrFlg | SystemEnum.EInputChar.Slash;
+ }
+
+ //Space
+ if ((inputType & SystemEnum.EInputChar.Space) == SystemEnum.EInputChar.Space)
+ {
+ wsChkStr = wsChkStr + " ";
+ wlErrFlg = wlErrFlg | SystemEnum.EInputChar.Space;
+ }
+
+ //-
+ if ((inputType & SystemEnum.EInputChar.Subtract) == SystemEnum.EInputChar.Subtract)
+ {
+ wsChkStr = wsChkStr + "-";
+ wlErrFlg = wlErrFlg | SystemEnum.EInputChar.Subtract;
+ }
+
+ //:
+ if ((inputType & SystemEnum.EInputChar.Colon) == SystemEnum.EInputChar.Colon)
+ {
+ wsChkStr = wsChkStr + ":";
+ wlErrFlg = wlErrFlg | SystemEnum.EInputChar.Colon;
+ }
+
+ //,
+ if ((inputType & SystemEnum.EInputChar.Comma) == SystemEnum.EInputChar.Comma)
+ {
+ wsChkStr = wsChkStr + ",";
+ wlErrFlg = wlErrFlg | SystemEnum.EInputChar.Colon;
+ }
+
+ //小英
+ if ((inputType & SystemEnum.EInputChar.Alpha_C) == SystemEnum.EInputChar.Alpha_C)
+ {
+ wsChkStr = wsChkStr + Chr_Alpha_C;
+ wlErrFlg = wlErrFlg | SystemEnum.EInputChar.Alpha_C;
+ }
+
+ //大英
+ if ((inputType & SystemEnum.EInputChar.Alpha_S) == SystemEnum.EInputChar.Alpha_S)
+ {
+ wsChkStr = wsChkStr + Chr_Alpha_S;
+ wlErrFlg = wlErrFlg | SystemEnum.EInputChar.Alpha_S;
+ }
+
+ //カナ
+ if ((inputType & SystemEnum.EInputChar.Kana) == SystemEnum.EInputChar.Kana)
+ {
+ wsChkStr = wsChkStr + Chr_Kana;
+ wlErrFlg = wlErrFlg | SystemEnum.EInputChar.Kana;
+ }
+ if (wsChkStr.Length > 0)
+ {
+ if (CConvert.IsInOwnStr(text, wsChkStr) == false)
+ {
+ Fields[index].Error = true;
+ if (wlErrFlg == SystemEnum.EInputChar.Num)
+ {
+ Fields[index].ErrorText = "数字を入力してください。";
+ }
+ else if (wlErrFlg == SystemEnum.EInputChar.Kana)
+ {
+ Fields[index].ErrorText = "半角カナを入力してください。";
+ }
+ else if (wlErrFlg == SystemEnum.EInputChar.Alpha_S)
+ {
+ Fields[index].ErrorText = "小英文字を入力してください。";
+ }
+ else if (wlErrFlg == SystemEnum.EInputChar.Alpha_C)
+ {
+ Fields[index].ErrorText = "大英文字を入力してください。";
+ }
+ else
+ {
+ Fields[index].ErrorText = "正しい値を入力してください。";
+ }
+ return false;
+ }
+ }
+ return true;
+ }
+ catch (Exception ex)
+ {
+ OperationLog.Instance.WriteLog($"IsCorrectValue:{ex.Message}");
+ return false;
+ }
+ }
+
+ private bool IsCorrectText(int index, string inputText, bool isEnter)
+ {
+ //必須判断
+ if (inputText.Trim().Length == 0 && Fields[index].Required)
+ {
+ Fields[index].Error = true;
+ Fields[index].ErrorText = "内容を入力してください。";
+ return false;
+ }
+
+ //入力文字判断
+ if (!IsCorrectValue(index, inputText)) { return false; }
+
+ //日付判断
+ if (Fields[index].InputStyle == SystemEnum.EInputStyle.Date)
+ {
+ if (!CConvert.IsDate(CConvert.ToInt(inputText.Replace("/", string.Empty).Replace("-", string.Empty)).ToString().PadLeft(8, '0')))
+ {
+ Fields[index].Error = true;
+ Fields[index].ErrorText = "正しい日付を入力してください。";
+ return false;
+ }
+ }
+
+ //範囲判断
+ if (Fields[index].Range.Length > 0)
+ {
+ if (CConvert.IsOutOfRange(inputText, Fields[index].Range))
+ {
+ Fields[index].Error = true;
+ Fields[index].ErrorText = "入力範囲以外です。";
+ return false;
+ }
+ }
+ return true;
+ }
+
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+
+ public void Add(ValidField field)
+ {
+ field.Index = Fields.Count;
+ Fields.Add(field);
+ dict.Add(field.Name, field);
+ if (field.GridFilter) { FilterFields.Add(field.Name); }
+ if (field.GridOrder > 0) { OrderFields.Add(field.GridOrder, field.Name); }
+ }
+
+ public void RemoveAt(int index)
+ {
+ string key = Fields[index].Name;
+ if (Fields[index].GridFilter) { FilterFields.Remove(key); }
+ if (Fields[index].GridOrder > 0) { OrderFields.Remove(Fields[index].GridOrder); }
+ dict.Remove(key);
+ Fields.RemoveAt(index);
+ for (int i = index; i < Fields.Count; i++) { Fields[i].Index -= 1; }
+ }
+
+ public void Remove(ValidField field)
+ {
+ RemoveAt(field.Index);
+ }
+
+ public void Remove(string key)
+ {
+ ValidField field = dict[key];
+ RemoveAt(field.Index);
+ }
+
+ public ValidField GetField(string key)
+ {
+ return dict[key];
+ }
+
+ public void SetField(string key, string value)
+ {
+ dict[key].Text = value;
+ }
+
+ public void SetField(string key, string value, string disp)
+ {
+ dict[key].Text = value;
+ dict[key].DispText = disp;
+ }
+
+ public void Clear()
+ {
+ ErrText = string.Empty;
+ EnterPush = false;
+ ArrowUpPush = false;
+
+ foreach (ValidField field in Fields)
+ {
+ field.Clear();
+ }
+ }
+
+ public async Task<bool> IsValidAll()
+ {
+ try
+ {
+ ErrText = string.Empty;
+ foreach (ValidField field in Fields)
+ {
+ string text = field.Text;
+ if (!IsCorrectText(field.Index, text, false))
+ {
+ ErrText = field.ErrorText;
+ return false;
+ }
+
+ if (BusinessValid != null)
+ {
+ ValidEventArgs e = new ValidEventArgs() { Text = text, IsAll = true };
+ if (!await BusinessValid(field, e))
+ {
+ ErrText = field.ErrorText;
+ return false;
+ }
+ }
+ }
+
+ return true;
+ }
+ catch
+ {
+ return false;
+ }
+ finally
+ {
+ if (ErrText.Length > 0 && ErrRefresh != null) { ErrRefresh(); }
+ }
+ }
+
+ #endregion
+
+ }
+}
diff --git a/HotelPms.Client.Blazor/_Imports.razor b/HotelPms.Client.Blazor/_Imports.razor
new file mode 100644
index 0000000..59fa665
--- /dev/null
+++ b/HotelPms.Client.Blazor/_Imports.razor
@@ -0,0 +1,19 @@
+@using System.Net.Http
+@using System.Net.Http.Json
+@using Microsoft.AspNetCore.Components.Forms
+@using Microsoft.AspNetCore.Components.Routing
+@using Microsoft.AspNetCore.Components.Web
+@using Microsoft.AspNetCore.Components.Web.Virtualization
+@using Microsoft.AspNetCore.Components.WebAssembly.Http
+@using Microsoft.JSInterop
+@using MudBlazor
+@using HotelPms.Client.Blazor
+@using HotelPms.Client.Blazor.Shared
+@using Grpc.Net.Client
+@using System.Data
+@using HotelPms.Data
+@using HotelPms.Data.Client
+@using HotelPms.DataAccessGrpc.Client
+@using HotelPms.Client.Blazor.Dialog
+@using HotelPms.Client.Blazor.Util
+@using HotelPms.Share.Util
\ No newline at end of file
diff --git a/HotelPms.Client.Blazor/wwwroot/appsettings.json b/HotelPms.Client.Blazor/wwwroot/appsettings.json
new file mode 100644
index 0000000..c96af9d
--- /dev/null
+++ b/HotelPms.Client.Blazor/wwwroot/appsettings.json
@@ -0,0 +1,11 @@
+{
+ // Explicit backend URL (override current site)
+ //"BackendUrl": "https://133.125.63.43:9527",
+ //"SubDir": "/grpc"
+ "BackgroundImage": "/bg1.jpg",
+ //"BackendUrl": "https://localhost:7240",
+ //"SubDir": "",
+ "BackendUrl": "https://ginbow.eu.org",
+ "SubDir": "/grpc",
+ "SiteSubDir": "/"
+}
diff --git a/HotelPms.Client.Blazor/wwwroot/bg1.jpg b/HotelPms.Client.Blazor/wwwroot/bg1.jpg
new file mode 100644
index 0000000..c4d3b13
--- /dev/null
+++ b/HotelPms.Client.Blazor/wwwroot/bg1.jpg
Binary files differ
diff --git a/HotelPms.Client.Blazor/wwwroot/css/laststyle.css b/HotelPms.Client.Blazor/wwwroot/css/laststyle.css
new file mode 100644
index 0000000..231dd8e
--- /dev/null
+++ b/HotelPms.Client.Blazor/wwwroot/css/laststyle.css
@@ -0,0 +1,33 @@
+/* 伪类选择器 :focus-within */
+/* 它表示一个元素获得焦点,或,该元素的后代元素获得焦点。划重点,它或它的后代获得焦点。 */
+/* 这也就意味着,它或它的后代获得焦点,都可以触发 :focus-within。 */
+.focus-button:focus-within {
+ border: 1px solid;
+ border-color: #00FF00;
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(0, 255, 0, 0.6);
+ -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(0, 255, 0, 0.6);
+ box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.075), 0px 0px 8px rgba(0, 255, 0, 0.6);
+}
+
+.input-pink > div > .mud-input.mud-input-underline:after {
+ border-bottom: 2px solid #ff1493;
+}
+
+.input-center > .mud-input-control-input-container > div > input {
+ text-align: center;
+}
+
+.input-right > .mud-input-control-input-container > div > input {
+ text-align: right;
+}
+
+.edit-grid .mud-input.mud-input-underline:before {
+ left: 0;
+ right: 0;
+ bottom: 0;
+ content: " ";
+ position: absolute;
+ transition: border-bottom .2s,background-color .2s;
+ border-bottom: 0px solid var(--mud-palette-lines-inputs);
+ pointer-events: none;
+}
\ No newline at end of file
diff --git a/HotelPms.Client.Blazor/wwwroot/css/site.css b/HotelPms.Client.Blazor/wwwroot/css/site.css
new file mode 100644
index 0000000..2a6ea05
--- /dev/null
+++ b/HotelPms.Client.Blazor/wwwroot/css/site.css
@@ -0,0 +1,143 @@
+@import url('https://fonts.googleapis.com/css2?family=Reggae+One&display=swap');
+
+.loading-logo svg {
+ width: 1000px;
+ height: 350px;
+ margin: auto;
+}
+
+.loading-logo svg text {
+ text-transform: uppercase;
+ animation: stroke 5s infinite alternate;
+ letter-spacing: 10px;
+ font-family: 'Reggae One', CenturyGothic, "AppleGothic", sans-serif;
+ font-size: 100px;
+}
+
+@keyframes stroke {
+ 0% {
+ fill: rgba(255, 0, 0, 0);
+ stroke: rgba(0, 255, 0, 1);
+ stroke-dashoffset: 25%;
+ stroke-dasharray: 0 50%;
+ stroke-width: 1;
+ }
+
+ 50% {
+ fill: rgba(255, 0, 0, 0);
+ stroke: rgba(0, 255, 0, 1);
+ stroke-width: 2;
+ }
+
+ 70% {
+ fill: rgba(255, 0, 0, 0);
+ stroke: rgba(0, 255, 0, 1);
+ stroke-width: 3;
+ }
+
+ 90%, 100% {
+ fill: rgba(255, 0, 0, 1);
+ stroke: rgba(0, 255, 0, 0);
+ stroke-dashoffset: -25%;
+ stroke-dasharray: 50% 0;
+ stroke-width: 0;
+ }
+}
+
+#globalLoadingSpinnerBg, #globalLoadingSpinner, #globalLoadingSpinner0 {
+ display: none;
+}
+
+.loading #globalLoadingSpinnerBg {
+ display: block;
+ opacity: .5;
+ position: fixed;
+ top: 0;
+ left: 0;
+ z-index: 9998;
+ width: 100vw;
+ height: 100vh;
+ background-color: #000;
+ transition: opacity .15s linear;
+ box-sizing: border-box;
+}
+
+.loading-logo #globalLoadingSpinner0 {
+ display: flex;
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100%;
+ z-index: 9999;
+}
+
+.loading #globalLoadingSpinner {
+ display: flex;
+ position: fixed;
+ top: 0;
+ left: 0;
+ z-index: 9999;
+ width: 100%;
+ height: 100%;
+ overflow-x: hidden;
+ overflow-y: auto;
+ outline: 0;
+ transition: opacity .15s linear;
+ box-sizing: border-box;
+}
+
+.global-text-primary {
+ color: #0d6efd !important;
+}
+
+.global-text-secondary {
+ color: #6c757d !important;
+}
+
+.global-text-success {
+ color: #198754 !important;
+}
+
+.global-text-danger {
+ color: #dc3545 !important;
+}
+
+.global-text-warning {
+ color: #ffc107 !important;
+}
+
+.global-text-light {
+ color: #0dcaf0 !important;
+}
+
+.global-text-info {
+ color: #f8f9fa !important;
+}
+
+.global-text-dark {
+ color: #212529 !important;
+}
+
+.global-spinner-grow {
+ display: inline-block;
+ width: 2rem;
+ height: 2rem;
+ vertical-align: -.125em;
+ background-color: currentColor;
+ border-radius: 50%;
+ opacity: 0;
+ -webkit-animation: .75s linear infinite spinner-grow;
+ animation: .75s linear infinite spinner-grow;
+ box-sizing: border-box;
+}
+
+@keyframes spinner-grow {
+ 0% {
+ transform: scale(0);
+ }
+
+ 50% {
+ opacity: 1;
+ transform: none;
+ }
+}
diff --git a/HotelPms.Client.Blazor/wwwroot/favicon.ico b/HotelPms.Client.Blazor/wwwroot/favicon.ico
new file mode 100644
index 0000000..5cecfe6
--- /dev/null
+++ b/HotelPms.Client.Blazor/wwwroot/favicon.ico
Binary files differ
diff --git a/HotelPms.Client.Blazor/wwwroot/icon-192.png b/HotelPms.Client.Blazor/wwwroot/icon-192.png
new file mode 100644
index 0000000..59ab776
--- /dev/null
+++ b/HotelPms.Client.Blazor/wwwroot/icon-192.png
Binary files differ
diff --git a/HotelPms.Client.Blazor/wwwroot/icon-512.png b/HotelPms.Client.Blazor/wwwroot/icon-512.png
new file mode 100644
index 0000000..ae1d4ba
--- /dev/null
+++ b/HotelPms.Client.Blazor/wwwroot/icon-512.png
Binary files differ
diff --git a/HotelPms.Client.Blazor/wwwroot/images/AdminDashboardTemplate.png b/HotelPms.Client.Blazor/wwwroot/images/AdminDashboardTemplate.png
new file mode 100644
index 0000000..7bcc2a6
--- /dev/null
+++ b/HotelPms.Client.Blazor/wwwroot/images/AdminDashboardTemplate.png
Binary files differ
diff --git a/HotelPms.Client.Blazor/wwwroot/images/FrontGateWay.jpg b/HotelPms.Client.Blazor/wwwroot/images/FrontGateWay.jpg
new file mode 100644
index 0000000..3583c93
--- /dev/null
+++ b/HotelPms.Client.Blazor/wwwroot/images/FrontGateWay.jpg
Binary files differ
diff --git a/HotelPms.Client.Blazor/wwwroot/images/avatar_jonny.jpg b/HotelPms.Client.Blazor/wwwroot/images/avatar_jonny.jpg
new file mode 100644
index 0000000..62d7713
--- /dev/null
+++ b/HotelPms.Client.Blazor/wwwroot/images/avatar_jonny.jpg
Binary files differ
diff --git a/HotelPms.Client.Blazor/wwwroot/images/logo_foot.gif b/HotelPms.Client.Blazor/wwwroot/images/logo_foot.gif
new file mode 100644
index 0000000..a9c6f91
--- /dev/null
+++ b/HotelPms.Client.Blazor/wwwroot/images/logo_foot.gif
Binary files differ
diff --git a/HotelPms.Client.Blazor/wwwroot/images/yado-oh-pro.jpg b/HotelPms.Client.Blazor/wwwroot/images/yado-oh-pro.jpg
new file mode 100644
index 0000000..e9c9370
--- /dev/null
+++ b/HotelPms.Client.Blazor/wwwroot/images/yado-oh-pro.jpg
Binary files differ
diff --git a/HotelPms.Client.Blazor/wwwroot/index.html b/HotelPms.Client.Blazor/wwwroot/index.html
new file mode 100644
index 0000000..12b3916
--- /dev/null
+++ b/HotelPms.Client.Blazor/wwwroot/index.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<html lang="ja">
+
+<head>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
+ <meta http-equiv="X-UA-Compatible" content="ie=edge">
+ <title>ホテルPMSシステム</title>
+ <base Href="/" />
+ <!--<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" rel="stylesheet" /> -->
+ <link href="_content/MudBlazor/MudBlazor.min.css" rel="stylesheet" />
+ <link href="css/laststyle.css" rel="stylesheet" />
+ <link href="css/site.css" rel="stylesheet" />
+ <link href="manifest.json" rel="manifest" />
+ <link rel="apple-touch-icon" sizes="64x64" href="icon-512.png" />
+ <link href="HotelPms.Client.Blazor.styles.css" rel="stylesheet">
+</head>
+
+<body class="loading loading-logo" style="overflow-x:hidden">
+ <div id="globalLoadingSpinnerBg"></div>
+ <div id="globalLoadingSpinner0">
+ <div style="margin-top: 50px; margin-inline: auto;">
+ <svg viewBox="0 0 400 200">
+ <text x="0" y="70%">GinBow</text>
+ </svg>
+ </div>
+ </div>
+ <div id="globalLoadingSpinner">
+ <div style="margin: auto;">
+ <div class="global-spinner-grow global-text-primary" role="status"></div>
+ <div class="global-spinner-grow global-text-secondary" role="status"></div>
+ <div class="global-spinner-grow global-text-success" role="status"></div>
+ <div class="global-spinner-grow global-text-danger" role="status"></div>
+ <div class="global-spinner-grow global-text-warning" role="status"></div>
+ <div class="global-spinner-grow global-text-info" role="status"></div>
+ <div class="global-spinner-grow global-text-light" role="status"></div>
+ <div class="global-spinner-grow global-text-dark" role="status"></div>
+ </div>
+ </div>
+ <div id="app"></div>
+ <div id="blazor-error-ui">
+ An unhandled error has occurred.
+ <a href="" class="reload">Reload</a>
+ <a class="dismiss">🗙</a>
+ </div>
+ <script src="_framework/blazor.webassembly.js"></script>
+ <script src="_content/MudBlazor/MudBlazor.min.js"></script>
+ <script src="js/NetCallJs.js"></script>
+ <script src="js/InputCore.js"></script>
+ <!--<script src="js/browser-resize.js"></script>-->
+</body>
+
+</html>
\ No newline at end of file
diff --git a/HotelPms.Client.Blazor/wwwroot/js/InputCore.js b/HotelPms.Client.Blazor/wwwroot/js/InputCore.js
new file mode 100644
index 0000000..2b5972e
--- /dev/null
+++ b/HotelPms.Client.Blazor/wwwroot/js/InputCore.js
@@ -0,0 +1,187 @@
+class JValidField {
+ constructor(el) {
+ this.Guid = el.dataset.guid;
+ this.Index = parseInt(el.dataset.validIndex);
+ this.Name = el.dataset.validName;
+ this.OrgText = el.dataset.validOrgText;
+ this.Text = el.dataset.validText;
+ this.InputChar = parseInt(el.dataset.validInputChar);
+ this.ShowStyle = parseInt(el.dataset.validShowStyle);
+ this.ThousandFormat = el.dataset.validThousandFormat;
+ }
+};
+
+/*
+*画面(部品)単位のViewModel管理
+*想定シナリオ
+*1.C# Blazor側でViewModelにViewModel生成、GuidやValidFieldを<input>の属性にセットする
+*2.OnAfterRenderAsyncのfirstRenderでInputCoreのinit(Guid)を呼出し
+*3.InputCoreのinit(Guid)に、JViewModelを生成し、<input>の属性よりValidFieldを生成し、入力制御を行う
+*4.C# Blazor側Page OR 部品 Dispose時に、InputCoreのdispose(Guid)を呼出し、廃棄する
+*/
+class JViewModel {
+ constructor(guid) {
+ this.Guid = guid
+ this.Fields = [];
+ this.FieldMap = new Map();
+ }
+
+ add(field) {
+ this.Fields.push(field);
+ this.FieldMap.set(field.Name, field);
+ }
+
+ static create(guid) {
+ return new JViewModel(guid);
+ }
+};
+
+/*
+* IMEモードなし状態:
+* 通常文字入力:keydown⇒keypress⇒input⇒keyup
+* Enter:keydown⇒keypress⇒change(※文字変更あった場合)⇒keyup
+* Tab:keydown⇒blur⇒focus(次)⇒keyup
+* ※その場合、入力文字毎制限はinputに行う
+* IMEモード状態:ひらがな
+* 通常文字入力:compositionstart⇒複数回keydown⇒input⇒keyup⇒compositionend
+* ※その場合、入力文字毎制限はcompositionendに行う
+* 全部入力内容のチェックタイミングはblurで行う
+* Up、End、Enterの判断はKeyUpの信頼度は一番高い、又Enterのみはkeypressでも可能です。
+*
+* フォーカス移動、全部チェックのため、viewFieldsの配列が必要です。
+*/
+class InputCore {
+ constructor() {
+ this.viewModelMap = new Map();
+ }
+
+ static filter(e) {
+ let index = parseInt(e.target.dataset.validIndex);
+ let field = window.inputCore.viewModelMap.get(e.target.dataset.guid).Fields[index];
+
+ if (field.InputChar == 1) { return; }
+
+ let v = e.target.value;
+
+ // 全角数字変換
+ if ((field.InputChar & 0x02) == 0x02) {
+ v = v.replace(/[0-9]/g, function (x) { return String.fromCharCode(x.charCodeAt(0) - 0xFEE0) });
+ }
+
+ let limitChar = '[^';
+ if ((field.InputChar & 0x02) == 0x02) { limitChar += '0-9'; } //数字
+ if ((field.InputChar & 0x04) == 0x04) { limitChar += 'a-z'; } //小アルファベット
+ if ((field.InputChar & 0x08) == 0x08) { limitChar += 'A-Z'; } //大アルファベット
+ if ((field.InputChar & 0x10) == 0x10) { limitChar += 'ヲ-゚'; } //カナ
+ if ((field.InputChar & 0x200) == 0x200) { limitChar += ' '; } // [space]
+ if ((field.InputChar & 0x400) == 0x400) { limitChar += ':'; } // :
+ if ((field.InputChar & 0x800) == 0x800) { limitChar += '-'; } // -
+ if ((field.InputChar & 0x2000) == 0x2000) { limitChar += '.'; } // .
+ if ((field.InputChar & 0x4000) == 0x4000) { limitChar += '/'; } // /
+ if ((field.InputChar & 0x8000) == 0x8000) { limitChar += ','; } // ,
+ limitChar += ']';
+ var re = new RegExp(limitChar,'g');
+ v = v.replace(re, '');
+
+ //let v = e.target.value
+ // .replace(/[0-9]/g, function (x) { return String.fromCharCode(x.charCodeAt(0) - 0xFEE0) })
+ // .replace(/[^0-9,.-]/g, '');
+ //.replace(/[0-9a-zA-Z]/g, function(x){ return String.fromCharCode(x.charCodeAt(0) - 0xFEE0) })
+ //.replace(/[^0-9a-zA-Z]/g, '');
+
+ //.replace(/[^0-9]/g, '')
+ e.target.value = v;
+ }
+
+ dispose(guid) {
+ try {
+ viewModelMap.delete(guid);
+ } catch(err) {
+ console.log(err);
+ }
+ }
+
+ init(guid) {
+ let viewModel = new JViewModel(guid);
+ let key = `[data-guid="${guid}"]`;
+ var list = document.querySelectorAll(key);
+ list.forEach(item => {
+ let field = new JValidField(item);
+ viewModel.add(field);
+ });
+ this.viewModelMap.set(guid, viewModel);
+
+ viewModel.Fields.forEach(item => {
+ let id = `${guid}-${item.Index}`;
+ var obj = document.getElementById(id);
+ obj.addEventListener('focus', function (e) {
+ console.log('focus', e.target.value, e.target.dataset.validName);
+ let index = parseInt(e.target.dataset.validIndex);
+ let field = window.inputCore.viewModelMap.get(e.target.dataset.guid).Fields[index];
+ field.OrgText = e.target.value;
+ if (((field.ShowStyle & 0x04) == 0x04) && e.target.value.length > 0) {
+ e.target.value = e.target.value.replace(",", "");
+ }
+
+ DotNet.invokeMethodAsync('HotelPms.Client.Blazor', 'InputCoreEvent', { ID: e.target.dataset.guid, Index: index, Name: e.target.dataset.validName, EventName: "focus", Key: "", OrgText: field.OrgText, Text: e.target.value })
+ .then(data => {
+ console.log(JSON.stringify(data));
+ });
+ });
+ obj.addEventListener('blur', function (e) {
+ console.log('blur', e.target.value, e.target.dataset.validName);
+ let index = parseInt(e.target.dataset.validIndex);
+ var field = window.inputCore.viewModelMap.get(e.target.dataset.guid).Fields[index];
+ DotNet.invokeMethodAsync('HotelPms.Client.Blazor', 'InputCoreEvent', { ID: e.target.dataset.guid, Index: index, Name: e.target.dataset.validName, EventName: "blur", Key: "", OrgText: field.OrgText, Text: e.target.value })
+ .then(data => {
+ console.log(JSON.stringify(data));
+ e.target.value = data.text;
+ });
+
+ });
+ obj.addEventListener('keyup', function (e) {
+ console.log('keyup', e.target.value, e.key, e.target.dataset.validName);
+
+ if (e.key === "Enter" || e.key === "ArrowUp" || e.key === "End") {
+ e.preventDefault();
+ e.stopPropagation();
+ let index = parseInt(e.target.dataset.validIndex);
+ var field = window.inputCore.viewModelMap.get(e.target.dataset.guid).Fields[index];
+ DotNet.invokeMethodAsync('HotelPms.Client.Blazor', 'InputCoreEvent', { ID: e.target.dataset.guid, Index: index, Name: e.target.dataset.validName, EventName: "keyup", Key: e.key, OrgText: field.OrgText, Text: e.target.value })
+ .then(data => {
+ console.log(JSON.stringify(data));
+
+ field.OrgText = data.orgText;
+ e.target.value = data.text;
+ if (data.nextFocus.length > 0) {
+ let nextInput = document.getElementById(data.nextFocus);
+ nextInput.focus();
+ nextInput.select();
+ }
+ });
+ }
+ });
+ obj.addEventListener('keypress', function (e) {
+ console.log('keypress', e.target.value, e.key, e.target.dataset.validName);
+ });
+ obj.addEventListener('keydown', function (e) {
+ console.log('keydown', e.target.value, e.key, e.target.dataset.validName);
+ });
+ obj.addEventListener('change', function (e) {
+ console.log('change', e.target.value, e.key, e.target.dataset.validName);
+ });
+ obj.addEventListener('input', function (e) {
+ console.log('input', e.target.value, e.key, e.target.dataset.validName, e.isComposing);
+ if (!e.isComposing) { InputCore.filter(e); }
+ });
+ obj.addEventListener('compositionstart', function (e) {
+ console.log('compositionstart', e.target.value, e.target.dataset.validName);
+ });
+ obj.addEventListener('compositionend', function (e) {
+ console.log('compositionend', e.target.value, e.target.dataset.validName);
+ InputCore.filter(e);
+ });
+ });
+ }
+};
+window.inputCore = new InputCore();
diff --git a/HotelPms.Client.Blazor/wwwroot/js/NavMenuFix.js b/HotelPms.Client.Blazor/wwwroot/js/NavMenuFix.js
new file mode 100644
index 0000000..740b9ac
--- /dev/null
+++ b/HotelPms.Client.Blazor/wwwroot/js/NavMenuFix.js
@@ -0,0 +1,3 @@
+export function inactiveA() {
+ document.querySelector("a.active")?.classList.remove("active");
+}
\ No newline at end of file
diff --git a/HotelPms.Client.Blazor/wwwroot/js/NetCallJs.js b/HotelPms.Client.Blazor/wwwroot/js/NetCallJs.js
new file mode 100644
index 0000000..9233785
--- /dev/null
+++ b/HotelPms.Client.Blazor/wwwroot/js/NetCallJs.js
@@ -0,0 +1,153 @@
+window.NetCallJs = {
+ delTableCol: function (parentID, columnId) {
+ try {
+ const owner = document.querySelector("#" + parentID);
+ if (owner == null) { return; }
+ const tab = owner.querySelector("table");
+ var rows = tab.rows;
+ if (rows == null) { return; }
+ var columnLength = rows.item(0).cells.length;
+ if (columnLength > columnId) {
+ for (var i = 0; i < tab.rows.length; i++) {
+ tab.rows[i].deleteCell(columnId);
+ }
+ }
+ }
+ catch (error) {
+ console.log(error);
+ }
+ },
+
+ setTableWidth: function (parentID, w) {
+ const owner = document.querySelector("#" + parentID);
+ const table = owner.querySelector("table");
+ table.setAttribute('style', 'table-layout: fixed;');
+ table.style.width = w;
+ },
+
+ setTableStyle: function (parentID, s) {
+ const owner = document.querySelector("#" + parentID);
+ const table = owner.querySelector("table");
+ table.setAttribute('style', s);
+ },
+
+ removeTableClass: function (parentID, s) {
+ const owner = document.querySelector("#" + parentID);
+ const table = owner.querySelector("table");
+ table.classList.remove(s);
+ },
+
+ setTRTop: function (parentID, i) {
+ const owner = document.querySelector("#" + parentID);
+ const scrollParent = owner.querySelector(".mud-table-container");
+ const tr = scrollParent.querySelectorAll("tr")[i];
+ scrollParent.scrollTop = tr.offsetTop;
+ },
+
+ clearA: function () {
+ document.querySelector("a.active")?.classList.remove("active");
+ },
+
+ hideGlobalLoadingSpinner: function () {
+ document.body.classList.remove('loading');
+ },
+
+ hideGlobalLoadingSpinnerLogo: function () {
+ document.body.classList.remove('loading-logo');
+ },
+
+ showGlobalLoadingSpinner: function () {
+ document.body.classList.add('loading');
+ },
+
+ removeCss: function (el, cssName) {
+ el.classList.remove(cssName);
+ },
+
+ getClientRectByID: function (elementId) {
+ return document.getElementById(elementId).getBoundingClientRect();
+ },
+
+ getClientRect: function (el) {
+ return el.getBoundingClientRect();
+ },
+
+ getScroll: function (el) {
+ return {
+ scrollTop: el.scrollTop,
+ scrollLeft: el.scrollLeft,
+ windowWidth: window.innerWidth,
+ windowHeight: window.innerHeight
+ };
+ },
+
+ getWindowSize: function () {
+ return {
+ width: window.innerWidth,
+ height: window.innerHeight
+ };
+ },
+
+ getInputValue: function (el) {
+ return el.value;
+ },
+
+ setInputValue: function (el, text) {
+ el.value = text;
+ },
+
+ getActiveElement: function () {
+ const el = document.activeElement;
+ return {
+ id: el.id,
+ tagName: el.tagName
+ };
+ },
+
+ setFocusByKey: function (key) {
+ const el = document.querySelector(key);
+ el.focus();
+ },
+
+ saveAsFile: function (fileName, type, bytesBase64, useBom) {
+ var browser = 0; // for Safari
+ if (window.navigator.msSaveBlob) {
+ browser = 1; // for IE、Edge
+ } else if (window.webkitURL && window.webkitURL.createObjectURL) {
+ browser = 3; // Chrome
+ } else if (window.URL && window.URL.createObjectURL) {
+ browser = 2; //Firefox、Chromeでも行く
+ }
+
+ if (browser > 0) {
+ var data = window.atob(bytesBase64);
+ var content = new Uint8Array(data.length);
+ for (var i = 0; i < data.length; i++) {
+ content[i] = data.charCodeAt(i);
+ }
+ var bom = new Uint8Array([0xEF, 0xBB, 0xBF]);
+ //var blob = new Blob([bom, content], { type: type });
+ var blob = useBom ? new Blob([bom, content], { type: type }) : new Blob([content.buffer], { type: type });
+
+ if (browser === 1) {
+ window.navigator.msSaveBlob(blob, fileName)
+ } else {
+ var a = document.createElement('a');
+ a.download = fileName;
+ a.target = '_blank';
+
+ if (browser === 2) {
+ a.href = window.URL.createObjectURL(blob);
+ document.body.appendChild(a);
+ a.click();
+ document.body.removeChild(a);
+ } else {
+ a.href = window.webkitURL.createObjectURL(blob);
+ a.click();
+ }
+ }
+ } else {
+ window.open('data:' + type + ';base64,' + bytesBase64, '_blank');
+ }
+ }
+};
\ No newline at end of file
diff --git a/HotelPms.Client.Blazor/wwwroot/js/browser-resize-cls.js b/HotelPms.Client.Blazor/wwwroot/js/browser-resize-cls.js
new file mode 100644
index 0000000..38e4b58
--- /dev/null
+++ b/HotelPms.Client.Blazor/wwwroot/js/browser-resize-cls.js
@@ -0,0 +1,18 @@
+window.browserResize = {
+ getInnerHeight: function () {
+ return window.innerHeight;
+ },
+ getInnerWidth: function () {
+ return window.innerWidth;
+ },
+ registerResizeCallback: function () {
+ window.addEventListener("resize", browserResize.resized);
+ },
+ resized: function () {
+ try {
+ //DotNet.invokeMethod("BrowserResize", 'OnBrowserResize');
+ DotNet.invokeMethodAsync("HotelPms.Client.Blazor", 'OnBrowserResize').then(data => data);
+ }
+ catch { }
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.Client.Blazor/wwwroot/js/browser-resize.js b/HotelPms.Client.Blazor/wwwroot/js/browser-resize.js
new file mode 100644
index 0000000..29df3e1
--- /dev/null
+++ b/HotelPms.Client.Blazor/wwwroot/js/browser-resize.js
@@ -0,0 +1,24 @@
+export function getInnerHeight() {
+ return window.innerHeight;
+}
+
+export function getInnerWidth() {
+ return window.innerWidth;
+}
+
+export function resized() {
+ try {
+ //DotNet.invokeMethod("BrowserResize", 'OnBrowserResize');
+ DotNet.invokeMethodAsync("HotelPms.Client.Blazor", 'OnBrowserResize').then(data => data);
+ }
+ catch { }
+}
+
+export function registerResizeCallback() {
+ window.addEventListener("resize", resized);
+}
+
+export function removeResizeCallback() {
+ window.removeEventListener("resize", resized);
+}
+
diff --git a/HotelPms.Client.Blazor/wwwroot/manifest.json b/HotelPms.Client.Blazor/wwwroot/manifest.json
new file mode 100644
index 0000000..de69efd
--- /dev/null
+++ b/HotelPms.Client.Blazor/wwwroot/manifest.json
@@ -0,0 +1,21 @@
+{
+ "name": "HotelPms.Client.Blazor",
+ "short_name": "HotelPms.Client.Blazor",
+ "start_url": "./",
+ "display": "standalone",
+ "background_color": "#ffffff",
+ "theme_color": "#03173d",
+ "prefer_related_applications": false,
+ "icons": [
+ {
+ "src": "icon-512.png",
+ "type": "image/png",
+ "sizes": "64x64"
+ },
+ {
+ "src": "icon-192.png",
+ "type": "image/png",
+ "sizes": "192x192"
+ }
+ ]
+}
diff --git a/HotelPms.Client.Blazor/wwwroot/sample-data/1.pdf b/HotelPms.Client.Blazor/wwwroot/sample-data/1.pdf
new file mode 100644
index 0000000..f95daa3
--- /dev/null
+++ b/HotelPms.Client.Blazor/wwwroot/sample-data/1.pdf
Binary files differ
diff --git a/HotelPms.Client.Blazor/wwwroot/sample-data/2.pdf b/HotelPms.Client.Blazor/wwwroot/sample-data/2.pdf
new file mode 100644
index 0000000..f2ba62f
--- /dev/null
+++ b/HotelPms.Client.Blazor/wwwroot/sample-data/2.pdf
Binary files differ
diff --git a/HotelPms.Client.Blazor/wwwroot/sample-data/sample.pdf b/HotelPms.Client.Blazor/wwwroot/sample-data/sample.pdf
new file mode 100644
index 0000000..9f56b3f
--- /dev/null
+++ b/HotelPms.Client.Blazor/wwwroot/sample-data/sample.pdf
Binary files differ
diff --git a/HotelPms.Client.Blazor/wwwroot/sample-data/weather.json b/HotelPms.Client.Blazor/wwwroot/sample-data/weather.json
new file mode 100644
index 0000000..06463c0
--- /dev/null
+++ b/HotelPms.Client.Blazor/wwwroot/sample-data/weather.json
@@ -0,0 +1,27 @@
+[
+ {
+ "date": "2018-05-06",
+ "temperatureC": 1,
+ "summary": "Freezing"
+ },
+ {
+ "date": "2018-05-07",
+ "temperatureC": 14,
+ "summary": "Bracing"
+ },
+ {
+ "date": "2018-05-08",
+ "temperatureC": -13,
+ "summary": "Freezing"
+ },
+ {
+ "date": "2018-05-09",
+ "temperatureC": -16,
+ "summary": "Balmy"
+ },
+ {
+ "date": "2018-05-10",
+ "temperatureC": -2,
+ "summary": "Chilly"
+ }
+]
diff --git a/HotelPms.Client.Blazor/wwwroot/service-worker.js b/HotelPms.Client.Blazor/wwwroot/service-worker.js
new file mode 100644
index 0000000..fe614da
--- /dev/null
+++ b/HotelPms.Client.Blazor/wwwroot/service-worker.js
@@ -0,0 +1,4 @@
+// In development, always fetch from the network and do not enable offline support.
+// This is because caching would make development more difficult (changes would not
+// be reflected on the first load after each change).
+self.addEventListener('fetch', () => { });
diff --git a/HotelPms.Client.Blazor/wwwroot/service-worker.published.js b/HotelPms.Client.Blazor/wwwroot/service-worker.published.js
new file mode 100644
index 0000000..0d9986f
--- /dev/null
+++ b/HotelPms.Client.Blazor/wwwroot/service-worker.published.js
@@ -0,0 +1,48 @@
+// Caution! Be sure you understand the caveats before publishing an application with
+// offline support. See https://aka.ms/blazor-offline-considerations
+
+self.importScripts('./service-worker-assets.js');
+self.addEventListener('install', event => event.waitUntil(onInstall(event)));
+self.addEventListener('activate', event => event.waitUntil(onActivate(event)));
+self.addEventListener('fetch', event => event.respondWith(onFetch(event)));
+
+const cacheNamePrefix = 'offline-cache-';
+const cacheName = `${cacheNamePrefix}${self.assetsManifest.version}`;
+const offlineAssetsInclude = [ /\.dll$/, /\.pdb$/, /\.wasm/, /\.html/, /\.js$/, /\.json$/, /\.css$/, /\.woff$/, /\.png$/, /\.jpe?g$/, /\.gif$/, /\.ico$/, /\.blat$/, /\.dat$/ ];
+const offlineAssetsExclude = [ /^service-worker\.js$/ ];
+
+async function onInstall(event) {
+ console.info('Service worker: Install');
+
+ // Fetch and cache all matching items from the assets manifest
+ const assetsRequests = self.assetsManifest.assets
+ .filter(asset => offlineAssetsInclude.some(pattern => pattern.test(asset.url)))
+ .filter(asset => !offlineAssetsExclude.some(pattern => pattern.test(asset.url)))
+ .map(asset => new Request(asset.url, { integrity: asset.hash, cache: 'no-cache' }));
+ await caches.open(cacheName).then(cache => cache.addAll(assetsRequests));
+}
+
+async function onActivate(event) {
+ console.info('Service worker: Activate');
+
+ // Delete unused caches
+ const cacheKeys = await caches.keys();
+ await Promise.all(cacheKeys
+ .filter(key => key.startsWith(cacheNamePrefix) && key !== cacheName)
+ .map(key => caches.delete(key)));
+}
+
+async function onFetch(event) {
+ let cachedResponse = null;
+ if (event.request.method === 'GET') {
+ // For all navigation requests, try to serve index.html from cache
+ // If you need some URLs to be server-rendered, edit the following check to exclude those URLs
+ const shouldServeIndexHtml = event.request.mode === 'navigate';
+
+ const request = shouldServeIndexHtml ? 'index.html' : event.request;
+ const cache = await caches.open(cacheName);
+ cachedResponse = await cache.match(request);
+ }
+
+ return cachedResponse || fetch(event.request);
+}
diff --git a/HotelPms.Data.Client/GrpcClient.cs b/HotelPms.Data.Client/GrpcClient.cs
new file mode 100644
index 0000000..c99a6bd
--- /dev/null
+++ b/HotelPms.Data.Client/GrpcClient.cs
@@ -0,0 +1,173 @@
+using HotelPms.Data.Common;
+using HotelPms.Share.Util;
+using Grpc.Core;
+using Grpc.Net.Client;
+using System;
+using System.Threading.Tasks;
+
+namespace HotelPms.Data.Client
+{
+ public class GrpcClient
+ {
+ /// <summary>
+ /// データ要求生成
+ /// </summary>
+ /// <param name="actionType"></param>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public static DataRequest CreateDataRequest(int actionType, string data)
+ {
+ return new DataRequest
+ {
+ ActionType = actionType,
+ Data = data,
+ CustomerID = "001",
+ LoginID = "sa",
+ Password = "123",
+ SystemID = 1,
+ RefTables = string.Empty,
+ IP = "127.0.0.1",
+ MachineName = Environment.MachineName,
+ OS = Environment.OSVersion.ToString()
+ };
+ }
+
+ /// <summary>
+ /// TableのgRPCクライアント
+ /// </summary>
+ /// <param name="channel"></param>
+ /// <returns></returns>
+ public static GrpcTableCore.GrpcTableCoreClient CreateTableClient(GrpcChannel channel)
+ {
+ return new GrpcTableCore.GrpcTableCoreClient(channel);
+ }
+
+ public static async Task<GrpcTable> GetTableAsync(GrpcChannel channel, int actionType, string data)
+ {
+ GrpcTableCore.GrpcTableCoreClient client = CreateTableClient(channel);
+ return await client.GetDataAsync(CreateDataRequest(actionType, data));
+ }
+
+ /// <summary>
+ /// TableのgRPCクライアント
+ /// </summary>
+ /// <param name="client"></param>
+ /// <param name="actionType"></param>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public static GrpcTable GetTable(GrpcChannel channel, int actionType, string data)
+ {
+ GrpcTableCore.GrpcTableCoreClient client = CreateTableClient(channel);
+ return client.GetData(CreateDataRequest(actionType, data));
+ }
+
+ /// <summary>
+ /// 自由SQL発行
+ /// </summary>
+ /// <param name="client"></param>
+ /// <param name="sql"></param>
+ /// <returns></returns>
+ public static GrpcTable GetTable(GrpcChannel channel, string sql)
+ {
+ return GetTable(channel, (int)ETableActionType.CustomSql, sql);
+ }
+
+ /// <summary>
+ /// 0行、0列の値を返す(同期)
+ /// </summary>
+ /// <param name="channel"></param>
+ /// <param name="sql"></param>
+ /// <returns></returns>
+ public static string ExecuteScalarSync(GrpcChannel channel, string sql)
+ {
+ GrpcTable table = GetTable(channel, sql);
+ if (table.ErrNo != 0) { return string.Empty; }
+ return CConvert.ToString(table.ToDataTable().Rows[0][0]);
+ }
+
+ /// <summary>
+ /// 0行、0列の値を返す
+ /// </summary>
+ /// <param name="sql"></param>
+ /// <returns></returns>
+ public static async Task<string> ExecuteScalar(GrpcChannel channel, string sql)
+ {
+ GrpcTableCore.GrpcTableCoreClient client = CreateTableClient(channel);
+ GrpcTable table = await client.GetDataAsync(CreateDataRequest((int)ETableActionType.CustomSql, sql));
+ if (table.ErrNo != 0) { return string.Empty; }
+ return CConvert.ToString(table.ToDataTable().Rows[0][0]);
+ }
+
+ /// <summary>
+ /// データの取得
+ /// </summary>
+ /// <param name="actionType"></param>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public static async Task<GrpcTable> GetTableStream(GrpcChannel channel, int actionType, string data)
+ {
+ GrpcTableCore.GrpcTableCoreClient client = CreateTableClient(channel);
+ GrpcTable table = null;
+ using (var call = client.GetDataStream())
+ {
+ await call.RequestStream.WriteAsync(CreateDataRequest(actionType, data));
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<GrpcTable>())
+ {
+ table = message;
+ break;
+ }
+ }
+ return table;
+ }
+
+ public static async Task<GrpcTable> GetTableStream(GrpcChannel channel, string sql)
+ {
+ return await GetTableStream(channel, (int)ETableActionType.CustomSql, sql);
+ }
+
+ /// <summary>
+ /// データセットのgRPCクライアント
+ /// </summary>
+ /// <param name="channel"></param>
+ /// <returns></returns>
+ public static GrpcSetCore.GrpcSetCoreClient CreateSetClient(GrpcChannel channel)
+ {
+ return new GrpcSetCore.GrpcSetCoreClient(channel);
+ }
+
+ public async static Task<GrpcSet> GetGrpcSet(GrpcChannel channel, int actionType, string data)
+ {
+ GrpcSetCore.GrpcSetCoreClient client = CreateSetClient(channel);
+ return await client.GetDataAsync(CreateDataRequest(actionType, data));
+ }
+
+ /// <summary>
+ /// データセットの取得
+ /// </summary>
+ /// <param name="client"></param>
+ /// <param name="actionType"></param>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async static Task<GrpcSet> GetDataSet(GrpcChannel channel, int actionType, string data)
+ {
+ GrpcSetCore.GrpcSetCoreClient client = CreateSetClient(channel);
+ GrpcSet set = null;
+ using (var call = client.GetDataStream())
+ {
+ await call.RequestStream.WriteAsync(CreateDataRequest(actionType, data));
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<GrpcSet>())
+ {
+ set = message;
+ break;
+ }
+ }
+ return set;
+ }
+ }
+}
diff --git a/HotelPms.Data.Client/GrpcFactory.cs b/HotelPms.Data.Client/GrpcFactory.cs
new file mode 100644
index 0000000..304554c
--- /dev/null
+++ b/HotelPms.Data.Client/GrpcFactory.cs
@@ -0,0 +1,79 @@
+using Grpc.Net.Client;
+using Grpc.Net.Client.Web;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net.Http;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HotelPms.Data.Client
+{
+ public class GrpcFactory : IDisposable
+ {
+ public static string Url = "https://localhost:7240"; //托管
+ //public static string Url = "https://localhost:5001"; //
+ //public static string Url = "https://133.125.63.43:46492"; //Web ⇒OK
+
+ private static GrpcFactory m_Default = null;
+
+ public static GrpcFactory Instance
+ {
+ get
+ {
+ if (m_Default == null) { m_Default = new GrpcFactory(); }
+ return m_Default;
+ }
+ }
+
+
+
+ /// <summary>
+ /// チャネル
+ /// </summary>
+ public GrpcChannel Channel { get; private set; } = null;
+
+ /// <summary>
+ /// GrpcTableの取得、更新用クライアント
+ /// </summary>
+ public GrpcTableCore.GrpcTableCoreClient TableCore { get; private set; } = null;
+
+ /// <summary>
+ /// GrpcSetの取得、更新用クライアント
+ /// </summary>
+ public GrpcSetCore.GrpcSetCoreClient SetCore { get; private set; } = null;
+
+ #region 各テーブルのクラウド
+
+ //public MenuCore.MenuCoreClient Menu { get; private set; } = null;
+
+ #endregion
+
+ public GrpcFactory()
+ {
+ var httpClientHandler = new HttpClientHandler();
+ httpClientHandler.ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator;
+ var httpClient = new HttpClient(new GrpcWebHandler(GrpcWebMode.GrpcWeb, httpClientHandler));
+ //var httpClient = new HttpClient(httpClientHandler);
+ GrpcChannelOptions options = new GrpcChannelOptions()
+ {
+ MaxReceiveMessageSize = int.MaxValue,
+ HttpClient = httpClient
+ };
+ Channel = GrpcChannel.ForAddress(Url, options);
+ TableCore = new GrpcTableCore.GrpcTableCoreClient(Channel);
+ SetCore = new GrpcSetCore.GrpcSetCoreClient(Channel);
+
+ #region 各テーブルのクラウド
+
+ //Menu = new MenuCore.MenuCoreClient(Channel);
+
+ #endregion
+ }
+
+ public void Dispose()
+ {
+ if (Channel != null) { Channel.Dispose(); }
+ }
+ }
+}
diff --git a/HotelPms.Data.Client/HotelPms.Data.Client.csproj b/HotelPms.Data.Client/HotelPms.Data.Client.csproj
new file mode 100644
index 0000000..d511c05
--- /dev/null
+++ b/HotelPms.Data.Client/HotelPms.Data.Client.csproj
@@ -0,0 +1,128 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <TargetFramework>net9.0</TargetFramework>
+ <ImplicitUsings>enable</ImplicitUsings>
+ <Nullable>enable</Nullable>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <Compile Remove="Access\**" />
+ <Compile Remove="CustomTypes\**" />
+ <Compile Remove="Master\**" />
+ <EmbeddedResource Remove="Access\**" />
+ <EmbeddedResource Remove="CustomTypes\**" />
+ <EmbeddedResource Remove="Master\**" />
+ <None Remove="Access\**" />
+ <None Remove="CustomTypes\**" />
+ <None Remove="Master\**" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <Compile Include="..\ProtosExpan\CustomTypes\Date.cs" Link="ProtosExpan\CustomTypes\Date.cs" />
+ <Compile Include="..\ProtosExpan\CustomTypes\DecimalValue.cs" Link="ProtosExpan\CustomTypes\DecimalValue.cs" />
+ <Compile Include="..\ProtosExpan\GrpcSet.cs" Link="GrpcSet.cs" />
+ <Compile Include="..\ProtosExpan\GrpcTable.cs" Link="GrpcTable.cs" />
+ <Compile Include="..\ProtosExpan\UseInfo\Arrange.cs" Link="ProtosExpan\UseInfo\Arrange.cs" />
+ <Compile Include="..\ProtosExpan\UseInfo\Pay.cs" Link="ProtosExpan\UseInfo\Pay.cs" />
+ <Compile Include="..\ProtosExpan\UseInfo\PayDiv.cs" Link="ProtosExpan\UseInfo\PayDiv.cs" />
+ <Compile Include="..\ProtosExpan\UseInfo\Receipt.cs" Link="ProtosExpan\UseInfo\Receipt.cs" />
+ <Compile Include="..\ProtosExpan\UseInfo\Rental.cs" Link="ProtosExpan\UseInfo\Rental.cs" />
+ <Compile Include="..\ProtosExpan\UseInfo\Sale.cs" Link="ProtosExpan\UseInfo\Sale.cs" />
+ <Compile Include="..\ProtosExpan\UseInfo\Sale.Client.cs" Link="ProtosExpan\UseInfo\Sale.Client.cs" />
+ <Compile Include="..\ProtosExpan\UseInfo\SaleDiv.cs" Link="ProtosExpan\UseInfo\SaleDiv.cs" />
+ <Compile Include="..\ProtosExpan\UseInfo\Use.cs" Link="ProtosExpan\UseInfo\Use.cs" />
+ <Compile Include="..\ProtosExpan\UseInfo\Use.Client.cs" Link="ProtosExpan\UseInfo\Use.Client.cs" />
+ <Compile Include="..\ProtosExpan\UseInfo\Use.Server.cs" Link="ProtosExpan\UseInfo\Use.Server.cs" />
+ <Compile Include="..\ProtosExpan\UseInfo\UseAllo.cs" Link="ProtosExpan\UseInfo\UseAllo.cs" />
+ <Compile Include="..\ProtosExpan\UseInfo\UseAllo.Server.cs" Link="ProtosExpan\UseInfo\UseAllo.Server.cs" />
+ <Compile Include="..\ProtosExpan\UseInfo\UseDetail.cs" Link="ProtosExpan\UseInfo\UseDetail.cs" />
+ <Compile Include="..\ProtosExpan\UseInfo\UseDetail.Client.cs" Link="ProtosExpan\UseInfo\UseDetail.Client.cs" />
+ <Compile Include="..\ProtosExpan\UseInfo\UseDetail.Server.cs" Link="ProtosExpan\UseInfo\UseDetail.Server.cs" />
+ <Compile Include="..\ProtosExpan\UseInfo\UseFree.cs" Link="ProtosExpan\UseInfo\UseFree.cs" />
+ <Compile Include="..\ProtosExpan\UseInfo\UseMemo.cs" Link="ProtosExpan\UseInfo\UseMemo.cs" />
+ <Compile Include="..\ProtosExpan\UseInfo\UsePerson.cs" Link="ProtosExpan\UseInfo\UsePerson.cs" />
+ <Compile Include="..\ProtosExpan\UseInfo\UsePersonFree.cs" Link="ProtosExpan\UseInfo\UsePersonFree.cs" />
+ <Compile Include="..\ProtosExpan\UseInfo\UsePersonTel.cs" Link="ProtosExpan\UseInfo\UsePersonTel.cs" />
+ <Compile Include="..\ProtosExpan\UseInfo\UseRoom.cs" Link="ProtosExpan\UseInfo\UseRoom.cs" />
+ <Compile Include="..\ProtosExpan\UseInfo\UseRoom.Client.cs" Link="ProtosExpan\UseInfo\UseRoom.Client.cs" />
+ <Compile Include="..\ProtosExpan\Master\Hotel.cs" Link="ProtosExpan\Master\Hotel.cs" />
+ <Compile Include="..\ProtosExpan\Master\HotelTable.cs" Link="ProtosExpan\Master\HotelTable.cs" />
+ <Compile Include="..\ProtosExpan\Master\Demo.cs" Link="ProtosExpan\Master\Demo.cs" />
+ <Compile Include="..\ProtosExpan\Master\DemoTable.cs" Link="ProtosExpan\Master\DemoTable.cs" />
+ <Compile Include="..\ProtosExpan\Master\Building.cs" Link="ProtosExpan\Master\Building.cs" />
+ <Compile Include="..\ProtosExpan\Master\BuildingTable.cs" Link="ProtosExpan\Master\BuildingTable.cs" />
+ <Compile Include="..\ProtosExpan\Master\OutputItem.cs" Link="ProtosExpan\Master\OutputItem.cs" />
+ <Compile Include="..\ProtosExpan\Master\OutputItemTable.cs" Link="ProtosExpan\Master\OutputItemTable.cs" />
+ <Compile Include="..\ProtosExpan\Master\Output.cs" Link="ProtosExpan\Master\Output.cs" />
+ <Compile Include="..\ProtosExpan\Master\OutputTable.cs" Link="ProtosExpan\Master\OutputTable.cs" />
+ <Compile Include="..\ProtosExpan\Master\RoomViewTab.cs" Link="ProtosExpan\Master\RoomViewTab.cs" />
+ <Compile Include="..\ProtosExpan\Master\RoomViewTabTable.cs" Link="ProtosExpan\Master\RoomViewTabTable.cs" />
+ <Compile Include="..\ProtosExpan\Master\RoomViewLayout.cs" Link="ProtosExpan\Master\RoomViewLayout.cs" />
+ <Compile Include="..\ProtosExpan\Master\RoomViewLayoutTable.cs" Link="ProtosExpan\Master\RoomViewLayoutTable.cs" />
+ <Compile Include="..\ProtosExpan\Master\RoomCell.cs" Link="ProtosExpan\Master\RoomCell.cs" />
+ <Compile Include="..\ProtosExpan\Master\RoomCellTable.cs" Link="ProtosExpan\Master\RoomCellTable.cs" />
+ <Compile Include="..\ProtosExpan\Master\Option.cs" Link="ProtosExpan\Master\Option.cs" />
+ <Compile Include="..\ProtosExpan\Master\OptionTable.cs" Link="ProtosExpan\Master\OptionTable.cs" />
+ <Compile Include="..\ProtosExpan\Master\RoomStatus.cs" Link="ProtosExpan\Master\RoomStatus.cs" />
+ <Compile Include="..\ProtosExpan\Master\RoomStatusTable.cs" Link="ProtosExpan\Master\RoomStatusTable.cs" />
+ <Compile Include="..\ProtosExpan\Master\RoomType.cs" Link="ProtosExpan\Master\RoomType.cs" />
+ <Compile Include="..\ProtosExpan\Master\RoomTypeTable.cs" Link="ProtosExpan\Master\RoomTypeTable.cs" />
+ <Compile Include="..\ProtosExpan\Master\Item.cs" Link="ProtosExpan\Master\Item.cs" />
+ <Compile Include="..\ProtosExpan\Master\ItemTable.cs" Link="ProtosExpan\Master\ItemTable.cs" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <Protobuf Include="..\Protos\greet.proto" GrpcServices="Client" Link="Protos\greet.proto" />
+ <Protobuf Include="..\Protos\sqlwhere.proto" GrpcServices="Client" Link="Protos\sqlwhere.proto" />
+ <Protobuf Include="..\Protos\use.proto" GrpcServices="Client" Link="Protos\use.proto" />
+ <Protobuf Include="..\Protos\grpcset.proto" GrpcServices="Client" Link="Protos\grpcset.proto" />
+ <Protobuf Include="..\Protos\grpctable.proto" GrpcServices="Client" Link="Protos\grpctable.proto" />
+ <Protobuf Include="..\Protos\datarequest.proto" GrpcServices="Client" Link="Protos\datarequest.proto" />
+ <Protobuf Include="..\Protos\dataresult.proto" GrpcServices="Client" Link="Protos\dataresult.proto" />
+ <Protobuf Include="..\Protos\file.proto" GrpcServices="Client" Link="Protos\file.proto" />
+ <Protobuf Include="..\Protos\usedetail.proto" GrpcServices="Client" Link="Protos\usedetail.proto" />
+ <Protobuf Include="..\Protos\useperson.proto" GrpcServices="Client" Link="Protos\useperson.proto" />
+ <Protobuf Include="..\Protos\useallo.proto" GrpcServices="Client" Link="Protos\useallo.proto" />
+ <Protobuf Include="..\Protos\useroom.proto" GrpcServices="Client" Link="Protos\useroom.proto" />
+ <Protobuf Include="..\Protos\arrange.proto" GrpcServices="Client" Link="Protos\arrange.proto" />
+ <Protobuf Include="..\Protos\pay.proto" GrpcServices="Client" Link="Protos\pay.proto" />
+ <Protobuf Include="..\Protos\paydiv.proto" GrpcServices="Client" Link="Protos\paydiv.proto" />
+ <Protobuf Include="..\Protos\receipt.proto" GrpcServices="Client" Link="Protos\receipt.proto" />
+ <Protobuf Include="..\Protos\rental.proto" GrpcServices="Client" Link="Protos\rental.proto" />
+ <Protobuf Include="..\Protos\sale.proto" GrpcServices="Client" Link="Protos\sale.proto" />
+ <Protobuf Include="..\Protos\salediv.proto" GrpcServices="Client" Link="Protos\salediv.proto" />
+ <Protobuf Include="..\Protos\usefree.proto" GrpcServices="Client" Link="Protos\usefree.proto" />
+ <Protobuf Include="..\Protos\usememo.proto" GrpcServices="Client" Link="Protos\usememo.proto" />
+ <Protobuf Include="..\Protos\usepersonfree.proto" GrpcServices="Client" Link="Protos\usepersonfree.proto" />
+ <Protobuf Include="..\Protos\usepersontel.proto" GrpcServices="Client" Link="Protos\usepersontel.proto" />
+ <Protobuf Include="..\Protos\customTypes.proto" GrpcServices="Client" Link="Protos\customTypes.proto" />
+ <Protobuf Include="..\Protos\hotel.proto" GrpcServices="Client" Link="Protos\hotel.proto" />
+ <Protobuf Include="..\Protos\demo.proto" GrpcServices="Client" Link="Protos\demo.proto" />
+ <Protobuf Include="..\Protos\building.proto" GrpcServices="Client" Link="Protos\building.proto" />
+ <Protobuf Include="..\Protos\outputitem.proto" GrpcServices="Client" Link="Protos\outputitem.proto" />
+ <Protobuf Include="..\Protos\output.proto" GrpcServices="Client" Link="Protos\output.proto" />
+ <Protobuf Include="..\Protos\loginresult.proto" GrpcServices="Client" Link="Protos\loginresult.proto" />
+ <Protobuf Include="..\Protos\reportcol.proto" GrpcServices="Client" Link="Protos\reportcol.proto" />
+ <Protobuf Include="..\Protos\roomviewtab.proto" GrpcServices="Client" Link="Protos\roomviewtab.proto" />
+ <Protobuf Include="..\Protos\roomviewlayout.proto" GrpcServices="Client" Link="Protos\roomviewlayout.proto" />
+ <Protobuf Include="..\Protos\roomcell.proto" GrpcServices="Client" Link="Protos\roomcell.proto" />
+ <Protobuf Include="..\Protos\option.proto" GrpcServices="Client" Link="Protos\option.proto" />
+ <Protobuf Include="..\Protos\roomstatus.proto" GrpcServices="Client" Link="Protos\roomstatus.proto" />
+ <Protobuf Include="..\Protos\roomtype.proto" GrpcServices="Client" Link="Protos\roomtype.proto" />
+ <Protobuf Include="..\Protos\item.proto" GrpcServices="Client" Link="Protos\item.proto" />
+ <Protobuf Include="..\Protos\sale.proto" GrpcServices="Client" Link="Protos\sale.proto" />
+ <PackageReference Include="Google.Protobuf" Version="3.30.1" />
+ <PackageReference Include="Grpc.Tools" Version="2.71.0" PrivateAssets="All" />
+ <PackageReference Include="Grpc.Net.Client" Version="2.70.0" />
+ <PackageReference Include="Grpc.Net.Client.Web" Version="2.70.0" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <Folder Include="ProtosExpan\CustomTypes\" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <ProjectReference Include="..\HotelPms.Data.Common\HotelPms.Data.Common.csproj" />
+ </ItemGroup>
+</Project>
diff --git a/HotelPms.Data.Client/Interface/Access/IDemo.cs b/HotelPms.Data.Client/Interface/Access/IDemo.cs
new file mode 100644
index 0000000..8afe64e
--- /dev/null
+++ b/HotelPms.Data.Client/Interface/Access/IDemo.cs
@@ -0,0 +1,16 @@
+using HotelPms.Data.Master;
+using System.Data;
+
+namespace HotelPms.Data.Common.Interface.Access
+{
+ public interface IDemo
+ {
+ bool Exists(int pID);
+ DataTable GetMasterGridData(string where);
+ Demo GetItem(int pID);
+ DataResult Add(Demo data);
+ DataResult Update(Demo data);
+ DataResult Remove(string where);
+ int GetUpdateID(int pID);
+ }
+}
diff --git a/HotelPms.Data.Client/ProtosExpan/CustomTypes/Readme.txt b/HotelPms.Data.Client/ProtosExpan/CustomTypes/Readme.txt
new file mode 100644
index 0000000..5f28270
--- /dev/null
+++ b/HotelPms.Data.Client/ProtosExpan/CustomTypes/Readme.txt
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/HotelPms.Data.Client/ProtosExpan/Master/Demo.Expan.cs b/HotelPms.Data.Client/ProtosExpan/Master/Demo.Expan.cs
new file mode 100644
index 0000000..ad71e47
--- /dev/null
+++ b/HotelPms.Data.Client/ProtosExpan/Master/Demo.Expan.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HotelPms.Data.Master
+{
+ public partial class Demo
+ {
+ public string GetFieldString(string name)
+ {
+
+ if (name == "ID") { return ID.ToString(); }
+ else if (name == "Name") { return Name; }
+ else if (name == "FInt") { return FInt.ToString(); }
+ else if (name == "FTinyInt") { return FTinyInt.ToString(); }
+ else if (name == "FSmallInt") { return FSmallInt.ToString(); }
+ else if (name == "FFloat") { return FFloat.ToString(); }
+ else if (name == "FBit") { return FBit ? "1" : "0"; }
+ else if (name == "FDecimal") { return FDecimal.ToText("N2"); }
+ else if (name == "FDate") { return FDate.ToDateTime().ToString("yyyy/MM/dd"); }
+ else if (name == "UpdateDate") { return UpdateDate.ToDateTime().ToString("yyyy/MM/dd HH:mm:ss fff"); }
+ else if (name == "UpdateID") { return UpdateID.ToString(); }
+ else { return string.Empty; }
+ }
+ }
+}
diff --git a/HotelPms.Data.Client/ProtosExpan/Master/Readme.txt b/HotelPms.Data.Client/ProtosExpan/Master/Readme.txt
new file mode 100644
index 0000000..5f28270
--- /dev/null
+++ b/HotelPms.Data.Client/ProtosExpan/Master/Readme.txt
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/HotelPms.Data.Client/ProtosExpan/Master/RoomViewAtt.cs b/HotelPms.Data.Client/ProtosExpan/Master/RoomViewAtt.cs
new file mode 100644
index 0000000..da282c1
--- /dev/null
+++ b/HotelPms.Data.Client/ProtosExpan/Master/RoomViewAtt.cs
@@ -0,0 +1,30 @@
+using HotelPms.Share.Util;
+
+namespace HotelPms.Data.Master
+{
+ public class RoomViewAtt
+ {
+ public int RoomID { get; set; } = 0;
+ public string RoomName { get; set; } = string.Empty;
+ public int RoomStatus { get; set; } = 0;
+ public int VodStatus { get; set; } = 0;
+ public bool MsgStatus { get; set; } = false;
+ public bool IOStatus { get; set; } = false;
+ public string BackColor { get; set; } = string.Empty;
+ public string ForeColor { get; set; } = string.Empty;
+ public int MaidType { get; set; } = 0;
+
+ public void Read(System.Data.DataRow row)
+ {
+ RoomID = CConvert.ToInt(row["RoomID"]);
+ RoomStatus = CConvert.ToInt(row["RoomStatus"]);
+ VodStatus = CConvert.ToInt(row["VodStatus"]);
+ MsgStatus = CConvert.ToBool(row["MsgStatus"]);
+ IOStatus = CConvert.ToBool(row["IOStatus"]);
+ RoomName = CConvert.ToString(row["RoomName"]);
+ BackColor = CConvert.ToString(row["BackColor"]);
+ ForeColor = CConvert.ToString(row["ForeColor"]);
+ MaidType = CConvert.ToInt(row["MaidType"]);
+ }
+ }
+}
diff --git a/HotelPms.Data.Client/ProtosExpan/Master/RoomViewLayout.Expan.cs b/HotelPms.Data.Client/ProtosExpan/Master/RoomViewLayout.Expan.cs
new file mode 100644
index 0000000..e7df04f
--- /dev/null
+++ b/HotelPms.Data.Client/ProtosExpan/Master/RoomViewLayout.Expan.cs
@@ -0,0 +1,29 @@
+using Google.Protobuf.WellKnownTypes;
+using HotelPms.Share.Util;
+using System;
+using System.Globalization;
+
+namespace HotelPms.Data.Master
+{
+ public partial class RoomViewLayout
+ {
+ public void Read(System.Data.DataRow row)
+ {
+ Row = CConvert.ToInt(row["Row"], Row);
+ Col = CConvert.ToInt(row["Col"], Col);
+ RoomID = CConvert.ToInt(row["RoomID"], RoomID);
+ DisplayName = row["DisplayName"].ToString();
+ RowHeight = CConvert.ToInt(row["RowHeight"], RowHeight);
+ ColWidth = CConvert.ToInt(row["ColWidth"], ColWidth);
+ BackColor = row["BackColor"].ToString();
+ ForeColor = row["ForeColor"].ToString();
+ Floor = CConvert.ToInt(row["Floor"], Floor);
+ FontName = row["FontName"].ToString();
+ FontSize = CConvert.ToInt(row["FontSize"], FontSize);
+ FontBold = CConvert.ToBool(row["FontBold"]);
+ FontItalic = CConvert.ToBool(row["FontItalic"]);
+ FontUnderline = CConvert.ToBool(row["FontUnderline"]);
+ TextAlign = row["TextAlign"].ToString();
+ }
+ }
+}
diff --git a/HotelPms.Data.Client/ProtosExpan/Master/RoomViewUse.cs b/HotelPms.Data.Client/ProtosExpan/Master/RoomViewUse.cs
new file mode 100644
index 0000000..58713dc
--- /dev/null
+++ b/HotelPms.Data.Client/ProtosExpan/Master/RoomViewUse.cs
@@ -0,0 +1,66 @@
+using Google.Protobuf.WellKnownTypes;
+using HotelPms.Share.Util;
+
+namespace HotelPms.Data.Master
+{
+ public class RoomViewUse
+ {
+ public int RoomID { get; set; } = 0;
+ public int UseID { get; set; } = 0;
+ public int DetailID { get; set; } = 0;
+ public int UseStatus { get; set; } = 0;
+ public int SubStatus { get; set; } = 0;
+ public int ExtenStatus { get; set; } = 0;
+ public Timestamp CinDate { get; set; } = Timestamp.FromDateTime(DateTime.SpecifyKind(DateTime.MinValue, DateTimeKind.Utc));
+ public Timestamp CoutDate { get; set; } = Timestamp.FromDateTime(DateTime.SpecifyKind(DateTime.MinValue, DateTimeKind.Utc));
+ public int Stay { get; set; } = 0;
+ public int CinTime { get; set; } = 0;
+ public int CoutTime { get; set; } = 0;
+ public Timestamp ResvDate { get; set; } = Timestamp.FromDateTime(DateTime.SpecifyKind(DateTime.MinValue, DateTimeKind.Utc));
+ public int ResvType { get; set; } = 0;
+ public string SortKey { get; set; } = string.Empty;
+ public string BackColor { get; set; } = string.Empty;
+ public string ForeColor { get; set; } = string.Empty;
+
+ /// <summary>
+ /// RoomCellに関連する利用データ
+ /// </summary>
+ public Dictionary<string, string> UseData = new Dictionary<string, string>();
+
+ public void Read(System.Data.DataRow row)
+ {
+ RoomID = CConvert.ToInt(row["RoomID"]);
+ UseID = CConvert.ToInt(row["UseID"]);
+ DetailID = CConvert.ToInt(row["DetailID"]);
+ UseStatus = CConvert.ToInt(row["UseStatus"]);
+ SubStatus = CConvert.ToInt(row["SubStatus"]);
+ ExtenStatus = CConvert.ToInt(row["ExtenStatus"]);
+ CinDate = CConvert.ToTimestamp(row.IsNull("CinDate") ? DateTime.MinValue : (System.DateTime)row["CinDate"]);
+ CoutDate = CConvert.ToTimestamp(row.IsNull("CoutDate") ? DateTime.MinValue : (System.DateTime)row["CoutDate"]);
+ Stay = CConvert.ToInt(row["Stay"]);
+ CinTime = CConvert.ToInt(row["CinTime"]);
+ CoutTime = CConvert.ToInt(row["CoutTime"]);
+ ResvDate = CConvert.ToTimestamp(row.IsNull("ResvDate") ? DateTime.MinValue : (System.DateTime)row["ResvDate"]);
+ ResvType = CConvert.ToInt(row["ResvType"]);
+ SortKey = CConvert.ToString(row["SortKey"]);
+ BackColor = CConvert.ToString(row["BackColor"]);
+ ForeColor = CConvert.ToString(row["ForeColor"]);
+ AddUseData(row);
+ }
+
+ /// <summary>
+ /// RoomCellの利用データの格納
+ /// </summary>
+ /// <param name="row"></param>
+ public void AddUseData(System.Data.DataRow row)
+ {
+ foreach (System.Data.DataColumn col in row.Table.Columns)
+ {
+ if (col.ColumnName.StartsWith("F") && CConvert.IsNumber(col.ColumnName.Substring(1)))
+ {
+ UseData.Add(col.ColumnName, CConvert.ToString(row[col.ColumnName]));
+ }
+ }
+ }
+ }
+}
diff --git a/HotelPms.Data.Client/ProtosExpan/UseInfo/Readme.txt b/HotelPms.Data.Client/ProtosExpan/UseInfo/Readme.txt
new file mode 100644
index 0000000..5f28270
--- /dev/null
+++ b/HotelPms.Data.Client/ProtosExpan/UseInfo/Readme.txt
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/HotelPms.Data.Client/Util/GrpcClientInterceptor.cs b/HotelPms.Data.Client/Util/GrpcClientInterceptor.cs
new file mode 100644
index 0000000..40246fd
--- /dev/null
+++ b/HotelPms.Data.Client/Util/GrpcClientInterceptor.cs
@@ -0,0 +1,92 @@
+using Grpc.Core;
+using Grpc.Core.Interceptors;
+using System;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HotelPms.Data.Util
+{
+ public class GrpcClientInterceptor : Interceptor
+ {
+ /// <summary>
+ /// 一元调用(UnaryCall)
+ /// </summary>
+ /// <typeparam name="TRequest"></typeparam>
+ /// <typeparam name="TResponse"></typeparam>
+ /// <param name="request"></param>
+ /// <param name="context"></param>
+ /// <param name="continuation"></param>
+ /// <returns></returns>
+ public override AsyncUnaryCall<TResponse> AsyncUnaryCall<TRequest, TResponse>(TRequest request, ClientInterceptorContext<TRequest, TResponse> context, AsyncUnaryCallContinuation<TRequest, TResponse> continuation)
+ {
+ Console.WriteLine("AsyncUnaryCall");
+ Console.WriteLine("客户端调用执行开始");
+ var responseCon = continuation(request, context);
+ var response = new AsyncUnaryCall<TResponse>(responseCon.ResponseAsync, responseCon.ResponseHeadersAsync, responseCon.GetStatus, responseCon.GetTrailers, responseCon.Dispose);
+ Console.WriteLine("客户端调用执行结束"); //非同期処理のため、ここには処理未完成
+ return response;
+ }
+
+ private async Task<TResponse> MyAsyncStuff<TResponse>(AsyncUnaryCall<TResponse> responseAsync)
+ {
+ return await responseAsync;
+ }
+
+ public override AsyncClientStreamingCall<TRequest, TResponse> AsyncClientStreamingCall<TRequest, TResponse>(ClientInterceptorContext<TRequest, TResponse> context, AsyncClientStreamingCallContinuation<TRequest, TResponse> continuation)
+ {
+ Console.WriteLine("AsyncClientStreamingCall");
+ return base.AsyncClientStreamingCall(context, continuation);
+ }
+
+ public override AsyncDuplexStreamingCall<TRequest, TResponse> AsyncDuplexStreamingCall<TRequest, TResponse>(ClientInterceptorContext<TRequest, TResponse> context, AsyncDuplexStreamingCallContinuation<TRequest, TResponse> continuation)
+ {
+ Console.WriteLine("AsyncDuplexStreamingCall");
+ return base.AsyncDuplexStreamingCall(context, continuation);
+ }
+
+ /// <summary>
+ /// 同期
+ /// </summary>
+ /// <typeparam name="TRequest"></typeparam>
+ /// <typeparam name="TResponse"></typeparam>
+ /// <param name="request"></param>
+ /// <param name="context"></param>
+ /// <param name="continuation"></param>
+ /// <returns></returns>
+ public override TResponse BlockingUnaryCall<TRequest, TResponse>(TRequest request, ClientInterceptorContext<TRequest, TResponse> context, BlockingUnaryCallContinuation<TRequest, TResponse> continuation)
+ {
+ Console.WriteLine("BlockingUnaryCall");
+ return base.BlockingUnaryCall(request, context, continuation);
+ }
+
+ public override AsyncServerStreamingCall<TResponse> AsyncServerStreamingCall<TRequest, TResponse>(TRequest request, ClientInterceptorContext<TRequest, TResponse> context, AsyncServerStreamingCallContinuation<TRequest, TResponse> continuation)
+ {
+ Console.WriteLine("AsyncServerStreamingCall");
+ return base.AsyncServerStreamingCall(request, context, continuation);
+ }
+
+ public override Task<TResponse> ClientStreamingServerHandler<TRequest, TResponse>(IAsyncStreamReader<TRequest> requestStream, ServerCallContext context, ClientStreamingServerMethod<TRequest, TResponse> continuation)
+ {
+ Console.WriteLine("ClientStreamingServerHandler");
+ return base.ClientStreamingServerHandler(requestStream, context, continuation);
+ }
+
+ public override Task DuplexStreamingServerHandler<TRequest, TResponse>(IAsyncStreamReader<TRequest> requestStream, IServerStreamWriter<TResponse> responseStream, ServerCallContext context, DuplexStreamingServerMethod<TRequest, TResponse> continuation)
+ {
+ Console.WriteLine("DuplexStreamingServerHandler");
+ return base.DuplexStreamingServerHandler(requestStream, responseStream, context, continuation);
+ }
+
+ public override Task ServerStreamingServerHandler<TRequest, TResponse>(TRequest request, IServerStreamWriter<TResponse> responseStream, ServerCallContext context, ServerStreamingServerMethod<TRequest, TResponse> continuation)
+ {
+ Console.WriteLine("ServerStreamingServerHandler");
+ return base.ServerStreamingServerHandler(request, responseStream, context, continuation);
+ }
+
+ public override Task<TResponse> UnaryServerHandler<TRequest, TResponse>(TRequest request, ServerCallContext context, UnaryServerMethod<TRequest, TResponse> continuation)
+ {
+ Console.WriteLine("UnaryServerHandler");
+ return base.UnaryServerHandler(request, context, continuation);
+ }
+ }
+}
diff --git a/HotelPms.Data.Common/Auth/LoginModel.cs b/HotelPms.Data.Common/Auth/LoginModel.cs
new file mode 100644
index 0000000..b79b784
--- /dev/null
+++ b/HotelPms.Data.Common/Auth/LoginModel.cs
@@ -0,0 +1,15 @@
+using System.ComponentModel.DataAnnotations;
+
+namespace HotelPms.Data.Common.Auth
+{
+ public class LoginModel
+ {
+ [Required]
+ public string Name { get; set; } = string.Empty;
+
+ [Required]
+ public string Password { get; set; } = string.Empty;
+
+ public bool RememberMe { get; set; }
+ }
+}
diff --git a/HotelPms.Data.Common/Auth/LoginResult.cs b/HotelPms.Data.Common/Auth/LoginResult.cs
new file mode 100644
index 0000000..6e6103c
--- /dev/null
+++ b/HotelPms.Data.Common/Auth/LoginResult.cs
@@ -0,0 +1,9 @@
+namespace HotelPms.Data.Common.Auth
+{
+ public class LoginResult
+ {
+ public bool Successful { get; set; }
+ public string Error { get; set; }
+ public string Token { get; set; }
+ }
+}
diff --git a/HotelPms.Data.Common/Auth/WeatherForecast.cs b/HotelPms.Data.Common/Auth/WeatherForecast.cs
new file mode 100644
index 0000000..7cd1201
--- /dev/null
+++ b/HotelPms.Data.Common/Auth/WeatherForecast.cs
@@ -0,0 +1,15 @@
+using System;
+
+namespace HotelPms.Data.Common.Auth
+{
+ public class WeatherForecast
+ {
+ public DateTime Date { get; set; }
+
+ public int TemperatureC { get; set; }
+
+ public string Summary { get; set; } = string.Empty;
+
+ public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
+ }
+}
diff --git a/HotelPms.Data.Common/Dtos/MessageDto.cs b/HotelPms.Data.Common/Dtos/MessageDto.cs
new file mode 100644
index 0000000..6e5ed9a
--- /dev/null
+++ b/HotelPms.Data.Common/Dtos/MessageDto.cs
@@ -0,0 +1,73 @@
+namespace HotelPms.Data.Common.Dtos
+{
+ /// <summary>
+ /// SignalR送信データ
+ /// </summary>
+ public class MessageDto
+ {
+ /// <summary>
+ /// メッセージ識別ID
+ /// 返信時特定する
+ /// </summary>
+ public Guid Id { get; set; }
+
+ /// <summary>
+ /// 送信元のSignalR ID
+ /// </summary>
+ public string ConnectionId { get; set; } = string.Empty;
+
+ /// <summary>
+ /// ログインID
+ /// </summary>
+ public string UserID { get; set; } = string.Empty;
+
+ /// <summary>
+ /// ログインパスワード
+ /// MD5 OR AES128
+ /// </summary>
+ public string UserPassword { get; set; } = string.Empty;
+
+ /// <summary>
+ /// 送信先のConnectionId
+ /// 必要???
+ /// </summary>
+ public string DestConnectionId { get; set; } = string.Empty;
+
+ /// <summary>
+ /// 送信先のUser ID
+ /// 相手先指定しない場合、全員
+ /// 相手先複数の場合、「,」で区切り
+ /// ※特別ユーザー
+ /// ①HotelPms.Service.Client
+ /// ②HotelPms.Service.Server
+ /// </summary>
+ public string DestUserID { get; set; } = string.Empty;
+
+ /// <summary>
+ /// JWT認証モードの場合
+ /// </summary>
+ public string AccessToKen { get; set; } = string.Empty;
+
+ /// <summary>
+ /// JWT認証モードの場合
+ /// </summary>
+ public string RefreshToKen { get; set; } = string.Empty;
+
+ /// <summary>
+ /// 送信種類
+ /// 0.メッセージ送信
+ /// 1.ホテル日更新
+ /// </summary>
+ public int ActionType { get; set; } = 0;
+
+ /// <summary>
+ /// 送信データ
+ /// </summary>
+ public string Data { get; set; } = string.Empty;
+
+ /// <summary>
+ /// 追加データ
+ /// </summary>
+ public string Tag { get; set; } = string.Empty;
+ }
+}
diff --git a/HotelPms.Data.Common/GrpcEnum.cs b/HotelPms.Data.Common/GrpcEnum.cs
new file mode 100644
index 0000000..f2699a9
--- /dev/null
+++ b/HotelPms.Data.Common/GrpcEnum.cs
@@ -0,0 +1,60 @@
+using System;
+
+namespace HotelPms.Data.Common;
+
+/// <summary>
+///
+/// </summary>
+public enum ETableActionType : int
+{
+ CustomSql = 0,
+ RoomTypeMasterGrid = 1,
+ BuildingMasterGrid = 2,
+ Pagination = 3,
+ ReportMaster = 4,
+ DemoMasterGrid = 5,
+ RoomViewTabMasterGrid = 6,
+ RoomViewLayoutGrid = 7,
+ RoomViewState = 8,
+ RoomStatusMasterGrid = 9,
+ UpdateRoomStatus = 10,
+ HotelMasterGrid = 11,
+
+ PostNoSearch = 1000,
+ AddressSearch = 1001,
+
+ MasterName = 2000,
+ RoomTypeBase = 2001,
+ RoomTypeList = 2002,
+ SalesLoginList = 2003,
+ SalesLoginName = 2004,
+
+ HotelDate = 9000,
+ Sequence = 9001,
+ TaxRate = 9002,
+}
+
+public enum ESeqType : int
+{
+ Use = 0,
+ UseDetail,
+ UsePerson,
+ ReceiptID,
+ ReceiptNo,
+ Sale,
+ Pay,
+}
+
+public enum ESetActionType : int
+{
+ CustomSql = 0,
+ ColSetting = 1,
+ /// <summary>
+ /// 客室状況画面の日別表示データ
+ /// </summary>
+ RoomView = 2,
+}
+
+public class GrpcEnum
+{
+}
diff --git a/HotelPms.Data.Common/HotelPms.Data.Common.csproj b/HotelPms.Data.Common/HotelPms.Data.Common.csproj
new file mode 100644
index 0000000..c67289d
--- /dev/null
+++ b/HotelPms.Data.Common/HotelPms.Data.Common.csproj
@@ -0,0 +1,13 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <TargetFramework>net9.0</TargetFramework>
+ <ImplicitUsings>enable</ImplicitUsings>
+ <Nullable>enable</Nullable>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <ProjectReference Include="..\HotelPms.Share\HotelPms.Share.csproj" />
+ </ItemGroup>
+
+</Project>
diff --git a/HotelPms.Data.Common/Interface/Master/IMaster.cs b/HotelPms.Data.Common/Interface/Master/IMaster.cs
new file mode 100644
index 0000000..9955e5b
--- /dev/null
+++ b/HotelPms.Data.Common/Interface/Master/IMaster.cs
@@ -0,0 +1,8 @@
+namespace HotelPms.Data.Common.Interface.Master
+{
+ public interface IMaster
+ {
+ int ID { get; set; }
+ string Name { get; set; }
+ }
+}
diff --git a/HotelPms.Data.Common/Pagination/PagingRequest.cs b/HotelPms.Data.Common/Pagination/PagingRequest.cs
new file mode 100644
index 0000000..3ff6236
--- /dev/null
+++ b/HotelPms.Data.Common/Pagination/PagingRequest.cs
@@ -0,0 +1,25 @@
+namespace HotelPms.Data.Common.Pagination
+{
+ public class PagingRequest
+ {
+ public int PageNumber { get; set; } = 1;
+ public int PageSize { get; set; } = 10;
+ public string Table { get; set; } = string.Empty;
+ public string Field { get; set; } = "*";
+
+ public string OrderBy { get; set; } = string.Empty;
+
+ public string Filter { get; set; } = string.Empty;
+
+
+ public void CopyTo(PagingRequest item)
+ {
+ item.PageNumber = PageNumber;
+ item.PageSize = PageSize;
+ item.Table = Table;
+ item.Field = Field;
+ item.OrderBy = OrderBy;
+ item.Filter = Filter;
+ }
+ }
+}
diff --git a/HotelPms.Data.Common/Pagination/PagingRespone.cs b/HotelPms.Data.Common/Pagination/PagingRespone.cs
new file mode 100644
index 0000000..4f0410c
--- /dev/null
+++ b/HotelPms.Data.Common/Pagination/PagingRespone.cs
@@ -0,0 +1,10 @@
+namespace HotelPms.Data.Common.Pagination
+{
+ public class PagingRespone
+ {
+ public int MaxPage { get; set; }
+ public int TotalRow { get; set; }
+
+ public string Descript { get; set; } = string.Empty;
+ }
+}
diff --git a/HotelPms.Data.Common/PmsEnum.cs b/HotelPms.Data.Common/PmsEnum.cs
new file mode 100644
index 0000000..0cdca3c
--- /dev/null
+++ b/HotelPms.Data.Common/PmsEnum.cs
@@ -0,0 +1,270 @@
+using System.ComponentModel;
+
+namespace HotelPms.Data.Common;
+
+public enum EResvType : int
+{
+ [Description("本予約")]
+ Reserve = 0,
+ [Description("仮予約")]
+ Temporary = 1,
+ [Description("予約なし")]
+ NoReserve = 2,
+}
+
+public enum EGroupType : int
+{
+ [Description("個人")]
+ Person = 0,
+ [Description("団体")]
+ Group = 1,
+}
+
+public enum EReceiptPrtWay : int
+{
+ [Description("連泊部屋単位")]
+ Room = 0,
+ [Description("全利用単位")]
+ Group = 1,
+ [Description("基本一括+付帯個別")]
+ BaseAdding = 2,
+}
+
+public enum EPayWay : int
+{
+ [Description("連泊部屋単位")]
+ Room = 0,
+ [Description("全利用単位")]
+ Group = 1,
+}
+
+public enum EUseStatus : int
+{
+ [Description("なし(途中入力データ格納用など)")]
+ None = 0,
+ [Description("予約")]
+ Resv = 1,
+ [Description("チェックイン")]
+ Cin = 2,
+ [Description("チェックアウト")]
+ Cout = 3,
+ [Description("キャンセル")]
+ Cancel = 4,
+ [Description("故障部屋")]
+ BreakDown = 5,
+ [Description("マネージャーブロック")]
+ Block = 6,
+ [Description("キャンセル待ち")]
+ CancelWait = 7,
+ [Description("問い合わせ")]
+ AskOnly = 8,
+ [Description("自由領収書")]
+ Free = 9,
+}
+
+public enum ECinStatus : int
+{
+ [Description("在室")]
+ In = 0,
+ [Description("外出")]
+ Out = 1,
+}
+
+public enum ECoutStatus : int
+{
+ [Description("未清掃(汚い部屋)")]
+ Uncleaned = 0,
+ [Description("清掃完了の綺麗部屋")]
+ Cleaned = 1,
+}
+
+public enum ECancelStatus : int
+{
+ [Description("キャンセル")]
+ Cancel = 0,
+ [Description("NoShow")]
+ NoShow = 1,
+}
+
+public enum EExtenStatus : int
+{
+ [Description("なし")]
+ None = 0,
+ [Description("延長中")]
+ Exten = 1,
+}
+
+public enum EPayType : int
+{
+ [Description("現金")]
+ Cash = 0,
+ [Description("クレジット")]
+ Credit = 1,
+ [Description("売掛金")]
+ Bill = 2,
+ [Description("予約金")]
+ ReservedMoney = 3,
+ [Description("クーポン")]
+ Coupon = 4,
+ [Description("宴会売掛金")]
+ PartyBill = 5,
+}
+
+public enum EPersonType : int
+{
+ [Description("大人")]
+ Adult = 0,
+ [Description("子供A")]
+ ChildA = 1,
+ [Description("子供B")]
+ ChildB = 2,
+ [Description("子供C")]
+ ChildC = 3,
+ [Description("子供D")]
+ ChildD = 4,
+ [Description("子供E")]
+ ChildE = 5,
+ [Description("子供F")]
+ ChildF = 6,
+ [Description("幼児")]
+ Infant = 7,
+}
+
+public enum EReceiptPrtType : int
+{
+ [Description("印字しない")]
+ NoPrint = 0,
+ [Description("印字")]
+ Print = 1,
+ [Description("印字済")]
+ Printed = 2,
+}
+
+public enum ERoomKind : int
+{
+ [Description("一般部屋")]
+ Normal = 0,
+ [Description("会場")]
+ Hall = 1,
+ [Description("売上部屋")]
+ Sales = 2,
+ [Description("架空部屋")]
+ Virtual = 3,
+}
+
+public enum EVisible : int
+{
+ [Description("非表示")]
+ Hidden = 0,
+ [Description("表示")]
+ Show = 1,
+}
+
+public enum EIssueStatus : int
+{
+ [Description("未発行")]
+ NoIssue = 0,
+ [Description("発行")]
+ Issue = 1,
+ [Description("再発行")]
+ ReIssue = 2,
+ [Description("キャンセル")]
+ Canceled = 9,
+}
+
+public enum EIOType : int
+{
+ [Description("なし")]
+ None = 0,
+ [Description("外税")]
+ Out = 1,
+ [Description("内税")]
+ Include = 2,
+}
+
+public enum ETelKind : int
+{
+ [Description("携帯")]
+ Mobile = 0,
+ [Description("自宅TEL")]
+ Tel = 1,
+ [Description("自宅FAX")]
+ Fax = 2,
+ [Description("会社TEL")]
+ CorpTel = 3,
+ [Description("会社FAX")]
+ CorpFax = 4,
+}
+
+
+
+public enum ESyncType : int
+{
+ [Description("利用更新")]
+ Use = 0,
+ [Description("顧客更新")]
+ Customer,
+}
+
+
+public enum EMasterEditStatus : int
+{
+ [Description("新規")]
+ Create = 0,
+ [Description("変更")]
+ Update,
+ [Description("削除")]
+ Delete,
+}
+
+public enum EReportID : int
+{
+ [Description("部屋別売上チェックリスト")]
+ RoomCheckList = 1,
+ [Description("デモマスタ")]
+ Demo = 10000,
+ [Description("館マスタ")]
+ Building = 10001,
+ [Description("部屋状態マスタ")]
+ RoomStatus = 10002,
+}
+
+public enum EMaidType : int
+{
+ [Description("空室(清掃完了)")]
+ Vacancy = 0,
+ [Description("清掃指示")]
+ Instruct,
+ [Description("点検中")]
+ Check,
+ [Description("通常清掃状態")]
+ Normal,
+}
+
+/// <summary>
+/// 科目種別
+/// </summary>
+public enum EItemKind : int
+{
+ [Description("宿泊基本")]
+ StayBase = 0,
+ [Description("日帰基本")]
+ DayUseBase,
+ [Description("宿泊追加")]
+ StayAdding,
+ [Description("日帰追加")]
+ DayUseAdding,
+ [Description("立替")]
+ Reimbursement,
+}
+
+/// <summary>
+/// 売上表示区分
+/// </summary>
+public enum ESaleDispType : int
+{
+ [Description("通常")]
+ Normal = 0,
+ [Description("まとめ")]
+ Group,
+}
diff --git a/HotelPms.Data.Common/Util/SyncConfig.cs b/HotelPms.Data.Common/Util/SyncConfig.cs
new file mode 100644
index 0000000..08c9398
--- /dev/null
+++ b/HotelPms.Data.Common/Util/SyncConfig.cs
@@ -0,0 +1,15 @@
+namespace HotelPms.Data.Common.Util
+{
+ public class SyncConfig
+ {
+ /// <summary>
+ /// 32,767
+ /// </summary>
+ /// <param name="type"></param>
+ /// <returns></returns>
+ public static string GetLockSql(ESyncType type)
+ {
+ return $"UPDATE S_SyncConfig SET Seq = CASE WHEN Seq = 32767 THEN 1 ELSE Seq + 1 END,UpdateDate = GETDATE() WHERE ID = {(int)type};";
+ }
+ }
+}
diff --git a/HotelPms.Data.Common/Util/UseSql.cs b/HotelPms.Data.Common/Util/UseSql.cs
new file mode 100644
index 0000000..2cf45ca
--- /dev/null
+++ b/HotelPms.Data.Common/Util/UseSql.cs
@@ -0,0 +1,153 @@
+using System.Text;
+
+namespace HotelPms.Data.Common.Util
+{
+ public class UseSql
+ {
+ /// <summary>
+ /// 利用情報
+ /// </summary>
+ public StringBuilder Use { get; set; } = new StringBuilder();
+
+ /// <summary>
+ /// 利用者
+ /// </summary>
+ public StringBuilder UsePerson { get; set; } = new StringBuilder();
+
+ /// <summary>
+ /// 利用者自由集計
+ /// </summary>
+ public StringBuilder UsePersonFree { get; set; } = new StringBuilder();
+
+ /// <summary>
+ /// 利用者電話
+ /// </summary>
+ public StringBuilder UsePersonTel { get; set; } = new StringBuilder();
+
+ /// <summary>
+ /// 利用明細
+ /// </summary>
+ public StringBuilder UseDetail { get; set; } = new StringBuilder();
+
+ /// <summary>
+ /// 日毎利用部屋
+ /// </summary>
+ public StringBuilder UseRoom { get; set; } = new StringBuilder();
+
+ /// <summary>
+ /// 部屋割り
+ /// </summary>
+ public StringBuilder UseAllo { get; set; } = new StringBuilder();
+
+ /// <summary>
+ /// 利用単位、連泊単位、日部屋単位の自由集計
+ /// </summary>
+ public StringBuilder UseFree { get; set; } = new StringBuilder();
+
+ /// <summary>
+ /// 利用メモ
+ /// </summary>
+ public StringBuilder UseMemo { get; set; } = new StringBuilder();
+
+ /// <summary>
+ /// 売上
+ /// </summary>
+ public StringBuilder Sale { get; set; } = new StringBuilder();
+
+ /// <summary>
+ /// 入金
+ /// </summary>
+ public StringBuilder Pay { get; set; } = new StringBuilder();
+
+ /// <summary>
+ /// 手配
+ /// </summary>
+ public StringBuilder Arrange { get; set; } = new StringBuilder();
+
+ /// <summary>
+ /// 領収書(利用情報含まない)
+ /// </summary>
+ public StringBuilder Receipt { get; set; } = new StringBuilder();
+
+ /// <summary>
+ /// 領収書明細(利用情報含まない)
+ /// </summary>
+ public StringBuilder ReceiptDetail { get; set; } = new StringBuilder();
+
+ /// <summary>
+ /// 領収書税金(利用情報含まない)
+ /// </summary>
+ public StringBuilder ReceiptTax { get; set; } = new StringBuilder();
+
+ /// <summary>
+ /// 会場(利用情報含まない)
+ /// </summary>
+ public StringBuilder Hall { get; set; } = new StringBuilder();
+
+ /// <summary>
+ /// 貸出品
+ /// </summary>
+ public StringBuilder Rental { get; set; } = new StringBuilder();
+
+ /// <summary>
+ /// 新規・変更
+ /// </summary>
+ public bool IsNew { get; set; } = false;
+
+ /// <summary>
+ /// 利用ID
+ /// </summary>
+ public int ID { get; set; } = 0;
+
+ /// <summary>
+ /// 新規かどうか
+ /// </summary>
+ /// <param name="isNew"></param>
+ public UseSql(bool isNew, int id)
+ {
+ IsNew = isNew;
+ ID = id;
+
+ if (isNew)
+ {
+ UsePerson.AppendLine($"DELETE FROM D_UsePerson WHERE ID = {ID};");
+ UsePersonFree.AppendLine($"DELETE FROM D_UsePersonFree WHERE ID = {ID};");
+ UsePersonTel.AppendLine($"DELETE FROM D_UsePersonTel WHERE ID = {ID};");
+ UseDetail.AppendLine($"DELETE FROM D_UseDetail WHERE ID = {ID};");
+ UseRoom.AppendLine($"DELETE FROM D_UseRoom WHERE ID = {ID};");
+ UseAllo.AppendLine($"DELETE FROM D_UseAllo WHERE ID = {ID};");
+ UseFree.AppendLine($"DELETE FROM D_UseFree WHERE ID = {ID};");
+ UseMemo.AppendLine($"DELETE FROM D_UseMemo WHERE ID = {ID};");
+ Sale.AppendLine($"DELETE FROM D_Sale WHERE ID = {ID};");
+ Pay.AppendLine($"DELETE FROM D_Pay WHERE ID = {ID};");
+ Arrange.AppendLine($"DELETE FROM D_Arrange WHERE ID = {ID};");
+ Rental.AppendLine($"DELETE FROM D_Rental WHERE ID = {ID};");
+ }
+ }
+
+ /// <summary>
+ /// 利用情報核心データ更新
+ /// 更新順番固定!!
+ /// </summary>
+ /// <returns></returns>
+ public override string ToString()
+ {
+ StringBuilder sql = new StringBuilder();
+ sql.AppendLine(SyncConfig.GetLockSql(ESyncType.Use)); //デッドロック防止
+ sql.Append(UseMemo.ToString());
+ sql.Append(UseFree.ToString());
+ sql.Append(Arrange.ToString());
+ sql.Append(UsePersonFree.ToString());
+ sql.Append(UsePersonTel.ToString());
+ sql.Append(UsePerson.ToString());
+ sql.Append(Pay.ToString());
+ sql.Append(Sale.ToString());
+ sql.Append(Rental.ToString());
+ sql.Append(UseAllo.ToString());
+ sql.Append(UseRoom.ToString());
+ sql.Append(UseDetail.ToString());
+ sql.Append(Use.ToString());
+ return sql.ToString();
+ }
+ }
+}
diff --git a/HotelPms.Data.Server/HotelPms.Data.Server.csproj b/HotelPms.Data.Server/HotelPms.Data.Server.csproj
new file mode 100644
index 0000000..847e6fa
--- /dev/null
+++ b/HotelPms.Data.Server/HotelPms.Data.Server.csproj
@@ -0,0 +1,92 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <TargetFramework>net9.0</TargetFramework>
+ <ImplicitUsings>enable</ImplicitUsings>
+ <Nullable>enable</Nullable>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <Compile Include="..\ProtosExpan\CustomTypes\Date.cs" Link="ProtosExpan\CustomTypes\Date.cs" />
+ <Compile Include="..\ProtosExpan\CustomTypes\DecimalValue.cs" Link="ProtosExpan\CustomTypes\DecimalValue.cs" />
+ <Compile Include="..\ProtosExpan\UseInfo\Arrange.cs" Link="ProtosExpan\UseInfo\Arrange.cs" />
+ <Compile Include="..\ProtosExpan\UseInfo\Pay.cs" Link="ProtosExpan\UseInfo\Pay.cs" />
+ <Compile Include="..\ProtosExpan\UseInfo\PayDiv.cs" Link="ProtosExpan\UseInfo\PayDiv.cs" />
+ <Compile Include="..\ProtosExpan\UseInfo\Receipt.cs" Link="ProtosExpan\UseInfo\Receipt.cs" />
+ <Compile Include="..\ProtosExpan\UseInfo\Rental.cs" Link="ProtosExpan\UseInfo\Rental.cs" />
+ <Compile Include="..\ProtosExpan\UseInfo\Sale.cs" Link="ProtosExpan\UseInfo\Sale.cs" />
+ <Compile Include="..\ProtosExpan\UseInfo\SaleDiv.cs" Link="ProtosExpan\UseInfo\SaleDiv.cs" />
+ <Compile Include="..\ProtosExpan\UseInfo\Use.cs" Link="ProtosExpan\UseInfo\Use.cs" />
+ <Compile Include="..\ProtosExpan\UseInfo\Use.Server.cs" Link="ProtosExpan\UseInfo\Use.Server.cs" />
+ <Compile Include="..\ProtosExpan\UseInfo\UseAllo.cs" Link="ProtosExpan\UseInfo\UseAllo.cs" />
+ <Compile Include="..\ProtosExpan\UseInfo\UseAllo.Server.cs" Link="ProtosExpan\UseInfo\UseAllo.Server.cs" />
+ <Compile Include="..\ProtosExpan\UseInfo\UseDetail.cs" Link="ProtosExpan\UseInfo\UseDetail.cs" />
+ <Compile Include="..\ProtosExpan\UseInfo\UseFree.cs" Link="ProtosExpan\UseInfo\UseFree.cs" />
+ <Compile Include="..\ProtosExpan\UseInfo\UseMemo.cs" Link="ProtosExpan\UseInfo\UseMemo.cs" />
+ <Compile Include="..\ProtosExpan\UseInfo\UsePerson.cs" Link="ProtosExpan\UseInfo\UsePerson.cs" />
+ <Compile Include="..\ProtosExpan\UseInfo\UsePersonFree.cs" Link="ProtosExpan\UseInfo\UsePersonFree.cs" />
+ <Compile Include="..\ProtosExpan\UseInfo\UsePersonTel.cs" Link="ProtosExpan\UseInfo\UsePersonTel.cs" />
+ <Compile Include="..\ProtosExpan\UseInfo\UseRoom.cs" Link="ProtosExpan\UseInfo\UseRoom.cs" />
+ <Compile Include="..\ProtosExpan\Master\Hotel.cs" Link="ProtosExpan\Master\Hotel.cs" />
+ <Compile Include="..\ProtosExpan\Master\Demo.cs" Link="ProtosExpan\Master\Demo.cs" />
+ <Compile Include="..\ProtosExpan\Master\Building.cs" Link="ProtosExpan\Master\Building.cs" />
+ <Compile Include="..\ProtosExpan\Master\OutputItem.cs" Link="ProtosExpan\Master\OutputItem.cs" />
+ <Compile Include="..\ProtosExpan\Master\Output.cs" Link="ProtosExpan\Master\Output.cs" />
+ <Compile Include="..\ProtosExpan\Master\RoomViewTab.cs" Link="ProtosExpan\Master\RoomViewTab.cs" />
+ <Compile Include="..\ProtosExpan\Master\RoomViewLayout.cs" Link="ProtosExpan\Master\RoomViewLayout.cs" />
+ <Compile Include="..\ProtosExpan\Master\RoomCell.cs" Link="ProtosExpan\Master\RoomCell.cs" />
+ <Compile Include="..\ProtosExpan\Master\Option.cs" Link="ProtosExpan\Master\Option.cs" />
+ <Compile Include="..\ProtosExpan\Master\RoomStatus.cs" Link="ProtosExpan\Master\RoomStatus.cs" />
+ <Compile Include="..\ProtosExpan\Master\RoomType.cs" Link="ProtosExpan\Master\RoomType.cs" />
+ <Compile Include="..\ProtosExpan\Master\Item.cs" Link="ProtosExpan\Master\Item.cs" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <Protobuf Include="..\Protos\greet.proto" GrpcServices="Server" Link="Protos\greet.proto" />
+ <Protobuf Include="..\Protos\sqlwhere.proto" GrpcServices="Server" Link="Protos\sqlwhere.proto" />
+ <Protobuf Include="..\Protos\grpcset.proto" GrpcServices="Server" Link="Protos\grpcset.proto" />
+ <Protobuf Include="..\Protos\grpctable.proto" GrpcServices="Server" Link="Protos\grpctable.proto" />
+ <Protobuf Include="..\Protos\datarequest.proto" GrpcServices="Server" Link="Protos\datarequest.proto" />
+ <Protobuf Include="..\Protos\dataresult.proto" GrpcServices="Server" Link="Protos\dataresult.proto" />
+ <Protobuf Include="..\Protos\file.proto" GrpcServices="Server" Link="Protos\file.proto" />
+ <Protobuf Include="..\Protos\use.proto" GrpcServices="Server" Link="Protos\use.proto" />
+ <Protobuf Include="..\Protos\usedetail.proto" GrpcServices="Server" Link="Protos\usedetail.proto" />
+ <Protobuf Include="..\Protos\useperson.proto" GrpcServices="Server" Link="Protos\useperson.proto" />
+ <Protobuf Include="..\Protos\useallo.proto" GrpcServices="Server" Link="Protos\useallo.proto" />
+ <Protobuf Include="..\Protos\useroom.proto" GrpcServices="Server" Link="Protos\useroom.proto" />
+ <Protobuf Include="..\Protos\arrange.proto" GrpcServices="Server" Link="Protos\arrange.proto" />
+ <Protobuf Include="..\Protos\pay.proto" GrpcServices="Server" Link="Protos\pay.proto" />
+ <Protobuf Include="..\Protos\paydiv.proto" GrpcServices="Server" Link="Protos\paydiv.proto" />
+ <Protobuf Include="..\Protos\receipt.proto" GrpcServices="Server" Link="Protos\receipt.proto" />
+ <Protobuf Include="..\Protos\rental.proto" GrpcServices="Server" Link="Protos\rental.proto" />
+ <Protobuf Include="..\Protos\sale.proto" GrpcServices="Server" Link="Protos\sale.proto" />
+ <Protobuf Include="..\Protos\salediv.proto" GrpcServices="Server" Link="Protos\salediv.proto" />
+ <Protobuf Include="..\Protos\usefree.proto" GrpcServices="Server" Link="Protos\usefree.proto" />
+ <Protobuf Include="..\Protos\usememo.proto" GrpcServices="Server" Link="Protos\usememo.proto" />
+ <Protobuf Include="..\Protos\usepersonfree.proto" GrpcServices="Server" Link="Protos\usepersonfree.proto" />
+ <Protobuf Include="..\Protos\usepersontel.proto" GrpcServices="Server" Link="Protos\usepersontel.proto" />
+ <Protobuf Include="..\Protos\customTypes.proto" GrpcServices="Server" Link="Protos\customTypes.proto" />
+ <Protobuf Include="..\Protos\hotel.proto" GrpcServices="Server" Link="Protos\hotel.proto" />
+ <Protobuf Include="..\Protos\demo.proto" GrpcServices="Server" Link="Protos\demo.proto" />
+ <Protobuf Include="..\Protos\building.proto" GrpcServices="Server" Link="Protos\building.proto" />
+ <Protobuf Include="..\Protos\outputitem.proto" GrpcServices="Server" Link="Protos\outputitem.proto" />
+ <Protobuf Include="..\Protos\output.proto" GrpcServices="Server" Link="Protos\output.proto" />
+ <Protobuf Include="..\Protos\loginresult.proto" GrpcServices="Server" Link="Protos\loginresult.proto" />
+ <Protobuf Include="..\Protos\reportcol.proto" GrpcServices="Server" Link="Protos\reportcol.proto" />
+ <Protobuf Include="..\Protos\roomviewtab.proto" GrpcServices="Server" Link="Protos\roomviewtab.proto" />
+ <Protobuf Include="..\Protos\roomviewlayout.proto" GrpcServices="Server" Link="Protos\roomviewlayout.proto" />
+ <Protobuf Include="..\Protos\roomcell.proto" GrpcServices="Server" Link="Protos\roomcell.proto" />
+ <Protobuf Include="..\Protos\option.proto" GrpcServices="Server" Link="Protos\option.proto" />
+ <Protobuf Include="..\Protos\roomstatus.proto" GrpcServices="Server" Link="Protos\roomstatus.proto" />
+ <Protobuf Include="..\Protos\roomtype.proto" GrpcServices="Server" Link="Protos\roomtype.proto" />
+ <Protobuf Include="..\Protos\item.proto" GrpcServices="Server" Link="Protos\item.proto" />
+ <Protobuf Include="..\Protos\sale.proto" GrpcServices="Server" Link="Protos\sale.proto" />
+ <PackageReference Include="Grpc.AspNetCore" Version="2.70.0" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <ProjectReference Include="..\HotelPms.Data.Common\HotelPms.Data.Common.csproj" />
+ <ProjectReference Include="..\HotelPms.Share\HotelPms.Share.csproj" />
+ </ItemGroup>
+
+</Project>
diff --git a/HotelPms.Data.Server/ProtosExpan/CustomTypes/Readme.txt b/HotelPms.Data.Server/ProtosExpan/CustomTypes/Readme.txt
new file mode 100644
index 0000000..5f28270
--- /dev/null
+++ b/HotelPms.Data.Server/ProtosExpan/CustomTypes/Readme.txt
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/HotelPms.Data.Server/ProtosExpan/Master/Option.Expan.cs b/HotelPms.Data.Server/ProtosExpan/Master/Option.Expan.cs
new file mode 100644
index 0000000..eb03add
--- /dev/null
+++ b/HotelPms.Data.Server/ProtosExpan/Master/Option.Expan.cs
@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HotelPms.Data.Server.ProtosExpan.Master
+{
+ public partial class Option
+ {
+ public enum GroupKey : int
+ {
+ [Description("システム設定")]
+ System = 0,
+ }
+
+ public enum OptionKey : int
+ {
+ [Description("バッチ種類")]
+ System_BatType = 0,
+ }
+ }
+}
diff --git a/HotelPms.Data.Server/ProtosExpan/Master/Output.Expan.cs b/HotelPms.Data.Server/ProtosExpan/Master/Output.Expan.cs
new file mode 100644
index 0000000..c603415
--- /dev/null
+++ b/HotelPms.Data.Server/ProtosExpan/Master/Output.Expan.cs
@@ -0,0 +1,15 @@
+namespace HotelPms.Data.Master
+{
+ public partial class Output
+ {
+ public string MaxIDSql()
+ {
+ return $@"SELECT ISNULL(MAX(ID),0) FROM M_Output WHERE MachineName = N'{MachineName}' AND UserName = N'{UserName}' AND ReportID = {ReportID};";
+ }
+
+ public string ClearDetailSql()
+ {
+ return $@"DELETE FROM M_OutputItem WHERE MachineName = N'{MachineName}' AND UserName = N'{UserName}' AND ReportID = {ReportID} AND OutputID = {ID};";
+ }
+ }
+}
diff --git a/HotelPms.Data.Server/ProtosExpan/Master/Readme.txt b/HotelPms.Data.Server/ProtosExpan/Master/Readme.txt
new file mode 100644
index 0000000..5f28270
--- /dev/null
+++ b/HotelPms.Data.Server/ProtosExpan/Master/Readme.txt
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/HotelPms.Data.Server/ProtosExpan/Master/ReportCol.cs b/HotelPms.Data.Server/ProtosExpan/Master/ReportCol.cs
new file mode 100644
index 0000000..da20b22
--- /dev/null
+++ b/HotelPms.Data.Server/ProtosExpan/Master/ReportCol.cs
@@ -0,0 +1,155 @@
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Text;
+using HotelPms.Share.Data;
+using HotelPms.Share.Util;
+using Google.Protobuf.WellKnownTypes;
+
+namespace HotelPms.Data.Master
+{
+ /// ****************************** Description *******************************
+ /// ◇システム名称
+ /// ホテルPMS
+ /// ◇概要
+ ///
+ /// ◇履歴
+ /// 2021/07/02 コード作成ツール 自動作成
+ /// ****************************** Declarations ******************************
+ [Serializable()]
+ public partial class ReportCol : RecordBase
+ {
+ #region ★★★★★ Property ★★★★★
+
+ public static ConcurrentDictionary<string, int> PrimaryKey { get; } = new ConcurrentDictionary<string, int>();
+
+ #endregion
+
+ partial void OnConstruction()
+ {
+ if (PrimaryKey.Count == 0)
+ {
+ PrimaryKey.TryAdd("SystemID", 0);
+ PrimaryKey.TryAdd("ReportID", 0);
+ PrimaryKey.TryAdd("ID", 0);
+
+ }
+ }
+
+ #region ★★★★★ Function ★★★★★
+
+
+ public override void CopyTo(object dest)
+ {
+ ReportCol item = dest as ReportCol;
+ item.SystemID = SystemID;
+ item.ReportID = ReportID;
+ item.ID = ID;
+ item.Name = Name;
+ item.Type = Type;
+ item.DispName = DispName;
+
+ }
+
+ public override void Clear()
+ {
+ SystemID = 0;
+ ReportID = 0;
+ ID = 0;
+ Name = string.Empty;
+ Type = 0;
+ DispName = string.Empty;
+
+ }
+
+ public ReportCol DeepClone()
+ {
+ ReportCol item = new ReportCol();
+ item.SystemID = SystemID;
+ item.ReportID = ReportID;
+ item.ID = ID;
+ item.Name = Name;
+ item.Type = Type;
+ item.DispName = DispName;
+
+ return item;
+ }
+
+ private Timestamp ToTimestamp(DateTime dateTime)
+ {
+ return Timestamp.FromDateTime(DateTime.SpecifyKind(dateTime, DateTimeKind.Utc));
+ }
+
+ public override bool ConvertDataRow(System.Data.DataRow row)
+ {
+ SystemID = CConvert.ToInt(row["SystemID"],SystemID);
+ ReportID = CConvert.ToInt(row["ReportID"],ReportID);
+ ID = CConvert.ToInt(row["ID"],ID);
+ Name = row["Name"].ToString();
+ Type = CConvert.ToInt(row["Type"],Type);
+ DispName = row["DispName"].ToString();
+
+ return true;
+ }
+
+ public void ToDataRow(System.Data.DataRow row)
+ {
+ row["SystemID"] = SystemID;
+ row["ReportID"] = ReportID;
+ row["ID"] = ID;
+ row["Name"] = Name;
+ row["Type"] = Type;
+ row["DispName"] = DispName;
+
+ }
+
+ public void ConvertReader(SqlDataReader row)
+ {
+ SystemID = CConvert.ToInt(row["SystemID"],SystemID);
+ ReportID = CConvert.ToInt(row["ReportID"],ReportID);
+ ID = CConvert.ToInt(row["ID"],ID);
+ Name = row["Name"].ToString();
+ Type = CConvert.ToInt(row["Type"],Type);
+ DispName = row["DispName"].ToString();
+
+ }
+
+ public string AddSql()
+ {
+ return $@"INSERT INTO S_ReportCol(SystemID,ReportID,ID,Name,Type,DispName) VALUES({SystemID},{ReportID},{ID},N'{Name}',{Type},N'{DispName}');";
+ }
+
+ public string UpdateSql()
+ {
+ return $@"UPDATE S_ReportCol SET Name = N'{Name}',Type = {Type},DispName = N'{DispName}' WHERE SystemID = {SystemID},ReportID = {ReportID},ID = {ID};";
+ }
+
+ public string ToText()
+ {
+ StringBuilder text = new StringBuilder();
+ text.AppendFormat("SystemID={0};", SystemID);
+ text.AppendFormat("ReportID={0};", ReportID);
+ text.AppendFormat("ID={0};", ID);
+ text.AppendFormat("Name={0};", Name);
+ text.AppendFormat("Type={0};", Type);
+ text.AppendFormat("DispName={0};", DispName);
+
+ return text.ToString();
+ }
+
+ public override object GetField(string name)
+ {
+
+ if (name.ToLower() == "SystemID".ToLower()) { return SystemID; }
+ else if (name.ToLower() == "ReportID".ToLower()) { return ReportID; }
+ else if (name.ToLower() == "ID".ToLower()) { return ID; }
+ else if (name.ToLower() == "Name".ToLower()) { return Name; }
+ else if (name.ToLower() == "Type".ToLower()) { return Type; }
+ else if (name.ToLower() == "DispName".ToLower()) { return DispName; }
+ else { return null; }
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.Data.Server/ProtosExpan/UseInfo/Readme.txt b/HotelPms.Data.Server/ProtosExpan/UseInfo/Readme.txt
new file mode 100644
index 0000000..5f28270
--- /dev/null
+++ b/HotelPms.Data.Server/ProtosExpan/UseInfo/Readme.txt
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/HotelPms.DataAccessDirect.Client/DemoAccess.cs b/HotelPms.DataAccessDirect.Client/DemoAccess.cs
new file mode 100644
index 0000000..35cd328
--- /dev/null
+++ b/HotelPms.DataAccessDirect.Client/DemoAccess.cs
@@ -0,0 +1,140 @@
+using HotelPms.Data;
+using HotelPms.Data.Common.Interface.Access;
+using HotelPms.Data.Master;
+using HotelPms.Share.Data;
+using HotelPms.Share.IO;
+using HotelPms.Share.Util;
+using System.Data;
+
+namespace HotelPms.DataAccessDirect.Client
+{
+ /// <summary>
+ /// 直接DBへアクセスする仕組み
+ /// データベース制御(クライアント側)
+ /// </summary>
+ public class DemoAccess : DataAccessDirectBase, IDisposable, IDemo
+ {
+ /// <summary>
+ ///
+ /// </summary>
+ /// <param name="access"></param>
+ public DemoAccess(DataAccess access)
+ {
+ TableName = "M_Demo";
+ DBAccess = access;
+ }
+
+ public void Dispose()
+ {
+ }
+
+ /// <summary>
+ /// 排他チェックのため、最新更新日取得する
+ /// </summary>
+ /// <param name="pID"></param>
+ /// <returns></returns>
+ public int GetUpdateID(int pID)
+ {
+ return CConvert.ToInt(DBAccess.ExecuteScalar($"SELECT UpdateID FROM {TableName} WHERE ID = {pID}"));
+ }
+
+ /// <summary>
+ /// 存在チェック
+ /// </summary>
+ /// <param name="pID"></param>
+ /// <returns></returns>
+ public bool Exists(int pID)
+ {
+ return CConvert.ToInt(DBAccess.ExecuteScalar($"IF EXISTS(SELECT 1 FROM {TableName} WHERE ID = {pID}) SELECT 1 ELSE SELECT 0")) == 1;
+ }
+
+ /// <summary>
+ /// データ行を取得する
+ /// </summary>
+ /// <param name="pID"></param>
+ /// <returns></returns>
+ public Demo GetItem(int pID)
+ {
+ var result = DBAccess.GetDataReader<Demo>($"SELECT * FROM {TableName}", (reader, data) =>
+ {
+ while (reader.Read())
+ {
+ data.ConvertReader(reader);
+ }
+ });
+ return result;
+ }
+
+ /// <summary>
+ /// テーブル全データ返す
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public DataTable GetMasterGridData(string where)
+ {
+ return DBAccess.GetDataTable($"SELECT A.* FROM {TableName} A {(string.IsNullOrEmpty(where) ? string.Empty : $"WHERE {where}")} ORDER BY A.ID");
+ }
+
+ /// <summary>
+ /// データ削除
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public DataResult Remove(string where)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ string sql = $"DELETE FROM {TableName} WHERE {where}";
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+ if (DBAccess.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = DBAccess.ErrNo;
+ result.ErrData = DBAccess.ErrInfo;
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ /// <summary>
+ /// 追加・更新
+ /// </summary>
+ /// <param name="add"></param>
+ /// <param name="item"></param>
+ /// <returns></returns>
+ private DataResult AddOrUpdate(bool add, Demo item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = add ? item.AddSql() : item.UpdateSql();
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ if (DBAccess.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = DBAccess.ErrNo;
+ result.ErrData = DBAccess.ErrInfo;
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ /// <summary>
+ /// 追加
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public DataResult Add(Demo data)
+ {
+ return AddOrUpdate(true, data);
+ }
+
+ /// <summary>
+ /// 更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public DataResult Update(Demo data)
+ {
+ return AddOrUpdate(false, data);
+ }
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.DataAccessDirect.Client/HotelPms.DataAccessDirect.Client.csproj b/HotelPms.DataAccessDirect.Client/HotelPms.DataAccessDirect.Client.csproj
new file mode 100644
index 0000000..5c0334a
--- /dev/null
+++ b/HotelPms.DataAccessDirect.Client/HotelPms.DataAccessDirect.Client.csproj
@@ -0,0 +1,14 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <TargetFramework>net9.0</TargetFramework>
+ <ImplicitUsings>enable</ImplicitUsings>
+ <Nullable>enable</Nullable>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <ProjectReference Include="..\HotelPms.Data.Client\HotelPms.Data.Client.csproj" />
+ <ProjectReference Include="..\HotelPms.Data.Common\HotelPms.Data.Common.csproj" />
+ </ItemGroup>
+
+</Project>
diff --git a/HotelPms.DataAccessDirect.Server/DemoAccess.cs b/HotelPms.DataAccessDirect.Server/DemoAccess.cs
new file mode 100644
index 0000000..827fde2
--- /dev/null
+++ b/HotelPms.DataAccessDirect.Server/DemoAccess.cs
@@ -0,0 +1,73 @@
+using HotelPms.Data;
+using HotelPms.Data.Master;
+using HotelPms.Share.Data;
+using HotelPms.Share.IO;
+using System.Data;
+
+namespace HotelPms.DataAccessDirect.Server
+{
+ /// <summary>
+ /// データベース制御(サーバー側)
+ /// 未使用
+ /// </summary>
+ public class DemoAccess : DataAccessDirectBase, IDisposable
+ {
+ /// <summary>
+ ///
+ /// </summary>
+ /// <param name="access"></param>
+ public DemoAccess(DataAccess access)
+ {
+ TableName = "M_Demo";
+ DBAccess = access;
+ }
+
+ public void Dispose()
+ {
+ }
+
+ public DataResult Add(Demo data)
+ {
+ throw new NotImplementedException();
+ }
+
+ public bool Exists(int pID)
+ {
+ throw new NotImplementedException();
+ }
+
+ public Demo GetItem(int pID)
+ {
+ throw new NotImplementedException();
+ }
+
+ public DataTable GetMasterGridData(string where)
+ {
+ throw new NotImplementedException();
+ }
+
+ /// <summary>
+ /// データ削除
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public DataResult Remove(string where)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ string sql = $"DELETE FROM {TableName} WHERE {where}";
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+ if (DBAccess.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = DBAccess.ErrNo;
+ result.ErrData = DBAccess.ErrInfo;
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ public DataResult Update(Demo data)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.DataAccessDirect.Server/HotelPms.DataAccessDirect.Server.csproj b/HotelPms.DataAccessDirect.Server/HotelPms.DataAccessDirect.Server.csproj
new file mode 100644
index 0000000..f297c2d
--- /dev/null
+++ b/HotelPms.DataAccessDirect.Server/HotelPms.DataAccessDirect.Server.csproj
@@ -0,0 +1,14 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <TargetFramework>net9.0</TargetFramework>
+ <ImplicitUsings>enable</ImplicitUsings>
+ <Nullable>enable</Nullable>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <ProjectReference Include="..\HotelPms.Data.Common\HotelPms.Data.Common.csproj" />
+ <ProjectReference Include="..\HotelPms.Data.Server\HotelPms.Data.Server.csproj" />
+ </ItemGroup>
+
+</Project>
diff --git a/HotelPms.DataAccessGrpc.Client/AddressAccess.Expan.cs b/HotelPms.DataAccessGrpc.Client/AddressAccess.Expan.cs
new file mode 100644
index 0000000..0a38e72
--- /dev/null
+++ b/HotelPms.DataAccessGrpc.Client/AddressAccess.Expan.cs
@@ -0,0 +1,42 @@
+using Grpc.Net.Client;
+using HotelPms.Data;
+using HotelPms.Data.Client;
+using HotelPms.Data.Common;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HotelPms.DataAccessGrpc.Client
+{
+ public partial class AddressAccess
+ {
+ /// <summary>
+ /// 郵便番号検索候補一覧を取得する
+ /// LIKE 'postNo%'
+ /// </summary>
+ /// <param name="channel"></param>
+ /// <param name="postNo"></param>
+ /// <returns></returns>
+ public async static Task<DataTable> GetPostNoSearch(GrpcChannel channel, string postNo)
+ {
+ GrpcTable table = await GrpcClient.GetTableStream(channel, (int)ETableActionType.PostNoSearch, postNo);
+ return table.ToDataTable();
+ }
+
+ /// <summary>
+ /// 住所検索候補一覧を取得する
+ /// LIKE '%address%'
+ /// </summary>
+ /// <param name="channel"></param>
+ /// <param name="address"></param>
+ /// <returns></returns>
+ public async static Task<DataTable> GetAddressSearch(GrpcChannel channel, string address)
+ {
+ GrpcTable table = await GrpcClient.GetTableStream(channel, (int)ETableActionType.AddressSearch, address);
+ return table.ToDataTable();
+ }
+ }
+}
diff --git a/HotelPms.DataAccessGrpc.Client/ArrangeAccess.cs b/HotelPms.DataAccessGrpc.Client/ArrangeAccess.cs
new file mode 100644
index 0000000..0f66fc6
--- /dev/null
+++ b/HotelPms.DataAccessGrpc.Client/ArrangeAccess.cs
@@ -0,0 +1,267 @@
+using Google.Protobuf;
+using Grpc.Core;
+using Grpc.Net.Client;
+using HotelPms.Data.Common;
+using HotelPms.Data.UseInfo;
+using HotelPms.Share.Util;
+using System;
+using System.Data;
+using System.Threading.Tasks;
+using HotelPms.Data;
+using System.Collections.Generic;
+using HotelPms.Data.Common.Pagination;
+using System.Text.Json;
+using System.Threading;
+using HotelPms.Data.Client;
+
+namespace HotelPms.DataAccessGrpc.Client
+{
+ internal class ArrangeAccess : IDisposable
+ {
+ /// <summary>
+ /// チャネル
+ /// </summary>
+ public GrpcChannel Channel { get; private set; } = null;
+ public ArrangeCore.ArrangeCoreClient Client { get; private set; } = null;
+
+
+ public ArrangeAccess(GrpcChannel channel)
+ {
+ Channel = channel;
+ Client = new ArrangeCore.ArrangeCoreClient(Channel);
+ }
+
+ public void Dispose()
+ {
+
+ }
+
+ public async Task<bool> Exists(int pID,int pDetailID,DateTime pUseDate)
+ {
+ return await GrpcClient.ExecuteScalar(Channel, $"IF EXISTS(SELECT 1 FROM D_Arrange WHERE ID = {pID} AND DetailID = {pDetailID} AND UseDate = {CConvert.ToSqlValue(pUseDate)}) SELECT 1 ELSE SELECT 0") == "1";
+
+ }
+
+ public async Task<FileGrpcData> OutputStream(PagingRequest request)
+ {
+ FileGrpcData data = null;
+ request.Table = "D_Arrange";
+ string json = JsonSerializer.Serialize(request);
+ using (var call = Client.OutputStream(GrpcClient.CreateDataRequest(2, json)))
+ {
+ var reaponseStream = call.ResponseStream;
+ //データの取得
+ while (await reaponseStream.MoveNext(CancellationToken.None))
+ {
+ data = reaponseStream.Current;
+ }
+ }
+ return data;
+ }
+
+ public async Task<ArrangeTable> GetPageData(PagingRequest request)
+ {
+ request.Table = "D_Arrange";
+ string json = JsonSerializer.Serialize(request);
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(1, json));
+ }
+
+
+ public DataTable GetMasterGridData(string where)
+ {
+ GrpcTable table = GrpcClient.GetTable(Channel, (int)ETableActionType.BuildingMasterGrid, where);
+ return table.ToDataTable();
+ }
+
+ /// <summary>
+ /// 同期データ取得
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public ArrangeTable GetData(string where)
+ {
+ return Client.GetData(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ public async Task<ArrangeTable> GetDataAsync(string where)
+ {
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public Arrange GetItem(int pID,int pDetailID,DateTime pUseDate)
+ {
+ ArrangeTable table = GetData($"ID = {pID} AND DetailID = {pDetailID} AND UseDate = {CConvert.ToSqlValue(pUseDate)}");
+ if(table == null || table.ErrNo != 0 || table.Rows.Count == 0) { return null; }
+ return table.Rows[0];
+ }
+
+ public async Task<ArrangeTable> GetDataStream()
+ {
+ return await GetDataStream(string.Empty);
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public async Task<ArrangeTable> GetDataStream(string where)
+ {
+ ArrangeTable table = null;
+ using (var call = Client.GetDataStream())
+ {
+ await call.RequestStream.WriteAsync(GrpcClient.CreateDataRequest(0, where));
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<ArrangeTable>())
+ {
+ table = message;
+ break;
+ }
+ }
+ return table;
+ }
+
+ public async Task<DataResult> AddAsync(Arrange data)
+ {
+ return await Client.AddAsync(data);
+ }
+
+ public DataResult Add(Arrange data)
+ {
+ return Client.Add(data);
+ }
+
+ public async Task<DataResult> UpdateAsync(Arrange data)
+ {
+ return await Client.UpdateAsync(data);
+ }
+
+ public DataResult Update(Arrange data)
+ {
+ return Client.Update(data);
+ }
+
+ /// <summary>
+ /// 追加若しくは更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <param name="add"></param>
+ /// <returns></returns>
+ private async Task<DataResult> AddOrUpdateStream(Arrange data, bool add)
+ {
+ DataResult result = null;
+ using (var call = add ? Client.AddStream() : Client.UpdateStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ /// <summary>
+ /// 追加
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> AddStream(Arrange data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ /// <summary>
+ /// 更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> UpdateStream(Arrange data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ public DataResult Remove(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return Client.Remove(data);
+ }
+
+ public async Task<DataResult> RemoveAsync(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return await Client.RemoveAsync(data);
+ }
+
+ /// <summary>
+ /// 削除
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public async Task<DataResult> RemoveStream(string where)
+ {
+ DataResult result = null;
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+
+ using (var call = Client.RemoveStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ public DataResult SetData(ArrangeTable table)
+ {
+ return Client.SetData(table);
+ }
+
+ /// <summary>
+ /// バッチ更新
+ /// </summary>
+ /// <param name="table"></param>
+ /// <returns></returns>
+ public async Task<DataResult> SetDataStream(ArrangeTable table)
+ {
+ DataResult result = null;
+ using (var call = Client.SetDataStream())
+ {
+ await call.RequestStream.WriteAsync(table);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+ }
+}
diff --git a/HotelPms.DataAccessGrpc.Client/AuthAccess.cs b/HotelPms.DataAccessGrpc.Client/AuthAccess.cs
new file mode 100644
index 0000000..fa8321c
--- /dev/null
+++ b/HotelPms.DataAccessGrpc.Client/AuthAccess.cs
@@ -0,0 +1,62 @@
+using HotelPms.Data;
+using Grpc.Net.Client;
+using System;
+using System.Threading.Tasks;
+
+namespace HotelPms.DataAccessGrpc.Client
+{
+ public class AuthAccess : IDisposable
+ {
+ /// <summary>
+ /// チャネル
+ /// </summary>
+ public GrpcChannel Channel { get; private set; } = null;
+ public AuthCore.AuthCoreClient Client { get; private set; } = null;
+
+
+ public AuthAccess(GrpcChannel channel)
+ {
+ Channel = channel;
+ Client = new AuthCore.AuthCoreClient(Channel);
+ }
+
+ public void Dispose()
+ {
+
+ }
+
+ public async Task<LoginResult> LoginAsync(string loginID, string password)
+ {
+ return await Client.LoginAsync(new DataRequest
+ {
+ ActionType = 0,
+ Data = string.Empty,
+ CustomerID = "001",
+ LoginID = loginID,
+ Password = password,
+ SystemID = 1,
+ RefTables = string.Empty,
+ IP = "127.0.0.1",
+ MachineName = Environment.MachineName,
+ OS = Environment.OSVersion.ToString()
+ });
+ }
+
+ public async Task<LoginResult> LogoutAsync(string loginID)
+ {
+ return await Client.LoginAsync(new DataRequest
+ {
+ ActionType = 0,
+ Data = string.Empty,
+ CustomerID = "001",
+ LoginID = loginID,
+ Password = string.Empty,
+ SystemID = 1,
+ RefTables = string.Empty,
+ IP = "127.0.0.1",
+ MachineName = Environment.MachineName,
+ OS = Environment.OSVersion.ToString()
+ });
+ }
+ }
+}
diff --git a/HotelPms.DataAccessGrpc.Client/BuildingAccess.cs b/HotelPms.DataAccessGrpc.Client/BuildingAccess.cs
new file mode 100644
index 0000000..44c1217
--- /dev/null
+++ b/HotelPms.DataAccessGrpc.Client/BuildingAccess.cs
@@ -0,0 +1,273 @@
+using Google.Protobuf;
+using Grpc.Core;
+using Grpc.Net.Client;
+using HotelPms.Data.Client;
+using HotelPms.Data.Common;
+using HotelPms.Data.Master;
+using HotelPms.Share.Util;
+using System;
+using System.Data;
+using System.Threading.Tasks;
+using HotelPms.Data;
+using System.Collections.Generic;
+using HotelPms.Data.Common.Pagination;
+using System.Text.Json;
+using System.Threading;
+
+namespace HotelPms.DataAccessGrpc.Client
+{
+ public class BuildingAccess : IDisposable
+ {
+ /// <summary>
+ /// チャネル
+ /// </summary>
+ public GrpcChannel Channel { get; private set; } = null;
+ public BuildingCore.BuildingCoreClient Client { get; private set; } = null;
+
+
+ public BuildingAccess(GrpcChannel channel)
+ {
+ Channel = channel;
+ Client = new BuildingCore.BuildingCoreClient(Channel);
+ }
+
+ public void Dispose()
+ {
+
+ }
+
+ public bool Exists(int pID)
+ {
+ return GrpcClient.ExecuteScalarSync(Channel, $"IF EXISTS(SELECT 1 FROM M_Building WHERE ID = {pID}) SELECT 1 ELSE SELECT 0") == "1";
+
+ }
+
+ public async Task<bool> ExistsAsync(int pID)
+ {
+ return await GrpcClient.ExecuteScalar(Channel, $"IF EXISTS(SELECT 1 FROM M_Building WHERE ID = {pID}) SELECT 1 ELSE SELECT 0") == "1";
+
+ }
+
+ public async Task<FileGrpcData> OutputStream(PagingRequest request)
+ {
+ FileGrpcData data = null;
+ request.Table = "M_Building";
+ string json = JsonSerializer.Serialize(request);
+ using (var call = Client.OutputStream(GrpcClient.CreateDataRequest(2, json)))
+ {
+ var reaponseStream = call.ResponseStream;
+ //データの取得
+ while (await reaponseStream.MoveNext(CancellationToken.None))
+ {
+ data = reaponseStream.Current;
+ }
+ }
+ return data;
+ }
+
+ public async Task<BuildingTable> GetPageData(PagingRequest request)
+ {
+ request.Table = "M_Building";
+ string json = JsonSerializer.Serialize(request);
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(1, json));
+ }
+
+
+ public DataTable GetMasterGridData(string where)
+ {
+ GrpcTable table = GrpcClient.GetTable(Channel, (int)ETableActionType.BuildingMasterGrid, where);
+ return table.ToDataTable();
+ }
+
+ /// <summary>
+ /// 同期データ取得
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public BuildingTable GetData(string where)
+ {
+ return Client.GetData(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ public async Task<BuildingTable> GetDataAsync(string where)
+ {
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public Building GetItem(int pID)
+ {
+ BuildingTable table = GetData($"ID = {pID}");
+ if(table == null || table.ErrNo != 0 || table.Rows.Count == 0) { return null; }
+ return table.Rows[0];
+ }
+
+ public async Task<BuildingTable> GetDataStream()
+ {
+ return await GetDataStream(string.Empty);
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public async Task<BuildingTable> GetDataStream(string where)
+ {
+ BuildingTable table = null;
+ using (var call = Client.GetDataStream())
+ {
+ await call.RequestStream.WriteAsync(GrpcClient.CreateDataRequest(0, where));
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<BuildingTable>())
+ {
+ table = message;
+ break;
+ }
+ }
+ return table;
+ }
+
+ public async Task<DataResult> AddAsync(Building data)
+ {
+ return await Client.AddAsync(data);
+ }
+
+ public DataResult Add(Building data)
+ {
+ return Client.Add(data);
+ }
+
+ public async Task<DataResult> UpdateAsync(Building data)
+ {
+ return await Client.UpdateAsync(data);
+ }
+
+ public DataResult Update(Building data)
+ {
+ return Client.Update(data);
+ }
+
+ /// <summary>
+ /// 追加若しくは更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <param name="add"></param>
+ /// <returns></returns>
+ private async Task<DataResult> AddOrUpdateStream(Building data, bool add)
+ {
+ DataResult result = null;
+ using (var call = add ? Client.AddStream() : Client.UpdateStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ /// <summary>
+ /// 追加
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> AddStream(Building data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ /// <summary>
+ /// 更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> UpdateStream(Building data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ public DataResult Remove(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return Client.Remove(data);
+ }
+
+ public async Task<DataResult> RemoveAsync(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return await Client.RemoveAsync(data);
+ }
+
+ /// <summary>
+ /// 削除
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public async Task<DataResult> RemoveStream(string where)
+ {
+ DataResult result = null;
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+
+ using (var call = Client.RemoveStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ public DataResult SetData(BuildingTable table)
+ {
+ return Client.SetData(table);
+ }
+
+ /// <summary>
+ /// バッチ更新
+ /// </summary>
+ /// <param name="table"></param>
+ /// <returns></returns>
+ public async Task<DataResult> SetDataStream(BuildingTable table)
+ {
+ DataResult result = null;
+ using (var call = Client.SetDataStream())
+ {
+ await call.RequestStream.WriteAsync(table);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+ }
+}
diff --git a/HotelPms.DataAccessGrpc.Client/DemoAccess.cs b/HotelPms.DataAccessGrpc.Client/DemoAccess.cs
new file mode 100644
index 0000000..9c76bc9
--- /dev/null
+++ b/HotelPms.DataAccessGrpc.Client/DemoAccess.cs
@@ -0,0 +1,289 @@
+using Google.Protobuf;
+using Grpc.Core;
+using Grpc.Net.Client;
+using HotelPms.Data;
+using HotelPms.Data.Client;
+using HotelPms.Data.Common;
+using HotelPms.Data.Common.Interface.Access;
+using HotelPms.Data.Common.Pagination;
+using HotelPms.Data.Master;
+using HotelPms.Share.Util;
+using System.Data;
+using System.Text.Json;
+
+namespace HotelPms.DataAccessGrpc.Client
+{
+ public class DemoAccess : IDisposable, IDemo
+ {
+ /// <summary>
+ /// チャネル
+ /// </summary>
+ public GrpcChannel? Channel { get; private set; }
+ public DemoCore.DemoCoreClient? Client { get; private set; }
+
+ private static DemoAccess? m_Default;
+
+ public static DemoAccess Instance
+ {
+ get
+ {
+ if (m_Default == null) { m_Default = new DemoAccess(GrpcFactory.Instance.Channel); }
+ return m_Default;
+ }
+ }
+
+ public DemoAccess(GrpcChannel channel)
+ {
+ Channel = channel;
+ Client = new DemoCore.DemoCoreClient(Channel);
+ }
+
+ public void Dispose()
+ {
+
+ }
+
+ /// <summary>
+ /// 排他チェックのため、最新更新日取得する
+ /// </summary>
+ /// <param name="pID"></param>
+ /// <returns></returns>
+ public int GetUpdateID(int pID)
+ {
+ return CConvert.ToInt(GrpcClient.ExecuteScalarSync(Channel, $"SELECT UpdateID FROM M_Demo WHERE ID = {pID}"));
+ }
+
+ public bool Exists(int pID)
+ {
+ return GrpcClient.ExecuteScalarSync(Channel, $"IF EXISTS(SELECT 1 FROM M_Demo WHERE ID = {pID}) SELECT 1 ELSE SELECT 0") == "1";
+ }
+
+ public async Task<bool> ExistsAsync(int pID)
+ {
+ return await GrpcClient.ExecuteScalar(Channel, $"IF EXISTS(SELECT 1 FROM M_Demo WHERE ID = {pID}) SELECT 1 ELSE SELECT 0") == "1";
+
+ }
+
+ public async Task<FileGrpcData> OutputStream(PagingRequest request)
+ {
+ FileGrpcData data = null;
+ request.Table = "M_Demo";
+ string json = JsonSerializer.Serialize(request);
+ using (var call = Client.OutputStream(GrpcClient.CreateDataRequest(2, json)))
+ {
+ var reaponseStream = call.ResponseStream;
+ //データの取得
+ while (await reaponseStream.MoveNext(CancellationToken.None))
+ {
+ data = reaponseStream.Current;
+ }
+ }
+ return data;
+ }
+
+ public async Task<DemoTable> GetPageData(PagingRequest request)
+ {
+ request.Table = "M_Demo";
+ string json = JsonSerializer.Serialize(request);
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(1, json));
+ }
+
+
+ public DataTable GetMasterGridData(string where)
+ {
+ GrpcTable table = GrpcClient.GetTable(Channel, (int)ETableActionType.DemoMasterGrid, where);
+ return table.ToDataTable();
+ }
+
+ /// <summary>
+ /// 同期データ取得
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public DemoTable GetData(string where)
+ {
+ return Client.GetData(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ public async Task<DemoTable> GetDataAsync(string where)
+ {
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public Demo GetItem(int pID)
+ {
+ DemoTable table = GetData($"ID = {pID}");
+ if(table == null || table.ErrNo != 0 || table.Rows.Count == 0) { return null; }
+ return table.Rows[0];
+ }
+
+ public async Task<DemoTable> GetDataStream()
+ {
+ return await GetDataStream(string.Empty);
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public async Task<DemoTable> GetDataStream(string where)
+ {
+ DemoTable table = null;
+ using (var call = Client.GetDataStream())
+ {
+ await call.RequestStream.WriteAsync(GrpcClient.CreateDataRequest(0, where));
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DemoTable>())
+ {
+ table = message;
+ break;
+ }
+ }
+ return table;
+ }
+
+ public async Task<DataResult> AddAsync(Demo data)
+ {
+ return await Client.AddAsync(data);
+ }
+
+ public DataResult Add(Demo data)
+ {
+ return Client.Add(data);
+ }
+
+ public async Task<DataResult> UpdateAsync(Demo data)
+ {
+ return await Client.UpdateAsync(data);
+ }
+
+ public DataResult Update(Demo data)
+ {
+ return Client.Update(data);
+ }
+
+ /// <summary>
+ /// 追加若しくは更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <param name="add"></param>
+ /// <returns></returns>
+ private async Task<DataResult> AddOrUpdateStream(Demo data, bool add)
+ {
+ DataResult result = null;
+ using (var call = add ? Client.AddStream() : Client.UpdateStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ /// <summary>
+ /// 追加
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> AddStream(Demo data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ /// <summary>
+ /// 更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> UpdateStream(Demo data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ public DataResult Remove(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return Client.Remove(data);
+ }
+
+ public async Task<DataResult> RemoveAsync(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return await Client.RemoveAsync(data);
+ }
+
+ /// <summary>
+ /// 削除
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public async Task<DataResult> RemoveStream(string where)
+ {
+ DataResult result = null;
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+
+ using (var call = Client.RemoveStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ public DataResult SetData(DemoTable table)
+ {
+ return Client.SetData(table);
+ }
+
+ /// <summary>
+ /// バッチ更新
+ /// </summary>
+ /// <param name="table"></param>
+ /// <returns></returns>
+ public async Task<DataResult> SetDataStream(DemoTable table)
+ {
+ DataResult result = null;
+ using (var call = Client.SetDataStream())
+ {
+ await call.RequestStream.WriteAsync(table);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+ }
+}
diff --git a/HotelPms.DataAccessGrpc.Client/HotelAccess.cs b/HotelPms.DataAccessGrpc.Client/HotelAccess.cs
new file mode 100644
index 0000000..68c663b
--- /dev/null
+++ b/HotelPms.DataAccessGrpc.Client/HotelAccess.cs
@@ -0,0 +1,269 @@
+using Google.Protobuf;
+using Grpc.Core;
+using Grpc.Net.Client;
+using HotelPms.Data;
+using HotelPms.Data.Client;
+using HotelPms.Data.Common;
+using HotelPms.Data.Common.Pagination;
+using HotelPms.Data.Master;
+using HotelPms.Share.Util;
+using System.Data;
+using System.Text.Json;
+
+namespace HotelPms.DataAccessGrpc.Client
+{
+ public class HotelAccess : IDisposable
+ {
+ /// <summary>
+ /// チャネル
+ /// </summary>
+ public GrpcChannel Channel { get; private set; } = null;
+ public HotelCore.HotelCoreClient Client { get; private set; } = null;
+
+ public HotelAccess(GrpcChannel channel)
+ {
+ Channel = channel;
+ Client = new HotelCore.HotelCoreClient(Channel);
+ }
+
+ public void Dispose()
+ {
+
+ }
+
+ public async Task<bool> Exists(int pID)
+ {
+ return await GrpcClient.ExecuteScalar(Channel, $"IF EXISTS(SELECT 1 FROM S_Hotel WHERE ID = {pID}) SELECT 1 ELSE SELECT 0") == "1";
+
+ }
+
+ public async Task<FileGrpcData> OutputStream(PagingRequest request)
+ {
+ FileGrpcData data = null;
+ request.Table = "S_Hotel";
+ string json = JsonSerializer.Serialize(request);
+ using (var call = Client.OutputStream(GrpcClient.CreateDataRequest(2, json)))
+ {
+ var reaponseStream = call.ResponseStream;
+ //データの取得
+ while (await reaponseStream.MoveNext(CancellationToken.None))
+ {
+ data = reaponseStream.Current;
+ }
+ }
+ return data;
+ }
+
+ public async Task<HotelTable> GetPageData(PagingRequest request)
+ {
+ request.Table = "S_Hotel";
+ string json = JsonSerializer.Serialize(request);
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(1, json));
+ }
+
+
+ public DataTable GetMasterGridData(string where)
+ {
+ GrpcTable table = GrpcClient.GetTable(Channel, (int)ETableActionType.HotelMasterGrid, where);
+ return table.ToDataTable();
+ }
+
+ public async Task<DateTime> GetHotelDate()
+ {
+ GrpcTable table = await GrpcClient.GetTableAsync(Channel, (int)ETableActionType.HotelDate, string.Empty);
+ DateTime dateTime = CConvert.ToDateTimeFromBytes(table.Rows[0].Data.Span.Slice(0, 8).ToArray());
+ return dateTime;
+ }
+
+ /// <summary>
+ /// 同期データ取得
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public HotelTable GetData(string where)
+ {
+ return Client.GetData(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ public async Task<HotelTable> GetDataAsync(string where)
+ {
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public Hotel GetItem(int pID)
+ {
+ HotelTable table = GetData($"ID = {pID}");
+ if(table == null || table.ErrNo != 0 || table.Rows.Count == 0) { return null; }
+ return table.Rows[0];
+ }
+
+ public async Task<HotelTable> GetDataStream()
+ {
+ return await GetDataStream(string.Empty);
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public async Task<HotelTable> GetDataStream(string where)
+ {
+ HotelTable table = null;
+ using (var call = Client.GetDataStream())
+ {
+ await call.RequestStream.WriteAsync(GrpcClient.CreateDataRequest(0, where));
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<HotelTable>())
+ {
+ table = message;
+ break;
+ }
+ }
+ return table;
+ }
+
+ public async Task<DataResult> AddAsync(Hotel data)
+ {
+ return await Client.AddAsync(data);
+ }
+
+ public DataResult Add(Hotel data)
+ {
+ return Client.Add(data);
+ }
+
+ public async Task<DataResult> UpdateAsync(Hotel data)
+ {
+ return await Client.UpdateAsync(data);
+ }
+
+ public DataResult Update(Hotel data)
+ {
+ return Client.Update(data);
+ }
+
+ /// <summary>
+ /// 追加若しくは更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <param name="add"></param>
+ /// <returns></returns>
+ private async Task<DataResult> AddOrUpdateStream(Hotel data, bool add)
+ {
+ DataResult result = null;
+ using (var call = add ? Client.AddStream() : Client.UpdateStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ /// <summary>
+ /// 追加
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> AddStream(Hotel data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ /// <summary>
+ /// 更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> UpdateStream(Hotel data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ public DataResult Remove(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return Client.Remove(data);
+ }
+
+ public async Task<DataResult> RemoveAsync(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return await Client.RemoveAsync(data);
+ }
+
+ /// <summary>
+ /// 削除
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public async Task<DataResult> RemoveStream(string where)
+ {
+ DataResult result = null;
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+
+ using (var call = Client.RemoveStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ public DataResult SetData(HotelTable table)
+ {
+ return Client.SetData(table);
+ }
+
+ /// <summary>
+ /// バッチ更新
+ /// </summary>
+ /// <param name="table"></param>
+ /// <returns></returns>
+ public async Task<DataResult> SetDataStream(HotelTable table)
+ {
+ DataResult result = null;
+ using (var call = Client.SetDataStream())
+ {
+ await call.RequestStream.WriteAsync(table);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+ }
+}
diff --git a/HotelPms.DataAccessGrpc.Client/HotelPms.DataAccessGrpc.Client.csproj b/HotelPms.DataAccessGrpc.Client/HotelPms.DataAccessGrpc.Client.csproj
new file mode 100644
index 0000000..cf4bc99
--- /dev/null
+++ b/HotelPms.DataAccessGrpc.Client/HotelPms.DataAccessGrpc.Client.csproj
@@ -0,0 +1,14 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <TargetFramework>net9.0</TargetFramework>
+ <ImplicitUsings>enable</ImplicitUsings>
+ <Nullable>enable</Nullable>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <ProjectReference Include="..\HotelPms.Data.Client\HotelPms.Data.Client.csproj" />
+ <ProjectReference Include="..\HotelPms.Data.Common\HotelPms.Data.Common.csproj" />
+ </ItemGroup>
+
+</Project>
diff --git a/HotelPms.DataAccessGrpc.Client/ItemAccess.cs b/HotelPms.DataAccessGrpc.Client/ItemAccess.cs
new file mode 100644
index 0000000..fe1cb3c
--- /dev/null
+++ b/HotelPms.DataAccessGrpc.Client/ItemAccess.cs
@@ -0,0 +1,293 @@
+using Google.Protobuf;
+using Grpc.Core;
+using Grpc.Net.Client;
+using HotelPms.Data.Client;
+using HotelPms.Data.Common;
+using HotelPms.Data.Master;
+using HotelPms.Share.Util;
+using System;
+using System.Data;
+using System.Threading.Tasks;
+using HotelPms.Data;
+using System.Collections.Generic;
+using HotelPms.Data.Common.Pagination;
+using System.Text.Json;
+using System.Threading;
+using System.Security.Cryptography;
+
+namespace HotelPms.DataAccessGrpc.Client;
+
+public class ItemAccess : IDisposable
+{
+ /// <summary>
+ /// チャネル
+ /// </summary>
+ public GrpcChannel Channel { get; private set; } = null;
+ public ItemCore.ItemCoreClient Client { get; private set; } = null;
+
+
+ public ItemAccess(GrpcChannel channel)
+ {
+ Channel = channel;
+ Client = new ItemCore.ItemCoreClient(Channel);
+ }
+
+ public void Dispose()
+ {
+
+ }
+
+ public bool Exists(string pID)
+ {
+ return GrpcClient.ExecuteScalarSync(Channel, $"IF EXISTS(SELECT 1 FROM M_Item WHERE ID = N'{pID}') SELECT 1 ELSE SELECT 0") == "1";
+
+ }
+
+ public async Task<bool> ExistsAsync(string pID)
+ {
+ return await GrpcClient.ExecuteScalar(Channel, $"IF EXISTS(SELECT 1 FROM M_Item WHERE ID = N'{pID}') SELECT 1 ELSE SELECT 0") == "1";
+
+ }
+
+ public async Task<FileGrpcData> OutputStream(PagingRequest request)
+ {
+ FileGrpcData data = null;
+ request.Table = "M_Item";
+ string json = JsonSerializer.Serialize(request);
+ using (var call = Client.OutputStream(GrpcClient.CreateDataRequest(2, json)))
+ {
+ var reaponseStream = call.ResponseStream;
+ //データの取得
+ while (await reaponseStream.MoveNext(CancellationToken.None))
+ {
+ data = reaponseStream.Current;
+ }
+ }
+ return data;
+ }
+
+ public async Task<ItemTable> GetPageData(PagingRequest request)
+ {
+ request.Table = "M_Item";
+ string json = JsonSerializer.Serialize(request);
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(1, json));
+ }
+
+ /// <summary>
+ /// 部屋タイプの基本料金を返す
+ /// </summary>
+ /// <param name="roomTypeID"></param>
+ /// <param name="personCount"></param>
+ /// <param name="useDate"></param>
+ /// <returns></returns>
+ public async Task<Item?> GetBaseItem(int roomTypeID, int personCount, string useDate)
+ {
+ ItemTable table = await Client.GetDataAsync(GrpcClient.CreateDataRequest(3, $"{roomTypeID},{personCount},{useDate}"));
+ if (table == null || table.ErrNo != 0 || table.Rows.Count == 0) { return null; }
+ return table.Rows[0];
+ }
+
+ public DataTable GetMasterGridData(string where)
+ {
+ GrpcTable table = GrpcClient.GetTable(Channel, (int)ETableActionType.BuildingMasterGrid, where);
+ return table.ToDataTable();
+ }
+
+ /// <summary>
+ /// 同期データ取得
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public ItemTable GetData(string where)
+ {
+ return Client.GetData(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ public async Task<ItemTable> GetDataAsync(string where)
+ {
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ public Item GetItem(string pID)
+ {
+ ItemTable table = GetData($"ID = N'{pID}'");
+ if (table == null || table.ErrNo != 0 || table.Rows.Count == 0) { return null; }
+ return table.Rows[0];
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public async Task<Item?> GetItemAsync(string pID)
+ {
+ ItemTable table = await GetDataAsync($"ID = N'{pID}'");
+ if(table == null || table.ErrNo != 0 || table.Rows.Count == 0) { return null; }
+ return table.Rows[0];
+ }
+
+ public async Task<ItemTable> GetDataStream()
+ {
+ return await GetDataStream(string.Empty);
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public async Task<ItemTable> GetDataStream(string where)
+ {
+ ItemTable table = null;
+ using (var call = Client.GetDataStream())
+ {
+ await call.RequestStream.WriteAsync(GrpcClient.CreateDataRequest(0, where));
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<ItemTable>())
+ {
+ table = message;
+ break;
+ }
+ }
+ return table;
+ }
+
+ public async Task<DataResult> AddAsync(Item data)
+ {
+ return await Client.AddAsync(data);
+ }
+
+ public DataResult Add(Item data)
+ {
+ return Client.Add(data);
+ }
+
+ public async Task<DataResult> UpdateAsync(Item data)
+ {
+ return await Client.UpdateAsync(data);
+ }
+
+ public DataResult Update(Item data)
+ {
+ return Client.Update(data);
+ }
+
+ /// <summary>
+ /// 追加若しくは更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <param name="add"></param>
+ /// <returns></returns>
+ private async Task<DataResult> AddOrUpdateStream(Item data, bool add)
+ {
+ DataResult result = null;
+ using (var call = add ? Client.AddStream() : Client.UpdateStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ /// <summary>
+ /// 追加
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> AddStream(Item data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ /// <summary>
+ /// 更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> UpdateStream(Item data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ public DataResult Remove(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return Client.Remove(data);
+ }
+
+ public async Task<DataResult> RemoveAsync(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return await Client.RemoveAsync(data);
+ }
+
+ /// <summary>
+ /// 削除
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public async Task<DataResult> RemoveStream(string where)
+ {
+ DataResult result = null;
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+
+ using (var call = Client.RemoveStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ public DataResult SetData(ItemTable table)
+ {
+ return Client.SetData(table);
+ }
+
+ /// <summary>
+ /// バッチ更新
+ /// </summary>
+ /// <param name="table"></param>
+ /// <returns></returns>
+ public async Task<DataResult> SetDataStream(ItemTable table)
+ {
+ DataResult result = null;
+ using (var call = Client.SetDataStream())
+ {
+ await call.RequestStream.WriteAsync(table);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+}
diff --git a/HotelPms.DataAccessGrpc.Client/OptionAccess.cs b/HotelPms.DataAccessGrpc.Client/OptionAccess.cs
new file mode 100644
index 0000000..eaf8e6f
--- /dev/null
+++ b/HotelPms.DataAccessGrpc.Client/OptionAccess.cs
@@ -0,0 +1,268 @@
+using Google.Protobuf;
+using Grpc.Core;
+using Grpc.Net.Client;
+using HotelPms.Data;
+using HotelPms.Data.Client;
+using HotelPms.Data.Common;
+using HotelPms.Data.Common.Pagination;
+using HotelPms.Data.Master;
+using System.Data;
+using System.Text.Json;
+
+namespace HotelPms.DataAccessGrpc.Client
+{
+ public class OptionAccess : IDisposable
+ {
+ /// <summary>
+ /// チャネル
+ /// </summary>
+ public GrpcChannel Channel { get; private set; } = null;
+ public OptionCore.OptionCoreClient Client { get; private set; } = null;
+
+
+ public OptionAccess(GrpcChannel channel)
+ {
+ Channel = channel;
+ Client = new OptionCore.OptionCoreClient(Channel);
+ }
+
+ public void Dispose()
+ {
+
+ }
+
+ public bool Exists(string pType,string pKey)
+ {
+ return GrpcClient.ExecuteScalarSync(Channel, $"IF EXISTS(SELECT 1 FROM S_Option WHERE Type = N'{pType}' AND Key = N'{pKey}') SELECT 1 ELSE SELECT 0") == "1";
+
+ }
+
+ public async Task<bool> ExistsAsync(string pType,string pKey)
+ {
+ return await GrpcClient.ExecuteScalar(Channel, $"IF EXISTS(SELECT 1 FROM S_Option WHERE Type = N'{pType}' AND Key = N'{pKey}') SELECT 1 ELSE SELECT 0") == "1";
+
+ }
+
+ public async Task<FileGrpcData> OutputStream(PagingRequest request)
+ {
+ FileGrpcData data = null;
+ request.Table = "S_Option";
+ string json = JsonSerializer.Serialize(request);
+ using (var call = Client.OutputStream(GrpcClient.CreateDataRequest(2, json)))
+ {
+ var reaponseStream = call.ResponseStream;
+ //データの取得
+ while (await reaponseStream.MoveNext(CancellationToken.None))
+ {
+ data = reaponseStream.Current;
+ }
+ }
+ return data;
+ }
+
+ public async Task<OptionTable> GetPageData(PagingRequest request)
+ {
+ request.Table = "S_Option";
+ string json = JsonSerializer.Serialize(request);
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(1, json));
+ }
+
+
+ public DataTable GetMasterGridData(string where)
+ {
+ GrpcTable table = GrpcClient.GetTable(Channel, (int)ETableActionType.BuildingMasterGrid, where);
+ return table.ToDataTable();
+ }
+
+ /// <summary>
+ /// 同期データ取得
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public OptionTable GetData(string where)
+ {
+ return Client.GetData(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ public async Task<OptionTable> GetDataAsync(string where)
+ {
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public Option GetItem(string pType,string pKey)
+ {
+ OptionTable table = GetData($"Type = N'{pType}' AND Key = N'{pKey}'");
+ if(table == null || table.ErrNo != 0 || table.Rows.Count == 0) { return null; }
+ return table.Rows[0];
+ }
+
+ public async Task<OptionTable> GetDataStream()
+ {
+ return await GetDataStream(string.Empty);
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public async Task<OptionTable> GetDataStream(string where)
+ {
+ OptionTable table = null;
+ using (var call = Client.GetDataStream())
+ {
+ await call.RequestStream.WriteAsync(GrpcClient.CreateDataRequest(0, where));
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<OptionTable>())
+ {
+ table = message;
+ break;
+ }
+ }
+ return table;
+ }
+
+ public async Task<DataResult> AddAsync(Option data)
+ {
+ return await Client.AddAsync(data);
+ }
+
+ public DataResult Add(Option data)
+ {
+ return Client.Add(data);
+ }
+
+ public async Task<DataResult> UpdateAsync(Option data)
+ {
+ return await Client.UpdateAsync(data);
+ }
+
+ public DataResult Update(Option data)
+ {
+ return Client.Update(data);
+ }
+
+ /// <summary>
+ /// 追加若しくは更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <param name="add"></param>
+ /// <returns></returns>
+ private async Task<DataResult> AddOrUpdateStream(Option data, bool add)
+ {
+ DataResult result = null;
+ using (var call = add ? Client.AddStream() : Client.UpdateStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ /// <summary>
+ /// 追加
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> AddStream(Option data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ /// <summary>
+ /// 更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> UpdateStream(Option data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ public DataResult Remove(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return Client.Remove(data);
+ }
+
+ public async Task<DataResult> RemoveAsync(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return await Client.RemoveAsync(data);
+ }
+
+ /// <summary>
+ /// 削除
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public async Task<DataResult> RemoveStream(string where)
+ {
+ DataResult result = null;
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+
+ using (var call = Client.RemoveStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ public DataResult SetData(OptionTable table)
+ {
+ return Client.SetData(table);
+ }
+
+ /// <summary>
+ /// バッチ更新
+ /// </summary>
+ /// <param name="table"></param>
+ /// <returns></returns>
+ public async Task<DataResult> SetDataStream(OptionTable table)
+ {
+ DataResult result = null;
+ using (var call = Client.SetDataStream())
+ {
+ await call.RequestStream.WriteAsync(table);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+ }
+}
diff --git a/HotelPms.DataAccessGrpc.Client/OutputAccess.cs b/HotelPms.DataAccessGrpc.Client/OutputAccess.cs
new file mode 100644
index 0000000..7fd14ab
--- /dev/null
+++ b/HotelPms.DataAccessGrpc.Client/OutputAccess.cs
@@ -0,0 +1,279 @@
+using Google.Protobuf;
+using Grpc.Core;
+using Grpc.Net.Client;
+using HotelPms.Data.Client;
+using HotelPms.Data.Common;
+using HotelPms.Data.Master;
+using HotelPms.Share.Util;
+using System;
+using System.Data;
+using System.Threading.Tasks;
+using HotelPms.Data;
+using System.Collections.Generic;
+using HotelPms.Data.Common.Pagination;
+using System.Text.Json;
+using System.Threading;
+
+namespace HotelPms.DataAccessGrpc.Client
+{
+ public class OutputAccess : IDisposable
+ {
+ /// <summary>
+ /// チャネル
+ /// </summary>
+ public GrpcChannel Channel { get; private set; } = null;
+ public OutputCore.OutputCoreClient Client { get; private set; } = null;
+
+
+ public OutputAccess(GrpcChannel channel)
+ {
+ Channel = channel;
+ Client = new OutputCore.OutputCoreClient(Channel);
+ }
+
+ public void Dispose()
+ {
+
+ }
+
+ public bool Exists(string pMachineName,string pUserName,int pReportID,int pID)
+ {
+ return GrpcClient.ExecuteScalarSync(Channel, $"IF EXISTS(SELECT 1 FROM M_Output WHERE MachineName = N'{pMachineName}' AND UserName = N'{pUserName}' AND ReportID = {pReportID} AND ID = {pID}) SELECT 1 ELSE SELECT 0") == "1";
+
+ }
+
+ public async Task<bool> ExistsAsync(string pMachineName,string pUserName,int pReportID,int pID)
+ {
+ return await GrpcClient.ExecuteScalar(Channel, $"IF EXISTS(SELECT 1 FROM M_Output WHERE MachineName = N'{pMachineName}' AND UserName = N'{pUserName}' AND ReportID = {pReportID} AND ID = {pID}) SELECT 1 ELSE SELECT 0") == "1";
+
+ }
+
+ public async Task<FileGrpcData> OutputStream(PagingRequest request)
+ {
+ FileGrpcData data = null;
+ request.Table = "M_Output";
+ string json = JsonSerializer.Serialize(request);
+ using (var call = Client.OutputStream(GrpcClient.CreateDataRequest(2, json)))
+ {
+ var reaponseStream = call.ResponseStream;
+ //データの取得
+ while (await reaponseStream.MoveNext(CancellationToken.None))
+ {
+ data = reaponseStream.Current;
+ }
+ }
+ return data;
+ }
+
+ public async Task<OutputTable> GetPageData(PagingRequest request)
+ {
+ request.Table = "M_Output";
+ string json = JsonSerializer.Serialize(request);
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(1, json));
+ }
+
+ public async Task<Output> GetDefColSetting(string pMachineName, string pUserName, int pReportID, int pOutputID = 0)
+ {
+ OutputTable table = await Client.GetDataAsync(GrpcClient.CreateDataRequest(8, $"'{pMachineName}','{pUserName}',{pReportID},{pOutputID}"));
+ return table.Rows[0];
+ }
+
+
+ public DataTable GetMasterGridData(string where)
+ {
+ GrpcTable table = GrpcClient.GetTable(Channel, (int)ETableActionType.BuildingMasterGrid, where);
+ return table.ToDataTable();
+ }
+
+ /// <summary>
+ /// 同期データ取得
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public OutputTable GetData(string where)
+ {
+ return Client.GetData(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ public async Task<OutputTable> GetDataAsync(string where)
+ {
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public Output GetItem(string pMachineName,string pUserName,int pReportID,int pID)
+ {
+ OutputTable table = GetData($"MachineName = N'{pMachineName}' AND UserName = N'{pUserName}' AND ReportID = {pReportID} AND ID = {pID}");
+ if(table == null || table.ErrNo != 0 || table.Rows.Count == 0) { return null; }
+ return table.Rows[0];
+ }
+
+ public async Task<OutputTable> GetDataStream()
+ {
+ return await GetDataStream(string.Empty);
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public async Task<OutputTable> GetDataStream(string where)
+ {
+ OutputTable table = null;
+ using (var call = Client.GetDataStream())
+ {
+ await call.RequestStream.WriteAsync(GrpcClient.CreateDataRequest(0, where));
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<OutputTable>())
+ {
+ table = message;
+ break;
+ }
+ }
+ return table;
+ }
+
+ public async Task<DataResult> AddAsync(Output data)
+ {
+ return await Client.AddAsync(data);
+ }
+
+ public DataResult Add(Output data)
+ {
+ return Client.Add(data);
+ }
+
+ public async Task<DataResult> UpdateAsync(Output data)
+ {
+ return await Client.UpdateAsync(data);
+ }
+
+ public DataResult Update(Output data)
+ {
+ return Client.Update(data);
+ }
+
+ /// <summary>
+ /// 追加若しくは更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <param name="add"></param>
+ /// <returns></returns>
+ private async Task<DataResult> AddOrUpdateStream(Output data, bool add)
+ {
+ DataResult result = null;
+ using (var call = add ? Client.AddStream() : Client.UpdateStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ /// <summary>
+ /// 追加
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> AddStream(Output data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ /// <summary>
+ /// 更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> UpdateStream(Output data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ public DataResult Remove(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return Client.Remove(data);
+ }
+
+ public async Task<DataResult> RemoveAsync(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return await Client.RemoveAsync(data);
+ }
+
+ /// <summary>
+ /// 削除
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public async Task<DataResult> RemoveStream(string where)
+ {
+ DataResult result = null;
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+
+ using (var call = Client.RemoveStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ public DataResult SetData(OutputTable table)
+ {
+ return Client.SetData(table);
+ }
+
+ /// <summary>
+ /// バッチ更新
+ /// </summary>
+ /// <param name="table"></param>
+ /// <returns></returns>
+ public async Task<DataResult> SetDataStream(OutputTable table)
+ {
+ DataResult result = null;
+ using (var call = Client.SetDataStream())
+ {
+ await call.RequestStream.WriteAsync(table);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+ }
+}
diff --git a/HotelPms.DataAccessGrpc.Client/OutputItemAccess.cs b/HotelPms.DataAccessGrpc.Client/OutputItemAccess.cs
new file mode 100644
index 0000000..0b92d6f
--- /dev/null
+++ b/HotelPms.DataAccessGrpc.Client/OutputItemAccess.cs
@@ -0,0 +1,273 @@
+using Google.Protobuf;
+using Grpc.Core;
+using Grpc.Net.Client;
+using HotelPms.Data.Client;
+using HotelPms.Data.Common;
+using HotelPms.Data.Master;
+using HotelPms.Share.Util;
+using System;
+using System.Data;
+using System.Threading.Tasks;
+using HotelPms.Data;
+using System.Collections.Generic;
+using HotelPms.Data.Common.Pagination;
+using System.Text.Json;
+using System.Threading;
+
+namespace HotelPms.DataAccessGrpc.Client
+{
+ public class OutputItemAccess : IDisposable
+ {
+ /// <summary>
+ /// チャネル
+ /// </summary>
+ public GrpcChannel Channel { get; private set; } = null;
+ public OutputItemCore.OutputItemCoreClient Client { get; private set; } = null;
+
+
+ public OutputItemAccess(GrpcChannel channel)
+ {
+ Channel = channel;
+ Client = new OutputItemCore.OutputItemCoreClient(Channel);
+ }
+
+ public void Dispose()
+ {
+
+ }
+
+ public bool Exists(string pMachineName,string pUserName,int pReportID,int pOutputID,int pID)
+ {
+ return GrpcClient.ExecuteScalarSync(Channel, $"IF EXISTS(SELECT 1 FROM M_OutputItem WHERE MachineName = N'{pMachineName}' AND UserName = N'{pUserName}' AND ReportID = {pReportID} AND OutputID = {pOutputID} AND ID = {pID}) SELECT 1 ELSE SELECT 0") == "1";
+
+ }
+
+ public async Task<bool> ExistsAsync(string pMachineName,string pUserName,int pReportID,int pOutputID,int pID)
+ {
+ return await GrpcClient.ExecuteScalar(Channel, $"IF EXISTS(SELECT 1 FROM M_OutputItem WHERE MachineName = N'{pMachineName}' AND UserName = N'{pUserName}' AND ReportID = {pReportID} AND OutputID = {pOutputID} AND ID = {pID}) SELECT 1 ELSE SELECT 0") == "1";
+
+ }
+
+ public async Task<FileGrpcData> OutputStream(PagingRequest request)
+ {
+ FileGrpcData data = null;
+ request.Table = "M_OutputItem";
+ string json = JsonSerializer.Serialize(request);
+ using (var call = Client.OutputStream(GrpcClient.CreateDataRequest(2, json)))
+ {
+ var reaponseStream = call.ResponseStream;
+ //データの取得
+ while (await reaponseStream.MoveNext(CancellationToken.None))
+ {
+ data = reaponseStream.Current;
+ }
+ }
+ return data;
+ }
+
+ public async Task<OutputItemTable> GetPageData(PagingRequest request)
+ {
+ request.Table = "M_OutputItem";
+ string json = JsonSerializer.Serialize(request);
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(1, json));
+ }
+
+
+ public DataTable GetMasterGridData(string where)
+ {
+ GrpcTable table = GrpcClient.GetTable(Channel, (int)ETableActionType.BuildingMasterGrid, where);
+ return table.ToDataTable();
+ }
+
+ /// <summary>
+ /// 同期データ取得
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public OutputItemTable GetData(string where)
+ {
+ return Client.GetData(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ public async Task<OutputItemTable> GetDataAsync(string where)
+ {
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public OutputItem GetItem(string pMachineName,string pUserName,int pReportID,int pOutputID,int pID)
+ {
+ OutputItemTable table = GetData($"MachineName = N'{pMachineName}' AND UserName = N'{pUserName}' AND ReportID = {pReportID} AND OutputID = {pOutputID} AND ID = {pID}");
+ if(table == null || table.ErrNo != 0 || table.Rows.Count == 0) { return null; }
+ return table.Rows[0];
+ }
+
+ public async Task<OutputItemTable> GetDataStream()
+ {
+ return await GetDataStream(string.Empty);
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public async Task<OutputItemTable> GetDataStream(string where)
+ {
+ OutputItemTable table = null;
+ using (var call = Client.GetDataStream())
+ {
+ await call.RequestStream.WriteAsync(GrpcClient.CreateDataRequest(0, where));
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<OutputItemTable>())
+ {
+ table = message;
+ break;
+ }
+ }
+ return table;
+ }
+
+ public async Task<DataResult> AddAsync(OutputItem data)
+ {
+ return await Client.AddAsync(data);
+ }
+
+ public DataResult Add(OutputItem data)
+ {
+ return Client.Add(data);
+ }
+
+ public async Task<DataResult> UpdateAsync(OutputItem data)
+ {
+ return await Client.UpdateAsync(data);
+ }
+
+ public DataResult Update(OutputItem data)
+ {
+ return Client.Update(data);
+ }
+
+ /// <summary>
+ /// 追加若しくは更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <param name="add"></param>
+ /// <returns></returns>
+ private async Task<DataResult> AddOrUpdateStream(OutputItem data, bool add)
+ {
+ DataResult result = null;
+ using (var call = add ? Client.AddStream() : Client.UpdateStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ /// <summary>
+ /// 追加
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> AddStream(OutputItem data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ /// <summary>
+ /// 更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> UpdateStream(OutputItem data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ public DataResult Remove(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return Client.Remove(data);
+ }
+
+ public async Task<DataResult> RemoveAsync(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return await Client.RemoveAsync(data);
+ }
+
+ /// <summary>
+ /// 削除
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public async Task<DataResult> RemoveStream(string where)
+ {
+ DataResult result = null;
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+
+ using (var call = Client.RemoveStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ public DataResult SetData(OutputItemTable table)
+ {
+ return Client.SetData(table);
+ }
+
+ /// <summary>
+ /// バッチ更新
+ /// </summary>
+ /// <param name="table"></param>
+ /// <returns></returns>
+ public async Task<DataResult> SetDataStream(OutputItemTable table)
+ {
+ DataResult result = null;
+ using (var call = Client.SetDataStream())
+ {
+ await call.RequestStream.WriteAsync(table);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+ }
+}
diff --git a/HotelPms.DataAccessGrpc.Client/PayAccess.cs b/HotelPms.DataAccessGrpc.Client/PayAccess.cs
new file mode 100644
index 0000000..09ebcad
--- /dev/null
+++ b/HotelPms.DataAccessGrpc.Client/PayAccess.cs
@@ -0,0 +1,267 @@
+using Google.Protobuf;
+using Grpc.Core;
+using Grpc.Net.Client;
+using HotelPms.Data.Common;
+using HotelPms.Data.UseInfo;
+using HotelPms.Share.Util;
+using System;
+using System.Data;
+using System.Threading.Tasks;
+using HotelPms.Data;
+using System.Collections.Generic;
+using HotelPms.Data.Common.Pagination;
+using System.Text.Json;
+using System.Threading;
+using HotelPms.Data.Client;
+
+namespace HotelPms.DataAccessGrpc.Client
+{
+ internal class PayAccess : IDisposable
+ {
+ /// <summary>
+ /// チャネル
+ /// </summary>
+ public GrpcChannel Channel { get; private set; } = null;
+ public PayCore.PayCoreClient Client { get; private set; } = null;
+
+
+ public PayAccess(GrpcChannel channel)
+ {
+ Channel = channel;
+ Client = new PayCore.PayCoreClient(Channel);
+ }
+
+ public void Dispose()
+ {
+
+ }
+
+ public async Task<bool> Exists(int pID,int pDetailID,DateTime pUseDate,int pPayID)
+ {
+ return await GrpcClient.ExecuteScalar(Channel, $"IF EXISTS(SELECT 1 FROM D_Pay WHERE ID = {pID} AND DetailID = {pDetailID} AND UseDate = {CConvert.ToSqlValue(pUseDate)} AND PayID = {pPayID}) SELECT 1 ELSE SELECT 0") == "1";
+
+ }
+
+ public async Task<FileGrpcData> OutputStream(PagingRequest request)
+ {
+ FileGrpcData data = null;
+ request.Table = "D_Pay";
+ string json = JsonSerializer.Serialize(request);
+ using (var call = Client.OutputStream(GrpcClient.CreateDataRequest(2, json)))
+ {
+ var reaponseStream = call.ResponseStream;
+ //データの取得
+ while (await reaponseStream.MoveNext(CancellationToken.None))
+ {
+ data = reaponseStream.Current;
+ }
+ }
+ return data;
+ }
+
+ public async Task<PayTable> GetPageData(PagingRequest request)
+ {
+ request.Table = "D_Pay";
+ string json = JsonSerializer.Serialize(request);
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(1, json));
+ }
+
+
+ public DataTable GetMasterGridData(string where)
+ {
+ GrpcTable table = GrpcClient.GetTable(Channel, (int)ETableActionType.BuildingMasterGrid, where);
+ return table.ToDataTable();
+ }
+
+ /// <summary>
+ /// 同期データ取得
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public PayTable GetData(string where)
+ {
+ return Client.GetData(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ public async Task<PayTable> GetDataAsync(string where)
+ {
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public Pay GetItem(int pID,int pDetailID,DateTime pUseDate,int pPayID)
+ {
+ PayTable table = GetData($"ID = {pID} AND DetailID = {pDetailID} AND UseDate = {CConvert.ToSqlValue(pUseDate)} AND PayID = {pPayID}");
+ if(table == null || table.ErrNo != 0 || table.Rows.Count == 0) { return null; }
+ return table.Rows[0];
+ }
+
+ public async Task<PayTable> GetDataStream()
+ {
+ return await GetDataStream(string.Empty);
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public async Task<PayTable> GetDataStream(string where)
+ {
+ PayTable table = null;
+ using (var call = Client.GetDataStream())
+ {
+ await call.RequestStream.WriteAsync(GrpcClient.CreateDataRequest(0, where));
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<PayTable>())
+ {
+ table = message;
+ break;
+ }
+ }
+ return table;
+ }
+
+ public async Task<DataResult> AddAsync(Pay data)
+ {
+ return await Client.AddAsync(data);
+ }
+
+ public DataResult Add(Pay data)
+ {
+ return Client.Add(data);
+ }
+
+ public async Task<DataResult> UpdateAsync(Pay data)
+ {
+ return await Client.UpdateAsync(data);
+ }
+
+ public DataResult Update(Pay data)
+ {
+ return Client.Update(data);
+ }
+
+ /// <summary>
+ /// 追加若しくは更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <param name="add"></param>
+ /// <returns></returns>
+ private async Task<DataResult> AddOrUpdateStream(Pay data, bool add)
+ {
+ DataResult result = null;
+ using (var call = add ? Client.AddStream() : Client.UpdateStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ /// <summary>
+ /// 追加
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> AddStream(Pay data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ /// <summary>
+ /// 更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> UpdateStream(Pay data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ public DataResult Remove(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return Client.Remove(data);
+ }
+
+ public async Task<DataResult> RemoveAsync(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return await Client.RemoveAsync(data);
+ }
+
+ /// <summary>
+ /// 削除
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public async Task<DataResult> RemoveStream(string where)
+ {
+ DataResult result = null;
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+
+ using (var call = Client.RemoveStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ public DataResult SetData(PayTable table)
+ {
+ return Client.SetData(table);
+ }
+
+ /// <summary>
+ /// バッチ更新
+ /// </summary>
+ /// <param name="table"></param>
+ /// <returns></returns>
+ public async Task<DataResult> SetDataStream(PayTable table)
+ {
+ DataResult result = null;
+ using (var call = Client.SetDataStream())
+ {
+ await call.RequestStream.WriteAsync(table);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+ }
+}
diff --git a/HotelPms.DataAccessGrpc.Client/PayDivAccess.cs b/HotelPms.DataAccessGrpc.Client/PayDivAccess.cs
new file mode 100644
index 0000000..0161fb5
--- /dev/null
+++ b/HotelPms.DataAccessGrpc.Client/PayDivAccess.cs
@@ -0,0 +1,267 @@
+using Google.Protobuf;
+using Grpc.Core;
+using Grpc.Net.Client;
+using HotelPms.Data.Common;
+using HotelPms.Data.UseInfo;
+using HotelPms.Share.Util;
+using System;
+using System.Data;
+using System.Threading.Tasks;
+using HotelPms.Data;
+using System.Collections.Generic;
+using HotelPms.Data.Common.Pagination;
+using System.Text.Json;
+using System.Threading;
+using HotelPms.Data.Client;
+
+namespace HotelPms.DataAccessGrpc.Client
+{
+ internal class PayDivAccess : IDisposable
+ {
+ /// <summary>
+ /// チャネル
+ /// </summary>
+ public GrpcChannel Channel { get; private set; } = null;
+ public PayDivCore.PayDivCoreClient Client { get; private set; } = null;
+
+
+ public PayDivAccess(GrpcChannel channel)
+ {
+ Channel = channel;
+ Client = new PayDivCore.PayDivCoreClient(Channel);
+ }
+
+ public void Dispose()
+ {
+
+ }
+
+ public async Task<bool> Exists(int pID,int pDetailID,DateTime pUseDate,int pPayID,int pRowNo)
+ {
+ return await GrpcClient.ExecuteScalar(Channel, $"IF EXISTS(SELECT 1 FROM D_PayDiv WHERE ID = {pID} AND DetailID = {pDetailID} AND UseDate = {CConvert.ToSqlValue(pUseDate)} AND PayID = {pPayID} AND RowNo = {pRowNo}) SELECT 1 ELSE SELECT 0") == "1";
+
+ }
+
+ public async Task<FileGrpcData> OutputStream(PagingRequest request)
+ {
+ FileGrpcData data = null;
+ request.Table = "D_PayDiv";
+ string json = JsonSerializer.Serialize(request);
+ using (var call = Client.OutputStream(GrpcClient.CreateDataRequest(2, json)))
+ {
+ var reaponseStream = call.ResponseStream;
+ //データの取得
+ while (await reaponseStream.MoveNext(CancellationToken.None))
+ {
+ data = reaponseStream.Current;
+ }
+ }
+ return data;
+ }
+
+ public async Task<PayDivTable> GetPageData(PagingRequest request)
+ {
+ request.Table = "D_PayDiv";
+ string json = JsonSerializer.Serialize(request);
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(1, json));
+ }
+
+
+ public DataTable GetMasterGridData(string where)
+ {
+ GrpcTable table = GrpcClient.GetTable(Channel, (int)ETableActionType.BuildingMasterGrid, where);
+ return table.ToDataTable();
+ }
+
+ /// <summary>
+ /// 同期データ取得
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public PayDivTable GetData(string where)
+ {
+ return Client.GetData(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ public async Task<PayDivTable> GetDataAsync(string where)
+ {
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public PayDiv GetItem(int pID,int pDetailID,DateTime pUseDate,int pPayID,int pRowNo)
+ {
+ PayDivTable table = GetData($"ID = {pID} AND DetailID = {pDetailID} AND UseDate = {CConvert.ToSqlValue(pUseDate)} AND PayID = {pPayID} AND RowNo = {pRowNo}");
+ if(table == null || table.ErrNo != 0 || table.Rows.Count == 0) { return null; }
+ return table.Rows[0];
+ }
+
+ public async Task<PayDivTable> GetDataStream()
+ {
+ return await GetDataStream(string.Empty);
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public async Task<PayDivTable> GetDataStream(string where)
+ {
+ PayDivTable table = null;
+ using (var call = Client.GetDataStream())
+ {
+ await call.RequestStream.WriteAsync(GrpcClient.CreateDataRequest(0, where));
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<PayDivTable>())
+ {
+ table = message;
+ break;
+ }
+ }
+ return table;
+ }
+
+ public async Task<DataResult> AddAsync(PayDiv data)
+ {
+ return await Client.AddAsync(data);
+ }
+
+ public DataResult Add(PayDiv data)
+ {
+ return Client.Add(data);
+ }
+
+ public async Task<DataResult> UpdateAsync(PayDiv data)
+ {
+ return await Client.UpdateAsync(data);
+ }
+
+ public DataResult Update(PayDiv data)
+ {
+ return Client.Update(data);
+ }
+
+ /// <summary>
+ /// 追加若しくは更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <param name="add"></param>
+ /// <returns></returns>
+ private async Task<DataResult> AddOrUpdateStream(PayDiv data, bool add)
+ {
+ DataResult result = null;
+ using (var call = add ? Client.AddStream() : Client.UpdateStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ /// <summary>
+ /// 追加
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> AddStream(PayDiv data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ /// <summary>
+ /// 更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> UpdateStream(PayDiv data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ public DataResult Remove(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return Client.Remove(data);
+ }
+
+ public async Task<DataResult> RemoveAsync(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return await Client.RemoveAsync(data);
+ }
+
+ /// <summary>
+ /// 削除
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public async Task<DataResult> RemoveStream(string where)
+ {
+ DataResult result = null;
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+
+ using (var call = Client.RemoveStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ public DataResult SetData(PayDivTable table)
+ {
+ return Client.SetData(table);
+ }
+
+ /// <summary>
+ /// バッチ更新
+ /// </summary>
+ /// <param name="table"></param>
+ /// <returns></returns>
+ public async Task<DataResult> SetDataStream(PayDivTable table)
+ {
+ DataResult result = null;
+ using (var call = Client.SetDataStream())
+ {
+ await call.RequestStream.WriteAsync(table);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+ }
+}
diff --git a/HotelPms.DataAccessGrpc.Client/ReceiptAccess.cs b/HotelPms.DataAccessGrpc.Client/ReceiptAccess.cs
new file mode 100644
index 0000000..4799841
--- /dev/null
+++ b/HotelPms.DataAccessGrpc.Client/ReceiptAccess.cs
@@ -0,0 +1,267 @@
+using Google.Protobuf;
+using Grpc.Core;
+using Grpc.Net.Client;
+using HotelPms.Data.Common;
+using HotelPms.Data.UseInfo;
+using HotelPms.Share.Util;
+using System;
+using System.Data;
+using System.Threading.Tasks;
+using HotelPms.Data;
+using System.Collections.Generic;
+using HotelPms.Data.Common.Pagination;
+using System.Text.Json;
+using System.Threading;
+using HotelPms.Data.Client;
+
+namespace HotelPms.DataAccessGrpc.Client
+{
+ internal class ReceiptAccess : IDisposable
+ {
+ /// <summary>
+ /// チャネル
+ /// </summary>
+ public GrpcChannel Channel { get; private set; } = null;
+ public ReceiptCore.ReceiptCoreClient Client { get; private set; } = null;
+
+
+ public ReceiptAccess(GrpcChannel channel)
+ {
+ Channel = channel;
+ Client = new ReceiptCore.ReceiptCoreClient(Channel);
+ }
+
+ public void Dispose()
+ {
+
+ }
+
+ public async Task<bool> Exists(int pID,int pReceiptID)
+ {
+ return await GrpcClient.ExecuteScalar(Channel, $"IF EXISTS(SELECT 1 FROM D_Receipt WHERE ID = {pID} AND ReceiptID = {pReceiptID}) SELECT 1 ELSE SELECT 0") == "1";
+
+ }
+
+ public async Task<FileGrpcData> OutputStream(PagingRequest request)
+ {
+ FileGrpcData data = null;
+ request.Table = "D_Receipt";
+ string json = JsonSerializer.Serialize(request);
+ using (var call = Client.OutputStream(GrpcClient.CreateDataRequest(2, json)))
+ {
+ var reaponseStream = call.ResponseStream;
+ //データの取得
+ while (await reaponseStream.MoveNext(CancellationToken.None))
+ {
+ data = reaponseStream.Current;
+ }
+ }
+ return data;
+ }
+
+ public async Task<ReceiptTable> GetPageData(PagingRequest request)
+ {
+ request.Table = "D_Receipt";
+ string json = JsonSerializer.Serialize(request);
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(1, json));
+ }
+
+
+ public DataTable GetMasterGridData(string where)
+ {
+ GrpcTable table = GrpcClient.GetTable(Channel, (int)ETableActionType.BuildingMasterGrid, where);
+ return table.ToDataTable();
+ }
+
+ /// <summary>
+ /// 同期データ取得
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public ReceiptTable GetData(string where)
+ {
+ return Client.GetData(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ public async Task<ReceiptTable> GetDataAsync(string where)
+ {
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public Receipt GetItem(int pID,int pReceiptID)
+ {
+ ReceiptTable table = GetData($"ID = {pID} AND ReceiptID = {pReceiptID}");
+ if(table == null || table.ErrNo != 0 || table.Rows.Count == 0) { return null; }
+ return table.Rows[0];
+ }
+
+ public async Task<ReceiptTable> GetDataStream()
+ {
+ return await GetDataStream(string.Empty);
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public async Task<ReceiptTable> GetDataStream(string where)
+ {
+ ReceiptTable table = null;
+ using (var call = Client.GetDataStream())
+ {
+ await call.RequestStream.WriteAsync(GrpcClient.CreateDataRequest(0, where));
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<ReceiptTable>())
+ {
+ table = message;
+ break;
+ }
+ }
+ return table;
+ }
+
+ public async Task<DataResult> AddAsync(Receipt data)
+ {
+ return await Client.AddAsync(data);
+ }
+
+ public DataResult Add(Receipt data)
+ {
+ return Client.Add(data);
+ }
+
+ public async Task<DataResult> UpdateAsync(Receipt data)
+ {
+ return await Client.UpdateAsync(data);
+ }
+
+ public DataResult Update(Receipt data)
+ {
+ return Client.Update(data);
+ }
+
+ /// <summary>
+ /// 追加若しくは更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <param name="add"></param>
+ /// <returns></returns>
+ private async Task<DataResult> AddOrUpdateStream(Receipt data, bool add)
+ {
+ DataResult result = null;
+ using (var call = add ? Client.AddStream() : Client.UpdateStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ /// <summary>
+ /// 追加
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> AddStream(Receipt data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ /// <summary>
+ /// 更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> UpdateStream(Receipt data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ public DataResult Remove(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return Client.Remove(data);
+ }
+
+ public async Task<DataResult> RemoveAsync(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return await Client.RemoveAsync(data);
+ }
+
+ /// <summary>
+ /// 削除
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public async Task<DataResult> RemoveStream(string where)
+ {
+ DataResult result = null;
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+
+ using (var call = Client.RemoveStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ public DataResult SetData(ReceiptTable table)
+ {
+ return Client.SetData(table);
+ }
+
+ /// <summary>
+ /// バッチ更新
+ /// </summary>
+ /// <param name="table"></param>
+ /// <returns></returns>
+ public async Task<DataResult> SetDataStream(ReceiptTable table)
+ {
+ DataResult result = null;
+ using (var call = Client.SetDataStream())
+ {
+ await call.RequestStream.WriteAsync(table);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+ }
+}
diff --git a/HotelPms.DataAccessGrpc.Client/RentalAccess.cs b/HotelPms.DataAccessGrpc.Client/RentalAccess.cs
new file mode 100644
index 0000000..bf9812f
--- /dev/null
+++ b/HotelPms.DataAccessGrpc.Client/RentalAccess.cs
@@ -0,0 +1,267 @@
+using Google.Protobuf;
+using Grpc.Core;
+using Grpc.Net.Client;
+using HotelPms.Data.Common;
+using HotelPms.Data.UseInfo;
+using HotelPms.Share.Util;
+using System;
+using System.Data;
+using System.Threading.Tasks;
+using HotelPms.Data;
+using System.Collections.Generic;
+using HotelPms.Data.Common.Pagination;
+using System.Text.Json;
+using System.Threading;
+using HotelPms.Data.Client;
+
+namespace HotelPms.DataAccessGrpc.Client
+{
+ internal class RentalAccess : IDisposable
+ {
+ /// <summary>
+ /// チャネル
+ /// </summary>
+ public GrpcChannel Channel { get; private set; } = null;
+ public RentalCore.RentalCoreClient Client { get; private set; } = null;
+
+
+ public RentalAccess(GrpcChannel channel)
+ {
+ Channel = channel;
+ Client = new RentalCore.RentalCoreClient(Channel);
+ }
+
+ public void Dispose()
+ {
+
+ }
+
+ public async Task<bool> Exists(int pID,int pDetailID,DateTime pBeginDate,string pFixturesID)
+ {
+ return await GrpcClient.ExecuteScalar(Channel, $"IF EXISTS(SELECT 1 FROM D_Rental WHERE ID = {pID} AND DetailID = {pDetailID} AND BeginDate = {CConvert.ToSqlValue(pBeginDate)} AND FixturesID = N'{pFixturesID}') SELECT 1 ELSE SELECT 0") == "1";
+
+ }
+
+ public async Task<FileGrpcData> OutputStream(PagingRequest request)
+ {
+ FileGrpcData data = null;
+ request.Table = "D_Rental";
+ string json = JsonSerializer.Serialize(request);
+ using (var call = Client.OutputStream(GrpcClient.CreateDataRequest(2, json)))
+ {
+ var reaponseStream = call.ResponseStream;
+ //データの取得
+ while (await reaponseStream.MoveNext(CancellationToken.None))
+ {
+ data = reaponseStream.Current;
+ }
+ }
+ return data;
+ }
+
+ public async Task<RentalTable> GetPageData(PagingRequest request)
+ {
+ request.Table = "D_Rental";
+ string json = JsonSerializer.Serialize(request);
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(1, json));
+ }
+
+
+ public DataTable GetMasterGridData(string where)
+ {
+ GrpcTable table = GrpcClient.GetTable(Channel, (int)ETableActionType.BuildingMasterGrid, where);
+ return table.ToDataTable();
+ }
+
+ /// <summary>
+ /// 同期データ取得
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public RentalTable GetData(string where)
+ {
+ return Client.GetData(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ public async Task<RentalTable> GetDataAsync(string where)
+ {
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public Rental GetItem(int pID,int pDetailID,DateTime pBeginDate,string pFixturesID)
+ {
+ RentalTable table = GetData($"ID = {pID} AND DetailID = {pDetailID} AND BeginDate = {CConvert.ToSqlValue(pBeginDate)} AND FixturesID = N'{pFixturesID}'");
+ if(table == null || table.ErrNo != 0 || table.Rows.Count == 0) { return null; }
+ return table.Rows[0];
+ }
+
+ public async Task<RentalTable> GetDataStream()
+ {
+ return await GetDataStream(string.Empty);
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public async Task<RentalTable> GetDataStream(string where)
+ {
+ RentalTable table = null;
+ using (var call = Client.GetDataStream())
+ {
+ await call.RequestStream.WriteAsync(GrpcClient.CreateDataRequest(0, where));
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<RentalTable>())
+ {
+ table = message;
+ break;
+ }
+ }
+ return table;
+ }
+
+ public async Task<DataResult> AddAsync(Rental data)
+ {
+ return await Client.AddAsync(data);
+ }
+
+ public DataResult Add(Rental data)
+ {
+ return Client.Add(data);
+ }
+
+ public async Task<DataResult> UpdateAsync(Rental data)
+ {
+ return await Client.UpdateAsync(data);
+ }
+
+ public DataResult Update(Rental data)
+ {
+ return Client.Update(data);
+ }
+
+ /// <summary>
+ /// 追加若しくは更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <param name="add"></param>
+ /// <returns></returns>
+ private async Task<DataResult> AddOrUpdateStream(Rental data, bool add)
+ {
+ DataResult result = null;
+ using (var call = add ? Client.AddStream() : Client.UpdateStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ /// <summary>
+ /// 追加
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> AddStream(Rental data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ /// <summary>
+ /// 更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> UpdateStream(Rental data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ public DataResult Remove(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return Client.Remove(data);
+ }
+
+ public async Task<DataResult> RemoveAsync(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return await Client.RemoveAsync(data);
+ }
+
+ /// <summary>
+ /// 削除
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public async Task<DataResult> RemoveStream(string where)
+ {
+ DataResult result = null;
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+
+ using (var call = Client.RemoveStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ public DataResult SetData(RentalTable table)
+ {
+ return Client.SetData(table);
+ }
+
+ /// <summary>
+ /// バッチ更新
+ /// </summary>
+ /// <param name="table"></param>
+ /// <returns></returns>
+ public async Task<DataResult> SetDataStream(RentalTable table)
+ {
+ DataResult result = null;
+ using (var call = Client.SetDataStream())
+ {
+ await call.RequestStream.WriteAsync(table);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+ }
+}
diff --git a/HotelPms.DataAccessGrpc.Client/RoomCellAccess.cs b/HotelPms.DataAccessGrpc.Client/RoomCellAccess.cs
new file mode 100644
index 0000000..8b0cc95
--- /dev/null
+++ b/HotelPms.DataAccessGrpc.Client/RoomCellAccess.cs
@@ -0,0 +1,273 @@
+using Google.Protobuf;
+using Grpc.Core;
+using Grpc.Net.Client;
+using HotelPms.Data.Client;
+using HotelPms.Data.Common;
+using HotelPms.Data.Master;
+using HotelPms.Share.Util;
+using System;
+using System.Data;
+using System.Threading.Tasks;
+using HotelPms.Data;
+using System.Collections.Generic;
+using HotelPms.Data.Common.Pagination;
+using System.Text.Json;
+using System.Threading;
+
+namespace HotelPms.DataAccessGrpc.Client
+{
+ public class RoomCellAccess : IDisposable
+ {
+ /// <summary>
+ /// チャネル
+ /// </summary>
+ public GrpcChannel Channel { get; private set; } = null;
+ public RoomCellCore.RoomCellCoreClient Client { get; private set; } = null;
+
+
+ public RoomCellAccess(GrpcChannel channel)
+ {
+ Channel = channel;
+ Client = new RoomCellCore.RoomCellCoreClient(Channel);
+ }
+
+ public void Dispose()
+ {
+
+ }
+
+ public bool Exists(int pTabID,string pCtrlName)
+ {
+ return GrpcClient.ExecuteScalarSync(Channel, $"IF EXISTS(SELECT 1 FROM M_RoomCell WHERE TabID = {pTabID} AND CtrlName = N'{pCtrlName}') SELECT 1 ELSE SELECT 0") == "1";
+
+ }
+
+ public async Task<bool> ExistsAsync(int pTabID,string pCtrlName)
+ {
+ return await GrpcClient.ExecuteScalar(Channel, $"IF EXISTS(SELECT 1 FROM M_RoomCell WHERE TabID = {pTabID} AND CtrlName = N'{pCtrlName}') SELECT 1 ELSE SELECT 0") == "1";
+
+ }
+
+ public async Task<FileGrpcData> OutputStream(PagingRequest request)
+ {
+ FileGrpcData data = null;
+ request.Table = "M_RoomCell";
+ string json = JsonSerializer.Serialize(request);
+ using (var call = Client.OutputStream(GrpcClient.CreateDataRequest(2, json)))
+ {
+ var reaponseStream = call.ResponseStream;
+ //データの取得
+ while (await reaponseStream.MoveNext(CancellationToken.None))
+ {
+ data = reaponseStream.Current;
+ }
+ }
+ return data;
+ }
+
+ public async Task<RoomCellTable> GetPageData(PagingRequest request)
+ {
+ request.Table = "M_RoomCell";
+ string json = JsonSerializer.Serialize(request);
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(1, json));
+ }
+
+
+ public DataTable GetMasterGridData(string where)
+ {
+ GrpcTable table = GrpcClient.GetTable(Channel, (int)ETableActionType.BuildingMasterGrid, where);
+ return table.ToDataTable();
+ }
+
+ /// <summary>
+ /// 同期データ取得
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public RoomCellTable GetData(string where)
+ {
+ return Client.GetData(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ public async Task<RoomCellTable> GetDataAsync(string where)
+ {
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public RoomCell GetItem(int pTabID,string pCtrlName)
+ {
+ RoomCellTable table = GetData($"TabID = {pTabID} AND CtrlName = N'{pCtrlName}'");
+ if(table == null || table.ErrNo != 0 || table.Rows.Count == 0) { return null; }
+ return table.Rows[0];
+ }
+
+ public async Task<RoomCellTable> GetDataStream()
+ {
+ return await GetDataStream(string.Empty);
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public async Task<RoomCellTable> GetDataStream(string where)
+ {
+ RoomCellTable table = null;
+ using (var call = Client.GetDataStream())
+ {
+ await call.RequestStream.WriteAsync(GrpcClient.CreateDataRequest(0, where));
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<RoomCellTable>())
+ {
+ table = message;
+ break;
+ }
+ }
+ return table;
+ }
+
+ public async Task<DataResult> AddAsync(RoomCell data)
+ {
+ return await Client.AddAsync(data);
+ }
+
+ public DataResult Add(RoomCell data)
+ {
+ return Client.Add(data);
+ }
+
+ public async Task<DataResult> UpdateAsync(RoomCell data)
+ {
+ return await Client.UpdateAsync(data);
+ }
+
+ public DataResult Update(RoomCell data)
+ {
+ return Client.Update(data);
+ }
+
+ /// <summary>
+ /// 追加若しくは更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <param name="add"></param>
+ /// <returns></returns>
+ private async Task<DataResult> AddOrUpdateStream(RoomCell data, bool add)
+ {
+ DataResult result = null;
+ using (var call = add ? Client.AddStream() : Client.UpdateStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ /// <summary>
+ /// 追加
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> AddStream(RoomCell data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ /// <summary>
+ /// 更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> UpdateStream(RoomCell data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ public DataResult Remove(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return Client.Remove(data);
+ }
+
+ public async Task<DataResult> RemoveAsync(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return await Client.RemoveAsync(data);
+ }
+
+ /// <summary>
+ /// 削除
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public async Task<DataResult> RemoveStream(string where)
+ {
+ DataResult result = null;
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+
+ using (var call = Client.RemoveStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ public DataResult SetData(RoomCellTable table)
+ {
+ return Client.SetData(table);
+ }
+
+ /// <summary>
+ /// バッチ更新
+ /// </summary>
+ /// <param name="table"></param>
+ /// <returns></returns>
+ public async Task<DataResult> SetDataStream(RoomCellTable table)
+ {
+ DataResult result = null;
+ using (var call = Client.SetDataStream())
+ {
+ await call.RequestStream.WriteAsync(table);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+ }
+}
diff --git a/HotelPms.DataAccessGrpc.Client/RoomStatusAccess.cs b/HotelPms.DataAccessGrpc.Client/RoomStatusAccess.cs
new file mode 100644
index 0000000..327a56c
--- /dev/null
+++ b/HotelPms.DataAccessGrpc.Client/RoomStatusAccess.cs
@@ -0,0 +1,284 @@
+using Google.Protobuf;
+using Grpc.Core;
+using Grpc.Net.Client;
+using HotelPms.Data.Client;
+using HotelPms.Data.Common;
+using HotelPms.Data.Master;
+using HotelPms.Share.Util;
+using System;
+using System.Data;
+using System.Threading.Tasks;
+using HotelPms.Data;
+using System.Collections.Generic;
+using HotelPms.Data.Common.Pagination;
+using System.Text.Json;
+using System.Threading;
+
+namespace HotelPms.DataAccessGrpc.Client
+{
+ public class RoomStatusAccess : IDisposable
+ {
+ /// <summary>
+ /// チャネル
+ /// </summary>
+ public GrpcChannel Channel { get; private set; } = null;
+ public RoomStatusCore.RoomStatusCoreClient Client { get; private set; } = null;
+
+
+ public RoomStatusAccess(GrpcChannel channel)
+ {
+ Channel = channel;
+ Client = new RoomStatusCore.RoomStatusCoreClient(Channel);
+ }
+
+ public void Dispose()
+ {
+
+ }
+
+ public bool Exists(int pID)
+ {
+ return GrpcClient.ExecuteScalarSync(Channel, $"IF EXISTS(SELECT 1 FROM M_RoomStatus WHERE ID = {pID}) SELECT 1 ELSE SELECT 0") == "1";
+
+ }
+
+ public async Task<bool> ExistsAsync(int pID)
+ {
+ return await GrpcClient.ExecuteScalar(Channel, $"IF EXISTS(SELECT 1 FROM M_RoomStatus WHERE ID = {pID}) SELECT 1 ELSE SELECT 0") == "1";
+
+ }
+
+ public async Task<FileGrpcData> OutputStream(PagingRequest request)
+ {
+ FileGrpcData data = null;
+ request.Table = "M_RoomStatus";
+ string json = JsonSerializer.Serialize(request);
+ using (var call = Client.OutputStream(GrpcClient.CreateDataRequest(2, json)))
+ {
+ var reaponseStream = call.ResponseStream;
+ //データの取得
+ while (await reaponseStream.MoveNext(CancellationToken.None))
+ {
+ data = reaponseStream.Current;
+ }
+ }
+ return data;
+ }
+
+ public async Task<RoomStatusTable> GetPageData(PagingRequest request)
+ {
+ request.Table = "M_RoomStatus";
+ string json = JsonSerializer.Serialize(request);
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(1, json));
+ }
+
+
+ public DataTable GetMasterGridData(string where)
+ {
+ GrpcTable table = GrpcClient.GetTable(Channel, (int)ETableActionType.RoomStatusMasterGrid, where);
+ return table.ToDataTable();
+ }
+
+ public async Task<DataTable> UpdateRoomStatus(DateTime useDate, int roomNo, int status)
+ {
+ GrpcTable table = await GrpcClient.GetTableAsync(Channel, (int)ETableActionType.UpdateRoomStatus, $"{CConvert.ToDateString(useDate)},{roomNo},{status}");
+ return table.ToDataTable();
+ }
+
+ /// <summary>
+ /// 同期データ取得
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public RoomStatusTable GetData(string where)
+ {
+ return Client.GetData(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ /// <summary>
+ /// 非同期データ取得
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public async Task<RoomStatusTable> GetDataAsync(string where)
+ {
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public RoomStatus GetItem(int pID)
+ {
+ RoomStatusTable table = GetData($"ID = {pID}");
+ if(table == null || table.ErrNo != 0 || table.Rows.Count == 0) { return null; }
+ return table.Rows[0];
+ }
+
+ public async Task<RoomStatusTable> GetDataStream()
+ {
+ return await GetDataStream(string.Empty);
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public async Task<RoomStatusTable> GetDataStream(string where)
+ {
+ RoomStatusTable table = null;
+ using (var call = Client.GetDataStream())
+ {
+ await call.RequestStream.WriteAsync(GrpcClient.CreateDataRequest(0, where));
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<RoomStatusTable>())
+ {
+ table = message;
+ break;
+ }
+ }
+ return table;
+ }
+
+ public async Task<DataResult> AddAsync(RoomStatus data)
+ {
+ return await Client.AddAsync(data);
+ }
+
+ public DataResult Add(RoomStatus data)
+ {
+ return Client.Add(data);
+ }
+
+ public async Task<DataResult> UpdateAsync(RoomStatus data)
+ {
+ return await Client.UpdateAsync(data);
+ }
+
+ public DataResult Update(RoomStatus data)
+ {
+ return Client.Update(data);
+ }
+
+ /// <summary>
+ /// 追加若しくは更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <param name="add"></param>
+ /// <returns></returns>
+ private async Task<DataResult> AddOrUpdateStream(RoomStatus data, bool add)
+ {
+ DataResult result = null;
+ using (var call = add ? Client.AddStream() : Client.UpdateStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ /// <summary>
+ /// 追加
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> AddStream(RoomStatus data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ /// <summary>
+ /// 更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> UpdateStream(RoomStatus data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ public DataResult Remove(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return Client.Remove(data);
+ }
+
+ public async Task<DataResult> RemoveAsync(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return await Client.RemoveAsync(data);
+ }
+
+ /// <summary>
+ /// 削除
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public async Task<DataResult> RemoveStream(string where)
+ {
+ DataResult result = null;
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+
+ using (var call = Client.RemoveStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ public DataResult SetData(RoomStatusTable table)
+ {
+ return Client.SetData(table);
+ }
+
+ /// <summary>
+ /// バッチ更新
+ /// </summary>
+ /// <param name="table"></param>
+ /// <returns></returns>
+ public async Task<DataResult> SetDataStream(RoomStatusTable table)
+ {
+ DataResult result = null;
+ using (var call = Client.SetDataStream())
+ {
+ await call.RequestStream.WriteAsync(table);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+ }
+}
diff --git a/HotelPms.DataAccessGrpc.Client/RoomTypeAccess.cs b/HotelPms.DataAccessGrpc.Client/RoomTypeAccess.cs
new file mode 100644
index 0000000..3572853
--- /dev/null
+++ b/HotelPms.DataAccessGrpc.Client/RoomTypeAccess.cs
@@ -0,0 +1,272 @@
+using Google.Protobuf;
+using Grpc.Core;
+using Grpc.Net.Client;
+using HotelPms.Data.Client;
+using HotelPms.Data.Common;
+using HotelPms.Data.Master;
+using HotelPms.Share.Util;
+using System;
+using System.Data;
+using System.Threading.Tasks;
+using HotelPms.Data;
+using System.Collections.Generic;
+using HotelPms.Data.Common.Pagination;
+using System.Text.Json;
+using System.Threading;
+
+namespace HotelPms.DataAccessGrpc.Client;
+
+public class RoomTypeAccess : IDisposable
+{
+ /// <summary>
+ /// チャネル
+ /// </summary>
+ public GrpcChannel Channel { get; private set; } = null;
+ public RoomTypeCore.RoomTypeCoreClient Client { get; private set; } = null;
+
+
+ public RoomTypeAccess(GrpcChannel channel)
+ {
+ Channel = channel;
+ Client = new RoomTypeCore.RoomTypeCoreClient(Channel);
+ }
+
+ public void Dispose()
+ {
+
+ }
+
+ public bool Exists(int pID)
+ {
+ return GrpcClient.ExecuteScalarSync(Channel, $"IF EXISTS(SELECT 1 FROM M_RoomType WHERE ID = {pID}) SELECT 1 ELSE SELECT 0") == "1";
+
+ }
+
+ public async Task<bool> ExistsAsync(int pID)
+ {
+ return await GrpcClient.ExecuteScalar(Channel, $"IF EXISTS(SELECT 1 FROM M_RoomType WHERE ID = {pID}) SELECT 1 ELSE SELECT 0") == "1";
+
+ }
+
+ public async Task<FileGrpcData> OutputStream(PagingRequest request)
+ {
+ FileGrpcData data = null;
+ request.Table = "M_RoomType";
+ string json = JsonSerializer.Serialize(request);
+ using (var call = Client.OutputStream(GrpcClient.CreateDataRequest(2, json)))
+ {
+ var reaponseStream = call.ResponseStream;
+ //データの取得
+ while (await reaponseStream.MoveNext(CancellationToken.None))
+ {
+ data = reaponseStream.Current;
+ }
+ }
+ return data;
+ }
+
+ public async Task<RoomTypeTable> GetPageData(PagingRequest request)
+ {
+ request.Table = "M_RoomType";
+ string json = JsonSerializer.Serialize(request);
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(1, json));
+ }
+
+
+ public DataTable GetMasterGridData(string where)
+ {
+ GrpcTable table = GrpcClient.GetTable(Channel, (int)ETableActionType.BuildingMasterGrid, where);
+ return table.ToDataTable();
+ }
+
+ /// <summary>
+ /// 同期データ取得
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public RoomTypeTable GetData(string where)
+ {
+ return Client.GetData(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ public async Task<RoomTypeTable> GetDataAsync(string where)
+ {
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public RoomType GetItem(int pID)
+ {
+ RoomTypeTable table = GetData($"ID = {pID}");
+ if(table == null || table.ErrNo != 0 || table.Rows.Count == 0) { return null; }
+ return table.Rows[0];
+ }
+
+ public async Task<RoomTypeTable> GetDataStream()
+ {
+ return await GetDataStream(string.Empty);
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public async Task<RoomTypeTable> GetDataStream(string where)
+ {
+ RoomTypeTable table = null;
+ using (var call = Client.GetDataStream())
+ {
+ await call.RequestStream.WriteAsync(GrpcClient.CreateDataRequest(0, where));
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<RoomTypeTable>())
+ {
+ table = message;
+ break;
+ }
+ }
+ return table;
+ }
+
+ public async Task<DataResult> AddAsync(RoomType data)
+ {
+ return await Client.AddAsync(data);
+ }
+
+ public DataResult Add(RoomType data)
+ {
+ return Client.Add(data);
+ }
+
+ public async Task<DataResult> UpdateAsync(RoomType data)
+ {
+ return await Client.UpdateAsync(data);
+ }
+
+ public DataResult Update(RoomType data)
+ {
+ return Client.Update(data);
+ }
+
+ /// <summary>
+ /// 追加若しくは更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <param name="add"></param>
+ /// <returns></returns>
+ private async Task<DataResult> AddOrUpdateStream(RoomType data, bool add)
+ {
+ DataResult result = null;
+ using (var call = add ? Client.AddStream() : Client.UpdateStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ /// <summary>
+ /// 追加
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> AddStream(RoomType data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ /// <summary>
+ /// 更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> UpdateStream(RoomType data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ public DataResult Remove(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return Client.Remove(data);
+ }
+
+ public async Task<DataResult> RemoveAsync(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return await Client.RemoveAsync(data);
+ }
+
+ /// <summary>
+ /// 削除
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public async Task<DataResult> RemoveStream(string where)
+ {
+ DataResult result = null;
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+
+ using (var call = Client.RemoveStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ public DataResult SetData(RoomTypeTable table)
+ {
+ return Client.SetData(table);
+ }
+
+ /// <summary>
+ /// バッチ更新
+ /// </summary>
+ /// <param name="table"></param>
+ /// <returns></returns>
+ public async Task<DataResult> SetDataStream(RoomTypeTable table)
+ {
+ DataResult result = null;
+ using (var call = Client.SetDataStream())
+ {
+ await call.RequestStream.WriteAsync(table);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+}
diff --git a/HotelPms.DataAccessGrpc.Client/RoomViewLayoutAccess.cs b/HotelPms.DataAccessGrpc.Client/RoomViewLayoutAccess.cs
new file mode 100644
index 0000000..beefcd1
--- /dev/null
+++ b/HotelPms.DataAccessGrpc.Client/RoomViewLayoutAccess.cs
@@ -0,0 +1,294 @@
+using Google.Protobuf;
+using Grpc.Core;
+using Grpc.Net.Client;
+using HotelPms.Data.Client;
+using HotelPms.Data.Common;
+using HotelPms.Data.Master;
+using HotelPms.Share.Util;
+using System;
+using System.Data;
+using System.Threading.Tasks;
+using HotelPms.Data;
+using System.Collections.Generic;
+using HotelPms.Data.Common.Pagination;
+using System.Text.Json;
+using System.Threading;
+
+namespace HotelPms.DataAccessGrpc.Client
+{
+ public class RoomViewLayoutAccess : IDisposable
+ {
+ /// <summary>
+ /// チャネル
+ /// </summary>
+ public GrpcChannel Channel { get; private set; } = null;
+ public RoomViewLayoutCore.RoomViewLayoutCoreClient Client { get; private set; } = null;
+
+
+ public RoomViewLayoutAccess(GrpcChannel channel)
+ {
+ Channel = channel;
+ Client = new RoomViewLayoutCore.RoomViewLayoutCoreClient(Channel);
+ }
+
+ public void Dispose()
+ {
+
+ }
+
+ public bool Exists(int pTabID,int pRow,int pCol)
+ {
+ return GrpcClient.ExecuteScalarSync(Channel, $"IF EXISTS(SELECT 1 FROM M_RoomViewLayout WHERE TabID = {pTabID} AND Row = {pRow} AND Col = {pCol}) SELECT 1 ELSE SELECT 0") == "1";
+
+ }
+
+ public async Task<bool> ExistsAsync(int pTabID,int pRow,int pCol)
+ {
+ return await GrpcClient.ExecuteScalar(Channel, $"IF EXISTS(SELECT 1 FROM M_RoomViewLayout WHERE TabID = {pTabID} AND Row = {pRow} AND Col = {pCol}) SELECT 1 ELSE SELECT 0") == "1";
+
+ }
+
+ public async Task<FileGrpcData> OutputStream(PagingRequest request)
+ {
+ FileGrpcData data = null;
+ request.Table = "M_RoomViewLayout";
+ string json = JsonSerializer.Serialize(request);
+ using (var call = Client.OutputStream(GrpcClient.CreateDataRequest(2, json)))
+ {
+ var reaponseStream = call.ResponseStream;
+ //データの取得
+ while (await reaponseStream.MoveNext(CancellationToken.None))
+ {
+ data = reaponseStream.Current;
+ }
+ }
+ return data;
+ }
+
+ public async Task<RoomViewLayoutTable> GetPageData(PagingRequest request)
+ {
+ request.Table = "M_RoomViewLayout";
+ string json = JsonSerializer.Serialize(request);
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(1, json));
+ }
+
+ /// <summary>
+ ///
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public DataTable GetMasterGridData(string where)
+ {
+ GrpcTable table = GrpcClient.GetTable(Channel, (int)ETableActionType.RoomViewLayoutGrid, where);
+ return table.ToDataTable();
+ }
+
+ public async Task<DataTable> GetRoomState(string where)
+ {
+ GrpcTable table = await GrpcClient.GetTableAsync(Channel, (int)ETableActionType.RoomViewState, where);
+ return table.ToDataTable();
+ }
+
+ /// <summary>
+ /// 客室状況画面の日別表示データ
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public async Task<DataSet> GetRoomViewData(string where)
+ {
+ GrpcSet set = await GrpcClient.GetGrpcSet(Channel, (int)ESetActionType.RoomView, where);
+ return set.ToDataSet();
+ }
+
+ /// <summary>
+ /// 同期データ取得
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public RoomViewLayoutTable GetData(string where)
+ {
+ return Client.GetData(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ public async Task<RoomViewLayoutTable> GetDataAsync(string where)
+ {
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public RoomViewLayout GetItem(int pTabID,int pRow,int pCol)
+ {
+ RoomViewLayoutTable table = GetData($"TabID = {pTabID} AND Row = {pRow} AND Col = {pCol}");
+ if(table == null || table.ErrNo != 0 || table.Rows.Count == 0) { return null; }
+ return table.Rows[0];
+ }
+
+ public async Task<RoomViewLayoutTable> GetDataStream()
+ {
+ return await GetDataStream(string.Empty);
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public async Task<RoomViewLayoutTable> GetDataStream(string where)
+ {
+ RoomViewLayoutTable table = null;
+ using (var call = Client.GetDataStream())
+ {
+ await call.RequestStream.WriteAsync(GrpcClient.CreateDataRequest(0, where));
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<RoomViewLayoutTable>())
+ {
+ table = message;
+ break;
+ }
+ }
+ return table;
+ }
+
+ public async Task<DataResult> AddAsync(RoomViewLayout data)
+ {
+ return await Client.AddAsync(data);
+ }
+
+ public DataResult Add(RoomViewLayout data)
+ {
+ return Client.Add(data);
+ }
+
+ public async Task<DataResult> UpdateAsync(RoomViewLayout data)
+ {
+ return await Client.UpdateAsync(data);
+ }
+
+ public DataResult Update(RoomViewLayout data)
+ {
+ return Client.Update(data);
+ }
+
+ /// <summary>
+ /// 追加若しくは更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <param name="add"></param>
+ /// <returns></returns>
+ private async Task<DataResult?> AddOrUpdateStream(RoomViewLayout data, bool add)
+ {
+ DataResult? result = null;
+ using (var call = add ? Client.AddStream() : Client.UpdateStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult?>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ /// <summary>
+ /// 追加
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> AddStream(RoomViewLayout data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ /// <summary>
+ /// 更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> UpdateStream(RoomViewLayout data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ public DataResult Remove(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return Client.Remove(data);
+ }
+
+ public async Task<DataResult> RemoveAsync(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return await Client.RemoveAsync(data);
+ }
+
+ /// <summary>
+ /// 削除
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public async Task<DataResult> RemoveStream(string where)
+ {
+ DataResult result = null;
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+
+ using (var call = Client.RemoveStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ public DataResult SetData(RoomViewLayoutTable table)
+ {
+ return Client.SetData(table);
+ }
+
+ /// <summary>
+ /// バッチ更新
+ /// </summary>
+ /// <param name="table"></param>
+ /// <returns></returns>
+ public async Task<DataResult> SetDataStream(RoomViewLayoutTable table)
+ {
+ DataResult result = null;
+ using (var call = Client.SetDataStream())
+ {
+ await call.RequestStream.WriteAsync(table);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+ }
+}
diff --git a/HotelPms.DataAccessGrpc.Client/RoomViewTabAccess.cs b/HotelPms.DataAccessGrpc.Client/RoomViewTabAccess.cs
new file mode 100644
index 0000000..0c9d7aa
--- /dev/null
+++ b/HotelPms.DataAccessGrpc.Client/RoomViewTabAccess.cs
@@ -0,0 +1,273 @@
+using Google.Protobuf;
+using Grpc.Core;
+using Grpc.Net.Client;
+using HotelPms.Data.Client;
+using HotelPms.Data.Common;
+using HotelPms.Data.Master;
+using HotelPms.Share.Util;
+using System;
+using System.Data;
+using System.Threading.Tasks;
+using HotelPms.Data;
+using System.Collections.Generic;
+using HotelPms.Data.Common.Pagination;
+using System.Text.Json;
+using System.Threading;
+
+namespace HotelPms.DataAccessGrpc.Client
+{
+ public class RoomViewTabAccess : IDisposable
+ {
+ /// <summary>
+ /// チャネル
+ /// </summary>
+ public GrpcChannel Channel { get; private set; } = null;
+ public RoomViewTabCore.RoomViewTabCoreClient Client { get; private set; } = null;
+
+
+ public RoomViewTabAccess(GrpcChannel channel)
+ {
+ Channel = channel;
+ Client = new RoomViewTabCore.RoomViewTabCoreClient(Channel);
+ }
+
+ public void Dispose()
+ {
+
+ }
+
+ public bool Exists(int pID)
+ {
+ return GrpcClient.ExecuteScalarSync(Channel, $"IF EXISTS(SELECT 1 FROM M_RoomViewTab WHERE ID = {pID}) SELECT 1 ELSE SELECT 0") == "1";
+
+ }
+
+ public async Task<bool> ExistsAsync(int pID)
+ {
+ return await GrpcClient.ExecuteScalar(Channel, $"IF EXISTS(SELECT 1 FROM M_RoomViewTab WHERE ID = {pID}) SELECT 1 ELSE SELECT 0") == "1";
+
+ }
+
+ public async Task<FileGrpcData> OutputStream(PagingRequest request)
+ {
+ FileGrpcData data = null;
+ request.Table = "M_RoomViewTab";
+ string json = JsonSerializer.Serialize(request);
+ using (var call = Client.OutputStream(GrpcClient.CreateDataRequest(2, json)))
+ {
+ var reaponseStream = call.ResponseStream;
+ //データの取得
+ while (await reaponseStream.MoveNext(CancellationToken.None))
+ {
+ data = reaponseStream.Current;
+ }
+ }
+ return data;
+ }
+
+ public async Task<RoomViewTabTable> GetPageData(PagingRequest request)
+ {
+ request.Table = "M_RoomViewTab";
+ string json = JsonSerializer.Serialize(request);
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(1, json));
+ }
+
+
+ public DataTable GetMasterGridData(string where)
+ {
+ GrpcTable table = GrpcClient.GetTable(Channel, (int)ETableActionType.RoomViewTabMasterGrid, where);
+ return table.ToDataTable();
+ }
+
+ /// <summary>
+ /// 同期データ取得
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public RoomViewTabTable GetData(string where)
+ {
+ return Client.GetData(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ public async Task<RoomViewTabTable> GetDataAsync(string where)
+ {
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public RoomViewTab GetItem(int pID)
+ {
+ RoomViewTabTable table = GetData($"ID = {pID}");
+ if(table == null || table.ErrNo != 0 || table.Rows.Count == 0) { return null; }
+ return table.Rows[0];
+ }
+
+ public async Task<RoomViewTabTable> GetDataStream()
+ {
+ return await GetDataStream(string.Empty);
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public async Task<RoomViewTabTable> GetDataStream(string where)
+ {
+ RoomViewTabTable table = null;
+ using (var call = Client.GetDataStream())
+ {
+ await call.RequestStream.WriteAsync(GrpcClient.CreateDataRequest(0, where));
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<RoomViewTabTable>())
+ {
+ table = message;
+ break;
+ }
+ }
+ return table;
+ }
+
+ public async Task<DataResult> AddAsync(RoomViewTab data)
+ {
+ return await Client.AddAsync(data);
+ }
+
+ public DataResult Add(RoomViewTab data)
+ {
+ return Client.Add(data);
+ }
+
+ public async Task<DataResult> UpdateAsync(RoomViewTab data)
+ {
+ return await Client.UpdateAsync(data);
+ }
+
+ public DataResult Update(RoomViewTab data)
+ {
+ return Client.Update(data);
+ }
+
+ /// <summary>
+ /// 追加若しくは更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <param name="add"></param>
+ /// <returns></returns>
+ private async Task<DataResult> AddOrUpdateStream(RoomViewTab data, bool add)
+ {
+ DataResult result = null;
+ using (var call = add ? Client.AddStream() : Client.UpdateStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ /// <summary>
+ /// 追加
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> AddStream(RoomViewTab data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ /// <summary>
+ /// 更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> UpdateStream(RoomViewTab data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ public DataResult Remove(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return Client.Remove(data);
+ }
+
+ public async Task<DataResult> RemoveAsync(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return await Client.RemoveAsync(data);
+ }
+
+ /// <summary>
+ /// 削除
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public async Task<DataResult> RemoveStream(string where)
+ {
+ DataResult result = null;
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+
+ using (var call = Client.RemoveStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ public DataResult SetData(RoomViewTabTable table)
+ {
+ return Client.SetData(table);
+ }
+
+ /// <summary>
+ /// バッチ更新
+ /// </summary>
+ /// <param name="table"></param>
+ /// <returns></returns>
+ public async Task<DataResult> SetDataStream(RoomViewTabTable table)
+ {
+ DataResult result = null;
+ using (var call = Client.SetDataStream())
+ {
+ await call.RequestStream.WriteAsync(table);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+ }
+}
diff --git a/HotelPms.DataAccessGrpc.Client/SaleAccess.cs b/HotelPms.DataAccessGrpc.Client/SaleAccess.cs
new file mode 100644
index 0000000..39aefc0
--- /dev/null
+++ b/HotelPms.DataAccessGrpc.Client/SaleAccess.cs
@@ -0,0 +1,268 @@
+using customTypes;
+using Google.Protobuf;
+using Grpc.Core;
+using Grpc.Net.Client;
+using HotelPms.Data;
+using HotelPms.Data.Client;
+using HotelPms.Data.Common;
+using HotelPms.Data.Common.Pagination;
+using HotelPms.Data.UseInfo;
+using System.Data;
+using System.Text.Json;
+
+namespace HotelPms.DataAccessGrpc.Client;
+
+public class SaleAccess : IDisposable
+{
+ /// <summary>
+ /// チャネル
+ /// </summary>
+ public GrpcChannel Channel { get; private set; } = null;
+ public SaleCore.SaleCoreClient Client { get; private set; } = null;
+
+
+ public SaleAccess(GrpcChannel channel)
+ {
+ Channel = channel;
+ Client = new SaleCore.SaleCoreClient(Channel);
+ }
+
+ public void Dispose()
+ {
+
+ }
+
+ public bool Exists(int pID,int pDetailID,Date pUseDate,int pSaleID)
+ {
+ return GrpcClient.ExecuteScalarSync(Channel, $"IF EXISTS(SELECT 1 FROM D_Sale WHERE ID = {pID} AND DetailID = {pDetailID} AND UseDate = {(pUseDate == null ? "NULL" : pUseDate.ToSqlValue())} AND SaleID = {pSaleID}) SELECT 1 ELSE SELECT 0") == "1";
+
+ }
+
+ public async Task<bool> ExistsAsync(int pID,int pDetailID,Date pUseDate,int pSaleID)
+ {
+ return await GrpcClient.ExecuteScalar(Channel, $"IF EXISTS(SELECT 1 FROM D_Sale WHERE ID = {pID} AND DetailID = {pDetailID} AND UseDate = {(pUseDate == null ? "NULL" : pUseDate.ToSqlValue())} AND SaleID = {pSaleID}) SELECT 1 ELSE SELECT 0") == "1";
+
+ }
+
+ public async Task<FileGrpcData> OutputStream(PagingRequest request)
+ {
+ FileGrpcData data = null;
+ request.Table = "D_Sale";
+ string json = JsonSerializer.Serialize(request);
+ using (var call = Client.OutputStream(GrpcClient.CreateDataRequest(2, json)))
+ {
+ var reaponseStream = call.ResponseStream;
+ //データの取得
+ while (await reaponseStream.MoveNext(CancellationToken.None))
+ {
+ data = reaponseStream.Current;
+ }
+ }
+ return data;
+ }
+
+ public async Task<SaleTable> GetPageData(PagingRequest request)
+ {
+ request.Table = "D_Sale";
+ string json = JsonSerializer.Serialize(request);
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(1, json));
+ }
+
+
+ public DataTable GetMasterGridData(string where)
+ {
+ GrpcTable table = GrpcClient.GetTable(Channel, (int)ETableActionType.BuildingMasterGrid, where);
+ return table.ToDataTable();
+ }
+
+ /// <summary>
+ /// 同期データ取得
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public SaleTable GetData(string where)
+ {
+ return Client.GetData(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ public async Task<SaleTable> GetDataAsync(string where)
+ {
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public Sale GetItem(int pID,int pDetailID,Date pUseDate,int pSaleID)
+ {
+ SaleTable table = GetData($"ID = {pID} AND DetailID = {pDetailID} AND UseDate = {(pUseDate == null ? "NULL" : pUseDate.ToSqlValue())} AND SaleID = {pSaleID}");
+ if(table == null || table.ErrNo != 0 || table.Rows.Count == 0) { return null; }
+ return table.Rows[0];
+ }
+
+ public async Task<SaleTable> GetDataStream()
+ {
+ return await GetDataStream(string.Empty);
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public async Task<SaleTable> GetDataStream(string where)
+ {
+ SaleTable table = null;
+ using (var call = Client.GetDataStream())
+ {
+ await call.RequestStream.WriteAsync(GrpcClient.CreateDataRequest(0, where));
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<SaleTable>())
+ {
+ table = message;
+ break;
+ }
+ }
+ return table;
+ }
+
+ public async Task<DataResult> AddAsync(Sale data)
+ {
+ return await Client.AddAsync(data);
+ }
+
+ public DataResult Add(Sale data)
+ {
+ return Client.Add(data);
+ }
+
+ public async Task<DataResult> UpdateAsync(Sale data)
+ {
+ return await Client.UpdateAsync(data);
+ }
+
+ public DataResult Update(Sale data)
+ {
+ return Client.Update(data);
+ }
+
+ /// <summary>
+ /// 追加若しくは更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <param name="add"></param>
+ /// <returns></returns>
+ private async Task<DataResult> AddOrUpdateStream(Sale data, bool add)
+ {
+ DataResult result = null;
+ using (var call = add ? Client.AddStream() : Client.UpdateStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ /// <summary>
+ /// 追加
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> AddStream(Sale data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ /// <summary>
+ /// 更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> UpdateStream(Sale data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ public DataResult Remove(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return Client.Remove(data);
+ }
+
+ public async Task<DataResult> RemoveAsync(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return await Client.RemoveAsync(data);
+ }
+
+ /// <summary>
+ /// 削除
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public async Task<DataResult> RemoveStream(string where)
+ {
+ DataResult result = null;
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+
+ using (var call = Client.RemoveStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ public DataResult SetData(SaleTable table)
+ {
+ return Client.SetData(table);
+ }
+
+ /// <summary>
+ /// バッチ更新
+ /// </summary>
+ /// <param name="table"></param>
+ /// <returns></returns>
+ public async Task<DataResult> SetDataStream(SaleTable table)
+ {
+ DataResult result = null;
+ using (var call = Client.SetDataStream())
+ {
+ await call.RequestStream.WriteAsync(table);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+}
diff --git a/HotelPms.DataAccessGrpc.Client/SaleDivAccess.cs b/HotelPms.DataAccessGrpc.Client/SaleDivAccess.cs
new file mode 100644
index 0000000..f2cc005
--- /dev/null
+++ b/HotelPms.DataAccessGrpc.Client/SaleDivAccess.cs
@@ -0,0 +1,267 @@
+using Google.Protobuf;
+using Grpc.Core;
+using Grpc.Net.Client;
+using HotelPms.Data.Common;
+using HotelPms.Data.UseInfo;
+using HotelPms.Share.Util;
+using System;
+using System.Data;
+using System.Threading.Tasks;
+using HotelPms.Data;
+using System.Collections.Generic;
+using HotelPms.Data.Common.Pagination;
+using System.Text.Json;
+using System.Threading;
+using HotelPms.Data.Client;
+
+namespace HotelPms.DataAccessGrpc.Client
+{
+ internal class SaleDivAccess : IDisposable
+ {
+ /// <summary>
+ /// チャネル
+ /// </summary>
+ public GrpcChannel Channel { get; private set; } = null;
+ public SaleDivCore.SaleDivCoreClient Client { get; private set; } = null;
+
+
+ public SaleDivAccess(GrpcChannel channel)
+ {
+ Channel = channel;
+ Client = new SaleDivCore.SaleDivCoreClient(Channel);
+ }
+
+ public void Dispose()
+ {
+
+ }
+
+ public async Task<bool> Exists(int pID,int pDetailID,DateTime pUseDate,int pSaleID,int pRowNo)
+ {
+ return await GrpcClient.ExecuteScalar(Channel, $"IF EXISTS(SELECT 1 FROM D_SaleDiv WHERE ID = {pID} AND DetailID = {pDetailID} AND UseDate = {CConvert.ToSqlValue(pUseDate)} AND SaleID = {pSaleID} AND RowNo = {pRowNo}) SELECT 1 ELSE SELECT 0") == "1";
+
+ }
+
+ public async Task<FileGrpcData> OutputStream(PagingRequest request)
+ {
+ FileGrpcData data = null;
+ request.Table = "D_SaleDiv";
+ string json = JsonSerializer.Serialize(request);
+ using (var call = Client.OutputStream(GrpcClient.CreateDataRequest(2, json)))
+ {
+ var reaponseStream = call.ResponseStream;
+ //データの取得
+ while (await reaponseStream.MoveNext(CancellationToken.None))
+ {
+ data = reaponseStream.Current;
+ }
+ }
+ return data;
+ }
+
+ public async Task<SaleDivTable> GetPageData(PagingRequest request)
+ {
+ request.Table = "D_SaleDiv";
+ string json = JsonSerializer.Serialize(request);
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(1, json));
+ }
+
+
+ public DataTable GetMasterGridData(string where)
+ {
+ GrpcTable table = GrpcClient.GetTable(Channel, (int)ETableActionType.BuildingMasterGrid, where);
+ return table.ToDataTable();
+ }
+
+ /// <summary>
+ /// 同期データ取得
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public SaleDivTable GetData(string where)
+ {
+ return Client.GetData(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ public async Task<SaleDivTable> GetDataAsync(string where)
+ {
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public SaleDiv GetItem(int pID,int pDetailID,DateTime pUseDate,int pSaleID,int pRowNo)
+ {
+ SaleDivTable table = GetData($"ID = {pID} AND DetailID = {pDetailID} AND UseDate = {CConvert.ToSqlValue(pUseDate)} AND SaleID = {pSaleID} AND RowNo = {pRowNo}");
+ if(table == null || table.ErrNo != 0 || table.Rows.Count == 0) { return null; }
+ return table.Rows[0];
+ }
+
+ public async Task<SaleDivTable> GetDataStream()
+ {
+ return await GetDataStream(string.Empty);
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public async Task<SaleDivTable> GetDataStream(string where)
+ {
+ SaleDivTable table = null;
+ using (var call = Client.GetDataStream())
+ {
+ await call.RequestStream.WriteAsync(GrpcClient.CreateDataRequest(0, where));
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<SaleDivTable>())
+ {
+ table = message;
+ break;
+ }
+ }
+ return table;
+ }
+
+ public async Task<DataResult> AddAsync(SaleDiv data)
+ {
+ return await Client.AddAsync(data);
+ }
+
+ public DataResult Add(SaleDiv data)
+ {
+ return Client.Add(data);
+ }
+
+ public async Task<DataResult> UpdateAsync(SaleDiv data)
+ {
+ return await Client.UpdateAsync(data);
+ }
+
+ public DataResult Update(SaleDiv data)
+ {
+ return Client.Update(data);
+ }
+
+ /// <summary>
+ /// 追加若しくは更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <param name="add"></param>
+ /// <returns></returns>
+ private async Task<DataResult> AddOrUpdateStream(SaleDiv data, bool add)
+ {
+ DataResult result = null;
+ using (var call = add ? Client.AddStream() : Client.UpdateStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ /// <summary>
+ /// 追加
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> AddStream(SaleDiv data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ /// <summary>
+ /// 更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> UpdateStream(SaleDiv data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ public DataResult Remove(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return Client.Remove(data);
+ }
+
+ public async Task<DataResult> RemoveAsync(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return await Client.RemoveAsync(data);
+ }
+
+ /// <summary>
+ /// 削除
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public async Task<DataResult> RemoveStream(string where)
+ {
+ DataResult result = null;
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+
+ using (var call = Client.RemoveStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ public DataResult SetData(SaleDivTable table)
+ {
+ return Client.SetData(table);
+ }
+
+ /// <summary>
+ /// バッチ更新
+ /// </summary>
+ /// <param name="table"></param>
+ /// <returns></returns>
+ public async Task<DataResult> SetDataStream(SaleDivTable table)
+ {
+ DataResult result = null;
+ using (var call = Client.SetDataStream())
+ {
+ await call.RequestStream.WriteAsync(table);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+ }
+}
diff --git a/HotelPms.DataAccessGrpc.Client/UseAccess.cs b/HotelPms.DataAccessGrpc.Client/UseAccess.cs
new file mode 100644
index 0000000..97a3b8b
--- /dev/null
+++ b/HotelPms.DataAccessGrpc.Client/UseAccess.cs
@@ -0,0 +1,114 @@
+using Google.Protobuf;
+using Grpc.Core;
+using Grpc.Net.Client;
+using HotelPms.Data.Common;
+using HotelPms.Data.UseInfo;
+using HotelPms.Share.Util;
+using System;
+using System.Data;
+using System.Threading.Tasks;
+using HotelPms.Data;
+using System.Collections.Generic;
+using HotelPms.Data.Common.Pagination;
+using System.Text.Json;
+using System.Threading;
+using HotelPms.Data.Client;
+
+namespace HotelPms.DataAccessGrpc.Client
+{
+ public class UseAccess : IDisposable
+ {
+ /// <summary>
+ /// チャネル
+ /// </summary>
+ public GrpcChannel Channel { get; private set; }
+ public UseCore.UseCoreClient Client { get; private set; }
+
+
+ public UseAccess(GrpcChannel channel)
+ {
+ Channel = channel;
+ Client = new UseCore.UseCoreClient(Channel);
+ }
+
+ public void Dispose()
+ {
+
+ }
+
+ /// <summary>
+ /// 同期データ取得
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public Use GetData(string where)
+ {
+ return Client.GetData(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ public async Task<Use> GetDataAsync(string where)
+ {
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ public async Task<Use> GetDataStream()
+ {
+ return await GetDataStream(string.Empty);
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public async Task<Use> GetDataStream(string where)
+ {
+ Use table = null;
+ using (var call = Client.GetDataStream())
+ {
+ await call.RequestStream.WriteAsync(GrpcClient.CreateDataRequest(0, where));
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<Use>())
+ {
+ table = message;
+ break;
+ }
+ }
+ return table;
+ }
+
+ public DataResult SetData(Use table)
+ {
+ return Client.SetData(table);
+ }
+
+ public async Task<DataResult> SetDataAsync(Use table)
+ {
+ return await Client.SetDataAsync(table);
+ }
+
+ /// <summary>
+ /// バッチ更新
+ /// </summary>
+ /// <param name="table"></param>
+ /// <returns></returns>
+ public async Task<DataResult> SetDataStream(Use table)
+ {
+ DataResult result = null;
+ using (var call = Client.SetDataStream())
+ {
+ await call.RequestStream.WriteAsync(table);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+ }
+}
diff --git a/HotelPms.DataAccessGrpc.Client/UseAlloAccess.cs b/HotelPms.DataAccessGrpc.Client/UseAlloAccess.cs
new file mode 100644
index 0000000..de537d2
--- /dev/null
+++ b/HotelPms.DataAccessGrpc.Client/UseAlloAccess.cs
@@ -0,0 +1,267 @@
+using Google.Protobuf;
+using Grpc.Core;
+using Grpc.Net.Client;
+using HotelPms.Data.Common;
+using HotelPms.Data.UseInfo;
+using HotelPms.Share.Util;
+using System;
+using System.Data;
+using System.Threading.Tasks;
+using HotelPms.Data;
+using System.Collections.Generic;
+using HotelPms.Data.Common.Pagination;
+using System.Text.Json;
+using System.Threading;
+using HotelPms.Data.Client;
+
+namespace HotelPms.DataAccessGrpc.Client
+{
+ internal class UseAlloAccess : IDisposable
+ {
+ /// <summary>
+ /// チャネル
+ /// </summary>
+ public GrpcChannel Channel { get; private set; } = null;
+ public UseAlloCore.UseAlloCoreClient Client { get; private set; } = null;
+
+
+ public UseAlloAccess(GrpcChannel channel)
+ {
+ Channel = channel;
+ Client = new UseAlloCore.UseAlloCoreClient(Channel);
+ }
+
+ public void Dispose()
+ {
+
+ }
+
+ public async Task<bool> Exists(int pID,int pDetailID,DateTime pUseDate,int pPersonID)
+ {
+ return await GrpcClient.ExecuteScalar(Channel, $"IF EXISTS(SELECT 1 FROM D_UseAllo WHERE ID = {pID} AND DetailID = {pDetailID} AND UseDate = {CConvert.ToSqlValue(pUseDate)} AND PersonID = {pPersonID}) SELECT 1 ELSE SELECT 0") == "1";
+
+ }
+
+ public async Task<FileGrpcData> OutputStream(PagingRequest request)
+ {
+ FileGrpcData data = null;
+ request.Table = "D_UseAllo";
+ string json = JsonSerializer.Serialize(request);
+ using (var call = Client.OutputStream(GrpcClient.CreateDataRequest(2, json)))
+ {
+ var reaponseStream = call.ResponseStream;
+ //データの取得
+ while (await reaponseStream.MoveNext(CancellationToken.None))
+ {
+ data = reaponseStream.Current;
+ }
+ }
+ return data;
+ }
+
+ public async Task<UseAlloTable> GetPageData(PagingRequest request)
+ {
+ request.Table = "D_UseAllo";
+ string json = JsonSerializer.Serialize(request);
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(1, json));
+ }
+
+
+ public DataTable GetMasterGridData(string where)
+ {
+ GrpcTable table = GrpcClient.GetTable(Channel, (int)ETableActionType.BuildingMasterGrid, where);
+ return table.ToDataTable();
+ }
+
+ /// <summary>
+ /// 同期データ取得
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public UseAlloTable GetData(string where)
+ {
+ return Client.GetData(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ public async Task<UseAlloTable> GetDataAsync(string where)
+ {
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public UseAllo GetItem(int pID,int pDetailID,DateTime pUseDate,int pPersonID)
+ {
+ UseAlloTable table = GetData($"ID = {pID} AND DetailID = {pDetailID} AND UseDate = {CConvert.ToSqlValue(pUseDate)} AND PersonID = {pPersonID}");
+ if(table == null || table.ErrNo != 0 || table.Rows.Count == 0) { return null; }
+ return table.Rows[0];
+ }
+
+ public async Task<UseAlloTable> GetDataStream()
+ {
+ return await GetDataStream(string.Empty);
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public async Task<UseAlloTable> GetDataStream(string where)
+ {
+ UseAlloTable table = null;
+ using (var call = Client.GetDataStream())
+ {
+ await call.RequestStream.WriteAsync(GrpcClient.CreateDataRequest(0, where));
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<UseAlloTable>())
+ {
+ table = message;
+ break;
+ }
+ }
+ return table;
+ }
+
+ public async Task<DataResult> AddAsync(UseAllo data)
+ {
+ return await Client.AddAsync(data);
+ }
+
+ public DataResult Add(UseAllo data)
+ {
+ return Client.Add(data);
+ }
+
+ public async Task<DataResult> UpdateAsync(UseAllo data)
+ {
+ return await Client.UpdateAsync(data);
+ }
+
+ public DataResult Update(UseAllo data)
+ {
+ return Client.Update(data);
+ }
+
+ /// <summary>
+ /// 追加若しくは更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <param name="add"></param>
+ /// <returns></returns>
+ private async Task<DataResult> AddOrUpdateStream(UseAllo data, bool add)
+ {
+ DataResult result = null;
+ using (var call = add ? Client.AddStream() : Client.UpdateStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ /// <summary>
+ /// 追加
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> AddStream(UseAllo data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ /// <summary>
+ /// 更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> UpdateStream(UseAllo data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ public DataResult Remove(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return Client.Remove(data);
+ }
+
+ public async Task<DataResult> RemoveAsync(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return await Client.RemoveAsync(data);
+ }
+
+ /// <summary>
+ /// 削除
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public async Task<DataResult> RemoveStream(string where)
+ {
+ DataResult result = null;
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+
+ using (var call = Client.RemoveStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ public DataResult SetData(UseAlloTable table)
+ {
+ return Client.SetData(table);
+ }
+
+ /// <summary>
+ /// バッチ更新
+ /// </summary>
+ /// <param name="table"></param>
+ /// <returns></returns>
+ public async Task<DataResult> SetDataStream(UseAlloTable table)
+ {
+ DataResult result = null;
+ using (var call = Client.SetDataStream())
+ {
+ await call.RequestStream.WriteAsync(table);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+ }
+}
diff --git a/HotelPms.DataAccessGrpc.Client/UseDetailAccess.cs b/HotelPms.DataAccessGrpc.Client/UseDetailAccess.cs
new file mode 100644
index 0000000..98e5fef
--- /dev/null
+++ b/HotelPms.DataAccessGrpc.Client/UseDetailAccess.cs
@@ -0,0 +1,267 @@
+using Google.Protobuf;
+using Grpc.Core;
+using Grpc.Net.Client;
+using HotelPms.Data.Common;
+using HotelPms.Data.UseInfo;
+using HotelPms.Share.Util;
+using System;
+using System.Data;
+using System.Threading.Tasks;
+using HotelPms.Data;
+using System.Collections.Generic;
+using HotelPms.Data.Common.Pagination;
+using System.Text.Json;
+using System.Threading;
+using HotelPms.Data.Client;
+
+namespace HotelPms.DataAccessGrpc.Client
+{
+ internal class UseDetailAccess : IDisposable
+ {
+ /// <summary>
+ /// チャネル
+ /// </summary>
+ public GrpcChannel Channel { get; private set; } = null;
+ public UseDetailCore.UseDetailCoreClient Client { get; private set; } = null;
+
+
+ public UseDetailAccess(GrpcChannel channel)
+ {
+ Channel = channel;
+ Client = new UseDetailCore.UseDetailCoreClient(Channel);
+ }
+
+ public void Dispose()
+ {
+
+ }
+
+ public async Task<bool> Exists(int pID,int pDetailID)
+ {
+ return await GrpcClient.ExecuteScalar(Channel, $"IF EXISTS(SELECT 1 FROM D_UseDetail WHERE ID = {pID} AND DetailID = {pDetailID}) SELECT 1 ELSE SELECT 0") == "1";
+
+ }
+
+ public async Task<FileGrpcData> OutputStream(PagingRequest request)
+ {
+ FileGrpcData data = null;
+ request.Table = "D_UseDetail";
+ string json = JsonSerializer.Serialize(request);
+ using (var call = Client.OutputStream(GrpcClient.CreateDataRequest(2, json)))
+ {
+ var reaponseStream = call.ResponseStream;
+ //データの取得
+ while (await reaponseStream.MoveNext(CancellationToken.None))
+ {
+ data = reaponseStream.Current;
+ }
+ }
+ return data;
+ }
+
+ public async Task<UseDetailTable> GetPageData(PagingRequest request)
+ {
+ request.Table = "D_UseDetail";
+ string json = JsonSerializer.Serialize(request);
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(1, json));
+ }
+
+
+ public DataTable GetMasterGridData(string where)
+ {
+ GrpcTable table = GrpcClient.GetTable(Channel, (int)ETableActionType.BuildingMasterGrid, where);
+ return table.ToDataTable();
+ }
+
+ /// <summary>
+ /// 同期データ取得
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public UseDetailTable GetData(string where)
+ {
+ return Client.GetData(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ public async Task<UseDetailTable> GetDataAsync(string where)
+ {
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public UseDetail GetItem(int pID,int pDetailID)
+ {
+ UseDetailTable table = GetData($"ID = {pID} AND DetailID = {pDetailID}");
+ if(table == null || table.ErrNo != 0 || table.Rows.Count == 0) { return null; }
+ return table.Rows[0];
+ }
+
+ public async Task<UseDetailTable> GetDataStream()
+ {
+ return await GetDataStream(string.Empty);
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public async Task<UseDetailTable> GetDataStream(string where)
+ {
+ UseDetailTable table = null;
+ using (var call = Client.GetDataStream())
+ {
+ await call.RequestStream.WriteAsync(GrpcClient.CreateDataRequest(0, where));
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<UseDetailTable>())
+ {
+ table = message;
+ break;
+ }
+ }
+ return table;
+ }
+
+ public async Task<DataResult> AddAsync(UseDetail data)
+ {
+ return await Client.AddAsync(data);
+ }
+
+ public DataResult Add(UseDetail data)
+ {
+ return Client.Add(data);
+ }
+
+ public async Task<DataResult> UpdateAsync(UseDetail data)
+ {
+ return await Client.UpdateAsync(data);
+ }
+
+ public DataResult Update(UseDetail data)
+ {
+ return Client.Update(data);
+ }
+
+ /// <summary>
+ /// 追加若しくは更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <param name="add"></param>
+ /// <returns></returns>
+ private async Task<DataResult> AddOrUpdateStream(UseDetail data, bool add)
+ {
+ DataResult result = null;
+ using (var call = add ? Client.AddStream() : Client.UpdateStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ /// <summary>
+ /// 追加
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> AddStream(UseDetail data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ /// <summary>
+ /// 更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> UpdateStream(UseDetail data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ public DataResult Remove(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return Client.Remove(data);
+ }
+
+ public async Task<DataResult> RemoveAsync(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return await Client.RemoveAsync(data);
+ }
+
+ /// <summary>
+ /// 削除
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public async Task<DataResult> RemoveStream(string where)
+ {
+ DataResult result = null;
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+
+ using (var call = Client.RemoveStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ public DataResult SetData(UseDetailTable table)
+ {
+ return Client.SetData(table);
+ }
+
+ /// <summary>
+ /// バッチ更新
+ /// </summary>
+ /// <param name="table"></param>
+ /// <returns></returns>
+ public async Task<DataResult> SetDataStream(UseDetailTable table)
+ {
+ DataResult result = null;
+ using (var call = Client.SetDataStream())
+ {
+ await call.RequestStream.WriteAsync(table);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+ }
+}
diff --git a/HotelPms.DataAccessGrpc.Client/UseFreeAccess.cs b/HotelPms.DataAccessGrpc.Client/UseFreeAccess.cs
new file mode 100644
index 0000000..9143015
--- /dev/null
+++ b/HotelPms.DataAccessGrpc.Client/UseFreeAccess.cs
@@ -0,0 +1,267 @@
+using Google.Protobuf;
+using Grpc.Core;
+using Grpc.Net.Client;
+using HotelPms.Data.Common;
+using HotelPms.Data.UseInfo;
+using HotelPms.Share.Util;
+using System;
+using System.Data;
+using System.Threading.Tasks;
+using HotelPms.Data;
+using System.Collections.Generic;
+using HotelPms.Data.Common.Pagination;
+using System.Text.Json;
+using System.Threading;
+using HotelPms.Data.Client;
+
+namespace HotelPms.DataAccessGrpc.Client
+{
+ internal class UseFreeAccess : IDisposable
+ {
+ /// <summary>
+ /// チャネル
+ /// </summary>
+ public GrpcChannel Channel { get; private set; } = null;
+ public UseFreeCore.UseFreeCoreClient Client { get; private set; } = null;
+
+
+ public UseFreeAccess(GrpcChannel channel)
+ {
+ Channel = channel;
+ Client = new UseFreeCore.UseFreeCoreClient(Channel);
+ }
+
+ public void Dispose()
+ {
+
+ }
+
+ public async Task<bool> Exists(int pID,int pDetailID,DateTime pUseDate,int pTypeID)
+ {
+ return await GrpcClient.ExecuteScalar(Channel, $"IF EXISTS(SELECT 1 FROM D_UseFree WHERE ID = {pID} AND DetailID = {pDetailID} AND UseDate = {CConvert.ToSqlValue(pUseDate)} AND TypeID = {pTypeID}) SELECT 1 ELSE SELECT 0") == "1";
+
+ }
+
+ public async Task<FileGrpcData> OutputStream(PagingRequest request)
+ {
+ FileGrpcData data = null;
+ request.Table = "D_UseFree";
+ string json = JsonSerializer.Serialize(request);
+ using (var call = Client.OutputStream(GrpcClient.CreateDataRequest(2, json)))
+ {
+ var reaponseStream = call.ResponseStream;
+ //データの取得
+ while (await reaponseStream.MoveNext(CancellationToken.None))
+ {
+ data = reaponseStream.Current;
+ }
+ }
+ return data;
+ }
+
+ public async Task<UseFreeTable> GetPageData(PagingRequest request)
+ {
+ request.Table = "D_UseFree";
+ string json = JsonSerializer.Serialize(request);
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(1, json));
+ }
+
+
+ public DataTable GetMasterGridData(string where)
+ {
+ GrpcTable table = GrpcClient.GetTable(Channel, (int)ETableActionType.BuildingMasterGrid, where);
+ return table.ToDataTable();
+ }
+
+ /// <summary>
+ /// 同期データ取得
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public UseFreeTable GetData(string where)
+ {
+ return Client.GetData(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ public async Task<UseFreeTable> GetDataAsync(string where)
+ {
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public UseFree GetItem(int pID,int pDetailID,DateTime pUseDate,int pTypeID)
+ {
+ UseFreeTable table = GetData($"ID = {pID} AND DetailID = {pDetailID} AND UseDate = {CConvert.ToSqlValue(pUseDate)} AND TypeID = {pTypeID}");
+ if(table == null || table.ErrNo != 0 || table.Rows.Count == 0) { return null; }
+ return table.Rows[0];
+ }
+
+ public async Task<UseFreeTable> GetDataStream()
+ {
+ return await GetDataStream(string.Empty);
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public async Task<UseFreeTable> GetDataStream(string where)
+ {
+ UseFreeTable table = null;
+ using (var call = Client.GetDataStream())
+ {
+ await call.RequestStream.WriteAsync(GrpcClient.CreateDataRequest(0, where));
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<UseFreeTable>())
+ {
+ table = message;
+ break;
+ }
+ }
+ return table;
+ }
+
+ public async Task<DataResult> AddAsync(UseFree data)
+ {
+ return await Client.AddAsync(data);
+ }
+
+ public DataResult Add(UseFree data)
+ {
+ return Client.Add(data);
+ }
+
+ public async Task<DataResult> UpdateAsync(UseFree data)
+ {
+ return await Client.UpdateAsync(data);
+ }
+
+ public DataResult Update(UseFree data)
+ {
+ return Client.Update(data);
+ }
+
+ /// <summary>
+ /// 追加若しくは更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <param name="add"></param>
+ /// <returns></returns>
+ private async Task<DataResult> AddOrUpdateStream(UseFree data, bool add)
+ {
+ DataResult result = null;
+ using (var call = add ? Client.AddStream() : Client.UpdateStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ /// <summary>
+ /// 追加
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> AddStream(UseFree data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ /// <summary>
+ /// 更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> UpdateStream(UseFree data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ public DataResult Remove(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return Client.Remove(data);
+ }
+
+ public async Task<DataResult> RemoveAsync(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return await Client.RemoveAsync(data);
+ }
+
+ /// <summary>
+ /// 削除
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public async Task<DataResult> RemoveStream(string where)
+ {
+ DataResult result = null;
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+
+ using (var call = Client.RemoveStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ public DataResult SetData(UseFreeTable table)
+ {
+ return Client.SetData(table);
+ }
+
+ /// <summary>
+ /// バッチ更新
+ /// </summary>
+ /// <param name="table"></param>
+ /// <returns></returns>
+ public async Task<DataResult> SetDataStream(UseFreeTable table)
+ {
+ DataResult result = null;
+ using (var call = Client.SetDataStream())
+ {
+ await call.RequestStream.WriteAsync(table);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+ }
+}
diff --git a/HotelPms.DataAccessGrpc.Client/UseMemoAccess.cs b/HotelPms.DataAccessGrpc.Client/UseMemoAccess.cs
new file mode 100644
index 0000000..327c927
--- /dev/null
+++ b/HotelPms.DataAccessGrpc.Client/UseMemoAccess.cs
@@ -0,0 +1,267 @@
+using Google.Protobuf;
+using Grpc.Core;
+using Grpc.Net.Client;
+using HotelPms.Data.Common;
+using HotelPms.Data.UseInfo;
+using HotelPms.Share.Util;
+using System;
+using System.Data;
+using System.Threading.Tasks;
+using HotelPms.Data;
+using System.Collections.Generic;
+using HotelPms.Data.Common.Pagination;
+using System.Text.Json;
+using System.Threading;
+using HotelPms.Data.Client;
+
+namespace HotelPms.DataAccessGrpc.Client
+{
+ internal class UseMemoAccess : IDisposable
+ {
+ /// <summary>
+ /// チャネル
+ /// </summary>
+ public GrpcChannel Channel { get; private set; } = null;
+ public UseMemoCore.UseMemoCoreClient Client { get; private set; } = null;
+
+
+ public UseMemoAccess(GrpcChannel channel)
+ {
+ Channel = channel;
+ Client = new UseMemoCore.UseMemoCoreClient(Channel);
+ }
+
+ public void Dispose()
+ {
+
+ }
+
+ public async Task<bool> Exists(int pID,int pDetailID,int pTypeID)
+ {
+ return await GrpcClient.ExecuteScalar(Channel, $"IF EXISTS(SELECT 1 FROM D_UseMemo WHERE ID = {pID} AND DetailID = {pDetailID} AND TypeID = {pTypeID}) SELECT 1 ELSE SELECT 0") == "1";
+
+ }
+
+ public async Task<FileGrpcData> OutputStream(PagingRequest request)
+ {
+ FileGrpcData data = null;
+ request.Table = "D_UseMemo";
+ string json = JsonSerializer.Serialize(request);
+ using (var call = Client.OutputStream(GrpcClient.CreateDataRequest(2, json)))
+ {
+ var reaponseStream = call.ResponseStream;
+ //データの取得
+ while (await reaponseStream.MoveNext(CancellationToken.None))
+ {
+ data = reaponseStream.Current;
+ }
+ }
+ return data;
+ }
+
+ public async Task<UseMemoTable> GetPageData(PagingRequest request)
+ {
+ request.Table = "D_UseMemo";
+ string json = JsonSerializer.Serialize(request);
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(1, json));
+ }
+
+
+ public DataTable GetMasterGridData(string where)
+ {
+ GrpcTable table = GrpcClient.GetTable(Channel, (int)ETableActionType.BuildingMasterGrid, where);
+ return table.ToDataTable();
+ }
+
+ /// <summary>
+ /// 同期データ取得
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public UseMemoTable GetData(string where)
+ {
+ return Client.GetData(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ public async Task<UseMemoTable> GetDataAsync(string where)
+ {
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public UseMemo GetItem(int pID,int pDetailID,int pTypeID)
+ {
+ UseMemoTable table = GetData($"ID = {pID} AND DetailID = {pDetailID} AND TypeID = {pTypeID}");
+ if(table == null || table.ErrNo != 0 || table.Rows.Count == 0) { return null; }
+ return table.Rows[0];
+ }
+
+ public async Task<UseMemoTable> GetDataStream()
+ {
+ return await GetDataStream(string.Empty);
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public async Task<UseMemoTable> GetDataStream(string where)
+ {
+ UseMemoTable table = null;
+ using (var call = Client.GetDataStream())
+ {
+ await call.RequestStream.WriteAsync(GrpcClient.CreateDataRequest(0, where));
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<UseMemoTable>())
+ {
+ table = message;
+ break;
+ }
+ }
+ return table;
+ }
+
+ public async Task<DataResult> AddAsync(UseMemo data)
+ {
+ return await Client.AddAsync(data);
+ }
+
+ public DataResult Add(UseMemo data)
+ {
+ return Client.Add(data);
+ }
+
+ public async Task<DataResult> UpdateAsync(UseMemo data)
+ {
+ return await Client.UpdateAsync(data);
+ }
+
+ public DataResult Update(UseMemo data)
+ {
+ return Client.Update(data);
+ }
+
+ /// <summary>
+ /// 追加若しくは更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <param name="add"></param>
+ /// <returns></returns>
+ private async Task<DataResult> AddOrUpdateStream(UseMemo data, bool add)
+ {
+ DataResult result = null;
+ using (var call = add ? Client.AddStream() : Client.UpdateStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ /// <summary>
+ /// 追加
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> AddStream(UseMemo data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ /// <summary>
+ /// 更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> UpdateStream(UseMemo data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ public DataResult Remove(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return Client.Remove(data);
+ }
+
+ public async Task<DataResult> RemoveAsync(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return await Client.RemoveAsync(data);
+ }
+
+ /// <summary>
+ /// 削除
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public async Task<DataResult> RemoveStream(string where)
+ {
+ DataResult result = null;
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+
+ using (var call = Client.RemoveStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ public DataResult SetData(UseMemoTable table)
+ {
+ return Client.SetData(table);
+ }
+
+ /// <summary>
+ /// バッチ更新
+ /// </summary>
+ /// <param name="table"></param>
+ /// <returns></returns>
+ public async Task<DataResult> SetDataStream(UseMemoTable table)
+ {
+ DataResult result = null;
+ using (var call = Client.SetDataStream())
+ {
+ await call.RequestStream.WriteAsync(table);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+ }
+}
diff --git a/HotelPms.DataAccessGrpc.Client/UsePersonAccess.cs b/HotelPms.DataAccessGrpc.Client/UsePersonAccess.cs
new file mode 100644
index 0000000..95715c1
--- /dev/null
+++ b/HotelPms.DataAccessGrpc.Client/UsePersonAccess.cs
@@ -0,0 +1,262 @@
+using Google.Protobuf;
+using Grpc.Core;
+using Grpc.Net.Client;
+using HotelPms.Data;
+using HotelPms.Data.Client;
+using HotelPms.Data.Common;
+using HotelPms.Data.Common.Pagination;
+using HotelPms.Data.UseInfo;
+using System.Data;
+using System.Text.Json;
+
+namespace HotelPms.DataAccessGrpc.Client
+{
+ internal class UsePersonAccess : IDisposable
+ {
+ /// <summary>
+ /// チャネル
+ /// </summary>
+ public GrpcChannel Channel { get; private set; } = null;
+ public UsePersonCore.UsePersonCoreClient Client { get; private set; } = null;
+
+
+ public UsePersonAccess(GrpcChannel channel)
+ {
+ Channel = channel;
+ Client = new UsePersonCore.UsePersonCoreClient(Channel);
+ }
+
+ public void Dispose()
+ {
+
+ }
+
+ public async Task<bool> Exists(int pID,int pPersonID)
+ {
+ return await GrpcClient.ExecuteScalar(Channel, $"IF EXISTS(SELECT 1 FROM D_UsePerson WHERE ID = {pID} AND PersonID = {pPersonID}) SELECT 1 ELSE SELECT 0") == "1";
+
+ }
+
+ public async Task<FileGrpcData> OutputStream(PagingRequest request)
+ {
+ FileGrpcData data = null;
+ request.Table = "D_UsePerson";
+ string json = JsonSerializer.Serialize(request);
+ using (var call = Client.OutputStream(GrpcClient.CreateDataRequest(2, json)))
+ {
+ var reaponseStream = call.ResponseStream;
+ //データの取得
+ while (await reaponseStream.MoveNext(CancellationToken.None))
+ {
+ data = reaponseStream.Current;
+ }
+ }
+ return data;
+ }
+
+ public async Task<UsePersonTable> GetPageData(PagingRequest request)
+ {
+ request.Table = "D_UsePerson";
+ string json = JsonSerializer.Serialize(request);
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(1, json));
+ }
+
+
+ public DataTable GetMasterGridData(string where)
+ {
+ GrpcTable table = GrpcClient.GetTable(Channel, (int)ETableActionType.BuildingMasterGrid, where);
+ return table.ToDataTable();
+ }
+
+ /// <summary>
+ /// 同期データ取得
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public UsePersonTable GetData(string where)
+ {
+ return Client.GetData(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ public async Task<UsePersonTable> GetDataAsync(string where)
+ {
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public UsePerson GetItem(int pID,int pPersonID)
+ {
+ UsePersonTable table = GetData($"ID = {pID} AND PersonID = {pPersonID}");
+ if(table == null || table.ErrNo != 0 || table.Rows.Count == 0) { return null; }
+ return table.Rows[0];
+ }
+
+ public async Task<UsePersonTable> GetDataStream()
+ {
+ return await GetDataStream(string.Empty);
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public async Task<UsePersonTable> GetDataStream(string where)
+ {
+ UsePersonTable table = null;
+ using (var call = Client.GetDataStream())
+ {
+ await call.RequestStream.WriteAsync(GrpcClient.CreateDataRequest(0, where));
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<UsePersonTable>())
+ {
+ table = message;
+ break;
+ }
+ }
+ return table;
+ }
+
+ public async Task<DataResult> AddAsync(UsePerson data)
+ {
+ return await Client.AddAsync(data);
+ }
+
+ public DataResult Add(UsePerson data)
+ {
+ return Client.Add(data);
+ }
+
+ public async Task<DataResult> UpdateAsync(UsePerson data)
+ {
+ return await Client.UpdateAsync(data);
+ }
+
+ public DataResult Update(UsePerson data)
+ {
+ return Client.Update(data);
+ }
+
+ /// <summary>
+ /// 追加若しくは更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <param name="add"></param>
+ /// <returns></returns>
+ private async Task<DataResult> AddOrUpdateStream(UsePerson data, bool add)
+ {
+ DataResult result = null;
+ using (var call = add ? Client.AddStream() : Client.UpdateStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ /// <summary>
+ /// 追加
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> AddStream(UsePerson data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ /// <summary>
+ /// 更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> UpdateStream(UsePerson data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ public DataResult Remove(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return Client.Remove(data);
+ }
+
+ public async Task<DataResult> RemoveAsync(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return await Client.RemoveAsync(data);
+ }
+
+ /// <summary>
+ /// 削除
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public async Task<DataResult> RemoveStream(string where)
+ {
+ DataResult result = null;
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+
+ using (var call = Client.RemoveStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ public DataResult SetData(UsePersonTable table)
+ {
+ return Client.SetData(table);
+ }
+
+ /// <summary>
+ /// バッチ更新
+ /// </summary>
+ /// <param name="table"></param>
+ /// <returns></returns>
+ public async Task<DataResult> SetDataStream(UsePersonTable table)
+ {
+ DataResult result = null;
+ using (var call = Client.SetDataStream())
+ {
+ await call.RequestStream.WriteAsync(table);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+ }
+}
diff --git a/HotelPms.DataAccessGrpc.Client/UsePersonFreeAccess.cs b/HotelPms.DataAccessGrpc.Client/UsePersonFreeAccess.cs
new file mode 100644
index 0000000..651743f
--- /dev/null
+++ b/HotelPms.DataAccessGrpc.Client/UsePersonFreeAccess.cs
@@ -0,0 +1,267 @@
+using Google.Protobuf;
+using Grpc.Core;
+using Grpc.Net.Client;
+using HotelPms.Data.Common;
+using HotelPms.Data.UseInfo;
+using HotelPms.Share.Util;
+using System;
+using System.Data;
+using System.Threading.Tasks;
+using HotelPms.Data;
+using System.Collections.Generic;
+using HotelPms.Data.Common.Pagination;
+using System.Text.Json;
+using System.Threading;
+using HotelPms.Data.Client;
+
+namespace HotelPms.DataAccessGrpc.Client
+{
+ internal class UsePersonFreeAccess : IDisposable
+ {
+ /// <summary>
+ /// チャネル
+ /// </summary>
+ public GrpcChannel Channel { get; private set; } = null;
+ public UsePersonFreeCore.UsePersonFreeCoreClient Client { get; private set; } = null;
+
+
+ public UsePersonFreeAccess(GrpcChannel channel)
+ {
+ Channel = channel;
+ Client = new UsePersonFreeCore.UsePersonFreeCoreClient(Channel);
+ }
+
+ public void Dispose()
+ {
+
+ }
+
+ public async Task<bool> Exists(int pID,int pPersonID,int pTypeID)
+ {
+ return await GrpcClient.ExecuteScalar(Channel, $"IF EXISTS(SELECT 1 FROM D_UsePersonFree WHERE ID = {pID} AND PersonID = {pPersonID} AND TypeID = {pTypeID}) SELECT 1 ELSE SELECT 0") == "1";
+
+ }
+
+ public async Task<FileGrpcData> OutputStream(PagingRequest request)
+ {
+ FileGrpcData data = null;
+ request.Table = "D_UsePersonFree";
+ string json = JsonSerializer.Serialize(request);
+ using (var call = Client.OutputStream(GrpcClient.CreateDataRequest(2, json)))
+ {
+ var reaponseStream = call.ResponseStream;
+ //データの取得
+ while (await reaponseStream.MoveNext(CancellationToken.None))
+ {
+ data = reaponseStream.Current;
+ }
+ }
+ return data;
+ }
+
+ public async Task<UsePersonFreeTable> GetPageData(PagingRequest request)
+ {
+ request.Table = "D_UsePersonFree";
+ string json = JsonSerializer.Serialize(request);
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(1, json));
+ }
+
+
+ public DataTable GetMasterGridData(string where)
+ {
+ GrpcTable table = GrpcClient.GetTable(Channel, (int)ETableActionType.BuildingMasterGrid, where);
+ return table.ToDataTable();
+ }
+
+ /// <summary>
+ /// 同期データ取得
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public UsePersonFreeTable GetData(string where)
+ {
+ return Client.GetData(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ public async Task<UsePersonFreeTable> GetDataAsync(string where)
+ {
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public UsePersonFree GetItem(int pID,int pPersonID,int pTypeID)
+ {
+ UsePersonFreeTable table = GetData($"ID = {pID} AND PersonID = {pPersonID} AND TypeID = {pTypeID}");
+ if(table == null || table.ErrNo != 0 || table.Rows.Count == 0) { return null; }
+ return table.Rows[0];
+ }
+
+ public async Task<UsePersonFreeTable> GetDataStream()
+ {
+ return await GetDataStream(string.Empty);
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public async Task<UsePersonFreeTable> GetDataStream(string where)
+ {
+ UsePersonFreeTable table = null;
+ using (var call = Client.GetDataStream())
+ {
+ await call.RequestStream.WriteAsync(GrpcClient.CreateDataRequest(0, where));
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<UsePersonFreeTable>())
+ {
+ table = message;
+ break;
+ }
+ }
+ return table;
+ }
+
+ public async Task<DataResult> AddAsync(UsePersonFree data)
+ {
+ return await Client.AddAsync(data);
+ }
+
+ public DataResult Add(UsePersonFree data)
+ {
+ return Client.Add(data);
+ }
+
+ public async Task<DataResult> UpdateAsync(UsePersonFree data)
+ {
+ return await Client.UpdateAsync(data);
+ }
+
+ public DataResult Update(UsePersonFree data)
+ {
+ return Client.Update(data);
+ }
+
+ /// <summary>
+ /// 追加若しくは更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <param name="add"></param>
+ /// <returns></returns>
+ private async Task<DataResult> AddOrUpdateStream(UsePersonFree data, bool add)
+ {
+ DataResult result = null;
+ using (var call = add ? Client.AddStream() : Client.UpdateStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ /// <summary>
+ /// 追加
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> AddStream(UsePersonFree data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ /// <summary>
+ /// 更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> UpdateStream(UsePersonFree data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ public DataResult Remove(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return Client.Remove(data);
+ }
+
+ public async Task<DataResult> RemoveAsync(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return await Client.RemoveAsync(data);
+ }
+
+ /// <summary>
+ /// 削除
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public async Task<DataResult> RemoveStream(string where)
+ {
+ DataResult result = null;
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+
+ using (var call = Client.RemoveStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ public DataResult SetData(UsePersonFreeTable table)
+ {
+ return Client.SetData(table);
+ }
+
+ /// <summary>
+ /// バッチ更新
+ /// </summary>
+ /// <param name="table"></param>
+ /// <returns></returns>
+ public async Task<DataResult> SetDataStream(UsePersonFreeTable table)
+ {
+ DataResult result = null;
+ using (var call = Client.SetDataStream())
+ {
+ await call.RequestStream.WriteAsync(table);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+ }
+}
diff --git a/HotelPms.DataAccessGrpc.Client/UsePersonTelAccess.cs b/HotelPms.DataAccessGrpc.Client/UsePersonTelAccess.cs
new file mode 100644
index 0000000..00be265
--- /dev/null
+++ b/HotelPms.DataAccessGrpc.Client/UsePersonTelAccess.cs
@@ -0,0 +1,262 @@
+using Google.Protobuf;
+using Grpc.Core;
+using Grpc.Net.Client;
+using HotelPms.Data;
+using HotelPms.Data.Client;
+using HotelPms.Data.Common;
+using HotelPms.Data.Common.Pagination;
+using HotelPms.Data.UseInfo;
+using System.Data;
+using System.Text.Json;
+
+namespace HotelPms.DataAccessGrpc.Client
+{
+ internal class UsePersonTelAccess : IDisposable
+ {
+ /// <summary>
+ /// チャネル
+ /// </summary>
+ public GrpcChannel Channel { get; private set; } = null;
+ public UsePersonTelCore.UsePersonTelCoreClient Client { get; private set; } = null;
+
+
+ public UsePersonTelAccess(GrpcChannel channel)
+ {
+ Channel = channel;
+ Client = new UsePersonTelCore.UsePersonTelCoreClient(Channel);
+ }
+
+ public void Dispose()
+ {
+
+ }
+
+ public async Task<bool> Exists(int pID,int pPersonID,string pTel)
+ {
+ return await GrpcClient.ExecuteScalar(Channel, $"IF EXISTS(SELECT 1 FROM D_UsePersonTel WHERE ID = {pID} AND PersonID = {pPersonID} AND Tel = N'{pTel}') SELECT 1 ELSE SELECT 0") == "1";
+
+ }
+
+ public async Task<FileGrpcData> OutputStream(PagingRequest request)
+ {
+ FileGrpcData data = null;
+ request.Table = "D_UsePersonTel";
+ string json = JsonSerializer.Serialize(request);
+ using (var call = Client.OutputStream(GrpcClient.CreateDataRequest(2, json)))
+ {
+ var reaponseStream = call.ResponseStream;
+ //データの取得
+ while (await reaponseStream.MoveNext(CancellationToken.None))
+ {
+ data = reaponseStream.Current;
+ }
+ }
+ return data;
+ }
+
+ public async Task<UsePersonTelTable> GetPageData(PagingRequest request)
+ {
+ request.Table = "D_UsePersonTel";
+ string json = JsonSerializer.Serialize(request);
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(1, json));
+ }
+
+
+ public DataTable GetMasterGridData(string where)
+ {
+ GrpcTable table = GrpcClient.GetTable(Channel, (int)ETableActionType.BuildingMasterGrid, where);
+ return table.ToDataTable();
+ }
+
+ /// <summary>
+ /// 同期データ取得
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public UsePersonTelTable GetData(string where)
+ {
+ return Client.GetData(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ public async Task<UsePersonTelTable> GetDataAsync(string where)
+ {
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public UsePersonTel GetItem(int pID,int pPersonID,string pTel)
+ {
+ UsePersonTelTable table = GetData($"ID = {pID} AND PersonID = {pPersonID} AND Tel = N'{pTel}'");
+ if(table == null || table.ErrNo != 0 || table.Rows.Count == 0) { return null; }
+ return table.Rows[0];
+ }
+
+ public async Task<UsePersonTelTable> GetDataStream()
+ {
+ return await GetDataStream(string.Empty);
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public async Task<UsePersonTelTable> GetDataStream(string where)
+ {
+ UsePersonTelTable table = null;
+ using (var call = Client.GetDataStream())
+ {
+ await call.RequestStream.WriteAsync(GrpcClient.CreateDataRequest(0, where));
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<UsePersonTelTable>())
+ {
+ table = message;
+ break;
+ }
+ }
+ return table;
+ }
+
+ public async Task<DataResult> AddAsync(UsePersonTel data)
+ {
+ return await Client.AddAsync(data);
+ }
+
+ public DataResult Add(UsePersonTel data)
+ {
+ return Client.Add(data);
+ }
+
+ public async Task<DataResult> UpdateAsync(UsePersonTel data)
+ {
+ return await Client.UpdateAsync(data);
+ }
+
+ public DataResult Update(UsePersonTel data)
+ {
+ return Client.Update(data);
+ }
+
+ /// <summary>
+ /// 追加若しくは更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <param name="add"></param>
+ /// <returns></returns>
+ private async Task<DataResult> AddOrUpdateStream(UsePersonTel data, bool add)
+ {
+ DataResult result = null;
+ using (var call = add ? Client.AddStream() : Client.UpdateStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ /// <summary>
+ /// 追加
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> AddStream(UsePersonTel data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ /// <summary>
+ /// 更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> UpdateStream(UsePersonTel data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ public DataResult Remove(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return Client.Remove(data);
+ }
+
+ public async Task<DataResult> RemoveAsync(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return await Client.RemoveAsync(data);
+ }
+
+ /// <summary>
+ /// 削除
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public async Task<DataResult> RemoveStream(string where)
+ {
+ DataResult result = null;
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+
+ using (var call = Client.RemoveStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ public DataResult SetData(UsePersonTelTable table)
+ {
+ return Client.SetData(table);
+ }
+
+ /// <summary>
+ /// バッチ更新
+ /// </summary>
+ /// <param name="table"></param>
+ /// <returns></returns>
+ public async Task<DataResult> SetDataStream(UsePersonTelTable table)
+ {
+ DataResult result = null;
+ using (var call = Client.SetDataStream())
+ {
+ await call.RequestStream.WriteAsync(table);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+ }
+}
diff --git a/HotelPms.DataAccessGrpc.Client/UseRoomAccess.cs b/HotelPms.DataAccessGrpc.Client/UseRoomAccess.cs
new file mode 100644
index 0000000..cf329af
--- /dev/null
+++ b/HotelPms.DataAccessGrpc.Client/UseRoomAccess.cs
@@ -0,0 +1,263 @@
+using Google.Protobuf;
+using Grpc.Core;
+using Grpc.Net.Client;
+using HotelPms.Data;
+using HotelPms.Data.Client;
+using HotelPms.Data.Common;
+using HotelPms.Data.Common.Pagination;
+using HotelPms.Data.UseInfo;
+using HotelPms.Share.Util;
+using System.Data;
+using System.Text.Json;
+
+namespace HotelPms.DataAccessGrpc.Client
+{
+ internal class UseRoomAccess : IDisposable
+ {
+ /// <summary>
+ /// チャネル
+ /// </summary>
+ public GrpcChannel Channel { get; private set; } = null;
+ public UseRoomCore.UseRoomCoreClient Client { get; private set; } = null;
+
+
+ public UseRoomAccess(GrpcChannel channel)
+ {
+ Channel = channel;
+ Client = new UseRoomCore.UseRoomCoreClient(Channel);
+ }
+
+ public void Dispose()
+ {
+
+ }
+
+ public async Task<bool> Exists(int pID,int pDetailID,DateTime pUseDate)
+ {
+ return await GrpcClient.ExecuteScalar(Channel, $"IF EXISTS(SELECT 1 FROM D_UseRoom WHERE ID = {pID} AND DetailID = {pDetailID} AND UseDate = {CConvert.ToSqlValue(pUseDate)}) SELECT 1 ELSE SELECT 0") == "1";
+
+ }
+
+ public async Task<FileGrpcData> OutputStream(PagingRequest request)
+ {
+ FileGrpcData data = null;
+ request.Table = "D_UseRoom";
+ string json = JsonSerializer.Serialize(request);
+ using (var call = Client.OutputStream(GrpcClient.CreateDataRequest(2, json)))
+ {
+ var reaponseStream = call.ResponseStream;
+ //データの取得
+ while (await reaponseStream.MoveNext(CancellationToken.None))
+ {
+ data = reaponseStream.Current;
+ }
+ }
+ return data;
+ }
+
+ public async Task<UseRoomTable> GetPageData(PagingRequest request)
+ {
+ request.Table = "D_UseRoom";
+ string json = JsonSerializer.Serialize(request);
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(1, json));
+ }
+
+
+ public DataTable GetMasterGridData(string where)
+ {
+ GrpcTable table = GrpcClient.GetTable(Channel, (int)ETableActionType.BuildingMasterGrid, where);
+ return table.ToDataTable();
+ }
+
+ /// <summary>
+ /// 同期データ取得
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public UseRoomTable GetData(string where)
+ {
+ return Client.GetData(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ public async Task<UseRoomTable> GetDataAsync(string where)
+ {
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public UseRoom GetItem(int pID,int pDetailID,DateTime pUseDate)
+ {
+ UseRoomTable table = GetData($"ID = {pID} AND DetailID = {pDetailID} AND UseDate = {CConvert.ToSqlValue(pUseDate)}");
+ if(table == null || table.ErrNo != 0 || table.Rows.Count == 0) { return null; }
+ return table.Rows[0];
+ }
+
+ public async Task<UseRoomTable> GetDataStream()
+ {
+ return await GetDataStream(string.Empty);
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public async Task<UseRoomTable> GetDataStream(string where)
+ {
+ UseRoomTable table = null;
+ using (var call = Client.GetDataStream())
+ {
+ await call.RequestStream.WriteAsync(GrpcClient.CreateDataRequest(0, where));
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<UseRoomTable>())
+ {
+ table = message;
+ break;
+ }
+ }
+ return table;
+ }
+
+ public async Task<DataResult> AddAsync(UseRoom data)
+ {
+ return await Client.AddAsync(data);
+ }
+
+ public DataResult Add(UseRoom data)
+ {
+ return Client.Add(data);
+ }
+
+ public async Task<DataResult> UpdateAsync(UseRoom data)
+ {
+ return await Client.UpdateAsync(data);
+ }
+
+ public DataResult Update(UseRoom data)
+ {
+ return Client.Update(data);
+ }
+
+ /// <summary>
+ /// 追加若しくは更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <param name="add"></param>
+ /// <returns></returns>
+ private async Task<DataResult> AddOrUpdateStream(UseRoom data, bool add)
+ {
+ DataResult result = null;
+ using (var call = add ? Client.AddStream() : Client.UpdateStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ /// <summary>
+ /// 追加
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> AddStream(UseRoom data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ /// <summary>
+ /// 更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> UpdateStream(UseRoom data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ public DataResult Remove(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return Client.Remove(data);
+ }
+
+ public async Task<DataResult> RemoveAsync(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return await Client.RemoveAsync(data);
+ }
+
+ /// <summary>
+ /// 削除
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public async Task<DataResult> RemoveStream(string where)
+ {
+ DataResult result = null;
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+
+ using (var call = Client.RemoveStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ public DataResult SetData(UseRoomTable table)
+ {
+ return Client.SetData(table);
+ }
+
+ /// <summary>
+ /// バッチ更新
+ /// </summary>
+ /// <param name="table"></param>
+ /// <returns></returns>
+ public async Task<DataResult> SetDataStream(UseRoomTable table)
+ {
+ DataResult result = null;
+ using (var call = Client.SetDataStream())
+ {
+ await call.RequestStream.WriteAsync(table);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+ }
+}
diff --git a/HotelPms.GrpcService/.config/dotnet-tools.json b/HotelPms.GrpcService/.config/dotnet-tools.json
new file mode 100644
index 0000000..43a4368
--- /dev/null
+++ b/HotelPms.GrpcService/.config/dotnet-tools.json
@@ -0,0 +1,12 @@
+{
+ "version": 1,
+ "isRoot": true,
+ "tools": {
+ "dotnet-ef": {
+ "version": "7.0.1",
+ "commands": [
+ "dotnet-ef"
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.GrpcService/Controllers/LoginController.cs b/HotelPms.GrpcService/Controllers/LoginController.cs
new file mode 100644
index 0000000..d1a25d4
--- /dev/null
+++ b/HotelPms.GrpcService/Controllers/LoginController.cs
@@ -0,0 +1,51 @@
+using HotelPms.Data.Common.Auth;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Configuration;
+using Microsoft.IdentityModel.Tokens;
+using System;
+using System.IdentityModel.Tokens.Jwt;
+using System.Security.Claims;
+using System.Text;
+
+namespace HotelPms.GrpcService.Controllers
+{
+ [Route("api/[controller]")]
+ [ApiController]
+ public class LoginController : ControllerBase
+ {
+ private readonly IConfiguration _configuration;
+
+ public LoginController(IConfiguration configuration)
+ {
+ _configuration = configuration;
+ }
+
+ [HttpPost]
+ public IActionResult Login([FromBody] LoginModel login)
+ {
+ //DBチェック
+ //var result = await _signInManager.PasswordSignInAsync(login.Email, login.Password, false, false);
+
+ //if (!result.Succeeded) return BadRequest(new LoginResult { Successful = false, Error = "Username and password are invalid." });
+
+ var claims = new[]
+ {
+ new Claim(ClaimTypes.Name, login.Name)
+ };
+
+ var key = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(_configuration["JwtSecurityKey"]));
+ var creds = new SigningCredentials(key, SecurityAlgorithms.HmacSha256);
+ var expiry = DateTime.Now.AddDays(Convert.ToInt32(_configuration["JwtExpiryInDays"]));
+
+ var token = new JwtSecurityToken(
+ _configuration["JwtIssuer"],
+ _configuration["JwtAudience"],
+ claims,
+ expires: expiry,
+ signingCredentials: creds
+ );
+
+ return Ok(new LoginResult { Successful = true, Token = new JwtSecurityTokenHandler().WriteToken(token) });
+ }
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.GrpcService/HotelPms.GrpcService.csproj b/HotelPms.GrpcService/HotelPms.GrpcService.csproj
new file mode 100644
index 0000000..de08a5a
--- /dev/null
+++ b/HotelPms.GrpcService/HotelPms.GrpcService.csproj
@@ -0,0 +1,23 @@
+<Project Sdk="Microsoft.NET.Sdk.Web">
+
+ <PropertyGroup>
+ <TargetFramework>net9.0</TargetFramework>
+ <Nullable>enable</Nullable>
+ <ImplicitUsings>enable</ImplicitUsings>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <PackageReference Include="Grpc.AspNetCore" Version="2.70.0" />
+ <PackageReference Include="Grpc.AspNetCore.Web" Version="2.70.0" />
+ <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.3" />
+ <PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.MessagePack" Version="9.0.3" />
+ <PackageReference Include="NPOI" Version="2.7.3" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <ProjectReference Include="..\HotelPms.Data.Common\HotelPms.Data.Common.csproj" />
+ <ProjectReference Include="..\HotelPms.Data.Server\HotelPms.Data.Server.csproj" />
+ <ProjectReference Include="..\HotelPms.Share\HotelPms.Share.csproj" />
+ </ItemGroup>
+
+</Project>
diff --git a/HotelPms.GrpcService/Hubs/NotifyHub.cs b/HotelPms.GrpcService/Hubs/NotifyHub.cs
new file mode 100644
index 0000000..cb445e4
--- /dev/null
+++ b/HotelPms.GrpcService/Hubs/NotifyHub.cs
@@ -0,0 +1,27 @@
+using HotelPms.Data.Common.Dtos;
+using Microsoft.AspNetCore.SignalR;
+using System;
+using System.Threading.Tasks;
+
+namespace HotelPms.GrpcService.Hubs
+{
+ public class NotifyHub : Hub
+ {
+ public override Task OnConnectedAsync()
+ {
+ //Context.ConnectionId
+ return base.OnConnectedAsync();
+ }
+
+ public override Task OnDisconnectedAsync(Exception exception)
+ {
+ return base.OnDisconnectedAsync(exception);
+ }
+
+ public async Task SendMessage(MessageDto data)
+ {
+ data.ConnectionId = Context.ConnectionId;
+ await Clients.All.SendAsync("ReceiveMessage", data);
+ }
+ }
+}
diff --git a/HotelPms.GrpcService/Program.cs b/HotelPms.GrpcService/Program.cs
new file mode 100644
index 0000000..70d2b31
--- /dev/null
+++ b/HotelPms.GrpcService/Program.cs
@@ -0,0 +1,178 @@
+using HotelPms.GrpcService;
+using HotelPms.GrpcService.Hubs;
+using HotelPms.GrpcService.Services;
+using HotelPms.GrpcService.Util;
+using Microsoft.AspNetCore.Authentication.JwtBearer;
+using Microsoft.AspNetCore.ResponseCompression;
+using Microsoft.AspNetCore.Server.Kestrel.Core;
+using Microsoft.IdentityModel.Tokens;
+using System.Text;
+
+//AppContext.SetSwitch("Microsoft.AspNetCore.Server.Kestrel.DisableHttp2AltSvcHandshake", true);
+
+var builder = WebApplication.CreateBuilder(args);
+Setting.Init(builder.Configuration);
+//if (Setting.HttpPort > 0) { builder.WebHost.UseUrls($"http://*:{Setting.HttpPort}"); }
+if (Setting.GrpcPort > 0 || Setting.ApiPort > 0)
+{
+ builder.Services.Configure<KestrelServerOptions>(y =>
+ {
+ if (Setting.GrpcPort > 0)
+ {
+ y.ListenAnyIP(Setting.GrpcPort, o =>
+ {
+ //o.Protocols = HttpProtocols.Http2;
+ //o.DisableAltSvcHeader = true;
+ o.Protocols = HttpProtocols.Http1AndHttp2;
+ //nginx要使用Http2、必须让Kestrel能够上https,就是tls,必须做个证书
+ //o.Protocols = HttpProtocols.Http2;
+ //o.UseHttps("./certs/backend.pfx", "password1");
+
+ //o.UseHttps("/etc/letsencrypt/live/ginbow.eu.org/certificate.pfx","Go_k@2087"); // 使用 Let’s Encrypt 证书
+ //o.Protocols = HttpProtocols.Http2; // 强制使用 HTTP/2
+ });
+ }
+
+ if (Setting.ApiPort > 0)
+ {
+ y.ListenAnyIP(Setting.ApiPort, o =>
+ {
+ //o.Protocols = HttpProtocols.Http2;
+ //o.DisableAltSvcHeader = true;
+ //o.UseHttps("/etc/letsencrypt/live/ginbow.eu.org/certificate.pfx", "Go_k@2087"); // 使用 Let’s Encrypt 证书
+ o.Protocols = HttpProtocols.Http1AndHttp2;
+ //o.UseHttps(cert); // 使用 Let’s Encrypt 证书
+ //o.Protocols = HttpProtocols.Http2; // 强制使用 HTTP/2
+ });
+ }
+ });
+}
+
+builder.Services.AddGrpc(options => { options.MaxReceiveMessageSize = int.MaxValue; });
+builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
+ .AddJwtBearer(options => {
+ options.TokenValidationParameters = new TokenValidationParameters
+ {
+ ClockSkew = TimeSpan.Zero,
+ ValidateIssuer = true,
+ ValidateAudience = true,
+ ValidateLifetime = true,
+ ValidateIssuerSigningKey = true,
+ ValidIssuer = Setting.JwtIssuer,
+ ValidAudience = Setting.JwtAudience,
+ IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(Setting.JwtSecurityKey))
+ };
+
+ options.Events = new JwtBearerEvents
+ {
+ //認証エラー
+ OnChallenge = async context =>
+ {
+ context.HandleResponse();
+
+ context.Response.ContentType = "application/json;charset=utf-8";
+ context.Response.StatusCode = StatusCodes.Status401Unauthorized;
+
+ await context.Response.WriteAsync("{\"message\":\"Unauthorized\",\"success\":false}");
+ },
+ //OnMessageReceived = async context =>
+ //{
+ // context.Token = context.Request.Query["token"];
+ // await Task.CompletedTask;
+ //}
+ };
+ });
+
+builder.Services.AddControllers();
+builder.Services.AddResponseCompression(opts =>
+{
+ opts.MimeTypes = ResponseCompressionDefaults.MimeTypes.Concat(
+ new[] { "application/octet-stream" });
+});
+
+builder.Services.AddCors(o => o.AddPolicy("AllowAll", builder =>
+{
+ builder.AllowAnyOrigin()
+ .AllowAnyMethod()
+ .AllowAnyHeader()
+ .WithExposedHeaders("Grpc-Status", "Grpc-Message", "Grpc-Encoding", "Grpc-Accept-Encoding");
+}));
+
+builder.Services.AddSignalR(config =>
+{
+ if (builder.Environment.IsDevelopment())
+ {
+ config.EnableDetailedErrors = true;
+ }
+})
+.AddMessagePackProtocol();
+
+// app初期化
+var app = builder.Build();
+
+app.Logger.Log(LogLevel.Information, $"Setting.HotelPmsDB = {Setting.HotelPmsDB}");
+app.Logger.Log(LogLevel.Information, $"Setting.HotelCommonDB = {Setting.HotelCommonDB}");
+app.Logger.Log(LogLevel.Information, $"Setting.SystemCenterDB = {Setting.SystemCenterDB}");
+
+
+app.UseResponseCompression();
+if (builder.Environment.IsDevelopment())
+{
+ app.UseDeveloperExceptionPage();
+}
+else
+{
+ app.UseExceptionHandler("/Error");
+ app.UseHsts();
+}
+app.UseHttpsRedirection();
+//app.UseBlazorFrameworkFiles();
+//app.UseStaticFiles();
+app.UseRouting();
+app.UseGrpcWeb(new GrpcWebOptions { DefaultEnabled = true });
+app.UseCors();
+app.UseAuthentication();
+app.UseAuthorization();
+
+app.MapControllers().RequireCors("AllowAll"); //Rest API
+app.MapGrpcService<FileService>().RequireCors("AllowAll");
+app.MapGrpcService<GrpcSetService>().RequireCors("AllowAll");
+app.MapGrpcService<GrpcTableService>().RequireCors("AllowAll");
+app.MapGrpcService<GreeterService>().RequireCors("AllowAll");
+app.MapGrpcService<UseService>().RequireCors("AllowAll");
+app.MapGrpcService<UseDetailService>().RequireCors("AllowAll");
+app.MapGrpcService<UsePersonService>().RequireCors("AllowAll");
+app.MapGrpcService<UseAlloService>().RequireCors("AllowAll");
+app.MapGrpcService<UseRoomService>().RequireCors("AllowAll");
+app.MapGrpcService<ArrangeService>().RequireCors("AllowAll");
+app.MapGrpcService<PayService>().RequireCors("AllowAll");
+app.MapGrpcService<PayDivService>().RequireCors("AllowAll");
+app.MapGrpcService<ReceiptService>().RequireCors("AllowAll");
+app.MapGrpcService<RentalService>().RequireCors("AllowAll");
+app.MapGrpcService<SaleService>().RequireCors("AllowAll");
+app.MapGrpcService<SaleDivService>().RequireCors("AllowAll");
+app.MapGrpcService<UseFreeService>().RequireCors("AllowAll");
+app.MapGrpcService<UseMemoService>().RequireCors("AllowAll");
+app.MapGrpcService<UsePersonFreeService>().RequireCors("AllowAll");
+app.MapGrpcService<UsePersonTelService>().RequireCors("AllowAll");
+app.MapGrpcService<HotelService>().RequireCors("AllowAll");
+app.MapGrpcService<DemoService>().RequireCors("AllowAll");
+app.MapGrpcService<BuildingService>().RequireCors("AllowAll");
+app.MapGrpcService<OutputItemService>().RequireCors("AllowAll");
+app.MapGrpcService<OutputService>().RequireCors("AllowAll");
+app.MapGrpcService<RoomViewTabService>().RequireCors("AllowAll");
+app.MapGrpcService<RoomViewLayoutService>().RequireCors("AllowAll");
+app.MapGrpcService<RoomCellService>().RequireCors("AllowAll");
+app.MapGrpcService<OptionService>().RequireCors("AllowAll");
+app.MapGrpcService<RoomStatusService>().RequireCors("AllowAll");
+app.MapGrpcService<RoomTypeService>().RequireCors("AllowAll");
+app.MapGrpcService<ItemService>().RequireCors("AllowAll");
+//app.UseEndpoints(endpoints =>
+//{
+// endpoints.MapGrpcService<GreeterService>();
+// endpoints.MapGrpcService<UseService>();
+//});
+app.MapGet("/", () => "。。。");
+app.MapHub<NotifyHub>("/notifyhub").RequireCors("AllowAll");
+
+app.Run();
diff --git a/HotelPms.GrpcService/Properties/launchSettings.json b/HotelPms.GrpcService/Properties/launchSettings.json
new file mode 100644
index 0000000..29a1d08
--- /dev/null
+++ b/HotelPms.GrpcService/Properties/launchSettings.json
@@ -0,0 +1,13 @@
+{
+ "profiles": {
+ "HotelPms.GrpcService": {
+ "commandName": "Project",
+ "dotnetRunMessages": true,
+ "launchBrowser": false,
+ "applicationUrl": "http://localhost:5240;https://localhost:7240",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ }
+ }
+}
diff --git a/HotelPms.GrpcService/Services/ArrangeService.cs b/HotelPms.GrpcService/Services/ArrangeService.cs
new file mode 100644
index 0000000..482fdb6
--- /dev/null
+++ b/HotelPms.GrpcService/Services/ArrangeService.cs
@@ -0,0 +1,369 @@
+using HotelPms.Data;
+using HotelPms.Data.Common.Pagination;
+using HotelPms.Data.UseInfo;
+using HotelPms.GrpcService.Util;
+using HotelPms.Share.Data;
+using HotelPms.Share.IO;
+using HotelPms.Share.Util;
+using Google.Protobuf;
+using Grpc.Core;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
+using System.Data;
+using System.Data.SqlClient;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Tasks;
+
+namespace HotelPms.GrpcService
+{
+ /// <summary>
+ /// ■攻略
+ /// 1.Arrange.proto(message:Arrange、ArrangeTable;Service:ArrangeCore) ⇒ projectファイルのInclude
+ /// 2.Arrange.cs(両方)
+ /// 3.ArrangeTable.cs(両方)
+ /// 4.ArrangeService.cs(サーバー側) ⇒ StartupでMapGrpcServiceの処理が必要
+ /// 5.ArrangeAccess.cs(クライアント側)
+ /// </summary>
+ public class ArrangeService : ArrangeCore.ArrangeCoreBase
+ {
+ #region ★★★★★ Declartions ★★★★★
+
+ private static string TableName = "D_Arrange";
+ private readonly ILogger<ArrangeService> _logger;
+ private IConfiguration m_Configuration;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public ArrangeService(ILogger<ArrangeService> logger, IConfiguration configuration)
+ {
+ _logger = logger;
+ m_Configuration = configuration;
+ }
+
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+
+ private string GetSql(DataRequest request)
+ {
+ StringBuilder sql = new StringBuilder();
+ if (request.ActionType == 0)
+ {
+ sql.Append($"SELECT * FROM {TableName} {(string.IsNullOrEmpty(request.Data) ? string.Empty : $"WHERE {request.Data}")}");
+ }
+ else if (request.ActionType == 1 || request.ActionType == 2)
+ {
+ PagingRequest pagingRequest = JsonSerializer.Deserialize<PagingRequest>(request.Data);
+ sql.Append($"EXECUTE Pagination {pagingRequest.PageNumber},{pagingRequest.PageSize},'{pagingRequest.Table}','{pagingRequest.Field}','{pagingRequest.OrderBy}','{CConvert.FromBase64(pagingRequest.Filter)}'");
+ }
+ return sql.ToString();
+ }
+
+ private DataTable GetDataTable(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+ DataTable table = null;
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 2)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ table = set.Tables[0];
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+
+ private ArrangeTable Get(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+
+ ArrangeTable table = new ArrangeTable() { ErrNo = 0, ErrData = string.Empty, Name = nameof(ArrangeTable) };
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 0)
+ {
+ using (SqlConnection dbConnect = msSqlNet.Open())
+ {
+ using (SqlCommand command = new SqlCommand(sql, dbConnect))
+ {
+ OperationLog.Instance.WriteLog($"データ読込:{sql}");
+ command.CommandTimeout = 60000 * 100;
+ using (SqlDataReader reader = command.ExecuteReader(CommandBehavior.Default))
+ {
+ //エラーまだ対応していない
+ if (reader == null)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ while (reader.Read())
+ {
+ Arrange item = new Arrange();
+ item.ConvertReader(reader);
+ table.Rows.Add(item);
+ }
+ }
+ reader.Close();
+ }
+ }
+ }
+ }
+ else if (request.ActionType == 1)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ foreach (DataRow row in set.Tables[0].Rows)
+ {
+ Arrange item = new Arrange();
+ item.ConvertDataRow(row);
+ table.Rows.Add(item);
+ }
+
+ table.ErrData = JsonSerializer.Serialize(new PagingRespone()
+ {
+ MaxPage = CConvert.ToInt(set.Tables[1].Rows[0]["MaxPage"]),
+ TotalRow = CConvert.ToInt(set.Tables[1].Rows[0]["TotalRow"])
+ });
+ }
+ else
+ {
+ table.ErrNo = -1;
+ table.ErrData = set.Tables[0].Rows[0]["Descript"].ToString();
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+ private DataResult Set(ArrangeTable table)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{table.Rows.Count}");
+
+ StringBuilder sql = new StringBuilder();
+ if (table.BeforeUpdate.Length > 0) { sql.AppendLine(table.BeforeUpdate.ToStringUtf8()); }
+
+ foreach (Arrange item in table.Rows)
+ {
+ sql.AppendLine(table.UpdateType == 2 ? item.UpdateSql() : item.AddSql());
+ }
+
+ if (table.AfterUpdate.Length > 0) { sql.AppendLine(table.AfterUpdate.ToStringUtf8()); }
+
+ string sqlCmd = sql.ToString();
+ OperationLog.Instance.WriteLog($"Sql生成:{sqlCmd}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (!msSqlNet.ExecuteNonQueryWithTran(sqlCmd))
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private DataResult AddOrUpdate(bool add, Arrange item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = add ? item.AddSql() : item.UpdateSql();
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private async Task AddOrUpdate(bool add, IAsyncStreamReader<Arrange> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ Arrange item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = AddOrUpdate(add, item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ private DataResult Delete(SqlWhere item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = $"DELETE FROM {TableName} WHERE {item.Data.ToStringUtf8()}";
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+
+ public async override Task OutputStream(DataRequest request, IServerStreamWriter<FileGrpcData> responseStream, ServerCallContext context)
+ {
+ try
+ {
+ using (DataTable data = GetDataTable(request))
+ {
+ byte[] bytes = Excel.Export(data);
+ FileGrpcData fileGrpcData = new FileGrpcData
+ {
+ Block = 1,
+ FileName = "Data",
+ Content = ByteString.CopyFrom(bytes)
+ };
+ await responseStream.WriteAsync(fileGrpcData);
+ }
+ }
+ catch { }
+ }
+
+ /// <summary>
+ /// 同期実行
+ /// </summary>
+ /// <param name="request"></param>
+ /// <param name="context"></param>
+ /// <returns></returns>
+ public override Task<ArrangeTable> GetData(DataRequest request, ServerCallContext context)
+ {
+ return Task.FromResult(Get(request));
+ }
+
+ public async override Task GetDataStream(IAsyncStreamReader<DataRequest> requestStream, IServerStreamWriter<ArrangeTable> responseStream, ServerCallContext context)
+ {
+ DataRequest request = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ request = message;
+ break;
+ }
+ ArrangeTable table = Get(request);
+ await responseStream.WriteAsync(table); //データ送信
+ }
+
+ public override Task<DataResult> SetData(ArrangeTable request, ServerCallContext context)
+ {
+ return Task.FromResult(Set(request));
+ }
+
+ public async override Task SetDataStream(IAsyncStreamReader<ArrangeTable> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ ArrangeTable table = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ table = message;
+ break;
+ }
+
+ DataResult result = Set(table);
+ //データ送信
+ await responseStream.WriteAsync(result);
+ }
+
+ public override Task<DataResult> Add(Arrange request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(true, request));
+ }
+
+ public async override Task AddStream(IAsyncStreamReader<Arrange> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(true, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Update(Arrange request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(false, request));
+ }
+
+ public async override Task UpdateStream(IAsyncStreamReader<Arrange> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(false, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Remove(SqlWhere request, ServerCallContext context)
+ {
+ return Task.FromResult(Delete(request));
+ }
+
+ public async override Task RemoveStream(IAsyncStreamReader<SqlWhere> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ SqlWhere item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = Delete(item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ #endregion
+ }
+}
diff --git a/HotelPms.GrpcService/Services/AuthService.cs b/HotelPms.GrpcService/Services/AuthService.cs
new file mode 100644
index 0000000..0032493
--- /dev/null
+++ b/HotelPms.GrpcService/Services/AuthService.cs
@@ -0,0 +1,67 @@
+using HotelPms.Data;
+using Grpc.Core;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
+using Microsoft.IdentityModel.Tokens;
+using System;
+using System.IdentityModel.Tokens.Jwt;
+using System.Security.Claims;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HotelPms.GrpcService
+{
+ /// <summary>
+ /// 認証処理
+ /// </summary>
+ public class AuthService : AuthCore.AuthCoreBase
+ {
+ private readonly ILogger<BuildingService> _logger;
+ private IConfiguration m_Configuration;
+
+ public AuthService(ILogger<BuildingService> logger, IConfiguration configuration)
+ {
+ _logger = logger;
+ m_Configuration = configuration;
+ }
+
+ public override Task<LoginResult> Login(DataRequest request, ServerCallContext context)
+ {
+ LoginResult ret = new LoginResult() { ErrNo = 0, ErrData = string.Empty, AccessToKen = string.Empty, RefreshToKen = string.Empty };
+
+ //DBチェック
+ //var result = await _signInManager.PasswordSignInAsync(login.Email, login.Password, false, false);
+
+ //if (!result.Succeeded) return BadRequest(new LoginResult { Successful = false, Error = "Username and password are invalid." });
+
+ var claims = new[]
+ {
+ new Claim(ClaimTypes.Name, request.LoginID)
+ };
+
+ var key = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(m_Configuration["JwtSecurityKey"]));
+ var creds = new SigningCredentials(key, SecurityAlgorithms.HmacSha256);
+ var expiry = DateTime.Now.AddDays(Convert.ToInt32(m_Configuration["JwtExpiryInDays"]));
+ //var expiry = DateTime.Now.AddSeconds(30); //在 .net core 中有一个属性的值,默认是300,也就是5分钟后,假如生命周期设置的是30秒,还需要加上这300秒 //在验证令牌生命周期时间到后,立即过期;默认的是300秒 ClockSkew = TimeSpan.Zero, 按自己理解的注释的,
+
+
+ var token = new JwtSecurityToken(
+ m_Configuration["JwtIssuer"],
+ m_Configuration["JwtAudience"],
+ claims,
+ expires: expiry,
+ signingCredentials: creds
+ );
+
+ ret.AccessToKen = new JwtSecurityTokenHandler().WriteToken(token);
+ return Task.FromResult(ret);
+ }
+
+ public override Task<LoginResult> Logout(DataRequest request, ServerCallContext context)
+ {
+ LoginResult ret = new LoginResult() { ErrNo = 0, ErrData = string.Empty, AccessToKen = string.Empty, RefreshToKen = string.Empty };
+
+ return Task.FromResult(ret);
+ }
+ }
+}
diff --git a/HotelPms.GrpcService/Services/BuildingService.cs b/HotelPms.GrpcService/Services/BuildingService.cs
new file mode 100644
index 0000000..83be8d4
--- /dev/null
+++ b/HotelPms.GrpcService/Services/BuildingService.cs
@@ -0,0 +1,369 @@
+using HotelPms.Data;
+using HotelPms.Data.Common.Pagination;
+using HotelPms.Data.Master;
+using HotelPms.GrpcService.Util;
+using HotelPms.Share.Data;
+using HotelPms.Share.IO;
+using HotelPms.Share.Util;
+using Google.Protobuf;
+using Grpc.Core;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
+using System.Data;
+using System.Data.SqlClient;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Tasks;
+
+namespace HotelPms.GrpcService
+{
+ /// <summary>
+ /// ■攻略
+ /// 1.Building.proto(message:Building、BuildingTable;Service:BuildingCore) ⇒ projectファイルのInclude
+ /// 2.Building.cs(両方)
+ /// 3.BuildingTable.cs(両方)
+ /// 4.BuildingService.cs(サーバー側) ⇒ StartupでMapGrpcServiceの処理が必要
+ /// 5.BuildingAccess.cs(クライアント側)
+ /// </summary>
+ public class BuildingService : BuildingCore.BuildingCoreBase
+ {
+ #region ★★★★★ Declartions ★★★★★
+
+ private static string TableName = "M_Building";
+ private readonly ILogger<BuildingService> _logger;
+ private IConfiguration m_Configuration;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public BuildingService(ILogger<BuildingService> logger, IConfiguration configuration)
+ {
+ _logger = logger;
+ m_Configuration = configuration;
+ }
+
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+
+ private string GetSql(DataRequest request)
+ {
+ StringBuilder sql = new StringBuilder();
+ if (request.ActionType == 0)
+ {
+ sql.Append($"SELECT * FROM {TableName} {(string.IsNullOrEmpty(request.Data) ? string.Empty : $"WHERE {request.Data}")}");
+ }
+ else if (request.ActionType == 1 || request.ActionType == 2)
+ {
+ PagingRequest pagingRequest = JsonSerializer.Deserialize<PagingRequest>(request.Data);
+ sql.Append($"EXECUTE Pagination {pagingRequest.PageNumber},{pagingRequest.PageSize},'{pagingRequest.Table}','{pagingRequest.Field}','{pagingRequest.OrderBy}','{CConvert.FromBase64(pagingRequest.Filter)}'");
+ }
+ return sql.ToString();
+ }
+
+ private DataTable GetDataTable(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+ DataTable table = null;
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 2)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ table = set.Tables[0];
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+
+ private BuildingTable Get(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+
+ BuildingTable table = new BuildingTable() { ErrNo = 0, ErrData = string.Empty, Name = nameof(BuildingTable) };
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 0)
+ {
+ using (SqlConnection dbConnect = msSqlNet.Open())
+ {
+ using (SqlCommand command = new SqlCommand(sql, dbConnect))
+ {
+ OperationLog.Instance.WriteLog($"データ読込:{sql}");
+ command.CommandTimeout = 60000 * 100;
+ using (SqlDataReader reader = command.ExecuteReader(CommandBehavior.Default))
+ {
+ //エラーまだ対応していない
+ if (reader == null)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ while (reader.Read())
+ {
+ Building item = new Building();
+ item.ConvertReader(reader);
+ table.Rows.Add(item);
+ }
+ }
+ reader.Close();
+ }
+ }
+ }
+ }
+ else if (request.ActionType == 1)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ foreach (DataRow row in set.Tables[0].Rows)
+ {
+ Building item = new Building();
+ item.ConvertDataRow(row);
+ table.Rows.Add(item);
+ }
+
+ table.Tag = JsonSerializer.Serialize(new PagingRespone()
+ {
+ MaxPage = CConvert.ToInt(set.Tables[1].Rows[0]["MaxPage"]),
+ TotalRow = CConvert.ToInt(set.Tables[1].Rows[0]["TotalRow"])
+ });
+ }
+ else
+ {
+ table.ErrNo = -1;
+ table.ErrData = set.Tables[0].Rows[0]["Descript"].ToString();
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+ private DataResult Set(BuildingTable table)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{table.Rows.Count}");
+
+ StringBuilder sql = new StringBuilder();
+ if (table.BeforeUpdate.Length > 0) { sql.AppendLine(table.BeforeUpdate.ToStringUtf8()); }
+
+ foreach (Building item in table.Rows)
+ {
+ sql.AppendLine(table.UpdateType == 2 ? item.UpdateSql() : item.AddSql());
+ }
+
+ if (table.AfterUpdate.Length > 0) { sql.AppendLine(table.AfterUpdate.ToStringUtf8()); }
+
+ string sqlCmd = sql.ToString();
+ OperationLog.Instance.WriteLog($"Sql生成:{sqlCmd}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (!msSqlNet.ExecuteNonQueryWithTran(sqlCmd))
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private DataResult AddOrUpdate(bool add, Building item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = add ? item.AddSql() : item.UpdateSql();
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private async Task AddOrUpdate(bool add, IAsyncStreamReader<Building> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ Building item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = AddOrUpdate(add, item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ private DataResult Delete(SqlWhere item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = $"DELETE FROM {TableName} WHERE {item.Data.ToStringUtf8()}";
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+
+ public async override Task OutputStream(DataRequest request, IServerStreamWriter<FileGrpcData> responseStream, ServerCallContext context)
+ {
+ try
+ {
+ using (DataTable data = GetDataTable(request))
+ {
+ byte[] bytes = Excel.Export(data);
+ FileGrpcData fileGrpcData = new FileGrpcData
+ {
+ Block = 1,
+ FileName = "Data",
+ Content = ByteString.CopyFrom(bytes)
+ };
+ await responseStream.WriteAsync(fileGrpcData);
+ }
+ }
+ catch { }
+ }
+
+ /// <summary>
+ /// 同期実行
+ /// </summary>
+ /// <param name="request"></param>
+ /// <param name="context"></param>
+ /// <returns></returns>
+ public override Task<BuildingTable> GetData(DataRequest request, ServerCallContext context)
+ {
+ return Task.FromResult(Get(request));
+ }
+
+ public async override Task GetDataStream(IAsyncStreamReader<DataRequest> requestStream, IServerStreamWriter<BuildingTable> responseStream, ServerCallContext context)
+ {
+ DataRequest request = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ request = message;
+ break;
+ }
+ BuildingTable table = Get(request);
+ await responseStream.WriteAsync(table); //データ送信
+ }
+
+ public override Task<DataResult> SetData(BuildingTable request, ServerCallContext context)
+ {
+ return Task.FromResult(Set(request));
+ }
+
+ public async override Task SetDataStream(IAsyncStreamReader<BuildingTable> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ BuildingTable table = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ table = message;
+ break;
+ }
+
+ DataResult result = Set(table);
+ //データ送信
+ await responseStream.WriteAsync(result);
+ }
+
+ public override Task<DataResult> Add(Building request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(true, request));
+ }
+
+ public async override Task AddStream(IAsyncStreamReader<Building> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(true, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Update(Building request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(false, request));
+ }
+
+ public async override Task UpdateStream(IAsyncStreamReader<Building> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(false, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Remove(SqlWhere request, ServerCallContext context)
+ {
+ return Task.FromResult(Delete(request));
+ }
+
+ public async override Task RemoveStream(IAsyncStreamReader<SqlWhere> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ SqlWhere item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = Delete(item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ #endregion
+ }
+}
diff --git a/HotelPms.GrpcService/Services/DemoService.cs b/HotelPms.GrpcService/Services/DemoService.cs
new file mode 100644
index 0000000..ec92b16
--- /dev/null
+++ b/HotelPms.GrpcService/Services/DemoService.cs
@@ -0,0 +1,369 @@
+using HotelPms.Data;
+using HotelPms.Data.Common.Pagination;
+using HotelPms.Data.Master;
+using HotelPms.GrpcService.Util;
+using HotelPms.Share.Data;
+using HotelPms.Share.IO;
+using HotelPms.Share.Util;
+using Google.Protobuf;
+using Grpc.Core;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
+using System.Data;
+using System.Data.SqlClient;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Tasks;
+
+namespace HotelPms.GrpcService
+{
+ /// <summary>
+ /// ■攻略
+ /// 1.Demo.proto(message:Demo、DemoTable;Service:DemoCore) ⇒ projectファイルのInclude
+ /// 2.Demo.cs(両方)
+ /// 3.DemoTable.cs(両方)
+ /// 4.DemoService.cs(サーバー側) ⇒ StartupでMapGrpcServiceの処理が必要
+ /// 5.DemoAccess.cs(クライアント側)
+ /// </summary>
+ public class DemoService : DemoCore.DemoCoreBase
+ {
+ #region ★★★★★ Declartions ★★★★★
+
+ private static string TableName = "M_Demo";
+ private readonly ILogger<DemoService> _logger;
+ private IConfiguration m_Configuration;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public DemoService(ILogger<DemoService> logger, IConfiguration configuration)
+ {
+ _logger = logger;
+ m_Configuration = configuration;
+ }
+
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+
+ private string GetSql(DataRequest request)
+ {
+ StringBuilder sql = new StringBuilder();
+ if (request.ActionType == 0)
+ {
+ sql.Append($"SELECT * FROM {TableName} {(string.IsNullOrEmpty(request.Data) ? string.Empty : $"WHERE {request.Data}")}");
+ }
+ else if (request.ActionType == 1 || request.ActionType == 2)
+ {
+ PagingRequest pagingRequest = JsonSerializer.Deserialize<PagingRequest>(request.Data);
+ sql.Append($"EXECUTE Pagination {pagingRequest.PageNumber},{pagingRequest.PageSize},'{pagingRequest.Table}','{pagingRequest.Field}','{pagingRequest.OrderBy}','{CConvert.FromBase64(pagingRequest.Filter)}'");
+ }
+ return sql.ToString();
+ }
+
+ private DataTable GetDataTable(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+ DataTable table = null;
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 2)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ table = set.Tables[0];
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+
+ private DemoTable Get(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+
+ DemoTable table = new DemoTable() { ErrNo = 0, ErrData = string.Empty, Name = nameof(DemoTable) };
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 0)
+ {
+ using (SqlConnection dbConnect = msSqlNet.Open())
+ {
+ using (SqlCommand command = new SqlCommand(sql, dbConnect))
+ {
+ OperationLog.Instance.WriteLog($"データ読込:{sql}");
+ command.CommandTimeout = 60000 * 100;
+ using (SqlDataReader reader = command.ExecuteReader(CommandBehavior.Default))
+ {
+ //エラーまだ対応していない
+ if (reader == null)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ while (reader.Read())
+ {
+ Demo item = new Demo();
+ item.ConvertReader(reader);
+ table.Rows.Add(item);
+ }
+ }
+ reader.Close();
+ }
+ }
+ }
+ }
+ else if (request.ActionType == 1)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ foreach (DataRow row in set.Tables[0].Rows)
+ {
+ Demo item = new Demo();
+ item.ConvertDataRow(row);
+ table.Rows.Add(item);
+ }
+
+ table.Tag = JsonSerializer.Serialize(new PagingRespone()
+ {
+ MaxPage = CConvert.ToInt(set.Tables[1].Rows[0]["MaxPage"]),
+ TotalRow = CConvert.ToInt(set.Tables[1].Rows[0]["TotalRow"])
+ });
+ }
+ else
+ {
+ table.ErrNo = -1;
+ table.ErrData = set.Tables[0].Rows[0]["Descript"].ToString();
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+ private DataResult Set(DemoTable table)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{table.Rows.Count}");
+
+ StringBuilder sql = new StringBuilder();
+ if (table.BeforeUpdate.Length > 0) { sql.AppendLine(table.BeforeUpdate.ToStringUtf8()); }
+
+ foreach (Demo item in table.Rows)
+ {
+ sql.AppendLine(table.UpdateType == 2 ? item.UpdateSql() : item.AddSql());
+ }
+
+ if (table.AfterUpdate.Length > 0) { sql.AppendLine(table.AfterUpdate.ToStringUtf8()); }
+
+ string sqlCmd = sql.ToString();
+ OperationLog.Instance.WriteLog($"Sql生成:{sqlCmd}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (!msSqlNet.ExecuteNonQueryWithTran(sqlCmd))
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private DataResult AddOrUpdate(bool add, Demo item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = add ? item.AddSql() : item.UpdateSql();
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private async Task AddOrUpdate(bool add, IAsyncStreamReader<Demo> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ Demo item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = AddOrUpdate(add, item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ private DataResult Delete(SqlWhere item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = $"DELETE FROM {TableName} WHERE {item.Data.ToStringUtf8()}";
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+
+ public async override Task OutputStream(DataRequest request, IServerStreamWriter<FileGrpcData> responseStream, ServerCallContext context)
+ {
+ try
+ {
+ using (DataTable data = GetDataTable(request))
+ {
+ byte[] bytes = Excel.Export(data);
+ FileGrpcData fileGrpcData = new FileGrpcData
+ {
+ Block = 1,
+ FileName = "Data",
+ Content = ByteString.CopyFrom(bytes)
+ };
+ await responseStream.WriteAsync(fileGrpcData);
+ }
+ }
+ catch { }
+ }
+
+ /// <summary>
+ /// 同期実行
+ /// </summary>
+ /// <param name="request"></param>
+ /// <param name="context"></param>
+ /// <returns></returns>
+ public override Task<DemoTable> GetData(DataRequest request, ServerCallContext context)
+ {
+ return Task.FromResult(Get(request));
+ }
+
+ public async override Task GetDataStream(IAsyncStreamReader<DataRequest> requestStream, IServerStreamWriter<DemoTable> responseStream, ServerCallContext context)
+ {
+ DataRequest request = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ request = message;
+ break;
+ }
+ DemoTable table = Get(request);
+ await responseStream.WriteAsync(table); //データ送信
+ }
+
+ public override Task<DataResult> SetData(DemoTable request, ServerCallContext context)
+ {
+ return Task.FromResult(Set(request));
+ }
+
+ public async override Task SetDataStream(IAsyncStreamReader<DemoTable> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ DemoTable table = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ table = message;
+ break;
+ }
+
+ DataResult result = Set(table);
+ //データ送信
+ await responseStream.WriteAsync(result);
+ }
+
+ public override Task<DataResult> Add(Demo request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(true, request));
+ }
+
+ public async override Task AddStream(IAsyncStreamReader<Demo> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(true, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Update(Demo request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(false, request));
+ }
+
+ public async override Task UpdateStream(IAsyncStreamReader<Demo> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(false, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Remove(SqlWhere request, ServerCallContext context)
+ {
+ return Task.FromResult(Delete(request));
+ }
+
+ public async override Task RemoveStream(IAsyncStreamReader<SqlWhere> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ SqlWhere item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = Delete(item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ #endregion
+ }
+}
diff --git a/HotelPms.GrpcService/Services/FileService.cs b/HotelPms.GrpcService/Services/FileService.cs
new file mode 100644
index 0000000..982cc20
--- /dev/null
+++ b/HotelPms.GrpcService/Services/FileService.cs
@@ -0,0 +1,79 @@
+using HotelPms.Data;
+using Google.Protobuf;
+using Grpc.Core;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace HotelPms.GrpcService
+{
+ public class FileService : FileCore.FileCoreBase
+ {
+ private readonly ILogger<FileService> _logger;
+ private IConfiguration m_Configuration;
+
+ public FileService(ILogger<FileService> logger, IConfiguration configuration)
+ {
+ _logger = logger;
+ m_Configuration = configuration;
+ }
+
+ public async override Task DownLoad(FileGrpcHead request, IServerStreamWriter<FileGrpcData> responseStream, ServerCallContext context)
+ {
+ //1M単位送信する
+ string path = System.AppDomain.CurrentDomain.BaseDirectory + @"DownLoad\" + request.FileName;
+ if (System.IO.File.Exists(path))
+ {
+ System.IO.FileInfo fileInfo = new System.IO.FileInfo(path);
+ long fileLength = fileInfo.Length;
+
+ using (System.IO.FileStream fs = new System.IO.FileStream(path, System.IO.FileMode.Open, System.IO.FileAccess.Read))
+ {
+ using (System.IO.BinaryReader br = new System.IO.BinaryReader(fs))
+ {
+ long offsetFile = 0;
+ long buffSize = 1024 * 1024; //1M
+ long lastBiteSize = fileLength % buffSize; //余り
+ long currentTimes = 1;
+ long loopTimes = fileLength / buffSize; //回数
+ if (lastBiteSize > 0) { loopTimes++; }
+ long blockSize = 0;
+ FileGrpcData contentStruct;
+ while (currentTimes <= loopTimes)
+ {
+ fs.Seek(offsetFile, System.IO.SeekOrigin.Begin);
+ if (currentTimes == loopTimes)
+ {
+ blockSize = lastBiteSize;
+ }
+ else
+ {
+ blockSize = buffSize;
+ }
+
+ byte[] byteArray = br.ReadBytes((int)blockSize);
+ ByteString sbytes = ByteString.CopyFrom(byteArray);
+ contentStruct = new FileGrpcData
+ {
+ FileName = request.FileName,
+ Block = (int)currentTimes,
+ Content = sbytes,
+ };
+ await responseStream.WriteAsync(contentStruct);
+ currentTimes++;
+ offsetFile += blockSize;
+ }
+ }
+ }
+ }
+ }
+
+ public override Task<FileGrpcHead> UpLoad(IAsyncStreamReader<FileGrpcData> requestStream, ServerCallContext context)
+ {
+ return base.UpLoad(requestStream, context);
+ }
+ }
+}
diff --git a/HotelPms.GrpcService/Services/GreeterService.cs b/HotelPms.GrpcService/Services/GreeterService.cs
new file mode 100644
index 0000000..cdfab30
--- /dev/null
+++ b/HotelPms.GrpcService/Services/GreeterService.cs
@@ -0,0 +1,22 @@
+using Grpc.Core;
+using HotelPms.Data;
+
+namespace HotelPms.GrpcService.Services
+{
+ public class GreeterService : Greeter.GreeterBase
+ {
+ private readonly ILogger<GreeterService> _logger;
+ public GreeterService(ILogger<GreeterService> logger)
+ {
+ _logger = logger;
+ }
+
+ public override Task<HelloReply> SayHello(HelloRequest request, ServerCallContext context)
+ {
+ return Task.FromResult(new HelloReply
+ {
+ Message = "Hello " + request.Name + " " + DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss.fff")
+ });
+ }
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.GrpcService/Services/GrpcSetService.cs b/HotelPms.GrpcService/Services/GrpcSetService.cs
new file mode 100644
index 0000000..5fca88c
--- /dev/null
+++ b/HotelPms.GrpcService/Services/GrpcSetService.cs
@@ -0,0 +1,120 @@
+using HotelPms.Data;
+using HotelPms.Data.Common;
+using HotelPms.GrpcService.Util;
+using HotelPms.Share.Data;
+using HotelPms.Share.IO;
+using HotelPms.Share.Util;
+using Google.Protobuf;
+using Grpc.Core;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using NPOI.SS.UserModel;
+
+namespace HotelPms.GrpcService
+{
+ public class GrpcSetService : GrpcSetCore.GrpcSetCoreBase
+ {
+ private readonly ILogger<GrpcTableService> _logger;
+ private IConfiguration m_Configuration;
+
+ public GrpcSetService(ILogger<GrpcTableService> logger, IConfiguration configuration)
+ {
+ _logger = logger;
+ m_Configuration = configuration;
+ }
+
+ public async override Task GetDataStream(IAsyncStreamReader<DataRequest> requestStream, IServerStreamWriter<GrpcSet> responseStream, ServerCallContext context)
+ {
+ DataRequest request = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ request = message;
+ break;
+ }
+
+ //データ送信
+ GrpcSet set = Get(request);
+ await responseStream.WriteAsync(set);
+ }
+
+ public override Task<GrpcSet> GetData(DataRequest request, ServerCallContext context)
+ {
+ return Task.FromResult(Get(request));
+ }
+
+ private string GetDB(DataRequest request)
+ {
+ //if (request.ActionType == (int)ETableActionType.ReportMaster)
+ //{
+ // return Setting.HotelCommonDB;
+ //}
+ //else
+ //{
+ return Setting.HotelPmsDB;
+ //}
+ }
+
+ private string GetSql(DataRequest request)
+ {
+ string[] fields;
+ StringBuilder sql = new StringBuilder();
+ if (request.ActionType == (int)ESetActionType.CustomSql)
+ {
+ sql.Append(request.Data);
+ }
+ else if (request.ActionType == (int)ESetActionType.ColSetting)
+ {
+ fields = request.Data.Split(new char[] { ',' }); //@MachineName,@UserName,@ID
+ sql.Append($"EXECUTE GetColSetting '{fields[0]}','{fields[1]}',{fields[2]}");
+ }
+ else if (request.ActionType == (int)ESetActionType.RoomView)
+ {
+ fields = request.Data.Split(new char[] { ',' });
+ sql.Append($"EXECUTE GetRoomView {(fields[0] == "NULL" ? "NULL" : $"'{fields[0]}'")},{fields[1]},{fields[2]}");
+ }
+ return sql.ToString();
+ }
+
+
+ private GrpcSet Get(DataRequest request)
+ {
+ GrpcSet set = new GrpcSet() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog(request.ToString());
+
+ using MsSqlNet msSqlNet = new MsSqlNet(GetDB(request));
+ using SqlConnection dbConnect = msSqlNet.Open();
+ string sql = GetSql(request);
+ using SqlCommand command = new SqlCommand(sql, dbConnect);
+ OperationLog.Instance.WriteLog(sql);
+ command.CommandTimeout = 60000 * 100;
+ using SqlDataReader reader = command.ExecuteReader(CommandBehavior.Default);
+ //エラーまだ対応していない
+ if (reader == null)
+ {
+ OperationLog.Instance.WriteLog("SqlDataReader=null");
+ set.ErrNo = msSqlNet.ErrNo;
+ set.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ while (true)
+ {
+ GrpcTable table = new GrpcTable();
+ set.Tables.Add(table);
+ GrpcTableService.SetTable(table, reader);
+ if (!reader.NextResult()) { break; }
+ }
+ }
+ reader.Close();
+ return set;
+ } //←全てusingはここにDispose
+ }
+}
diff --git a/HotelPms.GrpcService/Services/GrpcTableService.cs b/HotelPms.GrpcService/Services/GrpcTableService.cs
new file mode 100644
index 0000000..1da2e50
--- /dev/null
+++ b/HotelPms.GrpcService/Services/GrpcTableService.cs
@@ -0,0 +1,310 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Data;
+using System.Data.Common;
+using System.Data.SqlClient;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Google.Protobuf;
+using Grpc.Core;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
+using HotelPms.Data;
+using HotelPms.GrpcService.Util;
+using HotelPms.Share.Data;
+using HotelPms.Share.IO;
+using HotelPms.Share.Util;
+using HotelPms.Data.Common;
+using Org.BouncyCastle.Asn1.Ocsp;
+
+namespace HotelPms.GrpcService
+{
+ public class GrpcTableService : GrpcTableCore.GrpcTableCoreBase
+ {
+ private readonly ILogger<GrpcTableService> _logger;
+ private IConfiguration m_Configuration;
+
+ public GrpcTableService(ILogger<GrpcTableService> logger, IConfiguration configuration)
+ {
+ _logger = logger;
+ m_Configuration = configuration;
+ }
+
+ private static byte[] GetFieldValue(SqlDataReader reader, int index, Type type, bool isNull)
+ {
+ if (type == typeof(System.Int32)) { return CConvert.GetBytes((int)(isNull ? 0 : reader.GetInt32(index))); }
+ else if (type == typeof(bool)) { return CConvert.GetBytes((bool)(isNull ? false : reader.GetBoolean(index))); }
+ else if (type == typeof(DateTime)) { return CConvert.GetBytes((DateTime)(isNull ? DateTime.MinValue : reader.GetDateTime(index))); }
+ else if (type == typeof(float)) { return CConvert.GetBytes((float)(isNull ? 0F : reader.GetFloat(index))); }
+ else if (type == typeof(double)) { return CConvert.GetBytes((double)(isNull ? 0D : reader.GetDouble(index))); }
+ else if (type == typeof(decimal)) { return CConvert.GetBytes((decimal)(isNull ? 0M : reader.GetDecimal(index))); }
+ else if (type == typeof(System.Byte)) { return CConvert.GetBytes((byte)(isNull ? 0x00 : reader.GetByte(index))); }
+ else if (type == typeof(System.Int16)) { return CConvert.GetBytes((short)(isNull ? 0 : reader.GetInt16(index))); }
+ else
+ {
+ byte[] data = Encoding.UTF8.GetBytes(isNull ? string.Empty : reader.GetString(index));
+ byte[] endFlg = new byte[data.Length + 1];
+ Array.Copy(data, 0, endFlg, 0, data.Length);
+ return endFlg;
+ }
+
+ //object value = reader.GetValue(index);
+ //return GetValue(type, value);
+ }
+
+ private string GetSql(DataRequest request)
+ {
+ string[] fields;
+ StringBuilder sql = new StringBuilder();
+ if (request.ActionType == (int)ETableActionType.CustomSql)
+ {
+ sql.Append(request.Data);
+ }
+ else if (request.ActionType == (int)ETableActionType.RoomTypeMasterGrid)
+ {
+ sql.Append($"SELECT A.*,dbo.FN_GetRoomKind(A.Kind) KindName FROM M_RoomType A WITH(NOLOCK) {(string.IsNullOrEmpty(request.Data) ? string.Empty : $"WHERE {request.Data}")} ORDER BY A.ID");
+ }
+ else if (request.ActionType == (int)ETableActionType.BuildingMasterGrid)
+ {
+ sql.Append($"SELECT A.* FROM M_Building A WITH(NOLOCK) {(string.IsNullOrEmpty(request.Data) ? string.Empty : $"WHERE {request.Data}")} ORDER BY A.ID");
+ }
+ else if (request.ActionType == (int)ETableActionType.RoomStatusMasterGrid)
+ {
+ sql.Append($"SELECT A.* FROM M_RoomStatus A WITH(NOLOCK) {(string.IsNullOrEmpty(request.Data) ? string.Empty : $"WHERE {request.Data}")} ORDER BY A.SortID");
+ }
+ else if (request.ActionType == (int)ETableActionType.HotelMasterGrid)
+ {
+ sql.Append($"SELECT A.* FROM S_Hotel A WITH(NOLOCK) {(string.IsNullOrEmpty(request.Data) ? string.Empty : $"WHERE {request.Data}")} ORDER BY A.ID");
+ }
+ else if (request.ActionType == (int)ETableActionType.UpdateRoomStatus)
+ {
+ fields = request.Data.Split(new char[] { ',' });
+ sql.Append($"EXECUTE SetRoomStatus '{fields[0]}',{fields[1]},{fields[2]}");
+ }
+ else if (request.ActionType == (int)ETableActionType.DemoMasterGrid)
+ {
+ sql.Append($"SELECT A.* FROM M_Demo A WITH(NOLOCK) {(string.IsNullOrEmpty(request.Data) ? string.Empty : $"WHERE {request.Data}")} ORDER BY A.ID");
+ }
+ else if (request.ActionType == (int)ETableActionType.RoomViewTabMasterGrid)
+ {
+ sql.Append($"SELECT A.* FROM M_RoomViewTab A WITH(NOLOCK) {(string.IsNullOrEmpty(request.Data) ? string.Empty : $"WHERE {request.Data}")} ORDER BY A.ID");
+ }
+ else if (request.ActionType == (int)ETableActionType.RoomViewLayoutGrid)
+ {
+ sql.Append($"SELECT A.* FROM M_RoomViewLayout A WITH(NOLOCK) {(string.IsNullOrEmpty(request.Data) ? string.Empty : $"WHERE {request.Data}")} ORDER BY A.TabID,A.Row,A.Col");
+ }
+ else if (request.ActionType == (int)ETableActionType.RoomViewState)
+ {
+ fields = request.Data.Split(new char[] { ',' });
+ sql.Append($"EXECUTE GetRoomState '{fields[0]}',{fields[1]}");
+ }
+ else if (request.ActionType == (int)ETableActionType.ReportMaster)
+ {
+ sql.Append($"SELECT Name FROM S_Report WITH(NOLOCK) {(string.IsNullOrEmpty(request.Data) ? string.Empty : $"WHERE {request.Data}")} ORDER BY ID");
+ }
+ else if (request.ActionType == (int)ETableActionType.PostNoSearch)
+ {
+ sql.Append($"SELECT ZipCode,Address FROM M_Address WITH(NOLOCK) {(string.IsNullOrEmpty(request.Data) ? string.Empty : $"WHERE ZipCode LIKE '{request.Data}%'")} ORDER BY ZipCode");
+ }
+ else if (request.ActionType == (int)ETableActionType.AddressSearch)
+ {
+ sql.Append($"SELECT ZipCode,Address FROM M_Address WITH(NOLOCK) {(string.IsNullOrEmpty(request.Data) ? string.Empty : $"WHERE Address LIKE '%{request.Data}%'")} ORDER BY ZipCode");
+ }
+ else if (request.ActionType == (int)ETableActionType.HotelDate)
+ {
+ sql.Append($"SELECT TOP 1 HotelDate FROM S_Hotel WITH(NOLOCK)");
+ }
+ else if (request.ActionType == (int)ETableActionType.Sequence)
+ {
+ sql.Append($"SELECT NEXT VALUE FOR dbo.{GetSequence(CConvert.ToInt(request.Data))}");
+ }
+ else if (request.ActionType == (int)ETableActionType.TaxRate)
+ {
+ fields = request.Data.Split(new char[] { ',' });
+ sql.Append($"SELECT dbo.GetTax('{fields[0]}',{fields[1]})");
+ }
+ else if (request.ActionType == (int)ETableActionType.MasterName)
+ {
+ fields = request.Data.Split(new char[] { ',' });
+ sql.Append($"SELECT Name FROM M_{fields[0]} WITH(NOLOCK) WHERE ID = {fields[1]}");
+ }
+ else if (request.ActionType == (int)ETableActionType.RoomTypeBase)
+ {
+ sql.Append($"SELECT Name,Kind FROM M_RoomType WITH(NOLOCK) WHERE ID = {CConvert.ToInt(request.Data)}");
+ }
+ else if (request.ActionType == (int)ETableActionType.RoomTypeList)
+ {
+ sql.Append($"SELECT ID コード,Name 名称,ShortName 略称 FROM M_RoomType WITH(NOLOCK)");
+ }
+ else if (request.ActionType == (int)ETableActionType.SalesLoginList)
+ {
+ sql.Append($"SELECT ID コード,Name 名称 FROM M_Login WITH(NOLOCK) WHERE DataType = 1");
+ }
+ else if (request.ActionType == (int)ETableActionType.SalesLoginName)
+ {
+ sql.Append($"SELECT Name FROM M_Login WITH(NOLOCK) WHERE ID = {request.Data} AND DataType = 1");
+ }
+ return sql.ToString();
+ }
+
+ private string GetSequence(int type)
+ {
+ return $"Seq{((ESeqType)type).ToString()}";
+ }
+
+ private string GetDB(DataRequest request)
+{
+ if (request.ActionType == (int)ETableActionType.PostNoSearch
+ || request.ActionType == (int)ETableActionType.AddressSearch)
+ {
+ return Setting.SystemCenterDB;
+ }
+ else if (request.ActionType == (int)ETableActionType.ReportMaster)
+ {
+ return Setting.HotelCommonDB;
+ }
+ else
+ {
+ return Setting.HotelPmsDB;
+ }
+ }
+
+ public static void SetTable(GrpcTable table, SqlDataReader reader)
+ {
+ OperationLog.Instance.WriteLog($"SetTable Begin:{DateTime.Now.ToString("HH:mm:ss fff")}");
+ List<Type> fieldTypes = new List<Type>();
+ //List<string> sqlTypes = new List<string>();
+
+ #region Col
+
+ OperationLog.Instance.WriteLog("Col Begin");
+ for (int colIdx = 0; colIdx < reader.FieldCount; colIdx++)
+ {
+ //sqlTypes.Add(reader.GetDataTypeName(colIdx));
+ fieldTypes.Add(reader.GetFieldType(colIdx));
+ int fieldTypeInt = CConvert.ToTypeInt(fieldTypes[colIdx]);
+ string name = reader.GetName(colIdx);
+ //_logger.LogInformation($"{name}:{fieldTypes[colIdx].Name} = {fieldTypeInt}");
+ table.Cols.Add(new GrpcCol() { Name = name, FieldType = fieldTypeInt, PrimaryKey = false });
+ }
+
+ #endregion
+
+ #region Row
+
+ OperationLog.Instance.WriteLog("Row Begin");
+ while (reader.Read())
+ {
+ int fieldCount = reader.FieldCount;
+ bool[] isNullCache = new bool[fieldCount];
+ for (int i = 0; i < fieldCount; i++)
+ {
+ isNullCache[i] = reader.IsDBNull(i);
+ }
+
+ using (MemoryStream stream = new MemoryStream())
+ {
+ for (int i = 0; i < fieldCount; i++)
+ {
+ stream.Write(GetFieldValue(reader, i, fieldTypes[i], isNullCache[i]));
+ }
+
+ stream.Seek(0, SeekOrigin.Begin);
+ table.Rows.Add(new GrpcRow() { Data = ByteString.FromStream(stream) });
+ }
+ }
+ OperationLog.Instance.WriteLog($"Row End⇒{table.Rows.Count}件");
+
+ #endregion
+
+ OperationLog.Instance.WriteLog($"SetTable End:{DateTime.Now.ToString("HH:mm:ss fff")}");
+ }
+
+
+ private GrpcTable Get(DataRequest request)
+ {
+ GrpcTable table = new GrpcTable() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog(request.ToString());
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(GetDB(request)))
+ {
+ using (SqlConnection dbConnect = msSqlNet.Open())
+ {
+ string sql = GetSql(request);
+ using (SqlCommand command = new SqlCommand(sql, dbConnect))
+ {
+ OperationLog.Instance.WriteLog(sql);
+ command.CommandTimeout = 60000 * 100;
+ using (SqlDataReader reader = command.ExecuteReader(CommandBehavior.Default))
+ {
+ //エラーまだ対応していない
+ if (reader == null)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ while (true)
+ {
+ SetTable(table, reader);
+ if (!reader.NextResult()) { break; }
+ }
+ }
+ reader.Close();
+ }
+ }
+ }
+ }
+
+ if(table.ErrNo == 0)
+ {
+ table.ErrData = ""; //総行数を返す
+ }
+ return table;
+ }
+
+ public override Task<GrpcTable> GetData(DataRequest request, ServerCallContext context)
+ {
+ OperationLog.Instance.WriteLog("GetData Start");
+ return Task.FromResult(Get(request));
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <param name="requestStream"></param>
+ /// <param name="responseStream"></param>
+ /// <param name="context"></param>
+ /// <returns></returns>
+ public async override Task GetDataStream(IAsyncStreamReader<DataRequest> requestStream, IServerStreamWriter<GrpcTable> responseStream, ServerCallContext context)
+ {
+ DataRequest request = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ request = message;
+ break;
+ }
+
+ //データ送信
+ GrpcTable table = Get(request);
+ await responseStream.WriteAsync(table);
+ }
+
+ /// <summary>
+ ///
+ /// </summary>
+ /// <param name="requestStream"></param>
+ /// <param name="responseStream"></param>
+ /// <param name="context"></param>
+ /// <returns></returns>
+ public override Task SetData(IAsyncStreamReader<GrpcTable> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ return base.SetData(requestStream, responseStream, context);
+ }
+ }
+}
diff --git a/HotelPms.GrpcService/Services/HotelService.cs b/HotelPms.GrpcService/Services/HotelService.cs
new file mode 100644
index 0000000..5e655b2
--- /dev/null
+++ b/HotelPms.GrpcService/Services/HotelService.cs
@@ -0,0 +1,369 @@
+using HotelPms.Data;
+using HotelPms.Data.Common.Pagination;
+using HotelPms.Data.Master;
+using HotelPms.GrpcService.Util;
+using HotelPms.Share.Data;
+using HotelPms.Share.IO;
+using HotelPms.Share.Util;
+using Google.Protobuf;
+using Grpc.Core;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
+using System.Data;
+using System.Data.SqlClient;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Tasks;
+
+namespace HotelPms.GrpcService
+{
+ /// <summary>
+ /// ■攻略
+ /// 1.Hotel.proto(message:Hotel、HotelTable;Service:HotelCore) ⇒ projectファイルのInclude
+ /// 2.Hotel.cs(両方)
+ /// 3.HotelTable.cs(両方)
+ /// 4.HotelService.cs(サーバー側) ⇒ StartupでMapGrpcServiceの処理が必要
+ /// 5.HotelAccess.cs(クライアント側)
+ /// </summary>
+ public class HotelService : HotelCore.HotelCoreBase
+ {
+ #region ★★★★★ Declartions ★★★★★
+
+ private static string TableName = "S_Hotel";
+ private readonly ILogger<HotelService> _logger;
+ private IConfiguration m_Configuration;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public HotelService(ILogger<HotelService> logger, IConfiguration configuration)
+ {
+ _logger = logger;
+ m_Configuration = configuration;
+ }
+
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+
+ private string GetSql(DataRequest request)
+ {
+ StringBuilder sql = new StringBuilder();
+ if (request.ActionType == 0)
+ {
+ sql.Append($"SELECT * FROM {TableName} {(string.IsNullOrEmpty(request.Data) ? string.Empty : $"WHERE {request.Data}")}");
+ }
+ else if (request.ActionType == 1 || request.ActionType == 2)
+ {
+ PagingRequest pagingRequest = JsonSerializer.Deserialize<PagingRequest>(request.Data);
+ sql.Append($"EXECUTE Pagination {pagingRequest.PageNumber},{pagingRequest.PageSize},'{pagingRequest.Table}','{pagingRequest.Field}','{pagingRequest.OrderBy}','{CConvert.FromBase64(pagingRequest.Filter)}'");
+ }
+ return sql.ToString();
+ }
+
+ private DataTable GetDataTable(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+ DataTable table = null;
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 2)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ table = set.Tables[0];
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+
+ private HotelTable Get(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+
+ HotelTable table = new HotelTable() { ErrNo = 0, ErrData = string.Empty, Name = nameof(HotelTable) };
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 0)
+ {
+ using (SqlConnection dbConnect = msSqlNet.Open())
+ {
+ using (SqlCommand command = new SqlCommand(sql, dbConnect))
+ {
+ OperationLog.Instance.WriteLog($"データ読込:{sql}");
+ command.CommandTimeout = 60000 * 100;
+ using (SqlDataReader reader = command.ExecuteReader(CommandBehavior.Default))
+ {
+ //エラーまだ対応していない
+ if (reader == null)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ while (reader.Read())
+ {
+ Hotel item = new Hotel();
+ item.ConvertReader(reader);
+ table.Rows.Add(item);
+ }
+ }
+ reader.Close();
+ }
+ }
+ }
+ }
+ else if (request.ActionType == 1)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ foreach (DataRow row in set.Tables[0].Rows)
+ {
+ Hotel item = new Hotel();
+ item.ConvertDataRow(row);
+ table.Rows.Add(item);
+ }
+
+ table.ErrData = JsonSerializer.Serialize(new PagingRespone()
+ {
+ MaxPage = CConvert.ToInt(set.Tables[1].Rows[0]["MaxPage"]),
+ TotalRow = CConvert.ToInt(set.Tables[1].Rows[0]["TotalRow"])
+ });
+ }
+ else
+ {
+ table.ErrNo = -1;
+ table.ErrData = set.Tables[0].Rows[0]["Descript"].ToString();
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+ private DataResult Set(HotelTable table)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{table.Rows.Count}");
+
+ StringBuilder sql = new StringBuilder();
+ if (table.BeforeUpdate.Length > 0) { sql.AppendLine(table.BeforeUpdate.ToStringUtf8()); }
+
+ foreach (Hotel item in table.Rows)
+ {
+ sql.AppendLine(table.UpdateType == 2 ? item.UpdateSql() : item.AddSql());
+ }
+
+ if (table.AfterUpdate.Length > 0) { sql.AppendLine(table.AfterUpdate.ToStringUtf8()); }
+
+ string sqlCmd = sql.ToString();
+ OperationLog.Instance.WriteLog($"Sql生成:{sqlCmd}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (!msSqlNet.ExecuteNonQueryWithTran(sqlCmd))
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private DataResult AddOrUpdate(bool add, Hotel item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = add ? item.AddSql() : item.UpdateSql();
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private async Task AddOrUpdate(bool add, IAsyncStreamReader<Hotel> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ Hotel item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = AddOrUpdate(add, item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ private DataResult Delete(SqlWhere item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = $"DELETE FROM {TableName} WHERE {item.Data.ToStringUtf8()}";
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+
+ public async override Task OutputStream(DataRequest request, IServerStreamWriter<FileGrpcData> responseStream, ServerCallContext context)
+ {
+ try
+ {
+ using (DataTable data = GetDataTable(request))
+ {
+ byte[] bytes = Excel.Export(data);
+ FileGrpcData fileGrpcData = new FileGrpcData
+ {
+ Block = 1,
+ FileName = "Data",
+ Content = ByteString.CopyFrom(bytes)
+ };
+ await responseStream.WriteAsync(fileGrpcData);
+ }
+ }
+ catch { }
+ }
+
+ /// <summary>
+ /// 同期実行
+ /// </summary>
+ /// <param name="request"></param>
+ /// <param name="context"></param>
+ /// <returns></returns>
+ public override Task<HotelTable> GetData(DataRequest request, ServerCallContext context)
+ {
+ return Task.FromResult(Get(request));
+ }
+
+ public async override Task GetDataStream(IAsyncStreamReader<DataRequest> requestStream, IServerStreamWriter<HotelTable> responseStream, ServerCallContext context)
+ {
+ DataRequest request = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ request = message;
+ break;
+ }
+ HotelTable table = Get(request);
+ await responseStream.WriteAsync(table); //データ送信
+ }
+
+ public override Task<DataResult> SetData(HotelTable request, ServerCallContext context)
+ {
+ return Task.FromResult(Set(request));
+ }
+
+ public async override Task SetDataStream(IAsyncStreamReader<HotelTable> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ HotelTable table = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ table = message;
+ break;
+ }
+
+ DataResult result = Set(table);
+ //データ送信
+ await responseStream.WriteAsync(result);
+ }
+
+ public override Task<DataResult> Add(Hotel request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(true, request));
+ }
+
+ public async override Task AddStream(IAsyncStreamReader<Hotel> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(true, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Update(Hotel request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(false, request));
+ }
+
+ public async override Task UpdateStream(IAsyncStreamReader<Hotel> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(false, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Remove(SqlWhere request, ServerCallContext context)
+ {
+ return Task.FromResult(Delete(request));
+ }
+
+ public async override Task RemoveStream(IAsyncStreamReader<SqlWhere> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ SqlWhere item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = Delete(item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ #endregion
+ }
+}
diff --git a/HotelPms.GrpcService/Services/ItemService.cs b/HotelPms.GrpcService/Services/ItemService.cs
new file mode 100644
index 0000000..cdfe4c6
--- /dev/null
+++ b/HotelPms.GrpcService/Services/ItemService.cs
@@ -0,0 +1,373 @@
+using HotelPms.Data;
+using HotelPms.Data.Common.Pagination;
+using HotelPms.Data.Master;
+using HotelPms.GrpcService.Util;
+using HotelPms.Share.Data;
+using HotelPms.Share.IO;
+using HotelPms.Share.Util;
+using Google.Protobuf;
+using Grpc.Core;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
+using System.Data;
+using System.Data.SqlClient;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Tasks;
+
+namespace HotelPms.GrpcService;
+
+/// <summary>
+/// ■攻略
+/// 1.Item.proto(message:Item、ItemTable;Service:ItemCore) ⇒ projectファイルのInclude
+/// 2.Item.cs(両方)
+/// 3.ItemTable.cs(両方)
+/// 4.ItemService.cs(サーバー側) ⇒ StartupでMapGrpcServiceの処理が必要
+/// 5.ItemAccess.cs(クライアント側)
+/// </summary>
+public class ItemService : ItemCore.ItemCoreBase
+{
+ #region ★★★★★ Declartions ★★★★★
+
+ private static string TableName = "M_Item";
+ private readonly ILogger<ItemService> _logger;
+ private IConfiguration m_Configuration;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public ItemService(ILogger<ItemService> logger, IConfiguration configuration)
+ {
+ _logger = logger;
+ m_Configuration = configuration;
+ }
+
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+
+ private string GetSql(DataRequest request)
+ {
+ StringBuilder sql = new StringBuilder();
+ if (request.ActionType == 0)
+ {
+ sql.Append($"SELECT * FROM {TableName} {(string.IsNullOrEmpty(request.Data) ? string.Empty : $"WHERE {request.Data}")}");
+ }
+ else if (request.ActionType == 1 || request.ActionType == 2)
+ {
+ PagingRequest pagingRequest = JsonSerializer.Deserialize<PagingRequest>(request.Data);
+ sql.Append($"EXECUTE Pagination {pagingRequest.PageNumber},{pagingRequest.PageSize},'{pagingRequest.Table}','{pagingRequest.Field}','{pagingRequest.OrderBy}','{CConvert.FromBase64(pagingRequest.Filter)}'");
+ }
+ else if (request.ActionType == 3)
+ {
+ string[] para = request.Data.Split(',');
+ sql.Append($"EXECUTE GetBaseItem {para[0]},{para[1]},'{para[2]}'");
+ }
+ return sql.ToString();
+ }
+
+ private DataTable GetDataTable(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+ DataTable table = null;
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 2)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ table = set.Tables[0];
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+
+ private ItemTable Get(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+
+ ItemTable table = new ItemTable() { ErrNo = 0, ErrData = string.Empty, Name = nameof(ItemTable) };
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 0 || request.ActionType == 3)
+ {
+ using (SqlConnection dbConnect = msSqlNet.Open())
+ {
+ using (SqlCommand command = new SqlCommand(sql, dbConnect))
+ {
+ OperationLog.Instance.WriteLog($"データ読込:{sql}");
+ command.CommandTimeout = 60000 * 100;
+ using (SqlDataReader reader = command.ExecuteReader(CommandBehavior.Default))
+ {
+ //エラーまだ対応していない
+ if (reader == null)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ while (reader.Read())
+ {
+ Item item = new Item();
+ item.ConvertReader(reader);
+ table.Rows.Add(item);
+ }
+ }
+ reader.Close();
+ }
+ }
+ }
+ }
+ else if (request.ActionType == 1 )
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ foreach (DataRow row in set.Tables[0].Rows)
+ {
+ Item item = new Item();
+ item.ConvertDataRow(row);
+ table.Rows.Add(item);
+ }
+
+ table.Tag = JsonSerializer.Serialize(new PagingRespone()
+ {
+ MaxPage = CConvert.ToInt(set.Tables[1].Rows[0]["MaxPage"]),
+ TotalRow = CConvert.ToInt(set.Tables[1].Rows[0]["TotalRow"])
+ });
+ }
+ else
+ {
+ table.ErrNo = -1;
+ table.ErrData = set.Tables[0].Rows[0]["Descript"].ToString();
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+ private DataResult Set(ItemTable table)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{table.Rows.Count}");
+
+ StringBuilder sql = new StringBuilder();
+ if (table.BeforeUpdate.Length > 0) { sql.AppendLine(table.BeforeUpdate.ToStringUtf8()); }
+
+ foreach (Item item in table.Rows)
+ {
+ sql.AppendLine(table.UpdateType == 2 ? item.UpdateSql() : item.AddSql());
+ }
+
+ if (table.AfterUpdate.Length > 0) { sql.AppendLine(table.AfterUpdate.ToStringUtf8()); }
+
+ string sqlCmd = sql.ToString();
+ OperationLog.Instance.WriteLog($"Sql生成:{sqlCmd}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (!msSqlNet.ExecuteNonQueryWithTran(sqlCmd))
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private DataResult AddOrUpdate(bool add, Item item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = add ? item.AddSql() : item.UpdateSql();
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private async Task AddOrUpdate(bool add, IAsyncStreamReader<Item> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ Item item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = AddOrUpdate(add, item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ private DataResult Delete(SqlWhere item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = $"DELETE FROM {TableName} WHERE {item.Data.ToStringUtf8()}";
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+
+ public async override Task OutputStream(DataRequest request, IServerStreamWriter<FileGrpcData> responseStream, ServerCallContext context)
+ {
+ try
+ {
+ using (DataTable data = GetDataTable(request))
+ {
+ byte[] bytes = Excel.Export(data);
+ FileGrpcData fileGrpcData = new FileGrpcData
+ {
+ Block = 1,
+ FileName = "Data",
+ Content = ByteString.CopyFrom(bytes)
+ };
+ await responseStream.WriteAsync(fileGrpcData);
+ }
+ }
+ catch { }
+ }
+
+ /// <summary>
+ /// 同期実行
+ /// </summary>
+ /// <param name="request"></param>
+ /// <param name="context"></param>
+ /// <returns></returns>
+ public override Task<ItemTable> GetData(DataRequest request, ServerCallContext context)
+ {
+ return Task.FromResult(Get(request));
+ }
+
+ public async override Task GetDataStream(IAsyncStreamReader<DataRequest> requestStream, IServerStreamWriter<ItemTable> responseStream, ServerCallContext context)
+ {
+ DataRequest request = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ request = message;
+ break;
+ }
+ ItemTable table = Get(request);
+ await responseStream.WriteAsync(table); //データ送信
+ }
+
+ public override Task<DataResult> SetData(ItemTable request, ServerCallContext context)
+ {
+ return Task.FromResult(Set(request));
+ }
+
+ public async override Task SetDataStream(IAsyncStreamReader<ItemTable> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ ItemTable table = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ table = message;
+ break;
+ }
+
+ DataResult result = Set(table);
+ //データ送信
+ await responseStream.WriteAsync(result);
+ }
+
+ public override Task<DataResult> Add(Item request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(true, request));
+ }
+
+ public async override Task AddStream(IAsyncStreamReader<Item> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(true, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Update(Item request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(false, request));
+ }
+
+ public async override Task UpdateStream(IAsyncStreamReader<Item> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(false, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Remove(SqlWhere request, ServerCallContext context)
+ {
+ return Task.FromResult(Delete(request));
+ }
+
+ public async override Task RemoveStream(IAsyncStreamReader<SqlWhere> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ SqlWhere item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = Delete(item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ #endregion
+}
diff --git a/HotelPms.GrpcService/Services/OptionService.cs b/HotelPms.GrpcService/Services/OptionService.cs
new file mode 100644
index 0000000..a7f3998
--- /dev/null
+++ b/HotelPms.GrpcService/Services/OptionService.cs
@@ -0,0 +1,369 @@
+using HotelPms.Data;
+using HotelPms.Data.Common.Pagination;
+using HotelPms.Data.Master;
+using HotelPms.GrpcService.Util;
+using HotelPms.Share.Data;
+using HotelPms.Share.IO;
+using HotelPms.Share.Util;
+using Google.Protobuf;
+using Grpc.Core;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
+using System.Data;
+using System.Data.SqlClient;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Tasks;
+
+namespace HotelPms.GrpcService
+{
+ /// <summary>
+ /// ■攻略
+ /// 1.Option.proto(message:Option、OptionTable;Service:OptionCore) ⇒ projectファイルのInclude
+ /// 2.Option.cs(両方)
+ /// 3.OptionTable.cs(両方)
+ /// 4.OptionService.cs(サーバー側) ⇒ StartupでMapGrpcServiceの処理が必要
+ /// 5.OptionAccess.cs(クライアント側)
+ /// </summary>
+ public class OptionService : OptionCore.OptionCoreBase
+ {
+ #region ★★★★★ Declartions ★★★★★
+
+ private static string TableName = "S_Option";
+ private readonly ILogger<OptionService> _logger;
+ private IConfiguration m_Configuration;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public OptionService(ILogger<OptionService> logger, IConfiguration configuration)
+ {
+ _logger = logger;
+ m_Configuration = configuration;
+ }
+
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+
+ private string GetSql(DataRequest request)
+ {
+ StringBuilder sql = new StringBuilder();
+ if (request.ActionType == 0)
+ {
+ sql.Append($"SELECT * FROM {TableName} {(string.IsNullOrEmpty(request.Data) ? string.Empty : $"WHERE {request.Data}")}");
+ }
+ else if (request.ActionType == 1 || request.ActionType == 2)
+ {
+ PagingRequest pagingRequest = JsonSerializer.Deserialize<PagingRequest>(request.Data);
+ sql.Append($"EXECUTE Pagination {pagingRequest.PageNumber},{pagingRequest.PageSize},'{pagingRequest.Table}','{pagingRequest.Field}','{pagingRequest.OrderBy}','{CConvert.FromBase64(pagingRequest.Filter)}'");
+ }
+ return sql.ToString();
+ }
+
+ private DataTable GetDataTable(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+ DataTable table = null;
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 2)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ table = set.Tables[0];
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+
+ private OptionTable Get(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+
+ OptionTable table = new OptionTable() { ErrNo = 0, ErrData = string.Empty, Name = nameof(OptionTable) };
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 0)
+ {
+ using (SqlConnection dbConnect = msSqlNet.Open())
+ {
+ using (SqlCommand command = new SqlCommand(sql, dbConnect))
+ {
+ OperationLog.Instance.WriteLog($"データ読込:{sql}");
+ command.CommandTimeout = 60000 * 100;
+ using (SqlDataReader reader = command.ExecuteReader(CommandBehavior.Default))
+ {
+ //エラーまだ対応していない
+ if (reader == null)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ while (reader.Read())
+ {
+ Option item = new Option();
+ item.ConvertReader(reader);
+ table.Rows.Add(item);
+ }
+ }
+ reader.Close();
+ }
+ }
+ }
+ }
+ else if (request.ActionType == 1)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ foreach (DataRow row in set.Tables[0].Rows)
+ {
+ Option item = new Option();
+ item.ConvertDataRow(row);
+ table.Rows.Add(item);
+ }
+
+ table.ErrData = JsonSerializer.Serialize(new PagingRespone()
+ {
+ MaxPage = CConvert.ToInt(set.Tables[1].Rows[0]["MaxPage"]),
+ TotalRow = CConvert.ToInt(set.Tables[1].Rows[0]["TotalRow"])
+ });
+ }
+ else
+ {
+ table.ErrNo = -1;
+ table.ErrData = set.Tables[0].Rows[0]["Descript"].ToString();
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+ private DataResult Set(OptionTable table)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{table.Rows.Count}");
+
+ StringBuilder sql = new StringBuilder();
+ if (table.BeforeUpdate.Length > 0) { sql.AppendLine(table.BeforeUpdate.ToStringUtf8()); }
+
+ foreach (Option item in table.Rows)
+ {
+ sql.AppendLine(table.UpdateType == 2 ? item.UpdateSql() : item.AddSql());
+ }
+
+ if (table.AfterUpdate.Length > 0) { sql.AppendLine(table.AfterUpdate.ToStringUtf8()); }
+
+ string sqlCmd = sql.ToString();
+ OperationLog.Instance.WriteLog($"Sql生成:{sqlCmd}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (!msSqlNet.ExecuteNonQueryWithTran(sqlCmd))
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private DataResult AddOrUpdate(bool add, Option item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = add ? item.AddSql() : item.UpdateSql();
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private async Task AddOrUpdate(bool add, IAsyncStreamReader<Option> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ Option item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = AddOrUpdate(add, item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ private DataResult Delete(SqlWhere item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = $"DELETE FROM {TableName} WHERE {item.Data.ToStringUtf8()}";
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+
+ public async override Task OutputStream(DataRequest request, IServerStreamWriter<FileGrpcData> responseStream, ServerCallContext context)
+ {
+ try
+ {
+ using (DataTable data = GetDataTable(request))
+ {
+ byte[] bytes = Excel.Export(data);
+ FileGrpcData fileGrpcData = new FileGrpcData
+ {
+ Block = 1,
+ FileName = "Data",
+ Content = ByteString.CopyFrom(bytes)
+ };
+ await responseStream.WriteAsync(fileGrpcData);
+ }
+ }
+ catch { }
+ }
+
+ /// <summary>
+ /// 同期実行
+ /// </summary>
+ /// <param name="request"></param>
+ /// <param name="context"></param>
+ /// <returns></returns>
+ public override Task<OptionTable> GetData(DataRequest request, ServerCallContext context)
+ {
+ return Task.FromResult(Get(request));
+ }
+
+ public async override Task GetDataStream(IAsyncStreamReader<DataRequest> requestStream, IServerStreamWriter<OptionTable> responseStream, ServerCallContext context)
+ {
+ DataRequest request = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ request = message;
+ break;
+ }
+ OptionTable table = Get(request);
+ await responseStream.WriteAsync(table); //データ送信
+ }
+
+ public override Task<DataResult> SetData(OptionTable request, ServerCallContext context)
+ {
+ return Task.FromResult(Set(request));
+ }
+
+ public async override Task SetDataStream(IAsyncStreamReader<OptionTable> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ OptionTable table = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ table = message;
+ break;
+ }
+
+ DataResult result = Set(table);
+ //データ送信
+ await responseStream.WriteAsync(result);
+ }
+
+ public override Task<DataResult> Add(Option request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(true, request));
+ }
+
+ public async override Task AddStream(IAsyncStreamReader<Option> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(true, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Update(Option request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(false, request));
+ }
+
+ public async override Task UpdateStream(IAsyncStreamReader<Option> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(false, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Remove(SqlWhere request, ServerCallContext context)
+ {
+ return Task.FromResult(Delete(request));
+ }
+
+ public async override Task RemoveStream(IAsyncStreamReader<SqlWhere> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ SqlWhere item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = Delete(item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ #endregion
+ }
+}
diff --git a/HotelPms.GrpcService/Services/OutputItemService.cs b/HotelPms.GrpcService/Services/OutputItemService.cs
new file mode 100644
index 0000000..22089b4
--- /dev/null
+++ b/HotelPms.GrpcService/Services/OutputItemService.cs
@@ -0,0 +1,369 @@
+using HotelPms.Data;
+using HotelPms.Data.Common.Pagination;
+using HotelPms.Data.Master;
+using HotelPms.GrpcService.Util;
+using HotelPms.Share.Data;
+using HotelPms.Share.IO;
+using HotelPms.Share.Util;
+using Google.Protobuf;
+using Grpc.Core;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
+using System.Data;
+using System.Data.SqlClient;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Tasks;
+
+namespace HotelPms.GrpcService
+{
+ /// <summary>
+ /// ■攻略
+ /// 1.OutputItem.proto(message:OutputItem、OutputItemTable;Service:OutputItemCore) ⇒ projectファイルのInclude
+ /// 2.OutputItem.cs(両方)
+ /// 3.OutputItemTable.cs(両方)
+ /// 4.OutputItemService.cs(サーバー側) ⇒ StartupでMapGrpcServiceの処理が必要
+ /// 5.OutputItemAccess.cs(クライアント側)
+ /// </summary>
+ public class OutputItemService : OutputItemCore.OutputItemCoreBase
+ {
+ #region ★★★★★ Declartions ★★★★★
+
+ private static string TableName = "M_OutputItem";
+ private readonly ILogger<OutputItemService> _logger;
+ private IConfiguration m_Configuration;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public OutputItemService(ILogger<OutputItemService> logger, IConfiguration configuration)
+ {
+ _logger = logger;
+ m_Configuration = configuration;
+ }
+
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+
+ private string GetSql(DataRequest request)
+ {
+ StringBuilder sql = new StringBuilder();
+ if (request.ActionType == 0)
+ {
+ sql.Append($"SELECT * FROM {TableName} {(string.IsNullOrEmpty(request.Data) ? string.Empty : $"WHERE {request.Data}")}");
+ }
+ else if (request.ActionType == 1 || request.ActionType == 2)
+ {
+ PagingRequest pagingRequest = JsonSerializer.Deserialize<PagingRequest>(request.Data);
+ sql.Append($"EXECUTE Pagination {pagingRequest.PageNumber},{pagingRequest.PageSize},'{pagingRequest.Table}','{pagingRequest.Field}','{pagingRequest.OrderBy}','{CConvert.FromBase64(pagingRequest.Filter)}'");
+ }
+ return sql.ToString();
+ }
+
+ private DataTable GetDataTable(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+ DataTable table = null;
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 2)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ table = set.Tables[0];
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+
+ private OutputItemTable Get(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+
+ OutputItemTable table = new OutputItemTable() { ErrNo = 0, ErrData = string.Empty, Name = nameof(OutputItemTable) };
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 0)
+ {
+ using (SqlConnection dbConnect = msSqlNet.Open())
+ {
+ using (SqlCommand command = new SqlCommand(sql, dbConnect))
+ {
+ OperationLog.Instance.WriteLog($"データ読込:{sql}");
+ command.CommandTimeout = 60000 * 100;
+ using (SqlDataReader reader = command.ExecuteReader(CommandBehavior.Default))
+ {
+ //エラーまだ対応していない
+ if (reader == null)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ while (reader.Read())
+ {
+ OutputItem item = new OutputItem();
+ item.ConvertReader(reader);
+ table.Rows.Add(item);
+ }
+ }
+ reader.Close();
+ }
+ }
+ }
+ }
+ else if (request.ActionType == 1)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ foreach (DataRow row in set.Tables[0].Rows)
+ {
+ OutputItem item = new OutputItem();
+ item.ConvertDataRow(row);
+ table.Rows.Add(item);
+ }
+
+ table.ErrData = JsonSerializer.Serialize(new PagingRespone()
+ {
+ MaxPage = CConvert.ToInt(set.Tables[1].Rows[0]["MaxPage"]),
+ TotalRow = CConvert.ToInt(set.Tables[1].Rows[0]["TotalRow"])
+ });
+ }
+ else
+ {
+ table.ErrNo = -1;
+ table.ErrData = set.Tables[0].Rows[0]["Descript"].ToString();
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+ private DataResult Set(OutputItemTable table)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{table.Rows.Count}");
+
+ StringBuilder sql = new StringBuilder();
+ if (table.BeforeUpdate.Length > 0) { sql.AppendLine(table.BeforeUpdate.ToStringUtf8()); }
+
+ foreach (OutputItem item in table.Rows)
+ {
+ sql.AppendLine(table.UpdateType == 2 ? item.UpdateSql() : item.AddSql());
+ }
+
+ if (table.AfterUpdate.Length > 0) { sql.AppendLine(table.AfterUpdate.ToStringUtf8()); }
+
+ string sqlCmd = sql.ToString();
+ OperationLog.Instance.WriteLog($"Sql生成:{sqlCmd}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (!msSqlNet.ExecuteNonQueryWithTran(sqlCmd))
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private DataResult AddOrUpdate(bool add, OutputItem item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = add ? item.AddSql() : item.UpdateSql();
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private async Task AddOrUpdate(bool add, IAsyncStreamReader<OutputItem> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ OutputItem item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = AddOrUpdate(add, item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ private DataResult Delete(SqlWhere item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = $"DELETE FROM {TableName} WHERE {item.Data.ToStringUtf8()}";
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+
+ public async override Task OutputStream(DataRequest request, IServerStreamWriter<FileGrpcData> responseStream, ServerCallContext context)
+ {
+ try
+ {
+ using (DataTable data = GetDataTable(request))
+ {
+ byte[] bytes = Excel.Export(data);
+ FileGrpcData fileGrpcData = new FileGrpcData
+ {
+ Block = 1,
+ FileName = "Data",
+ Content = ByteString.CopyFrom(bytes)
+ };
+ await responseStream.WriteAsync(fileGrpcData);
+ }
+ }
+ catch { }
+ }
+
+ /// <summary>
+ /// 同期実行
+ /// </summary>
+ /// <param name="request"></param>
+ /// <param name="context"></param>
+ /// <returns></returns>
+ public override Task<OutputItemTable> GetData(DataRequest request, ServerCallContext context)
+ {
+ return Task.FromResult(Get(request));
+ }
+
+ public async override Task GetDataStream(IAsyncStreamReader<DataRequest> requestStream, IServerStreamWriter<OutputItemTable> responseStream, ServerCallContext context)
+ {
+ DataRequest request = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ request = message;
+ break;
+ }
+ OutputItemTable table = Get(request);
+ await responseStream.WriteAsync(table); //データ送信
+ }
+
+ public override Task<DataResult> SetData(OutputItemTable request, ServerCallContext context)
+ {
+ return Task.FromResult(Set(request));
+ }
+
+ public async override Task SetDataStream(IAsyncStreamReader<OutputItemTable> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ OutputItemTable table = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ table = message;
+ break;
+ }
+
+ DataResult result = Set(table);
+ //データ送信
+ await responseStream.WriteAsync(result);
+ }
+
+ public override Task<DataResult> Add(OutputItem request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(true, request));
+ }
+
+ public async override Task AddStream(IAsyncStreamReader<OutputItem> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(true, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Update(OutputItem request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(false, request));
+ }
+
+ public async override Task UpdateStream(IAsyncStreamReader<OutputItem> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(false, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Remove(SqlWhere request, ServerCallContext context)
+ {
+ return Task.FromResult(Delete(request));
+ }
+
+ public async override Task RemoveStream(IAsyncStreamReader<SqlWhere> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ SqlWhere item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = Delete(item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ #endregion
+ }
+}
diff --git a/HotelPms.GrpcService/Services/OutputService.cs b/HotelPms.GrpcService/Services/OutputService.cs
new file mode 100644
index 0000000..62f0054
--- /dev/null
+++ b/HotelPms.GrpcService/Services/OutputService.cs
@@ -0,0 +1,476 @@
+using HotelPms.Data;
+using HotelPms.Data.Common.Pagination;
+using HotelPms.Data.Master;
+using HotelPms.GrpcService.Util;
+using HotelPms.Share.Data;
+using HotelPms.Share.IO;
+using HotelPms.Share.Util;
+using Google.Protobuf;
+using Grpc.Core;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
+using System.Data;
+using System.Data.SqlClient;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Tasks;
+
+namespace HotelPms.GrpcService
+{
+ /// <summary>
+ /// ■攻略
+ /// 1.Output.proto(message:Output、OutputTable;Service:OutputCore) ⇒ projectファイルのInclude
+ /// 2.Output.cs(両方)
+ /// 3.OutputTable.cs(両方)
+ /// 4.OutputService.cs(サーバー側) ⇒ StartupでMapGrpcServiceの処理が必要
+ /// 5.OutputAccess.cs(クライアント側)
+ /// </summary>
+ public class OutputService : OutputCore.OutputCoreBase
+ {
+ #region ★★★★★ Declartions ★★★★★
+
+ public enum EActionType : int
+ {
+ Master = 0,
+ Page = 1,
+ Xlsx = 2,
+ Xls = 3,
+ Pdf = 4,
+ Csv = 5,
+ Json = 6,
+ Xml = 7,
+ DefOutput = 8,
+ }
+
+ private static string TableName = "M_Output";
+ private readonly ILogger<OutputService> _logger;
+ private IConfiguration m_Configuration;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public OutputService(ILogger<OutputService> logger, IConfiguration configuration)
+ {
+ _logger = logger;
+ m_Configuration = configuration;
+ }
+
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+
+ private string GetSql(DataRequest request)
+ {
+ StringBuilder sql = new StringBuilder();
+ if (request.ActionType == (int)EActionType.Master)
+ {
+ sql.Append($"SELECT * FROM {TableName} {(string.IsNullOrEmpty(request.Data) ? string.Empty : $"WHERE {request.Data}")}");
+ }
+ else if (request.ActionType >= (int)EActionType.Page && request.ActionType <= (int)EActionType.Xml)
+ {
+ PagingRequest pagingRequest = JsonSerializer.Deserialize<PagingRequest>(request.Data);
+ sql.Append($"EXEC Pagination {pagingRequest.PageNumber},{pagingRequest.PageSize},'{pagingRequest.Table}','{pagingRequest.Field}','{pagingRequest.OrderBy}','{CConvert.FromBase64(pagingRequest.Filter)}'");
+ }
+ else if (request.ActionType == (int)EActionType.DefOutput)
+ {
+ sql.Append($"EXEC GetDefaultOuput {request.Data}");
+ }
+ return sql.ToString();
+ }
+
+ private DataTable GetDataTable(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+ DataTable table = null;
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ // 全部データの出力(頁変更なし)
+ if (request.ActionType >= (int)EActionType.Xlsx && request.ActionType <= (int)EActionType.Xml)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ table = set.Tables[0];
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+ /// <summary>
+ /// マスタデータのセット
+ /// </summary>
+ /// <param name="msSqlNet"></param>
+ /// <param name="sql"></param>
+ /// <param name="table"></param>
+ private void SetMaster(MsSqlNet msSqlNet, string sql, OutputTable table)
+ {
+ using (SqlConnection dbConnect = msSqlNet.Open())
+ {
+ using (SqlCommand command = new SqlCommand(sql, dbConnect))
+ {
+ OperationLog.Instance.WriteLog($"データ読込:{sql}");
+ command.CommandTimeout = 60000 * 100;
+ using (SqlDataReader reader = command.ExecuteReader(CommandBehavior.Default))
+ {
+ //エラーまだ対応していない
+ if (reader == null)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ while (reader.Read())
+ {
+ Output item = new Output();
+ item.ConvertReader(reader);
+ table.Rows.Add(item);
+ }
+ }
+ reader.Close();
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// 頁毎データのセット
+ /// </summary>
+ /// <param name="msSqlNet"></param>
+ /// <param name="sql"></param>
+ /// <param name="table"></param>
+ private void SetPage(MsSqlNet msSqlNet, string sql, OutputTable table)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ foreach (DataRow row in set.Tables[0].Rows)
+ {
+ Output item = new Output();
+ item.ConvertDataRow(row);
+ table.Rows.Add(item);
+ }
+
+ table.Tag = JsonSerializer.Serialize(new PagingRespone()
+ {
+ MaxPage = CConvert.ToInt(set.Tables[1].Rows[0]["MaxPage"]),
+ TotalRow = CConvert.ToInt(set.Tables[1].Rows[0]["TotalRow"])
+ });
+ }
+ else
+ {
+ table.ErrNo = -1;
+ table.ErrData = set.Tables[0].Rows[0]["Descript"].ToString();
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// ディフォルト列設定をセット
+ /// </summary>
+ /// <param name="msSqlNet"></param>
+ /// <param name="sql"></param>
+ /// <param name="table"></param>
+ private void SetDefOutput(MsSqlNet msSqlNet, string sql, OutputTable table)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ Output output = new Output();
+ output.ConvertDataRow(set.Tables[0].Rows[0]);
+ table.Rows.Add(output);
+
+ foreach (DataRow row in set.Tables[1].Rows)
+ {
+ OutputItem item = new OutputItem();
+ item.ConvertDataRow(row);
+ output.Items.Add(item);
+ }
+
+ // 表示名称 ⇒ フィールド名のマッピング
+ // ※存在しなかったら、表示名称 = フィールド名ということ
+ foreach (DataRow row in set.Tables[2].Rows)
+ {
+ output.FieldMap.Add(row["Name"].ToString(), row["Field"].ToString());
+ }
+
+ foreach (DataRow row in set.Tables[3].Rows)
+ {
+ output.SelectList.Add(CConvert.ToInt(row["ID"]), row["Name"].ToString());
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// ActionTypeによるデータ取得
+ /// </summary>
+ /// <param name="request"></param>
+ /// <returns></returns>
+ private OutputTable Get(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+
+ OutputTable table = new OutputTable() { ErrNo = 0, ErrData = string.Empty, Name = nameof(OutputTable) };
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == (int)EActionType.Master) { SetMaster(msSqlNet, sql, table); }
+ else if (request.ActionType == (int)EActionType.Page) { SetPage(msSqlNet, sql, table); }
+ else if (request.ActionType == (int)EActionType.DefOutput) { SetDefOutput(msSqlNet, sql, table); }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+ private DataResult Set(OutputTable table)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{table.Rows.Count}");
+
+ StringBuilder sql = new StringBuilder();
+ if (table.BeforeUpdate.Length > 0) { sql.AppendLine(table.BeforeUpdate.ToStringUtf8()); }
+
+ foreach (Output item in table.Rows)
+ {
+ sql.AppendLine(table.UpdateType == 2 ? item.UpdateSql() : item.AddSql());
+ }
+
+ if (table.AfterUpdate.Length > 0) { sql.AppendLine(table.AfterUpdate.ToStringUtf8()); }
+
+ string sqlCmd = sql.ToString();
+ OperationLog.Instance.WriteLog($"Sql生成:{sqlCmd}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (!msSqlNet.ExecuteNonQueryWithTran(sqlCmd))
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private DataResult AddOrUpdate(bool add, Output item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ StringBuilder sql = new StringBuilder();
+ if (add)
+ {
+ int id = CConvert.ToInt(msSqlNet.ExecuteScalar(item.MaxIDSql())) + 1;
+ item.ID = id;
+ }
+ else
+ {
+ sql.AppendLine(item.ClearDetailSql());
+ }
+ sql.AppendLine(add ? item.AddSql() : item.UpdateSql());
+ int i = 1;
+ foreach (OutputItem detail in item.Items)
+ {
+ detail.MachineName = item.MachineName;
+ detail.UserName = item.UserName;
+ detail.ReportID = item.ReportID;
+ detail.OutputID = item.ID;
+ detail.ID = i;
+ sql.AppendLine(detail.AddSql());
+ i++;
+ }
+
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ if (!msSqlNet.ExecuteNonQueryWithTran(sql.ToString()))
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private async Task AddOrUpdate(bool add, IAsyncStreamReader<Output> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ Output item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = AddOrUpdate(add, item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ private DataResult Delete(SqlWhere item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = $@"DELETE FROM M_OutputItem WHERE OutputID IN (SELECT ID FROM {TableName} WHERE {item.Data.ToStringUtf8()});
+DELETE FROM {TableName} WHERE {item.Data.ToStringUtf8()};";
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (!msSqlNet.ExecuteNonQueryWithTran(sql))
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ #endregion
+
+
+ #region ★★★★★ Public Function ★★★★★
+
+ public async override Task OutputStream(DataRequest request, IServerStreamWriter<FileGrpcData> responseStream, ServerCallContext context)
+ {
+ try
+ {
+ using (DataTable data = GetDataTable(request))
+ {
+ byte[] bytes = Excel.Export(data);
+ FileGrpcData fileGrpcData = new FileGrpcData
+ {
+ Block = 1,
+ FileName = "Data",
+ Content = ByteString.CopyFrom(bytes)
+ };
+ await responseStream.WriteAsync(fileGrpcData);
+ }
+ }
+ catch { }
+ }
+
+ /// <summary>
+ /// 同期実行
+ /// </summary>
+ /// <param name="request"></param>
+ /// <param name="context"></param>
+ /// <returns></returns>
+ public override Task<OutputTable> GetData(DataRequest request, ServerCallContext context)
+ {
+ return Task.FromResult(Get(request));
+ }
+
+ public async override Task GetDataStream(IAsyncStreamReader<DataRequest> requestStream, IServerStreamWriter<OutputTable> responseStream, ServerCallContext context)
+ {
+ DataRequest request = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ request = message;
+ break;
+ }
+ OutputTable table = Get(request);
+ await responseStream.WriteAsync(table); //データ送信
+ }
+
+ public override Task<DataResult> SetData(OutputTable request, ServerCallContext context)
+ {
+ return Task.FromResult(Set(request));
+ }
+
+ public async override Task SetDataStream(IAsyncStreamReader<OutputTable> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ OutputTable table = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ table = message;
+ break;
+ }
+
+ DataResult result = Set(table);
+ //データ送信
+ await responseStream.WriteAsync(result);
+ }
+
+ public override Task<DataResult> Add(Output request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(true, request));
+ }
+
+ public async override Task AddStream(IAsyncStreamReader<Output> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(true, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Update(Output request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(false, request));
+ }
+
+ public async override Task UpdateStream(IAsyncStreamReader<Output> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(false, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Remove(SqlWhere request, ServerCallContext context)
+ {
+ return Task.FromResult(Delete(request));
+ }
+
+ public async override Task RemoveStream(IAsyncStreamReader<SqlWhere> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ SqlWhere item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = Delete(item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ #endregion
+ }
+}
diff --git a/HotelPms.GrpcService/Services/PayDivService.cs b/HotelPms.GrpcService/Services/PayDivService.cs
new file mode 100644
index 0000000..701a3cb
--- /dev/null
+++ b/HotelPms.GrpcService/Services/PayDivService.cs
@@ -0,0 +1,369 @@
+using HotelPms.Data;
+using HotelPms.Data.Common.Pagination;
+using HotelPms.Data.UseInfo;
+using HotelPms.GrpcService.Util;
+using HotelPms.Share.Data;
+using HotelPms.Share.IO;
+using HotelPms.Share.Util;
+using Google.Protobuf;
+using Grpc.Core;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
+using System.Data;
+using System.Data.SqlClient;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Tasks;
+
+namespace HotelPms.GrpcService
+{
+ /// <summary>
+ /// ■攻略
+ /// 1.PayDiv.proto(message:PayDiv、PayDivTable;Service:PayDivCore) ⇒ projectファイルのInclude
+ /// 2.PayDiv.cs(両方)
+ /// 3.PayDivTable.cs(両方)
+ /// 4.PayDivService.cs(サーバー側) ⇒ StartupでMapGrpcServiceの処理が必要
+ /// 5.PayDivAccess.cs(クライアント側)
+ /// </summary>
+ public class PayDivService : PayDivCore.PayDivCoreBase
+ {
+ #region ★★★★★ Declartions ★★★★★
+
+ private static string TableName = "D_PayDiv";
+ private readonly ILogger<PayDivService> _logger;
+ private IConfiguration m_Configuration;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public PayDivService(ILogger<PayDivService> logger, IConfiguration configuration)
+ {
+ _logger = logger;
+ m_Configuration = configuration;
+ }
+
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+
+ private string GetSql(DataRequest request)
+ {
+ StringBuilder sql = new StringBuilder();
+ if (request.ActionType == 0)
+ {
+ sql.Append($"SELECT * FROM {TableName} {(string.IsNullOrEmpty(request.Data) ? string.Empty : $"WHERE {request.Data}")}");
+ }
+ else if (request.ActionType == 1 || request.ActionType == 2)
+ {
+ PagingRequest pagingRequest = JsonSerializer.Deserialize<PagingRequest>(request.Data);
+ sql.Append($"EXECUTE Pagination {pagingRequest.PageNumber},{pagingRequest.PageSize},'{pagingRequest.Table}','{pagingRequest.Field}','{pagingRequest.OrderBy}','{CConvert.FromBase64(pagingRequest.Filter)}'");
+ }
+ return sql.ToString();
+ }
+
+ private DataTable GetDataTable(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+ DataTable table = null;
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 2)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ table = set.Tables[0];
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+
+ private PayDivTable Get(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+
+ PayDivTable table = new PayDivTable() { ErrNo = 0, ErrData = string.Empty, Name = nameof(PayDivTable) };
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 0)
+ {
+ using (SqlConnection dbConnect = msSqlNet.Open())
+ {
+ using (SqlCommand command = new SqlCommand(sql, dbConnect))
+ {
+ OperationLog.Instance.WriteLog($"データ読込:{sql}");
+ command.CommandTimeout = 60000 * 100;
+ using (SqlDataReader reader = command.ExecuteReader(CommandBehavior.Default))
+ {
+ //エラーまだ対応していない
+ if (reader == null)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ while (reader.Read())
+ {
+ PayDiv item = new PayDiv();
+ item.ConvertReader(reader);
+ table.Rows.Add(item);
+ }
+ }
+ reader.Close();
+ }
+ }
+ }
+ }
+ else if (request.ActionType == 1)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ foreach (DataRow row in set.Tables[0].Rows)
+ {
+ PayDiv item = new PayDiv();
+ item.ConvertDataRow(row);
+ table.Rows.Add(item);
+ }
+
+ table.ErrData = JsonSerializer.Serialize(new PagingRespone()
+ {
+ MaxPage = CConvert.ToInt(set.Tables[1].Rows[0]["MaxPage"]),
+ TotalRow = CConvert.ToInt(set.Tables[1].Rows[0]["TotalRow"])
+ });
+ }
+ else
+ {
+ table.ErrNo = -1;
+ table.ErrData = set.Tables[0].Rows[0]["Descript"].ToString();
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+ private DataResult Set(PayDivTable table)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{table.Rows.Count}");
+
+ StringBuilder sql = new StringBuilder();
+ if (table.BeforeUpdate.Length > 0) { sql.AppendLine(table.BeforeUpdate.ToStringUtf8()); }
+
+ foreach (PayDiv item in table.Rows)
+ {
+ sql.AppendLine(table.UpdateType == 2 ? item.UpdateSql() : item.AddSql());
+ }
+
+ if (table.AfterUpdate.Length > 0) { sql.AppendLine(table.AfterUpdate.ToStringUtf8()); }
+
+ string sqlCmd = sql.ToString();
+ OperationLog.Instance.WriteLog($"Sql生成:{sqlCmd}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (!msSqlNet.ExecuteNonQueryWithTran(sqlCmd))
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private DataResult AddOrUpdate(bool add, PayDiv item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = add ? item.AddSql() : item.UpdateSql();
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private async Task AddOrUpdate(bool add, IAsyncStreamReader<PayDiv> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ PayDiv item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = AddOrUpdate(add, item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ private DataResult Delete(SqlWhere item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = $"DELETE FROM {TableName} WHERE {item.Data.ToStringUtf8()}";
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+
+ public async override Task OutputStream(DataRequest request, IServerStreamWriter<FileGrpcData> responseStream, ServerCallContext context)
+ {
+ try
+ {
+ using (DataTable data = GetDataTable(request))
+ {
+ byte[] bytes = Excel.Export(data);
+ FileGrpcData fileGrpcData = new FileGrpcData
+ {
+ Block = 1,
+ FileName = "Data",
+ Content = ByteString.CopyFrom(bytes)
+ };
+ await responseStream.WriteAsync(fileGrpcData);
+ }
+ }
+ catch { }
+ }
+
+ /// <summary>
+ /// 同期実行
+ /// </summary>
+ /// <param name="request"></param>
+ /// <param name="context"></param>
+ /// <returns></returns>
+ public override Task<PayDivTable> GetData(DataRequest request, ServerCallContext context)
+ {
+ return Task.FromResult(Get(request));
+ }
+
+ public async override Task GetDataStream(IAsyncStreamReader<DataRequest> requestStream, IServerStreamWriter<PayDivTable> responseStream, ServerCallContext context)
+ {
+ DataRequest request = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ request = message;
+ break;
+ }
+ PayDivTable table = Get(request);
+ await responseStream.WriteAsync(table); //データ送信
+ }
+
+ public override Task<DataResult> SetData(PayDivTable request, ServerCallContext context)
+ {
+ return Task.FromResult(Set(request));
+ }
+
+ public async override Task SetDataStream(IAsyncStreamReader<PayDivTable> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ PayDivTable table = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ table = message;
+ break;
+ }
+
+ DataResult result = Set(table);
+ //データ送信
+ await responseStream.WriteAsync(result);
+ }
+
+ public override Task<DataResult> Add(PayDiv request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(true, request));
+ }
+
+ public async override Task AddStream(IAsyncStreamReader<PayDiv> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(true, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Update(PayDiv request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(false, request));
+ }
+
+ public async override Task UpdateStream(IAsyncStreamReader<PayDiv> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(false, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Remove(SqlWhere request, ServerCallContext context)
+ {
+ return Task.FromResult(Delete(request));
+ }
+
+ public async override Task RemoveStream(IAsyncStreamReader<SqlWhere> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ SqlWhere item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = Delete(item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ #endregion
+ }
+}
diff --git a/HotelPms.GrpcService/Services/PayService.cs b/HotelPms.GrpcService/Services/PayService.cs
new file mode 100644
index 0000000..0751d0d
--- /dev/null
+++ b/HotelPms.GrpcService/Services/PayService.cs
@@ -0,0 +1,369 @@
+using HotelPms.Data;
+using HotelPms.Data.Common.Pagination;
+using HotelPms.Data.UseInfo;
+using HotelPms.GrpcService.Util;
+using HotelPms.Share.Data;
+using HotelPms.Share.IO;
+using HotelPms.Share.Util;
+using Google.Protobuf;
+using Grpc.Core;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
+using System.Data;
+using System.Data.SqlClient;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Tasks;
+
+namespace HotelPms.GrpcService
+{
+ /// <summary>
+ /// ■攻略
+ /// 1.Pay.proto(message:Pay、PayTable;Service:PayCore) ⇒ projectファイルのInclude
+ /// 2.Pay.cs(両方)
+ /// 3.PayTable.cs(両方)
+ /// 4.PayService.cs(サーバー側) ⇒ StartupでMapGrpcServiceの処理が必要
+ /// 5.PayAccess.cs(クライアント側)
+ /// </summary>
+ public class PayService : PayCore.PayCoreBase
+ {
+ #region ★★★★★ Declartions ★★★★★
+
+ private static string TableName = "D_Pay";
+ private readonly ILogger<PayService> _logger;
+ private IConfiguration m_Configuration;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public PayService(ILogger<PayService> logger, IConfiguration configuration)
+ {
+ _logger = logger;
+ m_Configuration = configuration;
+ }
+
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+
+ private string GetSql(DataRequest request)
+ {
+ StringBuilder sql = new StringBuilder();
+ if (request.ActionType == 0)
+ {
+ sql.Append($"SELECT * FROM {TableName} {(string.IsNullOrEmpty(request.Data) ? string.Empty : $"WHERE {request.Data}")}");
+ }
+ else if (request.ActionType == 1 || request.ActionType == 2)
+ {
+ PagingRequest pagingRequest = JsonSerializer.Deserialize<PagingRequest>(request.Data);
+ sql.Append($"EXECUTE Pagination {pagingRequest.PageNumber},{pagingRequest.PageSize},'{pagingRequest.Table}','{pagingRequest.Field}','{pagingRequest.OrderBy}','{CConvert.FromBase64(pagingRequest.Filter)}'");
+ }
+ return sql.ToString();
+ }
+
+ private DataTable GetDataTable(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+ DataTable table = null;
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 2)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ table = set.Tables[0];
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+
+ private PayTable Get(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+
+ PayTable table = new PayTable() { ErrNo = 0, ErrData = string.Empty, Name = nameof(PayTable) };
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 0)
+ {
+ using (SqlConnection dbConnect = msSqlNet.Open())
+ {
+ using (SqlCommand command = new SqlCommand(sql, dbConnect))
+ {
+ OperationLog.Instance.WriteLog($"データ読込:{sql}");
+ command.CommandTimeout = 60000 * 100;
+ using (SqlDataReader reader = command.ExecuteReader(CommandBehavior.Default))
+ {
+ //エラーまだ対応していない
+ if (reader == null)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ while (reader.Read())
+ {
+ Pay item = new Pay();
+ item.ConvertReader(reader);
+ table.Rows.Add(item);
+ }
+ }
+ reader.Close();
+ }
+ }
+ }
+ }
+ else if (request.ActionType == 1)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ foreach (DataRow row in set.Tables[0].Rows)
+ {
+ Pay item = new Pay();
+ item.ConvertDataRow(row);
+ table.Rows.Add(item);
+ }
+
+ table.ErrData = JsonSerializer.Serialize(new PagingRespone()
+ {
+ MaxPage = CConvert.ToInt(set.Tables[1].Rows[0]["MaxPage"]),
+ TotalRow = CConvert.ToInt(set.Tables[1].Rows[0]["TotalRow"])
+ });
+ }
+ else
+ {
+ table.ErrNo = -1;
+ table.ErrData = set.Tables[0].Rows[0]["Descript"].ToString();
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+ private DataResult Set(PayTable table)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{table.Rows.Count}");
+
+ StringBuilder sql = new StringBuilder();
+ if (table.BeforeUpdate.Length > 0) { sql.AppendLine(table.BeforeUpdate.ToStringUtf8()); }
+
+ foreach (Pay item in table.Rows)
+ {
+ sql.AppendLine(table.UpdateType == 2 ? item.UpdateSql() : item.AddSql());
+ }
+
+ if (table.AfterUpdate.Length > 0) { sql.AppendLine(table.AfterUpdate.ToStringUtf8()); }
+
+ string sqlCmd = sql.ToString();
+ OperationLog.Instance.WriteLog($"Sql生成:{sqlCmd}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (!msSqlNet.ExecuteNonQueryWithTran(sqlCmd))
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private DataResult AddOrUpdate(bool add, Pay item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = add ? item.AddSql() : item.UpdateSql();
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private async Task AddOrUpdate(bool add, IAsyncStreamReader<Pay> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ Pay item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = AddOrUpdate(add, item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ private DataResult Delete(SqlWhere item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = $"DELETE FROM {TableName} WHERE {item.Data.ToStringUtf8()}";
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+
+ public async override Task OutputStream(DataRequest request, IServerStreamWriter<FileGrpcData> responseStream, ServerCallContext context)
+ {
+ try
+ {
+ using (DataTable data = GetDataTable(request))
+ {
+ byte[] bytes = Excel.Export(data);
+ FileGrpcData fileGrpcData = new FileGrpcData
+ {
+ Block = 1,
+ FileName = "Data",
+ Content = ByteString.CopyFrom(bytes)
+ };
+ await responseStream.WriteAsync(fileGrpcData);
+ }
+ }
+ catch { }
+ }
+
+ /// <summary>
+ /// 同期実行
+ /// </summary>
+ /// <param name="request"></param>
+ /// <param name="context"></param>
+ /// <returns></returns>
+ public override Task<PayTable> GetData(DataRequest request, ServerCallContext context)
+ {
+ return Task.FromResult(Get(request));
+ }
+
+ public async override Task GetDataStream(IAsyncStreamReader<DataRequest> requestStream, IServerStreamWriter<PayTable> responseStream, ServerCallContext context)
+ {
+ DataRequest request = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ request = message;
+ break;
+ }
+ PayTable table = Get(request);
+ await responseStream.WriteAsync(table); //データ送信
+ }
+
+ public override Task<DataResult> SetData(PayTable request, ServerCallContext context)
+ {
+ return Task.FromResult(Set(request));
+ }
+
+ public async override Task SetDataStream(IAsyncStreamReader<PayTable> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ PayTable table = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ table = message;
+ break;
+ }
+
+ DataResult result = Set(table);
+ //データ送信
+ await responseStream.WriteAsync(result);
+ }
+
+ public override Task<DataResult> Add(Pay request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(true, request));
+ }
+
+ public async override Task AddStream(IAsyncStreamReader<Pay> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(true, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Update(Pay request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(false, request));
+ }
+
+ public async override Task UpdateStream(IAsyncStreamReader<Pay> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(false, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Remove(SqlWhere request, ServerCallContext context)
+ {
+ return Task.FromResult(Delete(request));
+ }
+
+ public async override Task RemoveStream(IAsyncStreamReader<SqlWhere> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ SqlWhere item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = Delete(item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ #endregion
+ }
+}
diff --git a/HotelPms.GrpcService/Services/ReceiptService.cs b/HotelPms.GrpcService/Services/ReceiptService.cs
new file mode 100644
index 0000000..81e0889
--- /dev/null
+++ b/HotelPms.GrpcService/Services/ReceiptService.cs
@@ -0,0 +1,369 @@
+using HotelPms.Data;
+using HotelPms.Data.Common.Pagination;
+using HotelPms.Data.UseInfo;
+using HotelPms.GrpcService.Util;
+using HotelPms.Share.Data;
+using HotelPms.Share.IO;
+using HotelPms.Share.Util;
+using Google.Protobuf;
+using Grpc.Core;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
+using System.Data;
+using System.Data.SqlClient;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Tasks;
+
+namespace HotelPms.GrpcService
+{
+ /// <summary>
+ /// ■攻略
+ /// 1.Receipt.proto(message:Receipt、ReceiptTable;Service:ReceiptCore) ⇒ projectファイルのInclude
+ /// 2.Receipt.cs(両方)
+ /// 3.ReceiptTable.cs(両方)
+ /// 4.ReceiptService.cs(サーバー側) ⇒ StartupでMapGrpcServiceの処理が必要
+ /// 5.ReceiptAccess.cs(クライアント側)
+ /// </summary>
+ public class ReceiptService : ReceiptCore.ReceiptCoreBase
+ {
+ #region ★★★★★ Declartions ★★★★★
+
+ private static string TableName = "D_Receipt";
+ private readonly ILogger<ReceiptService> _logger;
+ private IConfiguration m_Configuration;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public ReceiptService(ILogger<ReceiptService> logger, IConfiguration configuration)
+ {
+ _logger = logger;
+ m_Configuration = configuration;
+ }
+
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+
+ private string GetSql(DataRequest request)
+ {
+ StringBuilder sql = new StringBuilder();
+ if (request.ActionType == 0)
+ {
+ sql.Append($"SELECT * FROM {TableName} {(string.IsNullOrEmpty(request.Data) ? string.Empty : $"WHERE {request.Data}")}");
+ }
+ else if (request.ActionType == 1 || request.ActionType == 2)
+ {
+ PagingRequest pagingRequest = JsonSerializer.Deserialize<PagingRequest>(request.Data);
+ sql.Append($"EXECUTE Pagination {pagingRequest.PageNumber},{pagingRequest.PageSize},'{pagingRequest.Table}','{pagingRequest.Field}','{pagingRequest.OrderBy}','{CConvert.FromBase64(pagingRequest.Filter)}'");
+ }
+ return sql.ToString();
+ }
+
+ private DataTable GetDataTable(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+ DataTable table = null;
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 2)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ table = set.Tables[0];
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+
+ private ReceiptTable Get(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+
+ ReceiptTable table = new ReceiptTable() { ErrNo = 0, ErrData = string.Empty, Name = nameof(ReceiptTable) };
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 0)
+ {
+ using (SqlConnection dbConnect = msSqlNet.Open())
+ {
+ using (SqlCommand command = new SqlCommand(sql, dbConnect))
+ {
+ OperationLog.Instance.WriteLog($"データ読込:{sql}");
+ command.CommandTimeout = 60000 * 100;
+ using (SqlDataReader reader = command.ExecuteReader(CommandBehavior.Default))
+ {
+ //エラーまだ対応していない
+ if (reader == null)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ while (reader.Read())
+ {
+ Receipt item = new Receipt();
+ item.ConvertReader(reader);
+ table.Rows.Add(item);
+ }
+ }
+ reader.Close();
+ }
+ }
+ }
+ }
+ else if (request.ActionType == 1)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ foreach (DataRow row in set.Tables[0].Rows)
+ {
+ Receipt item = new Receipt();
+ item.ConvertDataRow(row);
+ table.Rows.Add(item);
+ }
+
+ table.ErrData = JsonSerializer.Serialize(new PagingRespone()
+ {
+ MaxPage = CConvert.ToInt(set.Tables[1].Rows[0]["MaxPage"]),
+ TotalRow = CConvert.ToInt(set.Tables[1].Rows[0]["TotalRow"])
+ });
+ }
+ else
+ {
+ table.ErrNo = -1;
+ table.ErrData = set.Tables[0].Rows[0]["Descript"].ToString();
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+ private DataResult Set(ReceiptTable table)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{table.Rows.Count}");
+
+ StringBuilder sql = new StringBuilder();
+ if (table.BeforeUpdate.Length > 0) { sql.AppendLine(table.BeforeUpdate.ToStringUtf8()); }
+
+ foreach (Receipt item in table.Rows)
+ {
+ sql.AppendLine(table.UpdateType == 2 ? item.UpdateSql() : item.AddSql());
+ }
+
+ if (table.AfterUpdate.Length > 0) { sql.AppendLine(table.AfterUpdate.ToStringUtf8()); }
+
+ string sqlCmd = sql.ToString();
+ OperationLog.Instance.WriteLog($"Sql生成:{sqlCmd}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (!msSqlNet.ExecuteNonQueryWithTran(sqlCmd))
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private DataResult AddOrUpdate(bool add, Receipt item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = add ? item.AddSql() : item.UpdateSql();
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private async Task AddOrUpdate(bool add, IAsyncStreamReader<Receipt> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ Receipt item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = AddOrUpdate(add, item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ private DataResult Delete(SqlWhere item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = $"DELETE FROM {TableName} WHERE {item.Data.ToStringUtf8()}";
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+
+ public async override Task OutputStream(DataRequest request, IServerStreamWriter<FileGrpcData> responseStream, ServerCallContext context)
+ {
+ try
+ {
+ using (DataTable data = GetDataTable(request))
+ {
+ byte[] bytes = Excel.Export(data);
+ FileGrpcData fileGrpcData = new FileGrpcData
+ {
+ Block = 1,
+ FileName = "Data",
+ Content = ByteString.CopyFrom(bytes)
+ };
+ await responseStream.WriteAsync(fileGrpcData);
+ }
+ }
+ catch { }
+ }
+
+ /// <summary>
+ /// 同期実行
+ /// </summary>
+ /// <param name="request"></param>
+ /// <param name="context"></param>
+ /// <returns></returns>
+ public override Task<ReceiptTable> GetData(DataRequest request, ServerCallContext context)
+ {
+ return Task.FromResult(Get(request));
+ }
+
+ public async override Task GetDataStream(IAsyncStreamReader<DataRequest> requestStream, IServerStreamWriter<ReceiptTable> responseStream, ServerCallContext context)
+ {
+ DataRequest request = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ request = message;
+ break;
+ }
+ ReceiptTable table = Get(request);
+ await responseStream.WriteAsync(table); //データ送信
+ }
+
+ public override Task<DataResult> SetData(ReceiptTable request, ServerCallContext context)
+ {
+ return Task.FromResult(Set(request));
+ }
+
+ public async override Task SetDataStream(IAsyncStreamReader<ReceiptTable> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ ReceiptTable table = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ table = message;
+ break;
+ }
+
+ DataResult result = Set(table);
+ //データ送信
+ await responseStream.WriteAsync(result);
+ }
+
+ public override Task<DataResult> Add(Receipt request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(true, request));
+ }
+
+ public async override Task AddStream(IAsyncStreamReader<Receipt> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(true, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Update(Receipt request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(false, request));
+ }
+
+ public async override Task UpdateStream(IAsyncStreamReader<Receipt> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(false, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Remove(SqlWhere request, ServerCallContext context)
+ {
+ return Task.FromResult(Delete(request));
+ }
+
+ public async override Task RemoveStream(IAsyncStreamReader<SqlWhere> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ SqlWhere item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = Delete(item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ #endregion
+ }
+}
diff --git a/HotelPms.GrpcService/Services/RentalService.cs b/HotelPms.GrpcService/Services/RentalService.cs
new file mode 100644
index 0000000..722eced
--- /dev/null
+++ b/HotelPms.GrpcService/Services/RentalService.cs
@@ -0,0 +1,369 @@
+using HotelPms.Data;
+using HotelPms.Data.Common.Pagination;
+using HotelPms.Data.UseInfo;
+using HotelPms.GrpcService.Util;
+using HotelPms.Share.Data;
+using HotelPms.Share.IO;
+using HotelPms.Share.Util;
+using Google.Protobuf;
+using Grpc.Core;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
+using System.Data;
+using System.Data.SqlClient;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Tasks;
+
+namespace HotelPms.GrpcService
+{
+ /// <summary>
+ /// ■攻略
+ /// 1.Rental.proto(message:Rental、RentalTable;Service:RentalCore) ⇒ projectファイルのInclude
+ /// 2.Rental.cs(両方)
+ /// 3.RentalTable.cs(両方)
+ /// 4.RentalService.cs(サーバー側) ⇒ StartupでMapGrpcServiceの処理が必要
+ /// 5.RentalAccess.cs(クライアント側)
+ /// </summary>
+ public class RentalService : RentalCore.RentalCoreBase
+ {
+ #region ★★★★★ Declartions ★★★★★
+
+ private static string TableName = "D_Rental";
+ private readonly ILogger<RentalService> _logger;
+ private IConfiguration m_Configuration;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public RentalService(ILogger<RentalService> logger, IConfiguration configuration)
+ {
+ _logger = logger;
+ m_Configuration = configuration;
+ }
+
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+
+ private string GetSql(DataRequest request)
+ {
+ StringBuilder sql = new StringBuilder();
+ if (request.ActionType == 0)
+ {
+ sql.Append($"SELECT * FROM {TableName} {(string.IsNullOrEmpty(request.Data) ? string.Empty : $"WHERE {request.Data}")}");
+ }
+ else if (request.ActionType == 1 || request.ActionType == 2)
+ {
+ PagingRequest pagingRequest = JsonSerializer.Deserialize<PagingRequest>(request.Data);
+ sql.Append($"EXECUTE Pagination {pagingRequest.PageNumber},{pagingRequest.PageSize},'{pagingRequest.Table}','{pagingRequest.Field}','{pagingRequest.OrderBy}','{CConvert.FromBase64(pagingRequest.Filter)}'");
+ }
+ return sql.ToString();
+ }
+
+ private DataTable GetDataTable(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+ DataTable table = null;
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 2)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ table = set.Tables[0];
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+
+ private RentalTable Get(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+
+ RentalTable table = new RentalTable() { ErrNo = 0, ErrData = string.Empty, Name = nameof(RentalTable) };
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 0)
+ {
+ using (SqlConnection dbConnect = msSqlNet.Open())
+ {
+ using (SqlCommand command = new SqlCommand(sql, dbConnect))
+ {
+ OperationLog.Instance.WriteLog($"データ読込:{sql}");
+ command.CommandTimeout = 60000 * 100;
+ using (SqlDataReader reader = command.ExecuteReader(CommandBehavior.Default))
+ {
+ //エラーまだ対応していない
+ if (reader == null)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ while (reader.Read())
+ {
+ Rental item = new Rental();
+ item.ConvertReader(reader);
+ table.Rows.Add(item);
+ }
+ }
+ reader.Close();
+ }
+ }
+ }
+ }
+ else if (request.ActionType == 1)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ foreach (DataRow row in set.Tables[0].Rows)
+ {
+ Rental item = new Rental();
+ item.ConvertDataRow(row);
+ table.Rows.Add(item);
+ }
+
+ table.ErrData = JsonSerializer.Serialize(new PagingRespone()
+ {
+ MaxPage = CConvert.ToInt(set.Tables[1].Rows[0]["MaxPage"]),
+ TotalRow = CConvert.ToInt(set.Tables[1].Rows[0]["TotalRow"])
+ });
+ }
+ else
+ {
+ table.ErrNo = -1;
+ table.ErrData = set.Tables[0].Rows[0]["Descript"].ToString();
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+ private DataResult Set(RentalTable table)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{table.Rows.Count}");
+
+ StringBuilder sql = new StringBuilder();
+ if (table.BeforeUpdate.Length > 0) { sql.AppendLine(table.BeforeUpdate.ToStringUtf8()); }
+
+ foreach (Rental item in table.Rows)
+ {
+ sql.AppendLine(table.UpdateType == 2 ? item.UpdateSql() : item.AddSql());
+ }
+
+ if (table.AfterUpdate.Length > 0) { sql.AppendLine(table.AfterUpdate.ToStringUtf8()); }
+
+ string sqlCmd = sql.ToString();
+ OperationLog.Instance.WriteLog($"Sql生成:{sqlCmd}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (!msSqlNet.ExecuteNonQueryWithTran(sqlCmd))
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private DataResult AddOrUpdate(bool add, Rental item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = add ? item.AddSql() : item.UpdateSql();
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private async Task AddOrUpdate(bool add, IAsyncStreamReader<Rental> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ Rental item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = AddOrUpdate(add, item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ private DataResult Delete(SqlWhere item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = $"DELETE FROM {TableName} WHERE {item.Data.ToStringUtf8()}";
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+
+ public async override Task OutputStream(DataRequest request, IServerStreamWriter<FileGrpcData> responseStream, ServerCallContext context)
+ {
+ try
+ {
+ using (DataTable data = GetDataTable(request))
+ {
+ byte[] bytes = Excel.Export(data);
+ FileGrpcData fileGrpcData = new FileGrpcData
+ {
+ Block = 1,
+ FileName = "Data",
+ Content = ByteString.CopyFrom(bytes)
+ };
+ await responseStream.WriteAsync(fileGrpcData);
+ }
+ }
+ catch { }
+ }
+
+ /// <summary>
+ /// 同期実行
+ /// </summary>
+ /// <param name="request"></param>
+ /// <param name="context"></param>
+ /// <returns></returns>
+ public override Task<RentalTable> GetData(DataRequest request, ServerCallContext context)
+ {
+ return Task.FromResult(Get(request));
+ }
+
+ public async override Task GetDataStream(IAsyncStreamReader<DataRequest> requestStream, IServerStreamWriter<RentalTable> responseStream, ServerCallContext context)
+ {
+ DataRequest request = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ request = message;
+ break;
+ }
+ RentalTable table = Get(request);
+ await responseStream.WriteAsync(table); //データ送信
+ }
+
+ public override Task<DataResult> SetData(RentalTable request, ServerCallContext context)
+ {
+ return Task.FromResult(Set(request));
+ }
+
+ public async override Task SetDataStream(IAsyncStreamReader<RentalTable> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ RentalTable table = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ table = message;
+ break;
+ }
+
+ DataResult result = Set(table);
+ //データ送信
+ await responseStream.WriteAsync(result);
+ }
+
+ public override Task<DataResult> Add(Rental request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(true, request));
+ }
+
+ public async override Task AddStream(IAsyncStreamReader<Rental> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(true, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Update(Rental request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(false, request));
+ }
+
+ public async override Task UpdateStream(IAsyncStreamReader<Rental> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(false, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Remove(SqlWhere request, ServerCallContext context)
+ {
+ return Task.FromResult(Delete(request));
+ }
+
+ public async override Task RemoveStream(IAsyncStreamReader<SqlWhere> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ SqlWhere item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = Delete(item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ #endregion
+ }
+}
diff --git a/HotelPms.GrpcService/Services/RoomCellService.cs b/HotelPms.GrpcService/Services/RoomCellService.cs
new file mode 100644
index 0000000..7bb7deb
--- /dev/null
+++ b/HotelPms.GrpcService/Services/RoomCellService.cs
@@ -0,0 +1,369 @@
+using HotelPms.Data;
+using HotelPms.Data.Common.Pagination;
+using HotelPms.Data.Master;
+using HotelPms.GrpcService.Util;
+using HotelPms.Share.Data;
+using HotelPms.Share.IO;
+using HotelPms.Share.Util;
+using Google.Protobuf;
+using Grpc.Core;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
+using System.Data;
+using System.Data.SqlClient;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Tasks;
+
+namespace HotelPms.GrpcService
+{
+ /// <summary>
+ /// ■攻略
+ /// 1.RoomCell.proto(message:RoomCell、RoomCellTable;Service:RoomCellCore) ⇒ projectファイルのInclude
+ /// 2.RoomCell.cs(両方)
+ /// 3.RoomCellTable.cs(両方)
+ /// 4.RoomCellService.cs(サーバー側) ⇒ StartupでMapGrpcServiceの処理が必要
+ /// 5.RoomCellAccess.cs(クライアント側)
+ /// </summary>
+ public class RoomCellService : RoomCellCore.RoomCellCoreBase
+ {
+ #region ★★★★★ Declartions ★★★★★
+
+ private static string TableName = "M_RoomCell";
+ private readonly ILogger<RoomCellService> _logger;
+ private IConfiguration m_Configuration;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public RoomCellService(ILogger<RoomCellService> logger, IConfiguration configuration)
+ {
+ _logger = logger;
+ m_Configuration = configuration;
+ }
+
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+
+ private string GetSql(DataRequest request)
+ {
+ StringBuilder sql = new StringBuilder();
+ if (request.ActionType == 0)
+ {
+ sql.Append($"SELECT * FROM {TableName} {(string.IsNullOrEmpty(request.Data) ? string.Empty : $"WHERE {request.Data}")}");
+ }
+ else if (request.ActionType == 1 || request.ActionType == 2)
+ {
+ PagingRequest pagingRequest = JsonSerializer.Deserialize<PagingRequest>(request.Data);
+ sql.Append($"EXECUTE Pagination {pagingRequest.PageNumber},{pagingRequest.PageSize},'{pagingRequest.Table}','{pagingRequest.Field}','{pagingRequest.OrderBy}','{CConvert.FromBase64(pagingRequest.Filter)}'");
+ }
+ return sql.ToString();
+ }
+
+ private DataTable GetDataTable(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+ DataTable table = null;
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 2)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ table = set.Tables[0];
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+
+ private RoomCellTable Get(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+
+ RoomCellTable table = new RoomCellTable() { ErrNo = 0, ErrData = string.Empty, Name = nameof(RoomCellTable) };
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 0)
+ {
+ using (SqlConnection dbConnect = msSqlNet.Open())
+ {
+ using (SqlCommand command = new SqlCommand(sql, dbConnect))
+ {
+ OperationLog.Instance.WriteLog($"データ読込:{sql}");
+ command.CommandTimeout = 60000 * 100;
+ using (SqlDataReader reader = command.ExecuteReader(CommandBehavior.Default))
+ {
+ //エラーまだ対応していない
+ if (reader == null)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ while (reader.Read())
+ {
+ RoomCell item = new RoomCell();
+ item.ConvertReader(reader);
+ table.Rows.Add(item);
+ }
+ }
+ reader.Close();
+ }
+ }
+ }
+ }
+ else if (request.ActionType == 1)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ foreach (DataRow row in set.Tables[0].Rows)
+ {
+ RoomCell item = new RoomCell();
+ item.ConvertDataRow(row);
+ table.Rows.Add(item);
+ }
+
+ table.ErrData = JsonSerializer.Serialize(new PagingRespone()
+ {
+ MaxPage = CConvert.ToInt(set.Tables[1].Rows[0]["MaxPage"]),
+ TotalRow = CConvert.ToInt(set.Tables[1].Rows[0]["TotalRow"])
+ });
+ }
+ else
+ {
+ table.ErrNo = -1;
+ table.ErrData = set.Tables[0].Rows[0]["Descript"].ToString();
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+ private DataResult Set(RoomCellTable table)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{table.Rows.Count}");
+
+ StringBuilder sql = new StringBuilder();
+ if (table.BeforeUpdate.Length > 0) { sql.AppendLine(table.BeforeUpdate.ToStringUtf8()); }
+
+ foreach (RoomCell item in table.Rows)
+ {
+ sql.AppendLine(table.UpdateType == 2 ? item.UpdateSql() : item.AddSql());
+ }
+
+ if (table.AfterUpdate.Length > 0) { sql.AppendLine(table.AfterUpdate.ToStringUtf8()); }
+
+ string sqlCmd = sql.ToString();
+ OperationLog.Instance.WriteLog($"Sql生成:{sqlCmd}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (!msSqlNet.ExecuteNonQueryWithTran(sqlCmd))
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private DataResult AddOrUpdate(bool add, RoomCell item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = add ? item.AddSql() : item.UpdateSql();
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private async Task AddOrUpdate(bool add, IAsyncStreamReader<RoomCell> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ RoomCell item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = AddOrUpdate(add, item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ private DataResult Delete(SqlWhere item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = $"DELETE FROM {TableName} WHERE {item.Data.ToStringUtf8()}";
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+
+ public async override Task OutputStream(DataRequest request, IServerStreamWriter<FileGrpcData> responseStream, ServerCallContext context)
+ {
+ try
+ {
+ using (DataTable data = GetDataTable(request))
+ {
+ byte[] bytes = Excel.Export(data);
+ FileGrpcData fileGrpcData = new FileGrpcData
+ {
+ Block = 1,
+ FileName = "Data",
+ Content = ByteString.CopyFrom(bytes)
+ };
+ await responseStream.WriteAsync(fileGrpcData);
+ }
+ }
+ catch { }
+ }
+
+ /// <summary>
+ /// 同期実行
+ /// </summary>
+ /// <param name="request"></param>
+ /// <param name="context"></param>
+ /// <returns></returns>
+ public override Task<RoomCellTable> GetData(DataRequest request, ServerCallContext context)
+ {
+ return Task.FromResult(Get(request));
+ }
+
+ public async override Task GetDataStream(IAsyncStreamReader<DataRequest> requestStream, IServerStreamWriter<RoomCellTable> responseStream, ServerCallContext context)
+ {
+ DataRequest request = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ request = message;
+ break;
+ }
+ RoomCellTable table = Get(request);
+ await responseStream.WriteAsync(table); //データ送信
+ }
+
+ public override Task<DataResult> SetData(RoomCellTable request, ServerCallContext context)
+ {
+ return Task.FromResult(Set(request));
+ }
+
+ public async override Task SetDataStream(IAsyncStreamReader<RoomCellTable> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ RoomCellTable table = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ table = message;
+ break;
+ }
+
+ DataResult result = Set(table);
+ //データ送信
+ await responseStream.WriteAsync(result);
+ }
+
+ public override Task<DataResult> Add(RoomCell request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(true, request));
+ }
+
+ public async override Task AddStream(IAsyncStreamReader<RoomCell> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(true, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Update(RoomCell request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(false, request));
+ }
+
+ public async override Task UpdateStream(IAsyncStreamReader<RoomCell> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(false, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Remove(SqlWhere request, ServerCallContext context)
+ {
+ return Task.FromResult(Delete(request));
+ }
+
+ public async override Task RemoveStream(IAsyncStreamReader<SqlWhere> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ SqlWhere item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = Delete(item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ #endregion
+ }
+}
diff --git a/HotelPms.GrpcService/Services/RoomStatusService.cs b/HotelPms.GrpcService/Services/RoomStatusService.cs
new file mode 100644
index 0000000..bae2326
--- /dev/null
+++ b/HotelPms.GrpcService/Services/RoomStatusService.cs
@@ -0,0 +1,369 @@
+using HotelPms.Data;
+using HotelPms.Data.Common.Pagination;
+using HotelPms.Data.Master;
+using HotelPms.GrpcService.Util;
+using HotelPms.Share.Data;
+using HotelPms.Share.IO;
+using HotelPms.Share.Util;
+using Google.Protobuf;
+using Grpc.Core;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
+using System.Data;
+using System.Data.SqlClient;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Tasks;
+
+namespace HotelPms.GrpcService
+{
+ /// <summary>
+ /// ■攻略
+ /// 1.RoomStatus.proto(message:RoomStatus、RoomStatusTable;Service:RoomStatusCore) ⇒ projectファイルのInclude
+ /// 2.RoomStatus.cs(両方)
+ /// 3.RoomStatusTable.cs(両方)
+ /// 4.RoomStatusService.cs(サーバー側) ⇒ StartupでMapGrpcServiceの処理が必要
+ /// 5.RoomStatusAccess.cs(クライアント側)
+ /// </summary>
+ public class RoomStatusService : RoomStatusCore.RoomStatusCoreBase
+ {
+ #region ★★★★★ Declartions ★★★★★
+
+ private static string TableName = "M_RoomStatus";
+ private readonly ILogger<RoomStatusService> _logger;
+ private IConfiguration m_Configuration;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public RoomStatusService(ILogger<RoomStatusService> logger, IConfiguration configuration)
+ {
+ _logger = logger;
+ m_Configuration = configuration;
+ }
+
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+
+ private string GetSql(DataRequest request)
+ {
+ StringBuilder sql = new StringBuilder();
+ if (request.ActionType == 0)
+ {
+ sql.Append($"SELECT * FROM {TableName} {(string.IsNullOrEmpty(request.Data) ? string.Empty : $"WHERE {request.Data}")}");
+ }
+ else if (request.ActionType == 1 || request.ActionType == 2)
+ {
+ PagingRequest pagingRequest = JsonSerializer.Deserialize<PagingRequest>(request.Data);
+ sql.Append($"EXECUTE Pagination {pagingRequest.PageNumber},{pagingRequest.PageSize},'{pagingRequest.Table}','{pagingRequest.Field}','{pagingRequest.OrderBy}','{CConvert.FromBase64(pagingRequest.Filter)}'");
+ }
+ return sql.ToString();
+ }
+
+ private DataTable GetDataTable(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+ DataTable table = null;
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 2)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ table = set.Tables[0];
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+
+ private RoomStatusTable Get(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+
+ RoomStatusTable table = new RoomStatusTable() { ErrNo = 0, ErrData = string.Empty, Name = nameof(RoomStatusTable) };
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 0)
+ {
+ using (SqlConnection dbConnect = msSqlNet.Open())
+ {
+ using (SqlCommand command = new SqlCommand(sql, dbConnect))
+ {
+ OperationLog.Instance.WriteLog($"データ読込:{sql}");
+ command.CommandTimeout = 60000 * 100;
+ using (SqlDataReader reader = command.ExecuteReader(CommandBehavior.Default))
+ {
+ //エラーまだ対応していない
+ if (reader == null)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ while (reader.Read())
+ {
+ RoomStatus item = new RoomStatus();
+ item.ConvertReader(reader);
+ table.Rows.Add(item);
+ }
+ }
+ reader.Close();
+ }
+ }
+ }
+ }
+ else if (request.ActionType == 1)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ foreach (DataRow row in set.Tables[0].Rows)
+ {
+ RoomStatus item = new RoomStatus();
+ item.ConvertDataRow(row);
+ table.Rows.Add(item);
+ }
+
+ table.Tag = JsonSerializer.Serialize(new PagingRespone()
+ {
+ MaxPage = CConvert.ToInt(set.Tables[1].Rows[0]["MaxPage"]),
+ TotalRow = CConvert.ToInt(set.Tables[1].Rows[0]["TotalRow"])
+ });
+ }
+ else
+ {
+ table.ErrNo = -1;
+ table.ErrData = set.Tables[0].Rows[0]["Descript"].ToString();
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+ private DataResult Set(RoomStatusTable table)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{table.Rows.Count}");
+
+ StringBuilder sql = new StringBuilder();
+ if (table.BeforeUpdate.Length > 0) { sql.AppendLine(table.BeforeUpdate.ToStringUtf8()); }
+
+ foreach (RoomStatus item in table.Rows)
+ {
+ sql.AppendLine(table.UpdateType == 2 ? item.UpdateSql() : item.AddSql());
+ }
+
+ if (table.AfterUpdate.Length > 0) { sql.AppendLine(table.AfterUpdate.ToStringUtf8()); }
+
+ string sqlCmd = sql.ToString();
+ OperationLog.Instance.WriteLog($"Sql生成:{sqlCmd}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (!msSqlNet.ExecuteNonQueryWithTran(sqlCmd))
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private DataResult AddOrUpdate(bool add, RoomStatus item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = add ? item.AddSql() : item.UpdateSql();
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private async Task AddOrUpdate(bool add, IAsyncStreamReader<RoomStatus> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ RoomStatus item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = AddOrUpdate(add, item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ private DataResult Delete(SqlWhere item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = $"DELETE FROM {TableName} WHERE {item.Data.ToStringUtf8()}";
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+
+ public async override Task OutputStream(DataRequest request, IServerStreamWriter<FileGrpcData> responseStream, ServerCallContext context)
+ {
+ try
+ {
+ using (DataTable data = GetDataTable(request))
+ {
+ byte[] bytes = Excel.Export(data);
+ FileGrpcData fileGrpcData = new FileGrpcData
+ {
+ Block = 1,
+ FileName = "Data",
+ Content = ByteString.CopyFrom(bytes)
+ };
+ await responseStream.WriteAsync(fileGrpcData);
+ }
+ }
+ catch { }
+ }
+
+ /// <summary>
+ /// 同期実行
+ /// </summary>
+ /// <param name="request"></param>
+ /// <param name="context"></param>
+ /// <returns></returns>
+ public override Task<RoomStatusTable> GetData(DataRequest request, ServerCallContext context)
+ {
+ return Task.FromResult(Get(request));
+ }
+
+ public async override Task GetDataStream(IAsyncStreamReader<DataRequest> requestStream, IServerStreamWriter<RoomStatusTable> responseStream, ServerCallContext context)
+ {
+ DataRequest request = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ request = message;
+ break;
+ }
+ RoomStatusTable table = Get(request);
+ await responseStream.WriteAsync(table); //データ送信
+ }
+
+ public override Task<DataResult> SetData(RoomStatusTable request, ServerCallContext context)
+ {
+ return Task.FromResult(Set(request));
+ }
+
+ public async override Task SetDataStream(IAsyncStreamReader<RoomStatusTable> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ RoomStatusTable table = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ table = message;
+ break;
+ }
+
+ DataResult result = Set(table);
+ //データ送信
+ await responseStream.WriteAsync(result);
+ }
+
+ public override Task<DataResult> Add(RoomStatus request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(true, request));
+ }
+
+ public async override Task AddStream(IAsyncStreamReader<RoomStatus> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(true, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Update(RoomStatus request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(false, request));
+ }
+
+ public async override Task UpdateStream(IAsyncStreamReader<RoomStatus> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(false, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Remove(SqlWhere request, ServerCallContext context)
+ {
+ return Task.FromResult(Delete(request));
+ }
+
+ public async override Task RemoveStream(IAsyncStreamReader<SqlWhere> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ SqlWhere item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = Delete(item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ #endregion
+ }
+}
diff --git a/HotelPms.GrpcService/Services/RoomTypeService.cs b/HotelPms.GrpcService/Services/RoomTypeService.cs
new file mode 100644
index 0000000..c01f3a8
--- /dev/null
+++ b/HotelPms.GrpcService/Services/RoomTypeService.cs
@@ -0,0 +1,368 @@
+using HotelPms.Data;
+using HotelPms.Data.Common.Pagination;
+using HotelPms.Data.Master;
+using HotelPms.GrpcService.Util;
+using HotelPms.Share.Data;
+using HotelPms.Share.IO;
+using HotelPms.Share.Util;
+using Google.Protobuf;
+using Grpc.Core;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
+using System.Data;
+using System.Data.SqlClient;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Tasks;
+
+namespace HotelPms.GrpcService;
+
+/// <summary>
+/// ■攻略
+/// 1.RoomType.proto(message:RoomType、RoomTypeTable;Service:RoomTypeCore) ⇒ projectファイルのInclude
+/// 2.RoomType.cs(両方)
+/// 3.RoomTypeTable.cs(両方)
+/// 4.RoomTypeService.cs(サーバー側) ⇒ StartupでMapGrpcServiceの処理が必要
+/// 5.RoomTypeAccess.cs(クライアント側)
+/// </summary>
+public class RoomTypeService : RoomTypeCore.RoomTypeCoreBase
+{
+ #region ★★★★★ Declartions ★★★★★
+
+ private static string TableName = "M_RoomType";
+ private readonly ILogger<RoomTypeService> _logger;
+ private IConfiguration m_Configuration;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public RoomTypeService(ILogger<RoomTypeService> logger, IConfiguration configuration)
+ {
+ _logger = logger;
+ m_Configuration = configuration;
+ }
+
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+
+ private string GetSql(DataRequest request)
+ {
+ StringBuilder sql = new StringBuilder();
+ if (request.ActionType == 0)
+ {
+ sql.Append($"SELECT * FROM {TableName} {(string.IsNullOrEmpty(request.Data) ? string.Empty : $"WHERE {request.Data}")}");
+ }
+ else if (request.ActionType == 1 || request.ActionType == 2)
+ {
+ PagingRequest pagingRequest = JsonSerializer.Deserialize<PagingRequest>(request.Data);
+ sql.Append($"EXECUTE Pagination {pagingRequest.PageNumber},{pagingRequest.PageSize},'{pagingRequest.Table}','{pagingRequest.Field}','{pagingRequest.OrderBy}','{CConvert.FromBase64(pagingRequest.Filter)}'");
+ }
+ return sql.ToString();
+ }
+
+ private DataTable GetDataTable(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+ DataTable table = null;
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 2)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ table = set.Tables[0];
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+
+ private RoomTypeTable Get(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+
+ RoomTypeTable table = new RoomTypeTable() { ErrNo = 0, ErrData = string.Empty, Name = nameof(RoomTypeTable) };
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 0)
+ {
+ using (SqlConnection dbConnect = msSqlNet.Open())
+ {
+ using (SqlCommand command = new SqlCommand(sql, dbConnect))
+ {
+ OperationLog.Instance.WriteLog($"データ読込:{sql}");
+ command.CommandTimeout = 60000 * 100;
+ using (SqlDataReader reader = command.ExecuteReader(CommandBehavior.Default))
+ {
+ //エラーまだ対応していない
+ if (reader == null)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ while (reader.Read())
+ {
+ RoomType item = new RoomType();
+ item.ConvertReader(reader);
+ table.Rows.Add(item);
+ }
+ }
+ reader.Close();
+ }
+ }
+ }
+ }
+ else if (request.ActionType == 1)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ foreach (DataRow row in set.Tables[0].Rows)
+ {
+ RoomType item = new RoomType();
+ item.ConvertDataRow(row);
+ table.Rows.Add(item);
+ }
+
+ table.Tag = JsonSerializer.Serialize(new PagingRespone()
+ {
+ MaxPage = CConvert.ToInt(set.Tables[1].Rows[0]["MaxPage"]),
+ TotalRow = CConvert.ToInt(set.Tables[1].Rows[0]["TotalRow"])
+ });
+ }
+ else
+ {
+ table.ErrNo = -1;
+ table.ErrData = set.Tables[0].Rows[0]["Descript"].ToString();
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+ private DataResult Set(RoomTypeTable table)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{table.Rows.Count}");
+
+ StringBuilder sql = new StringBuilder();
+ if (table.BeforeUpdate.Length > 0) { sql.AppendLine(table.BeforeUpdate.ToStringUtf8()); }
+
+ foreach (RoomType item in table.Rows)
+ {
+ sql.AppendLine(table.UpdateType == 2 ? item.UpdateSql() : item.AddSql());
+ }
+
+ if (table.AfterUpdate.Length > 0) { sql.AppendLine(table.AfterUpdate.ToStringUtf8()); }
+
+ string sqlCmd = sql.ToString();
+ OperationLog.Instance.WriteLog($"Sql生成:{sqlCmd}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (!msSqlNet.ExecuteNonQueryWithTran(sqlCmd))
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private DataResult AddOrUpdate(bool add, RoomType item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = add ? item.AddSql() : item.UpdateSql();
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private async Task AddOrUpdate(bool add, IAsyncStreamReader<RoomType> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ RoomType item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = AddOrUpdate(add, item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ private DataResult Delete(SqlWhere item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = $"DELETE FROM {TableName} WHERE {item.Data.ToStringUtf8()}";
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+
+ public async override Task OutputStream(DataRequest request, IServerStreamWriter<FileGrpcData> responseStream, ServerCallContext context)
+ {
+ try
+ {
+ using (DataTable data = GetDataTable(request))
+ {
+ byte[] bytes = Excel.Export(data);
+ FileGrpcData fileGrpcData = new FileGrpcData
+ {
+ Block = 1,
+ FileName = "Data",
+ Content = ByteString.CopyFrom(bytes)
+ };
+ await responseStream.WriteAsync(fileGrpcData);
+ }
+ }
+ catch { }
+ }
+
+ /// <summary>
+ /// 同期実行
+ /// </summary>
+ /// <param name="request"></param>
+ /// <param name="context"></param>
+ /// <returns></returns>
+ public override Task<RoomTypeTable> GetData(DataRequest request, ServerCallContext context)
+ {
+ return Task.FromResult(Get(request));
+ }
+
+ public async override Task GetDataStream(IAsyncStreamReader<DataRequest> requestStream, IServerStreamWriter<RoomTypeTable> responseStream, ServerCallContext context)
+ {
+ DataRequest request = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ request = message;
+ break;
+ }
+ RoomTypeTable table = Get(request);
+ await responseStream.WriteAsync(table); //データ送信
+ }
+
+ public override Task<DataResult> SetData(RoomTypeTable request, ServerCallContext context)
+ {
+ return Task.FromResult(Set(request));
+ }
+
+ public async override Task SetDataStream(IAsyncStreamReader<RoomTypeTable> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ RoomTypeTable table = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ table = message;
+ break;
+ }
+
+ DataResult result = Set(table);
+ //データ送信
+ await responseStream.WriteAsync(result);
+ }
+
+ public override Task<DataResult> Add(RoomType request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(true, request));
+ }
+
+ public async override Task AddStream(IAsyncStreamReader<RoomType> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(true, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Update(RoomType request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(false, request));
+ }
+
+ public async override Task UpdateStream(IAsyncStreamReader<RoomType> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(false, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Remove(SqlWhere request, ServerCallContext context)
+ {
+ return Task.FromResult(Delete(request));
+ }
+
+ public async override Task RemoveStream(IAsyncStreamReader<SqlWhere> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ SqlWhere item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = Delete(item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ #endregion
+}
diff --git a/HotelPms.GrpcService/Services/RoomViewLayoutService.cs b/HotelPms.GrpcService/Services/RoomViewLayoutService.cs
new file mode 100644
index 0000000..8f19a38
--- /dev/null
+++ b/HotelPms.GrpcService/Services/RoomViewLayoutService.cs
@@ -0,0 +1,369 @@
+using HotelPms.Data;
+using HotelPms.Data.Common.Pagination;
+using HotelPms.Data.Master;
+using HotelPms.GrpcService.Util;
+using HotelPms.Share.Data;
+using HotelPms.Share.IO;
+using HotelPms.Share.Util;
+using Google.Protobuf;
+using Grpc.Core;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
+using System.Data;
+using System.Data.SqlClient;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Tasks;
+
+namespace HotelPms.GrpcService
+{
+ /// <summary>
+ /// ■攻略
+ /// 1.RoomViewLayout.proto(message:RoomViewLayout、RoomViewLayoutTable;Service:RoomViewLayoutCore) ⇒ projectファイルのInclude
+ /// 2.RoomViewLayout.cs(両方)
+ /// 3.RoomViewLayoutTable.cs(両方)
+ /// 4.RoomViewLayoutService.cs(サーバー側) ⇒ StartupでMapGrpcServiceの処理が必要
+ /// 5.RoomViewLayoutAccess.cs(クライアント側)
+ /// </summary>
+ public class RoomViewLayoutService : RoomViewLayoutCore.RoomViewLayoutCoreBase
+ {
+ #region ★★★★★ Declartions ★★★★★
+
+ private static string TableName = "M_RoomViewLayout";
+ private readonly ILogger<RoomViewLayoutService> _logger;
+ private IConfiguration m_Configuration;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public RoomViewLayoutService(ILogger<RoomViewLayoutService> logger, IConfiguration configuration)
+ {
+ _logger = logger;
+ m_Configuration = configuration;
+ }
+
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+
+ private string GetSql(DataRequest request)
+ {
+ StringBuilder sql = new StringBuilder();
+ if (request.ActionType == 0)
+ {
+ sql.Append($"SELECT * FROM {TableName} {(string.IsNullOrEmpty(request.Data) ? string.Empty : $"WHERE {request.Data}")}");
+ }
+ else if (request.ActionType == 1 || request.ActionType == 2)
+ {
+ PagingRequest pagingRequest = JsonSerializer.Deserialize<PagingRequest>(request.Data);
+ sql.Append($"EXECUTE Pagination {pagingRequest.PageNumber},{pagingRequest.PageSize},'{pagingRequest.Table}','{pagingRequest.Field}','{pagingRequest.OrderBy}','{CConvert.FromBase64(pagingRequest.Filter)}'");
+ }
+ return sql.ToString();
+ }
+
+ private DataTable GetDataTable(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+ DataTable table = null;
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 2)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ table = set.Tables[0];
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+
+ private RoomViewLayoutTable Get(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+
+ RoomViewLayoutTable table = new RoomViewLayoutTable() { ErrNo = 0, ErrData = string.Empty, Name = nameof(RoomViewLayoutTable) };
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 0)
+ {
+ using (SqlConnection dbConnect = msSqlNet.Open())
+ {
+ using (SqlCommand command = new SqlCommand(sql, dbConnect))
+ {
+ OperationLog.Instance.WriteLog($"データ読込:{sql}");
+ command.CommandTimeout = 60000 * 100;
+ using (SqlDataReader reader = command.ExecuteReader(CommandBehavior.Default))
+ {
+ //エラーまだ対応していない
+ if (reader == null)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ while (reader.Read())
+ {
+ RoomViewLayout item = new RoomViewLayout();
+ item.ConvertReader(reader);
+ table.Rows.Add(item);
+ }
+ }
+ reader.Close();
+ }
+ }
+ }
+ }
+ else if (request.ActionType == 1)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ foreach (DataRow row in set.Tables[0].Rows)
+ {
+ RoomViewLayout item = new RoomViewLayout();
+ item.ConvertDataRow(row);
+ table.Rows.Add(item);
+ }
+
+ table.ErrData = JsonSerializer.Serialize(new PagingRespone()
+ {
+ MaxPage = CConvert.ToInt(set.Tables[1].Rows[0]["MaxPage"]),
+ TotalRow = CConvert.ToInt(set.Tables[1].Rows[0]["TotalRow"])
+ });
+ }
+ else
+ {
+ table.ErrNo = -1;
+ table.ErrData = set.Tables[0].Rows[0]["Descript"].ToString();
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+ private DataResult Set(RoomViewLayoutTable table)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{table.Rows.Count}");
+
+ StringBuilder sql = new StringBuilder();
+ if (table.BeforeUpdate.Length > 0) { sql.AppendLine(table.BeforeUpdate.ToStringUtf8()); }
+
+ foreach (RoomViewLayout item in table.Rows)
+ {
+ sql.AppendLine(table.UpdateType == 2 ? item.UpdateSql() : item.AddSql());
+ }
+
+ if (table.AfterUpdate.Length > 0) { sql.AppendLine(table.AfterUpdate.ToStringUtf8()); }
+
+ string sqlCmd = sql.ToString();
+ OperationLog.Instance.WriteLog($"Sql生成:{sqlCmd}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (!msSqlNet.ExecuteNonQueryWithTran(sqlCmd))
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private DataResult AddOrUpdate(bool add, RoomViewLayout item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = add ? item.AddSql() : item.UpdateSql();
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private async Task AddOrUpdate(bool add, IAsyncStreamReader<RoomViewLayout> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ RoomViewLayout item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = AddOrUpdate(add, item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ private DataResult Delete(SqlWhere item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = $"DELETE FROM {TableName} WHERE {item.Data.ToStringUtf8()}";
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+
+ public async override Task OutputStream(DataRequest request, IServerStreamWriter<FileGrpcData> responseStream, ServerCallContext context)
+ {
+ try
+ {
+ using (DataTable data = GetDataTable(request))
+ {
+ byte[] bytes = Excel.Export(data);
+ FileGrpcData fileGrpcData = new FileGrpcData
+ {
+ Block = 1,
+ FileName = "Data",
+ Content = ByteString.CopyFrom(bytes)
+ };
+ await responseStream.WriteAsync(fileGrpcData);
+ }
+ }
+ catch { }
+ }
+
+ /// <summary>
+ /// 同期実行
+ /// </summary>
+ /// <param name="request"></param>
+ /// <param name="context"></param>
+ /// <returns></returns>
+ public override Task<RoomViewLayoutTable> GetData(DataRequest request, ServerCallContext context)
+ {
+ return Task.FromResult(Get(request));
+ }
+
+ public async override Task GetDataStream(IAsyncStreamReader<DataRequest> requestStream, IServerStreamWriter<RoomViewLayoutTable> responseStream, ServerCallContext context)
+ {
+ DataRequest request = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ request = message;
+ break;
+ }
+ RoomViewLayoutTable table = Get(request);
+ await responseStream.WriteAsync(table); //データ送信
+ }
+
+ public override Task<DataResult> SetData(RoomViewLayoutTable request, ServerCallContext context)
+ {
+ return Task.FromResult(Set(request));
+ }
+
+ public async override Task SetDataStream(IAsyncStreamReader<RoomViewLayoutTable> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ RoomViewLayoutTable table = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ table = message;
+ break;
+ }
+
+ DataResult result = Set(table);
+ //データ送信
+ await responseStream.WriteAsync(result);
+ }
+
+ public override Task<DataResult> Add(RoomViewLayout request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(true, request));
+ }
+
+ public async override Task AddStream(IAsyncStreamReader<RoomViewLayout> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(true, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Update(RoomViewLayout request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(false, request));
+ }
+
+ public async override Task UpdateStream(IAsyncStreamReader<RoomViewLayout> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(false, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Remove(SqlWhere request, ServerCallContext context)
+ {
+ return Task.FromResult(Delete(request));
+ }
+
+ public async override Task RemoveStream(IAsyncStreamReader<SqlWhere> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ SqlWhere item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = Delete(item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ #endregion
+ }
+}
diff --git a/HotelPms.GrpcService/Services/RoomViewTabService.cs b/HotelPms.GrpcService/Services/RoomViewTabService.cs
new file mode 100644
index 0000000..491477d
--- /dev/null
+++ b/HotelPms.GrpcService/Services/RoomViewTabService.cs
@@ -0,0 +1,369 @@
+using HotelPms.Data;
+using HotelPms.Data.Common.Pagination;
+using HotelPms.Data.Master;
+using HotelPms.GrpcService.Util;
+using HotelPms.Share.Data;
+using HotelPms.Share.IO;
+using HotelPms.Share.Util;
+using Google.Protobuf;
+using Grpc.Core;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
+using System.Data;
+using System.Data.SqlClient;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Tasks;
+
+namespace HotelPms.GrpcService
+{
+ /// <summary>
+ /// ■攻略
+ /// 1.RoomViewTab.proto(message:RoomViewTab、RoomViewTabTable;Service:RoomViewTabCore) ⇒ projectファイルのInclude
+ /// 2.RoomViewTab.cs(両方)
+ /// 3.RoomViewTabTable.cs(両方)
+ /// 4.RoomViewTabService.cs(サーバー側) ⇒ StartupでMapGrpcServiceの処理が必要
+ /// 5.RoomViewTabAccess.cs(クライアント側)
+ /// </summary>
+ public class RoomViewTabService : RoomViewTabCore.RoomViewTabCoreBase
+ {
+ #region ★★★★★ Declartions ★★★★★
+
+ private static string TableName = "M_RoomViewTab";
+ private readonly ILogger<RoomViewTabService> _logger;
+ private IConfiguration m_Configuration;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public RoomViewTabService(ILogger<RoomViewTabService> logger, IConfiguration configuration)
+ {
+ _logger = logger;
+ m_Configuration = configuration;
+ }
+
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+
+ private string GetSql(DataRequest request)
+ {
+ StringBuilder sql = new StringBuilder();
+ if (request.ActionType == 0)
+ {
+ sql.Append($"SELECT * FROM {TableName} {(string.IsNullOrEmpty(request.Data) ? string.Empty : $"WHERE {request.Data}")}");
+ }
+ else if (request.ActionType == 1 || request.ActionType == 2)
+ {
+ PagingRequest pagingRequest = JsonSerializer.Deserialize<PagingRequest>(request.Data);
+ sql.Append($"EXECUTE Pagination {pagingRequest.PageNumber},{pagingRequest.PageSize},'{pagingRequest.Table}','{pagingRequest.Field}','{pagingRequest.OrderBy}','{CConvert.FromBase64(pagingRequest.Filter)}'");
+ }
+ return sql.ToString();
+ }
+
+ private DataTable GetDataTable(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+ DataTable table = null;
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 2)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ table = set.Tables[0];
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+
+ private RoomViewTabTable Get(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+
+ RoomViewTabTable table = new RoomViewTabTable() { ErrNo = 0, ErrData = string.Empty, Name = nameof(RoomViewTabTable) };
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 0)
+ {
+ using (SqlConnection dbConnect = msSqlNet.Open())
+ {
+ using (SqlCommand command = new SqlCommand(sql, dbConnect))
+ {
+ OperationLog.Instance.WriteLog($"データ読込:{sql}");
+ command.CommandTimeout = 60000 * 100;
+ using (SqlDataReader reader = command.ExecuteReader(CommandBehavior.Default))
+ {
+ //エラーまだ対応していない
+ if (reader == null)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ while (reader.Read())
+ {
+ RoomViewTab item = new RoomViewTab();
+ item.ConvertReader(reader);
+ table.Rows.Add(item);
+ }
+ }
+ reader.Close();
+ }
+ }
+ }
+ }
+ else if (request.ActionType == 1)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ foreach (DataRow row in set.Tables[0].Rows)
+ {
+ RoomViewTab item = new RoomViewTab();
+ item.ConvertDataRow(row);
+ table.Rows.Add(item);
+ }
+
+ table.ErrData = JsonSerializer.Serialize(new PagingRespone()
+ {
+ MaxPage = CConvert.ToInt(set.Tables[1].Rows[0]["MaxPage"]),
+ TotalRow = CConvert.ToInt(set.Tables[1].Rows[0]["TotalRow"])
+ });
+ }
+ else
+ {
+ table.ErrNo = -1;
+ table.ErrData = set.Tables[0].Rows[0]["Descript"].ToString();
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+ private DataResult Set(RoomViewTabTable table)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{table.Rows.Count}");
+
+ StringBuilder sql = new StringBuilder();
+ if (table.BeforeUpdate.Length > 0) { sql.AppendLine(table.BeforeUpdate.ToStringUtf8()); }
+
+ foreach (RoomViewTab item in table.Rows)
+ {
+ sql.AppendLine(table.UpdateType == 2 ? item.UpdateSql() : item.AddSql());
+ }
+
+ if (table.AfterUpdate.Length > 0) { sql.AppendLine(table.AfterUpdate.ToStringUtf8()); }
+
+ string sqlCmd = sql.ToString();
+ OperationLog.Instance.WriteLog($"Sql生成:{sqlCmd}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (!msSqlNet.ExecuteNonQueryWithTran(sqlCmd))
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private DataResult AddOrUpdate(bool add, RoomViewTab item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = add ? item.AddSql() : item.UpdateSql();
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private async Task AddOrUpdate(bool add, IAsyncStreamReader<RoomViewTab> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ RoomViewTab item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = AddOrUpdate(add, item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ private DataResult Delete(SqlWhere item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = $"DELETE FROM {TableName} WHERE {item.Data.ToStringUtf8()}";
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+
+ public async override Task OutputStream(DataRequest request, IServerStreamWriter<FileGrpcData> responseStream, ServerCallContext context)
+ {
+ try
+ {
+ using (DataTable data = GetDataTable(request))
+ {
+ byte[] bytes = Excel.Export(data);
+ FileGrpcData fileGrpcData = new FileGrpcData
+ {
+ Block = 1,
+ FileName = "Data",
+ Content = ByteString.CopyFrom(bytes)
+ };
+ await responseStream.WriteAsync(fileGrpcData);
+ }
+ }
+ catch { }
+ }
+
+ /// <summary>
+ /// 同期実行
+ /// </summary>
+ /// <param name="request"></param>
+ /// <param name="context"></param>
+ /// <returns></returns>
+ public override Task<RoomViewTabTable> GetData(DataRequest request, ServerCallContext context)
+ {
+ return Task.FromResult(Get(request));
+ }
+
+ public async override Task GetDataStream(IAsyncStreamReader<DataRequest> requestStream, IServerStreamWriter<RoomViewTabTable> responseStream, ServerCallContext context)
+ {
+ DataRequest request = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ request = message;
+ break;
+ }
+ RoomViewTabTable table = Get(request);
+ await responseStream.WriteAsync(table); //データ送信
+ }
+
+ public override Task<DataResult> SetData(RoomViewTabTable request, ServerCallContext context)
+ {
+ return Task.FromResult(Set(request));
+ }
+
+ public async override Task SetDataStream(IAsyncStreamReader<RoomViewTabTable> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ RoomViewTabTable table = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ table = message;
+ break;
+ }
+
+ DataResult result = Set(table);
+ //データ送信
+ await responseStream.WriteAsync(result);
+ }
+
+ public override Task<DataResult> Add(RoomViewTab request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(true, request));
+ }
+
+ public async override Task AddStream(IAsyncStreamReader<RoomViewTab> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(true, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Update(RoomViewTab request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(false, request));
+ }
+
+ public async override Task UpdateStream(IAsyncStreamReader<RoomViewTab> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(false, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Remove(SqlWhere request, ServerCallContext context)
+ {
+ return Task.FromResult(Delete(request));
+ }
+
+ public async override Task RemoveStream(IAsyncStreamReader<SqlWhere> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ SqlWhere item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = Delete(item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ #endregion
+ }
+}
diff --git a/HotelPms.GrpcService/Services/SaleDivService.cs b/HotelPms.GrpcService/Services/SaleDivService.cs
new file mode 100644
index 0000000..6bb7c92
--- /dev/null
+++ b/HotelPms.GrpcService/Services/SaleDivService.cs
@@ -0,0 +1,369 @@
+using HotelPms.Data;
+using HotelPms.Data.Common.Pagination;
+using HotelPms.Data.UseInfo;
+using HotelPms.GrpcService.Util;
+using HotelPms.Share.Data;
+using HotelPms.Share.IO;
+using HotelPms.Share.Util;
+using Google.Protobuf;
+using Grpc.Core;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
+using System.Data;
+using System.Data.SqlClient;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Tasks;
+
+namespace HotelPms.GrpcService
+{
+ /// <summary>
+ /// ■攻略
+ /// 1.SaleDiv.proto(message:SaleDiv、SaleDivTable;Service:SaleDivCore) ⇒ projectファイルのInclude
+ /// 2.SaleDiv.cs(両方)
+ /// 3.SaleDivTable.cs(両方)
+ /// 4.SaleDivService.cs(サーバー側) ⇒ StartupでMapGrpcServiceの処理が必要
+ /// 5.SaleDivAccess.cs(クライアント側)
+ /// </summary>
+ public class SaleDivService : SaleDivCore.SaleDivCoreBase
+ {
+ #region ★★★★★ Declartions ★★★★★
+
+ private static string TableName = "D_SaleDiv";
+ private readonly ILogger<SaleDivService> _logger;
+ private IConfiguration m_Configuration;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public SaleDivService(ILogger<SaleDivService> logger, IConfiguration configuration)
+ {
+ _logger = logger;
+ m_Configuration = configuration;
+ }
+
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+
+ private string GetSql(DataRequest request)
+ {
+ StringBuilder sql = new StringBuilder();
+ if (request.ActionType == 0)
+ {
+ sql.Append($"SELECT * FROM {TableName} {(string.IsNullOrEmpty(request.Data) ? string.Empty : $"WHERE {request.Data}")}");
+ }
+ else if (request.ActionType == 1 || request.ActionType == 2)
+ {
+ PagingRequest pagingRequest = JsonSerializer.Deserialize<PagingRequest>(request.Data);
+ sql.Append($"EXECUTE Pagination {pagingRequest.PageNumber},{pagingRequest.PageSize},'{pagingRequest.Table}','{pagingRequest.Field}','{pagingRequest.OrderBy}','{CConvert.FromBase64(pagingRequest.Filter)}'");
+ }
+ return sql.ToString();
+ }
+
+ private DataTable GetDataTable(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+ DataTable table = null;
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 2)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ table = set.Tables[0];
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+
+ private SaleDivTable Get(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+
+ SaleDivTable table = new SaleDivTable() { ErrNo = 0, ErrData = string.Empty, Name = nameof(SaleDivTable) };
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 0)
+ {
+ using (SqlConnection dbConnect = msSqlNet.Open())
+ {
+ using (SqlCommand command = new SqlCommand(sql, dbConnect))
+ {
+ OperationLog.Instance.WriteLog($"データ読込:{sql}");
+ command.CommandTimeout = 60000 * 100;
+ using (SqlDataReader reader = command.ExecuteReader(CommandBehavior.Default))
+ {
+ //エラーまだ対応していない
+ if (reader == null)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ while (reader.Read())
+ {
+ SaleDiv item = new SaleDiv();
+ item.ConvertReader(reader);
+ table.Rows.Add(item);
+ }
+ }
+ reader.Close();
+ }
+ }
+ }
+ }
+ else if (request.ActionType == 1)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ foreach (DataRow row in set.Tables[0].Rows)
+ {
+ SaleDiv item = new SaleDiv();
+ item.ConvertDataRow(row);
+ table.Rows.Add(item);
+ }
+
+ table.ErrData = JsonSerializer.Serialize(new PagingRespone()
+ {
+ MaxPage = CConvert.ToInt(set.Tables[1].Rows[0]["MaxPage"]),
+ TotalRow = CConvert.ToInt(set.Tables[1].Rows[0]["TotalRow"])
+ });
+ }
+ else
+ {
+ table.ErrNo = -1;
+ table.ErrData = set.Tables[0].Rows[0]["Descript"].ToString();
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+ private DataResult Set(SaleDivTable table)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{table.Rows.Count}");
+
+ StringBuilder sql = new StringBuilder();
+ if (table.BeforeUpdate.Length > 0) { sql.AppendLine(table.BeforeUpdate.ToStringUtf8()); }
+
+ foreach (SaleDiv item in table.Rows)
+ {
+ sql.AppendLine(table.UpdateType == 2 ? item.UpdateSql() : item.AddSql());
+ }
+
+ if (table.AfterUpdate.Length > 0) { sql.AppendLine(table.AfterUpdate.ToStringUtf8()); }
+
+ string sqlCmd = sql.ToString();
+ OperationLog.Instance.WriteLog($"Sql生成:{sqlCmd}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (!msSqlNet.ExecuteNonQueryWithTran(sqlCmd))
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private DataResult AddOrUpdate(bool add, SaleDiv item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = add ? item.AddSql() : item.UpdateSql();
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private async Task AddOrUpdate(bool add, IAsyncStreamReader<SaleDiv> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ SaleDiv item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = AddOrUpdate(add, item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ private DataResult Delete(SqlWhere item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = $"DELETE FROM {TableName} WHERE {item.Data.ToStringUtf8()}";
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+
+ public async override Task OutputStream(DataRequest request, IServerStreamWriter<FileGrpcData> responseStream, ServerCallContext context)
+ {
+ try
+ {
+ using (DataTable data = GetDataTable(request))
+ {
+ byte[] bytes = Excel.Export(data);
+ FileGrpcData fileGrpcData = new FileGrpcData
+ {
+ Block = 1,
+ FileName = "Data",
+ Content = ByteString.CopyFrom(bytes)
+ };
+ await responseStream.WriteAsync(fileGrpcData);
+ }
+ }
+ catch { }
+ }
+
+ /// <summary>
+ /// 同期実行
+ /// </summary>
+ /// <param name="request"></param>
+ /// <param name="context"></param>
+ /// <returns></returns>
+ public override Task<SaleDivTable> GetData(DataRequest request, ServerCallContext context)
+ {
+ return Task.FromResult(Get(request));
+ }
+
+ public async override Task GetDataStream(IAsyncStreamReader<DataRequest> requestStream, IServerStreamWriter<SaleDivTable> responseStream, ServerCallContext context)
+ {
+ DataRequest request = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ request = message;
+ break;
+ }
+ SaleDivTable table = Get(request);
+ await responseStream.WriteAsync(table); //データ送信
+ }
+
+ public override Task<DataResult> SetData(SaleDivTable request, ServerCallContext context)
+ {
+ return Task.FromResult(Set(request));
+ }
+
+ public async override Task SetDataStream(IAsyncStreamReader<SaleDivTable> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ SaleDivTable table = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ table = message;
+ break;
+ }
+
+ DataResult result = Set(table);
+ //データ送信
+ await responseStream.WriteAsync(result);
+ }
+
+ public override Task<DataResult> Add(SaleDiv request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(true, request));
+ }
+
+ public async override Task AddStream(IAsyncStreamReader<SaleDiv> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(true, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Update(SaleDiv request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(false, request));
+ }
+
+ public async override Task UpdateStream(IAsyncStreamReader<SaleDiv> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(false, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Remove(SqlWhere request, ServerCallContext context)
+ {
+ return Task.FromResult(Delete(request));
+ }
+
+ public async override Task RemoveStream(IAsyncStreamReader<SqlWhere> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ SqlWhere item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = Delete(item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ #endregion
+ }
+}
diff --git a/HotelPms.GrpcService/Services/SaleService.cs b/HotelPms.GrpcService/Services/SaleService.cs
new file mode 100644
index 0000000..7dcc06d
--- /dev/null
+++ b/HotelPms.GrpcService/Services/SaleService.cs
@@ -0,0 +1,368 @@
+using HotelPms.Data;
+using HotelPms.Data.Common.Pagination;
+using HotelPms.Data.UseInfo;
+using HotelPms.GrpcService.Util;
+using HotelPms.Share.Data;
+using HotelPms.Share.IO;
+using HotelPms.Share.Util;
+using Google.Protobuf;
+using Grpc.Core;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
+using System.Data;
+using System.Data.SqlClient;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Tasks;
+
+namespace HotelPms.GrpcService;
+
+/// <summary>
+/// ■攻略
+/// 1.Sale.proto(message:Sale、SaleTable;Service:SaleCore) ⇒ projectファイルのInclude
+/// 2.Sale.cs(両方)
+/// 3.SaleTable.cs(両方)
+/// 4.SaleService.cs(サーバー側) ⇒ StartupでMapGrpcServiceの処理が必要
+/// 5.SaleAccess.cs(クライアント側)
+/// </summary>
+public class SaleService : SaleCore.SaleCoreBase
+{
+ #region ★★★★★ Declartions ★★★★★
+
+ private static string TableName = "D_Sale";
+ private readonly ILogger<SaleService> _logger;
+ private IConfiguration m_Configuration;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public SaleService(ILogger<SaleService> logger, IConfiguration configuration)
+ {
+ _logger = logger;
+ m_Configuration = configuration;
+ }
+
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+
+ private string GetSql(DataRequest request)
+ {
+ StringBuilder sql = new StringBuilder();
+ if (request.ActionType == 0)
+ {
+ sql.Append($"SELECT * FROM {TableName} {(string.IsNullOrEmpty(request.Data) ? string.Empty : $"WHERE {request.Data}")}");
+ }
+ else if (request.ActionType == 1 || request.ActionType == 2)
+ {
+ PagingRequest pagingRequest = JsonSerializer.Deserialize<PagingRequest>(request.Data);
+ sql.Append($"EXECUTE Pagination {pagingRequest.PageNumber},{pagingRequest.PageSize},'{pagingRequest.Table}','{pagingRequest.Field}','{pagingRequest.OrderBy}','{CConvert.FromBase64(pagingRequest.Filter)}'");
+ }
+ return sql.ToString();
+ }
+
+ private DataTable GetDataTable(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+ DataTable table = null;
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 2)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ table = set.Tables[0];
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+
+ private SaleTable Get(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+
+ SaleTable table = new SaleTable() { ErrNo = 0, ErrData = string.Empty, Name = nameof(SaleTable) };
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 0)
+ {
+ using (SqlConnection dbConnect = msSqlNet.Open())
+ {
+ using (SqlCommand command = new SqlCommand(sql, dbConnect))
+ {
+ OperationLog.Instance.WriteLog($"データ読込:{sql}");
+ command.CommandTimeout = 60000 * 100;
+ using (SqlDataReader reader = command.ExecuteReader(CommandBehavior.Default))
+ {
+ //エラーまだ対応していない
+ if (reader == null)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ while (reader.Read())
+ {
+ Sale item = new Sale();
+ item.ConvertReader(reader);
+ table.Rows.Add(item);
+ }
+ }
+ reader.Close();
+ }
+ }
+ }
+ }
+ else if (request.ActionType == 1)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ foreach (DataRow row in set.Tables[0].Rows)
+ {
+ Sale item = new Sale();
+ item.ConvertDataRow(row);
+ table.Rows.Add(item);
+ }
+
+ table.Tag = JsonSerializer.Serialize(new PagingRespone()
+ {
+ MaxPage = CConvert.ToInt(set.Tables[1].Rows[0]["MaxPage"]),
+ TotalRow = CConvert.ToInt(set.Tables[1].Rows[0]["TotalRow"])
+ });
+ }
+ else
+ {
+ table.ErrNo = -1;
+ table.ErrData = set.Tables[0].Rows[0]["Descript"].ToString();
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+ private DataResult Set(SaleTable table)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{table.Rows.Count}");
+
+ StringBuilder sql = new StringBuilder();
+ if (table.BeforeUpdate.Length > 0) { sql.AppendLine(table.BeforeUpdate.ToStringUtf8()); }
+
+ foreach (Sale item in table.Rows)
+ {
+ sql.AppendLine(table.UpdateType == 2 ? item.UpdateSql() : item.AddSql());
+ }
+
+ if (table.AfterUpdate.Length > 0) { sql.AppendLine(table.AfterUpdate.ToStringUtf8()); }
+
+ string sqlCmd = sql.ToString();
+ OperationLog.Instance.WriteLog($"Sql生成:{sqlCmd}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (!msSqlNet.ExecuteNonQueryWithTran(sqlCmd))
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private DataResult AddOrUpdate(bool add, Sale item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = add ? item.AddSql() : item.UpdateSql();
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private async Task AddOrUpdate(bool add, IAsyncStreamReader<Sale> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ Sale item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = AddOrUpdate(add, item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ private DataResult Delete(SqlWhere item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = $"DELETE FROM {TableName} WHERE {item.Data.ToStringUtf8()}";
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+
+ public async override Task OutputStream(DataRequest request, IServerStreamWriter<FileGrpcData> responseStream, ServerCallContext context)
+ {
+ try
+ {
+ using (DataTable data = GetDataTable(request))
+ {
+ byte[] bytes = Excel.Export(data);
+ FileGrpcData fileGrpcData = new FileGrpcData
+ {
+ Block = 1,
+ FileName = "Data",
+ Content = ByteString.CopyFrom(bytes)
+ };
+ await responseStream.WriteAsync(fileGrpcData);
+ }
+ }
+ catch { }
+ }
+
+ /// <summary>
+ /// 同期実行
+ /// </summary>
+ /// <param name="request"></param>
+ /// <param name="context"></param>
+ /// <returns></returns>
+ public override Task<SaleTable> GetData(DataRequest request, ServerCallContext context)
+ {
+ return Task.FromResult(Get(request));
+ }
+
+ public async override Task GetDataStream(IAsyncStreamReader<DataRequest> requestStream, IServerStreamWriter<SaleTable> responseStream, ServerCallContext context)
+ {
+ DataRequest request = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ request = message;
+ break;
+ }
+ SaleTable table = Get(request);
+ await responseStream.WriteAsync(table); //データ送信
+ }
+
+ public override Task<DataResult> SetData(SaleTable request, ServerCallContext context)
+ {
+ return Task.FromResult(Set(request));
+ }
+
+ public async override Task SetDataStream(IAsyncStreamReader<SaleTable> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ SaleTable table = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ table = message;
+ break;
+ }
+
+ DataResult result = Set(table);
+ //データ送信
+ await responseStream.WriteAsync(result);
+ }
+
+ public override Task<DataResult> Add(Sale request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(true, request));
+ }
+
+ public async override Task AddStream(IAsyncStreamReader<Sale> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(true, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Update(Sale request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(false, request));
+ }
+
+ public async override Task UpdateStream(IAsyncStreamReader<Sale> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(false, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Remove(SqlWhere request, ServerCallContext context)
+ {
+ return Task.FromResult(Delete(request));
+ }
+
+ public async override Task RemoveStream(IAsyncStreamReader<SqlWhere> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ SqlWhere item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = Delete(item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ #endregion
+}
diff --git a/HotelPms.GrpcService/Services/UseAlloService.cs b/HotelPms.GrpcService/Services/UseAlloService.cs
new file mode 100644
index 0000000..f75799f
--- /dev/null
+++ b/HotelPms.GrpcService/Services/UseAlloService.cs
@@ -0,0 +1,369 @@
+using HotelPms.Data;
+using HotelPms.Data.Common.Pagination;
+using HotelPms.Data.UseInfo;
+using HotelPms.GrpcService.Util;
+using HotelPms.Share.Data;
+using HotelPms.Share.IO;
+using HotelPms.Share.Util;
+using Google.Protobuf;
+using Grpc.Core;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
+using System.Data;
+using System.Data.SqlClient;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Tasks;
+
+namespace HotelPms.GrpcService
+{
+ /// <summary>
+ /// ■攻略
+ /// 1.UseAllo.proto(message:UseAllo、UseAlloTable;Service:UseAlloCore) ⇒ projectファイルのInclude
+ /// 2.UseAllo.cs(両方)
+ /// 3.UseAlloTable.cs(両方)
+ /// 4.UseAlloService.cs(サーバー側) ⇒ StartupでMapGrpcServiceの処理が必要
+ /// 5.UseAlloAccess.cs(クライアント側)
+ /// </summary>
+ public class UseAlloService : UseAlloCore.UseAlloCoreBase
+ {
+ #region ★★★★★ Declartions ★★★★★
+
+ private static string TableName = "D_UseAllo";
+ private readonly ILogger<UseAlloService> _logger;
+ private IConfiguration m_Configuration;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public UseAlloService(ILogger<UseAlloService> logger, IConfiguration configuration)
+ {
+ _logger = logger;
+ m_Configuration = configuration;
+ }
+
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+
+ private string GetSql(DataRequest request)
+ {
+ StringBuilder sql = new StringBuilder();
+ if (request.ActionType == 0)
+ {
+ sql.Append($"SELECT * FROM {TableName} {(string.IsNullOrEmpty(request.Data) ? string.Empty : $"WHERE {request.Data}")}");
+ }
+ else if (request.ActionType == 1 || request.ActionType == 2)
+ {
+ PagingRequest pagingRequest = JsonSerializer.Deserialize<PagingRequest>(request.Data);
+ sql.Append($"EXECUTE Pagination {pagingRequest.PageNumber},{pagingRequest.PageSize},'{pagingRequest.Table}','{pagingRequest.Field}','{pagingRequest.OrderBy}','{CConvert.FromBase64(pagingRequest.Filter)}'");
+ }
+ return sql.ToString();
+ }
+
+ private DataTable GetDataTable(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+ DataTable table = null;
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 2)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ table = set.Tables[0];
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+
+ private UseAlloTable Get(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+
+ UseAlloTable table = new UseAlloTable() { ErrNo = 0, ErrData = string.Empty, Name = nameof(UseAlloTable) };
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 0)
+ {
+ using (SqlConnection dbConnect = msSqlNet.Open())
+ {
+ using (SqlCommand command = new SqlCommand(sql, dbConnect))
+ {
+ OperationLog.Instance.WriteLog($"データ読込:{sql}");
+ command.CommandTimeout = 60000 * 100;
+ using (SqlDataReader reader = command.ExecuteReader(CommandBehavior.Default))
+ {
+ //エラーまだ対応していない
+ if (reader == null)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ while (reader.Read())
+ {
+ UseAllo item = new UseAllo();
+ item.ConvertReader(reader);
+ table.Rows.Add(item);
+ }
+ }
+ reader.Close();
+ }
+ }
+ }
+ }
+ else if (request.ActionType == 1)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ foreach (DataRow row in set.Tables[0].Rows)
+ {
+ UseAllo item = new UseAllo();
+ item.ConvertDataRow(row);
+ table.Rows.Add(item);
+ }
+
+ table.ErrData = JsonSerializer.Serialize(new PagingRespone()
+ {
+ MaxPage = CConvert.ToInt(set.Tables[1].Rows[0]["MaxPage"]),
+ TotalRow = CConvert.ToInt(set.Tables[1].Rows[0]["TotalRow"])
+ });
+ }
+ else
+ {
+ table.ErrNo = -1;
+ table.ErrData = set.Tables[0].Rows[0]["Descript"].ToString();
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+ private DataResult Set(UseAlloTable table)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{table.Rows.Count}");
+
+ StringBuilder sql = new StringBuilder();
+ if (table.BeforeUpdate.Length > 0) { sql.AppendLine(table.BeforeUpdate.ToStringUtf8()); }
+
+ foreach (UseAllo item in table.Rows)
+ {
+ sql.AppendLine(table.UpdateType == 2 ? item.UpdateSql() : item.AddSql());
+ }
+
+ if (table.AfterUpdate.Length > 0) { sql.AppendLine(table.AfterUpdate.ToStringUtf8()); }
+
+ string sqlCmd = sql.ToString();
+ OperationLog.Instance.WriteLog($"Sql生成:{sqlCmd}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (!msSqlNet.ExecuteNonQueryWithTran(sqlCmd))
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private DataResult AddOrUpdate(bool add, UseAllo item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = add ? item.AddSql() : item.UpdateSql();
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private async Task AddOrUpdate(bool add, IAsyncStreamReader<UseAllo> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ UseAllo item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = AddOrUpdate(add, item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ private DataResult Delete(SqlWhere item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = $"DELETE FROM {TableName} WHERE {item.Data.ToStringUtf8()}";
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+
+ public async override Task OutputStream(DataRequest request, IServerStreamWriter<FileGrpcData> responseStream, ServerCallContext context)
+ {
+ try
+ {
+ using (DataTable data = GetDataTable(request))
+ {
+ byte[] bytes = Excel.Export(data);
+ FileGrpcData fileGrpcData = new FileGrpcData
+ {
+ Block = 1,
+ FileName = "Data",
+ Content = ByteString.CopyFrom(bytes)
+ };
+ await responseStream.WriteAsync(fileGrpcData);
+ }
+ }
+ catch { }
+ }
+
+ /// <summary>
+ /// 同期実行
+ /// </summary>
+ /// <param name="request"></param>
+ /// <param name="context"></param>
+ /// <returns></returns>
+ public override Task<UseAlloTable> GetData(DataRequest request, ServerCallContext context)
+ {
+ return Task.FromResult(Get(request));
+ }
+
+ public async override Task GetDataStream(IAsyncStreamReader<DataRequest> requestStream, IServerStreamWriter<UseAlloTable> responseStream, ServerCallContext context)
+ {
+ DataRequest request = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ request = message;
+ break;
+ }
+ UseAlloTable table = Get(request);
+ await responseStream.WriteAsync(table); //データ送信
+ }
+
+ public override Task<DataResult> SetData(UseAlloTable request, ServerCallContext context)
+ {
+ return Task.FromResult(Set(request));
+ }
+
+ public async override Task SetDataStream(IAsyncStreamReader<UseAlloTable> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ UseAlloTable table = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ table = message;
+ break;
+ }
+
+ DataResult result = Set(table);
+ //データ送信
+ await responseStream.WriteAsync(result);
+ }
+
+ public override Task<DataResult> Add(UseAllo request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(true, request));
+ }
+
+ public async override Task AddStream(IAsyncStreamReader<UseAllo> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(true, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Update(UseAllo request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(false, request));
+ }
+
+ public async override Task UpdateStream(IAsyncStreamReader<UseAllo> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(false, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Remove(SqlWhere request, ServerCallContext context)
+ {
+ return Task.FromResult(Delete(request));
+ }
+
+ public async override Task RemoveStream(IAsyncStreamReader<SqlWhere> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ SqlWhere item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = Delete(item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ #endregion
+ }
+}
diff --git a/HotelPms.GrpcService/Services/UseDetailService.cs b/HotelPms.GrpcService/Services/UseDetailService.cs
new file mode 100644
index 0000000..25bbbf5
--- /dev/null
+++ b/HotelPms.GrpcService/Services/UseDetailService.cs
@@ -0,0 +1,369 @@
+using HotelPms.Data;
+using HotelPms.Data.Common.Pagination;
+using HotelPms.Data.UseInfo;
+using HotelPms.GrpcService.Util;
+using HotelPms.Share.Data;
+using HotelPms.Share.IO;
+using HotelPms.Share.Util;
+using Google.Protobuf;
+using Grpc.Core;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
+using System.Data;
+using System.Data.SqlClient;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Tasks;
+
+namespace HotelPms.GrpcService
+{
+ /// <summary>
+ /// ■攻略
+ /// 1.UseDetail.proto(message:UseDetail、UseDetailTable;Service:UseDetailCore) ⇒ projectファイルのInclude
+ /// 2.UseDetail.cs(両方)
+ /// 3.UseDetailTable.cs(両方)
+ /// 4.UseDetailService.cs(サーバー側) ⇒ StartupでMapGrpcServiceの処理が必要
+ /// 5.UseDetailAccess.cs(クライアント側)
+ /// </summary>
+ public class UseDetailService : UseDetailCore.UseDetailCoreBase
+ {
+ #region ★★★★★ Declartions ★★★★★
+
+ private static string TableName = "D_UseDetail";
+ private readonly ILogger<UseDetailService> _logger;
+ private IConfiguration m_Configuration;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public UseDetailService(ILogger<UseDetailService> logger, IConfiguration configuration)
+ {
+ _logger = logger;
+ m_Configuration = configuration;
+ }
+
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+
+ private string GetSql(DataRequest request)
+ {
+ StringBuilder sql = new StringBuilder();
+ if (request.ActionType == 0)
+ {
+ sql.Append($"SELECT * FROM {TableName} {(string.IsNullOrEmpty(request.Data) ? string.Empty : $"WHERE {request.Data}")}");
+ }
+ else if (request.ActionType == 1 || request.ActionType == 2)
+ {
+ PagingRequest pagingRequest = JsonSerializer.Deserialize<PagingRequest>(request.Data);
+ sql.Append($"EXECUTE Pagination {pagingRequest.PageNumber},{pagingRequest.PageSize},'{pagingRequest.Table}','{pagingRequest.Field}','{pagingRequest.OrderBy}','{CConvert.FromBase64(pagingRequest.Filter)}'");
+ }
+ return sql.ToString();
+ }
+
+ private DataTable GetDataTable(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+ DataTable table = null;
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 2)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ table = set.Tables[0];
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+
+ private UseDetailTable Get(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+
+ UseDetailTable table = new UseDetailTable() { ErrNo = 0, ErrData = string.Empty, Name = nameof(UseDetailTable) };
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 0)
+ {
+ using (SqlConnection dbConnect = msSqlNet.Open())
+ {
+ using (SqlCommand command = new SqlCommand(sql, dbConnect))
+ {
+ OperationLog.Instance.WriteLog($"データ読込:{sql}");
+ command.CommandTimeout = 60000 * 100;
+ using (SqlDataReader reader = command.ExecuteReader(CommandBehavior.Default))
+ {
+ //エラーまだ対応していない
+ if (reader == null)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ while (reader.Read())
+ {
+ UseDetail item = new UseDetail();
+ item.ConvertReader(reader);
+ table.Rows.Add(item);
+ }
+ }
+ reader.Close();
+ }
+ }
+ }
+ }
+ else if (request.ActionType == 1)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ foreach (DataRow row in set.Tables[0].Rows)
+ {
+ UseDetail item = new UseDetail();
+ item.ConvertDataRow(row);
+ table.Rows.Add(item);
+ }
+
+ table.ErrData = JsonSerializer.Serialize(new PagingRespone()
+ {
+ MaxPage = CConvert.ToInt(set.Tables[1].Rows[0]["MaxPage"]),
+ TotalRow = CConvert.ToInt(set.Tables[1].Rows[0]["TotalRow"])
+ });
+ }
+ else
+ {
+ table.ErrNo = -1;
+ table.ErrData = set.Tables[0].Rows[0]["Descript"].ToString();
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+ private DataResult Set(UseDetailTable table)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{table.Rows.Count}");
+
+ StringBuilder sql = new StringBuilder();
+ if (table.BeforeUpdate.Length > 0) { sql.AppendLine(table.BeforeUpdate.ToStringUtf8()); }
+
+ foreach (UseDetail item in table.Rows)
+ {
+ sql.AppendLine(table.UpdateType == 2 ? item.UpdateSql() : item.AddSql());
+ }
+
+ if (table.AfterUpdate.Length > 0) { sql.AppendLine(table.AfterUpdate.ToStringUtf8()); }
+
+ string sqlCmd = sql.ToString();
+ OperationLog.Instance.WriteLog($"Sql生成:{sqlCmd}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (!msSqlNet.ExecuteNonQueryWithTran(sqlCmd))
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private DataResult AddOrUpdate(bool add, UseDetail item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = add ? item.AddSql() : item.UpdateSql();
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private async Task AddOrUpdate(bool add, IAsyncStreamReader<UseDetail> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ UseDetail item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = AddOrUpdate(add, item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ private DataResult Delete(SqlWhere item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = $"DELETE FROM {TableName} WHERE {item.Data.ToStringUtf8()}";
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+
+ public async override Task OutputStream(DataRequest request, IServerStreamWriter<FileGrpcData> responseStream, ServerCallContext context)
+ {
+ try
+ {
+ using (DataTable data = GetDataTable(request))
+ {
+ byte[] bytes = Excel.Export(data);
+ FileGrpcData fileGrpcData = new FileGrpcData
+ {
+ Block = 1,
+ FileName = "Data",
+ Content = ByteString.CopyFrom(bytes)
+ };
+ await responseStream.WriteAsync(fileGrpcData);
+ }
+ }
+ catch { }
+ }
+
+ /// <summary>
+ /// 同期実行
+ /// </summary>
+ /// <param name="request"></param>
+ /// <param name="context"></param>
+ /// <returns></returns>
+ public override Task<UseDetailTable> GetData(DataRequest request, ServerCallContext context)
+ {
+ return Task.FromResult(Get(request));
+ }
+
+ public async override Task GetDataStream(IAsyncStreamReader<DataRequest> requestStream, IServerStreamWriter<UseDetailTable> responseStream, ServerCallContext context)
+ {
+ DataRequest request = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ request = message;
+ break;
+ }
+ UseDetailTable table = Get(request);
+ await responseStream.WriteAsync(table); //データ送信
+ }
+
+ public override Task<DataResult> SetData(UseDetailTable request, ServerCallContext context)
+ {
+ return Task.FromResult(Set(request));
+ }
+
+ public async override Task SetDataStream(IAsyncStreamReader<UseDetailTable> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ UseDetailTable table = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ table = message;
+ break;
+ }
+
+ DataResult result = Set(table);
+ //データ送信
+ await responseStream.WriteAsync(result);
+ }
+
+ public override Task<DataResult> Add(UseDetail request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(true, request));
+ }
+
+ public async override Task AddStream(IAsyncStreamReader<UseDetail> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(true, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Update(UseDetail request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(false, request));
+ }
+
+ public async override Task UpdateStream(IAsyncStreamReader<UseDetail> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(false, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Remove(SqlWhere request, ServerCallContext context)
+ {
+ return Task.FromResult(Delete(request));
+ }
+
+ public async override Task RemoveStream(IAsyncStreamReader<SqlWhere> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ SqlWhere item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = Delete(item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ #endregion
+ }
+}
diff --git a/HotelPms.GrpcService/Services/UseFreeService.cs b/HotelPms.GrpcService/Services/UseFreeService.cs
new file mode 100644
index 0000000..d8f9753
--- /dev/null
+++ b/HotelPms.GrpcService/Services/UseFreeService.cs
@@ -0,0 +1,369 @@
+using HotelPms.Data;
+using HotelPms.Data.Common.Pagination;
+using HotelPms.Data.UseInfo;
+using HotelPms.GrpcService.Util;
+using HotelPms.Share.Data;
+using HotelPms.Share.IO;
+using HotelPms.Share.Util;
+using Google.Protobuf;
+using Grpc.Core;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
+using System.Data;
+using System.Data.SqlClient;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Tasks;
+
+namespace HotelPms.GrpcService
+{
+ /// <summary>
+ /// ■攻略
+ /// 1.UseFree.proto(message:UseFree、UseFreeTable;Service:UseFreeCore) ⇒ projectファイルのInclude
+ /// 2.UseFree.cs(両方)
+ /// 3.UseFreeTable.cs(両方)
+ /// 4.UseFreeService.cs(サーバー側) ⇒ StartupでMapGrpcServiceの処理が必要
+ /// 5.UseFreeAccess.cs(クライアント側)
+ /// </summary>
+ public class UseFreeService : UseFreeCore.UseFreeCoreBase
+ {
+ #region ★★★★★ Declartions ★★★★★
+
+ private static string TableName = "D_UseFree";
+ private readonly ILogger<UseFreeService> _logger;
+ private IConfiguration m_Configuration;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public UseFreeService(ILogger<UseFreeService> logger, IConfiguration configuration)
+ {
+ _logger = logger;
+ m_Configuration = configuration;
+ }
+
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+
+ private string GetSql(DataRequest request)
+ {
+ StringBuilder sql = new StringBuilder();
+ if (request.ActionType == 0)
+ {
+ sql.Append($"SELECT * FROM {TableName} {(string.IsNullOrEmpty(request.Data) ? string.Empty : $"WHERE {request.Data}")}");
+ }
+ else if (request.ActionType == 1 || request.ActionType == 2)
+ {
+ PagingRequest pagingRequest = JsonSerializer.Deserialize<PagingRequest>(request.Data);
+ sql.Append($"EXECUTE Pagination {pagingRequest.PageNumber},{pagingRequest.PageSize},'{pagingRequest.Table}','{pagingRequest.Field}','{pagingRequest.OrderBy}','{CConvert.FromBase64(pagingRequest.Filter)}'");
+ }
+ return sql.ToString();
+ }
+
+ private DataTable GetDataTable(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+ DataTable table = null;
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 2)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ table = set.Tables[0];
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+
+ private UseFreeTable Get(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+
+ UseFreeTable table = new UseFreeTable() { ErrNo = 0, ErrData = string.Empty, Name = nameof(UseFreeTable) };
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 0)
+ {
+ using (SqlConnection dbConnect = msSqlNet.Open())
+ {
+ using (SqlCommand command = new SqlCommand(sql, dbConnect))
+ {
+ OperationLog.Instance.WriteLog($"データ読込:{sql}");
+ command.CommandTimeout = 60000 * 100;
+ using (SqlDataReader reader = command.ExecuteReader(CommandBehavior.Default))
+ {
+ //エラーまだ対応していない
+ if (reader == null)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ while (reader.Read())
+ {
+ UseFree item = new UseFree();
+ item.ConvertReader(reader);
+ table.Rows.Add(item);
+ }
+ }
+ reader.Close();
+ }
+ }
+ }
+ }
+ else if (request.ActionType == 1)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ foreach (DataRow row in set.Tables[0].Rows)
+ {
+ UseFree item = new UseFree();
+ item.ConvertDataRow(row);
+ table.Rows.Add(item);
+ }
+
+ table.ErrData = JsonSerializer.Serialize(new PagingRespone()
+ {
+ MaxPage = CConvert.ToInt(set.Tables[1].Rows[0]["MaxPage"]),
+ TotalRow = CConvert.ToInt(set.Tables[1].Rows[0]["TotalRow"])
+ });
+ }
+ else
+ {
+ table.ErrNo = -1;
+ table.ErrData = set.Tables[0].Rows[0]["Descript"].ToString();
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+ private DataResult Set(UseFreeTable table)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{table.Rows.Count}");
+
+ StringBuilder sql = new StringBuilder();
+ if (table.BeforeUpdate.Length > 0) { sql.AppendLine(table.BeforeUpdate.ToStringUtf8()); }
+
+ foreach (UseFree item in table.Rows)
+ {
+ sql.AppendLine(table.UpdateType == 2 ? item.UpdateSql() : item.AddSql());
+ }
+
+ if (table.AfterUpdate.Length > 0) { sql.AppendLine(table.AfterUpdate.ToStringUtf8()); }
+
+ string sqlCmd = sql.ToString();
+ OperationLog.Instance.WriteLog($"Sql生成:{sqlCmd}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (!msSqlNet.ExecuteNonQueryWithTran(sqlCmd))
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private DataResult AddOrUpdate(bool add, UseFree item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = add ? item.AddSql() : item.UpdateSql();
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private async Task AddOrUpdate(bool add, IAsyncStreamReader<UseFree> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ UseFree item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = AddOrUpdate(add, item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ private DataResult Delete(SqlWhere item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = $"DELETE FROM {TableName} WHERE {item.Data.ToStringUtf8()}";
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+
+ public async override Task OutputStream(DataRequest request, IServerStreamWriter<FileGrpcData> responseStream, ServerCallContext context)
+ {
+ try
+ {
+ using (DataTable data = GetDataTable(request))
+ {
+ byte[] bytes = Excel.Export(data);
+ FileGrpcData fileGrpcData = new FileGrpcData
+ {
+ Block = 1,
+ FileName = "Data",
+ Content = ByteString.CopyFrom(bytes)
+ };
+ await responseStream.WriteAsync(fileGrpcData);
+ }
+ }
+ catch { }
+ }
+
+ /// <summary>
+ /// 同期実行
+ /// </summary>
+ /// <param name="request"></param>
+ /// <param name="context"></param>
+ /// <returns></returns>
+ public override Task<UseFreeTable> GetData(DataRequest request, ServerCallContext context)
+ {
+ return Task.FromResult(Get(request));
+ }
+
+ public async override Task GetDataStream(IAsyncStreamReader<DataRequest> requestStream, IServerStreamWriter<UseFreeTable> responseStream, ServerCallContext context)
+ {
+ DataRequest request = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ request = message;
+ break;
+ }
+ UseFreeTable table = Get(request);
+ await responseStream.WriteAsync(table); //データ送信
+ }
+
+ public override Task<DataResult> SetData(UseFreeTable request, ServerCallContext context)
+ {
+ return Task.FromResult(Set(request));
+ }
+
+ public async override Task SetDataStream(IAsyncStreamReader<UseFreeTable> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ UseFreeTable table = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ table = message;
+ break;
+ }
+
+ DataResult result = Set(table);
+ //データ送信
+ await responseStream.WriteAsync(result);
+ }
+
+ public override Task<DataResult> Add(UseFree request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(true, request));
+ }
+
+ public async override Task AddStream(IAsyncStreamReader<UseFree> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(true, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Update(UseFree request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(false, request));
+ }
+
+ public async override Task UpdateStream(IAsyncStreamReader<UseFree> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(false, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Remove(SqlWhere request, ServerCallContext context)
+ {
+ return Task.FromResult(Delete(request));
+ }
+
+ public async override Task RemoveStream(IAsyncStreamReader<SqlWhere> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ SqlWhere item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = Delete(item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ #endregion
+ }
+}
diff --git a/HotelPms.GrpcService/Services/UseMemoService.cs b/HotelPms.GrpcService/Services/UseMemoService.cs
new file mode 100644
index 0000000..805548f
--- /dev/null
+++ b/HotelPms.GrpcService/Services/UseMemoService.cs
@@ -0,0 +1,369 @@
+using HotelPms.Data;
+using HotelPms.Data.Common.Pagination;
+using HotelPms.Data.UseInfo;
+using HotelPms.GrpcService.Util;
+using HotelPms.Share.Data;
+using HotelPms.Share.IO;
+using HotelPms.Share.Util;
+using Google.Protobuf;
+using Grpc.Core;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
+using System.Data;
+using System.Data.SqlClient;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Tasks;
+
+namespace HotelPms.GrpcService
+{
+ /// <summary>
+ /// ■攻略
+ /// 1.UseMemo.proto(message:UseMemo、UseMemoTable;Service:UseMemoCore) ⇒ projectファイルのInclude
+ /// 2.UseMemo.cs(両方)
+ /// 3.UseMemoTable.cs(両方)
+ /// 4.UseMemoService.cs(サーバー側) ⇒ StartupでMapGrpcServiceの処理が必要
+ /// 5.UseMemoAccess.cs(クライアント側)
+ /// </summary>
+ public class UseMemoService : UseMemoCore.UseMemoCoreBase
+ {
+ #region ★★★★★ Declartions ★★★★★
+
+ private static string TableName = "D_UseMemo";
+ private readonly ILogger<UseMemoService> _logger;
+ private IConfiguration m_Configuration;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public UseMemoService(ILogger<UseMemoService> logger, IConfiguration configuration)
+ {
+ _logger = logger;
+ m_Configuration = configuration;
+ }
+
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+
+ private string GetSql(DataRequest request)
+ {
+ StringBuilder sql = new StringBuilder();
+ if (request.ActionType == 0)
+ {
+ sql.Append($"SELECT * FROM {TableName} {(string.IsNullOrEmpty(request.Data) ? string.Empty : $"WHERE {request.Data}")}");
+ }
+ else if (request.ActionType == 1 || request.ActionType == 2)
+ {
+ PagingRequest pagingRequest = JsonSerializer.Deserialize<PagingRequest>(request.Data);
+ sql.Append($"EXECUTE Pagination {pagingRequest.PageNumber},{pagingRequest.PageSize},'{pagingRequest.Table}','{pagingRequest.Field}','{pagingRequest.OrderBy}','{CConvert.FromBase64(pagingRequest.Filter)}'");
+ }
+ return sql.ToString();
+ }
+
+ private DataTable GetDataTable(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+ DataTable table = null;
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 2)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ table = set.Tables[0];
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+
+ private UseMemoTable Get(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+
+ UseMemoTable table = new UseMemoTable() { ErrNo = 0, ErrData = string.Empty, Name = nameof(UseMemoTable) };
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 0)
+ {
+ using (SqlConnection dbConnect = msSqlNet.Open())
+ {
+ using (SqlCommand command = new SqlCommand(sql, dbConnect))
+ {
+ OperationLog.Instance.WriteLog($"データ読込:{sql}");
+ command.CommandTimeout = 60000 * 100;
+ using (SqlDataReader reader = command.ExecuteReader(CommandBehavior.Default))
+ {
+ //エラーまだ対応していない
+ if (reader == null)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ while (reader.Read())
+ {
+ UseMemo item = new UseMemo();
+ item.ConvertReader(reader);
+ table.Rows.Add(item);
+ }
+ }
+ reader.Close();
+ }
+ }
+ }
+ }
+ else if (request.ActionType == 1)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ foreach (DataRow row in set.Tables[0].Rows)
+ {
+ UseMemo item = new UseMemo();
+ item.ConvertDataRow(row);
+ table.Rows.Add(item);
+ }
+
+ table.ErrData = JsonSerializer.Serialize(new PagingRespone()
+ {
+ MaxPage = CConvert.ToInt(set.Tables[1].Rows[0]["MaxPage"]),
+ TotalRow = CConvert.ToInt(set.Tables[1].Rows[0]["TotalRow"])
+ });
+ }
+ else
+ {
+ table.ErrNo = -1;
+ table.ErrData = set.Tables[0].Rows[0]["Descript"].ToString();
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+ private DataResult Set(UseMemoTable table)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{table.Rows.Count}");
+
+ StringBuilder sql = new StringBuilder();
+ if (table.BeforeUpdate.Length > 0) { sql.AppendLine(table.BeforeUpdate.ToStringUtf8()); }
+
+ foreach (UseMemo item in table.Rows)
+ {
+ sql.AppendLine(table.UpdateType == 2 ? item.UpdateSql() : item.AddSql());
+ }
+
+ if (table.AfterUpdate.Length > 0) { sql.AppendLine(table.AfterUpdate.ToStringUtf8()); }
+
+ string sqlCmd = sql.ToString();
+ OperationLog.Instance.WriteLog($"Sql生成:{sqlCmd}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (!msSqlNet.ExecuteNonQueryWithTran(sqlCmd))
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private DataResult AddOrUpdate(bool add, UseMemo item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = add ? item.AddSql() : item.UpdateSql();
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private async Task AddOrUpdate(bool add, IAsyncStreamReader<UseMemo> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ UseMemo item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = AddOrUpdate(add, item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ private DataResult Delete(SqlWhere item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = $"DELETE FROM {TableName} WHERE {item.Data.ToStringUtf8()}";
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+
+ public async override Task OutputStream(DataRequest request, IServerStreamWriter<FileGrpcData> responseStream, ServerCallContext context)
+ {
+ try
+ {
+ using (DataTable data = GetDataTable(request))
+ {
+ byte[] bytes = Excel.Export(data);
+ FileGrpcData fileGrpcData = new FileGrpcData
+ {
+ Block = 1,
+ FileName = "Data",
+ Content = ByteString.CopyFrom(bytes)
+ };
+ await responseStream.WriteAsync(fileGrpcData);
+ }
+ }
+ catch { }
+ }
+
+ /// <summary>
+ /// 同期実行
+ /// </summary>
+ /// <param name="request"></param>
+ /// <param name="context"></param>
+ /// <returns></returns>
+ public override Task<UseMemoTable> GetData(DataRequest request, ServerCallContext context)
+ {
+ return Task.FromResult(Get(request));
+ }
+
+ public async override Task GetDataStream(IAsyncStreamReader<DataRequest> requestStream, IServerStreamWriter<UseMemoTable> responseStream, ServerCallContext context)
+ {
+ DataRequest request = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ request = message;
+ break;
+ }
+ UseMemoTable table = Get(request);
+ await responseStream.WriteAsync(table); //データ送信
+ }
+
+ public override Task<DataResult> SetData(UseMemoTable request, ServerCallContext context)
+ {
+ return Task.FromResult(Set(request));
+ }
+
+ public async override Task SetDataStream(IAsyncStreamReader<UseMemoTable> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ UseMemoTable table = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ table = message;
+ break;
+ }
+
+ DataResult result = Set(table);
+ //データ送信
+ await responseStream.WriteAsync(result);
+ }
+
+ public override Task<DataResult> Add(UseMemo request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(true, request));
+ }
+
+ public async override Task AddStream(IAsyncStreamReader<UseMemo> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(true, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Update(UseMemo request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(false, request));
+ }
+
+ public async override Task UpdateStream(IAsyncStreamReader<UseMemo> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(false, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Remove(SqlWhere request, ServerCallContext context)
+ {
+ return Task.FromResult(Delete(request));
+ }
+
+ public async override Task RemoveStream(IAsyncStreamReader<SqlWhere> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ SqlWhere item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = Delete(item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ #endregion
+ }
+}
diff --git a/HotelPms.GrpcService/Services/UsePersonFreeService.cs b/HotelPms.GrpcService/Services/UsePersonFreeService.cs
new file mode 100644
index 0000000..5b5dfe8
--- /dev/null
+++ b/HotelPms.GrpcService/Services/UsePersonFreeService.cs
@@ -0,0 +1,369 @@
+using HotelPms.Data;
+using HotelPms.Data.Common.Pagination;
+using HotelPms.Data.UseInfo;
+using HotelPms.GrpcService.Util;
+using HotelPms.Share.Data;
+using HotelPms.Share.IO;
+using HotelPms.Share.Util;
+using Google.Protobuf;
+using Grpc.Core;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
+using System.Data;
+using System.Data.SqlClient;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Tasks;
+
+namespace HotelPms.GrpcService
+{
+ /// <summary>
+ /// ■攻略
+ /// 1.UsePersonFree.proto(message:UsePersonFree、UsePersonFreeTable;Service:UsePersonFreeCore) ⇒ projectファイルのInclude
+ /// 2.UsePersonFree.cs(両方)
+ /// 3.UsePersonFreeTable.cs(両方)
+ /// 4.UsePersonFreeService.cs(サーバー側) ⇒ StartupでMapGrpcServiceの処理が必要
+ /// 5.UsePersonFreeAccess.cs(クライアント側)
+ /// </summary>
+ public class UsePersonFreeService : UsePersonFreeCore.UsePersonFreeCoreBase
+ {
+ #region ★★★★★ Declartions ★★★★★
+
+ private static string TableName = "D_UsePersonFree";
+ private readonly ILogger<UsePersonFreeService> _logger;
+ private IConfiguration m_Configuration;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public UsePersonFreeService(ILogger<UsePersonFreeService> logger, IConfiguration configuration)
+ {
+ _logger = logger;
+ m_Configuration = configuration;
+ }
+
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+
+ private string GetSql(DataRequest request)
+ {
+ StringBuilder sql = new StringBuilder();
+ if (request.ActionType == 0)
+ {
+ sql.Append($"SELECT * FROM {TableName} {(string.IsNullOrEmpty(request.Data) ? string.Empty : $"WHERE {request.Data}")}");
+ }
+ else if (request.ActionType == 1 || request.ActionType == 2)
+ {
+ PagingRequest pagingRequest = JsonSerializer.Deserialize<PagingRequest>(request.Data);
+ sql.Append($"EXECUTE Pagination {pagingRequest.PageNumber},{pagingRequest.PageSize},'{pagingRequest.Table}','{pagingRequest.Field}','{pagingRequest.OrderBy}','{CConvert.FromBase64(pagingRequest.Filter)}'");
+ }
+ return sql.ToString();
+ }
+
+ private DataTable GetDataTable(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+ DataTable table = null;
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 2)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ table = set.Tables[0];
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+
+ private UsePersonFreeTable Get(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+
+ UsePersonFreeTable table = new UsePersonFreeTable() { ErrNo = 0, ErrData = string.Empty, Name = nameof(UsePersonFreeTable) };
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 0)
+ {
+ using (SqlConnection dbConnect = msSqlNet.Open())
+ {
+ using (SqlCommand command = new SqlCommand(sql, dbConnect))
+ {
+ OperationLog.Instance.WriteLog($"データ読込:{sql}");
+ command.CommandTimeout = 60000 * 100;
+ using (SqlDataReader reader = command.ExecuteReader(CommandBehavior.Default))
+ {
+ //エラーまだ対応していない
+ if (reader == null)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ while (reader.Read())
+ {
+ UsePersonFree item = new UsePersonFree();
+ item.ConvertReader(reader);
+ table.Rows.Add(item);
+ }
+ }
+ reader.Close();
+ }
+ }
+ }
+ }
+ else if (request.ActionType == 1)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ foreach (DataRow row in set.Tables[0].Rows)
+ {
+ UsePersonFree item = new UsePersonFree();
+ item.ConvertDataRow(row);
+ table.Rows.Add(item);
+ }
+
+ table.ErrData = JsonSerializer.Serialize(new PagingRespone()
+ {
+ MaxPage = CConvert.ToInt(set.Tables[1].Rows[0]["MaxPage"]),
+ TotalRow = CConvert.ToInt(set.Tables[1].Rows[0]["TotalRow"])
+ });
+ }
+ else
+ {
+ table.ErrNo = -1;
+ table.ErrData = set.Tables[0].Rows[0]["Descript"].ToString();
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+ private DataResult Set(UsePersonFreeTable table)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{table.Rows.Count}");
+
+ StringBuilder sql = new StringBuilder();
+ if (table.BeforeUpdate.Length > 0) { sql.AppendLine(table.BeforeUpdate.ToStringUtf8()); }
+
+ foreach (UsePersonFree item in table.Rows)
+ {
+ sql.AppendLine(table.UpdateType == 2 ? item.UpdateSql() : item.AddSql());
+ }
+
+ if (table.AfterUpdate.Length > 0) { sql.AppendLine(table.AfterUpdate.ToStringUtf8()); }
+
+ string sqlCmd = sql.ToString();
+ OperationLog.Instance.WriteLog($"Sql生成:{sqlCmd}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (!msSqlNet.ExecuteNonQueryWithTran(sqlCmd))
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private DataResult AddOrUpdate(bool add, UsePersonFree item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = add ? item.AddSql() : item.UpdateSql();
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private async Task AddOrUpdate(bool add, IAsyncStreamReader<UsePersonFree> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ UsePersonFree item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = AddOrUpdate(add, item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ private DataResult Delete(SqlWhere item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = $"DELETE FROM {TableName} WHERE {item.Data.ToStringUtf8()}";
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+
+ public async override Task OutputStream(DataRequest request, IServerStreamWriter<FileGrpcData> responseStream, ServerCallContext context)
+ {
+ try
+ {
+ using (DataTable data = GetDataTable(request))
+ {
+ byte[] bytes = Excel.Export(data);
+ FileGrpcData fileGrpcData = new FileGrpcData
+ {
+ Block = 1,
+ FileName = "Data",
+ Content = ByteString.CopyFrom(bytes)
+ };
+ await responseStream.WriteAsync(fileGrpcData);
+ }
+ }
+ catch { }
+ }
+
+ /// <summary>
+ /// 同期実行
+ /// </summary>
+ /// <param name="request"></param>
+ /// <param name="context"></param>
+ /// <returns></returns>
+ public override Task<UsePersonFreeTable> GetData(DataRequest request, ServerCallContext context)
+ {
+ return Task.FromResult(Get(request));
+ }
+
+ public async override Task GetDataStream(IAsyncStreamReader<DataRequest> requestStream, IServerStreamWriter<UsePersonFreeTable> responseStream, ServerCallContext context)
+ {
+ DataRequest request = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ request = message;
+ break;
+ }
+ UsePersonFreeTable table = Get(request);
+ await responseStream.WriteAsync(table); //データ送信
+ }
+
+ public override Task<DataResult> SetData(UsePersonFreeTable request, ServerCallContext context)
+ {
+ return Task.FromResult(Set(request));
+ }
+
+ public async override Task SetDataStream(IAsyncStreamReader<UsePersonFreeTable> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ UsePersonFreeTable table = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ table = message;
+ break;
+ }
+
+ DataResult result = Set(table);
+ //データ送信
+ await responseStream.WriteAsync(result);
+ }
+
+ public override Task<DataResult> Add(UsePersonFree request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(true, request));
+ }
+
+ public async override Task AddStream(IAsyncStreamReader<UsePersonFree> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(true, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Update(UsePersonFree request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(false, request));
+ }
+
+ public async override Task UpdateStream(IAsyncStreamReader<UsePersonFree> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(false, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Remove(SqlWhere request, ServerCallContext context)
+ {
+ return Task.FromResult(Delete(request));
+ }
+
+ public async override Task RemoveStream(IAsyncStreamReader<SqlWhere> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ SqlWhere item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = Delete(item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ #endregion
+ }
+}
diff --git a/HotelPms.GrpcService/Services/UsePersonService.cs b/HotelPms.GrpcService/Services/UsePersonService.cs
new file mode 100644
index 0000000..20df081
--- /dev/null
+++ b/HotelPms.GrpcService/Services/UsePersonService.cs
@@ -0,0 +1,369 @@
+using HotelPms.Data;
+using HotelPms.Data.Common.Pagination;
+using HotelPms.Data.UseInfo;
+using HotelPms.GrpcService.Util;
+using HotelPms.Share.Data;
+using HotelPms.Share.IO;
+using HotelPms.Share.Util;
+using Google.Protobuf;
+using Grpc.Core;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
+using System.Data;
+using System.Data.SqlClient;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Tasks;
+
+namespace HotelPms.GrpcService
+{
+ /// <summary>
+ /// ■攻略
+ /// 1.UsePerson.proto(message:UsePerson、UsePersonTable;Service:UsePersonCore) ⇒ projectファイルのInclude
+ /// 2.UsePerson.cs(両方)
+ /// 3.UsePersonTable.cs(両方)
+ /// 4.UsePersonService.cs(サーバー側) ⇒ StartupでMapGrpcServiceの処理が必要
+ /// 5.UsePersonAccess.cs(クライアント側)
+ /// </summary>
+ public class UsePersonService : UsePersonCore.UsePersonCoreBase
+ {
+ #region ★★★★★ Declartions ★★★★★
+
+ private static string TableName = "D_UsePerson";
+ private readonly ILogger<UsePersonService> _logger;
+ private IConfiguration m_Configuration;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public UsePersonService(ILogger<UsePersonService> logger, IConfiguration configuration)
+ {
+ _logger = logger;
+ m_Configuration = configuration;
+ }
+
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+
+ private string GetSql(DataRequest request)
+ {
+ StringBuilder sql = new StringBuilder();
+ if (request.ActionType == 0)
+ {
+ sql.Append($"SELECT * FROM {TableName} {(string.IsNullOrEmpty(request.Data) ? string.Empty : $"WHERE {request.Data}")}");
+ }
+ else if (request.ActionType == 1 || request.ActionType == 2)
+ {
+ PagingRequest pagingRequest = JsonSerializer.Deserialize<PagingRequest>(request.Data);
+ sql.Append($"EXECUTE Pagination {pagingRequest.PageNumber},{pagingRequest.PageSize},'{pagingRequest.Table}','{pagingRequest.Field}','{pagingRequest.OrderBy}','{CConvert.FromBase64(pagingRequest.Filter)}'");
+ }
+ return sql.ToString();
+ }
+
+ private DataTable GetDataTable(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+ DataTable table = null;
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 2)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ table = set.Tables[0];
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+
+ private UsePersonTable Get(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+
+ UsePersonTable table = new UsePersonTable() { ErrNo = 0, ErrData = string.Empty, Name = nameof(UsePersonTable) };
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 0)
+ {
+ using (SqlConnection dbConnect = msSqlNet.Open())
+ {
+ using (SqlCommand command = new SqlCommand(sql, dbConnect))
+ {
+ OperationLog.Instance.WriteLog($"データ読込:{sql}");
+ command.CommandTimeout = 60000 * 100;
+ using (SqlDataReader reader = command.ExecuteReader(CommandBehavior.Default))
+ {
+ //エラーまだ対応していない
+ if (reader == null)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ while (reader.Read())
+ {
+ UsePerson item = new UsePerson();
+ item.ConvertReader(reader);
+ table.Rows.Add(item);
+ }
+ }
+ reader.Close();
+ }
+ }
+ }
+ }
+ else if (request.ActionType == 1)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ foreach (DataRow row in set.Tables[0].Rows)
+ {
+ UsePerson item = new UsePerson();
+ item.ConvertDataRow(row);
+ table.Rows.Add(item);
+ }
+
+ table.ErrData = JsonSerializer.Serialize(new PagingRespone()
+ {
+ MaxPage = CConvert.ToInt(set.Tables[1].Rows[0]["MaxPage"]),
+ TotalRow = CConvert.ToInt(set.Tables[1].Rows[0]["TotalRow"])
+ });
+ }
+ else
+ {
+ table.ErrNo = -1;
+ table.ErrData = set.Tables[0].Rows[0]["Descript"].ToString();
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+ private DataResult Set(UsePersonTable table)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{table.Rows.Count}");
+
+ StringBuilder sql = new StringBuilder();
+ if (table.BeforeUpdate.Length > 0) { sql.AppendLine(table.BeforeUpdate.ToStringUtf8()); }
+
+ foreach (UsePerson item in table.Rows)
+ {
+ sql.AppendLine(table.UpdateType == 2 ? item.UpdateSql() : item.AddSql());
+ }
+
+ if (table.AfterUpdate.Length > 0) { sql.AppendLine(table.AfterUpdate.ToStringUtf8()); }
+
+ string sqlCmd = sql.ToString();
+ OperationLog.Instance.WriteLog($"Sql生成:{sqlCmd}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (!msSqlNet.ExecuteNonQueryWithTran(sqlCmd))
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private DataResult AddOrUpdate(bool add, UsePerson item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = add ? item.AddSql() : item.UpdateSql();
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private async Task AddOrUpdate(bool add, IAsyncStreamReader<UsePerson> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ UsePerson item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = AddOrUpdate(add, item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ private DataResult Delete(SqlWhere item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = $"DELETE FROM {TableName} WHERE {item.Data.ToStringUtf8()}";
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+
+ public async override Task OutputStream(DataRequest request, IServerStreamWriter<FileGrpcData> responseStream, ServerCallContext context)
+ {
+ try
+ {
+ using (DataTable data = GetDataTable(request))
+ {
+ byte[] bytes = Excel.Export(data);
+ FileGrpcData fileGrpcData = new FileGrpcData
+ {
+ Block = 1,
+ FileName = "Data",
+ Content = ByteString.CopyFrom(bytes)
+ };
+ await responseStream.WriteAsync(fileGrpcData);
+ }
+ }
+ catch { }
+ }
+
+ /// <summary>
+ /// 同期実行
+ /// </summary>
+ /// <param name="request"></param>
+ /// <param name="context"></param>
+ /// <returns></returns>
+ public override Task<UsePersonTable> GetData(DataRequest request, ServerCallContext context)
+ {
+ return Task.FromResult(Get(request));
+ }
+
+ public async override Task GetDataStream(IAsyncStreamReader<DataRequest> requestStream, IServerStreamWriter<UsePersonTable> responseStream, ServerCallContext context)
+ {
+ DataRequest request = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ request = message;
+ break;
+ }
+ UsePersonTable table = Get(request);
+ await responseStream.WriteAsync(table); //データ送信
+ }
+
+ public override Task<DataResult> SetData(UsePersonTable request, ServerCallContext context)
+ {
+ return Task.FromResult(Set(request));
+ }
+
+ public async override Task SetDataStream(IAsyncStreamReader<UsePersonTable> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ UsePersonTable table = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ table = message;
+ break;
+ }
+
+ DataResult result = Set(table);
+ //データ送信
+ await responseStream.WriteAsync(result);
+ }
+
+ public override Task<DataResult> Add(UsePerson request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(true, request));
+ }
+
+ public async override Task AddStream(IAsyncStreamReader<UsePerson> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(true, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Update(UsePerson request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(false, request));
+ }
+
+ public async override Task UpdateStream(IAsyncStreamReader<UsePerson> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(false, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Remove(SqlWhere request, ServerCallContext context)
+ {
+ return Task.FromResult(Delete(request));
+ }
+
+ public async override Task RemoveStream(IAsyncStreamReader<SqlWhere> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ SqlWhere item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = Delete(item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ #endregion
+ }
+}
diff --git a/HotelPms.GrpcService/Services/UsePersonTelService.cs b/HotelPms.GrpcService/Services/UsePersonTelService.cs
new file mode 100644
index 0000000..3b6bd1b
--- /dev/null
+++ b/HotelPms.GrpcService/Services/UsePersonTelService.cs
@@ -0,0 +1,369 @@
+using HotelPms.Data;
+using HotelPms.Data.Common.Pagination;
+using HotelPms.Data.UseInfo;
+using HotelPms.GrpcService.Util;
+using HotelPms.Share.Data;
+using HotelPms.Share.IO;
+using HotelPms.Share.Util;
+using Google.Protobuf;
+using Grpc.Core;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
+using System.Data;
+using System.Data.SqlClient;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Tasks;
+
+namespace HotelPms.GrpcService
+{
+ /// <summary>
+ /// ■攻略
+ /// 1.UsePersonTel.proto(message:UsePersonTel、UsePersonTelTable;Service:UsePersonTelCore) ⇒ projectファイルのInclude
+ /// 2.UsePersonTel.cs(両方)
+ /// 3.UsePersonTelTable.cs(両方)
+ /// 4.UsePersonTelService.cs(サーバー側) ⇒ StartupでMapGrpcServiceの処理が必要
+ /// 5.UsePersonTelAccess.cs(クライアント側)
+ /// </summary>
+ public class UsePersonTelService : UsePersonTelCore.UsePersonTelCoreBase
+ {
+ #region ★★★★★ Declartions ★★★★★
+
+ private static string TableName = "D_UsePersonTel";
+ private readonly ILogger<UsePersonTelService> _logger;
+ private IConfiguration m_Configuration;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public UsePersonTelService(ILogger<UsePersonTelService> logger, IConfiguration configuration)
+ {
+ _logger = logger;
+ m_Configuration = configuration;
+ }
+
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+
+ private string GetSql(DataRequest request)
+ {
+ StringBuilder sql = new StringBuilder();
+ if (request.ActionType == 0)
+ {
+ sql.Append($"SELECT * FROM {TableName} {(string.IsNullOrEmpty(request.Data) ? string.Empty : $"WHERE {request.Data}")}");
+ }
+ else if (request.ActionType == 1 || request.ActionType == 2)
+ {
+ PagingRequest pagingRequest = JsonSerializer.Deserialize<PagingRequest>(request.Data);
+ sql.Append($"EXECUTE Pagination {pagingRequest.PageNumber},{pagingRequest.PageSize},'{pagingRequest.Table}','{pagingRequest.Field}','{pagingRequest.OrderBy}','{CConvert.FromBase64(pagingRequest.Filter)}'");
+ }
+ return sql.ToString();
+ }
+
+ private DataTable GetDataTable(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+ DataTable table = null;
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 2)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ table = set.Tables[0];
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+
+ private UsePersonTelTable Get(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+
+ UsePersonTelTable table = new UsePersonTelTable() { ErrNo = 0, ErrData = string.Empty, Name = nameof(UsePersonTelTable) };
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 0)
+ {
+ using (SqlConnection dbConnect = msSqlNet.Open())
+ {
+ using (SqlCommand command = new SqlCommand(sql, dbConnect))
+ {
+ OperationLog.Instance.WriteLog($"データ読込:{sql}");
+ command.CommandTimeout = 60000 * 100;
+ using (SqlDataReader reader = command.ExecuteReader(CommandBehavior.Default))
+ {
+ //エラーまだ対応していない
+ if (reader == null)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ while (reader.Read())
+ {
+ UsePersonTel item = new UsePersonTel();
+ item.ConvertReader(reader);
+ table.Rows.Add(item);
+ }
+ }
+ reader.Close();
+ }
+ }
+ }
+ }
+ else if (request.ActionType == 1)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ foreach (DataRow row in set.Tables[0].Rows)
+ {
+ UsePersonTel item = new UsePersonTel();
+ item.ConvertDataRow(row);
+ table.Rows.Add(item);
+ }
+
+ table.ErrData = JsonSerializer.Serialize(new PagingRespone()
+ {
+ MaxPage = CConvert.ToInt(set.Tables[1].Rows[0]["MaxPage"]),
+ TotalRow = CConvert.ToInt(set.Tables[1].Rows[0]["TotalRow"])
+ });
+ }
+ else
+ {
+ table.ErrNo = -1;
+ table.ErrData = set.Tables[0].Rows[0]["Descript"].ToString();
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+ private DataResult Set(UsePersonTelTable table)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{table.Rows.Count}");
+
+ StringBuilder sql = new StringBuilder();
+ if (table.BeforeUpdate.Length > 0) { sql.AppendLine(table.BeforeUpdate.ToStringUtf8()); }
+
+ foreach (UsePersonTel item in table.Rows)
+ {
+ sql.AppendLine(table.UpdateType == 2 ? item.UpdateSql() : item.AddSql());
+ }
+
+ if (table.AfterUpdate.Length > 0) { sql.AppendLine(table.AfterUpdate.ToStringUtf8()); }
+
+ string sqlCmd = sql.ToString();
+ OperationLog.Instance.WriteLog($"Sql生成:{sqlCmd}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (!msSqlNet.ExecuteNonQueryWithTran(sqlCmd))
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private DataResult AddOrUpdate(bool add, UsePersonTel item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = add ? item.AddSql() : item.UpdateSql();
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private async Task AddOrUpdate(bool add, IAsyncStreamReader<UsePersonTel> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ UsePersonTel item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = AddOrUpdate(add, item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ private DataResult Delete(SqlWhere item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = $"DELETE FROM {TableName} WHERE {item.Data.ToStringUtf8()}";
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+
+ public async override Task OutputStream(DataRequest request, IServerStreamWriter<FileGrpcData> responseStream, ServerCallContext context)
+ {
+ try
+ {
+ using (DataTable data = GetDataTable(request))
+ {
+ byte[] bytes = Excel.Export(data);
+ FileGrpcData fileGrpcData = new FileGrpcData
+ {
+ Block = 1,
+ FileName = "Data",
+ Content = ByteString.CopyFrom(bytes)
+ };
+ await responseStream.WriteAsync(fileGrpcData);
+ }
+ }
+ catch { }
+ }
+
+ /// <summary>
+ /// 同期実行
+ /// </summary>
+ /// <param name="request"></param>
+ /// <param name="context"></param>
+ /// <returns></returns>
+ public override Task<UsePersonTelTable> GetData(DataRequest request, ServerCallContext context)
+ {
+ return Task.FromResult(Get(request));
+ }
+
+ public async override Task GetDataStream(IAsyncStreamReader<DataRequest> requestStream, IServerStreamWriter<UsePersonTelTable> responseStream, ServerCallContext context)
+ {
+ DataRequest request = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ request = message;
+ break;
+ }
+ UsePersonTelTable table = Get(request);
+ await responseStream.WriteAsync(table); //データ送信
+ }
+
+ public override Task<DataResult> SetData(UsePersonTelTable request, ServerCallContext context)
+ {
+ return Task.FromResult(Set(request));
+ }
+
+ public async override Task SetDataStream(IAsyncStreamReader<UsePersonTelTable> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ UsePersonTelTable table = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ table = message;
+ break;
+ }
+
+ DataResult result = Set(table);
+ //データ送信
+ await responseStream.WriteAsync(result);
+ }
+
+ public override Task<DataResult> Add(UsePersonTel request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(true, request));
+ }
+
+ public async override Task AddStream(IAsyncStreamReader<UsePersonTel> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(true, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Update(UsePersonTel request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(false, request));
+ }
+
+ public async override Task UpdateStream(IAsyncStreamReader<UsePersonTel> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(false, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Remove(SqlWhere request, ServerCallContext context)
+ {
+ return Task.FromResult(Delete(request));
+ }
+
+ public async override Task RemoveStream(IAsyncStreamReader<SqlWhere> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ SqlWhere item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = Delete(item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ #endregion
+ }
+}
diff --git a/HotelPms.GrpcService/Services/UseRoomService.cs b/HotelPms.GrpcService/Services/UseRoomService.cs
new file mode 100644
index 0000000..1bb0205
--- /dev/null
+++ b/HotelPms.GrpcService/Services/UseRoomService.cs
@@ -0,0 +1,369 @@
+using HotelPms.Data;
+using HotelPms.Data.Common.Pagination;
+using HotelPms.Data.UseInfo;
+using HotelPms.GrpcService.Util;
+using HotelPms.Share.Data;
+using HotelPms.Share.IO;
+using HotelPms.Share.Util;
+using Google.Protobuf;
+using Grpc.Core;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
+using System.Data;
+using System.Data.SqlClient;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Tasks;
+
+namespace HotelPms.GrpcService
+{
+ /// <summary>
+ /// ■攻略
+ /// 1.UseRoom.proto(message:UseRoom、UseRoomTable;Service:UseRoomCore) ⇒ projectファイルのInclude
+ /// 2.UseRoom.cs(両方)
+ /// 3.UseRoomTable.cs(両方)
+ /// 4.UseRoomService.cs(サーバー側) ⇒ StartupでMapGrpcServiceの処理が必要
+ /// 5.UseRoomAccess.cs(クライアント側)
+ /// </summary>
+ public class UseRoomService : UseRoomCore.UseRoomCoreBase
+ {
+ #region ★★★★★ Declartions ★★★★★
+
+ private static string TableName = "D_UseRoom";
+ private readonly ILogger<UseRoomService> _logger;
+ private IConfiguration m_Configuration;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public UseRoomService(ILogger<UseRoomService> logger, IConfiguration configuration)
+ {
+ _logger = logger;
+ m_Configuration = configuration;
+ }
+
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+
+ private string GetSql(DataRequest request)
+ {
+ StringBuilder sql = new StringBuilder();
+ if (request.ActionType == 0)
+ {
+ sql.Append($"SELECT * FROM {TableName} {(string.IsNullOrEmpty(request.Data) ? string.Empty : $"WHERE {request.Data}")}");
+ }
+ else if (request.ActionType == 1 || request.ActionType == 2)
+ {
+ PagingRequest pagingRequest = JsonSerializer.Deserialize<PagingRequest>(request.Data);
+ sql.Append($"EXECUTE Pagination {pagingRequest.PageNumber},{pagingRequest.PageSize},'{pagingRequest.Table}','{pagingRequest.Field}','{pagingRequest.OrderBy}','{CConvert.FromBase64(pagingRequest.Filter)}'");
+ }
+ return sql.ToString();
+ }
+
+ private DataTable GetDataTable(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+ DataTable table = null;
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 2)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ table = set.Tables[0];
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+
+ private UseRoomTable Get(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+
+ UseRoomTable table = new UseRoomTable() { ErrNo = 0, ErrData = string.Empty, Name = nameof(UseRoomTable) };
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 0)
+ {
+ using (SqlConnection dbConnect = msSqlNet.Open())
+ {
+ using (SqlCommand command = new SqlCommand(sql, dbConnect))
+ {
+ OperationLog.Instance.WriteLog($"データ読込:{sql}");
+ command.CommandTimeout = 60000 * 100;
+ using (SqlDataReader reader = command.ExecuteReader(CommandBehavior.Default))
+ {
+ //エラーまだ対応していない
+ if (reader == null)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ while (reader.Read())
+ {
+ UseRoom item = new UseRoom();
+ item.ConvertReader(reader);
+ table.Rows.Add(item);
+ }
+ }
+ reader.Close();
+ }
+ }
+ }
+ }
+ else if (request.ActionType == 1)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ foreach (DataRow row in set.Tables[0].Rows)
+ {
+ UseRoom item = new UseRoom();
+ item.ConvertDataRow(row);
+ table.Rows.Add(item);
+ }
+
+ table.ErrData = JsonSerializer.Serialize(new PagingRespone()
+ {
+ MaxPage = CConvert.ToInt(set.Tables[1].Rows[0]["MaxPage"]),
+ TotalRow = CConvert.ToInt(set.Tables[1].Rows[0]["TotalRow"])
+ });
+ }
+ else
+ {
+ table.ErrNo = -1;
+ table.ErrData = set.Tables[0].Rows[0]["Descript"].ToString();
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+ private DataResult Set(UseRoomTable table)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{table.Rows.Count}");
+
+ StringBuilder sql = new StringBuilder();
+ if (table.BeforeUpdate.Length > 0) { sql.AppendLine(table.BeforeUpdate.ToStringUtf8()); }
+
+ foreach (UseRoom item in table.Rows)
+ {
+ sql.AppendLine(table.UpdateType == 2 ? item.UpdateSql() : item.AddSql());
+ }
+
+ if (table.AfterUpdate.Length > 0) { sql.AppendLine(table.AfterUpdate.ToStringUtf8()); }
+
+ string sqlCmd = sql.ToString();
+ OperationLog.Instance.WriteLog($"Sql生成:{sqlCmd}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (!msSqlNet.ExecuteNonQueryWithTran(sqlCmd))
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private DataResult AddOrUpdate(bool add, UseRoom item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = add ? item.AddSql() : item.UpdateSql();
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private async Task AddOrUpdate(bool add, IAsyncStreamReader<UseRoom> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ UseRoom item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = AddOrUpdate(add, item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ private DataResult Delete(SqlWhere item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = $"DELETE FROM {TableName} WHERE {item.Data.ToStringUtf8()}";
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+
+ public async override Task OutputStream(DataRequest request, IServerStreamWriter<FileGrpcData> responseStream, ServerCallContext context)
+ {
+ try
+ {
+ using (DataTable data = GetDataTable(request))
+ {
+ byte[] bytes = Excel.Export(data);
+ FileGrpcData fileGrpcData = new FileGrpcData
+ {
+ Block = 1,
+ FileName = "Data",
+ Content = ByteString.CopyFrom(bytes)
+ };
+ await responseStream.WriteAsync(fileGrpcData);
+ }
+ }
+ catch { }
+ }
+
+ /// <summary>
+ /// 同期実行
+ /// </summary>
+ /// <param name="request"></param>
+ /// <param name="context"></param>
+ /// <returns></returns>
+ public override Task<UseRoomTable> GetData(DataRequest request, ServerCallContext context)
+ {
+ return Task.FromResult(Get(request));
+ }
+
+ public async override Task GetDataStream(IAsyncStreamReader<DataRequest> requestStream, IServerStreamWriter<UseRoomTable> responseStream, ServerCallContext context)
+ {
+ DataRequest request = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ request = message;
+ break;
+ }
+ UseRoomTable table = Get(request);
+ await responseStream.WriteAsync(table); //データ送信
+ }
+
+ public override Task<DataResult> SetData(UseRoomTable request, ServerCallContext context)
+ {
+ return Task.FromResult(Set(request));
+ }
+
+ public async override Task SetDataStream(IAsyncStreamReader<UseRoomTable> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ UseRoomTable table = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ table = message;
+ break;
+ }
+
+ DataResult result = Set(table);
+ //データ送信
+ await responseStream.WriteAsync(result);
+ }
+
+ public override Task<DataResult> Add(UseRoom request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(true, request));
+ }
+
+ public async override Task AddStream(IAsyncStreamReader<UseRoom> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(true, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Update(UseRoom request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(false, request));
+ }
+
+ public async override Task UpdateStream(IAsyncStreamReader<UseRoom> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(false, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Remove(SqlWhere request, ServerCallContext context)
+ {
+ return Task.FromResult(Delete(request));
+ }
+
+ public async override Task RemoveStream(IAsyncStreamReader<SqlWhere> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ SqlWhere item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = Delete(item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ #endregion
+ }
+}
diff --git a/HotelPms.GrpcService/Services/UseService.cs b/HotelPms.GrpcService/Services/UseService.cs
new file mode 100644
index 0000000..7f9e322
--- /dev/null
+++ b/HotelPms.GrpcService/Services/UseService.cs
@@ -0,0 +1,158 @@
+using Grpc.Core;
+using HotelPms.Data;
+using HotelPms.Data.UseInfo;
+using HotelPms.GrpcService.Util;
+using HotelPms.Share.Data;
+using HotelPms.Share.IO;
+using HotelPms.Share.Util;
+
+namespace HotelPms.GrpcService
+{
+ /// <summary>
+ /// ■攻略
+ /// 1.Use.proto(message:Use、UseTable;Service:UseCore) ⇒ projectファイルのInclude
+ /// 2.Use.cs(両方)
+ /// 3.UseTable.cs(両方)
+ /// 4.UseService.cs(サーバー側) ⇒ StartupでMapGrpcServiceの処理が必要
+ /// 5.UseAccess.cs(クライアント側)
+ /// </summary>
+ public class UseService : UseCore.UseCoreBase
+ {
+ #region ★★★★★ Declartions ★★★★★
+
+ private static string TableName = "D_Use";
+ private readonly ILogger<UseService> _logger;
+ private IConfiguration m_Configuration;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public UseService(ILogger<UseService> logger, IConfiguration configuration)
+ {
+ _logger = logger;
+ m_Configuration = configuration;
+ }
+
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+
+ /// <summary>
+ /// 利用情報取得
+ /// </summary>
+ /// <param name="request"></param>
+ /// <returns></returns>
+ private Use? Get(DataRequest request)
+ {
+ try
+ {
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+ using MsSqlNet msSqlNet = new(Setting.HotelPmsDB);
+ Use? item = Use.Get(CConvert.ToInt(request.Data), msSqlNet);
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return item;
+ }
+ catch(Exception ex)
+ {
+ OperationLog.Instance.WriteLog($"UseService.Get({request.Data}):{ex.Message}");
+ return null;
+ }
+ }
+
+ /// <summary>
+ /// 利用データ更新
+ /// </summary>
+ /// <param name="use"></param>
+ /// <returns></returns>
+ private DataResult Set(Use use)
+ {
+ DataResult result = new() { ErrNo = 0, ErrData = string.Empty };
+ try
+ {
+ OperationLog.Instance.WriteLog($"■利用情報保存開始:{use.ID}");
+
+ string sql = use.ToSql();
+ OperationLog.Instance.WriteLog($"利用情報保存Sql生成:{sql}");
+
+ using MsSqlNet msSqlNet = new(Setting.HotelPmsDB);
+ if (!msSqlNet.ExecuteNonQueryWithTran(sql))
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ OperationLog.Instance.WriteLog($"利用情報保存結果:{result.ErrNo}.{result.ErrData}");
+
+ //非同期実行
+ if (result.ErrNo == 0)
+ {
+ Task.Run(() =>
+ {
+ OperationLog.Instance.WriteLog($"非同期更新:{use.ID}");
+ using MsSqlNet msSqlNet = new(Setting.HotelPmsDB);
+ int cnt = msSqlNet.ExecuteNonQuery($"EXECUTE SaveUseAfterAsync {use.ID}");
+ OperationLog.Instance.WriteLog($"非同期更新結果:{cnt},ErrNo:{msSqlNet.ErrNo},ErrInfo:{msSqlNet.ErrInfo}");
+ });
+ }
+ }
+ catch(Exception ex)
+ {
+ OperationLog.Instance.WriteLog($"UseService.Set():{ex.Message}");
+ result.ErrNo = 999999;
+ result.ErrData = ex.Message;
+ }
+ return result;
+ }
+
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+
+ /// <summary>
+ /// 同期実行
+ /// </summary>
+ /// <param name="request"></param>
+ /// <param name="context"></param>
+ /// <returns></returns>
+ public override Task<Use?> GetData(DataRequest request, ServerCallContext context)
+ {
+ return Task.FromResult(Get(request));
+ }
+
+ public async override Task GetDataStream(IAsyncStreamReader<DataRequest> requestStream, IServerStreamWriter<Use> responseStream, ServerCallContext context)
+ {
+ DataRequest request = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ request = message;
+ break;
+ }
+ Use? use = Get(request);
+ await responseStream.WriteAsync(use); //データ送信
+ }
+
+ public override Task<DataResult> SetData(Use request, ServerCallContext context)
+ {
+ return Task.FromResult(Set(request));
+ }
+
+ public async override Task SetDataStream(IAsyncStreamReader<Use> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ Use table = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ table = message;
+ break;
+ }
+
+ DataResult result = Set(table);
+ //データ送信
+ await responseStream.WriteAsync(result);
+ }
+
+ #endregion
+ }
+}
diff --git a/HotelPms.GrpcService/Util/Excel.cs b/HotelPms.GrpcService/Util/Excel.cs
new file mode 100644
index 0000000..8c0ad59
--- /dev/null
+++ b/HotelPms.GrpcService/Util/Excel.cs
@@ -0,0 +1,69 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using NPOI.SS.UserModel;
+using NPOI.HSSF.UserModel;
+using NPOI.XSSF.UserModel;
+using System.Data;
+using System.IO;
+
+namespace HotelPms.GrpcService.Util
+{
+ public class Excel
+ {
+ public static byte[] Export(DataTable dt, string type = "xlsx")
+ {
+ const int headerRowIndex = 0;
+
+ // ブック作成
+ IWorkbook book;
+ switch (type)
+ {
+ case "xls":
+ book = new HSSFWorkbook();
+ break;
+ case "xlsx":
+ book = new XSSFWorkbook();
+ break;
+ default:
+ return null;
+ }
+
+ // シート作成
+ var sheet = book.CreateSheet("Table");
+
+ // ヘッダ行作成
+ var headerRow = sheet.CreateRow(0);
+ foreach (DataColumn col in dt.Columns)
+ {
+ ICell cell = headerRow.CreateCell(dt.Columns.IndexOf(col));
+ cell.SetCellValue(col.ColumnName);
+ }
+
+ // データ行作成
+ foreach (DataRow row in dt.Rows)
+ {
+ var dataRow = sheet.CreateRow(headerRowIndex + 1 + dt.Rows.IndexOf(row));
+
+ foreach (DataColumn col in dt.Columns)
+ {
+ var colIndex = dt.Columns.IndexOf(col);
+ if (row[colIndex] == DBNull.Value) continue;
+
+ ICell cell = dataRow.CreateCell(colIndex);
+ cell.SetCellValue(row[colIndex].ToString());
+ }
+ }
+
+ // ブックを出力(保存)
+ using (var ms = new MemoryStream())
+ {
+ book.Write(ms, true);
+ byte[] data = ms.ToArray();
+ ms.Close();
+ return data;
+ }
+ }
+ }
+}
diff --git a/HotelPms.GrpcService/Util/Setting.cs b/HotelPms.GrpcService/Util/Setting.cs
new file mode 100644
index 0000000..074b663
--- /dev/null
+++ b/HotelPms.GrpcService/Util/Setting.cs
@@ -0,0 +1,49 @@
+using HotelPms.Share.Util;
+
+namespace HotelPms.GrpcService.Util
+{
+ public class Setting
+ {
+ /// <summary>
+ /// 共通DB
+ /// </summary>
+ public static string HotelCommonDB { get; set; } = string.Empty;
+
+ /// <summary>
+ /// 施設DB
+ /// </summary>
+ public static string HotelPmsDB { get; set; } = string.Empty;
+
+ /// <summary>
+ /// クラウド管理DB
+ /// </summary>
+ public static string SystemCenterDB { get; set; } = string.Empty;
+
+ public static string JwtIssuer { get; set; } = string.Empty;
+
+ public static string JwtAudience { get; set; } = string.Empty;
+
+ public static string JwtSecurityKey { get; set; } = string.Empty;
+
+ public static int GrpcPort { get; set; } = 0;
+
+ public static int ApiPort { get; set; } = 0;
+
+ /// <summary>
+ /// 初期化
+ /// </summary>
+ /// <param name="app"></param>
+ /// <param name="configuration"></param>
+ public static void Init(IConfiguration configuration)
+ {
+ Setting.HotelPmsDB = configuration.GetSection("ConnectionStrings:HotelPmsDB").Value;
+ Setting.HotelCommonDB = configuration.GetSection("ConnectionStrings:HotelCommonDB").Value;
+ Setting.SystemCenterDB = configuration.GetSection("ConnectionStrings:SystemManagementCenterDB").Value;
+ JwtIssuer = configuration["JwtIssuer"];
+ JwtAudience = configuration["JwtAudience"];
+ JwtSecurityKey = configuration["JwtSecurityKey"];
+ GrpcPort = CConvert.ToInt(configuration["GrpcPort"]);
+ ApiPort = CConvert.ToInt(configuration["ApiPort"]);
+ }
+ }
+}
diff --git a/HotelPms.GrpcService/appsettings.Development.json b/HotelPms.GrpcService/appsettings.Development.json
new file mode 100644
index 0000000..0c208ae
--- /dev/null
+++ b/HotelPms.GrpcService/appsettings.Development.json
@@ -0,0 +1,8 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft.AspNetCore": "Warning"
+ }
+ }
+}
diff --git a/HotelPms.GrpcService/appsettings.json b/HotelPms.GrpcService/appsettings.json
new file mode 100644
index 0000000..12b9b3d
--- /dev/null
+++ b/HotelPms.GrpcService/appsettings.json
@@ -0,0 +1,25 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft.AspNetCore": "Warning"
+ }
+ },
+ "GrpcPort": 0,
+ "ApiPort": 0,
+ "JwtSecurityKey": "RANDOM_KEY_MUST_NOT_BE_SHARED",
+ "JwtIssuer": "https://localhost",
+ "JwtAudience": "https://localhost",
+ "JwtExpiryInDays": 1,
+ "ConnectionStrings": {
+ "SystemManagementCenterDB": "Data Source=localhost;Initial Catalog=SystemCenter;Persist Security Info=True;User ID=sa;password=oatcti",
+ "HotelPmsDB": "Data Source=localhost;Initial Catalog=HotelPms;Persist Security Info=True;User ID=sa;password=oatcti",
+ "HotelCommonDB": "Data Source=localhost;Initial Catalog=HotelCommon;Persist Security Info=True;User ID=sa;password=oatcti"
+ },
+ "AllowedHosts": "*",
+ "Kestrel": {
+ "EndpointDefaults": {
+ "Protocols": "Http2"
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/Animations/AnimationDirection.cs b/HotelPms.Share.Windows/Animations/AnimationDirection.cs
new file mode 100644
index 0000000..5d130d8
--- /dev/null
+++ b/HotelPms.Share.Windows/Animations/AnimationDirection.cs
@@ -0,0 +1,12 @@
+namespace HotelPms.Share.Windows.Animations
+{
+ enum AnimationDirection
+ {
+ In, //In. Stops if finished.
+ Out, //Out. Stops if finished.
+ InOutIn, //Same as In, but changes to InOutOut if finished.
+ InOutOut, //Same as Out.
+ InOutRepeatingIn, // Same as In, but changes to InOutRepeatingOut if finished.
+ InOutRepeatingOut // Same as Out, but changes to InOutRepeatingIn if finished.
+ }
+}
diff --git a/HotelPms.Share.Windows/Animations/AnimationManager.cs b/HotelPms.Share.Windows/Animations/AnimationManager.cs
new file mode 100644
index 0000000..9316ec0
--- /dev/null
+++ b/HotelPms.Share.Windows/Animations/AnimationManager.cs
@@ -0,0 +1,364 @@
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Windows.Forms;
+using Timer = System.Windows.Forms.Timer;
+
+namespace HotelPms.Share.Windows.Animations
+{
+ class AnimationManager
+ {
+ public bool InterruptAnimation { get; set; }
+ public double Increment { get; set; }
+ public double SecondaryIncrement { get; set; }
+ public AnimationType AnimationType { get; set; }
+ public bool Singular { get; set; }
+
+ public delegate void AnimationFinished(object sender);
+ public event AnimationFinished OnAnimationFinished;
+
+ public delegate void AnimationProgress(object sender);
+ public event AnimationProgress OnAnimationProgress;
+
+ private readonly List<double> _animationProgresses;
+ private readonly List<Point> _animationSources;
+ private readonly List<AnimationDirection> _animationDirections;
+ private readonly List<object[]> _animationDatas;
+
+ private const double MIN_VALUE = 0.00;
+ private const double MAX_VALUE = 1.00;
+
+ private readonly Timer _animationTimer = new Timer { Interval = 5, Enabled = false };
+
+ /// <summary>
+ /// Constructor
+ /// </summary>
+ /// <param name="singular">If true, only one animation is supported. The current animation will be replaced with the new one. If false, a new animation is added to the list.</param>
+ public AnimationManager(bool singular = true)
+ {
+ _animationProgresses = new List<double>();
+ _animationSources = new List<Point>();
+ _animationDirections = new List<AnimationDirection>();
+ _animationDatas = new List<object[]>();
+
+ Increment = 0.03;
+ SecondaryIncrement = 0.03;
+ AnimationType = AnimationType.Linear;
+ InterruptAnimation = true;
+ Singular = singular;
+
+ if (Singular)
+ {
+ _animationProgresses.Add(0);
+ _animationSources.Add(new Point(0, 0));
+ _animationDirections.Add(AnimationDirection.In);
+ }
+
+ _animationTimer.Tick += AnimationTimerOnTick;
+ }
+
+ private void AnimationTimerOnTick(object sender, EventArgs eventArgs)
+ {
+ for (var i = 0; i < _animationProgresses.Count; i++)
+ {
+ UpdateProgress(i);
+
+ if (!Singular)
+ {
+ if ((_animationDirections[i] == AnimationDirection.InOutIn && _animationProgresses[i] == MAX_VALUE))
+ {
+ _animationDirections[i] = AnimationDirection.InOutOut;
+ }
+ else if ((_animationDirections[i] == AnimationDirection.InOutRepeatingIn && _animationProgresses[i] == MIN_VALUE))
+ {
+ _animationDirections[i] = AnimationDirection.InOutRepeatingOut;
+ }
+ else if ((_animationDirections[i] == AnimationDirection.InOutRepeatingOut && _animationProgresses[i] == MIN_VALUE))
+ {
+ _animationDirections[i] = AnimationDirection.InOutRepeatingIn;
+ }
+ else if (
+ (_animationDirections[i] == AnimationDirection.In && _animationProgresses[i] == MAX_VALUE) ||
+ (_animationDirections[i] == AnimationDirection.Out && _animationProgresses[i] == MIN_VALUE) ||
+ (_animationDirections[i] == AnimationDirection.InOutOut && _animationProgresses[i] == MIN_VALUE))
+ {
+ _animationProgresses.RemoveAt(i);
+ _animationSources.RemoveAt(i);
+ _animationDirections.RemoveAt(i);
+ _animationDatas.RemoveAt(i);
+ }
+ }
+ else
+ {
+ if ((_animationDirections[i] == AnimationDirection.InOutIn && _animationProgresses[i] == MAX_VALUE))
+ {
+ _animationDirections[i] = AnimationDirection.InOutOut;
+ }
+ else if ((_animationDirections[i] == AnimationDirection.InOutRepeatingIn && _animationProgresses[i] == MAX_VALUE))
+ {
+ _animationDirections[i] = AnimationDirection.InOutRepeatingOut;
+ }
+ else if ((_animationDirections[i] == AnimationDirection.InOutRepeatingOut && _animationProgresses[i] == MIN_VALUE))
+ {
+ _animationDirections[i] = AnimationDirection.InOutRepeatingIn;
+ }
+ }
+ }
+
+ OnAnimationProgress?.Invoke(this);
+ }
+
+ public bool IsAnimating()
+ {
+ return _animationTimer.Enabled;
+ }
+
+ public void StartNewAnimation(AnimationDirection animationDirection, object[] data = null)
+ {
+ StartNewAnimation(animationDirection, new Point(0, 0), data);
+ }
+
+ public void StartNewAnimation(AnimationDirection animationDirection, Point animationSource, object[] data = null)
+ {
+ if (!IsAnimating() || InterruptAnimation)
+ {
+ if (Singular && _animationDirections.Count > 0)
+ {
+ _animationDirections[0] = animationDirection;
+ }
+ else
+ {
+ _animationDirections.Add(animationDirection);
+ }
+
+ if (Singular && _animationSources.Count > 0)
+ {
+ _animationSources[0] = animationSource;
+ }
+ else
+ {
+ _animationSources.Add(animationSource);
+ }
+
+ if (!(Singular && _animationProgresses.Count > 0))
+ {
+ switch (_animationDirections[_animationDirections.Count - 1])
+ {
+ case AnimationDirection.InOutRepeatingIn:
+ case AnimationDirection.InOutIn:
+ case AnimationDirection.In:
+ _animationProgresses.Add(MIN_VALUE);
+ break;
+ case AnimationDirection.InOutRepeatingOut:
+ case AnimationDirection.InOutOut:
+ case AnimationDirection.Out:
+ _animationProgresses.Add(MAX_VALUE);
+ break;
+ default:
+ throw new Exception("Invalid AnimationDirection");
+ }
+ }
+
+ if (Singular && _animationDatas.Count > 0)
+ {
+ _animationDatas[0] = data ?? new object[] { };
+ }
+ else
+ {
+ _animationDatas.Add(data ?? new object[] { });
+ }
+
+ }
+
+ _animationTimer.Start();
+ }
+
+ public void UpdateProgress(int index)
+ {
+ switch (_animationDirections[index])
+ {
+ case AnimationDirection.InOutRepeatingIn:
+ case AnimationDirection.InOutIn:
+ case AnimationDirection.In:
+ IncrementProgress(index);
+ break;
+ case AnimationDirection.InOutRepeatingOut:
+ case AnimationDirection.InOutOut:
+ case AnimationDirection.Out:
+ DecrementProgress(index);
+ break;
+ default:
+ throw new Exception("No AnimationDirection has been set");
+ }
+ }
+
+ private void IncrementProgress(int index)
+ {
+ _animationProgresses[index] += Increment;
+ if (_animationProgresses[index] > MAX_VALUE)
+ {
+ _animationProgresses[index] = MAX_VALUE;
+
+ for (int i = 0; i < GetAnimationCount(); i++)
+ {
+ if (_animationDirections[i] == AnimationDirection.InOutIn) return;
+ if (_animationDirections[i] == AnimationDirection.InOutRepeatingIn) return;
+ if (_animationDirections[i] == AnimationDirection.InOutRepeatingOut) return;
+ if (_animationDirections[i] == AnimationDirection.InOutOut && _animationProgresses[i] != MAX_VALUE) return;
+ if (_animationDirections[i] == AnimationDirection.In && _animationProgresses[i] != MAX_VALUE) return;
+ }
+
+ _animationTimer.Stop();
+ OnAnimationFinished?.Invoke(this);
+ }
+ }
+
+ private void DecrementProgress(int index)
+ {
+ _animationProgresses[index] -= (_animationDirections[index] == AnimationDirection.InOutOut || _animationDirections[index] == AnimationDirection.InOutRepeatingOut) ? SecondaryIncrement : Increment;
+ if (_animationProgresses[index] < MIN_VALUE)
+ {
+ _animationProgresses[index] = MIN_VALUE;
+
+ for (var i = 0; i < GetAnimationCount(); i++)
+ {
+ if (_animationDirections[i] == AnimationDirection.InOutIn) return;
+ if (_animationDirections[i] == AnimationDirection.InOutRepeatingIn) return;
+ if (_animationDirections[i] == AnimationDirection.InOutRepeatingOut) return;
+ if (_animationDirections[i] == AnimationDirection.InOutOut && _animationProgresses[i] != MIN_VALUE) return;
+ if (_animationDirections[i] == AnimationDirection.Out && _animationProgresses[i] != MIN_VALUE) return;
+ }
+
+ _animationTimer.Stop();
+ OnAnimationFinished?.Invoke(this);
+ }
+ }
+
+ public double GetProgress()
+ {
+ if (!Singular)
+ throw new Exception("Animation is not set to Singular.");
+
+ if (_animationProgresses.Count == 0)
+ throw new Exception("Invalid animation");
+
+ return GetProgress(0);
+ }
+
+ public double GetProgress(int index)
+ {
+ if (!(index < GetAnimationCount()))
+ throw new IndexOutOfRangeException("Invalid animation index");
+
+ switch (AnimationType)
+ {
+ case AnimationType.Linear:
+ return AnimationLinear.CalculateProgress(_animationProgresses[index]);
+ case AnimationType.EaseInOut:
+ return AnimationEaseInOut.CalculateProgress(_animationProgresses[index]);
+ case AnimationType.EaseOut:
+ return AnimationEaseOut.CalculateProgress(_animationProgresses[index]);
+ case AnimationType.CustomQuadratic:
+ return AnimationCustomQuadratic.CalculateProgress(_animationProgresses[index]);
+ default:
+ throw new NotImplementedException("The given AnimationType is not implemented");
+ }
+
+ }
+
+ public Point GetSource(int index)
+ {
+ if (!(index < GetAnimationCount()))
+ throw new IndexOutOfRangeException("Invalid animation index");
+
+ return _animationSources[index];
+ }
+
+ public Point GetSource()
+ {
+ if (!Singular)
+ throw new Exception("Animation is not set to Singular.");
+
+ if (_animationSources.Count == 0)
+ throw new Exception("Invalid animation");
+
+ return _animationSources[0];
+ }
+
+ public AnimationDirection GetDirection()
+ {
+ if (!Singular)
+ throw new Exception("Animation is not set to Singular.");
+
+ if (_animationDirections.Count == 0)
+ throw new Exception("Invalid animation");
+
+ return _animationDirections[0];
+ }
+
+ public AnimationDirection GetDirection(int index)
+ {
+ if (!(index < _animationDirections.Count))
+ throw new IndexOutOfRangeException("Invalid animation index");
+
+ return _animationDirections[index];
+ }
+
+ public object[] GetData()
+ {
+ if (!Singular)
+ throw new Exception("Animation is not set to Singular.");
+
+ if (_animationDatas.Count == 0)
+ throw new Exception("Invalid animation");
+
+ return _animationDatas[0];
+ }
+
+ public object[] GetData(int index)
+ {
+ if (!(index < _animationDatas.Count))
+ throw new IndexOutOfRangeException("Invalid animation index");
+
+ return _animationDatas[index];
+ }
+
+ public int GetAnimationCount()
+ {
+ return _animationProgresses.Count;
+ }
+
+ public void SetProgress(double progress)
+ {
+ if (!Singular)
+ throw new Exception("Animation is not set to Singular.");
+
+ if (_animationProgresses.Count == 0)
+ throw new Exception("Invalid animation");
+
+ _animationProgresses[0] = progress;
+ }
+
+ public void SetDirection(AnimationDirection direction)
+ {
+ if (!Singular)
+ throw new Exception("Animation is not set to Singular.");
+
+ if (_animationProgresses.Count == 0)
+ throw new Exception("Invalid animation");
+
+ _animationDirections[0] = direction;
+ }
+
+ public void SetData(object[] data)
+ {
+ if (!Singular)
+ throw new Exception("Animation is not set to Singular.");
+
+ if (_animationDatas.Count == 0)
+ throw new Exception("Invalid animation");
+
+ _animationDatas[0] = data;
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/Animations/Animations.cs b/HotelPms.Share.Windows/Animations/Animations.cs
new file mode 100644
index 0000000..cf05849
--- /dev/null
+++ b/HotelPms.Share.Windows/Animations/Animations.cs
@@ -0,0 +1,53 @@
+using System;
+
+namespace HotelPms.Share.Windows.Animations
+{
+ enum AnimationType
+ {
+ Linear,
+ EaseInOut,
+ EaseOut,
+ CustomQuadratic
+ }
+
+ static class AnimationLinear
+ {
+ public static double CalculateProgress(double progress)
+ {
+ return progress;
+ }
+ }
+
+ static class AnimationEaseInOut
+ {
+ public static double PI = Math.PI;
+ public static double PI_HALF = Math.PI / 2;
+
+ public static double CalculateProgress(double progress)
+ {
+ return EaseInOut(progress);
+ }
+
+ private static double EaseInOut(double s)
+ {
+ return s - Math.Sin(s * 2 * PI) / (2 * PI);
+ }
+ }
+
+ public static class AnimationEaseOut
+ {
+ public static double CalculateProgress(double progress)
+ {
+ return -1 * progress * (progress - 2);
+ }
+ }
+
+ public static class AnimationCustomQuadratic
+ {
+ public static double CalculateProgress(double progress)
+ {
+ var kickoff = 0.6;
+ return 1 - Math.Cos((Math.Max(progress, kickoff) - kickoff) * Math.PI / (2 - (2 * kickoff)));
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/Component/AntLabel.cs b/HotelPms.Share.Windows/Component/AntLabel.cs
new file mode 100644
index 0000000..71c860a
--- /dev/null
+++ b/HotelPms.Share.Windows/Component/AntLabel.cs
@@ -0,0 +1,168 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Windows.Forms;
+using System.Drawing.Drawing2D;
+using System.Drawing;
+using System.ComponentModel;
+using Timer = System.Windows.Forms.Timer;
+
+namespace HotelPms.Share.Windows.Component
+{
+ public class AntLabel : Label
+ {
+ private int m_BeginX = 0;
+ private Timer timer1;
+ private System.ComponentModel.IContainer components;
+ private StringFormat sf = null;
+ private bool m_AnimationEnabled = false;
+
+ public bool AnimationEnabled
+ {
+ get { return m_AnimationEnabled; }
+ set
+ {
+ m_AnimationEnabled = value;
+ timer1.Enabled = m_AnimationEnabled;
+ this.Invalidate();
+ }
+ }
+
+ private int m_Interval = 300;
+
+ public int Interval
+ {
+ get { return m_Interval; }
+ set
+ {
+ m_Interval = value;
+ if (timer1 != null)
+ {
+ timer1.Interval = m_Interval;
+ this.Invalidate();
+ }
+ }
+ }
+
+ public AntLabel()
+ {
+ InitializeComponent();
+ sf = new StringFormat();
+ sf.Alignment = StringAlignment.Center;
+ sf.LineAlignment = StringAlignment.Center;
+ timer1.Enabled = false;
+ }
+
+ private LinearGradientMode m_GradientMode = LinearGradientMode.Vertical;
+ [Description("EndBackColor"), Category("CTextBoxArray動作")]
+ public LinearGradientMode GradientMode
+ {
+ get { return m_GradientMode; }
+ set { m_GradientMode = value; this.Invalidate(); }
+ }
+
+
+ private Color m_EndBackColor = Color.FromArgb(120, 150, 150);
+
+ [Description("EndBackColor"), Category("CTextBoxArray動作")]
+ public Color EndBackColor
+ {
+ get { return m_EndBackColor; }
+ set { m_EndBackColor = value; this.Invalidate(); }
+ }
+
+ protected override void OnPaint(PaintEventArgs e)
+ {
+ base.OnPaint(e);
+
+ int offset = 3;
+ Rectangle r = new Rectangle(offset, offset, this.ClientRectangle.Width - offset, this.ClientRectangle.Height - offset);
+
+ if (m_AnimationEnabled)
+ {
+ using (LinearGradientBrush lgb = new LinearGradientBrush(new Rectangle(m_BeginX, 0, this.Width, this.Height), Color.White, Color.Gainsboro, LinearGradientMode.Horizontal))
+ {
+ Color[] colors = new Color[]
+ {
+ Color.FromArgb(255, 0, 0),
+ Color.FromArgb(255, 0, 0),
+ Color.FromArgb(255, 128, 0),
+ Color.FromArgb(255, 255, 0),
+ Color.FromArgb(0, 255, 0),
+ Color.FromArgb(0, 255, 128),
+ Color.FromArgb(0, 255, 255),
+ Color.FromArgb(0, 128, 255),
+ Color.FromArgb(0, 0, 255),
+ Color.FromArgb(0, 0, 255),
+ };
+
+ int num_colors = colors.Length;
+ float[] blend_positions = new float[num_colors];
+ for (int i = 0; i < num_colors; i++)
+ {
+ blend_positions[i] = i / (num_colors - 1f);
+ }
+
+ ColorBlend color_blend = new ColorBlend();
+ color_blend.Colors = colors;
+ color_blend.Positions = blend_positions;
+ lgb.InterpolationColors = color_blend;
+
+ //e.Graphics.Clear(this.BackColor);
+ using (LinearGradientBrush brush = new LinearGradientBrush(this.ClientRectangle, m_EndBackColor, BackColor, m_GradientMode))
+ {
+ brush.SetSigmaBellShape(0.4f, 0.45f); //创建基于钟形曲线的渐变过渡过程。
+ e.Graphics.FillRectangle(brush, this.ClientRectangle);
+ }
+
+ // Draw the string again.
+ e.Graphics.DrawString(this.Text, this.Font, lgb, r, sf);
+ }
+ }
+ else
+ {
+ using (Brush defBrush = new SolidBrush(this.ForeColor))
+ {
+ //e.Graphics.Clear(this.BackColor);
+ using (LinearGradientBrush brush = new LinearGradientBrush(this.ClientRectangle, m_EndBackColor, BackColor, m_GradientMode))
+ {
+ brush.SetSigmaBellShape(0.4f, 0.45f); //创建基于钟形曲线的渐变过渡过程。
+ e.Graphics.FillRectangle(brush, this.ClientRectangle);
+ }
+
+ e.Graphics.DrawString(this.Text, this.Font, defBrush, r, sf);
+ }
+ }
+ }
+
+ private void InitializeComponent()
+ {
+ this.components = new System.ComponentModel.Container();
+ this.timer1 = new System.Windows.Forms.Timer(this.components);
+ this.SuspendLayout();
+ //
+ // timer1
+ //
+ this.timer1.Interval = 1000;
+ this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
+ this.ResumeLayout(false);
+
+ }
+
+ private void timer1_Tick(object sender, EventArgs e)
+ {
+ try
+ {
+ timer1.Enabled = false;
+ m_BeginX += 5;
+ if (m_BeginX > this.Width) { m_BeginX = 0; }
+ this.Invalidate();
+ }
+ catch { }
+ finally
+ {
+ timer1.Enabled = true;
+ }
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/Component/AntLabel.resx b/HotelPms.Share.Windows/Component/AntLabel.resx
new file mode 100644
index 0000000..64942a3
--- /dev/null
+++ b/HotelPms.Share.Windows/Component/AntLabel.resx
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>513, 587</value>
+ </metadata>
+ <metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>False</value>
+ </metadata>
+</root>
\ No newline at end of file
diff --git a/HotelPms.Share.Windows/Component/ButtonFlat.cs b/HotelPms.Share.Windows/Component/ButtonFlat.cs
new file mode 100644
index 0000000..1d306b6
--- /dev/null
+++ b/HotelPms.Share.Windows/Component/ButtonFlat.cs
@@ -0,0 +1,177 @@
+using HotelPms.Share.Windows.GraphicsApi;
+using HotelPms.Share.Windows.Util;
+using System;
+using System.ComponentModel;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Windows.Forms;
+
+namespace HotelPms.Share.Windows.Component
+{
+ public class ButtonFlat : System.Windows.Forms.Button
+ {
+ private bool m_DisableClickEvent = true;
+
+ /// <summary>
+ /// Click連打禁止 【※注意:ボタンイベントの中でFrom.Show()を使うとShownイベントなども消える場合があります。】
+ /// </summary>
+ [Description("Click連打禁止 【※注意:ボタンイベントの中でFrom.Show()を使うとShownイベントなども消える場合があります。】"), Category("拡張動作"), DefaultValue(true)]
+ public bool DisableClickEvent
+ {
+ get { return m_DisableClickEvent; }
+ set { m_DisableClickEvent = value; }
+ }
+
+ private LinearGradientMode m_GradientMode = LinearGradientMode.Horizontal;
+
+ [Description("GradientMode"), Category("拡張動作"), DefaultValue(LinearGradientMode.Horizontal)]
+ public LinearGradientMode GradientMode
+ {
+ get { return m_GradientMode; }
+ set { m_GradientMode = value; Invalidate(); }
+ }
+
+ private Color m_GradientColor = Color.Empty;
+
+ [Description("GradientColor"), Category("拡張動作")]
+ public Color GradientColor
+ {
+ get { return m_GradientColor; }
+ set { m_GradientColor = value; Invalidate(); }
+ }
+
+ private bool m_Selected = false;
+ private bool m_MouseFocused = false;
+ private StringFormat m_StringFormat = new StringFormat();
+ private Image imgEllipse = null;
+
+ protected override void Dispose(bool disposing)
+ {
+ if (imgEllipse != null) { imgEllipse.Dispose(); }
+ m_StringFormat.Dispose();
+ base.Dispose(disposing);
+ }
+
+ protected override void OnPaint(PaintEventArgs pevent)
+ {
+ base.OnPaint(pevent);
+ if (this.FlatStyle != FlatStyle.Flat) { return; }
+
+ //ControlPaint.Light
+ Color beginColor = this.m_MouseFocused ? (FlatAppearance.MouseOverBackColor == Color.Empty ? ControlPaint.Light(this.BackColor) : FlatAppearance.MouseOverBackColor) : m_Selected ? (FlatAppearance.MouseDownBackColor == Color.Empty ? ControlPaint.Light(this.BackColor) : FlatAppearance.MouseDownBackColor) : this.BackColor;
+ Color endColor = m_GradientColor == Color.Empty ? beginColor : this.m_MouseFocused ? ControlPaint.LightLight(m_GradientColor) : m_Selected ? ControlPaint.Light(m_GradientColor) : m_GradientColor;
+
+ //using (LinearGradientBrush brush = new LinearGradientBrush(this.ClientRectangle, Color.FromArgb(0, 136, 0), Color.FromArgb(0, 166, 0), m_GradientMode))
+ using (LinearGradientBrush brush = new LinearGradientBrush(this.ClientRectangle, beginColor, endColor, m_GradientMode))
+ {
+ pevent.Graphics.FillRectangle(brush, this.ClientRectangle);
+ }
+
+ //線
+ if (this.FlatAppearance.BorderSize > 0 && !this.FlatAppearance.BorderColor.Equals(Color.Empty))
+ {
+ using (Pen pen = new Pen(this.FlatAppearance.BorderColor, this.FlatAppearance.BorderSize))
+ {
+ pevent.Graphics.DrawRectangle(pen, new Rectangle(this.ClientRectangle.X, this.ClientRectangle.Y, this.ClientRectangle.Width - this.FlatAppearance.BorderSize, this.ClientRectangle.Height - this.FlatAppearance.BorderSize));
+ }
+ }
+
+ Rectangle textRect = ClientRectangle;
+ if (Image != null && imgEllipse == null)
+ {
+ imgEllipse = GdiPlus.CutEllipse(Image, new Rectangle(0, 0, Image.Size.Width, Image.Size.Height), Image.Size);
+ }
+
+ if (imgEllipse != null)
+ {
+ //高さの80%で出力
+ int imgHeight = (int)(ClientRectangle.Height * 0.8F);
+ int adding = (int)(textRect.Height - imgHeight) / 2;
+ pevent.Graphics.DrawImage(imgEllipse, new Rectangle(adding, adding, imgHeight, imgHeight));
+ textRect = new Rectangle(new Point(textRect.Location.X + textRect.Height, 0), new Size(textRect.Width - textRect.Height, textRect.Height));
+ }
+
+ SetStringFormat();
+ using (SolidBrush foreBrush = new SolidBrush(this.ForeColor))
+ {
+ pevent.Graphics.DrawString(this.Text, this.Font, foreBrush, textRect, m_StringFormat);
+ }
+ }
+
+ private void SetStringFormat()
+ {
+ switch (this.TextAlign)
+ {
+ case ContentAlignment.BottomCenter:
+ case ContentAlignment.BottomLeft:
+ case ContentAlignment.BottomRight:
+ m_StringFormat.LineAlignment = StringAlignment.Far;
+ break;
+ case ContentAlignment.MiddleCenter:
+ case ContentAlignment.MiddleLeft:
+ case ContentAlignment.MiddleRight:
+ m_StringFormat.LineAlignment = StringAlignment.Center;
+ break;
+ case ContentAlignment.TopCenter:
+ case ContentAlignment.TopLeft:
+ case ContentAlignment.TopRight:
+ m_StringFormat.LineAlignment = StringAlignment.Near;
+ break;
+ }
+
+ switch (this.TextAlign)
+ {
+ case ContentAlignment.TopLeft:
+ case ContentAlignment.BottomLeft:
+ case ContentAlignment.MiddleLeft:
+ m_StringFormat.Alignment = StringAlignment.Near;
+ break;
+ case ContentAlignment.MiddleCenter:
+ case ContentAlignment.BottomCenter:
+ case ContentAlignment.TopCenter:
+ m_StringFormat.Alignment = StringAlignment.Center;
+ break;
+ case ContentAlignment.BottomRight:
+ case ContentAlignment.MiddleRight:
+ case ContentAlignment.TopRight:
+ m_StringFormat.Alignment = StringAlignment.Far;
+ break;
+ }
+ }
+
+ protected override void OnEnter(EventArgs e)
+ {
+ base.OnEnter(e);
+ m_Selected = true;
+ }
+
+ protected override void OnLeave(EventArgs e)
+ {
+ base.OnLeave(e);
+ m_Selected = false;
+ }
+
+ protected override void OnMouseEnter(EventArgs e)
+ {
+ base.OnMouseEnter(e);
+ m_MouseFocused = true;
+ }
+
+ protected override void OnMouseLeave(EventArgs e)
+ {
+ base.OnMouseLeave(e);
+ m_MouseFocused = false;
+ }
+
+ protected override void OnClick(EventArgs e)
+ {
+ //System.Diagnostics.Debug.WriteLine("base.OnClick begin");
+ base.OnClick(e);
+
+ //System.Diagnostics.Debug.WriteLine("base.OnClick end ");
+
+ //保留されているメッセージを削除し、2度押しを許可しない
+ if (m_DisableClickEvent) { RemovePeekMessage.Invoke(); }
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/Component/CTextBox.cs b/HotelPms.Share.Windows/Component/CTextBox.cs
new file mode 100644
index 0000000..325f34e
--- /dev/null
+++ b/HotelPms.Share.Windows/Component/CTextBox.cs
@@ -0,0 +1,886 @@
+using System;
+using System.ComponentModel;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Text;
+using System.Windows.Forms;
+using System.Drawing;
+using System.Drawing.Design;
+using HotelPms.Share.Windows.Component.PropertyEditor;
+using System.Runtime.InteropServices;
+using System.Text.RegularExpressions;
+
+namespace HotelPms.Share.Windows.Component
+{
+ /// <summary>
+ /// 入力スタイル
+ /// </summary>
+ public enum InputStyleSelection
+ {
+ /// <summary>
+ /// 通常
+ /// </summary>
+ [Description("通常")]
+ Normal = 0,
+ /// 時刻
+ /// </summary>
+ [Description("時刻")]
+ Time,
+ [Description("日付")]
+ Date,
+ [Description("年月")]
+ Month,
+ }
+
+ /// <summary>
+ /// MMyyを入力したときの年の付与方法
+ /// </summary>
+ public enum MMddInputStyle
+ {
+ Future = 0, //未来
+ Before = 1, //過去
+ }
+
+ /// <summary>
+ /// EnabledがFalseでも前景色、背景色が変わらないTextBox
+ /// </summary>
+ [ToolboxBitmap(typeof(System.Windows.Forms.TextBox))]
+ public class CTextBox : TextBox, ITextBoxArray, IPanelEx
+ {
+ public enum ETitleStyle : int
+ {
+ /// <summary>
+ /// なし
+ /// </summary>
+ [Description("なし")]
+ None = 0,
+ /// <summary>
+ /// "ラベル
+ /// </summary>
+ [Description("ラベル")]
+ Label,
+ /// <summary>
+ /// アイコン
+ /// </summary>
+ [Description("アイコン")]
+ Icon,
+ /// <summary>
+ /// アンドロイドスタイル
+ /// </summary>
+ [Description("アンドロイドスタイル")]
+ Material,
+ }
+
+ #region -------- API ------
+
+ [EditorBrowsable(EditorBrowsableState.Always), Browsable(true),
+ DesignerSerializationVisibility(DesignerSerializationVisibility.Visible), Bindable(true)]
+ public override bool AutoSize
+ {
+ get { return base.AutoSize; }
+ set { base.AutoSize = value; }
+ }
+
+ [System.Runtime.InteropServices.DllImport("user32.dll")]
+ private static extern int SetWindowLong(IntPtr hWnd, int nIndex, int wndproc);
+ [System.Runtime.InteropServices.DllImport("user32.dll")]
+ private static extern int GetWindowLong(IntPtr hWnd, int nIndex);
+ private const int GWL_STYLE = -16;
+ private const int WS_DISABLED = 0x8000000;
+
+ private const int EM_SETCUEBANNER = 0x1501;
+ [DllImport("user32.dll", CharSet = CharSet.Auto)]
+ private static extern Int32 SendMessage(IntPtr hWnd, int msg, int wParam, [MarshalAs(UnmanagedType.LPWStr)] string lParam);
+
+ #endregion
+
+ private bool m_IsFocus = false;
+
+ private static bool m_ClickSelAll = false;
+
+ /// <summary>
+ /// クリックしたら、全選択かどうか
+ /// </summary>
+ public static bool ClickSelAll
+ {
+ get { return m_ClickSelAll; }
+ set { m_ClickSelAll = value; }
+ }
+
+ #region 拡張動作
+
+ private MMddInputStyle curMMddInputStyle = MMddInputStyle.Future;
+
+ /// <summary>
+ /// MMddで入力したら、来年 + mmddかもしくは 今年 + mmddの設定
+ /// </summary>
+ [Description("MMddで入力したら、来年/今年/ホテルデート + MMddの設定"), Category("拡張動作")]
+ public MMddInputStyle CurMMddInputStyle
+ {
+ get { return curMMddInputStyle; }
+ set { curMMddInputStyle = value; }
+ }
+
+ private string tipText = string.Empty;
+
+ [Description("ヒント"), Category("拡張動作")]
+ public string TipText
+ {
+ get { return tipText; }
+ set
+ {
+ tipText = value;
+ SendMessage(this.Handle, EM_SETCUEBANNER, 0, value);
+ Invalidate();
+ }
+ }
+
+ private bool panelExEnabled = false;
+
+ [Description("親Panelを描くするかどうか"), Category("IPanelEx拡張動作")]
+ public bool PanelExEnabled
+ {
+ get { return panelExEnabled; }
+ set { panelExEnabled = value; Invalidate(); }
+ }
+
+
+ private ETitleStyle titleStyle = ETitleStyle.None;
+
+ [Description("タイトル表示"), Category("IPanelEx拡張動作")]
+ public ETitleStyle TitleStyle
+ {
+ get { return titleStyle; }
+ set { titleStyle = value; Invalidate(); }
+ }
+
+ private int titleWidth = 50;
+
+ [Description("タイトル幅(アイコンの場合無効、幅=高)"), Category("IPanelEx拡張動作")]
+ public int TitleWidth
+ {
+ get { return titleWidth; }
+ set { titleWidth = value; Invalidate(); }
+ }
+
+ private string titleText = string.Empty;
+
+ [Description("タイトルの文言"), Category("IPanelEx拡張動作")]
+ public string TitleText
+ {
+ get { return titleText; }
+ set { titleText = value; Invalidate(); }
+ }
+
+ private Font titleFont = new Font("MS UI Gothic", 9F);
+
+ [Description("タイトルのフォント"), Category("IPanelEx拡張動作")]
+ public Font TitleFont
+ {
+ get { return titleFont; }
+ set { titleFont = value; Invalidate(); }
+ }
+
+ private Color titleForeColor = Color.White;
+
+ [Description("タイトルの文字色"), Category("IPanelEx拡張動作")]
+ public Color TitleForeColor
+ {
+ get { return titleForeColor; }
+ set { titleForeColor = value; Invalidate(); }
+ }
+
+ private Color titleBackColor = Color.FromArgb(255, 0, 64, 64);
+
+ [Description("タイトルの背景色"), Category("IPanelEx拡張動作")]
+ public Color TitleBackColor
+ {
+ get { return titleBackColor; }
+ set { titleBackColor = value; Invalidate(); }
+ }
+
+ private Color shadowColor = Color.FromArgb(140, 123, 193, 247); //#7bc1f7 140, 123, 193, 247 (青) #22AC38 140, 34, 172, 56 (緑) 255,55,71,79 (濃Gray)
+
+ [Description("影色"), Category("IPanelEx拡張動作")]
+ public Color ShadowColor
+ {
+ get { return shadowColor; }
+ set { shadowColor = value; Invalidate(); }
+ }
+
+ private Color borderColor = Color.FromArgb(255, 122, 122, 122); //255,0,120,215 (濃青) #7bc1f7 140, 123, 193, 247 (青) #22AC38 255, 34, 172, 56 (緑) 255,122,122,122(Gray)
+
+ [Description("罫線色"), Category("IPanelEx拡張動作")]
+ public Color BorderColor
+ {
+ get { return borderColor; }
+ set { borderColor = value; Invalidate(); }
+ }
+
+ private Color borderFocusColor = Color.FromArgb(255, 0, 120, 215); //255,0,120,215 (濃青) #7bc1f7 140, 123, 193, 247 (青) #22AC38 255, 34, 172, 56 (緑) 255,122,122,122(Gray)
+
+ [Description("罫線色"), Category("IPanelEx拡張動作")]
+ public Color BorderFocusColor
+ {
+ get { return borderFocusColor; }
+ set { borderFocusColor = value; Invalidate(); }
+ }
+
+ private Image foreImage = null;
+
+ [Category("IPanelEx拡張動作"), Description("显示的前端的图片")]
+ public Image ForeImage
+ {
+ get { return foreImage; }
+ set
+ {
+ foreImage = value;
+ Invalidate();
+ }
+ }
+
+ #endregion
+
+ private bool enabled = true;
+ public new bool Enabled
+ {
+ get { return enabled; }
+ set
+ {
+ enabled = value;
+ if (enabled)
+ {
+ SetWindowLong(this.Handle, GWL_STYLE, (~WS_DISABLED) & GetWindowLong(this.Handle, GWL_STYLE));
+ }
+ else
+ {
+ SetWindowLong(this.Handle, GWL_STYLE, WS_DISABLED | GetWindowLong(this.Handle, GWL_STYLE));
+ }
+ }
+ }
+
+ #region CTextBoxArray動作
+
+ private InputStyleSelection m_InputStyle = InputStyleSelection.Normal;
+ private bool m_TextBoxArrayMember = false;
+ private string m_ShowStyle = "0x1";
+ private bool m_IsChkData = false;
+ private bool m_NotNull = false;
+ private string m_InputType = "0x1";
+ private bool m_IsDate = false;
+ private string m_In_Range = string.Empty; // '範囲: "'A','E','F'" OR "'1','2','21'" OR "[1,10]" OR "(1,10)" OR "[1,10)" OR "(1,10]" 空白の時しない
+ private string m_DBFieldName = string.Empty;
+ private object m_DBObject = null;
+ private bool m_IsPrimaryKey = false;
+ private bool m_EnableUpDownKey = false; //↑と↓キーで「enter」と「esc」同じ様にする
+ private Control m_MstNameCtrl = null;
+
+ [Description("入力モード"), Category("CTextBoxArray動作"), DefaultValue(InputStyleSelection.Normal)]
+ public InputStyleSelection InputStyle
+ {
+ get { return m_InputStyle; }
+ set { m_InputStyle = value; }
+ }
+
+ [Description("日付コントロールかどうか"), Category("CTextBoxArray動作"), DefaultValue(false)]
+ public bool IsDate
+ {
+ get { return m_IsDate; }
+ set { m_IsDate = value; }
+ }
+
+ [Description("入力範囲を取得または設定します。"), Category("CTextBoxArray動作"), DefaultValue("")]
+ public string In_Range
+ {
+ get { return m_In_Range; }
+ set { m_In_Range = value; }
+ }
+
+ [Description("DB項目名を取得または設定します。"), Category("CTextBoxArray動作"), DefaultValue("")]
+ public string DBFieldName
+ {
+ get { return m_DBFieldName; }
+ set { m_DBFieldName = value; }
+ }
+
+ [Description("DBクラスを取得または設定します。"), Category("CTextBoxArray動作"), DefaultValue(null)]
+ public object DBObject
+ {
+ get { return m_DBObject; }
+ set { m_DBObject = value; }
+ }
+
+ [Description("PrimaryKeyを取得または設定します。"), Category("CTextBoxArray動作"), DefaultValue(false)]
+ public bool IsPrimaryKey
+ {
+ get { return m_IsPrimaryKey; }
+ set { m_IsPrimaryKey = value; }
+ }
+
+ [Description("UpとDownFocus動作するかどうか。"), Category("CTextBoxArray動作"), DefaultValue(false)]
+ public bool EnableUpDownKey
+ {
+ get { return m_EnableUpDownKey; }
+ set { m_EnableUpDownKey = value; }
+ }
+
+ [Description("名称コントロールを取得または設定します。"), Category("CTextBoxArray動作"), DefaultValue("")]
+ public Control MstNameCtrl
+ {
+ get { return m_MstNameCtrl; }
+ set { m_MstNameCtrl = value; }
+ }
+
+ [Description("CTextBoxArrayの子コントロールを取得または設定します。"), Category("CTextBoxArray動作"), DefaultValue(false)]
+ public bool TextBoxArrayMember
+ {
+ get { return m_TextBoxArrayMember; }
+ set { m_TextBoxArrayMember = value; }
+ }
+
+ [Description("チェックするかどうか"), Category("CTextBoxArray動作"), DefaultValue(false)]
+ public bool IsChkData
+ {
+ get { return m_IsChkData; }
+ set { m_IsChkData = value; }
+ }
+
+ [Description("空白可能かどうか true:NULL不可 / false:NULL可"), Category("CTextBoxArray動作"), DefaultValue(false)]
+ public bool NotNull
+ {
+ get { return m_NotNull; }
+ set { m_NotNull = value; }
+ }
+
+ [Description("組合せ可能 例:0x2,0x8"), Category("CTextBoxArray動作"), DefaultValue(false),
+ Editor(typeof(InputTypeEditor), typeof(UITypeEditor))]
+ public string InputType
+ {
+ get { return m_InputType; }
+ set { m_InputType = value; }
+ }
+
+ [Description(@"組合せ可能 例:0x2,0x8
+0x1:特になし
+0x2:桁数未満だったら「0」を頭に追加
+0x4:金額時の3桁ごとの「,」 例1,000,000
+0x8:ENDキーで一覧選択画面があり"), Category("CTextBoxArray動作"), DefaultValue("0x1")]
+ public string ShowStyle
+ {
+ get { return m_ShowStyle; }
+ set { m_ShowStyle = value; }
+ }
+
+ private string m_OrgText = string.Empty;
+ public string OrgText
+ {
+ get { return m_OrgText; }
+ set { m_OrgText = value; }
+ }
+
+ #endregion
+
+ protected override void OnEnter(EventArgs e)
+ {
+ if (enabled) { base.OnEnter(e); }
+ m_IsFocus = true;
+ }
+
+ /// <summary>
+ /// フォッカス取得時
+ /// </summary>
+ /// <param name="e"></param>
+ protected override void OnGotFocus(EventArgs e)
+ {
+ if (!enabled) { return; }
+ base.OnGotFocus(e);
+
+ if ((this.Text != string.Empty) && (!this.Multiline))
+ {
+ this.SelectAll();
+ }
+ }
+
+ protected override void OnLeave(EventArgs e)
+ {
+ if (enabled) { base.OnLeave(e); }
+ m_IsFocus = false;
+ }
+
+ protected override void OnClick(EventArgs e)
+ {
+ if (enabled) { base.OnClick(e); }
+ }
+
+ protected override void OnMouseDown(MouseEventArgs e)
+ {
+ if (enabled) { base.OnMouseDown(e); }
+ }
+
+ protected override void OnMouseUp(MouseEventArgs e)
+ {
+ if (enabled) { base.OnMouseUp(e); }
+
+ if (m_ClickSelAll && m_IsFocus && e.Button == MouseButtons.Left)
+ {
+ if (this.Text.Length > 0)
+ {
+ this.SelectAll();
+ }
+ m_IsFocus = false;
+ }
+ }
+
+ protected override void OnMouseEnter(EventArgs e)
+ {
+ if (enabled) { base.OnMouseEnter(e); }
+ }
+
+ protected override void OnKeyDown(KeyEventArgs e)
+ {
+ switch (e.KeyCode)
+ {
+ case Keys.Return:
+ if (m_InputStyle == InputStyleSelection.Time)
+ {
+ this.Text = ParseTime();
+ }
+ else if (m_InputStyle == InputStyleSelection.Month)
+ {
+ this.Text = ParseMonth();
+ }
+ else if (m_InputStyle == InputStyleSelection.Date)
+ {
+ this.Text = ParseDate();
+ }
+ break;
+ }
+ base.OnKeyDown(e);
+ }
+
+ protected override void OnValidating(CancelEventArgs e)
+ {
+ if (m_InputStyle == InputStyleSelection.Time)
+ {
+ this.Text = ParseTime();
+ }
+ else if (m_InputStyle == InputStyleSelection.Month)
+ {
+ this.Text = ParseMonth();
+ }
+ else if (m_InputStyle == InputStyleSelection.Date)
+ {
+ this.Text = ParseDate();
+ }
+ base.OnValidating(e);
+ }
+
+ /// <summary>
+ /// 月文字列加工
+ /// </summary>
+ /// <returns></returns>
+ public string ParseMonth()
+ {
+ string sbuf = "";
+ try
+ {
+ if (this.Text.Length == 2)
+ {
+ //月のみが入力されている場合は、当年の年を付加する
+ if (int.Parse(this.Text) >= 1 && int.Parse(this.Text) <= 12)
+ {
+ sbuf = DateTime.Today.Year.ToString() + "/" + this.Text;
+ }
+ }
+ else if (this.Text.Length == 6)
+ {
+ int pos = this.Text.LastIndexOf('/');
+ if (pos == -1)
+ {
+ if (int.Parse(this.Text.Substring(4)) >= 1 && int.Parse(this.Text.Substring(4)) <= 12)
+ {
+ sbuf = this.Text.Substring(0, 4) + "/" + this.Text.Substring(4);
+ }
+ }
+ else if (pos == 4)
+ {
+ sbuf = this.Text.Substring(0, 4) + "/0" + this.Text.Substring(5);
+ }
+ }
+ else if (this.Text.Length == 7 && this.Text.LastIndexOf('/') == 4)
+ {
+ if (int.Parse(this.Text.Substring(5)) >= 1 && int.Parse(this.Text.Substring(5)) <= 12)
+ {
+ sbuf = this.Text;
+ }
+ }
+
+ if (Convert.ToInt32(sbuf.Replace("/", string.Empty)) < 190101) { return string.Empty; }
+
+ return sbuf;
+ }
+ catch
+ {
+ return "";
+ }
+
+ }
+
+ /// <summary>
+ /// 全て数字かどうか
+ /// </summary>
+ /// <param name="strNumber"></param>
+ /// <returns></returns>
+ private bool IsWholeNumber(String strNumber)
+ {
+ Regex objNotPattern = new Regex("[^0-9]");
+ Regex objPattern = new Regex("^[0-9]+$");
+ return !objNotPattern.IsMatch(strNumber) && objPattern.IsMatch(strNumber);
+ }
+
+ private DateTime GetToday()
+ {
+ return DateTime.Today;
+ }
+
+ public string ParseDate()
+ {
+ string sbuf = "";
+ try
+ {
+ if (this.Text.Length == 10)
+ {
+ //入力された文字列が日付入力文字として正しいかをチェックする
+
+ int pos = this.Text.IndexOf('/');
+ if (pos == 4)
+ {
+ pos = this.Text.LastIndexOf('/');
+ if (pos == 7)
+ {
+ if (int.Parse(this.Text.Substring(5, 2)) >= 1 && int.Parse(this.Text.Substring(5, 2)) <= 12 && int.Parse(this.Text.Substring(8)) >= 1 && int.Parse(this.Text.Substring(8)) <= 31)
+ {
+ DateTime result;
+ if (DateTime.TryParse(this.Text, out result))
+ {
+ sbuf = this.Text;
+ }
+ }
+ }
+ }
+ }
+ else if (this.Text.Length == 9)
+ {
+ int pos = this.Text.IndexOf('/');
+ if (pos == 4)
+ {
+ pos = this.Text.LastIndexOf('/');
+ if (pos == 7)
+ {
+ // Ex)2012/10/1
+ if (int.Parse(this.Text.Substring(5, 2)) >= 1 && int.Parse(this.Text.Substring(5, 2)) <= 12 && int.Parse(this.Text.Substring(8)) >= 1 && int.Parse(this.Text.Substring(8)) <= 31)
+ {
+ DateTime result;
+ if (DateTime.TryParse(this.Text.Substring(0, 7) + "/0" + this.Text.Substring(8), out result))
+ {
+ sbuf = this.Text.Substring(0, 7) + "/0" + this.Text.Substring(8);
+ }
+ }
+ }
+ else if (pos == 6)
+ {
+ //20151218 毛利 Redmine#7195 日付のチェックの桁がおかしかった。.Substring(8)→.Substring(7)に修正
+ // Ex)2012/1/11
+ if (int.Parse(this.Text.Substring(5, 1)) >= 1 && int.Parse(this.Text.Substring(5, 1)) <= 12 && int.Parse(this.Text.Substring(7)) >= 1 && int.Parse(this.Text.Substring(7)) <= 31)
+ {
+ DateTime result;
+ if (DateTime.TryParse(this.Text.Substring(0, 5) + "0" + this.Text.Substring(5), out result))
+ {
+ sbuf = this.Text.Substring(0, 5) + "0" + this.Text.Substring(5);
+ }
+ }
+ }
+ }
+ }
+ else if (this.Text.Length == 8)
+ {
+ int pos = this.Text.LastIndexOf('/');
+ if (pos == -1)
+ {
+ //スラッシュが入力されない場合
+ if (int.Parse(this.Text.Substring(4, 2)) >= 1 && int.Parse(this.Text.Substring(4, 2)) <= 12 && (int.Parse(this.Text.Substring(6, 2)) >= 1 && int.Parse(this.Text.Substring(6, 2)) <= 31))
+ {
+ DateTime result;
+ if (DateTime.TryParse(this.Text.Substring(0, 4) + "/" + this.Text.Substring(4, 2) + "/" + this.Text.Substring(6, 2), out result))
+ {
+ sbuf = this.Text.Substring(0, 4) + "/" + this.Text.Substring(4, 2) + "/" + this.Text.Substring(6, 2);
+ }
+ }
+ }
+ else if (pos == 6)
+ {
+ //Ex)2012/1/1
+ pos = this.Text.IndexOf('/');
+ if (pos == 4)
+ {
+ DateTime result;
+ if (DateTime.TryParse(this.Text.Substring(0, 4) + "/0" + this.Text.Substring(5, 1) + "/0" + this.Text.Substring(7), out result))
+ {
+ sbuf = this.Text.Substring(0, 4) + "/0" + this.Text.Substring(5, 1) + "/0" + this.Text.Substring(7);
+ }
+ }
+ }
+ }
+ else if (this.Text.Length == 6)
+ {
+ if (IsWholeNumber(this.Text))
+ {
+ DateTime result;
+ string dateStr = string.Format("{0}{1}/{2}/{3}", DateTime.Today.Year.ToString().Substring(0, 2), this.Text.Substring(0, 2), this.Text.Substring(2, 2), this.Text.Substring(4, 2));
+ if (DateTime.TryParse(dateStr, out result))
+ {
+ sbuf = dateStr;
+ }
+ }
+ }
+ else if (this.Text.Length == 5)
+ {
+ //月日のみ入力
+ int pos = this.Text.LastIndexOf('/');
+ if (pos == 2)
+ {
+ DateTime result;
+ if (DateTime.TryParse(DateTime.Today.Year.ToString() + "/" + this.Text, out result))
+ {
+ sbuf = DateTime.Today.Year.ToString() + "/" + this.Text;
+ }
+ }
+ }
+ else if (this.Text.Length == 4)
+ {
+ //月日のみ入力 Ex)1111
+ int pos = this.Text.LastIndexOf('/');
+ if (pos == -1)
+ {
+ DateTime result;
+
+ if (this.Text == "0229")
+ {
+ if (!DateTime.TryParse(this.GetToday().Year.ToString() + "/02/29", out result))//今年で変換できた
+ {
+ if (curMMddInputStyle == MMddInputStyle.Future)//「今年/02/29」 or 「来年/02/29」
+ {
+ DateTime.TryParse(this.GetToday().Year.ToString() + "/02/28", out result);//仮に0228で日付取得
+ }
+ else if (curMMddInputStyle == MMddInputStyle.Before)
+ {
+ DateTime.TryParse(this.GetToday().Year.ToString() + "/03/01", out result);//仮に0301で日付取得
+ }
+ }
+
+ if (curMMddInputStyle == MMddInputStyle.Future)//「今年/02/29」 or 「来年/02/29」
+ {
+ //未来
+ if (DateTime.Compare(result.Date, this.GetToday().Date) < 0)
+ {
+ result = result.AddYears(1);//さらに未来
+ }
+ }
+ else if (curMMddInputStyle == MMddInputStyle.Before)//「今年/02/29」 or 「去年/02/29」
+ {
+ //過去
+ if (DateTime.Compare(result.Date, this.GetToday().Date) > 0)
+ {
+ result = result.AddYears(-1);//さらに過去
+ }
+ }
+
+ if (DateTime.TryParse(result.Year.ToString() + "/02/29", out result))//最後にその年で02/29にがあるなら
+ {
+ sbuf = result.ToString("yyyy/MM/dd");
+ }
+ }
+ else if (DateTime.TryParse(this.GetToday().Year.ToString() + "/" + this.Text.Substring(0, 2) + "/" + this.Text.Substring(2), out result))
+ {
+ if (curMMddInputStyle == MMddInputStyle.Future)
+ {
+ //未来
+ if (DateTime.Compare(new DateTime(this.GetToday().Year, int.Parse(this.Text.Substring(0, 2)), int.Parse(this.Text.Substring(2))), this.GetToday().Date) < 0)
+ {
+ sbuf = (this.GetToday().Year + 1).ToString() + "/" + this.Text.Substring(0, 2) + "/" + this.Text.Substring(2);
+ }
+ else
+ {
+ sbuf = this.GetToday().Year.ToString() + "/" + this.Text.Substring(0, 2) + "/" + this.Text.Substring(2);
+ }
+ }
+ else
+ {
+ //過去
+ if (DateTime.Compare(new DateTime(this.GetToday().Year, int.Parse(this.Text.Substring(0, 2)), int.Parse(this.Text.Substring(2))), this.GetToday().Date) <= 0)
+ {
+ sbuf = this.GetToday().Year.ToString() + "/" + this.Text.Substring(0, 2) + "/" + this.Text.Substring(2);
+ }
+ else
+ {
+ sbuf = (this.GetToday().Year - 1).ToString() + "/" + this.Text.Substring(0, 2) + "/" + this.Text.Substring(2);
+ }
+ //-----------------------------------liu 不具合2270 ↑-------------------------------------------------------
+ }
+ }
+ }
+ else if (pos == 1)
+ {
+ //月日のみ入力 Ex)1/11
+ DateTime result;
+ if (DateTime.TryParse(DateTime.Today.Year.ToString() + "/0" + this.Text, out result))
+ {
+ sbuf = DateTime.Today.Year.ToString() + "/0" + this.Text;
+ }
+ }
+ else if (pos == 2)
+ {
+ //月日のみ入力 Ex)11/1
+ DateTime result;
+ if (DateTime.TryParse(DateTime.Today.Year.ToString() + "/" + this.Text.Substring(0, 2) + "/0" + this.Text.Substring(3), out result))
+ {
+ sbuf = DateTime.Today.Year.ToString() + "/" + this.Text.Substring(0, 2) + "/0" + this.Text.Substring(3);
+ }
+ }
+ }
+ else if (this.Text.Length == 3)
+ {
+ //月日のみ入力 Ex)111
+ int pos = this.Text.LastIndexOf('/');
+ if (pos == 1)
+ {
+ //月日のみ入力 Ex)1/1
+ DateTime result;
+ if (DateTime.TryParse(DateTime.Today.Year.ToString() + "/0" + this.Text, out result))
+ {
+ sbuf = result.ToShortDateString();
+ }
+ }
+ }
+ else if (this.Text.Length == 2)
+ {
+ //EX 01
+ int pos = this.Text.LastIndexOf('/');
+ if (pos == -1)
+ {
+ DateTime result;
+ if (DateTime.TryParse(this.GetToday().Year.ToString() + "/" + this.GetToday().Month.ToString() + "/" + this.Text, out result))
+ {
+ if (DateTime.Compare(this.GetToday().Date, new DateTime(this.GetToday().Year, this.GetToday().Month, int.Parse(this.Text))) <= 0)
+ {
+ sbuf = this.GetToday().Year.ToString() + "/" + this.GetToday().Month.ToString() + "/" + this.Text;
+ }
+ else
+ {
+ if ((this.GetToday().Month + 1) > 12)
+ {
+ sbuf = (this.GetToday().Year + 1).ToString() + "/01" + "/" + this.Text;
+ }
+ else
+ {
+ sbuf = this.GetToday().Year.ToString() + "/" + (this.GetToday().Month + 1).ToString() + "/" + this.Text;
+ }
+ }
+ sbuf = DateTime.Parse(sbuf).ToString("yyyy/MM/dd");
+ }
+ }
+ }
+ return sbuf;
+ }
+ catch
+ {
+ //return this.Text;
+ return OrgText;
+ }
+
+ }
+
+ /// <summary>
+ /// 時間文字列の加工
+ /// </summary>
+ /// <returns></returns>
+ public string ParseTime()
+ {
+ // 00:00 ~ 23:59
+ string sbuf = "";
+ try
+ {
+ if (this.Text.Length > 5) { return string.Empty; }
+ int pos = this.Text.LastIndexOf(':');
+ if (this.Text.Length == 5)
+ {
+ if (pos == 2)
+ {
+ if (int.Parse(this.Text.Substring(0, 2)) >= 0 && int.Parse(this.Text.Substring(0, 2)) < 24 && int.Parse(this.Text.Substring(3)) >= 0 && int.Parse(this.Text.Substring(3)) <= 59)
+ {
+ sbuf = this.Text;
+ }
+ }
+ }
+ else if (this.Text.Length == 4)
+ {
+ if (pos >= 0)
+ {
+ string[] items = this.Text.Split(new char[] { ':' });
+ if (int.Parse(items[0]) >= 0 && int.Parse(items[0]) < 24 && int.Parse(items[1]) >= 0 && int.Parse(items[1]) <= 59)
+ {
+ sbuf = int.Parse(items[0]).ToString().PadLeft(2, '0') + ":" + int.Parse(items[1]).ToString().PadLeft(2, '0');
+ }
+ }
+ else
+ {
+ if (int.Parse(this.Text.Substring(0, 2)) >= 0 && int.Parse(this.Text.Substring(0, 2)) < 24 && int.Parse(this.Text.Substring(2)) >= 0 && int.Parse(this.Text.Substring(2)) <= 59)
+ {
+ sbuf = this.Text.Substring(0, 2) + ":" + this.Text.Substring(2);
+ }
+ }
+ }
+ else
+ {
+ if (pos >= 0)
+ {
+ string[] items = this.Text.Split(new char[] { ':' });
+ if (int.Parse(items[0]) >= 0 && int.Parse(items[0]) < 24 && int.Parse(items[1]) >= 0 && int.Parse(items[1]) <= 59)
+ {
+ sbuf = int.Parse(items[0]).ToString().PadLeft(2, '0') + ":" + int.Parse(items[1]).ToString().PadLeft(2, '0');
+ }
+ }
+ else if (this.Text.Length == 3)
+ {
+ if (int.Parse(this.Text.Substring(0, 1)) >= 0 && int.Parse(this.Text.Substring(0, 1)) < 24 && int.Parse(this.Text.Substring(1)) >= 0 && int.Parse(this.Text.Substring(1)) <= 59)
+ {
+ sbuf = this.Text.Substring(0, 1) + ":" + this.Text.Substring(1);
+ }
+ }
+ else if (this.Text.Length == 2)
+ {
+ if (int.Parse(this.Text) >= 0 && int.Parse(this.Text) < 24)
+ {
+ sbuf = this.Text + ":00";
+ }
+ }
+ else if (this.Text.Length == 1)
+ {
+ sbuf = this.Text.PadLeft(2, '0') + ":00";
+ }
+ }
+ return sbuf;
+ }
+ catch
+ {
+ return "";
+ }
+ }
+
+ public virtual void ResetOrgText()
+ {
+ m_OrgText = this.Text;
+ }
+
+ }
+}
diff --git a/HotelPms.Share.Windows/Component/Calendar.cs b/HotelPms.Share.Windows/Component/Calendar.cs
new file mode 100644
index 0000000..0084996
--- /dev/null
+++ b/HotelPms.Share.Windows/Component/Calendar.cs
@@ -0,0 +1,1014 @@
+using HotelPms.Share.Windows.Util;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Windows.Forms;
+using System.Windows.Forms.VisualStyles;
+
+namespace HotelPms.Share.Windows.Component
+{
+ /// <summary>
+ /// コピーだけ、全く書いてない
+ /// テスト
+ /// </summary>
+ public class Calendar : System.Windows.Forms.Control
+ {
+ #region ★★★★★ Declartions ★★★★★
+
+ public enum ShowStyleType : int
+ {
+ TreeMonth = 0,
+ OneMonth,
+ }
+
+ public enum HitType : int
+ {
+ None = 0,
+ YearPrev,
+ MonthPrev,
+ CurrentDay,
+ MonthNext,
+ YearNext,
+ Day,
+ }
+
+ public enum LanguageType : int
+ {
+ Japanese = 0,
+ Chinese,
+ English,
+ }
+
+ public enum DayStyleType : int
+ {
+ Row4 = 0,
+ Row3,
+ }
+
+ public sealed class HitTestInfo
+ {
+ public static readonly HitTestInfo Nowhere;
+
+ internal int y;
+ internal int x;
+ internal string value = string.Empty;
+ internal HitType type;
+
+ static HitTestInfo()
+ {
+ HitTestInfo.Nowhere = new HitTestInfo();
+ }
+
+ internal HitTestInfo()
+ {
+ this.type = HitType.None;
+ this.x = -1;
+ this.y = -1;
+ }
+
+ public string Value { get { return value; } }
+
+ public int X
+ {
+ get { return this.x; }
+ }
+
+ public int Y
+ {
+ get { return this.y; }
+ }
+
+ public HitType Type
+ {
+ get { return this.type; }
+ }
+
+ public override int GetHashCode()
+ {
+ return this.x << 16 | this.y << 8 | (int)this.type;
+ }
+
+ public override bool Equals(object obj)
+ {
+ HitTestInfo hi = obj as HitTestInfo;
+ return (this.type == hi.type && this.x == hi.x && this.x == hi.x);
+ }
+
+ public override string ToString()
+ {
+ return string.Concat(new string[7] { "{ ", this.type.ToString(), ",", this.x.ToString(), ",", this.y.ToString(), "}" });
+ }
+ }
+
+ private static string[] weekShortNamesCn = new string[] { "日", "一", "二", "三", "四", "五", "六" };
+ private static string[] weekShortNamesJp = new string[] { "日", "月", "火", "水", "木", "金", "土" };
+ private static string[] weekShortNamesEn = new string[] { "S", "M", "T", "W", "T", "F", "S" };
+
+ private static string[] ButtonBarText = new string[] { "<<", "<", "〇", ">", ">>" };
+
+ private StringFormat m_StringFormat = new StringFormat(StringFormatFlags.NoWrap);
+ private StringFormat m_StringFormatLeft = new StringFormat(StringFormatFlags.NoWrap);
+ private static int colCount = 35; //幅35セル単位
+ private static int dayWidth = 5; //5セル単位(固定)
+ private static int dayHeight = 4; //4セル単位,3セル単位可能
+ private static int dayLineCount = 6; //6行
+ private int headerRowCount = 9; //Topカレンダーの高さ
+ private int changeBarRowCount = 2; //年月調整バー
+ private int weekRowCount = 2; //週のタイトル
+ private int rowCount = 0;
+ private float cellHeight = 0;
+ private float cellWidth = 0;
+ private bool m_MouseFocused = false;
+ private bool m_MouseDown = false;
+ private HitType currHitType = HitType.None;
+ private string currHitValue = string.Empty;
+
+ private RectangleF headerCenterRect;
+ private List<RectangleF> buttonRectList = new List<RectangleF>();
+ private SortedList<string, RectangleF> dayRectList = new SortedList<string, RectangleF>();
+ private DateTime showValue = DateTime.Now;
+
+ public event CalendarEventHandler DayCellFormat;
+ public event CalendarEventHandler DateSelect;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+
+ #region カレンダー(年月日)
+
+ private Font yearFont = new Font("メイリオ", 14F);
+
+ [Description("年のフォント"), Category("Calendar Action(TopCenter)")]
+ public Font YearFont
+ {
+ get { return yearFont; }
+ set { yearFont = value; Invalidate(); }
+ }
+
+ private Color yearForeColor = Color.Purple;
+
+ [Description("年のフォント色"), Category("Calendar Action(TopCenter)")]
+ public Color YearForeColor
+ {
+ get { return yearForeColor; }
+ set { yearForeColor = value; Invalidate(); }
+ }
+
+ private Font monthFont = new Font("メイリオ", 36F);
+
+ [Description("月のフォント"), Category("Calendar Action(TopCenter)")]
+ public Font MonthFont
+ {
+ get { return monthFont; }
+ set { monthFont = value; Invalidate(); }
+ }
+
+ private Color monthForeColor = Color.Purple;
+
+ [Description("月のフォント色"), Category("Calendar Action(TopCenter)")]
+ public Color MonthForeColor
+ {
+ get { return monthForeColor; }
+ set { monthForeColor = value; Invalidate(); }
+ }
+
+ private Font selectDateFont = new Font("メイリオ", 12F);
+
+ [Description("選択された日のフォント"), Category("Calendar Action(TopCenter)")]
+ public Font SelectDateFont
+ {
+ get { return selectDateFont; }
+ set { selectDateFont = value; Invalidate(); }
+ }
+
+ private Color selectDateForeColor = Color.Navy;
+
+ [Description("選択された日のフォント色"), Category("Calendar Action(TopCenter)")]
+ public Color SelectDateForeColor
+ {
+ get { return selectDateForeColor; }
+ set { selectDateForeColor = value; Invalidate(); }
+ }
+
+ #endregion
+
+ #region カレンダー(ボタン)
+
+ private Font buttonFont = new Font("メイリオ", 12F);
+
+ [Description("ボタンのフォント"), Category("Calendar Action(Button)")]
+ public Font ButtonFont
+ {
+ get { return buttonFont; }
+ set { buttonFont = value; Invalidate(); }
+ }
+
+ private Color buttonForeColor = Color.White;
+
+ [Description("ボタンのフォント色"), Category("Calendar Action(Button)")]
+ public Color ButtonForeColor
+ {
+ get { return buttonForeColor; }
+ set { buttonForeColor = value; Invalidate(); }
+ }
+
+ private Color buttonBackColor = Color.FromArgb(64, 64, 64);
+
+ [Description("ボタンの背景色"), Category("Calendar Action(Button)")]
+ public Color ButtonBackColor
+ {
+ get { return buttonBackColor; }
+ set { buttonBackColor = value; Invalidate(); }
+ }
+
+ private Color buttonOverColor = Color.Gray;
+
+ [Description("ボタンのマウス移動色"), Category("Calendar Action(Button)")]
+ public Color ButtonOverColor
+ {
+ get { return buttonOverColor; }
+ set { buttonOverColor = value; Invalidate(); }
+ }
+
+ private Color buttonDownColor = Color.Black;
+
+ [Description("ボタンのマウス押した色"), Category("Calendar Action(Button)")]
+ public Color ButtonDownColor
+ {
+ get { return buttonDownColor; }
+ set { buttonDownColor = value; Invalidate(); }
+ }
+
+ #endregion
+
+ #region カレンダー(当月)
+
+ private DayStyleType dayStyle = DayStyleType.Row4;
+ [Description("日付セルスタイル"), Category("Calendar Action(Current Month)")]
+ public DayStyleType DayStyle
+ {
+ get { return dayStyle; }
+ set
+ {
+ dayStyle = value;
+ dayHeight = dayStyle == DayStyleType.Row4 ? 4 : 3;
+ Invalidate();
+ }
+ }
+
+ private Font weekFont = new Font("メイリオ", 10F);
+
+ [Description("曜日表記のフォント"), Category("Calendar Action(Current Month)")]
+ public Font WeekFont
+ {
+ get { return weekFont; }
+ set { weekFont = value; Invalidate(); }
+ }
+
+ private Color weekForeColor = Color.White;
+
+ [Description("曜日のフォント色"), Category("Calendar Action(Current Month)")]
+ public Color WeekForeColor
+ {
+ get { return weekForeColor; }
+ set { weekForeColor = value; Invalidate(); }
+ }
+
+ private Color weekBackColor = Color.FromArgb(0, 192, 0);
+
+ [Description("曜日の背景色"), Category("Calendar Action(Current Month)")]
+ public Color WeekBackColor
+ {
+ get { return weekBackColor; }
+ set { weekBackColor = value; Invalidate(); }
+ }
+
+ private Color selDayBackColor = Color.FromArgb(192, 255, 192);
+
+ [Description("選択された日付セルの背景色"), Category("Calendar Action(Current Month)")]
+ public Color SelDayBackColor
+ {
+ get { return selDayBackColor; }
+ set { selDayBackColor = value; Invalidate(); }
+ }
+
+ private Color dayBackColor = Color.FromArgb(255, 245, 210);
+
+ [Description("日付セルの背景色"), Category("Calendar Action(Current Month)")]
+ public Color DayBackColor
+ {
+ get { return dayBackColor; }
+ set { dayBackColor = value; Invalidate(); }
+ }
+
+ private Color dayOverColor = Color.FromArgb(192, 255, 255);
+
+ [Description("日付セルのマウス移動色"), Category("Calendar Action(Current Month)")]
+ public Color DayOverColor
+ {
+ get { return dayOverColor; }
+ set { dayOverColor = value; Invalidate(); }
+ }
+
+ private Color dayDownColor = Color.FromArgb(0, 192, 0);
+
+ [Description("日付セルのマウス押した色"), Category("Calendar Action(Current Month)")]
+ public Color DayDownColor
+ {
+ get { return dayDownColor; }
+ set { dayDownColor = value; Invalidate(); }
+ }
+
+
+ private Font dayFont = new Font("メイリオ", 14F);
+
+ [Description("日付のフォント"), Category("Calendar Action(Current Month)")]
+ public Font DayFont
+ {
+ get { return dayFont; }
+ set
+ {
+ dayFont = value;
+ Invalidate();
+ }
+ }
+
+ private Color dayForeColor = Color.Black;
+
+ [Description("日付のフォント色"), Category("Calendar Action(Current Month)")]
+ public Color DayForeColor
+ {
+ get { return dayForeColor; }
+ set { dayForeColor = value;Invalidate();}
+ }
+
+
+ private Font rokuyouFont = new Font("メイリオ", 8F);
+
+ [Description("六曜のフォント調整"), Category("Calendar Action(Current Month)")]
+ public Font RokuyouFont
+ {
+ get { return rokuyouFont; }
+ set
+ {
+ rokuyouFont = value;
+ Invalidate();
+ }
+ }
+
+ private bool rokuyouVisible = true;
+ [Description("六曜の表示・非表示"), Category("Calendar Action(Current Month)")]
+ public bool RokuyouVisible
+ {
+ get { return rokuyouVisible; }
+ set { rokuyouVisible = value; Invalidate(); }
+ }
+
+ private Color rokuyouForeColor = Color.FromArgb(0, 64, 0);
+
+ [Description("六曜のフォント色"), Category("Calendar Action(Current Month)")]
+ public Color RokuyouForeColor
+ {
+ get { return rokuyouForeColor; }
+ set { rokuyouForeColor = value; Invalidate(); }
+ }
+
+ private Font holidayFont = new Font("メイリオ", 7F);
+
+ [Description("祝日のフォント調整"), Category("Calendar Action(Current Month)")]
+ public Font HolidayFont
+ {
+ get { return holidayFont; }
+ set
+ {
+ holidayFont = value;
+ Invalidate();
+ }
+ }
+
+ private Color memoForeColor = Color.Black;
+
+ [Description("メモのフォント色"), Category("Calendar Action(Current Month)")]
+ public Color MemoForeColor
+ {
+ get { return memoForeColor; }
+ set { memoForeColor = value; Invalidate(); }
+ }
+
+ private Font memoFont = new Font("メイリオ", 9F);
+
+ [Description("メモのフォント調整"), Category("Calendar Action(Current Month)")]
+ public Font MemoFont
+ {
+ get { return memoFont; }
+ set
+ {
+ memoFont = value;
+ Invalidate();
+ }
+ }
+
+ private Color holidayForeColor = Color.Red;
+
+ [Description("祝日のフォント色"), Category("Calendar Action(Current Month)")]
+ public Color HolidayForeColor
+ {
+ get { return holidayForeColor; }
+ set { holidayForeColor = value; Invalidate(); }
+ }
+
+ #endregion
+
+ #region カレンダー(Small)
+
+ private Font smallYearFont = new Font("メイリオ", 12F);
+
+ [Description("年月のフォント"), Category("Calendar Action(Small)")]
+ public Font SmallYearFont
+ {
+ get { return smallYearFont; }
+ set { smallYearFont = value; Invalidate(); }
+ }
+
+ private Color smallYearForeColor = Color.Black;
+
+ [Description("年月のフォント色"), Category("Calendar Action(Small)")]
+ public Color SmallYearForeColor
+ {
+ get { return smallYearForeColor; }
+ set { smallYearForeColor = value; Invalidate(); }
+ }
+
+ private Font smallFont = new Font("メイリオ", 7F);
+
+ [Description("小さい日付のフォント調整"), Category("Calendar Action(Small)")]
+ public Font SmallFont
+ {
+ get { return smallFont; }
+ set
+ {
+ smallFont = value;
+ Invalidate();
+ }
+ }
+
+ #endregion
+
+ private ShowStyleType showStyle = ShowStyleType.TreeMonth;
+
+ [Description("表示形式"), Category("Calendar Action")]
+ public ShowStyleType ShowStyle
+ {
+ get { return showStyle; }
+ set
+ {
+ showStyle = value;
+ Invalidate();
+ }
+ }
+
+ private LanguageType language = LanguageType.Japanese;
+
+ [Description("言語"), Category("Calendar Action")]
+ public LanguageType Language
+ {
+ get { return language; }
+ set
+ {
+ language = value;
+ Invalidate();
+ }
+ }
+
+ private string format = "yyyy/MM/dd";
+
+ [Description("Format 例:yyyy/MM/dd"), Category("Calendar Action")]
+ public string Format
+ {
+ get { return format; }
+ set
+ {
+ format = value;
+ if (format.Length == 0) { format = "yyyy/MM/dd"; }
+ Invalidate();
+ }
+ }
+
+ private DateTime dateValue = DateTime.Now.Date;
+
+ [Description("選択された日付"), Category("Calendar Action")]
+ public DateTime Value
+ {
+ get { return dateValue; }
+ set
+ {
+ dateValue = value;
+ showValue = dateValue;
+ Invalidate();
+ }
+ }
+
+ public override string Text
+ {
+ get
+ {
+ return Value.ToString(Format);
+ }
+ }
+
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public Calendar()
+ {
+ SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.Opaque | ControlStyles.UserPaint | ControlStyles.DoubleBuffer | ControlStyles.Selectable | ControlStyles.UserMouse, true);
+ m_StringFormat.Alignment = StringAlignment.Center;
+ m_StringFormat.LineAlignment = StringAlignment.Center;
+ m_StringFormatLeft.Alignment = StringAlignment.Near;
+ m_StringFormatLeft.LineAlignment = StringAlignment.Center;
+ }
+
+ protected override void Dispose(bool disposing)
+ {
+ m_StringFormatLeft.Dispose();
+ m_StringFormat.Dispose();
+ base.Dispose(disposing);
+ }
+
+ #endregion
+
+ #region ★★★★★ Control Event ★★★★★
+
+ protected override void OnPaint(PaintEventArgs e)
+ {
+ base.OnPaint(e);
+
+ try
+ {
+ if (ShowStyle == ShowStyleType.OneMonth) { headerRowCount = 2; }
+ rowCount = headerRowCount + changeBarRowCount + weekRowCount + dayHeight * dayLineCount;
+ cellWidth = (ClientRectangle.Width - 1 - Padding.Left - Padding.Right) * 1.0F / colCount;
+ cellHeight = (ClientRectangle.Height - 1 - Padding.Top - Padding.Bottom) * 1.0F / rowCount;
+
+ //印字領域
+ Rectangle rect = new Rectangle(new Point(Padding.Left, Padding.Top), new Size(ClientRectangle.Width - 1 - Padding.Left - Padding.Right, ClientRectangle.Height - 1 - Padding.Top - Padding.Bottom));
+ e.Graphics.Clear(BackColor);
+
+ using (Brush textBrush = new SolidBrush(ForeColor))
+ {
+ if (ShowStyle == ShowStyleType.TreeMonth)
+ {
+ DrawSmall(rect.Left, rect.Top, -1, e.Graphics, textBrush); //前月
+ DrawHeaderCenter(rect.Left + cellWidth * 14, rect.Top, e.Graphics, textBrush);
+ DrawSmall(rect.Left + rect.Width - cellWidth * 14, rect.Top, 1, e.Graphics, textBrush); //来月
+ }
+ else
+ {
+ DrawHeaderOneMonth(rect.Left, rect.Top, e.Graphics, textBrush);
+ }
+ DrawButtonBar(rect.Left, rect.Top + cellHeight * headerRowCount, e.Graphics, textBrush); //ボタンバー
+ DrawNormal(rect.Left, rect.Top + cellHeight * (headerRowCount + changeBarRowCount), e.Graphics, textBrush); //カレンダー
+ }
+ }
+ catch
+ {
+ }
+ }
+
+ private string GetWeekShortName(int index)
+ {
+ return Language == LanguageType.Japanese ? weekShortNamesJp[index] : Language == LanguageType.Chinese ? weekShortNamesCn[index] : weekShortNamesEn[index];
+ }
+
+ private void DrawHeaderOneMonth(float x, float y, Graphics g, Brush textBrush)
+ {
+ headerCenterRect = new RectangleF(new PointF(x, y), new SizeF(cellWidth * colCount, cellHeight * headerRowCount));
+ g.DrawRectangle(Pens.Black, headerCenterRect.X, headerCenterRect.Y, headerCenterRect.Width, headerCenterRect.Height);
+
+ //表示の年
+ bool isNewColor = YearForeColor.IsSystemColor;
+ Brush brush = isNewColor ? SystemBrushes.FromSystemColor(YearForeColor) : new SolidBrush(YearForeColor);
+ RectangleF rect = new RectangleF(new PointF(x, y), new SizeF(cellWidth * 18, cellHeight * headerRowCount));
+ g.DrawString(showValue.ToString("yyyy年MM月"), YearFont, brush, rect, m_StringFormat);
+ if (isNewColor) { brush.Dispose(); }
+
+ ////表示の月
+ //isNewColor = MonthForeColor.IsSystemColor;
+ //brush = isNewColor ? SystemBrushes.FromSystemColor(MonthForeColor) : new SolidBrush(MonthForeColor);
+ //rect = new RectangleF(new PointF(x + cellWidth * 9, y), new SizeF(cellWidth * 9, cellHeight * headerRowCount));
+ //g.DrawString(showValue.Month.ToString() + "月", MonthFont, brush, rect, m_StringFormat);
+ //if (isNewColor) { brush.Dispose(); }
+
+ //現在の利用日
+ isNewColor = SelectDateForeColor.IsSystemColor;
+ brush = isNewColor ? SystemBrushes.FromSystemColor(SelectDateForeColor) : new SolidBrush(SelectDateForeColor);
+ rect = new RectangleF(new PointF(x + cellWidth * 18, y), new SizeF(cellWidth * 17, cellHeight * headerRowCount));
+ g.DrawString(Text, SelectDateFont, brush, rect, m_StringFormat);
+ if (isNewColor) { brush.Dispose(); }
+ }
+
+ private void DrawHeaderCenter(float x, float y, Graphics g, Brush textBrush)
+ {
+ headerCenterRect = new RectangleF(new PointF(x, y), new SizeF(cellWidth * 7, cellHeight * 9));
+ g.DrawRectangle(Pens.Black, headerCenterRect.X, headerCenterRect.Y, headerCenterRect.Width, headerCenterRect.Height);
+
+ //表示の年
+ bool isNewColor = YearForeColor.IsSystemColor;
+ Brush brush = isNewColor ? SystemBrushes.FromSystemColor(YearForeColor) : new SolidBrush(YearForeColor);
+ RectangleF rect = new RectangleF(new PointF(x, y), new SizeF(cellWidth * 7, cellHeight * 2));
+ g.DrawString(showValue.Year.ToString(), YearFont, brush, rect, m_StringFormat);
+ if(isNewColor) { brush.Dispose(); }
+
+ //表示の月
+ isNewColor = MonthForeColor.IsSystemColor;
+ brush = isNewColor ? SystemBrushes.FromSystemColor(MonthForeColor) : new SolidBrush(MonthForeColor);
+ rect = new RectangleF(new PointF(x, y + cellHeight * 2), new SizeF(cellWidth * 7, cellHeight * 5));
+ g.DrawString(showValue.Month.ToString(), MonthFont, brush, rect, m_StringFormat);
+ if (isNewColor) { brush.Dispose(); }
+
+ //現在の利用日
+ isNewColor = SelectDateForeColor.IsSystemColor;
+ brush = isNewColor ? SystemBrushes.FromSystemColor(SelectDateForeColor) : new SolidBrush(SelectDateForeColor);
+ rect = new RectangleF(new PointF(x, y + cellHeight * 7), new SizeF(cellWidth * 7, cellHeight * 2));
+ g.DrawString(Text, SelectDateFont, brush, rect, m_StringFormat);
+ if (isNewColor) { brush.Dispose(); }
+ }
+
+ //yearPrevRect, yearNextRect, monthPrevRect, monthNextRect, dayRect
+ private void DrawButtonBar(float x, float y, Graphics g, Brush textBrush)
+ {
+ buttonRectList.Clear();
+ RectangleF rect = new RectangleF(new PointF(x, y), new SizeF(cellWidth * 7, cellHeight * 2));
+ buttonRectList.Add(rect);
+ for (int i= 0; i< 5; i++ )
+ {
+ if (i > 0) { rect = new RectangleF(new PointF(rect.Left + rect.Width, y), new SizeF(cellWidth * 7, cellHeight * 2)); buttonRectList.Add(rect); }
+ Color hitColor = m_MouseDown && !ButtonDownColor.IsEmpty ? buttonDownColor : !ButtonOverColor.IsEmpty ? ButtonOverColor : ControlPaint.Light(ButtonBackColor.IsEmpty ? BackColor : ButtonBackColor);
+ using (Brush brush = (HitType)(i + 1) == currHitType ? new SolidBrush(hitColor) : new SolidBrush(ButtonBackColor.IsEmpty ? BackColor : ButtonBackColor))
+ {
+ g.FillRectangle(brush, rect);
+ }
+ g.DrawRectangle(Pens.Black, rect.X, rect.Y, rect.Width, rect.Height);
+ bool isNewColor = ButtonForeColor.IsSystemColor;
+ Brush foreBrush = isNewColor ? SystemBrushes.FromSystemColor(ButtonForeColor) : new SolidBrush(ButtonForeColor);
+ g.DrawString(ButtonBarText[i], ButtonFont, foreBrush, rect, m_StringFormat);
+ if(isNewColor) { foreBrush.Dispose(); }
+ }
+ }
+
+ /// <summary>
+ /// 前月、来月の小さいカレンダーを描く
+ /// </summary>
+ private void DrawSmall(float x, float y, int type, Graphics g, Brush textBrush)
+ {
+ //年-月
+ RectangleF rect = new RectangleF(new PointF(x, y), new SizeF(cellWidth * 14, cellHeight * 2));
+ DateTime firstDate = DateTime.Parse(showValue.AddMonths(type).ToString("yyyy/MM") + "/01");
+ g.DrawRectangle(Pens.Black, rect.X, rect.Y, rect.Width, rect.Height);
+ bool isNewColor = SmallYearForeColor.IsSystemColor;
+ Brush foreBrush = isNewColor ? SystemBrushes.FromSystemColor(SmallYearForeColor) : new SolidBrush(SmallYearForeColor);
+ g.DrawString(language == LanguageType.English ? firstDate.ToString("yyyy/MM") : firstDate.ToString("yyyy年MM月"), SmallYearFont, foreBrush, rect, m_StringFormatLeft);
+ if (isNewColor) { foreBrush.Dispose(); }
+
+ //週のタイトル
+ int firstWeek = (int)firstDate.DayOfWeek;
+ float curY = y + rect.Height;
+ rect = new RectangleF(new PointF(x, curY), new SizeF(cellWidth * 2, cellHeight));
+ for (int i = 0; i < 7; i++)
+ {
+ g.DrawRectangle(Pens.Black, rect.X, rect.Y, rect.Width, rect.Height);
+ g.DrawString(GetWeekShortName(i), smallFont, i == (int)DayOfWeek.Sunday ? Brushes.Red : i == (int)DayOfWeek.Saturday ? Brushes.Blue : textBrush, rect, m_StringFormat);
+ rect = new RectangleF(new PointF(rect.Left + rect.Width, curY), new SizeF(cellWidth * 2, cellHeight));
+ }
+
+ //日付
+ int dayCount = 0;
+ for (int row = 0; row < dayLineCount; row++)
+ {
+ curY = rect.Top + rect.Height;
+ rect = new RectangleF(new PointF(x, curY), new SizeF(cellWidth * 2, cellHeight));
+ for (int i = 0; i < 7; i++)
+ {
+ string dayText = string.Empty;
+ if(row == 0 && i < firstWeek)
+ {
+ dayText = string.Empty;
+ }
+ else
+ {
+ DateTime date = firstDate.AddDays((double)dayCount);
+ if (date.Month == firstDate.Month) { dayText = date.Day.ToString(); }
+ dayCount++;
+ }
+
+ g.DrawRectangle(Pens.Black, rect.X, rect.Y, rect.Width, rect.Height);
+ g.DrawString(dayText, smallFont, i == (int)DayOfWeek.Sunday ? Brushes.Red : i == (int)DayOfWeek.Saturday ? Brushes.Blue : textBrush, rect, m_StringFormat);
+ rect = new RectangleF(new PointF(rect.Left + rect.Width, curY), new SizeF(cellWidth * 2, cellHeight));
+ }
+ }
+ }
+
+ private void DrawNormal(float x, float y, Graphics g, Brush textBrush)
+ {
+ dayRectList.Clear();
+ DateTime firstDate = DateTime.Parse(showValue.ToString("yyyy/MM") + "/01");
+
+ //週のタイトル
+ int firstWeek = (int)firstDate.DayOfWeek;
+ float curY = y;
+ RectangleF rect = new RectangleF(new PointF(x, curY), new SizeF(cellWidth * dayWidth, cellHeight * 2));
+ bool isNewColor = WeekForeColor.IsSystemColor;
+ Brush brush = isNewColor ? SystemBrushes.FromSystemColor(WeekForeColor) : new SolidBrush(WeekForeColor);
+ using (Brush backbrush = new SolidBrush(WeekBackColor.IsEmpty ? BackColor : WeekBackColor))
+ {
+ for (int i = 0; i < 7; i++)
+ {
+
+ g.FillRectangle(backbrush, rect);
+ g.DrawRectangle(Pens.Black, rect.X, rect.Y, rect.Width, rect.Height);
+ g.DrawString(GetWeekShortName(i), WeekFont, i == (int)DayOfWeek.Sunday ? Brushes.Red : i == (int)DayOfWeek.Saturday ? Brushes.Blue : brush, rect, m_StringFormat);
+ rect = new RectangleF(new PointF(rect.Left + rect.Width, curY), new SizeF(cellWidth * dayWidth, cellHeight * 2));
+ }
+ }
+ if (isNewColor) { brush.Dispose(); }
+
+ //日付
+ int dayCount = 0;
+ for (int row = 0; row < dayLineCount; row++)
+ {
+ curY = rect.Top + rect.Height;
+ rect = new RectangleF(new PointF(x, curY), new SizeF(cellWidth * dayWidth, cellHeight * dayHeight));
+ for (int i = 0; i < 7; i++)
+ {
+ DateTime date;
+ bool isOutOfRange = false;
+ string dayText = string.Empty;
+ if (row == 0 && i < firstWeek)
+ {
+ date = firstDate.AddDays((double)(i - firstWeek));
+ dayText = date.Day.ToString();
+ isOutOfRange = true;
+ }
+ else
+ {
+ date = firstDate.AddDays((double)dayCount);
+ if (date.Month != firstDate.Month)
+ {
+ isOutOfRange = true;
+ }
+ dayText = date.Day.ToString();
+ dayCount++;
+ }
+
+ dayRectList.Add(date.ToString("yyyy/MM/dd"), rect);
+ RectangleF dayRect = new RectangleF(new PointF(rect.X, rect.Y), new SizeF(cellWidth * 3, cellHeight * 2));
+
+ //Raise DayCellFormat
+ CalendarEventArgs args = new CalendarEventArgs()
+ {
+ DateValue = date,
+ DateText = dayText,
+ Rokuyou = RokuyouVisible ? JapaneseDateTime.ToRokuyou(date) : string.Empty,
+ Holiday = string.Empty,
+ MemoText = string.Empty
+ };
+ if(DayCellFormat != null) { DayCellFormat(this, args); }
+
+ Color hitColor = m_MouseDown && !DayDownColor.IsEmpty ? DayDownColor : !DayOverColor.IsEmpty ? DayOverColor : ControlPaint.Light(!SelDayBackColor.IsEmpty && Value.Date.CompareTo(date.Date) == 0 ? SelDayBackColor : DayBackColor.IsEmpty ? BackColor : DayBackColor);
+ using (Brush backbrush = currHitType == HitType.Day && currHitValue.CompareTo(date.ToString("yyyy/MM/dd")) == 0 ? new SolidBrush(hitColor) : new SolidBrush(!SelDayBackColor.IsEmpty && Value.Date.CompareTo(date.Date) == 0 ? SelDayBackColor : DayBackColor.IsEmpty ? BackColor : DayBackColor))
+ {
+ g.FillRectangle(backbrush, rect);
+ }
+ g.DrawRectangle(Pens.Black, rect.X, rect.Y, rect.Width, rect.Height);
+
+ //日付
+ isNewColor = DayForeColor.IsSystemColor;
+ brush = isNewColor ? SystemBrushes.FromSystemColor(DayForeColor) : new SolidBrush(DayForeColor);
+ g.DrawString(args.DateText, DayFont, isOutOfRange ? Brushes.Gray : i == (int)DayOfWeek.Sunday ? Brushes.Red : i == (int)DayOfWeek.Saturday ? Brushes.Blue : brush, dayRect, m_StringFormat);
+ if (isNewColor) { brush.Dispose(); }
+
+ //六曜
+ if (RokuyouVisible)
+ {
+ RectangleF rokuyouRect;
+ isNewColor = RokuyouForeColor.IsSystemColor && !isOutOfRange;
+ brush = isOutOfRange ? Brushes.Gray : isNewColor ? SystemBrushes.FromSystemColor(RokuyouForeColor) : new SolidBrush(RokuyouForeColor);
+ if (DayStyle == DayStyleType.Row4)
+ {
+ rokuyouRect = new RectangleF(new PointF(rect.X, rect.Y + cellHeight * 2), new SizeF(cellWidth * 3, cellHeight));
+ g.DrawString(args.Rokuyou, rokuyouFont, brush, rokuyouRect, m_StringFormat);
+ }
+ else
+ {
+ rokuyouRect = new RectangleF(new PointF(rect.X + cellWidth * 3, rect.Y), new SizeF(cellWidth * 2, cellHeight));
+ g.DrawString(args.Rokuyou, rokuyouFont, brush, rokuyouRect, m_StringFormatLeft);
+ }
+ if (isNewColor) { brush.Dispose(); }
+ }
+
+ //祝日
+ if (args.Holiday.Length > 0)
+ {
+ RectangleF holidayRect;
+ isNewColor = HolidayForeColor.IsSystemColor && !isOutOfRange;
+ brush = isOutOfRange ? Brushes.Gray : isNewColor ? SystemBrushes.FromSystemColor(HolidayForeColor) : new SolidBrush(HolidayForeColor);
+ if (DayStyle == DayStyleType.Row4)
+ {
+ holidayRect = new RectangleF(new PointF(rect.X, rect.Y + cellHeight * 3), new SizeF(cellWidth * dayWidth, cellHeight));
+ g.DrawString(args.Holiday, holidayFont, brush, holidayRect, m_StringFormat);
+ }
+ else
+ {
+ holidayRect = new RectangleF(new PointF(rect.X, rect.Y + cellHeight * 2), new SizeF(cellWidth * 3, cellHeight));
+ g.DrawString(args.Holiday, holidayFont, brush, holidayRect, m_StringFormatLeft);
+ }
+ if (isNewColor) { brush.Dispose(); }
+ }
+
+ //メモ
+ if (args.MemoText.Length > 0)
+ {
+ RectangleF memoRect;
+ isNewColor = MemoForeColor.IsSystemColor && !isOutOfRange;
+ brush = isOutOfRange ? Brushes.Gray : isNewColor ? SystemBrushes.FromSystemColor(MemoForeColor) : new SolidBrush(MemoForeColor);
+ if (DayStyle == DayStyleType.Row4)
+ {
+ memoRect = new RectangleF(new PointF(rect.X + cellWidth * 3, rect.Y), new SizeF(cellWidth * 2, cellHeight * 3));
+ g.DrawString(args.MemoText, MemoFont, brush, memoRect, m_StringFormat);
+ }
+ else
+ {
+ memoRect = new RectangleF(new PointF(rect.X + cellWidth * 3, rect.Y + cellHeight * 1), new SizeF(cellWidth * 2, cellHeight * 2));
+ g.DrawString(args.MemoText, MemoFont, brush, memoRect, m_StringFormat);
+ }
+ if (isNewColor) { brush.Dispose(); }
+ }
+
+ rect = new RectangleF(new PointF(rect.Left + rect.Width, curY), new SizeF(cellWidth * dayWidth, cellHeight * dayHeight));
+ }
+ }
+ }
+
+
+ protected override void OnMouseWheel(MouseEventArgs e)
+ {
+ //if (e.Delta > 0)
+ //{
+ // if (m_TabKeyList.Count - m_TopIndex > m_TabCount) { m_TopIndex++; }
+ //}
+ //else
+ //{
+ // if (m_TopIndex > 0) { m_TopIndex--; }
+ //}
+ base.OnMouseWheel(e);
+ Invalidate();
+ }
+
+ protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
+ {
+ if (keyData == Keys.Tab)
+ return true;
+ if (keyData == (Keys.Tab | Keys.Shift))
+ return true;
+
+ switch (keyData)
+ {
+ case Keys.Left:
+ return true;
+ case Keys.Right:
+ return true;
+ }
+
+
+ return base.ProcessCmdKey(ref msg, keyData);
+ }
+
+ protected override void OnMouseClick(MouseEventArgs e)
+ {
+ base.OnMouseClick(e);
+ HitTestInfo item = HitTest(e.X, e.Y);
+ if(currHitType == HitType.CurrentDay) { showValue = Value; }
+ else if (currHitType == HitType.MonthPrev) { showValue = showValue.AddMonths(-1); }
+ else if (currHitType == HitType.MonthNext) { showValue = showValue.AddMonths(1); }
+ else if (currHitType == HitType.YearPrev) { showValue = showValue.AddYears(-1); }
+ else if (currHitType == HitType.YearNext) { showValue = showValue.AddYears(1); }
+ else if (currHitType == HitType.Day)
+ {
+ Value = DateTime.Parse(item.Value); showValue = Value;
+ }
+ Invalidate();
+
+ if (currHitType == HitType.Day && DateSelect != null)
+ {
+ CalendarEventArgs args = new CalendarEventArgs()
+ {
+ DateValue = Value,
+ DateText = Text,
+ Rokuyou = string.Empty,
+ Holiday = string.Empty,
+ MemoText = string.Empty
+ };
+ DateSelect(this, args);
+ }
+ }
+
+ protected override void OnMouseMove(MouseEventArgs e)
+ {
+ HitTestInfo item = HitTest(e.X, e.Y);
+ Invalidate();
+ base.OnMouseMove(e);
+ }
+
+ protected override void OnMouseEnter(System.EventArgs e)
+ {
+ m_MouseFocused = true;
+ Invalidate();
+ base.OnMouseEnter(e);
+ }
+
+ protected override void OnMouseLeave(System.EventArgs e)
+ {
+ m_MouseFocused = false;
+ Invalidate();
+ base.OnMouseLeave(e);
+ }
+
+ protected override void OnMouseDown(MouseEventArgs e)
+ {
+ HitTestInfo item = HitTest(e.X, e.Y);
+ m_MouseDown = true;
+ this.Focus();
+ Invalidate();
+ base.OnMouseDown(e);
+ }
+
+ protected override void OnMouseUp(MouseEventArgs e)
+ {
+ m_MouseDown = false;
+ Invalidate();
+ base.OnMouseUp(e);
+ }
+
+ protected override void OnResize(System.EventArgs e)
+ {
+ Invalidate();
+ base.OnResize(e);
+ }
+
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+
+
+
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+
+ private bool InRectangle(RectangleF r, int x, int y)
+ {
+ return (r.X <= (float)x && (float)x <= (r.X + r.Width)) && (r.Y <= (float)y && (float)y <= (r.Y + r.Height));
+ }
+
+ public HitTestInfo HitTest(int x, int y)
+ {
+ HitTestInfo hit = new HitTestInfo();
+ hit.x = x;
+ hit.y = y;
+ currHitType = HitType.None;
+ currHitValue = string.Empty;
+ for (int i = 0; i < buttonRectList.Count; i++)
+ {
+ if (buttonRectList[i].Contains((float)x, (float)y))
+ {
+ Cursor = Cursors.Hand;
+ hit.type = (HitType)(i + 1);
+ currHitType = hit.Type;
+ return hit;
+ }
+ }
+
+
+ foreach(KeyValuePair<string, RectangleF> item in dayRectList)
+ {
+ if (item.Value.Contains((float)x, (float)y))
+ {
+ Cursor = Cursors.Hand;
+ hit.type = HitType.Day;
+ hit.value = item.Key;
+ currHitType = hit.Type;
+ currHitValue = hit.value;
+ return hit;
+ }
+ }
+ Cursor = Cursors.Default;
+ return HitTestInfo.Nowhere;
+ }
+
+ #endregion
+ }
+}
diff --git a/HotelPms.Share.Windows/Component/CalendarEventArgs.cs b/HotelPms.Share.Windows/Component/CalendarEventArgs.cs
new file mode 100644
index 0000000..683d4a5
--- /dev/null
+++ b/HotelPms.Share.Windows/Component/CalendarEventArgs.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HotelPms.Share.Windows.Component
+{
+ public class CalendarEventArgs : EventArgs
+ {
+ public DateTime DateValue { get; set; }
+ public string DateText { get; set; } = string.Empty;
+
+ public string Rokuyou { get; set; } = string.Empty;
+
+ public string Holiday { get; set; } = string.Empty;
+
+ public string MemoText { get; set; } = string.Empty;
+ }
+}
diff --git a/HotelPms.Share.Windows/Component/CalendarEventHandler.cs b/HotelPms.Share.Windows/Component/CalendarEventHandler.cs
new file mode 100644
index 0000000..0118673
--- /dev/null
+++ b/HotelPms.Share.Windows/Component/CalendarEventHandler.cs
@@ -0,0 +1,10 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HotelPms.Share.Windows.Component
+{
+ public delegate void CalendarEventHandler(object sender, CalendarEventArgs e);
+}
diff --git a/HotelPms.Share.Windows/Component/ComboBoxItem.cs b/HotelPms.Share.Windows/Component/ComboBoxItem.cs
new file mode 100644
index 0000000..0df92b9
--- /dev/null
+++ b/HotelPms.Share.Windows/Component/ComboBoxItem.cs
@@ -0,0 +1,44 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace HotelPms.Share.Windows.Component
+{
+ public class ComboBoxItem
+ {
+ private string m_Key = string.Empty;
+
+ public string Key
+ {
+ get { return m_Key; }
+ set { m_Key = value; }
+ }
+
+ private string m_Text = string.Empty;
+
+ public string Text
+ {
+ get { return m_Text; }
+ set { m_Text = value; }
+ }
+
+ private object m_Tag = null;
+
+ public object Tag
+ {
+ get { return m_Tag; }
+ set { m_Tag = value; }
+ }
+
+ public ComboBoxItem(string key, string text)
+ {
+ this.m_Key = key;
+ this.m_Text = text;
+ }
+
+ public override string ToString()
+ {
+ return m_Text;
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/Component/ControlEx.cs b/HotelPms.Share.Windows/Component/ControlEx.cs
new file mode 100644
index 0000000..41acdd5
--- /dev/null
+++ b/HotelPms.Share.Windows/Component/ControlEx.cs
@@ -0,0 +1,43 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace HotelPms.Share.Windows.Component
+{
+ public static class ControlEx
+ {
+ /// <summary>
+ /// コントロールの拡張プロパティメソッド追加
+ /// </summary>
+ /// <param name="self"></param>
+ /// <returns></returns>
+ public static object GetPropertyEx(this Control self, string key)
+ {
+ ControlPropertyEx val = null;
+ ControlPropertyEx.Data.TryGetValue(self, out val);
+ return val.Addition[key];
+ }
+
+ public static void SetPropertyEx(this Control self, string key, object value)
+ {
+ ControlPropertyEx data = null;
+ if(!ControlPropertyEx.Data.TryGetValue(self, out data))
+ {
+ data = new ControlPropertyEx();
+ ControlPropertyEx.Data.Add(self, data);
+ }
+ data.Addition[key] = value; //存在しなかったら、自動追加
+ }
+
+
+ public static ControlPropertyEx GetPropertyData(this Control self)
+ {
+ ControlPropertyEx val = null;
+ ControlPropertyEx.Data.TryGetValue(self, out val);
+ return val;
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/Component/ControlPropertyEx.cs b/HotelPms.Share.Windows/Component/ControlPropertyEx.cs
new file mode 100644
index 0000000..0ad0221
--- /dev/null
+++ b/HotelPms.Share.Windows/Component/ControlPropertyEx.cs
@@ -0,0 +1,34 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.CompilerServices;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace HotelPms.Share.Windows.Component
+{
+ /// <summary>
+ /// コントロールのプロパティの拡張
+ /// GC.Collect();の直後、ConditionalWeakTableより自動で消える
+ /// </summary>
+ public class ControlPropertyEx
+ {
+ public static ConditionalWeakTable<Control, ControlPropertyEx> Data { get; set; } = new ConditionalWeakTable<Control, ControlPropertyEx>();
+
+ /// <summary>
+ /// 追加プロパティ
+ /// </summary>
+ public Dictionary<string, object> Addition { get; set; } = new Dictionary<string, object>();
+
+ public override string ToString()
+ {
+ StringBuilder text = new StringBuilder();
+ foreach(KeyValuePair<string, object> item in Addition)
+ {
+ text.Append($"{item.Key}={item.Value};");
+ }
+ return text.ToString();
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/Component/CountButton.cs b/HotelPms.Share.Windows/Component/CountButton.cs
new file mode 100644
index 0000000..e7b224b
--- /dev/null
+++ b/HotelPms.Share.Windows/Component/CountButton.cs
@@ -0,0 +1,214 @@
+using HotelPms.Share.Windows.GraphicsApi;
+using HotelPms.Share.Windows.Util;
+using System;
+using System.ComponentModel;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Drawing.Imaging;
+using System.Windows.Forms;
+
+namespace HotelPms.Share.Windows.Component
+{
+ public class CountButton : System.Windows.Forms.Button
+ {
+ private bool m_DisableClickEvent = true;
+
+ /// <summary>
+ /// Click連打禁止 【※注意:ボタンイベントの中でFrom.Show()を使うとShownイベントなども消える場合があります。】
+ /// </summary>
+ [Description("Click連打禁止 【※注意:ボタンイベントの中でFrom.Show()を使うとShownイベントなども消える場合があります。】"), Category("拡張動作"), DefaultValue(true)]
+ public bool DisableClickEvent
+ {
+ get { return m_DisableClickEvent; }
+ set { m_DisableClickEvent = value; }
+ }
+
+ private LinearGradientMode m_GradientMode = LinearGradientMode.Horizontal;
+
+ [Description("GradientMode"), Category("拡張動作"), DefaultValue(LinearGradientMode.Horizontal)]
+ public LinearGradientMode GradientMode
+ {
+ get { return m_GradientMode; }
+ set { m_GradientMode = value; Invalidate(); }
+ }
+
+ private Color m_GradientColor = Color.Empty;
+
+ [Description("GradientColor"), Category("拡張動作")]
+ public Color GradientColor
+ {
+ get { return m_GradientColor; }
+ set { m_GradientColor = value; Invalidate(); }
+ }
+
+ private int m_Count = 0;
+
+ [Description("Count"), Category("拡張動作")]
+ public int Count
+ {
+ get { return m_Count; }
+ set { m_Count = value; Invalidate(); }
+ }
+
+ private Color m_CountForeColor = Color.White;
+
+ [Description("CountForeColor"), Category("拡張動作")]
+ public Color CountForeColor
+ {
+ get { return m_CountForeColor; }
+ set { m_CountForeColor = value; Invalidate(); }
+ }
+
+ private Color m_CountBackColor = Color.Red;
+
+ [Description("CountBackColor"), Category("拡張動作")]
+ public Color CountBackColor
+ {
+ get { return m_CountBackColor; }
+ set { m_CountBackColor = value; Invalidate(); }
+ }
+
+ private bool m_Selected = false;
+ private bool m_MouseFocused = false;
+ private StringFormat m_StringFormat = new StringFormat();
+ private Image imgEllipse = null;
+
+ public CountButton()
+ {
+ FlatStyle = FlatStyle.Flat;
+ }
+
+ protected override void Dispose(bool disposing)
+ {
+ if (imgEllipse != null) { imgEllipse.Dispose(); }
+ m_StringFormat.Dispose();
+ base.Dispose(disposing);
+ }
+
+ protected override void OnPaint(PaintEventArgs pevent)
+ {
+ base.OnPaint(pevent);
+ if (this.FlatStyle != FlatStyle.Flat) { return; }
+ if (this.Image == null) { return; }
+
+ //ControlPaint.Light
+ Color beginColor = this.m_MouseFocused ? (FlatAppearance.MouseOverBackColor == Color.Empty ? ControlPaint.Light(this.BackColor) : FlatAppearance.MouseOverBackColor) : m_Selected ? (FlatAppearance.MouseDownBackColor == Color.Empty ? ControlPaint.Light(this.BackColor) : FlatAppearance.MouseDownBackColor) : this.BackColor;
+ Color endColor = m_GradientColor == Color.Empty ? beginColor : this.m_MouseFocused ? ControlPaint.LightLight(m_GradientColor) : m_Selected ? ControlPaint.Light(m_GradientColor) : m_GradientColor;
+
+ //using (LinearGradientBrush brush = new LinearGradientBrush(this.ClientRectangle, Color.FromArgb(0, 136, 0), Color.FromArgb(0, 166, 0), m_GradientMode))
+ using (LinearGradientBrush brush = new LinearGradientBrush(this.ClientRectangle, beginColor, endColor, m_GradientMode))
+ {
+ pevent.Graphics.FillRectangle(brush, this.ClientRectangle);
+ }
+
+ //線
+ if (this.FlatAppearance.BorderSize > 0 && !this.FlatAppearance.BorderColor.Equals(Color.Empty))
+ {
+ using (Pen pen = new Pen(this.FlatAppearance.BorderColor, this.FlatAppearance.BorderSize))
+ {
+ pevent.Graphics.DrawRectangle(pen, new Rectangle(this.ClientRectangle.X, this.ClientRectangle.Y, this.ClientRectangle.Width - this.FlatAppearance.BorderSize, this.ClientRectangle.Height - this.FlatAppearance.BorderSize));
+ }
+ }
+
+ float rate = 0.7F;
+ int width = (int)(ClientRectangle.Width * rate);
+ int height = (int)(ClientRectangle.Height * rate);
+ Rectangle imgRect = new Rectangle((ClientRectangle.Width - width) / 2, (ClientRectangle.Height - height) / 2, width, height);
+ ImageAttributes vAttr = new ImageAttributes();
+ vAttr.SetColorKey((Image as Bitmap).GetPixel(0, 0), (Image as Bitmap).GetPixel(0, 0));
+ pevent.Graphics.DrawImage(Image, imgRect, 0, 0, Image.Width, Image.Height, GraphicsUnit.Pixel, vAttr);
+
+ string val = Count.ToString();
+ Size textSize = TextRenderer.MeasureText(val, this.Font);
+ textSize = new Size((int)(textSize.Width * 1.1F), (int)(textSize.Height * 1.1F));
+
+ //上余白、右余白固定
+ Rectangle textRect = new Rectangle(new Point(ClientRectangle.Width - textSize.Width - (int)(height * 0.2F), (int)(height * 0.2F)), textSize);
+ using (SolidBrush textBackBrush = new SolidBrush(m_CountBackColor))
+ {
+ GdiPlus.FillRoundRectangle(pevent.Graphics, textBackBrush, textRect, 5);
+ }
+
+ using (SolidBrush foreBrush = new SolidBrush(m_CountForeColor))
+ {
+ TextRenderer.DrawText(pevent.Graphics, val, this.Font, textRect, m_CountForeColor, TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter);
+ }
+ }
+
+ private void SetStringFormat()
+ {
+ switch (this.TextAlign)
+ {
+ case ContentAlignment.BottomCenter:
+ case ContentAlignment.BottomLeft:
+ case ContentAlignment.BottomRight:
+ m_StringFormat.LineAlignment = StringAlignment.Far;
+ break;
+ case ContentAlignment.MiddleCenter:
+ case ContentAlignment.MiddleLeft:
+ case ContentAlignment.MiddleRight:
+ m_StringFormat.LineAlignment = StringAlignment.Center;
+ break;
+ case ContentAlignment.TopCenter:
+ case ContentAlignment.TopLeft:
+ case ContentAlignment.TopRight:
+ m_StringFormat.LineAlignment = StringAlignment.Near;
+ break;
+ }
+
+ switch (this.TextAlign)
+ {
+ case ContentAlignment.TopLeft:
+ case ContentAlignment.BottomLeft:
+ case ContentAlignment.MiddleLeft:
+ m_StringFormat.Alignment = StringAlignment.Near;
+ break;
+ case ContentAlignment.MiddleCenter:
+ case ContentAlignment.BottomCenter:
+ case ContentAlignment.TopCenter:
+ m_StringFormat.Alignment = StringAlignment.Center;
+ break;
+ case ContentAlignment.BottomRight:
+ case ContentAlignment.MiddleRight:
+ case ContentAlignment.TopRight:
+ m_StringFormat.Alignment = StringAlignment.Far;
+ break;
+ }
+ }
+
+ protected override void OnEnter(EventArgs e)
+ {
+ base.OnEnter(e);
+ m_Selected = true;
+ }
+
+ protected override void OnLeave(EventArgs e)
+ {
+ base.OnLeave(e);
+ m_Selected = false;
+ }
+
+ protected override void OnMouseEnter(EventArgs e)
+ {
+ base.OnMouseEnter(e);
+ m_MouseFocused = true;
+ }
+
+ protected override void OnMouseLeave(EventArgs e)
+ {
+ base.OnMouseLeave(e);
+ m_MouseFocused = false;
+ }
+
+ protected override void OnClick(EventArgs e)
+ {
+ //System.Diagnostics.Debug.WriteLine("base.OnClick begin");
+ base.OnClick(e);
+
+ //System.Diagnostics.Debug.WriteLine("base.OnClick end ");
+
+ //保留されているメッセージを削除し、2度押しを許可しない
+ if (m_DisableClickEvent) { RemovePeekMessage.Invoke(); }
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/Component/DataGridViewEx.cs b/HotelPms.Share.Windows/Component/DataGridViewEx.cs
new file mode 100644
index 0000000..96fa61c
--- /dev/null
+++ b/HotelPms.Share.Windows/Component/DataGridViewEx.cs
@@ -0,0 +1,534 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Text;
+using System.Windows.Forms;
+
+namespace HotelPms.Share.Windows.Component
+{
+ [ToolboxBitmap(typeof(DataGridView))]
+ public partial class DataGridViewEx : DataGridView
+ {
+ #region Private�萔
+
+ private const int WM_KEYDOWN = 0x100;
+ private const int WM_KEYUP = 0x101;
+ private const int WM_CHAR = 0x102;
+ private int orgRowIndex = 0;
+
+ #endregion
+
+ /// <summary>
+ /// �R���X�g���N�^
+ /// </summary>
+ public DataGridViewEx()
+ {
+ InitializeComponent();
+
+ SetStyle(ControlStyles.DoubleBuffer | ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint, true);
+ UpdateStyles();
+
+ txtKanji.Visible = false;
+ this.Controls.Add(txtKanji);
+ txtKanji.AutoSize = false;
+ txtKanji.BorderStyle = BorderStyle.None;
+ txtKanji.Leave += new EventHandler(txtKanji_Leave);
+
+ this.KeyDown += new KeyEventHandler(this.CancelEndKeyEvent);
+ this.KeyUp += new KeyEventHandler(this.InsertRowEvent);
+ this.KeyUp += new KeyEventHandler(this.DeleteRowEvent);
+ //this.RowPostPaint += new System.Windows.Forms.DataGridViewRowPostPaintEventHandler(this.RepaintGrid);
+ this.CellPainting += new System.Windows.Forms.DataGridViewCellPaintingEventHandler(this.OnCellPainting);
+ this.CellEnter += this.DoCellEnter;
+ this.CellLeave += this.DoCellLeave;
+ this.SelectionChanged += new EventHandler(DataGridViewEx_SelectionChanged);
+ this.RowLeave += new DataGridViewCellEventHandler(DataGridViewEx_RowLeave);
+ }
+
+ private void DataGridViewEx_RowLeave(object sender, DataGridViewCellEventArgs e)
+ {
+ System.Diagnostics.Debug.WriteLine("DataGridViewEx_RowLeave");
+ orgRowIndex = e.RowIndex;
+ }
+
+ /// <summary>
+ /// SelectionMode = FullRowSelect�̎��ɁA�s�ύX�̎��������̃C�x���g��ʂ�Ȃ�
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ private void DataGridViewEx_SelectionChanged(object sender, EventArgs e)
+ {
+ if(this.CurrentRow == null) { return; }
+ if (orgRowIndex != this.CurrentRow.Index)
+ {
+ RaiseRowChanged();
+ orgRowIndex = this.CurrentRow.Index;
+ }
+ }
+
+ void txtKanji_Leave(object sender, EventArgs e)
+ {
+ SaveKanji();
+ }
+
+ #region Private�ϐ�
+ /// <summary>
+ /// �Z���I�����F
+ /// </summary>
+ private Color m_CellSelectionBackColor = Color.Empty;
+
+ /// <summary>
+ /// �s�I�����[�h�Ń��^�[���L�[�ɂ��Z���ړ�����̗L��
+ /// </summary>
+ private bool m_EnableReturnOnFullRowSelect = true;
+
+ /// <summary>
+ /// ���̃��^�[���L�[�̈ړ����ɂ���
+ /// </summary>
+ private bool m_StopNext = false;
+ /// <summary>
+ ///
+ /// </summary>
+ private bool allowAddDelRowByKey = true;
+
+ private int colIndexKanjiToKana = -1; //�����˃J�i�ϊ��̗�Index
+
+ #endregion
+
+ #region �v���p�e�B
+
+ private bool m_RowStyleInEditEnabled = false;
+
+ [Description("�ҏW��Ԏ��A�����s�̕ҏW��ԈȊO�̃Z���̔w�i�F�͍s�X�^�C�����炩�Ⴕ���͑S�̃X�^�C����"), Category("����"), DefaultValue(typeof(bool))]
+ public bool RowStyleInEditEnabled
+ {
+ set
+ {
+ this.m_RowStyleInEditEnabled = value;
+ }
+ get
+ {
+ return this.m_RowStyleInEditEnabled;
+ }
+ }
+
+
+ [Description("�����˃J�i�ϊ��̗�Index"), Category("����"), DefaultValue(-1)]
+ public int ColIndexKanjiToKana
+ {
+ get { return colIndexKanjiToKana; }
+ set { colIndexKanjiToKana = value; }
+ }
+
+ /// <summary>
+ /// �Z���I�����F
+ /// </summary>
+ [Description("�Z���I�����̐F���擾�܂��͐ݒ肵�܂��B"), Category("�\��"), DefaultValue(typeof(Color))]
+ public Color CellSelectionBackColor
+ {
+ set
+ {
+ this.m_CellSelectionBackColor = value;
+ }
+ get
+ {
+ return this.m_CellSelectionBackColor;
+ }
+ }
+
+ /// <summary>
+ /// �s�I�����[�h�Ń��^�[���L�[�ɂ��Z���ړ�����̗L��
+ /// </summary>
+ [Description("�s�I�����[�h�Ń��^�[���L�[�ɂ��Z���ړ����삷��^���Ȃ����擾�܂��͐ݒ肵�܂��B"), Category("����"), DefaultValue(typeof(bool))]
+ public bool EnableReturnOnFullRowSelect
+ {
+ set
+ {
+ this.m_EnableReturnOnFullRowSelect = value;
+ }
+ get
+ {
+ return this.m_EnableReturnOnFullRowSelect;
+ }
+ }
+
+ /// <summary>
+ /// �s�}���A�폜��������
+ /// </summary>
+ public bool AllowAddDelRowByKey
+ {
+ set
+ {
+ this.allowAddDelRowByKey = value;
+ }
+ get
+ {
+ return this.allowAddDelRowByKey;
+ }
+ }
+
+ #endregion
+
+ public event KeyEventHandler OnEnterEventHandler;
+ public event KeyEventHandler EditKeyDown;
+ public event DataGridViewCellEventHandler RowChanged;
+
+ private bool RaiseRowChanged()
+ {
+ if(this.CurrentCell == null) { return true;}
+ if (RowChanged != null)
+ {
+ RowChanged(this, new DataGridViewCellEventArgs(this.CurrentCell.ColumnIndex, orgRowIndex));
+ }
+ return false;
+ }
+ private bool RaiseEnterEvent()
+ {
+ if (OnEnterEventHandler != null)
+ {
+ KeyEventArgs e = new KeyEventArgs(Keys.Enter);
+ OnEnterEventHandler(this, e);
+ if (e.Handled) { return true; }
+ }
+ return false;
+ }
+
+ private bool RaiseEditKeyDownEvent(Keys keyData)
+ {
+ if (EditKeyDown != null)
+ {
+ KeyEventArgs e = new KeyEventArgs(keyData);
+ EditKeyDown(this, e);
+ if (e.Handled) { return true; }
+ }
+ return false;
+ }
+
+ /// <summary>
+ /// ���̃��^�[���L�[�̈ړ����ɂ���
+ /// </summary>
+ public void StopNext()
+ {
+ this.m_StopNext = true;
+ }
+
+ // �s�}��
+ protected virtual void InsertRowEvent(object sender, KeyEventArgs e)
+ {
+ if (e.Shift && e.KeyCode == Keys.Insert)
+ {
+ if (this.allowAddDelRowByKey)
+ {
+ this.Rows.Add(new DataGridViewRow());
+ }
+ }
+ }
+
+ // �s�폜
+ protected virtual void DeleteRowEvent(object sender, KeyEventArgs e)
+ {
+ if (e.Shift && e.KeyCode == Keys.Delete)
+ {
+ if (this.allowAddDelRowByKey && this.RowCount > 0)
+ {
+ if (this.CurrentCell.RowIndex == 0)
+ {
+ this[0, this.CurrentCell.RowIndex].Selected = true;
+ this.Rows.RemoveAt(this.CurrentCell.RowIndex);
+ }
+ }
+ }
+ }
+
+ // [End] �L�[�����̃L�����Z��
+ protected virtual void CancelEndKeyEvent(object sender, KeyEventArgs e)
+ {
+ if (e.KeyCode == Keys.End)
+ {
+ e.SuppressKeyPress = true;
+ }
+ }
+
+ /// <summary>
+ /// �Z���̋��E�ɐ���`�悷��
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ private void OnCellPainting(object sender, DataGridViewCellPaintingEventArgs e)
+ {
+ DataGridView dataGridView = (DataGridView)sender;
+ Pen GrayPen = Pens.LightGray;
+
+ //�O���C�F�Řg�`��
+ e.Graphics.DrawRectangle(GrayPen, e.CellBounds);
+ }
+
+ private DataGridViewSelectionMode orgSelectionMode = DataGridViewSelectionMode.FullRowSelect;
+ protected override void OnCellBeginEdit(DataGridViewCellCancelEventArgs e)
+ {
+ base.OnCellBeginEdit(e);
+ if (!e.Cancel)
+ {
+ orgSelectionMode = this.SelectionMode;
+ foreach (DataGridViewCell cell in this.CurrentRow.Cells)
+ {
+ if (cell.Equals(this.CurrentCell))
+ {
+ this.CurrentCell.Style.BackColor = this.CurrentCell.Style.SelectionBackColor;
+ }
+ else
+ {
+ cell.Style.BackColor = m_RowStyleInEditEnabled ? this.CurrentRow.DefaultCellStyle.SelectionBackColor : this.DefaultCellStyle.SelectionBackColor;
+ }
+ }
+ this.SelectionMode = DataGridViewSelectionMode.CellSelect;
+ }
+ }
+
+ protected override void OnCellEndEdit(DataGridViewCellEventArgs e)
+ {
+ base.OnCellEndEdit(e);
+ foreach (DataGridViewCell cell in this.CurrentRow.Cells)
+ {
+ cell.Style.BackColor = m_RowStyleInEditEnabled ? this.CurrentRow.DefaultCellStyle.BackColor : this.DefaultCellStyle.BackColor;
+ }
+ this.SelectionMode = orgSelectionMode;
+ if (this.SelectionMode == DataGridViewSelectionMode.FullRowSelect && this.CurrentRow.Selected == false)
+ {
+ this.CurrentRow.Selected = true;
+ }
+ }
+
+ protected override void OnCellEnter(DataGridViewCellEventArgs e)
+ {
+ if (this.SelectionMode == DataGridViewSelectionMode.FullRowSelect && this.CurrentRow.Selected == false)
+ {
+ this.CurrentRow.Selected = true;
+ }
+ base.OnCellEnter(e);
+ }
+
+ protected override void OnEditingControlShowing(DataGridViewEditingControlShowingEventArgs e)
+ {
+ try
+ {
+ if (e.Control is DataGridViewTextBoxEditingControl)
+ {
+ DataGridViewTextBoxEditingControl control = (DataGridViewTextBoxEditingControl)e.Control;
+ control.Enter -= new EventHandler(control_Enter);
+ control.Enter += new EventHandler(control_Enter);
+ }
+ }
+ catch { }
+ base.OnEditingControlShowing(e);
+ }
+
+ private void control_Enter(object sender, EventArgs e)
+ {
+ (sender as TextBox).BackColor = this.CurrentCell.Style.SelectionBackColor;
+ }
+
+ protected override bool DoubleBuffered
+ {
+ set
+ {
+ base.DoubleBuffered = value;
+ }
+ }
+
+ protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
+ {
+ //�����s�ҏW�̑Ή�
+ if ((keyData & Keys.Control) == Keys.Control && (keyData & Keys.Return) == Keys.Return)
+ {
+ if (EditingControl is DataGridViewTextBoxEditingControl)
+ {
+ DataGridViewTextBoxEditingControl editor = EditingControl as DataGridViewTextBoxEditingControl;
+ if (editor.Visible && editor.Multiline)
+ {
+ editor.Text += Environment.NewLine;
+ editor.SelectionStart = editor.Text.Length;
+ return true;
+ }
+ }
+ }
+
+ if (RaiseEditKeyDownEvent(keyData)) { return true; }
+
+ if (colIndexKanjiToKana > -1)
+ {
+ if (keyData != Keys.Enter && CurrentCell.ColumnIndex == colIndexKanjiToKana)
+ {
+ ShowKanjiCtrl();
+ }
+ else
+ {
+ txtKanji.Visible = false;
+ }
+
+ }
+ return base.ProcessCmdKey(ref msg, keyData);
+ }
+
+ /// <summary>
+ /// �ҏW��Ԃ̎��A�L�[�͂����ɒʂ�
+ /// </summary>
+ /// <param name="keyData"></param>
+ /// <returns></returns>
+ protected override bool ProcessDialogKey(Keys keyData)
+ {
+ if (this.m_EnableReturnOnFullRowSelect == true)
+ {
+ //Enter�L�[�������ꂽ���́ATab�L�[�������ꂽ�悤�ɂ���
+ if ((keyData & Keys.KeyCode) == Keys.Enter)
+ {
+ if (RaiseEnterEvent()) { return true; }
+
+ if (this.m_StopNext == false)
+ {
+ bool flg = this.StandardTab;
+ this.StandardTab = false;
+ bool ret = this.ProcessTabKey(keyData);
+ this.StandardTab = flg;
+ return ret;
+ }
+ else
+ {
+ //���ɖ߂�
+ this.m_StopNext = false;
+ return true;
+ }
+ }
+ }
+ else
+ {
+ if ((keyData & Keys.KeyCode) == Keys.Enter)
+ {
+ return true;
+ }
+ }
+
+ return base.ProcessDialogKey(keyData);
+ }
+
+ /// <summary>
+ /// �ҏW��Ԃł͂Ȃ����ACell��̃L�[
+ /// </summary>
+ /// <param name="e"></param>
+ /// <returns></returns>
+ protected override bool ProcessDataGridViewKey(KeyEventArgs e)
+ {
+ if (this.m_EnableReturnOnFullRowSelect == true)
+ {
+ //Enter�L�[�������ꂽ���́ATab�L�[�������ꂽ�悤�ɂ���
+ if (e.KeyCode == Keys.Enter)
+ {
+ if (RaiseEnterEvent()) { return true; }
+
+ if (this.m_StopNext == false)
+ {
+ bool flg = this.StandardTab;
+ this.StandardTab = false;
+ bool ret = this.ProcessTabKey(e.KeyCode);
+ this.StandardTab = flg;
+ return ret;
+ }
+ else
+ {
+ //���ɖ߂�
+ this.m_StopNext = false;
+ return true;
+ }
+ }
+ }
+ else
+ {
+ if (e.KeyCode == Keys.Enter) { return true; }
+ }
+
+ // [End] �L�[�����̃L�����Z��
+ if (e.KeyCode == Keys.End)
+ {
+ e.Handled = true;
+ return true;
+ }
+
+ return base.ProcessDataGridViewKey(e);
+ }
+
+ private string ToCString(object value)
+ {
+ try
+ {
+ return value.ToString();
+ }
+ catch
+ {
+ return string.Empty;
+ }
+ }
+
+ private void ShowKanjiCtrl()
+ {
+ if (txtKanji.Visible) { return; }
+ CurrentCell.ReadOnly = true;
+ txtKanji.Font = CurrentCell.Style.Font;
+
+ txtKanji.Location = new Point(RowHeadersVisible ? RowHeadersWidth : 0 + CurrentCell.Size.Width * CurrentCell.ColumnIndex + 2,
+ ColumnHeadersHeight + CurrentCell.Size.Height * CurrentCell.RowIndex);
+
+
+ //txtKanji.Location = new Point(RowHeadersVisible ? RowHeadersWidth : 0 + CurrentCell.Size.Width * CurrentCell.ColumnIndex + (CurrentCell.Size.Width - txtKanji.Width)/2,
+ // ColumnHeadersHeight + CurrentCell.Size.Height * CurrentCell.RowIndex + (CurrentCell.Size.Height - txtKanji.Height)/2);
+ txtKanji.Size = new Size(CurrentCell.Size.Width, CurrentCell.Size.Height);
+ txtKanji.Text = ToCString(CurrentRow.Cells[colIndexKanjiToKana].Value);
+ txtKana.Text = ToCString(CurrentRow.Cells[colIndexKanjiToKana + 1].Value);
+ txtKanji.Visible = true;
+ txtKanji.Focus();
+ }
+
+ private void SaveKanji()
+ {
+ txtKanji.Visible = false;
+ CurrentRow.Cells[colIndexKanjiToKana].Value = txtKanji.Text;
+ CurrentRow.Cells[colIndexKanjiToKana + 1].Value = txtKana.Text;
+ }
+
+
+ /// <summary>
+ ///
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ private void DoCellEnter(object sender, DataGridViewCellEventArgs e)
+ {
+ //�w�b�_�[�ȊO�̃Z��
+ if (e.ColumnIndex >= 0 && e.RowIndex >= 0)
+ {
+ DataGridView dgv = (DataGridView)sender;
+
+ //�Z���X�^�C����ύX����
+ dgv[e.ColumnIndex, e.RowIndex].Style.SelectionBackColor = this.m_CellSelectionBackColor;
+ }
+ }
+
+ /// <summary>
+ ///
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ private void DoCellLeave(object sender, DataGridViewCellEventArgs e)
+ {
+ //�w�b�_�[�ȊO�̃Z��
+ if (e.ColumnIndex >= 0 && e.RowIndex >= 0)
+ {
+ DataGridView dgv = (DataGridView)sender;
+
+ //�Z���X�^�C�������ɖ߂�
+ //dgv[e.ColumnIndex, e.RowIndex].Style.SelectionBackColor = Color.Empty;
+ }
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/Component/DataGridViewEx.designer.cs b/HotelPms.Share.Windows/Component/DataGridViewEx.designer.cs
new file mode 100644
index 0000000..7762141
--- /dev/null
+++ b/HotelPms.Share.Windows/Component/DataGridViewEx.designer.cs
@@ -0,0 +1,92 @@
+namespace HotelPms.Share.Windows.Component
+{
+ partial class DataGridViewEx
+ {
+ /// <summary>
+ /// 必要なデザイナ変数です。
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// 使用中のリソースをすべてクリーンアップします。
+ /// </summary>
+ /// <param name="disposing">マネージ リソースが破棄される場合 true、破棄されない場合は false です。</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region コンポーネント デザイナで生成されたコード
+
+ /// <summary>
+ /// デザイナ サポートに必要なメソッドです。このメソッドの内容を
+ /// コード エディタで変更しないでください。
+ /// </summary>
+ private void InitializeComponent()
+ {
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
+ this.txtKanji = new HotelPms.Share.Windows.Component.TextBoxFurigana();
+ this.txtKana = new System.Windows.Forms.TextBox();
+ ((System.ComponentModel.ISupportInitialize)(this)).BeginInit();
+ this.SuspendLayout();
+ //
+ // txtKanji
+ //
+ this.txtKanji.ChildControl = this.txtKana;
+ this.txtKanji.ImeMode = System.Windows.Forms.ImeMode.Hiragana;
+ this.txtKanji.Location = new System.Drawing.Point(0, 0);
+ this.txtKanji.Name = "txtKanji";
+ this.txtKanji.Size = new System.Drawing.Size(100, 19);
+ this.txtKanji.TabIndex = 0;
+ //
+ // txtKana
+ //
+ this.txtKana.Location = new System.Drawing.Point(0, 0);
+ this.txtKana.Name = "txtKana";
+ this.txtKana.Size = new System.Drawing.Size(100, 19);
+ this.txtKana.TabIndex = 0;
+ //
+ // DataGridViewEx
+ //
+ this.AllowUserToResizeColumns = false;
+ this.AllowUserToResizeRows = false;
+ this.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+ this.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
+ dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
+ dataGridViewCellStyle3.BackColor = System.Drawing.Color.OliveDrab;
+ dataGridViewCellStyle3.Font = new System.Drawing.Font("MS UI Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+ dataGridViewCellStyle3.ForeColor = System.Drawing.Color.White;
+ dataGridViewCellStyle3.SelectionBackColor = System.Drawing.Color.FromArgb(255, 49, 106, 197);
+ dataGridViewCellStyle3.SelectionForeColor = System.Drawing.Color.FromArgb(255, 255, 255, 255);
+ dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
+ this.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle3;
+ this.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
+ dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
+ dataGridViewCellStyle4.BackColor = System.Drawing.Color.FromArgb(255, 255, 255, 255);
+ dataGridViewCellStyle4.Font = new System.Drawing.Font("MS UI Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+ dataGridViewCellStyle4.ForeColor = System.Drawing.Color.FromArgb(255, 0, 0, 0);
+ dataGridViewCellStyle4.SelectionBackColor = System.Drawing.Color.FromArgb(255, 49, 106, 197);
+ dataGridViewCellStyle4.SelectionForeColor = System.Drawing.Color.FromArgb(255, 255, 255, 255);
+ dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
+ this.DefaultCellStyle = dataGridViewCellStyle4;
+ this.EnableHeadersVisualStyles = false;
+ this.GridColor = System.Drawing.Color.Black;
+ this.RowHeadersVisible = false;
+ this.RowTemplate.Height = 21;
+ ((System.ComponentModel.ISupportInitialize)(this)).EndInit();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ public HotelPms.Share.Windows.Component.TextBoxFurigana txtKanji;
+ public System.Windows.Forms.TextBox txtKana;
+
+ }
+}
diff --git a/HotelPms.Share.Windows/Component/DataGridViewEx.resx b/HotelPms.Share.Windows/Component/DataGridViewEx.resx
new file mode 100644
index 0000000..49af6a6
--- /dev/null
+++ b/HotelPms.Share.Windows/Component/DataGridViewEx.resx
@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <metadata name="txtKanji.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>17, 17</value>
+ </metadata>
+ <metadata name="txtKana.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>108, 17</value>
+ </metadata>
+ <metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>False</value>
+ </metadata>
+</root>
\ No newline at end of file
diff --git a/HotelPms.Share.Windows/Component/Design/DesignItem.cs b/HotelPms.Share.Windows/Component/Design/DesignItem.cs
new file mode 100644
index 0000000..440baf6
--- /dev/null
+++ b/HotelPms.Share.Windows/Component/Design/DesignItem.cs
@@ -0,0 +1,396 @@
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Drawing.Imaging;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+
+namespace HotelPms.Share.Windows.Component.Design
+{
+ public class DesignItem
+ {
+ public Rectangle[] SmallRect = new Rectangle[8];
+ public Rectangle[] BoundRect = new Rectangle[4];
+
+ public static Size Square = new Size(7, 7);
+ //private StringFormat m_StringFormat = new StringFormat(StringFormatFlags.NoWrap);
+
+ private DesignPanel.ItemType m_Appearance = DesignPanel.ItemType.Normal;
+
+ /// <summary>
+ /// 外観
+ /// </summary>
+ public DesignPanel.ItemType Appearance
+ {
+ get { return m_Appearance; }
+ set { m_Appearance = value; }
+ }
+
+ private bool m_DesignMode = false;
+
+ public bool DesignMode
+ {
+ get { return m_DesignMode; }
+ set { m_DesignMode = value; }
+ }
+
+ private string m_ImageFile = string.Empty;
+
+ public string ImageFile
+ {
+ get { return m_ImageFile; }
+ set { m_ImageFile = value; }
+ }
+
+ private string m_Text = string.Empty;
+
+ public string Text
+ {
+ get { return m_Text; }
+ set { m_Text = value; }
+ }
+
+ private float m_LineWidth = 1.0F;
+
+ public float LineWidth
+ {
+ get { return m_LineWidth; }
+ set { m_LineWidth = value; }
+ }
+
+ private Font m_Font = SystemFonts.MenuFont;
+ public Font Font
+ {
+ get { return m_Font; }
+ set { m_Font = value; }
+ }
+
+ public int X1
+ {
+ get { return m_ClientRectangle.X; }
+ set { m_ClientRectangle = new Rectangle(new Point(value, m_ClientRectangle.Y), m_ClientRectangle.Size); }
+ }
+
+ public int Y1
+ {
+ get { return m_ClientRectangle.Y; }
+ set { m_ClientRectangle = new Rectangle(new Point(m_ClientRectangle.X, value), m_ClientRectangle.Size); }
+ }
+
+ public int X2
+ {
+ get { return m_ClientRectangle.X + m_ClientRectangle.Width; }
+ set { m_ClientRectangle = new Rectangle(m_ClientRectangle.Location, new Size(value - m_ClientRectangle.X, m_ClientRectangle.Height)); }
+ }
+
+ public int Y2
+ {
+ get { return m_ClientRectangle.Y + m_ClientRectangle.Height; }
+ set { m_ClientRectangle = new Rectangle(m_ClientRectangle.Location, new Size(m_ClientRectangle.Width, value - m_ClientRectangle.Y)); }
+ }
+
+ private Rectangle m_ClientRectangle = new Rectangle(0, 0, 100, 100);
+
+ public Rectangle ClientRectangle
+ {
+ get { return m_ClientRectangle; }
+ set { m_ClientRectangle = value; }
+ }
+
+ private Color m_BackColor = Color.White;
+
+ public Color BackColor
+ {
+ get { return m_BackColor; }
+ set { m_BackColor = value; }
+ }
+
+ private Color m_BackGradientColor = Color.Empty;
+
+ public Color BackGradientColor
+ {
+ get { return m_BackGradientColor; }
+ set { m_BackGradientColor = value; }
+ }
+
+ private LinearGradientMode m_BackGradientMode = LinearGradientMode.Horizontal;
+
+ public LinearGradientMode BackGradientMode
+ {
+ get { return m_BackGradientMode; }
+ set { m_BackGradientMode = value; }
+ }
+
+
+ private Color m_ForeColor = Color.Black;
+
+ public Color ForeColor
+ {
+ get { return m_ForeColor; }
+ set { m_ForeColor = value; }
+ }
+
+ private TextFormatFlags m_LineAlignment = TextFormatFlags.VerticalCenter;
+
+ /// <summary>
+ /// 縦
+ /// </summary>
+ public TextFormatFlags LineAlignment
+ {
+ get { return m_LineAlignment; }
+ set { m_LineAlignment = value; }
+ }
+
+ private TextFormatFlags m_Alignment = TextFormatFlags.Left;
+
+ /// <summary>
+ /// 水平
+ /// </summary>
+ public TextFormatFlags Alignment
+ {
+ get { return m_Alignment; }
+ set { m_Alignment = value; }
+ }
+
+ public bool EnabledBorder { get; set; } = false;
+
+ public string Name { get; set; } = string.Empty;
+
+ public object Tag { get; set; } = null;
+
+ public void Draw(Graphics g)
+ {
+ FillCell(g);
+ DrawCellImage(g); //画像
+ DrawCellText(g); //文字
+ }
+
+ private void DrawCellImage(Graphics g)
+ {
+ try
+ {
+ if (m_Appearance == DesignPanel.ItemType.Line) { return; }
+ if (m_ImageFile.Length == 0) { return; }
+ if (!File.Exists(m_ImageFile)) { return; }
+ Bitmap img = Image.FromFile(m_ImageFile) as Bitmap;
+ using (ImageAttributes vAttr = new ImageAttributes())
+ {
+ vAttr.SetColorKey(img.GetPixel(0, 0), img.GetPixel(0, 0));
+ g.DrawImage(img, m_ClientRectangle, 0, 0, img.Width, img.Height, GraphicsUnit.Pixel, vAttr);
+ }
+ }
+ catch { }
+ }
+
+ private Font GetScaleFont(Font orgFont, Graphics g)
+ {
+ return new Font(orgFont.FontFamily, orgFont.Size * g.Transform.Elements[0], orgFont.Style);
+ }
+
+ private void DrawCellText(Graphics g)
+ {
+ bool newflag = m_ForeColor.IsSystemColor;
+ Color brushColor = m_ForeColor;
+
+ if (m_Appearance == DesignPanel.ItemType.Normal)
+ {
+ if (g.Transform.Elements[0] == 1F)
+ {
+ TextRenderer.DrawText(g, m_Text, m_Font, m_ClientRectangle, m_ForeColor, m_Alignment | m_LineAlignment);
+ }
+ else
+ {
+ using (Font newFont = GetScaleFont(m_Font, g))
+ {
+ float scale = g.Transform.Elements[0];
+ TextRenderer.DrawText(g, m_Text, newFont, new Rectangle((int)(m_ClientRectangle.X * scale), (int)(m_ClientRectangle.Y * scale), (int)(m_ClientRectangle.Width * scale), (int)(m_ClientRectangle.Height * scale)), m_ForeColor, m_Alignment | m_LineAlignment);
+ }
+ }
+ }
+ else
+ {
+ Pen pen = newflag ? SystemPens.FromSystemColor(brushColor) : new Pen(brushColor);
+ pen.Width = m_LineWidth;
+ SmoothingMode sm = g.SmoothingMode;
+ g.SmoothingMode = SmoothingMode.AntiAlias;
+ g.DrawLine(pen, new Point(X1, Y1), new Point(X2, Y2));
+ g.SmoothingMode = sm;
+ if (!newflag) { pen.Dispose(); }
+ }
+
+
+ }
+
+ private void FillCell(Graphics g)
+ {
+ if (m_Appearance == DesignPanel.ItemType.Normal)
+ {
+ if (m_BackColor.Equals(Color.Empty) || m_BackColor.Equals(Color.Transparent)) { return; }
+
+ Color bColorMax = m_BackColor;
+ Color bColorMin = m_BackGradientColor;
+ if (m_BackGradientColor.Equals(Color.Empty))
+ {
+ bool newflag = bColorMax.IsSystemColor;
+ SolidBrush brush = newflag ? SystemBrushes.FromSystemColor(bColorMax) as SolidBrush : new SolidBrush(bColorMax);
+ g.FillRectangle(brush, m_ClientRectangle);
+ if (!newflag) { brush.Dispose(); }
+ }
+ else
+ {
+ using (LinearGradientBrush lgBrush = new LinearGradientBrush(m_ClientRectangle, bColorMax, bColorMin, m_BackGradientMode)) { g.FillRectangle(lgBrush, m_ClientRectangle); }
+ }
+
+ if (EnabledBorder) { ControlPaint.DrawVisualStyleBorder(g, m_ClientRectangle); }
+ }
+
+ //ControlPaint.DrawBorder(g, m_ClientRectangle,
+ // Color.DimGray, 1, ButtonBorderStyle.Solid, //左边
+ // Color.DimGray, 1, ButtonBorderStyle.Solid, //上边
+ // Color.White, 1, ButtonBorderStyle.Solid, //右边
+ // Color.White, 1, ButtonBorderStyle.Solid);//底边
+
+ //その部分
+ if (!m_DesignMode) { return; }
+ DrawDesignFrame(g);
+
+ //if (isFocus && m_IsMouseDown)
+ //{
+ //ControlPaint.DrawBorder(e.Graphics, r,
+ // Color.DimGray, 1, ButtonBorderStyle.Solid, //左边
+ // Color.DimGray, 1, ButtonBorderStyle.Solid, //上边
+ // Color.White, 1, ButtonBorderStyle.Solid, //右边
+ // Color.White, 1, ButtonBorderStyle.Solid);//底边
+ //}
+ }
+
+ /// <summary>
+ /// 6個点
+ /// </summary>
+ /// <returns></returns>
+ private Rectangle[] CreateDesignSmallRect()
+ {
+ Rectangle[] SmallRect = new Rectangle[8];
+ if (m_Appearance == DesignPanel.ItemType.Line && X1 == X2)
+ {
+ #region 縦線 (※X1は線の中心のX)
+
+ SmallRect[0] = Rectangle.Empty; //上左
+ SmallRect[1] = new Rectangle(new Point(X1 - Square.Width / 2, Y1 - Square.Height), Square); //上中間
+ SmallRect[2] = Rectangle.Empty; //上右
+ SmallRect[3] = Rectangle.Empty; //中間左
+ SmallRect[4] = Rectangle.Empty; //中間右
+ SmallRect[5] = Rectangle.Empty; //下左
+ SmallRect[6] = new Rectangle(new Point(X1 - Square.Width / 2, Y2), Square); //下中間
+ SmallRect[7] = Rectangle.Empty; //下右
+
+ #endregion
+ }
+ else if (m_Appearance == DesignPanel.ItemType.Line && Y1 == Y2)
+ {
+ #region 横線 (※Y1は線の中心のY)
+
+ SmallRect[0] = Rectangle.Empty; //上左
+ SmallRect[1] = Rectangle.Empty; //上中間
+ SmallRect[2] = Rectangle.Empty; //上右
+ SmallRect[3] = new Rectangle(new Point(X1 - Square.Width, Y1 - Square.Height/ 2), Square); //中間左
+ SmallRect[4] = new Rectangle(new Point(X2, Y1 - Square.Height / 2), Square); //中間右
+ SmallRect[5] = Rectangle.Empty; //下左
+ SmallRect[6] = Rectangle.Empty; //下中間
+ SmallRect[7] = Rectangle.Empty; //下右
+
+ #endregion
+ }
+ else
+ {
+ SmallRect[0] = new Rectangle(new Point(m_ClientRectangle.X - Square.Width, m_ClientRectangle.Y - Square.Height), Square); //上左
+ SmallRect[1] = new Rectangle(new Point(m_ClientRectangle.X + (m_ClientRectangle.Width - Square.Width) / 2, m_ClientRectangle.Y - Square.Height), Square); //上中間
+ SmallRect[2] = new Rectangle(new Point(m_ClientRectangle.X + m_ClientRectangle.Width, m_ClientRectangle.Y - Square.Height), Square); //上右
+ SmallRect[3] = new Rectangle(new Point(m_ClientRectangle.X - Square.Width, m_ClientRectangle.Y + (m_ClientRectangle.Height - Square.Height) / 2), Square); //中間左
+ SmallRect[4] = new Rectangle(new Point(m_ClientRectangle.X + m_ClientRectangle.Width, m_ClientRectangle.Y + (m_ClientRectangle.Height - Square.Height) / 2), Square); //中間右
+ SmallRect[5] = new Rectangle(new Point(m_ClientRectangle.X - Square.Width, m_ClientRectangle.Y + m_ClientRectangle.Height), Square); //下左
+ SmallRect[6] = new Rectangle(new Point(m_ClientRectangle.X + (m_ClientRectangle.Width - Square.Width) / 2, m_ClientRectangle.Y + m_ClientRectangle.Height), Square); //下中間
+ SmallRect[7] = new Rectangle(new Point(m_ClientRectangle.X + m_ClientRectangle.Width, m_ClientRectangle.Y + m_ClientRectangle.Height), Square); //下右
+ }
+ return SmallRect;
+ }
+
+ /// <summary>
+ /// 棒
+ /// </summary>
+ /// <returns></returns>
+ private Rectangle[] CreateDesignBoundRect()
+ {
+ int adding = 2;
+ Rectangle[] BoundRect = new Rectangle[4];
+ if (m_Appearance == DesignPanel.ItemType.Line && X1 == X2)
+ {
+ int x = 0;
+ int x1 = 0;
+ int width = 0;
+ if ((int)m_LineWidth < Square.Width)
+ {
+ x = X1 - Square.Width / 2 - Square.Width;
+ width = Square.Width * 3;
+ }
+ else
+ {
+ x = X1 - (int)m_LineWidth / 2 - Square.Width;
+ width = Square.Width * 2 + (int)m_LineWidth;
+ }
+ x1 = x + width - (Square.Width - adding);
+
+ BoundRect[0] = new Rectangle(x, Y1 - Square.Height, width, Square.Height); //上
+ BoundRect[1] = new Rectangle(x, Y1, Square.Width - adding, Y2 - Y1); //左
+ BoundRect[2] = new Rectangle(x, Y2, width, Square.Height); //下
+ BoundRect[3] = new Rectangle(x1, Y1, Square.Width - adding, Y2 - Y1); //右
+ }
+ else if (m_Appearance == DesignPanel.ItemType.Line && Y1 == Y2)
+ {
+ int y = 0;
+ int y1 = 0;
+ int height = 0;
+ if ((int)m_LineWidth < Square.Height)
+ {
+ y = Y1 - Square.Height / 2 - Square.Height;
+ height = Square.Height * 3;
+ }
+ else
+ {
+ y = Y1 - (int)m_LineWidth / 2 - Square.Height;
+ height = Square.Height * 2 + (int)m_LineWidth;
+ }
+ y1 = y + height - (Square.Height - adding);
+
+ BoundRect[0] = new Rectangle(X1, y, X2 - X1, Square.Height - adding); //上
+ BoundRect[1] = new Rectangle(X1 - Square.Width, y, Square.Width, height); //左
+ BoundRect[2] = new Rectangle(X1, y1, X2 - X1, Square.Height - adding); //下
+ BoundRect[3] = new Rectangle(X2, y, Square.Width, height); //右
+ }
+ else
+ {
+ BoundRect[0] = new Rectangle(m_ClientRectangle.X, m_ClientRectangle.Y - Square.Height, m_ClientRectangle.Width, Square.Height - adding); //上
+ BoundRect[1] = new Rectangle(m_ClientRectangle.X - Square.Width, m_ClientRectangle.Y, Square.Width - adding, m_ClientRectangle.Height); //左
+ BoundRect[2] = new Rectangle(m_ClientRectangle.X, m_ClientRectangle.Y + m_ClientRectangle.Height + adding + 1, m_ClientRectangle.Width, Square.Height - adding); //下
+ BoundRect[3] = new Rectangle(m_ClientRectangle.X + m_ClientRectangle.Width + adding + 1, m_ClientRectangle.Y, Square.Width - adding, m_ClientRectangle.Height); //右
+ }
+ return BoundRect;
+ }
+
+ private void DrawDesignFrame(Graphics g)
+ {
+ try
+ {
+ SmallRect = CreateDesignSmallRect();
+ BoundRect = CreateDesignBoundRect();
+ g.FillRectangles(Brushes.LightGray, BoundRect);
+ g.FillRectangles(Brushes.White, SmallRect);
+ g.DrawRectangles(Pens.Black, SmallRect);
+ }
+ catch { }
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/Component/Design/DesignItemCollection.cs b/HotelPms.Share.Windows/Component/Design/DesignItemCollection.cs
new file mode 100644
index 0000000..ae18428
--- /dev/null
+++ b/HotelPms.Share.Windows/Component/Design/DesignItemCollection.cs
@@ -0,0 +1,180 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace HotelPms.Share.Windows.Component.Design
+{
+ public class DesignItemCollection : CollectionBase
+ {
+ private DesignPanel owner;
+
+ public virtual DesignItem this[int index]
+ {
+ get
+ {
+ return this.List[index] as DesignItem;
+ }
+ }
+
+ public DesignItemCollection(DesignPanel owner)
+ : base()
+ {
+ if (owner == null)
+ throw new ArgumentNullException("owner");
+
+ this.owner = owner;
+ }
+
+ public DesignItemCollection(DesignPanel owner, DesignItem dateItems)
+ : this(owner)
+ {
+ this.Add(dateItems);
+ }
+
+ public int IndexOf(DesignItem dateItem)
+ {
+ if (dateItem == null)
+ throw new ArgumentNullException("dateItem");
+
+ for (int i = 0; i < this.Count; i++)
+ {
+ if (this[i] == dateItem)
+ {
+ return i;
+ }
+ }
+
+ return -1;
+ }
+
+ public void Add(DesignItem value)
+ {
+ int index;
+ if (value == null)
+ throw new ArgumentNullException("value");
+
+ //if (value.Owner == null) { value.Owner = this.owner; }
+
+ index = this.IndexOf(value);
+ if (index == -1)
+ this.List.Add(value);
+ else
+ this.List[index] = value;
+ }
+
+ public void Insert(DesignItem value, int p)
+ {
+ int index;
+ if (value == null)
+ throw new ArgumentNullException("value");
+
+ //if (value.Owner == null) { value.Owner = this.owner; }
+
+ index = this.IndexOf(value);
+ if (index == -1)
+ this.List.Insert(p, value);
+ else
+ this.List[index] = value;
+ }
+
+
+ public void AddRange(DesignItem[] dateItems)
+ {
+ if (dateItems == null)
+ throw new ArgumentNullException("dateItems");
+
+ for (int i = 0; i < dateItems.Length; i++)
+ {
+ //dateItems[i].Owner = owner;
+ this.Add(dateItems[i]);
+ }
+ }
+
+ public void Add(DesignItemCollection dateItems)
+ {
+ if (dateItems == null)
+ throw new ArgumentNullException("dateItems");
+
+ for (int i = 0; i < dateItems.Count; i++)
+ {
+ this.Add(dateItems[i]);
+ }
+ }
+
+ public new void Clear()
+ {
+ while (this.Count > 0)
+ {
+ this.RemoveAt(0);
+ }
+ }
+
+ public bool Contains(DesignItem dateItem)
+ {
+ if (dateItem == null)
+ throw new ArgumentNullException("dateItem");
+
+ return (this.IndexOf(dateItem) != -1);
+ }
+
+
+ public void Remove(DesignItem value)
+ {
+ if (value == null)
+ throw new ArgumentNullException("value");
+
+ this.List.Remove(value);
+
+ }
+
+ public new void RemoveAt(int index)
+ {
+ this.Remove(this[index]);
+ }
+
+ public void Move(DesignItem value, int index)
+ {
+ if (value == null)
+ throw new ArgumentNullException("value");
+
+ if (index < 0)
+ {
+ index = 0;
+ }
+ else if (index > this.Count)
+ {
+ index = this.Count;
+ }
+
+ if (!this.Contains(value) || this.IndexOf(value) == index)
+ {
+ return;
+ }
+
+ this.List.Remove(value);
+
+ if (index > this.Count)
+ {
+ this.List.Add(value);
+ }
+ else
+ {
+ this.List.Insert(index, value);
+ }
+
+ }
+
+ public void MoveToTop(DesignItem value)
+ {
+ this.Move(value, 0);
+ }
+
+
+ public void MoveToBottom(DesignItem value)
+ {
+ this.Move(value, this.Count);
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/Component/Design/DesignPanel.cs b/HotelPms.Share.Windows/Component/Design/DesignPanel.cs
new file mode 100644
index 0000000..2969f3a
--- /dev/null
+++ b/HotelPms.Share.Windows/Component/Design/DesignPanel.cs
@@ -0,0 +1,610 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+
+namespace HotelPms.Share.Windows.Component.Design
+{
+ /// <summary>
+ /// 設計Frame:2015/05/13
+ /// </summary>
+ public class DesignPanel : Panel
+ {
+ #region ★★★★★ Declartions ★★★★★
+
+ public enum ItemType : int
+ {
+ Normal = 0,
+ Line,
+ }
+
+ public enum HitDownSquare : int
+ {
+ None = 0,
+ TopLeft,
+ TopCenter,
+ TopRight,
+ MiddleLeft,
+ MiddleRight,
+ BottomLeft,
+ BottomCenter,
+ BottomRight,
+ Body,
+ }
+
+ public sealed class HitTestInfo
+ {
+ public static readonly HitTestInfo Nowhere;
+
+ internal int y;
+ internal int x;
+ internal HitDownSquare type;
+ internal int index;
+ internal int itemY;
+ internal int itemX;
+
+ static HitTestInfo()
+ {
+ HitTestInfo.Nowhere = new HitTestInfo();
+ }
+
+ internal HitTestInfo()
+ {
+ this.type = HitDownSquare.None;
+ this.x = -1;
+ this.y = -1;
+ this.index = -1;
+ }
+
+ public int X
+ {
+ get { return this.x; }
+ }
+
+ public int Y
+ {
+ get { return this.y; }
+ }
+
+ public int ItemY
+ {
+ get { return this.itemY; }
+ }
+
+ public int ItemX
+ {
+ get { return this.itemX; }
+ }
+
+
+ public int Index
+ {
+ get { return this.index; }
+ }
+
+ public HitDownSquare Type
+ {
+ get { return this.type; }
+ }
+
+ public override int GetHashCode()
+ {
+ return this.x << 16 | this.y << 8 | (int)this.type;
+ }
+
+ public override bool Equals(object obj)
+ {
+ HitTestInfo hi = obj as HitTestInfo;
+ return (this.type == hi.type && this.x == hi.x && this.x == hi.x);
+ }
+
+ public override string ToString()
+ {
+ return string.Concat(new string[7] { "{ ", this.type.ToString(), ",", this.x.ToString(), ",", this.y.ToString(), "}" });
+ }
+ }
+
+ private bool isMouseDown = false;
+
+ private HitTestInfo curHitTestInfo = null;
+ //public bool isSelected = false;
+ private int m_SelectIndex = -1;
+ public bool m_MouseFocused = false;
+ public event EventHandler StyleChange;
+ private float m_Zoom = 1;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+
+ private DesignItemCollection m_Items = null;
+
+
+ [Category("Item Setting")]
+ [DefaultValue(null)]
+ [Description("Item")]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
+ public DesignItemCollection Items
+ {
+ get { return m_Items; }
+ set { m_Items = value; }
+ }
+
+ [Category("Item Setting")]
+ [DefaultValue(1F)]
+ [Description("Zoom")]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
+ public float Zoom
+ {
+ get { return m_Zoom; }
+ set { m_Zoom = value <= 0 ? 1 : value; Invalidate(); }
+ }
+
+ [Category("Item Setting")]
+ [DefaultValue(-1)]
+ [Description("SelectIndex")]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
+ public int SelectIndex
+ {
+ get { return m_SelectIndex; }
+ set { m_SelectIndex = value; Invalidate(); }
+ }
+
+ public DesignItem CurrentItem
+ {
+ get
+ {
+ if(m_SelectIndex == -1) { return null; }
+ return Items[m_SelectIndex];
+ }
+ }
+
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public DesignPanel()
+ {
+ //SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor | ControlStyles.UserPaint, true);
+ this.SetStyle(ControlStyles.DoubleBuffer, true);
+ this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
+ this.SetStyle(ControlStyles.UserPaint, true);
+ this.SetStyle(ControlStyles.ResizeRedraw, true);
+ this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
+ //SetStyle(ControlStyles.SupportsTransparentBackColor, true);
+ //SetStyle(ControlStyles.Opaque, true); //透明
+ //this.BackColor = Color.Transparent;
+
+ m_Items = new DesignItemCollection(this);
+ }
+
+ #endregion
+
+ #region ★★★★★ Control Event ★★★★★
+
+ protected override void OnEnter(EventArgs e)
+ {
+ base.OnEnter(e);
+ //isSelected = true;
+ Invalidate();
+ }
+
+ protected override void OnLeave(EventArgs e)
+ {
+ base.OnLeave(e);
+ //isSelected = false;
+ Invalidate();
+ }
+
+ protected override void OnMouseEnter(EventArgs e)
+ {
+ base.OnMouseEnter(e);
+ m_MouseFocused = true;
+ Invalidate();
+ }
+
+ protected override void OnMouseLeave(EventArgs e)
+ {
+ base.OnMouseLeave(e);
+ m_MouseFocused = false;
+ Invalidate();
+ }
+
+ protected override void OnMouseDown(MouseEventArgs e)
+ {
+ this.Focus();
+ //e.X, e.Yとは実際画面の位置ではなく、ヒットされる該当コントロールに対する相対位置
+ isMouseDown = true;
+ curHitTestInfo = HitTest(e.X, e.Y);
+ SetCursor(curHitTestInfo);
+ m_SelectIndex = curHitTestInfo.index;
+ Invalidate();
+ System.Diagnostics.Debug.WriteLine(string.Format("OnMouseDown X:{0} Y:{1}", e.X, e.Y));
+ base.OnMouseDown(e);
+ }
+
+ protected override void OnMouseUp(MouseEventArgs e)
+ {
+ this.Cursor = Cursors.Default;
+ isMouseDown = false;
+ System.Diagnostics.Debug.WriteLine(string.Format("OnMouseUp X:{0} Y:{1}", e.X, e.Y));
+ base.OnMouseUp(e);
+ }
+
+ protected override void OnMouseMove(MouseEventArgs e)
+ {
+ if (!isMouseDown)
+ {
+ System.Diagnostics.Debug.WriteLine(string.Format("OnMouseMove X:{0} Y:{1}", e.X, e.Y));
+ HitTestInfo hit = HitTest(e.X, e.Y);
+ SetCursor(hit);
+ }
+ else
+ {
+ int offsetX = 0;
+ int offsetY = 0;
+ System.Diagnostics.Debug.WriteLine(string.Format("X:{0} Y:{1}", e.X, e.Y));
+ if (m_SelectIndex >= 0)
+ {
+ int x = (int)(e.X / m_Zoom);
+ int y = (int)(e.Y / m_Zoom);
+ DesignItem item = Items[m_SelectIndex];
+ switch (curHitTestInfo.Type)
+ {
+
+ case HitDownSquare.TopCenter:
+ offsetY = item.ClientRectangle.Y + item.ClientRectangle.Height - DesignItem.Square.Height * 3;
+ if (y < offsetY)
+ {
+ item.ClientRectangle = new Rectangle(new Point(item.ClientRectangle.Location.X, y), new Size(item.ClientRectangle.Width, item.ClientRectangle.Y + item.ClientRectangle.Height - y));
+ }
+ break;
+
+ case HitDownSquare.TopRight:
+ offsetX = item.ClientRectangle.X + DesignItem.Square.Width * 3;
+ offsetY = item.ClientRectangle.Y + item.ClientRectangle.Height - DesignItem.Square.Height * 3;
+ if (x > offsetX)
+ {
+ item.ClientRectangle = new Rectangle(new Point(item.ClientRectangle.X, item.ClientRectangle.Location.Y), new Size(x - item.ClientRectangle.X, item.ClientRectangle.Height));
+ }
+ if (y < offsetY)
+ {
+ item.ClientRectangle = new Rectangle(new Point(item.ClientRectangle.Location.X, y), new Size(item.ClientRectangle.Width, item.ClientRectangle.Y + item.ClientRectangle.Height - y));
+ }
+ break;
+
+ case HitDownSquare.TopLeft:
+ offsetX = item.ClientRectangle.X + item.ClientRectangle.Width - DesignItem.Square.Width * 3;
+ offsetY = item.ClientRectangle.Y + item.ClientRectangle.Height - DesignItem.Square.Height * 3;
+ if (x < offsetX)
+ {
+ item.ClientRectangle = new Rectangle(new Point(x, item.ClientRectangle.Y), new Size(item.ClientRectangle.X + item.ClientRectangle.Width - x, item.ClientRectangle.Height));
+ }
+ if (y < offsetY)
+ {
+ item.ClientRectangle = new Rectangle(new Point(item.ClientRectangle.X, y), new Size(item.ClientRectangle.Width, item.ClientRectangle.Y + item.ClientRectangle.Height - y));
+ }
+ break;
+
+ case HitDownSquare.MiddleLeft:
+ offsetX = item.ClientRectangle.X + item.ClientRectangle.Width - DesignItem.Square.Width * 3;
+ if (x < offsetX)
+ {
+ item.ClientRectangle = new Rectangle(new Point(x, item.ClientRectangle.Y), new Size(item.ClientRectangle.X + item.ClientRectangle.Width - x, item.ClientRectangle.Height));
+ }
+ break;
+
+ case HitDownSquare.BottomCenter:
+ offsetY = item.ClientRectangle.Y + DesignItem.Square.Height * 3;
+ if (y > offsetY) { item.ClientRectangle = new Rectangle(item.ClientRectangle.Location, new Size(item.ClientRectangle.Width, y - item.ClientRectangle.Y)); }
+ break;
+
+ case HitDownSquare.BottomLeft:
+ offsetX = item.ClientRectangle.X + item.ClientRectangle.Width - DesignItem.Square.Width * 3;
+ offsetY = item.ClientRectangle.Y + DesignItem.Square.Height * 3;
+ if (x < offsetX)
+ {
+ item.ClientRectangle = new Rectangle(new Point(x, item.ClientRectangle.Y), new Size(item.ClientRectangle.X + item.ClientRectangle.Width - x, item.ClientRectangle.Height));
+ }
+ if (y > offsetY) { item.ClientRectangle = new Rectangle(item.ClientRectangle.Location, new Size(item.ClientRectangle.Width, y - item.ClientRectangle.Y)); }
+ break;
+
+ case HitDownSquare.BottomRight:
+ offsetX = item.ClientRectangle.X + DesignItem.Square.Width * 3;
+ offsetY = item.ClientRectangle.Y + DesignItem.Square.Height * 3;
+ if (x > offsetX)
+ {
+ item.ClientRectangle = new Rectangle(item.ClientRectangle.Location, new Size(x - item.ClientRectangle.X, item.ClientRectangle.Height));
+ }
+ if (y > offsetY) { item.ClientRectangle = new Rectangle(item.ClientRectangle.Location, new Size(item.ClientRectangle.Width, y - item.ClientRectangle.Y)); }
+ break;
+
+ case HitDownSquare.MiddleRight:
+ offsetX = item.ClientRectangle.X + DesignItem.Square.Width * 3;
+ if (x > offsetX)
+ {
+ item.ClientRectangle = new Rectangle(new Point(item.ClientRectangle.X, item.ClientRectangle.Location.Y), new Size(x - item.ClientRectangle.X, item.ClientRectangle.Height));
+ }
+ break;
+ case HitDownSquare.Body:
+ offsetX = x - (int)(curHitTestInfo.X / m_Zoom);
+ offsetY = y - (int)(curHitTestInfo.Y / m_Zoom);
+ item.ClientRectangle = new Rectangle(new Point(curHitTestInfo.ItemX + offsetX, curHitTestInfo.ItemY + offsetY), item.ClientRectangle.Size);
+ break;
+ }
+ }
+ //RefreshBackground();
+ Invalidate();
+ if (StyleChange != null) { StyleChange(this, new EventArgs()); }
+ }
+ base.OnMouseMove(e);
+ }
+
+ protected override void OnPreviewKeyDown(PreviewKeyDownEventArgs e)
+ {
+ DesignItem item = null;
+ switch (e.KeyCode)
+ {
+ case Keys.Up:
+ if (m_SelectIndex >= 0)
+ {
+ item = Items[m_SelectIndex];
+ if (e.Shift)
+ {
+ if (item.ClientRectangle.Size.Height > DesignItem.Square.Height * 3)
+ {
+ item.ClientRectangle = new Rectangle(item.ClientRectangle.Location, new Size(item.ClientRectangle.Size.Width, item.ClientRectangle.Size.Height - 1));
+ }
+ }
+ else
+ {
+ item.ClientRectangle = new Rectangle(new Point(item.ClientRectangle.X, item.ClientRectangle.Y - 1), item.ClientRectangle.Size);
+ }
+ if (StyleChange != null) { StyleChange(this, new EventArgs()); }
+ }
+ break;
+ case Keys.Down:
+ if (m_SelectIndex >= 0)
+ {
+ item = Items[m_SelectIndex];
+ if (e.Shift)
+ {
+ item.ClientRectangle = new Rectangle(item.ClientRectangle.Location, new Size(item.ClientRectangle.Size.Width, item.ClientRectangle.Size.Height + 1));
+ }
+ else
+ {
+ item.ClientRectangle = new Rectangle(new Point(item.ClientRectangle.X, item.ClientRectangle.Y + 1), item.ClientRectangle.Size);
+ }
+
+
+ if (StyleChange != null) { StyleChange(this, new EventArgs()); }
+ }
+ break;
+ case Keys.Left:
+ if (m_SelectIndex >= 0)
+ {
+ item = Items[m_SelectIndex];
+ if (e.Shift)
+ {
+ if (item.ClientRectangle.Size.Width > DesignItem.Square.Width * 3)
+ {
+ item.ClientRectangle = new Rectangle(item.ClientRectangle.Location, new Size(item.ClientRectangle.Size.Width - 1, item.ClientRectangle.Size.Height));
+ }
+ }
+ else
+ {
+ item.ClientRectangle = new Rectangle(new Point(item.ClientRectangle.X - 1, item.ClientRectangle.Y), item.ClientRectangle.Size);
+ }
+ if (StyleChange != null) { StyleChange(this, new EventArgs()); }
+ }
+ break;
+ case Keys.Right:
+ if (m_SelectIndex >= 0)
+ {
+ item = Items[m_SelectIndex];
+ if (e.Shift)
+ {
+ item.ClientRectangle = new Rectangle(item.ClientRectangle.Location, new Size(item.ClientRectangle.Size.Width + 1, item.ClientRectangle.Size.Height));
+ }
+ else
+ {
+ item.ClientRectangle = new Rectangle(new Point(item.ClientRectangle.X + 1, item.ClientRectangle.Y), item.ClientRectangle.Size);
+ }
+ if (StyleChange != null) { StyleChange(this, new EventArgs()); }
+ }
+ break;
+ default:
+ base.OnPreviewKeyDown(e);
+ return;
+ }
+ e.IsInputKey = true;
+ //RefreshBackground();
+ Invalidate();
+ }
+
+ protected override void OnPaint(PaintEventArgs e)
+ {
+ base.OnPaint(e);//コントロールのプロパティで設定した部分の描画
+
+ GraphicsState state = e.Graphics.Save();
+ e.Graphics.ScaleTransform((float)m_Zoom, (float)m_Zoom);
+
+ //選択枠
+ int i = 0;
+ foreach (DesignItem item in m_Items)
+ {
+ System.Diagnostics.Debug.WriteLine(m_SelectIndex.ToString());
+ item.DesignMode = (i == m_SelectIndex);
+ item.Draw(e.Graphics);
+ i++;
+ }
+
+ e.Graphics.Restore(state);
+ }
+
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+
+
+ private void SetCursor(HitTestInfo hit)
+ {
+ switch (hit.type)
+ {
+ case HitDownSquare.BottomRight:
+ case HitDownSquare.TopLeft:
+ this.Cursor = Cursors.SizeNWSE;
+ break;
+ case HitDownSquare.BottomCenter:
+ case HitDownSquare.TopCenter:
+ this.Cursor = Cursors.SizeNS;
+ break;
+ case HitDownSquare.BottomLeft:
+ case HitDownSquare.TopRight:
+ this.Cursor = Cursors.SizeNESW;
+ break;
+ case HitDownSquare.MiddleLeft:
+ case HitDownSquare.MiddleRight:
+ this.Cursor = Cursors.SizeWE;
+ break;
+ case HitDownSquare.Body:
+ this.Cursor = Cursors.SizeAll;
+ break;
+ default:
+ this.Cursor = Cursors.Default;
+ break;
+ }
+ }
+
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+
+ private bool InRectangle(Rectangle r, int x, int y)
+ {
+ return (r.X * m_Zoom <= x && x <= (r.X + r.Width) * m_Zoom) && (r.Y * m_Zoom <= y && y <= (r.Y + r.Height) * m_Zoom);
+ }
+
+ public HitTestInfo HitTest(int x, int y)
+ {
+ HitTestInfo hit = new HitTestInfo();
+ hit.x = x;
+ hit.y = y;
+
+ for (int idx = Items.Count - 1; idx >= 0; idx--)
+ {
+ DesignItem item = Items[idx];
+ for (int i = 0; i < item.SmallRect.Length; i++)
+ {
+ //if (item.SmallRect[i].Contains(x, y))
+ if (InRectangle(item.SmallRect[i], x, y))
+ {
+ hit.type = (HitDownSquare)(i + 1);
+ hit.index = idx;
+ return hit;
+ }
+ }
+
+ for (int i = 0; i < item.BoundRect.Length; i++)
+ {
+ //if (item.BoundRect[i].Contains(x, y))
+ if (InRectangle(item.BoundRect[i], x, y))
+ {
+ switch (i)
+ {
+ case 0:
+ hit.type = HitDownSquare.TopCenter;
+ break;
+ case 1:
+ hit.type = HitDownSquare.MiddleLeft;
+ break;
+ case 2:
+ hit.type = HitDownSquare.BottomCenter;
+ break;
+ case 3:
+ hit.type = HitDownSquare.MiddleRight;
+ break;
+ }
+ if (item.Appearance == ItemType.Line)
+ {
+ hit.type = HitDownSquare.Body;
+ hit.itemX = item.ClientRectangle.X;
+ hit.itemY = item.ClientRectangle.Y;
+ }
+ hit.index = idx;
+ return hit;
+ }
+ }
+
+ Rectangle bodyR = item.ClientRectangle;
+ if (item.Appearance == ItemType.Line)
+ {
+ if (item.X1 == item.X2) { bodyR = new Rectangle(bodyR.Location, new Size((int)item.LineWidth < DesignItem.Square.Width ? DesignItem.Square.Width : (int)item.LineWidth, item.ClientRectangle.Height)); }
+ else if (item.Y1 == item.Y2) { bodyR = new Rectangle(bodyR.Location, new Size(item.ClientRectangle.Width, (int)item.LineWidth < DesignItem.Square.Height ? DesignItem.Square.Height : (int)item.LineWidth)); }
+ }
+
+ //if (bodyR.Contains(x, y))
+ if (InRectangle(bodyR, x, y))
+ {
+ hit.type = HitDownSquare.Body;
+ hit.index = idx;
+ hit.itemX = item.ClientRectangle.X;
+ hit.itemY = item.ClientRectangle.Y;
+ return hit;
+ }
+ }
+
+ return HitTestInfo.Nowhere;
+ }
+
+ public void RemoveItem()
+ {
+ if (m_SelectIndex == -1) { return; }
+ this.Items.RemoveAt(m_SelectIndex);
+ if (this.Items.Count == 0) { m_SelectIndex = -1; }
+ else if (m_SelectIndex >= this.Items.Count) { m_SelectIndex = this.Items.Count - 1; }
+ Invalidate();
+ }
+
+ public DesignItem SelectItem(string name)
+ {
+ for (int i = 0; i < Items.Count; i++)
+ {
+ if(Items[i].Name == name)
+ {
+ m_SelectIndex = i;
+ Invalidate();
+ return CurrentItem;
+ }
+ }
+
+ return null;
+ }
+
+ public void BringItemToFront()
+ {
+ if (m_SelectIndex == -1 || Items.Count == 1) { return; }
+ DesignItem item = CurrentItem;
+ Items.Remove(item);
+ Items.Add(item);
+ m_SelectIndex = Items.Count - 1;
+ Invalidate();
+ }
+
+ public void SendItemToBack()
+ {
+ if (m_SelectIndex == -1 || Items.Count == 1) { return; }
+ DesignItem item = CurrentItem;
+ Items.Remove(item);
+ Items.Insert(item, 0);
+ m_SelectIndex = 0;
+ Invalidate();
+ }
+
+ #endregion
+ }
+}
diff --git a/HotelPms.Share.Windows/Component/FocusInfo.cs b/HotelPms.Share.Windows/Component/FocusInfo.cs
new file mode 100644
index 0000000..6a29dee
--- /dev/null
+++ b/HotelPms.Share.Windows/Component/FocusInfo.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace HotelPms.Share.Windows.Component
+{
+ public class FocusInfo
+ {
+ private Control activeControl = null;
+ private Dictionary<DataGridViewEx, GridSelInfo> grid = new Dictionary<DataGridViewEx, GridSelInfo>();
+
+ public Control ActiveControl
+ {
+ get { return activeControl; }
+ set { activeControl = value; }
+ }
+
+ public Dictionary<DataGridViewEx, GridSelInfo> Grid
+ {
+ get { return grid; }
+ set { grid = value; }
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/Component/FunctionKeyBar.cs b/HotelPms.Share.Windows/Component/FunctionKeyBar.cs
new file mode 100644
index 0000000..d1b6a4d
--- /dev/null
+++ b/HotelPms.Share.Windows/Component/FunctionKeyBar.cs
@@ -0,0 +1,210 @@
+using System.Windows.Forms;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+
+namespace HotelPms.Share.Windows.Component
+{
+ public partial class FunctionKeyBar : System.Windows.Forms.Control
+ {
+ private float m_Split = 5;
+ StringFormat format = new StringFormat();
+ RectangleF[] cellsRectTitle = new RectangleF[12];
+ RectangleF[] cellsRectKey = new RectangleF[12];
+ private string[] m_KeyContext = new string[] { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty,
+ string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty};
+
+ /// <summary>
+ /// F1の機能名
+ /// </summary>
+ public string KeyContextF01
+ {
+ set { m_KeyContext[0] = value; Invalidate(); }
+ get { return m_KeyContext[0]; }
+ }
+
+ /// <summary>
+ /// F2の機能名
+ /// </summary>
+ public string KeyContextF02
+ {
+ set { m_KeyContext[1] = value; Invalidate(); }
+ get { return m_KeyContext[1]; }
+ }
+
+ /// <summary>
+ /// F3の機能名
+ /// </summary>
+ public string KeyContextF03
+ {
+ set { m_KeyContext[2] = value; Invalidate(); }
+ get { return m_KeyContext[2]; }
+ }
+
+ /// <summary>
+ /// F4の機能名
+ /// </summary>
+ public string KeyContextF04
+ {
+ set { m_KeyContext[3] = value; Invalidate(); }
+ get { return m_KeyContext[3]; }
+ }
+
+ /// <summary>
+ /// F5の機能名
+ /// </summary>
+ public string KeyContextF05
+ {
+ set { m_KeyContext[4] = value; Invalidate(); }
+ get { return m_KeyContext[4]; }
+ }
+
+ /// <summary>
+ /// F6の機能名
+ /// </summary>
+ public string KeyContextF06
+ {
+ set { m_KeyContext[5] = value; Invalidate(); }
+ get { return m_KeyContext[5]; }
+ }
+
+ /// <summary>
+ /// F7の機能名
+ /// </summary>
+ public string KeyContextF07
+ {
+ set { m_KeyContext[6] = value; Invalidate(); }
+ get { return m_KeyContext[6]; }
+ }
+
+ /// <summary>
+ /// F8の機能名
+ /// </summary>
+ public string KeyContextF08
+ {
+ set { m_KeyContext[7] = value; Invalidate(); }
+ get { return m_KeyContext[7]; }
+ }
+
+ /// <summary>
+ /// F9の機能名
+ /// </summary>
+ public string KeyContextF09
+ {
+ set { m_KeyContext[8] = value; Invalidate(); }
+ get { return m_KeyContext[8]; }
+ }
+
+ /// <summary>
+ /// F10の機能名
+ /// </summary>
+ public string KeyContextF10
+ {
+ set { m_KeyContext[9] = value; Invalidate(); }
+ get { return m_KeyContext[9]; }
+ }
+
+ /// <summary>
+ /// F11の機能名
+ /// </summary>
+ public string KeyContextF11
+ {
+ set { m_KeyContext[10] = value; Invalidate(); }
+ get { return m_KeyContext[10]; }
+ }
+
+ /// <summary>
+ /// F12の機能名
+ /// </summary>
+ public string KeyContextF12
+ {
+ set { m_KeyContext[11] = value; Invalidate(); }
+ get { return m_KeyContext[11]; }
+ }
+
+ private Color m_CaptionBeginColor = Color.Maroon;
+
+ public Color CaptionBeginColor
+ {
+ get { return m_CaptionBeginColor; }
+ set { m_CaptionBeginColor = value; Invalidate(); }
+ }
+
+ private Color m_CaptionEndColor = Color.Gold;
+
+ public Color CaptionEndColor
+ {
+ get { return m_CaptionEndColor; }
+ set { m_CaptionEndColor = value; Invalidate(); }
+ }
+
+
+ public FunctionKeyBar()
+ {
+ SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.Opaque | ControlStyles.UserPaint | ControlStyles.DoubleBuffer | ControlStyles.Selectable | ControlStyles.UserMouse, true);
+ format.Alignment = StringAlignment.Center;
+ format.LineAlignment = StringAlignment.Center;
+ }
+
+ protected override void OnPaint(PaintEventArgs e)
+ {
+ float width = (float)(this.Width - this.Padding.Left - this.Padding.Right - 2 * m_Split);
+ float height = (float)(this.Height - this.Padding.Top - this.Padding.Bottom);
+
+ float cellWidth = width / 12F;
+ float cellHeight = height / 2F;
+
+ float x = this.Padding.Left;
+ for (int i = 0; i < 12; i++)
+ {
+ //上
+ cellsRectTitle[i] = new RectangleF(new PointF(x, this.Padding.Top), new SizeF(cellWidth, cellHeight));
+
+ //下
+ cellsRectKey[i] = new RectangleF(new PointF(x, this.Padding.Top + cellHeight), new SizeF(cellWidth, cellHeight));
+
+ x += cellWidth;
+ if ((i + 1) % 4 == 0) { x += m_Split; }
+ }
+
+ e.Graphics.FillRectangle(new SolidBrush(this.BackColor), 0, 0, this.Width, this.Height);
+ //e.Graphics.FillRectangles(Brushes.Maroon, cellsRectTitle);
+
+ for (int i = 0; i < 12; i++)
+ {
+ using (LinearGradientBrush brush = new LinearGradientBrush(cellsRectTitle[i], m_CaptionBeginColor, m_CaptionEndColor, LinearGradientMode.Vertical))
+ {
+ brush.SetSigmaBellShape(0.4f, 0.45f); //创建基于钟形曲线的渐变过渡过程。
+ e.Graphics.FillRectangle(brush, cellsRectTitle[i]);
+ }
+ }
+
+ e.Graphics.DrawRectangles(System.Drawing.Pens.Black, cellsRectTitle);
+
+ for (int i = 0; i < 12; i++)
+ {
+ string key = string.Format("F{0}", i + 1);
+ e.Graphics.DrawString(key, this.Font, Brushes.White, cellsRectTitle[i], format);
+
+ if (m_KeyContext[i].Length > 0)
+ {
+ using (LinearGradientBrush brush = new LinearGradientBrush(cellsRectKey[i], Color.FromArgb(50, 169, 200), Color.FromArgb(0, 109, 189), LinearGradientMode.Vertical))
+ {
+
+ brush.SetSigmaBellShape(0.4f, 0.45f); //创建基于钟形曲线的渐变过渡过程。
+ e.Graphics.FillRectangle(brush, cellsRectKey[i]);
+ }
+ }
+ else
+ {
+ e.Graphics.FillRectangle(new SolidBrush((m_KeyContext[i].Length > 0) ? Color.FromArgb(0, 109, 189) : this.BackColor), cellsRectKey[i].X, cellsRectKey[i].Y, cellsRectKey[i].Width, cellsRectKey[i].Height);
+ }
+ e.Graphics.DrawRectangle(System.Drawing.Pens.Black, cellsRectKey[i].X, cellsRectKey[i].Y, cellsRectKey[i].Width, cellsRectKey[i].Height);
+ if (m_KeyContext[i].Length > 0) { e.Graphics.DrawString(m_KeyContext[i], this.Font, Brushes.Yellow, cellsRectKey[i], format); }
+ }
+
+
+ base.OnPaint(e);
+ }
+
+ }
+}
diff --git a/HotelPms.Share.Windows/Component/GlassButton.cs b/HotelPms.Share.Windows/Component/GlassButton.cs
new file mode 100644
index 0000000..874eaed
--- /dev/null
+++ b/HotelPms.Share.Windows/Component/GlassButton.cs
@@ -0,0 +1,845 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+using System.Drawing.Drawing2D;
+using System.Drawing.Text;
+using PushButtonState = System.Windows.Forms.VisualStyles.PushButtonState;
+
+namespace HotelPms.Share.Windows.Component
+{
+ /// <summary>
+ /// Represents a glass button control.
+ /// </summary>
+ [ToolboxBitmap(typeof(GlassButton)), ToolboxItem(true), ToolboxItemFilter("System.Windows.Forms"), Description("Raises an event when the user clicks it.")]
+ public partial class GlassButton : Button
+ {
+ #region " Constructors "
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="Glass.GlassButton" /> class.
+ /// </summary>
+ public GlassButton()
+ {
+ InitializeComponent();
+ timer.Interval = animationLength / framesCount;
+ base.BackColor = Color.Transparent;
+ BackColor = Color.Black;
+ ForeColor = Color.White;
+ OuterBorderColor = Color.White;
+ InnerBorderColor = Color.Black;
+ ShineColor = Color.White;
+ GlowColor = Color.FromArgb(-7488001);//unchecked((int)(0xFF8DBDFF)));
+ SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor | ControlStyles.UserPaint, true);
+ SetStyle(ControlStyles.Opaque, false);
+ }
+
+ #endregion
+
+ #region " Fields and Properties "
+
+ private Color backColor;
+ /// <summary>
+ /// Gets or sets the background color of the control.
+ /// </summary>
+ /// <returns>A <see cref="T:System.Drawing.Color" /> value representing the background color.</returns>
+ [DefaultValue(typeof(Color), "Black")]
+ public virtual new Color BackColor
+ {
+ get { return backColor; }
+ set
+ {
+ if (!backColor.Equals(value))
+ {
+ backColor = value;
+ UseVisualStyleBackColor = false;
+ CreateFrames();
+ OnBackColorChanged(EventArgs.Empty);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the foreground color of the control.
+ /// </summary>
+ /// <returns>The foreground <see cref="T:System.Drawing.Color" /> of the control.</returns>
+ [DefaultValue(typeof(Color), "White")]
+ public virtual new Color ForeColor
+ {
+ get { return base.ForeColor; }
+ set
+ {
+ base.ForeColor = value;
+ }
+ }
+
+ private Color innerBorderColor;
+ /// <summary>
+ /// Gets or sets the inner border color of the control.
+ /// </summary>
+ /// <returns>A <see cref="T:System.Drawing.Color" /> value representing the color of the inner border.</returns>
+ [DefaultValue(typeof(Color), "Black"), Category("Appearance"), Description("The inner border color of the control.")]
+ public virtual Color InnerBorderColor
+ {
+ get { return innerBorderColor; }
+ set
+ {
+ if (innerBorderColor != value)
+ {
+ innerBorderColor = value;
+ CreateFrames();
+ if (IsHandleCreated)
+ {
+ Invalidate();
+ }
+ OnInnerBorderColorChanged(EventArgs.Empty);
+ }
+ }
+ }
+
+ private Color outerBorderColor;
+ /// <summary>
+ /// Gets or sets the outer border color of the control.
+ /// </summary>
+ /// <returns>A <see cref="T:System.Drawing.Color" /> value representing the color of the outer border.</returns>
+ [DefaultValue(typeof(Color), "White"), Category("Appearance"), Description("The outer border color of the control.")]
+ public virtual Color OuterBorderColor
+ {
+ get { return outerBorderColor; }
+ set
+ {
+ if (outerBorderColor != value)
+ {
+ outerBorderColor = value;
+ CreateFrames();
+ if (IsHandleCreated)
+ {
+ Invalidate();
+ }
+ OnOuterBorderColorChanged(EventArgs.Empty);
+ }
+ }
+ }
+
+ private Color shineColor;
+ /// <summary>
+ /// Gets or sets the shine color of the control.
+ /// </summary>
+ /// <returns>A <see cref="T:System.Drawing.Color" /> value representing the shine color.</returns>
+ [DefaultValue(typeof(Color), "White"), Category("Appearance"), Description("The shine color of the control.")]
+ public virtual Color ShineColor
+ {
+ get { return shineColor; }
+ set
+ {
+ if (shineColor != value)
+ {
+ shineColor = value;
+ CreateFrames();
+ if (IsHandleCreated)
+ {
+ Invalidate();
+ }
+ OnShineColorChanged(EventArgs.Empty);
+ }
+ }
+ }
+
+ private Color glowColor;
+ /// <summary>
+ /// Gets or sets the glow color of the control.
+ /// </summary>
+ /// <returns>A <see cref="T:System.Drawing.Color" /> value representing the glow color.</returns>
+ [DefaultValue(typeof(Color), "255,141,189,255"), Category("Appearance"), Description("The glow color of the control.")]
+ public virtual Color GlowColor
+ {
+ get { return glowColor; }
+ set
+ {
+ if (glowColor != value)
+ {
+ glowColor = value;
+ CreateFrames();
+ if (IsHandleCreated)
+ {
+ Invalidate();
+ }
+ OnGlowColorChanged(EventArgs.Empty);
+ }
+ }
+ }
+
+ private bool isHovered;
+ private bool isFocused;
+ private bool isFocusedByKey;
+ private bool isKeyDown;
+ private bool isMouseDown;
+ private bool isPressed { get { return isKeyDown || (isMouseDown && isHovered); } }
+
+ /// <summary>
+ /// Gets the state of the button control.
+ /// </summary>
+ /// <value>The state of the button control.</value>
+ [Browsable(false)]
+ public PushButtonState State
+ {
+ get
+ {
+ if (!Enabled)
+ {
+ return PushButtonState.Disabled;
+ }
+ if (isPressed)
+ {
+ return PushButtonState.Pressed;
+ }
+ if (isHovered)
+ {
+ return PushButtonState.Hot;
+ }
+ if (isFocused || IsDefault)
+ {
+ return PushButtonState.Default;
+ }
+ return PushButtonState.Normal;
+ }
+ }
+
+ #endregion
+
+ #region " Events "
+
+ /// <summary>Occurs when the value of the <see cref="P:Glass.GlassButton.InnerBorderColor" /> property changes.</summary>
+ [Description("Event raised when the value of the InnerBorderColor property is changed."), Category("Property Changed")]
+ public event EventHandler InnerBorderColorChanged;
+
+ /// <summary>
+ /// Raises the <see cref="E:Glass.GlassButton.InnerBorderColorChanged" /> event.
+ /// </summary>
+ /// <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param>
+ protected virtual void OnInnerBorderColorChanged(EventArgs e)
+ {
+ if (InnerBorderColorChanged != null)
+ {
+ InnerBorderColorChanged(this, e);
+ }
+ }
+
+ /// <summary>Occurs when the value of the <see cref="P:Glass.GlassButton.OuterBorderColor" /> property changes.</summary>
+ [Description("Event raised when the value of the OuterBorderColor property is changed."), Category("Property Changed")]
+ public event EventHandler OuterBorderColorChanged;
+
+ /// <summary>
+ /// Raises the <see cref="E:Glass.GlassButton.OuterBorderColorChanged" /> event.
+ /// </summary>
+ /// <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param>
+ protected virtual void OnOuterBorderColorChanged(EventArgs e)
+ {
+ if (OuterBorderColorChanged != null)
+ {
+ OuterBorderColorChanged(this, e);
+ }
+ }
+
+ /// <summary>Occurs when the value of the <see cref="P:Glass.GlassButton.ShineColor" /> property changes.</summary>
+ [Description("Event raised when the value of the ShineColor property is changed."), Category("Property Changed")]
+ public event EventHandler ShineColorChanged;
+
+ /// <summary>
+ /// Raises the <see cref="E:Glass.GlassButton.ShineColorChanged" /> event.
+ /// </summary>
+ /// <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param>
+ protected virtual void OnShineColorChanged(EventArgs e)
+ {
+ if (ShineColorChanged != null)
+ {
+ ShineColorChanged(this, e);
+ }
+ }
+
+ /// <summary>Occurs when the value of the <see cref="P:Glass.GlassButton.GlowColor" /> property changes.</summary>
+ [Description("Event raised when the value of the GlowColor property is changed."), Category("Property Changed")]
+ public event EventHandler GlowColorChanged;
+
+ /// <summary>
+ /// Raises the <see cref="E:Glass.GlassButton.GlowColorChanged" /> event.
+ /// </summary>
+ /// <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param>
+ protected virtual void OnGlowColorChanged(EventArgs e)
+ {
+ if (GlowColorChanged != null)
+ {
+ InnerBorderColorChanged(this, e);
+ }
+ }
+
+ #endregion
+
+ #region " Overrided Methods "
+
+ /// <summary>
+ /// Raises the <see cref="E:System.Windows.Forms.Control.SizeChanged" /> event.
+ /// </summary>
+ /// <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param>
+ protected override void OnSizeChanged(EventArgs e)
+ {
+ CreateFrames();
+ base.OnSizeChanged(e);
+ }
+
+ /// <summary>
+ /// Raises the <see cref="E:System.Windows.Forms.Control.Click" /> event.
+ /// </summary>
+ /// <param name="e">The <see cref="System.EventArgs" /> instance containing the event data.</param>
+ protected override void OnClick(EventArgs e)
+ {
+ isKeyDown = isMouseDown = false;
+ base.OnClick(e);
+ }
+
+ /// <summary>
+ /// Raises the <see cref="E:System.Windows.Forms.Control.Enter" /> event.
+ /// </summary>
+ /// <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param>
+ protected override void OnEnter(EventArgs e)
+ {
+ isFocused = isFocusedByKey = true;
+ base.OnEnter(e);
+ }
+
+ /// <summary>
+ /// Raises the <see cref="E:System.Windows.Forms.Control.Leave" /> event.
+ /// </summary>
+ /// <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param>
+ protected override void OnLeave(EventArgs e)
+ {
+ base.OnLeave(e);
+ isFocused = isFocusedByKey = isKeyDown = isMouseDown = false;
+ Invalidate();
+ }
+
+ /// <summary>
+ /// Raises the <see cref="M:System.Windows.Forms.ButtonBase.OnKeyUp(System.Windows.Forms.KeyEventArgs)" /> event.
+ /// </summary>
+ /// <param name="kevent">A <see cref="T:System.Windows.Forms.KeyEventArgs" /> that contains the event data.</param>
+ protected override void OnKeyDown(KeyEventArgs kevent)
+ {
+ if (kevent.KeyCode == Keys.Space)
+ {
+ isKeyDown = true;
+ Invalidate();
+ }
+ base.OnKeyDown(kevent);
+ }
+
+ /// <summary>
+ /// Raises the <see cref="M:System.Windows.Forms.ButtonBase.OnKeyUp(System.Windows.Forms.KeyEventArgs)" /> event.
+ /// </summary>
+ /// <param name="kevent">A <see cref="T:System.Windows.Forms.KeyEventArgs" /> that contains the event data.</param>
+ protected override void OnKeyUp(KeyEventArgs kevent)
+ {
+ if (isKeyDown && kevent.KeyCode == Keys.Space)
+ {
+ isKeyDown = false;
+ Invalidate();
+ }
+ base.OnKeyUp(kevent);
+ }
+
+ /// <summary>
+ /// Raises the <see cref="E:System.Windows.Forms.Control.MouseDown" /> event.
+ /// </summary>
+ /// <param name="e">A <see cref="T:System.Windows.Forms.MouseEventArgs" /> that contains the event data.</param>
+ protected override void OnMouseDown(MouseEventArgs e)
+ {
+ if (!isMouseDown && e.Button == MouseButtons.Left)
+ {
+ isMouseDown = true;
+ isFocusedByKey = false;
+ Invalidate();
+ }
+ base.OnMouseDown(e);
+ }
+
+ /// <summary>
+ /// Raises the <see cref="E:System.Windows.Forms.Control.MouseUp" /> event.
+ /// </summary>
+ /// <param name="e">A <see cref="T:System.Windows.Forms.MouseEventArgs" /> that contains the event data.</param>
+ protected override void OnMouseUp(MouseEventArgs e)
+ {
+ if (isMouseDown)
+ {
+ isMouseDown = false;
+ Invalidate();
+ }
+ base.OnMouseUp(e);
+ }
+
+ /// <summary>
+ /// Raises the <see cref="M:System.Windows.Forms.Control.OnMouseMove(System.Windows.Forms.MouseEventArgs)" /> event.
+ /// </summary>
+ /// <param name="mevent">A <see cref="T:System.Windows.Forms.MouseEventArgs" /> that contains the event data.</param>
+ protected override void OnMouseMove(MouseEventArgs mevent)
+ {
+ base.OnMouseMove(mevent);
+ if (mevent.Button != MouseButtons.None)
+ {
+ if (!ClientRectangle.Contains(mevent.X, mevent.Y))
+ {
+ if (isHovered)
+ {
+ isHovered = false;
+ Invalidate();
+ }
+ }
+ else if (!isHovered)
+ {
+ isHovered = true;
+ Invalidate();
+ }
+ }
+ }
+
+ /// <summary>
+ /// Raises the <see cref="E:System.Windows.Forms.Control.MouseEnter" /> event.
+ /// </summary>
+ /// <param name="e">The <see cref="System.EventArgs" /> instance containing the event data.</param>
+ protected override void OnMouseEnter(EventArgs e)
+ {
+ isHovered = true;
+ FadeIn();
+ Invalidate();
+ base.OnMouseEnter(e);
+ }
+
+ /// <summary>
+ /// Raises the <see cref="E:System.Windows.Forms.Control.MouseLeave" /> event.
+ /// </summary>
+ /// <param name="e">The <see cref="System.EventArgs" /> instance containing the event data.</param>
+ protected override void OnMouseLeave(EventArgs e)
+ {
+ isHovered = false;
+ FadeOut();
+ Invalidate();
+ base.OnMouseLeave(e);
+ }
+
+ #endregion
+
+ #region " Painting "
+
+ /// <summary>
+ /// Raises the <see cref="M:System.Windows.Forms.ButtonBase.OnPaint(System.Windows.Forms.PaintEventArgs)" /> event.
+ /// </summary>
+ /// <param name="pevent">A <see cref="T:System.Windows.Forms.PaintEventArgs" /> that contains the event data.</param>
+ protected override void OnPaint(PaintEventArgs pevent)
+ {
+ DrawButtonBackgroundFromBuffer(pevent.Graphics);
+ DrawForegroundFromButton(pevent);
+ DrawButtonForeground(pevent.Graphics);
+ }
+
+ private void DrawButtonBackgroundFromBuffer(Graphics graphics)
+ {
+ int frame;
+ if (!Enabled)
+ {
+ frame = FRAME_DISABLED;
+ }
+ else if (isPressed)
+ {
+ frame = FRAME_PRESSED;
+ }
+ else if (!isAnimating && currentFrame == 0)
+ {
+ frame = FRAME_NORMAL;
+ }
+ else
+ {
+ if (!HasAnimationFrames)
+ {
+ CreateFrames(true);
+ }
+ frame = FRAME_ANIMATED + currentFrame;
+ }
+ if (frames == null)
+ {
+ CreateFrames();
+ }
+ graphics.DrawImage(frames[frame], Point.Empty);
+ }
+
+ public Image CreateBackgroundFrame(bool pressed, bool hovered,
+ bool animating, bool enabled, float glowOpacity)
+ {
+ Rectangle rect = ClientRectangle;
+ if (rect.Width <= 0)
+ {
+ rect.Width = 1;
+ }
+ if (rect.Height <= 0)
+ {
+ rect.Height = 1;
+ }
+ Image img = new Bitmap(rect.Width, rect.Height);
+ using (Graphics g = Graphics.FromImage(img))
+ {
+ g.Clear(Color.Transparent);
+ DrawButtonBackground(g, rect, pressed, hovered, animating, enabled,
+ outerBorderColor, backColor, glowColor, shineColor, innerBorderColor,
+ glowOpacity);
+ }
+ return img;
+ }
+
+ private static void DrawButtonBackground(Graphics g, Rectangle rectangle,
+ bool pressed, bool hovered, bool animating, bool enabled,
+ Color outerBorderColor, Color backColor, Color glowColor, Color shineColor,
+ Color innerBorderColor, float glowOpacity)
+ {
+ SmoothingMode sm = g.SmoothingMode;
+ g.SmoothingMode = SmoothingMode.AntiAlias;
+
+ #region " white border "
+ Rectangle rect = rectangle;
+ rect.Width--;
+ rect.Height--;
+ using (GraphicsPath bw = CreateRoundRectangle(rect, 4))
+ {
+ using (Pen p = new Pen(outerBorderColor))
+ {
+ g.DrawPath(p, bw);
+ }
+ }
+ #endregion
+
+ rect.X++;
+ rect.Y++;
+ rect.Width -= 2;
+ rect.Height -= 2;
+ Rectangle rect2 = rect;
+ rect2.Height >>= 1;
+
+ #region " content "
+ using (GraphicsPath bb = CreateRoundRectangle(rect, 2))
+ {
+ int opacity = pressed ? 0xcc : 0x7f;
+ using (Brush br = new SolidBrush(Color.FromArgb(opacity, backColor)))
+ {
+ g.FillPath(br, bb);
+ }
+ }
+ #endregion
+
+ #region " glow "
+ if ((hovered || animating) && !pressed)
+ {
+ using (GraphicsPath clip = CreateRoundRectangle(rect, 2))
+ {
+ g.SetClip(clip, CombineMode.Intersect);
+ using (GraphicsPath brad = CreateBottomRadialPath(rect))
+ {
+ using (PathGradientBrush pgr = new PathGradientBrush(brad))
+ {
+ unchecked
+ {
+ int opacity = (int)(0xB2 * glowOpacity + .5f);
+ RectangleF bounds = brad.GetBounds();
+ pgr.CenterPoint = new PointF((bounds.Left + bounds.Right) / 2f, (bounds.Top + bounds.Bottom) / 2f);
+ pgr.CenterColor = Color.FromArgb(opacity, glowColor);
+ pgr.SurroundColors = new Color[] { Color.FromArgb(0, glowColor) };
+ }
+ g.FillPath(pgr, brad);
+ }
+ }
+ g.ResetClip();
+ }
+ }
+ #endregion
+
+ #region " shine "
+ if (rect2.Width > 0 && rect2.Height > 0)
+ {
+ rect2.Height++;
+ using (GraphicsPath bh = CreateTopRoundRectangle(rect2, 2))
+ {
+ rect2.Height++;
+ int opacity = 0x99;
+ if (pressed | !enabled)
+ {
+ opacity = (int)(.4f * opacity + .5f);
+ }
+ using (LinearGradientBrush br = new LinearGradientBrush(rect2, Color.FromArgb(opacity, shineColor), Color.FromArgb(opacity / 3, shineColor), LinearGradientMode.Vertical))
+ {
+ g.FillPath(br, bh);
+ }
+ }
+ rect2.Height -= 2;
+ }
+ #endregion
+
+ #region " black border "
+ using (GraphicsPath bb = CreateRoundRectangle(rect, 3))
+ {
+ using (Pen p = new Pen(innerBorderColor))
+ {
+ g.DrawPath(p, bb);
+ }
+ }
+ #endregion
+
+ g.SmoothingMode = sm;
+ }
+
+ private void DrawButtonForeground(Graphics g)
+ {
+ if (Focused && ShowFocusCues)
+ {
+ Rectangle rect = ClientRectangle;
+ rect.Inflate(-4, -4);
+ ControlPaint.DrawFocusRectangle(g, rect);
+ }
+ }
+
+ private Button imageButton;
+ private void DrawForegroundFromButton(PaintEventArgs pevent)
+ {
+ if (imageButton == null)
+ {
+ imageButton = new Button();
+ imageButton.Parent = new TransparentControl();
+ imageButton.BackColor = Color.Transparent;
+ imageButton.FlatAppearance.BorderSize = 0;
+ imageButton.FlatStyle = FlatStyle.Flat;
+ }
+ imageButton.AutoEllipsis = AutoEllipsis;
+ if (Enabled)
+ {
+ imageButton.ForeColor = ForeColor;
+ }
+ else
+ {
+ imageButton.ForeColor = Color.FromArgb((3*ForeColor.R + backColor.R) >> 2,
+ (3*ForeColor.G + backColor.G) >> 2,
+ (3*ForeColor.B + backColor.B) >> 2);
+ }
+ imageButton.Font = Font;
+ imageButton.RightToLeft = RightToLeft;
+ imageButton.Image = Image;
+ imageButton.ImageAlign = ImageAlign;
+ imageButton.ImageIndex = ImageIndex;
+ imageButton.ImageKey = ImageKey;
+ imageButton.ImageList = ImageList;
+ imageButton.Padding = Padding;
+ imageButton.Size = Size;
+ imageButton.Text = Text;
+ imageButton.TextAlign = TextAlign;
+ imageButton.TextImageRelation = TextImageRelation;
+ imageButton.UseCompatibleTextRendering = UseCompatibleTextRendering;
+ imageButton.UseMnemonic = UseMnemonic;
+ InvokePaint(imageButton, pevent);
+ }
+
+ class TransparentControl : Control
+ {
+ protected override void OnPaintBackground(PaintEventArgs pevent) { }
+ protected override void OnPaint(PaintEventArgs e) { }
+ }
+
+ private static GraphicsPath CreateRoundRectangle(Rectangle rectangle, int radius)
+ {
+ radius += 10;
+ GraphicsPath path = new GraphicsPath();
+ int l = rectangle.Left;
+ int t = rectangle.Top;
+ int w = rectangle.Width;
+ int h = rectangle.Height;
+ int d = radius << 1;
+ path.AddArc(l, t, d, d, 180, 90); // topleft
+ path.AddLine(l + radius, t, l + w - radius, t); // top
+ path.AddArc(l + w - d, t, d, d, 270, 90); // topright
+ path.AddLine(l + w, t + radius, l + w, t + h - radius); // right
+ path.AddArc(l + w - d, t + h - d, d, d, 0, 90); // bottomright
+ path.AddLine(l + w - radius, t + h, l + radius, t + h); // bottom
+ path.AddArc(l, t + h - d, d, d, 90, 90); // bottomleft
+ path.AddLine(l, t + h - radius, l, t + radius); // left
+ path.CloseFigure();
+ return path;
+ }
+
+ private static GraphicsPath CreateTopRoundRectangle(Rectangle rectangle, int radius)
+ {
+ radius += 10;
+ GraphicsPath path = new GraphicsPath();
+ int l = rectangle.Left;
+ int t = rectangle.Top;
+ int w = rectangle.Width;
+ int h = rectangle.Height;
+ int d = radius << 1;
+ path.AddArc(l, t, d, d, 180, 90); // topleft
+ path.AddLine(l + radius, t, l + w - radius, t); // top
+ path.AddArc(l + w - d, t, d, d, 270, 90); // topright
+ path.AddLine(l + w, t + radius, l + w, t + h); // right
+ path.AddLine(l + w, t + h, l, t + h); // bottom
+ path.AddLine(l, t + h, l, t + radius); // left
+ path.CloseFigure();
+ return path;
+ }
+
+ private static GraphicsPath CreateBottomRadialPath(Rectangle rectangle)
+ {
+ GraphicsPath path = new GraphicsPath();
+ RectangleF rect = rectangle;
+ rect.X -= rect.Width * .35f;
+ rect.Y -= rect.Height * .15f;
+ rect.Width *= 1.7f;
+ rect.Height *= 2.3f;
+ path.AddEllipse(rect);
+ path.CloseFigure();
+ return path;
+ }
+
+ #endregion
+
+ #region " Unused Properties & Events "
+
+ /// <summary>This property is not relevant for this class.</summary>
+ /// <returns>This property is not relevant for this class.</returns>
+ [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), EditorBrowsable(EditorBrowsableState.Never)]
+ public new FlatButtonAppearance FlatAppearance
+ {
+ get { return base.FlatAppearance; }
+ }
+
+ /// <summary>This property is not relevant for this class.</summary>
+ /// <returns>This property is not relevant for this class.</returns>
+ [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), EditorBrowsable(EditorBrowsableState.Never)]
+ public new FlatStyle FlatStyle
+ {
+ get { return base.FlatStyle; }
+ set { base.FlatStyle = value; }
+ }
+
+ /// <summary>This property is not relevant for this class.</summary>
+ /// <returns>This property is not relevant for this class.</returns>
+ [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), EditorBrowsable(EditorBrowsableState.Never)]
+ public new bool UseVisualStyleBackColor
+ {
+ get { return base.UseVisualStyleBackColor; }
+ set { base.UseVisualStyleBackColor = value; }
+ }
+
+ #endregion
+
+ #region " Animation Support "
+
+ private List<Image> frames;
+
+ private const int FRAME_DISABLED = 0;
+ private const int FRAME_PRESSED = 1;
+ private const int FRAME_NORMAL = 2;
+ private const int FRAME_ANIMATED = 3;
+
+ private bool HasAnimationFrames
+ {
+ get
+ {
+ return frames != null && frames.Count > FRAME_ANIMATED;
+ }
+ }
+
+ private void CreateFrames()
+ {
+ CreateFrames(false);
+ }
+
+ private void CreateFrames(bool withAnimationFrames)
+ {
+ DestroyFrames();
+ if (!IsHandleCreated)
+ {
+ return;
+ }
+ if (frames == null)
+ {
+ frames = new List<Image>();
+ }
+ frames.Add(CreateBackgroundFrame(false, false, false, false, 0));
+ frames.Add(CreateBackgroundFrame(true, true, false, true, 0));
+ frames.Add(CreateBackgroundFrame(false, false, false, true, 0));
+ if (!withAnimationFrames)
+ {
+ return;
+ }
+ for (int i = 0; i < framesCount; i++)
+ {
+ frames.Add(CreateBackgroundFrame(false, true, true, true, (float)i / (framesCount - 1F)));
+ }
+ }
+
+ private void DestroyFrames()
+ {
+ if (frames != null)
+ {
+ while (frames.Count > 0)
+ {
+ frames[frames.Count - 1].Dispose();
+ frames.RemoveAt(frames.Count - 1);
+ }
+ }
+ }
+
+ private const int animationLength = 300;
+ private const int framesCount = 10;
+ private int currentFrame;
+ private int direction;
+
+ private bool isAnimating
+ {
+ get
+ {
+ return direction != 0;
+ }
+ }
+
+ private void FadeIn()
+ {
+ direction = 1;
+ timer.Enabled = true;
+ }
+
+ private void FadeOut()
+ {
+ direction = -1;
+ timer.Enabled = true;
+ }
+
+ private void timer_Tick(object sender, EventArgs e)
+ {
+ if (!timer.Enabled)
+ {
+ return;
+ }
+ Refresh();
+ currentFrame += direction;
+ if (currentFrame == -1)
+ {
+ currentFrame = 0;
+ timer.Enabled = false;
+ direction = 0;
+ return;
+ }
+ if (currentFrame == framesCount)
+ {
+ currentFrame = framesCount - 1;
+ timer.Enabled = false;
+ direction = 0;
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/HotelPms.Share.Windows/Component/GlassButton.designer.cs b/HotelPms.Share.Windows/Component/GlassButton.designer.cs
new file mode 100644
index 0000000..ab78df9
--- /dev/null
+++ b/HotelPms.Share.Windows/Component/GlassButton.designer.cs
@@ -0,0 +1,57 @@
+namespace HotelPms.Share.Windows.Component
+{
+ partial class GlassButton
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ if (imageButton != null)
+ {
+ imageButton.Parent.Dispose();
+ imageButton.Parent = null;
+ imageButton.Dispose();
+ imageButton = null;
+ }
+ DestroyFrames();
+ if (components != null)
+ {
+ components.Dispose();
+ }
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Component Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.components = new System.ComponentModel.Container();
+ this.timer = new System.Windows.Forms.Timer(this.components);
+ this.SuspendLayout();
+ //
+ // timer
+ //
+ this.timer.Tick += new System.EventHandler(this.timer_Tick);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Timer timer;
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.Share.Windows/Component/GradientLabel.cs b/HotelPms.Share.Windows/Component/GradientLabel.cs
new file mode 100644
index 0000000..1a45c06
--- /dev/null
+++ b/HotelPms.Share.Windows/Component/GradientLabel.cs
@@ -0,0 +1,43 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+
+namespace HotelPms.Share.Windows.Component
+{
+ public class GradientLabel : Label
+ {
+ private LinearGradientMode m_GradientMode = LinearGradientMode.Horizontal;
+ [Description("EndBackColor"), Category("CTextBoxArray動作")]
+ public LinearGradientMode GradientMode
+ {
+ get { return m_GradientMode; }
+ set { m_GradientMode = value; this.Invalidate(); }
+ }
+
+
+ private Color m_EndBackColor = Color.FromArgb(120, 150, 150);
+
+ [Description("EndBackColor"), Category("CTextBoxArray動作")]
+ public Color EndBackColor
+ {
+ get { return m_EndBackColor; }
+ set { m_EndBackColor = value; this.Invalidate(); }
+ }
+
+ protected override void OnPaintBackground(PaintEventArgs pevent)
+ {
+ base.OnPaintBackground(pevent);
+
+ //BackColor Color.FromArgb(0, 64, 64)
+ using (LinearGradientBrush brush = new LinearGradientBrush(this.ClientRectangle, BackColor, m_EndBackColor, m_GradientMode))
+ {
+ pevent.Graphics.FillRectangle(brush, this.ClientRectangle);
+ }
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/Component/GridSelInfo.cs b/HotelPms.Share.Windows/Component/GridSelInfo.cs
new file mode 100644
index 0000000..12f9a4a
--- /dev/null
+++ b/HotelPms.Share.Windows/Component/GridSelInfo.cs
@@ -0,0 +1,25 @@
+namespace HotelPms.Share.Windows.Component
+{
+ public class GridSelInfo
+ {
+ public enum EFocusType : int
+ {
+ Defalut = 0,
+ Index,
+ Data,
+ }
+
+ /// <summary>
+ /// 0.各リスト初期時のフォーカス(Row,Col,Data無視)
+ /// 1.指定行番号でフォーカス
+ /// 2.Dataでヒットされた行でフォーカス
+ /// </summary>
+ public EFocusType FocusType { get; set; } = EFocusType.Defalut;
+
+ public int Row { get; set; } = 0;
+
+ public int Col { get; set; } = 0;
+
+ public object Data { get; set; } = null;
+ }
+}
diff --git a/HotelPms.Share.Windows/Component/IPanelEx.cs b/HotelPms.Share.Windows/Component/IPanelEx.cs
new file mode 100644
index 0000000..57f10df
--- /dev/null
+++ b/HotelPms.Share.Windows/Component/IPanelEx.cs
@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HotelPms.Share.Windows.Component
+{
+ public interface IPanelEx
+ {
+ bool PanelExEnabled { get; set; }
+ CTextBox.ETitleStyle TitleStyle { get; set; }
+ int TitleWidth { get; set; }
+ string TitleText { get; set; }
+ Font TitleFont { get; set; }
+ Color TitleForeColor { get; set; }
+ Color TitleBackColor { get; set; }
+ Color ShadowColor { get; set; }
+ Color BorderColor { get; set; }
+
+ Color BorderFocusColor { get; set; }
+ Image ForeImage { get; set; }
+ }
+}
diff --git a/HotelPms.Share.Windows/Component/ITextBoxArray.cs b/HotelPms.Share.Windows/Component/ITextBoxArray.cs
new file mode 100644
index 0000000..004a12c
--- /dev/null
+++ b/HotelPms.Share.Windows/Component/ITextBoxArray.cs
@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace HotelPms.Share.Windows.Component
+{
+ public interface ITextBoxArray
+ {
+ bool TextBoxArrayMember { get;set;}
+ bool IsChkData { get;set;}
+ bool NotNull { get;set;}
+ object DBObject { get;set;}
+ string DBFieldName { get;set;}
+ //InputStyleSelection InputStyle { get;set;}
+ //bool IsDate { get;set;}
+ //string In_Range { get;set;}
+ //bool IsPrimaryKey { get;set;}
+ //bool EnableUpDownKey { get;set;}
+ //Control MstNameCtrl { get;set;}
+ }
+}
diff --git a/HotelPms.Share.Windows/Component/LoadingPanel.cs b/HotelPms.Share.Windows/Component/LoadingPanel.cs
new file mode 100644
index 0000000..28fe7ea
--- /dev/null
+++ b/HotelPms.Share.Windows/Component/LoadingPanel.cs
@@ -0,0 +1,203 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace HotelPms.Share.Windows.Component
+{
+ /// <summary>
+ /// 透明的加载等待层
+ /// </summary>
+ [ToolboxBitmap(typeof(LoadingPanel))]
+ public class LoadingPanel : System.Windows.Forms.Control
+ {
+ /// <summary>
+ /// 是否背景透明
+ /// </summary>
+ private bool _transparentBG = true;
+ /// <summary>
+ /// 透明度
+ /// </summary>
+ private int _alpha = 125;
+
+ /// <summary>
+ /// 容器组件
+ /// </summary>
+ private System.ComponentModel.Container components = new System.ComponentModel.Container();
+
+ /// <summary>
+ /// 构造函数
+ /// </summary>
+ public LoadingPanel() : this(true) { }
+ /// <summary>
+ /// 标准构造函数
+ /// </summary>
+ /// <param name="Alpha"></param>
+ /// <param name="showLoadingImage"></param>
+ public LoadingPanel(bool showLoadingImage)
+ {
+ // | ControlStyles.OptimizedDoubleBuffer AllPaintingInWmPaint
+ SetStyle(ControlStyles.Opaque | ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true);
+
+ base.CreateControl();
+ // 显示等待的图像
+ if (showLoadingImage)
+ {
+ PictureBox pictureBox_Loading = new PictureBox();
+ //pictureBox_Loading.BackColor = System.Drawing.Color.White;
+ pictureBox_Loading.BackColor = System.Drawing.Color.Transparent;
+ //Properties.Resources.load.MakeTransparent(Properties.Resources.load.GetPixel(0, 0));
+
+ //pictureBox_Loading.SizeMode = PictureBoxSizeMode.AutoSize;
+ //Bitmap bitmap2 = new Bitmap(@"D:\Develop\Src\Cs\L2Soft\HotelPms\HotelPms.Share.Windows\Resources\load.gif");
+ //// 透過にする
+ //bitmap2.MakeTransparent(bitmap2.GetPixel(0, 0));
+ //pictureBox_Loading.Image = bitmap2;
+
+ pictureBox_Loading.Image = Properties.Resources.load;
+ pictureBox_Loading.Name = "pictureBox_Loading";
+ pictureBox_Loading.Size = new System.Drawing.Size(200, 200);
+ pictureBox_Loading.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
+ Point Location = new Point(this.Location.X + (this.Width - pictureBox_Loading.Width) / 2, this.Location.Y + (this.Height - pictureBox_Loading.Height) / 2);
+ pictureBox_Loading.Location = Location;
+ pictureBox_Loading.Anchor = AnchorStyles.None;
+ this.Controls.Add(pictureBox_Loading);
+ }
+
+
+ }
+
+ /// <summary>
+ /// 析构处理
+ /// </summary>
+ /// <param name="disposing"></param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ if (!((components == null)))
+ {
+ components.Dispose();
+ }
+ }
+ base.Dispose(disposing);
+ }
+
+ protected override void OnSizeChanged(EventArgs e)
+ {
+ this.Invalidate();
+ base.OnSizeChanged(e);
+ }
+
+ protected override void OnLocationChanged(EventArgs e)
+ {
+ this.Invalidate();
+ base.OnLocationChanged(e);
+ }
+
+ /// <summary>
+ /// 自定义绘制窗体
+ /// </summary>
+ /// <param name="e"></param>
+ protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
+ {
+ float vlblControlWidth;
+ float vlblControlHeight;
+
+ Pen labelBorderPen;
+ SolidBrush labelBackColorBrush;
+
+ if (_transparentBG)
+ {
+ Color drawColor = Color.FromArgb(this._alpha, this.BackColor);
+ labelBorderPen = new Pen(drawColor, 0);
+ labelBackColorBrush = new SolidBrush(drawColor);
+ }
+ else
+ {
+ labelBorderPen = new Pen(this.BackColor, 0);
+ labelBackColorBrush = new SolidBrush(this.BackColor);
+ }
+ vlblControlWidth = this.Size.Width;
+ vlblControlHeight = this.Size.Height;
+ //e.Graphics.DrawRectangle(labelBorderPen, 0, 0, vlblControlWidth, vlblControlHeight);
+ e.Graphics.FillRectangle(labelBackColorBrush, 0, 0, vlblControlWidth, vlblControlHeight);
+
+ //Pen b6 = new Pen(Color.FromArgb(255, 215 - 16, 227 - 11, 242 - 5));
+ //Pen b8 = new Pen(Color.FromArgb(_alpha, 215, 227 + 4, 242));
+ //Pen b7 = new Pen(Color.FromArgb(255, 215 - 22, 227 - 10, 242));
+ //GraphicsPath path = new GraphicsPath();
+ //path.AddRectangle(new Rectangle( 0, 0, this.Width, this.Height));
+ //LinearGradientBrush brocha = new LinearGradientBrush(new Point(0, 0), new Point(this.Height, this.Width), b6.Color, b8.Color);
+ //e.Graphics.FillPath(brocha, path);
+
+ base.OnPaint(e);
+ }
+ /// <summary>
+ /// 控件透明特性
+ /// </summary>
+ protected override CreateParams CreateParams
+ {
+ get
+ {
+ CreateParams cp = base.CreateParams;
+ // 开启 WS_EX_TRANSPARENT,使控件支持透明
+ cp.ExStyle |= 0x20;
+ return cp;
+ }
+ }
+ /// <summary>
+ /// 是否使用透明
+ /// </summary>
+ [Category("AlphaOpaque"), Description("是否使用透明,默认为True")]
+ public bool TransparentBG
+ {
+ get { return _transparentBG; }
+ set
+ {
+ _transparentBG = value;
+ this.Invalidate();
+ }
+ }
+ /// <summary>
+ /// 设置透明度
+ /// </summary>
+ [Category("AlphaOpaque"), Description("设置透明度")]
+ public int Alpha
+ {
+ get { return _alpha; }
+ set
+ {
+ _alpha = value;
+ this.Invalidate();
+ }
+ }
+ /// <summary>
+ /// 隐藏处理
+ /// </summary>
+ public void CloseWaiting()
+ {
+ this.BeginInvoke(new Action(() =>
+ {
+ SendToBack();
+ Hide();
+
+ }));
+ }
+ /// <summary>
+ /// 显示处理
+ /// </summary>
+ public void ShowWaiting()
+ {
+ this.BeginInvoke(new Action(() =>
+ {
+ BringToFront();
+ Show();
+ }));
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/Component/MaterialButton.cs b/HotelPms.Share.Windows/Component/MaterialButton.cs
new file mode 100644
index 0000000..657e187
--- /dev/null
+++ b/HotelPms.Share.Windows/Component/MaterialButton.cs
@@ -0,0 +1,269 @@
+using System.ComponentModel;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Drawing.Text;
+using System.Windows.Forms;
+using HotelPms.Share.Windows.Animations;
+using System;
+using System.Drawing.Imaging;
+
+namespace HotelPms.Share.Windows.Component
+{
+ public class MaterialButton : Button
+ {
+ private float radius = 10F;
+
+ /// <summary>
+ /// 半径
+ /// </summary>
+ public float Radius
+ {
+ get { return radius; }
+ set { radius = value; Invalidate(); }
+ }
+
+ private readonly AnimationManager _animationManager;
+
+ private bool m_Selected = false;
+ private bool m_MouseFocused = false;
+ private StringFormat m_StringFormat = new StringFormat();
+
+ //public event EventHandler ClickFinished;
+ public new event EventHandler Click;
+
+ public MaterialButton()
+ {
+ BackColor = Color.FromArgb(255, 0, 105, 217);
+ ForeColor = Color.White;
+ Cursor = Cursors.Hand;
+ _animationManager = new AnimationManager(false)
+ {
+ Increment = 0.03,
+ AnimationType = AnimationType.EaseOut
+ };
+ _animationManager.OnAnimationProgress += sender => Invalidate();
+ _animationManager.OnAnimationFinished += _animationManager_OnAnimationFinished;
+
+ FlatStyle = FlatStyle.Flat;
+ //AutoSizeMode = AutoSizeMode.GrowAndShrink;
+ //AutoSize = true;
+ }
+
+ private void _animationManager_OnAnimationFinished(object sender)
+ {
+ Click?.Invoke(this, new EventArgs());
+ //ClickFinished?.Invoke(this, new EventArgs());
+ }
+
+ protected override void Dispose(bool disposing)
+ {
+ m_StringFormat.Dispose();
+ base.Dispose(disposing);
+ }
+
+ public override string Text
+ {
+ get { return base.Text; }
+ set
+ {
+ base.Text = value;
+ Invalidate();
+ }
+ }
+
+ protected override void OnEnter(EventArgs e)
+ {
+ base.OnEnter(e);
+ m_Selected = true;
+ }
+
+ protected override void OnLeave(EventArgs e)
+ {
+ base.OnLeave(e);
+ m_Selected = false;
+ }
+
+ protected override void OnMouseEnter(EventArgs e)
+ {
+ base.OnMouseEnter(e);
+ m_MouseFocused = true;
+ }
+
+ protected override void OnMouseLeave(EventArgs e)
+ {
+ base.OnMouseLeave(e);
+ m_MouseFocused = false;
+ }
+
+ protected override void OnMouseUp(MouseEventArgs mevent)
+ {
+ base.OnMouseUp(mevent);
+
+ _animationManager.StartNewAnimation(AnimationDirection.In, mevent.Location);
+ }
+
+ protected override void OnPreviewKeyDown(PreviewKeyDownEventArgs e)
+ {
+ base.OnPreviewKeyDown(e);
+
+ if (e.KeyCode == Keys.Enter)
+ {
+ _animationManager.StartNewAnimation(AnimationDirection.In, new Point(Width / 2, Height / 2));
+ }
+ }
+
+ protected override void OnPaint(PaintEventArgs pevent)
+ {
+ var g = pevent.Graphics;
+ g.SmoothingMode = SmoothingMode.AntiAlias;
+
+ g.Clear(Parent.BackColor);
+
+ if (radius.CompareTo(0F) <= 0)
+ {
+ Color beginColor = m_MouseFocused ? (FlatAppearance.MouseOverBackColor == Color.Empty ? ControlPaint.Light(BackColor) : FlatAppearance.MouseOverBackColor) : m_Selected ? (FlatAppearance.MouseDownBackColor == Color.Empty ? ControlPaint.Light(BackColor) : FlatAppearance.MouseDownBackColor) : BackColor;
+ using (SolidBrush backBrush = new SolidBrush(beginColor))
+ {
+ g.FillRectangle(backBrush, ClientRectangle);
+ }
+
+ //線
+ if (this.FlatAppearance.BorderSize > 0 && !this.FlatAppearance.BorderColor.Equals(Color.Empty))
+ {
+ using (Pen pen = new Pen(this.FlatAppearance.BorderColor, this.FlatAppearance.BorderSize))
+ {
+ g.DrawRectangle(pen, ClientRectangle);
+ }
+ }
+ }
+ else
+ {
+ using (var backgroundPath = CreateRoundRect(ClientRectangle.X, ClientRectangle.Y, ClientRectangle.Width - 1, ClientRectangle.Height - 1, radius))
+ {
+ Color beginColor = m_MouseFocused ? (FlatAppearance.MouseOverBackColor == Color.Empty ? ControlPaint.Light(BackColor) : FlatAppearance.MouseOverBackColor) : m_Selected ? (FlatAppearance.MouseDownBackColor == Color.Empty ? ControlPaint.LightLight(BackColor) : FlatAppearance.MouseDownBackColor) : BackColor;
+ using (SolidBrush backBrush = new SolidBrush(beginColor))
+ {
+ g.FillPath(backBrush, backgroundPath);
+ }
+
+ //線
+ if (this.FlatAppearance.BorderSize > 0 && !this.FlatAppearance.BorderColor.Equals(Color.Empty))
+ {
+ using (Pen pen = new Pen(this.FlatAppearance.BorderColor, this.FlatAppearance.BorderSize))
+ {
+ g.DrawPath(pen, backgroundPath);
+ }
+ }
+ }
+ }
+
+ if (_animationManager.IsAnimating())
+ {
+ for (int i = 0; i < _animationManager.GetAnimationCount(); i++)
+ {
+ var animationValue = _animationManager.GetProgress(i);
+ var animationSource = _animationManager.GetSource(i);
+ using (var rippleBrush = new SolidBrush(Color.FromArgb((int)(51 - (animationValue * 50)), Color.White)))
+ {
+ var rippleSize = (int)(animationValue * Width * 2);
+ g.FillEllipse(rippleBrush, new Rectangle(animationSource.X - rippleSize / 2, animationSource.Y - rippleSize / 2, rippleSize, rippleSize));
+ }
+ }
+ }
+
+ Rectangle textR = ClientRectangle;
+ if (Image != null)
+ {
+ int x = 5;
+ float rate = 0.5F;
+ int width = (int)(ClientRectangle.Width * 0.3) - x;
+ int height = (int)(ClientRectangle.Height * rate);
+
+ //Zoom
+ if ((double)Image.Width / (double)Image.Height > (double)width / (double)height) // image is wider
+ {
+ height = (int)((double)Image.Height / (double)Image.Width * (double)width);
+ }
+ else
+ {
+ width = (int)((double)Image.Width / (double)Image.Height * (double)height);
+ }
+
+ //居中
+ Rectangle imgRect = new Rectangle(x, (ClientRectangle.Height - height) / 2, width, height);
+ ImageAttributes vAttr = new ImageAttributes();
+ vAttr.SetColorKey((Image as Bitmap).GetPixel(0, 0), (Image as Bitmap).GetPixel(0, 0));
+ pevent.Graphics.DrawImage(Image, imgRect, 0, 0, Image.Width, Image.Height, GraphicsUnit.Pixel, vAttr);
+
+ textR = new Rectangle(new Point(x + ClientRectangle.X + width, ClientRectangle.Y), new Size(ClientRectangle.Width - width, ClientRectangle.Height));
+ }
+
+ SetStringFormat();
+ using (SolidBrush foreBrush = new SolidBrush(this.ForeColor))
+ {
+ g.DrawString(Text, Font, foreBrush, textR, m_StringFormat);
+ }
+ }
+
+ public static GraphicsPath CreateRoundRect(float x, float y, float width, float height, float radius)
+ {
+ var gp = new GraphicsPath();
+ gp.AddLine(x + radius, y, x + width - (radius * 2), y);
+ gp.AddArc(x + width - (radius * 2), y, radius * 2, radius * 2, 270, 90);
+ gp.AddLine(x + width, y + radius, x + width, y + height - (radius * 2));
+ gp.AddArc(x + width - (radius * 2), y + height - (radius * 2), radius * 2, radius * 2, 0, 90);
+ gp.AddLine(x + width - (radius * 2), y + height, x + radius, y + height);
+ gp.AddArc(x, y + height - (radius * 2), radius * 2, radius * 2, 90, 90);
+ gp.AddLine(x, y + height - (radius * 2), x, y + radius);
+ gp.AddArc(x, y, radius * 2, radius * 2, 180, 90);
+ gp.CloseFigure();
+ return gp;
+ }
+
+ public static GraphicsPath CreateRoundRect(Rectangle rect, float radius)
+ {
+ return CreateRoundRect(rect.X, rect.Y, rect.Width, rect.Height, radius);
+ }
+
+ private void SetStringFormat()
+ {
+ switch (this.TextAlign)
+ {
+ case ContentAlignment.BottomCenter:
+ case ContentAlignment.BottomLeft:
+ case ContentAlignment.BottomRight:
+ m_StringFormat.LineAlignment = StringAlignment.Far;
+ break;
+ case ContentAlignment.MiddleCenter:
+ case ContentAlignment.MiddleLeft:
+ case ContentAlignment.MiddleRight:
+ m_StringFormat.LineAlignment = StringAlignment.Center;
+ break;
+ case ContentAlignment.TopCenter:
+ case ContentAlignment.TopLeft:
+ case ContentAlignment.TopRight:
+ m_StringFormat.LineAlignment = StringAlignment.Near;
+ break;
+ }
+
+ switch (this.TextAlign)
+ {
+ case ContentAlignment.TopLeft:
+ case ContentAlignment.BottomLeft:
+ case ContentAlignment.MiddleLeft:
+ m_StringFormat.Alignment = StringAlignment.Near;
+ break;
+ case ContentAlignment.MiddleCenter:
+ case ContentAlignment.BottomCenter:
+ case ContentAlignment.TopCenter:
+ m_StringFormat.Alignment = StringAlignment.Center;
+ break;
+ case ContentAlignment.BottomRight:
+ case ContentAlignment.MiddleRight:
+ case ContentAlignment.TopRight:
+ m_StringFormat.Alignment = StringAlignment.Far;
+ break;
+ }
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/Component/PanelEx.cs b/HotelPms.Share.Windows/Component/PanelEx.cs
new file mode 100644
index 0000000..ef72941
--- /dev/null
+++ b/HotelPms.Share.Windows/Component/PanelEx.cs
@@ -0,0 +1,499 @@
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+using System.Linq;
+using System.Drawing.Drawing2D;
+using System.Drawing.Text;
+using HotelPms.Share.Windows.Util;
+using HotelPms.Share.Windows.Animations;
+using HotelPms.Share.Windows.GraphicsApi;
+
+namespace HotelPms.Share.Windows.Component
+{
+ public class PanelEx : Panel
+ {
+ private int imgPadding = 5;
+
+ public int ArcWidth { get; set; } = 16;
+
+ public int OffsetX { get; set; } = 0;
+ public int OffsetY { get; set; } = 0;
+
+ /// <summary>
+ /// 模糊
+ /// </summary>
+ public int Blur { get; set; } = 15;
+
+ /// <summary>
+ /// 蔓延
+ /// </summary>
+ public int Spread { get; set; } = 15;
+
+ public bool UseTitleBookMark { get; set; } = true;
+
+ public Color TitleBookMarkColor { get; set; } = Color.Pink;
+
+ public string Title { get; set; } = string.Empty;
+
+ public Font TitleFont { get; set; } = DefaultFont;
+
+ public Font SignFont { get; set; } = DefaultFont;
+
+ public int TitleHeight { get; set; } = 0;
+
+ public Color TitleForeColor { get; set; } = Color.Black;
+
+ public Color TitleBackColor { get; set; } = Color.Gainsboro;
+
+ public int MaxHeight { get; set; } = -1;
+
+ private bool m_Expan = true;
+
+ /// <summary>
+ /// 拡張
+ /// </summary>
+ public bool Expan
+ {
+ get { return m_Expan; }
+ set
+ {
+ m_Expan = value;
+ if(!m_Expan && MaxHeight == -1) { MaxHeight = this.Height; }
+ //this.Height = m_Expan ? MaxHeight : MixHeight;
+ animationSelf.StartNewAnimation(m_Expan ? AnimationDirection.Out : AnimationDirection.In);
+ Invalidate();
+ }
+ }
+
+ private StringFormat m_StringFormat = new StringFormat();
+ private Rectangle m_TitleRect;
+
+ private string activeName = string.Empty;
+ public string ActiveName { get { return activeName; } set { activeName = value; Invalidate(); } }
+
+ private readonly Dictionary<Control, AnimationManager> animationDict = new Dictionary<Control, AnimationManager>();
+ private AnimationManager animationSelf;
+
+ public PanelEx()
+ {
+ SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.DoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor, true);
+ m_StringFormat.LineAlignment = StringAlignment.Center;
+ m_StringFormat.Alignment = StringAlignment.Near;
+
+ animationSelf = new AnimationManager
+ {
+ Increment = 0.03,
+ AnimationType = AnimationType.Linear,
+ InterruptAnimation = false,
+ };
+ animationSelf.OnAnimationProgress += _animationManager_OnAnimationProgress;
+ }
+
+ private void _animationManager_OnAnimationProgress(object sender)
+ {
+ Invalidate();
+ }
+
+ protected override void OnControlAdded(ControlEventArgs e)
+ {
+ if (e.Control is TextBox || e.Control is ComboBox)
+ {
+ e.Control.Enter += Control_Enter;
+ e.Control.Leave += Control_Leave;
+
+ IPanelEx child = e.Control as IPanelEx;
+ if (child != null)
+ {
+ System.Diagnostics.Debug.WriteLine($"{e.Control.Handle}:{e.Control.Name}:{child.PanelExEnabled}"); //←未設定
+ AnimationManager animationManager = new AnimationManager
+ {
+ Increment = 0.06,
+ AnimationType = AnimationType.EaseInOut,
+ InterruptAnimation = false,
+ };
+ animationManager.OnAnimationProgress += _animationManager_OnAnimationProgress;
+ animationDict.Add(e.Control, animationManager);
+ }
+ }
+ base.OnControlAdded(e);
+ }
+
+ private void Control_Leave(object sender, EventArgs e)
+ {
+ ActiveName = string.Empty;
+
+ IPanelEx child = sender as IPanelEx;
+ if (child != null && child.PanelExEnabled && (child.TitleStyle == CTextBox.ETitleStyle.Material || child.TitleStyle == CTextBox.ETitleStyle.Icon))
+ {
+ if (child.TitleStyle == CTextBox.ETitleStyle.Icon && (sender as Control).Text.Length > 0) { return; }
+ animationDict[child as Control].StartNewAnimation(AnimationDirection.Out);
+ }
+ }
+
+ private void Control_Enter(object sender, EventArgs e)
+ {
+ ActiveName = (sender as Control).Name;
+
+ IPanelEx child = sender as IPanelEx;
+ if (child != null && child.PanelExEnabled && (child.TitleStyle == CTextBox.ETitleStyle.Material || child.TitleStyle == CTextBox.ETitleStyle.Icon))
+ {
+ if (child.TitleStyle == CTextBox.ETitleStyle.Icon && (sender as Control).Text.Length > 0) { return; }
+ animationDict[child as Control].StartNewAnimation(AnimationDirection.In);
+ }
+ }
+
+ protected override void OnPaint(PaintEventArgs e)
+ {
+ base.OnPaint(e);
+ e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
+ e.Graphics.TextRenderingHint = TextRenderingHint.AntiAlias;
+ DrawShadow(Controls.OfType<Control>().Where(c => ActiveName.Length > 0 && ActiveName == c.Name), e.Graphics);
+ DrawStyle(Controls.OfType<CTextBox>().Where(c => c.BorderStyle == BorderStyle.None), e.Graphics);
+ DrawTitle(e);
+ SetHeight(e);
+ }
+
+ protected override void OnMouseMove(MouseEventArgs e)
+ {
+ base.OnMouseMove(e);
+ if (TitleHeight == 0) { return; }
+ Cursor = m_TitleRect.Contains(e.Location) ? Cursors.Hand : Cursors.Default;
+ }
+
+ protected override void OnMouseClick(MouseEventArgs e)
+ {
+ base.OnMouseClick(e);
+ if(!m_TitleRect.Contains(e.Location)) { return; }
+ Expan = !Expan;
+ }
+
+ private void DrawTitle(PaintEventArgs e)
+ {
+ if(TitleHeight == 0) { return; }
+ m_TitleRect = new Rectangle(UseTitleBookMark ? 5 : 0, 0, this.Width, TitleHeight);
+ using (SolidBrush backBrush = new SolidBrush(TitleBackColor))
+ {
+ e.Graphics.FillRectangle(backBrush, m_TitleRect);
+ }
+
+ if (UseTitleBookMark)
+ {
+ Rectangle markRect = new Rectangle(0, 0, 5, TitleHeight);
+ using (SolidBrush backBrush = new SolidBrush(TitleBookMarkColor))
+ {
+ e.Graphics.FillRectangle(backBrush, markRect);
+ }
+ }
+
+ //文言
+ using (SolidBrush foreBrush = new SolidBrush(TitleForeColor))
+ {
+ e.Graphics.DrawString(Title, TitleFont, foreBrush, m_TitleRect, m_StringFormat);
+ }
+
+ //矢印
+ int width = 30;
+ Rectangle signRect = new Rectangle(this.Width - width, 0, width, TitleHeight);
+ using (SolidBrush foreBrush = new SolidBrush(TitleForeColor))
+ {
+ e.Graphics.DrawString(m_Expan ? "▲" : "▼", SignFont, foreBrush, signRect, m_StringFormat);
+ }
+ }
+
+ private void SetHeight(PaintEventArgs e)
+ {
+ if (TitleHeight == 0 || MaxHeight <= 0) { return; }
+
+ if (!animationSelf.IsAnimating())
+ {
+ this.Height = m_Expan ? MaxHeight : TitleHeight;
+ System.Diagnostics.Debug.WriteLine($"animationSelf⇒END");
+ }
+ else
+ {
+ //Animate
+ int height = MaxHeight - TitleHeight;
+ int step = (int)(height * animationSelf.GetProgress());
+ if (m_Expan)
+ {
+ this.Height = TitleHeight + (height - step);
+ }
+ else
+ {
+ this.Height = MaxHeight - step;
+ }
+ System.Diagnostics.Debug.WriteLine($"animationSelf⇒{step}");
+ }
+ }
+
+ private void DrawShadow(IEnumerable<Control> controls, Graphics g)
+ {
+ foreach (var control in controls)
+ {
+ DrawOutsetShadow(g, control);
+ }
+ }
+
+ private void DrawStyle(IEnumerable<Control> controls, Graphics g)
+ {
+ foreach (var control in controls)
+ {
+ DrawControlStyle(g, control);
+ }
+ }
+
+ private Rectangle GetControlRect(Control control)
+ {
+ int titleWidth = 0;
+ if (control is IPanelEx)
+ {
+ IPanelEx child = control as IPanelEx;
+ if(child.PanelExEnabled)
+ {
+ if (child.TitleStyle == CTextBox.ETitleStyle.Label) { titleWidth = child.TitleWidth; }
+ else if (child.TitleStyle == CTextBox.ETitleStyle.Icon) { titleWidth = control.Height + imgPadding; }
+ }
+ }
+
+ int left = control.Left - ArcWidth / 2 - titleWidth;
+ int top = control.Top - ArcWidth / 2;
+ int width = control.Width + ArcWidth + titleWidth;
+ int height = control.Height + ArcWidth;
+ Rectangle r = new Rectangle(left, top, width, height);
+ return r;
+ }
+
+ /// <summary>
+ /// 枠線
+ /// </summary>
+ /// <param name="g"></param>
+ /// <param name="control"></param>
+ private void DrawControlStyle(Graphics g, Control control)
+ {
+ bool drawBorder = true;
+ Color borderColor = Color.FromArgb(255, 0, 120, 215); //255,0,120,215 (濃青) #7bc1f7 140, 123, 193, 247 (青) #22AC38 255, 34, 172, 56 (緑)
+ Rectangle r = GetControlRect(control);
+ if (control is IPanelEx)
+ {
+ IPanelEx child = control as IPanelEx;
+ if (child.PanelExEnabled)
+ {
+ borderColor = control.Focused ? child.BorderFocusColor : child.BorderColor;
+ if (child.TitleStyle == CTextBox.ETitleStyle.Material) { drawBorder = false; }
+ }
+ else
+ {
+ drawBorder = false;
+ }
+ }
+
+ if (drawBorder)
+ {
+ using (GraphicsPath path = new GraphicsPath())
+ {
+ path.AddArc(r.X, r.Y, ArcWidth, ArcWidth, 180, 90);
+ path.AddArc(r.X + r.Width - ArcWidth - 1, r.Y, ArcWidth, ArcWidth, -90, 90);
+ path.AddArc(r.X + r.Width - ArcWidth - 1, r.Y + r.Height - ArcWidth - 1, ArcWidth, ArcWidth, 0, 90);
+ path.AddArc(r.X, r.Y + r.Height - ArcWidth - 1, ArcWidth, ArcWidth, 90, 90);
+ path.CloseFigure();
+
+ using (Brush brush = new SolidBrush(control.BackColor))
+ {
+ g.FillPath(brush, path);
+ }
+ using (Pen pen = new Pen(borderColor)) //255,0,120,215 (濃青) #7bc1f7 140, 123, 193, 247 (青) #22AC38 255, 34, 172, 56 (緑)
+ {
+ g.DrawPath(pen, path);
+ }
+ }
+ }
+
+ //Labelを各
+ if (control is IPanelEx)
+ {
+ IPanelEx child = control as IPanelEx;
+ if (child.PanelExEnabled)
+ {
+ if (child.TitleStyle == CTextBox.ETitleStyle.Label)
+ {
+ int labelWidth = child.TitleWidth;
+ using (GraphicsPath path = new GraphicsPath())
+ {
+ path.AddArc(r.X, r.Y, ArcWidth, ArcWidth, 180, 90);
+ path.AddLine(new Point(r.X + labelWidth, r.Y), new Point(r.X + labelWidth, r.Y + r.Height - 1));
+ path.AddArc(r.X, r.Y + r.Height - ArcWidth - 1, ArcWidth, ArcWidth, 90, 90);
+ path.CloseFigure();
+
+ using (Brush brush = new SolidBrush(child.TitleBackColor))
+ {
+ g.FillPath(brush, path);
+ }
+ using (Pen pen = new Pen(borderColor)) //255,0,120,215 (濃青) #7bc1f7 140, 123, 193, 247 (青) #22AC38 255, 34, 172, 56 (緑) 255,122,122,122 gray
+ {
+ g.DrawPath(pen, path);
+ }
+ }
+
+ TextRenderer.DrawText(g, child.TitleText, child.TitleFont, new Rectangle(r.X, r.Y, child.TitleWidth, r.Height), child.TitleForeColor, TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter);
+ }
+ else if (child.TitleStyle == CTextBox.ETitleStyle.Icon)
+ {
+ if (child.ForeImage != null)
+ {
+ Rectangle imgRect = new Rectangle(control.Left - control.Height - imgPadding, control.Top, control.Width, control.Height);
+ GdiPlus.DrawImage(g, child.ForeImage as Bitmap, imgRect);
+ }
+
+ if (child is CTextBox)
+ {
+ CTextBox textBox = (child as CTextBox);
+ Size sizeText = TextRenderer.MeasureText(textBox.TipText, child.TitleFont);
+ int endX = r.X + 15; //タイトル文字最終的な位置 X
+ int endY = r.Y - sizeText.Height * 2 / 3; //タイトル文字最終的な位置 Y
+
+ if (animationDict.ContainsKey(control) && animationDict[control].IsAnimating())
+ {
+ double per = animationDict[control].GetProgress();
+ //位置、フォントサイズの変化 animationDict[control].GetProgress() in ⇒ enter ⇒ 増大, out ⇒ leave ⇒ 減少
+ float fontSize = textBox.Font.Size - (textBox.Font.Size - child.TitleFont.Size) * (float)per;
+ double curX = textBox.Left - (textBox.Left - endX) * per;
+ double curY = textBox.Top - (textBox.Top - endY) * per;
+ using (Font font = new Font(child.TitleFont.FontFamily, fontSize))
+ {
+ Rectangle textR = new Rectangle((int)curX, (int)curY, (int)(sizeText.Width * 1.2), sizeText.Height);
+ using (Brush brush = new SolidBrush(this.BackColor))
+ {
+ g.FillRectangle(brush, textR);
+ }
+ TextRenderer.DrawText(g, textBox.TipText, font, textR, borderColor, TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter);
+ }
+ }
+ else
+ {
+ if ((control.Focused || textBox.Text.Length > 0) && textBox.TipText.Length > 0)
+ {
+ Rectangle textR = new Rectangle(endX, endY, (int)(sizeText.Width * 1.2), sizeText.Height);
+ using (Brush brush = new SolidBrush(this.BackColor))
+ {
+ g.FillRectangle(brush, textR);
+ }
+ TextRenderer.DrawText(g, textBox.TipText, child.TitleFont, textR, borderColor, TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter);
+ }
+ }
+ }
+ }
+ else if (child.TitleStyle == CTextBox.ETitleStyle.Material && animationDict.ContainsKey(control))
+ {
+ var lineY = control.Bottom + 3;
+ if (!animationDict[control].IsAnimating())
+ {
+ using (Pen pen = new Pen(control.Focused ? child.ShadowColor : child.BorderColor, control.Focused ? 2F : 1F))
+ {
+ g.DrawLine(pen, control.Location.X, lineY, control.Location.X + control.Width, lineY);
+ }
+ }
+ else
+ {
+ //Animate
+ int animationWidth = (int)(control.Width * animationDict[control].GetProgress());
+ int halfAnimationWidth = animationWidth / 2;
+ int animationStart = control.Location.X + control.Width / 2;
+
+ using (Pen pen = new Pen(child.BorderColor, 1F))
+ {
+ g.DrawLine(pen, control.Location.X, lineY, control.Location.X + control.Width, lineY);
+ }
+
+ using (Pen pen = new Pen(child.ShadowColor, 2F))
+ {
+ g.DrawLine(pen, animationStart - halfAnimationWidth, lineY, animationStart - halfAnimationWidth + animationWidth, lineY);
+ }
+ }
+ }
+ }
+ }
+ }
+
+
+ // drawing the loop on an image because of speed
+ private void DrawOutsetShadow(Graphics g, Control control)
+ {
+ Color shadowColor = Color.FromArgb(140, 123, 193, 247); //#7bc1f7 140, 123, 193, 247 (青) #22AC38 140, 34, 172, 56 (緑)
+ if (control is IPanelEx)
+ {
+ IPanelEx child = control as IPanelEx;
+ if (child.PanelExEnabled)
+ {
+ shadowColor = child.ShadowColor;
+ if (child.TitleStyle == CTextBox.ETitleStyle.Material) { return; }
+ }
+ }
+
+ var rOuter = control.Bounds;
+ var rInner = control.Bounds;
+ if (control is CTextBox && (control as CTextBox).BorderStyle == BorderStyle.None)
+ {
+ Rectangle r = GetControlRect(control);
+ rOuter = r;
+ rInner = r;
+ }
+
+ rInner.Offset(OffsetX, OffsetY);
+ rInner.Inflate(-Blur, -Blur);
+ rOuter.Inflate(Spread, Spread);
+ rOuter.Offset(OffsetX, OffsetY);
+ var originalOuter = rOuter;
+
+ using (var img = new Bitmap(originalOuter.Width, originalOuter.Height, g))
+ {
+ using (var g2 = Graphics.FromImage(img))
+ {
+ var currentBlur = 0;
+ do
+ {
+ var transparency = (rOuter.Height - rInner.Height) / (double)(Blur * 2 + Spread * 3);
+ transparency -= 0.02;
+ var color = Color.FromArgb(((int)(255 * (transparency * transparency))), shadowColor);
+ var rOutput = rInner;
+ rOutput.Offset(-originalOuter.Left, -originalOuter.Top);
+ DrawRoundedRectangle(g2, rOutput, currentBlur, Pens.Transparent, color);
+ rInner.Inflate(1, 1);
+ currentBlur = (int)((double)Blur * (1 - (transparency * transparency)));
+ } while (rOuter.Contains(rInner));
+ g2.Flush();
+ }
+ g.DrawImage(img, originalOuter);
+ }
+ }
+
+ private void DrawRoundedRectangle(Graphics gfx, Rectangle bounds, int cornerRadius, Pen drawPen, Color fillColor)
+ {
+ int strokeOffset = Convert.ToInt32(Math.Ceiling(drawPen.Width));
+ bounds = Rectangle.Inflate(bounds, -strokeOffset, -strokeOffset);
+
+ var gfxPath = new GraphicsPath();
+ if (cornerRadius > 0)
+ {
+ gfxPath.AddArc(bounds.X, bounds.Y, cornerRadius, cornerRadius, 180, 90);
+ gfxPath.AddArc(bounds.X + bounds.Width - cornerRadius, bounds.Y, cornerRadius, cornerRadius, 270, 90);
+ gfxPath.AddArc(bounds.X + bounds.Width - cornerRadius, bounds.Y + bounds.Height - cornerRadius, cornerRadius, cornerRadius, 0, 90);
+ gfxPath.AddArc(bounds.X, bounds.Y + bounds.Height - cornerRadius, cornerRadius, cornerRadius, 90, 90);
+ }
+ else
+ {
+ gfxPath.AddRectangle(bounds);
+ }
+ gfxPath.CloseAllFigures();
+
+ gfx.FillPath(new SolidBrush(fillColor), gfxPath);
+ if (drawPen != Pens.Transparent)
+ {
+ var pen = new Pen(drawPen.Color);
+ pen.EndCap = pen.StartCap = LineCap.Round;
+ gfx.DrawPath(pen, gfxPath);
+ }
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/Component/PanelEx.resx b/HotelPms.Share.Windows/Component/PanelEx.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/HotelPms.Share.Windows/Component/PanelEx.resx
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root>
\ No newline at end of file
diff --git a/HotelPms.Share.Windows/Component/PropertyDialog/FormInputType.cs b/HotelPms.Share.Windows/Component/PropertyDialog/FormInputType.cs
new file mode 100644
index 0000000..4031dd8
--- /dev/null
+++ b/HotelPms.Share.Windows/Component/PropertyDialog/FormInputType.cs
@@ -0,0 +1,81 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+
+namespace HotelPms.Share.Windows.Component.PropertyDialog
+{
+ public partial class FormInputType : Form
+ {
+ private string m_InputType = string.Empty;
+
+ //None = 0x1, //���ɂȂ�
+ //Num = 0x2, //����
+ //Alpha_S = 0x4, //�A���t�@�x�b�g��
+ //Alpha_C = 0x8, //�A���t�@�x�b�g��
+ //Kana = 0x10, //�J�i
+ //Half = 0x20, //���p
+ //Full = 0x40, //�S�p
+ //Num_FieldClear = 0x80, //���͍ő包��������N���A
+ //Plus_FieldClear = 0x100,//"+"�L�[�ŃN���A
+ //Space = 0x200, //��
+ //Colon = 0x400, //":"���\
+ //Subtract = 0x800, //"-"
+ //DotSendKeys = 0x1000, //"."��"000"�Ƃ���
+ //Dot = 0x2000, //"."
+ //Slash = 0x4000, //"/"
+ //Comma = 0x8000, //"," �J���}
+
+ private string[] m_TypeList = new string[] { "0x1", "0x2", "0x4", "0x8", "0x10", "0x20", "0x40", "0x200", "0x400", "0x800", "0x1000", "0x2000", "0x80", "0x100", "0x4000", "0x8000" };
+
+ public string InputType
+ {
+ get { return m_InputType; }
+ set { m_InputType = value; }
+ }
+
+ public FormInputType(string inputType)
+ {
+ m_InputType = inputType;
+ InitializeComponent();
+ }
+
+ private void button1_Click(object sender, EventArgs e)
+ {
+ m_InputType = string.Empty;
+ for (int i = 1; i <= 15; i++)
+ {
+ CheckBox obj = this.Controls[string.Format("chkType{0}", i)] as CheckBox;
+ if (obj.Checked)
+ {
+ if (m_InputType.Length > 0) { m_InputType += ","; }
+ m_InputType += m_TypeList[i];
+ }
+ }
+ if (m_InputType.Length == 0) { m_InputType = "0x1"; }
+ this.DialogResult = DialogResult.OK;
+ this.Close();
+ }
+
+ private void button2_Click(object sender, EventArgs e)
+ {
+ this.Close();
+ }
+
+ private void FormInputType_Load(object sender, EventArgs e)
+ {
+ if (m_InputType.Length == 0) { return; }
+ string[] dataList = m_InputType.Split(new char[] { ',' });
+ foreach (string item in dataList)
+ {
+ int index = Array.IndexOf(m_TypeList, item);
+ if (index <= 0) { continue; }
+ (this.Controls[string.Format("chkType{0}", index)] as CheckBox).Checked = true;
+ }
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.Share.Windows/Component/PropertyDialog/FormInputType.designer.cs b/HotelPms.Share.Windows/Component/PropertyDialog/FormInputType.designer.cs
new file mode 100644
index 0000000..ab088a9
--- /dev/null
+++ b/HotelPms.Share.Windows/Component/PropertyDialog/FormInputType.designer.cs
@@ -0,0 +1,274 @@
+namespace HotelPms.Share.Windows.Component.PropertyDialog
+{
+ partial class FormInputType
+ {
+ /// <summary>
+ /// 必要なデザイナ変数です。
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// 使用中のリソースをすべてクリーンアップします。
+ /// </summary>
+ /// <param name="disposing">マネージ リソースが破棄される場合 true、破棄されない場合は false です。</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows フォーム デザイナで生成されたコード
+
+ /// <summary>
+ /// デザイナ サポートに必要なメソッドです。このメソッドの内容を
+ /// コード エディタで変更しないでください。
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.chkType1 = new System.Windows.Forms.CheckBox();
+ this.chkType2 = new System.Windows.Forms.CheckBox();
+ this.chkType3 = new System.Windows.Forms.CheckBox();
+ this.chkType4 = new System.Windows.Forms.CheckBox();
+ this.chkType5 = new System.Windows.Forms.CheckBox();
+ this.chkType6 = new System.Windows.Forms.CheckBox();
+ this.chkType12 = new System.Windows.Forms.CheckBox();
+ this.button1 = new System.Windows.Forms.Button();
+ this.button2 = new System.Windows.Forms.Button();
+ this.chkType13 = new System.Windows.Forms.CheckBox();
+ this.chkType7 = new System.Windows.Forms.CheckBox();
+ this.chkType10 = new System.Windows.Forms.CheckBox();
+ this.chkType11 = new System.Windows.Forms.CheckBox();
+ this.chkType9 = new System.Windows.Forms.CheckBox();
+ this.chkType8 = new System.Windows.Forms.CheckBox();
+ this.chkType14 = new System.Windows.Forms.CheckBox();
+ this.chkType15 = new System.Windows.Forms.CheckBox();
+ this.SuspendLayout();
+ //
+ // chkType1
+ //
+ this.chkType1.AutoSize = true;
+ this.chkType1.Location = new System.Drawing.Point(24, 12);
+ this.chkType1.Name = "chkType1";
+ this.chkType1.Size = new System.Drawing.Size(76, 16);
+ this.chkType1.TabIndex = 0;
+ this.chkType1.Text = "数字 0~9";
+ this.chkType1.UseVisualStyleBackColor = true;
+ //
+ // chkType2
+ //
+ this.chkType2.AutoSize = true;
+ this.chkType2.Location = new System.Drawing.Point(24, 34);
+ this.chkType2.Name = "chkType2";
+ this.chkType2.Size = new System.Drawing.Size(130, 16);
+ this.chkType2.TabIndex = 1;
+ this.chkType2.Text = "アルファベット(小) a~z";
+ this.chkType2.UseVisualStyleBackColor = true;
+ //
+ // chkType3
+ //
+ this.chkType3.AutoSize = true;
+ this.chkType3.Location = new System.Drawing.Point(24, 56);
+ this.chkType3.Name = "chkType3";
+ this.chkType3.Size = new System.Drawing.Size(134, 16);
+ this.chkType3.TabIndex = 3;
+ this.chkType3.Text = "アルファベット(大) A~Z";
+ this.chkType3.UseVisualStyleBackColor = true;
+ //
+ // chkType4
+ //
+ this.chkType4.AutoSize = true;
+ this.chkType4.Location = new System.Drawing.Point(24, 78);
+ this.chkType4.Name = "chkType4";
+ this.chkType4.Size = new System.Drawing.Size(43, 16);
+ this.chkType4.TabIndex = 2;
+ this.chkType4.Text = "カナ";
+ this.chkType4.UseVisualStyleBackColor = true;
+ //
+ // chkType5
+ //
+ this.chkType5.AutoSize = true;
+ this.chkType5.Location = new System.Drawing.Point(24, 100);
+ this.chkType5.Name = "chkType5";
+ this.chkType5.Size = new System.Drawing.Size(48, 16);
+ this.chkType5.TabIndex = 4;
+ this.chkType5.Text = "半角";
+ this.chkType5.UseVisualStyleBackColor = true;
+ //
+ // chkType6
+ //
+ this.chkType6.AutoSize = true;
+ this.chkType6.Location = new System.Drawing.Point(24, 122);
+ this.chkType6.Name = "chkType6";
+ this.chkType6.Size = new System.Drawing.Size(48, 16);
+ this.chkType6.TabIndex = 5;
+ this.chkType6.Text = "全角";
+ this.chkType6.UseVisualStyleBackColor = true;
+ //
+ // chkType12
+ //
+ this.chkType12.AutoSize = true;
+ this.chkType12.Location = new System.Drawing.Point(220, 100);
+ this.chkType12.Name = "chkType12";
+ this.chkType12.Size = new System.Drawing.Size(146, 16);
+ this.chkType12.TabIndex = 6;
+ this.chkType12.Text = "入力最大桁超えたらクリア";
+ this.chkType12.UseVisualStyleBackColor = true;
+ //
+ // button1
+ //
+ this.button1.Location = new System.Drawing.Point(158, 199);
+ this.button1.Name = "button1";
+ this.button1.Size = new System.Drawing.Size(95, 32);
+ this.button1.TabIndex = 7;
+ this.button1.Text = "OK";
+ this.button1.UseVisualStyleBackColor = true;
+ this.button1.Click += new System.EventHandler(this.button1_Click);
+ //
+ // button2
+ //
+ this.button2.Location = new System.Drawing.Point(271, 199);
+ this.button2.Name = "button2";
+ this.button2.Size = new System.Drawing.Size(95, 32);
+ this.button2.TabIndex = 8;
+ this.button2.Text = "Cancel";
+ this.button2.UseVisualStyleBackColor = true;
+ this.button2.Click += new System.EventHandler(this.button2_Click);
+ //
+ // chkType13
+ //
+ this.chkType13.AutoSize = true;
+ this.chkType13.Location = new System.Drawing.Point(220, 122);
+ this.chkType13.Name = "chkType13";
+ this.chkType13.Size = new System.Drawing.Size(96, 16);
+ this.chkType13.TabIndex = 9;
+ this.chkType13.Text = "\"+\"キーでクリア";
+ this.chkType13.UseVisualStyleBackColor = true;
+ //
+ // chkType7
+ //
+ this.chkType7.AutoSize = true;
+ this.chkType7.Location = new System.Drawing.Point(24, 144);
+ this.chkType7.Name = "chkType7";
+ this.chkType7.Size = new System.Drawing.Size(48, 16);
+ this.chkType7.TabIndex = 10;
+ this.chkType7.Text = "空白";
+ this.chkType7.UseVisualStyleBackColor = true;
+ //
+ // chkType10
+ //
+ this.chkType10.AutoSize = true;
+ this.chkType10.Location = new System.Drawing.Point(220, 56);
+ this.chkType10.Name = "chkType10";
+ this.chkType10.Size = new System.Drawing.Size(107, 16);
+ this.chkType10.TabIndex = 14;
+ this.chkType10.Text = "「.」→「000」とする";
+ this.chkType10.UseVisualStyleBackColor = true;
+ //
+ // chkType11
+ //
+ this.chkType11.AutoSize = true;
+ this.chkType11.Location = new System.Drawing.Point(220, 78);
+ this.chkType11.Name = "chkType11";
+ this.chkType11.Size = new System.Drawing.Size(44, 16);
+ this.chkType11.TabIndex = 13;
+ this.chkType11.Text = "「.」";
+ this.chkType11.UseVisualStyleBackColor = true;
+ //
+ // chkType9
+ //
+ this.chkType9.AutoSize = true;
+ this.chkType9.Location = new System.Drawing.Point(220, 34);
+ this.chkType9.Name = "chkType9";
+ this.chkType9.Size = new System.Drawing.Size(42, 16);
+ this.chkType9.TabIndex = 12;
+ this.chkType9.Text = "「-」";
+ this.chkType9.UseVisualStyleBackColor = true;
+ //
+ // chkType8
+ //
+ this.chkType8.AutoSize = true;
+ this.chkType8.Location = new System.Drawing.Point(220, 12);
+ this.chkType8.Name = "chkType8";
+ this.chkType8.Size = new System.Drawing.Size(42, 16);
+ this.chkType8.TabIndex = 11;
+ this.chkType8.Text = "「:」";
+ this.chkType8.UseVisualStyleBackColor = true;
+ //
+ // chkType14
+ //
+ this.chkType14.AutoSize = true;
+ this.chkType14.Location = new System.Drawing.Point(220, 144);
+ this.chkType14.Name = "chkType14";
+ this.chkType14.Size = new System.Drawing.Size(42, 16);
+ this.chkType14.TabIndex = 15;
+ this.chkType14.Text = "「/」";
+ this.chkType14.UseVisualStyleBackColor = true;
+ //
+ // chkType15
+ //
+ this.chkType15.AutoSize = true;
+ this.chkType15.Location = new System.Drawing.Point(220, 166);
+ this.chkType15.Name = "chkType15";
+ this.chkType15.Size = new System.Drawing.Size(38, 16);
+ this.chkType15.TabIndex = 16;
+ this.chkType15.Text = "「,」";
+ this.chkType15.UseVisualStyleBackColor = true;
+ //
+ // FormInputType
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(385, 240);
+ this.Controls.Add(this.chkType15);
+ this.Controls.Add(this.chkType14);
+ this.Controls.Add(this.chkType10);
+ this.Controls.Add(this.chkType11);
+ this.Controls.Add(this.chkType9);
+ this.Controls.Add(this.chkType8);
+ this.Controls.Add(this.chkType7);
+ this.Controls.Add(this.chkType13);
+ this.Controls.Add(this.button2);
+ this.Controls.Add(this.button1);
+ this.Controls.Add(this.chkType12);
+ this.Controls.Add(this.chkType6);
+ this.Controls.Add(this.chkType5);
+ this.Controls.Add(this.chkType3);
+ this.Controls.Add(this.chkType4);
+ this.Controls.Add(this.chkType2);
+ this.Controls.Add(this.chkType1);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "FormInputType";
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+ this.Text = "入力設定";
+ this.Load += new System.EventHandler(this.FormInputType_Load);
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.CheckBox chkType1;
+ private System.Windows.Forms.CheckBox chkType2;
+ private System.Windows.Forms.CheckBox chkType3;
+ private System.Windows.Forms.CheckBox chkType4;
+ private System.Windows.Forms.CheckBox chkType5;
+ private System.Windows.Forms.CheckBox chkType6;
+ private System.Windows.Forms.CheckBox chkType12;
+ private System.Windows.Forms.Button button1;
+ private System.Windows.Forms.Button button2;
+ private System.Windows.Forms.CheckBox chkType13;
+ private System.Windows.Forms.CheckBox chkType7;
+ private System.Windows.Forms.CheckBox chkType10;
+ private System.Windows.Forms.CheckBox chkType11;
+ private System.Windows.Forms.CheckBox chkType9;
+ private System.Windows.Forms.CheckBox chkType8;
+ private System.Windows.Forms.CheckBox chkType14;
+ private System.Windows.Forms.CheckBox chkType15;
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.Share.Windows/Component/PropertyDialog/FormInputType.resx b/HotelPms.Share.Windows/Component/PropertyDialog/FormInputType.resx
new file mode 100644
index 0000000..d58980a
--- /dev/null
+++ b/HotelPms.Share.Windows/Component/PropertyDialog/FormInputType.resx
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root>
\ No newline at end of file
diff --git a/HotelPms.Share.Windows/Component/PropertyEditor/InputTypeEditor.cs b/HotelPms.Share.Windows/Component/PropertyEditor/InputTypeEditor.cs
new file mode 100644
index 0000000..50f70ac
--- /dev/null
+++ b/HotelPms.Share.Windows/Component/PropertyEditor/InputTypeEditor.cs
@@ -0,0 +1,48 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Drawing.Design;
+using System.ComponentModel;
+using System.Windows.Forms.Design;
+using HotelPms.Share.Windows.Component.PropertyDialog;
+using System.Windows.Forms;
+
+namespace HotelPms.Share.Windows.Component.PropertyEditor
+{
+ public class InputTypeEditor : UITypeEditor
+ {
+ public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
+ {
+ if (context != null && context.Instance != null)
+ {
+ return UITypeEditorEditStyle.Modal;
+ }
+
+ return base.GetEditStyle(context);
+ }
+
+ public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
+ {
+ IWindowsFormsEditorService editorService = null;
+
+ if (context != null && context.Instance != null && provider != null)
+ {
+ editorService = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
+ if (editorService != null)
+ {
+ CTextBox control = (CTextBox)context.Instance;
+ using (FormInputType dlg = new FormInputType(control.InputType))
+ {
+ if (dlg.ShowDialog() == DialogResult.OK)
+ {
+ value = dlg.InputType;
+ return value;
+ }
+ }
+ }
+ }
+
+ return value;
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/Component/RemovePeekMessage.cs b/HotelPms.Share.Windows/Component/RemovePeekMessage.cs
new file mode 100644
index 0000000..a2e18e6
--- /dev/null
+++ b/HotelPms.Share.Windows/Component/RemovePeekMessage.cs
@@ -0,0 +1,200 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Runtime.InteropServices;
+
+namespace HotelPms.Share.Windows.Component
+{
+ /// <summary>
+ /// �ۗ�����Ă���E�B���h�E���b�Z�[�W���폜
+ /// </summary>
+ public static class RemovePeekMessage
+ {
+ #region �萔
+ /// <summary>
+ /// �Y������E�B���h�E�ɍĕ`�悪�K�v��OS�����f�����Ƃ��Ƀ|�X�g����郁�b�Z�[�W
+ /// </summary>
+ private const int WM_PAINT = 0xF;
+
+ /// <summary>
+ /// �E�B���h�E�̃N���C�A���g�̈�Ń��[�U�[���}�E�X�̈ړ��������Ƃ��Ƀ|�X�g����郁�b�Z�[�W
+ /// </summary>
+ private const int WM_MOUSEMOVE = 0x200;
+
+ /// <summary>
+ /// �E�B���h�E�̃N���C�A���g�̈�Ń��[�U�[���}�E�X�̍��{�^�����������Ƃ��Ƀ|�X�g����郁�b�Z�[�W
+ /// </summary>
+ private const int WM_LBUTTONDOWN = 0x201;
+
+ /// <summary>
+ /// �E�B���h�E�̃N���C�A���g�̈�Ń��[�U�[���}�E�X�̍��{�^���𗣂����Ƃ��Ƀ|�X�g����郁�b�Z�[�W
+ /// </summary>
+ private const int WM_LBUTTONUP = 0x202;
+
+ /// <summary>
+ /// �}�E�X�|�C���^���̈�O�ɏo�����Ƀ|�X�g����郁�b�Z�[�W
+ /// </summary>
+ private const int WM_MOUSELEAVE = 0x2A3;
+
+ private const int WM_KEYFIRST = 0x100;
+ private const int WM_KEYLAST = 0x109;
+
+ private const int WM_MOUSEFIRST = 0x200;
+ private const int WM_MOUSELAST = 0x20D;
+
+ #endregion
+
+ #region �\����
+ /// <summary>
+ /// MSG �\���̌^
+ /// </summary>
+ [StructLayout(LayoutKind.Sequential)]
+ public struct MSG
+ {
+ /// <summary>
+ /// �E�B���h�E�n���h��
+ /// </summary>
+ public IntPtr hWnd;
+ /// <summary>
+ /// MessageID
+ /// </summary>
+ public int msg;
+ /// <summary>
+ /// WParam�t�B�[���h�iMessageID���ƂɈႤ��)
+ /// </summary>
+ public IntPtr wParam;
+ /// <summary>
+ /// LParam�t�B�[���h�iMessageID���ƂɈႤ��)
+ /// </summary>
+ public IntPtr lParam;
+ /// <summary>
+ /// ����
+ /// </summary>
+ public int time;
+ /// <summary>
+ /// �J�[�\���ʒu�i�X�N���[�����W�j
+ /// </summary>
+ public POINTAPI pt;
+ }
+
+ /// <summary>
+ /// POINTAPI�\����
+ /// </summary>
+ [StructLayout(LayoutKind.Sequential)]
+ public struct POINTAPI
+ {
+ /// <summary>
+ /// X���W
+ /// </summary>
+ public int x;
+ /// <summary>
+ /// Y���W
+ /// </summary>
+ public int y;
+ }
+ #endregion
+
+ #region �^
+ /// <summary>
+ /// wRemoveMsg�ŗ��p�\�ȃI�v�V����
+ /// </summary>
+ enum EPeekMessageOption
+ {
+ /// <summary>
+ /// �����チ�b�Z�[�W���L���[����폜���Ȃ�
+ /// </summary>
+ PM_NOREMOVE = 0,
+ /// <summary>
+ /// �����チ�b�Z�[�W���L���[����폜����
+ /// </summary>
+ PM_REMOVE
+ }
+ #endregion
+
+ #region DllImport
+ /// <summary>
+ /// �X���b�h�̃��b�Z�[�W�L���[�Ƀ��b�Z�[�W�����邩�ǂ������`�F�b�N��
+ /// ����A�w�肳�ꂽ�\���̂ɂ��̃��b�Z�[�W���i�[���܂�
+ /// </summary>
+ /// <param name="lpMsg"> ���b�Z�[�W�����i�[����AMSG �\���̌^�ϐ��̃|�C���^���w�肵�܂�</param>
+ /// <param name="hWnd">���b�Z�[�W���擾����E�B���h�E�̃n���h�����w�肵�܂��B�S�Ă̏ꍇ�� NULL</param>
+ /// <param name="wMsgFilterMin">���b�Z�[�W�̍ŏ��l���w�肵�A�t�B���^�����O���܂��B���Ȃ��ꍇ��0</param>
+ /// <param name="wMsgFilterMax">���b�Z�[�W�̍ő�l���w�肵�A�t�B���^�����O���܂��B���Ȃ��ꍇ��0</param>
+ /// <param name="wRemoveMsg">�����チ�b�Z�[�W���L���[���폜���邩�ۂ�</param>
+ /// <returns>���b�Z�[�W���擾�����Ƃ��� 0 �ȊO�A�擾���Ȃ������Ƃ��� 0</returns>
+ [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ private static extern bool PeekMessage(
+ out MSG lpMsg,
+ int hWnd,
+ int wMsgFilterMin,
+ int wMsgFilterMax,
+ EPeekMessageOption wRemoveMsg
+ );
+
+ /// <summary>
+ /// �w�肳�ꂽ MSG �\���̌^�ϐ��Ƀ��b�Z�[�W���i�[���܂�
+ /// </summary>
+ /// <param name="lpMsg">���b�Z�[�W�����i�[����AMSG �\���̌^�ϐ��̃|�C���^���w�肵�܂�</param>
+ /// <param name="hWnd">���b�Z�[�W���擾����E�B���h�E�̃n���h�����w�肵�܂��B�S�Ă̏ꍇ�� NULL</param>
+ /// <param name="wMsgFilterMin">���b�Z�[�W�̍ŏ��l���w�肵�A�t�B���^�����O���܂��B���Ȃ��ꍇ��0</param>
+ /// <param name="wMsgFilterMax">���b�Z�[�W�̍ő�l���w�肵�A�t�B���^�����O���܂��B���Ȃ��ꍇ��0</param>
+ /// <returns></returns>
+ [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ private static extern bool GetMessage(
+ out MSG lpMsg,
+ int hWnd,
+ int wMsgFilterMin,
+ int wMsgFilterMax
+ );
+
+ /// <summary>
+ /// �w�肳�ꂽ�E�B���h�E���b�Z�[�W���E�B���h�E�v���V�[�W���Ƀf�B�X�p�b�`���܂�
+ /// </summary>
+ /// <param name="lpMsg">�f�B�X�p�b�`���郁�b�Z�[�W���i�[���� MSG �\���̕ϐ��̃|�C���^���w�肵�܂�</param>
+ /// <returns>�E�B���h�E�v���V�[�W���̖߂�l</returns>
+ [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
+ private static extern IntPtr DispatchMessage(
+ out MSG lpMsg
+ );
+ #endregion
+
+ #region ���\�b�h
+ /// <summary>
+ /// �ۗ�����Ă���E�B���h�E���b�Z�[�W���폜���܂��B
+ /// </summary>
+ public static void Invoke()
+ {
+ //Console.WriteLine("�y���zRemovePeekMessage.Invoke():���̎��_�̃C�x���g���ׂč폜���s�J�n");
+ MSG wm;
+ while (PeekMessage(out wm, 0, WM_KEYFIRST, WM_KEYLAST, EPeekMessageOption.PM_REMOVE)) { }
+ while (PeekMessage(out wm, 0, WM_MOUSEFIRST, WM_MOUSELAST, EPeekMessageOption.PM_REMOVE)) { }
+
+
+#if false
+ System.Diagnostics.Debug.WriteLine("Invoke begin");
+ MSG wm;
+ while (true)
+ {
+ bool ret = PeekMessage(out wm, 0, 0, 0, EPeekMessageOption.PM_REMOVE);
+ System.Diagnostics.Debug.WriteLine(wm.msg.ToString());
+ System.Diagnostics.Debug.WriteLine(ret.ToString());
+ if (!ret) { break; }
+
+ switch (wm.msg)
+ {
+ case WM_LBUTTONUP:
+ case WM_MOUSELEAVE:
+ case WM_PAINT:
+ System.Diagnostics.Debug.WriteLine(wm.msg.ToString());
+ DispatchMessage(out wm);
+ break;
+ }
+ }
+ System.Diagnostics.Debug.WriteLine("Invoke end");
+#endif
+ }
+ #endregion
+ }
+}
diff --git a/HotelPms.Share.Windows/Component/RoundButton.cs b/HotelPms.Share.Windows/Component/RoundButton.cs
new file mode 100644
index 0000000..1d7f067
--- /dev/null
+++ b/HotelPms.Share.Windows/Component/RoundButton.cs
@@ -0,0 +1,77 @@
+using HotelPms.Share.Windows.Util;
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace HotelPms.Share.Windows.Component
+{
+ public class RoundButton : System.Windows.Forms.Control
+ {
+ private StringFormat m_StringFormat = new StringFormat(StringFormatFlags.NoWrap);
+
+ public RoundButton()
+ {
+ //base.BackColor = Color.Transparent;
+ //BackColor = Color.Black;
+ //ForeColor = Color.White;
+ SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor | ControlStyles.UserPaint, true);
+ SetStyle(ControlStyles.Opaque, false);
+ m_StringFormat.Alignment = StringAlignment.Center;
+ m_StringFormat.LineAlignment = StringAlignment.Center;
+ }
+
+
+ protected override void Dispose(bool disposing)
+ {
+ //img.Dispose();
+ m_StringFormat.Dispose();
+ base.Dispose(disposing);
+ }
+
+ protected override void OnPaint(PaintEventArgs e)
+ {
+ base.OnPaint(e);
+
+ //if (img == null)
+ //{
+ // img = Image.FromFile(Application.StartupPath + @"\avatar5.png");
+ // imgEllipse = GdiPlus.CutEllipse(img, new Rectangle(0, 0, img.Size.Width, img.Size.Height), img.Size);
+ //}
+
+
+ //GdiPlus.FillRoundRectangle(e.Graphics, Brushes.DarkBlue, (RectangleF)ClientRectangle, 24);
+ //e.Graphics.DrawImage(imgEllipse, new Rectangle(5, 5, ClientRectangle.Size.Height - 10, ClientRectangle.Size.Height - 10));
+ //GdiPlus.DrawRoundRectangle(e.Graphics, Pens.Red, (RectangleF)ClientRectangle, 15);
+
+
+ //TextRenderer.DrawText();
+ //TextRenderer.MeasureText()
+ }
+
+ private static GraphicsPath CreateRoundRectangle(Rectangle rectangle, int radius)
+ {
+ radius += 10;
+ GraphicsPath path = new GraphicsPath();
+ int l = rectangle.Left;
+ int t = rectangle.Top;
+ int w = rectangle.Width;
+ int h = rectangle.Height;
+ int d = radius << 1;
+ path.AddArc(l, t, d, d, 180, 90); // topleft
+ path.AddLine(l + radius, t, l + w - radius, t); // top
+ path.AddArc(l + w - d, t, d, d, 270, 90); // topright
+ path.AddLine(l + w, t + radius, l + w, t + h - radius); // right
+ path.AddArc(l + w - d, t + h - d, d, d, 0, 90); // bottomright
+ path.AddLine(l + w - radius, t + h, l + radius, t + h); // bottom
+ path.AddArc(l, t + h - d, d, d, 90, 90); // bottomleft
+ path.AddLine(l, t + h - radius, l, t + radius); // left
+ path.CloseFigure();
+ return path;
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/Component/TabMark.cs b/HotelPms.Share.Windows/Component/TabMark.cs
new file mode 100644
index 0000000..1c5c54d
--- /dev/null
+++ b/HotelPms.Share.Windows/Component/TabMark.cs
@@ -0,0 +1,727 @@
+using HotelPms.Share.Windows.GraphicsApi;
+using HotelPms.Share.Windows.Util;
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Windows.Forms;
+using System.Windows.Forms.VisualStyles;
+
+namespace HotelPms.Share.Windows.Component
+{
+ public class TabMark : System.Windows.Forms.Control
+ {
+ #region ★★★★★ Declartions ★★★★★
+
+ public enum HitDownSquare : int
+ {
+ None = 0,
+ Left,
+ Right,
+ Tab,
+ }
+
+ public enum AngleStyle : int
+ {
+ /// <summary>
+ /// 直角
+ /// </summary>
+ Normal = 0,
+ /// <summary>
+ /// 円角
+ /// </summary>
+ Round = 1
+ }
+
+ public sealed class HitTestInfo
+ {
+ public static readonly HitTestInfo Nowhere;
+
+ internal int y;
+ internal int x;
+ internal int index = 0;
+ internal HitDownSquare type;
+
+ static HitTestInfo()
+ {
+ HitTestInfo.Nowhere = new HitTestInfo();
+ }
+
+ internal HitTestInfo()
+ {
+ this.type = HitDownSquare.None;
+ this.x = -1;
+ this.y = -1;
+ }
+
+ public int Index { get { return index; } }
+
+ public int X
+ {
+ get { return this.x; }
+ }
+
+ public int Y
+ {
+ get { return this.y; }
+ }
+
+ public HitDownSquare Type
+ {
+ get { return this.type; }
+ }
+
+ public override int GetHashCode()
+ {
+ return this.x << 16 | this.y << 8 | (int)this.type;
+ }
+
+ public override bool Equals(object obj)
+ {
+ HitTestInfo hi = obj as HitTestInfo;
+ return (this.type == hi.type && this.x == hi.x && this.x == hi.x);
+ }
+
+ public override string ToString()
+ {
+ return string.Concat(new string[7] { "{ ", this.type.ToString(), ",", this.x.ToString(), ",", this.y.ToString(), "}" });
+ }
+ }
+
+
+ public event CellFormatEventHandler CellFormat = null;
+ public event EventHandler SelectedIndexChanged = null;
+
+ private Rectangle m_LeftRect;
+ private Rectangle m_RightRect;
+ private List<Rectangle> m_TabRect = new List<Rectangle>();
+ private StringFormat m_StringFormat = new StringFormat(StringFormatFlags.NoWrap);
+ private int m_TabCount = 3;
+ private int m_FocusIndex = -1;
+ private bool m_IsMouseDown = false;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+
+ //private int m_LastMouseClickIndex = -1;
+ //public int LastMouseClickIndex
+ //{
+ // get { return m_LastMouseClickIndex; }
+ // set { m_LastMouseClickIndex = value; }
+ //}
+
+ private bool m_FirstColFrozen = false;
+ public bool FirstColFrozen
+ {
+ get { return m_FirstColFrozen; }
+ set { m_FirstColFrozen = value; }
+ }
+
+ private Color m_SelectBorderColor = Color.FromArgb(255, 86, 157, 229);
+
+ public Color SelectBorderColor
+ {
+ get { return m_SelectBorderColor; }
+ set { m_SelectBorderColor = value; }
+ }
+
+ private Color m_FocusBackColorMax = Color.FromArgb(255, 228, 240, 252);
+
+ public Color FocusBackColorMax
+ {
+ get { return m_FocusBackColorMax; }
+ set { m_FocusBackColorMax = value; }
+ }
+ private Color m_FocusBackColorMin = Color.FromArgb(255, 234, 243, 252);
+
+ public Color FocusBackColorMin
+ {
+ get { return m_FocusBackColorMin; }
+ set { m_FocusBackColorMin = value; }
+ }
+
+ private Color m_MouseDownBackColorMax = Color.FromArgb(255, 207, 230, 252);
+
+ public Color MouseDownBackColorMax
+ {
+ get { return m_MouseDownBackColorMax; }
+ set { m_MouseDownBackColorMax = value; }
+ }
+ private Color m_MouseDownBackColorMin = Color.FromArgb(255, 217, 235, 252);
+
+ public Color MouseDownBackColorMin
+ {
+ get { return m_MouseDownBackColorMin; }
+ set { m_MouseDownBackColorMin = value; }
+ }
+
+ /// <summary>
+ /// 表示タブの数
+ /// </summary>
+ public int TabCount
+ {
+ get { return m_TabCount; }
+ set { m_TabCount = value; Invalidate(); }
+ }
+
+ private int m_ScrollButtonWidth = 35;
+
+ /// <summary>
+ /// 浸り右
+ /// </summary>
+ public int ScrollButtonWidth
+ {
+ get { return m_ScrollButtonWidth; }
+ set { m_ScrollButtonWidth = value; Invalidate(); }
+ }
+
+ private Color m_ScrollButtonBackColorMax = Color.FromArgb(255, 86, 157, 229);
+
+ public Color ScrollButtonBackColorMax
+ {
+ get { return m_ScrollButtonBackColorMax; }
+ set { m_ScrollButtonBackColorMax = value; Invalidate(); }
+ }
+
+ private Color m_ScrollButtonBackColorMin = Color.FromArgb(255, 229, 240, 251);
+
+ public Color ScrollButtonBackColorMin
+ {
+ get { return m_ScrollButtonBackColorMin; }
+ set { m_ScrollButtonBackColorMin = value; Invalidate(); }
+ }
+
+ private Color m_ScrollButtonForeColor = Color.Black;
+
+ public Color ScrollButtonForeColor
+ {
+ get { return m_ScrollButtonForeColor; }
+ set { m_ScrollButtonForeColor = value; Invalidate(); }
+ }
+ private Image m_ScrollButtonImage = null;
+
+ public Image ScrollButtonImage
+ {
+ get { return m_ScrollButtonImage; }
+ set { m_ScrollButtonImage = value; Invalidate(); }
+ }
+
+ private string m_ScrollLeftText = "<<";
+
+ public string ScrollLeftText
+ {
+ get { return m_ScrollLeftText; }
+ set { m_ScrollLeftText = value; Invalidate(); }
+ }
+
+ private string m_ScrollRightText = ">>";
+
+ public string ScrollRightText
+ {
+ get { return m_ScrollRightText; }
+ set { m_ScrollRightText = value; Invalidate(); }
+ }
+
+ private List<string> m_TabKeyList = new List<string>();
+
+ //public List<string> TabKeyList
+ //{
+ // get { return m_TabKeyList; }
+ // set { m_TabKeyList = value; }
+ //}
+ private List<string> m_TabTextList = new List<string>();
+
+ //public List<string> TabTextList
+ //{
+ // get { return m_TabTextList; }
+ // set { m_TabTextList = value; }
+ //}
+ private int m_SelectIndex = 0;
+
+ public int SelectIndex
+ {
+ get { return m_SelectIndex; }
+ set
+ {
+ m_SelectIndex = value;
+ if(m_TabKeyList.Count > 0 && m_TabCount > 0)
+ {
+ if (m_SelectIndex < m_TopIndex) { m_TopIndex = (m_SelectIndex - 1 < 0) ? 0 : (m_SelectIndex - 1); }
+ if ((m_TopIndex + m_TabCount - 1) < m_SelectIndex)
+ {
+ m_TopIndex = m_SelectIndex - m_TabCount + 2;
+ if ((m_TopIndex + m_TabCount - 1) > (m_TabKeyList.Count - 1)) { m_TopIndex = m_SelectIndex - m_TabCount + 1; }
+ }
+ if ((m_TopIndex + m_TabCount - 1) == m_SelectIndex && m_SelectIndex < (m_TabKeyList.Count - 1)) { m_TopIndex++; }
+ }
+ Invalidate();
+ }
+ }
+
+ public string SelectKey
+ {
+ get { return m_TabKeyList.Count == 0 ? string.Empty : m_TabKeyList[m_SelectIndex]; }
+ }
+
+ public int DataCount
+ {
+ get { return m_TabKeyList.Count; }
+ }
+
+ private Color m_SelectBackColorMin = SystemColors.Control;
+
+ public Color SelectBackColorMin
+ {
+ get { return m_SelectBackColorMin; }
+ set { m_SelectBackColorMin = value; Invalidate(); }
+ }
+
+ private Color m_SelectBackColorMax = SystemColors.Highlight;
+
+ public Color SelectBackColorMax
+ {
+ get { return m_SelectBackColorMax; }
+ set { m_SelectBackColorMax = value; Invalidate(); }
+ }
+ private Color m_SelectForeColor = SystemColors.HighlightText;
+
+ public Color SelectForeColor
+ {
+ get { return m_SelectForeColor; }
+ set { m_SelectForeColor = value; Invalidate(); }
+ }
+ private int m_TabSpace = 2;
+
+ public int TabSpace
+ {
+ get { return m_TabSpace; }
+ set { m_TabSpace = value; Invalidate(); }
+ }
+ private Color m_TabBackColorMax = Color.FromArgb(255, 86, 157, 229);
+
+ public Color TabBackColorMax
+ {
+ get { return m_TabBackColorMax; }
+ set { m_TabBackColorMax = value; Invalidate(); }
+ }
+
+ private Color m_TabBackColorMin = Color.FromArgb(255, 229, 240, 251);
+
+ public Color TabBackColorMin
+ {
+ get { return m_TabBackColorMin; }
+ set { m_TabBackColorMin = value; Invalidate(); }
+ }
+
+ private Color m_TabForeColor = Color.Black;
+
+ public Color TabForeColor
+ {
+ get { return m_TabForeColor; }
+ set { m_TabForeColor = value; Invalidate(); }
+ }
+
+ private Color m_BorderColor = VisualStyleInformation.TextControlBorder;
+
+ public Color BorderColor
+ {
+ get { return m_BorderColor; }
+ set { m_BorderColor = value; Invalidate(); }
+ }
+ private AngleStyle m_TabStyle = AngleStyle.Normal; //0.直 1.円
+
+ public AngleStyle TabStyle
+ {
+ get { return m_TabStyle; }
+ set { m_TabStyle = value; Invalidate(); }
+ }
+
+ private int m_CornerRadius = 10;
+
+ public int CornerRadius
+ {
+ get { return m_CornerRadius; }
+ set { m_CornerRadius = value; Invalidate(); }
+ }
+
+ private int m_TopIndex = 0;
+
+ public int TopIndex
+ {
+ get { return m_TopIndex; }
+ set { m_TopIndex = value; Invalidate(); }
+ }
+
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public TabMark()
+ {
+ SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.Opaque | ControlStyles.UserPaint | ControlStyles.DoubleBuffer | ControlStyles.Selectable | ControlStyles.UserMouse, true);
+ m_StringFormat.Alignment = StringAlignment.Center;
+ m_StringFormat.LineAlignment = StringAlignment.Center;
+ }
+
+ protected override void Dispose(bool disposing)
+ {
+ m_StringFormat.Dispose();
+ base.Dispose(disposing);
+ }
+
+ #endregion
+
+ #region ★★★★★ Control Event ★★★★★
+
+ protected override void OnPaint(PaintEventArgs e)
+ {
+ base.OnPaint(e);
+
+ try
+ {
+ GdiPlus.FillRectangle(e.Graphics, BackColor, ClientRectangle);
+
+ if (m_TabCount <= 0 || m_TabKeyList.Count == 0 || m_TabTextList.Count == 0)
+ {
+ return;
+ }
+
+ //余白取る
+ Rectangle allRect = new Rectangle(ClientRectangle.X + this.Margin.Left, ClientRectangle.Y + this.Margin.Top,
+ ClientRectangle.Width - this.Margin.Left - this.Margin.Right, ClientRectangle.Height - this.Margin.Top - this.Margin.Bottom);
+
+ //描く領域の確定
+ bool showScroll = (m_TabKeyList.Count > m_TabCount);
+ if (showScroll)
+ {
+ m_RightRect = new Rectangle(ClientRectangle.Width - (m_ScrollButtonWidth + this.Margin.Right), allRect.Y, m_ScrollButtonWidth, allRect.Height);
+ DrawCell(e.Graphics, m_RightRect, m_ScrollRightText, m_ScrollButtonBackColorMin, m_ScrollButtonBackColorMax, m_ScrollButtonForeColor, m_ScrollButtonForeColor, false, m_FocusIndex == -3);
+
+ m_LeftRect = new Rectangle(ClientRectangle.Width - m_ScrollButtonWidth * 2 - m_TabSpace - this.Margin.Right, allRect.Y, m_ScrollButtonWidth, allRect.Height);
+ DrawCell(e.Graphics, m_LeftRect, m_ScrollLeftText, m_ScrollButtonBackColorMin, m_ScrollButtonBackColorMax, m_ScrollButtonForeColor, m_ScrollButtonForeColor, false, m_FocusIndex == -2);
+ }
+
+ m_TabRect.Clear();
+ int tabWidth = allRect.Width - (showScroll ? (m_ScrollButtonWidth * 2 + m_TabSpace) : 0);
+ int tabCellWidth = (tabWidth - m_TabSpace * m_TabCount) / m_TabCount;
+ int x = allRect.X;
+ for (int i = 0; i < m_TabCount; i++)
+ {
+ if ((m_TopIndex + i) > (m_TabTextList.Count - 1)) { break; }
+ m_TabRect.Add(new Rectangle(x, allRect.Y, tabCellWidth, allRect.Height));
+
+ int dataIndex = (m_FirstColFrozen && i == 0) ? 0 : (m_TopIndex + i);
+ TabMarkFormatEventArgs eventArgs = new TabMarkFormatEventArgs(false, null, m_TabForeColor, m_SelectForeColor, m_TabKeyList[dataIndex]);
+ if (CellFormat != null)
+ {
+ CellFormat(this, eventArgs);
+ if (eventArgs.Cancel) { continue; }
+ }
+
+ DrawCell(e.Graphics, m_TabRect[i], m_TabTextList[dataIndex], m_TabBackColorMin, m_TabBackColorMax, eventArgs.TabForeColor, eventArgs.TabSelForeColor, m_SelectIndex == (m_TopIndex + i), m_FocusIndex == i);
+ x += (tabCellWidth + m_TabSpace);
+ }
+ }
+ catch
+ {
+ }
+ }
+
+ protected override void OnMouseWheel(MouseEventArgs e)
+ {
+ if (e.Delta > 0)
+ {
+ if (m_TabKeyList.Count - m_TopIndex > m_TabCount) { m_TopIndex++; }
+ }
+ else
+ {
+ if (m_TopIndex > 0) { m_TopIndex--; }
+ }
+ base.OnMouseWheel(e);
+ Invalidate();
+ }
+
+ protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
+ {
+ if (keyData == Keys.Tab)
+ return true;
+ if (keyData == (Keys.Tab | Keys.Shift))
+ return true;
+
+ int orgIndex = m_SelectIndex;
+ switch (keyData)
+ {
+ case Keys.Left:
+ if (m_SelectIndex > 0) { m_SelectIndex--; }
+ if (m_SelectIndex == 0)
+ {
+ m_TopIndex = 0;
+ }
+ else if (m_SelectIndex == m_TopIndex)
+ {
+ m_TopIndex--;
+ }
+ if (orgIndex != m_SelectIndex)
+ {
+ Invalidate();
+ if (SelectedIndexChanged != null) { SelectedIndexChanged(this, new EventArgs()); }
+ }
+ return true;
+ case Keys.Right:
+ if (m_SelectIndex < (m_TabKeyList.Count - 1)) { m_SelectIndex++; }
+ if (m_SelectIndex == (m_TopIndex + m_TabCount - 1) && m_SelectIndex < (m_TabKeyList.Count - 1))
+ {
+ m_TopIndex++;
+ }
+ if (orgIndex != m_SelectIndex)
+ {
+ Invalidate();
+ if (SelectedIndexChanged != null) { SelectedIndexChanged(this, new EventArgs()); }
+ }
+ return true;
+ }
+
+
+ return base.ProcessCmdKey(ref msg, keyData);
+ }
+
+ protected override void OnMouseClick(MouseEventArgs e)
+ {
+ base.OnMouseClick(e);
+
+ HitTestInfo item = HitTest(e.X, e.Y);
+ if (item.Type == HitDownSquare.Tab)
+ {
+ int orgIndex = m_SelectIndex;
+
+ if (m_FirstColFrozen && item.Index == 0)
+ {
+ m_SelectIndex = 0;
+ }
+ else
+ {
+ m_SelectIndex = m_TopIndex + item.Index;
+
+ if ((item.Index + 1) == m_TabCount && m_SelectIndex < (m_TabKeyList.Count - 1))
+ {
+ //最後へ
+ m_TopIndex++;
+ }
+ else if (item.Index == 0 && m_SelectIndex != 0)
+ {
+ m_TopIndex--;
+ }
+ }
+ //m_LastMouseClickIndex = item.Index;
+
+ Invalidate();
+ if (orgIndex != m_SelectIndex)
+ {
+ if (SelectedIndexChanged != null) { SelectedIndexChanged(this, new EventArgs()); }
+ }
+ }
+ else if (item.Type == HitDownSquare.Left)
+ {
+ if (m_TopIndex > 0) { m_TopIndex--; }
+ }
+ else if (item.Type == HitDownSquare.Right)
+ {
+ if (m_TabKeyList.Count - m_TopIndex > m_TabCount) { m_TopIndex++; }
+ }
+ }
+
+ protected override void OnMouseMove(MouseEventArgs e)
+ {
+ HitTestInfo item = HitTest(e.X, e.Y);
+ m_FocusIndex = -1;
+ if (item.Type == HitDownSquare.Tab)
+ {
+ m_FocusIndex = item.Index;
+ }
+ else if (item.Type == HitDownSquare.Left)
+ {
+ m_FocusIndex = -2;
+ }
+ else if (item.Type == HitDownSquare.Right)
+ {
+ m_FocusIndex = -3;
+ }
+
+ Invalidate();
+ base.OnMouseMove(e);
+ }
+
+ protected override void OnMouseLeave(System.EventArgs e)
+ {
+ //HitTestInfo item = HitTest(MousePosition.X, MousePosition.Y);
+ m_FocusIndex = -1;
+ Invalidate();
+ base.OnMouseLeave(e);
+ }
+
+ protected override void OnMouseDown(MouseEventArgs e)
+ {
+ m_IsMouseDown = true;
+ Invalidate();
+ base.OnMouseDown(e);
+ }
+
+ protected override void OnMouseUp(MouseEventArgs e)
+ {
+ m_IsMouseDown = false;
+ Invalidate();
+ base.OnMouseUp(e);
+ }
+
+ protected override void OnResize(System.EventArgs e)
+ {
+ Invalidate();
+ base.OnResize(e);
+ }
+
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+
+ private void DrawCell(Graphics g, Rectangle ClientRectangle, string text, Color minBackColor, Color maxBackColor, Color foreColor, Color selForeColor, bool isSel, bool isFocus)
+ {
+ bool newflag = false;
+
+ //背景
+ Color bColorMax = isFocus ? (m_IsMouseDown ? m_MouseDownBackColorMax : (isSel ? ControlPaint.Light(m_SelectBackColorMin) : m_FocusBackColorMin)) : (isSel ? m_SelectBackColorMin : minBackColor);
+ Color bColorMin = isFocus ? (m_IsMouseDown ? m_MouseDownBackColorMin : (isSel ? ControlPaint.Light(m_SelectBackColorMax) : m_FocusBackColorMax)) : (isSel ? m_SelectBackColorMax : maxBackColor);
+ using (LinearGradientBrush lgBrush = new LinearGradientBrush(ClientRectangle, bColorMax, bColorMin, LinearGradientMode.Vertical))
+ {
+ lgBrush.SetSigmaBellShape(0.4f, 0.45f); //创建基于钟形曲线的渐变过渡过程。
+
+ if (m_TabStyle == AngleStyle.Round)
+ {
+ GdiPlus.FillRoundRectangle(g, lgBrush, ClientRectangle, m_CornerRadius);
+ }
+ else
+ {
+ g.FillRectangle(lgBrush, ClientRectangle);
+ }
+ }
+
+ //枠線
+ Color bColor = (isFocus || isSel) ? m_SelectBorderColor : m_BorderColor;
+ newflag = bColor.IsSystemColor;
+ Pen pen = newflag ? SystemPens.FromSystemColor(bColor) : new Pen(bColor);
+ if (m_TabStyle == AngleStyle.Round)
+ {
+ GdiPlus.DrawRoundRectangle(g, pen, ClientRectangle, m_CornerRadius);
+ }
+ else
+ {
+ g.DrawRectangle(pen, ClientRectangle.X, ClientRectangle.Y, ClientRectangle.Width - 1, ClientRectangle.Height - 1);
+ }
+ if (!newflag) { pen.Dispose(); }
+
+ //文言
+ newflag = foreColor.IsSystemColor;
+ Color brushColor = isFocus ? (isSel ? ControlPaint.Light(selForeColor) : ControlPaint.Light(foreColor)) : (isSel ? selForeColor : foreColor);
+ SolidBrush brush = newflag ? SystemBrushes.FromSystemColor(brushColor) as SolidBrush : new SolidBrush(brushColor);
+ if (isSel)
+ {
+ using (Font f = new Font(this.Font, FontStyle.Bold)) { g.DrawString(text, f, brush, ClientRectangle, m_StringFormat); }
+ }
+ else
+ {
+ g.DrawString(text, this.Font, brush, ClientRectangle, m_StringFormat);
+ }
+ if (!newflag) { brush.Dispose(); }
+ }
+
+
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+
+ public HitTestInfo HitTest(int x, int y)
+ {
+ HitTestInfo hit = new HitTestInfo();
+ hit.x = x;
+ hit.y = y;
+
+ if (m_LeftRect.Contains(x, y))
+ {
+ hit.type = HitDownSquare.Left;
+ return hit;
+ }
+
+ if (m_RightRect.Contains(x, y))
+ {
+ hit.type = HitDownSquare.Right;
+ return hit;
+ }
+
+ for (int i = 0; i < m_TabRect.Count; i++)
+ {
+ if (m_TabRect[i].Contains(x, y))
+ {
+ hit.type = HitDownSquare.Tab;
+ hit.index = i;
+ return hit;
+ }
+ }
+
+ return HitTestInfo.Nowhere;
+ }
+
+ public void AddItem(string key, string text)
+ {
+ m_TabKeyList.Add(key);
+ m_TabTextList.Add(text);
+ Invalidate();
+ }
+
+ public void Clear()
+ {
+ m_FocusIndex = -1;
+ m_SelectIndex = 0;
+ m_TopIndex = 0;
+ m_TabKeyList.Clear();
+ m_TabTextList.Clear();
+ Invalidate();
+ }
+
+ public void RemoveItem(string key)
+ {
+ int index = m_TabKeyList.IndexOf(key);
+ if (index >= 0) { RemoveItem(index); }
+ }
+
+ public void RemoveItem(int index)
+ {
+ m_TabKeyList.RemoveAt(index);
+ m_TabTextList.RemoveAt(index);
+ Invalidate();
+ }
+
+ public void SetIndexByKey(string key)
+ {
+ for (int i = 0; i < m_TabKeyList.Count; i++)
+ {
+ if (m_TabKeyList[i] == key)
+ {
+ SelectIndex = i;
+ break;
+ }
+ }
+ }
+
+ public string GetKey(int index)
+ {
+ return m_TabKeyList.Count == 0 ? string.Empty : m_TabKeyList[index];
+ }
+
+ public string GetText(int index)
+ {
+ return m_TabTextList.Count == 0 ? string.Empty : m_TabTextList[index];
+ }
+
+ #endregion
+ }
+}
diff --git a/HotelPms.Share.Windows/Component/TabMarkFormatEventArgs.cs b/HotelPms.Share.Windows/Component/TabMarkFormatEventArgs.cs
new file mode 100644
index 0000000..945f161
--- /dev/null
+++ b/HotelPms.Share.Windows/Component/TabMarkFormatEventArgs.cs
@@ -0,0 +1,86 @@
+using System;
+using System.Drawing;
+
+namespace HotelPms.Share.Windows.Component
+{
+ public delegate void CellFormatEventHandler(object sender, TabMarkFormatEventArgs e);
+
+ public class TabMarkFormatEventArgs : EventArgs
+ {
+ private bool cancel = false;
+ private object tag = null;
+
+ public object Tag
+ {
+ get { return tag; }
+ set { tag = value; }
+ }
+
+ public bool Cancel
+ {
+ get { return cancel; }
+ set { cancel = value; }
+ }
+
+ private Color m_ScrollButtonBackColorMax = Color.FromArgb(255, 86, 157, 229);
+
+ public Color ScrollButtonBackColorMax
+ {
+ get { return m_ScrollButtonBackColorMax; }
+ set { m_ScrollButtonBackColorMax = value; }
+ }
+
+ private Color m_ScrollButtonBackColorMin = Color.FromArgb(255, 229, 240, 251);
+
+ public Color ScrollButtonBackColorMin
+ {
+ get { return m_ScrollButtonBackColorMin; }
+ set { m_ScrollButtonBackColorMin = value; }
+ }
+
+ private Color m_ScrollButtonForeColor = Color.Black;
+
+ public Color ScrollButtonForeColor
+ {
+ get { return m_ScrollButtonForeColor; }
+ set { m_ScrollButtonForeColor = value; }
+ }
+
+ private Color m_TabForeColor = Color.Black;
+
+ public Color TabForeColor
+ {
+ get { return m_TabForeColor; }
+ set { m_TabForeColor = value; }
+ }
+
+
+ private Color m_TabSelForeColor = Color.Black;
+
+ public Color TabSelForeColor
+ {
+ get { return m_TabSelForeColor; }
+ set { m_TabSelForeColor = value; }
+ }
+ private string m_Key = string.Empty;
+
+ public string Key
+ {
+ get { return m_Key; }
+ set { m_Key = value; }
+ }
+
+ public TabMarkFormatEventArgs()
+ {
+ }
+
+ public TabMarkFormatEventArgs(bool cancel, object tag, Color tabForeColor, Color tabSelForeColor, string key)
+ {
+ this.Cancel = cancel;
+ this.Tag = tag;
+ this.TabForeColor = tabForeColor;
+ this.TabSelForeColor = tabSelForeColor;
+ this.Key = key;
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/Component/TextBoxFurigana.cs b/HotelPms.Share.Windows/Component/TextBoxFurigana.cs
new file mode 100644
index 0000000..80acad3
--- /dev/null
+++ b/HotelPms.Share.Windows/Component/TextBoxFurigana.cs
@@ -0,0 +1,320 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.ComponentModel;
+using System.Drawing;
+using System.Windows.Forms;
+using System.Runtime.InteropServices;
+
+namespace HotelPms.Share.Windows.Component
+{
+ /// <summary>
+ /// 拡張機能を持ったTextBoxです。
+ /// IMEを利用して入力したコンテキストを従属するコントロールまたはイベントイベントデータとして渡す機能を持ったTextBox。
+ /// 使用例:全角入力された文字を半角カナ文字に変換して渡す。
+ /// </summary>
+ [ToolboxBitmap(typeof(System.Windows.Forms.TextBox))]
+ public class TextBoxFurigana : CTextBox
+ {
+ /// <summary>
+ /// ImeComposed イベントを処理するメソッドを表します。
+ /// </summary>
+ /// <param name="sender">イベントのソース。</param>
+ /// <param name="e">変換文字列情報。</param>
+ public delegate void ImeComposedEventHandler(object sender, ImeComposedEventArgs e);
+
+ /// <summary>
+ /// IME入力文字が確定されたとき発生するイベントを定義します。
+ /// </summary>
+ [Description("IME入力文字が確定されたとき発生するイベントです。"), Category("キー")]
+ public event ImeComposedEventHandler ImeComposed = null;
+
+ private const int WM_CHAR = 0x0102;
+ private const int WM_IME_COMPOSITION = 0x010F;
+ private const int GCS_RESULTREADSTR = 0x0200;
+
+ private System.Windows.Forms.Control m_Control = null; // 連結する子コントロール
+
+ /// <summary>
+ /// TextBoxEx クラスの新しいインスタンスを初期化します。
+ /// </summary>
+ public TextBoxFurigana()
+ {
+ }
+
+ /// <summary>指定されたウィンドウに関連付けられている入力コンテキストを取得します。</summary>
+ [DllImport("Imm32.dll")]
+ public static extern int ImmGetContext(IntPtr hWnd);
+
+ /// <summary>変換文字列に関する情報を取得します。</summary>
+ [DllImport("Imm32.dll")]
+ public static extern int ImmGetCompositionString(int hIMC, int dwIndex, StringBuilder lpBuf, int dwBufLen);
+
+ /// <summary>
+ /// 入力コンテキストを解放し、コンテキスト内の関連メモリのロックを解除します。
+ /// アプリケーションで ImmGetContext 関数を呼び出したら、必ず対応する ImmReleaseContext 関数を呼び出さなければなりません。
+ /// </summary>
+ [DllImport("Imm32.dll")]
+ public static extern bool ImmReleaseContext(IntPtr hWnd, int hIMC);
+
+ // IMEの状態取得
+ [DllImport("Imm32.dll")]
+ private static extern int ImmGetOpenStatus(int hIMC);
+
+ /// <summary>
+ /// 従属するコントロールを取得または設定します。
+ /// </summary>
+ [Description("連結する子コントロールを取得または設定します。"), Category("動作"), DefaultValue(null)]
+ public Control ChildControl
+ {
+ get { return m_Control; }
+ set { m_Control = value; }
+ }
+
+
+
+ /// <summary>
+ /// キーが押された時呼ばれます。
+ /// </summary>
+ /// <param name="m">処理対象の System.Windows.Forms.Message。</param>
+ protected override void WndProc(ref Message m)
+ {
+ if ((ImeComposed != null || ChildControl != null))
+ {
+ if (m.Msg == WM_IME_COMPOSITION)
+ {
+ // 変換が確定状態か確認する
+ if (((int)m.LParam & GCS_RESULTREADSTR) > 0)
+ {
+ // 入力コンテキストを取得します
+ int hIMC = ImmGetContext(this.Handle);
+
+ //int status = ImmGetOpenStatus(hIMC);
+
+ // 変換文字列に関する情報を取得するのに必要なバッファサイズを取得します。
+ int strLen = ImmGetCompositionString(hIMC, GCS_RESULTREADSTR, null, 0);
+
+ // 文字列バッファを確保します。
+ StringBuilder str = new StringBuilder(strLen);
+
+ // 変換文字列に関する情報を取得します。
+ ImmGetCompositionString(hIMC, GCS_RESULTREADSTR, str, str.Capacity);
+
+ // 入力コンテキストを解放します。
+ ImmReleaseContext(this.Handle, hIMC);
+
+ //System.Diagnostics.Debug.WriteLine(string.Format("Status:{0},String:{1}",status, str.ToString(0, strLen)));
+
+ //イベントデータの設定&起動
+ if (ImeComposed != null)
+ {
+ //文字列を対象長さ分切り出して(後ろのゴミを排除して)イベントデータを生成する
+ if (str.Length >= strLen)
+ {
+ ImeComposed(this, new ImeComposedEventArgs(str.ToString(0, strLen), GetSelectionMode()));
+ }
+ }
+
+ //従属コントロールに入力文字文字列を設定する
+ if (ChildControl != null)
+ {
+ if (str.Length >= strLen)
+ {
+ SetCompositionStr(ChildControl, str.ToString(0, strLen));
+ }
+ else
+ {
+ //MessageBox.Show("エラー::取得する長さが異常です。" + "Text=" + str.ToString() + "/長さ=" + str.Length + "/取得長さ=" + strLen);
+ //SetCompositionStr(ChildControl, str.ToString(0, str.Length));
+ }
+ }
+ }
+ else if ((int)m.LParam == 6144)
+ {
+ try
+ {
+ //従属コントロールに入力文字文字列を設定する
+ if (ChildControl != null)
+ {
+ //従属コントロールに入力文字文字列を設定
+ if (InputLanguage.CurrentInputLanguage.LayoutName.Contains("ATOK")) { SetCompositionStr(ChildControl, " "); }
+ }
+ }
+ catch { }
+ }
+ }
+ else if (m.Msg == WM_CHAR)
+ {
+ //半角英数字 //20121002 毛利 Redmine#2795 #2796
+ int hIMC = ImmGetContext(this.Handle);
+ if (ImmGetOpenStatus(hIMC) == 0)
+ {
+ char chr = Convert.ToChar(m.WParam.ToInt32() & 0xff);
+
+ if (m.WParam.ToInt32() >= 32)
+ {
+ //イベント起動
+ string str = chr.ToString();
+ //System.Diagnostics.Debug.WriteLine(string.Format("String:{0}", str));
+
+ //イベントデータの設定&起動
+ if (ImeComposed != null)
+ {
+ ImeComposed(this, new ImeComposedEventArgs(str, GetSelectionMode()));
+ }
+
+ //従属コントロールに入力文字文字列を設定する
+ if (ChildControl != null)
+ {
+ try
+ {
+ //従属コントロールに入力文字文字列を設定
+ SetCompositionStr(ChildControl, str);
+ }
+ catch { }
+ }
+ }
+ }
+ ImmReleaseContext(this.Handle, hIMC);
+ }
+ }
+
+ //if (!this.IsDisposed)
+ //{
+ // if (this.Parent != null)
+ // {
+ // if (!base.IsDisposed)
+ // {
+ // try
+ // {
+ base.WndProc(ref m);
+ // }
+ // catch
+ // {
+ // //伝票入力で存在するコードを入力した後、科目名のテキストボックスをクリックすると
+ // //なんかここで落ちてた。回避の方法がよくわからないので、とりあえずtry-catchで。
+ // }
+ // }
+ // }
+ //}
+ }
+
+ /// <summary>
+ /// 従属するコントロールに入力文字を設定するメッソド
+ /// </summary>
+ /// <param name="cntl">入力した文字列を設定するコントロール。</param>
+ /// <param name="inputStr">IMEを利用して入力した文字列。</param>
+ protected virtual void SetCompositionStr(System.Windows.Forms.Control cntl, string inputStr)
+ {
+ // 入力開始位置が先頭か確認する
+
+ inputStr.Replace("'", string.Empty);
+ if (this.SelectionStart == 0)
+ {
+ // 選択範囲が既入力文字列全体と一致するか確認する
+
+ if (this.SelectionLength == this.Text.Length)
+ {
+ // 既入力文字列を選択して入力する場合、入力文字列で置換える
+ cntl.Text = inputStr;
+ }
+ else
+ {
+ // 既入力文字列の先頭に入力文字列を挿入する
+ cntl.Text = inputStr + cntl.Text;
+ }
+ }
+ else
+ {
+ // 先頭以外の場合、全て追加設定する
+ cntl.Text += inputStr;
+ }
+
+ //20100108 ogi DBの制限を超えないように対応
+ if (cntl.Text.Length > (cntl as TextBox).MaxLength) { cntl.Text = cntl.Text.Substring(0, (cntl as TextBox).MaxLength); }
+ }
+
+ private int GetSelectionMode()
+ {
+ if (this.SelectionStart == 0)
+ {
+ // 選択範囲が既入力文字列全体と一致するか確認する
+ if (this.SelectionLength == this.Text.Length)
+ {
+ return 0;
+ }
+ else
+ {
+ // 既入力文字列の先頭に入力文字列を挿入する
+ return 1;
+ }
+ }
+ else
+ {
+ // 先頭以外の場合、全て追加設定する
+ return 2;
+ }
+
+ }
+
+ /// <summary>
+ /// COMMENT:202061012 毛利 機能追加
+ /// メインテキストが空白になった場合、子テキストも空白に。
+ /// </summary>
+ /// <param name="e"></param>
+ protected override void OnTextChanged(EventArgs e)
+ {
+ if (this.Text == "")
+ {
+ if (ChildControl != null) { this.ChildControl.Text = ""; }
+ if (ImeComposed != null) { ImeComposed(this, new ImeComposedEventArgs(string.Empty, 3)); }
+ }
+
+ base.OnTextChanged(e);
+ }
+
+ /// <summary>
+ /// 変換文字列情報イベントデータ。
+ /// </summary>
+ [Serializable]
+ public class ImeComposedEventArgs : System.EventArgs
+ {
+ /// <summary>変換文字列。</summary>
+ private string m_InputStr;
+ private int m_SelectionMode; //0:置換える、1:先頭に挿入、2:追加
+
+ /// <summary>
+ /// 変換文字列情報イベントデータクラスの新しいインスタンスを初期化します。
+ /// </summary>
+ public ImeComposedEventArgs()
+ {
+ m_InputStr = "";
+ }
+ /// <summary>
+ /// 変換文字列情報イベントデータクラスの新しいインスタンスを初期化します。
+ /// </summary>
+ /// <param name="inputStr">IMEを利用して入力した文字列。</param>
+ public ImeComposedEventArgs(string inputStr, int selectionMode)
+ {
+ m_InputStr = inputStr;
+ m_SelectionMode = selectionMode;
+ }
+
+ /// <summary>
+ /// IMEを利用して入力した文字列を取得します。
+ /// </summary>
+ public string InputString
+ {
+ get { return m_InputStr; }
+ }
+
+ /// <summary>
+ /// 0:置換える、1:先頭に挿入、2:追加
+ /// </summary>
+ public int SelectionMode
+ {
+ get { return m_SelectionMode; }
+ }
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/Component/TreeMenu.cs b/HotelPms.Share.Windows/Component/TreeMenu.cs
new file mode 100644
index 0000000..57cf5b3
--- /dev/null
+++ b/HotelPms.Share.Windows/Component/TreeMenu.cs
@@ -0,0 +1,727 @@
+using HotelPms.Share.Windows.GraphicsApi;
+using HotelPms.Share.Windows.Util;
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Windows.Forms;
+using System.Windows.Forms.VisualStyles;
+
+namespace HotelPms.Share.Windows.Component
+{
+ public class TreeMenu : System.Windows.Forms.Control
+ {
+ #region ★★★★★ Declartions ★★★★★
+
+ public enum HitDownSquare : int
+ {
+ None = 0,
+ Left,
+ Right,
+ Tab,
+ }
+
+ public enum AngleStyle : int
+ {
+ /// <summary>
+ /// 直角
+ /// </summary>
+ Normal = 0,
+ /// <summary>
+ /// 円角
+ /// </summary>
+ Round = 1
+ }
+
+ public sealed class HitTestInfo
+ {
+ public static readonly HitTestInfo Nowhere;
+
+ internal int y;
+ internal int x;
+ internal int index = 0;
+ internal HitDownSquare type;
+
+ static HitTestInfo()
+ {
+ HitTestInfo.Nowhere = new HitTestInfo();
+ }
+
+ internal HitTestInfo()
+ {
+ this.type = HitDownSquare.None;
+ this.x = -1;
+ this.y = -1;
+ }
+
+ public int Index { get { return index; } }
+
+ public int X
+ {
+ get { return this.x; }
+ }
+
+ public int Y
+ {
+ get { return this.y; }
+ }
+
+ public HitDownSquare Type
+ {
+ get { return this.type; }
+ }
+
+ public override int GetHashCode()
+ {
+ return this.x << 16 | this.y << 8 | (int)this.type;
+ }
+
+ public override bool Equals(object obj)
+ {
+ HitTestInfo hi = obj as HitTestInfo;
+ return (this.type == hi.type && this.x == hi.x && this.x == hi.x);
+ }
+
+ public override string ToString()
+ {
+ return string.Concat(new string[7] { "{ ", this.type.ToString(), ",", this.x.ToString(), ",", this.y.ToString(), "}" });
+ }
+ }
+
+
+ public event CellFormatEventHandler CellFormat = null;
+ public event EventHandler SelectedIndexChanged = null;
+
+ private Rectangle m_LeftRect;
+ private Rectangle m_RightRect;
+ private List<Rectangle> m_TabRect = new List<Rectangle>();
+ private StringFormat m_StringFormat = new StringFormat(StringFormatFlags.NoWrap);
+ private int m_TabCount = 3;
+ private int m_FocusIndex = -1;
+ private bool m_IsMouseDown = false;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+
+ //private int m_LastMouseClickIndex = -1;
+ //public int LastMouseClickIndex
+ //{
+ // get { return m_LastMouseClickIndex; }
+ // set { m_LastMouseClickIndex = value; }
+ //}
+
+ private bool m_FirstColFrozen = false;
+ public bool FirstColFrozen
+ {
+ get { return m_FirstColFrozen; }
+ set { m_FirstColFrozen = value; }
+ }
+
+ private Color m_SelectBorderColor = Color.FromArgb(255, 86, 157, 229);
+
+ public Color SelectBorderColor
+ {
+ get { return m_SelectBorderColor; }
+ set { m_SelectBorderColor = value; }
+ }
+
+ private Color m_FocusBackColorMax = Color.FromArgb(255, 228, 240, 252);
+
+ public Color FocusBackColorMax
+ {
+ get { return m_FocusBackColorMax; }
+ set { m_FocusBackColorMax = value; }
+ }
+ private Color m_FocusBackColorMin = Color.FromArgb(255, 234, 243, 252);
+
+ public Color FocusBackColorMin
+ {
+ get { return m_FocusBackColorMin; }
+ set { m_FocusBackColorMin = value; }
+ }
+
+ private Color m_MouseDownBackColorMax = Color.FromArgb(255, 207, 230, 252);
+
+ public Color MouseDownBackColorMax
+ {
+ get { return m_MouseDownBackColorMax; }
+ set { m_MouseDownBackColorMax = value; }
+ }
+ private Color m_MouseDownBackColorMin = Color.FromArgb(255, 217, 235, 252);
+
+ public Color MouseDownBackColorMin
+ {
+ get { return m_MouseDownBackColorMin; }
+ set { m_MouseDownBackColorMin = value; }
+ }
+
+ /// <summary>
+ /// 表示タブの数
+ /// </summary>
+ public int TabCount
+ {
+ get { return m_TabCount; }
+ set { m_TabCount = value; Invalidate(); }
+ }
+
+ private int m_ScrollButtonWidth = 35;
+
+ /// <summary>
+ /// 浸り右
+ /// </summary>
+ public int ScrollButtonWidth
+ {
+ get { return m_ScrollButtonWidth; }
+ set { m_ScrollButtonWidth = value; Invalidate(); }
+ }
+
+ private Color m_ScrollButtonBackColorMax = Color.FromArgb(255, 86, 157, 229);
+
+ public Color ScrollButtonBackColorMax
+ {
+ get { return m_ScrollButtonBackColorMax; }
+ set { m_ScrollButtonBackColorMax = value; Invalidate(); }
+ }
+
+ private Color m_ScrollButtonBackColorMin = Color.FromArgb(255, 229, 240, 251);
+
+ public Color ScrollButtonBackColorMin
+ {
+ get { return m_ScrollButtonBackColorMin; }
+ set { m_ScrollButtonBackColorMin = value; Invalidate(); }
+ }
+
+ private Color m_ScrollButtonForeColor = Color.Black;
+
+ public Color ScrollButtonForeColor
+ {
+ get { return m_ScrollButtonForeColor; }
+ set { m_ScrollButtonForeColor = value; Invalidate(); }
+ }
+ private Image m_ScrollButtonImage = null;
+
+ public Image ScrollButtonImage
+ {
+ get { return m_ScrollButtonImage; }
+ set { m_ScrollButtonImage = value; Invalidate(); }
+ }
+
+ private string m_ScrollLeftText = "<<";
+
+ public string ScrollLeftText
+ {
+ get { return m_ScrollLeftText; }
+ set { m_ScrollLeftText = value; Invalidate(); }
+ }
+
+ private string m_ScrollRightText = ">>";
+
+ public string ScrollRightText
+ {
+ get { return m_ScrollRightText; }
+ set { m_ScrollRightText = value; Invalidate(); }
+ }
+
+ private List<string> m_TabKeyList = new List<string>();
+
+ //public List<string> TabKeyList
+ //{
+ // get { return m_TabKeyList; }
+ // set { m_TabKeyList = value; }
+ //}
+ private List<string> m_TabTextList = new List<string>();
+
+ //public List<string> TabTextList
+ //{
+ // get { return m_TabTextList; }
+ // set { m_TabTextList = value; }
+ //}
+ private int m_SelectIndex = 0;
+
+ public int SelectIndex
+ {
+ get { return m_SelectIndex; }
+ set
+ {
+ m_SelectIndex = value;
+ if(m_TabKeyList.Count > 0 && m_TabCount > 0)
+ {
+ if (m_SelectIndex < m_TopIndex) { m_TopIndex = (m_SelectIndex - 1 < 0) ? 0 : (m_SelectIndex - 1); }
+ if ((m_TopIndex + m_TabCount - 1) < m_SelectIndex)
+ {
+ m_TopIndex = m_SelectIndex - m_TabCount + 2;
+ if ((m_TopIndex + m_TabCount - 1) > (m_TabKeyList.Count - 1)) { m_TopIndex = m_SelectIndex - m_TabCount + 1; }
+ }
+ if ((m_TopIndex + m_TabCount - 1) == m_SelectIndex && m_SelectIndex < (m_TabKeyList.Count - 1)) { m_TopIndex++; }
+ }
+ Invalidate();
+ }
+ }
+
+ public string SelectKey
+ {
+ get { return m_TabKeyList.Count == 0 ? string.Empty : m_TabKeyList[m_SelectIndex]; }
+ }
+
+ public int DataCount
+ {
+ get { return m_TabKeyList.Count; }
+ }
+
+ private Color m_SelectBackColorMin = SystemColors.Control;
+
+ public Color SelectBackColorMin
+ {
+ get { return m_SelectBackColorMin; }
+ set { m_SelectBackColorMin = value; Invalidate(); }
+ }
+
+ private Color m_SelectBackColorMax = SystemColors.Highlight;
+
+ public Color SelectBackColorMax
+ {
+ get { return m_SelectBackColorMax; }
+ set { m_SelectBackColorMax = value; Invalidate(); }
+ }
+ private Color m_SelectForeColor = SystemColors.HighlightText;
+
+ public Color SelectForeColor
+ {
+ get { return m_SelectForeColor; }
+ set { m_SelectForeColor = value; Invalidate(); }
+ }
+ private int m_TabSpace = 2;
+
+ public int TabSpace
+ {
+ get { return m_TabSpace; }
+ set { m_TabSpace = value; Invalidate(); }
+ }
+ private Color m_TabBackColorMax = Color.FromArgb(255, 86, 157, 229);
+
+ public Color TabBackColorMax
+ {
+ get { return m_TabBackColorMax; }
+ set { m_TabBackColorMax = value; Invalidate(); }
+ }
+
+ private Color m_TabBackColorMin = Color.FromArgb(255, 229, 240, 251);
+
+ public Color TabBackColorMin
+ {
+ get { return m_TabBackColorMin; }
+ set { m_TabBackColorMin = value; Invalidate(); }
+ }
+
+ private Color m_TabForeColor = Color.Black;
+
+ public Color TabForeColor
+ {
+ get { return m_TabForeColor; }
+ set { m_TabForeColor = value; Invalidate(); }
+ }
+
+ private Color m_BorderColor = VisualStyleInformation.TextControlBorder;
+
+ public Color BorderColor
+ {
+ get { return m_BorderColor; }
+ set { m_BorderColor = value; Invalidate(); }
+ }
+ private AngleStyle m_TabStyle = AngleStyle.Normal; //0.直 1.円
+
+ public AngleStyle TabStyle
+ {
+ get { return m_TabStyle; }
+ set { m_TabStyle = value; Invalidate(); }
+ }
+
+ private int m_CornerRadius = 10;
+
+ public int CornerRadius
+ {
+ get { return m_CornerRadius; }
+ set { m_CornerRadius = value; Invalidate(); }
+ }
+
+ private int m_TopIndex = 0;
+
+ public int TopIndex
+ {
+ get { return m_TopIndex; }
+ set { m_TopIndex = value; Invalidate(); }
+ }
+
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public TreeMenu()
+ {
+ SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.Opaque | ControlStyles.UserPaint | ControlStyles.DoubleBuffer | ControlStyles.Selectable | ControlStyles.UserMouse, true);
+ m_StringFormat.Alignment = StringAlignment.Center;
+ m_StringFormat.LineAlignment = StringAlignment.Center;
+ }
+
+ protected override void Dispose(bool disposing)
+ {
+ m_StringFormat.Dispose();
+ base.Dispose(disposing);
+ }
+
+ #endregion
+
+ #region ★★★★★ Control Event ★★★★★
+
+ protected override void OnPaint(PaintEventArgs e)
+ {
+ base.OnPaint(e);
+
+ try
+ {
+ GdiPlus.FillRectangle(e.Graphics, BackColor, ClientRectangle);
+
+ if (m_TabCount <= 0 || m_TabKeyList.Count == 0 || m_TabTextList.Count == 0)
+ {
+ return;
+ }
+
+ //余白取る
+ Rectangle allRect = new Rectangle(ClientRectangle.X + this.Margin.Left, ClientRectangle.Y + this.Margin.Top,
+ ClientRectangle.Width - this.Margin.Left - this.Margin.Right, ClientRectangle.Height - this.Margin.Top - this.Margin.Bottom);
+
+ //描く領域の確定
+ bool showScroll = (m_TabKeyList.Count > m_TabCount);
+ if (showScroll)
+ {
+ m_RightRect = new Rectangle(ClientRectangle.Width - (m_ScrollButtonWidth + this.Margin.Right), allRect.Y, m_ScrollButtonWidth, allRect.Height);
+ DrawCell(e.Graphics, m_RightRect, m_ScrollRightText, m_ScrollButtonBackColorMin, m_ScrollButtonBackColorMax, m_ScrollButtonForeColor, m_ScrollButtonForeColor, false, m_FocusIndex == -3);
+
+ m_LeftRect = new Rectangle(ClientRectangle.Width - m_ScrollButtonWidth * 2 - m_TabSpace - this.Margin.Right, allRect.Y, m_ScrollButtonWidth, allRect.Height);
+ DrawCell(e.Graphics, m_LeftRect, m_ScrollLeftText, m_ScrollButtonBackColorMin, m_ScrollButtonBackColorMax, m_ScrollButtonForeColor, m_ScrollButtonForeColor, false, m_FocusIndex == -2);
+ }
+
+ m_TabRect.Clear();
+ int tabWidth = allRect.Width - (showScroll ? (m_ScrollButtonWidth * 2 + m_TabSpace) : 0);
+ int tabCellWidth = (tabWidth - m_TabSpace * m_TabCount) / m_TabCount;
+ int x = allRect.X;
+ for (int i = 0; i < m_TabCount; i++)
+ {
+ if ((m_TopIndex + i) > (m_TabTextList.Count - 1)) { break; }
+ m_TabRect.Add(new Rectangle(x, allRect.Y, tabCellWidth, allRect.Height));
+
+ int dataIndex = (m_FirstColFrozen && i == 0) ? 0 : (m_TopIndex + i);
+ TabMarkFormatEventArgs eventArgs = new TabMarkFormatEventArgs(false, null, m_TabForeColor, m_SelectForeColor, m_TabKeyList[dataIndex]);
+ if (CellFormat != null)
+ {
+ CellFormat(this, eventArgs);
+ if (eventArgs.Cancel) { continue; }
+ }
+
+ DrawCell(e.Graphics, m_TabRect[i], m_TabTextList[dataIndex], m_TabBackColorMin, m_TabBackColorMax, eventArgs.TabForeColor, eventArgs.TabSelForeColor, m_SelectIndex == (m_TopIndex + i), m_FocusIndex == i);
+ x += (tabCellWidth + m_TabSpace);
+ }
+ }
+ catch
+ {
+ }
+ }
+
+ protected override void OnMouseWheel(MouseEventArgs e)
+ {
+ if (e.Delta > 0)
+ {
+ if (m_TabKeyList.Count - m_TopIndex > m_TabCount) { m_TopIndex++; }
+ }
+ else
+ {
+ if (m_TopIndex > 0) { m_TopIndex--; }
+ }
+ base.OnMouseWheel(e);
+ Invalidate();
+ }
+
+ protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
+ {
+ if (keyData == Keys.Tab)
+ return true;
+ if (keyData == (Keys.Tab | Keys.Shift))
+ return true;
+
+ int orgIndex = m_SelectIndex;
+ switch (keyData)
+ {
+ case Keys.Left:
+ if (m_SelectIndex > 0) { m_SelectIndex--; }
+ if (m_SelectIndex == 0)
+ {
+ m_TopIndex = 0;
+ }
+ else if (m_SelectIndex == m_TopIndex)
+ {
+ m_TopIndex--;
+ }
+ if (orgIndex != m_SelectIndex)
+ {
+ Invalidate();
+ if (SelectedIndexChanged != null) { SelectedIndexChanged(this, new EventArgs()); }
+ }
+ return true;
+ case Keys.Right:
+ if (m_SelectIndex < (m_TabKeyList.Count - 1)) { m_SelectIndex++; }
+ if (m_SelectIndex == (m_TopIndex + m_TabCount - 1) && m_SelectIndex < (m_TabKeyList.Count - 1))
+ {
+ m_TopIndex++;
+ }
+ if (orgIndex != m_SelectIndex)
+ {
+ Invalidate();
+ if (SelectedIndexChanged != null) { SelectedIndexChanged(this, new EventArgs()); }
+ }
+ return true;
+ }
+
+
+ return base.ProcessCmdKey(ref msg, keyData);
+ }
+
+ protected override void OnMouseClick(MouseEventArgs e)
+ {
+ base.OnMouseClick(e);
+
+ HitTestInfo item = HitTest(e.X, e.Y);
+ if (item.Type == HitDownSquare.Tab)
+ {
+ int orgIndex = m_SelectIndex;
+
+ if (m_FirstColFrozen && item.Index == 0)
+ {
+ m_SelectIndex = 0;
+ }
+ else
+ {
+ m_SelectIndex = m_TopIndex + item.Index;
+
+ if ((item.Index + 1) == m_TabCount && m_SelectIndex < (m_TabKeyList.Count - 1))
+ {
+ //最後へ
+ m_TopIndex++;
+ }
+ else if (item.Index == 0 && m_SelectIndex != 0)
+ {
+ m_TopIndex--;
+ }
+ }
+ //m_LastMouseClickIndex = item.Index;
+
+ Invalidate();
+ if (orgIndex != m_SelectIndex)
+ {
+ if (SelectedIndexChanged != null) { SelectedIndexChanged(this, new EventArgs()); }
+ }
+ }
+ else if (item.Type == HitDownSquare.Left)
+ {
+ if (m_TopIndex > 0) { m_TopIndex--; }
+ }
+ else if (item.Type == HitDownSquare.Right)
+ {
+ if (m_TabKeyList.Count - m_TopIndex > m_TabCount) { m_TopIndex++; }
+ }
+ }
+
+ protected override void OnMouseMove(MouseEventArgs e)
+ {
+ HitTestInfo item = HitTest(e.X, e.Y);
+ m_FocusIndex = -1;
+ if (item.Type == HitDownSquare.Tab)
+ {
+ m_FocusIndex = item.Index;
+ }
+ else if (item.Type == HitDownSquare.Left)
+ {
+ m_FocusIndex = -2;
+ }
+ else if (item.Type == HitDownSquare.Right)
+ {
+ m_FocusIndex = -3;
+ }
+
+ Invalidate();
+ base.OnMouseMove(e);
+ }
+
+ protected override void OnMouseLeave(System.EventArgs e)
+ {
+ //HitTestInfo item = HitTest(MousePosition.X, MousePosition.Y);
+ m_FocusIndex = -1;
+ Invalidate();
+ base.OnMouseLeave(e);
+ }
+
+ protected override void OnMouseDown(MouseEventArgs e)
+ {
+ m_IsMouseDown = true;
+ Invalidate();
+ base.OnMouseDown(e);
+ }
+
+ protected override void OnMouseUp(MouseEventArgs e)
+ {
+ m_IsMouseDown = false;
+ Invalidate();
+ base.OnMouseUp(e);
+ }
+
+ protected override void OnResize(System.EventArgs e)
+ {
+ Invalidate();
+ base.OnResize(e);
+ }
+
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+
+ private void DrawCell(Graphics g, Rectangle ClientRectangle, string text, Color minBackColor, Color maxBackColor, Color foreColor, Color selForeColor, bool isSel, bool isFocus)
+ {
+ bool newflag = false;
+
+ //背景
+ Color bColorMax = isFocus ? (m_IsMouseDown ? m_MouseDownBackColorMax : (isSel ? ControlPaint.Light(m_SelectBackColorMin) : m_FocusBackColorMin)) : (isSel ? m_SelectBackColorMin : minBackColor);
+ Color bColorMin = isFocus ? (m_IsMouseDown ? m_MouseDownBackColorMin : (isSel ? ControlPaint.Light(m_SelectBackColorMax) : m_FocusBackColorMax)) : (isSel ? m_SelectBackColorMax : maxBackColor);
+ using (LinearGradientBrush lgBrush = new LinearGradientBrush(ClientRectangle, bColorMax, bColorMin, LinearGradientMode.Vertical))
+ {
+ lgBrush.SetSigmaBellShape(0.4f, 0.45f); //创建基于钟形曲线的渐变过渡过程。
+
+ if (m_TabStyle == AngleStyle.Round)
+ {
+ GdiPlus.FillRoundRectangle(g, lgBrush, ClientRectangle, m_CornerRadius);
+ }
+ else
+ {
+ g.FillRectangle(lgBrush, ClientRectangle);
+ }
+ }
+
+ //枠線
+ Color bColor = (isFocus || isSel) ? m_SelectBorderColor : m_BorderColor;
+ newflag = bColor.IsSystemColor;
+ Pen pen = newflag ? SystemPens.FromSystemColor(bColor) : new Pen(bColor);
+ if (m_TabStyle == AngleStyle.Round)
+ {
+ GdiPlus.DrawRoundRectangle(g, pen, ClientRectangle, m_CornerRadius);
+ }
+ else
+ {
+ g.DrawRectangle(pen, ClientRectangle.X, ClientRectangle.Y, ClientRectangle.Width - 1, ClientRectangle.Height - 1);
+ }
+ if (!newflag) { pen.Dispose(); }
+
+ //文言
+ newflag = foreColor.IsSystemColor;
+ Color brushColor = isFocus ? (isSel ? ControlPaint.Light(selForeColor) : ControlPaint.Light(foreColor)) : (isSel ? selForeColor : foreColor);
+ SolidBrush brush = newflag ? SystemBrushes.FromSystemColor(brushColor) as SolidBrush : new SolidBrush(brushColor);
+ if (isSel)
+ {
+ using (Font f = new Font(this.Font, FontStyle.Bold)) { g.DrawString(text, f, brush, ClientRectangle, m_StringFormat); }
+ }
+ else
+ {
+ g.DrawString(text, this.Font, brush, ClientRectangle, m_StringFormat);
+ }
+ if (!newflag) { brush.Dispose(); }
+ }
+
+
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+
+ public HitTestInfo HitTest(int x, int y)
+ {
+ HitTestInfo hit = new HitTestInfo();
+ hit.x = x;
+ hit.y = y;
+
+ if (m_LeftRect.Contains(x, y))
+ {
+ hit.type = HitDownSquare.Left;
+ return hit;
+ }
+
+ if (m_RightRect.Contains(x, y))
+ {
+ hit.type = HitDownSquare.Right;
+ return hit;
+ }
+
+ for (int i = 0; i < m_TabRect.Count; i++)
+ {
+ if (m_TabRect[i].Contains(x, y))
+ {
+ hit.type = HitDownSquare.Tab;
+ hit.index = i;
+ return hit;
+ }
+ }
+
+ return HitTestInfo.Nowhere;
+ }
+
+ public void AddItem(string key, string text)
+ {
+ m_TabKeyList.Add(key);
+ m_TabTextList.Add(text);
+ Invalidate();
+ }
+
+ public void Clear()
+ {
+ m_FocusIndex = -1;
+ m_SelectIndex = 0;
+ m_TopIndex = 0;
+ m_TabKeyList.Clear();
+ m_TabTextList.Clear();
+ Invalidate();
+ }
+
+ public void RemoveItem(string key)
+ {
+ int index = m_TabKeyList.IndexOf(key);
+ if (index >= 0) { RemoveItem(index); }
+ }
+
+ public void RemoveItem(int index)
+ {
+ m_TabKeyList.RemoveAt(index);
+ m_TabTextList.RemoveAt(index);
+ Invalidate();
+ }
+
+ public void SetIndexByKey(string key)
+ {
+ for (int i = 0; i < m_TabKeyList.Count; i++)
+ {
+ if (m_TabKeyList[i] == key)
+ {
+ SelectIndex = i;
+ break;
+ }
+ }
+ }
+
+ public string GetKey(int index)
+ {
+ return m_TabKeyList.Count == 0 ? string.Empty : m_TabKeyList[index];
+ }
+
+ public string GetText(int index)
+ {
+ return m_TabTextList.Count == 0 ? string.Empty : m_TabTextList[index];
+ }
+
+ #endregion
+ }
+}
diff --git a/HotelPms.Share.Windows/GraphicsApi/ColorType.cs b/HotelPms.Share.Windows/GraphicsApi/ColorType.cs
new file mode 100644
index 0000000..2338794
--- /dev/null
+++ b/HotelPms.Share.Windows/GraphicsApi/ColorType.cs
@@ -0,0 +1,26 @@
+namespace HotelPms.Share.Windows.GraphicsApi
+{
+ public class ColorType
+ {
+ public static System.Drawing.Color Control = System.Drawing.Color.FromArgb(255, 236, 233, 216);//System.Drawing.SystemColors.Control
+ public static System.Drawing.Color ButtonFace = System.Drawing.Color.FromArgb(255, 236, 233, 216);//System.Drawing.SystemColors.ButtonFace;
+ public static System.Drawing.Color MenuBar = System.Drawing.Color.FromArgb(255, 236, 233, 216);//System.Drawing.SystemColors.MenuBar
+ public static System.Drawing.Color ActiveCaptionText = System.Drawing.Color.FromArgb(255, 255, 255, 255);//System.Drawing.SystemColors.ActiveCaptionText;
+ public static System.Drawing.Color HighlightText = System.Drawing.Color.FromArgb(255, 255, 255, 255);//System.Drawing.SystemColors.HighlightText
+ public static System.Drawing.Color ControlLightLight = System.Drawing.Color.FromArgb(255, 255, 255, 255);// System.Drawing.SystemColors.ControlLightLight
+ public static System.Drawing.Color Window = System.Drawing.Color.FromArgb(255, 255, 255, 255);//System.Drawing.SystemColors.Window
+ public static System.Drawing.Color GrayText = System.Drawing.Color.FromArgb(255, 172, 168, 153);//System.Drawing.SystemColors.GrayText
+ public static System.Drawing.Color ControlDark = System.Drawing.Color.FromArgb(255, 172, 168, 153); //System.Drawing.SystemColors.ControlDark
+ public static System.Drawing.Color WindowText = System.Drawing.Color.FromArgb(255, 0, 0, 0); //System.Drawing.SystemColors.WindowText
+ public static System.Drawing.Color ControlText = System.Drawing.Color.FromArgb(255, 0, 0, 0);//System.Drawing.SystemColors.ControlText
+ public static System.Drawing.Color Desktop = System.Drawing.Color.FromArgb(255, 0, 78, 152); //System.Drawing.SystemColors.Desktop
+ public static System.Drawing.Color Highlight = System.Drawing.Color.FromArgb(255, 49, 106, 197);//System.Drawing.SystemColors.Highlight
+ public static System.Drawing.Color ControlDarkDark = System.Drawing.Color.FromArgb(255, 113, 111, 100);//System.Drawing.SystemColors.ControlDarkDark
+ public static System.Drawing.Color ActiveCaption = System.Drawing.Color.FromArgb(255, 0, 84, 227);//System.Drawing.SystemColors.ActiveCaption
+ public static System.Drawing.Color GradientInactiveCaption = System.Drawing.Color.FromArgb(255, 157, 185, 235);//System.Drawing.SystemColors.GradientInactiveCaption
+ public static System.Drawing.Color MenuHighlight = System.Drawing.Color.FromArgb(255, 49, 106, 197);//System.Drawing.SystemColors.MenuHighlight
+ public static System.Drawing.Color InactiveBorder = System.Drawing.Color.FromArgb(255, 212, 208, 200); //System.Drawing.SystemColors.InactiveBorder
+ public static System.Drawing.Color InactiveCaptionText = System.Drawing.Color.FromArgb(255, 216, 228, 248);//System.Drawing.BHotel.Lib.Utility.EnvironmentSetting.InactiveCaptionText
+
+ }
+}
diff --git a/HotelPms.Share.Windows/GraphicsApi/GdiPlus.cs b/HotelPms.Share.Windows/GraphicsApi/GdiPlus.cs
new file mode 100644
index 0000000..cf46b81
--- /dev/null
+++ b/HotelPms.Share.Windows/GraphicsApi/GdiPlus.cs
@@ -0,0 +1,175 @@
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Drawing.Imaging;
+
+namespace HotelPms.Share.Windows.GraphicsApi
+{
+ /// <summary>
+ /// UTF8中文转码
+ /// </summary>
+ public static class GdiPlus
+ {
+ /// <summary>
+ /// 等比缩放图片,画到目标区域
+ /// </summary>
+ /// <param name="g"></param>
+ /// <param name="img"></param>
+ /// <param name="tagRect"></param>
+ public static void DrawImage(Graphics g, Bitmap img, Rectangle tagRect)
+ {
+ int width = tagRect.Width;
+ int height = tagRect.Height;
+
+ //Zoom
+ if ((double)img.Width / (double)tagRect.Width < (double)img.Height / (double)tagRect.Height) // image is wider
+ {
+ //例1: img(w=100,h=100) → tag(w=10,h=5) w缩小10倍,h缩小20倍 → 全体缩小20倍 → w=5,h=5
+ width = (int)((double)img.Width / ((double)img.Height / (double)tagRect.Height));
+ }
+ else
+ {
+ //例2: img(w=100,h=100) → tag(w=100,h=500) w缩小1倍,h缩小0.5倍 → 全体缩小1倍 → w=100,h=100
+ height = (int)((double)img.Height / (double)img.Width * (double)tagRect.Width);
+ }
+
+ //居中
+ Rectangle imgRect = new Rectangle(tagRect.X, tagRect.Y, width, height);
+ ImageAttributes vAttr = new ImageAttributes();
+ vAttr.SetColorKey(img.GetPixel(0, 0), img.GetPixel(0, 0));
+ g.DrawImage(img, imgRect, 0, 0, img.Width, img.Height, GraphicsUnit.Pixel, vAttr);
+ }
+
+ public static void FillRectangle(Graphics g, Color color, RectangleF rect)
+ {
+ bool newflag = color.IsSystemColor;
+ SolidBrush brush = newflag ? SystemBrushes.FromSystemColor(color) as SolidBrush : new SolidBrush(color);
+ g.FillRectangle(brush, rect);
+ if (!newflag) { brush.Dispose(); }
+ }
+
+ /// <summary>
+ /// 円角長方形
+ /// </summary>
+ /// <param name="g"></param>
+ /// <param name="pen"></param>
+ /// <param name="rect"></param>
+ /// <param name="cornerRadius"></param>
+ public static void DrawRoundRectangle(Graphics g, Pen pen, RectangleF rect, int cornerRadius)
+ {
+ using (GraphicsPath path = CreateRoundedRectanglePath(rect, cornerRadius))
+ {
+ g.SmoothingMode = SmoothingMode.AntiAlias; //使绘图质量最高,即消除锯齿
+ //g.InterpolationMode = InterpolationMode.HighQualityBicubic; //要らない!!!
+ //g.CompositingQuality = CompositingQuality.HighQuality; //要らない!!!
+ g.DrawPath(pen, path);
+ g.SmoothingMode = SmoothingMode.Default;
+ //g.InterpolationMode = InterpolationMode.Default; //要らない!!!
+ ///g.CompositingQuality = CompositingQuality.Default; //要らない!!!
+ }
+ }
+
+ /// <summary>
+ /// 円角長方形
+ /// </summary>
+ /// <param name="g"></param>
+ /// <param name="brush"></param>
+ /// <param name="rect"></param>
+ /// <param name="cornerRadius"></param>
+ public static void FillRoundRectangle(Graphics g, Brush brush, RectangleF rect, int cornerRadius)
+ {
+ using (GraphicsPath path = CreateRoundedRectanglePath(rect, cornerRadius))
+ {
+ g.SmoothingMode = SmoothingMode.AntiAlias; //使绘图质量最高,即消除锯齿
+ //g.InterpolationMode = InterpolationMode.HighQualityBicubic; //要らない!!!
+ //g.CompositingQuality = CompositingQuality.HighQuality; //要らない!!!
+ g.FillPath(brush, path);
+ g.SmoothingMode = SmoothingMode.Default;
+ //g.InterpolationMode = InterpolationMode.Default; //要らない!!!
+ //g.CompositingQuality = CompositingQuality.Default; //要らない!!!
+ }
+ }
+
+ /// <summary>
+ ///角丸長方形のGraphicsPathを作成します。
+ /// </summary>
+ /// <param name="rect">長方形</param>
+ /// <param name="radius">角丸の半径</param>
+ /// <param name="leftTop">左上は角丸:true 直角:false</param>
+ /// <param name="rightYop">右上は角丸:true 直角:false</param>
+ /// <param name="rightBottom">右下は角丸:true 直角:false</param>
+ /// <param name="leftBottom">左下は角丸:true 直角:false</param>
+ /// <returns></returns>
+ public static GraphicsPath GetRoundRect(RectangleF rect, float radius, bool leftTop, bool rightYop, bool rightBottom, bool leftBottom)
+ {
+ GraphicsPath path = new GraphicsPath();
+ path.StartFigure();
+
+ // 左上の角丸(※枠は正方形、枠の中心は円心)
+ if (leftTop) { path.AddArc(rect.Left, rect.Top, radius * 2, radius * 2, 180, 90); }
+
+ // 上の線
+ path.AddLine(rect.Left + (leftTop ? radius : 0), rect.Top, rect.Right - (rightYop ? radius : 0), rect.Top);
+
+ // 右上の角丸
+ if (rightYop) { path.AddArc(rect.Right - radius * 2, rect.Top, radius * 2, radius * 2, 270, 90); }
+
+ // 右の線
+ path.AddLine(rect.Right, rect.Top + (rightYop ? radius : 0), rect.Right, rect.Bottom - (rightBottom ? radius : 0));
+
+ // 右下の角丸
+ if (rightBottom) { path.AddArc(rect.Right - radius * 2, rect.Bottom - radius * 2, radius * 2, radius * 2, 0, 90); }
+
+ // 下の線
+ path.AddLine(rect.Right - (rightBottom ? radius : 0), rect.Bottom, rect.Left + (leftBottom ? radius : 0), rect.Bottom);
+
+ // 左下の角丸
+ if (leftBottom) { path.AddArc(rect.Left, rect.Bottom - radius * 2, radius * 2, radius * 2, 90, 90); }
+
+ // 左の線
+ path.AddLine(rect.Left, rect.Bottom - (leftBottom ? radius : 0), rect.Left, rect.Top + (leftTop ? radius : 0));
+
+ path.CloseFigure();
+ return path;
+ }
+
+ /// <summary>
+ ///
+ /// </summary>
+ /// <param name="rect"></param>
+ /// <param name="cornerRadius">角丸の半径</param>
+ /// <returns></returns>
+ public static GraphicsPath CreateRoundedRectanglePath(RectangleF rect, int cornerRadius)
+ {
+ GraphicsPath Rect = new GraphicsPath();
+ Rect.StartFigure();
+ Rect.AddArc(rect.X, rect.Y, cornerRadius * 2, cornerRadius * 2, 180, 90);
+ Rect.AddArc(rect.X + rect.Width - cornerRadius * 2 - 1, rect.Y, cornerRadius * 2, cornerRadius * 2, -90, 90);
+ Rect.AddArc(rect.X + rect.Width - cornerRadius * 2 - 1, rect.Y + rect.Height - cornerRadius * 2 - 1, cornerRadius * 2, cornerRadius * 2, 0, 90);
+ Rect.AddArc(rect.X, rect.Bottom - cornerRadius * 2 - 1, cornerRadius * 2, cornerRadius * 2, 90, 90);
+ Rect.CloseFigure();
+ return Rect;
+ }
+
+ /// <summary>
+ /// 対象画像の目標領域より丸い画像を切り出し
+ /// </summary>
+ /// <param name="img">対象画像</param>
+ /// <param name="rec">対象画像の目標領域</param>
+ /// <param name="size">必要な画像サイズ</param>
+ /// <returns></returns>
+ public static Image CutEllipse(Image img, Rectangle rec, Size size)
+ {
+ Bitmap bitmap = new Bitmap(size.Width, size.Height);
+ using (Graphics g = Graphics.FromImage(bitmap))
+ {
+ using (TextureBrush br = new TextureBrush(img, System.Drawing.Drawing2D.WrapMode.Clamp, rec))
+ {
+ br.ScaleTransform(bitmap.Width / (float)rec.Width, bitmap.Height / (float)rec.Height);
+ g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
+ g.FillEllipse(br, new Rectangle(Point.Empty, size));
+ }
+ }
+ return bitmap;
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/GraphicsApi/Geometry.cs b/HotelPms.Share.Windows/GraphicsApi/Geometry.cs
new file mode 100644
index 0000000..6ba49f1
--- /dev/null
+++ b/HotelPms.Share.Windows/GraphicsApi/Geometry.cs
@@ -0,0 +1,119 @@
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HotelPms.Share.Windows.GraphicsApi
+{
+ public class Geometry
+ {
+ /// <summary>
+ /// 任意二点の距離
+ /// </summary>
+ /// <param name="coord1"></param>
+ /// <param name="coord2"></param>
+ /// <returns></returns>
+ public static double Dist2d(PointD coord1, PointD coord2)
+ {
+ double dx = coord1.X - coord2.X;
+ double dy = coord1.Y - coord2.Y;
+ return Math.Sqrt(dx * dx + dy * dy);
+ }
+
+ /// <summary>
+ /// 二点同じ?
+ /// </summary>
+ /// <param name="coord1"></param>
+ /// <param name="coord2"></param>
+ /// <returns></returns>
+ public static bool Equals(PointD coord1, PointD coord2)
+ {
+ return coord1.X == coord2.X && coord1.Y == coord2.Y;
+ }
+
+ /// <summary>
+ /// 平行移動
+ /// </summary>
+ /// <param name="coords"></param>
+ /// <param name="offset"></param>
+ /// <returns></returns>
+ public static IList<PointD> OffsetCoords(IList<PointD> coords, double offset)
+ {
+ var path = new List<PointD>();
+ int N = coords.Count - 1;
+ int max = N;
+ double mi, mi1, li, li1, ri, ri1, si, si1, Xi1, Yi1;
+ PointD p0, p1, p2;
+
+ var isClosed = Equals(coords[0], coords[N]);
+ if (!isClosed)
+ {
+ p0 = coords[0];
+ p1 = coords[1];
+
+ double qq1 = Dist2d(p0, p1);
+ double qq2 = (p1.Y - p0.Y);
+ double qq3 = qq2 / qq1;
+ double qq4 = qq3 * offset;
+ double qq5 = p0.X + qq4;
+
+ p2 = new PointD(p0.X + (p1.Y - p0.Y) / Dist2d(p0, p1) * offset, p0.Y - (p1.X - p0.X) / Dist2d(p0, p1) * offset);
+ path.Add(p2);
+ coords.Add(coords[N].Clone());
+ N++;
+ max--;
+ }
+
+ for (var i = 0; i < max; i++)
+ {
+ p0 = coords[i];
+ p1 = coords[(i + 1) % N];
+ p2 = coords[(i + 2) % N];
+ mi = (p1.Y - p0.Y) / (p1.X - p0.X);
+ mi1 = (p2.Y - p1.Y) / (p2.X - p1.X);
+
+ // Prevent alignements
+ if (Math.Abs(mi - mi1) > 1e-10) //0.0000000001
+ {
+ li = Math.Sqrt((p1.X - p0.X) * (p1.X - p0.X) + (p1.Y - p0.Y) * (p1.Y - p0.Y));
+ li1 = Math.Sqrt((p2.X - p1.X) * (p2.X - p1.X) + (p2.Y - p1.Y) * (p2.Y - p1.Y));
+ ri = p0.X + offset * (p1.Y - p0.Y) / li;
+ ri1 = p1.X + offset * (p2.Y - p1.Y) / li1;
+ si = p0.Y - offset * (p1.X - p0.X) / li;
+ si1 = p1.Y - offset * (p2.X - p1.X) / li1;
+ Xi1 = (mi1 * ri1 - mi * ri + si - si1) / (mi1 - mi);
+ Yi1 = (mi * mi1 * (ri1 - ri) + mi1 * si - mi * si1) / (mi1 - mi);
+
+ // Correction for vertical lines
+ if (p1.X - p0.X == 0)
+ {
+ Xi1 = p1.X + offset * (p1.Y - p0.Y) / Math.Abs(p1.Y - p0.Y);
+ Yi1 = mi1 * Xi1 - mi1 * ri1 + si1;
+ }
+ if (p2.X - p1.X == 0)
+ {
+ Xi1 = p2.X + offset * (p2.Y - p1.Y) / Math.Abs(p2.Y - p1.Y);
+ Yi1 = mi * Xi1 - mi * ri + si;
+ }
+ path.Add(new PointD(Xi1, Yi1));
+ }
+ }
+
+ if (isClosed)
+ {
+ path.Add(path[0].Clone());
+ }
+ else
+ {
+ coords.RemoveAt(coords.Count - 1);
+ p0 = coords[coords.Count - 1];
+ p1 = coords[coords.Count - 2];
+ p2 = new PointD(p0.X - (p1.Y - p0.Y) / Dist2d(p0, p1) * offset, p0.Y + (p1.X - p0.X) / Dist2d(p0, p1) * offset);
+ path.Add(p2);
+ }
+ return path;
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/GraphicsApi/Overlap.cs b/HotelPms.Share.Windows/GraphicsApi/Overlap.cs
new file mode 100644
index 0000000..99d7083
--- /dev/null
+++ b/HotelPms.Share.Windows/GraphicsApi/Overlap.cs
@@ -0,0 +1,295 @@
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+
+namespace HotelPms.Share.Windows.GraphicsApi
+{
+ /// <summary>
+ /// 重ねる判断
+ /// </summary>
+ public static class Overlap
+ {
+ /// <summary>
+ /// 線(a)と線(b)
+ /// </summary>
+ /// <param name="a1">線aの開始頂点</param>
+ /// <param name="a2">線aの終了頂点</param>
+ /// <param name="b1"></param>
+ /// <param name="b2"></param>
+ /// <returns></returns>
+ public static bool LineLine(Point a1, Point a2, Point b1, Point b2 )
+ {
+ // b1->b2向量 与 a1->b1向量的向量积
+ var ua_t = (b2.X - b1.X) * (a1.Y - b1.Y) - (b2.Y - b1.Y) * (a1.X - b1.X);
+ // a1->a2向量 与 a1->b1向量的向量积
+ var ub_t = (a2.X - a1.X) * (a1.Y - b1.Y) - (a2.Y - a1.Y) * (a1.X - b1.X);
+ // a1->a2向量 与 b1->b2向量的向量积
+ var u_b = (b2.Y - b1.Y) * (a2.X - a1.X) - (b2.X - b1.X) * (a2.Y - a1.Y);
+ // u_b == 0时,角度为0或者180 平行或者共线不属于相交
+ if (u_b != 0)
+ {
+ var ua = ua_t / u_b;
+ var ub = ub_t / u_b;
+
+ if (0 <= ua && ua <= 1 && 0 <= ub && ub <= 1)
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+
+ /// <summary>
+ /// 矩形と矩形
+ /// </summary>
+ /// <param name="r1"></param>
+ /// <param name="r2"></param>
+ /// <returns></returns>
+ public static bool RectRect(Rectangle r1, Rectangle r2)
+ {
+ return !(r1.Right < r2.Left || r1.Bottom < r2.Top || r2.Right < r1.Left || r2.Bottom < r1.Top);
+ }
+
+ /// <summary>
+ /// 矩形と矩形
+ /// </summary>
+ /// <param name="a"></param>
+ /// <param name="b"></param>
+ /// <returns></returns>
+ public static bool RectRect2(Rectangle a, Rectangle b)
+ {
+ var a_min_x = a.X;
+ var a_min_y = a.Y;
+ var a_max_x = a.X + a.Width;
+ var a_max_y = a.Y + a.Height;
+
+ var b_min_x = b.X;
+ var b_min_y = b.Y;
+ var b_max_x = b.X + b.Width;
+ var b_max_y = b.Y + b.Height;
+
+ return a_min_x <= b_max_x &&
+ a_max_x >= b_min_x &&
+ a_min_y <= b_max_y &&
+ a_max_y >= b_min_y;
+ }
+
+ /// <summary>
+ /// 線と矩形
+ /// </summary>
+ /// <param name="a1"></param>
+ /// <param name="a2"></param>
+ /// <param name="b"></param>
+ /// <returns></returns>
+ public static bool LineRect(Point a1, Point a2, Rectangle b)
+ {
+ var r0 = new Point(b.Left, b.Top);
+ var r1 = new Point(b.Left, b.Bottom);
+ var r2 = new Point(b.Right, b.Bottom);
+ var r3 = new Point(b.Right, b.Top);
+
+ if (LineLine(a1, a2, r0, r1)) return true;
+ if (LineLine(a1, a2, r1, r2)) return true;
+ if (LineLine(a1, a2, r2, r3)) return true;
+ if (LineLine(a1, a2, r3, r0)) return true;
+ return false;
+ }
+
+ /// <summary>
+ /// 線とポリコン
+ /// </summary>
+ /// <param name="a1"></param>
+ /// <param name="a2"></param>
+ /// <param name="b"></param>
+ /// <returns></returns>
+ public static bool LinePolygon(Point a1, Point a2, IList<Point> b )
+ {
+ var length = b.Count;
+
+ for (var i = 0; i < length; ++i)
+ {
+ var b1 = b[i];
+ var b2 = b[(i + 1) % length];
+
+ if (LineLine(a1, a2, b1, b2))
+ return true;
+ }
+
+ return false;
+ }
+
+ /// <summary>
+ /// ポイント イン ポリコン
+ /// </summary>
+ /// <param name="point"></param>
+ /// <param name="polygon"></param>
+ /// <returns></returns>
+ public static bool PointInPolygon(Point point, IList<Point> polygon)
+ {
+ //* 射线法判断点是否在多边形内
+ //* 点射线(向右水平)与多边形相交点的个数为奇数则认为该点在多边形内
+ //* 点射线(向右水平)与多边形相交点的个数为偶数则认为该点不在多边形内
+ bool inside = false;
+ int x = point.X;
+ int y = point.Y;
+
+ // use some raycasting to test hits
+ // https://github.com/substack/point-in-polygon/blob/master/index.js
+ var length = polygon.Count;
+
+ for (int i = 0, j = length - 1; i < length; j = i++)
+ {
+ int xi = polygon[i].X, yi = polygon[i].Y, xj = polygon[j].X, yj = polygon[j].Y;
+ bool intersect = ((yi > y) != (yj > y)) && (x < (xj - xi) * (y - yi) / (yj - yi) + xi);
+ // (yi > y) != (yj > y)表示此条边的两个端点的y值一个大于这个点的y一个小于这个点的y
+ // (x < (xj - xi) * (y - yi) / (yj - yi) + xi) 这个看起来像是求投影呢,还没搞明白
+ if (intersect) { inside = !inside; }
+ }
+
+ return inside;
+ }
+
+ /// <summary>
+ /// 矩形とポリコン
+ /// </summary>
+ /// <param name="a"></param>
+ /// <param name="b"></param>
+ /// <returns></returns>
+ public static bool RectPolygon(Rectangle a, IList<Point> b)
+ {
+ var r0 = new Point(a.Left, a.Top);
+ var r1 = new Point(a.Left, a.Bottom);
+ var r2 = new Point(a.Right, a.Bottom);
+ var r3 = new Point(a.Right, a.Top);
+
+ // 矩形的每条边与多边形是否相交
+ if (LinePolygon(r0, r1, b)) return true;
+
+ if (LinePolygon(r1, r2, b)) return true;
+
+ if (LinePolygon(r2, r3, b)) return true;
+
+ if (LinePolygon(r3, r0, b)) return true;
+
+ // 走到这可以检测出两个图形无交点
+ // 检测是否矩形包含多边形,如果多边形上存在一个点在矩形内,则相交
+ int l = b.Count;
+ for (int i = 0; i < l; ++i)
+ {
+ if (PointInPolygon(b[i], new Point[] { r0, r1, r2, r3 }))
+ return true;
+ }
+
+ // 检测是否多边形包含矩形,如果矩形上存在一个点在多边形内,则相交
+ if (PointInPolygon(r0, b))
+ return true;
+
+ if (PointInPolygon(r1, b))
+ return true;
+
+ if (PointInPolygon(r2, b))
+ return true;
+
+ if (PointInPolygon(r3, b))
+ return true;
+
+ return false;
+ }
+
+ /// <summary>
+ /// ポリコンとポリコン
+ /// </summary>
+ /// <param name="a"></param>
+ /// <param name="b"></param>
+ /// <returns></returns>
+ public static bool PolygonPolygon(IList<Point> a, IList<Point> b)
+ {
+ int i, l;
+
+ // a的每条边与b的每条边做相交检测
+ for (i = 0, l = a.Count; i < l; ++i)
+ {
+ var a1 = a[i];
+ var a2 = a[(i + 1) % l];
+
+ if (LinePolygon(a1, a2, b))
+ return true;
+ }
+
+ // 判断两个多边形的包含关系
+ for (i = 0, l = b.Count; i < l; ++i)
+ {
+ if (PointInPolygon(b[i], a))
+ return true;
+ }
+
+ // 判断两个多边形的包含关系
+ for (i = 0, l = a.Count; i < l; ++i)
+ {
+ if (PointInPolygon(a[i], b))
+ return true;
+ }
+ return false;
+ }
+
+ /// <summary>
+ /// 计算两点之间的距离
+ /// </summary>
+ /// <param name="x1"></param>
+ /// <param name="y1"></param>
+ /// <param name="x2"></param>
+ /// <param name="y2"></param>
+ /// <returns></returns>
+ public static double lineSpace(double x1, double y1, double x2, double y2)
+ {
+ double lineLength = 0;
+ lineLength = Math.Sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
+ return lineLength;
+
+ }
+
+ /// <summary>
+ /// 点到线段距离
+ /// </summary>
+ /// <param name="x1">線の開始頂点x</param>
+ /// <param name="y1">線の開始頂点y</param>
+ /// <param name="x2">線の終了頂点x</param>
+ /// <param name="y2">線の終了頂点y</param>
+ /// <param name="x0">点x</param>
+ /// <param name="y0">点y</param>
+ /// <returns></returns>
+ public static double PointToLine(double x1, double y1, double x2, double y2, double x0, double y0)
+ {
+ double space = 0;
+ double a, b, c;
+ a = lineSpace(x1, y1, x2, y2);// 线段的长度
+ b = lineSpace(x1, y1, x0, y0);// (x1,y1)到点的距离
+ c = lineSpace(x2, y2, x0, y0);// (x2,y2)到点的距离
+ if (c <= 0.000001 || b <= 0.000001)
+ {
+ space = 0;
+ return space;
+ }
+ if (a <= 0.000001)
+ {
+ space = b;
+ return space;
+ }
+ if (c * c >= a * a + b * b)
+ {
+ space = b;
+ return space;
+ }
+ if (b * b >= a * a + c * c)
+ {
+ space = c;
+ return space;
+ }
+ double p = (a + b + c) / 2;// 半周长
+ double s = Math.Sqrt(p * (p - a) * (p - b) * (p - c));// 海伦公式求面积
+ space = 2 * s / a;// 返回点到线的距离(利用三角形面积公式求高)
+ return space;
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/GraphicsApi/PointD.cs b/HotelPms.Share.Windows/GraphicsApi/PointD.cs
new file mode 100644
index 0000000..f1e9239
--- /dev/null
+++ b/HotelPms.Share.Windows/GraphicsApi/PointD.cs
@@ -0,0 +1,39 @@
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HotelPms.Share.Windows.GraphicsApi
+{
+ public class PointD
+ {
+ public double X { get; set; } = 0;
+ public double Y { get; set; } = 0;
+
+ public PointD()
+ { }
+
+ public PointD(double x, double y)
+ {
+ X = x;
+ Y = y;
+ }
+
+ public static IList<PointF> ToPointF(IList<PointD> ds)
+ {
+ List<PointF> list = new List<PointF>();
+ foreach(PointD item in ds)
+ {
+ list.Add(new PointF((float)item.X, (float)item.Y));
+ }
+ return list;
+ }
+
+ public PointD Clone()
+ {
+ return new PointD(X, Y);
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/GraphicsApi/RegionFormAPI.cs b/HotelPms.Share.Windows/GraphicsApi/RegionFormAPI.cs
new file mode 100644
index 0000000..0e8dbed
--- /dev/null
+++ b/HotelPms.Share.Windows/GraphicsApi/RegionFormAPI.cs
@@ -0,0 +1,118 @@
+using System;
+using System.Runtime.InteropServices;
+
+namespace HotelPms.Share.Windows.GraphicsApi
+{
+ /// <summary>
+ /// 无锯齿
+ /// </summary>
+ public class RegionFormAPI
+ {
+ #region 消息
+ public const int MF_REMOVE = 0x1000;
+
+ public const int SC_RESTORE = 0xF120; //还原
+ public const int SC_MOVE = 0xF010; //移动
+ public const int SC_SIZE = 0xF000; //大小
+ public const int SC_MINIMIZE = 0xF020; //最小化
+ public const int SC_MAXIMIZE = 0xF030; //最大化
+ public const int SC_CLOSE = 0xF060; //关闭
+
+ public const int WM_SYSCOMMAND = 0x0112;
+ public const int WM_COMMAND = 0x0111;
+
+ public const int GW_HWNDFIRST = 0;
+ public const int GW_HWNDLAST = 1;
+ public const int GW_HWNDNEXT = 2;
+ public const int GW_HWNDPREV = 3;
+ public const int GW_OWNER = 4;
+ public const int GW_CHILD = 5;
+
+ public const int WM_NCCALCSIZE = 0x83;
+ public const int WM_WINDOWPOSCHANGING = 0x46;
+ public const int WM_PAINT = 0xF;
+ public const int WM_CREATE = 0x1;
+ public const int WM_NCCREATE = 0x81;
+ public const int WM_NCPAINT = 0x85;
+ public const int WM_PRINT = 0x317;
+ public const int WM_DESTROY = 0x2;
+ public const int WM_SHOWWINDOW = 0x18;
+ public const int WM_SHARED_MENU = 0x1E2;
+ public const int HC_ACTION = 0;
+ public const int WH_CALLWNDPROC = 4;
+ public const int GWL_WNDPROC = -4;
+
+ public const int WS_SYSMENU = 0x80000;
+ public const int WS_SIZEBOX = 0x40000;
+
+ public const int WS_MAXIMIZEBOX = 0x10000;
+
+ public const int WS_MINIMIZEBOX = 0x20000;
+ #endregion
+ [StructLayout(LayoutKind.Sequential)]
+ public struct Size
+ {
+ public Int32 cx;
+ public Int32 cy;
+
+ public Size(Int32 x, Int32 y)
+ {
+ cx = x;
+ cy = y;
+ }
+ }
+
+ [StructLayout(LayoutKind.Sequential, Pack = 1)]
+ public struct BLENDFUNCTION
+ {
+ public byte BlendOp;
+ public byte BlendFlags;
+ public byte SourceConstantAlpha;
+ public byte AlphaFormat;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct Point
+ {
+ public Int32 x;
+ public Int32 y;
+
+ public Point(Int32 x, Int32 y)
+ {
+ this.x = x;
+ this.y = y;
+ }
+ }
+
+ public const byte AC_SRC_OVER = 0;
+ public const Int32 ULW_ALPHA = 2;
+ public const byte AC_SRC_ALPHA = 1;
+
+ [DllImport("gdi32.dll", ExactSpelling = true, SetLastError = true)]
+ public static extern IntPtr CreateCompatibleDC(IntPtr hDC);
+
+ [DllImport("user32.dll", ExactSpelling = true, SetLastError = true)]
+ public static extern IntPtr GetDC(IntPtr hWnd);
+
+ [DllImport("gdi32.dll", ExactSpelling = true)]
+ public static extern IntPtr SelectObject(IntPtr hDC, IntPtr hObj);
+
+ [DllImport("user32.dll", ExactSpelling = true)]
+ public static extern int ReleaseDC(IntPtr hWnd, IntPtr hDC);
+
+ [DllImport("gdi32.dll", ExactSpelling = true, SetLastError = true)]
+ public static extern int DeleteDC(IntPtr hDC);
+
+ [DllImport("gdi32.dll", ExactSpelling = true, SetLastError = true)]
+ public static extern int DeleteObject(IntPtr hObj);
+
+ [DllImport("user32.dll", ExactSpelling = true, SetLastError = true)]
+ public static extern int UpdateLayeredWindow(IntPtr hwnd, IntPtr hdcDst, ref Point pptDst, ref Size psize, IntPtr hdcSrc, ref Point pptSrc, Int32 crKey, ref BLENDFUNCTION pblend, Int32 dwFlags);
+
+ [DllImport("gdi32.dll", ExactSpelling = true, SetLastError = true)]
+ public static extern IntPtr ExtCreateRegion(IntPtr lpXform, uint nCount, IntPtr rgnData);
+
+ [DllImport("user32")]
+ public static extern int SendMessage(IntPtr hwnd, int msg, int wp, int lp);
+ }
+}
diff --git a/HotelPms.Share.Windows/GraphicsApi/Star.cs b/HotelPms.Share.Windows/GraphicsApi/Star.cs
new file mode 100644
index 0000000..40dd2a6
--- /dev/null
+++ b/HotelPms.Share.Windows/GraphicsApi/Star.cs
@@ -0,0 +1,90 @@
+using System;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+
+namespace HotelPms.Share.Windows.GraphicsApi
+{
+ public class Star
+ {
+ /// <summary>
+ /// 画五角星
+ /// </summary>
+ /// <param name="pointed">多少个角</param>
+ /// <param name="e">Graphics参数</param>
+ public static void Draw(int pointed, Graphics g, PointF center, int len1 = 100, int len2 = 50)
+ {
+ g.SmoothingMode = SmoothingMode.AntiAlias; //使绘图质量最高,即消除锯齿
+ //g.SmoothingMode = SmoothingMode.HighQuality;//对图片进行平滑处理
+ g.InterpolationMode = InterpolationMode.HighQualityBicubic; //设置图像呈现的质量
+ g.CompositingQuality = CompositingQuality.HighQuality;
+
+ Pen p = new Pen(Color.Red);//画笔的颜色
+ double[] angles1 = GetAngles(-Math.PI / 2, pointed);//五角星外围的点角度的一个数组
+ double[] angles2 = GetAngles(-Math.PI / 2 + Math.PI / pointed, pointed);//五角星内围的点角度的一个数组
+ PointF[] points1 = GetPoints(center, len1, angles1);//五角星外围的点的一个数组
+ PointF[] points2 = GetPoints(center, len2, angles2);//五角星内围的点的一个数组
+ PointF[] points = new PointF[points1.Length + points2.Length];//最终合成多边形所有点的数组
+ for (int i = 0, j = 0; i < points.Length; i += 2, j++)
+ {
+ points[i] = points1[j];
+ points[i + 1] = points2[j];
+ }
+ g.DrawPolygon(p, points);//画一个多边形
+ g.FillPolygon(Brushes.Gold, points);//填充颜色
+ }
+ /// <summary>
+ /// 获得所有角度的数组
+ /// </summary>
+ /// <param name="startAngle">开始的角度</param>
+ /// <param name="pointed">个数</param>
+ /// <returns></returns>
+ public static double[] GetAngles(double startAngle, int pointed)
+ {
+ double[] angles = new double[pointed];
+ angles[0] = startAngle;
+ for (int i = 1; i < angles.Length; i++)
+ {
+ angles[i] = angles[i - 1] + GetAngleLength(pointed);
+ }
+ return angles;
+ }
+ /// <summary>
+ /// 获得角度的增量
+ /// </summary>
+ /// <param name="pointed"></param>
+ /// <returns></returns>
+ public static double GetAngleLength(int pointed)
+ {
+ return 2 * Math.PI / pointed;
+ }
+
+
+ /// <summary>
+ /// 获得五角星的各个点
+ /// </summary>
+ /// <param name="ptCenter">中心点坐标</param>
+ /// <param name="length">距离中心点的长度</param>
+ /// <param name="angle">和水平方向的夹角</param>
+ /// <returns></returns>
+ public static PointF GetPoint(PointF ptCenter, double length, double angle)
+ {
+ return new PointF((float)(ptCenter.X + length * Math.Cos(angle)), (float)(ptCenter.Y + length * Math.Sin(angle)));
+ }
+ /// <summary>
+ /// 返回一个坐标的数组
+ /// </summary>
+ /// <param name="ptCenter">中心点</param>
+ /// <param name="length">距离中心点的长度</param>
+ /// <param name="angles">两点之间的夹角</param>
+ /// <returns></returns>
+ public static PointF[] GetPoints(PointF ptCenter, double length, params double[] angles)
+ {
+ PointF[] points = new PointF[angles.Length];
+ for (int i = 0; i < points.Length; i++)
+ {
+ points[i] = GetPoint(ptCenter, length, angles[i]);
+ }
+ return points;
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/HotelPms.Share.Windows.csproj b/HotelPms.Share.Windows/HotelPms.Share.Windows.csproj
new file mode 100644
index 0000000..587e32f
--- /dev/null
+++ b/HotelPms.Share.Windows/HotelPms.Share.Windows.csproj
@@ -0,0 +1,43 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <TargetFramework>net9.0-windows7.0</TargetFramework>
+ <Nullable>enable</Nullable>
+ <UseWindowsForms>true</UseWindowsForms>
+ <ImplicitUsings>enable</ImplicitUsings>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <None Remove="Resources\load.gif" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <EmbeddedResource Include="Resources\load.gif" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="9.0.3" />
+ <PackageReference Include="NPOI" Version="2.7.3" />
+ <PackageReference Include="System.Data.SqlClient" Version="4.9.0" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <ProjectReference Include="..\HotelPms.Share\HotelPms.Share.csproj" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <Compile Update="Properties\Resources.Designer.cs">
+ <DesignTime>True</DesignTime>
+ <AutoGen>True</AutoGen>
+ <DependentUpon>Resources.resx</DependentUpon>
+ </Compile>
+ </ItemGroup>
+
+ <ItemGroup>
+ <EmbeddedResource Update="Properties\Resources.resx">
+ <Generator>ResXFileCodeGenerator</Generator>
+ <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+ </EmbeddedResource>
+ </ItemGroup>
+
+</Project>
diff --git a/HotelPms.Share.Windows/Properties/Resources.Designer.cs b/HotelPms.Share.Windows/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..4a5704a
--- /dev/null
+++ b/HotelPms.Share.Windows/Properties/Resources.Designer.cs
@@ -0,0 +1,73 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+// このコードはツールによって生成されました。
+// ランタイム バージョン:4.0.30319.42000
+//
+// このファイルへの変更は、以下の状況下で不正な動作の原因になったり、
+// コードが再生成されるときに損失したりします。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace HotelPms.Share.Windows.Properties {
+ using System;
+
+
+ /// <summary>
+ /// ローカライズされた文字列などを検索するための、厳密に型指定されたリソース クラスです。
+ /// </summary>
+ // このクラスは StronglyTypedResourceBuilder クラスが ResGen
+ // または Visual Studio のようなツールを使用して自動生成されました。
+ // メンバーを追加または削除するには、.ResX ファイルを編集して、/str オプションと共に
+ // ResGen を実行し直すか、または VS プロジェクトをビルドし直します。
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources() {
+ }
+
+ /// <summary>
+ /// このクラスで使用されているキャッシュされた ResourceManager インスタンスを返します。
+ /// </summary>
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("HotelPms.Share.Windows.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ /// <summary>
+ /// すべてについて、現在のスレッドの CurrentUICulture プロパティをオーバーライドします
+ /// 現在のスレッドの CurrentUICulture プロパティをオーバーライドします。
+ /// </summary>
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ /// <summary>
+ /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。
+ /// </summary>
+ internal static System.Drawing.Bitmap load {
+ get {
+ object obj = ResourceManager.GetObject("load", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/Properties/Resources.resx b/HotelPms.Share.Windows/Properties/Resources.resx
new file mode 100644
index 0000000..a1607bc
--- /dev/null
+++ b/HotelPms.Share.Windows/Properties/Resources.resx
@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <data name="load" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <value>..\Resources\load.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+ </data>
+</root>
\ No newline at end of file
diff --git a/HotelPms.Share.Windows/Report/Border.cs b/HotelPms.Share.Windows/Report/Border.cs
new file mode 100644
index 0000000..d3bdff7
--- /dev/null
+++ b/HotelPms.Share.Windows/Report/Border.cs
@@ -0,0 +1,55 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Drawing.Drawing2D;
+
+namespace HotelPms.Share.Windows.Report
+{
+ public class Border
+ {
+ public enum TypeIndex : int
+ {
+ Left = 0,
+ Right,
+ Top,
+ Bottom,
+ }
+
+ private TypeIndex m_Index = TypeIndex.Left;
+
+ public TypeIndex Index
+ {
+ get { return m_Index; }
+ set { m_Index = value; }
+ }
+
+ private bool m_Visible = false;
+
+ public bool Visible
+ {
+ get { return m_Visible; }
+ set { m_Visible = value; }
+ }
+
+ private DashStyle m_DashStyle = DashStyle.Solid;
+
+ public DashStyle DashStyle
+ {
+ get { return m_DashStyle; }
+ set { m_DashStyle = value; }
+ }
+
+ private float m_Weight = 1;
+
+ public float Weight
+ {
+ get { return m_Weight; }
+ set { m_Weight = value; }
+ }
+
+ public Border(TypeIndex index)
+ {
+ m_Index = index;
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/Report/Cell.cs b/HotelPms.Share.Windows/Report/Cell.cs
new file mode 100644
index 0000000..c9b6cd0
--- /dev/null
+++ b/HotelPms.Share.Windows/Report/Cell.cs
@@ -0,0 +1,45 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Drawing;
+
+namespace HotelPms.Share.Windows.Report
+{
+ /// <summary>
+ /// �P��:1/100�C���` (�{���ł�������)
+ /// </summary>
+ public class Cell
+ {
+ public enum CellKind : int
+ {
+ Text = 0,
+ DotLine,
+ Line,
+ Image,
+ PrintTime,
+ PageNo,
+ TimeAndPage,
+ }
+
+ /// <summary>
+ /// ����X�^�C��
+ /// null�̏ꍇ�A�e�N���X�̈ꊇ�ݒ�̃X�^�C�����g���z��
+ /// </summary>
+ public CellStyle Style { get; set; }
+
+ /// <summary>
+ /// �L�[
+ /// </summary>
+ public string Key { get; set; } = string.Empty;
+
+ /// <summary>
+ /// ������
+ /// </summary>
+ public CellKind CellType { get; set; } = CellKind.Text;
+
+ /// <summary>
+ /// ���
+ /// </summary>
+ public string Text { get; set; } = string.Empty;
+ }
+}
diff --git a/HotelPms.Share.Windows/Report/CellStyle.cs b/HotelPms.Share.Windows/Report/CellStyle.cs
new file mode 100644
index 0000000..834a137
--- /dev/null
+++ b/HotelPms.Share.Windows/Report/CellStyle.cs
@@ -0,0 +1,72 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+
+namespace HotelPms.Share.Windows.Report
+{
+ public class CellStyle : OutputStyle
+ {
+ /// <summary>
+ /// 幅の計算方法
+ /// </summary>
+ public enum EWidthMode : int
+ {
+ /// <summary>
+ /// サイズ設定(Width)
+ /// </summary>
+ None = 0,
+ /// <summary>
+ /// 実際文字のWidth + Padding
+ /// </summary>
+ TextWidth,
+ /// <summary>
+ /// 行残り幅を使う
+ /// </summary>
+ AutoFill,
+ /// <summary>
+ /// 指定列までの幅を取る
+ /// </summary>
+ EndOfCol,
+ }
+
+ /// <summary>
+ /// X位置の計算方法
+ /// </summary>
+ public enum ELocalXMode : int
+ {
+ /// <summary>
+ /// Xの自由指定
+ /// </summary>
+ None = 0,
+ /// <summary>
+ /// 指定列のX位置から印字
+ /// </summary>
+ BeginOfCol,
+ }
+
+ public ELocalXMode LocalXMode { get; set; } = ELocalXMode.None;
+
+ /// <summary>
+ /// 幅のサイズ計算方法
+ /// </summary>
+ public EWidthMode WidthMode { get; set; } = EWidthMode.None;
+
+ /// <summary>
+ /// PrintRowに動作する
+ /// 行毎の調整
+ /// </summary>
+ public DockStyle Dock { get; set; } = DockStyle.None;
+
+ /// <summary>
+ /// 開始列
+ /// </summary>
+ public int BeginCol { get; set; } = -1;
+
+ /// <summary>
+ /// 終了列(当該列含む)
+ /// </summary>
+ public int EndCol { get; set; } = -1;
+ }
+}
diff --git a/HotelPms.Share.Windows/Report/ColumnStyle.cs b/HotelPms.Share.Windows/Report/ColumnStyle.cs
new file mode 100644
index 0000000..707e8e1
--- /dev/null
+++ b/HotelPms.Share.Windows/Report/ColumnStyle.cs
@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace HotelPms.Share.Windows.Report
+{
+ public class ColumnStyle : OutputStyle
+ {
+ private float m_WidthRate = 0F;
+
+ public float WidthRate
+ {
+ get { return m_WidthRate; }
+ set { m_WidthRate = value; }
+ }
+
+ private string m_DataField = string.Empty;
+
+ public string DataField
+ {
+ get { return m_DataField; }
+ set { m_DataField = value; }
+ }
+
+ public CellStyle DefaultCellStyle { get; set; }
+
+ public string Text { get; set; } = string.Empty;
+
+ public ColumnStyle()
+ {
+
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/Report/FetchEventArgs.cs b/HotelPms.Share.Windows/Report/FetchEventArgs.cs
new file mode 100644
index 0000000..6d494fb
--- /dev/null
+++ b/HotelPms.Share.Windows/Report/FetchEventArgs.cs
@@ -0,0 +1,37 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace HotelPms.Share.Windows.Report
+{
+ public class FetchEventArgs : System.EventArgs
+ {
+ private int m_Index = 0;
+ public int Index
+ {
+ get { return m_Index; }
+ set { m_Index = value; }
+ }
+
+ private int m_Count = 0;
+ public int Count
+ {
+ get { return m_Count; }
+ set { m_Count = value; }
+ }
+
+ private Cell m_Item = null;
+ public Cell Item
+ {
+ get { return m_Item; }
+ set { m_Item = value; }
+ }
+
+ public FetchEventArgs(Cell item, int index, int count)
+ {
+ m_Index = index;
+ m_Count = count;
+ m_Item = item;
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/Report/FormReport .cs b/HotelPms.Share.Windows/Report/FormReport .cs
new file mode 100644
index 0000000..ac905d7
--- /dev/null
+++ b/HotelPms.Share.Windows/Report/FormReport .cs
@@ -0,0 +1,157 @@
+using HotelPms.Share.Util;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Drawing;
+using System.Drawing.Printing;
+using System.IO;
+using System.Windows.Forms;
+
+namespace HotelPms.Share.Windows.Report
+{
+ public class FormReport : PrintGdiPlus, IDisposable, IReport
+ {
+ #region ★★★★★ Declartions ★★★★★
+
+ private bool m_Disposed = false;
+ private float m_CurrentY = 0F;
+ private List<List<Cell>> m_ObjList = null;
+ private List<Cell> m_CurrentPageData = null;
+ private Rectangle m_OwnerArea;
+ private string m_Title = string.Empty;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+
+
+
+
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public FormReport(List<List<Cell>> objList, Rectangle ownerArea, PaperKind paper, string title)
+ {
+
+ m_ObjList = objList;
+ m_OwnerArea = ownerArea;
+ m_Title = title;
+ foreach (PaperSize ps in m_PrintDoc.PrinterSettings.PaperSizes)
+ {
+ if (ps.Kind == paper)
+ {
+ m_PrintDoc.DefaultPageSettings.PaperSize = ps;
+ break;
+ }
+ }
+
+ if (m_OwnerArea.Width > m_OwnerArea.Height) { m_PrintDoc.DefaultPageSettings.Landscape = true; }
+ this.PrintDoc.PrintPage += PrintDoc_PrintPage;
+ m_PageIndex = 0;
+ }
+
+ ~FormReport()
+ {
+ Dispose(false);
+ }
+
+ protected override void Dispose(bool disposing)
+ {
+ if (!m_Disposed) //一回だけ
+ {
+ if (disposing)
+ {
+ //Managed Resources
+ }
+
+ //Unmanaged resources
+ m_Disposed = true;
+ }
+ base.Dispose(disposing);
+ }
+
+ public override void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+
+ #endregion
+
+ #region ★★★★★ Control Event ★★★★★
+
+ private void PrintDoc_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
+ {
+ m_CurrentPageData = m_ObjList[m_PageIndex];
+ e.Graphics.PageUnit = GraphicsUnit.Pixel; //画面と同じ単位
+ //e.Graphics.PageUnit = GraphicsUnit.Display;
+
+ //印字範囲 98%
+ float width = (e.PageBounds.Width - (int)e.PageSettings.HardMarginX * 2) * e.Graphics.DpiX / 100;
+ float height = (e.PageBounds.Height - (int)e.PageSettings.HardMarginY * 2) * e.Graphics.DpiY / 100;
+ m_PrintWidth = width * 0.98F;
+ m_PrintHeight = height * 0.98F;
+ m_LeftMargins = (width * 1.0F - m_PrintWidth) / 2;
+ m_TopMargins = (height * 1.0F - m_PrintHeight) / 2;
+
+ Font titleFont = new Font("MS UI Gothic", 18F);
+ Font detailFont = new Font("MS UI Gothic", 9F);
+ m_TitleHeight = GetTextHeight(e.Graphics, titleFont) + 6F; //ヘッダーの高さ
+ m_DetailRowHeight = GetTextHeight(e.Graphics, detailFont) + 6F; //ヘッダーの高さ
+ float detailHeight = m_PrintHeight - m_TitleHeight;
+
+ //タイトルの印刷
+ Cell title = new Cell();
+ title.Text = m_Title;
+ title.Style.RectangleF = new RectangleF(new PointF(m_LeftMargins, m_TopMargins), new SizeF(m_PrintWidth, m_TitleHeight));
+ title.Style.Font = titleFont;
+ DrawCell(e.Graphics, title);
+
+ //印字時間+ページ
+ m_CurrentY = m_TopMargins + m_TitleHeight - m_DetailRowHeight;
+ Cell page_printDate = new Cell();
+ page_printDate.Text = string.Format("{0} 頁:{1}/{2}", DateTime.Now.ToString("yyyy年MM月dd日(ddd) HH:mm:ss"), m_PageIndex + 1, m_ObjList.Count);
+ page_printDate.Style.RectangleF = new RectangleF(new PointF(m_LeftMargins, m_CurrentY), new SizeF(m_PrintWidth, m_DetailRowHeight));
+ page_printDate.Style.Alignment = StringAlignment.Far;
+ DrawCell(e.Graphics, page_printDate);
+
+ //画面の描く
+ float rateX = (e.Graphics.DpiX / 96.0F);
+ float rateY = (e.Graphics.DpiY / 96.0F);
+
+ float zoomRate = (m_PrintWidth / (m_OwnerArea.Width * rateX)) < (detailHeight / (m_OwnerArea.Height * rateY)) ? (m_PrintWidth / (m_OwnerArea.Width * rateX)) : (detailHeight / (m_OwnerArea.Height * rateY));
+
+ foreach (Cell item in m_CurrentPageData)
+ {
+ item.Style.RectangleF = new RectangleF(m_LeftMargins + item.Style.RectangleF.Left * rateX * zoomRate, m_TopMargins + item.Style.RectangleF.Top * rateX * zoomRate + m_TitleHeight, item.Style.RectangleF.Width * rateX * zoomRate, item.Style.RectangleF.Height * rateX * zoomRate);
+ DrawCell(e.Graphics, item);
+ }
+
+ //e.Graphics.DrawRectangle(Pens.Blue, m_LeftMargins, m_TopMargins + m_TitleHeight, (m_OwnerArea.Width * rateX * zoomRate), (m_OwnerArea.Height * rateY * zoomRate));
+
+ //次のページ
+ if (m_PageIndex == m_ObjList.Count - 1)
+ {
+ e.HasMorePages = false;
+ }
+ else
+ {
+ m_PageIndex++;
+ e.HasMorePages = true;
+ }
+ }
+
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+
+
+
+ #endregion
+ }
+}
diff --git a/HotelPms.Share.Windows/Report/FormTypeSelect.cs b/HotelPms.Share.Windows/Report/FormTypeSelect.cs
new file mode 100644
index 0000000..5dcb0bd
--- /dev/null
+++ b/HotelPms.Share.Windows/Report/FormTypeSelect.cs
@@ -0,0 +1,46 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+
+namespace HotelPms.Share.Windows.Report
+{
+ public partial class FormTypeSelect : Form
+ {
+ private ReportType m_ReportType = ReportType.Print;
+
+ public ReportType ReportType
+ {
+ get { return m_ReportType; }
+ set { m_ReportType = value; }
+ }
+
+ public FormTypeSelect()
+ {
+ InitializeComponent();
+ }
+
+ private void btnItem0_Click(object sender, EventArgs e)
+ {
+ int index = int.Parse((sender as Button).Name.Replace("btnItem", string.Empty));
+ m_ReportType = (Report.ReportType)index;
+ this.DialogResult = System.Windows.Forms.DialogResult.OK;
+ this.Close();
+ }
+
+ private void FormTypeSelect_KeyDown(object sender, KeyEventArgs e)
+ {
+ switch(e.KeyCode)
+ {
+ case Keys.Escape:
+ e.Handled = true;
+ this.Close();
+ break;
+ }
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/Report/FormTypeSelect.designer.cs b/HotelPms.Share.Windows/Report/FormTypeSelect.designer.cs
new file mode 100644
index 0000000..893c406
--- /dev/null
+++ b/HotelPms.Share.Windows/Report/FormTypeSelect.designer.cs
@@ -0,0 +1,270 @@
+namespace HotelPms.Share.Windows.Report
+{
+ partial class FormTypeSelect
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.components = new System.ComponentModel.Container();
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormTypeSelect));
+ this.imageList1 = new System.Windows.Forms.ImageList(this.components);
+ this.btnItem0 = new System.Windows.Forms.Button();
+ this.groupBox1 = new System.Windows.Forms.GroupBox();
+ this.btnItem7 = new System.Windows.Forms.Button();
+ this.btnItem6 = new System.Windows.Forms.Button();
+ this.btnItem5 = new System.Windows.Forms.Button();
+ this.btnItem4 = new System.Windows.Forms.Button();
+ this.btnItem3 = new System.Windows.Forms.Button();
+ this.btnItem2 = new System.Windows.Forms.Button();
+ this.btnItem1 = new System.Windows.Forms.Button();
+ this.groupBox1.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // imageList1
+ //
+ this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
+ this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
+ this.imageList1.Images.SetKeyName(0, "ooopic_1459993201.ico");
+ this.imageList1.Images.SetKeyName(1, "ooopic_1460364858.ico");
+ this.imageList1.Images.SetKeyName(2, "ooopic_1460365076.ico");
+ this.imageList1.Images.SetKeyName(3, "ooopic_1460365251.ico");
+ this.imageList1.Images.SetKeyName(4, "ooopic_1460365261.ico");
+ this.imageList1.Images.SetKeyName(5, "ooopic_1460365274.ico");
+ this.imageList1.Images.SetKeyName(6, "ooopic_1460446711.ico");
+ this.imageList1.Images.SetKeyName(7, "ooopic_1460446734.ico");
+ //
+ // btnItem0
+ //
+ this.btnItem0.BackColor = System.Drawing.Color.DarkCyan;
+ this.btnItem0.Cursor = System.Windows.Forms.Cursors.Hand;
+ this.btnItem0.FlatAppearance.BorderColor = System.Drawing.SystemColors.Control;
+ this.btnItem0.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.btnItem0.Font = new System.Drawing.Font("MS P明朝", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+ this.btnItem0.ForeColor = System.Drawing.Color.Orange;
+ this.btnItem0.ImageAlign = System.Drawing.ContentAlignment.TopCenter;
+ this.btnItem0.ImageIndex = 0;
+ this.btnItem0.ImageList = this.imageList1;
+ this.btnItem0.Location = new System.Drawing.Point(16, 18);
+ this.btnItem0.Name = "btnItem0";
+ this.btnItem0.Size = new System.Drawing.Size(189, 165);
+ this.btnItem0.TabIndex = 148;
+ this.btnItem0.Text = "印刷(&P)";
+ this.btnItem0.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
+ this.btnItem0.UseVisualStyleBackColor = false;
+ this.btnItem0.Click += new System.EventHandler(this.btnItem0_Click);
+ //
+ // groupBox1
+ //
+ this.groupBox1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(50)))), ((int)(((byte)(50)))));
+ this.groupBox1.Controls.Add(this.btnItem7);
+ this.groupBox1.Controls.Add(this.btnItem6);
+ this.groupBox1.Controls.Add(this.btnItem5);
+ this.groupBox1.Controls.Add(this.btnItem4);
+ this.groupBox1.Controls.Add(this.btnItem3);
+ this.groupBox1.Controls.Add(this.btnItem2);
+ this.groupBox1.Controls.Add(this.btnItem1);
+ this.groupBox1.Controls.Add(this.btnItem0);
+ this.groupBox1.ForeColor = System.Drawing.Color.White;
+ this.groupBox1.Location = new System.Drawing.Point(12, 12);
+ this.groupBox1.Name = "groupBox1";
+ this.groupBox1.Size = new System.Drawing.Size(606, 376);
+ this.groupBox1.TabIndex = 149;
+ this.groupBox1.TabStop = false;
+ this.groupBox1.Text = "出力種類";
+ //
+ // btnItem7
+ //
+ this.btnItem7.BackColor = System.Drawing.Color.DarkCyan;
+ this.btnItem7.Cursor = System.Windows.Forms.Cursors.Hand;
+ this.btnItem7.FlatAppearance.BorderColor = System.Drawing.SystemColors.Control;
+ this.btnItem7.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.btnItem7.Font = new System.Drawing.Font("MS P明朝", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+ this.btnItem7.ForeColor = System.Drawing.Color.Orange;
+ this.btnItem7.ImageAlign = System.Drawing.ContentAlignment.TopCenter;
+ this.btnItem7.ImageIndex = 6;
+ this.btnItem7.ImageList = this.imageList1;
+ this.btnItem7.Location = new System.Drawing.Point(400, 196);
+ this.btnItem7.Name = "btnItem7";
+ this.btnItem7.Size = new System.Drawing.Size(189, 165);
+ this.btnItem7.TabIndex = 155;
+ this.btnItem7.Text = "Xls(&L)";
+ this.btnItem7.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
+ this.btnItem7.UseVisualStyleBackColor = false;
+ this.btnItem7.Click += new System.EventHandler(this.btnItem0_Click);
+ //
+ // btnItem6
+ //
+ this.btnItem6.BackColor = System.Drawing.Color.DarkCyan;
+ this.btnItem6.Cursor = System.Windows.Forms.Cursors.Hand;
+ this.btnItem6.FlatAppearance.BorderColor = System.Drawing.SystemColors.Control;
+ this.btnItem6.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.btnItem6.Font = new System.Drawing.Font("MS P明朝", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+ this.btnItem6.ForeColor = System.Drawing.Color.Orange;
+ this.btnItem6.ImageAlign = System.Drawing.ContentAlignment.TopCenter;
+ this.btnItem6.ImageIndex = 3;
+ this.btnItem6.ImageList = this.imageList1;
+ this.btnItem6.Location = new System.Drawing.Point(16, 196);
+ this.btnItem6.Name = "btnItem6";
+ this.btnItem6.Size = new System.Drawing.Size(189, 165);
+ this.btnItem6.TabIndex = 154;
+ this.btnItem6.Text = "Xml(&X)";
+ this.btnItem6.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
+ this.btnItem6.UseVisualStyleBackColor = false;
+ this.btnItem6.Click += new System.EventHandler(this.btnItem0_Click);
+ //
+ // btnItem5
+ //
+ this.btnItem5.BackColor = System.Drawing.Color.DarkCyan;
+ this.btnItem5.Cursor = System.Windows.Forms.Cursors.Hand;
+ this.btnItem5.FlatAppearance.BorderColor = System.Drawing.SystemColors.Control;
+ this.btnItem5.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.btnItem5.Font = new System.Drawing.Font("MS P明朝", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+ this.btnItem5.ForeColor = System.Drawing.Color.Orange;
+ this.btnItem5.ImageAlign = System.Drawing.ContentAlignment.TopCenter;
+ this.btnItem5.ImageIndex = 6;
+ this.btnItem5.ImageList = this.imageList1;
+ this.btnItem5.Location = new System.Drawing.Point(410, 370);
+ this.btnItem5.Name = "btnItem5";
+ this.btnItem5.Size = new System.Drawing.Size(117, 100);
+ this.btnItem5.TabIndex = 153;
+ this.btnItem5.Text = "Json(&J)";
+ this.btnItem5.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
+ this.btnItem5.UseVisualStyleBackColor = false;
+ this.btnItem5.Visible = false;
+ this.btnItem5.Click += new System.EventHandler(this.btnItem0_Click);
+ //
+ // btnItem4
+ //
+ this.btnItem4.BackColor = System.Drawing.Color.DarkCyan;
+ this.btnItem4.Cursor = System.Windows.Forms.Cursors.Hand;
+ this.btnItem4.FlatAppearance.BorderColor = System.Drawing.SystemColors.Control;
+ this.btnItem4.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.btnItem4.Font = new System.Drawing.Font("MS P明朝", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+ this.btnItem4.ForeColor = System.Drawing.Color.Orange;
+ this.btnItem4.ImageAlign = System.Drawing.ContentAlignment.TopCenter;
+ this.btnItem4.ImageIndex = 5;
+ this.btnItem4.ImageList = this.imageList1;
+ this.btnItem4.Location = new System.Drawing.Point(287, 370);
+ this.btnItem4.Name = "btnItem4";
+ this.btnItem4.Size = new System.Drawing.Size(117, 100);
+ this.btnItem4.TabIndex = 152;
+ this.btnItem4.Text = "Html(&H)";
+ this.btnItem4.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
+ this.btnItem4.UseVisualStyleBackColor = false;
+ this.btnItem4.Visible = false;
+ this.btnItem4.Click += new System.EventHandler(this.btnItem0_Click);
+ //
+ // btnItem3
+ //
+ this.btnItem3.BackColor = System.Drawing.Color.DarkCyan;
+ this.btnItem3.Cursor = System.Windows.Forms.Cursors.Hand;
+ this.btnItem3.FlatAppearance.BorderColor = System.Drawing.SystemColors.Control;
+ this.btnItem3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.btnItem3.Font = new System.Drawing.Font("MS P明朝", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+ this.btnItem3.ForeColor = System.Drawing.Color.Orange;
+ this.btnItem3.ImageAlign = System.Drawing.ContentAlignment.TopCenter;
+ this.btnItem3.ImageIndex = 2;
+ this.btnItem3.ImageList = this.imageList1;
+ this.btnItem3.Location = new System.Drawing.Point(208, 196);
+ this.btnItem3.Name = "btnItem3";
+ this.btnItem3.Size = new System.Drawing.Size(189, 165);
+ this.btnItem3.TabIndex = 151;
+ this.btnItem3.Text = "CSV(&C)";
+ this.btnItem3.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
+ this.btnItem3.UseVisualStyleBackColor = false;
+ this.btnItem3.Click += new System.EventHandler(this.btnItem0_Click);
+ //
+ // btnItem2
+ //
+ this.btnItem2.BackColor = System.Drawing.Color.DarkCyan;
+ this.btnItem2.Cursor = System.Windows.Forms.Cursors.Hand;
+ this.btnItem2.FlatAppearance.BorderColor = System.Drawing.SystemColors.Control;
+ this.btnItem2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.btnItem2.Font = new System.Drawing.Font("MS P明朝", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+ this.btnItem2.ForeColor = System.Drawing.Color.Orange;
+ this.btnItem2.ImageAlign = System.Drawing.ContentAlignment.TopCenter;
+ this.btnItem2.ImageIndex = 7;
+ this.btnItem2.ImageList = this.imageList1;
+ this.btnItem2.Location = new System.Drawing.Point(400, 18);
+ this.btnItem2.Name = "btnItem2";
+ this.btnItem2.Size = new System.Drawing.Size(189, 165);
+ this.btnItem2.TabIndex = 150;
+ this.btnItem2.Text = "Xlsx(&E)";
+ this.btnItem2.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
+ this.btnItem2.UseVisualStyleBackColor = false;
+ this.btnItem2.Click += new System.EventHandler(this.btnItem0_Click);
+ //
+ // btnItem1
+ //
+ this.btnItem1.BackColor = System.Drawing.Color.DarkCyan;
+ this.btnItem1.Cursor = System.Windows.Forms.Cursors.Hand;
+ this.btnItem1.FlatAppearance.BorderColor = System.Drawing.SystemColors.Control;
+ this.btnItem1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.btnItem1.Font = new System.Drawing.Font("MS P明朝", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+ this.btnItem1.ForeColor = System.Drawing.Color.Orange;
+ this.btnItem1.ImageAlign = System.Drawing.ContentAlignment.TopCenter;
+ this.btnItem1.ImageIndex = 1;
+ this.btnItem1.ImageList = this.imageList1;
+ this.btnItem1.Location = new System.Drawing.Point(208, 18);
+ this.btnItem1.Name = "btnItem1";
+ this.btnItem1.Size = new System.Drawing.Size(189, 165);
+ this.btnItem1.TabIndex = 149;
+ this.btnItem1.Text = "PDF(&D)";
+ this.btnItem1.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
+ this.btnItem1.UseVisualStyleBackColor = false;
+ this.btnItem1.Click += new System.EventHandler(this.btnItem0_Click);
+ //
+ // FormTypeSelect
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(50)))), ((int)(((byte)(50)))));
+ this.ClientSize = new System.Drawing.Size(630, 398);
+ this.Controls.Add(this.groupBox1);
+ this.KeyPreview = true;
+ this.Name = "FormTypeSelect";
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+ this.Text = "出力選択";
+ this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FormTypeSelect_KeyDown);
+ this.groupBox1.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.ImageList imageList1;
+ private System.Windows.Forms.GroupBox groupBox1;
+ private System.Windows.Forms.Button btnItem5;
+ private System.Windows.Forms.Button btnItem4;
+ public System.Windows.Forms.Button btnItem0;
+ public System.Windows.Forms.Button btnItem3;
+ public System.Windows.Forms.Button btnItem2;
+ public System.Windows.Forms.Button btnItem1;
+ public System.Windows.Forms.Button btnItem6;
+ public System.Windows.Forms.Button btnItem7;
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.Share.Windows/Report/FormTypeSelect.resx b/HotelPms.Share.Windows/Report/FormTypeSelect.resx
new file mode 100644
index 0000000..85b12a7
--- /dev/null
+++ b/HotelPms.Share.Windows/Report/FormTypeSelect.resx
@@ -0,0 +1,863 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <metadata name="imageList1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>17, 17</value>
+ </metadata>
+ <data name="imageList1.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>
+ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
+ LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
+ ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAC2
+ qwAAAk1TRnQBSQFMAgEBCAEAARgBAAEYAQABgAEAAYABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
+ BAABAgIAAYABAQIAAQEBAAEIBwABAxcAAYACAAGAAwACgAEAAYADAAGAAQABgAEAAoACAAPAAQABwAHc
+ AcABAAHwAcoBpgEAATMFAAEzAQABMwEAATMBAAIzAgADFgEAAxwBAAMiAQADKQEAA1UBAANNAQADQgEA
+ AzkBAAGAAXwB/wEAAlAB/wEAAZMBAAHWAQAB/wHsAcwBAAHGAdYB7wEAAdYC5wEAAZABqQGtAgAB/wEz
+ AwABZgMAAZkDAAHMAgABMwMAAjMCAAEzAWYCAAEzAZkCAAEzAcwCAAEzAf8CAAFmAwABZgEzAgACZgIA
+ AWYBmQIAAWYBzAIAAWYB/wIAAZkDAAGZATMCAAGZAWYCAAKZAgABmQHMAgABmQH/AgABzAMAAcwBMwIA
+ AcwBZgIAAcwBmQIAAswCAAHMAf8CAAH/AWYCAAH/AZkCAAH/AcwBAAEzAf8CAAH/AQABMwEAATMBAAFm
+ AQABMwEAAZkBAAEzAQABzAEAATMBAAH/AQAB/wEzAgADMwEAAjMBZgEAAjMBmQEAAjMBzAEAAjMB/wEA
+ ATMBZgIAATMBZgEzAQABMwJmAQABMwFmAZkBAAEzAWYBzAEAATMBZgH/AQABMwGZAgABMwGZATMBAAEz
+ AZkBZgEAATMCmQEAATMBmQHMAQABMwGZAf8BAAEzAcwCAAEzAcwBMwEAATMBzAFmAQABMwHMAZkBAAEz
+ AswBAAEzAcwB/wEAATMB/wEzAQABMwH/AWYBAAEzAf8BmQEAATMB/wHMAQABMwL/AQABZgMAAWYBAAEz
+ AQABZgEAAWYBAAFmAQABmQEAAWYBAAHMAQABZgEAAf8BAAFmATMCAAFmAjMBAAFmATMBZgEAAWYBMwGZ
+ AQABZgEzAcwBAAFmATMB/wEAAmYCAAJmATMBAANmAQACZgGZAQACZgHMAQABZgGZAgABZgGZATMBAAFm
+ AZkBZgEAAWYCmQEAAWYBmQHMAQABZgGZAf8BAAFmAcwCAAFmAcwBMwEAAWYBzAGZAQABZgLMAQABZgHM
+ Af8BAAFmAf8CAAFmAf8BMwEAAWYB/wGZAQABZgH/AcwBAAHMAQAB/wEAAf8BAAHMAQACmQIAAZkBMwGZ
+ AQABmQEAAZkBAAGZAQABzAEAAZkDAAGZAjMBAAGZAQABZgEAAZkBMwHMAQABmQEAAf8BAAGZAWYCAAGZ
+ AWYBMwEAAZkBMwFmAQABmQFmAZkBAAGZAWYBzAEAAZkBMwH/AQACmQEzAQACmQFmAQADmQEAApkBzAEA
+ ApkB/wEAAZkBzAIAAZkBzAEzAQABZgHMAWYBAAGZAcwBmQEAAZkCzAEAAZkBzAH/AQABmQH/AgABmQH/
+ ATMBAAGZAcwBZgEAAZkB/wGZAQABmQH/AcwBAAGZAv8BAAHMAwABmQEAATMBAAHMAQABZgEAAcwBAAGZ
+ AQABzAEAAcwBAAGZATMCAAHMAjMBAAHMATMBZgEAAcwBMwGZAQABzAEzAcwBAAHMATMB/wEAAcwBZgIA
+ AcwBZgEzAQABmQJmAQABzAFmAZkBAAHMAWYBzAEAAZkBZgH/AQABzAGZAgABzAGZATMBAAHMAZkBZgEA
+ AcwCmQEAAcwBmQHMAQABzAGZAf8BAALMAgACzAEzAQACzAFmAQACzAGZAQADzAEAAswB/wEAAcwB/wIA
+ AcwB/wEzAQABmQH/AWYBAAHMAf8BmQEAAcwB/wHMAQABzAL/AQABzAEAATMBAAH/AQABZgEAAf8BAAGZ
+ AQABzAEzAgAB/wIzAQAB/wEzAWYBAAH/ATMBmQEAAf8BMwHMAQAB/wEzAf8BAAH/AWYCAAH/AWYBMwEA
+ AcwCZgEAAf8BZgGZAQAB/wFmAcwBAAHMAWYB/wEAAf8BmQIAAf8BmQEzAQAB/wGZAWYBAAH/ApkBAAH/
+ AZkBzAEAAf8BmQH/AQAB/wHMAgAB/wHMATMBAAH/AcwBZgEAAf8BzAGZAQAB/wLMAQAB/wHMAf8BAAL/
+ ATMBAAHMAf8BZgEAAv8BmQEAAv8BzAEAAmYB/wEAAWYB/wFmAQABZgL/AQAB/wJmAQAB/wFmAf8BAAL/
+ AWYBAAEhAQABpQEAA18BAAN3AQADhgEAA5YBAAPLAQADsgEAA9cBAAPdAQAD4wEAA+oBAAPxAQAD+AEA
+ AfAB+wH/AQABpAKgAQADgAMAAf8CAAH/AwAC/wEAAf8DAAH/AQAB/wEAAv8CAAP//wD/AP8A/wD/AP8A
+ /wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A
+ /wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A
+ /wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A
+ /wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A
+ /wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A
+ /wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A
+ /wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A
+ /wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A
+ /wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AKgATP//AKgAZv//AJYA
+ cP//ACQADP8wABL/HQAZ/0L0Gf//ACAAIP8NACT/GwAL/xP0OvMT9Av//wAfAEn/AvQH/xoAB/8H9Bnz
+ KPIZ8wf0B///AB4ABf8K9C//EfQF/xgAB/8E9A3zSPIN8wT0B///AB0AA/8C9AvzD/QQ/w70CfMG8gLz
+ AvQE/xkABv8F9A/zQvIP8wX0Bv//AB0ABP8B9AHzAvIH8QnyIPMJ8g3xAfIB8wH0BP8ZAAj/CfQJ8wHy
+ AfARvALwGLwL8AG8CfAB8QjzCfQI/yYAQf8/AEH/NQAE/wHzAfIB8QLwBbwI8AnxA/ADvAgHB+8CHA7v
+ CQcCvAHxAfMB9AH/AfYB/xoADf8K9AHyAfADByG8A/AdvAHxCfQN/yMASP84AEj/MgAD/wH0AfMB8gHw
+ AbwB7wH3Ae0BcwFyAVABSgFJRCgB/xsAFP8B9AHxAgcWvCDwD7wB8AH0E/8jAAf/PfQG/zYAB/899Ab/
+ MQAB/1MoAf8dABL/AfEBBxO8KfANvAH0EP8kAAT/AvQH8zTyBfMC9AT/NAAE/wL0B/M08gXzAvQE/zAA
+ Af9TKAH/IwAL/wHyAQcRvC/wCrwB8Ar/KQAE/wH0AfEOUBtWD1ACTwZJAXMB8gHzAvQD/zIABP8B9AHx
+ DlAbVg9QAk8GSQFzAfIB8wL0A/8vAAH/UygC/ywAAfQQvDXwCLwB8jEAA/8B9AHzDVAJVhFXB1YVUAFJ
+ Ae8B8gHzAfQD/zAAA/8B9AHzDVAJVhFXB1YVUAFJAe8B8gHzAfQD/y4AAf9TKAL/LAAB8Q28O/AGvAH/
+ LwAD/wH0AfMLUApWAVcBVhFXB1YWUAFJARwB8QHzAfQD/y4AA/8B9AHzC1AKVgFXAVYRVwdWFlABSQEc
+ AfEB8wH0A/8tAAH/AVBSKAL/KwAB/wy8P/AEvAHzLgAD/wH0AfMEUAFXAVgIXQJcC1cBVgFXAVYBVwFW
+ BFcBVgpXAVYKVwJcB10BVwNQAU8B7wHxAfMB9AP/LAAD/wH0AfMEUAFXAVgIXQJcC1cBVgFXAVYBVwFW
+ BFcBVgpXAVYKVwJcB10BVwNQAU8B7wHxAfMB9AP/LAAB/wF4UigC/ysAAfQJvBfwF/EX8AG8AfEtAAP/
+ AfQB8wNQAlZASQFQAVcCUAFJAQcB8QHzAfQD/yoAA/8B9AHzA1ACVkBJAVABVwJQAUkBBwHxAfMB9AP/
+ KwAB/wGZDigESQQoBEkGKARJBSgESQcoA0kBSgMoCVAOKAL/KwAB8wi8E/Ah8RTwAf8rAAP/AfQB8wFz
+ AlABVgtJA08GUAFPBFABTwVQA08CUAFPAlABSQFPC1ABTwJQBE8JSQNQAUkBvAHyAfMB9AP/KAAD/wH0
+ AfMBcwJQAVYLSQNPBlABTwRQAU8FUANPAlABTwJQAUkBTwtQAU8CUARPCUkDUAFJAbwB8gHzAfQD/yoA
+ Af8BGw4oAfADvAEcAigBSQTwAUkEKAEcBPAFKAPxAfABUAYoAfEC8gHxAigBcwHyAfED8gHxA/IBmAwo
+ AU8C/ysAAfMGvBLwJ/ER8AH/KgAE/wH0Ae8CUAFWB0kBTwVQAU8DSQlQAkkBTwFQC0kCUAtJB1ACTwdJ
+ A1ABSQHwAfIB9AT/JgAE/wH0Ae8CUAFWCUkIUANJAlALSQFQC0kBTwRQA0kBTwdQAU8ISQNQAUkB8AHy
+ AfQE/ykAAf8B8w4oBLwBHAIoAUkE8AFJBCgBHAHxAvAB8QUoBPEBUAYoBPECKAFzAfEC8gHxBfIB8Awo
+ AVAC/ysAAfMEvBDwL/EN8AH/KgAD/wH0AfADUAFPBUkJUAPzCFABCALzARsBUAvzAVYBSQXzBvIBvApQ
+ AU8FSQJQAU8BSQHwAfIB9AP/JgAD/wH0AfADUAFPBUkB7wLzAQcHUAFJA/MBXQFPC/MBUAzzAXMDUAFy
+ A/MHUAFJA/EBfgVJAlABTwFJAfAB8gH0A/8pAAH/AfYOKAG8AfABvAHwARwCKAFJBPABSQQoARwD8AHx
+ BSgE8QFQBigE8QIoAXMK8gwoAXMC/ysAAfMCvA/wNfEJ8AHxAf8pAAP/AfQB8wRQBUkLUAPzBlABBwLz
+ AfQBVgFQC/MBeAFJBfMF8gPxClAGSQJQAU8BUAHwAfMB9AP/JAAD/wH0AfMEUAVJAlABBwLzAQcFUAFJ
+ A/MBwwJQC/MBVg3zAfADUAFyAvMB8gVQAUkD8QH0AVAGSQJQAU8BUAHwAfMB9AP/KAAC/w4oArwC8AEc
+ AigBSQTwAUoEKAEcA/AB8QUoBPEBcgEoAfEC8gEoAUkC8gLxAigBcwryDCgBeAL/KwAB8wG8DvA58Qfw
+ AfEB/ygAA/8B9AHzAU8DUARJAU8NUAPzBFAB7wLzAfQBVgJQAvMBwwKgAeUCoAHlAqABfgFQAuUDoAHl
+ A6AB5QF+AfAC8QpQAU8FSQJQAUkBHAHxAfMB9AP/IgAD/wH0AfMBTwNQBEkBTwRQAQgC8wHvA1ABTwPz
+ AcMDUALzAcMDoAHlAqAB5QGgAVYBXAHlAqAB5QWgAeUBnwLzBFABcwHzAfIB8ANQAU8B8ALxAfQDUAFP
+ BUkCUAFJARwB8QHzAfQD/ycAAv8OKAG8A/ABHAIoAUkE8AFKBCgBHATxBSgE8QFyAVAC8QHyAXIBSgTy
+ AigBcwTyEigBmQL/KwAB8wG8DPAV8RPyFfEF8AHxAf8nAAP/AfQB8wHyA1AFSQ9QA/MCUAGYAvMB9AFX
+ A1AC8wF4FlAC8QFWClAGSQFQAU8BSQG8AfEB8wH0A/8gAAP/AfQB8wHyA1AFSQZQAQgC8wGYAVABTwPz
+ AcMEUALzAVYVUAGYAfMBCARQAXMC8gHwAlAB8ALxAfQFUAZJAVABTwFJAbwB8QHzAfQD/yYAAv8OKALw
+ ArwBHAIoAUkE8AFKBCgBHALwAvEFKAHwA/EBcgEcAfEB8gHxAbwBSgTyAigBcwTyEigBCAL/KwAB8wG8
+ CvAS8R3yEvED8AHxAf8nAAP/AfQB8gHxAlAFSQFPEFAD8wGYAvMB9AFXBFAC8wF4FlAC8QFXC1AGSQFQ
+ ASgB8AG8AfIB9AP/IAAD/wH0AfIB8QJQBUkBTwdQAbwC8wGYA/MBwwVQAvMBVxVQAZgB8wEIBVABeALy
+ ArwC8QH0B1AGSQFQASgB8AG8AfIB9AP/JgAC/w4oDPABSgQoARwE8QUoAbwB8gLxAXID8QLyAUkE8gIo
+ AXME8hIoARsC/ysAAfMJ8BDxJfIQ8QHwAfEB/yYAA/8B9APyAVAGSRJQBPMB9AFXBVAC8wF4DFAITwFQ
+ AfAB8QHwAVYLUAZJAVABSQPwAfIB9AP/HgAD/wH0A/IBUAZJCVABvATzAcMGUALzAVcMUAhPAZgC8wHl
+ BlABeALyAvEB9AhQBkkBUAFJA/AB8gH0A/8lAAL/DigBvAvwAUoEKAEcBPEFKAEHAvEB8gFQAfEB8gPx
+ AUkE8gIoAXME8hIoAfEC/ysAAfMH8A/xK/IP8QH/JQAD/wH0AfMD8gdJElABcgPzAVcGUALzAXgKUAFP
+ BfIG8QHwAcMMUAFPB0kC8QG8AfEB8wH0A/8cAAP/AfQB8wPyB0kKUAPzAXgHUALzAVcKUAGYDPMBVwdQ
+ AQcC8QEICVABTwdJAvEBvAHxAfMB9AP/JAAC/w4oC/AB8QFKBCgBHATxBSgBHAPyAXME8QHyARwD8gHx
+ AigBcwTyEigB8wL/KwAB8wXwDvEx8gzxAf8kAAP/AfQE8wH/AZgGSRJQBPMB8AZQAvMBeApQBfIH8QHD
+ DVABTwZJAfMB/wLxAbwB8QHzAfQD/xoAA/8B9ATzAf8BmAZJCVAB8ATzB1AC8wFXCVABHAvzAfQBVwdQ
+ AXME8QF4CFABTwZJAfMB/wLxAbwB8QHzAfQD/yMAAv8OKAG8C/ABSQQoARwD8QHwBSgBcwHyAvEBvALy
+ AXMC8gHxA/IB8AIoAXME8hIoAfQC/ysAAfME8A3xNfIK8QH/JAAD/wH0AfMB8gHzAf8B8wH/AUoFSRFQ
+ A/MBnwLzAbwFUALzAXgJUAFyAvIB9gF5B1cPUAZJAfEBvAHwAfQB8QHwAbwB8gH0A/8aAAP/AfQB8wHy
+ AfMB/wHzAf8BSgVJCFABvALzAfQD8wZQAvMBVwlQA/MBnwdXAVYIUAFzAvEB8gEIAvEBcwdQBkkB8QG8
+ AfAB9AHxAfABvAHyAfQD/yMAAv8OKATwARwCKAFJBPABSgQoARwE8QUoAXIB8gLxAfIB8QHyASgD8gHx
+ AvIBBwIoAXME8hIoA/8rAAHzAvAN8TnyCPEB/yMAA/8B9AHzAfIB8wH/A/MB/wZJD1AD8wGfAVABmALz
+ AQgEUALzAXgJUAEcAvIYUAVJAe8B8AK8AfMB8gHxAbwB8AHyAfQD/xgAA/8B9AHzAfIB8wH/A/MB/wZJ
+ BlABCALzAfQCUAPzBVAC8wFWCVAC8wGYEFABcgLxAfIBVwFQAbwC8AFyBlAFSQHvAfACvAHzAfIB8QG8
+ AfAB8gH0A/8iAAL/AVANKATwARwCKAFJA/AB8QFKBCgBHATxBSgBUAHxBfIBKAEcBfIB7wIoAXME8hIo
+ A/8rAAHzAfAL8T/yBPEB8gH/IgAD/wH0AfMB8gHzAvQE8wH/BUkBTwxQAUkD8wGfA1ABmALzAQcDUALz
+ AXgKUALyAZgKSQxQBUkBUAHyBPAB/wLxAQcB8QHzAfQD/xYAA/8B9AHzAfIB8wL0BPMB/wVJAU8EUAEH
+ AvMB9ARQA/MEUALzAVYJUAPzAVAJSQFPBFABcgLxAfIBVwNQAbwC8AFyBFAFSQFQAfIE8AH/AvEBBwHx
+ AfMB9AP/IQAC/wFQDSgE8AEcAigBSQHxAvAB8QFKASgI8QPyAXMBKAFKAfEB8gHxAfIB8QHvAigF8gEc
+ AigBcwTyEigD/ysAAfMG8UryIgAD/wH0BPMB/wHzA/QB8wH0AfMGSQpQAUkD8wGfBVABmALzAe8CUALz
+ AXgKUAHwB/EF8AF4ClAGSQHzBvAB/wHxAfABvAHyAfMD/xUAA/8B9ATzAf8B8wP0AfMB9AHzBkkBUAFJ
+ AQcC8wH0BlAD8wNQAvMBVgpQDPMB8gNQAXIC8QHyAVcFUAG8AvADUAZJAfMG8AH/AfEB8AG8AfIB8wP/
+ IQAC/wF4DSgE8AEcAigBSQTxAUoBKAvxAbwCKAHxBPIBUAIoBfIBcwIoAXME8hIoA/8jAAH/AfIGvAEc
+ T+sBcwEHBbwB8QH0GgAD/wH0AvIB8wH/AfMF9AHzAfQBvAZJCFABSQPzAZ8HUAGYAvMBmAFQAvMBfgtQ
+ AZkF8QbwAXgIUAdJAfQC8APxAvAB8gHzAfEC8AHyAfQD/xQAA/8B9ALyAfMB/wHzBfQB8wH0AbwGSQHv
+ AvMB9AhQA/MBUAFPAvMBVwpQAVYK8wLyA1AB8gHxAfIBVwdQAbwC8AFQBkkB9ALwA/EC8AHyAfMB8QLw
+ AfIB9AP/HwAD/wGZDSgE8AEcAigBSQHwA/EBSgEoCvEC8gIoAvED8gMoAe8E8gFQAigBcwTyEigD/yEA
+ Af8B8QHrYEoB7wH/FwAD/wH0AfMB8gHzAf8I9AHzAf8BBwdJAk8FUANXCVADVwFQAVYBVw1QAVYKVwVQ
+ A08HSQH/AvAF8QLwAfQC8QEHAfAB8wH0A/8SAAP/AfQB8wHyAfMB/wj0AfMB/wEHBUkBVgJXCFABSQFW
+ AlcBVgFQAlcNUAtXAU8CUAJXCFABTwFQAlcBVgVJAf8C8AXxAvAB9ALxAQcB8AHzAfQD/x4AA/8BCA0o
+ BPABHAIoAUkE8QFKASgM8QIoAfEB8gHxAfIBvAMoAUkE8gFQAigBcwHzA/ISKAP/IQABB2NKAXMB9hUA
+ A/8B9ATzAf8J9AHzAf8BHBVJAU8DSQFPBUkBUAZJAVABTwFQBEkBTwdJAU8PSQH/AfAI8QLwAf8B8QHw
+ AQcB8QHzAfQC/xEAA/8B9ATzAf8J9AHzAf8BHBVJAU8DSQFPBUkBUAZJAVABTwFQBEkBTwdJAU8PSQH/
+ AfAI8QLwAf8B8QHwAQcB8QHzAfQC/x4AA/8BvFAoA/8gAAHyZUoBHAH/FAAD/wH0AvIB8wH/AfMK9AHz
+ Af8BvAEoQkkB/wLwA/EC8gTxAfAB8QH0AfEB8AG8AfIB9AP/EAAD/wH0AvIB8wH/AfMK9AHzAf8BvAEo
+ QkkB/wLwA/EC8gTxAfAB8QH0AfEB8AG8AfIB9AP/HQAD/wHxUCgD/x8AAf8Bc2ZKAfITAAP/AfQB8wHy
+ AfMB/w30AfMB9AL/AQcCHAFzN3IBcwHtARwBBwH/AfMB8ATxBPID8QLwAfMB8QHwAQcB8AHzAfQD/w4A
+ A/8B9AHzAfIB8wH/DfQB8wH0Av8BBwIcAXM3cgFzAe0BHAEHAf8B8wHwBPEE8gPxAvAB8wHxAfABBwHw
+ AfMB9AP/HAAD/wHzUCgD/x8AAfNnSgEcEwAC/wH0AvMB8gHzAf8O9AjzB/QS8wHyAfMR8gvxA/AG8Qby
+ A/EC8AH/AfEB8AEHAfEB8wH0Av8OAAL/AfQC8wHyAfMB/w70CPMH9BLzAfIB8xHyC/ED8AbxBvID8QLw
+ Af8B8QHwAQcB8QHzAfQC/xwAA/8B9FAoA/8fAAG8Z0oBcxIAA/8B9ALyAfMB/xH0FfMB8gHzEvIc8Qfy
+ A/ED8AH0AfEB8AG8AfIB9AP/DAAD/wH0AvIB8wH/EfQV8wHyAfMS8hzxB/ID8QPwAfQB8QHwAbwB8gH0
+ A/8bAAT/UCgD/x8AAbxnSgFzEQAD/wH0AfMC8gH/E/QB8wH0HPMR8gHxBPIN8QvyA/EC8AHzAfEB8AEH
+ AfAB8wH0A/8KAAP/AfQB8wLyAf8T9AHzAfQc8xHyAfEE8g3xC/ID8QLwAfMB8QHwAQcB8AHzAfQD/xoA
+ A/8B9lAoA/8fAAG8DEoBcwEcAbwBGwHyAfABBwEcDEoBSwEcAe8BvAEbAfIB8QG8ARwBcw5KAXMBHAG8
+ AfEB8gEbAbwB7wEcAW4KSgFzAbwBGwEcCkoBbgEHAfIBvAFzCEoBcxEAA/8B8wLyAfMB/w70AZII7QHs
+ Ae097AnyA/ED8AH/AfEB8AG8AfEB8wP/CgAD/wHzAvIB8wH/DvQBkgjtAewB7T3sCfID8QPwAf8B8QHw
+ AbwB8QHzA/8aAAT/UCgE/x4AAbwLSgHvCP8B8wFzCUoBHAHzCf8B8gFzCkoBcwHyCf8B9AEcCUoB8AP/
+ AesISgFLARsD/wHzCEoBcxAAA/8B9APyAf8B8w70Ae8B7QH0AvAFvAUHAu8B7QHsEPAB9wHsBvAKvALs
+ D7wB7QHsCfIE8QPwAfQB8QG8AfAB8gH0A/8IAAP/AfQD8gH/AfMO9AHvAe0B9ALwBbwFBwLvAe0B7BDw
+ AfcB7AbwCrwC7A+8Ae0B7AnyBPED8AH0AfEBvAHwAfIB9AP/GQAE/1AoBP8eAAG8CkoBmQv/AXMHSgEH
+ Df8BHAhKAbwN/wHzAXMGSgFLAfQD/wFzCEoBBwX/AesHSgFzEAAC/wH0AvMB8hH0AQcB7QP/BfQE8wLy
+ AfEC7QHxD/MB7wHsD/MB8gLsD/IC7AjyBfEC8AG8AfQB8QHwAQcB8QHzAfQC/wgAAv8B9ALzAfIR9AEH
+ Ae0D/wX0BPMC8gHxAu0B8Q/zAe8B7A/zAfIC7A/yAuwI8gXxAvABvAH0AfEB8AEHAfEB8wH0Av8ZAAT/
+ ISgBUAVWAS8oKAT/HgABvAlKAXMF/wHzAfAB9gT/AfQGSgGZBf8BvAIcAZkB8wX/AXMCSgFLA0oBvAb/
+ AfMB8AHyBv8B9AFzAkoBSwJKAUsB9AP/AXMHSgEcBv8B6wdKAXMPAAP/AfQC8gHzAf8B8w/0AfAB7QH0
+ Af8C9AESARUBEgHrAW0CFQH3AvIB8QH3AewBvA/zAe8B7BDzAuwB8w7yAuwK8gTxAvABvAH/AvEBvAHy
+ AfQD/wYAA/8B9ALyAfMB/wHzD/QB8AHtAfQB/wL0ARIBFQESAesBbQIVAfcC8gHxAfcB7AG8D/MB7wHs
+ EPMC7AHzDvIC7AryBPEC8AG8Af8C8QG8AfIB9AP/GAAE/yIoBlYoKAT/HgABvAFKB0sBSgG8BP8BHAJK
+ AXMBGgT/ARwCSgFLAUoBcwH2A/8B8wFzBEoBSwEcBP8B9AJKAksBSgGZBf8BBwFzAkoBSwFzARwB9AT/
+ AfMCSgJLAUoBUQH0A/8BcwJKA0sBSgFzAfQG/wHrAkoFSwEcDwAC/wH0AfMB8QHyAf8B8xD0AfMB7QHw
+ Af8B9AIVAfMB9APzAfACFQHyAfEB7wHsAbwP8wHvAewQ8wLsAvMN8gLsCfIG8QPwAfIB8AG8AfEB8wH0
+ Av8GAAL/AfQB8wHxAfIB/wHzEPQB8wHtAfAB/wH0AhUB8wH0A/MB8AIVAfIB8QHvAewBvA/zAe8B7BDz
+ AuwC8w3yAuwJ8gbxA/AB8gHwAbwB8QHzAfQC/xgABP8iKAZWKCgE/x4AAbwJSwHzA/8BBwJKAUsBSgFz
+ BP8B8AJKAUsBSgGZBP8BcwJKBEsBSgGZBP8BcwJKAUsBcwH2BP8BHAJKA0sCSgFzAfQE/wEcAkoCSwFR
+ AfQD/wFzAkoDSwFKAbwH/wHrAkoFSwEcDgAD/wH0AvIB8xP0Ae0BBwH/BvQC8wHwAhUC8gHvAewBBw/z
+ Ae8B7A/zAfIB7AHtD/IB7AGSCvIF8QLwAbwB/wHxAfABvAHyAfQD/wQAA/8B9ALyAfMT9AHtAQcB/wb0
+ AvMB8AIVAvIB7wHsAQcP8wHvAewP8wHyAewB7Q/yAewBkgryBfEC8AG8Af8B8QHwAbwB8gH0A/8XAAP/
+ AfQiKAFQBVYBLyYoAVAE/x4AAbwISwFzBP8BcwJKAVECSwEbA/8B8wJKAksB8AP/AfACSgFRBUsBcwH2
+ A/8BHAJKAUsBvAT/Ae8CSgFRBUsBSgFzBP8B9AJKAksBUQH0A/8BcwJKAVEBSwFKARwI/wHrAkoBUQRL
+ ARwOAAP/AfMB8QHyAf8B8xL0Ae0B9wP/A/QDFQETAe8B8wLyAe8B7AHvD/MB7wHsEPMB7AH3D/IB7AH3
+ BvIB8QHyCPEC8AG8AfQB8AEHAfEB8wP/BAAD/wHzAfEB8gH/AfMS9AHtAfcD/wP0AxUBEwHvAfMC8gHv
+ AewB7w/zAe8B7BDzAewB9w/yAewB9wbyAfEB8gjxAvABvAH0AfABBwHxAfMD/xcAA/8B9CMoBlYmKAFQ
+ BP8eAAG8AUsGUQFLAXME/wFuAUoDUQFLAbwD/wHzAkoBUQFLAQcD/wFzAUoBSwVRAUsBcwH2A/8BHAJK
+ AVEB8wP/AfYCSghRAUsBGgT/AXMCSgFRAXMB9AP/AXMCSgFRAUsBcwH0CP8B6wJKBVEBHA4AAv8B9AHz
+ AfIB8xT0Au0D/wb0AeoBFQEHAfMB8gEHAewB9w/zAe8B7A7zAvIB7AH3DvIB8AHsAQcF8gvxAvABvAHz
+ AfABvAHwAfMB9AL/BAAC/wH0AfMB8gHzFPQC7QP/BvQB6gEVAQcB8wHyAQcB7AH3D/MB7wHsDvMC8gHs
+ AfcO8gHwAewBBwXyC/EC8AG8AfMB8AG8AfAB8wH0Av8XAAP/AfQjKAZWJigBUAT/HgABvAhRAXMB9AL/
+ AbwCSgNRAUsBBwP/AfQCSgJRAXMBvAEbARwCSgVRAksBvAT/ARwCSgFzBP8BBwJKCFEBSwFzBP8B7wJK
+ AVEBcwH0A/8BcwFKAUsBUQFLAQcE/wEcAfQD/wHrAUoBSwVRARwOAAL/AfQB8wHyAf8B8xP0Au0D/wIV
+ AfID9AHsARUBkgLzAQcB7AGSD/MB7wHsDfMD8gHsAe8O8gEHAewB8AfyCvEB8AK8AfQC8AHzAfQC/wQA
+ Av8B9AHzAfIB/wHzE/QC7QP/AhUB8gP0AewBFQGSAvMBBwHsAZIP8wHvAewN8wPyAewB7w7yAQcB7AHw
+ B/IK8QHwArwB9ALwAfMB9AL/FwAD/wH0IygBLwVWAS8lKAFyAfQD/x4AARoJUQFzArwBcwFKBVEBvAP/
+ AfQCSgtRAUsBUQFzAbwF/wHrAkoBHAT/AXMCSglRAXMB9AP/AfACSgFRAXMB9AP/AXMBSgFLAVEBHAT/
+ AQcBSgH2A/8B6wFKAUsFUQEcDgAC/wL0A/MT9ALtBP8B8QHsARIBEwFtAfcB9APzAbwB7AHtD/MB7wHs
+ DvMC8gHsAQcO8gHvAewF8g3xAvABvAHxAvAB8wH0Av8EAAL/AvQD8xP0Au0E/wHxAewBEgETAW0B9wH0
+ A/MBvAHsAe0P8wHvAewO8wLyAewBBw7yAe8B7AXyDfEC8AG8AfEC8AHzAfQC/xcAA/8B9CQoBlYlKAF4
+ AfQD/x4AARoTUQG8A/8B9AJKCVEBcwEcAQgB8wb/AfICSgFRAZkE/wHrAUoLUQHzA/8B8wJKAVEBcwH0
+ A/8BcwFKAUsBUQEbA/8B9AJKBP8B6wFKAUsFUQEcDgAC/wL0AvMU9AHvAe0B/wLzBfIC8QTwAQcC7A/z
+ Ae8B7A/zAfEB7AG8DvIB9wHsA/IB8QHyAfEB8gvxAvACvAHwAfEB8wH0Av8EAAL/AvQC8xT0Ae8B7QH/
+ AvMF8gLxBPABBwLsD/MB7wHsD/MB8QHsAbwO8gH3AewD8gHxAfIB8QHyC/EC8AK8AfAB8QHzAfQC/xcA
+ A/8B9CQoBlYlKAF4AfQD/x4AARoTUQG8A/8B9AJKBlEBcwGZARsB9Aj/AfQBbQFKAlEBmQT/AesBSgtR
+ ARsD/wH0AkoBUQFzAfQD/wFzAUoBSwEIBP8BcwFKAXME/wHrAUoGUQEcDgAD/wH0A/MT9AEHCe087ATy
+ DvEC8AO8AfIB9AP/BAAD/wH0A/MT9AEHCe087ATyDvEC8AO8AfIB9AP/FwAD/wH0JCgBLwVWAS8kKAGY
+ AfQD/x4AAfATUQEIA/8B9AJKBFEBcwGZAfQK/wG8AesBSgNRAbwE/wHrAUoLUQEbA/8B8wJKAVEBcwH0
+ A/8BcwFEAXME/wG8AkoBcwT/AesBSgZRARwOAAP/AfQD8xP0AfAB7QG8BQcI7wH3AuwQUAHsD1ABLgHs
+ D1AC7AXyDfEC8AO8AfMB9AP/BAAD/wH0A/MT9AHwAe0BvAUHCO8B9wLsEFAB7A9QAS4B7A9QAuwF8g3x
+ AvADvAHzAfQD/xcAA/8B9CUoBlYkKAEIAfQD/x4AAfATUQEIA/8B9AJKA1EBcwEaCf8B8gEHAXMBSgFL
+ BFEBmQT/AXMBSgpRAXMB8wP/AfMCSgFRAXMB9AP/AXMBSgHyA/8B9AJKAVEBcwT/AesBSgZRARwPAAP/
+ AfQC8xP0AfMB7QHwA/8E9ATzAvIBvALsEFAB7BBQAewPUALsAfIQ8QLwArwBBwHyAfQD/wYAA/8B9ALz
+ E/QB8wHtAfAD/wT0BPMC8gG8AuwQUAHsEFAB7A9QAuwB8hDxAvACvAEHAfIB9AP/GAAD/wH0FygBLwFW
+ DCgGVgsoAVYBLxcoAfEB9AP/HgAB8BNRAQgD/wH0AkoBUQFzAVEBCAb/AfMB8AEHAXMCSwJRAnMDUQEc
+ BP8BcwFKAUsBcwhRAXMB9AP/AbwCSgFRAXMB9AP/AXMBHAT/AXMBSgJRAXME/wHrAUoBUQFzBFEBHA8A
+ BP8D8xP0Ae0BBwH/AfQBEwEVAeoH9wHxAbwC7A9WAVAB7A9WAVAB7AFQDlYB7AHtAfEC8g7xAvACvAHw
+ AfMB9AP/BgAE/wPzE/QB7QEHAf8B9AETARUB6gf3AfEBvALsD1YBUAHsD1YBUAHsAVAOVgHsAe0B8QLy
+ DvEC8AK8AfAB8wH0A/8YAAP/AfQVKAEuA1YMKAEvBVYBLwooA1YBLhUoAfMB9AP/HgAB8AFREXMBUQEI
+ A/8B9AJKAlEBcwH0BP8B8AFzAUoDUQJzA1EDcwFRAXME/wEHAkoIcwFRARwE/wHvAkoBUQFzAfQD/wEH
+ AfQD/wG8AkoBcwFRAXME/wHrAUoBUQVzARwQAAP/AfQB8gLzEvQB7QH3Af8D9AHsARUBFAH3AfMD8gHx
+ AfAC7A9WAVAB7A9WAVAB7A9WAewB9wHyAfEB8g3xAvADvAHzAfQD/wgAA/8B9AHyAvMS9AHtAfcB/wP0
+ AewBFQEUAfcB8wPyAfEB8ALsD1YBUAHsD1YBUAHsD1YB7AH3AfIB8QHyDfEC8AO8AfMB9AP/GQAD/wH0
+ FCgFVg0oBlYKKAVWFCgB8wH0A/8eAAHwAVERcwFRAbwD/wH0AkoBcwFRAXME/wHvAkoBUQRzAVEBCAEb
+ AZkBSgFLA3MB9AP/AfQCSghzAVEBGgT/AXMBSgFRAnMB9Af/AfMCSgJzAVEBcwT/AesBSgFRBXMBHBEA
+ A/8B9AHyAvMR9ALtAv8F9AHtAhUB9wLyAfAB7QHsAVcOVgFQAewPVgFQAewOVgFXAewBBwHxAfIN8QLw
+ A7wB8wH0A/8KAAP/AfQB8gLzEfQC7QL/BfQB7QIVAfcC8gHwAe0B7AFXDlYBUAHsD1YBUAHsDlYBVwHs
+ AQcB8QHyDfEC8AO8AfMB9AP/GgAD/wH0AUkRKAEvBlYNKAZWCigGVgEvEigB8wH0A/8eAAHwAVERcwFR
+ ARoD/wH0AkoBcwFRARwE/wJKBXMBUQGZA/8BcwFKAVEBcwFRARoE/wHvAUoBSwZzAVEBHAT/AfQCSgNz
+ AfQH/wEcAUoBUQJzAVEBcwT/AesBSgFRBXMBHBIABP8B8gLzEPQC7QP/BfQB8wHwAhUB8gHxAZIB7A9X
+ AVAB7A9XAVAB7AFWDlcB7AG8DvEC8AK8AQcB8wH0A/8MAAT/AfIC8xD0Au0D/wX0AfMB8AIVAfIB8QGS
+ AewPVwFQAewPVwFQAewBVg5XAewBvA7xAvACvAEHAfMB9AP/GwAD/wH0AVAPKAEvCFYNKAEvBVYBLwko
+ CFYBLxAoAfMB9AP/HgAB8BJzAVEBGgP/AfQCSgJzAXQE/wHrAUoBUQNzAVEBcwT/Ae8BSgFLAXMBUQF0
+ AfYE/wEcAUoBUQRzAVEBHAH0BP8BHAFKAVEDcwH0Bv8BvAJKA3MBUQFzBP8B6wFKAVEFcwEcEwAD/wH0
+ AfID8w70Au0C/wHyARUBEwT0AfICFQLyAZIB7A9XAVAB7A9XAVAB7A5XAVYB7AHyDfEC8AK8AQcB8wH0
+ A/8OAAP/AfQB8gPzDvQC7QL/AfIBFQETBPQB8gIVAvIBkgHsD1cBUAHsD1cBUAHsDlcBVgHsAfIN8QLw
+ ArwBBwHzAfQD/xwAA/8B9AFQDSgBLgpWDigGVgkoClYPKAHzAfQD/x4AAfAScwFRARoD/wH0AkoDcwH0
+ A/8B8AJKA1EBcwEbBP8BcwFKAVECcwFRAZkF/wG8AW4BSwNzAZkB9gT/AfMCSgRzAfQF/wH0AkoFcwF0
+ BP8B6wFKAVEFcwEcFAAD/wH0AfID8w30AfcB7QT/AfMB7wPsAfcB8QLzAfIB9wHsD1cBUAHsD1cBUAHs
+ DlcBVgHsDfEC8AK8AQcB8wH0A/8QAAP/AfQB8gPzDfQB9wHtBP8B8wHvA+wB9wHxAvMB8gH3AewPVwFQ
+ AewPVwFQAewOVwFWAewN8QLwArwBBwHzAfQD/x0AA/8B9AFQDCgBUAtWDigGVgkoC1YBUA0oAfMB9AP/
+ HgAB8AJzAXQPcwFRARoD/wH0AkoCcwFRAZkE/wH0AbwB7wGZARoB9AT/AfICSgVzARoG/wHzAfIB9AH2
+ Bf8B9AHrAUoFcwH0Bf8BHAFKAVEFcwF0BP8BcwFKAVEFcwEcFQAD/wH0AfIE8wv0AQcB7QH0A/EE8AW8
+ AQcB9wHsAXgOVwFQAewBVw54AVABcgFXDXgBUAHsDPEC8AK8AQcB8wH0A/8SAAP/AfQB8gTzC/QBBwHt
+ AfQD8QTwBbwBBwH3AewBeA5XAVAB7AFXDngBUAFyAVcNeAFQAewM8QLwArwBBwHzAfQD/x4AA/8B9AFQ
+ CigBLwxWAS4OKAEvBVYBLwgoAS8MVgEvCygB8wH0A/8eAAHwAnMBeQ9zAVEBGgP/AfQCSgRzARoM/wHz
+ AesBSgdzARoN/wHyAXMBSgZzAfQE/wG8AkoGcwF5BP8B6wFKAVECcwJ5AXMBmRYAA/8B9AHyBPMK9AG8
+ Ae0Q7AFXA1YMUAHsEFABcg1QAVcBUAHsC/EC8AK8AQcB8wH0A/8UAAP/AfQB8gTzCvQBvAHtEOwBVwNW
+ DFAB7BBQAXINUAFXAVAB7AvxAvACvAEHAfMB9AP/HwAD/wH0AVAIKAEvA1YBNQJWAVAFVgEvESgGVgoo
+ AS8IVgE1A1YBLgkoAfMB9AP/HgABGgJzAnkPcwGZA/8B8AJKBXMBmQH0CP8B9AG8AkoJcwGZAfMJ/wHz
+ Ae8CSgFzAXQFcwEaA/8B9AFtAUoIcwH0Av8B9AJKA3MCeQFzAZkXAAP/AfQB8gTzCfQB8wHsAfEB9ALz
+ AfID8QTwArwB7wHsAXgOVwFQAewPVwFQAXINVwF4AVcB7ArxAvACvAEHAfMB9AP/FgAD/wH0AfIE8wn0
+ AfMB7AHxAfQC8wHyA/EE8AK8Ae8B7A9XAVAB7A9XAVABcg1XAXgBVgHsCvEC8AK8AQcB8wH0A/8gAAP/
+ AfQBUAcoAzUBVgEvATUBLwQ1AVYBLxMoATUBVgE1AVYCNQwoCDUDLwE1AS8IKAHzAfQD/x4AARoCcwF5
+ AZkBdA9zARoB9AEbAXMBSgFzAXQFcwF0AZkBGgEbAvQB8wHwARwBcwFRAXMCdApzAXkBmQEbAvQB8wEb
+ AQcBHAJRAXMCdAZzAXQBGgH0ARsBcwFKAXMBdAdzARwBGwH0ARwBSgFzAXQBcwF5AZkBeQFzAZkYAAP/
+ AfQB8gTzB/QB8wH0AewBBwH/AvQD8wLsA/EC8AHvAewBeA5XAVAB7A9XAVABcg1XAXgBVwHtCfEC8AK8
+ AQcC9AP/GAAD/wH0AfIE8wf0AfMB9AHsAQcB/wL0A/MC7APxAvAB7wHsD1cBUAHsD1cBUAFyDVcBeAFW
+ Ae0J8QLwArwBBwL0A/8hAAP/AfQBcgYoAy8CNQEvBjUVKAEvBTUBLwwoAS4BNQEvATUJLwYoAUoB8wH0
+ A/8eAAEbAnQBeQKZAXkNdAJzAXQCcwh0BHMCdAJzAVEBcw10BHMDdAFzAVEBcwt0AnMBdAJzCnQBcwJ0
+ AXMCdAJ5ApkCdAGZGQAD/wH0AfIG8wT0AvMB7AHvAf8D9ALzAhUB8gPxAfAB7wHsAXgOVwFQAewPVwFQ
+ AXINVwF4AVcB9wjxAvACvAEHAfQE/xoAA/8B9AHyBvME9ALzAewB7wH/A/QC8wIVAfID8QHwAe8B7AlX
+ BlYBUAHsD1YBUAFyAVAMVgFXAVYB9wjxAvACvAEHAfQE/yIAA/8B9AFzBigCLwg1AS8XKAY1DigBLwI1
+ By8BLgYoAVAB8wH0A/8eAAEbAnQBeQOZW3kDmQF5AnQBmRoABP8B8gXzAfQB8wL0AvMC7AH/BPQB8wFt
+ ARUBvAHyA/EB7wHsAVcOVgFQAewQUAFzDVABVgFQAQcH8QLwArwBBwH0BP8cAAT/AfIF8wH0AfMC9ALz
+ AuwB/wT0AfMBbQEVAbwB8gPxAe8B7AFXDlYBUAHsEFABcw1QAVcBVgEHB/EC8AK8AQcB9AT/IgAE/wH0
+ AXMGKAIvATUBLwE1AS8BNQEvATUZKAY1ECgILwEuBigBcwHzAfQD/x4AAfQBdAN5X5kEeQGZGwAE/wHx
+ CPMB9AHzAuwC/wT0AfcBFQGSAvIC8QEHAewBVw5WAVAB7ARWDFABcw1QAVYBUAG8BvEC8AO8AfQE/x4A
+ BP8B8QjzAfQB8wLsAv8E9AH3ARUBkgLyAvEBBwHsAVcOVgFQAewEVgxQAXMNUAJWAbwG8QLwA7wB9AT/
+ IwAE/wH0AXMGKAMvAjUBLwQ1AS8XKAIvAjUBLwE1AS8NKAovAS4GKAHvAfMB9AP/HgAB/wGZBHldmQV5
+ AfMcAAT/AfEB8gjzAe0B7AP/ARQB7AK8ARUBbQLzAfIB8QEHAewOVwFWAVAB7AZWAlABVgZXAVABHANX
+ AVYJUAFWAVAG8QLwA7wB9AT/IAAE/wHxAfII8wHtAewD/wEUAewCvAEVAW0C8wHyAfEBBwHsBlcBeAJX
+ BlYBUAHsAlYMVwJQARwDVwhQA1cBVgbxAvADvAH0BP8kAAT/AfQBcwYoBC8DNQIvAjUCLxYoATUBLwQ1
+ CygMLwEuBigB8AL0A/8fAAHzB3lYmQZ5AZkB/x0ABP8B8QHyB/MB9wHsBP8B9AHvAxUD8wHyAbwB7AZX
+ A3gDVwF4AVcBVgFQAewIVgdXAVABHAFWAlcBVglQAVYBUAXxAvACvAHwAfQE/yIABP8B8QHyB/MB9wHs
+ BP8B9AHvAxUD8wHyAbwB7AFXAXgDVwJ4B1cBVgFQAewBVgF4DFcCUAEcBFcGUARXAVYF8QLwArwB8AH0
+ BP8lAAT/AfQBeAcoAy8BNQQvBTUBLhQoAS8BNQIvAjUJKAEuDC8BLgcoAfMB9AT/IAABG2N5AZkB/yAA
+ A/8B8QLyBfMB7wHsAf8C8wPyAfEB8AEHAvACvAEHAewFVwN4BFcBeAJXAVAB7AFWAlcEVgNXBVYBUAGY
+ AVACVgpQAVYBUATxAvACvAHxAfQD/yYAA/8B8QLyBfMB7wHsAf8C8wPyAfEB8AEHAvACvAEHAewFVwJ4
+ CFcBUAHsBVcHVgRQAZgBUARXBFADVwFQAlYE8QLwArwB8QH0A/8nAAT/AfMBeAkoBy8BNQEvAzUBLxMo
+ AS4BLwE1AS8CNQEvBygNLwkoAfMB9AT/IQAB8wGZYHkBGgH/IgAD/wHxAvIE8wG8EOwBeANXA3gFVwF4
+ AlcBUAHsCVcCVgVQAXINUAFWAVAC8QPwArwB8wT/KAAD/wHxAvIE8wG8EOwFVwJ4CFcBUAHsBlcFVgVQ
+ AXICUAFWA1cBVgFQA1cCUAJWAvED8AK8AfME/ygABP8B8wEcCygHLwM1Ay8SKAMvATUCLwUoDS8LKAHz
+ AfQD/yMAAf8B9AYbUZkGGwHzAf8lAAP/A/IE8wHwAfIB8Aa8BQcB7wHtAXgCVwJ4ClcBUAHsD1cBUAGY
+ AVYMUAFWAVAB8QPwArwB9AT/KgAD/wPyBPMB8AHyAfAGvAUHAe8B7QVXAngIVwFQAewLVwJWA1ABmANQ
+ AVYGVwNQAlYB8QPwArwB9AT/KQAD/wH0AfMBHAwoAS4LLxIoAi8BNQMvBSgLLwwoAVAB8wH0A/8rAAH0
+ BvNK9C4AA/8B9AHxAvID8wH0Av8D9APzAvIC8QG8Ae0PVwFQAewOVwFWAVABmQJWAVcKUAFWAVAD8AG8
+ AQcB9AT/LAAD/wH0AfEC8gPzAfQC/wP0A/MC8gLxAbwB7Q9XAVAB7A1XAVYCUAGZBVAEVgRQAlYD8AG8
+ AQcB9AT/KgAD/wH0AfMBHA4oCi8SKAEuATUFLwQoCS8OKAEHAfQE/ysAAfRQ8wH/LgAD/wH0AfEC8gLz
+ AfQB/wP0AvMC8gLxAvABvAGSD1cBUAHsDVcCVgFQAZkEVglQAVYBUAHwArwBBwH0BP8uAAP/AfQB8QLy
+ AvMB9AH/A/QC8wLyAvEC8AG8AZIPVwFQAewOVwFWAVABmQVQBVYDUAFWAVAB8AK8AQcB9AT/KwAD/wH0
+ AfMBHBAoCC8TKAYvBCgILw8oAfMB9AP/LABR8wH/MAAC/wH0AfED8gHzAf8E9ALzAvIC8QLwAZIFVwRW
+ B1AB7AxXA1YBUAGZAVADVglQAVYBUAK8AQcE/zIAAv8B9AHxA/IB8wH/BPQC8wLyAvEC8AGSBVcEVgdQ
+ AewOVwFWAVABmQRQB1YCUAFWAVACvAEHBP8tAAP/AfQB8wEcEigGLxMoBi8EKAYvESgB9AT/LABR8wH/
+ MQAC/wH0AvEC8gL/BPQC8wLyAvEB8AGSBFcEVghQAewMVwNWAVABmQFQAlYKUAFWAVACvAT/NAAC/wH0
+ AvEC8gL/BPQC8wLyAvEB8AGSBFcEVghQAewOVwFWAVABmQNQAlYDUARWAVABVgFQArwE/y4AA/8B9AHz
+ ARwTKAEuBC8TKAEuBi8DKAQvEigBcwH0BP8sAFHzAf8yAAP/AfAB8QHyA/8E9ALzAvIC8QH3A1cEVghQ
+ AXIB7A9XAVABmQJWC1ABVgFQAfIE/zYAA/8B8AHxAfID/wT0AvMC8gLxAfcDVwRWCFABcgHsDlcBVgFQ
+ AZkCVgpQAlYBUAHyBP8vAAP/AfQB8wEcFSgDLxQoBi8DKAIvAS4TKAH0BP8tAFHzAf8zAAP/AvEB/wT0
+ A/MC8gHxAvAB9wJXBFYKUAHsD1cBUAGZAlYLUAFWAVAE/zgAA/8C8QH/BPQD8wLyAfEC8AH3AlcEVgpQ
+ AewOVwFWAVABmQJWC1ABVwFQBP8wAAP/AfQB8wEcFygBLxQoBi8DKAEvFCgBSQT/LgBR8wH/NQAD/wnx
+ BfABVwRWC1AB7A9XAVABcgNWClABVgFQAv88AAP/CfEF8AFXBFYLUAHsD1cBUAFyAlYLUAFWAVAC/zIA
+ A/8B9AHzARwtKAUvAS4XKAX/LgAB9FDzAf82AAL/AfQB8AzxAVcDVgpQAU8BUAHsD1cBUAFyA1YKUAFW
+ AVAB/z4AAv8B9AHwDPEBVwNWClABTwFQAewPVwFQAXIDVgpQAVYBUAH/MwAD/wH0AfMBHC0oBi8UKAEi
+ ASgBcwT/LwAB9FDzAf84AAL/AfQE8ALxBfABVwNWCVACTwFzAfAPVwFQARwDVgpQAVYBUEEAAv8B9ATw
+ AvEF8AFXA1YJUAJPAXMB8A9XAVABHANWClABVgFQNAAD/wH0AfMBHC0oBi8RKAQiASgE/zAAAfRQ8wH/
+ OgAG/wb0AXgBVglQBEkBmAHyAVYIVwZWAVABCAJWDVBDAAb/BvQBeAFWCVAESQGYAfIBVghXBlYBUAEI
+ AlYNUDQAA/8B9AHzARxCKAUiASgE/zEAAfRQ8wH/RAAT/wFWCFcGVgFQARsCVg1QTQAT/wFWCFcGVgFQ
+ ARsCVg1QNAAD/wH0AfMBHEEoBSIBSgT/MgAB9FDzAf9XAAFWB1cHVgFQARsDVgxQYAABVgdXB1YBUAEb
+ A1YMUDQAA/8B9AHzARw6KAEHAfQBcwEoASIBKAQiAUoBvAT/MwAB9FDzAf9XAAFWB1cHVgFQARsDVgxQ
+ YAABVgdXB1YBUAEbA1YMUDQAA/8B9AHzARw6KAHwBPQC8wHyAfACvAT/NAAB9EbzB/ID8wH/VwAPVgFQ
+ ARsEVgtQYAAPVgFQARsEVgtQNAAD/wH0AfMBHDooAfMD9AHzAfIB8QHwArwE/zUAAfQ78wLyEPEB8gLz
+ Af9XAA9WAVABGwRWC1BgAA9WAVABGwRWC1A0AAP/AfQB8gEcOigB/wL0AfMB8gHxAfACvAT/NgAB9Dnz
+ AfIC8QHwAbwPBwK8AfIB/1cAAVwEVwRWB1ABGwRWC1BgAAFcBFcEVgdQARsEVgtQNAAD/wH0AfIBHDoo
+ AvQB8wHyAfEB8AK8BP83AAH0OPMB8gHxAfABBwGSAe0C7AbtBJIE9wEHAf9YAAFcA1cEVgdQAZgBGwRW
+ C1BgAAFcA1cEVgdQAZgBGwRWC1AzAAT/AfQB8gEcOSgBIgLzAfIB8QHwArwE/zgAAfQ38wHyAfEBBwGS
+ A+wF7QWSBfcBBwH/WQABXAJXBFYIUAEIARsEVgtQYAABXAJXBFYIUAEIARsEVgtQNAAD/wH0AfIBHDgo
+ ASIBSQHzAfIB8QHwArwE/zkAAfQ28wHyAfEBBwHtA+wG7QSSBfcBvAH/WgACVwRWCVAB8AEbBFYLUGAA
+ AlcEVglQAfABGwRWC1A0AAP/AfQB8gEcOCgBIgHsAfIB8QHwAQcBvAT/OgAB9DXzAfIB8QEHAe0D7Abt
+ BZIE9wEHAf9bAAFXBVYJUAH0ARsEVgtQYAABVwVWCVAB9AEbBFYLUDMABP8B9AHyARw3KAIiAvABvAEH
+ AfAE/zsAAfQ18wHxAbwBkgTsBu0EkgT3AQcB/1wAAVcEVglQAU8B/wEbBVYKUGAAAVcEVglQAU8B/wEb
+ BVYKUDMABP8B9AHyARw1KAQiAfABvAEHAfAE/zwAAfQ08wHyAfEB7wTsBu0FkgP3AQcB/10AAVcDVgpQ
+ AU8BAAEbBFYLUGAAAVcDVgpQAU8BAAEbBFYLUDMABP8B8wHyARw0KAQiAUkBvAEHAfAE/z0AAfQ08wHx
+ AfAB7QPsBu0FkgP3AQcB/14AA1YIUAFPA0kBAAEbBVYKUGAAA1YIUAFPA0kBAAEbBVYKUDMAA/8B9AHz
+ AfIBHDMoBSICBwHwBP8+AAH0NPMB8QEHBOwG7QSSA/cBBwH/bwABGwVWB1ABTwFQAU9wAAEbBVYHUAFP
+ AVABTzMAA/8B9AHzAfIBHDMoBSIBBwHwA/9AADTzAfIB8QEHA+wG7QWSAfcBkgEHAf9wAAEIBVYHUAFP
+ AVABT3AAAQgFVgdQAU8BUAFPMwAD/wH0AfMB8gEcMygEIgHtAfED/0EANPMB8gHxAQcD7AbtBJIB9wGS
+ AQcB/3EAAQgEVghQAU8BUAFPcAABCARWCFABTwFQAU8zAAP/AfQB8wHyARwyKAUiAfEE/0EANPMB8gHx
+ AQcC7AbtBpIBBwH/cgABCARWCFABTwFQAU9wAAEIBFYIUAFPAVABTzMAA/8B9AHzAfIBHDIoBCIB8AP/
+ QwA08wHyAfEBBwHsBu0GkgEHAf9zAAEIBFYKUAFPcAABCARWClABTzMAA/8B9AHzAfIBHDMoAiIBHAP/
+ RAA08wHyAfEBBwHsBu0FkgEHAf90AAEIBFYKUAFPcAABCARWClABTzMAA/8C9AHyARwyKAIiAUoD/0UA
+ NPMB8gHxAQcB7AXtBZIBBwH/dQABCARWClABT3AAAQgEVgpQAU8zAAT/AfQB8wEcMygBSgP/RgA08wHy
+ AfEBBwHsBe0EkgG8Af92AAEIBFYKUAFPcAABCARWClABTzMABP8C9AGYMigBHAP/RwA08wHyAfEBBwHs
+ BO0EkgEHAf93AAEIBVcEVgZQcAABCAVXBFYGUDMABf8B9AGZMSgB9AL/SQAB9DPzAfIB8QEHBO0EkgEH
+ Af94AAEIBFcEVgdQcAABCARXBFYHUDQABf8BmS8oAQgC/0sAAfQz8wHyAfEBBwTtA5IBBwH/eQABCANX
+ BFYIUHAAAQgDVwRWCFA0AAX/AQgtKAEbAv9NAAH/M/MB8gHxAQcD7QOSAbwB/3oAAQgCVwRWCVBwAAEI
+ AlcEVglQNQAE/wEIKSgBcgH0Av9RADPzAfIB8QEHA+0CkgG8Af97AAEIAVcEVglQAZhwAAEIAVcEVglQ
+ AZg4AAH/AQgjKAFQAXgBGwH0Av9VAAH0MvMB8gHxAQcC7QKSAQcB/3wAAQgEVgpQAfBwAAEIBFYKUAHw
+ RQAZ/1sAMvMB8gHxAQcC7QGSAQcB/30AAcIEVgpQAf9wAAHCBFYKUAH/uQAB/zHzAfIB8QEHAu0BBwH/
+ fgABwgNWC1BxAAHCA1YLULsAAf8w8wHyAfEBBwHtAbwB//8AzAAB9C7zAvIBvAEHAf//AM8AAfYu8wHy
+ Af//AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AF0AAvMV9C//AfQB8ioAA/8B91YA
+ AREB8wL//wAxAAH0AfJF/wH0KQAC/wH0ARBZAAGSAv//ADAAAfQB/wH0BJkBnwF5CH4T5QteBF0EWAU3
+ CTYB9gH/AfQpAAL/AQ9bAAEHAv//AC8AA/8BNgtYBF0HXgrlDV4FXQpYBTYC/wH0KAAC/wFtBAABDj8V
+ E0MBEAUAAfQB//8AMAAC/wE2ClgEXQZeC+UOXgVdClgFNgP/KAAC/wQAAW0W/xr0EfMI8gTxB/AB7wQA
+ AewB//8AMAAC/wE2ClgFXQVeC+UNXgVdC1gFNgP/KAAB/wHwAwABEBj/GvQR8wjyBfEG8AH3BAAC//8A
+ LwAB9AH/DFgEXQNeDeUFXgPlBV4FXQtYBTYC/ykAAf8B7QMAAewZ/xr0EfMI8gXxBfABvAQAAv//AC8A
+ AfQB/wGZC1gEXQFeDuUGXgPlBV4FXQpYBTYBVwL/KQAB/wHtAwAB9xb/HfQR8wnyBPEG8AQABP//AC0A
+ AfQB/wEbC1gEXQFeDuUFXgXlBF4FXQpYBTYBeQH/AfQpAAH/Ae0DAAH3Ev8f9BLzCfIF8QbwBAAH//8A
+ KgAD/wFXC1gCXQF+D+UFXgblA14FXQpYBTYBnwH/AfQpAAH/Ae0DAAH3C/8X9BrzC/IG8QrwBAAB8AHx
+ AfIB8wT/qAAM/zAAEv8zAAL/AVcLWAFdA34N5QZeBuUCXgZdClgFNgHDAf8B9CkAAf8B7QMAAfcJ/wP0
+ F/MU8grxDvAIvAkAARIB8wL/pQAg/w0AJP8yAAL/AVcLWAFdA34N5QVeCOUBXgZdCVgGNgL/AfQpAAH/
+ Ae0DAAH3CP8C9AHzAvIP8RrwG7wGBwsAAZIC/6QASf8C9Af/MQAB9AH/DFgEfg3lBV4I5QF+Bl0JWAY2
+ A/8pAAH/Ae0DAAH3B/8C9AHzAfEB8AS8NwcQ7wwAAe8C/6IABf8K9C//EfQF/zAAAfQB/wGZC1gFfgvl
+ Bl4I5QJ+BF0KWAY2A/8pAAH/Ae0DAAH3B/8B9AHzAfEB8CMHI+8G9wcQAQ4FAAL/ogAD/wL0C/MP9BD/
+ DvQJ8wbyAvMC9AT/MAAB9AH/ARsLWAV+C+UFXgjlBH4DXQlYBzYC/yoAAf8B7QMAAfcG/wH0AfMB8gLw
+ Fv8a9BHzCPIE8QfwAQcEAAFtAf8rAEH/NQAE/wH0AfMC8gfxCfIg8wnyDfEB8gHzAfQE/zAAA/8LWAZ+
+ CuUFXgflBn4BXQpYBjYBVwL/KgAB/wHtAwAB9wb/AfQB8wHxAbwY/xr0EfMI8gTxB/AB9wMAAQ4C/yYA
+ SP8yAAT/AfMB8gHxAvAFvAjwCfEE8AEaA7wGBwTvBZkE7wGZA+8BBwGZAe8MBwG8AfAB8QHzAfQC9gH/
+ MQAC/wFXClgGfgnlAV4BXQJeAV0BXgflBn4BXQlYBjYBVwF5Av8qAAH/Ae0DAAH3Bv8B9AHyAfAB8hn/
+ GvQR8wnyBPEG8AEOAwAC/yUAB/899Ab/MQAD/wH0AfMB8gHwAbwB7wIcAXMBbgJLASojJAMqASQBKgEk
+ GyoB/zEAAv8BVwpYB34I5QVdB+UHfglYAVcFNgJXAZkB/wH0KgAB/wHtAwAB9wb/AfQB8gHwAfMb/xr0
+ EPMJ8gTxBfABDgMAAv8kAAT/AvQH8zTyBfMC9AT/MAAB/wIkASMCJAEjASQCIykkAyoBJB0qAf8xAAH0
+ Af8BeQNYATcGWAd+COUFXQblCH4BeQhYBTYDVwEbAf8B9CoAAf8B7QMAAfcG/wH0AfIB8AHzHP8a9BHz
+ CPIF8QPwAQ4DAAL/IwAE/wH0AfEOUBtWD1ACTwZJAXMB8gHzAvQD/y8AAf8EIy0kASoBJCAqAf8xAAH0
+ Af8BmQJYAXkBNgVYAXkIfgblBl0F5Qh+A3kGWAU2BFcC/wH0KgAB/wHtAwAB9wX/AvQB8gHwAfMe/xr0
+ EPMI8gXxAvABDgMAAv8iAAP/AfQB8w1QCVYRVwdWFVABSQHvAfIB8wH0A/8uAAH/AiQBIzAkICoC/zAA
+ AfQB/wEbA1gBNgVYAXkHfgKfAaADfgHlAVgEXQHlAaAC5Qp+A3kFWAY2AVgCVwE2Av8B9CoAAf8B7QMA
+ AfcF/wL0AfIB8AHzC/8BvQEXARYBGxD/GvQR8wjyBPEB8AEOAwAC/yEAA/8B9AHzC1AKVgFXAVYRVwdW
+ FlABSQEcAfEB8wH0A/8tAAH/MSQDKgEkHioC/zAAA/8BWAF5AVgCNgRYBn4FnwR+AVgEXQSgCX4DeQVY
+ BjYDWAFXATYD/yoAAf8B7QMAAfcF/wL0AfIB8AHzCf8BvQFHAZQBFwJHAeMQ/xr0EfMI8gTxAQ4DAAL/
+ IAAD/wH0AfMEUAFXAVgIXQJcC1cBVgFXAVYBVwFWBFcBVgpXAVYKVwJcB10BVwNQAU8B7wHxAfMB9AP/
+ LAAB/wFLASMtJCQqAv8xAAL/AVcBeQFYAjYDWAE3BH4HnwJ+AZ8FWAFdAqADnwh+A3kFWAU2BFgCVwL/
+ KwAB/wHtAwAB9wX/AvQB8gHwAfMJ/wEXAUcB8wH/Ab0DRwH0D/8b9BDzCPID8QEOAwAC/x8AA/8B9AHz
+ A1ACVkBJAVABVwJQAUkBBwHxAfMB9AP/KwAB/wF0KSQBKgEkASoBJCUqAv8xAAL/AVcBeQFXAjYEWAGf
+ AX4MnwVYCJ8FfgN5BVgFNgVYAlcC/ysAAf8B7QMAAfcF/wL0AfIB8AHzCf8BlAFHAZQD/wEXAkcB9BD/
+ GvQR8wjyAfEBDgMAAv8eAAP/AfQB8wFzAlABVgtJA08GUAFPBFABTwVQA08CUAFPAlABSQFPC1ABTwJQ
+ BE8JSQNQAUkBvAHyAfMB9AP/KgAB/wGZASMTJAFLAXMCHAQkAUsB7wEcAksBKgEkBEsFJAIqBEsDKglL
+ FCoC/zEAAfQB/wJ5AzYEWA2fAX4FWAGgCJ8EfgJ5BFgGNgFXBVgBVwF5Av8rAAH/Ae0DAAH3Bf8C9AHy
+ AfAB8wn/AfQCRwT/ARcCRwH0EP8a9BHzCPIBDgMAAv8dAAT/AfQB7wJQAVYHSQFPCVAISQJQC0kMUAJJ
+ CVACTwdJA1ABSQHwAfIB9AT/KQAB/wEbASMSJALwAbwC8AQkBfACSwPwAfEBJAQqASQBcwTxASQBKgG8
+ AvIE8QHyAfEB8gFLEyoC/zEAAfQB/wGZAXkDNgRYDZ8FWAF5C58BfgN5ATcCWAc2BlgBVwGZAf8B9CsA
+ Af8B7QMAAfcF/wL0AfIB8AHzCv8B4wFHAZQE/wNHEf8a9BHzB/IBDgMAAv8dAAP/AfQB8ANQAU8FSQlQ
+ AUkBcwnzAZgBUAzzAXMKUAG8AfINUAFPBUkCUAFPAUkB8AHyAfQD/ykAAf8B8xMkAUsE8AEHAiQBSwTw
+ AbwBJAEqAvEB8AHxASQBKgMkASoBdATxAioB8APxAfIB8QHyAfEC8gF0EioBTAL/MQAB9AH/ARsBeQM2
+ ATcDWA2fATcEWAufAn4CeQNYBzYHWAFXARsB/wH0KwAB/wHtAwAB9wb/AfQB8gHwAfMK/wH0AkcB8wT/
+ AkcBFxL/GvQQ8wbyAQ4DAAL/HAAD/wH0AfMEUAVJCVABSQvzAZkBUA3zAfAJUAPyDVAGSQJQAU8BUAHw
+ AfMB9AP/KAAB/wH2FCQF8AIkBfADJATxASQDKgEkASoBdATxAioBvAPxBvIBBxIqAVIC/zEAAv8B9gFY
+ AzYCNwFYAXkMnwF+BVgLnwJ+AnkBNwg2CFgBVwH2Af8B9CsAAf8B7QMAAfcG/wH0AfIB8AHzC/8BtwFH
+ ARcE/wG9AkcBlBL/GvQR8wTyAQ4DAAL/GwAD/wH0AfMBTwNQBEkBTwlQAU8D8wH0AcMHoAF+AVABXAHl
+ AqAB5QOgAeUBoAHlAZ8C8whQBPIBBw1QAU8FSQJQAUkBHAHxAfMB9AP/JwAC/xQkASoE8AEHAUsE8AEc
+ AyQE8QEqAUsC8QHyASQBdALxAvICKgHwAfIC8QbyAfASKgF0Av8yAAL/AVcDNgM3AXkMnwVYAXkLnwF+
+ AnkJNgFYAnkGWAFXAv8B9CsAAf8B7QMAAfcG/wH0AfIB8AHzDP8BFgFHARYE/wEWAkcB9BP/GvQQ8wPy
+ AQ4DAAL/GgAD/wH0AfMB8gNQBUkKUAEIAvMBwhdQAZgB8wEIBlABmALyARoC8g5QBkkBUAFPAUkBvAHx
+ AfMB9AP/JgAC/xUkAQcE8AG8A/AB8QQkBPEBKgGTA/EBKgEcBPECKgHwBPIYKgGZAv8yAAL/BDYBNwFY
+ ATcNnwE3BFgNnwF5AVgJNgR5BVgBVwP/KwAB/wHtAwAB9wb/AfQB8gHwAfMN/wHjAUcBlAT/AkcBFxT/
+ GvQR8wHyAQ4DAAL/GgAD/wH0AfIB8QJQBUkBTwpQAvMBoBhQAZgB8wEIBlAC8gEbAVYB8gLxDlAGSQFQ
+ ASgB8AG8AfIB9AP/JgAC/xYkAfEH8AFLBCQE8QEqBPECdALxAfIBvAIqAfAC8gHxAfIYKgGaAv8yAAH0
+ Af8BVwI2ATcCWAE2DJ8BeQE3BFgBoAyfAXkJNgV5BVgBVwL/LAAB/wHtAwAB9wb/AfQB8gHwAfMO/wEW
+ AUcBvQP/AfQCRwGUFP8a9BHzAQ4DAAL/GQAD/wH0A/IBUAZJC1AC8wFXD1AITwGYAvMB5QVQAfAC8gF+
+ AlAC8QF4DVAGSQFQAUkD8AHyAfQD/yUAAv8WJAEcA/AB8QPwAiQDKgTxASQC8QHyAfEB8AF0A/EBvAIq
+ AfAE8hgqARoC/zIAAfQB/wF5AjYDWAE2DJ8FWAF5DZ8JNgd5BFgBVwL/LAAB/wHtAwAB9wb/AfQB8gHw
+ AfMP/wGUAUcBvQP/ARYCRxX/GvQQ8wEOAwAC/xgAA/8B9AHzA/IHSQtQAvMBVg1QAZgM8wFXBFABcgLy
+ AcMDUAG8AvENUAFPB0kC8QG8AfEB8wH0A/8kAAL/FyQG8AEqAiQBKgEkASoE8QFLBPEB8gF0AfEB8gHx
+ AZkCKgHwA/IB8xgqARsC/zIAAfQB/wGfAjYEWAWfARoGnwE2A1gBNwHDAcILnwF5CDYBWAd5BFgBeQL/
+ LAAB/wHtAwAB9wb/AfQB8gHwAfMQ/wG9AUcBvQP/AkcBFxb/GvQO8wEOAwAC/xcAA/8B9ATzAf8BmAZJ
+ C1AC8w1QARwL8wH0AVcFUAPyAVcEUALxAbwMUAFPBkkB8wH/AvEBvAHxAfMB9AP/IwAC/xckARwB8AHx
+ AfAC8QMkASoCJATxARwC8QPyAXQD8QEcAioB8ATyGCoB8wL/GAABEwJDChEBQwERC0MBFQH/AfYCNgRY
+ C58BeQE2BFgBwwTCCJ8INgFYCXkDWAGZAf8B8gRDGRUB8w4AAf8B7QMAAfcG/wH0AfIB8AHzEf8B9AEX
+ Ab0C/wG9AkcBvRb/GvQN8wEOAwAC/xcAA/8B9AHzAfIB8wH/AfMB/wFKBUkLUALzAXIMUAPzAZ8HVwFW
+ BlAB7wLyAaAFUAF4AfEB8AxQBkkB8QG8AfAB9AHxAfABvAHyAfQD/yMAAv8XJAbwAXMCJAMqAbwD8QHw
+ AvEBUQLxAbwC8gHxAXQCKgHwBPIYKgH0Av8XABVDBRUBQwERAv8CNgRYA58CGgWfARoBVwE2A1gBeQbC
+ AZ8BGgSfAVcINgGZCXkDWAEbAf8BBwVDGRUBBw0AAf8B7QMAAfcG/wH0AfIB8AHzE/8CtwL/A0cY/xr0
+ C/MBDgMAAv8WAAP/AfQB8wHyAfMB/wPzAf8GSQpQAfIC8wxQAvMBmA5QAU8D8gdQAfEC8AtQBUkB7wHw
+ ArwB8wHyAfEBvAHwAfIB9AP/IgAC/xYkBPAB8QHwAvECJAEqASQBKgG8BPEB8gHxASQC8QHyAfEC8gFR
+ AioB8APyAfMYKgH2Av8XABcVAxQBQwERAv8FNgF5ApkFnwKZAp8FNgYaA58DmQF5CDYLeQJYAVcB9AH/
+ AewFQxkUAe8NAAH/Ae0DAAH3Bf8C9AHyAfAB8xX/Ab0C/wJHARYY/xr0CvMBDgMAAv8VAAP/AfQB8wHy
+ AfMC9ATzAf8FSQFPClAD8wEcAVAHSQJQA/MBUApJA1AB8QLyAX4IUALwAZgJUAVJAVAB8gTwAf8C8QEH
+ AfEB8wH0A/8hAAL/AUsUJAFLA/AC8QHwAvEBmQQkAZkF8QG8ASoE8gHxAfIBSwIqAfAE8hgqA/8XABYU
+ AxMBFQERARABvAH0ATAENgF5CpkBeQQ2AVcBmQIICZkINgFXCHkCWARXAfQB8wESBREYEwEUAe8NAAH/
+ Ae0DAAH3Bf8C9AHyAfAB8xj/AeMCRxn/GvQJ8wEOAwAC/xQAA/8B9ATzAf8B8wP0AfMB9AHzBkkKUAvz
+ AZgCUA3zAlABcgLyAcMJUAEHAvAIUAZJAfMG8AH/AfEB8AG8AfIB8wP/IQAC/wFSFCQC8QLwAfEBkwHw
+ A/EEKgEcAvEB8gLxAUsBKgF0AfEB8gLxAfIBSwIqAfAE8hgqA/8XAAFtFRMDEgEVAhAB7QHxAVEEMAF5
+ CpkBUQQwAXkKmQF5AVEELwMwAVECeQR4CFcBUQHzAfEBEQUQAeoIEgUTBhIFEwHvDQAB/wHtAwAB9wX/
+ AvQB8gHwAfMY/wH0AkcB4xr/GvQH8wEOAwAC/xQAA/8B9ALyAfMB/wHzBfQB8wH0AbwGSQlQAVYBnwnz
+ AZ8CUAFWDPMBUAFPA/IBVwpQAvABvAVQB0kB9ALwA/EC8AHyAfMB8QLwAfIB9AP/IAAC/wF0EyQBmQHw
+ A/EBSwEqBPEBvAEkAioBdAXxASQCKgXyAyoB8ATyGCoD/xcAAewMEgMTBhIC6gESARACDgEUAbwBHAQv
+ ARwBeAUcAXgDHAUvAZkHHAF4AhwBeAgvAngBcwxRAVAB8AG8Bg4BbQfqBRIF6gcSAfcNAAH/Ae0DAAH3
+ Bf8C9AHyAfAB8xn/ARYCRwG3Gv8a9AbzAQ4DAAL/EwAD/wH0AfMB8gHzAf8I9AHzAf8BBwdJAk8IUAhX
+ AVYEUAtXAlADVwJQAUkIUAFWAlcBUANPB0kB/wLwBfEC8AH0AvEBBwHwAfMB9AP/HgAD/wGZEiQBKgPw
+ AvEBJAEqAfAE8QFLAioBSwLxAfIC8QMqBPIB8QMqAfAE8hgqA/8XAAHsARIB6gQSBeoFEgTqAm0B6gFt
+ Ag4BAAEOAe8BHAEpAy8KcwFRASkEAwUcBnMEKQQvCFEIUAEpAQcB7wEABQ4B6gZtBeoFbQjqAfcNAAH/
+ Ae0DAAH3Bf8C9AHyAfAB8xr/A0cBvQEWAb0Y/xr0BfMBDgMAAv8SAAP/AfQE8wH/CfQB8wH/ARwVSQFP
+ A0kBTwVJAVAGSQFQAU8BUARJAU8HSQFPD0kB/wHwCPEC8AH/AfEB8AEHAfEB8wH0Av8eAAP/ARoSJAFz
+ AfAD8QFzASQBKgFLA/EB8AEcAioBSwTxAXQDKgF0A/IB8QMqAfAE8hgqA/8XAAHrBuoFbQTqB20B6gFt
+ BAABkgH3ASgDKQpzAigDKQFQCnMBSgQoAykKUANKAykCKAH3Ae0GAAETGG0B9w0AAf8B7QMAAfcF/wL0
+ AfIB8AHzGv8BlAJHAb0B/wHzARcB4wHzFv8M9AHzAb0BlAEWAZQBGgHzB/QE8wEOAwAC/xIAA/8B9ALy
+ AfMB/wHzCvQB8wH/AbwBKEJJAf8C8APxAvIE8QHwAfEB9AHxAfABvAHyAfQD/x0AA/8BGhYkASoBJAEq
+ AiQBSwEkBioBJAIqASQpKgP/FwAZbQQAAuwBIgMoCkoFKATrA20ESggoB0oFKQUoAUkB7AFtBgABQxdt
+ AesBBw0AAf8B7QMAAfcF/wL0AfIB8AHzG/8DRwT/AZQBRwEXAZQBvRT/BvQBvQHjCUcBlAj0AvMBDgMA
+ Av8RAAP/AfQB8wHyAfMB/w30AfMB9AL/AQcCHAFzN3IBcwHtARwBBwH/AfMB8ATxBPID8QLwAfMB8QHw
+ AQcB8AHzAfQD/xwAA/8B8RQkASoCJDkqA/8XAAGSGG0EAAHqAesEIglKAUkEIgEoBuoESggiBkoJKAMi
+ AUkBbQEUBgABDwLrB20D6wttAesBBw0AAf8B7QMAAfcF/wL0AfIB8AHzG/8BlAJHAb0F/wG9ARYCRwHj
+ AZQB9BH/AvQBlAEXBUcBFgK9BPQBGgn0AfMBDgMAAv8RAAL/AfQC8wHyAfMB/w70CPMH9BLzAfIB8xHy
+ C/ED8AbxBvID8QLwAf8B8QHwAQcB8QHzAfQC/xwAA/8B8xIkASoCJAEqASQBKgEkNyoD/xcAAfcB7QES
+ A20E6wVtBesKbQTrCuwF6wfsEOsMbQESAxMDFAQTAusGbQTrCW0B6gESAewBkgG8DQAB/wHtAwAB9wX/
+ AvQB8gHwAfMc/wNHCP8B9AEWBEcBFgG9AfQK/wH0ARoBFwVHAZQJ9AEbARoJ9AEOAwAC/xAAA/8B9ALy
+ AfMB/xH0FfMB8gHzEvIc8QfyA/ED8AH0AfEB8AG8AfIB9AP/GwAD/wH0EiQBKgEkBCoBJDcqA/8XAAP3
+ AZID7ALtFOwC6wHsMesf7ALrAuwBkgH3ApIBvA0AAf8B7QMAAfcG/wH0AfIB8AHzHP8BlAJHAbcK/wH0
+ AZQB4wVHAeMBlAG9AfMC/wH0AZQFRwEWC/QBGgFHAbcJ9AEOAwAC/w8AA/8B9AHzAvIB/xP0AfMB9Bzz
+ EfIB8QTyDfEL8gPxAvAB8wHxAfABBwHwAfMB9AP/GgAE/xUkBSoBJDUqA/8XAAr3He8LBwu8CPALvAoH
+ Ee8N9wHwDQAB/wHtAwAB9wX/AvQB8gHwAfMd/wNHDv8BvQGUARcMRwGUAv8H9AHzAb0BFgEXAkcK9AEO
+ AwAC/w8AA/8B8wLyAfMB/w70AZII7QHsAe097AnyA/ED8AH/AfEB8AG8AfEB8wP/GgAD/wH2DyQIKgEk
+ OCoD/xcAB/ca7wgHBrwF8APxBvII8wbyA/EE8Aa8CAcP7wn3AfENAAH/Ae0DAAH3Bf8C9AHyAfAB8x3/
+ AZQCRwG9Ev8BvQEWFkcBFwv0AQ4DAAL/DgAD/wH0A/IB/wHzDvQB7wHtAfQC8AW8BQcC7wHtAewQ8AH3
+ AewG8Aq8AuwPvAHtAewJ8gTxA/AB9AHxAbwB8AHyAfQD/xkABP8NJAEqAyQBKgEkASoBJDsqBP8WAAX3
+ Ge8HBwa8BPAC8QPyBPMG9Ab/BvQD8wPyA/ED8Aa8BwcN7wj3AfENAAH/Ae0DAAH3Bf8C9AHyAfAB8x7/
+ A0cT/wHjA0cBFwG3ARYB4wIXCUcBFwHjAZQN9AEOAwAC/w4AAv8B9ALzAfIR9AEHAe0D/wX0BPMC8gHx
+ Au0B8Q/zAe8B7A/zAfIC7A/yAuwI8gXxAvABvAH0AfEB8AEHAfEB8wH0Av8ZAAT/DSQCKgEkQCoE/xYA
+ BfcG7xgHBrwD8ALxBPID8wT0EP8E9APzA/ID8QPwBLwPBwXvB/cB8g0AAf8B7QMAAfcF/wL0AfIB8AHz
+ Hv8BFgJHAZQQ/wG9BEcBvQj/F/QBDgMAAv8NAAP/AfQC8gHzAf8B8w/0AfAB7QH0Af8C9AESARUBEgHr
+ AW0CFQH3AvIB8QH3AewBvA/zAe8B7BDzAuwB8w7yAuwK8gTxAvABvAH/AvEBvAHyAfQD/xgABP8IJAEq
+ AiQDKgIkEioFMSkqBP8WAAX3Be8XBwa8A/AD8QPyBPMD9BP/BPQE8wLyA/EC8AW8EAcE7wb3AfMNAAH/
+ Ae0DAAH3Bf8C9AHyAfAB8x//A0cP/wGUA0cB4w//EvQBDgMAAv8NAAL/AfQB8wHxAfIB/wHzEPQB8wHt
+ AfAB/wH0AhUB8wH0A/MB8AIVAfIB8QHvAewBvA/zAe8B7BDzAuwC8w3yAuwJ8gbxA/AB8gHwAbwB8QHz
+ AfQC/xgABP8OJAcqASQMKgYxKCoE/xYABPcE7xQHCrwE8ALxBPID8wX0Ev8F9APzA/IC8QPwBLwRBwTv
+ BfcB8w0AAf8B7QMAAfcF/wL0AfIB8AHzH/8BFgJHAb0N/wHjA0cBvRL/EPQBDgMAAv8MAAP/AfQC8gHz
+ E/QB7QEHAf8G9ALzAfACFQLyAe8B7AEHD/MB7wHsD/MB8gHsAe0P8gHsAZIK8gXxAvABvAH/AfEB8AG8
+ AfIB9AP/FwAE/wkkASoEJAQqASQPKgYxKCoE/xYABPcD7wQHCLwFBw28BPAD8QTyBPMF9BD/BfQE8wPy
+ AvED8AS8EgcD7wX3AfQNAAH/Ae0DAAH3Bf8C9AHyAfAB8x//AfQDRwz/ARcCRwEXAfQU/w/0AQ4DAAL/
+ DAAD/wHzAfEB8gH/AfMS9AHtAfcD/wP0AxUBEwHvAfMC8gHvAewB7w/zAe8B7BDzAewB9w/yAewB9wby
+ AfEB8gjxAvABvAH0AfABBwHxAfMD/xcAA/8B9AUkBCoCJBgqBTEBKyYqAUsE/xYAAZID9wPvAwcJvAUH
+ C7wG8ATxBPIF8wb0CP8I9AXzA/ID8QLwBLwUBwPvBPcB9A0AAf8B7QMAAfcF/wH0AfMB8gHwAfMg/wEX
+ AkcB9Ar/AeMCRwHjGP8N9AEOAwAC/wwAAv8B9AHzAfIB8xT0Au0D/wb0AeoBFQEHAfMB8gEHAewB9w/z
+ Ae8B7A7zAvIB7AH3DvIB8AHsAQcF8gvxAvABvAHzAfABvAHwAfMB9AL/FwAD/wH0ByQBKgIkAyoBJBUq
+ BjEmKgFMBP8WAAGSAvcD7wMHCLwJBwi8CPAG8QfyCbwB8gvzBvID8QLwA7wHBwTvBwcDvAMHA+8D9wH/
+ DQAB/wHtAwAB9wX/AfQB8wHyAfAB8yD/Ab0CRwHjCf8BFgJHAeMa/wz0AQ4DAAL/DAAC/wH0AfMB8gH/
+ AfMT9ALtA/8CFQHyA/QB7AEVAZIC8wEHAewBkg/zAe8B7A3zA/IB7AHvDvIBBwHsAfAH8grxAfACvAH0
+ AvAB8wH0Av8XAAP/AfQCJAEqASQBKgIkASoBJAYqASQTKgYxJioBUgT/FgAD9wLvAwcJvAMHGO8LBwnw
+ DrwMBw3vBAcFvAMHA+8C9wH/DQAB/wHtAwAB9wX/AfQB8wHyAfAB8yH/A0cI/wG9AkcBFxz/C/QBDgMA
+ Av8MAAL/AvQD8xP0Au0E/wHxAewBEgETAW0B9wH0A/MBvAHsAe0P8wHvAewO8wLyAewBBw7yAe8B7AXy
+ DfEC8AG8AfEC8AHzAfQC/xcAA/8B9AIkASoEJB0qBTEBKyUqAVIB9AP/FgAC9wLvAgcDvATwBLwCBwH3
+ AUMaDwEQAhECQwEVAhQBEwMSAeoCEgITARQCFQJDAREBEAcPAQ4VDwEOAREB7wMHB7wDBwPvAfcB/w0A
+ Af8B7QMAAfcF/wH0AfMB8gHwAfMh/wGUAkcBlAf/A0cf/wn0AQ4DAAL/DAAC/wL0AvMU9AHvAe0B/wLz
+ BfIC8QTwAQcC7A/zAe8B7A/zAfEB7AG8DvIB9wHsA/IB8QHyAfEB8gvxAvACvAHwAfEB8wH0Av8XAAP/
+ AfQBKgQkASoCJBwqBjElKgF0AfQD/xYAAe8B9wLvAQcDvAbwArwDBwHvAQ4BEE4RARABDgHvAwcIvAIH
+ A+8B9wH/DQAB/wHtAwAB9wX/AfQB8wHyAfAB8yL/AkcBFwb/ARcCRwH0IP8I9AEOAwAC/wwAA/8B9APz
+ E/QBBwntPOwE8g7xAvADvAHyAfQD/xcAA/8B9AEqASQCKgEkASoBJB0qBjElKgF0AfQD/xYAAQcB9wHv
+ AgcCvALwA/EC8AK8AgcB7wH3AQ8QEQhDBhEEQy4RAQ4B7wIHA7wF8AK8AgcC7wH3DgAB/wHtAwAB9wX/
+ AfQB8wHyAfAB8yL/AeMCRwG9BP8BlAJHAZQi/wf0AQ4DAAL/DAAD/wH0A/MT9AHwAe0BvAUHCO8B9wLs
+ EFAB7A9QAS4B7A9QAuwF8g3xAvADvAHzAfQD/xcAA/8B9AMqASQBKgIkHioFMQErJCoBmQH0A/8WAAEH
+ AfcB7wEHArwB8AbxAfACvAIHAe8B9wEPEBEIFQYRBUMtEQEOAe8CBwK8A/AB8QPwArwCBwHvAfcOAAH/
+ Ae0DAAH3Bf8B9AHzAfIBvAHzIv8BvQJHARYE/wJHARck/wb0AQ4DAAL/DQAD/wH0AvMT9AHzAe0B8AP/
+ BPQE8wLyAbwC7BBQAewQUAHsD1AC7AHyEPEC8AK8AQcB8gH0A/8YAAP/AfQlKgYxJCoBGgH0A/8WAAG8
+ AfcB7wEHAbwB8ALxBPIB8QHwArwCBwHvAe0BDwoRBkMEFAQVAkMEEQUVChEDQyARAQ8B7wEHA7wB8AXx
+ AvACvAEHAe8B9w4AAf8B7QMAAfcF/wH0AfMB8gG8AfMj/wNHA/8BFgJHJ/8E9AEOAwAC/w0ABP8D8xP0
+ Ae0BBwH/AfQBEwEVAeoH9wHxAbwC7A9WAVAB7A9WAVAB7AFQDlYB7AHtAfEC8g7xAvACvAHwAfMB9AP/
+ GAAD/wH0ASoEJBMqATEMKgYxCyoBMRgqAfEB9AP/FgAB8AH3AgcBvAHwAfEC8gLzAvIB8QHwAbwCBwH3
+ AewBEAkRB0MIFAZDARQEFSVDCBEBDwH3AQcCvALwAvED8gHxAfACvAEHAe8B9w4AAf8B7QMAAfcF/wH0
+ AfMB8gG8AfMj/wHjAkcD/wJHARYo/wP0AQ4DAAL/DgAD/wH0AfIC8xL0Ae0B9wH/A/QB7AEVARQB9wHz
+ A/IB8QHwAuwPVgFQAewPVgFQAewPVgHsAfcB8gHxAfIN8QLwA7wB8wH0A/8ZAAP/AfQBKgEkBCoBJA8q
+ AzENKgUxASsKKgMxFioB8wH0A/8WAAHxAfcBBwPvCQcD7wH3AW0JEQhDAhMGFAZDBRQoQwURARAB9wHv
+ AQcDvALwAvEC8AO8AgcB9w4AAf8B7QMAAfcF/wH0AfMB8gG8AfMj/wH0AkcBlAH/AeMCRyv/AfQBDgMA
+ Av8PAAP/AfQB8gLzEfQC7QL/BfQB7QIVAfcC8gHwAe0B7AFXDlYBUAHsD1YBUAHsDlYBVwHsAQcB8QHy
+ DfEC8AO8AfMB9AP/GgAD/wH0AioBJBEqBTENKgYxCioFMRQqAfMB9AP/FgAB8gLtAZIH9wjvARMGQwcV
+ BBQIbQYUBeoKFAITCRQTFQZDAfcD7wv3AZIC9w4AAf8B7QMAAfcF/wH0AfMB8gG8AfMk/wNHAfQCRwGU
+ LP8BDgMAAv8QAAT/AfIC8xD0Au0D/wX0AfMB8AIVAfIB8QGSAewPVwFQAewPVwFQAewBVg5XAewBvA7x
+ AvACvAEHAfMB9AP/GwAD/wH0ASoBJBAqASsGMQ0qBjEKKgYxASsSKgHzAfQD/xYAAfMD9wzvAwcLFAYT
+ ARIB7AfrBBMCEgPrAm0JEgETCRIMEwsUAxUBFAHvBQcB7wIHB+8C9w4AAf8B7QMAAfcF/wH0AfMB8gG8
+ AfMk/wEWAkcBlAJHLf8BDgMAAv8RAAP/AfQB8gPzDvQC7QL/AfIBFQETBPQB8gIVAvIBkgHsD1cBUAHs
+ D1cBUAHsDlcBVgHsAfIN8QLwArwBBwHzAfQD/xwAA/8B9AFLECoIMQ4qBTEKKggxESoB8wH0A/8WAAH0
+ AfcBBwW8BvAF8QH3Au0E7ATrAm0C6gISAW0B6wNtA+oBEgUVBBMBFApDBhUCQwEVBEMJFQ4UARMR7wH3
+ DgAB/wHtAwAB9wT/AvQB8wHyAbwB8yT/Ab0ERwEWLf8BDgMAAv8SAAP/AfQB8gPzDfQB9wHtBP8B8wHv
+ A+wB9wHxAvMB8gH3AewPVwFQAewPVwFQAewOVwFWAewN8QLwArwBBwHzAfQD/x0AA/8B9AFLDioKMQ4q
+ BjEJKgoxDyoB8wH0A/8WAAHzAfcEvAbwB/EBBwLtBOwD6wNtAuoCEgPrA20C6gEUBBUBFAQTARUJQwEV
+ ARQSFQkUCRMQBwLvDgAB/wHtAwAB9wH/AfQC/wL0AfMB8gG8AfMl/wRHLv8BDgMAAv8TAAP/AfQB8gTz
+ C/QBBwHtAfQD8QTwBbwBBwH3AewBeA5XAVAB7AFXDngBUAFyAVcNeAFQAewM8QLwArwBBwHzAfQD/x4A
+ A/8B9AFLDCoMMQ4qBjEJKgwxDSoB8wH0A/8WAAH0Ae8DvATwCPEB8gHxAfAB7QXsA+sDbQLqAhIE6wNt
+ AeoBFAQVAxIBEwEUCUMBFQMUDxUHFAgTAxIBEwESAbwRBw4AAf8B7QMAAfcB/wL0Af8C9AHzAfIBvAHz
+ Jf8B4wJHARcu/wEOAwAC/xQAA/8B9AHyBPMK9AG8Ae0Q7AFXA1YMUAHsEFABcg1QAVcBUAHsC/EC8AK8
+ AQcB8wH0A/8fAAP/AfQBSwsqDDEQKgUxASsJKgwxASsLKgHzAfQD/xcAAfcB8AG8BPAG8QbyBewE6wNt
+ AuoBEgFtBOsDbQIUAxUFEglDARUFFA0VBhQGEwgSAeoMvAUHAbwOAAH/Ae0DAAH3Af8F9AHzAfIBvAHz
+ Jf8BvQJHAb0u/wEOAwAC/xUAA/8B9AHyBPMJ9AHzAewB8QH0AvMB8gPxBPACvAHvAewBeA5XAVAB7A9X
+ AVABcg1XAXgBVwHsCvEC8AK8AQcB8wH0A/8gAAP/AfQBUgkqDDESKgYxCioBKwwxCioB8wH0A/8XAAHv
+ BfAE8QjyAfMF7APrA20C6gISBusCbQIUAxUB6gMSARUIQwEVCBQBQwkVBRQFEwYSBOoBbQHrELwBBwHy
+ DgAB/wHtAwAB9wH/BfQB8wHyAbwB8yX/AbcCRwH0Lv8BDgMAAv8WAAP/AfQB8gTzB/QB8wH0AewBBwH/
+ AvQD8wLsA/EC8AHvAewBeA5XAVAB7A9XAVABcg1XAXgBVwHtCfEC8AK8AQcC9AP/IQAD/wH0AVIHKg0x
+ EyoGMQwqDTEIKgHzAfQD/xcAAQcBvALwBPEJ8gLzBOwE6wNtAuoCEgHsBusDFAIVA+oBEgEUARUHQwEV
+ ARMHFAFDCBUGFAQTBBIF6gNtAesB9wzwBLwBBwH0DgAB/wHtAwAB9wH/BfQB8wHyAbwB8yX/ARcCRwHz
+ Lv8BDgMAAv8XAAP/AfQB8gbzBPQC8wHsAe8B/wP0AvMCFQHyA/EB8AHvAewBeA5XAVAB7A9XAVABcg1X
+ AXgBVwH3CPEC8AK8AQcB9AT/IgAD/wH0AVIHKgsxFioFMQErDSoHMQErAzECKgEkBSoB8wH0A/8XAAHw
+ AbwB8APxBvIH8wGSA+wD6wNtA+oBEgFtAewG6wIUAhUBEwPqARIBQwEVB0MCEwYUAUMIFQYUAxMEEgTq
+ BG0C6wHsAQcK8QXwAbwBBw8AAf8B7QMAAfcB/wX0AfMB8gG8AfMl/wNHAb0u/wEOAwAC/xgABP8B8gXz
+ AfQB8wL0AvMC7AH/BPQB8wFtARUBvAHyA/EB7wHsAVcOVgFQAewQUAFzDVABVgFQAQcH8QLwArwBBwH0
+ BP8jAAP/AfQBdAcqCTEYKgYxDyoCMQcrASoCJAEqAyQBSwHzAfQD/xcAAfMBvAPxBfIJ8wEHAe0C7APr
+ Am0D6gISA+wE6wETAhQCFQJtAuoBQwIVBkMEEwQUAUMIFQYUAxMDEgPqBG0F6wHtCfIE8QTwAbwPAAH/
+ Ae0DAAH3BvQB8wHxAbwB8yT/Ab0DRwG9Lv8BDgMAAv8ZAAT/AfEI8wH0AfMC7AL/BPQB9wEVAZIC8gLx
+ AQcB7AFXDlYBUAHsBFYMUAFzDVABVgFQAbwG8QLwA7wB9AT/IwAE/wH0AXQHKggxGSoGMRAqCCsBKgYk
+ AXQB8wH0A/8XAAH/AbwC8QTyC/MB8QHtAewD6wNtA+oCEgPsBOsDFAEVAeoDbQMVBkMBEgUTAhQCQwcV
+ BhQDEwMSAuoEbQfrAewB8wvyA/EC8AG8DwAB/wHtAwAB9wb0AfMB8QG8AfMk/wGUA0cBlC7/AQ4DAAL/
+ GgAE/wHxAfII8wHtAewD/wEUAewCvAEVAW0C8wHyAfEBBwHsCVcBVgVXAVAB7AVXAVYBUANWBlABHARQ
+ A1YGUAFWAVAG8QLwA7wB9AT/JAAE/wH0AXQHKgkxASsYKgUxASsNKgcrBCoGJAGZAfMB9AP/GAABvAXy
+ DPMB9AHtBOsCbQPqAhIBbQPsA+sBEwQUAesCbQESAxUFQwMSBBMBFQJDCBUFFAMTAxIC6gNtBesF7AH0
+ B/MF8gPxAbwB8g8AAf8B7QMAAfcG9AHzAfEBvAHzJP8BFwFHAZQBRwEWLv8BDgMAAv8bAAT/AfEB8gfz
+ AfcB7AT/AfQB7wMVA/MB8gG8AewGeARXBXgBcgHsBVcCVgNXAVYFUAEcA1ABVgJXAVYGUAFWAVAF8QLw
+ ArwB8AH0BP8lAAT/AfQBdAcqATEBKwkxFyoGMQwqASsLKgYkAfAC9AP/GAABvAHxBfIL8wH0AewD6wNt
+ AuoDEgXsAusDFAEVAesDbQhDBRICEwEVAkMIFQUUAxMDEgLqAm0F6wfsCvME8gLxAbwB9A8AAf8B7QMA
+ AfcG9AHzAfEBvAHzJP8CRwH/ARcBFi7/AQ4DAAL/HQAD/wHxAvIF8wHvAewB/wLzA/IB8QHwAQcC8AK8
+ AQcB7AF4CFcCeARXAXIB7AVXA1YDVwFWBFABmANQAlcBVgdQAVYBUATxAvACvAHxAfQD/ycABP8B9AF0
+ CCoMMRUqBjEKKgMrCioHJAHzAfQE/xgAAfEB8ATyDPMB9APrA20C6gMSARMG7AESAxQBEwPrAhUGQwET
+ BhIGQwYVBRQCEwMSAuoDbQTrBuwB7QGSCvME8gLxAbwQAAH/Ae0DAAH3BvQB8wHxAbwB8wL0If8B9AJH
+ Af8BFgEXLv8BDgMAAv8eAAP/AfEC8gTzAbwQ7AhXAngFVwFQAewGVwNWA1cEUAFyAlACVwFWCFABVgFQ
+ AvED8AK8AfME/ygABP8B8wF0CCoBJAErBDECKwYxFCoFMQErByoCKwsqASMIJAHzAfQE/xgAAfQBvAXy
+ DPMB7ALrAm0C6gQSAW0G7AIUAhUD6wETARUGQwETAeoFEgZDBhUFFAMTAhIC6gNtA+sF7APtAfcB7wrz
+ BPIC8QG8EAAB/wHtAwAB9wb0AfMB8QG8AfMD9CD/Ab0CRwH/AZQBFy7/AQ4DAAL/HwAD/wPyBPMB8AHy
+ AfAGvAUHAe8B7QlXAXgFVwFQAewIVwFWBFcDUAGYAVABVwJWCVABVgFQAfED8AK8AfQE/ykABP8B8wF0
+ CyoDKwExASsHMQErEioBMQErAzEBKwYqAisKKgEjAiQDIwEkAyMBJAHzAfQD/xkAAf8BvAHyAfEE8gvz
+ AfcB6wJtAuoDEgITBuwBEgEUAhUB6gLrAW0HQwEUAeoFEglDBRUEFAITAxIC6gJtBOsE7ATtAfcB8Anz
+ BfIB8QLwEAAB/wHtAwAB9wX0AvMB8QG8AfME9B//AZQBRwEWAf8BvQEXLv8BDgMAAv8gAAP/AfQB8QLy
+ A/MB9AL/A/QD8wLyAvEBvAHtD1cBcgHsCVcBVgNXAVYCUAGZA1YKUAFWAVAD8AG8AQcB9AT/KgAD/wH0
+ AfMBdA0qBDEBKwExAysCMRIqASsDMQIrECoCJAojAUsB8wH0A/8aAAG8AvEF8grzAbwB6wLqAxIDEwEU
+ AuwE6wQVAesCbQdDARUFEgETAREKQwQVBBQDEwISAuoCbQTrBOwD7QGSAfcL8wTyAfEBvAHyEAAB/wHt
+ AwAB9wX0AvMB8QG8AfMF9B7/ARcBRwG9Af8B8wEXLv8BDgMAAv8hAAP/AfQB8QLyAvMB9AH/A/QC8wLy
+ AvEC8AG8AZIPVwFQAewOVwFWAVABmQJWC1ABVgFQAfACvAEHAfQE/ysAA/8B9AHzAXQPKgIrAzEEKxMq
+ ATEEKw8qDSMBBwH0BP8aAAG8AfAE8QbyB/MB6gMSAxMCFAESBesBEwIVAUMB6gFtAeoBFQFDBREBQwIS
+ AxMBFAgRBkMDFQQUAhMDEgLqAm0D6wTsAu0CkgHtAfQJ8wTyAvEBBwH0EAAB/wHtAwAB9wX0AvMB8QG8
+ AfMH9Bz/AkcBvQL/ARcu/wEOAwAC/yMAAv8B9AHxA/IB8wH/BPQC8wLyAvEC8AGSBVcEVgdQAewPVwFQ
+ AZkNUAFWAVACvAEHBP8tAAP/AfQB8wF0ECoIKxMqBisCKgEkCSoPIwHzAfQD/xsAAfIBvAHwBPEJ8gLz
+ AfQEEwUUBm0DQwEVAhIBEwcRAxMCFAEVDBEEQwMVBBQCEwMSAeoDbQLrBOwC7QKSAe0B9AnzBPIC8QEH
+ EQAB/wHtAwAB9wX0AvMB8QG8AfMI9Bv/AkcB8wL/AeMu/wEOAwAC/yQAAv8B9ALxAvIC/wT0AvMC8gLx
+ AfABkgRXBFYIUAHsD1cBUAGZAVYMUAFWAVACvAT/LgAD/wH0AfMBkxIqBisTKgYrASoCJAcqESMB9AT/
+ GwAB9AG8A/AG8QfyAfMGFAMVAuoDEgEUAkMBEQESAhMBEAERBRAFFAERCRAGEQRDAxUDFAITAhIC6gJt
+ A+sD7ALtAZIB7QHsA/QH8wTyAvEBBxEAAf8B7QMAAfcF9ALzAfEBvAHzCfQa/wJHAfQC/wEWLv8BDgMA
+ Av8lAAP/AfAB8QHyA/8E9ALzAvIC8QH3A1cEVghQAXIB7A9XAVABmQFWDFABVgFQAfIE/y8AA/8B9AHz
+ AZMUKgQrFCoDKwMqAyQEKgEkESMBdAH0BP8cAAEHBvAH8QTyARMFFQJDARUFEwMRARUCFAMQBA8FFQwP
+ AxAEEQNDAxUDFAMTAhIB6gJtAusD7ALtAZIC7QP0B/ME8gHxArwRAAH/Ae0DAAH3BfQC8wHxAbwB8gv0
+ GP8CRwP/ARYu/wEOAwAC/yYAA/8C8QH/BPQD8wLyAfEC8AH3AlcEVgpQAewPVwFQAZkCVgtQAVYBUAT/
+ MAAD/wH0AfMBHBYqAisVKgErBCoDJAMqEyMB9AT/HQABBwK8CPAF8QLyAesBFQVDAREFFAEVAxACFQER
+ Bg8FQxAPAxADEQNDAxUDFAITAhIB6gFtAusD7ALtAfcB7QH3BPQG8wTyAfEBBwHyEQAB/wHtAwAB9wX0
+ AfMB8gHxAbwB8gz0F/8CRwP/Ab0u/wEOAwAC/ygAA/8J8QXwAVcEVgtQAewPVwFQAXIDVgpQAVYBUAL/
+ MgAD/wH0AfMBkxcqASsbKgIkASoUIwFKBP8eAAW8AvACvAPwBbwB8AH3AkMFEQQVAUMDDwNDAw8DDgUR
+ DA4HDwMQAxEDQwIVAxQCEwESAeoCbQHrA+wC7QGSAe0BBwX0BvME8gEHAf8RAAH/Ae0DAAH3BfQB8wHy
+ AfEBvAHyDvQV/wJHMv8BDgMAAv8pAAL/AfQB8AzxAVcDVgpQAU8BUAHsD1cBUAFyA1YKUAFWAVAB/zMA
+ A/8B9AHzARwzKgMkFCMF/x4AAf8BBwW8AfIE8wHwA/MB8gHxAbwBEAIRBBAFEQMPAREBEAYOAg8BEAIP
+ Eg4EDwIQAxEDQwIVAxQCEwESAeoBbQHrA+wB7QGSAfcB7AHwBvQF8wLyAfECBxIAAf8B7QMAAfcB9AHz
+ AvQC8wHyAfEBvAHyD/QU/wJHAfQC/wG9Lv8BDgMAAv8rAAL/AfQE8ALxBfABVwNWCVACTwFzAfAPVwFQ
+ ARwDVgpQAVYBUDQAA/8B9AHzAZMsKgEkBioCJBQjAXQE/yAAAf8B8AgHB7wB8AEAFw4DDwEOAg8BEAQR
+ A0MEEQMPGA4HAAHvDgcB8BMAAf8B7QMAAfcB9AXzAfIB8AG8AfIQ9BP/ARcBRwEaAv8BFi7/AQ4DAAL/
+ LQAG/wb0AXgBVglQBEkBmAHyAVYIVwZWAVABCAJWDVA0AAP/AfQB8wGTKyoCJAYqASQVIwT/JQAN/wEA
+ ARIBEQG8AesCFQEUARMBFAIVAUMBFQMUBhUDFAMVI0MBFQHyAfMB9wHsAfEG8g//FQAB/wHtAwAB9wH0
+ BfMB8gHwAbwB8hH0Ev8BtwFHAZQC/wFHLv8BDgMAAv83ABP/AVYIVwZWAVABGwJWDVA0AAP/AfQB8wGT
+ LCoCJAQqASQVIwT/NAADFAFtAuoB7AHrAeoBEwESA+oBbSzqAW0DFAHrAfEB7AHqARMB8ioAAf8B7QMA
+ AfcB9AXzAfIB8AG8AfIT9BH/AkcB/wIXLv8BDgMAAv9KAAFWB1cHVgFQARsDVgxQNAAD/wH0AfMBkyoq
+ ByQVIwFLBP81AALqAesBBwEAAe0C9wHyAvMB8gHwAuwsAAESAfQC8gGSAW0B6wHsAW0B8ioAAf8B7QMA
+ AfcB9AXzAfIB8AG8AfIU9BD/AfMClAG9L/8BDgMAAv9KAAFWB1cHVgFQARsDVgxQNAAD/wH0AfMBHCkq
+ ByQKIwEHAfQBcwcjAUsBvAT/NgAC7AG8AgAB8AK8BQAuDgEUBQAB9AEHAfcB8yoAAf8B7QMAAfcB9AXz
+ AfIB8AEHAfIV9EL/AQ4DAAL/SgAPVgFQARsEVgtQNAAD/wH0AfMBkyYqCCQMIwHwBPQC8wHyAfACvAT/
+ QwAB/wQTAhIC6gJtA+sF7AjtBuwD6wJtAuoDEgQTAewzAAH/Ae0DAAH3BvMB8gHwAQcB8hf0QP8BDgMA
+ Av9KAA9WAVABGwRWC1A0AAP/AfQB8wEcJioIJAwjBPQB8wHyAfEB8AK8BP9FAAEUAxMCEgLqAm0E6wfs
+ Au0I7ATrAm0C6gMSBBMB7TMAAf8B7QMAAfcG8wHyAfABBwHyGPQ//wEOAwAC/0oAAVwEVwRWB1ABGwRW
+ C1A0AAP/AfQB8gEcJyoGJA0jAf8C9AHzAfIB8QHwArwE/0YABBMCEgLqA20D6xHsBOsCbQLqAhIFEwGS
+ MwAB/wHtAwAB9wbzAfIB8AEHAfIa9D3/AQ4DAAL/SgABXANXBFYHUAGYARsEVgtQNAAD/wH0AfIBHCUq
+ CCQNIwL0AfMB8gHxAfACvAT/RwAFFAITAxIC6gJtD+sFbQLqAhIDEwUUAfczAAH/Ae0DAAH3BvMB8QH3
+ AewB9yjvAQcu/wEOAwAC/0oAAVwCVwRWCFABCAEbBFYLUDMABP8B9AHyARwkKggkDiMC8wHyAfEB8AK8
+ BP9IAAQVBBQDEwMSAeoKbQfqAxIDEwUUAxUB7zMAAf8B7QMAAfcF8wHyAUYB+QEgKPkBRgHrAewt/wEO
+ AwAC/0oAAlcEVglQAfABGwRWC1A0AAP/AfQB8gEcJCoIJA0jAUQB8wHyAfEB8AK8BP9JAAQVBBQDEwMS
+ AuoIbQXqARIC6gMSAhMFFAQVAQczAAH/Ae0DAAH3BfMu+QHsAfMs/wEOAwAC/0oAAVcFVglQAfQBGwRW
+ C1A0AAP/AfQB8gEcIyoIJA4jAXMB8gHxAfABBwG8BP9KAAEUAxUEFAQTARID6gdtBeoCEgHqAxIEEwQU
+ BBUBBzMAAf8B7QMAAfcB8wHyAvMB8i75AW4B8yz/AQ4DAAL/SgABVwRWCVABTwH/ARsFVgpQMwAE/wH0
+ AfIBHCMqCCQOIwLwAbwBBwHwBP9LAAEUAxUFFAQTBeoFbQHqBRIC6gMSBBMEFAQVAbwzAAH/Ae0DAAH3
+ AfMC8gHzAfIu+QFuAfMs/wEOAwAC/0oAAVcDVgpQAU8BAAEbBFYLUDMABP8B9AHyARwjKgckDyMB8AG8
+ AQcB8AT/TAABFAMVBRQDEwESCuoGEgHqBRIDEwQUBBUB8DMAAf8B7QMAAfcB8wTyC/kCRwf5BBcBRwX5
+ AkcO+QFuAfMs/wEOAwAC/0oAA1YIUAFPA0kBAAEbBVYKUDMABP8B8wHyARwjKgckDiMBSgG8AQcB8AT/
+ TQABFAMVBRQDEwESCeoGEgHqBhICEwUUAxUBFAHxMwAB/wHtAwAB9wHzA/IB8Qv5Av8BRwb5Bf8BvQFH
+ A/kC/w75AW4B8yz/AQ4DAAL/WgABGwVWB1ABTwFQAU8zAAP/AfQB8wHyARwiKgckDyMCBwHwBP9OAAEU
+ AxUFFAMTAhII6gYSAeoFEgQTBBQDFQEUAfIzAAH/Ae0DAAH3AfMD8gHxC/kC/wFHBvkC/wFGAW8B9AL/
+ AUcC+QL/DvkBbgHzLP8BDgMAAv9aAAEIBVYHUAFPAVABTzMAA/8B9AHzAfIBHCIqBiQQIwEHAfAD/1AA
+ ARQDFQUUAxMCEgfqARIFEwHqBhIEEwQUAxUBFAHzMwAB/wHtAwAB9wHzA/IB8QsgAv8BRwYgAv8DIAHz
+ Af8BvQIgAv8OIAFuAfMs/wEOAwAC/1oAAQgEVghQAU8BUAFPMwAD/wH0AfMB8gEcIioGJA8jAe0B8QP/
+ UQABFAMVBRQCEwISCOoFEwgSAxMFFAMVARQB8zMAAf8B7QMAAfcB8wHxAvIB8QsgBP8B8wEWAyAC/wMg
+ AW8C/wIgAv8DlAEXCiABbgHyLP8BDgMAAv9aAAEIBFYIUAFPAVABTzMAA/8B9AHzAfIBHCIqByQOIwHx
+ BP9RAAETAxUGFAETAxIG6gESBRMB6ggSAhMFFAMVARQB9DMAAf8B7QMAAfcB8gLxAfIB8QsgAv8C9AL/
+ ARYCIAL/BCAC/wIgBf8BFgogAW4B8iz/AQ4DAAL/WgABCARWClABTzMAA/8B9AHzAfIBHCIqByQNIwHw
+ A/9TAAESAxUGFAETARII6gYTAeoIEgETBhQDFQEUAfQzAAH/Ae0DAAH3AfIE8QsgAv8BRgEgAW8B/wG9
+ AiAC/wMgAeMC/wIgAv8DRgsgAW4B8iz/AQ4DAAL/WgABCARWClABTzMAA/8B9AHzAfIBHCEqCCQMIwEc
+ A/9UAAESAUMDFQUUARIJ6gUTAeoJEgETBhQDFQETAf8zAAH/Ae0DAAH3AfIB8APxCyAC/wFGASAB4wH/
+ AfMCIAL/AyAB9AH/ARoCIAL/DiABbgHyLP8BDgMAAv9aAAEIBFYKUAFPMwAD/wL0AfIBHCAqCCQMIwFL
+ A/9VAAHqAUMDFQUUCeoGEwPqBxIHFAIVARQBEwH/MwAB/wHtAwAB9wHyAvAB8QHwCyAC/wK9Av8BkwIg
+ Av8CvQP/AyAF/wG9CiABbgHyAfQr/wEOAwAC/1oAAQgEVgpQAU8zAAT/AfQB8wEcIioGJAsjAUsD/1YA
+ AW0BQwMVBRQJ6gUTBeoFEggUARUCFAESAf8zAAH/Ae0DAAH3AfIE8AsgBf8BkwMgBf8BBwQgBf8BvQog
+ AW4B8gL0Kv8BDgMAAv9aAAEIBVcEVgZQMwAE/wL0AZkhKgckCiMBdAP/VwAB6wFDAxUEFAETCOoBEgUT
+ BuoDEgETCxQBEjQAAf8B7QMAAfcB8gTwLiABbgHyBPQo/wEOAwAC/1oAAQgEVwRWB1AzAAX/AfQBmSEq
+ ByQJIwH0Av9ZAAHrAUMEFQMUARII6gUTCOoCEgETCxQBEjQAAf8B7QMAAfcB8wTwLiABbgHyBfQn/wEO
+ AwAC/1oAAQgDVwRWCFA0AAX/AZkgKggkByMBGgL/WwAB7AEVBBQDEwltBBIB6gltBBIJEwFtNAAB/wHv
+ AwABEgH/BPAuIAFuAfMH9CX/AQ4DAAL/WgABCAJXBFYJUDQABf8BGiEqByQFIwEbAv9dAAHtARUEFAIT
+ ARIIbQHqBBIJbQHqBBIEEwISAxMBbTQAAf8B9AQAAfIB/wHxAvADICn5AiAB7wn0JP8BDgMAAv9aAAEI
+ AVcEVglQAZg1AAT/ARoiKgckAXQB9AL/YAABkgEVBRQBEwHqCG0EEgHqCW0FEgMTAxIDEwFtNAAC/wEO
+ BAAB7QLyAfEBkywgAZML9CP/AQ4DAAL/WgABCARWClAB8DgAAf8BGiMqAUsBdAEbAfQC/2QAAfcBFQYU
+ CG0B6gQSAesIbQYSAhMEEgMTAW01AAH/AfEMAAH3A/EJ8hDzGfQi/wEOAwAC/1oAAcIEVgpQAf9FABn/
+ aQAB7wEVBRQBEwHqB20EEgHqCG0B6gUSAhMFEgMTAW02AAH/AZILAAH3BfEI8hDzGvQg/wEOAwAC/1oA
+ AcIDVgtQyAABBwIVBBQC6gdtBBIJbQYSAhMB6gQSAxMBbTYAAv8BvAEOCQAB9wHxAfAE8QjyEfMZ9B//
+ AQ4DAAL//wAyAAEHAhUEFAHqB20FEghtBhICEwHqBRIDEwHqOAAC/wEHAW0DQwEOAwAB9wPwBPEI8hHz
+ GvQd/wEOAwAC//8AMgABvAIVBBQB6gdtBBMB6wdtAeoFEgITAuoEEgQTARI6AAX/AewDAAH3BPAF8Qjy
+ EPMa9Bz/AQ4DAAL//wAyAAHwAhUDFAESAeoGbQHqAxMBEghtARMDEgMTA+oEEgMTARQBEz4AAf8B7AMA
+ AfcG8ATxCPIQ8xr0G/8BDgMAAv//ADIAAfEBFQQUAeoGbQHrBBMC6wZtARIGEwESAuoFEgETAxQBEz4A
+ Af8B7QMAAfcB8gbwBfEI8hDzGvQZ/wEOAwAC//8AMgAB8gEVBBQB6gdtAxMBEgPrBG0B6gcTAW0D6gQS
+ BBQBEz4AAf8BBwMAAW0B/wfwBfEI8hDzGvQY/wQAAf//ADMAAfIEFAESAeoFbQHrBBMG6wJtBxMBbQPq
+ BBIGFD4AAf8B8wQAAfIB/wHxBPAF8QjyEPMc9Bb/ARIDAAEPAf//ADMAAfMEFAHqBW0C6wMTAeoH6wES
+ BhMCbQTqAhIHFD8AAf8BEAQAAewB8FHxAQcBFAQAAfEB//8AMwAB9AQUBW0C6wESAxMH6wHqBhMB6gJt
+ BOoBEgETBxQ/AAH/AfBcAAERAv//ADMAAfQDFAETBW0C6wMTAeoH6wYTARIDbQTqARMHFAESQAAB/wGS
+ WgABDgH0Af//ADQAAf8DFAHqBG0C6wFtAxMH6wcTBG0D6gETCBQB80EAAf8BB1gAARMC//8ANgAB/wHw
+ AfcH7wL3AZIB9wbvAfcBkgPtAuwB9wGSBe0B7AHrAW0B6gQSAesB/0MAAv8BBwERUwAB7AH0Av//AA4A
+ AUIBTQE+BwABPgMAASgEAAECAgABgAEBAgABAQEAAQEGAAFgFgAD//8A/wD/AP8A/wD/AP8A/wD/AP8A
+ /wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wAhAP//lP8BwAgAAQM0/wH4
+ DAABHzL/DgAk/wHgAQEF/wH+AgABfwL/AfwOAAE/I/8BgAMAAX8B/AQAAT8C/wH4DgABHyP/AYAJAAEf
+ Av8B+A4AAR8j/woAAQ8C/wHwDgABDyP/CgABDwL/AfgOAAEfIv8B/goAAQ8C/wH4DgABHwT/AYAHAAE/
+ B/8BgAcAAT8F/wH+CgABDwL/AfwOAAE/A/8B+AgAAQcG/wH4CAABBwX/Af4KAAEPAv8B/g4AAX8D/wHw
+ CAABAwb/AfAIAAEDBf8B/goAAQ8D/wGADAABAQT/AeAIAAEBBv8B4AgAAQEF/wH+CgABDwP/Af4MAAF/
+ BP8BwAkABv8BwAkABf8B/goAAQcF/wGACQAG/wGACQABfwX/AYAJAAF/BP8B/goAAQcF/wGACQABfwX/
+ CgABPwX/CgABPwT/Af4KAAEHBf8KAAF/BP8B/goAAR8E/wH+CgABHwT/Af4KAAEHBf8KAAF/BP8B/AoA
+ AQ8E/wH8CgABDwT/Af4KAAEHBf8KAAE/BP8B+AoAAQcE/wH4CgABBwT/Af4KAAEHBf8KAAE/BP8B8AoA
+ AQME/wHwCgABAwT/Af4KAAEHBf8KAAE/BP8B8AoAAQME/wHwCgABAwT/Af4KAAEHBf8KAAE/BP8B4AoA
+ AQEE/wHgCgABAQT/Af4KAAEHBf8KAAE/BP8BwAsABP8BwAsABP8B/goAAQcF/woAAT8E/wGACwABfwP/
+ AYALAAF/A/8B/goAAQcF/woAAT8E/wGACwABfwP/AYALAAF/A/8B/goAAQcF/woAAT8E/wwAAT8D/wwA
+ AT8D/wH+CgABBwX/CgABPwP/Af4MAAEfAv8B/gwAAR8D/wH+CgABBwX/CgABPwP/AfwMAAEPAv8B/AwA
+ AQ8D/wH+CgABBwX/CgABPwP/AfwMAAEPAv8B/AwAAQ8D/wH+CgABBwX/CgABPwP/AfgMAAEHAv8B+AwA
+ AQcD/wH+CgABBwX/CgABPwP/AfAMAAEDAv8B8AwAAQMD/wH+CgABBwX/CgABfwP/AeAMAAEDAv8B4AwA
+ AQMD/wH+CgABBwT/DAABfwL/AeAMAAEBAv8B4AwAAQED/wH8CgABBwP/AfwMAAEfAv8BwA0AAv8BwA0A
+ A/8B/AoAAQcD/wH8DAABDwL/AYANAAL/AYANAAP/AfwKAAEHA/8B+AwAAQcC/wGADQABfwH/AYANAAF/
+ Av8B/AoAAQcD/wHwDAABBwL/DgABPwH/DgABPwL/AfwKAAEHA/8B8AwAAQcC/w4AAT8B/w4AAT8C/wH8
+ CgABBwP/AfAMAAEHAf8B/g4AAR8B/g4AAR8C/wH8CgABBwP/AfAMAAEHAf8B/A4AAQ8B/A4AAQ8C/wH8
+ CgABBwP/AfAMAAEHAf8B/A4AAQ8B/A4AAQ8C/wH8CgABAwP/AfAMAAEHAf8B+A4AAQcB+A4AAQcC/wH8
+ CgABAwP/AfAMAAEHAf8B+A4AAQcB+A4AAQcC/wH8CgABAwP/AfAMAAEHAf8B8A4AAQMB8A4AAQMC/wH8
+ CgABAwP/AfAMAAEHAf8B8A4AAQMB8A4AAQMC/wH8CgABAwP/AfAMAAEHAf8B4A4AAQEB4A4AAQEC/wH8
+ CgABAwP/AfAMAAEHAf8B4A4AAQEB4A4AAQEC/wH8CgABAwP/AfAMAAEHAf8B4A4AAQEB4A4AAQEC/wH8
+ CgABAwP/AfAMAAEHAf8B4A4AAQEB4A4AAQEC/wH8CgABAwP/AfAMAAEHAf8B4A4AAQEB4A4AAQEC/wH8
+ CgABAwP/AfAMAAEHAf8B4A4AAQEB4A4AAQEC/wH8CgABAwP/AfAMAAEHAf8B4A4AAQEB4A4AAQEC/wH8
+ CgABAwP/AfAMAAEHAf8B4A4AAQEB4A4AAQEC/wH8CgABAwP/AfAMAAEHAf8B8A4AAQMB8A4AAQMC/wH8
+ CgABAwP/AfAMAAEHAf8B8A4AAQMB8A4AAQMC/wH8CgABAwP/AfAMAAEHAf8B+A4AAQcB+A4AAQcC/wH8
+ CgABAwP/AfAMAAEHAf8B/A4AAQ8B/A4AAQ8C/wH8CgABAwP/AfAMAAEHAf8B/g4AAR8B/g4AAR8C/wH8
+ CgABAwP/AfAMAAEHAv8OAAE/Af8OAAE/Av8B/AoAAQMD/wHwDAABBwL/AYANAAF/Af8BgA0AAX8C/wH8
+ CgABAwP/AfAMAAEHAv8BwA0AAv8BwA0AA/8B/AoAAQMD/wHwDAABBwL/AeAMAAEBAv8B4AwAAQED/wH8
+ CgABAwP/AfAMAAEHAv8B8AwAAQMC/wHwDAABAwP/AfwKAAEDA/8B8AwAAQcC/wH4DAABBwL/AfgMAAEH
+ A/8B/AoAAQMD/wHwDAABBwL/AfwMAAEPAv8B/AwAAQ8D/wH8CgABAwP/AfAMAAEHAv8B/gwAAR8C/wH+
+ DAABHwP/AfgKAAEDA/8B8AwAAQcD/wwAAT8D/wwAAT8D/wH4CgABAwP/AfAMAAEHA/8BgAsAAX8D/wGA
+ CwABfwP/AfgKAAEDA/8B+AwAAQcD/wHACwAE/wHACwAE/wH4CgABAwP/AfwMAAEPA/8B8AoAAQME/wHw
+ CgABAwT/AfgKAAEDA/8B/gwAAR8D/wH4CgABBwT/AfgKAAEHBP8B+AoAAQcE/wwAAX8D/wH8CgABDwT/
+ AfwKAAEPBP8B+AoAAQcF/woAAX8E/wH+CgABHwT/Af4KAAEfBP8B+AoAAQcF/woAAT8F/woAAT8F/woA
+ AT8E/wH4CgABDwX/CgABPwX/AcAJAAb/AcAJAAX/AfgKAAEPBf8KAAE/Bf8B4AgAAQEG/wHgCAABAQX/
+ AfgKAAEPBf8KAAE/Bf8B8AgAAQMG/wHwCAABAwX/AfgKAAEfBf8KAAE/Bf8B+AgAAQcG/wH4CAABBwX/
+ AfgKAAE/Bf8KAAE/Bf8B/ggAAR8G/wH+CAABHwX/AfgKAAE/Bf8KAAE/Bv8IAAE/B/8IAAE/Bf8B+AoA
+ AX8F/woAAT8G/wHABwABfwf/AcAHAAF/Bf8B+AoABv8KAAE/Bv8B8AcAAX8H/wHwBwABfwX/AfgJAAEB
+ Bv8KAAE/B/8B/AYAAX8I/wH8BgABfwX/AfgJAAEDBv8KAAE/Cv8BgAMAAX8L/wGAAwABfwX/AfgJAAEH
+ Bv8KAAE/Cv8BgAMAAX8L/wGAAwABfwX/AfgJAAEPBv8KAAE/Cv8BgAMAAX8L/wGAAwABfwX/AfgJAAEf
+ Bv8KAAE/Cv8BgAMAAX8L/wGAAwABfwX/AfgJAAE/Bv8KAAE/Cv8BgAMAAX8L/wGAAwABfwX/AfgJAAF/
+ Bv8KAAF/Cv8BgAMAAX8L/wGAAwABfwX/AfAJAAf/CgAL/wGAAwABfwv/AYADAAF/Bf8B+AgAAQEH/wkA
+ AQEL/wGAAwABfwv/AYADAAF/Bf8B+AgAAQMH/wkAAQML/wGAAwABfwv/AYADAAF/Bf8B8AgAAQcH/wkA
+ AQcL/wGAAwABfwv/AYADAAF/Bf8B8AgAAQ8H/wkAAQ8L/wGAAQABgAEAAX8L/wGAAQABgAEAAX8F/wHw
+ CAABHwf/CQABHwv/AYABAAGAAQABfwv/AYABAAGAAQABfwX/AfAIAAE/B/8JAAE/Df8BgAEAAX8N/wGA
+ AQABfwX/AfAIAAj/CQABfw3/AYABAAF/Df8BgAEAAX8F/wHwBwABAQj/CQAO/wGAAQABfw3/AYABAAF/
+ Bf8B8AcAAQEI/wgAAQEO/wGAAQABfw3/AYABAAF/Bf8B8AcAAQcI/wgAAQMO/wGAAQABfw3/AYABAAF/
+ Bf8B8AcAAQ8I/wgAAQcO/wGAAQABfw3/AYABAAF/Bf8B8AcAAR8I/wgAAQ8O/wGAAQABfw3/AYABAAF/
+ Bf8B8AcAAT8I/wgAAR8O/wGAAQABfw3/AYABAAF/Bf8B8AcAAX8I/wgAAT8O/wGAAQABfw3/AYABAAF/
+ Bf8B8AYAAQEJ/wgAAX8O/wGAAQABfw3/AYABAAF/Bf8B+AYAAQcJ/wgAD/8BgAEAAX8N/wGAAQABfwX/
+ AfgGAAEfCf8HAAEBD/8BgAEAAX8N/wGAAQABfwX/AfwGAAr/AYAGAAEDD/8BgAEAAX8N/wGAAQABfwb/
+ AYAEAAEPCv8BgAYAAQcP/wGAAQABfw3/AYABAAF/B/8B/AIAAQEL/wHABgABDw//AYABAAF/Df8BgAEA
+ AX8W/wHABgABHw//AYABAA7/AYABABf/AeAGAAE/OP8B+AYAAX84/wH+BgD/////a/8BwAgAAT8E/wHw
+ CwABPyX/AcAIAAE/BP8B4AsAAR8l/wHACAABPwT/AeALAAEPJf8BwAgAAT8E/wHACwABDyX/AeAIAAE/
+ BP8BwAsAAQ8l/wHgCAABPwT/AcALAAEHJf8B4AgAAX8E/wHACwABByX/AeAIAAF/BP8BwAsAAQEl/wHg
+ CAABfwT/AcAMAAE/JP8B4AgAAX8E/wHADAABHxT/AeABAQX/Af4CAAF/Bf8B8AgAAX8E/wHADAABDxT/
+ AYADAAF/AfwEAAE/Bf8B8AgAAX8E/wHADAABBxT/AYAJAAEfBf8B8AgAAX8E/wHADAABAxT/CgABDwX/
+ AfAIAAF/BP8BwAwAAQMU/woAAQ8F/wHwCAAF/wHADAABAwX/AYAHAAE/Bf8B/goAAQ8F/wHwCAAF/wHA
+ DAABAQT/AfgIAAEHBf8B/goAAQ8F/wH4CAAF/wHADAABAQT/AfAIAAEDBf8B/goAAQ8F/wH4CAAF/wHA
+ DAABAQT/AeAIAAEBBf8B/goAAQ8F/wH4CAAF/wHADAABAQT/AcAJAAX/Af4KAAEPBf8B+AgABf8BwAwA
+ AQEE/wGACQABfwT/Af4KAAEHBf8B+AgABf8BwAwAAQEE/woAAT8E/wH+CgABBwX/AfgIAAX/AcAMAAEB
+ A/8B/goAAR8E/wH+CgABBwX/AfwHAAEBBf8BwAwAAQED/wH8CgABDwT/Af4KAAEHBf8B/AcAAQEF/wHA
+ DAABAQP/AfgKAAEHBP8B/goAAQcF/wH8BwABAQX/AcAMAAEBA/8B8AoAAQME/wH+CgABBwX/AfwHAAEB
+ Bf8BwAwAAQED/wHwCgABAwT/Af4KAAEHBf8B/AcAAQEF/wHADAABAQP/AeAKAAEBBP8B/goAAQcF/wH8
+ BwABAQX/AcAMAAEBA/8BwAsABP8B/goAAQcF/wH+BwABAQX/AcAMAAEBA/8BgAsAAX8D/wH+CgABBwX/
+ Af4HAAEBBf8BwAwAAQED/wGACwABfwP/Af4KAAEHBf8B/gcAAQMF/wHADAABAQP/DAABPwP/Af4KAAEH
+ Bf8B/gcAAQMF/wHADAABAQL/Af4MAAEfA/8B/goAAQcF/wH+BwABAwX/AcAMAAEBAv8B/AwAAQ8D/wH+
+ CgABBwL/AfgOAAEPAf8BwAwAAQEC/wH8DAABDwP/Af4KAAEHAv8B8A4AAQcB/wHADAABAQL/AfgMAAEH
+ A/8B/goAAQcC/wHwDgABBwH/AcAMAAEBAv8B8AwAAQMD/wH+CgABBwL/AfAOAAEHAf8BwAwAAQEC/wHg
+ DAABAwP/Af4KAAEHAv8B8A4AAQcB/wHADAABAQL/AeAMAAEBA/8B/goAAQcC/wHwDgABBwH/AcAMAAEB
+ Av8BwA0AA/8B/AoAAQcC/wHwDgABBwH/AcAMAAEBAv8BgA0AA/8B/AoAAQcC/wHwDgABBwH/AcAMAAEB
+ Av8BgA0AAX8C/wH8CgABBwL/AfAOAAEHAf8BwAwAAQEC/w4AAT8C/wH8CgABBwL/AfAOAAEHAf8BwAwA
+ AQEC/w4AAT8C/wH8CgABBwL/AfAOAAEHAf8BwAwAAQEB/wH+DgABHwL/AfwKAAEHAv8B8A4AAQcB/wHA
+ DAABAQH/AfwOAAEPAv8B/AoAAQcC/wHwDgABBwH/AcAMAAEBAf8B/A4AAQ8C/wH8CgABBwL/AfAOAAEH
+ Af8BwAwAAQEB/wH4DgABBwL/AfwKAAEDAv8B8A4AAQcB/wHADAABAQH/AfgOAAEHAv8B/AoAAQMC/wHw
+ DgABBwH/AcAMAAEBAf8B8A4AAQMC/wH8CgABAwL/AfAOAAEHAf8BwAwAAQEB/wHwDgABAwL/AfwKAAED
+ Av8B8A4AAQcB/wHADAABAQH/AeAOAAEBAv8B/AoAAQMC/wHwDgABBwH/AcAMAAEBAf8B4A4AAQEC/wH8
+ CgABAwL/AfAOAAEHAf8BwAwAAQEB/wHgDgABAQL/AfwKAAEDAv8B8A4AAQcB/wHADAABAQH/AeAOAAEB
+ Av8B/AoAAQMC/wHwDgABBwH/AcAMAAEBAf8B4A4AAQEC/wH8CgABAwL/AfAOAAEHAf8BwAwAAQEB/wHg
+ DgABAQL/AfwKAAEDAv8B8A4AAQcB/wHADAABAQH/AeAOAAEBAv8B/AoAAQMC/wHwDgABDwH/AcAMAAEB
+ Af8B4A4AAQEC/wH8CgABAwL/AfAOAAEPAf8BwAwAAQEB/wHwDgABAwL/AfwKAAEDAv8B8A4AAQ8B/wHA
+ DAABAQH/AfAOAAEDAv8B/AoAAQMC/wHwDgABDwH/AcAMAAEBAf8B+A4AAQcC/wH8CgABAwL/AfAOAAEP
+ Af8BwAwAAQEB/wH8DgABDwL/AfwKAAEDAv8B8A4AAQ8B/wHADAABAQH/Af4OAAEfAv8B/AoAAQMC/wHw
+ DgABDwH/AcAMAAEBAv8OAAE/Av8B/AoAAQMC/wHwDgABDwH/AcAMAAEBAv8BgA0AAX8C/wH8CgABAwL/
+ AfAOAAEPAf8BwAwAAQEC/wHADQAD/wH8CgABAwL/AfAOAAEPAf8BwAwAAQEC/wHgDAABAQP/AfwKAAED
+ Av8B+A4AAQ8B/wHADAABAQL/AfAMAAEDA/8B/AoAAQMC/wH4DgABDwH/AcAMAAEBAv8B+AwAAQcD/wH8
+ CgABAwL/AfgOAAEPAf8BwAwAAQEC/wH8DAABDwP/AfwKAAEDAv8B+A4AAR8B/wHADAABAQL/Af4MAAEf
+ A/8B/AoAAQMC/wH4DgABHwH/AcAMAAEBA/8MAAE/A/8B+AoAAQMC/wH4DgABHwH/AcAMAAEBA/8BgAsA
+ AX8D/wH4CgABAwL/AfwOAAEfAf8BwAwAAQED/wHACwAE/wH4CgABAwL/AfwOAAEfAf8BwAwAAQED/wHw
+ CgABAwT/AfgKAAEDAv8B/A4AAT8B/wHADAABAQP/AfgKAAEHBP8B+AoAAQMC/wH8DgABPwH/AcAMAAEB
+ A/8B/AoAAQ8E/wH4CgABBwL/AfwOAAE/Af8BwAwAAQED/wH+CgABHwT/AfgKAAEHAv8B/g4AAT8B/wHA
+ DAABAQT/CgABPwT/AfgKAAEHAv8B/g4AAT8B/wHADAABAQT/AcAJAAX/AfgKAAEPAv8B/g4AAX8B/wHA
+ DAABAQT/AeAIAAEBBf8B+AoAAQ8C/wH+DgABfwH/AcAMAAEBBP8B8AgAAQMF/wH4CgABDwP/DgABfwH/
+ AcAMAAEBBP8B+AgAAQcF/wH4CgABHwP/DgABfwH/AcAMAAEBBP8B/ggAAR8F/wH4CgABPwP/DgABfwH/
+ AcAMAAEBBf8IAAE/Bf8B+AoAAT8D/w4AAv8BwAwAAQEF/wHABwABfwX/AfgKAAF/A/8BgAwAAQEC/wHA
+ DAABAQX/AfAHAAF/Bf8B+AoABP8B+AEAASAKAAEHAv8BwAwAAQEG/wH8BgABfwX/AfgJAAEBBv8B4AgA
+ Bf8BwAwAAQEJ/wGAAwABfwX/AfgJAAEDBv8B4QgABf8BwAwAAQEJ/wGAAwABfwX/AfgJAAEHBv8B4wEf
+ BQABAQHwBf8BwAwAAQEJ/wGAAwABfwX/AfgJAAEPB/8B/gUAAQEG/wHADAABAQn/AYADAAF/Bf8B+AkA
+ AR8I/wUAAQEG/wHADAABAQn/AYADAAF/Bf8B+AkAAT8I/wUAAQEG/wHADAABAQn/AYADAAF/Bf8B+AkA
+ AX8I/wUAAQEG/wHADAABAQn/AYADAAF/Bf8B8AkACf8FAAEBBv8BwAwAAQEJ/wGAAwABfwX/AfgIAAEB
+ Cf8FAAEBBv8BwAwAAQEJ/wGAAwABfwX/AfgIAAEDCf8FAAEBBv8BwAwAAQEJ/wGAAwABfwX/AfAIAAEH
+ Cf8FAAEBBv8BwAwAAQEJ/wGAAQABgAEAAX8F/wHwCAABDwn/BQABAQb/AcAMAAEBCf8BgAEAAYABAAF/
+ Bf8B8AgAAR8J/wUAAQEG/wHADAABAQv/AYABAAF/Bf8B8AgAAT8J/wUAAQEG/wHADAABAQv/AYABAAF/
+ Bf8B8AgACv8FAAEBBv8BwAwAAQEL/wGAAQABfwX/AfAHAAEBCv8FAAEBBv8BwAwAAQEL/wGAAQABfwX/
+ AfAHAAEBCv8FAAEBBv8BwAwAAQEL/wGAAQABfwX/AfAHAAEHCv8FAAEBBv8BwAwAAQEL/wGAAQABfwX/
+ AfAHAAEPCv8FAAEBBv8BwAwAAQEL/wGAAQABfwX/AfAHAAEfCv8FAAEBBv8BwAwAAQEL/wGAAQABfwX/
+ AfAHAAE/Cv8FAAEBBv8BwAwAAQEL/wGAAQABfwX/AfAHAAF/Cv8FAAEDBv8BwAwAAQEL/wGAAQABfwX/
+ AfAGAAEBC/8FAAEDBv8BwAwAAQEL/wGAAQABfwX/AfgGAAEHC/8FAAEDBv8BwAwAAQEL/wGAAQABfwX/
+ AfgGAAEfC/8FAAEDBv8BwAwAAQEL/wGAAQABfwX/AfwGAAz/BQABAwb/AcAMAAEBC/8BgAEAAX8G/wGA
+ BAABDwz/BQABAwb/AeAMAAEBC/8BgAEAAX8H/wH8AgABAQ3/BQABAwb/AfAMAAEBC/8BgAEAGf8FAAED
+ Bv8B8AwAAQEm/wUAAQMG/wH8DAABASb/BQABAwf/DAABASb/BQABAwf/AfALAAEBJv8FAAEDB/8B8AsA
+ AQEm/wUAAQMH/wHwCwABAyb/BQABAwf/AfALAAEDJv8FAAEDB/8B+AsAAQMm/wUAAQMH/wH4CwABAyb/
+ BQABAwf/AfwLAAEHJv8FAAEDB/8B/gsAAQ8m/wGABAABBwj/CwABHyH/Cw==
+</value>
+ </data>
+</root>
\ No newline at end of file
diff --git a/HotelPms.Share.Windows/Report/GridCsv.cs b/HotelPms.Share.Windows/Report/GridCsv.cs
new file mode 100644
index 0000000..20830f2
--- /dev/null
+++ b/HotelPms.Share.Windows/Report/GridCsv.cs
@@ -0,0 +1,125 @@
+using NPOI.HSSF.UserModel;
+using NPOI.SS.UserModel;
+using NPOI.XSSF.UserModel;
+using HotelPms.Share.Util;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Diagnostics;
+using System.Drawing;
+using System.IO;
+using System.Linq;
+using System.Text;
+
+namespace HotelPms.Share.Windows.Report
+{
+ public class GridCsv : ReportBase, IDisposable, IReport
+ {
+ #region ★★★★★ Declartions ★★★★★
+
+ private bool m_Disposed = false;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public GridCsv(DataTable data, GridStyle style)
+ {
+ m_Data = data;
+ m_Style = style;
+ }
+
+ ~GridCsv()
+ {
+ Dispose(false);
+ }
+
+ protected virtual void Dispose(bool disposing)
+ {
+ if (!m_Disposed) //一回だけ
+ {
+ if (disposing)
+ {
+ //Managed Resources
+ }
+
+ //Unmanaged resources
+ m_Disposed = true;
+ }
+ }
+
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+
+ #endregion
+
+ #region ★★★★★ Control Event ★★★★★
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+
+ public void Output()
+ {
+ string path = System.IO.Path.GetTempFileName().Replace(".tmp", ".csv");
+ Output(path);
+ Process.Start(path);
+ }
+
+ public void Output(string file)
+ {
+ try
+ {
+ using (StreamWriter sw = new StreamWriter(file, false, Encoding.UTF8))
+ {
+ StringBuilder colNames = new StringBuilder();
+ int col = 0;
+ foreach (ColumnStyle cs in m_Style.ColumnStyle)
+ {
+ if (col > 0) { colNames.Append(","); }
+ colNames.Append("\"");
+ colNames.Append(cs.Text);
+ colNames.Append("\"");
+ col++;
+ }
+ sw.WriteLine(colNames.ToString());
+
+ //データ
+ for (int i = 0; i < m_Data.Rows.Count; i++)
+ {
+ StringBuilder row = new StringBuilder();
+ col = 0;
+ foreach (ColumnStyle cs in m_Style.ColumnStyle)
+ {
+ string text = m_Data.Rows[i][cs.DataField].ToString();
+ if (col > 0) { row.Append(","); }
+ row.Append("\"");
+ row.Append(text);
+ row.Append("\"");
+ col++;
+ }
+ sw.WriteLine(row.ToString());
+ }
+
+ sw.Close();
+ }
+ }
+ catch
+ {
+ }
+ }
+
+
+ #endregion
+
+ }
+}
diff --git a/HotelPms.Share.Windows/Report/GridExcel.cs b/HotelPms.Share.Windows/Report/GridExcel.cs
new file mode 100644
index 0000000..099ceb5
--- /dev/null
+++ b/HotelPms.Share.Windows/Report/GridExcel.cs
@@ -0,0 +1,260 @@
+using NPOI.HSSF.UserModel;
+using NPOI.SS.UserModel;
+using NPOI.XSSF.UserModel;
+using HotelPms.Share.Util;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Diagnostics;
+using System.Drawing;
+using System.IO;
+using System.Linq;
+using System.Text;
+using HotelPms.Share.Windows.Util;
+using HorizontalAlignment = NPOI.SS.UserModel.HorizontalAlignment;
+using BorderStyle = NPOI.SS.UserModel.BorderStyle;
+
+namespace HotelPms.Share.Windows.Report
+{
+ public class GridExcel : ReportBase, IDisposable, IReport
+ {
+ #region ★★★★★ Declartions ★★★★★
+
+ private bool m_Disposed = false;
+ private string m_File = string.Empty;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+
+ private bool m_XlsxEnabled = true;
+
+ public bool XlsxEnabled
+ {
+ get { return m_XlsxEnabled; }
+ set { m_XlsxEnabled = value; }
+ }
+
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public GridExcel(DataTable data, GridStyle style, bool xlsxEnabled, string file)
+ {
+ m_Data = data;
+ m_Style = style;
+ m_XlsxEnabled = xlsxEnabled;
+ m_File = file;
+ }
+
+ ~GridExcel()
+ {
+ Dispose(false);
+ }
+
+ protected virtual void Dispose(bool disposing)
+ {
+ if (!m_Disposed) //一回だけ
+ {
+ if (disposing)
+ {
+ //Managed Resources
+ }
+
+ //Unmanaged resources
+ m_Disposed = true;
+ }
+ }
+
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+
+ #endregion
+
+ #region ★★★★★ Control Event ★★★★★
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+
+ public void Output()
+ {
+ string path = m_File + (m_XlsxEnabled ? ".xlsx" : ".xls");
+ Output(path);
+ //Process.Start(path);
+ CConvert.StartFile(path);
+ }
+
+ public void Output(string file)
+ {
+ using (FileStream stream = new FileStream(file, FileMode.Create, FileAccess.Write))
+ {
+ IWorkbook wb = null;
+ if (m_XlsxEnabled) { wb = new XSSFWorkbook(); } else { wb = new HSSFWorkbook(); }
+ ISheet sheet = wb.CreateSheet("Sheet1");
+ ICreationHelper cH = wb.GetCreationHelper();
+
+ // Create a new font and alter it.
+ IFont font = wb.CreateFont();
+ font.FontHeightInPoints = (short)m_Style.Font.SizeInPoints;
+ font.FontName = m_Style.Font.Name;
+
+ //center
+ ICellStyle style = wb.CreateCellStyle();
+ style.SetFont(font);
+ style.BorderBottom = BorderStyle.Thin;
+ style.BottomBorderColor = IndexedColors.Black.Index;
+ style.BorderLeft = BorderStyle.Thin;
+ style.LeftBorderColor = IndexedColors.Black.Index;
+ style.BorderRight = BorderStyle.Thin;
+ style.RightBorderColor = IndexedColors.Black.Index;
+ style.BorderTop = BorderStyle.Thin;
+ style.TopBorderColor = IndexedColors.Black.Index;
+ style.Alignment = HorizontalAlignment.Center;
+ style.VerticalAlignment = VerticalAlignment.Center;
+
+ //left
+ ICellStyle style1 = wb.CreateCellStyle();
+ style1.SetFont(font);
+ style1.BorderBottom = BorderStyle.Thin;
+ style1.BottomBorderColor = IndexedColors.Black.Index;
+ style1.BorderLeft = BorderStyle.Thin;
+ style1.LeftBorderColor = IndexedColors.Black.Index;
+ style1.BorderRight = BorderStyle.Thin;
+ style1.RightBorderColor = IndexedColors.Black.Index;
+ style1.BorderTop = BorderStyle.Thin;
+ style1.TopBorderColor = IndexedColors.Black.Index;
+ style1.Alignment = HorizontalAlignment.Left;
+ style1.VerticalAlignment = VerticalAlignment.Center;
+
+ //right
+ ICellStyle style3 = wb.CreateCellStyle();
+ style3.SetFont(font);
+ style3.Alignment = HorizontalAlignment.Right;
+ style3.VerticalAlignment = VerticalAlignment.Bottom;
+
+ IFont font18 = wb.CreateFont();
+ font18.FontHeightInPoints = (short)18;
+ font18.FontName = m_Style.Font.Name;
+
+ ICellStyle style2 = wb.CreateCellStyle();
+ style2.SetFont(font18);
+ style2.Alignment = HorizontalAlignment.Left;
+ style2.VerticalAlignment = VerticalAlignment.Center;
+
+ IRow row = sheet.CreateRow(0);
+ ICell cell = row.CreateCell(0);
+ cell.SetCellValue("データ一覧");
+ cell.CellStyle = style2;
+
+ cell = row.CreateCell(m_Style.ColumnStyle.Count - 1);
+ cell.SetCellValue(DateTime.Now.ToString("yyyy年MM月dd日(ddd) HH:mm:ss"));
+ cell.CellStyle = style3;
+
+ //タイトル
+ row = sheet.CreateRow(1);
+ //row.HeightInPoints = 16;
+ int col = 0;
+ foreach (ColumnStyle cs in m_Style.ColumnStyle)
+ {
+ cell = row.CreateCell(col);
+ cell.CellStyle = style;
+ if (cs.MaxCharLen < GeneralSub.GetStrLenB(cs.Text)) { cs.MaxCharLen = GeneralSub.GetStrLenB(cs.Text); }
+ cell.SetCellValue(cH.CreateRichTextString(cs.Text));
+ col++;
+ }
+
+ //データ
+ for (int i = 0; i < m_Data.Rows.Count; i++)
+ {
+ row = sheet.CreateRow(i + 2);
+ //row.HeightInPoints = 16;
+ col = 0;
+ foreach (ColumnStyle cs in m_Style.ColumnStyle)
+ {
+ cell = row.CreateCell(col);
+ if (cs.DefaultCellStyle != null)
+ {
+ if (cs.DefaultCellStyle.Alignment == StringAlignment.Center)
+ {
+ cell.CellStyle = style;
+ }
+ else
+ {
+ cell.CellStyle = style1;
+ }
+ }
+ string text = m_Data.Rows[i][cs.DataField].ToString();
+ if (cs.MaxCharLen < GeneralSub.GetStrLenB(text)) { cs.MaxCharLen = GeneralSub.GetStrLenB(text); }
+ cell.SetCellValue(cH.CreateRichTextString(text));
+ col++;
+ }
+ }
+
+ //fit
+ col = 0;
+ foreach (ColumnStyle cs in m_Style.ColumnStyle)
+ {
+ sheet.SetColumnWidth(col, (int)((cs.MaxCharLen + 0.72) * 256));
+ //sheet.AutoSizeColumn(col);
+ col++;
+ }
+ wb.Write(stream, true);
+ }
+ }
+
+ /// <summary>
+ /// 横水平方向
+ /// </summary>
+ /// <param name="align"></param>
+ /// <returns></returns>
+ public HorizontalAlignment ToHorizontalAlignment(StringAlignment align)
+ {
+ HorizontalAlignment ag = HorizontalAlignment.Center;
+ switch (align)
+ {
+ case StringAlignment.Center:
+ ag = HorizontalAlignment.Center;
+ break;
+ case StringAlignment.Near:
+ ag = HorizontalAlignment.Left;
+ break;
+ case StringAlignment.Far:
+ ag = HorizontalAlignment.Right;
+ break;
+ }
+ return ag;
+ }
+
+ /// <summary>
+ /// 縦垂直方向
+ /// </summary>
+ /// <param name="align"></param>
+ /// <returns></returns>
+ public VerticalAlignment ToVerticalAlignment(StringAlignment align)
+ {
+ VerticalAlignment ag = VerticalAlignment.Center;
+ switch (align)
+ {
+ case StringAlignment.Center:
+ ag = VerticalAlignment.Center;
+ break;
+ case StringAlignment.Near:
+ ag = VerticalAlignment.Top;
+ break;
+ case StringAlignment.Far:
+ ag = VerticalAlignment.Bottom;
+ break;
+ }
+ return ag;
+ }
+
+ #endregion
+
+ }
+}
diff --git a/HotelPms.Share.Windows/Report/GridReport.cs b/HotelPms.Share.Windows/Report/GridReport.cs
new file mode 100644
index 0000000..eaf01c7
--- /dev/null
+++ b/HotelPms.Share.Windows/Report/GridReport.cs
@@ -0,0 +1,347 @@
+using HotelPms.Share.IO;
+using HotelPms.Share.Util;
+using HotelPms.Share.Windows.Report.Member;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Drawing;
+using System.IO;
+using System.Windows.Forms;
+
+namespace HotelPms.Share.Windows.Report
+{
+ public class GridReport : PrintGdiPlus, IDisposable, IReport
+ {
+ #region ★★★★★ Declartions ★★★★★
+
+
+ private bool m_Disposed = false;
+ private bool m_InitOK = false;
+ private float m_CurrentY = 0F;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public GridReport(DataTable data, GridStyle style, string pdfFile)
+ {
+ m_Data = data;
+ m_Style = style;
+ if (m_PrintDoc.DefaultPageSettings.PaperSize.Width < m_PrintDoc.DefaultPageSettings.PaperSize.Height) { m_PrintDoc.DefaultPageSettings.Landscape = true; }
+
+ //PDFの場合
+ if (pdfFile.Length > 0)
+ {
+ PrintDoc.PrinterSettings.PrinterName = "Microsoft Print to PDF";
+ PrintDoc.PrinterSettings.PrintFileName = pdfFile;
+ PrintDoc.PrinterSettings.PrintToFile = true;
+ }
+
+ this.PrintDoc.PrintPage += PrintDoc_PrintPage;
+ m_InitOK = false;
+ }
+
+ ~GridReport()
+ {
+ Dispose(false);
+ }
+
+ protected override void Dispose(bool disposing)
+ {
+ if (!m_Disposed) //一回だけ
+ {
+ if (disposing)
+ {
+ //Managed Resources
+ }
+
+ //Unmanaged resources
+ m_Disposed = true;
+ }
+ base.Dispose(disposing);
+ }
+
+ public override void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+
+ #endregion
+
+ #region ★★★★★ Control Event ★★★★★
+
+ private void PrintDoc_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
+ {
+ //初期化
+ Init(e);
+
+ //ヘッダー出力
+ PrintHeader(e);
+
+ //明細出力
+ PrintDetail(e);
+
+ //フッター出力
+ PrintFooter(e);
+
+ //次のページ
+ e.HasMorePages = m_DataRowIndex < (m_Data.Rows.Count - 1);
+ m_PageIndex++;
+ }
+
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+
+ private void Init(System.Drawing.Printing.PrintPageEventArgs e)
+ {
+ try
+ {
+ if (m_InitOK) { return; }
+
+ //if (GeneralSub.IsIdeMode())
+ //{
+ // using (Pen pen = new Pen(Color.Blue, 4F))
+ // {
+ // e.Graphics.DrawRectangle(pen, new Rectangle(e.PageBounds.X, e.PageBounds.Y, e.PageBounds.Width - (int)e.PageSettings.HardMarginX * 2 - (int)pen.Width, e.PageBounds.Height - (int)e.PageSettings.HardMarginY * 2 - (int)pen.Width));
+ // }
+ //}
+
+ //印字範囲 98%
+ float width = e.PageBounds.Width - (int)e.PageSettings.HardMarginX * 2;
+ float height = e.PageBounds.Height - (int)e.PageSettings.HardMarginY * 2;
+ m_PrintWidth = width * PaperSizeRate;
+ m_PrintHeight = height * PaperSizeRate;
+ m_LeftMargins = (width * 1.0F - m_PrintWidth) / 2;
+ m_TopMargins = (height * 1.0F - m_PrintHeight) / 2;
+ //if (GeneralSub.IsIdeMode()) { e.Graphics.DrawRectangle(Pens.Red, m_LeftMargins, m_TopMargins, m_PrintWidth, m_PrintHeight); }
+
+ //各列のX位置の計算
+ float x = m_LeftMargins;
+ foreach (ColumnStyle item in m_Style.ColumnStyle)
+ {
+ item.Width = item.WidthRate * m_PrintWidth;
+ item.Left = x;
+ x += item.Width;
+ }
+
+ //ヘッダー情報位置の計算
+ BuildHeader(e.Graphics);
+
+ m_DetailRowHeight = GetTextHeight(e.Graphics, m_Style.Font) + (float)m_Style.DefaultRowStyle.Padding.Top + (float)m_Style.DefaultRowStyle.Padding.Bottom; //行高さ
+ m_HeaderHeight = m_Style.Header.Height; //ヘッダーの高さ
+ m_CaptionHeight = GetTextHeight(e.Graphics, m_Style.ColumnStyle[0].Font) + (float)m_Style.DefaultRowStyle.Padding.Top + (float)m_Style.DefaultRowStyle.Padding.Bottom; //項目名印字行の高さ
+ m_FooterHeight = 0F; //フッターの高さ(TODO)
+ float detailHeight = m_PrintHeight - m_HeaderHeight - m_CaptionHeight - m_FooterHeight; //明細印字領域の高さ
+
+ //行数
+ m_DetailRowCount = (int)(detailHeight / m_DetailRowHeight);
+
+ //ページ数
+ m_PageIndex = 1;
+ m_PageCount = m_Data.Rows.Count / m_DetailRowCount + (((m_Data.Rows.Count % m_DetailRowCount) > 0) ? 1 : 0);
+
+ m_InitOK = true;
+ }
+ catch(Exception ex)
+ {
+ OperationLog.Instance.WriteLog($"GridReport.Init:{ex.Message}");
+ }
+ }
+
+ private float GetPrintRowHeight(Graphics g, PrintRow row)
+ {
+ float height = 0;
+ foreach (Cell cell in row.Cells)
+ {
+ if (cell.Style == null) { cell.Style = m_Style.Header.DefaultCellStyle; }
+ cell.Style.Height = GetTextHeight(g, cell.Style.Font) + cell.Style.Padding.Top + cell.Style.Padding.Bottom;
+ if (height < cell.Style.Height) { height = cell.Style.Height; }
+ }
+ return height;
+ }
+
+ /// <summary>
+ /// 印字位置の計算
+ /// (X,Y,Width,Height)
+ /// </summary>
+ private void BuildHeader(Graphics g)
+ {
+ float y = m_TopMargins;
+ foreach(PrintRow row in Style.Header.Rows)
+ {
+ #region 行毎
+
+ float x = m_LeftMargins;
+ float width = m_PrintWidth;
+ float height = GetPrintRowHeight(g, row);
+ foreach(Cell cell in row.Cells)
+ {
+ #region 列毎
+
+ //Y位置
+ cell.Style.Top = y;
+
+ //文言予測
+ if (cell.CellType == Cell.CellKind.PrintTime)
+ {
+ cell.Text = cell.Style.Template.Length > 0 ? string.Format(cell.Style.Template, DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss")) : DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
+ }
+ else if (cell.CellType == Cell.CellKind.PageNo)
+ {
+ cell.Text = cell.Style.Template.Length > 0 ? string.Format(cell.Style.Template, m_PageIndex, m_PageCount) : $"99999 / 99999";
+ }
+ else if (cell.CellType == Cell.CellKind.TimeAndPage)
+ {
+ cell.Text = cell.Style.Template.Length > 0 ? string.Format(cell.Style.Template, DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"), m_PageIndex, m_PageCount) : $"{DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss")} {m_PageIndex} / {m_PageCount.ToString().PadLeft(5, ' ')}";
+ }
+ else
+ {
+ cell.Text = cell.Style.Template.Length > 0 ? string.Format(cell.Style.Template, cell.Text) : cell.Text;
+ }
+
+ //X位置
+ if (cell.Style.LocalXMode == CellStyle.ELocalXMode.BeginOfCol)
+ {
+ x = Style.ColumnStyle[cell.Style.BeginCol].Left;
+ cell.Style.Left = x;
+ }
+
+ //幅
+ if (cell.Style.WidthMode == CellStyle.EWidthMode.TextWidth)
+ {
+ cell.Style.Width = GetTextWidth(g, cell.Style.Font, cell.Text) + cell.Style.Padding.Left + cell.Style.Padding.Right;
+ }
+ else if (cell.Style.WidthMode == CellStyle.EWidthMode.AutoFill)
+ {
+ cell.Style.Width = width;
+ }
+ else if (cell.Style.WidthMode == CellStyle.EWidthMode.EndOfCol)
+ {
+ cell.Style.Width = Style.ColumnStyle[cell.Style.EndCol].Left + Style.ColumnStyle[cell.Style.EndCol].Width - Style.ColumnStyle[cell.Style.BeginCol].Left;
+ }
+
+ //高さ(最大)
+ cell.Style.Height = height;
+
+ //X位置
+ if (cell.Style.LocalXMode == CellStyle.ELocalXMode.BeginOfCol)
+ {
+ x += cell.Style.Width;
+ }
+ else
+ {
+ if (cell.Style.Dock == DockStyle.Left || cell.Style.Dock == DockStyle.Fill)
+ {
+ cell.Style.Left = x;
+ x += cell.Style.Width;
+ }
+ else if (cell.Style.Dock == DockStyle.Right)
+ {
+ cell.Style.Left = m_LeftMargins + width - cell.Style.Width;
+ }
+ else if (cell.Style.Dock == DockStyle.Fill)
+ {
+ cell.Style.Left = x;
+ }
+ else
+ {
+ //Noneで、実際の位置設定
+ }
+ }
+
+ //幅の変化
+ width -= cell.Style.Width;
+
+ #endregion
+ }
+
+ y += height;
+
+ #endregion
+ }
+ }
+
+ private void PrintHeader(System.Drawing.Printing.PrintPageEventArgs e)
+ {
+ m_CurrentY = m_TopMargins;
+
+ //複数行想定(タイトル+印字時間+ページなど)
+ foreach (PrintRow row in m_Style.Header.Rows)
+ {
+ foreach (Cell cell in row.Cells)
+ {
+ DrawCell(e.Graphics, cell);
+ }
+ }
+
+ //列名
+ m_CurrentY = m_TopMargins + m_HeaderHeight;
+ foreach (ColumnStyle cs in m_Style.ColumnStyle)
+ {
+ Cell item = new Cell();
+ item.Style = m_Style.DefaultCellStyle.Clone() as CellStyle;
+ item.Style.Font = cs.Font;
+ item.Style.RectangleF = new RectangleF(new PointF(cs.Left, m_CurrentY), new SizeF(cs.Width, m_CaptionHeight));
+ item.Text = cs.Text;
+ item.Style.LeftBorder.Visible = true;
+ item.Style.TopBorder.Visible = true;
+ item.Style.RightBorder.Visible = true;
+ item.Style.BottomBorder.Visible = true;
+ item.Style.Alignment = cs.Alignment;
+ item.Style.LineAlignment = cs.LineAlignment;
+ DrawCell(e.Graphics, item);
+ }
+ m_CurrentY = m_TopMargins + m_HeaderHeight + m_CaptionHeight;
+ }
+
+ private void PrintFooter(System.Drawing.Printing.PrintPageEventArgs e)
+ {
+
+ }
+
+ private void PrintDetail(System.Drawing.Printing.PrintPageEventArgs e)
+ {
+ for (int i = 0; i < m_DetailRowCount; i++)
+ {
+ if (m_DataRowIndex == m_Data.Rows.Count) { break; }
+ DataRow row = m_Data.Rows[m_DataRowIndex];
+
+ //行印字
+ foreach (ColumnStyle cs in m_Style.ColumnStyle)
+ {
+ Cell item = new Cell();
+ item.Style = m_Style.DefaultCellStyle.Clone() as CellStyle;
+ item.Style.RectangleF = new RectangleF(new PointF(cs.Left, m_CurrentY), new SizeF(cs.Width, m_DetailRowHeight));
+ item.Text = row[cs.DataField].ToString();
+ item.Style.LeftBorder.Visible = true;
+ item.Style.TopBorder.Visible = true;
+ item.Style.RightBorder.Visible = true;
+ item.Style.BottomBorder.Visible = true;
+ if (cs.DefaultCellStyle != null)
+ {
+ item.Style.Alignment = cs.DefaultCellStyle.Alignment;
+ item.Style.LineAlignment = cs.DefaultCellStyle.LineAlignment;
+ }
+ DrawCell(e.Graphics, item);
+ }
+
+ m_CurrentY += m_DetailRowHeight;
+ m_DataRowIndex++;
+ }
+ }
+
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+
+
+
+ #endregion
+ }
+}
diff --git a/HotelPms.Share.Windows/Report/GridStyle.cs b/HotelPms.Share.Windows/Report/GridStyle.cs
new file mode 100644
index 0000000..d8c296c
--- /dev/null
+++ b/HotelPms.Share.Windows/Report/GridStyle.cs
@@ -0,0 +1,68 @@
+using HotelPms.Share.Windows.Report.Member;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+
+namespace HotelPms.Share.Windows.Report
+{
+ public class GridStyle : OutputStyle
+ {
+ public enum BoderStyle : int
+ {
+ [Description("全体枠線")]
+ All = 0,
+ [Description("行下線")]
+ UnderLine,
+ }
+
+ /// <summary>
+ /// 行スタイルのディフォルト
+ /// </summary>
+ public RowStyle DefaultRowStyle { get; set; } = new RowStyle();
+
+ /// <summary>
+ /// セルスタイルのディフォルト
+ /// </summary>
+ public CellStyle DefaultCellStyle { get; set; } = new CellStyle();
+
+ /// <summary>
+ /// 指定行インデックスのスタイル
+ /// 例:小計、合計行
+ /// </summary>
+ public SortedDictionary<int, RowStyle> RowStyle { get; set; } = new SortedDictionary<int, RowStyle>();
+
+ /// <summary>
+ /// 列単位のスタイル
+ /// </summary>
+ public List<ColumnStyle> ColumnStyle { get; set; } = new List<ColumnStyle>();
+
+ /// <summary>
+ /// 罫線の様式
+ /// </summary>
+ public BoderStyle Boder { get; set; } = BoderStyle.All;
+
+ /// <summary>
+ /// 交互に行背景色を印字するかどうか
+ /// </summary>
+ public Color AlternatingRowColor { get; set; } = Color.Empty; //Color.FromArgb(255, 216, 228, 248);
+
+ /// <summary>
+ /// ヘッダー印字情報
+ /// </summary>
+ public PageHeader Header { get; set; } = new PageHeader();
+
+ /// <summary>
+ /// フッター印字情報
+ /// </summary>
+ public PageFooter Footer { get; set; } = new PageFooter();
+
+ public GridStyle()
+ {
+ DefaultRowStyle.Padding = new Padding(0, 3, 0, 3);
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/Report/GridXml.cs b/HotelPms.Share.Windows/Report/GridXml.cs
new file mode 100644
index 0000000..9a56663
--- /dev/null
+++ b/HotelPms.Share.Windows/Report/GridXml.cs
@@ -0,0 +1,88 @@
+using NPOI.HSSF.UserModel;
+using NPOI.SS.UserModel;
+using NPOI.XSSF.UserModel;
+using HotelPms.Share.Util;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Diagnostics;
+using System.Drawing;
+using System.IO;
+using System.Linq;
+using System.Text;
+
+namespace HotelPms.Share.Windows.Report
+{
+ public class GridXml : ReportBase, IDisposable, IReport
+ {
+ #region ★★★★★ Declartions ★★★★★
+
+ private bool m_Disposed = false;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public GridXml(DataTable data, GridStyle style)
+ {
+ m_Data = data;
+ m_Style = style;
+ }
+
+ ~GridXml()
+ {
+ Dispose(false);
+ }
+
+ protected virtual void Dispose(bool disposing)
+ {
+ if (!m_Disposed) //一回だけ
+ {
+ if (disposing)
+ {
+ //Managed Resources
+ }
+
+ //Unmanaged resources
+ m_Disposed = true;
+ }
+ }
+
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+
+ #endregion
+
+ #region ★★★★★ Control Event ★★★★★
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+
+ public void Output()
+ {
+ string path = System.IO.Path.GetTempFileName().Replace(".tmp", ".xml");
+ Output(path);
+ Process.Start(path);
+ }
+
+ public void Output(string file)
+ {
+ if (m_Data.TableName.Length == 0) { m_Data.TableName = "Data"; }
+ m_Data.WriteXml(file);
+ }
+
+
+ #endregion
+
+ }
+}
diff --git a/HotelPms.Share.Windows/Report/IReport.cs b/HotelPms.Share.Windows/Report/IReport.cs
new file mode 100644
index 0000000..7e83d73
--- /dev/null
+++ b/HotelPms.Share.Windows/Report/IReport.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Text;
+
+namespace HotelPms.Share.Windows.Report
+{
+ public interface IReport
+ {
+ void Output();
+ void Dispose();
+
+ DataTable Data { get; set; }
+ GridStyle Style { get; set; }
+ }
+}
diff --git a/HotelPms.Share.Windows/Report/Member/PageFooter.cs b/HotelPms.Share.Windows/Report/Member/PageFooter.cs
new file mode 100644
index 0000000..e3b3529
--- /dev/null
+++ b/HotelPms.Share.Windows/Report/Member/PageFooter.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HotelPms.Share.Windows.Report.Member
+{
+ public class PageFooter : PrintSection
+ {
+
+ }
+}
diff --git a/HotelPms.Share.Windows/Report/Member/PageHeader.cs b/HotelPms.Share.Windows/Report/Member/PageHeader.cs
new file mode 100644
index 0000000..a353e70
--- /dev/null
+++ b/HotelPms.Share.Windows/Report/Member/PageHeader.cs
@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HotelPms.Share.Windows.Report.Member
+{
+ public class PageHeader : PrintSection
+ {
+
+ public PageHeader()
+ {
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/Report/Member/PrintRow.cs b/HotelPms.Share.Windows/Report/Member/PrintRow.cs
new file mode 100644
index 0000000..71e7396
--- /dev/null
+++ b/HotelPms.Share.Windows/Report/Member/PrintRow.cs
@@ -0,0 +1,53 @@
+using System.Collections.Generic;
+using System.ComponentModel;
+
+namespace HotelPms.Share.Windows.Report.Member
+{
+ public class PrintRow
+ {
+ /// <summary>
+ /// 行のセル毎印刷情報
+ /// </summary>
+ public List<Cell> Cells { get; set; } = new List<Cell>();
+
+ /// <summary>
+ /// ディフォルトプロパティ
+ /// </summary>
+ /// <param name="index"></param>
+ /// <returns></returns>
+ public Cell this[int index] { get { return Cells[index]; } }
+
+ /// <summary>
+ /// 行の最大Y - 最小Y
+ /// </summary>
+ /// <param name="def"></param>
+ /// <returns></returns>
+ public float GetHeight(float def)
+ {
+ float rowHeight = def;
+ if (Cells.Count > 0)
+ {
+ float minY = 0F;
+ float maxY = 0F;
+ int i = 0;
+ foreach (Cell cell in Cells)
+ {
+ if (cell.Style == null) { continue; }
+ if (i == 0)
+ {
+ minY = cell.Style.Top;
+ maxY = cell.Style.Top + cell.Style.Height;
+ }
+ else
+ {
+ if (minY > cell.Style.Top) { minY = cell.Style.Top; }
+ if (maxY < (cell.Style.Top + cell.Style.Height)) { maxY = cell.Style.Top + cell.Style.Height; }
+ }
+ i++;
+ }
+ rowHeight = maxY - minY;
+ }
+ return rowHeight;
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/Report/Member/PrintSection.cs b/HotelPms.Share.Windows/Report/Member/PrintSection.cs
new file mode 100644
index 0000000..14c4c45
--- /dev/null
+++ b/HotelPms.Share.Windows/Report/Member/PrintSection.cs
@@ -0,0 +1,60 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HotelPms.Share.Windows.Report.Member
+{
+ public abstract class PrintSection
+ {
+ /// <summary>
+ /// セルデータによる高さ自動調整
+ /// </summary>
+ public bool AutoHeight { get; set; } = true;
+
+ private float m_Height = 0;
+
+ /// <summary>
+ /// 固定高さの設定
+ /// </summary>
+ public float Height
+ {
+ get
+ {
+ float height = 0F;
+ if (AutoHeight)
+ {
+ foreach(PrintRow row in Rows)
+ {
+ height += row.GetHeight(DefaultCellStyle.Height);
+ }
+ return height;
+ }
+ else
+ {
+ return m_Height;
+ }
+ }
+ set
+ {
+ m_Height = value;
+ }
+ }
+
+ /// <summary>
+ /// 行スタイルのディフォルト
+ /// </summary>
+ public RowStyle DefaultRowStyle { get; set; } = new RowStyle();
+
+ /// <summary>
+ /// セルスタイルのディフォルト
+ /// </summary>
+ public CellStyle DefaultCellStyle { get; set; } = new CellStyle();
+
+ /// <summary>
+ /// 行毎データ
+ /// </summary>
+ public List<PrintRow> Rows { get; set; } = new List<PrintRow>();
+ }
+}
diff --git a/HotelPms.Share.Windows/Report/OutputStyle.cs b/HotelPms.Share.Windows/Report/OutputStyle.cs
new file mode 100644
index 0000000..117d39c
--- /dev/null
+++ b/HotelPms.Share.Windows/Report/OutputStyle.cs
@@ -0,0 +1,174 @@
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+
+namespace HotelPms.Share.Windows.Report
+{
+ /// <summary>
+ /// 単位:1/100インチ
+ /// </summary>
+ public abstract class OutputStyle
+ {
+ /// <summary>
+ /// 文言出力用テンプレート
+ /// 例:ページ:{0}/{1}
+ /// </summary>
+ public string Template { get; set; } = string.Empty;
+
+ private Font m_Font = new Font("MS UI Gothic", 9F);
+
+ public Font Font
+ {
+ get { return m_Font; }
+ set { m_Font = value; }
+ }
+
+ private float m_Left = 0F;
+
+ public float Left
+ {
+ get { return m_Left; }
+ set { m_Left = value; }
+ }
+
+ private float m_Top = 0F;
+
+ public float Top
+ {
+ get { return m_Top; }
+ set { m_Top = value; }
+ }
+
+
+ private int m_MaxCharLen = 0;
+
+ public int MaxCharLen
+ {
+ get { return m_MaxCharLen; }
+ set { m_MaxCharLen = value; }
+ }
+
+ private float m_Width = 0F;
+
+ /// <summary>
+ /// Padding含む
+ /// </summary>
+ public float Width
+ {
+ get { return m_Width; }
+ set { m_Width = value; }
+ }
+
+ /// <summary>
+ /// Padding含む
+ /// </summary>
+ public float Height { get; set; } = 0F;
+
+ public RectangleF RectangleF
+ {
+ get { return new RectangleF(m_Left, m_Top, m_Width, Height); }
+ set { m_Left = value.Left; m_Top = value.Top; m_Width = value.Width; Height = value.Height; }
+ }
+
+
+ /// <summary>
+ /// 1/100インチ
+ /// </summary>
+ private Padding m_Padding = new Padding(0);
+
+ public Padding Padding
+ {
+ get { return m_Padding; }
+ set { m_Padding = value; }
+ }
+
+ private List<Border> m_BorderList = new List<Border>();
+
+ /// <summary>
+ /// 0.Left 1.Right 2.Top 3.Bottom
+ /// </summary>
+ public List<Border> BorderList
+ {
+ get { return m_BorderList; }
+ set { m_BorderList = value; }
+ }
+
+ private Border m_LeftBorder = new Border(Border.TypeIndex.Left);
+
+ public Border LeftBorder
+ {
+ get { return m_LeftBorder; }
+ set { m_LeftBorder = value; }
+ }
+
+ private Border m_RightBorder = new Border(Border.TypeIndex.Right);
+
+ public Border RightBorder
+ {
+ get { return m_RightBorder; }
+ set { m_RightBorder = value; }
+ }
+
+
+ private Border m_TopBorder = new Border(Border.TypeIndex.Top);
+
+ public Border TopBorder
+ {
+ get { return m_TopBorder; }
+ set { m_TopBorder = value; }
+ }
+
+
+ private Border m_BottomBorder = new Border(Border.TypeIndex.Bottom);
+
+ public Border BottomBorder
+ {
+ get { return m_BottomBorder; }
+ set { m_BottomBorder = value; }
+ }
+
+ // 概要:
+ // 垂直方向の平面上のテキスト配置情報を取得または設定します。
+ //
+ // 戻り値:
+ // テキスト配置情報を指定する System.Drawing.StringAlignment 列挙体。
+
+ private StringAlignment m_Alignment = StringAlignment.Center;
+
+ public StringAlignment Alignment
+ {
+ get { return m_Alignment; }
+ set { m_Alignment = value; }
+ }
+
+ private StringAlignment m_LineAlignment = StringAlignment.Center;
+
+ //
+ // 概要:
+ // 水平方向の平面上の行配置を取得または設定します。
+ //
+ // 戻り値:
+ // 行配置を表す System.Drawing.StringAlignment 列挙体。
+ public StringAlignment LineAlignment
+ {
+ get { return m_LineAlignment; }
+ set { m_LineAlignment = value; }
+ }
+
+ public OutputStyle()
+ {
+ m_BorderList.Add(m_LeftBorder);
+ m_BorderList.Add(m_RightBorder);
+ m_BorderList.Add(m_TopBorder);
+ m_BorderList.Add(m_BottomBorder);
+ }
+
+ public object Clone()
+ {
+ return this.MemberwiseClone();
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/Report/PrintGdiPlus.cs b/HotelPms.Share.Windows/Report/PrintGdiPlus.cs
new file mode 100644
index 0000000..bb1b745
--- /dev/null
+++ b/HotelPms.Share.Windows/Report/PrintGdiPlus.cs
@@ -0,0 +1,265 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Drawing.Printing;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using Microsoft.Win32;
+using System.IO;
+
+namespace HotelPms.Share.Windows.Report
+{
+ /// <summary>
+ /// ****************************** Description *******************************
+ /// ◇システム名称
+ /// @CoreCom
+ /// ◇概要
+ /// 施設設定画面
+ /// ◇履歴
+ /// 2007/11/02 小木 勝龍 新規作成
+ /// ****************************** Declarations ******************************
+ /// </summary>
+ public abstract class PrintGdiPlus : ReportBase,IDisposable
+ {
+ #region ★★★★★ Declartions ★★★★★
+
+ public static SortedDictionary<string, string> FontFileDict = null;
+ public static string SystemFontPath = string.Empty;
+
+ public delegate void FetchEventHandler(object sender, FetchEventArgs e);
+ public event FetchEventHandler FetchItem = null;
+
+ private bool m_Disposed = false;
+
+ protected StringFormat m_StringFormat = new StringFormat();
+ protected float m_PrintRate = 1F; //印字倍率
+
+ protected static int A4PaperWidth = 827;
+ protected static int A4PaperHeight = 1169;
+
+ protected static int B5PaperWidth = 717;
+ protected static int B5PaperHeight = 1012;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+
+ protected List<Cell> m_Items = new List<Cell>();
+ public List<Cell> Items
+ {
+ get { return m_Items; }
+ }
+
+ protected PrintDocument m_PrintDoc = new PrintDocument();
+
+ public PrintDocument PrintDoc
+ {
+ get { return m_PrintDoc; }
+ set { m_PrintDoc = value; }
+ }
+
+ /// <summary>
+ /// 印字範囲
+ /// </summary>
+ public float PaperSizeRate { get; set; } = 0.95F;
+
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public PrintGdiPlus()
+ {
+ m_PrintDoc.DefaultPageSettings.Margins = new Margins(0, 0, 0, 0);
+ SystemFontPath = Environment.GetFolderPath(Environment.SpecialFolder.Fonts);
+ if (FontFileDict == null) { FontFileDict = ReadFontInformation(); }
+ m_StringFormat.FormatFlags |= StringFormatFlags.NoWrap;
+ }
+
+ ~PrintGdiPlus()
+ {
+ Dispose(false);
+ }
+
+ protected virtual void Dispose(bool disposing)
+ {
+ if (!m_Disposed) //一回だけ
+ {
+ if (disposing)
+ {
+ //Managed Resources
+ if (m_StringFormat != null) { m_StringFormat.Dispose(); m_StringFormat = null; }
+ }
+
+ //Unmanaged resources
+ m_Disposed = true;
+ }
+ }
+
+ public virtual void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+
+ #endregion
+
+ #region ★★★★★ Control Event ★★★★★
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+
+ public void Clear()
+ {
+ m_Items.Clear();
+ }
+
+ public void Add(Cell cell)
+ {
+ m_Items.Add(cell);
+ }
+
+
+
+ public void PrintAll(Graphics g)
+ {
+ int i = 0;
+ int count = m_Items.Count;
+ foreach (Cell item in m_Items)
+ {
+ if (FetchItem != null) { FetchItem(this, new FetchEventArgs(item, i, count)); }
+ DrawCell(g, item);
+ i++;
+ }
+ }
+
+ public void DrawBorder(Graphics g, Border border, Cell item)
+ {
+ if (!border.Visible) { return; }
+
+ using (Pen pen = new Pen(Brushes.Black, border.Weight))
+ {
+ pen.DashStyle = border.DashStyle;
+
+ float x1 = 0F;
+ float y1 = 0F;
+ float x2 = 0F;
+ float y2 = 0F;
+
+ if (border.Index == Border.TypeIndex.Top)
+ {
+ x1 = item.Style.Left - border.Weight * 0.5F;
+ x2 = item.Style.Left + item.Style.Width + border.Weight * 0.5F;
+ y1 = y2 = item.Style.Top;
+ }
+ else if (border.Index == Border.TypeIndex.Bottom)
+ {
+ x1 = item.Style.Left - border.Weight * 0.5F;
+ x2 = item.Style.Left + item.Style.Width + border.Weight * 0.5F;
+ y1 = y2 = item.Style.Top + item.Style.Height;
+ }
+ else if (border.Index == Border.TypeIndex.Left)
+ {
+ x1 = x2 = item.Style.Left;
+ y1 = item.Style.Top;
+ y2 = item.Style.Top + item.Style.Height;
+ }
+ else if (border.Index == Border.TypeIndex.Right)
+ {
+ x1 = x2 = item.Style.Left + item.Style.Width;
+ y1 = item.Style.Top;
+ y2 = item.Style.Top + item.Style.Height;
+ }
+
+ g.DrawLine(pen, x1, y1, x2, y2);
+ }
+ }
+
+ public void DrawCell(Graphics g, Cell item)
+ {
+ if (item.CellType == Cell.CellKind.Text || item.CellType == Cell.CellKind.PrintTime || item.CellType == Cell.CellKind.PageNo || item.CellType == Cell.CellKind.TimeAndPage)
+ {
+ //枠
+ foreach (Border border in item.Style.BorderList) { DrawBorder(g, border, item); }
+
+ RectangleF r = new RectangleF(item.Style.Left + item.Style.Padding.Left, item.Style.Top + item.Style.Padding.Top, item.Style.Width - item.Style.Padding.Left - item.Style.Padding.Right, item.Style.Height - item.Style.Padding.Top - item.Style.Padding.Bottom);
+ m_StringFormat.Alignment = item.Style.Alignment;
+ m_StringFormat.LineAlignment = item.Style.LineAlignment;
+
+ string text = item.Text;
+ if(item.CellType == Cell.CellKind.PrintTime)
+ {
+ text = item.Style.Template.Length > 0 ? string.Format(item.Style.Template, DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss")) : DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
+ }
+ else if (item.CellType == Cell.CellKind.PageNo)
+ {
+ text = item.Style.Template.Length > 0 ? string.Format(item.Style.Template, m_PageIndex, m_PageCount) : $"{m_PageIndex} / {m_PageCount.ToString().PadLeft(5, ' ')}";
+ }
+ else if (item.CellType == Cell.CellKind.TimeAndPage)
+ {
+ text = item.Style.Template.Length > 0 ? string.Format(item.Style.Template, DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"), m_PageIndex, m_PageCount) : $"{DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss")} {m_PageIndex} / {m_PageCount.ToString().PadLeft(5, ' ')}";
+ }
+
+ g.DrawString(text, item.Style.Font, Brushes.Black, r, m_StringFormat);
+ }
+ else if (item.CellType == Cell.CellKind.DotLine || item.CellType == Cell.CellKind.Line)
+ {
+ using (Pen pen = new Pen(Brushes.Black, 1))
+ {
+ pen.DashStyle = (item.CellType == Cell.CellKind.DotLine) ? DashStyle.Dot : DashStyle.Solid;
+ g.DrawLine(pen, item.Style.Left, item.Style.Top, item.Style.Left + item.Style.Width, item.Style.Top + item.Style.Height);
+ }
+ }
+ else if (item.CellType == Cell.CellKind.Image)
+ {
+ if (System.IO.File.Exists(item.Text))
+ {
+ using (System.Drawing.Image img = System.Drawing.Image.FromFile(item.Text))
+ {
+ DrawImage(g, img, item.Style.RectangleF);
+ g.DrawRectangle(Pens.Black, item.Style.RectangleF.X, item.Style.RectangleF.Y, item.Style.RectangleF.Width, item.Style.RectangleF.Height);
+ }
+ }
+ }
+ }
+
+ public void Output()
+ {
+ m_PrintDoc.Print();
+ }
+
+
+ /// <summary>
+ ///
+ /// </summary>
+ /// <param name="graphics"></param>
+ /// <param name="image"></param>
+ /// <param name="rectangle"></param>
+ public void DrawImage(Graphics graphics, Image image, RectangleF rectangle)
+ {
+ if (graphics == null) throw new ArgumentNullException();
+ if (rectangle.Width <= 0 || rectangle.Height <= 0) throw new ArgumentOutOfRangeException();
+ if (image == null) return;
+
+ var l = rectangle.Left;
+ var t = rectangle.Top;
+ var w = (float)image.Width;
+ var h = (float)image.Height;
+ var r = h / w;
+ w = rectangle.Height / r;
+ h = rectangle.Height;
+ if (w > rectangle.Width)
+ {
+ w = rectangle.Width;
+ h = rectangle.Width * r;
+ }
+ l += (rectangle.Width - w) / 2;
+ t += (rectangle.Height - h) / 2;
+ graphics.DrawImage(image, l, t, w, h);
+ }
+
+ #endregion
+ }
+}
diff --git a/HotelPms.Share.Windows/Report/ReportBase.cs b/HotelPms.Share.Windows/Report/ReportBase.cs
new file mode 100644
index 0000000..9fc944f
--- /dev/null
+++ b/HotelPms.Share.Windows/Report/ReportBase.cs
@@ -0,0 +1,148 @@
+using Microsoft.Win32;
+using HotelPms.Share.Util;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using HotelPms.Share.Windows.Util;
+
+namespace HotelPms.Share.Windows.Report
+{
+ public enum ReportType : int
+ {
+ Print = 0,
+ Pdf,
+ Xlsx,
+ Csv,
+ Html,
+ Json,
+ Xml,
+ Xls,
+ Preveiw,
+ }
+
+#pragma warning disable CA1416
+ public abstract class ReportBase
+ {
+ protected float m_PrintWidth = 700F; // 印字使用幅(A4)
+ protected float m_PrintHeight = 1032F; // 印字使用高(A4)
+
+ protected float m_LeftMargins = 50F; //左余白
+ protected float m_TopMargins = 60F; //上余白
+
+ protected int m_PageCount = 0;
+ protected int m_PageIndex = 1;
+ protected int m_DataRowIndex = 0;
+ protected float m_DetailRowHeight = 0F;
+ protected float m_TitleHeight = 0F;
+ protected int m_DetailRowCount = 0;
+ protected float m_HeaderHeight = 0F;
+ protected float m_CaptionHeight = 0F; //項目名の固定行
+ protected float m_FooterHeight = 0F;
+
+
+ protected DataTable m_Data = null;
+
+ public DataTable Data
+ {
+ get { return m_Data; }
+ set { m_Data = value; }
+ }
+
+ protected GridStyle m_Style = null;
+
+ public GridStyle Style
+ {
+ get { return m_Style; }
+ set { m_Style = value; }
+ }
+
+ /// <summary>
+ /// 1/100 インチ ⇒ Point
+ /// </summary>
+ /// <param name="value"></param>
+ /// <returns></returns>
+ public float GetPointWithDisplay(float value)
+ {
+ return value * 0.72F;
+ }
+
+ public float GetTextHeight(Graphics g, Font font)
+ {
+ return g.MeasureString("A", font).Height;
+ }
+
+ public float GetTextWidth(Graphics g, Font font, string text)
+ {
+ return g.MeasureString(text, font).Width;
+ }
+
+ public static void CreateColumnStyle(DataGridView grid, GridStyle style)
+ {
+ style.ColumnStyle.Clear();
+ int total = 0;
+ int lastIdx = 0;
+ foreach (DataGridViewColumn col in grid.Columns)
+ {
+ if (!col.Visible || (col.CellType.Name != "DataGridViewTextBoxCell")) { continue; }
+ total += col.Width;
+ lastIdx = col.Index;
+ }
+
+ float rate = 0F;
+ foreach (DataGridViewColumn col in grid.Columns)
+ {
+ if (!col.Visible || (col.CellType.Name != "DataGridViewTextBoxCell")) { continue; }
+
+ ColumnStyle colStyle = new ColumnStyle();
+ colStyle.DefaultCellStyle = new CellStyle();
+ colStyle.WidthRate = lastIdx == col.Index ? (1.0F - rate) : (float)CConvert.Divide(col.Width * 1.0F, total, 2);
+ colStyle.Width = col.Width * 1.0F;
+ rate += colStyle.WidthRate;
+ colStyle.DataField = col.DataPropertyName.Length > 0 ? col.DataPropertyName : col.Name;
+ colStyle.Text = col.HeaderText;
+ colStyle.Alignment = GeneralSub.ToStringAlignment(grid.ColumnHeadersDefaultCellStyle.Alignment);
+ colStyle.LineAlignment = GeneralSub.ToLineStringAlignment(grid.ColumnHeadersDefaultCellStyle.Alignment);
+ colStyle.DefaultCellStyle.Alignment = GeneralSub.ToStringAlignment(col.DefaultCellStyle.Alignment);
+ colStyle.DefaultCellStyle.LineAlignment = GeneralSub.ToLineStringAlignment(col.DefaultCellStyle.Alignment);
+ colStyle.DefaultCellStyle.Font = col.DefaultCellStyle.Font;
+ colStyle.Font = grid.ColumnHeadersDefaultCellStyle.Font;
+ style.ColumnStyle.Add(colStyle);
+ }
+ }
+
+ public static SortedDictionary<string, string> ReadFontInformation()
+ {
+ var dictionary = new SortedDictionary<string, string>();
+
+ RegistryKey mykey = Registry.LocalMachine;
+
+ string key = @"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts";
+ using (RegistryKey regkey = mykey.OpenSubKey(key, false))
+ {
+ if (regkey != null)
+ {
+ //获取字体名
+ string[] mynames = regkey.GetValueNames();
+
+ foreach (string name in mynames)
+ {
+ //获取字体的文件名
+ string myvalue = regkey.GetValue(name).ToString();
+
+ if (myvalue.Substring(myvalue.Length - 4).ToUpper() == ".TTF" && myvalue.Substring(1, 2).ToUpper() != @":\")
+ {
+ string val = name.Substring(0, name.Length - 11);
+ dictionary[val] = myvalue;
+ }
+ }
+ regkey.Close();
+ }
+ }
+ return dictionary;
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/Report/ReportControl.cs b/HotelPms.Share.Windows/Report/ReportControl.cs
new file mode 100644
index 0000000..ecd35dd
--- /dev/null
+++ b/HotelPms.Share.Windows/Report/ReportControl.cs
@@ -0,0 +1,33 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HotelPms.Share.Windows.Report
+{
+ public class ReportControl
+ {
+ public enum EItemType : int
+ {
+ /// <summary>
+ /// 印刷対象コントロール
+ /// </summary>
+ Element = 0,
+ Paper,
+ PageHeader,
+ PageFooter,
+ GroupHeader,
+ /// <summary>
+ /// グループのフッター
+ /// </summary>
+ GroupFooter,
+ /// <summary>
+ /// 明細(DataTableの行数と一致)
+ /// </summary>
+ Detail,
+ }
+
+ public EItemType ItemType { get; set; } = EItemType.Element;
+ }
+}
diff --git a/HotelPms.Share.Windows/Report/ReportFactory.cs b/HotelPms.Share.Windows/Report/ReportFactory.cs
new file mode 100644
index 0000000..5e53786
--- /dev/null
+++ b/HotelPms.Share.Windows/Report/ReportFactory.cs
@@ -0,0 +1,107 @@
+using HotelPms.Share.Util;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Diagnostics;
+using System.Drawing;
+using System.Drawing.Printing;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+
+namespace HotelPms.Share.Windows.Report
+{
+ public class ReportFactory
+ {
+ public static void OutputGrid(DataTable data, GridStyle style)
+ {
+ ReportType type = ReportType.Print;
+ using(FormTypeSelect form = new FormTypeSelect())
+ {
+ if (form.ShowDialog() != System.Windows.Forms.DialogResult.OK) { return; }
+ type = form.ReportType;
+ }
+ OutputGrid(data, style, type);
+ }
+
+ public static string GetTempFileName()
+ {
+ string root = Application.StartupPath.TrimEnd(Path.DirectorySeparatorChar) + @"\Output\";
+ if(!Directory.Exists(root)) { Directory.CreateDirectory(root); }
+
+ return $"{root}{DateTime.Now.ToString("yyyyMMddHHmmssfff")}";
+ }
+
+ public static void OutputGrid(DataTable data, GridStyle style, ReportType type)
+ {
+ string path = string.Empty;
+ IReport report = null;
+ if (type == ReportType.Print) { report = new GridReport(data, style, string.Empty); }
+ else if (type == ReportType.Pdf)
+ {
+ path = GetTempFileName() + ".pdf";
+ report = new GridReport(data, style, path);
+ }
+ else if (type == ReportType.Xlsx) { report = new GridExcel(data, style, true, GetTempFileName()); }
+ else if (type == ReportType.Xls) { report = new GridExcel(data, style, false, GetTempFileName()); }
+ else if (type == ReportType.Csv) { report = new GridCsv(data, style); }
+ else if (type == ReportType.Xml) { report = new GridXml(data, style); }
+
+ if (report == null) { return; }
+ report.Output();
+ report.Dispose();
+
+ if (type == ReportType.Pdf) { CConvert.StartFile(path); }
+ }
+
+ public static void OutputForm(List<List<Cell>> rptList, Rectangle ownerArea, PaperKind paper, string titlem)
+ {
+ OutputForm(rptList, ownerArea, paper, titlem, -1);
+ }
+
+ public static void OutputForm(List<List<Cell>> rptList, Rectangle ownerArea, PaperKind paper, string title, int rptType)
+ {
+ ReportType type = ReportType.Print;
+ if (rptType == -1)
+ {
+ using (FormTypeSelect form = new FormTypeSelect())
+ {
+ form.btnItem2.Enabled = false;
+ form.btnItem3.Enabled = false;
+ form.btnItem6.Enabled = false;
+ form.btnItem7.Enabled = false;
+ if (form.ShowDialog() != System.Windows.Forms.DialogResult.OK) { return; }
+ type = form.ReportType;
+ }
+ }
+ else
+ {
+ type = (ReportType)rptType;
+ }
+
+ IReport report = null;
+ if (type == ReportType.Print) { report = new FormReport(rptList, ownerArea, paper, title); }
+
+ if (report == null) { return; }
+ report.Output();
+ report.Dispose();
+ }
+
+ public static int SelectType()
+ {
+ ReportType type = ReportType.Print;
+ using (FormTypeSelect form = new FormTypeSelect())
+ {
+ form.btnItem2.Enabled = false;
+ form.btnItem3.Enabled = false;
+ form.btnItem6.Enabled = false;
+ form.btnItem7.Enabled = false;
+ if (form.ShowDialog() != System.Windows.Forms.DialogResult.OK) { return -1; }
+ type = form.ReportType;
+ }
+ return (int)type;
+ }
+
+ }
+}
diff --git a/HotelPms.Share.Windows/Report/RowStyle.cs b/HotelPms.Share.Windows/Report/RowStyle.cs
new file mode 100644
index 0000000..753b357
--- /dev/null
+++ b/HotelPms.Share.Windows/Report/RowStyle.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+
+namespace HotelPms.Share.Windows.Report
+{
+ public class RowStyle : OutputStyle
+ {
+
+ }
+}
diff --git a/HotelPms.Share.Windows/Report/TrueFontFactory.cs b/HotelPms.Share.Windows/Report/TrueFontFactory.cs
new file mode 100644
index 0000000..ac1be8e
--- /dev/null
+++ b/HotelPms.Share.Windows/Report/TrueFontFactory.cs
@@ -0,0 +1,1084 @@
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Globalization;
+using System.IO;
+using System.Linq;
+using System.Runtime.InteropServices;
+using System.Text;
+
+namespace HotelPms.Share.Windows.Report
+{
+#pragma warning disable CS0649
+ public class TrueFontFactory
+ {
+ [StructLayout(LayoutKind.Sequential, Pack = 0x1)]
+ struct TT_OFFSET_TABLE
+ {
+ public ushort uMajorVersion;
+ public ushort uMinorVersion;
+ public ushort uNumOfTables;
+ public ushort uSearchRange;
+ public ushort uEntrySelector;
+ public ushort uRangeShift;
+ }
+ [StructLayout(LayoutKind.Sequential, Pack = 0x1)]
+ struct TT_TABLE_DIRECTORY
+ {
+ public char szTag1;
+ public char szTag2;
+ public char szTag3;
+ public char szTag4;
+ public uint uCheckSum; //Check sum
+ public uint uOffset; //Offset from beginning of file
+ public uint uLength; //length of the table in bytes
+ }
+ [StructLayout(LayoutKind.Sequential, Pack = 0x1)]
+ struct TT_NAME_TABLE_HEADER
+ {
+ public ushort uFSelector;
+ public ushort uNRCount;
+ public ushort uStorageOffset;
+ }
+ [StructLayout(LayoutKind.Sequential, Pack = 0x1)]
+ struct TT_NAME_RECORD
+ {
+ public ushort uPlatformID;
+ public ushort uEncodingID;
+ public ushort uLanguageID;
+ public ushort uNameID;
+ public ushort uStringLength;
+ public ushort uStringOffset;
+ }
+
+ private static TT_OFFSET_TABLE ttOffsetTable;
+ private static TT_TABLE_DIRECTORY tblDir;
+ private static TT_NAME_TABLE_HEADER ttNTHeader;
+ private static TT_NAME_RECORD ttNMRecord;
+
+ public static string GetEngName(string fontName)
+ {
+ ////InstalledFontCollectionオブジェクトの取得
+ //System.Drawing.Text.InstalledFontCollection InstalledFont = new System.Drawing.Text.InstalledFontCollection();
+
+ ////インストール済みフォントを取得してコンボボックスに表示する
+ //FontFamily[] FontFamilies = InstalledFont.Families;
+ //foreach (FontFamily f in FontFamilies)
+ //{
+ // string fontName = f.GetName(CultureInfo.GetCultureInfo("en-us").LCID);
+ // string aa = fontName + ".ttf";
+ // System.Diagnostics.Debug.WriteLine(f.Name + ":" + aa);
+ //}
+
+ FontFamily msp = new FontFamily(fontName);
+ return msp.GetName(CultureInfo.GetCultureInfo("en-us").LCID);
+ }
+
+ /// <summary>
+ /// 例:MS UI Gothic ⇒ C:\\WINDOWS\\Fonts\\msgothic.ttc,1
+ /// </summary>
+ /// <param name="fontName"></param>
+ /// <returns>filename,index</returns>
+ public static string GetFontFile(string fontName)
+ {
+ string root = Environment.GetFolderPath(Environment.SpecialFolder.Fonts);
+ string item = string.Empty;
+ string engName = GetEngName(fontName);
+
+ #region FontName(English) ⇒ FileName,Index
+
+ switch (engName)
+ {
+ case "Agency FB":
+ item = "AGENCYB.TTF,0";
+ break;
+ case "Algerian":
+ item = "ALGER.TTF,0";
+ break;
+ case "Book Antiqua":
+ item = "ANTQUAB.TTF,0";
+ break;
+ case "Arial":
+ item = "arial.ttf,0";
+ break;
+ case "Arial Narrow":
+ item = "ARIALN.TTF,0";
+ break;
+ case "Arial Unicode MS":
+ item = "ARIALUNI.TTF,0";
+ break;
+ case "Arial Black":
+ item = "ariblk.ttf,0";
+ break;
+ case "Arial Rounded MT Bold":
+ item = "ARLRDBD.TTF,0";
+ break;
+ case "Baskerville Old Face":
+ item = "BASKVILL.TTF,0";
+ break;
+ case "Bauhaus 93":
+ item = "BAUHS93.TTF,0";
+ break;
+ case "Bell MT":
+ item = "BELL.TTF,0";
+ break;
+ case "Bernard MT Condensed":
+ item = "BERNHC.TTF,0";
+ break;
+ case "Bodoni MT":
+ item = "BOD_B.TTF,0";
+ break;
+ case "Bodoni MT Black":
+ item = "BOD_BLAI.TTF,0";
+ break;
+ case "Bodoni MT Condensed":
+ item = "BOD_CB.TTF,0";
+ break;
+ case "Bodoni MT Poster Compressed":
+ item = "BOD_PSTC.TTF,0";
+ break;
+ case "Bookman Old Style":
+ item = "BOOKOS.TTF,0";
+ break;
+ case "Bradley Hand ITC":
+ item = "BRADHITC.TTF,0";
+ break;
+ case "Britannic Bold":
+ item = "BRITANIC.TTF,0";
+ break;
+ case "Berlin Sans FB":
+ item = "BRLNSB.TTF,0";
+ break;
+ case "Berlin Sans FB Demi":
+ item = "BRLNSDB.TTF,0";
+ break;
+ case "Broadway":
+ item = "BROADW.TTF,0";
+ break;
+ case "Brush Script MT":
+ item = "BRUSHSCI.TTF,0";
+ break;
+ case "Bookshelf Symbol 7":
+ item = "BSSYM7.TTF,0";
+ break;
+ case "Buxton Sketch":
+ item = "BuxtonSketch.ttf,0";
+ break;
+ case "Calibri":
+ item = "calibri.ttf,0";
+ break;
+ case "Calibri Light":
+ item = "calibril.ttf,0";
+ break;
+ case "Californian FB":
+ item = "CALIFB.TTF,0";
+ break;
+ case "Calisto MT":
+ item = "CALIST.TTF,0";
+ break;
+ case "Cambria":
+ item = "cambria.ttc,0";
+ break;
+ case "Cambria Math":
+ item = "cambria.ttc,1";
+ break;
+ case "Candara":
+ item = "Candara.ttf,0";
+ break;
+ case "Castellar":
+ item = "CASTELAR.TTF,0";
+ break;
+ case "Century Schoolbook":
+ item = "CENSCBK.TTF,0";
+ break;
+ case "Centaur":
+ item = "CENTAUR.TTF,0";
+ break;
+ case "Century":
+ item = "CENTURY.TTF,0";
+ break;
+ case "Chiller":
+ item = "CHILLER.TTF,0";
+ break;
+ case "Colonna MT":
+ item = "COLONNA.TTF,0";
+ break;
+ case "Comic Sans MS":
+ item = "comic.ttf,0";
+ break;
+ case "Consolas":
+ item = "consola.ttf,0";
+ break;
+ case "Constantia":
+ item = "constan.ttf,0";
+ break;
+ case "Cooper Black":
+ item = "COOPBL.TTF,0";
+ break;
+ case "Copperplate Gothic Bold":
+ item = "COPRGTB.TTF,0";
+ break;
+ case "Copperplate Gothic Light":
+ item = "COPRGTL.TTF,0";
+ break;
+ case "Corbel":
+ item = "corbel.ttf,0";
+ break;
+ case "Courier New":
+ item = "cour.ttf,0";
+ break;
+ case "Curlz MT":
+ item = "CURLZ___.TTF,0";
+ break;
+ case "DengXian":
+ item = "Deng.ttf,0";
+ break;
+ case "DengXian Light":
+ item = "Dengl.ttf,0";
+ break;
+ case "Ebrima":
+ item = "ebrima.ttf,0";
+ break;
+ case "Elephant":
+ item = "ELEPHNT.TTF,0";
+ break;
+ case "Engravers MT":
+ item = "ENGR.TTF,0";
+ break;
+ case "Eras Bold ITC":
+ item = "ERASBD.TTF,0";
+ break;
+ case "Eras Demi ITC":
+ item = "ERASDEMI.TTF,0";
+ break;
+ case "Eras Light ITC":
+ item = "ERASLGHT.TTF,0";
+ break;
+ case "Eras Medium ITC":
+ item = "ERASMD.TTF,0";
+ break;
+ case "Felix Titling":
+ item = "FELIXTI.TTF,0";
+ break;
+ case "Forte":
+ item = "FORTE.TTF,0";
+ break;
+ case "Franklin Gothic Book":
+ item = "FRABK.TTF,0";
+ break;
+ case "Franklin Gothic Demi":
+ item = "FRADM.TTF,0";
+ break;
+ case "Franklin Gothic Demi Cond":
+ item = "FRADMCN.TTF,0";
+ break;
+ case "Franklin Gothic Heavy":
+ item = "FRAHV.TTF,0";
+ break;
+ case "Franklin Gothic Medium":
+ item = "framd.ttf,0";
+ break;
+ case "Franklin Gothic Medium Cond":
+ item = "FRAMDCN.TTF,0";
+ break;
+ case "Freestyle Script":
+ item = "FREESCPT.TTF,0";
+ break;
+ case "French Script MT":
+ item = "FRSCRIPT.TTF,0";
+ break;
+ case "Footlight MT Light":
+ item = "FTLTLT.TTF,0";
+ break;
+ case "FZLanTingHeiS-UL-GB":
+ item = "FZLTCXHJW.TTF,0";
+ break;
+ case "Gabriola":
+ item = "Gabriola.ttf,0";
+ break;
+ case "Gadugi":
+ item = "gadugi.ttf,0";
+ break;
+ case "Garamond":
+ item = "GARA.TTF,0";
+ break;
+ case "Georgia":
+ item = "georgia.ttf,0";
+ break;
+ case "Gigi":
+ item = "GIGI.TTF,0";
+ break;
+ case "Gill Sans MT":
+ item = "GILBI___.TTF,0";
+ break;
+ case "Gill Sans MT Condensed":
+ item = "GILC____.TTF,0";
+ break;
+ case "Gill Sans Ultra Bold Condensed":
+ item = "GILLUBCD.TTF,0";
+ break;
+ case "Gill Sans Ultra Bold":
+ item = "GILSANUB.TTF,0";
+ break;
+ case "Gloucester MT Extra Condensed":
+ item = "GLECB.TTF,0";
+ break;
+ case "Gill Sans MT Ext Condensed Bold":
+ item = "GLSNECB.TTF,0";
+ break;
+ case "Century Gothic":
+ item = "GOTHIC.TTF,0";
+ break;
+ case "Goudy Old Style":
+ item = "GOUDOS.TTF,0";
+ break;
+ case "Goudy Stout":
+ item = "GOUDYSTO.TTF,0";
+ break;
+ case "Harlow Solid Italic":
+ item = "HARLOWSI.TTF,0";
+ break;
+ case "Harrington":
+ item = "HARNGTON.TTF,0";
+ break;
+ case "Haettenschweiler":
+ item = "HATTEN.TTF,0";
+ break;
+ case "HGGothicE":
+ item = "HGRGE.TTC,0";
+ break;
+ case "HGPGothicE":
+ item = "HGRGE.TTC,1";
+ break;
+ case "HGSGothicE":
+ item = "HGRGE.TTC,2";
+ break;
+ case "HGGothicM":
+ item = "HGRGM.TTC,0";
+ break;
+ case "HGPGothicM":
+ item = "HGRGM.TTC,1";
+ break;
+ case "HGSGothicM":
+ item = "HGRGM.TTC,2";
+ break;
+ case "HGGyoshotai":
+ item = "HGRGY.TTC,0";
+ break;
+ case "HGPGyoshotai":
+ item = "HGRGY.TTC,1";
+ break;
+ case "HGSGyoshotai":
+ item = "HGRGY.TTC,2";
+ break;
+ case "HGKyokashotai":
+ item = "HGRKK.TTC,0";
+ break;
+ case "HGPKyokashotai":
+ item = "HGRKK.TTC,1";
+ break;
+ case "HGSKyokashotai":
+ item = "HGRKK.TTC,2";
+ break;
+ case "HGMinchoB":
+ item = "HGRMB.TTC,0";
+ break;
+ case "HGPMinchoB":
+ item = "HGRMB.TTC,1";
+ break;
+ case "HGSMinchoB":
+ item = "HGRMB.TTC,2";
+ break;
+ case "HGMinchoE":
+ item = "HGRME.TTC,0";
+ break;
+ case "HGPMinchoE":
+ item = "HGRME.TTC,1";
+ break;
+ case "HGSMinchoE":
+ item = "HGRME.TTC,2";
+ break;
+ case "HGSoeiKakupoptai":
+ item = "HGRPP1.TTC,0";
+ break;
+ case "HGPSoeiKakupoptai":
+ item = "HGRPP1.TTC,1";
+ break;
+ case "HGSSoeiKakupoptai":
+ item = "HGRPP1.TTC,2";
+ break;
+ case "HGSoeiPresenceEB":
+ item = "HGRPRE.TTC,0";
+ break;
+ case "HGPSoeiPresenceEB":
+ item = "HGRPRE.TTC,1";
+ break;
+ case "HGSSoeiPresenceEB":
+ item = "HGRPRE.TTC,2";
+ break;
+ case "HGSoeiKakugothicUB":
+ item = "HGRSGU.TTC,0";
+ break;
+ case "HGPSoeiKakugothicUB":
+ item = "HGRSGU.TTC,1";
+ break;
+ case "HGSSoeiKakugothicUB":
+ item = "HGRSGU.TTC,2";
+ break;
+ case "HGSeikaishotaiPRO":
+ item = "HGRSKP.TTF,0";
+ break;
+ case "HGMaruGothicMPRO":
+ item = "HGRSMP.TTF,0";
+ break;
+ case "Microsoft Himalaya":
+ item = "himalaya.ttf,0";
+ break;
+ case "High Tower Text":
+ item = "HTOWERT.TTF,0";
+ break;
+ case "Impact":
+ item = "impact.ttf,0";
+ break;
+ case "Imprint MT Shadow":
+ item = "IMPRISHA.TTF,0";
+ break;
+ case "Informal Roman":
+ item = "INFROMAN.TTF,0";
+ break;
+ case "Blackadder ITC":
+ item = "ITCBLKAD.TTF,0";
+ break;
+ case "Edwardian Script ITC":
+ item = "ITCEDSCR.TTF,0";
+ break;
+ case "Kristen ITC":
+ item = "ITCKRIST.TTF,0";
+ break;
+ case "Javanese Text":
+ item = "javatext.ttf,0";
+ break;
+ case "Jokerman":
+ item = "JOKERMAN.TTF,0";
+ break;
+ case "Juice ITC":
+ item = "JUICE___.TTF,0";
+ break;
+ case "Kunstler Script":
+ item = "KUNSTLER.TTF,0";
+ break;
+ case "Wide Latin":
+ item = "LATINWD.TTF,0";
+ break;
+ case "Lucida Bright":
+ item = "LBRITE.TTF,0";
+ break;
+ case "Lucida Calligraphy":
+ item = "LCALLIG.TTF,0";
+ break;
+ case "Leelawadee UI":
+ item = "LeelaUIb.ttf,0";
+ break;
+ case "Leelawadee UI Semilight":
+ item = "LeelUIsl.ttf,0";
+ break;
+ case "Lucida Fax":
+ item = "LFAX.TTF,0";
+ break;
+ case "Lucida Handwriting":
+ item = "LHANDW.TTF,0";
+ break;
+ case "Lucida Sans":
+ item = "LSANS.TTF,0";
+ break;
+ case "Lucida Sans Typewriter":
+ item = "LTYPE.TTF,0";
+ break;
+ case "Lucida Console":
+ item = "lucon.ttf,0";
+ break;
+ case "Lucida Sans Unicode":
+ item = "l_10646.ttf,0";
+ break;
+ case "Magneto":
+ item = "MAGNETOB.TTF,0";
+ break;
+ case "Maiandra GD":
+ item = "MAIAN.TTF,0";
+ break;
+ case "Malgun Gothic":
+ item = "malgun.ttf,0";
+ break;
+ case "Malgun Gothic Semilight":
+ item = "malgunsl.ttf,0";
+ break;
+ case "Marlett":
+ item = "marlett.ttf,0";
+ break;
+ case "Matura MT Script Capitals":
+ item = "MATURASC.TTF,0";
+ break;
+ case "Meiryo":
+ item = "meiryo.ttc,0";
+ break;
+ case "Meiryo UI":
+ item = "meiryo.ttc,2";
+ break;
+ case "Microsoft Sans Serif":
+ item = "micross.ttf,0";
+ break;
+ case "MingLiU-ExtB":
+ item = "mingliub.ttc,0";
+ break;
+ case "PMingLiU-ExtB":
+ item = "mingliub.ttc,1";
+ break;
+ case "MingLiU_HKSCS-ExtB":
+ item = "mingliub.ttc,2";
+ break;
+ case "Mistral":
+ item = "MISTRAL.TTF,0";
+ break;
+ case "Myanmar Text":
+ item = "mmrtext.ttf,0";
+ break;
+ case "Modern No. 20":
+ item = "MOD20.TTF,0";
+ break;
+ case "Mongolian Baiti":
+ item = "monbaiti.ttf,0";
+ break;
+ case "MS Gothic":
+ item = "msgothic.ttc,0";
+ break;
+ case "MS UI Gothic":
+ item = "msgothic.ttc,1";
+ break;
+ case "MS PGothic":
+ item = "msgothic.ttc,2";
+ break;
+ case "微軟正黑體":
+ item = "msjh.ttc,0";
+ break;
+ case "Microsoft JhengHei UI":
+ item = "msjh.ttc,1";
+ break;
+ case "微軟正黑體 Light":
+ item = "msjhl.ttc,0";
+ break;
+ case "Microsoft JhengHei UI Light":
+ item = "msjhl.ttc,1";
+ break;
+ case "Microsoft MHei":
+ item = "MSMHei-Bold.ttf,0";
+ break;
+ case "MS Mincho":
+ item = "msmincho.ttc,0";
+ break;
+ case "MS PMincho":
+ item = "msmincho.ttc,1";
+ break;
+ case "Microsoft NeoGothic":
+ item = "MSNeoGothic-Bold.ttf,0";
+ break;
+ case "Microsoft YaHei":
+ item = "msyh.ttc,0";
+ break;
+ case "Microsoft YaHei UI":
+ item = "msyh.ttc,1";
+ break;
+ case "Microsoft YaHei Light":
+ item = "msyhl.ttc,0";
+ break;
+ case "Microsoft YaHei UI Light":
+ item = "msyhl.ttc,1";
+ break;
+ case "Microsoft Yi Baiti":
+ item = "msyi.ttf,0";
+ break;
+ case "Monotype Corsiva":
+ item = "MTCORSVA.TTF,0";
+ break;
+ case "MV Boli":
+ item = "mvboli.ttf,0";
+ break;
+ case "Niagara Engraved":
+ item = "NIAGENG.TTF,0";
+ break;
+ case "Niagara Solid":
+ item = "NIAGSOL.TTF,0";
+ break;
+ case "Nina":
+ item = "nina.ttf,0";
+ break;
+ case "Nirmala UI":
+ item = "Nirmala.ttf,0";
+ break;
+ case "Nirmala UI Semilight":
+ item = "NirmalaS.ttf,0";
+ break;
+ case "Microsoft New Tai Lue":
+ item = "ntailu.ttf,0";
+ break;
+ case "OCR A Extended":
+ item = "OCRAEXT.TTF,0";
+ break;
+ case "OCRB":
+ item = "OCRB.TTF,0";
+ break;
+ case "OCR-B-10 BT":
+ item = "OCRB10N.TTF,0";
+ break;
+ case "Old English Text MT":
+ item = "OLDENGL.TTF,0";
+ break;
+ case "Onyx":
+ item = "ONYX.TTF,0";
+ break;
+ case "MS Outlook":
+ item = "OUTLOOK.TTF,0";
+ break;
+ case "Palatino Linotype":
+ item = "pala.ttf,0";
+ break;
+ case "Palace Script MT":
+ item = "PALSCRI.TTF,0";
+ break;
+ case "Papyrus":
+ item = "PAPYRUS.TTF,0";
+ break;
+ case "Parchment":
+ item = "PARCHM.TTF,0";
+ break;
+ case "Perpetua":
+ item = "PERBI___.TTF,0";
+ break;
+ case "Perpetua Titling MT":
+ item = "PERTIBD.TTF,0";
+ break;
+ case "Microsoft PhagsPa":
+ item = "phagspa.ttf,0";
+ break;
+ case "Playbill":
+ item = "PLAYBILL.TTF,0";
+ break;
+ case "Poor Richard":
+ item = "POORICH.TTF,0";
+ break;
+ case "Pristina":
+ item = "PRISTINA.TTF,0";
+ break;
+ case "Rage Italic":
+ item = "RAGE.TTF,0";
+ break;
+ case "Ravie":
+ item = "RAVIE.TTF,0";
+ break;
+ case "MS Reference Sans Serif":
+ item = "REFSAN.TTF,0";
+ break;
+ case "MS Reference Specialty":
+ item = "REFSPCL.TTF,0";
+ break;
+ case "Rockwell Condensed":
+ item = "ROCCB___.TTF,0";
+ break;
+ case "Rockwell":
+ item = "ROCK.TTF,0";
+ break;
+ case "Rockwell Extra Bold":
+ item = "ROCKEB.TTF,0";
+ break;
+ case "Script MT Bold":
+ item = "SCRIPTBL.TTF,0";
+ break;
+ case "Segoe MDL2 Assets":
+ item = "segmdl2.ttf,0";
+ break;
+ case "Segoe Marker":
+ item = "SegoeMarker.ttf,0";
+ break;
+ case "Segoe Print":
+ item = "segoepr.ttf,0";
+ break;
+ case "Segoe Script":
+ item = "segoesc.ttf,0";
+ break;
+ case "Segoe UI":
+ item = "segoeui.ttf,0";
+ break;
+ case "Segoe UI Light":
+ item = "segoeuil.ttf,0";
+ break;
+ case "Segoe UI Semilight":
+ item = "segoeuisl.ttf,0";
+ break;
+ case "Segoe WP Black":
+ item = "SegoeWP-Black.ttf,0";
+ break;
+ case "Segoe WP":
+ item = "SegoeWP-Bold.ttf,0";
+ break;
+ case "Segoe WP Light":
+ item = "SegoeWP-Light.ttf,0";
+ break;
+ case "Segoe WP Semibold":
+ item = "SegoeWP-Semibold.ttf,0";
+ break;
+ case "Segoe WP SemiLight":
+ item = "SegoeWP-Semilight.ttf,0";
+ break;
+ case "Segoe UI Black":
+ item = "seguibl.ttf,0";
+ break;
+ case "Segoe UI Emoji":
+ item = "seguiemj.ttf,0";
+ break;
+ case "Segoe UI Historic":
+ item = "seguihis.ttf,0";
+ break;
+ case "Segoe UI Semibold":
+ item = "seguisb.ttf,0";
+ break;
+ case "Segoe UI Symbol":
+ item = "seguisym.ttf,0";
+ break;
+ case "Showcard Gothic":
+ item = "SHOWG.TTF,0";
+ break;
+ case "FangSong":
+ item = "simfang.ttf,0";
+ break;
+ case "SimHei":
+ item = "simhei.ttf,0";
+ break;
+ case "KaiTi":
+ item = "simkai.ttf,0";
+ break;
+ case "SimSun":
+ item = "simsun.ttc,0";
+ break;
+ case "NSimSun":
+ item = "simsun.ttc,1";
+ break;
+ case "SimSun-ExtB":
+ item = "simsunb.ttf,0";
+ break;
+ case "Sitka Small":
+ item = "Sitka.ttc,0";
+ break;
+ case "Sitka Text":
+ item = "Sitka.ttc,1";
+ break;
+ case "Sitka Subheading":
+ item = "Sitka.ttc,2";
+ break;
+ case "Sitka Heading":
+ item = "Sitka.ttc,3";
+ break;
+ case "Sitka Display":
+ item = "Sitka.ttc,4";
+ break;
+ case "Sitka Banner":
+ item = "Sitka.ttc,5";
+ break;
+ case "SketchFlow Print":
+ item = "SketchFlow Print.ttf,0";
+ break;
+ case "Snap ITC":
+ item = "SNAP____.TTF,0";
+ break;
+ case "Stencil":
+ item = "STENCIL.TTF,0";
+ break;
+ case "Sylfaen":
+ item = "sylfaen.ttf,0";
+ break;
+ case "Symbol":
+ item = "symbol.ttf,0";
+ break;
+ case "Tahoma":
+ item = "tahoma.ttf,0";
+ break;
+ case "Microsoft Tai Le":
+ item = "taile.ttf,0";
+ break;
+ case "Tw Cen MT":
+ item = "TCBI____.TTF,0";
+ break;
+ case "Tw Cen MT Condensed":
+ item = "TCCB____.TTF,0";
+ break;
+ case "Tw Cen MT Condensed Extra Bold":
+ item = "TCCEB.TTF,0";
+ break;
+ case "Tempus Sans ITC":
+ item = "TEMPSITC.TTF,0";
+ break;
+ case "Times New Roman":
+ item = "times.ttf,0";
+ break;
+ case "Trebuchet MS":
+ item = "trebuc.ttf,0";
+ break;
+ case "Verdana":
+ item = "verdana.ttf,0";
+ break;
+ case "Viner Hand ITC":
+ item = "VINERITC.TTF,0";
+ break;
+ case "Vivaldi":
+ item = "VIVALDII.TTF,0";
+ break;
+ case "Vladimir Script":
+ item = "VLADIMIR.TTF,0";
+ break;
+ case "Webdings":
+ item = "webdings.ttf,0";
+ break;
+ case "Wingdings":
+ item = "wingding.ttf,0";
+ break;
+ case "Wingdings 2":
+ item = "WINGDNG2.TTF,0";
+ break;
+ case "Wingdings 3":
+ item = "WINGDNG3.TTF,0";
+ break;
+ case "Yu Gothic":
+ item = "YuGothB.ttc,0";
+ break;
+ case "Yu Gothic UI":
+ item = "YuGothB.ttc,1";
+ break;
+ case "Yu Gothic UI Semibold":
+ item = "YuGothB.ttc,2";
+ break;
+ case "Yu Gothic Light":
+ item = "YuGothL.ttc,0";
+ break;
+ case "Yu Gothic UI Light":
+ item = "YuGothL.ttc,1";
+ break;
+ case "Yu Gothic Medium":
+ item = "YuGothM.ttc,0";
+ break;
+ case "Yu Gothic UI Semilight":
+ item = "YuGothR.ttc,1";
+ break;
+ case "Yu Mincho":
+ item = "yumin.ttf,0";
+ break;
+ case "Yu Mincho Demibold":
+ item = "yumindb.ttf,0";
+ break;
+ case "Yu Mincho Light":
+ item = "yuminl.ttf,0";
+ break;
+ }
+
+ #endregion
+
+ return root + Path.DirectorySeparatorChar + item;
+ }
+
+
+ /// <summary>
+ /// FontName(English) ⇒ FileName,Index
+ /// </summary>
+ /// <returns></returns>
+ public static Dictionary<string, string> GetFontFileDict()
+ {
+ Dictionary<string, string> dict = new Dictionary<string, string>();
+ string root = Environment.GetFolderPath(Environment.SpecialFolder.Fonts);
+ string[] files = Directory.GetFiles(root);
+ foreach(string item in files)
+ {
+ if ((item.ToLower(System.Globalization.CultureInfo.InvariantCulture).EndsWith(".ttf") || item.ToLower(System.Globalization.CultureInfo.InvariantCulture).EndsWith(".otf") || item.ToLower(System.Globalization.CultureInfo.InvariantCulture).EndsWith(".ttc")))
+ {
+ List<string> list = GetFontName(item);
+ if (list == null) { continue; }
+ for (int i = 0; i < list.Count; i++)
+ {
+ if (dict.ContainsKey(list[i])) { continue; }
+ dict.Add(list[i], string.Format("{0},{1}", item, i));
+ //System.Diagnostics.Debug.WriteLine("case \"" + list[i] + "\":");
+ //System.Diagnostics.Debug.WriteLine(" item = \"" + string.Format("{0},{1}", Path.GetFileName(item), i) + "\";");
+ //System.Diagnostics.Debug.WriteLine(" break;");
+ }
+ }
+ }
+ return dict;
+ }
+
+
+ public static List<string> GetFontName(string file)
+ {
+ try
+ {
+ List<string> list = new List<string>();
+ bool isMulti = false;
+ if (file.ToLower(System.Globalization.CultureInfo.InvariantCulture).EndsWith(".ttc")) { isMulti = true; }
+
+ using (FileStream fs = new FileStream(file, FileMode.Open, FileAccess.Read))
+ {
+ using (BinaryReader r = new BinaryReader(fs))
+ {
+ List<int> offsetList = new List<int>();
+
+ if (isMulti)
+ {
+ byte[] buffH = r.ReadBytes(4); //ttcf
+ buffH = r.ReadBytes(4); //Skip
+ int dirCount = ReadInt(r.ReadBytes(4));
+ for (int i = 0; i < dirCount; i++)
+ {
+ offsetList.Add(ReadInt(r.ReadBytes(4)));
+ }
+ }
+ else
+ {
+ offsetList.Add(0);
+ }
+
+ foreach (int directoryOffset in offsetList)
+ {
+ if (isMulti) { fs.Seek(directoryOffset, SeekOrigin.Begin); }
+
+ byte[] buff = r.ReadBytes(Marshal.SizeOf(ttOffsetTable));
+ buff = BigEndian(buff);
+ IntPtr ptr = Marshal.AllocHGlobal(buff.Length);
+ Marshal.Copy(buff, 0x0, ptr, buff.Length);
+ TT_OFFSET_TABLE ttResult = (TT_OFFSET_TABLE)Marshal.PtrToStructure(ptr, typeof(TT_OFFSET_TABLE));
+ Marshal.FreeHGlobal(ptr);
+ //Must be maj =1 minor = 0
+ if (ttResult.uMajorVersion != 1 || ttResult.uMinorVersion != 0) { return null; }
+
+ bool bFound = false;
+ TT_TABLE_DIRECTORY tbName = new TT_TABLE_DIRECTORY();
+ for (int i = 0; i < ttResult.uNumOfTables; i++)
+ {
+ byte[] bNameTable = r.ReadBytes(Marshal.SizeOf(tblDir));
+ IntPtr ptrName = Marshal.AllocHGlobal(bNameTable.Length);
+ Marshal.Copy(bNameTable, 0x0, ptrName, bNameTable.Length);
+ tbName = (TT_TABLE_DIRECTORY)Marshal.PtrToStructure(ptrName, typeof(TT_TABLE_DIRECTORY));
+ Marshal.FreeHGlobal(ptrName);
+ string szName = tbName.szTag1.ToString() + tbName.szTag2.ToString() + tbName.szTag3.ToString() + tbName.szTag4.ToString();
+ if (szName == null) { continue; }
+ if (szName.ToString() != "name") { continue; }
+
+ bFound = true;
+ byte[] btLength = BitConverter.GetBytes(tbName.uLength);
+ byte[] btOffset = BitConverter.GetBytes(tbName.uOffset);
+ Array.Reverse(btLength);
+ Array.Reverse(btOffset);
+ tbName.uLength = BitConverter.ToUInt32(btLength, 0);
+ tbName.uOffset = BitConverter.ToUInt32(btOffset, 0);
+ break;
+ }
+
+ //名称取得
+ if (bFound) { AddName(list, fs, r, ref tbName); }
+ }
+ }
+ }
+ return list;
+ }
+ catch
+ {
+ return null;
+ }
+ }
+
+ private static void AddName(List<string> list, FileStream fs, BinaryReader r, ref TT_TABLE_DIRECTORY tbName)
+ {
+ fs.Position = tbName.uOffset;
+ byte[] btNTHeader = r.ReadBytes(Marshal.SizeOf(ttNTHeader));
+ btNTHeader = BigEndian(btNTHeader);
+ IntPtr ptrNTHeader = Marshal.AllocHGlobal(btNTHeader.Length);
+ Marshal.Copy(btNTHeader, 0x0, ptrNTHeader, btNTHeader.Length);
+ TT_NAME_TABLE_HEADER ttNTResult = (TT_NAME_TABLE_HEADER)Marshal.PtrToStructure(ptrNTHeader, typeof(TT_NAME_TABLE_HEADER));
+ Marshal.FreeHGlobal(ptrNTHeader);
+ for (int i = 0; i < ttNTResult.uNRCount; i++)
+ {
+ byte[] btNMRecord = r.ReadBytes(Marshal.SizeOf(ttNMRecord));
+ btNMRecord = BigEndian(btNMRecord);
+ IntPtr ptrNMRecord = Marshal.AllocHGlobal(btNMRecord.Length);
+ Marshal.Copy(btNMRecord, 0x0, ptrNMRecord, btNMRecord.Length);
+ TT_NAME_RECORD ttNMResult = (TT_NAME_RECORD)Marshal.PtrToStructure(ptrNMRecord, typeof(TT_NAME_RECORD));
+ Marshal.FreeHGlobal(ptrNMRecord);
+ if (ttNMResult.uNameID == 1)
+ {
+ long fPos = fs.Position;
+ fs.Position = tbName.uOffset + ttNMResult.uStringOffset + ttNTResult.uStorageOffset;
+ byte[] szResult = r.ReadBytes(ttNMResult.uStringLength);
+ if (szResult.Length != 0)
+ {
+ string name;
+ if (ttNMResult.uPlatformID == 0 || ttNMResult.uPlatformID == 3 || (ttNMResult.uPlatformID == 2 && ttNMResult.uEncodingID == 1))
+ {
+ name = ReadUnicodeString(szResult);
+ }
+ else
+ {
+ name = System.Text.Encoding.Default.GetString(szResult);
+ }
+ list.Add(name);
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// 反転
+ /// </summary>
+ /// <param name="bLittle"></param>
+ /// <returns></returns>
+ private static byte[] BigEndian(byte[] bLittle)
+ {
+ byte[] bBig = new byte[bLittle.Length];
+ for (int y = 0; y < (bLittle.Length - 1); y += 2)
+ {
+ byte b1, b2;
+ b1 = bLittle[y];
+ b2 = bLittle[y + 1];
+ bBig[y] = b2;
+ bBig[y + 1] = b1;
+ }
+ return bBig;
+ }
+
+ private static int ReadInt(byte[] buff)
+ {
+ int ch1 = buff[0];
+ int ch2 = buff[1];
+ int ch3 = buff[2];
+ int ch4 = buff[3];
+ if ((ch1 | ch2 | ch3 | ch4) < 0)
+ throw new EndOfStreamException();
+ return ((ch1 << 24) + (ch2 << 16) + (ch3 << 8) + ch4);
+ }
+
+ private static char ReadChar(byte[] buff)
+ {
+ int ch1 = buff[0];
+ int ch2 = buff[1];
+ if ((ch1 | ch2) < 0)
+ throw new EndOfStreamException();
+ return (char)((ch1 << 8) + ch2);
+ }
+
+ private static string ReadUnicodeString(byte[] buff)
+ {
+ StringBuilder buf = new StringBuilder();
+ int length = buff.Length / 2;
+ for (int k = 0; k < length; ++k)
+ {
+ byte[] item = new byte[2];
+ Array.Copy(buff, k * 2, item, 0, 2);
+ buf.Append(ReadChar(item));
+ }
+ return buf.ToString();
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/Resources/load.gif b/HotelPms.Share.Windows/Resources/load.gif
new file mode 100644
index 0000000..150507d
--- /dev/null
+++ b/HotelPms.Share.Windows/Resources/load.gif
Binary files differ
diff --git a/HotelPms.Share.Windows/Service/MonitorSetting.cs b/HotelPms.Share.Windows/Service/MonitorSetting.cs
new file mode 100644
index 0000000..71673ac
--- /dev/null
+++ b/HotelPms.Share.Windows/Service/MonitorSetting.cs
@@ -0,0 +1,73 @@
+using HotelPms.Share.IO;
+using HotelPms.Share.Util;
+using System;
+using System.Windows.Forms;
+
+namespace HotelPms.Share.Windows.Service
+{
+ public class MonitorSetting : DictionarySetting
+ {
+ public enum SettingKey : int
+ {
+ /// <summary>
+ /// 0.ClientSide 1.ServerSide
+ /// </summary>
+ ServiceType,
+ Port,
+ }
+
+ private static MonitorSetting m_Instance = null;
+
+ public static MonitorSetting Instance { get { return m_Instance; } }
+
+ /// <summary>
+ /// アプリケーションの初期化
+ /// </summary>
+ /// <returns></returns>
+ public static bool Initialize()
+ {
+ try
+ {
+ m_Instance = new MonitorSetting();
+ m_Instance.FileName = Application.StartupPath + @"\MonitorSetting.json";
+ m_Instance.Load();
+ return true;
+ }
+ catch (Exception ex)
+ {
+ OperationLog.Instance.WriteLog($"MonitorSetting.Initialize異常エラー:{ex.Message}");
+ return false;
+ }
+ }
+
+ public static void Dispose()
+ {
+ }
+
+ public override void SetDefault()
+ {
+ if (!Data.ContainsKey(SettingKey.ServiceType.ToString())) { Data.Add(SettingKey.ServiceType.ToString(), "0"); }
+ if (!Data.ContainsKey(SettingKey.Port.ToString())) { Data.Add(SettingKey.Port.ToString(), "46498"); }
+ }
+
+ /// <summary>
+ /// Windows起動時実行
+ /// </summary>
+ public static void SetStartUpRun()
+ {
+ try
+ {
+ //Runキーを開く
+ using (Microsoft.Win32.RegistryKey regkey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run", true))
+ {
+ if (regkey == null) { return; }
+ //値の名前に製品名、値のデータに実行ファイルのパスを指定し、書き込む
+ regkey.SetValue(Application.ProductName, Application.ExecutablePath);
+ //閉じる
+ regkey.Close();
+ }
+ }
+ catch { }
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/Service/Setting.cs b/HotelPms.Share.Windows/Service/Setting.cs
new file mode 100644
index 0000000..3e56abc
--- /dev/null
+++ b/HotelPms.Share.Windows/Service/Setting.cs
@@ -0,0 +1,73 @@
+using HotelPms.Share.IO;
+using HotelPms.Share.Util;
+using System;
+using System.Windows.Forms;
+
+namespace HotelPms.Share.Windows.Service
+{
+ public class Setting : DictionarySetting
+ {
+ public enum SettingKey : int
+ {
+ ServiceFullPath,
+ ServiceName,
+ DispName,
+ Description,
+ Port,
+ SignalUrl,
+ }
+
+ private static Setting m_Instance;
+ public static Setting Instance { get { return m_Instance; } }
+
+ /// <summary>
+ /// 0.ClientSide 1.ServerSide
+ /// </summary>
+ public int ServiceType { get; set; } = 0;
+
+ /// <summary>
+ /// アプリケーションの初期化
+ /// </summary>
+ /// <returns></returns>
+ public static bool Initialize(int type)
+ {
+ try
+ {
+ m_Instance = new Setting();
+ m_Instance.FileName = Application.StartupPath + @"\ServiceSetting.json";
+ m_Instance.ServiceType = type;
+ m_Instance.Load();
+ return true;
+ }
+ catch (Exception ex)
+ {
+ OperationLog.Instance.WriteLog($"Setting.Initialize異常エラー:{ex.Message}");
+ return false;
+ }
+ }
+
+ public static void Dispose()
+ {
+ }
+
+ public override void SetDefault()
+ {
+ if (ServiceType == 0)
+ {
+ if (!Data.ContainsKey(SettingKey.ServiceName.ToString())) { Data.Add(SettingKey.ServiceName.ToString(), "HotelPms.Service.Client"); }
+ if (!Data.ContainsKey(SettingKey.ServiceFullPath.ToString())) { Data.Add(SettingKey.ServiceFullPath.ToString(), @"D:\Develop\Src\Cs\L2Soft\HotelPms\HotelPms.Service.Client\bin\Debug\net5.0-windows\HotelPms.Service.Client.exe"); }
+ if (!Data.ContainsKey(SettingKey.DispName.ToString())) { Data.Add(SettingKey.DispName.ToString(), "HotelPms_ClientSide"); }
+ if (!Data.ContainsKey(SettingKey.Description.ToString())) { Data.Add(SettingKey.Description.ToString(), "HotelPmsクライアント連動制御"); }
+ }
+ else
+ {
+ if (!Data.ContainsKey(SettingKey.ServiceName.ToString())) { Data.Add(SettingKey.ServiceName.ToString(), "HotelPms.Service.Server"); }
+ if (!Data.ContainsKey(SettingKey.ServiceFullPath.ToString())) { Data.Add(SettingKey.ServiceFullPath.ToString(), @"D:\Develop\Src\Cs\L2Soft\HotelPms\HotelPms.Service.Server\bin\Debug\net5.0-windows\HotelPms.Service.Server.exe"); }
+ if (!Data.ContainsKey(SettingKey.DispName.ToString())) { Data.Add(SettingKey.DispName.ToString(), "HotelPms_ServerSide"); }
+ if (!Data.ContainsKey(SettingKey.Description.ToString())) { Data.Add(SettingKey.Description.ToString(), "HotelPmsサーバー連動制御"); }
+ }
+ if (!Data.ContainsKey(SettingKey.Port.ToString())) { Data.Add(SettingKey.Port.ToString(), "46499"); }
+ if (!Data.ContainsKey(SettingKey.SignalUrl.ToString())) { Data.Add(SettingKey.SignalUrl.ToString(), "https://localhost:44375/notifyhub"); }
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/Tool/CalendarSelector.Designer.cs b/HotelPms.Share.Windows/Tool/CalendarSelector.Designer.cs
new file mode 100644
index 0000000..35929ea
--- /dev/null
+++ b/HotelPms.Share.Windows/Tool/CalendarSelector.Designer.cs
@@ -0,0 +1,112 @@
+using HotelPms.Share.Windows.Component;
+
+namespace HotelPms.Share.Windows.Tool
+{
+ partial class CalendarSelector
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.calendar1 = new HotelPms.Share.Windows.Component.Calendar();
+ this.pnlMain.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // LoadingObj
+ //
+ this.LoadingObj.Size = new System.Drawing.Size(558, 596);
+ //
+ // pnlMain
+ //
+ this.pnlMain.Controls.Add(this.calendar1);
+ this.pnlMain.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+ this.pnlMain.Size = new System.Drawing.Size(558, 596);
+ //
+ // calendar1
+ //
+ this.calendar1.ButtonBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
+ this.calendar1.ButtonDownColor = System.Drawing.Color.Black;
+ this.calendar1.ButtonFont = new System.Drawing.Font("メイリオ", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.calendar1.ButtonForeColor = System.Drawing.Color.White;
+ this.calendar1.ButtonOverColor = System.Drawing.Color.Gray;
+ this.calendar1.DayBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(245)))), ((int)(((byte)(210)))));
+ this.calendar1.DayDownColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
+ this.calendar1.DayFont = new System.Drawing.Font("メイリオ", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.calendar1.DayForeColor = System.Drawing.Color.Black;
+ this.calendar1.DayOverColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
+ this.calendar1.DayStyle = HotelPms.Share.Windows.Component.Calendar.DayStyleType.Row4;
+ this.calendar1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.calendar1.Format = "yyyy/MM/dd";
+ this.calendar1.HolidayFont = new System.Drawing.Font("メイリオ", 7F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.calendar1.HolidayForeColor = System.Drawing.Color.Red;
+ this.calendar1.Language = HotelPms.Share.Windows.Component.Calendar.LanguageType.Japanese;
+ this.calendar1.Location = new System.Drawing.Point(0, 0);
+ this.calendar1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+ this.calendar1.MemoFont = new System.Drawing.Font("メイリオ", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.calendar1.MemoForeColor = System.Drawing.Color.Black;
+ this.calendar1.MonthFont = new System.Drawing.Font("メイリオ", 36F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.calendar1.MonthForeColor = System.Drawing.Color.Purple;
+ this.calendar1.Name = "calendar1";
+ this.calendar1.RokuyouFont = new System.Drawing.Font("メイリオ", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.calendar1.RokuyouForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(64)))), ((int)(((byte)(0)))));
+ this.calendar1.RokuyouVisible = true;
+ this.calendar1.SelDayBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+ this.calendar1.SelectDateFont = new System.Drawing.Font("メイリオ", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.calendar1.SelectDateForeColor = System.Drawing.Color.Navy;
+ this.calendar1.ShowStyle = HotelPms.Share.Windows.Component.Calendar.ShowStyleType.TreeMonth;
+ this.calendar1.Size = new System.Drawing.Size(558, 596);
+ this.calendar1.SmallFont = new System.Drawing.Font("メイリオ", 7F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.calendar1.SmallYearFont = new System.Drawing.Font("メイリオ", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.calendar1.SmallYearForeColor = System.Drawing.Color.Black;
+ this.calendar1.TabIndex = 0;
+ this.calendar1.Text = "2019/06/20";
+ this.calendar1.Value = new System.DateTime(2019, 6, 20, 0, 0, 0, 0);
+ this.calendar1.WeekBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
+ this.calendar1.WeekFont = new System.Drawing.Font("メイリオ", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.calendar1.WeekForeColor = System.Drawing.Color.White;
+ this.calendar1.YearFont = new System.Drawing.Font("メイリオ", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.calendar1.YearForeColor = System.Drawing.Color.Purple;
+ this.calendar1.DayCellFormat += new HotelPms.Share.Windows.Component.CalendarEventHandler(this.Calendar1_DayCellFormat);
+ this.calendar1.DateSelect += new HotelPms.Share.Windows.Component.CalendarEventHandler(this.Calendar1_DateSelect);
+ //
+ // CalendarSelector
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(560, 633);
+ this.Margin = new System.Windows.Forms.Padding(7, 8, 7, 8);
+ this.Name = "CalendarSelector";
+ this.Text = "日期选择";
+ this.Load += new System.EventHandler(this.CalendarSelector_Load);
+ this.pnlMain.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private Calendar calendar1;
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.Share.Windows/Tool/CalendarSelector.cs b/HotelPms.Share.Windows/Tool/CalendarSelector.cs
new file mode 100644
index 0000000..4e89f02
--- /dev/null
+++ b/HotelPms.Share.Windows/Tool/CalendarSelector.cs
@@ -0,0 +1,55 @@
+using HotelPms.Share.Util;
+using HotelPms.Share.Windows.Component;
+using HotelPms.Share.Windows.Util;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace HotelPms.Share.Windows.Tool
+{
+ public partial class CalendarSelector : FormBase
+ {
+ public DateTime SelDate { get; set; } = DateTime.Now;
+ public Control OwnerControl { get; set; } = null;
+
+ public CalendarSelector(Control obj)
+ {
+ InitializeComponent();
+ OwnerControl = obj;
+ }
+
+ private void Calendar1_DateSelect(object sender, CalendarEventArgs e)
+ {
+ SelDate = calendar1.Value;
+ OwnerControl.Text = calendar1.Text;
+ this.DialogResult = DialogResult.OK;
+ }
+
+ private void CalendarSelector_Load(object sender, EventArgs e)
+ {
+ calendar1.Value = CConvert.ToDateTime(OwnerControl.Text);
+ //Point location = this.Location;
+ //GeneralSub.GetLocationToScreen(OwnerControl, ref location);
+ //this.Location = location;
+ }
+
+ public static DialogResult Execute(Control obj)
+ {
+ using (CalendarSelector form = new CalendarSelector(obj))
+ {
+ return form.ShowDialog();
+ }
+ }
+
+ private void Calendar1_DayCellFormat(object sender, CalendarEventArgs e)
+ {
+ if (e.DateValue.ToString("MMdd") == "0101") { e.Holiday = "元旦"; }
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/Tool/CalendarSelector.resx b/HotelPms.Share.Windows/Tool/CalendarSelector.resx
new file mode 100644
index 0000000..f298a7b
--- /dev/null
+++ b/HotelPms.Share.Windows/Tool/CalendarSelector.resx
@@ -0,0 +1,60 @@
+<root>
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root>
\ No newline at end of file
diff --git a/HotelPms.Share.Windows/Tool/CalendarSelectorOne.Designer.cs b/HotelPms.Share.Windows/Tool/CalendarSelectorOne.Designer.cs
new file mode 100644
index 0000000..53d4186
--- /dev/null
+++ b/HotelPms.Share.Windows/Tool/CalendarSelectorOne.Designer.cs
@@ -0,0 +1,113 @@
+using HotelPms.Share.Windows.Component;
+
+namespace HotelPms.Share.Windows.Tool
+{
+ partial class CalendarSelectorOne
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.calendar1 = new HotelPms.Share.Windows.Component.Calendar();
+ this.pnlMain.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // LoadingObj
+ //
+ this.LoadingObj.Size = new System.Drawing.Size(393, 377);
+ //
+ // pnlMain
+ //
+ this.pnlMain.Controls.Add(this.calendar1);
+ this.pnlMain.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+ this.pnlMain.Size = new System.Drawing.Size(393, 377);
+ //
+ // calendar1
+ //
+ this.calendar1.ButtonBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
+ this.calendar1.ButtonDownColor = System.Drawing.Color.Black;
+ this.calendar1.ButtonFont = new System.Drawing.Font("メイリオ", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.calendar1.ButtonForeColor = System.Drawing.Color.White;
+ this.calendar1.ButtonOverColor = System.Drawing.Color.Gray;
+ this.calendar1.DayBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(245)))), ((int)(((byte)(210)))));
+ this.calendar1.DayDownColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
+ this.calendar1.DayFont = new System.Drawing.Font("メイリオ", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.calendar1.DayForeColor = System.Drawing.Color.Black;
+ this.calendar1.DayOverColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
+ this.calendar1.DayStyle = HotelPms.Share.Windows.Component.Calendar.DayStyleType.Row4;
+ this.calendar1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.calendar1.Format = "yyyy/MM/dd";
+ this.calendar1.HolidayFont = new System.Drawing.Font("メイリオ", 7F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.calendar1.HolidayForeColor = System.Drawing.Color.Red;
+ this.calendar1.Language = HotelPms.Share.Windows.Component.Calendar.LanguageType.Japanese;
+ this.calendar1.Location = new System.Drawing.Point(0, 0);
+ this.calendar1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+ this.calendar1.MemoFont = new System.Drawing.Font("メイリオ", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.calendar1.MemoForeColor = System.Drawing.Color.Black;
+ this.calendar1.MonthFont = new System.Drawing.Font("メイリオ", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.calendar1.MonthForeColor = System.Drawing.Color.Purple;
+ this.calendar1.Name = "calendar1";
+ this.calendar1.RokuyouFont = new System.Drawing.Font("メイリオ", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.calendar1.RokuyouForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(64)))), ((int)(((byte)(0)))));
+ this.calendar1.RokuyouVisible = true;
+ this.calendar1.SelDayBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+ this.calendar1.SelectDateFont = new System.Drawing.Font("メイリオ", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.calendar1.SelectDateForeColor = System.Drawing.Color.Navy;
+ this.calendar1.ShowStyle = HotelPms.Share.Windows.Component.Calendar.ShowStyleType.OneMonth;
+ this.calendar1.Size = new System.Drawing.Size(393, 377);
+ this.calendar1.SmallFont = new System.Drawing.Font("メイリオ", 7F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.calendar1.SmallYearFont = new System.Drawing.Font("メイリオ", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.calendar1.SmallYearForeColor = System.Drawing.Color.Black;
+ this.calendar1.TabIndex = 0;
+ this.calendar1.Text = "2019/06/20";
+ this.calendar1.Value = new System.DateTime(2019, 6, 20, 0, 0, 0, 0);
+ this.calendar1.WeekBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
+ this.calendar1.WeekFont = new System.Drawing.Font("メイリオ", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.calendar1.WeekForeColor = System.Drawing.Color.White;
+ this.calendar1.YearFont = new System.Drawing.Font("メイリオ", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.calendar1.YearForeColor = System.Drawing.Color.Purple;
+ this.calendar1.DayCellFormat += new HotelPms.Share.Windows.Component.CalendarEventHandler(this.Calendar1_DayCellFormat);
+ this.calendar1.DateSelect += new HotelPms.Share.Windows.Component.CalendarEventHandler(this.Calendar1_DateSelect);
+ //
+ // CalendarSelectorOne
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(395, 414);
+ this.Margin = new System.Windows.Forms.Padding(7, 8, 7, 8);
+ this.Name = "CalendarSelectorOne";
+ this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
+ this.Text = "日期选择";
+ this.Load += new System.EventHandler(this.CalendarSelector_Load);
+ this.pnlMain.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private Calendar calendar1;
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.Share.Windows/Tool/CalendarSelectorOne.cs b/HotelPms.Share.Windows/Tool/CalendarSelectorOne.cs
new file mode 100644
index 0000000..233a97c
--- /dev/null
+++ b/HotelPms.Share.Windows/Tool/CalendarSelectorOne.cs
@@ -0,0 +1,63 @@
+using HotelPms.Share.Util;
+using HotelPms.Share.Windows.Component;
+using HotelPms.Share.Windows.Util;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace HotelPms.Share.Windows.Tool
+{
+ public partial class CalendarSelectorOne : FormBase
+ {
+ public DateTime SelDate { get; set; } = DateTime.Now;
+ public Control OwnerControl { get; set; } = null;
+
+ public CalendarSelectorOne(Control obj)
+ {
+ InitializeComponent();
+ OwnerControl = obj;
+ }
+
+ private void Calendar1_DateSelect(object sender, CalendarEventArgs e)
+ {
+ SelDate = calendar1.Value;
+ OwnerControl.Text = calendar1.Text;
+ this.DialogResult = DialogResult.OK;
+ }
+
+ private void CalendarSelector_Load(object sender, EventArgs e)
+ {
+ calendar1.Value = CConvert.ToDateTime(OwnerControl.Text);
+ //如果要将Control1(例如Label1或者Button1)上的点(x,y)转换成屏幕上的点(x1,y1),那么就调用Control1.PointToScreen。
+ //反之,如果要将屏幕的(x1,y1)变成控件上的(x,y),那么就调用Control1.PointToClient。
+ //eg1:求Button1的左上角在屏幕上的位置。
+ //Point p = new Point(0, 0); // 0,0 是左上角
+ //p = Button1.PointToScreen(p);
+ Point location = OwnerControl.PointToScreen(new Point(0, 0));
+ location = new Point(location.X -1,location.Y + OwnerControl.Height - 2);
+ Screen currentScreen = Screen.FromControl(OwnerControl);
+ if (location.X + this.Width > currentScreen.WorkingArea.X + currentScreen.WorkingArea.Width) { location.X = currentScreen.WorkingArea.X + currentScreen.WorkingArea.Width - this.Width; }
+ if(location.Y+ this.Height > currentScreen.WorkingArea.Y + currentScreen.WorkingArea.Height) { location.Y -= (currentScreen.WorkingArea.Y + OwnerControl.Height - 2 + this.Height); }
+ this.Location = location;
+ }
+
+ public static DialogResult Execute(Control obj)
+ {
+ using (CalendarSelectorOne form = new CalendarSelectorOne(obj))
+ {
+ return form.ShowDialog();
+ }
+ }
+
+ private void Calendar1_DayCellFormat(object sender, CalendarEventArgs e)
+ {
+ if (e.DateValue.ToString("MMdd") == "0101") { e.Holiday = "元旦"; }
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/Tool/CalendarSelectorOne.resx b/HotelPms.Share.Windows/Tool/CalendarSelectorOne.resx
new file mode 100644
index 0000000..f298a7b
--- /dev/null
+++ b/HotelPms.Share.Windows/Tool/CalendarSelectorOne.resx
@@ -0,0 +1,60 @@
+<root>
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root>
\ No newline at end of file
diff --git a/HotelPms.Share.Windows/Tool/DBLogin.cs b/HotelPms.Share.Windows/Tool/DBLogin.cs
new file mode 100644
index 0000000..7eb3586
--- /dev/null
+++ b/HotelPms.Share.Windows/Tool/DBLogin.cs
@@ -0,0 +1,155 @@
+using System;
+using System.Data;
+using System.Text;
+using System.Windows.Forms;
+using System.IO;
+using HotelPms.Share.IO;
+
+namespace HotelPms.Share.Windows.Tool
+{
+ public partial class DBLogin : Form
+ {
+ private string listFile = @"\LoginInfo.vic";
+
+ private string userID = string.Empty;
+ private string passWord = string.Empty;
+ private string dataSource = string.Empty;
+ private string catalog = string.Empty;
+
+ /// <summary>���[�U�[</summary>
+ public string UseID
+ {
+ get { return userID; }
+ set { userID = value; }
+ }
+
+ /// <summary>�p�X���[�h</summary>
+ public string PassWord
+ {
+ get { return passWord; }
+ set { passWord = value; }
+ }
+
+ /// <summary>�f�[�^�x�[�X���݂̃p�\�R����</summary>
+ public string DataSource
+ {
+ get { return dataSource; }
+ set { dataSource = value; }
+ }
+
+ /// <summary>�f�[�^�x�[�X��</summary>
+ public string Catalog
+ {
+ get { return catalog; }
+ set { catalog = value; }
+ }
+
+ public DBLogin()
+ {
+ //SqlDataSourceEnumerator instance = SqlDataSourceEnumerator.Instance;
+ //System.Data.DataTable table = instance.GetDataSources();
+
+ InitializeComponent();
+
+ // Display the contents of the table.
+ //DisplayData(table);
+ }
+
+ private void Login_Shown(object sender, EventArgs e)
+ {
+ if (this.cmbSrcDataSource.Items.Count > 0)
+ {
+ this.cmbSrcDataSource.SelectedIndex = 0;
+ }
+
+ if (!File.Exists(Application.StartupPath + listFile)) { return; }
+
+ listBox1.Items.Clear();
+ using (StreamReader sr = new StreamReader(Application.StartupPath + listFile, Encoding.Default))
+ {
+ string line = string.Empty;
+
+ while ((line = sr.ReadLine()) != null)
+ {
+ listBox1.Items.Add(line);
+ }
+ sr.Close();
+ }
+
+ }
+
+ private void DisplayData(System.Data.DataTable table)
+ {
+ foreach (System.Data.DataRow row in table.Rows)
+ {
+ this.cmbSrcDataSource.Items.Add(row["ServerName"].ToString());
+ }
+ }
+
+ private void Save()
+ {
+ string line = cmbSrcDataSource.Text + "," + txtDstUser.Text + "," + txtDstPassword.Text + "," + txtDstCatalog.Text;
+ if (!listBox1.Items.Contains(line))
+ {
+ listBox1.Items.Add(line);
+ }
+
+ StringBuilder fileInfo = new StringBuilder();
+ foreach (string item in listBox1.Items)
+ {
+ fileInfo.Append(item + Environment.NewLine);
+ }
+ FileOperation.Delete(Application.StartupPath + listFile);
+ File.WriteAllText(Application.StartupPath + listFile, fileInfo.ToString(), Encoding.Default);
+ }
+
+ private void btnLogin_Click(object sender, EventArgs e)
+ {
+ userID = txtDstUser.Text;
+ passWord = txtDstPassword.Text;
+ dataSource = cmbSrcDataSource.Text;
+ catalog = txtDstCatalog.Text;
+
+ Save();
+
+ this.DialogResult = DialogResult.OK;
+ this.Close();
+ }
+
+ private void btnCancel_Click(object sender, EventArgs e)
+ {
+ this.DialogResult = DialogResult.Cancel;
+ this.Close();
+ }
+
+ private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ if(listBox1.SelectedIndex == -1) { return;}
+ string[] items = listBox1.Items[listBox1.SelectedIndex].ToString().Split(new char[]{','});
+
+ cmbSrcDataSource.Text = items[0];
+ txtDstUser.Text = items[1];
+ txtDstPassword.Text = items[2];
+ txtDstCatalog.Text = items[3];
+ }
+
+ private void cmbSrcDataSource_DropDown(object sender, EventArgs e)
+ {
+ ComboBox obj = sender as ComboBox;
+ if (obj.Items.Count == 0)
+ {
+ this.Cursor = System.Windows.Forms.Cursors.AppStarting;
+
+ //SqlDataSourceEnumerator sqlServerList = System.Data.Sql.SqlDataSourceEnumerator.Instance;
+ //using (DataTable dtServerList = sqlServerList.GetDataSources())
+ //{
+ // foreach (DataRow dRow in dtServerList.Rows)
+ // {
+ // obj.Items.Add(dRow["ServerName"].ToString());
+ // }
+ //}
+ this.Cursor = System.Windows.Forms.Cursors.Default;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.Share.Windows/Tool/DBLogin.designer.cs b/HotelPms.Share.Windows/Tool/DBLogin.designer.cs
new file mode 100644
index 0000000..19559de
--- /dev/null
+++ b/HotelPms.Share.Windows/Tool/DBLogin.designer.cs
@@ -0,0 +1,201 @@
+namespace HotelPms.Share.Windows.Tool
+{
+ partial class DBLogin
+ {
+ /// <summary>
+ /// 必要なデザイナ変数です。
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// 使用中のリソースをすべてクリーンアップします。
+ /// </summary>
+ /// <param name="disposing">マネージ リソースが破棄される場合 true、破棄されない場合は false です。</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows フォーム デザイナで生成されたコード
+
+ /// <summary>
+ /// デザイナ サポートに必要なメソッドです。このメソッドの内容を
+ /// コード エディタで変更しないでください。
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.txtDstCatalog = new System.Windows.Forms.TextBox();
+ this.lblDstCatalog = new System.Windows.Forms.Label();
+ this.txtDstPassword = new System.Windows.Forms.TextBox();
+ this.label6 = new System.Windows.Forms.Label();
+ this.txtDstUser = new System.Windows.Forms.TextBox();
+ this.label7 = new System.Windows.Forms.Label();
+ this.label8 = new System.Windows.Forms.Label();
+ this.groupBox1 = new System.Windows.Forms.GroupBox();
+ this.cmbSrcDataSource = new System.Windows.Forms.ComboBox();
+ this.btnLogin = new System.Windows.Forms.Button();
+ this.btnCancel = new System.Windows.Forms.Button();
+ this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
+ this.listBox1 = new System.Windows.Forms.ListBox();
+ this.groupBox1.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // txtDstCatalog
+ //
+ this.txtDstCatalog.Location = new System.Drawing.Point(122, 103);
+ this.txtDstCatalog.Name = "txtDstCatalog";
+ this.txtDstCatalog.Size = new System.Drawing.Size(123, 19);
+ this.txtDstCatalog.TabIndex = 4;
+ //
+ // lblDstCatalog
+ //
+ this.lblDstCatalog.AutoSize = true;
+ this.lblDstCatalog.Location = new System.Drawing.Point(20, 106);
+ this.lblDstCatalog.Name = "lblDstCatalog";
+ this.lblDstCatalog.Size = new System.Drawing.Size(74, 12);
+ this.lblDstCatalog.TabIndex = 14;
+ this.lblDstCatalog.Text = "データベース名";
+ //
+ // txtDstPassword
+ //
+ this.txtDstPassword.Location = new System.Drawing.Point(122, 78);
+ this.txtDstPassword.Name = "txtDstPassword";
+ this.txtDstPassword.Size = new System.Drawing.Size(123, 19);
+ this.txtDstPassword.TabIndex = 3;
+ //
+ // label6
+ //
+ this.label6.AutoSize = true;
+ this.label6.Location = new System.Drawing.Point(21, 81);
+ this.label6.Name = "label6";
+ this.label6.Size = new System.Drawing.Size(52, 12);
+ this.label6.TabIndex = 12;
+ this.label6.Text = "パスワード";
+ //
+ // txtDstUser
+ //
+ this.txtDstUser.Location = new System.Drawing.Point(122, 53);
+ this.txtDstUser.Name = "txtDstUser";
+ this.txtDstUser.Size = new System.Drawing.Size(123, 19);
+ this.txtDstUser.TabIndex = 2;
+ //
+ // label7
+ //
+ this.label7.AutoSize = true;
+ this.label7.Location = new System.Drawing.Point(20, 56);
+ this.label7.Name = "label7";
+ this.label7.Size = new System.Drawing.Size(45, 12);
+ this.label7.TabIndex = 10;
+ this.label7.Text = "ユーザー";
+ //
+ // label8
+ //
+ this.label8.AutoSize = true;
+ this.label8.Location = new System.Drawing.Point(21, 31);
+ this.label8.Name = "label8";
+ this.label8.Size = new System.Drawing.Size(57, 12);
+ this.label8.TabIndex = 8;
+ this.label8.Text = "サーバー名";
+ //
+ // groupBox1
+ //
+ this.groupBox1.Controls.Add(this.cmbSrcDataSource);
+ this.groupBox1.Controls.Add(this.label8);
+ this.groupBox1.Controls.Add(this.txtDstCatalog);
+ this.groupBox1.Controls.Add(this.label7);
+ this.groupBox1.Controls.Add(this.lblDstCatalog);
+ this.groupBox1.Controls.Add(this.txtDstUser);
+ this.groupBox1.Controls.Add(this.txtDstPassword);
+ this.groupBox1.Controls.Add(this.label6);
+ this.groupBox1.Location = new System.Drawing.Point(12, 12);
+ this.groupBox1.Name = "groupBox1";
+ this.groupBox1.Size = new System.Drawing.Size(282, 145);
+ this.groupBox1.TabIndex = 1;
+ this.groupBox1.TabStop = false;
+ this.groupBox1.Text = "予約センター";
+ //
+ // cmbSrcDataSource
+ //
+ this.cmbSrcDataSource.FormattingEnabled = true;
+ this.cmbSrcDataSource.Location = new System.Drawing.Point(122, 27);
+ this.cmbSrcDataSource.Name = "cmbSrcDataSource";
+ this.cmbSrcDataSource.Size = new System.Drawing.Size(123, 20);
+ this.cmbSrcDataSource.TabIndex = 15;
+ this.cmbSrcDataSource.Text = "SC1425";
+ this.cmbSrcDataSource.DropDown += new System.EventHandler(this.cmbSrcDataSource_DropDown);
+ //
+ // btnLogin
+ //
+ this.btnLogin.Location = new System.Drawing.Point(315, 86);
+ this.btnLogin.Name = "btnLogin";
+ this.btnLogin.Size = new System.Drawing.Size(96, 27);
+ this.btnLogin.TabIndex = 18;
+ this.btnLogin.Text = "ログイン";
+ this.btnLogin.UseVisualStyleBackColor = true;
+ this.btnLogin.Click += new System.EventHandler(this.btnLogin_Click);
+ //
+ // btnCancel
+ //
+ this.btnCancel.Location = new System.Drawing.Point(315, 130);
+ this.btnCancel.Name = "btnCancel";
+ this.btnCancel.Size = new System.Drawing.Size(96, 27);
+ this.btnCancel.TabIndex = 19;
+ this.btnCancel.Text = "取消";
+ this.btnCancel.UseVisualStyleBackColor = true;
+ this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
+ //
+ // openFileDialog1
+ //
+ this.openFileDialog1.FileName = "openFileDialog1";
+ //
+ // listBox1
+ //
+ this.listBox1.FormattingEnabled = true;
+ this.listBox1.ItemHeight = 12;
+ this.listBox1.Location = new System.Drawing.Point(12, 163);
+ this.listBox1.Name = "listBox1";
+ this.listBox1.Size = new System.Drawing.Size(409, 160);
+ this.listBox1.TabIndex = 20;
+ this.listBox1.SelectedIndexChanged += new System.EventHandler(this.listBox1_SelectedIndexChanged);
+ //
+ // DBLogin
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(433, 331);
+ this.Controls.Add(this.listBox1);
+ this.Controls.Add(this.btnCancel);
+ this.Controls.Add(this.btnLogin);
+ this.Controls.Add(this.groupBox1);
+ this.MaximumSize = new System.Drawing.Size(441, 365);
+ this.Name = "DBLogin";
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+ this.Text = "ログイン";
+ this.Shown += new System.EventHandler(this.Login_Shown);
+ this.groupBox1.ResumeLayout(false);
+ this.groupBox1.PerformLayout();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.TextBox txtDstCatalog;
+ private System.Windows.Forms.Label lblDstCatalog;
+ private System.Windows.Forms.TextBox txtDstPassword;
+ private System.Windows.Forms.Label label6;
+ private System.Windows.Forms.TextBox txtDstUser;
+ private System.Windows.Forms.Label label7;
+ private System.Windows.Forms.Label label8;
+ private System.Windows.Forms.GroupBox groupBox1;
+ private System.Windows.Forms.Button btnLogin;
+ private System.Windows.Forms.Button btnCancel;
+ private System.Windows.Forms.OpenFileDialog openFileDialog1;
+ private System.Windows.Forms.ComboBox cmbSrcDataSource;
+ private System.Windows.Forms.ListBox listBox1;
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.Share.Windows/Tool/DBLogin.resx b/HotelPms.Share.Windows/Tool/DBLogin.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/HotelPms.Share.Windows/Tool/DBLogin.resx
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root>
\ No newline at end of file
diff --git a/HotelPms.Share.Windows/Tool/DataSelector.Designer.cs b/HotelPms.Share.Windows/Tool/DataSelector.Designer.cs
new file mode 100644
index 0000000..4428afe
--- /dev/null
+++ b/HotelPms.Share.Windows/Tool/DataSelector.Designer.cs
@@ -0,0 +1,174 @@
+namespace HotelPms.Share.Windows.Tool
+{
+ partial class DataSelector
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DataSelector));
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
+ this.pnlFilter = new HotelPms.Share.Windows.Component.PanelEx();
+ this.txtFilter = new HotelPms.Share.Windows.Component.CTextBox();
+ this.panel2 = new System.Windows.Forms.Panel();
+ this.DataGridView1 = new System.Windows.Forms.DataGridView();
+ this.pnlFilter.SuspendLayout();
+ this.panel2.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.DataGridView1)).BeginInit();
+ this.SuspendLayout();
+ //
+ // pnlFilter
+ //
+ this.pnlFilter.ActiveName = "";
+ this.pnlFilter.ArcWidth = 16;
+ this.pnlFilter.BackColor = System.Drawing.Color.White;
+ this.pnlFilter.Blur = 15;
+ this.pnlFilter.Controls.Add(this.txtFilter);
+ this.pnlFilter.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.pnlFilter.Font = new System.Drawing.Font("MS UI Gothic", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.pnlFilter.Location = new System.Drawing.Point(1, 195);
+ this.pnlFilter.Margin = new System.Windows.Forms.Padding(4);
+ this.pnlFilter.Name = "pnlFilter";
+ this.pnlFilter.OffsetX = 0;
+ this.pnlFilter.OffsetY = 0;
+ this.pnlFilter.Size = new System.Drawing.Size(372, 50);
+ this.pnlFilter.Spread = 15;
+ this.pnlFilter.TabIndex = 1;
+ //
+ // txtFilter
+ //
+ this.txtFilter.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.txtFilter.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(122)))), ((int)(((byte)(122)))), ((int)(((byte)(122)))));
+ this.txtFilter.BorderFocusColor = System.Drawing.SystemColors.Highlight;
+ this.txtFilter.BorderStyle = System.Windows.Forms.BorderStyle.None;
+ this.txtFilter.Font = new System.Drawing.Font("Yu Gothic UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.txtFilter.ForeImage = ((System.Drawing.Image)(resources.GetObject("txtFilter.ForeImage")));
+ this.txtFilter.InputType = "0x1";
+ this.txtFilter.Location = new System.Drawing.Point(41, 15);
+ this.txtFilter.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
+ this.txtFilter.MstNameCtrl = null;
+ this.txtFilter.Name = "txtFilter";
+ this.txtFilter.OrgText = "";
+ this.txtFilter.PanelExEnabled = true;
+ this.txtFilter.ShadowColor = System.Drawing.Color.FromArgb(((int)(((byte)(140)))), ((int)(((byte)(0)))), ((int)(((byte)(120)))), ((int)(((byte)(215)))));
+ this.txtFilter.Size = new System.Drawing.Size(319, 22);
+ this.txtFilter.TabIndex = 1;
+ this.txtFilter.TipText = "";
+ this.txtFilter.TitleBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
+ this.txtFilter.TitleFont = new System.Drawing.Font("MS UI Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.txtFilter.TitleForeColor = System.Drawing.Color.White;
+ this.txtFilter.TitleStyle = HotelPms.Share.Windows.Component.CTextBox.ETitleStyle.Icon;
+ this.txtFilter.TitleText = "";
+ this.txtFilter.TitleWidth = 50;
+ //
+ // panel2
+ //
+ this.panel2.Controls.Add(this.DataGridView1);
+ this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.panel2.Location = new System.Drawing.Point(1, 1);
+ this.panel2.Margin = new System.Windows.Forms.Padding(4);
+ this.panel2.Name = "panel2";
+ this.panel2.Size = new System.Drawing.Size(372, 194);
+ this.panel2.TabIndex = 2;
+ //
+ // DataGridView1
+ //
+ this.DataGridView1.AllowUserToAddRows = false;
+ this.DataGridView1.AllowUserToDeleteRows = false;
+ this.DataGridView1.AllowUserToResizeColumns = false;
+ this.DataGridView1.AllowUserToResizeRows = false;
+ dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
+ this.DataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
+ this.DataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.DisplayedCells;
+ this.DataGridView1.BorderStyle = System.Windows.Forms.BorderStyle.None;
+ dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
+ dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control;
+ dataGridViewCellStyle2.Font = new System.Drawing.Font("MS UI Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText;
+ dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(50)))), ((int)(((byte)(100)))));
+ dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
+ dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
+ this.DataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
+ this.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
+ this.DataGridView1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.DataGridView1.Location = new System.Drawing.Point(0, 0);
+ this.DataGridView1.Margin = new System.Windows.Forms.Padding(4);
+ this.DataGridView1.MultiSelect = false;
+ this.DataGridView1.Name = "DataGridView1";
+ this.DataGridView1.ReadOnly = true;
+ dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
+ dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Control;
+ dataGridViewCellStyle3.Font = new System.Drawing.Font("MS UI Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText;
+ dataGridViewCellStyle3.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(50)))), ((int)(((byte)(100)))));
+ dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
+ dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
+ this.DataGridView1.RowHeadersDefaultCellStyle = dataGridViewCellStyle3;
+ this.DataGridView1.RowHeadersVisible = false;
+ this.DataGridView1.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders;
+ this.DataGridView1.RowTemplate.Height = 21;
+ this.DataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
+ this.DataGridView1.Size = new System.Drawing.Size(372, 194);
+ this.DataGridView1.TabIndex = 0;
+ this.DataGridView1.CellMouseDoubleClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.DataGridView1_CellMouseDoubleClick);
+ this.DataGridView1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.DataGridView1_KeyDown);
+ //
+ // DataSelector
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(43)))), ((int)(((byte)(43)))), ((int)(((byte)(43)))));
+ this.ClientSize = new System.Drawing.Size(374, 246);
+ this.Controls.Add(this.panel2);
+ this.Controls.Add(this.pnlFilter);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+ this.KeyPreview = true;
+ this.Margin = new System.Windows.Forms.Padding(7, 8, 7, 8);
+ this.Name = "DataSelector";
+ this.Padding = new System.Windows.Forms.Padding(1);
+ this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
+ this.Text = "日期选择";
+ this.Load += new System.EventHandler(this.CalendarSelector_Load);
+ this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.DataSelector_KeyDown);
+ this.pnlFilter.ResumeLayout(false);
+ this.pnlFilter.PerformLayout();
+ this.panel2.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.DataGridView1)).EndInit();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private HotelPms.Share.Windows.Component.PanelEx pnlFilter;
+ private System.Windows.Forms.Panel panel2;
+ private System.Windows.Forms.DataGridView DataGridView1;
+ public HotelPms.Share.Windows.Component.CTextBox txtFilter;
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.Share.Windows/Tool/DataSelector.cs b/HotelPms.Share.Windows/Tool/DataSelector.cs
new file mode 100644
index 0000000..540678f
--- /dev/null
+++ b/HotelPms.Share.Windows/Tool/DataSelector.cs
@@ -0,0 +1,352 @@
+using HotelPms.Share.Util;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Diagnostics;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace HotelPms.Share.Windows.Tool
+{
+ public partial class DataSelector : Form
+ {
+ #region ★★★★★ Declartions ★★★★★
+
+ [Flags]
+ public enum Style : int
+ {
+ None = 0x1,
+ HideBottom = 0x2,
+ HideReturnField = 0x4,
+ HideGridHeader = 0x8,
+ }
+
+ private List<string> m_CurrentRow = new List<string>();
+
+
+ public List<string> SelecetdItem
+ {
+ get
+ {
+ return m_CurrentRow;
+ }
+ }
+
+ private DataView DtView = new DataView();
+
+ // 共通変数
+ private int intReturnField_IndexNo; // ReturnFieldのIndex
+ private bool strVisibleBottom = true;
+ private bool strVisibleReturnField = true;
+ private bool visibleGridHeader = true;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+
+ public bool IsReturnRow { get; set; } = false;
+
+ public Control OwnerControl { get; set; } = null;
+
+ public DataTable Data { get; set; } = null;
+
+ /// <summary>
+ /// ReturnField(選択したときに返すフィールド名)
+ /// </summary>
+ public string ReturnField { get; set; } = "コード";
+
+ public string SearchField { get; set; } = "名称";
+
+ public Style CurStyle { get; set; } = Style.None;
+
+ public List<int> ColWidth { get; set; } = new List<int>();
+
+ /// <summary>
+ /// ReturnValue(選択後に取得できる値)
+ /// </summary>
+ public string ReturnValue { get; set; } = string.Empty;
+
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public DataSelector(Control obj)
+ {
+ InitializeComponent();
+ OwnerControl = obj;
+ }
+
+ private void CalendarSelector_Load(object sender, EventArgs e)
+ {
+ //如果要将Control1(例如Label1或者Button1)上的点(x,y)转换成屏幕上的点(x1,y1),那么就调用Control1.PointToScreen。
+ //反之,如果要将屏幕的(x1,y1)变成控件上的(x,y),那么就调用Control1.PointToClient。
+ //eg1:求Button1的左上角在屏幕上的位置。
+ //Point p = new Point(0, 0); // 0,0 是左上角
+ //p = Button1.PointToScreen(p);
+ Point location = OwnerControl.PointToScreen(new Point(0, 0));
+ location = new Point(location.X -1,location.Y + OwnerControl.Height - 2);
+ Screen currentScreen = Screen.FromControl(OwnerControl);
+ if (location.X + this.Width > currentScreen.WorkingArea.X + currentScreen.WorkingArea.Width) { location.X = currentScreen.WorkingArea.X + currentScreen.WorkingArea.Width - this.Width; }
+ if(location.Y+ this.Height > currentScreen.WorkingArea.Y + currentScreen.WorkingArea.Height) { location.Y -= (currentScreen.WorkingArea.Y + OwnerControl.Height - 2 + this.Height); }
+ this.Location = location;
+
+ if ((CurStyle & Style.HideBottom) == Style.HideBottom) { strVisibleBottom = false; }
+ if ((CurStyle & Style.HideGridHeader) == Style.HideGridHeader) { visibleGridHeader = false; }
+ if ((CurStyle & Style.HideReturnField) == Style.HideReturnField) { strVisibleReturnField = false; }
+
+ Data.TableName = "SelectTable";
+ DtView.Table = Data;
+ DtView.RowFilter = "";
+
+ // データを表示
+ this.DataGridView1.DataSource = DtView;
+
+ //下部の検索キーと閉じるボタンを表示するか(初期値:True(表示))
+ pnlFilter.Visible = strVisibleBottom;
+
+ //ReturnField(戻り値を返す項目列名)のIndexNoを取得する。
+ intReturnField_IndexNo = -1;
+
+ if (ReturnField.Length == 0)
+ {
+ intReturnField_IndexNo = 0;
+ }
+ else
+ {
+ for (int i = 0; i < this.DataGridView1.Columns.Count; i++)
+ {
+ if (this.DataGridView1.Columns[i].HeaderText.ToString() == ReturnField.ToString())
+ {
+ intReturnField_IndexNo = i;
+ }
+ }
+ }
+
+ //ReturnField(戻り値を返す項目列名)を取得する。
+ if (ReturnField.Length == 0)
+ {
+ ReturnField = this.DtView.Table.Columns[intReturnField_IndexNo].ColumnName.ToString();
+ }
+
+ //SearchField(検索キーに関連させる項目列名)を取得する。
+ if (SearchField.Length == 0)
+ {
+ SearchField = this.DtView.Table.Columns[intReturnField_IndexNo + 1].ColumnName.ToString();
+ }
+
+ //VisibleReturnField = falseの場合、ReturnFieldを非表示とする。
+ if ((!strVisibleReturnField) && (intReturnField_IndexNo > -1))
+ {
+ this.DataGridView1.Columns[intReturnField_IndexNo].Visible = false;
+ }
+
+ if (Data.Rows.Count == 0)
+ {
+ MessageBox.Show("該当データがありません。");
+ this.Close();
+ return;
+ }
+
+ this.DataGridView1.ColumnHeadersVisible = visibleGridHeader;
+
+ //エラー処理
+ if (!ValidateInput())
+ {
+ Debug.Assert(false, "開発用Error", "Selectが不適切、searchFieldが数値、文字列以外");
+
+ }
+
+ DataGridView1.EnableHeadersVisualStyles = false;
+ DataGridView1.ColumnHeadersHeight = 25;
+ foreach (DataGridViewColumn col in DataGridView1.Columns)
+ {
+ col.HeaderCell.Style.BackColor = System.Drawing.Color.FromArgb(50, 50, 100);
+ col.HeaderCell.Style.ForeColor = Color.White;
+ }
+
+ DataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.None;
+ DataGridView1.AllowUserToResizeColumns = true;
+ if (ColWidth == null || ColWidth.Count == 0)
+ {
+ DataGridView1.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
+ }
+ else
+ {
+ for (int i = 0; i < ColWidth.Count; i++)
+ {
+ DataGridView1.Columns[i].Width = ColWidth[i];
+ }
+ }
+
+
+ if(DataGridView1.Rows.Count > 0)
+ {
+ DataGridView1.Rows[0].Cells[0].Selected = true;
+ DataGridView1.CurrentCell = DataGridView1.Rows[0].Cells[0];
+ this.ActiveControl = DataGridView1;
+ }
+ }
+
+ private void DataSelector_KeyDown(object sender, KeyEventArgs e)
+ {
+ switch (e.KeyCode)
+ {
+ case Keys.Escape:
+ e.Handled = true;
+ ReturnValue = string.Empty;
+ this.Close();
+ break;
+ }
+ }
+
+ #endregion
+
+ #region ★★★★★ Control Event ★★★★★
+
+ private void DataGridView1_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
+ {
+ DataGridView1_KeyDown(sender, new KeyEventArgs(Keys.Enter));
+ }
+
+ private void DataGridView1_KeyDown(object sender, KeyEventArgs e)
+ {
+ if (e.KeyCode == Keys.Enter)
+ {
+ if (DataGridView1.RowCount > 0)
+ {
+
+ if (!IsReturnRow)
+ {
+ ReturnValue = this.DataGridView1[ReturnField, this.DataGridView1.CurrentCell.RowIndex].Value.ToString(); //Cell値
+ }
+ else
+ {
+ m_CurrentRow.Clear();
+ foreach (DataGridViewCell cell in DataGridView1.CurrentRow.Cells) { m_CurrentRow.Add(CConvert.ToString(cell.Value)); }
+ }
+ //画面を閉じる
+ this.Close();
+ }
+ }
+ else if (e.KeyCode == Keys.Tab)
+ {
+ e.Handled = true;
+ txtFilter.Focus();
+ }
+ }
+
+ private void TxtFilter_KeyDown(object sender, KeyEventArgs e)
+ {
+ //Enterキー入力の場合
+ if (e.KeyCode == Keys.Enter)
+ {
+ //DataGridView1へフォーカス移動
+ DataGridView1.Focus();
+ }
+ }
+
+ private void TxtFilter_Enter(object sender, EventArgs e)
+ {
+ txtFilter.BackColor = Color.LemonChiffon;
+ }
+
+ private void TxtFilter_Leave(object sender, EventArgs e)
+ {
+ txtFilter.BackColor = Color.White;
+ }
+
+ private void TxtFilter_TextChanged(object sender, EventArgs e)
+ {
+ // フィルター条件を判別
+ if (txtFilter.Text.Length == 0 || SearchField.Length == 0)
+ {
+ //フィルタ条件無し(全てを表示)
+ DtView.RowFilter = string.Empty;
+ }
+ else
+ {
+ //フィルタ条件指定
+ DtView.RowFilter = $"{SearchField} LIKE '%{txtFilter.Text}%'";
+ }
+ // データを表示
+ this.DataGridView1.DataSource = DtView;
+ }
+
+
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+
+ /// <summary>
+ /// ValidateInput
+ /// </summary>
+ private bool ValidateInput()
+ {
+ if (IsReturnRow) { return true; }
+ if (Data.Rows.Count == 0) { return false; }
+ if (Data.Columns[SearchField].DataType != typeof(string)) { return false; }
+ return true;
+ }
+
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+
+ public static List<string> ExecuteForRow(Control owner, DataTable data, Style style, Size size, string returnField, string searchField, List<int> colWidth)
+ {
+ using (DataSelector form = new DataSelector(owner))
+ {
+ form.CurStyle = style;
+ if (!size.Equals(Size.Empty)) { form.Size = size; }
+ if (returnField.Length > 0) { form.ReturnField = returnField; }
+ if (searchField.Length > 0) { form.SearchField = searchField; }
+ if (colWidth != null) { form.ColWidth = colWidth; }
+ form.Data = data;
+ form.IsReturnRow = true;
+ form.ShowDialog();
+ return form.SelecetdItem;
+ }
+
+ }
+
+ /// <summary>
+ /// 一覧表示
+ /// </summary>
+ /// <returns></returns>
+ public static string Execute(Control owner, DataTable data)
+ {
+ return Execute(owner, data, Size.Empty);
+ }
+
+ public static string Execute(Control owner, DataTable data, Size size)
+ {
+ return Execute(owner, data, size, string.Empty, string.Empty, null, Style.None);
+ }
+
+ public static string Execute(Control owner, DataTable data, Size size, string returnField, string searchField, List<int> colWidth, Style style)
+ {
+ string result = string.Empty;
+ using (DataSelector form = new DataSelector(owner))
+ {
+ form.CurStyle = style;
+ if (!size.Equals(Size.Empty)) { form.Size = size; }
+ if (returnField.Length > 0) { form.ReturnField = returnField; }
+ if (searchField.Length > 0) { form.SearchField = searchField; }
+ if (colWidth != null) { form.ColWidth = colWidth; }
+ form.Data = data;
+ form.ShowDialog();
+ if (form.ReturnValue.Length > 0)
+ {
+ result = form.ReturnValue;
+ }
+ }
+ return result;
+ }
+
+ #endregion
+ }
+}
diff --git a/HotelPms.Share.Windows/Tool/DataSelector.resx b/HotelPms.Share.Windows/Tool/DataSelector.resx
new file mode 100644
index 0000000..258174e
--- /dev/null
+++ b/HotelPms.Share.Windows/Tool/DataSelector.resx
@@ -0,0 +1,95 @@
+<root>
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <assembly alias="System.Drawing.Common" name="System.Drawing.Common, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" />
+ <data name="txtFilter.ForeImage" type="System.Drawing.Bitmap, System.Drawing.Common" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>
+ iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
+ wAAADsABataJCQAABppJREFUeF7tnEtIFV8cx6WHlaZUm4IeZilUVIseFFFm+cgHgUsJbVEt2tUiWiS9
+ qKBoZdAqFwatMimUEiFyFYWGhRBogUltCkszIxK08+fr/3fhNH3vvWfunJk7eu8HviB4Ht/53uHOzPmd
+ uRkqjSfSAXokHaBH0gF6JOkBTk5Oyl8zk8ACfPHihbpx44Y6fPiwWrlypcrJyVGLFi1Sc+fOVZmZmWrx
+ 4sVqyZIlavfu3er06dPq4cOH6tevX9I7vPgW4O/fv9Xdu3fVqlWrVEZGhifV1taqwcFBGTlcWA/w27dv
+ qr6+ngbhVfn5+aqjo0NmCgfWAvz+/bs6cOAAPXA/1NnZKTMnFysB3rx5kx6k39q+fbs4SB6eAvzz54/a
+ tGkTPbgg9fjxY3EUPAkH+OXLF3owyVJDQ4M4C5aEAuzr66MHkWxVVFSIw+BwHeCrV6+oebdaunSp2rx5
+ s9q7d+/0d9natWtpO7c6cuSIOA0GVwF++vSJmjbRhg0b1Pnz5+Pez01NTan79++rQ4cO0XFMdOLECRnN
+ f4wDxAWDmY0nHAy+LxPlzp07dNx4wocQBMYBur3a7ty5U/38+VN6e+fChQt0nlgaGBiQ3v5hFKDb+7yr
+ V69KT7t8/vx5+rmZzcmEZ22/iRvg6OgoNRdNr1+/lp7+sWfPHjo306VLl6SXP8QN0M3j2cePH6WX/+za
+ tYt6YBofH5de9okZ4NevX6khpufPn0uv4MjLy6NenDp58qT0sE/MAE1XVa5cuSI9ggXrhcwPk19EHRnr
+ ecyIU7jaJpMnT55QX041NjZKD7tEDbC5uZkaccrmrUqi4ENk3nQVFhZKa7tEDXD16tXUiK7jx49L6+Qy
+ PDxM/TnV398vPewRNUBmwCkvTxi22bhxI/WoC/eztqEB9vT0UAO68GwbJu7du0d96tqyZYu0tgcNENUz
+ ZkDXxYsXpXU4ML3htw0dEaVHNrmuIG+aTVm/fj31qss2dETUbdnkusLI0aNHqVddb968kdZ2oEmg6M0m
+ j2jZsmXSMlzcunWL+tWF+0ab0ACxisEmjwgryWHkwYMH1K+u1tZWaW2HfwLEXpV58+bRySPCMnwYefr0
+ KfWrCw8INqFn4IIFC+jkEYWhHstob2+nfnU9evRIWtuBBpidnU0njwgFoDBi8vjZ3d0tre1AA8QuKTa5
+ rjBy5swZ6lXXhw8fpLUdaBLYYsYm14XqWdgwWamemJiQ1nagAZ46dYpOriuoqpcbsNeQedVlGzoivmjZ
+ 5LpQtw0TL1++pD517du3T1rbgwaI05wZcCpMoP7MPOq6du2atLZH1BTmzJlDTehqamqS1smH+XOqt7dX
+ WtsjaoAmnygUBlC6ZN505ebmSmu7RE1gaGiIGnEK+12SycjICPXl1Llz56SHXWKeQtiTzMw4hR0DyQLP
+ 5cyTU37VhmMGiA3dzIxT8+fPlx7BcvnyZerHqW3btkkP+8T9EmOGmHATGyRtbW3UB5MfxaQIcQPEbnhm
+ ignbLYIAN/Fsfqa6ujrp5Q9xAwQ7duyg5pjWrFnj6xtGJldcXX5jPAMzF0u2V35xtTW9YOjaunWrjOAP
+ xgHiVQJmMJawYwBFb6+gAsjGN5Wfy2+uznG8SsAMxhOK3qjb4iwyBc+2pjfzJvIrRNdfEniVgBk01bp1
+ 66Z3faEAhBoGluGxkozFUKzn4WruZheqG/kRYkLfsniVgBmcCbIdYkIBAmwsYgZngmyGmHCAoKWlhRqc
+ CbIVoqcAAV4lyMrKoibDLhsheg4wgulzqS1hGwcoLy+n/zeV1xCtBQh+/PgxvaGbGbUl1KTfv38vM/4P
+ lupZW1N5CdFqgDrYk1xQUEANuxUWQ7GeF2tJqqioiPY1VaIh+hZghHfv3qnbt2+rqqoqtXDhQmqeqbi4
+ WF2/ft3Vizv79++nY5kqkRB9D5Dx9u3b6WdlbPTBL3ugCogdA1gF91q3RfAsHFO5DTEpAfrNwYMHaTim
+ chPirAwQlJSU0HBMZRrirA0QlJaW0nBMZRLirA4QlJWV0XBMFS/EWR8g8PLzAVBNTY2M9C8pESDwugzX
+ 1dUlI/1NygQIKisraTgmilYaSKkAAW7oWUDxhG3PjJQLEFRXV9OQYgkb7/HLJU5SMkDg9kxcvny59Pyb
+ lA0QuLmwoF7DSOkAgcl6IhZBopHyAYJjx47R4CIaGxuTlv+SDlB49uzZ9K0KzjZcMFasWKHOnj0r/41O
+ OkACu9pGIx2gR9IBeiQdoEfSAXpCqf8A3WrDXAo8THcAAAAASUVORK5CYII=
+</value>
+ </data>
+</root>
\ No newline at end of file
diff --git a/HotelPms.Share.Windows/Tool/DebugMonitor.cs b/HotelPms.Share.Windows/Tool/DebugMonitor.cs
new file mode 100644
index 0000000..b44a4da
--- /dev/null
+++ b/HotelPms.Share.Windows/Tool/DebugMonitor.cs
@@ -0,0 +1,85 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+using HotelPms.Share.Data;
+using HotelPms.Share.Util;
+using HotelPms.Share.Windows.Util;
+
+namespace HotelPms.Share.Windows.Tool
+{
+ public partial class DebugMonitor : Form
+ {
+ public DebugMonitor()
+ {
+ InitializeComponent();
+ GeneralSub.SetDoubleBuffered(listBox1);
+ }
+
+ private void listBox1_DoubleClick(object sender, EventArgs e)
+ {
+ try
+ {
+ Clipboard.SetDataObject(listBox1.SelectedItem, true);
+ }
+ catch { }
+ }
+
+ public void WriteLog(string msg)
+ {
+ try
+ {
+ //textBox2.Text = MsSqlNet.ConnectCount.ToString();
+
+ if (cbFillter.Checked)
+ {
+ cbFillter.Tag = false;
+ foreach (string sp in this.textBox3.Text.Split(new char[] { ',' }))
+ {
+ if (msg.Contains(sp)) { cbFillter.Tag = true; break; }
+ }
+ if (cbFillter.Tag.Equals(false)) return;
+ }
+
+ string newMsg = string.Format("�y{0}�z ", DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss fff")) + msg;
+ if (listBox1.Items.Count == int.MaxValue) { listBox1.Items.RemoveAt(0); }
+ listBox1.Items.Add(newMsg);
+ listBox1.SelectedIndex = listBox1.Items.Count - 1;
+ listBox1.Refresh();
+ }
+ catch { }
+ }
+
+ private void DebugMonitor_FormClosing(object sender, FormClosingEventArgs e)
+ {
+ if (e.CloseReason == CloseReason.UserClosing)
+ {
+ this.Visible = false;
+ e.Cancel = true;
+ }
+ }
+
+ private void btnClear_Click(object sender, EventArgs e)
+ {
+ listBox1.Items.Clear();
+ }
+
+ private void DebugMonitor_Load(object sender, EventArgs e)
+ {
+ this.Location = new Point(0, 0);
+ }
+
+ private void cbTopMost_CheckedChanged(object sender, EventArgs e)
+ {
+ this.TopMost = cbTopMost.Checked;
+ }
+
+ private void label1_Click(object sender, EventArgs e)
+ {
+ //textBox2.Text = MsSqlNet.ConnectCount.ToString();
+ }
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.Share.Windows/Tool/DebugMonitor.designer.cs b/HotelPms.Share.Windows/Tool/DebugMonitor.designer.cs
new file mode 100644
index 0000000..5be2914
--- /dev/null
+++ b/HotelPms.Share.Windows/Tool/DebugMonitor.designer.cs
@@ -0,0 +1,188 @@
+namespace HotelPms.Share.Windows.Tool
+{
+ partial class DebugMonitor
+ {
+ /// <summary>
+ /// 必要なデザイナ変数です。
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// 使用中のリソースをすべてクリーンアップします。
+ /// </summary>
+ /// <param name="disposing">マネージ リソースが破棄される場合 true、破棄されない場合は false です。</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows フォーム デザイナで生成されたコード
+
+ /// <summary>
+ /// デザイナ サポートに必要なメソッドです。このメソッドの内容を
+ /// コード エディタで変更しないでください。
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.components = new System.ComponentModel.Container();
+ this.panel1 = new System.Windows.Forms.Panel();
+ this.textBox3 = new System.Windows.Forms.TextBox();
+ this.cbFillter = new System.Windows.Forms.CheckBox();
+ this.label1 = new System.Windows.Forms.Label();
+ this.textBox2 = new System.Windows.Forms.TextBox();
+ this.cbTopMost = new System.Windows.Forms.CheckBox();
+ this.textBox1 = new System.Windows.Forms.TextBox();
+ this.panel2 = new System.Windows.Forms.Panel();
+ this.listBox1 = new System.Windows.Forms.ListBox();
+ this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
+ this.btnClear = new System.Windows.Forms.Button();
+ this.panel1.SuspendLayout();
+ this.panel2.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // panel1
+ //
+ this.panel1.Controls.Add(this.textBox3);
+ this.panel1.Controls.Add(this.cbFillter);
+ this.panel1.Controls.Add(this.label1);
+ this.panel1.Controls.Add(this.textBox2);
+ this.panel1.Controls.Add(this.cbTopMost);
+ this.panel1.Controls.Add(this.textBox1);
+ this.panel1.Controls.Add(this.btnClear);
+ this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.panel1.Location = new System.Drawing.Point(0, 0);
+ this.panel1.Name = "panel1";
+ this.panel1.Size = new System.Drawing.Size(748, 63);
+ this.panel1.TabIndex = 0;
+ //
+ // textBox3
+ //
+ this.textBox3.Location = new System.Drawing.Point(176, 32);
+ this.textBox3.Name = "textBox3";
+ this.textBox3.Size = new System.Drawing.Size(132, 19);
+ this.textBox3.TabIndex = 6;
+ this.toolTip1.SetToolTip(this.textBox3, ",で区切るとor条件として処理");
+ //
+ // cbFillter
+ //
+ this.cbFillter.AutoSize = true;
+ this.cbFillter.Location = new System.Drawing.Point(122, 34);
+ this.cbFillter.Name = "cbFillter";
+ this.cbFillter.Size = new System.Drawing.Size(58, 16);
+ this.cbFillter.TabIndex = 5;
+ this.cbFillter.Text = "フィルター";
+ this.cbFillter.UseVisualStyleBackColor = true;
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Cursor = System.Windows.Forms.Cursors.Hand;
+ this.label1.Font = new System.Drawing.Font("MS UI Gothic", 9F, System.Drawing.FontStyle.Underline, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
+ this.label1.ForeColor = System.Drawing.Color.DarkBlue;
+ this.label1.Location = new System.Drawing.Point(177, 13);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(62, 12);
+ this.label1.TabIndex = 4;
+ this.label1.Text = "SQL接続数";
+ this.label1.Click += new System.EventHandler(this.label1_Click);
+ //
+ // textBox2
+ //
+ this.textBox2.Location = new System.Drawing.Point(245, 10);
+ this.textBox2.Name = "textBox2";
+ this.textBox2.Size = new System.Drawing.Size(63, 19);
+ this.textBox2.TabIndex = 3;
+ //
+ // cbTopMost
+ //
+ this.cbTopMost.AutoSize = true;
+ this.cbTopMost.Checked = true;
+ this.cbTopMost.CheckState = System.Windows.Forms.CheckState.Checked;
+ this.cbTopMost.Location = new System.Drawing.Point(122, 12);
+ this.cbTopMost.Name = "cbTopMost";
+ this.cbTopMost.Size = new System.Drawing.Size(48, 16);
+ this.cbTopMost.TabIndex = 2;
+ this.cbTopMost.Text = "前面";
+ this.cbTopMost.UseVisualStyleBackColor = true;
+ this.cbTopMost.CheckedChanged += new System.EventHandler(this.cbTopMost_CheckedChanged);
+ //
+ // textBox1
+ //
+ this.textBox1.Location = new System.Drawing.Point(314, 10);
+ this.textBox1.Multiline = true;
+ this.textBox1.Name = "textBox1";
+ this.textBox1.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
+ this.textBox1.Size = new System.Drawing.Size(422, 41);
+ this.textBox1.TabIndex = 1;
+ //
+ // panel2
+ //
+ this.panel2.Controls.Add(this.listBox1);
+ this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.panel2.Location = new System.Drawing.Point(0, 63);
+ this.panel2.Name = "panel2";
+ this.panel2.Size = new System.Drawing.Size(748, 127);
+ this.panel2.TabIndex = 1;
+ //
+ // listBox1
+ //
+ this.listBox1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.listBox1.FormattingEnabled = true;
+ this.listBox1.ItemHeight = 12;
+ this.listBox1.Location = new System.Drawing.Point(0, 0);
+ this.listBox1.Name = "listBox1";
+ this.listBox1.Size = new System.Drawing.Size(748, 127);
+ this.listBox1.TabIndex = 0;
+ this.listBox1.DoubleClick += new System.EventHandler(this.listBox1_DoubleClick);
+ //
+ // btnClear
+ //
+ this.btnClear.Location = new System.Drawing.Point(12, 12);
+ this.btnClear.Name = "btnClear";
+ this.btnClear.Size = new System.Drawing.Size(104, 38);
+ this.btnClear.TabIndex = 0;
+ this.btnClear.Text = "クリア";
+ this.btnClear.UseVisualStyleBackColor = true;
+ this.btnClear.Click += new System.EventHandler(this.btnClear_Click);
+ //
+ // DebugMonitor
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(748, 190);
+ this.Controls.Add(this.panel2);
+ this.Controls.Add(this.panel1);
+ this.Name = "DebugMonitor";
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
+ this.Text = "出力";
+ this.TopMost = true;
+ this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.DebugMonitor_FormClosing);
+ this.Load += new System.EventHandler(this.DebugMonitor_Load);
+ this.panel1.ResumeLayout(false);
+ this.panel1.PerformLayout();
+ this.panel2.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Panel panel1;
+ private System.Windows.Forms.Panel panel2;
+ private System.Windows.Forms.Button btnClear;
+ private System.Windows.Forms.ListBox listBox1;
+ private System.Windows.Forms.TextBox textBox1;
+ private System.Windows.Forms.CheckBox cbTopMost;
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.TextBox textBox2;
+ private System.Windows.Forms.TextBox textBox3;
+ private System.Windows.Forms.CheckBox cbFillter;
+ private System.Windows.Forms.ToolTip toolTip1;
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.Share.Windows/Tool/DebugMonitor.resx b/HotelPms.Share.Windows/Tool/DebugMonitor.resx
new file mode 100644
index 0000000..9d9bc4d
--- /dev/null
+++ b/HotelPms.Share.Windows/Tool/DebugMonitor.resx
@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>17, 17</value>
+ </metadata>
+</root>
\ No newline at end of file
diff --git a/HotelPms.Share.Windows/Tool/ExitDialog.cs b/HotelPms.Share.Windows/Tool/ExitDialog.cs
new file mode 100644
index 0000000..46e9b45
--- /dev/null
+++ b/HotelPms.Share.Windows/Tool/ExitDialog.cs
@@ -0,0 +1,92 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+using System.Data.SqlClient;
+using HotelPms.Share.Util;
+using HotelPms.Share.Windows.Util;
+
+namespace HotelPms.Share.Windows.Tool
+{
+ public partial class ExitDialog : Form
+ {
+
+ /// ****************************** Description *******************************
+ /// ���V�X�e������
+ /// �@�z�e���Ǘ��V�X�e��
+ /// ���T�v
+ /// �@�ҏW�I�����
+ /// ������
+ /// �@2008/03/28�@���@�����@�@�V�K�쐬
+ /// ****************************** Declarations ******************************
+
+ #region �����������@Declartions�@����������
+
+ private int activeIndex = 1;
+
+ #endregion
+
+ #region �����������@Property�@����������
+ #endregion
+
+ #region �����������@Class Event�@����������
+
+ public ExitDialog()
+ {
+ InitializeComponent();
+ }
+
+ private void ExitDialog_Load(object sender, EventArgs e)
+ {
+ }
+
+ #endregion
+
+ #region �����������@Control Event�@����������
+
+ private void btnCmd_Click(object sender, EventArgs e)
+ {
+ activeIndex = CConvert.ToInt((sender as Button).Name.Replace("btnCmd", string.Empty));
+ switch (activeIndex)
+ {
+ case 1:
+ //�߂�
+ this.DialogResult = DialogResult.Cancel;
+ break;
+ case 2:
+ //�ۑ�
+ this.DialogResult = DialogResult.OK;
+ break;
+ case 3:
+ //�j��
+ this.DialogResult = DialogResult.Abort;
+ break;
+ }
+ this.Close();
+ }
+
+ #endregion
+
+ #region �����������@Private Function�@����������
+
+ #endregion
+
+ #region �����������@Public Function�@����������
+
+ public static DialogResult ExecuteDialog()
+ {
+ DialogResult ret = DialogResult.Cancel;
+ ExitDialog form = new ExitDialog();
+ ret = form.ShowDialog();
+ form.Dispose();
+ return ret;
+ }
+
+ #endregion
+
+
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.Share.Windows/Tool/ExitDialog.designer.cs b/HotelPms.Share.Windows/Tool/ExitDialog.designer.cs
new file mode 100644
index 0000000..a287e8b
--- /dev/null
+++ b/HotelPms.Share.Windows/Tool/ExitDialog.designer.cs
@@ -0,0 +1,148 @@
+namespace HotelPms.Share.Windows.Tool
+{
+ partial class ExitDialog
+ {
+ /// <summary>
+ /// 必要なデザイナ変数です。
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// 使用中のリソースをすべてクリーンアップします。
+ /// </summary>
+ /// <param name="disposing">マネージ リソースが破棄される場合 true、破棄されない場合は false です。</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows フォーム デザイナで生成されたコード
+
+ /// <summary>
+ /// デザイナ サポートに必要なメソッドです。このメソッドの内容を
+ /// コード エディタで変更しないでください。
+ /// </summary>
+ private void InitializeComponent()
+ {
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ExitDialog));
+ this.label2 = new System.Windows.Forms.Label();
+ this.pictureBox1 = new System.Windows.Forms.PictureBox();
+ this.btnCmd2 = new HotelPms.Share.Windows.Component.MaterialButton();
+ this.btnCmd1 = new HotelPms.Share.Windows.Component.MaterialButton();
+ this.btnCmd3 = new HotelPms.Share.Windows.Component.MaterialButton();
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
+ this.SuspendLayout();
+ //
+ // label2
+ //
+ this.label2.Font = new System.Drawing.Font("MS UI Gothic", 24F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.label2.ForeColor = System.Drawing.Color.Yellow;
+ this.label2.Location = new System.Drawing.Point(105, 10);
+ this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(443, 55);
+ this.label2.TabIndex = 1;
+ this.label2.Text = "登録・編集中です";
+ this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // pictureBox1
+ //
+ this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
+ this.pictureBox1.Location = new System.Drawing.Point(49, 16);
+ this.pictureBox1.Margin = new System.Windows.Forms.Padding(4);
+ this.pictureBox1.Name = "pictureBox1";
+ this.pictureBox1.Size = new System.Drawing.Size(49, 44);
+ this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
+ this.pictureBox1.TabIndex = 5;
+ this.pictureBox1.TabStop = false;
+ //
+ // btnCmd2
+ //
+ this.btnCmd2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this.btnCmd2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(105)))), ((int)(((byte)(217)))));
+ this.btnCmd2.Cursor = System.Windows.Forms.Cursors.Hand;
+ this.btnCmd2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.btnCmd2.Font = new System.Drawing.Font("メイリオ", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.btnCmd2.ForeColor = System.Drawing.Color.White;
+ this.btnCmd2.Location = new System.Drawing.Point(206, 83);
+ this.btnCmd2.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
+ this.btnCmd2.Name = "btnCmd2";
+ this.btnCmd2.Radius = 5F;
+ this.btnCmd2.Size = new System.Drawing.Size(151, 47);
+ this.btnCmd2.TabIndex = 15;
+ this.btnCmd2.Text = "保存";
+ this.btnCmd2.UseVisualStyleBackColor = false;
+ this.btnCmd2.Click += new System.EventHandler(this.btnCmd_Click);
+ //
+ // btnCmd1
+ //
+ this.btnCmd1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this.btnCmd1.BackColor = System.Drawing.Color.Purple;
+ this.btnCmd1.Cursor = System.Windows.Forms.Cursors.Hand;
+ this.btnCmd1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.btnCmd1.Font = new System.Drawing.Font("メイリオ", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.btnCmd1.ForeColor = System.Drawing.Color.White;
+ this.btnCmd1.Location = new System.Drawing.Point(28, 83);
+ this.btnCmd1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
+ this.btnCmd1.Name = "btnCmd1";
+ this.btnCmd1.Radius = 5F;
+ this.btnCmd1.Size = new System.Drawing.Size(151, 47);
+ this.btnCmd1.TabIndex = 16;
+ this.btnCmd1.Text = "戻る";
+ this.btnCmd1.UseVisualStyleBackColor = false;
+ this.btnCmd1.Click += new System.EventHandler(this.btnCmd_Click);
+ //
+ // btnCmd3
+ //
+ this.btnCmd3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this.btnCmd3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(64)))), ((int)(((byte)(0)))));
+ this.btnCmd3.Cursor = System.Windows.Forms.Cursors.Hand;
+ this.btnCmd3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.btnCmd3.Font = new System.Drawing.Font("メイリオ", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.btnCmd3.ForeColor = System.Drawing.Color.White;
+ this.btnCmd3.Location = new System.Drawing.Point(384, 83);
+ this.btnCmd3.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
+ this.btnCmd3.Name = "btnCmd3";
+ this.btnCmd3.Radius = 5F;
+ this.btnCmd3.Size = new System.Drawing.Size(151, 47);
+ this.btnCmd3.TabIndex = 17;
+ this.btnCmd3.Text = "廃棄";
+ this.btnCmd3.UseVisualStyleBackColor = false;
+ this.btnCmd3.Click += new System.EventHandler(this.btnCmd_Click);
+ //
+ // ExitDialog
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(36)))), ((int)(((byte)(36)))), ((int)(((byte)(36)))));
+ this.ClientSize = new System.Drawing.Size(564, 147);
+ this.Controls.Add(this.btnCmd3);
+ this.Controls.Add(this.btnCmd1);
+ this.Controls.Add(this.btnCmd2);
+ this.Controls.Add(this.pictureBox1);
+ this.Controls.Add(this.label2);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
+ this.Margin = new System.Windows.Forms.Padding(4);
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "ExitDialog";
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+ this.Text = "終了確認";
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.PictureBox pictureBox1;
+ public Component.MaterialButton btnCmd2;
+ public Component.MaterialButton btnCmd1;
+ public Component.MaterialButton btnCmd3;
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.Share.Windows/Tool/ExitDialog.resx b/HotelPms.Share.Windows/Tool/ExitDialog.resx
new file mode 100644
index 0000000..02c9001
--- /dev/null
+++ b/HotelPms.Share.Windows/Tool/ExitDialog.resx
@@ -0,0 +1,99 @@
+<root>
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <assembly alias="System.Drawing.Common" name="System.Drawing.Common, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" />
+ <data name="pictureBox1.Image" type="System.Drawing.Bitmap, System.Drawing.Common" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>
+ iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
+ wQAADsEBuJFr7QAAB25JREFUaEPtWW1olWUYPue4s+nMNp1Tt6nkR9ZyflTDdKCpRJhCEZXUD6MPNMjM
+ 0lAUsfqhWAlBiAn9MqMElSAIQs0yzFBTnLUtlzpd23TTHTvTjX3Qubuu+3mf97w7O8c53ccxeuHi/X6e
+ 67qv+36e5z3H9/8Ws4UlW0QGADniXLpztuYmv7S2+CUS6eeirGzVnSEk1BCU69eNAIkElTyPeW3N2jcU
+ zqPJt9Vf9glxLexT4kwfphEdoYDv942UuY+tVzivJNfmFSByNzAfGKUCeI14ceECeXze+8knoK7aJ0RU
+ wBhHwHyJtPTTa+F6n7qQP3GZvLP80+QS4RXAiBsBExwRA1wBxIJ5z8nMR9cmjwBLniBBaUsHaeY/04gi
+ kEYNfldA0rlA4rUXfBLCvrGe0R9syGMUEhlmRLSm6r1wbdSF2XPW9b0AEic0+iAXaUxzBGASa6YYTmZM
+ p2FRF/Dcnu3jk8MFKyAafabN3Vq4FKB7dWGsSFP/qAtAn7tgyROx0a8uD8pnGzLl6H5eoyjHhVBUgHVh
+ 9ZrP+0ZEzfmg1J1D9Cv90lgXjf7caUPE7wu4yMvOkMu1I3BvrIrks2E4xvf6zAUStyAZCfcHwcGydFGW
+ ku7nT5U0f6YiPTBclr3A0chxwRFA0IWCSW/Ku+991bsi2kW/BtFvMdEfmjFQBZD08JRCGZEyzd27tQCx
+ fCdcad4vKlrUu7NzXTkiTzD6IBEJpYIYch9FagXcFciVnJQZ7WDmhxgX8D5dmNibLrBAKSB0zhN9AitR
+ KyAzML6jANy3LlC06wLa6TUX3OgDYTig0W810Zf6gBZwMJAuWSkTlXResEhygzNkdsFDet+kmuNCtRHA
+ drZuniIFk5f3vAsa/RJErRzRR/5KY4aSUiFYB7GImT7M+9HpMyU/e55Myptlihj3vS5IHVxAGxTA9nrc
+ BRJXONEnAY0+RyCSAzjuUwCLluRnFjyr0eecYJ6BCxRNF9qGS/NfRoB1YcqDb/XcvFDx+6Bo9JG30oB0
+ IBmmBiYmi4y0LHWA5Bc8skSeLJolp/YPdO+bove4gLbCCErNyVSZOvWVnnGhthgzLkAB7KytCiRIntEn
+ sRoHOH5gdJbWwDNzVigooP0zEEzxdOFatiuAgekxFxj9iyejAuQKIkoSTCNLzAHrgAIWv7RFBWj+xzyj
+ 7yGFuNRuq0zRNq+WRl146umN3SeAxC3YiZs+FFGDaHIm9uDA9oEqYNvGvbpU+GjFPR2e0ffUhVFwJF0a
+ EX22TXy8rrB7XdDcP2FSiB1IFZbIIRQloxhLDMMiQQHj7l2qdXBoJ1KN12OftS7YNIK73e4CiVuEIICR
+ 0sgT1VgqO4RjwZFn5LjXdQiNd1/hcSFyAcWMtimC2LBqujxcuPL2XSgrG+EKYMPsyI0+SWAprfAeA8z7
+ vFEvmwnMc73DO0gfTSO64BFQcSj99l3oEP1SRL/Wyf0qTEiWCOcEe+ycb/9wqORkzjcFHOe+e8x2QF7+
+ GWNcQB8Np7rJBW/02aicw8cJo88aqID9JJIA5XvTVcAnq7Pi3nfBdugCBFBIy+mA9kXQhYJJi2Xh85u7
+ LuDyEZ9YhCDAjT6gaXQWnXcCCtACjnPPC22PLnBiQ5AafzMCiFt2gSOPJa/RP4so1Q0x0T+DqHEusCS8
+ x55zDp+VB+FagvvuMdujC638VhipLqgI9H3pFzMidckFb/TZSGspRhuSpwNnUkyn3Q2mp7qAmjk/yBVA
+ cF7okguMfu3PUQFskALUanZ2ugfAduluE2oBYNDY99WjURduakS69BNeACiALzcXw94qT+qUoSOCnXqP
+ Pecs3MFpOfo9zJUplxaJnm13THfpdMt4pBdm5+OYncGBYC3c1OzMkccrQMpAnALYuO0MQ1xc4B6Xzfyg
+ QVMuOJnpaNTJu9o+Uwl1IFdyNXhhRwBHtfvyl3TugnUgBAGMgKYP8QfqIF7HMeAXGZpRcDnBZXVe2nQz
+ ocV5vgPYDwNGESWpKuDvwwZvvzrnxrVw+PQEuXjACOALrViTKPlyLJnZOArL3VvYjp1zLqXRlJLnJyW/
+ yiiA3wWJ3nGv2T1HPDhAIQwiuTCgJ3Zn6foq4YhE8sSVg0YAI2DIIyrezm4AfsygKf2oJ/Efd53XJTV/
+ A433fFywPwYOAlqOp7gCCK5u47rA6Ffv8ylqfzACIsXI+1Mo3C6ANZDbv1AL2I38NZFNK5+I+3xCMHio
+ PyuAQSVYzBPuX6rfGg51s1FA5Xc+hRXRdCQgzcf87fGrg9hrnnN+D7BwSZ6R5zjuvR/3fe8155z9M+ok
+ Tj4Ef0MaM+41/YOknQsUUPGtT/78BmsQ7K2YvoTNCO/5jk2TVUDcIZXky772Sekeg5LdfQf2Ty4EeREU
+ wT8JKSDhr9p8sXgnKv5Lnxz7AtjhwB57r9nzW0VsOzF7ciCXkl1GAFOR5An+FJlwOKVNxNZ1+bJljYO1
+ MbDXvfe81xJdv9E17z3s2T+xbX2+G3mLTv9vtg/w575kQ6fk7bbpgz1C8PfKZIHl5FD8r2w+378Ud1ah
+ ALE1zAAAAABJRU5ErkJggg==
+</value>
+ </data>
+</root>
\ No newline at end of file
diff --git a/HotelPms.Share.Windows/Tool/MstList.cs b/HotelPms.Share.Windows/Tool/MstList.cs
new file mode 100644
index 0000000..7c85856
--- /dev/null
+++ b/HotelPms.Share.Windows/Tool/MstList.cs
@@ -0,0 +1,664 @@
+using HotelPms.Share.Data;
+using HotelPms.Share.Util;
+using HotelPms.Share.Windows.Util;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Diagnostics;
+using System.Drawing;
+using System.Windows.Forms;
+
+
+namespace HotelPms.Share.Windows.Tool
+{
+ public partial class MstList : Form
+ {
+ /// ****************************** Description *******************************
+ /// ���V�X�e������
+ /// �@�\��Z���^�[�Ǘ��V�X�e��
+ /// ���T�v
+ /// �@�ꗗ�I�����
+ /// ������
+ /// �@20090126 vic �V�K�쐬
+ /// ****************************** Declarations ******************************
+
+ #region �����������@Declartions�@����������
+
+ [Flags]
+ public enum Style : int
+ {
+ None = 0x1,
+ HideBottom = 0x2,
+ HideReturnField = 0x4,
+ HideGridHeader = 0x8,
+ }
+
+
+ private bool isReturnRow = false;
+
+ public bool IsReturnRow
+ {
+ set { isReturnRow = value; }
+ }
+
+ private DataGridViewRow m_CurrentRow = null;
+
+
+ public object SelecetdItem
+ {
+ get
+ {
+ return m_CurrentRow;
+ }
+ }
+
+
+ /// <summary>
+ /// �������
+ /// </summary>
+ public enum SearchType
+ {
+ Custom = 0, //Sql�������[�U�[����w�肷��
+ DataTable, //.ShowDataTable��DataTable���w�肷��
+ }
+
+ private DataView DtView = new DataView();
+
+ // ���ʕϐ�
+ private int intReturnField_IndexNo; // ReturnField��Index
+ private string strSqlSelected; // Sql���̑I���i���ۂɎ��s����SQL��)
+ private string strSql = string.Empty;
+ private string strAddCondition = string.Empty;
+ private string strReturnField = "�R�[�h";
+ private string strSearchField = "����";
+ private string strReturnValue = string.Empty;
+ private List<int> colWidth = new List<int>();
+ private bool strVisibleBottom = true;
+ private bool strVisibleReturnField = true;
+ private bool visibleGridHeader = true;
+ private Style style = Style.None;
+
+ #endregion
+
+ #region �����������@Property�@����������
+
+ /// <summary>
+ /// OwnerControl
+ /// </summary>
+ public DBConnectItem DBConnectData { get; set; }
+
+ /// <summary>
+ /// OwnerControl
+ /// </summary>
+ public Control OwnerControl { get; set; }
+
+ /// <summary>
+ /// SelectType
+ /// </summary>
+ public SearchType SelectType { get; set; }
+
+ /// <summary>
+ /// ShowDataTable(�\������f�[�^�e�[�u�����w�肷��A�������A�f�t�H���g�̏ꍇ�R�[�h�A���̃J�������K�v)
+ /// </summary>
+ public DataTable DtTable { get; set; }
+
+ /// <summary>
+ /// Sql
+ /// </summary>
+ public string Sql
+ {
+ set { strSql = value; }
+ get { return strSql; }
+ }
+
+ /// <summary>
+ /// AddCondition
+ /// </summary>
+ public string AddCondition
+ {
+ set { strAddCondition = value; }
+ get { return strAddCondition; }
+ }
+
+ /// <summary>
+ /// ReturnField(�I�������Ƃ��ɕԂ��t�B�[���h��)
+ /// </summary>
+ public string ReturnField
+ {
+ set { strReturnField = value; }
+ get { return strReturnField; }
+ }
+
+ /// <summary>
+ /// SearchField
+ /// </summary>
+ public string SearchField
+ {
+ set { strSearchField = value; }
+ get { return strSearchField; }
+ }
+
+ public Style CurStyle
+ {
+ set { style = value; }
+ get { return style; }
+ }
+
+ /// <summary>
+ /// VisibleBottom
+ /// </summary>
+ public List<int> ColWidth
+ {
+ set { colWidth = value; }
+ get { return colWidth; }
+ }
+
+ /// <summary>
+ /// ReturnValue(�I����Ɏ擾�ł���l)
+ /// </summary>
+ public string ReturnValue
+ {
+ get { return strReturnValue; }
+ }
+
+ #endregion
+
+ #region �����������@Class Event�@����������
+
+ /// <summary>
+ /// MstList
+ /// </summary>
+ public MstList()
+ {
+ InitializeComponent();
+ }
+
+ private void SetLocation()
+ {
+ DataGridView grid = OwnerControl as DataGridView;
+ Form ownerForm = GeneralSub.GetOwnerForm(grid);
+ //�\���ʒu����
+ System.Drawing.Point location = new System.Drawing.Point(0, 0);
+ System.Drawing.Point baseLocation = GeneralSub.GetPopUpLocationEx(ownerForm, grid);
+ location.X = baseLocation.X;
+ location.Y = baseLocation.Y;
+ if (location.X + this.Width > Screen.PrimaryScreen.Bounds.Width)
+ {
+ location.X = baseLocation.X - (location.X + this.Width - Screen.PrimaryScreen.Bounds.Width + 2);
+ }
+ if (location.Y + this.Height > Screen.PrimaryScreen.Bounds.Height)
+ {
+ location.Y = baseLocation.Y - grid.Rows[grid.CurrentCell.RowIndex].Height - this.Height;
+ }
+ this.SetBounds(location.X, location.Y, this.Width, this.Height);
+ }
+
+ /// <summary>
+ /// MstList_Load
+ /// </summary>
+ private void MstList_Load(object sender, EventArgs e)
+ {
+ //�\�����C�A�E�g
+ if (OwnerControl != null)
+ {
+ if (OwnerControl is DataGridView)
+ {
+ SetLocation();
+ }
+ else
+ {
+ this.StartPosition = FormStartPosition.Manual;
+ Point p = this.OwnerControl.PointToScreen(new Point(0, 0));
+
+ int x = p.X;
+ int y = p.Y + OwnerControl.Height;
+
+ if (p.Y + OwnerControl.Height + this.Height > Screen.PrimaryScreen.Bounds.Height)
+ {
+ y = p.Y - this.Height;
+ }
+
+ if (p.X + this.Width > Screen.PrimaryScreen.Bounds.Width)
+ {
+ x = Screen.PrimaryScreen.Bounds.Width - this.Width;
+ }
+
+ this.Location = new Point(x, y);
+ }
+ }
+ //if (msSqlNet == null) { msSqlNet = EnvironmentSetting.DbAccess; }
+
+ if ((style & Style.HideBottom) == Style.HideBottom) { strVisibleBottom = false; }
+ if ((style & Style.HideGridHeader) == Style.HideGridHeader) { visibleGridHeader = false; }
+ if ((style & Style.HideReturnField) == Style.HideReturnField) { strVisibleReturnField = false; }
+
+ //DefaultDataTable�ݒ�
+ SetDefaultHeader();
+
+ //Sql���̑I��
+ GetData();
+ DtTable.TableName = "SelectTable";
+
+ // DataView��DataSet�̃e�[�u����A������
+ DtView.Table = DtTable;
+ DtView.RowFilter = "";
+
+ // �f�[�^��\��
+ this.DataGridView1.DataSource = DtView;
+
+ //�����̌����L�[�ƕ���{�^����\�����邩(�����l:True(�\��))
+ if (this.strVisibleBottom == false)
+ {
+ this.panel2.Visible = false; // �p�l���P�ʂŔ�\����
+ }
+
+ // DataGridView1�̐ݒ�
+ //this.DataGridView1.RowHeadersVisible = false; //�s�w�b�_�[���\��
+ //this.DataGridView1.AutoResizeColumns( "AllCells", true); // ����������
+
+
+ //ReturnField(�߂�l��Ԃ����ڗ�)��IndexNo���擾����B
+ intReturnField_IndexNo = -1;
+
+ if (strReturnField == string.Empty)
+ {
+ intReturnField_IndexNo = 0;
+ }
+ else
+ {
+ for (int i = 0; i < this.DataGridView1.Columns.Count; i++)
+ {
+ if (this.DataGridView1.Columns[i].HeaderText.ToString() == strReturnField.ToString())
+ {
+ intReturnField_IndexNo = i;
+ }
+ }
+ }
+
+ if (intReturnField_IndexNo == -1)
+ {
+ intReturnField_IndexNo = 0;
+ strReturnField = string.Empty;
+ strSearchField = string.Empty;
+ }
+
+ //ReturnField(�߂�l��Ԃ����ڗ�)���擾����B
+ if (this.strReturnField.Length == 0)
+ {
+ this.strReturnField = this.DtView.Table.Columns[intReturnField_IndexNo].ColumnName.ToString();
+ }
+
+ //SearchField(�����L�[�Ɋ֘A�����鍀�ڗ�)���擾����B
+ if (this.strSearchField.Length == 0)
+ {
+ this.strSearchField = this.DtView.Table.Columns[intReturnField_IndexNo + 1].ColumnName.ToString();
+ }
+
+ //VisibleReturnField = false�̏ꍇ�AReturnField���\���Ƃ���B
+ if ((strVisibleReturnField == false) && (intReturnField_IndexNo > -1))
+ {
+ this.DataGridView1.Columns[intReturnField_IndexNo].Visible = false;
+ }
+
+ if (DtTable.Rows.Count == 0)
+ {
+ MessageBox.Show("�Y���f�[�^������܂���B");
+ this.Close();
+ return;
+ }
+
+ this.DataGridView1.ColumnHeadersVisible = visibleGridHeader;
+
+ //�G���[����
+ if (!ValidateInput())
+ {
+ Debug.Assert(false, "�J���pError", "Select���s�K�AsearchField�����l�A������ȊO");
+
+ }
+
+ DataGridView1.EnableHeadersVisualStyles = false;
+ DataGridView1.ColumnHeadersHeight = 25;
+ foreach (DataGridViewColumn col in DataGridView1.Columns)
+ {
+ col.HeaderCell.Style.BackColor = System.Drawing.Color.FromArgb(50, 50, 100);
+ col.HeaderCell.Style.ForeColor = Color.White;
+ }
+
+ DataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.None;//COMMENT:20080918 �ї� No1060
+ DataGridView1.AllowUserToResizeColumns = true;
+ if (colWidth == null || colWidth.Count == 0)
+ {
+ DataGridView1.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
+ return;
+ }
+ for (int i = 0; i < colWidth.Count; i++)
+ {
+ DataGridView1.Columns[i].Width = colWidth[i];
+ }
+ }
+
+ #region Esc�L�[�@����
+
+ protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
+ {
+ if (keyData == Keys.Escape)
+ {
+ //�e�X�g�p���b�Z�[�W
+ //MessageBox.Show("����{�^���N���b�N");
+
+ //�߂�l�Ƃ��Đݒ�(Empty�l)
+ strReturnValue = string.Empty;
+
+ //��ʂ����
+ this.Close();
+ }
+
+ return base.ProcessCmdKey(ref msg, keyData);
+ }
+
+ #endregion
+
+ #endregion
+
+ #region �����������@Control Event�@����������
+
+ /// <summary>
+ /// ����{�^���@�N���b�N�C�x���g
+ /// </summary>
+ private void btnClose_Click(object sender, EventArgs e)
+ {
+ //�e�X�g�p���b�Z�[�W
+ //MessageBox.Show("����{�^���N���b�N");
+
+ //�߂�l�Ƃ��Đݒ�(Empty�l)
+ strReturnValue = string.Empty;
+
+ //��ʂ����
+ this.Close();
+
+ }
+
+ /// <summary>
+ /// DataGridView1_CellMouseDoubleClick
+ /// </summary>
+ private void DataGridView1_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
+ {
+ if (DataGridView1.RowCount > 0)
+ {
+
+ //�e�X�g�p���b�Z�[�W
+ //int iCol = intReturnField_IndexNo; //��(ReturnField�̗�Œ�)
+ //int iRow = this.DataGridView1.CurrentCell.RowIndex; //�s(�I���s)
+ //MessageBox.Show("��" + iCol.ToString() + ":�s" + iRow.ToString() + "��" + CellValue.ToString.ToString() + "���I������Ă��܂�");
+
+
+ // �A�N�e�B�u�ȃZ���̒l��߂�l�Ƃ��Đݒ�
+ if (!isReturnRow)
+ {
+ strReturnValue = this.DataGridView1[this.strReturnField.ToString(), this.DataGridView1.CurrentCell.RowIndex].Value.ToString(); //Cell�l
+ }
+ else
+ {
+ m_CurrentRow = this.DataGridView1.CurrentRow;
+ }
+
+ //��ʂ����
+ this.Close();
+
+ }
+ }
+
+ /// <summary>
+ /// DataGridView1_KeyDown
+ /// </summary>
+ private void DataGridView1_KeyDown(object sender, KeyEventArgs e)
+ {
+ if (e.KeyCode == Keys.Enter)
+ {
+ if (DataGridView1.RowCount > 0)
+ {
+
+ if (!isReturnRow)
+ {
+ strReturnValue = this.DataGridView1[this.strReturnField.ToString(), this.DataGridView1.CurrentCell.RowIndex].Value.ToString(); //Cell�l
+ }
+ else
+ {
+ m_CurrentRow = this.DataGridView1.CurrentRow;
+ }
+ //��ʂ����
+ this.Close();
+
+ }
+ }
+ else if (e.KeyCode == Keys.Tab)
+ {
+ e.Handled = true;
+
+ if (e.Shift == true)
+ {
+ this.btnClose.Focus();
+ }
+ else
+ {
+ this.txtSearch.Focus();
+ }
+ }
+ }
+
+ /// <summary>
+ /// txtSearch_KeyDown
+ /// </summary>
+ private void txtSearch_KeyDown(object sender, KeyEventArgs e)
+ {
+
+ //string strFilterSql;
+
+ //Enter�L�[���͂̏ꍇ
+ if (e.KeyCode == Keys.Enter)
+ {
+ //DataGridView1�փt�H�[�J�X�ړ�
+ this.DataGridView1.Focus();
+ }
+
+ }
+
+ /// <summary>
+ /// txtSearch_KeyDown
+ /// </summary>
+ private void txtSearch_TextChanged(object sender, EventArgs e)
+ {
+
+ string strFilterSql;
+
+ // �t�B���^�[������
+ if ((this.txtSearch.Text.ToString() == string.Empty) || (this.strSearchField.ToString() == string.Empty))
+ {
+ //�t�B���^��������(�S��\��)
+ strFilterSql = string.Empty;
+ }
+ else
+ {
+ //�t�B���^�����w��
+ strFilterSql = this.strSearchField.ToString() + " LIKE '%" + this.txtSearch.Text.ToString() + "%'";
+ }
+
+ //�e�X�g�p���b�Z�[�W
+ //MessageBox.Show("�t�B���^�[�F" + strFilterSql.ToString());
+
+ // �t�B���^�[�������w�肵��DataView�Ɋi�[
+ DtView.RowFilter = strFilterSql.ToString();
+
+ // �f�[�^��\��
+ this.DataGridView1.DataSource = DtView;
+
+ }
+
+ private void txtSearch_Enter(object sender, EventArgs e)
+ {
+ txtSearch.BackColor = Color.LightSteelBlue;
+ }
+
+ private void txtSearch_Leave(object sender, EventArgs e)
+ {
+ txtSearch.BackColor = Color.White;
+ }
+
+ #endregion
+
+ #region �����������@Private Function�@����������
+
+ /// <summary>
+ /// Default�̐ݒ�
+ /// </summary>
+ private void SetDefaultHeader()
+ {
+ if (SelectType != SearchType.DataTable)
+ {
+ DtTable.Columns.AddRange(new DataColumn[] { new DataColumn("�R�[�h"), new DataColumn("����") });
+ }
+ }
+
+ /// <summary>
+ /// ValidateInput
+ /// </summary>
+ private bool ValidateInput()
+ {
+ if (isReturnRow) { return true; }
+ if (DtTable.Rows.Count == 0)
+ return false;
+ if (
+ DtTable.Columns[this.strSearchField].DataType != typeof(string)
+ // && DtSet.Tables[0].Columns[this.strSearchField].DataType != typeof(int)
+ )
+ return false;
+ return true;
+ }
+
+ /// <summary>
+ /// SelectSql
+ /// </summary>
+ private void GetData()
+ {
+ strSqlSelected = string.Empty;
+
+ //Sql���̑I��
+ if (SelectType.Equals(SearchType.Custom))
+ { //�J�X�^���ݒ�
+
+ strSqlSelected = this.strSql.ToString() + " " + this.strAddCondition.ToString();
+ // �f�[�^���擾
+ using (MsSqlNet msSqlNet = new MsSqlNet(DBConnectData.HostName, DBConnectData.UserID, DBConnectData.Password, DBConnectData.DBName))
+ {
+ DtTable = msSqlNet.GetDataTable(this.strSqlSelected.ToString());
+ }
+ }
+ }
+
+
+ #region ------------ �Œ�f�[�^�̃e�[�u���f�[�^ -------------------
+
+ /// <summary>
+ /// Enum�ɂ��f�[�^�e�[�u�������
+ /// </summary>
+ public DataTable GetTypeData(Type enumType)
+ {
+ DataTable dt = new DataTable();
+ dt.Columns.AddRange(new DataColumn[] { new DataColumn("�R�[�h"), new DataColumn("����") });
+ DataRow row = null;
+ foreach (object item in Enum.GetValues(enumType))
+ {
+ row = dt.NewRow();
+ dt.Rows.Add(row);
+ row["�R�[�h"] = ((int)item).ToString();
+ row["����"] = item.ToString();
+ }
+ return dt;
+ }
+
+ #endregion
+
+ #endregion
+
+ #region �����������@Public Function�@����������
+
+ public static string GetTypeName(Type enumType,int code)
+ {
+ try
+ {
+ return CConvert.ToString(Enum.GetName(enumType, code));
+ }
+ catch
+ {
+ return string.Empty;
+ }
+ }
+
+ public static string ExecuteSql(Control owner, DBConnectItem dbItem, string sql)
+ {
+ return Execute(SearchType.Custom, owner, dbItem, Style.None, Size.Empty, string.Empty, string.Empty, string.Empty, null, sql, null);
+ }
+
+ public static string ExecuteTable(Control owner, DataTable data)
+ {
+ return Execute(SearchType.DataTable, owner, null, Style.None, Size.Empty, string.Empty, string.Empty, string.Empty, null, string.Empty, data);
+ }
+
+ /// <summary>
+ /// �ꗗ�\��
+ /// </summary>
+ /// <returns></returns>
+ public static string Execute(SearchType type, Control owner, DBConnectItem dbItem)
+ {
+ return Execute(type, owner, dbItem, Style.None, Size.Empty, string.Empty, string.Empty, string.Empty, null, string.Empty, null);
+ }
+
+ public static string Execute(SearchType type, Control owner, DBConnectItem dbItem, Style style)
+ {
+ return Execute(type, owner, dbItem, style, Size.Empty, string.Empty, string.Empty, string.Empty, null, string.Empty, null);
+ }
+
+ public static string Execute(SearchType type, Control owner, DBConnectItem dbItem, Style style, Size size)
+ {
+ return Execute(type, owner, dbItem, style, size, string.Empty, string.Empty, string.Empty, null, string.Empty, null);
+ }
+
+ public static string Execute(SearchType type, Control owner, DBConnectItem dbItem, Style style, Size size, string addCondition)
+ {
+ return Execute(type, owner, dbItem, style, size, addCondition, string.Empty, string.Empty, null, string.Empty, null);
+ }
+
+ public static string Execute(SearchType type, Control owner, DBConnectItem dbItem, Style style, Size size, string addCondition,
+ string returnField, string searchField, List<int> colWidth)
+ {
+ return Execute(type, owner, dbItem, style, size, addCondition, returnField, searchField, colWidth, string.Empty, null);
+ }
+
+ public static string Execute(SearchType type, Control owner, DBConnectItem dbItem, Style style, Size size, string addCondition,
+ string returnField, string searchField, List<int> colWidth, string sql, DataTable data)
+ {
+ string result = string.Empty;
+ MstList mstList = new MstList();
+ mstList.SelectType = type;
+ mstList.OwnerControl = owner;
+ mstList.DBConnectData = dbItem;
+ mstList.CurStyle = style;
+ if (!size.Equals(Size.Empty)) { mstList.Size = size; }
+ if (returnField.Length > 0) { mstList.ReturnField = returnField; }
+ if (searchField.Length > 0) { mstList.SearchField = searchField; }
+ if (colWidth != null) { mstList.ColWidth = colWidth; }
+ mstList.AddCondition = addCondition;
+ mstList.Sql = sql;
+ mstList.DtTable = data;
+ mstList.ShowDialog();
+ if (mstList.ReturnValue.Length > 0)
+ {
+ result = mstList.ReturnValue;
+ }
+ mstList.Dispose();
+ return result;
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.Share.Windows/Tool/MstList.designer.cs b/HotelPms.Share.Windows/Tool/MstList.designer.cs
new file mode 100644
index 0000000..24cc602
--- /dev/null
+++ b/HotelPms.Share.Windows/Tool/MstList.designer.cs
@@ -0,0 +1,171 @@
+namespace HotelPms.Share.Windows.Tool
+{
+ partial class MstList
+ {
+ /// <summary>
+ /// 必要なデザイナ変数です。
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// 使用中のリソースをすべてクリーンアップします。
+ /// </summary>
+ /// <param name="disposing">マネージ リソースが破棄される場合 true、破棄されない場合は false です。</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows フォーム デザイナで生成されたコード
+
+ /// <summary>
+ /// デザイナ サポートに必要なメソッドです。このメソッドの内容を
+ /// コード エディタで変更しないでください。
+ /// </summary>
+ private void InitializeComponent()
+ {
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
+ this.panel1 = new System.Windows.Forms.Panel();
+ this.DataGridView1 = new System.Windows.Forms.DataGridView();
+ this.panel2 = new System.Windows.Forms.Panel();
+ this.txtSearch = new System.Windows.Forms.TextBox();
+ this.btnClose = new System.Windows.Forms.Button();
+ this.label1 = new System.Windows.Forms.Label();
+ this.panel1.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.DataGridView1)).BeginInit();
+ this.panel2.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // panel1
+ //
+ this.panel1.AutoSize = true;
+ this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.panel1.Controls.Add(this.DataGridView1);
+ this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.panel1.Location = new System.Drawing.Point(0, 0);
+ this.panel1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.panel1.Name = "panel1";
+ this.panel1.Size = new System.Drawing.Size(341, 300);
+ this.panel1.TabIndex = 4;
+ //
+ // DataGridView1
+ //
+ this.DataGridView1.AllowUserToAddRows = false;
+ this.DataGridView1.AllowUserToDeleteRows = false;
+ this.DataGridView1.AllowUserToResizeColumns = false;
+ this.DataGridView1.AllowUserToResizeRows = false;
+ dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
+ this.DataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
+ this.DataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.DisplayedCells;
+ this.DataGridView1.BorderStyle = System.Windows.Forms.BorderStyle.None;
+ this.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
+ this.DataGridView1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.DataGridView1.Location = new System.Drawing.Point(0, 0);
+ this.DataGridView1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.DataGridView1.MultiSelect = false;
+ this.DataGridView1.Name = "DataGridView1";
+ this.DataGridView1.ReadOnly = true;
+ this.DataGridView1.RowHeadersVisible = false;
+ this.DataGridView1.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders;
+ this.DataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
+ this.DataGridView1.Size = new System.Drawing.Size(339, 298);
+ this.DataGridView1.TabIndex = 1;
+ this.DataGridView1.CellMouseDoubleClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.DataGridView1_CellMouseDoubleClick);
+ this.DataGridView1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.DataGridView1_KeyDown);
+ //
+ // panel2
+ //
+ this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.panel2.Controls.Add(this.txtSearch);
+ this.panel2.Controls.Add(this.btnClose);
+ this.panel2.Controls.Add(this.label1);
+ this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.panel2.Location = new System.Drawing.Point(0, 300);
+ this.panel2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.panel2.Name = "panel2";
+ this.panel2.Size = new System.Drawing.Size(341, 32);
+ this.panel2.TabIndex = 5;
+ //
+ // txtSearch
+ //
+ this.txtSearch.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.txtSearch.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.txtSearch.Font = new System.Drawing.Font("MS UI Gothic", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.txtSearch.Location = new System.Drawing.Point(85, 0);
+ this.txtSearch.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.txtSearch.MaxLength = 10;
+ this.txtSearch.Name = "txtSearch";
+ this.txtSearch.Size = new System.Drawing.Size(172, 23);
+ this.txtSearch.TabIndex = 2;
+ this.txtSearch.TextChanged += new System.EventHandler(this.txtSearch_TextChanged);
+ this.txtSearch.Enter += new System.EventHandler(this.txtSearch_Enter);
+ this.txtSearch.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtSearch_KeyDown);
+ this.txtSearch.Leave += new System.EventHandler(this.txtSearch_Leave);
+ //
+ // btnClose
+ //
+ this.btnClose.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(236)))), ((int)(((byte)(233)))), ((int)(((byte)(216)))));
+ this.btnClose.Dock = System.Windows.Forms.DockStyle.Right;
+ this.btnClose.Font = new System.Drawing.Font("MS UI Gothic", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.btnClose.ForeColor = System.Drawing.Color.Black;
+ this.btnClose.Location = new System.Drawing.Point(257, 0);
+ this.btnClose.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.btnClose.Name = "btnClose";
+ this.btnClose.Size = new System.Drawing.Size(82, 30);
+ this.btnClose.TabIndex = 3;
+ this.btnClose.Text = "閉じる";
+ this.btnClose.UseVisualStyleBackColor = false;
+ this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
+ //
+ // label1
+ //
+ this.label1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(236)))), ((int)(((byte)(233)))), ((int)(((byte)(216)))));
+ this.label1.Dock = System.Windows.Forms.DockStyle.Left;
+ this.label1.Font = new System.Drawing.Font("MS UI Gothic", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.label1.ImageAlign = System.Drawing.ContentAlignment.TopLeft;
+ this.label1.Location = new System.Drawing.Point(0, 0);
+ this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(85, 30);
+ this.label1.TabIndex = 31;
+ this.label1.Text = "検索文字";
+ this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // MstList
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.AutoSize = true;
+ this.BackColor = System.Drawing.Color.White;
+ this.CausesValidation = false;
+ this.ClientSize = new System.Drawing.Size(341, 332);
+ this.Controls.Add(this.panel1);
+ this.Controls.Add(this.panel2);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+ this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.Name = "MstList";
+ this.Text = "MstListForm";
+ this.Load += new System.EventHandler(this.MstList_Load);
+ this.panel1.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.DataGridView1)).EndInit();
+ this.panel2.ResumeLayout(false);
+ this.panel2.PerformLayout();
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Panel panel1;
+ private System.Windows.Forms.DataGridView DataGridView1;
+ private System.Windows.Forms.Panel panel2;
+ private System.Windows.Forms.Button btnClose;
+ private System.Windows.Forms.TextBox txtSearch;
+ private System.Windows.Forms.Label label1;
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.Share.Windows/Tool/MstList.resx b/HotelPms.Share.Windows/Tool/MstList.resx
new file mode 100644
index 0000000..6dae11d
--- /dev/null
+++ b/HotelPms.Share.Windows/Tool/MstList.resx
@@ -0,0 +1,60 @@
+<root>
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root>
\ No newline at end of file
diff --git a/HotelPms.Share.Windows/UI/Colors.cs b/HotelPms.Share.Windows/UI/Colors.cs
new file mode 100644
index 0000000..a249d1d
--- /dev/null
+++ b/HotelPms.Share.Windows/UI/Colors.cs
@@ -0,0 +1,836 @@
+namespace HotelPms.Share.Windows.UI
+{
+ public static class Colors
+ {
+ public static class Red
+ {
+ public static string Default { get; } = "#F44336";
+
+
+ public static string Lighten5 { get; } = "#FFEBEE";
+
+
+ public static string Lighten4 { get; } = "#FFCDD2";
+
+
+ public static string Lighten3 { get; } = "#EF9A9A";
+
+
+ public static string Lighten2 { get; } = "#E57373";
+
+
+ public static string Lighten1 { get; } = "#EF5350";
+
+
+ public static string Darken1 { get; } = "#E53935";
+
+
+ public static string Darken2 { get; } = "#D32F2F";
+
+
+ public static string Darken3 { get; } = "#C62828";
+
+
+ public static string Darken4 { get; } = "#B71C1C";
+
+
+ public static string Accent1 { get; } = "#FF8A80";
+
+
+ public static string Accent2 { get; } = "#FF5252";
+
+
+ public static string Accent3 { get; } = "#FF1744";
+
+
+ public static string Accent4 { get; } = "#D50000";
+
+ }
+
+ public static class Pink
+ {
+ public static string Default { get; } = "#E91E63";
+
+
+ public static string Lighten5 { get; } = "#FCE4EC";
+
+
+ public static string Lighten4 { get; } = "#F8BBD0";
+
+
+ public static string Lighten3 { get; } = "#F48FB1";
+
+
+ public static string Lighten2 { get; } = "#F06292";
+
+
+ public static string Lighten1 { get; } = "#EC407A";
+
+
+ public static string Darken1 { get; } = "#D81B60";
+
+
+ public static string Darken2 { get; } = "#C2185B";
+
+
+ public static string Darken3 { get; } = "#AD1457";
+
+
+ public static string Darken4 { get; } = "#880E4F";
+
+
+ public static string Accent1 { get; } = "#FF80AB";
+
+
+ public static string Accent2 { get; } = "#FF4081";
+
+
+ public static string Accent3 { get; } = "#F50057";
+
+
+ public static string Accent4 { get; } = "#C51162";
+
+ }
+
+ public static class Purple
+ {
+ public static string Default { get; } = "#9C27B0";
+
+
+ public static string Lighten5 { get; } = "#F3E5F5";
+
+
+ public static string Lighten4 { get; } = "#E1BEE7";
+
+
+ public static string Lighten3 { get; } = "#CE93D8";
+
+
+ public static string Lighten2 { get; } = "#BA68C8";
+
+
+ public static string Lighten1 { get; } = "#AB47BC";
+
+
+ public static string Darken1 { get; } = "#8E24AA";
+
+
+ public static string Darken2 { get; } = "#7B1FA2";
+
+
+ public static string Darken3 { get; } = "#6A1B9A";
+
+
+ public static string Darken4 { get; } = "#4A148C";
+
+
+ public static string Accent1 { get; } = "#EA80FC";
+
+
+ public static string Accent2 { get; } = "#E040FB";
+
+
+ public static string Accent3 { get; } = "#D500F9";
+
+
+ public static string Accent4 { get; } = "#AA00FF";
+
+ }
+
+ public static class DeepPurple
+ {
+ public static string Default { get; } = "#673AB7";
+
+
+ public static string Lighten5 { get; } = "#EDE7F6";
+
+
+ public static string Lighten4 { get; } = "#D1C4E9";
+
+
+ public static string Lighten3 { get; } = "#B39DDB";
+
+
+ public static string Lighten2 { get; } = "#9575CD";
+
+
+ public static string Lighten1 { get; } = "#7E57C2";
+
+
+ public static string Darken1 { get; } = "#5E35B1";
+
+
+ public static string Darken2 { get; } = "#512DA8";
+
+
+ public static string Darken3 { get; } = "#4527A0";
+
+
+ public static string Darken4 { get; } = "#311B92";
+
+
+ public static string Accent1 { get; } = "#B388FF";
+
+
+ public static string Accent2 { get; } = "#7C4DFF";
+
+
+ public static string Accent3 { get; } = "#651FFF";
+
+
+ public static string Accent4 { get; } = "#6200EA";
+
+ }
+
+ public static class Indigo
+ {
+ public static string Default { get; } = "#3F51B5";
+
+
+ public static string Lighten5 { get; } = "#E8EAF6";
+
+
+ public static string Lighten4 { get; } = "#C5CAE9";
+
+
+ public static string Lighten3 { get; } = "#9FA8DA";
+
+
+ public static string Lighten2 { get; } = "#7986CB";
+
+
+ public static string Lighten1 { get; } = "#5C6BC0";
+
+
+ public static string Darken1 { get; } = "#3949AB";
+
+
+ public static string Darken2 { get; } = "#303F9F";
+
+
+ public static string Darken3 { get; } = "#283593";
+
+
+ public static string Darken4 { get; } = "#1A237E";
+
+
+ public static string Accent1 { get; } = "#8C9EFF";
+
+
+ public static string Accent2 { get; } = "#536DFE";
+
+
+ public static string Accent3 { get; } = "#3D5AFE";
+
+
+ public static string Accent4 { get; } = "#304FFE";
+
+ }
+
+ public static class Blue
+ {
+ public static string Default { get; } = "#2196F3";
+
+
+ public static string Lighten5 { get; } = "#E3F2FD";
+
+
+ public static string Lighten4 { get; } = "#BBDEFB";
+
+
+ public static string Lighten3 { get; } = "#90CAF9";
+
+
+ public static string Lighten2 { get; } = "#64B5F6";
+
+
+ public static string Lighten1 { get; } = "#42A5F5";
+
+
+ public static string Darken1 { get; } = "#1E88E5";
+
+
+ public static string Darken2 { get; } = "#1976D2";
+
+
+ public static string Darken3 { get; } = "#1565C0";
+
+
+ public static string Darken4 { get; } = "#0D47A1";
+
+
+ public static string Accent1 { get; } = "#82B1FF";
+
+
+ public static string Accent2 { get; } = "#448AFF";
+
+
+ public static string Accent3 { get; } = "#2979FF";
+
+
+ public static string Accent4 { get; } = "#2962FF";
+
+ }
+
+ public static class LightBlue
+ {
+ public static string Default { get; } = "#03A9F4";
+
+
+ public static string Lighten5 { get; } = "#E1F5FE";
+
+
+ public static string Lighten4 { get; } = "#B3E5FC";
+
+
+ public static string Lighten3 { get; } = "#81D4FA";
+
+
+ public static string Lighten2 { get; } = "#4FC3F7";
+
+
+ public static string Lighten1 { get; } = "#29B6F6";
+
+
+ public static string Darken1 { get; } = "#039BE5";
+
+
+ public static string Darken2 { get; } = "#0288D1";
+
+
+ public static string Darken3 { get; } = "#0277BD";
+
+
+ public static string Darken4 { get; } = "#01579B";
+
+
+ public static string Accent1 { get; } = "#80D8FF";
+
+
+ public static string Accent2 { get; } = "#40C4FF";
+
+
+ public static string Accent3 { get; } = "#00B0FF";
+
+
+ public static string Accent4 { get; } = "#0091EA";
+
+ }
+
+ public static class Cyan
+ {
+ public static string Default { get; } = "#00BCD4";
+
+
+ public static string Lighten5 { get; } = "#E0F7FA";
+
+
+ public static string Lighten4 { get; } = "#B2EBF2";
+
+
+ public static string Lighten3 { get; } = "#80DEEA";
+
+
+ public static string Lighten2 { get; } = "#4DD0E1";
+
+
+ public static string Lighten1 { get; } = "#26C6DA";
+
+
+ public static string Darken1 { get; } = "#00ACC1";
+
+
+ public static string Darken2 { get; } = "#0097A7";
+
+
+ public static string Darken3 { get; } = "#00838F";
+
+
+ public static string Darken4 { get; } = "#006064";
+
+
+ public static string Accent1 { get; } = "#84FFFF";
+
+
+ public static string Accent2 { get; } = "#18FFFF";
+
+
+ public static string Accent3 { get; } = "#00E5FF";
+
+
+ public static string Accent4 { get; } = "#00B8D4";
+
+ }
+
+ public static class Teal
+ {
+ public static string Default { get; } = "#009688";
+
+
+ public static string Lighten5 { get; } = "#E0F2F1";
+
+
+ public static string Lighten4 { get; } = "#B2DFDB";
+
+
+ public static string Lighten3 { get; } = "#80CBC4";
+
+
+ public static string Lighten2 { get; } = "#4DB6AC";
+
+
+ public static string Lighten1 { get; } = "#26A69A";
+
+
+ public static string Darken1 { get; } = "#00897B";
+
+
+ public static string Darken2 { get; } = "#00796B";
+
+
+ public static string Darken3 { get; } = "#00695C";
+
+
+ public static string Darken4 { get; } = "#004D40";
+
+
+ public static string Accent1 { get; } = "#A7FFEB";
+
+
+ public static string Accent2 { get; } = "#64FFDA";
+
+
+ public static string Accent3 { get; } = "#1DE9B6";
+
+
+ public static string Accent4 { get; } = "#00BFA5";
+
+ }
+
+ public static class Green
+ {
+ public static string Default { get; } = "#4CAF50";
+
+
+ public static string Lighten5 { get; } = "#E8F5E9";
+
+
+ public static string Lighten4 { get; } = "#C8E6C9";
+
+
+ public static string Lighten3 { get; } = "#A5D6A7";
+
+
+ public static string Lighten2 { get; } = "#81C784";
+
+
+ public static string Lighten1 { get; } = "#66BB6A";
+
+
+ public static string Darken1 { get; } = "#43A047";
+
+
+ public static string Darken2 { get; } = "#388E3C";
+
+
+ public static string Darken3 { get; } = "#2E7D32";
+
+
+ public static string Darken4 { get; } = "#1B5E20";
+
+
+ public static string Accent1 { get; } = "#B9F6CA";
+
+
+ public static string Accent2 { get; } = "#69F0AE";
+
+
+ public static string Accent3 { get; } = "#00E676";
+
+
+ public static string Accent4 { get; } = "#00C853";
+
+ }
+
+ public static class LightGreen
+ {
+ public static string Default { get; } = "#8BC34A";
+
+
+ public static string Lighten5 { get; } = "#F1F8E9";
+
+
+ public static string Lighten4 { get; } = "#DCEDC8";
+
+
+ public static string Lighten3 { get; } = "#C5E1A5";
+
+
+ public static string Lighten2 { get; } = "#AED581";
+
+
+ public static string Lighten1 { get; } = "#9CCC65";
+
+
+ public static string Darken1 { get; } = "#7CB342";
+
+
+ public static string Darken2 { get; } = "#689F38";
+
+
+ public static string Darken3 { get; } = "#558B2F";
+
+
+ public static string Darken4 { get; } = "#33691E";
+
+
+ public static string Accent1 { get; } = "#CCFF90";
+
+
+ public static string Accent2 { get; } = "#B2FF59";
+
+
+ public static string Accent3 { get; } = "#76FF03";
+
+
+ public static string Accent4 { get; } = "#64DD17";
+
+ }
+
+ public static class Lime
+ {
+ public static string Default { get; } = "#CDDC39";
+
+
+ public static string Lighten5 { get; } = "#F9FBE7";
+
+
+ public static string Lighten4 { get; } = "#F0F4C3";
+
+
+ public static string Lighten3 { get; } = "#E6EE9C";
+
+
+ public static string Lighten2 { get; } = "#DCE775";
+
+
+ public static string Lighten1 { get; } = "#D4E157";
+
+
+ public static string Darken1 { get; } = "#C0CA33";
+
+
+ public static string Darken2 { get; } = "#AFB42B";
+
+
+ public static string Darken3 { get; } = "#9E9D24";
+
+
+ public static string Darken4 { get; } = "#827717";
+
+
+ public static string Accent1 { get; } = "#F4FF81";
+
+
+ public static string Accent2 { get; } = "#EEFF41";
+
+
+ public static string Accent3 { get; } = "#C6FF00";
+
+
+ public static string Accent4 { get; } = "#AEEA00";
+
+ }
+
+ public static class Yellow
+ {
+ public static string Default { get; } = "#FFEB3B";
+
+
+ public static string Lighten5 { get; } = "#FFFDE7";
+
+
+ public static string Lighten4 { get; } = "#FFF9C4";
+
+
+ public static string Lighten3 { get; } = "#FFF59D";
+
+
+ public static string Lighten2 { get; } = "#FFF176";
+
+
+ public static string Lighten1 { get; } = "#FFEE58";
+
+
+ public static string Darken1 { get; } = "#FDD835";
+
+
+ public static string Darken2 { get; } = "#FBC02D";
+
+
+ public static string Darken3 { get; } = "#F9A825";
+
+
+ public static string Darken4 { get; } = "#F57F17";
+
+
+ public static string Accent1 { get; } = "#FFFF8D";
+
+
+ public static string Accent2 { get; } = "#FFFF00";
+
+
+ public static string Accent3 { get; } = "#FFEA00";
+
+
+ public static string Accent4 { get; } = "#FFD600";
+
+ }
+
+ public static class Amber
+ {
+ public static string Default { get; } = "#FFC107";
+
+
+ public static string Lighten5 { get; } = "#FFF8E1";
+
+
+ public static string Lighten4 { get; } = "#FFECB3";
+
+
+ public static string Lighten3 { get; } = "#FFE082";
+
+
+ public static string Lighten2 { get; } = "#FFD54F";
+
+
+ public static string Lighten1 { get; } = "#FFCA28";
+
+
+ public static string Darken1 { get; } = "#FFB300";
+
+
+ public static string Darken2 { get; } = "#FFA000";
+
+
+ public static string Darken3 { get; } = "#FF8F00";
+
+
+ public static string Darken4 { get; } = "#FF6F00";
+
+
+ public static string Accent1 { get; } = "#FFE57F";
+
+
+ public static string Accent2 { get; } = "#FFD740";
+
+
+ public static string Accent3 { get; } = "#FFC400";
+
+
+ public static string Accent4 { get; } = "#FFAB00";
+
+ }
+
+ public static class Orange
+ {
+ public static string Default { get; } = "#FF9800";
+
+
+ public static string Lighten5 { get; } = "#FFF3E0";
+
+
+ public static string Lighten4 { get; } = "#FFE0B2";
+
+
+ public static string Lighten3 { get; } = "#FFCC80";
+
+
+ public static string Lighten2 { get; } = "#FFB74D";
+
+
+ public static string Lighten1 { get; } = "#FFA726";
+
+
+ public static string Darken1 { get; } = "#FB8C00";
+
+
+ public static string Darken2 { get; } = "#F57C00";
+
+
+ public static string Darken3 { get; } = "#EF6C00";
+
+
+ public static string Darken4 { get; } = "#E65100";
+
+
+ public static string Accent1 { get; } = "#FFD180";
+
+
+ public static string Accent2 { get; } = "#FFAB40";
+
+
+ public static string Accent3 { get; } = "#FF9100";
+
+
+ public static string Accent4 { get; } = "#FF6D00";
+
+ }
+
+ public static class DeepOrange
+ {
+ public static string Default { get; } = "#FF5722";
+
+
+ public static string Lighten5 { get; } = "#FBE9E7";
+
+
+ public static string Lighten4 { get; } = "#FFCCBC";
+
+
+ public static string Lighten3 { get; } = "#FFAB91";
+
+
+ public static string Lighten2 { get; } = "#FF8A65";
+
+
+ public static string Lighten1 { get; } = "#FF7043";
+
+
+ public static string Darken1 { get; } = "#F4511E";
+
+
+ public static string Darken2 { get; } = "#E64A19";
+
+
+ public static string Darken3 { get; } = "#D84315";
+
+
+ public static string Darken4 { get; } = "#BF360C";
+
+
+ public static string Accent1 { get; } = "#FF9E80";
+
+
+ public static string Accent2 { get; } = "#FF6E40";
+
+
+ public static string Accent3 { get; } = "#FF3D00";
+
+
+ public static string Accent4 { get; } = "#DD2C00";
+
+ }
+
+ public static class Brown
+ {
+ public static string Default { get; } = "#795548";
+
+
+ public static string Lighten5 { get; } = "#EFEBE9";
+
+
+ public static string Lighten4 { get; } = "#D7CCC8";
+
+
+ public static string Lighten3 { get; } = "#BCAAA4";
+
+
+ public static string Lighten2 { get; } = "#A1887F";
+
+
+ public static string Lighten1 { get; } = "#8D6E63";
+
+
+ public static string Darken1 { get; } = "#6D4C41";
+
+
+ public static string Darken2 { get; } = "#5D4037";
+
+
+ public static string Darken3 { get; } = "#4E342E";
+
+
+ public static string Darken4 { get; } = "#3E2723";
+
+ }
+
+ public static class BlueGrey
+ {
+ public static string Default { get; } = "#607D8B";
+
+
+ public static string Lighten5 { get; } = "#ECEFF1";
+
+
+ public static string Lighten4 { get; } = "#CFD8DC";
+
+
+ public static string Lighten3 { get; } = "#B0BEC5";
+
+
+ public static string Lighten2 { get; } = "#90A4AE";
+
+
+ public static string Lighten1 { get; } = "#78909C";
+
+
+ public static string Darken1 { get; } = "#546E7A";
+
+
+ public static string Darken2 { get; } = "#455A64";
+
+
+ public static string Darken3 { get; } = "#37474F";
+
+
+ public static string Darken4 { get; } = "#263238";
+
+ }
+
+ public static class Grey
+ {
+ public static string Default { get; } = "#9E9E9E";
+
+
+ public static string Lighten5 { get; } = "#FAFAFA";
+
+
+ public static string Lighten4 { get; } = "#F5F5F5";
+
+
+ public static string Lighten3 { get; } = "#EEEEEE";
+
+
+ public static string Lighten2 { get; } = "#E0E0E0";
+
+
+ public static string Lighten1 { get; } = "#BDBDBD";
+
+
+ public static string Darken1 { get; } = "#757575";
+
+
+ public static string Darken2 { get; } = "#616161";
+
+
+ public static string Darken3 { get; } = "#424242";
+
+
+ public static string Darken4 { get; } = "#212121";
+
+ }
+
+ public static class Shades
+ {
+ public static string Black { get; } = "#000000";
+
+
+ public static string White { get; } = "#FFFFFF";
+
+
+ public static string Transparent { get; } = "transparent";
+
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/UI/Palette.cs b/HotelPms.Share.Windows/UI/Palette.cs
new file mode 100644
index 0000000..5fdaa92
--- /dev/null
+++ b/HotelPms.Share.Windows/UI/Palette.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HotelPms.Share.Windows.UI
+{
+ public class Palette
+ {
+ public Color Primary { get; set; } = Color.Blue;
+
+ public Color Secondary { get; set; } = Color.White;
+ }
+}
diff --git a/HotelPms.Share.Windows/UI/Theme.cs b/HotelPms.Share.Windows/UI/Theme.cs
new file mode 100644
index 0000000..df3ff0b
--- /dev/null
+++ b/HotelPms.Share.Windows/UI/Theme.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HotelPms.Share.Windows.UI
+{
+ public class Theme
+ {
+ public Palette? Palette { get; set; }
+ }
+}
diff --git a/HotelPms.Share.Windows/Util/CTextBoxArray.cs b/HotelPms.Share.Windows/Util/CTextBoxArray.cs
new file mode 100644
index 0000000..43a7daf
--- /dev/null
+++ b/HotelPms.Share.Windows/Util/CTextBoxArray.cs
@@ -0,0 +1,680 @@
+using System;
+using System.ComponentModel;
+using System.Collections.Generic;
+using System.Text;
+using System.Windows.Forms;
+using HotelPms.Share.Util;
+using System.Drawing;
+using HotelPms.Share.Windows.Component;
+
+namespace HotelPms.Share.Windows.Util
+{
+ public class CTextBoxArray
+ {
+ private class ItemsComparer : IComparer<CTextBox>
+ {
+ public int Compare(CTextBox x, CTextBox y)
+ {
+ if (x == null)
+ {
+ return (y == null ? 0 : -1);
+ }
+ else
+ {
+ if (y == null)
+ {
+ return 1;
+ }
+ else
+ {
+ return x.TabIndex.CompareTo(y.TabIndex);
+ }
+ }
+ }
+ }
+ private ItemsComparer itemsComparer = new ItemsComparer();
+
+ public delegate void TBArrayEventHandler(object sender, int index, CTextBoxArrayBaseEventArgs e);
+ public delegate bool TBArrayResultEventHandler(object sender, int index, CTextBoxArrayBaseEventArgs e);
+ public delegate void TBArrayValidatingEventHandler(object sender, int index, CancelEventArgs e);
+ public delegate void TBArrayKeyDownEventHandler(object sender, int index, KeyEventArgs e);
+ public delegate void TBArrayPreviewKeyDownEventHandler(object sender, int index, PreviewKeyDownEventArgs e);
+ public delegate void TBArrayKeyPressEventHandler(object sender, int index, KeyPressEventArgs e);
+
+ public event TBArrayKeyPressEventHandler KeyPress;
+ public event TBArrayKeyDownEventHandler KeyDown;
+ public event TBArrayPreviewKeyDownEventHandler PreviewKeyDown;
+ public event TBArrayKeyDownEventHandler BeforeAutoNextFocus;
+ public event TBArrayKeyDownEventHandler AfterAutoNextFocus;
+ public event TBArrayValidatingEventHandler Validating;
+ public event TBArrayEventHandler TextChanged;
+ public event TBArrayEventHandler Enter;
+ public event TBArrayEventHandler AfterEnter;
+ public event TBArrayEventHandler Leave;
+ public event TBArrayEventHandler AfterLeave;
+ public event TBArrayEventHandler Validated;
+
+ public event TBArrayEventHandler ValueChanged; //���͍��ڕύX�������ǂ���
+ public event TBArrayResultEventHandler IsCorrectEtc; //�R���g���[���v���p�e�B�ȊO�̃`�F�b�N���s���Ƃ��ɂ��̃C�x���g���ōs���B
+ public event TBArrayKeyDownEventHandler NextFocus;
+ public event TBArrayKeyDownEventHandler KeyEnd;
+ public event TBArrayEventHandler ForceValidating;
+ public event TBArrayKeyPressEventHandler MultiKeyPress;
+
+ private List<CTextBox> items = new List<CTextBox>();
+ private string orgMstName = string.Empty;
+ private int acitveIndex = 0;
+ private Color orgBkColor = Color.White;
+ private bool isChangeLine = false;
+ private bool disbleValidating = false;
+ private bool disbleTextChanged = false;
+ private bool autoNextFocus = false;
+ private bool m_ReadOnly = false;
+
+ private bool m_ForceChangeLine = false;
+
+ /// <summary>
+ /// �}���`���͂̏ꍇ�A�uEnter�v�ʼn��s
+ /// </summary>
+ public bool ForceChangeLine
+ {
+ get { return m_ForceChangeLine; }
+ set { m_ForceChangeLine = value; }
+ }
+
+ private bool m_UsingOrgBackColor = false;
+
+ public bool UsingOrgBackColor
+ {
+ get { return m_UsingOrgBackColor; }
+ set { m_UsingOrgBackColor = value; }
+ }
+
+ /// <summary>
+ ///
+ /// </summary>
+ public bool ReadOnly
+ {
+ get { return m_ReadOnly; }
+ set
+ {
+ try
+ {
+ m_ReadOnly = value;
+ foreach (CTextBox item in items) { item.ReadOnly = m_ReadOnly; }
+ }
+ catch { }
+ }
+ }
+
+
+ /// <summary>
+ /// ���̃}�X�^���i�t�H�b�J�X�̎��j
+ /// </summary>
+ public string OrgMstName
+ {
+ get { return orgMstName; }
+ set { orgMstName = value; }
+ }
+
+ public List<CTextBox> Items
+ {
+ get { return items; }
+ }
+
+ public bool DisbleValidating
+ {
+ get { return disbleValidating; }
+ set { disbleValidating = value; }
+ }
+
+ public bool DisbleTextChanged
+ {
+ get { return disbleTextChanged; }
+ set { disbleTextChanged = value; }
+ }
+
+ /// <summary>
+ /// TAB���ʂŃt�H�[�J�X���邩�ǂ���
+ /// </summary>
+ public bool AutoNextFocus
+ {
+ get { return autoNextFocus; }
+ set { autoNextFocus = value; }
+ }
+
+ private bool m_ShiftEnterEnabled = false;
+
+ /// <summary>
+ /// ShiftEnter = KeyUp ?
+ /// </summary>
+ public bool ShiftEnterEnabled
+ {
+ get { return m_ShiftEnterEnabled; }
+ set { m_ShiftEnterEnabled = value; }
+ }
+
+
+ public CTextBoxArray()
+ : this(false, null)
+ { }
+
+ public CTextBoxArray(bool autoNextFocus)
+ : this(autoNextFocus, null)
+ { }
+
+ public CTextBoxArray(bool autoNextFocus, Control owner)
+ {
+ this.autoNextFocus = autoNextFocus;
+ if (owner != null) { InitInputSetting(owner); }
+ }
+
+ public void Add(CTextBox item)
+ {
+ Add(item, -1);
+ }
+
+ public void Add(CTextBox item, int index)
+ {
+ item.Enter += new EventHandler(this.Cell_Enter);
+ item.Leave += new EventHandler(this.Cell_Leave);
+ item.KeyPress += new KeyPressEventHandler(this.Cell_KeyPress);
+ item.KeyDown += new KeyEventHandler(Cell_KeyDown);
+ item.PreviewKeyDown += new PreviewKeyDownEventHandler(Cell_PreviewKeyDown);
+ item.TextChanged += new EventHandler(this.Cell_TextChanged);
+ item.Validating += new CancelEventHandler(this.Cell_Validating);
+ item.Validated += new EventHandler(this.Cell_Validated);
+ item.DoubleClick += new EventHandler(Cell_DoubleClick);
+ if (index >= 0)
+ {
+ items.Insert(index,item);
+ }
+ else
+ {
+ items.Add(item);
+ }
+ //enableManager.Add(new ControlEnableManager(item));
+ }
+
+ private void Cell_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
+ {
+ int index = items.IndexOf((sender as CTextBox));
+ if (PreviewKeyDown != null)
+ {
+ PreviewKeyDown(this, index, e);
+ }
+ }
+
+
+ public static void SetCtrlEnabled(Control obj,bool value)
+ {
+ try
+ {
+ if (obj is CTextBox)
+ {
+ (obj as CTextBox).Enabled = value;
+ }
+ else
+ {
+ obj.Enabled = value;
+ }
+ }
+ catch { }
+ }
+
+
+ /// <summary>
+ /// ��ʂɓ��͍��ڈȊO��CTextBox����͕s�ɂ���
+ /// </summary>
+ /// <param name="obj">�e�e��</param>
+ /// <param name="tbArray">���͊Ǘ�����</param>
+ public void SetCTextProtect(Control obj)
+ {
+ foreach (Control item in obj.Controls)
+ {
+ if (item is UserControl) { continue; }
+
+ if (item is CTextBox)
+ {
+ if (!items.Contains(item as CTextBox)) { (item as CTextBox).Enabled = false; }
+ }
+
+ SetCTextProtect(item);
+ }
+ }
+
+ public void ClearText()
+ {
+ foreach (CTextBox item in items)
+ {
+ item.Text = string.Empty;
+ if (item.MstNameCtrl != null)
+ {
+ item.MstNameCtrl.Text = string.Empty;
+ }
+ }
+ }
+
+ public void ClearTag()
+ {
+ foreach (CTextBox item in items)
+ {
+ item.Tag = null;
+ }
+ }
+
+ public void PerformValidated(object sender, EventArgs e)
+ {
+ Cell_Validated(sender, e);
+ }
+
+ public void PerformValidating(object sender, CancelEventArgs e)
+ {
+ Cell_Validating(sender, e);
+ }
+
+ public void PerformEnter(object sender, EventArgs e)
+ {
+ Cell_Enter(sender, e);
+ }
+
+ public void PerformEnter()
+ {
+ Cell_Enter(items[acitveIndex], new EventArgs());
+ }
+
+ public void PerformKeyDown(object sender, KeyEventArgs e)
+ {
+ Cell_KeyDown(sender, e);
+ }
+
+ private void SetItemValue(object sender, int index, string value)
+ {
+ (sender as CTextBox).TextChanged -= new EventHandler(Cell_TextChanged);
+ this.Items[index].Text = value;
+ (sender as CTextBox).TextChanged += new EventHandler(Cell_TextChanged);
+ }
+
+ private string GetItemValue(object sender, int index)
+ {
+ string value = string.Empty;
+ value = this.Items[index].Text;
+ return value;
+ }
+
+ private bool CheckValueChanged(object sender, int index)
+ {
+ string newInputValue = string.Empty;
+ if ((InputCtrl.GetShowStyle(this.Items[index]) & numShowStyle.ThousandSeparator) == numShowStyle.ThousandSeparator)
+ {
+ newInputValue = CConvert.ToThousandSeparator(CConvert.ToDecimal(this.Items[index].Text));
+ }
+ else
+ {
+ newInputValue = GetItemValue(sender, index);
+ }
+ if (!newInputValue.Equals(this.Items[index].OrgText))
+ {
+ //�l�ύX�������ǂ���
+ if (ValueChanged != null)
+ {
+ string saveText = GetItemValue(sender, index);
+ CTextBoxArrayBaseEventArgs vce = new CTextBoxArrayBaseEventArgs() { Cancel = false };
+ ValueChanged(this, index, vce);
+ if (vce.Cancel)
+ {
+ //���̒l�ɖ߂�
+ if (vce.ResetOrgValue) { SetItemValue(sender, index, this.Items[index].OrgText); }
+ return false;
+ }
+ SetItemValue(sender, index, saveText);
+ }
+ }
+ return true;
+ }
+
+
+ private void SetInputValue(object sender, int index)
+ {
+ if ((InputCtrl.GetShowStyle(this.Items[index]) & numShowStyle.ThousandSeparator) == numShowStyle.ThousandSeparator)
+ {
+ this.Items[index].OrgText = CConvert.ToThousandSeparator(CConvert.ToDecimal(this.Items[index].Text));
+ }
+ else
+ {
+ this.Items[index].OrgText = GetItemValue(sender, index);
+ }
+ //System.Diagnostics.Debug.WriteLine(string.Format("SetInputValue({0},{1}) orgValue = {2}", (sender as Control).Name, index, orgValue));
+ }
+
+
+ private void Cell_KeyDown(object sender, KeyEventArgs e)
+ {
+ int index = items.IndexOf((sender as CTextBox));
+ if (KeyDown != null)
+ {
+ KeyDown(this, index, e);
+ }
+ else
+ {
+ switch (e.KeyCode)
+ {
+ case Keys.Down:
+ case Keys.Return:
+ if (m_ShiftEnterEnabled && e.KeyCode == Keys.Return && e.Shift)
+ {
+ Cell_KeyDown(sender, new KeyEventArgs(Keys.Up));
+ return;
+ }
+
+ if (e.Control == true && this.Items[index].Multiline)
+ {
+ isChangeLine = true;
+ return;
+ }
+
+ isChangeLine = false;
+
+ if (!this.Items[index].EnableUpDownKey && e.KeyCode == Keys.Up) { return; }
+
+ if (!m_ReadOnly)
+ {
+ if (!CheckValueChanged(sender, index)) { return; } //�l�ύX������A�C�x���g����
+
+ if (!InputCtrl.IsCorrectText(this.Items[index]))
+ {
+ (sender as Control).Focus();
+ return;
+ }
+
+ //���̊O�`�F�b�N
+ if (IsCorrectEtc != null)
+ {
+ if (!IsCorrectEtc(this, index, new CTextBoxArrayBaseEventArgs() { CheckAll = false, ShowErrMsg = true }))
+ {
+ (sender as Control).Focus(); //�������Ȃ����́H�H
+ return;
+ }
+ }
+
+ SetInputValue(sender, index);
+ }
+ if (NextFocus != null) { NextFocus(this, index, e); }
+ if (autoNextFocus) { SetAutoNextFocus(index, e); }
+ break;
+ case Keys.Up:
+ case Keys.Escape:
+ if (m_ShiftEnterEnabled && e.KeyCode == Keys.Up && this.Items[index].Multiline && !IsTopLine(this.Items[index])) { return; }
+ if (!this.Items[index].EnableUpDownKey && e.KeyCode == Keys.Down) { return; }
+ if (NextFocus != null) { NextFocus(this, index, e); }
+ if (autoNextFocus) { SetAutoNextFocus(index, e); }
+ break;
+ case Keys.End:
+ if (m_ReadOnly) { e.Handled = true; return; }
+ if ((InputCtrl.GetShowStyle(this.Items[index]) & numShowStyle.ShowList) != numShowStyle.ShowList) { return; }
+ if (KeyEnd != null)
+ {
+ e.Handled = true;
+ KeyEnd(this, index, e);
+ }
+ break;
+ }
+ }
+ }
+
+ private bool IsTopLine(CTextBox obj)
+ {
+ try
+ {
+ if (obj.SelectionStart == 0) { return true; }
+
+ string line = obj.Text.Substring(0, obj.SelectionStart);
+ return !line.Contains(Environment.NewLine);
+ }
+ catch
+ {
+ return true;
+ }
+ }
+
+ private void Cell_Validated(object sender, EventArgs e)
+ {
+ if (m_ReadOnly) { return; }
+ int index = items.IndexOf((sender as CTextBox));
+ if (Validated != null)
+ {
+ Validated(this, index, new CTextBoxArrayBaseEventArgs());
+ }
+ }
+
+ private void Cell_DoubleClick(object sender, EventArgs e)
+ {
+ if (m_ReadOnly) { return; }
+ CTextBox curField = (sender as CTextBox);
+ int index = items.IndexOf(curField);
+ if ((InputCtrl.GetShowStyle(curField) & numShowStyle.ShowList) == numShowStyle.ShowList)
+ {
+ //�ꗗ�\��
+ if (KeyEnd != null)
+ {
+ KeyEnd(this, index, new KeyEventArgs(Keys.End));
+ }
+ }
+ }
+
+ private void Cell_Enter(object sender, EventArgs e)
+ {
+ CTextBox curField = (sender as CTextBox);
+ System.Diagnostics.Debug.WriteLine("Cell_Enter " + curField.Name);
+ orgBkColor = curField.BackColor;
+ int index = items.IndexOf(curField);
+ acitveIndex = index;
+ if (Enter != null)
+ {
+ Enter(this, index, new CTextBoxArrayBaseEventArgs());
+ }
+ else
+ {
+ this.Items[index].OrgText = curField.Text;
+ System.Diagnostics.Debug.WriteLine("Cell_Enter " + curField.Name + " Org = " + this.Items[index].OrgText);
+ InputCtrl.TextEnter(curField);
+ if (AfterEnter != null) { AfterEnter(this, index, new CTextBoxArrayBaseEventArgs()); }
+ }
+ }
+
+ private void Cell_Leave(object sender, EventArgs e)
+ {
+ CTextBox curField = (sender as CTextBox);
+ System.Diagnostics.Debug.WriteLine("Cell_Leave " + curField.Name);
+ int index = items.IndexOf((sender as CTextBox));
+ if (Leave != null)
+ {
+ Leave(this, index, new CTextBoxArrayBaseEventArgs());
+ }
+ else
+ {
+ InputCtrl.TextLeave(curField);
+ if (curField.ReadOnly || m_UsingOrgBackColor) { curField.BackColor = orgBkColor; }
+ }
+ if (AfterLeave != null) { AfterLeave(this, index, new CTextBoxArrayBaseEventArgs()); }
+ }
+
+ private void Cell_KeyPress(object sender, KeyPressEventArgs e)
+ {
+ //3 'Ctrl-C Copy 22 'Ctrl-V Paste 24 'Ctrl-X Cut //���� Redmine#8743
+ if (e.KeyChar == 3 || e.KeyChar == 22 || e.KeyChar == 24)
+ {
+ return;
+ }
+
+ CTextBox curField = (sender as CTextBox);
+ int index = items.IndexOf((sender as CTextBox));
+ if (KeyPress != null)
+ {
+ KeyPress(this, index, e);
+ }
+ else
+ {
+ if (curField.Multiline) { if (MultiKeyPress != null) { MultiKeyPress(this, index, e); } }
+ if (curField.IsChkData) { InputCtrl.TextBoxKeyPress(curField, e, curField.MaxLength, InputCtrl.GetInputType(curField)); }
+ if (!m_ForceChangeLine)
+ {
+ if (!isChangeLine && e.KeyChar == 13)
+ {
+ e.Handled = true;
+ }
+ }
+ isChangeLine = false;
+ }
+ }
+
+ private void Cell_TextChanged(object sender, EventArgs e)
+ {
+ if (m_ReadOnly) { return; }
+ if (disbleTextChanged) { return; }
+ int index = items.IndexOf((sender as CTextBox));
+ if (TextChanged != null)
+ {
+ TextChanged(this, index, new CTextBoxArrayBaseEventArgs());
+ }
+ }
+
+ private void Cell_Validating(object sender, CancelEventArgs e)
+ {
+ System.Diagnostics.Debug.WriteLine("Cell_Validating " + (sender as Control).Name);
+ if (m_ReadOnly) { return; }
+ if (this.disbleValidating) { return; }
+ int index = items.IndexOf((sender as CTextBox));
+ if (Validating != null)
+ {
+ Validating(this, index, e);
+ }
+ else
+ {
+ bool isCheck = false;
+ if (!this.Items[index].OrgText.Equals(this.Items[index].Text)) { isCheck = true; }
+
+ if (!isCheck)
+ {
+ if (ForceValidating == null)
+ {
+ return;
+ }
+ else
+ {
+ //�l�����ł��`�F�b�N�������s��
+ CTextBoxArrayBaseEventArgs forceValidatingEventArgs = new CTextBoxArrayBaseEventArgs() { Cancel = true };
+ ForceValidating(this, index, forceValidatingEventArgs);
+ if (forceValidatingEventArgs.Cancel) { return; }
+ }
+ }
+
+ bool isPass = false;
+
+ //System.Diagnostics.Debug.WriteLine("Org:" + orgValue);
+ if (!CheckValueChanged(sender, index)) { return; } //�l�ύX������A�C�x���g����
+
+ if (InputCtrl.IsCorrectText(this.Items[index], false))
+ {
+ if (IsCorrectEtc == null)
+ {
+ isPass = true;
+ }
+ else
+ {
+ if (IsCorrectEtc(this, index, new CTextBoxArrayBaseEventArgs() { CheckAll = false, ShowErrMsg = false }))
+ {
+ isPass = true;
+ }
+ }
+ }
+
+ if (isPass)
+ {
+ SetInputValue(sender, index);
+ }
+ else
+ {
+ SetItemValue(sender, index, this.Items[index].OrgText);
+ }
+ }
+ }
+
+ private bool SetAutoNextFocus(int index, KeyEventArgs e)
+ {
+ try
+ {
+ if (BeforeAutoNextFocus != null)
+ {
+ BeforeAutoNextFocus(this, index, e);
+ if (e.Handled) { return true; }
+ }
+
+ int hitIdx = -1;
+ if (e.KeyCode == Keys.Return)
+ {
+ for (int i = index + 1; i < items.Count; i++)
+ {
+ if (GeneralSub.CtrlCanFocus(items[i]))
+ {
+ hitIdx = i;
+ break;
+ }
+ }
+
+ if (hitIdx == -1) { return false; }
+ }
+ else if (e.KeyCode == Keys.Up)
+ {
+ if (index == 0) { return true; }
+
+ for (int i = index - 1; i >= 0; i--)
+ {
+ if (GeneralSub.CtrlCanFocus(items[i]))
+ {
+ hitIdx = i;
+ break;
+ }
+ }
+
+ if (hitIdx == -1) { return false; }
+ }
+ items[hitIdx].Focus();
+ e.Handled = true;
+ return true;
+ }
+ catch
+ {
+ return false;
+ }
+ finally
+ {
+ if (AfterAutoNextFocus != null) { AfterAutoNextFocus(this, index, e); }
+ }
+ }
+
+ private void InitAllCtrl(Control owner)
+ {
+ foreach (Control obj in owner.Controls)
+ {
+ if ((obj is ITextBoxArray) && (obj as ITextBoxArray).TextBoxArrayMember)
+ {
+ if (obj is CTextBox) { this.Add(obj as CTextBox); }
+ }
+
+ //���̊K�w
+ if (obj.Controls.Count > 0) { InitAllCtrl(obj); }
+ }
+ }
+
+ /// <summary>
+ /// ���͐ݒ菉��������
+ /// </summary>
+ /// <param name="ownerForm"></param>
+ public void InitInputSetting(Control owner)
+ {
+ InitAllCtrl(owner);
+ items.Sort(itemsComparer);
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/Util/CTextBoxArrayBaseEventArgs.cs b/HotelPms.Share.Windows/Util/CTextBoxArrayBaseEventArgs.cs
new file mode 100644
index 0000000..73c3443
--- /dev/null
+++ b/HotelPms.Share.Windows/Util/CTextBoxArrayBaseEventArgs.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace HotelPms.Share.Windows.Util
+{
+ public class CTextBoxArrayBaseEventArgs : EventArgs
+ {
+ public bool Cancel { get; set; } = false;
+
+ public int ChangeEditingModeResult { get; set; } = 4;
+
+ /// <summary>
+ /// �Ō�̓o�^���̃`�F�b�N�ł͂Ȃ��A���ڃt�H�[�J�X�ړ����̃`�F�b�N
+ /// </summary>
+ public bool CheckAll { get; set; } = false;
+ public bool ShowErrMsg { get; set; } = false;
+
+ /// <summary>
+ /// yyyy/MM/dd
+ /// </summary>
+ public string ChangeDate { get; set; }
+
+ public bool ResetOrgValue { get; set; }
+
+ public object Tag { get; set; } = null;
+ }
+}
diff --git a/HotelPms.Share.Windows/Util/ComboBoxItem.cs b/HotelPms.Share.Windows/Util/ComboBoxItem.cs
new file mode 100644
index 0000000..b11a155
--- /dev/null
+++ b/HotelPms.Share.Windows/Util/ComboBoxItem.cs
@@ -0,0 +1,83 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Windows.Forms;
+
+namespace HotelPms.Share.Windows.Util
+{
+ public class ComboBoxItem
+ {
+ private string m_Key = string.Empty;
+
+ public string Key
+ {
+ get { return m_Key; }
+ set { m_Key = value; }
+ }
+
+ private string m_Text = string.Empty;
+
+ public string Text
+ {
+ get { return m_Text; }
+ set { m_Text = value; }
+ }
+
+ private object m_Tag = null;
+
+ public object Tag
+ {
+ get { return m_Tag; }
+ set { m_Tag = value; }
+ }
+
+ public ComboBoxItem(string key, string text)
+ {
+ this.m_Key = key;
+ this.m_Text = text;
+ }
+
+ public override string ToString()
+ {
+ return m_Text;
+ }
+
+ public static void AddComboBox(ComboBox obj, Type type)
+ {
+ AddComboBox(obj, type, false, -1);
+ }
+
+ public static void AddComboBox(ComboBox obj, Type type, bool useBlank)
+ {
+ AddComboBox(obj, type, useBlank, -1);
+ }
+
+ public static void AddComboBox(ComboBox obj, Type type, bool useBlank, int defID)
+ {
+ int selIndex = 0;
+ obj.Items.Clear();
+ int i = 0;
+ if (useBlank)
+ {
+ obj.Items.Add(new ComboBoxItem("-1", string.Empty));
+ i++;
+ }
+
+ foreach (object item in Enum.GetValues(type))
+ {
+ int id = (int)item;
+ string name = item.ToString();
+ if (name.Contains("_"))
+ {
+ string[] items = name.Split(new char[] { '_' });
+ if (items.Length == 2) { name = string.Format("{0}({1})", items[0], items[1]); }
+ }
+
+ obj.Items.Add(new ComboBoxItem(id.ToString(), name));
+ if (id == defID) { selIndex = i; }
+ i++;
+ }
+ obj.SelectedIndex = selIndex;
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/Util/FormBase.Designer.cs b/HotelPms.Share.Windows/Util/FormBase.Designer.cs
new file mode 100644
index 0000000..ef7255e
--- /dev/null
+++ b/HotelPms.Share.Windows/Util/FormBase.Designer.cs
@@ -0,0 +1,82 @@
+namespace HotelPms.Share.Windows.Util
+{
+ partial class FormBase
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.pnlMain = new HotelPms.Share.Windows.Component.PanelEx();
+ this.LoadingObj = new HotelPms.Share.Windows.Component.LoadingPanel();
+ this.SuspendLayout();
+ //
+ // pnlMain
+ //
+ this.pnlMain.ActiveName = "";
+ this.pnlMain.ArcWidth = 16;
+ this.pnlMain.Blur = 15;
+ this.pnlMain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.pnlMain.Location = new System.Drawing.Point(1, 36);
+ this.pnlMain.Name = "pnlMain";
+ this.pnlMain.OffsetX = 0;
+ this.pnlMain.OffsetY = 0;
+ this.pnlMain.Size = new System.Drawing.Size(574, 344);
+ this.pnlMain.Spread = 15;
+ this.pnlMain.TabIndex = 1;
+ //
+ // LoadingObj
+ //
+ this.LoadingObj.Alpha = 125;
+ this.LoadingObj.BackColor = System.Drawing.Color.White;
+ this.LoadingObj.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.LoadingObj.Location = new System.Drawing.Point(1, 36);
+ this.LoadingObj.Name = "LoadingObj";
+ this.LoadingObj.Size = new System.Drawing.Size(574, 344);
+ this.LoadingObj.TabIndex = 1;
+ this.LoadingObj.Text = "loadingPanel1";
+ this.LoadingObj.TransparentBG = true;
+ this.LoadingObj.Visible = false;
+ //
+ // FormBase
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(576, 381);
+ this.Controls.Add(this.pnlMain);
+ this.Controls.Add(this.LoadingObj);
+ this.KeyPreview = true;
+ this.Margin = new System.Windows.Forms.Padding(4);
+ this.Name = "FormBase";
+ this.Padding = new System.Windows.Forms.Padding(1, 36, 1, 1);
+ this.Text = "FormBase";
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+ public Component.PanelEx pnlMain;
+ public Component.LoadingPanel LoadingObj;
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.Share.Windows/Util/FormBase.cs b/HotelPms.Share.Windows/Util/FormBase.cs
new file mode 100644
index 0000000..69abe02
--- /dev/null
+++ b/HotelPms.Share.Windows/Util/FormBase.cs
@@ -0,0 +1,647 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Drawing.Text;
+using System.Linq;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace HotelPms.Share.Windows.Util
+{
+ public partial class FormBase : Form
+ {
+ #region API
+
+ [DllImport("user32.dll")]
+ public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);
+
+ [DllImport("user32.dll")]
+ public static extern bool ReleaseCapture();
+
+ [DllImport("user32.dll")]
+ public static extern int TrackPopupMenuEx(IntPtr hmenu, uint fuFlags, int x, int y, IntPtr hwnd, IntPtr lptpm);
+
+ [DllImport("user32.dll")]
+ public static extern IntPtr GetSystemMenu(IntPtr hWnd, bool bRevert);
+
+ [DllImport("user32.dll")]
+ public static extern IntPtr MonitorFromWindow(IntPtr hwnd, uint dwFlags);
+
+ [DllImport("User32.dll", CharSet = CharSet.Auto)]
+ public static extern bool GetMonitorInfo(HandleRef hmonitor, [In, Out] MONITORINFOEX info);
+
+ public const int WM_NCLBUTTONDOWN = 0xA1;
+ public const int HT_CAPTION = 0x2;
+ public const int WM_MOUSEMOVE = 0x0200;
+ public const int WM_LBUTTONDOWN = 0x0201;
+ public const int WM_LBUTTONUP = 0x0202;
+ public const int WM_LBUTTONDBLCLK = 0x0203;
+ public const int WM_RBUTTONDOWN = 0x0204;
+ private const int HTBOTTOMLEFT = 16;
+ private const int HTBOTTOMRIGHT = 17;
+ private const int HTLEFT = 10;
+ private const int HTRIGHT = 11;
+ private const int HTBOTTOM = 15;
+ private const int HTTOP = 12;
+ private const int HTTOPLEFT = 13;
+ private const int HTTOPRIGHT = 14;
+ private const int BORDER_WIDTH = 7;
+
+ private const int WMSZ_TOP = 3;
+ private const int WMSZ_TOPLEFT = 4;
+ private const int WMSZ_TOPRIGHT = 5;
+ private const int WMSZ_LEFT = 1;
+ private const int WMSZ_RIGHT = 2;
+ private const int WMSZ_BOTTOM = 6;
+ private const int WMSZ_BOTTOMLEFT = 7;
+ private const int WMSZ_BOTTOMRIGHT = 8;
+
+ private readonly Dictionary<int, int> _resizingLocationsToCmd = new Dictionary<int, int>
+ {
+ {HTTOP, WMSZ_TOP},
+ {HTTOPLEFT, WMSZ_TOPLEFT},
+ {HTTOPRIGHT, WMSZ_TOPRIGHT},
+ {HTLEFT, WMSZ_LEFT},
+ {HTRIGHT, WMSZ_RIGHT},
+ {HTBOTTOM, WMSZ_BOTTOM},
+ {HTBOTTOMLEFT, WMSZ_BOTTOMLEFT},
+ {HTBOTTOMRIGHT, WMSZ_BOTTOMRIGHT}
+ };
+
+ private const uint TPM_LEFTALIGN = 0x0000;
+ private const uint TPM_RETURNCMD = 0x0100;
+
+ private const int WM_SYSCOMMAND = 0x0112;
+ private const int WS_MINIMIZEBOX = 0x20000;
+ private const int WS_SYSMENU = 0x00080000;
+
+ private const int MONITOR_DEFAULTTONEAREST = 2;
+
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto, Pack = 4)]
+ public class MONITORINFOEX
+ {
+ public int cbSize = Marshal.SizeOf(typeof(MONITORINFOEX));
+ public RECT rcMonitor = new RECT();
+ public RECT rcWork = new RECT();
+ public int dwFlags = 0;
+ [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
+ public char[] szDevice = new char[32];
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct RECT
+ {
+ public int left;
+ public int top;
+ public int right;
+ public int bottom;
+
+ public int Width()
+ {
+ return right - left;
+ }
+
+ public int Height()
+ {
+ return bottom - top;
+ }
+ }
+
+ #endregion
+
+ private enum ResizeDirection
+ {
+ BottomLeft,
+ Left,
+ Right,
+ BottomRight,
+ Bottom,
+ None
+ }
+
+ private enum ButtonState
+ {
+ XOver,
+ MaxOver,
+ MinOver,
+ HelpOver,
+ XDown,
+ MaxDown,
+ MinDown,
+ HelpDown,
+ None
+ }
+
+ private readonly Cursor[] _resizeCursors = { Cursors.SizeNESW, Cursors.SizeWE, Cursors.SizeNWSE, Cursors.SizeWE, Cursors.SizeNS };
+
+ private ResizeDirection _resizeDir;
+ private ButtonState _buttonState = ButtonState.None;
+
+ private Rectangle _helpButtonBounds;
+ private Rectangle _minButtonBounds;
+ private Rectangle _maxButtonBounds;
+ private Rectangle _xButtonBounds;
+ private Rectangle _statusBarBounds;
+
+ private bool _maximized;
+ private Size _previousSize;
+ private Point _previousLocation;
+ private bool _headerMouseDown;
+
+ private Font helpFont = new Font(FontFamily.GenericSansSerif, 16F);
+ private StringFormat helpFormat = new StringFormat { LineAlignment = StringAlignment.Center, Alignment = StringAlignment.Center, FormatFlags = StringFormatFlags.NoWrap, };
+ private StringFormat titleFormat = new StringFormat { LineAlignment = StringAlignment.Center, FormatFlags = StringFormatFlags.NoWrap, };
+
+ private bool showHelpIcon = false;
+
+ public bool ShowHelpIcon
+ {
+ get { return showHelpIcon; }
+ set { showHelpIcon = value; Invalidate(); }
+ }
+
+ public bool Sizable { get; set; } = true;
+
+ /// <summary>
+ /// フォームの背景色
+ /// </summary>
+ public Color BackgroundColor { get; set; } = Color.FromArgb(255, 43, 43, 43);
+
+ /// <summary>
+ /// タイトルバーの背景色
+ /// </summary>
+ public Color TitleBarColor { get; set; } = Color.FromArgb(255, 60, 63, 65);
+
+ /// <summary>
+ /// 枠線色
+ /// </summary>
+ public Color BorderColor { get; set; } = Color.FromArgb(31, 0, 0, 0);
+
+ /// <summary>
+ /// タイトルバーのマウスHover色
+ /// </summary>
+ public Color TitleBarHoverColor { get; set; } = Color.FromArgb(255, 79, 82, 84);
+
+ /// <summary>
+ /// タイトルバーのマウスDown色
+ /// </summary>
+ public Color TitleBarDownColor { get; set; } = Color.FromArgb(255, 79, 82, 84);
+
+ public int TitlePadding { get; set; } = 14;
+
+ private int titleBarHeight = 36;
+
+ /// <summary>
+ /// タイトルバーの高さ
+ /// </summary>
+ public int TitleBarHeight
+ {
+ get { return titleBarHeight; }
+ set { titleBarHeight = value; Invalidate(); }
+ }
+
+ public event PaintEventHandler DrawTitle;
+ public event MouseEventHandler HelpClick;
+
+ public FormBase()
+ {
+ FormBorderStyle = FormBorderStyle.None;
+ DoubleBuffered = true;
+ SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.UserPaint, true);
+
+ // This enables the form to trigger the MouseMove event even when mouse is over another control
+ Application.AddMessageFilter(new MouseMessageFilter());
+ MouseMessageFilter.MouseMove += OnGlobalMouseMove;
+ InitializeComponent();
+ }
+
+ protected override void OnKeyDown(KeyEventArgs e)
+ {
+ if (e.Alt && e.KeyCode == Keys.F4 && LoadingObj.Visible) { e.Handled = true; return; }
+ base.OnKeyDown(e);
+ }
+
+ protected void OnGlobalMouseMove(object sender, MouseEventArgs e)
+ {
+ if (IsDisposed) return;
+ // Convert to client position and pass to Form.MouseMove
+ var clientCursorPos = PointToClient(e.Location);
+ var newE = new MouseEventArgs(MouseButtons.None, 0, clientCursorPos.X, clientCursorPos.Y, 0);
+ OnMouseMove(newE);
+ }
+
+ protected override void WndProc(ref Message m)
+ {
+ base.WndProc(ref m);
+ if (DesignMode || IsDisposed) return;
+
+ if (m.Msg == WM_LBUTTONDBLCLK)
+ {
+ MaximizeWindow(!_maximized);
+ }
+ else if (m.Msg == WM_MOUSEMOVE && _maximized &&
+ _statusBarBounds.Contains(PointToClient(Cursor.Position)) &&
+ !(_minButtonBounds.Contains(PointToClient(Cursor.Position)) || _maxButtonBounds.Contains(PointToClient(Cursor.Position)) || _xButtonBounds.Contains(PointToClient(Cursor.Position))))
+ {
+ if (_headerMouseDown)
+ {
+ _maximized = false;
+ _headerMouseDown = false;
+
+ var mousePoint = PointToClient(Cursor.Position);
+ if (mousePoint.X < Width / 2)
+ Location = mousePoint.X < _previousSize.Width / 2 ?
+ new Point(Cursor.Position.X - mousePoint.X, Cursor.Position.Y - mousePoint.Y) :
+ new Point(Cursor.Position.X - _previousSize.Width / 2, Cursor.Position.Y - mousePoint.Y);
+ else
+ Location = Width - mousePoint.X < _previousSize.Width / 2 ?
+ new Point(Cursor.Position.X - _previousSize.Width + Width - mousePoint.X, Cursor.Position.Y - mousePoint.Y) :
+ new Point(Cursor.Position.X - _previousSize.Width / 2, Cursor.Position.Y - mousePoint.Y);
+
+ Size = _previousSize;
+ ReleaseCapture();
+ SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0);
+ }
+ }
+ else if (m.Msg == WM_LBUTTONDOWN &&
+ _statusBarBounds.Contains(PointToClient(Cursor.Position)) &&
+ !(_minButtonBounds.Contains(PointToClient(Cursor.Position)) || _maxButtonBounds.Contains(PointToClient(Cursor.Position)) || _xButtonBounds.Contains(PointToClient(Cursor.Position))))
+ {
+ if (!_maximized)
+ {
+ ReleaseCapture();
+ SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0);
+ }
+ else
+ {
+ _headerMouseDown = true;
+ }
+ }
+ else if (m.Msg == WM_RBUTTONDOWN)
+ {
+ Point cursorPos = PointToClient(Cursor.Position);
+
+ if (_statusBarBounds.Contains(cursorPos) && !_minButtonBounds.Contains(cursorPos) &&
+ !_maxButtonBounds.Contains(cursorPos) && !_xButtonBounds.Contains(cursorPos))
+ {
+ // Show default system menu when right clicking titlebar
+ var id = TrackPopupMenuEx(GetSystemMenu(Handle, false), TPM_LEFTALIGN | TPM_RETURNCMD, Cursor.Position.X, Cursor.Position.Y, Handle, IntPtr.Zero);
+
+ // Pass the command as a WM_SYSCOMMAND message
+ SendMessage(Handle, WM_SYSCOMMAND, id, 0);
+ }
+ }
+ else if (m.Msg == WM_NCLBUTTONDOWN)
+ {
+ // This re-enables resizing by letting the application know when the
+ // user is trying to resize a side. This is disabled by default when using WS_SYSMENU.
+ if (!Sizable) return;
+
+ byte bFlag = 0;
+
+ // Get which side to resize from
+ if (_resizingLocationsToCmd.ContainsKey((int)m.WParam))
+ bFlag = (byte)_resizingLocationsToCmd[(int)m.WParam];
+
+ if (bFlag != 0)
+ SendMessage(Handle, WM_SYSCOMMAND, 0xF000 | bFlag, (int)m.LParam);
+ }
+ else if (m.Msg == WM_LBUTTONUP)
+ {
+ _headerMouseDown = false;
+ }
+ }
+
+ protected override CreateParams CreateParams
+ {
+ get
+ {
+ var par = base.CreateParams;
+ // WS_SYSMENU: Trigger the creation of the system menu
+ // WS_MINIMIZEBOX: Allow minimizing from taskbar
+ par.Style = par.Style | WS_MINIMIZEBOX | WS_SYSMENU; // Turn on the WS_MINIMIZEBOX style flag
+ //par.ExStyle |= 0x02000000; // 用双缓冲绘制窗口的所有子控件
+ return par;
+ }
+ }
+
+ private void MaximizeWindow(bool maximize)
+ {
+ if (!MaximizeBox || !ControlBox) return;
+
+ _maximized = maximize;
+
+ if (maximize)
+ {
+ var monitorHandle = MonitorFromWindow(Handle, MONITOR_DEFAULTTONEAREST);
+ var monitorInfo = new MONITORINFOEX();
+ GetMonitorInfo(new HandleRef(null, monitorHandle), monitorInfo);
+ _previousSize = Size;
+ _previousLocation = Location;
+ Size = new Size(monitorInfo.rcWork.Width(), monitorInfo.rcWork.Height());
+ Location = new Point(monitorInfo.rcWork.left, monitorInfo.rcWork.top);
+ }
+ else
+ {
+ Size = _previousSize;
+ Location = _previousLocation;
+ }
+
+ }
+
+ /// <summary>
+ /// 全部ここに初期化が必要!!!
+ /// </summary>
+ /// <param name="e"></param>
+ protected override void OnPaint(PaintEventArgs e)
+ {
+ Padding = new Padding(1, TitleBarHeight, 1, 1);
+ _helpButtonBounds = new Rectangle((Width - TitlePadding / 2) - 4 * TitleBarHeight, 0, TitleBarHeight, TitleBarHeight);
+ _minButtonBounds = new Rectangle((Width - TitlePadding / 2) - 3 * TitleBarHeight, 0, TitleBarHeight, TitleBarHeight);
+ _maxButtonBounds = new Rectangle((Width - TitlePadding / 2) - 2 * TitleBarHeight, 0, TitleBarHeight, TitleBarHeight);
+ _xButtonBounds = new Rectangle((Width - TitlePadding / 2) - TitleBarHeight, 0, TitleBarHeight, TitleBarHeight);
+ _statusBarBounds = new Rectangle(0, 0, Width, TitleBarHeight);
+ var g = e.Graphics;
+ //g.TextRenderingHint = TextRenderingHint.AntiAlias;
+
+ g.Clear(BackgroundColor);
+ using (var titleBarBrush = new SolidBrush(TitleBarColor))
+ {
+ g.FillRectangle(titleBarBrush, _statusBarBounds);
+ }
+
+ using (var borderPen = new Pen(BorderColor, 1))
+ {
+ g.DrawLine(borderPen, new Point(0, Height - 1), new Point(Width - 1, Height - 1)); //Draw border
+ }
+
+ // Determine whether or not we even should be drawing the buttons.
+ bool showMin = MinimizeBox && ControlBox;
+ bool showMax = MaximizeBox && ControlBox;
+
+ // When MaximizeButton == false, the minimize button will be painted in its place
+ using (var hoverBrush = new SolidBrush(TitleBarHoverColor))
+ {
+ if (_buttonState == ButtonState.MinOver && showMin) { g.FillRectangle(hoverBrush, showMax ? _minButtonBounds : _maxButtonBounds); }
+ if (_buttonState == ButtonState.MaxOver && showMax) { g.FillRectangle(hoverBrush, _maxButtonBounds); }
+ if (_buttonState == ButtonState.HelpOver && showHelpIcon) { g.FillRectangle(hoverBrush, _helpButtonBounds); }
+ }
+
+ using (var downBrush = new SolidBrush(TitleBarDownColor))
+ {
+ if (_buttonState == ButtonState.MinDown && showMin) { g.FillRectangle(downBrush, showMax ? _minButtonBounds : _maxButtonBounds); }
+ if (_buttonState == ButtonState.MaxDown && showMax) { g.FillRectangle(downBrush, _maxButtonBounds); }
+ if (_buttonState == ButtonState.HelpDown && showHelpIcon) { g.FillRectangle(downBrush, _helpButtonBounds); }
+ }
+
+ if (_buttonState == ButtonState.XOver && ControlBox)
+ {
+ using (var hoverBrushX = new SolidBrush(Color.FromArgb(255, 232, 17, 35)))
+ {
+ g.FillRectangle(hoverBrushX, _xButtonBounds);
+ }
+ }
+
+ if (_buttonState == ButtonState.XDown && ControlBox)
+ {
+ using (var downBrushX = new SolidBrush(Color.FromArgb(255, 232, 17, 35)))
+ {
+ g.FillRectangle(downBrushX, _xButtonBounds);
+ }
+ }
+
+ using (var buttonPen = new Pen(Color.White, 2))
+ {
+ // Minimize button.
+ if (showMin)
+ {
+ int x = showMax ? _minButtonBounds.X : _maxButtonBounds.X;
+ int y = showMax ? _minButtonBounds.Y : _maxButtonBounds.Y;
+
+ g.DrawLine(
+ buttonPen,
+ x + (int)(_minButtonBounds.Width * 0.33),
+ y + (int)(_minButtonBounds.Height * 0.66),
+ x + (int)(_minButtonBounds.Width * 0.66),
+ y + (int)(_minButtonBounds.Height * 0.66)
+ );
+ }
+
+ // Maximize button
+ if (showMax)
+ {
+ g.DrawRectangle(
+ buttonPen,
+ _maxButtonBounds.X + (int)(_maxButtonBounds.Width * 0.33),
+ _maxButtonBounds.Y + (int)(_maxButtonBounds.Height * 0.36),
+ (int)(_maxButtonBounds.Width * 0.39),
+ (int)(_maxButtonBounds.Height * 0.31)
+ );
+ }
+
+ // Close button
+ if (ControlBox)
+ {
+ g.DrawLine(
+ buttonPen,
+ _xButtonBounds.X + (int)(_xButtonBounds.Width * 0.33),
+ _xButtonBounds.Y + (int)(_xButtonBounds.Height * 0.33),
+ _xButtonBounds.X + (int)(_xButtonBounds.Width * 0.66),
+ _xButtonBounds.Y + (int)(_xButtonBounds.Height * 0.66)
+ );
+
+ g.DrawLine(
+ buttonPen,
+ _xButtonBounds.X + (int)(_xButtonBounds.Width * 0.66),
+ _xButtonBounds.Y + (int)(_xButtonBounds.Height * 0.33),
+ _xButtonBounds.X + (int)(_xButtonBounds.Width * 0.33),
+ _xButtonBounds.Y + (int)(_xButtonBounds.Height * 0.66));
+ }
+ }
+
+ if (showHelpIcon) { g.DrawString("?", helpFont, Brushes.White, _helpButtonBounds, helpFormat); }
+
+ //Form title
+ if (DrawTitle != null)
+ {
+ DrawTitle(this, e);
+ }
+ else
+ {
+ g.DrawString(Text, this.Font, Brushes.White, new Rectangle(TitlePadding, 0, Width, TitleBarHeight), titleFormat);
+ }
+ }
+
+ protected override void OnMouseUp(MouseEventArgs e)
+ {
+ if (DesignMode) return;
+ UpdateButtons(e, true);
+
+ base.OnMouseUp(e);
+ ReleaseCapture();
+ }
+
+ protected override void OnMouseDown(MouseEventArgs e)
+ {
+ if (DesignMode) return;
+ UpdateButtons(e);
+
+ if (e.Button == MouseButtons.Left && !_maximized)
+ ResizeForm(_resizeDir);
+ base.OnMouseDown(e);
+ }
+
+ protected override void OnMouseLeave(EventArgs e)
+ {
+ base.OnMouseLeave(e);
+ if (DesignMode) return;
+ _buttonState = ButtonState.None;
+ Invalidate();
+ }
+
+ protected override void OnMouseMove(MouseEventArgs e)
+ {
+ base.OnMouseMove(e);
+
+ if (DesignMode) return;
+
+ if (Sizable)
+ {
+ //True if the mouse is hovering over a child control
+ var isChildUnderMouse = GetChildAtPoint(e.Location) != null;
+
+ if (e.Location.X < BORDER_WIDTH && e.Location.Y > Height - BORDER_WIDTH && !isChildUnderMouse && !_maximized)
+ {
+ _resizeDir = ResizeDirection.BottomLeft;
+ Cursor = Cursors.SizeNESW;
+ }
+ else if (e.Location.X < BORDER_WIDTH && !isChildUnderMouse && !_maximized)
+ {
+ _resizeDir = ResizeDirection.Left;
+ Cursor = Cursors.SizeWE;
+ }
+ else if (e.Location.X > Width - BORDER_WIDTH && e.Location.Y > Height - BORDER_WIDTH && !isChildUnderMouse && !_maximized)
+ {
+ _resizeDir = ResizeDirection.BottomRight;
+ Cursor = Cursors.SizeNWSE;
+ }
+ else if (e.Location.X > Width - BORDER_WIDTH && !isChildUnderMouse && !_maximized)
+ {
+ _resizeDir = ResizeDirection.Right;
+ Cursor = Cursors.SizeWE;
+ }
+ else if (e.Location.Y > Height - BORDER_WIDTH && !isChildUnderMouse && !_maximized)
+ {
+ _resizeDir = ResizeDirection.Bottom;
+ Cursor = Cursors.SizeNS;
+ }
+ else
+ {
+ _resizeDir = ResizeDirection.None;
+
+ //Only reset the cursor when needed, this prevents it from flickering when a child control changes the cursor to its own needs
+ if (_resizeCursors.Contains(Cursor))
+ {
+ Cursor = Cursors.Default;
+ }
+ }
+ }
+
+ UpdateButtons(e);
+ }
+
+ private void UpdateButtons(MouseEventArgs e, bool up = false)
+ {
+ if (DesignMode) return;
+ var oldState = _buttonState;
+ bool showMin = MinimizeBox && ControlBox;
+ bool showMax = MaximizeBox && ControlBox;
+
+ if (e.Button == MouseButtons.Left && !up)
+ {
+ if (showMin && !showMax && _maxButtonBounds.Contains(e.Location)) { _buttonState = ButtonState.MinDown; }
+ else if (showMin && showMax && _minButtonBounds.Contains(e.Location)) { _buttonState = ButtonState.MinDown; }
+ else if (showMax && _maxButtonBounds.Contains(e.Location)) { _buttonState = ButtonState.MaxDown; }
+ else if (ControlBox && _xButtonBounds.Contains(e.Location)) { _buttonState = ButtonState.XDown; }
+ else if (showHelpIcon && _helpButtonBounds.Contains(e.Location)) { _buttonState = ButtonState.HelpDown; }
+ else { _buttonState = ButtonState.None; }
+ }
+ else
+ {
+ if (showMin && !showMax && _maxButtonBounds.Contains(e.Location))
+ {
+ _buttonState = ButtonState.MinOver;
+
+ if (oldState == ButtonState.MinDown && up)
+ WindowState = FormWindowState.Minimized;
+ }
+ else if (showMin && showMax && _minButtonBounds.Contains(e.Location))
+ {
+ _buttonState = ButtonState.MinOver;
+
+ if (oldState == ButtonState.MinDown && up)
+ WindowState = FormWindowState.Minimized;
+ }
+ else if (MaximizeBox && ControlBox && _maxButtonBounds.Contains(e.Location))
+ {
+ _buttonState = ButtonState.MaxOver;
+
+ if (oldState == ButtonState.MaxDown && up)
+ MaximizeWindow(!_maximized);
+
+ }
+ else if (ControlBox && _xButtonBounds.Contains(e.Location))
+ {
+ _buttonState = ButtonState.XOver;
+
+ if (oldState == ButtonState.XDown && up && !LoadingObj.Visible) { Close(); }
+ }
+ else if (showHelpIcon && _helpButtonBounds.Contains(e.Location))
+ {
+ _buttonState = ButtonState.HelpOver;
+ if (oldState == ButtonState.HelpDown && up && !LoadingObj.Visible && HelpClick != null) { HelpClick(this, new MouseEventArgs(MouseButtons.Left, 0, e.Location.X, e.Location.Y, 0)); }
+ }
+ else _buttonState = ButtonState.None;
+ }
+
+ //if (oldState != _buttonState) Invalidate();
+ Invalidate();
+ }
+
+
+ private void ResizeForm(ResizeDirection direction)
+ {
+ if (DesignMode) return;
+ var dir = -1;
+ switch (direction)
+ {
+ case ResizeDirection.BottomLeft:
+ dir = HTBOTTOMLEFT;
+ break;
+ case ResizeDirection.Left:
+ dir = HTLEFT;
+ break;
+ case ResizeDirection.Right:
+ dir = HTRIGHT;
+ break;
+ case ResizeDirection.BottomRight:
+ dir = HTBOTTOMRIGHT;
+ break;
+ case ResizeDirection.Bottom:
+ dir = HTBOTTOM;
+ break;
+ }
+
+ ReleaseCapture();
+ if (dir != -1)
+ {
+ SendMessage(Handle, WM_NCLBUTTONDOWN, dir, 0);
+ }
+ }
+
+ }
+}
diff --git a/HotelPms.Share.Windows/Util/FormBase.resx b/HotelPms.Share.Windows/Util/FormBase.resx
new file mode 100644
index 0000000..f298a7b
--- /dev/null
+++ b/HotelPms.Share.Windows/Util/FormBase.resx
@@ -0,0 +1,60 @@
+<root>
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root>
\ No newline at end of file
diff --git a/HotelPms.Share.Windows/Util/GeneralSub.cs b/HotelPms.Share.Windows/Util/GeneralSub.cs
new file mode 100644
index 0000000..7f285dd
--- /dev/null
+++ b/HotelPms.Share.Windows/Util/GeneralSub.cs
Binary files differ
diff --git a/HotelPms.Share.Windows/Util/InputCtrl.cs b/HotelPms.Share.Windows/Util/InputCtrl.cs
new file mode 100644
index 0000000..f555864
--- /dev/null
+++ b/HotelPms.Share.Windows/Util/InputCtrl.cs
@@ -0,0 +1,870 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.IO;
+using System.Windows.Forms;
+using System.Drawing;
+using System.Xml;
+using System.Xml.XPath;
+using HotelPms.Share.Util;
+using HotelPms.Share.Windows.Component;
+using HotelPms.Share.Windows.GraphicsApi;
+
+namespace HotelPms.Share.Windows.Util
+{
+ [Flags()]
+ public enum numInputType
+ {
+ None = 0x1, //���ɂȂ�
+ Num = 0x2, //����
+ Alpha_S = 0x4, //�A���t�@�x�b�g��
+ Alpha_C = 0x8, //�A���t�@�x�b�g��
+ Kana = 0x10, //�J�i
+ Half = 0x20, //���p
+ Full = 0x40, //�S�p
+ Num_FieldClear = 0x80, //���͍ő包��������N���A
+ Plus_FieldClear = 0x100,//"+"�L�[�ŃN���A
+ Space = 0x200, //��
+ Colon = 0x400, //":"���\
+ Subtract = 0x800, //"-"
+ DotSendKeys = 0x1000, //"."��"000"�Ƃ���
+ Dot = 0x2000, //"."
+ Slash = 0x4000, //"/"
+ Comma = 0x8000, //"," �J���}
+
+ Alpha = Alpha_S | Alpha_C,//�A���t�@�x�b�g��+�A���t�@�x�b�g��
+ NumAlpha = Num | Alpha | Space,//�����{�A���t�@�x�b�g�{��
+ ANK = NumAlpha | Kana, //�����{�A���t�@�x�b�g�{�{�J�i
+ TIME = Num | Colon, //���ԗp "12:30"
+ }
+
+ [Flags()]
+ public enum numShowStyle
+ {
+ None = 0x1, //���ɂȂ�
+ ZeroPad = 0x2, //����������������"0"�ɒlj�
+ ThousandSeparator = 0x4,//���z����3�����Ƃ�"," ��1,000,000
+ ShowList = 0x8, //END�L�[�ňꗗ�I����ʂ�����
+ }
+
+ public class InputCtrl
+ {
+ public static string Chr_SqlKinshi = "'";
+ public static string Chr_Num = "0123456789";
+ public static string Chr_Alpha_S = "abcdefghijklmnopqrstuvwxyz ";
+ public static string Chr_Alpha_C = "ABCDEFGHIJKLMNOPQRSTUVWXYZ ";
+ public static string Chr_Kana = "���������������������������������������������������������� ";
+ public static string Chr_Alpha = Chr_Alpha_S + Chr_Alpha_C;
+ public static string Chr_NumAlpha = Chr_Num + Chr_Alpha;
+ public static string Chr_ANK = Chr_NumAlpha + Chr_Kana;
+
+ ///�� IsNotInOwnStr
+ ///�@�y�T�@�v�z�F�Y��������͐e������̒��Ɋ܂܂�ĂȂ���
+ ///�@�y���@���z�FhsValue�@�@�@�@����������
+ ///�@�@�@�@�@�@�@hsOwnString�@�@�e������@�@
+ ///�@�y�߂�l�z�FBoolean
+ public static bool IsNotInOwnStr(string hsValue, string hsOwnString)
+ {
+ try
+ {
+ for (int i = 0; i <= hsValue.Length - 1; i++)
+ {
+ if (hsOwnString.IndexOf(hsValue[i]) != -1)
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+ catch
+ {
+ return false;
+ }
+ }
+
+
+ ///�� IsInOwnStr
+ ///�@�y�T�@�v�z�F�Y��������͐e������̒��Ɋ܂܂�Ă܂���
+ ///�@�y���@���z�FhsValue�@�@�@�@����������
+ ///�@�@�@�@�@�@�@hsOwnString�@�@�e������@�@�@
+ ///�@�y�߂�l�z�FBoolean
+ public static bool IsInOwnStr(string hsValue, string hsOwnString)
+ {
+ try
+ {
+ for (int i = 0; i <= hsValue.Length - 1; i++)
+ {
+ if (hsOwnString.IndexOf(hsValue[i]) == -1)
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+ catch
+ {
+ return false;
+ }
+ }
+
+ public static bool IsCorrectValue(CTextBox textBox)
+ {
+ return IsCorrectValue(textBox, true);
+ }
+
+ ///�� IsCorrectValue
+ ///�@�y�T�@�v�z�F�`�F�b�N
+ ///�@�y���@���z�F
+ ///�@�y�߂�l�z�Fobject
+ public static bool IsCorrectValue(CTextBox textBox, bool showErrMsg)
+ {
+ string wsChkStr = "";
+ numInputType wlErrFlg = 0;
+ int wiLen;
+ try
+ {
+ string text = (GetShowStyle(textBox) & numShowStyle.ThousandSeparator) == numShowStyle.ThousandSeparator ? textBox.Text.Replace(",", string.Empty) : textBox.Text;
+
+ System.Text.Encoding enc = System.Text.Encoding.Default;
+ wiLen = enc.GetBytes(text).Length;
+
+ numInputType inputType = GetInputType(textBox);
+
+ //���p�`�F�b�N
+ if ((inputType & numInputType.Half) == numInputType.Half && wiLen != text.Length)
+ {
+ if (showErrMsg) { MessageBox.Show(null, "���p���͂��Ă��������B", "���̓`�F�b�N", MessageBoxButtons.OK); }
+ return false;
+ }
+
+ //�S�p�`�F�b�N
+ if ((inputType & numInputType.Full) == numInputType.Full && wiLen != 2 * text.Length)
+ {
+ if (showErrMsg) { MessageBox.Show(null, "�S�p���͂��Ă��������B", "���̓`�F�b�N", MessageBoxButtons.OK); }
+ return false;
+ }
+
+ //����
+ if ((inputType & numInputType.Num) == numInputType.Num)
+ {
+ wsChkStr = wsChkStr + Chr_Num;
+ wlErrFlg = wlErrFlg | numInputType.Num;
+ }
+
+ //.
+ if ((inputType & numInputType.Dot) == numInputType.Dot)
+ {
+ wsChkStr = wsChkStr + ".";
+ wlErrFlg = wlErrFlg | numInputType.Dot;
+ }
+
+ //[/]
+ if ((inputType & numInputType.Slash) == numInputType.Slash)
+ {
+ wsChkStr = wsChkStr + "/";
+ wlErrFlg = wlErrFlg | numInputType.Slash;
+ }
+
+ //Space
+ if ((inputType & numInputType.Space) == numInputType.Space)
+ {
+ wsChkStr = wsChkStr + " ";
+ wlErrFlg = wlErrFlg | numInputType.Space;
+ }
+
+ //-
+ if ((inputType & numInputType.Subtract) == numInputType.Subtract)
+ {
+ wsChkStr = wsChkStr + "-";
+ wlErrFlg = wlErrFlg | numInputType.Subtract;
+ }
+
+ //:
+ if ((inputType & numInputType.Colon) == numInputType.Colon)
+ {
+ wsChkStr = wsChkStr + ":";
+ wlErrFlg = wlErrFlg | numInputType.Colon;
+ }
+
+ //,
+ if ((inputType & numInputType.Comma) == numInputType.Comma)
+ {
+ wsChkStr = wsChkStr + ",";
+ wlErrFlg = wlErrFlg | numInputType.Colon;
+ }
+
+ //���p
+ if ((inputType & numInputType.Alpha_C) == numInputType.Alpha_C)
+ {
+ wsChkStr = wsChkStr + Chr_Alpha_C;
+ wlErrFlg = wlErrFlg | numInputType.Alpha_C;
+ }
+
+ //��p
+ if ((inputType & numInputType.Alpha_S) == numInputType.Alpha_S)
+ {
+ wsChkStr = wsChkStr + Chr_Alpha_S;
+ wlErrFlg = wlErrFlg | numInputType.Alpha_S;
+ }
+
+ //�J�i
+ if ((inputType & numInputType.Kana) == numInputType.Kana)
+ {
+ wsChkStr = wsChkStr + Chr_Kana;
+ wlErrFlg = wlErrFlg | numInputType.Kana;
+ }
+ if (wsChkStr != "")
+ {
+ if (IsInOwnStr(text, wsChkStr) == false)
+ {
+ if (!showErrMsg) { return false; }
+ if (wlErrFlg == numInputType.Num)
+ {
+ MessageBox.Show(null, "��������͂��Ă��������B", "���̓`�F�b�N", MessageBoxButtons.OK);
+ }
+ else if (wlErrFlg == numInputType.Kana)
+ {
+ MessageBox.Show(null, "���p�J�i����͂��Ă��������B", "���̓`�F�b�N", MessageBoxButtons.OK);
+ }
+ else if (wlErrFlg == numInputType.Alpha_S)
+ {
+ MessageBox.Show(null, "���p��������͂��Ă��������B", "���̓`�F�b�N", MessageBoxButtons.OK);
+ }
+ else if (wlErrFlg == numInputType.Alpha_C)
+ {
+ MessageBox.Show(null, "��p��������͂��Ă��������B", "���̓`�F�b�N", MessageBoxButtons.OK);
+ }
+ else
+ {
+ MessageBox.Show(null, "�������l����͂��Ă��������B", "���̓`�F�b�N", MessageBoxButtons.OK);
+ }
+ return false;
+ }
+ }
+ return true;
+ }
+ catch
+ {
+ return false;
+ }
+ }
+
+
+ ///�� IsOutOfRange
+ ///�@�y�T�@�v�z�F�`�F�b�N
+ ///�@�y���@���z�F
+ ///�@�y�߂�l�z�Fbool
+ public static bool IsOutOfRange(string hsValue, string hsRange)
+ {
+ try
+ {
+ string[] wsRange;
+ if (hsRange[0] == "'"[0])
+ {
+
+ if (hsRange.IndexOf("'" + hsValue + "'") == -1)
+ {
+ return true;
+ }
+ }
+ else
+ {
+ wsRange = hsRange.Split(new char[] { ',' });
+ wsRange[0] = wsRange[0].Substring(1);
+ wsRange[1] = wsRange[1].Substring(0, wsRange[1].Length - 1);
+ if (hsRange[0] == '[')
+ {
+ if (Convert.ToDouble(hsValue) < Convert.ToDouble(wsRange[0]))
+ {
+ return true;
+ }
+ }
+ else if (hsRange[0] == '(')
+ {
+ if (Convert.ToDouble(hsValue) <= Convert.ToDouble(wsRange[0]))
+ {
+ return true;
+ }
+ }
+ if (hsRange[hsRange.Length - 1] == ']')
+ {
+ if (Convert.ToDouble(hsValue) > Convert.ToDouble(wsRange[1]))
+ {
+ return true;
+ }
+ }
+ else if (hsRange[hsRange.Length - 1] == ')')
+ {
+ if (Convert.ToDouble(hsValue) >= Convert.ToDouble(wsRange[1]))
+ {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+ catch
+ {
+ return true;
+ }
+ }
+
+ public static bool IsCorrectText(CTextBox textbox)
+ {
+ return IsCorrectText(textbox, true, false);
+ }
+
+ public static bool IsCorrectText(CTextBox textbox, bool showErrMsg)
+ {
+ return IsCorrectText(textbox, showErrMsg, false);
+ }
+
+ public static bool IsCorrectText(CTextBox textbox, bool showErrMsg, bool ignoteNull)
+ {
+ if (!textbox.Visible) { return true; }
+
+ if (IsCorrectInput(textbox, showErrMsg, ignoteNull))
+ {
+ if (textbox.Text.Length > 0)
+ {
+ if ((GetShowStyle(textbox) & numShowStyle.ZeroPad) == numShowStyle.ZeroPad)
+ {
+ textbox.Text = textbox.Text.PadLeft(textbox.MaxLength, '0');
+ }
+ }
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ public static bool IsCorrectInput(CTextBox textbox)
+ {
+ return IsCorrectInput(textbox, true, false);
+ }
+
+ ///�� IsCorrectInput
+ ///�@�y�T�@�v�z�F�`�F�b�N
+ ///�@�y���@���z�F
+ ///�@�y�߂�l�z�Fbool
+ public static bool IsCorrectInput(CTextBox textbox, bool showErrMsg , bool ignoteNull)
+ {
+ try
+ {
+ if (textbox.IsChkData == false)
+ {
+ return true;
+ }
+
+ if ("".Equals(textbox.Text.Trim()))
+ {
+ if (ignoteNull){return true;}
+
+ if (textbox.NotNull)
+ {
+ if (showErrMsg) { MessageBox.Show("���e����͂��Ă��������B", "���̓`�F�b�N", MessageBoxButtons.OK, MessageBoxIcon.Information); }
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+ }
+ if (!IsCorrectValue(textbox, showErrMsg))
+ {
+ return false;
+ }
+ //System.Text.Encoding enc = System.Text.Encoding.GetEncoding("Shift_JIS");
+ //if (enc.GetBytes(hsValue).Length > hoCtrTag.MaxKeta)
+ //{
+ // if (showErrMsg) { MessageBox.Show(null, hoCtrTag.MaxKeta.ToString() + "���ȓ��œ��͂��Ă��������B", MessageBoxButtons.OK); }
+ // return false;
+ //}
+ if (textbox.IsDate)
+ {
+ if (CConvert.IsDate(CConvert.ToInt(textbox.Text).ToString().PadLeft(8,'0')))
+ {
+ if (showErrMsg) { MessageBox.Show("���t����͂��Ă��������B", "���̓`�F�b�N", MessageBoxButtons.OK, MessageBoxIcon.Information); }
+ return false;
+ }
+ }
+ if (textbox.In_Range != "")
+ {
+ if (IsOutOfRange(textbox.Text, textbox.In_Range))
+ {
+ if (showErrMsg) { MessageBox.Show("���͔͈͈ȊO�ł��B", "���̓`�F�b�N", MessageBoxButtons.OK, MessageBoxIcon.Information); }
+ return false;
+ }
+ }
+
+ return true;
+ }
+ catch
+ {
+ return false;
+ }
+ }
+
+ ///�� SetNextFocus
+ ///�@�y�T�@�v�z�F�J�\���ړ�
+ ///�@�y���@���z�F
+ ///�@�y�߂�l�z�Fbool
+ public static bool SetNextFocus(System.Windows.Forms.KeyEventArgs e)
+ {
+ try
+ {
+ System.Windows.Forms.Keys KeyCode = e.KeyCode;
+ if (KeyCode == Keys.Return)
+ {
+ SendKeys.Send("{TAB}");
+ }
+ else if (KeyCode == Keys.Escape)
+ {
+ SendKeys.Send("+{TAB}");
+ }
+ return true;
+ }
+ catch
+ {
+ return false;
+ }
+ }
+
+ public static numShowStyle GetShowStyle(CTextBox curField)
+ {
+ string[] wsItems = null;
+ if (curField.ShowStyle.Length == 0)
+ {
+ return numShowStyle.None;
+ }
+ else
+ {
+ wsItems = curField.ShowStyle.Split(new char[] { ',' });
+ numShowStyle ret = (numShowStyle)CConvert.ToInt(wsItems[0]);
+ for (int i = 1; i <= wsItems.Length - 1; i++)
+ {
+ ret = ret | (numShowStyle)CConvert.ToInt(wsItems[i]);
+ }
+ return ret;
+ }
+ }
+
+ public static numInputType GetInputType(CTextBox curField)
+ {
+ string[] wsItems = null;
+ if (curField.InputType.Length == 0)
+ {
+ return numInputType.None;
+ }
+ else
+ {
+ wsItems = curField.InputType.Split(new char[] { ',' });
+ numInputType ret = (numInputType)CConvert.ToInt(wsItems[0]);
+ for (int i = 1; i <= wsItems.Length - 1; i++)
+ {
+ ret = ret | (numInputType)CConvert.ToInt(wsItems[i]);
+ }
+ return ret;
+ }
+ }
+
+ public static void TextEnter(CTextBox hoTextBox)
+ {
+ numShowStyle style = GetShowStyle(hoTextBox);
+ if ((style & numShowStyle.ThousandSeparator) == numShowStyle.ThousandSeparator)
+ {
+ hoTextBox.Text = hoTextBox.Text.Replace(",", string.Empty);
+ }
+
+ if (!hoTextBox.PanelExEnabled)
+ {
+ if ((style & numShowStyle.ShowList) == numShowStyle.ShowList)
+ {
+ hoTextBox.BackColor = Color.Pink;
+ }
+ else
+ {
+ hoTextBox.BackColor = Color.LightSteelBlue;
+ }
+ }
+ }
+
+ public static void TextLeave(CTextBox hoTextBox)
+ {
+ numShowStyle style = GetShowStyle(hoTextBox);
+ if ((style & numShowStyle.ThousandSeparator) == numShowStyle.ThousandSeparator)
+ {
+ hoTextBox.Text = string.Format("{0:#,0}", CConvert.ToDecimal(hoTextBox.Text));
+ }
+ if (!hoTextBox.PanelExEnabled) { hoTextBox.BackColor = hoTextBox.ReadOnly ? ColorType.Control : Color.White; }
+ }
+
+ public static bool TextKeyPress(TextBox hoTextBox, ref char hKeyAscii, int hlMaxKeta, numInputType hlInputType)
+ {
+ try
+ {
+ if (hlInputType == numInputType.None)
+ {
+ return true;
+ }
+
+ if (hKeyAscii == 8)
+ {
+ return true;
+ }
+ else if (hKeyAscii == "'"[0])
+ {
+ hKeyAscii = (char)0;
+ return false;
+ }
+ else if (hKeyAscii == 13)
+ {
+ //hKeyAscii = (char)0;
+ return false;
+ }
+ else if (hKeyAscii == '+')
+ {
+ //if ((hlInputType & numInputType.Plus_FieldClear) == numInputType.Plus_FieldClear)
+ //{
+ // hoTextBox.Text = "";
+ // hKeyAscii = (char)0;
+ // return false;
+ //}
+ }
+
+ if ((hlInputType & numInputType.Num_FieldClear) == numInputType.Num_FieldClear)
+ {
+ if (hoTextBox.Text.Length >= hlMaxKeta)
+ {
+ hoTextBox.Text = "";
+ //���̃`�F�b�N�ɍs��
+ }
+ }
+
+ if ((hlInputType & numInputType.Num) == numInputType.Num)
+ {
+ if ('0' <= hKeyAscii && hKeyAscii <= '9')
+ {
+ return true;
+ }
+ }
+
+ if ((hlInputType & numInputType.Dot) == numInputType.Dot)
+ {
+ if (hKeyAscii == '.')
+ {
+ return true;
+ }
+ }
+
+ if ((hlInputType & numInputType.Slash) == numInputType.Slash)
+ {
+ if (hKeyAscii == '/')
+ {
+ return true;
+ }
+ }
+
+ if ((hlInputType & numInputType.Colon) == numInputType.Colon)
+ {
+ if (hKeyAscii == ':')
+ {
+ return true;
+ }
+ }
+
+ if ((hlInputType & numInputType.Subtract) == numInputType.Subtract)
+ {
+ if (hKeyAscii == '-')
+ {
+ return true;
+ }
+ }
+
+ if ((hlInputType & numInputType.Comma) == numInputType.Comma)
+ {
+ if (hKeyAscii == ',')
+ {
+ return true;
+ }
+ }
+
+ if ((hlInputType & numInputType.DotSendKeys) == numInputType.DotSendKeys)
+ {
+ if (hKeyAscii == '.')
+ {
+ SendKeys.Send("000");
+ hKeyAscii = (char)0;
+ return true;
+ }
+ }
+
+ if ((hlInputType & numInputType.Space) == numInputType.Space)
+ {
+ if (hKeyAscii == ' ')
+ {
+ return true;
+ }
+ }
+
+ if ((hlInputType & numInputType.Alpha_C) == numInputType.Alpha_C)
+ {
+ if ('A' <= hKeyAscii && hKeyAscii <= 'Z')
+ {
+ return true;
+ }
+ }
+
+ if ((hlInputType & numInputType.Alpha_S) == numInputType.Alpha_S)
+ {
+ if ('a' <= hKeyAscii && hKeyAscii <= 'z')
+ {
+ return true;
+ }
+ }
+
+ if ((hlInputType & numInputType.Kana) == numInputType.Kana)
+ {
+ if ('�' <= hKeyAscii && hKeyAscii <= '�')
+ {
+ return true;
+ }
+ }
+
+ if ((hlInputType & numInputType.Half) == numInputType.Half)
+ {
+ if (hKeyAscii >= 0 && hKeyAscii <= 255)
+ {
+ return true;
+ }
+ }
+ if ((hlInputType & numInputType.Full) == numInputType.Full)
+ {
+ if (hKeyAscii < 0 || hKeyAscii > 255)
+ {
+ return true;
+ }
+ }
+
+ hKeyAscii = (char)0;
+ return false;
+ }
+ catch
+ {
+ return false;
+ }
+ }
+
+ public static void TextBoxEnter(object sender)
+ {
+ TextBox txtField = (TextBox)sender;
+ txtField.BackColor = Color.Pink;
+ }
+
+ public static void TextBoxLeave(object sender)
+ {
+ TextBox txtField = (TextBox)sender;
+ txtField.BackColor = Color.White;
+ }
+
+ public static void TextBoxKeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e,int maxKeta,numInputType inputType)
+ {
+ TextBox txtField = (TextBox)sender;
+ char KeyAscii = e.KeyChar;
+ TextKeyPress(txtField, ref KeyAscii, maxKeta, inputType);
+ if (KeyAscii == (char)0)
+ {
+ e.Handled = true;
+ }
+ }
+
+ ///�� GetFormXml
+ ///�@�y�T�@�v�z�F���ѕW���̂w�l�k��ǂ�
+ ///�@�y���@���z�F(IN) hsConfigXml String ̧���߽
+ ///�@�y�߂�l�z�F�Ȃ�
+ public static Dictionary<string, InputItem> GetFormXml(object hvConfigXml)
+ {
+ Dictionary<string, InputItem> woParentHash = new Dictionary<string, InputItem>();
+ XmlDocument doc = new XmlDocument();
+ string wsName;
+ string wsValue;
+ string wsCtrKey;
+ InputItem woCtrTag;
+ try
+ {
+ if (hvConfigXml == null)
+ {
+ return null;
+ }
+ if (hvConfigXml is Stream)
+ {
+ doc.Load(((Stream)(hvConfigXml)));
+ }
+ else
+ {
+ doc.Load(((string)(hvConfigXml)));
+ }
+ XmlNode rootnode = doc.DocumentElement;
+ foreach (XmlNode child in rootnode.ChildNodes)
+ {
+ if (child.NodeType == XmlNodeType.Element && child.Name == "control")
+ {
+ wsCtrKey = child.Attributes["CtrName"].Value;
+ if (wsCtrKey.Length == 0)
+ {
+ return null;
+ }
+ woCtrTag = new InputItem();
+ foreach (XmlAttribute child1 in child.Attributes)
+ {
+ wsName = child1.Name;
+ wsValue = child1.Value;
+ //Debug.WriteLine(wsName + " : " + wsValue);
+ if (wsName.Equals("InputType"))
+ {
+ string[] wsItems = null;
+ wsItems = wsValue.Split(new char[] { ','});
+ for (int i = 0; i <= wsItems.Length - 1; i++)
+ {
+ woCtrTag.InputType = woCtrTag.InputType | (numInputType)CConvert.ToInt(wsItems[i]);
+ }
+ }
+ else if (wsName.Equals("ShowStyle"))
+ {
+ string[] wsItems = null;
+ wsItems = wsValue.Split(new char[] { ',' });
+ for (int i = 0; i <= wsItems.Length - 1; i++)
+ {
+ woCtrTag.ShowStyle = woCtrTag.ShowStyle | (numShowStyle)CConvert.ToInt(wsItems[i]);
+ }
+ }
+ else if (wsName.Equals("ImeMode"))
+ {
+ woCtrTag.ImeMode = (ImeMode)CConvert.ToInt(wsValue);
+ }
+ else
+ {
+ CConvert.CallByName(woCtrTag, wsName, CallType.Let, new object[] { wsValue });
+ }
+ }
+ woParentHash.Add(wsCtrKey, woCtrTag);
+ }
+ }
+ return woParentHash;
+ }
+ catch
+ {
+ return woParentHash;
+ }
+ }
+
+ public static bool IsNaturalNumber(String strNumber)
+ {
+ Regex objNotNaturalPattern = new Regex("[^0-9]");
+ Regex objNaturalPattern = new Regex("0*[1-9][0-9]*");
+ return !objNotNaturalPattern.IsMatch(strNumber) &&
+ objNaturalPattern.IsMatch(strNumber);
+ }
+
+ public static bool IsInteger(String strNumber)
+ {
+ Regex objNotIntPattern = new Regex("[^0-9-]");
+ Regex objIntPattern = new Regex("^-[0-9]+$|^[0-9]+$");
+ return !objNotIntPattern.IsMatch(strNumber) && objIntPattern.IsMatch(strNumber);
+ }
+
+ public static bool IsPositiveNumber(String strNumber)
+ {
+ Regex objNotPositivePattern = new Regex("[^0-9.]");
+ Regex objPositivePattern = new Regex("^[.][0-9]+$|[0-9]*[.]*[0-9]+$");
+ Regex objTwoDotPattern = new Regex("[0-9]*[.][0-9]*[.][0-9]*");
+ return !objNotPositivePattern.IsMatch(strNumber) &&
+ objPositivePattern.IsMatch(strNumber) &&
+ !objTwoDotPattern.IsMatch(strNumber);
+ }
+
+ public static bool IsNumber(String strNumber)
+ {
+ Regex objNotNumberPattern = new Regex("[^0-9.-]");
+ Regex objTwoDotPattern = new Regex("[0-9]*[.][0-9]*[.][0-9]*");
+ Regex objTwoMinusPattern = new Regex("[0-9]*[-][0-9]*[-][0-9]*");
+ String strValidRealPattern = "^([-]|[.]|[-.]|[0-9])[0-9]*[.]*[0-9]+$";
+ String strValidIntegerPattern = "^([-]|[0-9])[0-9]*$";
+ Regex objNumberPattern = new Regex("(" + strValidRealPattern + ")|(" + strValidIntegerPattern + ")");
+ return !objNotNumberPattern.IsMatch(strNumber) &&
+ !objTwoDotPattern.IsMatch(strNumber) &&
+ !objTwoMinusPattern.IsMatch(strNumber) &&
+ objNumberPattern.IsMatch(strNumber);
+ }
+
+ public static bool IsAlpha(String strToCheck)
+ {
+ Regex objAlphaPattern = new Regex("[^a-zA-Z]");
+ return !objAlphaPattern.IsMatch(strToCheck);
+ }
+
+ public static bool IsAlphaNumeric(String strToCheck)
+ {
+ Regex objAlphaNumericPattern = new Regex("[^a-zA-Z0-9]");
+ return !objAlphaNumericPattern.IsMatch(strToCheck);
+ }
+
+ public static bool IsHalfKana(String strToCheck)
+ {
+ Regex objNotPattern = new Regex("[^�-�]");
+ Regex objPattern = new Regex("^[�-�]+$");
+ return !objNotPattern.IsMatch(strToCheck) && objPattern.IsMatch(strToCheck);
+ }
+
+ public static bool IsLargAlpha(String strToCheck)
+ {
+ Regex objNotPattern = new Regex("[^A-Z]");
+ Regex objPattern = new Regex("^[A-Z]+$");
+ return !objNotPattern.IsMatch(strToCheck) && objPattern.IsMatch(strToCheck);
+ }
+
+ public static bool IsSmallAlpha(String strToCheck)
+ {
+ Regex objNotPattern = new Regex("[^a-z]");
+ Regex objPattern = new Regex("^[a-z]+$");
+ return !objNotPattern.IsMatch(strToCheck) && objPattern.IsMatch(strToCheck);
+ }
+
+ /// <summary>
+ /// �S�Đ������ǂ���
+ /// </summary>
+ /// <param name="strNumber"></param>
+ /// <returns></returns>
+ public static bool IsWholeNumber(String strNumber)
+ {
+ Regex objNotPattern = new Regex("[^0-9]");
+ Regex objPattern = new Regex("^[0-9]+$");
+ return !objNotPattern.IsMatch(strNumber) && objPattern.IsMatch(strNumber);
+ }
+
+ /// <summary>
+ /// SQL��SMALLDateTime�̃`�F�b�N
+ /// </summary>
+ /// <param name="value"></param>
+ /// <returns></returns>
+ public static bool IsCorrectSmallDateTime(string value)
+ {
+ //1900-01-01 �` 2079-06-06
+ try
+ {
+ DateTime date = CConvert.ToDateTime(value);
+ if (date.Date.CompareTo(CConvert.ToDateTime("1900/01/01").Date) < 0) { return false; }
+ if (date.CompareTo(CConvert.ToDateTime("2079/06/05 23:59:59")) > 0) { return false; }
+ return true;
+ }
+ catch
+ {
+ return false;
+ }
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/Util/InputItem.cs b/HotelPms.Share.Windows/Util/InputItem.cs
new file mode 100644
index 0000000..c190bc4
--- /dev/null
+++ b/HotelPms.Share.Windows/Util/InputItem.cs
@@ -0,0 +1,180 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.IO;
+using System.Reflection;
+using System.Windows.Forms;
+
+namespace HotelPms.Share.Windows.Util
+{
+ [Serializable()]
+ public class InputItem
+ {
+ private bool lbIsChkData = false;
+ private bool lbNotNull = false;
+ private int liMaxKeta = 0;
+ private int liSeparatorLen = 0;
+ private numInputType liInputType = 0;
+ private bool lbIsDate = false;
+ private string lsIn_Range = ""; // '�͈́F "'A','E','F'" OR "'1','2','21'" OR "[1,10]" OR "(1,10)" OR "[1,10)" OR "(1,10]" �̎����Ȃ�
+ private string lsDBFieldName = "";
+ private string lsCtrName = "";
+ private bool lbIsPrimaryKey = false;
+ private int liIndex = 0;
+ private int liCtrIdx = 0;
+ private string lsText = "";
+ private string lsTag = "";
+ private numShowStyle showStyle = 0;
+ private bool enableUpDownKey = false; //���Ɓ��L�[�Łuenter�v�Ɓuesc�v�����l�ɂ���
+ private ImeMode imeMode = ImeMode.On;
+ private string mstNameCtrl = string.Empty;
+
+ public ImeMode ImeMode
+ {
+ get { return imeMode; }
+ set { imeMode = value; }
+ }
+
+ public int CtrIdx
+ {
+ get{return liCtrIdx;}
+ set{liCtrIdx = value;}
+ }
+
+ public int Index{
+ get{return liIndex;}
+ set{liIndex = value;}
+ }
+
+ public bool EnableUpDownKey
+ {
+ get { return enableUpDownKey; }
+ set { enableUpDownKey = value; }
+ }
+
+ public bool IsChkData
+ {
+ get{return lbIsChkData;}
+ set{lbIsChkData = value;}
+ }
+
+ public numShowStyle ShowStyle
+ {
+ get { return showStyle; }
+ set { showStyle = value; }
+ }
+
+ public bool NotNull
+ {
+ get{return lbNotNull;}
+ set{lbNotNull = value;}
+ }
+
+ public int MaxKeta
+ {
+ get{return liMaxKeta;}
+ set
+ {
+ liMaxKeta = value;
+ int len = liMaxKeta / 3;
+ liSeparatorLen =liMaxKeta + len + (liMaxKeta % 3 == 0 ? (len == 0 ? 0 : -1) : 0);
+ }
+ }
+
+ public int SeparatorLen
+ {
+ get { return liSeparatorLen; }
+ }
+
+
+ public numInputType InputType
+ {
+ get{return liInputType;}
+ set{liInputType = value;}
+ }
+
+ public bool IsDate
+ {
+ get{return lbIsDate;}
+ set{lbIsDate = value;}
+ }
+
+ public string In_Range
+ {
+ get{return lsIn_Range;}
+ set{lsIn_Range = value;}
+ }
+
+ public string DBFieldName
+ {
+ get{return lsDBFieldName;}
+ set{lsDBFieldName = value;}
+ }
+
+ public string CtrName
+ {
+ get{return lsCtrName;}
+ set{lsCtrName = value;}
+ }
+
+ public bool IsPrimaryKey
+ {
+ get{return lbIsPrimaryKey;}
+ set{lbIsPrimaryKey = value;}
+ }
+
+ public string Text
+ {
+ get{return lsText;}
+ set{lsText = value;}
+ }
+
+ public string MstNameCtrl
+ {
+ get { return mstNameCtrl; }
+ set { mstNameCtrl = value; }
+ }
+
+ public string Tag
+ {
+ get{return lsTag;}
+ set{lsTag = value;}
+ }
+
+ public string ShowAllInfo()
+ {
+ try
+ {
+ string wsRet = "";
+ string wvValue = "";
+ Type woType = System.Type.GetType("Oat.Library.CommonClass.WinForm.InputItem");
+ FieldInfo[] woFields = woType.GetFields(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Static);
+
+ for (int i = 0; i < woFields.Length; i++)
+ {
+ try
+ {
+ wvValue = woFields[i].GetValue(this).ToString();
+ }
+ catch
+ {
+ wvValue = "";
+ }
+ wsRet = wsRet + woFields[i].Name + " = " + wvValue + "\n";
+ }
+
+ return wsRet;
+
+ }
+ catch
+ {
+ return "";
+ }
+ }
+
+ public InputItem Clone()
+ {
+ return MemberwiseClone() as InputItem;
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/Util/InputItemEventArgs.cs b/HotelPms.Share.Windows/Util/InputItemEventArgs.cs
new file mode 100644
index 0000000..0f7d33c
--- /dev/null
+++ b/HotelPms.Share.Windows/Util/InputItemEventArgs.cs
@@ -0,0 +1,34 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace HotelPms.Share.Windows.Util
+{
+ public class InputItemEventArgs : EventArgs
+ {
+ private bool cancel = false;
+ private object tag = null;
+
+ public object Tag
+ {
+ get { return tag; }
+ set { tag = value; }
+ }
+
+ public bool Cancel
+ {
+ get { return cancel; }
+ set { cancel = value; }
+ }
+
+ public InputItemEventArgs()
+ {
+ }
+
+ public InputItemEventArgs(bool cancel, object tag)
+ {
+ this.Cancel = cancel;
+ this.Tag = tag;
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/Util/JapaneseDateTime.cs b/HotelPms.Share.Windows/Util/JapaneseDateTime.cs
new file mode 100644
index 0000000..c7d45d8
--- /dev/null
+++ b/HotelPms.Share.Windows/Util/JapaneseDateTime.cs
@@ -0,0 +1,182 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HotelPms.Share.Windows.Util
+{
+ public class JapaneseDateTime
+ {
+ private int year, month, dayOfMonth;
+ private bool isLeap;
+ private DateTime time;
+ //System.Globalization.ChineseLunisolarCalendar cc;
+ System.Globalization.JapaneseLunisolarCalendar cc;
+ private static string[] RokuyouList = new string[] { "大安", "赤口", "先勝", "友引", "先負", "仏滅" };
+
+ /// <summary>
+ /// 旧暦年
+ /// </summary>
+ public int Year
+ {
+ get { return year; }
+ }
+
+ /// <summary>
+ /// 旧暦月
+ /// </summary>
+ public int Month
+ {
+ get { return month; }
+ }
+
+ /// <summary>
+ /// 新暦時間
+ /// </summary>
+ public DateTime NewTime
+ {
+ get { return time; }
+ }
+
+ /// <summary>
+ /// 旧暦時間
+ /// </summary>
+ public DateTime OldTime
+ {
+ get { return new DateTime(year, month, dayOfMonth); }
+ }
+
+ /// <summary>
+ /// 旧暦日
+ /// </summary>
+ public int DayOfMonth
+ {
+ get { return dayOfMonth; }
+ }
+
+ /// <summary>
+ /// 閏月かどうか
+ /// </summary>
+ public bool IsLeap
+ {
+ get { return isLeap; }
+ }
+
+ /// <summary>
+ /// 指定日付で旧暦を変換する
+ /// </summary>
+ /// <param name="time"></param>
+ public JapaneseDateTime(DateTime time)
+ {
+ //cc = new System.Globalization.ChineseLunisolarCalendar();
+ cc = new System.Globalization.JapaneseLunisolarCalendar();
+
+ if (time > cc.MaxSupportedDateTime || time < cc.MinSupportedDateTime)
+ throw new Exception("Out Of Range :" + cc.MinSupportedDateTime.ToShortDateString() + "~" + cc.MaxSupportedDateTime.ToShortDateString());
+ year = cc.GetYear(time);
+ month = cc.GetMonth(time);
+ dayOfMonth = cc.GetDayOfMonth(time);
+ isLeap = cc.IsLeapMonth(year, month);
+ if (cc.IsLeapYear(year) && month >= cc.GetLeapMonth(year)) { month -= 1; }
+ this.time = time;
+ }
+
+ public static JapaneseDateTime Now
+ {
+ get { return new JapaneseDateTime(DateTime.Now); }
+ }
+
+ public JapaneseDateTime(int Year, int Month, int DayOfMonth, bool IsLeap)
+ {
+ if (Year >= cc.MaxSupportedDateTime.Year || Year <= cc.MinSupportedDateTime.Year)
+ throw new Exception("Out Of Range ::" + cc.MinSupportedDateTime.ToShortDateString() + "~" + cc.MaxSupportedDateTime.ToShortDateString());
+
+ if (Month < 1 || Month > 12)
+ throw new Exception("日付が不正です。");
+ //cc = new System.Globalization.ChineseLunisolarCalendar();
+ cc = new System.Globalization.JapaneseLunisolarCalendar();
+
+ if (cc.GetLeapMonth(Year) != Month && IsLeap)
+ throw new Exception("GetLeapMonth Error");
+ if (cc.GetDaysInMonth(Year, IsLeap ? Month + 1 : Month) < DayOfMonth || DayOfMonth < 1)
+ throw new Exception("Day Error");
+ year = Year;
+ month = Month;
+ dayOfMonth = DayOfMonth;
+ isLeap = IsLeap;
+ time = DateTime.Now;
+ }
+
+ /// <summary>
+ /// 旧暦⇒新暦
+ /// </summary>
+ /// <returns></returns>
+ public DateTime ToDateTime()
+ {
+ return cc.ToDateTime(year, isLeap ? month + 1 : month, dayOfMonth, time.Hour, time.Minute, time.Second, time.Millisecond);
+ }
+
+ /// <summary>
+ /// 旧暦⇒新暦
+ /// </summary>
+ /// <returns></returns>
+ public static DateTime ToDateTime(JapaneseDateTime CnTime)
+ {
+ return CnTime.ToDateTime();
+ }
+
+ /// <summary>
+ /// 新暦⇒旧暦
+ /// </summary>
+ /// <returns></returns>
+ public static JapaneseDateTime ToJapaneseDateTime(DateTime Time)
+ {
+ return new JapaneseDateTime(Time);
+ }
+
+ /// <summary>
+ /// 新暦⇒旧暦
+ /// </summary>
+ /// <returns></returns>
+ public static string ToJapaneseDateString(DateTime Time)
+ {
+ return ToJapaneseDateString(Time, "yyyy/MM/dd");
+ }
+
+ /// <summary>
+ /// 新暦⇒旧暦
+ /// </summary>
+ /// <returns></returns>
+ public static string ToJapaneseDateString(DateTime Time, string format)
+ {
+ try
+ {
+ JapaneseDateTime jpDate = new JapaneseDateTime(Time);
+ return jpDate.OldTime.ToString(format);
+ }
+ catch
+ {
+ return string.Empty;
+ }
+ }
+
+ /// <summary>
+ /// 新暦⇒六曜
+ /// </summary>
+ /// <returns></returns>
+ public static string ToRokuyou(DateTime Time)
+ {
+ try
+ {
+ JapaneseDateTime jpDate = new JapaneseDateTime(Time);
+ int index = (jpDate.Month + jpDate.DayOfMonth) % 6;
+ return RokuyouList[index];
+ }
+ catch
+ {
+ return string.Empty;
+ }
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/Util/MouseMessageFilter.cs b/HotelPms.Share.Windows/Util/MouseMessageFilter.cs
new file mode 100644
index 0000000..4a97b40
--- /dev/null
+++ b/HotelPms.Share.Windows/Util/MouseMessageFilter.cs
@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace HotelPms.Share.Windows.Util
+{
+ public class MouseMessageFilter : IMessageFilter
+ {
+ private const int WM_MOUSEMOVE = 0x0200;
+
+ public static event MouseEventHandler MouseMove;
+
+ public bool PreFilterMessage(ref Message m)
+ {
+
+ if (m.Msg == WM_MOUSEMOVE)
+ {
+ if (MouseMove != null)
+ {
+ int x = Control.MousePosition.X, y = Control.MousePosition.Y;
+
+ MouseMove(null, new MouseEventArgs(MouseButtons.None, 0, x, y, 0));
+ }
+ }
+ return false;
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/Util/NPOIExcel.cs b/HotelPms.Share.Windows/Util/NPOIExcel.cs
new file mode 100644
index 0000000..da3c925
--- /dev/null
+++ b/HotelPms.Share.Windows/Util/NPOIExcel.cs
@@ -0,0 +1,400 @@
+using NPOI.HSSF.UserModel;
+using NPOI.SS.UserModel;
+using NPOI.XSSF.UserModel;
+
+namespace HotelPms.Share.Windows.Util
+{
+ public class NPOIExcel : IDisposable
+ {
+ #region ★★★★★ Declartions ★★★★★
+
+ private bool m_Disposed = false;
+ private bool m_IsEditting = false;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+
+ /// <summary>
+ /// 絶対パス
+ /// </summary>
+ public string FileName { get; set; } = string.Empty;
+
+ /// <summary>
+ /// 現在のWorkbook
+ /// </summary>
+ public IWorkbook Workbook { get; set; } = null;
+
+ /// <summary>
+ /// 選択されたSheet
+ /// </summary>
+ public ISheet Sheet { get; set; } = null;
+
+ /// <summary>
+ /// Excel2003前?
+ /// </summary>
+ public bool XlsMode { get; set; } = false;
+
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public NPOIExcel(string fileName)
+ {
+ FileName = fileName;
+ FileInfo fileInfo = new FileInfo(FileName);
+ XlsMode = (fileInfo.Extension == ".xls");
+
+ if (System.IO.File.Exists(FileName))
+ {
+ using (FileStream file = new FileStream(FileName, FileMode.Open, FileAccess.Read))
+ {
+ Workbook = XlsMode ? new HSSFWorkbook(file) : new XSSFWorkbook(file);
+ }
+ Sheet = Workbook.GetSheetAt(0);
+ Sheet.ForceFormulaRecalculation = true;
+ }
+ else
+ {
+ Workbook = XlsMode ? new HSSFWorkbook() : new XSSFWorkbook();
+ Sheet = Workbook.CreateSheet("Sheet1"); //シートの作成
+ }
+ }
+
+ ~NPOIExcel()
+ {
+ Dispose(false);
+ }
+
+ protected virtual void Dispose(bool disposing)
+ {
+ if (!m_Disposed) //一回だけ
+ {
+ if (disposing)
+ {
+ if (m_IsEditting) { Save(); }
+ //Managed Resources
+ }
+
+ //Unmanaged resources
+ m_Disposed = true;
+ }
+ }
+
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+
+ private string GetCellFormat(ICell cell)
+ {
+ IDataFormat df = XlsMode ? new HSSFDataFormat((Workbook as HSSFWorkbook).Workbook) : new XSSFDataFormat((Workbook as XSSFWorkbook).GetStylesSource());
+ return df.GetFormat(cell.CellStyle.DataFormat);
+ }
+
+
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+
+ /// <summary>
+ /// シート変換
+ /// </summary>
+ /// <param name="sheetIdx"></param>
+ public void SetCurrentSheet(int sheetIdx)
+ {
+ Sheet = Workbook.GetSheetAt(sheetIdx);
+ Sheet.ForceFormulaRecalculation = true;
+ }
+
+ /// <summary>
+ /// 存在しない時、null
+ /// </summary>
+ /// <param name="colRowValue"></param>
+ /// <returns></returns>
+ public ICell? GetCell(string colRowValue)
+ {
+ return GetCell(colRowValue, false);
+ }
+
+ public object? GetCellValue(string colRowValue)
+ {
+ try
+ {
+ ICell cell = GetCell(colRowValue);
+ if (cell == null) { return string.Empty; }
+ System.Diagnostics.Debug.WriteLine($"{colRowValue}.CellType={cell.CellType}");
+ if (cell.CellType == CellType.Numeric) { return cell.NumericCellValue; }
+ else if (cell.CellType == CellType.Boolean) { return cell.BooleanCellValue; }
+ else { return cell.StringCellValue; }
+ }
+ catch
+ {
+ return string.Empty;
+ }
+ }
+
+ public string? GetCellForceString(string colRowValue)
+ {
+ try
+ {
+ object ret = GetCellValue(colRowValue);
+ return ret == null ? string.Empty : ret.ToString();
+ }
+ catch
+ {
+ return string.Empty;
+ }
+ }
+
+ /// <summary>
+ /// セルの値を取得する
+ /// </summary>
+ /// <param name="colRowValue"></param>
+ /// <returns></returns>
+ public string GetCellString(string colRowValue)
+ {
+ try
+ {
+ ICell cell = GetCell(colRowValue);
+ if (cell == null) { return string.Empty; }
+ System.Diagnostics.Debug.WriteLine($"{colRowValue}={cell.StringCellValue}");
+ return cell.StringCellValue;
+ }
+ catch
+ {
+ return string.Empty;
+ }
+ }
+
+ public int GetCellInt(string colRowValue)
+ {
+ try
+ {
+ ICell cell = GetCell(colRowValue);
+ if (cell == null) { return 0; }
+ return (int)cell.NumericCellValue;
+ }
+ catch
+ {
+ return 0;
+ }
+ }
+
+ /// <summary>
+ /// 存在しない時、新規
+ /// </summary>
+ /// <param name="colRowValue"></param>
+ /// <returns></returns>
+ public ICell? GetCell(string colRowValue, bool newCell)
+ {
+ System.Drawing.Point p = GetCellPoint(colRowValue);
+ IRow row = Sheet.GetRow(p.Y);
+ if (row == null)
+ {
+ if (newCell) { row = Sheet.CreateRow(p.Y); } else { return null; }
+ }
+
+ ICell cell = row.GetCell(p.X);
+ if (cell == null)
+ {
+ if (newCell) { cell = row.CreateCell(p.X); } else { return null; }
+ }
+ return cell;
+ }
+
+ /// <summary>
+ /// フォントの作成
+ /// </summary>
+ /// <returns></returns>
+ public IFont CreateFont()
+ {
+ IFont font = Workbook.CreateFont();
+ return font;
+ }
+
+ /// <summary>
+ /// 計算式セット
+ /// </summary>
+ /// <param name="colRowValue"></param>
+ /// <param name="formula"></param>
+ public void SetCellFormula(string colRowValue, string formula)
+ {
+ m_IsEditting = true;
+ ICell cell = GetCell(colRowValue, true);
+ cell.SetCellFormula(formula);
+
+ }
+
+ /// <summary>
+ /// セルの値セット:xls専用
+ /// </summary>
+ /// <param name="colRowValue"></param>
+ /// <param name="richTextString"></param>
+ public void SetCell(string colRowValue, HSSFRichTextString richTextString)
+ {
+ m_IsEditting = true;
+ ICell cell = GetCell(colRowValue, true);
+ cell.SetCellValue(richTextString);
+ }
+
+ /// <summary>
+ /// セルの値セット:数字専用
+ /// </summary>
+ /// <param name="colRowValue"></param>
+ /// <param name="value"></param>
+ public void SetCell(string colRowValue, double value)
+ {
+ m_IsEditting = true;
+ ICell cell = GetCell(colRowValue, true);
+ cell.SetCellValue(value);
+ }
+
+ /// <summary>
+ /// セルの値セット:日付専用
+ /// </summary>
+ /// <param name="colRowValue"></param>
+ /// <param name="value"></param>
+ public void SetCell(string colRowValue, DateTime value)
+ {
+ m_IsEditting = true;
+ ICell cell = GetCell(colRowValue, true);
+ cell.SetCellValue(value);
+ }
+
+ /// <summary>
+ /// セルの値セット:Boolean
+ /// </summary>
+ /// <param name="colRowValue"></param>
+ /// <param name="value"></param>
+ public void SetCell(string colRowValue, bool value)
+ {
+ m_IsEditting = true;
+ ICell cell = GetCell(colRowValue, true);
+ cell.SetCellValue(value);
+ }
+
+ /// <summary>
+ /// 数字型変換対応
+ /// </summary>
+ /// <param name="colRowValue"></param>
+ /// <param name="value"></param>
+ public void SetCell(string colRowValue, string value)
+ {
+ m_IsEditting = true;
+ System.Drawing.Point p = GetCellPoint(colRowValue);
+ IRow row = Sheet.GetRow(p.Y);
+ if (row == null) { row = Sheet.CreateRow(p.Y); }
+
+ ICell cell = row.GetCell(p.X);
+ if (cell == null) { cell = row.CreateCell(p.X); }
+
+ string format = GetCellFormat(cell);
+ if ((format.Contains("#") && format.Contains("0")) || format.Contains("0_"))
+ {
+ double val = 0;
+ if (double.TryParse(value, out val))
+ {
+ cell.SetCellValue(val);
+ }
+ else
+ {
+ cell.SetCellValue(value);
+ }
+ }
+ else
+ {
+ cell.SetCellValue(value);
+ }
+ }
+
+ /// <summary>
+ /// 保存
+ /// </summary>
+ public void Save()
+ {
+ //Write the stream data of workbook to the root directory
+ using (FileStream file = new FileStream(FileName, FileMode.Create))
+ {
+ Workbook.Write(file, true);
+ file.Close();
+ }
+ }
+
+ /// <summary> ExcelX位置→EXCEL列文字 (1→A,2→B,3→C,27→AA)
+ /// </summary>
+ /// <param name="ColNum">索引号</param>
+ /// <returns>string</returns>
+ public static string ToColName(int ColNum)
+ {
+ int ll_mod;
+ string ColName = "";
+
+ while (ColNum > 0)
+ {
+ ll_mod = ColNum % 26;
+ if (ll_mod == 0)
+ {
+ ColName = "Z" + ColName;
+ ll_mod = 1;
+ }
+ else
+ {
+ ColName = (Convert.ToChar(ll_mod + 64)).ToString() + ColName;
+ }
+ ColNum = (ColNum - ll_mod) / 26;
+ }
+
+ return ColName;
+ }
+
+ /// <summary> Excel列文字→ExcelX位置 ("A"→1、"AA"→27)
+ /// </summary>
+ /// <param name="ColName">列名</param>
+ /// <returns>int</returns>
+ public static int ToIndex(string ColName)
+ {
+ int ColIndex = 0;
+ for (int i = ColName.Length - 1; i >= 0; i--)
+ {
+ ColIndex += Convert.ToInt32(((int)ColName[i] - 64) * Math.Pow(26, (ColName.Length - 1) - i));
+ }
+
+ return ColIndex;
+ }
+
+
+ /// <summary> Excel文字→Excel位置("A1"→(0,0)、"B2"→(1,1))(0基準)
+ /// </summary>
+ /// <param name="colRowValue"></param>
+ /// <returns></returns>
+ public static System.Drawing.Point GetCellPoint(string colRowValue)
+ {
+ System.Drawing.Point point = new System.Drawing.Point(0, 0);
+ string colstr = string.Empty;
+ string rowStr = string.Empty;
+ for (int i = 0; i < colRowValue.Length; i++)
+ {
+ if (Char.IsNumber(colRowValue[i]))
+ {
+ rowStr += colRowValue[i].ToString();
+ }
+ else
+ {
+ colstr += colRowValue[i].ToString();
+ }
+ }
+
+ point.Y = Convert.ToInt32(rowStr) - 1; //行
+ point.X = ToIndex(colstr) - 1;
+ return point;
+ }
+
+ #endregion
+ }
+}
diff --git a/HotelPms.Share.Windows/Util/UnhandledExceptionListener.cs b/HotelPms.Share.Windows/Util/UnhandledExceptionListener.cs
new file mode 100644
index 0000000..95ea7d6
--- /dev/null
+++ b/HotelPms.Share.Windows/Util/UnhandledExceptionListener.cs
@@ -0,0 +1,57 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Windows.Forms;
+using System.IO;
+
+namespace HotelPms.Share.Windows.Util
+{
+ public class UnhandledExceptionListener
+ {
+ public static void Execute()
+ {
+ Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
+ Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
+ AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
+ if (Application.StartupPath.CompareTo(Environment.CurrentDirectory) != 0) { Environment.CurrentDirectory = Application.StartupPath; }
+ }
+
+ private static void WriteUnhandledExceptionLog(object data, string title)
+ {
+ try
+ {
+ string file = Application.StartupPath + @"\UnhandledException.log";
+
+ if (File.Exists(file))
+ {
+ FileInfo fileInfo = new FileInfo(file);
+ if (fileInfo.Length > 1024 * 1024)
+ {
+ string bkfile = string.Format(@"\UnhandledException{0}.log", DateTime.Now.ToString("yyyyMMddHHmmss"));
+ File.Copy(file, bkfile, true);
+ File.Delete(file);
+ }
+ }
+
+ using (System.IO.FileStream fs = new System.IO.FileStream(file, System.IO.FileMode.Append, System.IO.FileAccess.Write))
+ {
+ using (System.IO.StreamWriter w = new System.IO.StreamWriter(fs, System.Text.Encoding.UTF8))
+ {
+ w.WriteLine(string.Format("�y{0}�z{2}�F{1}", DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss fff"), data, title));
+ }
+ }
+ }
+ catch { }
+ }
+
+ private static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
+ {
+ WriteUnhandledExceptionLog(e.Exception, "Application_ThreadException");
+ }
+
+ private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
+ {
+ WriteUnhandledExceptionLog(e.ExceptionObject, "CurrentDomain_UnhandledException" + "�F" + e.IsTerminating.ToString());
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/Util/ValueChangeEventArgs.cs b/HotelPms.Share.Windows/Util/ValueChangeEventArgs.cs
new file mode 100644
index 0000000..1a3d2ef
--- /dev/null
+++ b/HotelPms.Share.Windows/Util/ValueChangeEventArgs.cs
@@ -0,0 +1,71 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace HotelPms.Share.Windows.Util
+{
+ public class ValueChangeEventArgs : InputItemEventArgs
+ {
+ //private bool cancel = false;
+ private string chengDate = string.Empty;
+ private bool resetOrgValue = true;
+ //private object tag = null;
+ private int m_ChangeEditingModeResult = 4;
+
+ public int ChangeEditingModeResult
+ {
+ get { return m_ChangeEditingModeResult; }
+ set { m_ChangeEditingModeResult = value; }
+ }
+
+ //public object Tag
+ //{
+ // get { return tag; }
+ // set { tag = value; }
+ //}
+
+ //public bool Cancel
+ //{
+ // get { return cancel; }
+ // set { cancel = value; }
+ //}
+
+ /// <summary>
+ /// yyyy/MM/dd
+ /// </summary>
+ public string ChengDate
+ {
+ get { return chengDate; }
+ set { chengDate = value; }
+ }
+
+ public bool ResetOrgValue
+ {
+ get { return resetOrgValue; }
+ set { resetOrgValue = value; }
+ }
+
+ public ValueChangeEventArgs()
+ {
+ }
+
+ public ValueChangeEventArgs(bool cancel)
+ {
+ this.Cancel = cancel;
+ }
+
+
+ public ValueChangeEventArgs(bool cancel, string chengDate)
+ {
+ this.Cancel = cancel;
+ this.ChengDate=chengDate;
+ }
+
+ public ValueChangeEventArgs(bool cancel, string chengDate, bool resetOrgValue)
+ {
+ this.Cancel = cancel;
+ this.ChengDate = chengDate;
+ this.resetOrgValue = resetOrgValue;
+ }
+ }
+}
diff --git a/HotelPms.Share.Windows/Util/ValueChangeListener.cs b/HotelPms.Share.Windows/Util/ValueChangeListener.cs
new file mode 100644
index 0000000..d5d11ba
--- /dev/null
+++ b/HotelPms.Share.Windows/Util/ValueChangeListener.cs
@@ -0,0 +1,245 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Drawing;
+using System.Reflection;
+using HotelPms.Share.Windows.Component;
+using System.Windows.Forms;
+using HotelPms.Share.Util;
+
+namespace HotelPms.Share.Windows.Util
+{
+ public enum ChangeEditingModeResult : int
+ {
+ Error = 0, //失敗
+ Inputting, //入力登録中状態
+ Editting, //編集中状態
+ ReLoad, //最新情報をロードした
+ Other, //その他
+ }
+
+ /// <summary>
+ /// 編集フォームのモード
+ /// </summary>
+ public enum UpdateFormMode : int
+ {
+ Normal = 0, //閲覧中、修正可能
+ Edit, //閲覧から修正中
+ New, //新規
+ Inputting, //新規登録中
+ ReadOnly, //閲覧モード、修正不可
+ }
+
+ public class ValueChangeListener :IDisposable
+ {
+ private static Dictionary<string, Bitmap> ResourceImage = new Dictionary<string, Bitmap>();
+
+ //Control
+ private UpdateFormMode curUpdateMode = UpdateFormMode.New;
+ private Control btnEditStatus = null;
+ public event CTextBoxArray.TBArrayEventHandler BeforeChangeToEditingMode = null;
+ private bool m_IsAntLabel = false;
+ private System.Windows.Forms.Timer timer1 = null;
+
+ public UpdateFormMode CurUpdateMode
+ {
+ get { return curUpdateMode; }
+ set { curUpdateMode = value; }
+ }
+
+ public ValueChangeListener(Control btnEditStatus)
+ {
+ m_IsAntLabel = (btnEditStatus is AntLabel);
+ if (!m_IsAntLabel)
+ {
+ timer1 = new System.Windows.Forms.Timer();
+ timer1.Interval = 500;
+ timer1.Tick += new EventHandler(timer1_Tick);
+ }
+
+ this.btnEditStatus = btnEditStatus;
+ }
+
+ private Bitmap GetResourceImage(string fileName)
+ {
+ Bitmap bmp = null;
+ if (!ResourceImage.TryGetValue(fileName, out bmp))
+ {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("HotelPms.Share.Windows.Properties.Resources", Assembly.GetExecutingAssembly());
+ object obj = temp.GetObject(fileName);
+ bmp = ((System.Drawing.Bitmap)(obj));
+ ResourceImage.Add(fileName, bmp);
+ }
+ return bmp;
+ }
+
+ private void timer1_Tick(object sender, EventArgs e)
+ {
+ Button obj = btnEditStatus as Button;
+ if (CConvert.ToBool(obj.Tag) == true)
+ {
+ if (curUpdateMode == UpdateFormMode.Edit)
+ {
+ obj.Image = GetResourceImage("henshu_w");
+ }
+ else
+ {
+ obj.Image = GetResourceImage("toroku_w");
+ }
+ obj.Tag = false;
+ }
+ else
+ {
+ if (curUpdateMode == UpdateFormMode.Edit)
+ {
+ obj.Image = GetResourceImage("henshu_b");
+ }
+ else
+ {
+ obj.Image = GetResourceImage("toroku_b");
+ }
+ obj.Tag = true;
+ }
+ }
+
+ /// <summary> [編集中(点滅)][登録中][登録中(点滅)][閲覧中]の更新
+ /// </summary>
+ public void SetEditStatusStyle()
+ {
+ if (m_IsAntLabel)
+ {
+ AntLabel label = btnEditStatus as AntLabel;
+ label.AnimationEnabled = false;
+ switch (curUpdateMode)
+ {
+ case UpdateFormMode.Edit:
+ label.Text = "編集中";
+ label.Tag = true;
+ label.EndBackColor = Color.FromArgb(192, 64, 0);
+ label.BackColor = Color.PapayaWhip;
+ label.AnimationEnabled = true;
+ break;
+ case UpdateFormMode.New:
+ label.Text = "登録中";
+ label.EndBackColor = Color.FromArgb(64, 0, 64);
+ label.BackColor = Color.PapayaWhip;
+ break;
+ case UpdateFormMode.Inputting:
+ label.Text = "登録中";
+ label.EndBackColor = Color.FromArgb(0, 64, 0);
+ label.BackColor = Color.PapayaWhip;
+ label.Tag = true;
+ label.AnimationEnabled = true;
+ break;
+ default:
+ label.Text = "閲覧中";
+ label.EndBackColor = Color.FromArgb(0, 0, 64);
+ label.BackColor = Color.PapayaWhip;
+ break;
+ }
+ }
+ else
+ {
+ Button obj = btnEditStatus as Button;
+ timer1.Enabled = false;
+ switch (curUpdateMode)
+ {
+ case UpdateFormMode.Edit:
+ obj.Image = GetResourceImage("henshu_b");
+ obj.Tag = true;
+ timer1.Enabled = true;
+ break;
+ case UpdateFormMode.New:
+ obj.Image = GetResourceImage("toroku_w");
+ break;
+ case UpdateFormMode.Inputting:
+ obj.Image = GetResourceImage("toroku_b");
+ obj.Tag = true;
+ timer1.Enabled = true;
+ break;
+ default:
+ obj.Image = GetResourceImage("etsuranchu");
+ break;
+ }
+ }
+ }
+
+ /// <summary>
+ /// 閲覧モードから編集中に変った時(Overwrite)
+ /// </summary>
+ /// <returns></returns>
+ public ChangeEditingModeResult ChangeEditingBefore()
+ {
+ if (BeforeChangeToEditingMode != null)
+ {
+ CTextBoxArrayBaseEventArgs e = new CTextBoxArrayBaseEventArgs();
+ e.ChangeEditingModeResult = (int)ChangeEditingModeResult.Other;
+ BeforeChangeToEditingMode(this, 0, e);
+ return (ChangeEditingModeResult)e.ChangeEditingModeResult;
+ }
+ return ChangeEditingModeResult.Other;
+ }
+
+ /// <summary>
+ /// 画面の編集モードの更新
+ /// </summary>
+ /// <param name="mode"></param>
+ public ChangeEditingModeResult SetUpdateFormMode(UpdateFormMode mode)
+ {
+ if (curUpdateMode == UpdateFormMode.Normal && mode == UpdateFormMode.Edit)
+ {
+ ChangeEditingModeResult ret = ChangeEditingBefore();
+ if (ret.Equals(ChangeEditingModeResult.ReLoad)
+ || ret.Equals(ChangeEditingModeResult.Error))
+ {
+ return ret;
+ }
+ }
+
+ curUpdateMode = mode;
+ SetEditStatusStyle(); //表示更新
+
+ switch (mode)
+ {
+ case UpdateFormMode.Edit:
+ return ChangeEditingModeResult.Editting;
+ case UpdateFormMode.Inputting:
+ return ChangeEditingModeResult.Inputting;
+ default:
+ break;
+ }
+ return ChangeEditingModeResult.Other;
+ }
+
+ /// <summary>
+ /// 編集中もしくは登録中モードへ
+ /// </summary>
+ /// <returns></returns>
+ public ChangeEditingModeResult ChangeToEditingMode()
+ {
+ if (curUpdateMode == UpdateFormMode.ReadOnly)
+ {
+ return ChangeEditingModeResult.Error;
+ }
+
+ ChangeEditingModeResult ret = ChangeEditingModeResult.Other;
+ if (curUpdateMode == UpdateFormMode.Normal)
+ {
+ ret = SetUpdateFormMode(UpdateFormMode.Edit);
+ }
+ else if (curUpdateMode == UpdateFormMode.New)
+ {
+ ret = SetUpdateFormMode(UpdateFormMode.Inputting);
+ }
+ return ret;
+ }
+
+ public void Dispose()
+ {
+ try
+ {
+ }
+ catch { }
+ }
+ }
+}
diff --git a/HotelPms.Share/Data/DBConnectItem.cs b/HotelPms.Share/Data/DBConnectItem.cs
new file mode 100644
index 0000000..b94e579
--- /dev/null
+++ b/HotelPms.Share/Data/DBConnectItem.cs
@@ -0,0 +1,83 @@
+namespace HotelPms.Share.Data;
+
+/// <summary>
+/// テーブルFacilityMstに対応するクラスです。
+/// </summary>
+[Serializable()]
+public class DBConnectItem
+{
+ private string hostName = string.Empty;
+ public string HostName
+ {
+ get { return hostName; }
+ set { hostName = value; }
+ }
+ private string dBName = string.Empty;
+
+ public string DBName
+ {
+ get { return dBName; }
+ set { dBName = value; }
+ }
+ private string userID = string.Empty;
+
+ public string UserID
+ {
+ get { return userID; }
+ set { userID = value; }
+ }
+ private string password = string.Empty;
+
+ public string Password
+ {
+ get { return password; }
+ set { password = value; }
+ }
+
+ /// <summary>
+ /// ※SqlServerでは使わない 1433となる
+ /// </summary>
+ public int Port { get; set; } = 5432;
+
+ private object tag = null;
+
+ public object Tag
+ {
+ get { return tag; }
+ set { tag = value; }
+ }
+
+ public DBConnectItem()
+ {
+ }
+
+ public DBConnectItem(string hostName, string dBName, string userID, string password)
+ : this(hostName, dBName, userID, password, 5432)
+ { }
+
+ public DBConnectItem(string hostName, string dBName, string userID, string password, int port)
+ : this(hostName, dBName, userID, password, port, null)
+ { }
+
+ public DBConnectItem(string hostName, string dBName, string userID, string password, int port, object tag)
+ {
+ this.hostName = hostName;
+ this.dBName = dBName;
+ this.userID = userID;
+ this.password = password;
+ Port = port;
+ this.tag = tag;
+ }
+
+ public virtual DBConnectItem Clone()
+ {
+ return new DBConnectItem()
+ {
+ HostName = this.hostName,
+ DBName = this.dBName,
+ UserID = this.userID,
+ Password = this.password,
+ Tag = this.tag
+ };
+ }
+}
diff --git a/HotelPms.Share/Data/DataAccess.cs b/HotelPms.Share/Data/DataAccess.cs
new file mode 100644
index 0000000..d0eee59
--- /dev/null
+++ b/HotelPms.Share/Data/DataAccess.cs
@@ -0,0 +1,45 @@
+using System.Data;
+using System.Data.Common;
+
+namespace HotelPms.Share.Data;
+
+public abstract class DataAccess : IDisposable
+{
+ public abstract string UseID { get; set; }
+
+ /// <summary>パスワード</summary>
+ public abstract string PassWord { get; set; }
+
+ /// <summary>データベース所在のパソコン名</summary>
+ public abstract string DataSource { get; set; }
+
+ /// <summary>データベース名</summary>
+ public abstract string Catalog { get; set; }
+
+ public abstract string Schema { get; set; }
+
+ public abstract int Port { get; set; }
+
+ public abstract int ErrNo { get; set; }
+
+ public abstract string ErrInfo { get; set; }
+
+ public abstract System.Data.DataSet GetDataSet(string sql);
+ public abstract System.Data.DataSet GetDataSetWithTran(string sql);
+
+ public abstract System.Data.DataTable GetDataTable(string sql);
+ public abstract object ExecuteScalar(string sql);
+ public abstract int ExecuteGetID(string sql);
+
+ public abstract int ExecuteNonQuery(string sql);
+
+ public abstract bool ExecuteNonQueryWithTran(string sql);
+
+ public abstract void Dispose();
+
+ public abstract DataTable GetTableList();
+
+ public abstract DataTable GetTableList(string whereAdding);
+
+ public abstract T GetDataReader<T>(string sql, Action<DbDataReader, T> Fetch) where T : new();
+}
diff --git a/HotelPms.Share/Data/DataAccessDirectBase.cs b/HotelPms.Share/Data/DataAccessDirectBase.cs
new file mode 100644
index 0000000..adf8e3f
--- /dev/null
+++ b/HotelPms.Share/Data/DataAccessDirectBase.cs
@@ -0,0 +1,14 @@
+namespace HotelPms.Share.Data;
+
+public abstract class DataAccessDirectBase
+{
+ /// <summary>
+ /// テーブル名
+ /// </summary>
+ public string TableName { get; set; } = string.Empty;
+
+ /// <summary>
+ /// テーブル名
+ /// </summary>
+ public DataAccess DBAccess { get; set; }
+}
diff --git a/HotelPms.Share/Data/IRecord.cs b/HotelPms.Share/Data/IRecord.cs
new file mode 100644
index 0000000..c95f7a0
--- /dev/null
+++ b/HotelPms.Share/Data/IRecord.cs
@@ -0,0 +1,15 @@
+
+namespace HotelPms.Share.Data;
+
+public interface IRecord
+{
+ object Parent
+ {
+ get;
+ set;
+ }
+
+ void CopyTo(object dest);
+ string? ToString();
+ void Clear();
+}
diff --git a/HotelPms.Share/Data/MsSqlNet.cs b/HotelPms.Share/Data/MsSqlNet.cs
new file mode 100644
index 0000000..dcc01a4
--- /dev/null
+++ b/HotelPms.Share/Data/MsSqlNet.cs
@@ -0,0 +1,843 @@
+using HotelPms.Share.Data.Script;
+using HotelPms.Share.IO;
+using HotelPms.Share.Util;
+using System.Data;
+using System.Data.Common;
+using System.Data.SqlClient;
+using System.Text;
+
+namespace HotelPms.Share.Data;
+
+/// ****************************** Description *******************************
+/// ◇システム名称
+/// 汎用クラス
+/// ◇概要
+/// データベース制御用クラス(Microsolt Sql専用)
+/// ◇履歴
+/// 2007/XX/XX 小木 勝龍 新規作成
+/// 20110727 毛利 タイムアウト時間を600s⇒6000s
+/// ****************************** Declarations ******************************
+public class MsSqlNet : DataAccess
+{
+ #region ★★★★★ Declartions ★★★★★
+
+ public event SqlInfoMessageEventHandler SqlInfoMessageEvent;
+
+ #endregion
+
+ #region ★★★★★ Declartions ★★★★★
+
+ public string ConnectionString { get; set; } = string.Empty;
+
+ /// <summary>ユーザー</summary>
+ public override string UseID { get; set; } = string.Empty;
+
+ /// <summary>パスワード</summary>
+ public override string PassWord { get; set; } = string.Empty;
+
+ /// <summary>データベース所在のパソコン名</summary>
+ public override string DataSource { get; set; } = string.Empty;
+
+ /// <summary>データベース名</summary>
+ public override string Catalog { get; set; } = string.Empty;
+
+ public override string Schema { get; set; } = "dbo";
+
+ public override int Port { get; set; } = 1433;
+
+ /// <summary>
+ /// デッドロック関連: 1205,3635,5231,5252,17888,22840,23424
+ /// </summary>
+ public int Message_id { get; set; } = 0;
+
+ /// <summary>エラー情報</summary>
+ public override string ErrInfo { get; set; } = string.Empty;
+
+ /// <summary>エラーコード</summary>
+ public override int ErrNo { get; set; } = 0;
+
+ public bool PoolEnabled { get; set; } = false;
+
+ public int MaxPoolSize { get; set; } = 1000;
+
+ public int RetryCount { get; set; } = 12;
+
+ public int RetryInterval { get; set; } = 5;
+
+ /// <summary>
+ /// タイマー単位のSQL
+ /// </summary>
+ public bool IsTimerAccess { get; set; } = false;
+
+ public bool FireInfoMessageEventOnUserErrors { get; set; } = false;
+
+ public bool MessageEventEnabled { get; set; } = false;
+
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public MsSqlNet(string connectionString)
+ {
+ ConnectionString = connectionString;
+ SqlConnectionStringBuilder ssb = new SqlConnectionStringBuilder(connectionString);
+ DataSource = ssb.DataSource;
+ UseID = ssb.UserID;
+ PassWord = ssb.Password;
+ Catalog = ssb.InitialCatalog;
+ MaxPoolSize = ssb.MaxPoolSize;
+ }
+
+ public MsSqlNet(DBConnectItem connecitem) : this(connecitem.HostName, connecitem.UserID, connecitem.Password, connecitem.DBName)
+ { }
+
+ public MsSqlNet(string dataSource, string userID, string passWord) : this(dataSource, userID, passWord, "master")
+ {
+ }
+
+ public MsSqlNet(string dataSource, string userID, string passWord, string catalog)
+ {
+ DataSource = dataSource;
+ UseID = userID;
+ PassWord = passWord;
+ Catalog = catalog;
+ ResetConnectionString();
+ }
+
+ public override void Dispose()
+ {
+
+ }
+
+ #endregion
+
+ #region ★★★★★ Public static Function ★★★★★
+
+ public static void ClearPool()
+ {
+ try
+ {
+ SqlConnection.ClearAllPools();
+ }
+ catch { }
+ }
+
+ /// <summary>
+ ///
+ /// </summary>
+ /// <param name="item"></param>
+ /// <param name="createSql"></param>
+ /// <returns>0.正常 -1.SQL発行エラー 1.DB接続エラー 2.DBが既に存在する</returns>
+ public static int CreateDB(DBConnectItem item, string createSql)
+ {
+ using (MsSqlNet dbAccess = new MsSqlNet(item.HostName, item.UserID, item.Password, "master"))
+ {
+ if (dbAccess.ErrNo != 0) { return 1; }
+ if (dbAccess.ExistsDataBase(item.DBName)) { return 2; }
+
+ if(dbAccess.ExecuteNonQuery(createSql) == -1)
+ {
+ return -1;
+ }
+ else
+ {
+ return 0;
+ }
+ }
+ }
+
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+
+ public void ResetConnectionString()
+ {
+ SqlConnectionStringBuilder ssb = new SqlConnectionStringBuilder();
+ ssb.DataSource = DataSource;
+ ssb.UserID = UseID;
+ ssb.Password = PassWord;
+ ssb.InitialCatalog = Catalog;
+ ssb.MaxPoolSize = MaxPoolSize;
+ ssb.ApplicationName = System.IO.Path.GetFileNameWithoutExtension(System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName);
+ //ssb.ApplicationName = System.IO.Path.GetFileNameWithoutExtension(Application.ExecutablePath);
+ ConnectionString = ssb.ToString();
+ }
+
+ /// <summary>
+ /// 可変戻り値
+ /// </summary>
+ /// <typeparam name="T"></typeparam>
+ /// <param name="sql"></param>
+ /// <param name="fillReaderHandler"></param>
+ /// <returns></returns>
+ public override T GetDataReader<T>(string sql, Action<DbDataReader, T> Fetch)
+ {
+ OperationLog.Instance.WriteLog(string.Format("MsSqlNet.GetDataReader({0})", sql), GetLogLevel());
+ for (int i = 0; i < RetryCount; i++)
+ {
+ if (i > 0) { OperationLog.Instance.WriteLog(string.Format("{1}⇒MsSqlNet.GetDataReader({0})", sql, i), OperationLog.LogLevelType.Normal); }
+ try
+ {
+ ErrClear();
+ T t = new T();
+ using (SqlConnection dbConnect = Open())
+ {
+ using (SqlCommand command = new SqlCommand(sql, dbConnect))
+ {
+ command.CommandTimeout = 6000;
+ using (SqlDataReader reader = command.ExecuteReader(CommandBehavior.Default))
+ {
+ Fetch(reader, t);
+ } //自動クロス
+ }
+ }
+ return t;
+ }
+ catch (Exception ex)
+ {
+ if (!IsTransient(ex, sql)) { return default; }
+ }
+ Thread.Sleep(RetryInterval * 1000);
+ }
+ return default;
+ }
+
+ public override DataSet GetDataSet(string sql)
+ {
+ OperationLog.Instance.WriteLog(string.Format("MsSqlNet.GetDataSet({0})", sql), GetLogLevel());
+ for (int i = 0; i < RetryCount; i++)
+ {
+ if (i > 0) { OperationLog.Instance.WriteLog(string.Format("{1}⇒MsSqlNet.GetDataSet({0})", sql, i), OperationLog.LogLevelType.Normal); }
+ try
+ {
+ ErrClear();
+ using (SqlConnection dbConnect = Open())
+ {
+ using (SqlCommand command = new SqlCommand(sql, dbConnect))
+ {
+ command.CommandTimeout = 6000;
+ DataSet dataset = new DataSet();
+ using (SqlDataAdapter adapter = new SqlDataAdapter())
+ {
+ adapter.SelectCommand = command;
+ adapter.Fill(dataset);
+ }
+ return dataset;
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ if (!IsTransient(ex, sql)) { return null; }
+ }
+ Thread.Sleep(RetryInterval * 1000);
+ }
+ return null;
+ }
+
+ public override DataSet GetDataSetWithTran(string sql)
+ {
+ OperationLog.Instance.WriteLog(string.Format("MsSqlNet.GetDataSetWithTran({0})", sql), GetLogLevel());
+ string sqlCommand = string.Format(@"SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+BEGIN TRY
+ BEGIN TRANSACTION;
+ {0}
+ COMMIT TRANSACTION;
+ SELECT 0 AS ErrorNumber;
+END TRY
+BEGIN CATCH
+ ROLLBACK TRANSACTION;
+ SELECT ERROR_NUMBER() AS ErrorNumber,ERROR_SEVERITY() AS ErrorSeverity,ERROR_STATE() AS ErrorState,ERROR_PROCEDURE() AS ErrorProcedure,ERROR_LINE() AS ErrorLine,ERROR_MESSAGE() AS ErrorMessage;
+END CATCH;", sql);
+
+ DataSet result = null;
+ for (int i = 0; i < 5; i++)
+ {
+ if (i > 0) { OperationLog.Instance.WriteLog(string.Format("{1}⇒MsSqlNet.GetDataSetWithTran({0})", sql, i), OperationLog.LogLevelType.Normal); }
+ result = GetDataSet(sqlCommand);
+ if (result != null && result.Tables.Count > 0 && result.Tables[result.Tables.Count - 1].Rows.Count > 0 && CConvert.ToInt(result.Tables[result.Tables.Count - 1].Rows[0]["ErrorNumber"]) != 0)
+ {
+ DataRow row = result.Tables[result.Tables.Count - 1].Rows[0];
+ string err = string.Format("ErrorNumber:{0}" + Environment.NewLine, row["ErrorNumber"]);
+ err += string.Format("ErrorSeverity:{0}" + Environment.NewLine, row["ErrorSeverity"]);
+ err += string.Format("ErrorState:{0}" + Environment.NewLine, row["ErrorState"]);
+ err += string.Format("ErrorProcedure:{0}" + Environment.NewLine, row["ErrorProcedure"]);
+ err += string.Format("ErrorLine:{0}" + Environment.NewLine, row["ErrorLine"]);
+ err += string.Format("ErrorMessage:{0}" + Environment.NewLine, row["ErrorMessage"]);
+ ErrNo = CConvert.ToInt(row["ErrorNumber"]);
+ ErrInfo = err;
+ OperationLog.Instance.WriteLog(string.Format("MsSqlNet.GetDataSetWithTran({0})={1}", sqlCommand, ErrInfo), GetLogLevel());
+
+ //トランザクション (プロセス ID 61) が、ロック 個のリソースで他のプロセスとデッドロックして、このトランザクションがそのデッドロックの対象となりました。トランザクションを再実行してください。
+ if (CConvert.ToInt(row["ErrorNumber"]) == 1205 || err.Contains("デッドロック"))
+ {
+ Thread.Sleep(100);
+ continue;
+ }
+ }
+ break;
+ }
+ return result;
+
+ }
+
+ public override DataTable GetDataTable(string sql)
+ {
+ OperationLog.Instance.WriteLog(string.Format("MsSqlNet.GetDataTable({0})", sql), GetLogLevel());
+ for (int i = 0; i < RetryCount; i++)
+ {
+ if (i > 0) { OperationLog.Instance.WriteLog(string.Format("{1}⇒MsSqlNet.GetDataTable({0})", sql, i), OperationLog.LogLevelType.Normal); }
+ try
+ {
+ ErrClear();
+ using (SqlConnection dbConnect = Open())
+ {
+ using (SqlCommand command = new SqlCommand(sql, dbConnect))
+ {
+ command.CommandTimeout = 60000;
+ DataTable dataTable = new DataTable();
+ using (SqlDataAdapter adapter = new SqlDataAdapter())
+ {
+ adapter.SelectCommand = command;
+ adapter.Fill(dataTable);
+ }
+ return dataTable;
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ if (!IsTransient(ex, sql)) { return null; }
+ }
+ Thread.Sleep(RetryInterval * 1000);
+ }
+ return null;
+ }
+
+ public override object ExecuteScalar(string sql)
+ {
+ OperationLog.Instance.WriteLog(string.Format("MsSqlNet.ExecuteScalar({0})", sql), GetLogLevel());
+ for (int i = 0; i < RetryCount; i++)
+ {
+ if (i > 0) { OperationLog.Instance.WriteLog(string.Format("{1}⇒MsSqlNet.ExecuteScalar({0})", sql, i), OperationLog.LogLevelType.Normal); }
+ try
+ {
+ ErrClear();
+ using (SqlConnection dbConnect = Open())
+ {
+ using (SqlCommand command = new SqlCommand(sql, dbConnect))
+ {
+ command.CommandTimeout = 60000;
+ return command.ExecuteScalar();
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ if (!IsTransient(ex, sql)) { return null; }
+ }
+ Thread.Sleep(RetryInterval * 1000);
+ }
+ return null;
+ }
+
+ public override int ExecuteGetID(string sql)
+ {
+ OperationLog.Instance.WriteLog(string.Format("MsSqlNet.ExecuteGetID({0})", sql), GetLogLevel());
+
+ for (int i = 0; i < RetryCount; i++)
+ {
+ if (i > 0) { OperationLog.Instance.WriteLog(string.Format("{1}⇒MsSqlNet.ExecuteGetID({0})", sql, i), OperationLog.LogLevelType.Normal); }
+ try
+ {
+ ErrClear();
+ using (SqlConnection dbConnect = Open())
+ {
+ sql = sql + " SELECT CAST(scope_identity() AS int) ";
+ using (SqlCommand command = new SqlCommand(sql, dbConnect))
+ {
+ command.CommandTimeout = 60000;
+ return CConvert.ToInt(command.ExecuteScalar().ToString(), -1); //NULL可能性がある
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ if (!IsTransient(ex, sql)) { return -1; }
+ }
+ Thread.Sleep(RetryInterval * 1000);
+ }
+ return -1;
+ }
+
+ public override int ExecuteNonQuery(string sql)
+ {
+ OperationLog.Instance.WriteLog(string.Format("MsSqlNet.ExecuteNonQuery({0})", sql), GetLogLevel());
+
+ for (int i = 0; i < RetryCount; i++)
+ {
+ if (i > 0) { OperationLog.Instance.WriteLog(string.Format("{1}⇒MsSqlNet.ExecuteNonQuery({0})", sql, i), OperationLog.LogLevelType.Normal); }
+ try
+ {
+ ErrClear();
+ using (SqlConnection dbConnect = Open())
+ {
+ using (SqlCommand command = new SqlCommand(sql, dbConnect))
+ {
+ int row = command.ExecuteNonQuery();
+ return (row == -1 ? 0 : row);
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ if (!IsTransient(ex, sql)) { return -1; }
+ }
+ Thread.Sleep(RetryInterval * 1000);
+ }
+ return -1;
+ }
+
+ public override bool ExecuteNonQueryWithTran(string sql)
+ {
+ try
+ {
+ OperationLog.Instance.WriteLog(string.Format("MsSqlNet.ExecuteNonQueryWithTran({0})", sql), GetLogLevel());
+ using (DataSet result = GetDataSetWithTran(sql))
+ {
+ if (result == null) { return false; }
+ else if (result.Tables.Count > 0 && result.Tables[result.Tables.Count - 1].Rows.Count > 0 && CConvert.ToInt(result.Tables[result.Tables.Count - 1].Rows[0]["ErrorNumber"]) != 0) { return false; }
+ }
+ return true;
+ }
+ catch (Exception ex)
+ {
+ ErrNo = -1;
+ ErrInfo = ex.Message;
+ OperationLog.Instance.WriteLog(string.Format("ExecuteNonQueryWithTran:{0},{1},{2}", ErrNo, ErrInfo, sql));
+ return false;
+ }
+ }
+
+ #region ★★★★★ DB情報取得よく使う関数 ★★★★★
+
+ public virtual bool CanConnect()
+ {
+ try
+ {
+ using (SqlConnection dbConnect = Open())
+ {
+ return dbConnect.State == ConnectionState.Open;
+ }
+ }
+ catch
+ {
+ return false;
+ }
+ }
+
+ public virtual bool ExistsObject(string name)
+ {
+ string sql = string.Format("IF OBJECT_ID('{0}','U') IS NOT NULL SELECT 1 ELSE SELECT 0;", name);
+ return CConvert.ToInt(ExecuteScalar(sql)) == 1;
+ }
+
+ /// <summary>
+ /// DBの一覧を取得
+ /// </summary>
+ /// <returns></returns>
+ public virtual bool ExistsDataBase(string name)
+ {
+ string sql = string.Format("IF EXISTS(SELECT -1 FROM sys.databases WHERE name = '{0}') SELECT 1 ELSE SELECT 0;", name);
+ return CConvert.ToInt(ExecuteScalar(sql)) == 1;
+ }
+
+ public virtual bool ExistsProctrue(string name)
+ {
+ string sql = string.Format("IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[{0}]') AND type in (N'P', N'PC')) SELECT 1 ELSE SELECT 0;", name);
+ return CConvert.ToInt(ExecuteScalar(sql)) == 1;
+
+ }
+
+ /// <summary>
+ /// Identity項目があるかどうか
+ /// </summary>
+ /// <param name="tableName"></param>
+ /// <returns></returns>
+ public virtual bool IsExistsIdentity(string tableName)
+ {
+ string sql = string.Format(@"IF EXISTS(Select Top 1 1 FROM sysobjects WHERE objectproperty(id, 'TableHasIdentity') = 1 AND upper(name) = upper('{0}'))
+ SELECT 1 ELSE SELECT 0", tableName);
+ bool hasIdentity = CConvert.ToInt(ExecuteScalar(sql)) == 1;
+ return hasIdentity;
+ }
+
+ /// <summary>
+ /// DBの生成
+ /// </summary>
+ /// <returns></returns>
+ public virtual bool CreateSimpleDB(string tagDBName)
+ {
+ string sql = string.Format(@"IF EXISTS (SELECT name FROM sys.databases WHERE name = N'{0}') RETURN;
+CREATE DATABASE {0};
+ALTER DATABASE [{0}] SET RECOVERY SIMPLE;
+ALTER DATABASE [{0}] SET AUTO_SHRINK ON;", tagDBName);
+ return ExecuteNonQuery(sql) != -1;
+ }
+
+ public virtual bool CreateSimpleDB(string tagDBName, string logicName, string filePath)
+ {
+ if (!filePath[filePath.Length - 1].Equals(Path.DirectorySeparatorChar)) { filePath += Path.DirectorySeparatorChar.ToString(); }
+ string sql = string.Format(@"IF EXISTS (SELECT name FROM sys.databases WHERE name = N'{0}') RETURN;
+CREATE DATABASE [{0}] ON PRIMARY
+( NAME = N'{1}', FILENAME = N'{2}{0}.mdf')
+ LOG ON
+( NAME = N'{1}_log', FILENAME = N'{2}{0}.ldf');
+ALTER DATABASE [{0}] SET RECOVERY SIMPLE;
+ALTER DATABASE [{0}] SET AUTO_SHRINK ON;", tagDBName, logicName, filePath);
+ return ExecuteNonQuery(sql) != -1;
+ }
+
+ /// <summary>
+ /// DB所在フォルダー
+ /// </summary>
+ /// <returns></returns>
+ public string GetDBFileDir()
+ {
+ string file = CConvert.ToString(ExecuteScalar(string.Format("SELECT physical_name FROM sys.database_files WHERE name = '{0}'", Catalog)));
+ return Path.GetDirectoryName(file);
+ }
+
+ /// <summary>
+ /// メモリーテーブルを使用する
+ /// </summary>
+ /// <returns></returns>
+ public virtual bool SetMemoryTableEnabled()
+ {
+ string sql = string.Format(@"ALTER DATABASE {0} ADD FILEGROUP [FG_MemoryTable] CONTAINS MEMORY_OPTIMIZED_DATA", Catalog);
+ if (ExecuteNonQuery(sql) == -1) { return false; }
+
+ string dir = GetDBFileDir();
+ if (!dir[dir.Length - 1].Equals(Path.DirectorySeparatorChar)) { dir += Path.DirectorySeparatorChar.ToString(); }
+
+ sql = string.Format(@"ALTER DATABASE {0}
+ADD FILE
+(
+ NAME = '{0}_MemoryTable',
+ FILENAME ='{1}{0}'
+)
+TO FILEGROUP [FG_MemoryTable];", Catalog, dir);
+ return ExecuteNonQuery(sql) != -1;
+ }
+
+ /// <summary>
+ /// DBの一覧を取得
+ /// </summary>
+ /// <returns></returns>
+ public virtual DataSet GetDataBaseList()
+ {
+ string sql = "SELECT name FROM sys.databases WHERE name NOT IN('master','tempdb','model','msdb','ReportServer','ReportServerTempDB')";
+ return GetDataSet(sql);
+ }
+
+ /// <summary>
+ /// DBの削除
+ /// </summary>
+ /// <returns></returns>
+ public virtual bool DropProcedure(string name)
+ {
+ string sql = string.Format(@"IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[{0}]') AND type in (N'P', N'PC')) DROP PROCEDURE [dbo].[{0}];", name);
+ return ExecuteNonQuery(sql) != -1;
+ }
+
+ /// <summary>
+ ///
+ /// </summary>
+ /// <param name="name"></param>
+ /// <returns></returns>
+ public virtual bool DropFunction(string name)
+ {
+ string sql = string.Format(@"IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[{0}]') AND type in (N'FN', N'IF', N'TF', N'FS', N'FT')) DROP FUNCTION [dbo].[{0}];", name);
+ return ExecuteNonQuery(sql) != -1;
+ }
+
+ /// <summary>
+ /// DBの削除
+ /// </summary>
+ /// <returns></returns>
+ public virtual bool DropDB(string tagDBName)
+ {
+ string sql = string.Format("DROP DATABASE {0};", tagDBName);
+ return ExecuteNonQuery(sql) != -1;
+ }
+
+ public virtual bool GetDDL(string path, string itemName)
+ {
+ System.Data.DataTable ddl = GetDataTable(string.Format("SELECT definition FROM sys.sql_modules WHERE execute_as_principal_id is null and object_id =(OBJECT_ID(N'{0}'))", itemName));
+ if (ddl != null && ddl.Rows.Count > 0)
+ {
+ FileOperation.Delete(path + Path.DirectorySeparatorChar + itemName + ".sql");
+ System.IO.File.WriteAllText(path + Path.DirectorySeparatorChar + itemName + ".sql", ddl.Rows[0]["definition"].ToString(), System.Text.Encoding.Default);
+ ddl.Dispose();
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ public virtual bool GetDDLByArray(string path, string[] ogjList)
+ {
+ List<string> list = new List<string>(ogjList);
+ return GetDDLByList(path, list, null);
+ }
+
+ public virtual bool GetDDLByArray(string path, string[] ogjList, Action<string, int> callBack)
+ {
+ List<string> list = new List<string>(ogjList);
+ return GetDDLByList(path, list, callBack);
+ }
+
+ public virtual bool GetDDLByList(string path, List<string> ogjList, Action<string, int> callBack)
+ {
+ foreach (string item in ogjList)
+ {
+ GetDDL(path, item);
+ if (callBack != null) { callBack(item, 0); }
+ }
+ return true;
+ }
+
+ public virtual bool GetAllDDL(string path)
+ {
+ return GetAllDDL(path, null);
+ }
+
+ public virtual bool GetAllDDL(string path, Action<string, int> callBack)
+ {
+ System.Data.DataTable table = null;
+
+ //関数
+ table = GetDataTable("SELECT * FROM sys.objects WHERE type in (N'FN', N'IF', N'TF', N'FS', N'FT') and is_ms_shipped = 0");
+ int maxCount = table.Rows.Count;
+ int curCount = 0;
+ foreach (DataRow row in table.Rows)
+ {
+ curCount++;
+ System.Diagnostics.Debug.WriteLine(string.Format("{0}/{1} : {2}", curCount, maxCount, row["name"]));
+
+ if (CConvert.IsSmallAlpha(row["name"].ToString().Substring(0, 1))) { continue; }
+ GetDDL(path, row["name"].ToString());
+ if (callBack != null) { callBack(row["name"].ToString(), 6); }
+ }
+ table.Dispose();
+
+ //プロシージャ
+ table = GetDataTable("SELECT * FROM sys.objects WHERE type in (N'P', N'PC') and is_ms_shipped = 0");
+ maxCount = table.Rows.Count;
+ curCount = 0;
+ foreach (DataRow row in table.Rows)
+ {
+ curCount++;
+ System.Diagnostics.Debug.WriteLine(string.Format("{0}/{1} : {2}", curCount, maxCount, row["name"]));
+
+ if (CConvert.IsSmallAlpha(row["name"].ToString().Substring(0, 1))) { continue; }
+ GetDDL(path, row["name"].ToString());
+ if (callBack != null) { callBack(row["name"].ToString(), 5); }
+ }
+ table.Dispose();
+
+ return true;
+ }
+
+ /// <summary>
+ /// テーブル一覧を取得
+ /// </summary>
+ /// <returns></returns>
+ public override DataTable GetTableList()
+ {
+ return GetDataTable(@"Select Name FROM sys.sysobjects Where XType='U' AND NOT name IN('sysdiagrams','dtproperties') ORDER BY Name");
+ }
+
+ /// <summary>
+ /// テーブル一覧を取得
+ /// </summary>
+ /// <returns></returns>
+ public override DataTable GetTableList(string whereAdding)
+ {
+ return GetDataTable($"Select Name FROM SysObjects Where XType='U' AND NOT name IN('sysdiagrams','dtproperties') AND {whereAdding} ORDER BY Name");
+ }
+
+ /// <summary>
+ /// テーブル名より項目一覧を取得
+ /// </summary>
+ /// <param name="table"></param>
+ /// <returns></returns>
+ public virtual DataTable GetFieldList(string table)
+ {
+ string sql = @$"SELECT CASE WHEN C.xtype = 'PK' THEN 1 ELSE 0 END PKFlg ,A.name Field,D.name Type,A.is_nullable,A.max_length,
+ CASE WHEN D.name = 'int' THEN 7
+ WHEN D.name = 'tinyint' THEN 2
+ WHEN D.name = 'bit' THEN 1
+ WHEN D.name = 'nvarchar' THEN A.max_length / 2
+ WHEN D.name IN ('date','datetime') THEN 10
+ ELSE A.max_length END MaxLen,
+ CASE WHEN B.value IS NULL THEN A.name ELSE CAST(B.value AS NVARCHAR) END Caption
+FROM sys.columns A
+ Left outer join (SELECT syscolumns.name,sysobjects.xtype
+ FROM syscolumns,sysobjects,sysindexes,sysindexkeys
+ WHERE syscolumns.id = object_id('{table}')
+ AND sysobjects.xtype = 'PK'
+ AND sysobjects.parent_obj = syscolumns.id
+ AND sysindexes.id = syscolumns.id
+ AND sysobjects.name = sysindexes.name
+ AND sysindexkeys.id = syscolumns.id
+ AND sysindexkeys.indid = sysindexes.indid
+ AND syscolumns.colid = sysindexkeys.colid) C
+ On C.name = A.name
+ LEFT JOIN sys.extended_properties B ON A.object_id = B.major_id AND A.column_id = B.minor_id AND B.name='MS_Description'
+ LEFT JOIN sys.types D ON A.user_type_id = D.user_type_id
+WHERE A.object_id = object_id('{table}')
+";
+ return GetDataTable(sql);
+ }
+
+ /// <summary>
+ ///
+ /// </summary>
+ /// <param name="tableName"></param>
+ /// <param name="identityOn"></param>
+ /// <returns></returns>
+ public virtual string GetTableScript(string tableName, int identityOn)
+ {
+ try
+ {
+ string sql = @"IF EXISTS(SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[SP_GetCreateTableScript]') AND type in (N'P', N'PC')) SELECT 1 ELSE SELECT 0;";
+ if (CConvert.ToInt(ExecuteScalar(sql)) == 0)
+ {
+ sql = ResourceFile.GetScript(ResourceFile.ResType.SP_GetCreateTableScript);
+ ExecuteNonQuery(sql);
+ }
+
+ StringBuilder script = new StringBuilder();
+ using (DataTable table = GetDataTable(string.Format(@"EXECUTE SP_GetCreateTableScript '{0}',{1}", tableName, identityOn)))
+ {
+ foreach (DataRow row in table.Rows)
+ {
+ script.AppendLine(row["v_desc"].ToString());
+ }
+ }
+ return script.ToString();
+ }
+ catch
+ {
+ return string.Empty;
+ }
+ }
+
+ #endregion
+
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+
+ /// <summary> SQLのメッセージ通知 例:RAISERROR('10,SHORI,1122',0,1) WITH NOWAIT
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ private void DBConnect_InfoMessage(object sender, SqlInfoMessageEventArgs e)
+ {
+ if (SqlInfoMessageEvent != null) { SqlInfoMessageEvent(sender, e); }
+ System.Diagnostics.Debug.WriteLine(e.Message);
+ }
+
+ private void ErrClear()
+ {
+ ErrNo = 0;
+ ErrInfo = string.Empty;
+ }
+
+ public SqlConnection Open()
+ {
+ SqlConnection dbConnect = new SqlConnection();
+ dbConnect.ConnectionString = ConnectionString;
+ if (MessageEventEnabled)
+ {
+ dbConnect.FireInfoMessageEventOnUserErrors = FireInfoMessageEventOnUserErrors; //SqlExceptionの場合、出力しない
+ dbConnect.InfoMessage += new SqlInfoMessageEventHandler(DBConnect_InfoMessage);
+ }
+ dbConnect.Open();
+ return dbConnect;
+ }
+
+ /// <summary>
+ /// 一時的なエラー
+ /// </summary>
+ /// <param name="ex"></param>
+ /// <returns></returns>
+ private bool IsTransient(Exception ex, string sql)
+ {
+ SqlException exSql = null;
+ if (ex is SqlException)
+ {
+ exSql = ex as SqlException;
+ Message_id = exSql.Number;
+ ErrNo = exSql.ErrorCode;
+ }
+ else
+ {
+ ErrNo = -1;
+ }
+ ErrInfo = ex.Message;
+ OperationLog.Instance.WriteLog(string.Format("MsSqlNet.IsTransient({0},{1},{2},{3})", Message_id, ErrNo, ErrInfo, sql), OperationLog.LogLevelType.Normal);
+
+ if (exSql != null)
+ {
+ // Enumerate through all errors found in the exception.
+ foreach (SqlError err in exSql.Errors)
+ {
+ switch (err.Number)
+ {
+ // SQL Error Code: 40501
+ // The service is currently busy. Retry the request after 10 seconds.
+ // Code: (reason code to be decoded).
+ case 40501:
+ case 10928:
+ case 10929:
+ case 10053:
+ case 10054: //サーバーに要求を送信しているときに、トランスポート レベルのエラーが発生しました。 (provider: TCP プロバイダ, error: 0 - 既存の接続はリモート ホストに強制的に切断されました。)
+ case 10060:
+ case 40197:
+ case 40540:
+ case 40613:
+ case 40143:
+ case 233:
+ case 64:
+ case 1205: //トランザクション (プロセス ID %1!) が、%2! 個のリソースで他のプロセスとデッドロックして、このトランザクションがそのデッドロックの対象となりました。トランザクションを再実行してください。
+ case 3635: //データベース ID %2!、ファイル ID %3! の '%1!' メタデータの処理中にエラーが発生しました。トランザクション='%4!'。詳細コンテキスト='%5!'。場所='%6!'(%7!)。操作を再試行してください。問題が解決しない場合は、データベース管理者に問い合わせて、ロックとメモリ構成を調査してください。アプリケーションで競合のデッドロックが生じている可能性を調査してください。
+ case 5231: //オブジェクト ID %1! (オブジェクト '%2!'): このオブジェクトを確認のためにロックしようとして、デッドロックが発生しました。このオブジェクトはスキップされたので、処理されません。
+ case 40095: //レプリケーション トランザクション (プロセス ID %1!) が、%2! 個のリソースで他のプロセスとデッドロックして、このトランザクションがそのデッドロックの対象となりました。操作が再試行されます。
+ return true;
+ }
+ }
+ }
+ else if (ex is TimeoutException)
+ {
+ return true;
+ }
+ else if (ErrInfo.Contains("現在の接続の状態は '終了"))
+ {
+ return true;
+ }
+ return false;
+ }
+
+ private OperationLog.LogLevelType GetLogLevel()
+ {
+ return IsTimerAccess ? OperationLog.LogLevelType.Level8 : OperationLog.LogLevelType.Level7;
+ }
+
+ #endregion
+
+}
diff --git a/HotelPms.Share/Data/PostgreSqlNet.cs b/HotelPms.Share/Data/PostgreSqlNet.cs
new file mode 100644
index 0000000..16374d5
--- /dev/null
+++ b/HotelPms.Share/Data/PostgreSqlNet.cs
@@ -0,0 +1,381 @@
+using HotelPms.Share.IO;
+using Npgsql;
+using System.Data;
+using System.Data.Common;
+
+namespace HotelPms.Share.Data;
+
+public class PostgreSqlNet : DataAccess
+{
+ #region ★★★★★ Declartions ★★★★★
+
+ public string ConnectionString { get; set; } = string.Empty;
+
+ /// <summary>ユーザー</summary>
+ public override string UseID { get; set; } = string.Empty;
+
+ /// <summary>パスワード</summary>
+ public override string PassWord { get; set; } = string.Empty;
+
+ /// <summary>データベース所在のパソコン名</summary>
+ public override string DataSource { get; set; } = string.Empty;
+
+ /// <summary>データベース名</summary>
+ public override string Catalog { get; set; } = string.Empty;
+
+ public override string Schema { get; set; } = "public";
+
+ public override int Port { get; set; } = 5432;
+
+ /// <summary>
+ /// デッドロック関連: 1205,3635,5231,5252,17888,22840,23424
+ /// </summary>
+ public int Message_id { get; set; } = 0;
+
+ public string SqlState { get; set; } = string.Empty;
+
+ /// <summary>エラー情報</summary>
+ public override string ErrInfo { get; set; } = string.Empty;
+
+ /// <summary>エラーコード</summary>
+ public override int ErrNo { get; set; } = 0;
+
+ public bool PoolEnabled { get; set; } = false;
+
+ public int MaxPoolSize { get; set; } = 1000;
+
+ public int RetryCount { get; set; } = 12;
+
+ public int RetryInterval { get; set; } = 5;
+
+ /// <summary>
+ /// タイマー単位のSQL
+ /// </summary>
+ public bool IsTimerAccess { get; set; } = false;
+
+ public bool FireInfoMessageEventOnUserErrors { get; set; } = false;
+
+ public bool MessageEventEnabled { get; set; } = false;
+
+ #endregion
+
+
+ public PostgreSqlNet(string connectionString)
+ {
+ ConnectionString = connectionString;
+ NpgsqlConnectionStringBuilder ssb = new NpgsqlConnectionStringBuilder(connectionString);
+ DataSource = ssb.Host;
+ Port = ssb.Port;
+ UseID = ssb.Username;
+ PassWord = ssb.Password;
+ Catalog = ssb.Database;
+ MaxPoolSize = ssb.MaxPoolSize;
+ }
+
+ public PostgreSqlNet(DBConnectItem connecitem) : this(connecitem.HostName, connecitem.UserID, connecitem.Password, connecitem.Port, connecitem.DBName)
+ { }
+
+ public PostgreSqlNet(string dataSource, string userID, string passWord) : this(dataSource, userID, passWord, 5432, "postgres")
+ {
+ }
+
+ public PostgreSqlNet(string dataSource, string userID, string passWord, int port) : this(dataSource, userID, passWord, port, "postgres")
+ { }
+
+ public PostgreSqlNet(string dataSource, string userID, string passWord, int port, string catalog)
+ {
+ DataSource = dataSource;
+ Port = port;
+ UseID = userID;
+ PassWord = passWord;
+ Catalog = catalog;
+ ResetConnectionString();
+ }
+
+ public override void Dispose()
+ {
+
+ }
+
+ public void ResetConnectionString()
+ {
+ NpgsqlConnectionStringBuilder ssb = new NpgsqlConnectionStringBuilder();
+ ssb.Host = DataSource;
+ ssb.Port = Port;
+ ssb.Username = UseID;
+ ssb.Password = PassWord;
+ ssb.Database = Catalog;
+ ssb.Enlist = true;
+ //ssb.MaxPoolSize = MaxPoolSize;
+ ssb.ApplicationName = System.IO.Path.GetFileNameWithoutExtension(System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName);
+ ssb.Encoding = "UTF8";
+ //ssb.ApplicationName = System.IO.Path.GetFileNameWithoutExtension(Application.ExecutablePath);
+ ConnectionString = ssb.ToString();
+ }
+
+ public static bool CreateDataBase(DBConnectItem item)
+ {
+ using (PostgreSqlNet dbAccess = new PostgreSqlNet(item.HostName, item.UserID, item.Password, item.Port))
+ {
+ if (dbAccess.ErrNo != 0) { return false; }
+ return (dbAccess.ExecuteNonQuery($"CREATE DATABASE \"{item.DBName}\" ENCODING 'UTF8'") != -1);
+ }
+ }
+
+ /// 可変戻り値
+ /// </summary>
+ /// <typeparam name="T"></typeparam>
+ /// <param name="sql"></param>
+ /// <param name="fillReaderHandler"></param>
+ /// <returns></returns>
+ public override T GetDataReader<T>(string sql, Action<DbDataReader, T> Fetch)
+ {
+ OperationLog.Instance.WriteLog(string.Format("MsSqlNet.GetDataReader({0})", sql), GetLogLevel());
+ for (int i = 0; i < RetryCount; i++)
+ {
+ if (i > 0) { OperationLog.Instance.WriteLog(string.Format("{1}⇒MsSqlNet.GetDataReader({0})", sql, i), OperationLog.LogLevelType.Normal); }
+ try
+ {
+ ErrClear();
+ T t = new T();
+ using (NpgsqlConnection dbConnect = Open())
+ {
+ using (NpgsqlCommand command = new NpgsqlCommand(sql, dbConnect))
+ {
+ command.CommandTimeout = 6000;
+ using (NpgsqlDataReader reader = command.ExecuteReader(CommandBehavior.Default))
+ {
+
+ Fetch(reader, t);
+ } //自動クロス
+ }
+ }
+ return t;
+ }
+ catch (Exception ex)
+ {
+ if (!IsTransient(ex, sql)) { return default; }
+ }
+ Thread.Sleep(RetryInterval * 1000);
+ }
+ return default;
+ }
+
+ public override DataSet GetDataSet(string sql)
+ {
+ throw new NotImplementedException();
+ }
+
+ public override DataSet GetDataSetWithTran(string sql)
+ {
+ throw new NotImplementedException();
+ }
+
+ public override DataTable GetDataTable(string sql)
+ {
+ OperationLog.Instance.WriteLog(string.Format("GetDataTable({0})", sql), GetLogLevel());
+ for (int i = 0; i < RetryCount; i++)
+ {
+ if (i > 0) { OperationLog.Instance.WriteLog(string.Format("{1}⇒GetDataTable({0})", sql, i), OperationLog.LogLevelType.Normal); }
+ try
+ {
+ ErrClear();
+ using (NpgsqlConnection dbConnect = Open())
+ {
+ using (NpgsqlCommand command = new NpgsqlCommand(sql, dbConnect))
+ {
+ command.CommandTimeout = 60000;
+ DataTable dataTable = new DataTable();
+ using (NpgsqlDataAdapter adapter = new NpgsqlDataAdapter())
+ {
+ adapter.SelectCommand = command;
+ adapter.Fill(dataTable);
+ }
+ return dataTable;
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ if (!IsTransient(ex, sql)) { return null; }
+ }
+ Thread.Sleep(RetryInterval * 1000);
+ }
+ return null;
+ }
+
+ public override object ExecuteScalar(string sql)
+ {
+ OperationLog.Instance.WriteLog($"ExecuteScalar({sql})", GetLogLevel());
+
+ for (int i = 0; i < RetryCount; i++)
+ {
+ if (i > 0) { OperationLog.Instance.WriteLog($"{i}⇒ExecuteScalar({sql})", OperationLog.LogLevelType.Normal); }
+ try
+ {
+ ErrClear();
+ using (NpgsqlConnection dbConnect = Open())
+ {
+ using (NpgsqlCommand command = new NpgsqlCommand(sql, dbConnect))
+ {
+ return command.ExecuteReader();
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ if (!IsTransient(ex, sql)) { return null; }
+ }
+ Thread.Sleep(RetryInterval * 1000);
+ }
+ return null;
+ }
+
+ public override int ExecuteGetID(string sql)
+ {
+ throw new NotImplementedException();
+ }
+
+ public override int ExecuteNonQuery(string sql)
+ {
+ OperationLog.Instance.WriteLog($"ExecuteNonQuery({sql})", GetLogLevel());
+
+ for (int i = 0; i < RetryCount; i++)
+ {
+ if (i > 0) { OperationLog.Instance.WriteLog($"{i}⇒ExecuteNonQuery({sql})", OperationLog.LogLevelType.Normal); }
+ try
+ {
+ ErrClear();
+ using (NpgsqlConnection dbConnect = Open())
+ {
+ using (NpgsqlCommand command = new NpgsqlCommand(sql, dbConnect))
+ {
+ int row = command.ExecuteNonQuery();
+ return (row == -1 ? 0 : row);
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ if (!IsTransient(ex, sql)) { return -1; }
+ }
+ Thread.Sleep(RetryInterval * 1000);
+ }
+ return -1;
+ }
+
+ public override bool ExecuteNonQueryWithTran(string sql)
+ {
+ OperationLog.Instance.WriteLog($"ExecuteNonQuery({sql})", GetLogLevel());
+
+ for (int i = 0; i < RetryCount; i++)
+ {
+ if (i > 0) { OperationLog.Instance.WriteLog($"{i}⇒ExecuteNonQuery({sql})", OperationLog.LogLevelType.Normal); }
+ NpgsqlTransaction tran = null;
+ try
+ {
+ ErrClear();
+ using (NpgsqlConnection dbConnect = Open())
+ {
+ tran = dbConnect.BeginTransaction();
+ using (NpgsqlCommand command = new NpgsqlCommand(sql, dbConnect))
+ {
+ int row = command.ExecuteNonQuery();
+ if (row == -1)
+ {
+ tran.Rollback();
+ return false;
+ }
+ else
+ {
+ tran.Commit();
+ return true;
+ }
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ tran?.Rollback();
+ if (!IsTransient(ex, sql)) { return false; }
+ }
+ Thread.Sleep(RetryInterval * 1000);
+ }
+ return false;
+ }
+
+ public NpgsqlConnection Open()
+ {
+ NpgsqlConnection dbConnect = new NpgsqlConnection();
+ dbConnect.ConnectionString = ConnectionString;
+ dbConnect.Open();
+ return dbConnect;
+ }
+
+ /// <summary>
+ /// 一時的なエラー
+ /// </summary>
+ /// <param name="ex"></param>
+ /// <returns></returns>
+ private bool IsTransient(Exception ex, string sql)
+ {
+ NpgsqlException exSql = null;
+ if (ex is NpgsqlException)
+ {
+ exSql = ex as NpgsqlException;
+ Message_id = exSql.HResult;
+ ErrNo = exSql.ErrorCode;
+ SqlState = exSql.SqlState;
+ }
+ else
+ {
+ ErrNo = -1;
+ }
+ ErrInfo = ex.Message;
+ OperationLog.Instance.WriteLog(string.Format("IsTransient({0},{1},{2},{3})", Message_id, ErrNo, ErrInfo, sql), OperationLog.LogLevelType.Normal);
+
+ if (exSql != null)
+ {
+ //Specifies whether the exception is considered transient, that is, whether retrying the operation could succeed (e.g. a network error or a timeout).
+ if (exSql.IsTransient) { return true; }
+ if (exSql.SqlState == "40P01") { return true; } //デッドロックの検出
+ }
+ else if (ex is TimeoutException)
+ {
+ return true;
+ }
+ return false;
+ }
+
+ private void ErrClear()
+ {
+ ErrNo = 0;
+ ErrInfo = string.Empty;
+ SqlState = string.Empty;
+ Message_id = 0;
+ }
+
+ private OperationLog.LogLevelType GetLogLevel()
+ {
+ return IsTimerAccess ? OperationLog.LogLevelType.Level8 : OperationLog.LogLevelType.Level7;
+ }
+
+ /// <summary>
+ /// テーブル一覧を取得
+ /// ※一般的にschema = publicですが
+ /// </summary>
+ /// <returns></returns>
+ public override DataTable GetTableList()
+ {
+ return GetDataTable($"SELECT \"table_name\" AS \"Name\" FROM \"information_schema\".\"tables\" WHERE \"table_schema\"='{Schema}';");
+ }
+
+ /// <summary>
+ /// テーブル一覧を取得
+ /// </summary>
+ /// <returns></returns>
+ public override DataTable GetTableList(string whereAdding)
+ {
+ return GetDataTable($"SELECT \"table_name\" AS \"Name\" FROM \"information_schema\".\"tables\" WHERE \"table_schema\"='{Schema}' AND {whereAdding};");
+ }
+}
diff --git a/HotelPms.Share/Data/RecordBase.cs b/HotelPms.Share/Data/RecordBase.cs
new file mode 100644
index 0000000..99bd1de
--- /dev/null
+++ b/HotelPms.Share/Data/RecordBase.cs
@@ -0,0 +1,79 @@
+using HotelPms.Share.Util;
+using System.Data;
+using System.Reflection;
+
+namespace HotelPms.Share.Data;
+
+public abstract class RecordBase : IRecord
+{
+ /// <summary>
+ /// �e�f�[�^
+ /// </summary>
+ public object Parent { get; set; } = null;
+
+ /// <summary>
+ /// �ڕW�N���X�ɃR�s�[����
+ /// </summary>
+ /// <param name="dest"></param>
+ public abstract void CopyTo(object dest);
+
+ /// <summary>
+ /// �f�[�^���N���A����
+ /// </summary>
+ public abstract void Clear();
+
+ public abstract object? GetField(string name);
+
+ public virtual bool SetField(string name, object value)
+ {
+ return false;
+ }
+
+ /// <summary>
+ /// DataRow�̏��Ŏ��g���X�V����(�ėp������A������ƒx��)
+ /// </summary>
+ /// <param name="row"></param>
+ /// <returns></returns>
+ public abstract bool ConvertDataRow(DataRow row);
+
+ /// <summary> �i�e�X�g�p�j���f�[�^�Ɣ�r���ĕς�����Ƃ���́u�V�����y�I�z�v�Ƃ���
+ /// </summary>
+ /// <param name="orgItem"></param>
+ /// <returns></returns>
+ public string CompareOrgItem(RecordBase orgItem)
+ {
+ string outInfo = string.Empty;
+ try
+ {
+ if (orgItem == null) return this.ToString();
+
+ Dictionary<string, object[]> dic = new Dictionary<string, object[]>();
+ PropertyInfo[] myInfo = orgItem.GetType().GetProperties();
+ foreach (PropertyInfo item in myInfo)
+ {
+ dic.Add(item.Name, new object[] { string.Format("{0}", CConvert.GetPropertyValue(orgItem, item.Name)), null });
+ }
+
+ myInfo = this.GetType().GetProperties();
+ foreach (PropertyInfo item in myInfo)
+ {
+ dic[item.Name][1] = string.Format("{0}", CConvert.GetPropertyValue(this, item.Name));
+
+ if (dic[item.Name][1].Equals(dic[item.Name][0]))
+ {
+ outInfo += string.Format("{0} = {1}" + Environment.NewLine, item.Name, dic[item.Name][1]);
+ }
+ else
+ {
+ outInfo += string.Format("{0} = {1} �� {2}�y�I�z" + Environment.NewLine, item.Name, dic[item.Name][1], dic[item.Name][0]);
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ outInfo = ex.Message;
+ }
+
+ return outInfo;
+ }
+}
diff --git a/HotelPms.Share/Data/Script/DataBaseCreator.cs b/HotelPms.Share/Data/Script/DataBaseCreator.cs
new file mode 100644
index 0000000..3d0532b
--- /dev/null
+++ b/HotelPms.Share/Data/Script/DataBaseCreator.cs
@@ -0,0 +1,76 @@
+using System.Text;
+
+namespace HotelPms.Share.Data.Script;
+
+public class DataBaseCreator
+{
+ /// <summary>
+ /// パーティション作成用SQL
+ /// 数字型(10件) + 日付型(10件)
+ /// </summary>
+ /// <param name="dbPath"></param>
+ /// <param name="dbName"></param>
+ /// <param name="beginDate"></param>
+ /// <returns></returns>
+ public static string CreatePartitionScript(string dbPath, string dbName, DateTime beginDate)
+ {
+ if(!dbPath.EndsWith(Path.DirectorySeparatorChar)){ dbPath += Path.DirectorySeparatorChar; }
+ StringBuilder sql = new StringBuilder();
+
+ //数字型
+ for (int i = 0; i < 10; i++)
+ {
+ sql.AppendLine($"ALTER DATABASE {dbName} ADD FILEGROUP {dbName}_IntFileGroup{(i + 1).ToString().PadLeft(2, '0')}");
+ }
+
+ for (int i = 0; i < 10; i++)
+ {
+ string no = (i + 1).ToString().PadLeft(2, '0');
+ sql.AppendLine($@"ALTER DATABASE {dbName} ADD FILE (NAME=N'{dbName}_IntFileGroup{no}',FILENAME=N'{dbPath}{dbName}_IntFileGroup{no}.ndf',size=10Mb,filegrowth=5mb) TO FILEGROUP {dbName}_IntFileGroup{no}");
+ }
+
+ sql.Append("CREATE PARTITION FUNCTION [IntPartitionFun](int) AS RANGE RIGHT FOR VALUES (1000000");
+ for (int i = 2; i <= 9; i++)
+ {
+ sql.Append($", {i}000000");
+ }
+ sql.AppendLine(")");
+
+ sql.Append($"CREATE PARTITION SCHEME [IntPartitionSchema] AS PARTITION [IntPartitionFun] TO ([{dbName}_IntFileGroup01]");
+ for (int i = 2; i <= 10; i++)
+ {
+ sql.Append($", [{dbName}_IntFileGroup{i.ToString().PadLeft(2, '0')}]");
+ }
+ sql.AppendLine(")");
+ sql.AppendLine("");
+
+ //日付型
+ for (int i = 0; i < 10; i++)
+ {
+ sql.AppendLine($"ALTER DATABASE {dbName} ADD FILEGROUP {dbName}_DateFileGroup{(i + 1).ToString().PadLeft(2, '0')}");
+ }
+
+ for (int i = 0; i < 10; i++)
+ {
+ string no = (i + 1).ToString().PadLeft(2, '0');
+ sql.AppendLine($@"ALTER DATABASE {dbName} ADD FILE (NAME=N'{dbName}_DateFileGroup{no}',FILENAME=N'{dbPath}{dbName}_DateFileGroup{no}.ndf',size=10Mb,filegrowth=5mb) TO FILEGROUP {dbName}_DateFileGroup{no}");
+ }
+
+ int curYear = beginDate.Year;
+ sql.Append($"CREATE PARTITION FUNCTION [DatePartitionFun](Date) AS RANGE RIGHT FOR VALUES ('{curYear}/01/01'");
+ for (int i = 1; i <= 8; i++)
+ {
+ sql.Append($", '{curYear + i}/01/01'");
+ }
+ sql.AppendLine(")");
+
+ sql.Append($"CREATE PARTITION SCHEME [DatePartitionSchema] AS PARTITION [DatePartitionFun] TO ([{dbName}_DateFileGroup01]");
+ for (int i = 2; i <= 10; i++)
+ {
+ sql.Append($", [{dbName}_DateFileGroup{i.ToString().PadLeft(2, '0')}]");
+ }
+ sql.AppendLine(")");
+
+ return sql.ToString();
+ }
+}
diff --git a/HotelPms.Share/Data/Script/Field.cs b/HotelPms.Share/Data/Script/Field.cs
new file mode 100644
index 0000000..d40878a
--- /dev/null
+++ b/HotelPms.Share/Data/Script/Field.cs
@@ -0,0 +1,61 @@
+using HotelPms.Share.Util;
+using System.Data.Common;
+
+namespace HotelPms.Share.Data.Script;
+
+public class Field
+{
+ /// <summary>
+ /// 項目名(列名)
+ /// </summary>
+ public string Name { get; set; } = string.Empty;
+
+ /// <summary>
+ /// 説明
+ /// </summary>
+ public string Description { get; set; } = string.Empty;
+
+ /// <summary>
+ /// 型
+ /// 例:NVARCHAR(50)
+ /// </summary>
+ public string DataType { get; set; } = string.Empty;
+
+ /// <summary>
+ /// プライマリーキーかどうか
+ /// </summary>
+ public bool IsPrimaryKey { get; set; } = false;
+
+ /// <summary>
+ /// 自動増加型かどうか
+ /// </summary>
+ public bool IsIdentity { get; set; } = false;
+
+ /// <summary>
+ /// 変更チェック
+ /// ※プライマリーキー変更は手動でしましょう
+ /// </summary>
+ /// <param name="item"></param>
+ /// <returns>0.なし 1.Description 2.DataType 12.両方変更あり</returns>
+ public int CompareTo(Field item)
+ {
+
+ bool type1 = (item.Description.CompareTo(Description) != 0);
+ bool type2 = (item.DataType.Replace("[", string.Empty).Replace("]", string.Empty).ToUpper().CompareTo(DataType.Replace("[", string.Empty).Replace("]", string.Empty).ToUpper()) != 0);
+
+ if (type1 && !type2) { return 1; }
+ else if (!type1 && type2) { return 2; }
+ else if (type1 && type2) { return 12; }
+ else { return 0; }
+ }
+
+ public Field() { }
+
+ public Field(DbDataReader reader)
+ {
+ Name = CConvert.ToString(reader["Name"]);
+ Description = CConvert.ToString(reader["Description"]);
+ DataType = CConvert.ToString(reader["DataType"]);
+ IsPrimaryKey = CConvert.ToInt(reader["IsPrimaryKey"]) == 1;
+ }
+}
diff --git a/HotelPms.Share/Data/Script/MsSql/GetTableDefine.sql b/HotelPms.Share/Data/Script/MsSql/GetTableDefine.sql
new file mode 100644
index 0000000..e376142
--- /dev/null
+++ b/HotelPms.Share/Data/Script/MsSql/GetTableDefine.sql
@@ -0,0 +1,53 @@
+-- ***********************************************************************
+-- PROCEDURE NAME : GetTableDefine
+-- PARAMETER : @tableName
+-- Description : �e�[�u����`���
+-- ***********************************************************************
+CREATE PROCEDURE [dbo].[GetTableDefine]
+ @tableName varchar(500)
+AS
+BEGIN
+ SET NOCOUNT ON;
+
+ DECLARE @PKData TABLE(Col varchar(500));
+ DECLARE @objectId int,@indId smallint,@pkCol varchar(500),@key varchar(500),@i smallint;
+
+ SET @objectId = object_id(@tableName);
+
+ --pk�ꗗ
+ IF EXISTS(SELECT 1 FROM sysobjects WHERE parent_obj = @objectId AND xtype = 'PK')
+ BEGIN
+ SELECT @indId=indid
+ FROM sysindexes a,sysobjects b
+ WHERE a.id=b.parent_obj AND a.name=b.name AND b.xtype='PK' AND b.parent_obj=@objectId;
+
+ INSERT INTO @PKData(Col) SELECT index_col(@tableName,@indId,1); --PrimaryKey�̈�Ԗڂ̍��ڎ擾
+
+ --����PrimaryKey�̍��ڎ擾
+ SET @i = 2;
+ SET @key = index_col(@tableName,@indId,@i);
+ WHILE (@key IS NOT NULL)
+ BEGIN
+ INSERT INTO @PKData(Col) SELECT @key;
+ SET @i = @i + 1;
+ SET @key = index_col(@tableName,@indId,@i);
+ END
+ END
+
+ --����
+ SELECT a.name AS [Name],'[' + b.name + ']' +
+ CASE WHEN b.xtype in(167,175,231,239) THEN '('+ case when a.prec = -1 then 'max' else CAST(a.prec as varchar) end + ') '
+ WHEN b.xtype in(106,108) THEN '('+ CAST(a.xprec as varchar) + ','+ CAST(a.xscale as varchar)+ ') ' --��������
+ ELSE ' '
+ END AS DataType,
+ CASE WHEN c.Col IS NULL THEN 0 ELSE 1 END AS IsPrimaryKey,
+ d.value AS [Description]
+ FROM syscolumns a
+ INNER JOIN systypes b ON a.xtype = b.xusertype
+ LEFT JOIN @PKData c ON a.name = c.Col
+ LEFT JOIN sys.extended_properties d on d.major_id = a.id and d.name = N'MS_Description' and d.[minor_id] = a.colid
+ WHERE a.id = @objectId
+ ORDER BY a.colid;
+
+ SET NOCOUNT OFF;
+END
\ No newline at end of file
diff --git a/HotelPms.Share/Data/Script/MsSql/SP_CloseDBConnect.sql b/HotelPms.Share/Data/Script/MsSql/SP_CloseDBConnect.sql
new file mode 100644
index 0000000..15bba3f
--- /dev/null
+++ b/HotelPms.Share/Data/Script/MsSql/SP_CloseDBConnect.sql
@@ -0,0 +1,46 @@
+CREATE PROCEDURE SP_CloseDBConnect
+ @Dname varchar(50)
+AS
+BEGIN
+ DECLARE @name varchar(50), @s varchar(1000)
+
+ IF (@Dname = '')
+ BEGIN
+ DECLARE DataName CURSOR FOR SELECT name FROM sys.databases WHERE name not in ('master');
+
+ OPEN DataName
+ FETCH NEXT FROM DataName INTO @name
+ WHILE (@@FETCH_STATUS = 0)
+ BEGIN
+ DECLARE tb CURSOR local FOR SELECT N'kill '+CAST(spid AS varchar) FROM master..sysprocesses WHERE dbid=db_id(@name)
+
+ OPEN tb
+ FETCH next FROM tb INTO @s
+ WHILE @@FETCH_STATUS=0
+ BEGIN
+ EXEC(@s)
+ FETCH NEXT FROM tb INTO @s
+ END
+ CLOSE tb
+ DEALLOCATE tb
+
+ FETCH NEXT FROM DataName INTO @name
+ END
+ CLOSE DataName
+ DEALLOCATE DataName
+ END
+ ELSE
+ BEGIN
+ DECLARE tb CURSOR local FOR SELECT N'kill '+CAST(spid AS varchar) FROM master..sysprocesses WHERE dbid=db_id(@Dname)
+
+ OPEN tb
+ FETCH next FROM tb INTO @s
+ WHILE @@FETCH_STATUS=0
+ BEGIN
+ EXEC(@s)
+ FETCH NEXT FROM tb INTO @s
+ END
+ CLOSE tb
+ DEALLOCATE tb
+ END
+END
diff --git a/HotelPms.Share/Data/Script/MsSql/SP_GetCreateTableScript.sql b/HotelPms.Share/Data/Script/MsSql/SP_GetCreateTableScript.sql
new file mode 100644
index 0000000..bb23293
--- /dev/null
+++ b/HotelPms.Share/Data/Script/MsSql/SP_GetCreateTableScript.sql
@@ -0,0 +1,74 @@
+-- ***********************************************************************
+-- PROCEDURE NAME : SP_GetCreateTableScript
+-- Description : �e�[�u���̐����r�p�k�̎擾
+-- ***********************************************************************
+CREATE PROCEDURE SP_GetCreateTableScript
+ @v_tableName varchar(256),
+ @IdentityOn int = 1 --identity���ڂ���������Aidentity�Őݒ肷�邩�ǂ���
+AS
+BEGIN
+ DECLARE @i_objectId int,
+ @i_indId smallint, --Index id
+ @v_pkInfo varchar(500),
+ @v_clusteredInfo varchar(20),
+ @v_pkCol varchar(500),
+ @v_key varchar(50),
+ @i_i smallint;
+
+ SET @i_objectId = object_id(@v_tableName);
+ IF @i_objectId is null RETURN;
+ IF OBJECTPROPERTY(@i_objectId, 'IsTable ') <> 1 RETURN;
+
+ CREATE TABLE #CreateTableScript(i_id int identity,v_desc varchar(1000));
+
+ INSERT INTO #CreateTableScript(v_desc) VALUES('CREATE TABLE ['+ @v_tableName + '](');
+
+ INSERT INTO #CreateTableScript(v_desc)
+ SELECT SPACE(4) + '[' + a.name + ']' + SPACE(1) + '[' + b.name + ']' +
+ CASE WHEN b.xtype in(167,175,231,239) THEN '('+ case when a.prec = -1 then 'max' else CAST(a.prec as varchar) end + ') '
+ WHEN b.xtype in(106,108) THEN '('+ CAST(a.xprec as varchar) + ','+ CAST(a.xscale as varchar)+ ') ' --��������
+ ELSE ' '
+ END
+ + SPACE(1) +
+ CASE WHEN (a.colstat & 1 = 1) AND @IdentityOn = 1
+ THEN 'IDENTITY('+ CAST(ident_seed(@v_tableName) as varchar)+ ',' +
+ CAST(ident_incr(@v_tableName) as varchar)+ ') '
+ ELSE ' '
+ END
+ + CASE a.isnullable WHEN 0 THEN 'NOT NULL' ELSE 'NULL' END + '|'
+ FROM syscolumns a,systypes b
+ WHERE a.id = @i_objectId AND a.xtype = b.xusertype
+ ORDER BY a.colid;
+
+ IF EXISTS(SELECT 1 FROM sysobjects WHERE parent_obj = @i_objectId AND xtype = 'PK')
+ BEGIN
+ SELECT @v_pkInfo=b.name,@i_indId=indid,
+ @v_clusteredInfo = (CASE WHEN (a.status & 16)=16 THEN 'CLUSTERED' ELSE 'NONCLUSTERED' END)
+ FROM sysindexes a,sysobjects b
+ WHERE a.id=b.parent_obj AND a.name=b.name AND b.xtype='PK' AND b.parent_obj=@i_objectId;
+
+ SELECT @v_pkCol = '[' + index_col(@v_tableName,@i_indId,1) + ']'; --PrimaryKey�̈�Ԗڂ̍��ڎ擾
+
+ --����PrimaryKey�̍��ڎ擾
+ SET @i_i = 2;
+ SELECT @v_key = index_col(@v_tableName,@i_indId,@i_i);
+ WHILE (@v_key IS NOT NULL)
+ BEGIN
+ SELECT @v_pkCol = @v_pkCol + ',[' + @v_key + ']', @i_i = @i_i + 1;
+ SELECT @v_key = index_col(@v_tableName, @i_indId, @i_i);
+ END
+
+ SET @v_pkInfo = ' CONSTRAINT ['+@v_pkInfo+ '] PRIMARY KEY '+ @v_clusteredInfo + ' ('+ @v_pkCol + ') ';
+ INSERT INTO #CreateTableScript(v_desc) VALUES(@v_pkInfo); -- ���匮�M�������Վ��\
+ END
+ ELSE
+ BEGIN
+ SELECT @i_i = COUNT(-1) FROM #CreateTableScript;
+ UPDATE #CreateTableScript SET v_desc = replace(v_desc, '|', ' ') WHERE i_id = @i_i;
+ END
+
+ INSERT INTO #CreateTableScript(v_desc) values( ')');
+ UPDATE #CreateTableScript SET v_desc = replace(v_desc, '|', ',');
+ SELECT v_desc FROM #CreateTableScript ORDER BY i_id;
+ DROP TABLE #CreateTableScript
+END
\ No newline at end of file
diff --git a/HotelPms.Share/Data/Script/ResourceFile.cs b/HotelPms.Share/Data/Script/ResourceFile.cs
new file mode 100644
index 0000000..bcf8c81
--- /dev/null
+++ b/HotelPms.Share/Data/Script/ResourceFile.cs
@@ -0,0 +1,35 @@
+using System.Text;
+using System.Reflection;
+using System.IO;
+using HotelPms.Share.Util;
+
+namespace HotelPms.Share.Data.Script;
+
+public class ResourceFile
+{
+ public enum ResType : int
+ {
+ SP_GetCreateTableScript = 0,
+ SP_CloseDBConnect,
+ }
+
+ public static string GetName(ResType type)
+ {
+ string name = string.Empty;
+ switch (type)
+ {
+ case ResType.SP_GetCreateTableScript:
+ case ResType.SP_CloseDBConnect:
+ name = string.Format("HotelPms.Share.Data.Script.MsSql.{0}.sql", type.ToString());
+ break;
+ }
+ return name;
+ }
+
+ public static string GetScript(ResType type)
+ {
+ Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(GetName(type));
+ byte[] data = CConvert.ToBytes(stream);
+ return Encoding.Default.GetString(data);
+ }
+}
diff --git a/HotelPms.Share/Data/Script/TableCreator.cs b/HotelPms.Share/Data/Script/TableCreator.cs
new file mode 100644
index 0000000..5bb1427
--- /dev/null
+++ b/HotelPms.Share/Data/Script/TableCreator.cs
@@ -0,0 +1,127 @@
+using System.Text;
+
+namespace HotelPms.Share.Data.Script;
+
+public class TableCreator : IDisposable
+{
+ public TableCreator()
+ {
+
+ }
+
+ /// <summary>
+ /// 初期化
+ /// 必ずPKがある
+ /// </summary>
+ /// <param name="name">テーブル名</param>
+ public TableCreator(string name)
+ {
+ Name = name;
+ }
+
+ /// <summary>
+ /// テーブル名
+ /// </summary>
+ public string Name { get; set; } = string.Empty;
+
+ /// <summary>
+ /// テーブルの説明
+ /// </summary>
+ public string Description { get; set; } = string.Empty;
+
+ /// <summary>
+ /// パーティションの構成
+ /// </summary>
+ public string PartitionSchema { get; set; } = string.Empty;
+
+ /// <summary>
+ /// パーティション使用列名
+ /// </summary>
+ public string PartitionKey { get; set; } = string.Empty;
+
+ /// <summary>
+ /// 項目
+ /// </summary>
+ public List<Field> Fields { get; set; } = new List<Field>();
+
+ /// <summary>
+ /// 項目
+ /// </summary>
+ /// <param name="index"></param>
+ /// <returns></returns>
+ public virtual Field this[int index]
+ {
+ get { return Fields[index]; }
+ }
+
+ /// <summary>
+ /// 名称で検索する
+ /// </summary>
+ /// <param name="name"></param>
+ /// <returns></returns>
+ public virtual Field? this[string name]
+ {
+ get { return Fields.FirstOrDefault<Field>(item => item.Name == name); }
+ }
+
+ /// <summary>
+ /// メモリー解放
+ /// </summary>
+ public void Dispose()
+ {
+ Fields.Clear();
+ }
+
+ /// <summary>
+ /// SQL文の作成
+ /// テーブルを削除してから、新規作成する
+ /// </summary>
+ /// <returns></returns>
+ public override string ToString()
+ {
+ StringBuilder desc = new StringBuilder();
+ // テーブルの説明
+ if (Description.Length > 0)
+ {
+ desc.AppendLine($"EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'{Description}' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'{Name}';");
+ }
+
+ StringBuilder cols = new StringBuilder();
+ StringBuilder pk = new StringBuilder();
+ foreach(Field item in Fields)
+ {
+ if (item.IsPrimaryKey)
+ {
+ if(pk.Length > 0) { pk.Append(","); }
+ pk.Append($"[{item.Name}] ASC");
+ }
+
+ cols.AppendLine($"[{item.Name}] {item.DataType} {(item.IsIdentity ? "IDENTITY(1,1)" : string.Empty)} {(item.IsPrimaryKey ? "NOT" : string.Empty)} NULL,");
+
+ if (item.Description.Length > 0)
+ {
+ desc.AppendLine($"EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'{item.Description}' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'{Name}', @level2type=N'COLUMN',@level2name=N'{item.Name}';");
+ }
+ }
+
+ //PARTITION構成の場合、最後にON [PARTITION構成]([列名])
+ string partition = string.Empty;
+ if(PartitionSchema.Length > 0) { partition = $"ON [{PartitionSchema}]([{PartitionKey}])"; }
+ ;
+ return $@"
+IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'{Name}') AND type in (N'U'))
+DROP TABLE {Name}
+
+CREATE TABLE [{Name}](
+{cols.ToString()}
+ CONSTRAINT [PK_{Name}] PRIMARY KEY CLUSTERED
+(
+ {pk.ToString()}
+)) {partition}
+
+{desc.ToString()}
+";
+ }
+
+
+}
diff --git a/HotelPms.Share/Data/SqlBrokerListener.cs b/HotelPms.Share/Data/SqlBrokerListener.cs
new file mode 100644
index 0000000..b9d0cec
--- /dev/null
+++ b/HotelPms.Share/Data/SqlBrokerListener.cs
@@ -0,0 +1,245 @@
+using HotelPms.Share.Data.Script;
+using HotelPms.Share.Util;
+using System.Data;
+using System.Data.SqlClient;
+
+namespace HotelPms.Share.Data;
+
+/// <summary>
+/// ****************************** Description *******************************
+/// ◇システム名称
+/// @CoreCom
+/// ◇概要
+/// 施設設定画面
+/// ◇履歴
+/// 2007/11/02 小木 勝龍 新規作成
+/// ****************************** Declarations ******************************
+/// </summary>
+public class SqlBrokerListener : IDisposable
+{
+ #region ★★★★★ Declartions ★★★★★
+
+#if false
+CREATE TABLE [dbo].[S_BrokerMsg](
+ [ID] [int] NOT NULL,
+ [SeqNo] int null,
+ [ActionID] TINYINT NULL,
+ [ActionData] [nvarchar](500) NULL,
+ [PcName] [nvarchar](50) NULL,
+ [UserName] [nvarchar](50) NULL,
+ UpdateDate DATETIME,
+CONSTRAINT [PK_S_BrokerMsg] PRIMARY KEY CLUSTERED
+(
+ [ID] ASC
+))
+GO
+
+CREATE TABLE [dbo].[H_BrokerMsg](
+[ID] [int] IDENTITY(1,1) NOT NULL,
+ [BrokerID] [int] NULL,
+ [SeqNo] int null,
+ [ActionID] TINYINT NULL,
+ [ActionData] [nvarchar](500) NULL,
+ [PcName] [nvarchar](50) NULL,
+ [UserName] [nvarchar](50) NULL,
+ UpdateDate DATETIME,
+CONSTRAINT [PK_H_BrokerMsg] PRIMARY KEY CLUSTERED
+(
+ [ID] ASC
+))
+GO
+
+CREATE TRIGGER [dbo].[TR_AddBrokerLog]
+ON [dbo].[S_BrokerMsg]
+FOR INSERT, UPDATE
+AS
+BEGIN
+ IF @@ROWCOUNT = 0 RETURN
+ SET NOCOUNT ON
+ DELETE FROM [H_BrokerMsg] WHERE UpdateDate < DATEADD(DD, -7, GETDATE());
+ INSERT INTO [H_BrokerMsg]([PcName],[UserName],[SeqNo],[ActionID],[ActionData],[UpdateDate]) SELECT [PcName],[UserName],[SeqNo],[ActionID],[ActionData],[UpdateDate] FROM inserted;
+END
+GO
+
+ALTER TABLE [dbo].[S_BrokerMsg] ENABLE TRIGGER [TR_AddBrokerLog]
+GO
+#endif
+
+
+ /// <summary>
+ /// 非同期のため、使う時Invoke必要
+ /// </summary>
+ public event DataChangeEventHandler? DataChange;
+ private bool m_Disposed = false;
+ private string m_ConnectString = string.Empty;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+
+ /// <summary>
+ /// メッセージデータのID
+ /// </summary>
+ public int ID { get; set; } = 1;
+
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public SqlBrokerListener(string hostName, string useID, string password, string dbName, int id)
+ {
+ ID = id;
+ m_ConnectString = string.Format("Data Source={0};User ID={1};Password={2};Initial Catalog={3};Application Name=SqlBrokerListener;", hostName, useID, password, dbName);
+ }
+
+ ~SqlBrokerListener()
+ {
+ Dispose(false);
+ }
+
+ protected virtual void Dispose(bool disposing)
+ {
+ if (!m_Disposed) //一回だけ
+ {
+ if (disposing)
+ {
+ //Managed Resources
+ SqlDependency.Stop(m_ConnectString);
+ }
+
+ //Unmanaged resources
+ m_Disposed = true;
+ }
+ }
+
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+
+ private void Update(bool isFirst)
+ {
+ using (SqlConnection connection = new SqlConnection(m_ConnectString))
+ {
+ //依赖是基于某一张表的,而且查询语句只能是简单查询语句,不能带top或*,同时必须指定所有者,即类似[dbo].[]
+ //using (SqlCommand command = new SqlCommand("select [Message] From [dbo].[Messages] WHERE ID = 1", connection))
+ using (SqlCommand command = new SqlCommand(string.Format("select [SeqNo] From [dbo].[S_BrokerMsg] WHERE ID = {0}", ID), connection))
+ {
+ //command.NotificationAutoEnlist = true;
+ command.Notification = null;
+ command.CommandType = CommandType.Text;
+ connection.Open();
+ SqlDependency dependency = new SqlDependency(command);
+ dependency.OnChange += dependency_OnChange;
+
+ using (DataTable dataTable = new DataTable())
+ {
+ using (SqlDataAdapter adapter = new SqlDataAdapter())
+ {
+ adapter.SelectCommand = command;
+ adapter.Fill(dataTable);
+ adapter.Dispose();
+ }
+
+ if (isFirst) { return; }
+ if (DataChange != null) { DataChange(this, new SqlDataChangeEventArgs(isFirst ? 0 : 1, false, dataTable)); }
+ }
+ }
+ }
+ }
+
+ private void dependency_OnChange(object sender, SqlNotificationEventArgs e)
+ {
+ SqlDependency dependency = (SqlDependency)sender;
+ dependency.OnChange -= dependency_OnChange;
+
+ //if (m_OwnerForm.InvokeRequired)
+ //{
+ // m_OwnerForm.Invoke(new OnChangeEventHandler(dependency_OnChange), new object[] { sender, e });
+ //}
+ //else
+ //{
+ Update(false);
+ //}
+ }
+
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+
+ public void Execute()
+ {
+ SqlDependency.Start(m_ConnectString);
+ Update(true);
+ }
+
+ public static bool BrokerEnabled(string hostName, string useID, string password, string dbName)
+ {
+ try
+ {
+ using (MsSqlNet msSqlNet = new MsSqlNet(hostName, useID, password, "master"))
+ {
+ object ret = msSqlNet.ExecuteScalar(string.Format("SELECT is_broker_enabled FROM sys.databases WHERE name ='{0}'", dbName));
+ return CConvert.ToBool(ret);
+ }
+ }
+ catch
+ {
+ return false;
+ }
+ }
+
+ /// <summary>
+ /// インストール時、is_broker_enabledよりfalseの場合、初期化必要
+ /// </summary>
+ /// <param name="hostName"></param>
+ /// <param name="useID"></param>
+ /// <param name="password"></param>
+ /// <param name="dbName"></param>
+ /// <returns></returns>
+ public static bool InitBroker(string hostName, string useID, string password, string dbName)
+ {
+ try
+ {
+ string sql = string.Empty;
+
+ //MASTER登録
+ using (MsSqlNet msSqlNet = new MsSqlNet(hostName, useID, password, "master"))
+ {
+ if (!msSqlNet.ExistsProctrue("SP_CloseDBConnect"))
+ {
+ sql = ResourceFile.GetScript(ResourceFile.ResType.SP_CloseDBConnect);
+ if (msSqlNet.ExecuteNonQuery(sql) == -1) { return false; }
+ }
+
+ //DBをクロス
+ //if (msSqlNet.ExecuteNonQuery(string.Format("EXECUTE SP_CloseDBConnect '{0}'", dbName)) == -1) { return false; }
+ msSqlNet.ExecuteNonQuery(string.Format("EXECUTE SP_CloseDBConnect '{0}'", dbName));
+
+ //Broker Enable
+ sql = string.Format(@"ALTER DATABASE {0} SET NEW_BROKER WITH ROLLBACK IMMEDIATE;
+ALTER DATABASE {0} SET ENABLE_BROKER; ", dbName);
+ if (msSqlNet.ExecuteNonQuery(sql) == -1) { return false; }
+
+ //sa権限⇒DBへ
+ if (msSqlNet.ExecuteNonQuery(string.Format("ALTER AUTHORIZATION ON DATABASE::{0} TO [sa];", dbName)) == -1) { return false; }
+
+ //CLR??
+
+ //成功チェック
+ return CConvert.ToBool(msSqlNet.ExecuteScalar(string.Format("SELECT is_broker_enabled FROM sys.databases WHERE name ='{0}'", dbName)));
+ }
+ }
+ catch
+ {
+ return false;
+ }
+ }
+
+ #endregion
+}
diff --git a/HotelPms.Share/Data/SqlDataChangeEventArgs.cs b/HotelPms.Share/Data/SqlDataChangeEventArgs.cs
new file mode 100644
index 0000000..8844f52
--- /dev/null
+++ b/HotelPms.Share/Data/SqlDataChangeEventArgs.cs
@@ -0,0 +1,41 @@
+
+namespace HotelPms.Share.Data;
+
+public delegate void DataChangeEventHandler(object sender, SqlDataChangeEventArgs e);
+
+public class SqlDataChangeEventArgs
+{
+ private int m_Index = 0;
+
+ /// <summary>
+ /// -1:Timer 0�`�F���r�p�k��Index
+ /// </summary>
+ public int Index
+ {
+ get { return m_Index; }
+ set { m_Index = value; }
+ }
+
+ private bool m_Cancel = false;
+
+ public bool Cancel
+ {
+ get { return m_Cancel; }
+ set { m_Cancel = value; }
+ }
+
+ private object? m_Data;
+
+ public object? Data
+ {
+ get { return m_Data; }
+ set { m_Data = value; }
+ }
+
+ public SqlDataChangeEventArgs(int index,bool cancel, object data)
+ {
+ this.m_Index = index;
+ this.m_Cancel = cancel;
+ this.m_Data = data;
+ }
+}
diff --git a/HotelPms.Share/Data/TableAccessBase.cs b/HotelPms.Share/Data/TableAccessBase.cs
new file mode 100644
index 0000000..23b7f99
--- /dev/null
+++ b/HotelPms.Share/Data/TableAccessBase.cs
@@ -0,0 +1,75 @@
+using System.Data;
+
+namespace HotelPms.Share.Data;
+
+public abstract class TableAccessBase : IDisposable
+{
+ /// <summary>
+ /// 同期用
+ /// </summary>
+ public static object SyncRoot { get; set; } = new object();
+
+ /// <summary>
+ /// テーブル名
+ /// </summary>
+ public string TableName { get; set; } = string.Empty;
+
+ /// <summary>
+ /// 追加SQL
+ /// SourceFactoryより自動で生成可能
+ /// </summary>
+ public string InsertSql { get; set; } = string.Empty;
+
+ /// <summary>
+ /// 更新SQL
+ /// SourceFactoryより自動で生成可能
+ /// </summary>
+ public string UpdateSql { get; set; } = string.Empty;
+
+ public TableAccessBase(string tableName)
+ {
+ TableName = tableName;
+ }
+
+ public abstract System.Data.DataTable GetPopUpList(DataAccess access);
+
+ public abstract System.Data.DataTable GetPopUpList(DataAccess access, object[] key);
+
+ /// <summary> 項目値を返す
+ /// </summary>
+ /// <param name="msSqlNet"></param>
+ /// <param name="pHotelCode"></param>
+ /// <param name="field"></param>
+ /// <returns></returns>
+ public object GetFieldValue(DataAccess access, string field, string where)
+ {
+ return access.ExecuteScalar(string.Format("Select {1} From {0} {2}", TableName, field, where));
+ }
+
+ /// <summary> 複数項目値を返す
+ /// </summary>
+ /// <param name="msSqlNet"></param>
+ /// <param name="pHotelCode"></param>
+ /// <param name="fields">Name1,Name2,Name3…</param>
+ /// <returns></returns>
+ public DataTable GetFields(DataAccess access, string fields, string where)
+ {
+ return access.GetDataTable(string.Format("Select {1} From {0} {2}", TableName, fields, where));
+ }
+
+ /// <summary> 項目更新
+ /// </summary>
+ /// <param name="msSqlNet"></param>
+ /// <param name="pHotelCode"></param>
+ /// <param name="field"></param>
+ /// <returns></returns>
+ public bool SetFieldValue(DataAccess access, string field, string value, string where)
+ {
+ return access.ExecuteNonQuery(string.Format(" UPDATE {0} SET {1} = '{2}' {3}", TableName, field, value, where)) > 0;
+ }
+
+ public virtual void Dispose()
+ {
+
+ }
+}
diff --git a/HotelPms.Share/HotelPms.Share.csproj b/HotelPms.Share/HotelPms.Share.csproj
new file mode 100644
index 0000000..4d53e22
--- /dev/null
+++ b/HotelPms.Share/HotelPms.Share.csproj
@@ -0,0 +1,26 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <TargetFramework>net9.0</TargetFramework>
+ <ImplicitUsings>enable</ImplicitUsings>
+ <Nullable>enable</Nullable>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <PackageReference Include="Google.Protobuf" Version="3.30.1" />
+ <PackageReference Include="Npgsql" Version="9.0.3" />
+ <PackageReference Include="System.Data.SqlClient" Version="4.9.0" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Remove="Data\Script\MsSql\GetTableDefine.sql" />
+ <None Remove="Data\Script\MsSql\SP_CloseDBConnect.sql" />
+ <None Remove="Data\Script\MsSql\SP_GetCreateTableScript.sql" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <EmbeddedResource Include="Data\Script\MsSql\GetTableDefine.sql" />
+ <EmbeddedResource Include="Data\Script\MsSql\SP_CloseDBConnect.sql" />
+ <EmbeddedResource Include="Data\Script\MsSql\SP_GetCreateTableScript.sql" />
+ </ItemGroup>
+
+</Project>
diff --git a/HotelPms.Share/IO/FileOperation.cs b/HotelPms.Share/IO/FileOperation.cs
new file mode 100644
index 0000000..100ca4d
--- /dev/null
+++ b/HotelPms.Share/IO/FileOperation.cs
@@ -0,0 +1,265 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.IO;
+
+namespace HotelPms.Share.IO
+{
+ public class FileOperation
+ {
+ [System.Runtime.InteropServices.DllImport("shell32.dll")]
+ private static extern int ExtractIconEx(string lpszFile, int niconIndex, ref IntPtr phiconLarge, ref IntPtr phiconSmall, int nIcons);
+
+ /// <summary>�w��PATH�ňꊇ�R�s�[����</summary>
+ /// <param name="hsSrcDir">���p�[�X</param>
+ /// <param name="hsDstDir">�ڕW�p�[�X</param>
+ /// <returns>bool</returns>
+ public static bool CopyTree(string hsSrcDir, string hsDstDir)
+ {
+ try
+ {
+ //�ڕW�p�[�X���Ȃ���A���B
+ if (!Directory.Exists(hsDstDir))
+ {
+ Directory.CreateDirectory(hsDstDir);
+ }
+
+ //�t�@�C�����R�s�[
+ string[] wvFileArray = Directory.GetFiles(hsSrcDir);
+ if (wvFileArray.Length > 0)
+ {
+ foreach (string wsCurfile in wvFileArray)
+ {
+ string dstFile = hsDstDir + Path.DirectorySeparatorChar + Path.GetFileName(wsCurfile);
+ Delete(dstFile);
+ File.Copy(wsCurfile, dstFile, true);
+ }
+ }
+
+ //�q�t�H���_���R�s�[
+ string wsCurSrcDir = null;
+ string wsCurFullDstDir = null;
+
+ string[] wvDirArray = Directory.GetDirectories(hsSrcDir);
+
+ if (wvDirArray.Length > 0)
+ {
+ foreach (string wsCurFullSrcDir in wvDirArray)
+ {
+ wsCurSrcDir = wsCurFullSrcDir.Substring(wsCurFullSrcDir.LastIndexOf(Path.DirectorySeparatorChar) + 1);
+ wsCurFullDstDir = hsDstDir + Path.DirectorySeparatorChar + wsCurSrcDir;
+
+ CopyTree(wsCurFullSrcDir, wsCurFullDstDir);
+ }
+ }
+
+ return true;
+ }
+ catch
+ {
+ return false;
+ }
+
+ }
+
+ public static List<string> GetDirList(string rootDir)
+ {
+ List<string> retDir = new List<string>();
+ string[] dirList = Directory.GetDirectories(rootDir);
+ retDir.AddRange(dirList);
+
+ foreach (string item in dirList)
+ {
+ retDir.AddRange(GetDirList(item));
+ }
+
+ return retDir;
+ }
+
+ /// <summary>�w��PATH�Ńt�@�C���ꗗ���擾����</summary>
+ /// <param name="hsSrcDir">���p�[�X</param>
+ /// <param name="hoFileList">�t�@�C���ꗗ</param>
+ /// <returns>bool</returns>
+ public static bool GetFileList(string hsSrcDir, ref List<string> hoFileList)
+ {
+ return GetFileList(hsSrcDir, ref hoFileList, "*");
+ }
+
+ /// <summary>�w��PATH�Ńt�@�C���ꗗ���擾����</summary>
+ /// <param name="hsSrcDir">���p�[�X</param>
+ /// <param name="hoFileList">�t�@�C���ꗗ</param>
+ /// <param name="hsSearchPattern">�t�@�C���̃^�C�v(�� *.txt�A*.sql��)</param>
+ /// <returns>bool</returns>
+ public static bool GetFileList(string hsSrcDir, ref List<string> hoFileList, string hsSearchPattern)
+ {
+ try
+ {
+ string[] wvFileArray = Directory.GetFiles(hsSrcDir, hsSearchPattern);
+ if (wvFileArray.Length > 0)
+ {
+ foreach (string wsCurfile in wvFileArray)
+ {
+ hoFileList.Add(wsCurfile);
+ }
+ }
+
+ string[] wvDirArray = Directory.GetDirectories(hsSrcDir);
+
+ if (wvDirArray.Length > 0)
+ {
+ foreach (string wsCurFullSrcDir in wvDirArray)
+ {
+ GetFileList(wsCurFullSrcDir, ref hoFileList, hsSearchPattern);
+ }
+ }
+
+ return true;
+ }
+ catch
+ {
+ return false;
+ }
+ }
+
+ public static void DeleteFile(string fileName)
+ {
+ try
+ {
+ FileInfo fi = new FileInfo(fileName);
+ if ((fi.Attributes & FileAttributes.ReadOnly) == FileAttributes.ReadOnly)
+ {
+ fi.Attributes = FileAttributes.Normal;
+ }
+
+ File.Delete(fileName);
+ }
+ catch { }
+ }
+
+ /// <summary>�t�@�C�����폜����</summary>
+ /// <param name="fileName">�t�@�C����</param>
+ /// <returns>bool</returns>
+ public static bool Delete(string fileName)
+ {
+ try
+ {
+ FileInfo fi = new FileInfo(fileName);
+ if ((fi.Attributes & FileAttributes.ReadOnly) == FileAttributes.ReadOnly)
+ {
+ fi.Attributes = FileAttributes.Normal;
+ }
+
+ File.Delete(fileName);
+
+ return true;
+ }
+ catch
+ {
+ return false;
+ }
+ }
+
+ /// <summary>�t�@�C���̎�ނō폜����</summary>
+ /// <param name="hsSrcDir">�p�[�X</param>
+ /// <param name="hsSearchPattern">�t�@�C���̎��(�� *.txt�A*.sql��)</</param>
+ /// <returns>bool</returns>
+ public static bool Delete(string hsSrcDir, string[] hsSearchPattern)
+ {
+ try
+ {
+ List<string> hoList = new List<string>();
+ for (int i = 0; i < hsSearchPattern.Length; i++)
+ {
+ GetFileList(hsSrcDir, ref hoList, hsSearchPattern[i]);
+ }
+
+ for (int i = 0; i < hoList.Count; i++)
+ {
+ FileInfo fi = new FileInfo(hoList[i].ToString());
+ if ((fi.Attributes & FileAttributes.ReadOnly) == FileAttributes.ReadOnly)
+ {
+ fi.Attributes = FileAttributes.Normal;
+ }
+
+ File.Delete(hoList[i].ToString());
+ }
+
+ hoList.Clear();
+
+ return true;
+ }
+ catch
+ {
+ return false;
+ }
+ }
+
+ /// <summary>
+ /// �ǂݎ���p���O��
+ /// </summary>
+ /// <param name="filePath"></param>
+ /// <returns></returns>
+ public static bool UnReadOnly(string filePath)
+ {
+ try
+ {
+ FileInfo fi = new FileInfo(filePath);
+ if ((fi.Attributes & FileAttributes.ReadOnly) == FileAttributes.ReadOnly)
+ {
+ fi.Attributes = FileAttributes.Normal;
+ }
+ return true;
+ }
+ catch
+ {
+ return false;
+ }
+ }
+
+ /// <summary>�SPath�폜����</summary>
+ /// <param name="aimpath">�p�[�X</param>
+ /// <returns>bool</returns>
+ public static bool DeleteDir(string aimpath)
+ {
+ try
+ {
+ if (aimpath[aimpath.Length - 1] != Path.DirectorySeparatorChar)
+ {
+ aimpath += Path.DirectorySeparatorChar;
+ }
+ string[] filelist = Directory.GetFileSystemEntries(aimpath);
+ foreach (string file in filelist)
+ {
+ if (Directory.Exists(file))
+ {
+ DeleteDir(aimpath + Path.GetFileName(file));
+ }
+ else
+ {
+ string filePath = aimpath + Path.GetFileName(file);
+ UnReadOnly(filePath);
+ File.Delete(filePath);
+ }
+ }
+ Directory.Delete(aimpath, true);
+ return true;
+ }
+ catch
+ {
+ return false;
+ }
+ }
+
+ ///// <summary>
+ ///// �t�@�C���̃R�s�[
+ ///// </summary>
+ ///// <param name="fileList"></param>
+ //public static void CopyToClipboard(System.Collections.Specialized.StringCollection fileList)
+ //{
+ // //System.Collections.Specialized.StringCollection strcoll = new System.Collections.Specialized.StringCollection();
+ // //strcoll.Add(System.Windows.Forms.Application.ExecutablePath);
+ // //strcoll.Add(Application.StartupPath + @"\GoogleJapaneseInputSetup.exe");
+ // Clipboard.SetFileDropList(fileList);
+ //}
+ }
+}
diff --git a/HotelPms.Share/IO/IOutputLog.cs b/HotelPms.Share/IO/IOutputLog.cs
new file mode 100644
index 0000000..3ef8370
--- /dev/null
+++ b/HotelPms.Share/IO/IOutputLog.cs
@@ -0,0 +1,15 @@
+namespace HotelPms.Share.IO
+{
+ /// <summary>
+ /// 画面出力用
+ /// </summary>
+ public interface IOutputLog
+ {
+ /// <summary>
+ /// ログ発行
+ /// </summary>
+ /// <param name="msg">内容</param>
+ /// <param name="flag">0:通常メッセージ 1:有効メッセージ</param>
+ void WriteLog(string msg, int flag);
+ }
+}
diff --git a/HotelPms.Share/IO/LogInfo.cs b/HotelPms.Share/IO/LogInfo.cs
new file mode 100644
index 0000000..b58e3cf
--- /dev/null
+++ b/HotelPms.Share/IO/LogInfo.cs
@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace HotelPms.Share.IO
+{
+ public class LogInfo
+ {
+ private string m_Message = string.Empty;
+
+ public string Message
+ {
+ get { return m_Message; }
+ set { m_Message = value; }
+ }
+
+ private OperationLog.LogLevelType m_Level = OperationLog.LogLevelType.Normal;
+
+ public OperationLog.LogLevelType Level
+ {
+ get { return m_Level; }
+ set { m_Level = value; }
+ }
+
+ public LogInfo(string msg, OperationLog.LogLevelType level)
+ {
+ m_Message = msg;
+ m_Level = level;
+ }
+ }
+}
diff --git a/HotelPms.Share/IO/OperationLog.cs b/HotelPms.Share/IO/OperationLog.cs
new file mode 100644
index 0000000..19408fe
--- /dev/null
+++ b/HotelPms.Share/IO/OperationLog.cs
@@ -0,0 +1,315 @@
+using HotelPms.Share.Util;
+using System;
+using System.Globalization;
+using System.IO;
+using System.Text;
+using System.Threading;
+
+namespace HotelPms.Share.IO
+{
+ public class OperationLog
+ {
+ /// ****************************** Description *******************************
+ /// ���V�X�e������
+ /// �@�ėp�N���X
+ /// ���T�v
+ /// �@�ȒPOpeLog���s
+ /// ������
+ /// �@2016/02/28 ���@���� �V�K�쐬
+ /// ****************************** Declarations ******************************
+
+ #region �����������@Declartions�@����������
+
+ public enum LogLevelType : int
+ {
+ Normal = 0,
+ Level1,
+ Level2,
+ Level3,
+ Level4,
+ Level5,
+ Level6,
+ /// <summary>
+ /// �ʏ�SQL���O
+ /// </summary>
+ Level7,
+ /// <summary>
+ /// �^�C�}�[�̏���SQL���O
+ /// </summary>
+ Level8,
+ /// <summary>
+ /// DB��new MsSqlNet���x��
+ /// </summary>
+ Level9,
+ }
+
+ private static string LogLevelFile = System.AppDomain.CurrentDomain.BaseDirectory + @"LogLevel.dat";
+ private static OperationLog? m_Default;
+ public static object SyncRoot = new object();
+ private string rootPath = System.AppDomain.CurrentDomain.BaseDirectory + @"OpeLog" + Path.DirectorySeparatorChar;
+ private long m_FileMaxSize = 512; //�P�ʁFKB
+ private int m_FileIndex = 1;
+ private bool m_Enabled = true;
+ public event MessageEventHandler? OutPut;
+
+ #endregion
+
+ #region �����������@Property�@����������
+
+ private LogLevelType m_Level = LogLevelType.Normal;
+
+ public LogLevelType Level
+ {
+ get { return m_Level; }
+ set { m_Level = value; }
+ }
+
+ public static OperationLog Instance
+ {
+ get
+ {
+ if (m_Default == null) { m_Default = new OperationLog(System.AppDomain.CurrentDomain.BaseDirectory + @"OpeLog" + Path.DirectorySeparatorChar + Environment.MachineName + "_" + Environment.UserName + Path.DirectorySeparatorChar, 512); }
+ return m_Default;
+ }
+ }
+
+ public long FileMaxSize
+ {
+ set { m_FileMaxSize = value; }
+ get { return m_FileMaxSize; }
+ }
+
+ /// <summary>
+ /// Log����邩�ǂ���
+ /// </summary>
+ public string RootPath
+ {
+ get { return rootPath; }
+ set { rootPath = value; }
+ }
+
+ public bool Enabled
+ {
+ get { return m_Enabled; }
+ set { m_Enabled = value; }
+ }
+
+ #endregion
+
+ #region �����������@Class Event�@����������
+
+ /// <summary>
+ /// �R���X�g���N�^
+ /// </summary>
+ /// <param name="currentType">�@�\ID����(�ʏ�SystemLog����`����Ă����ʁA�N���X)</param>
+ /// <param name="running">�����I�Ƀ��O�������邩�ǂ���</param>
+ /// <param name="rootPath"></param>
+ /// <param name="maxSize">�P�ʁFKB</param>
+ public OperationLog(string rootPath, long maxSize)
+ {
+ if (rootPath.Length > 0) { this.rootPath = rootPath; }
+ this.m_FileMaxSize = maxSize;
+ if (File.Exists(LogLevelFile)) { m_Level = (LogLevelType)CConvert.ToInt(File.ReadAllText(LogLevelFile, Encoding.UTF8)); }
+ InitLogger();
+ }
+
+ #endregion
+
+ #region �����������@Public Functions�@����������
+
+ /// <summary>
+ /// �V�X�e�����Ԃ���delayMonth���O�̃t�H���_���폜����
+ /// </summary>
+ /// <param name="delayMonth"></param>
+ public void ClearLog(int delayMonth)
+ {
+ try
+ {
+ string[] dirList = Directory.GetDirectories(rootPath);
+
+ foreach (string curDir in dirList)
+ {
+ if (curDir.Substring(curDir.Length - 6, 6).CompareTo(DateTime.Now.Date.AddMonths(-delayMonth).ToString("yyyyMM")) <= 0)
+ {
+ FileOperation.DeleteDir(curDir);
+ }
+ }
+ }
+ catch
+ {
+ }
+ }
+
+ /// <summary>
+ /// �V�X�e�����Ԃ���delayDay���O�̃t�H���_�ƃt�@�C�����폜����
+ /// </summary>
+ /// <param name="delayMonth"></param>
+ public void ClearLogByDay(int delayDay)
+ {
+ try
+ {
+ string beginYM = DateTime.Now.Date.AddDays(-delayDay).ToString("yyyyMM");
+ int beginD = CConvert.ToInt(DateTime.Now.Date.AddDays(-delayDay).ToString("dd"));
+
+ string[] dirList = Directory.GetDirectories(rootPath);
+
+ foreach (string curDir in dirList)
+ {
+ if (curDir.Substring(curDir.Length - 6, 6).CompareTo(beginYM) < 0)
+ {
+ FileOperation.DeleteDir(curDir);
+ }
+ else if (curDir.Substring(curDir.Length - 6, 6).CompareTo(beginYM) == 0)
+ {
+ //���t���폜
+ string[] fileList = Directory.GetFiles(curDir);
+ foreach (string file in fileList)
+ {
+ if (CConvert.ToInt(Path.GetFileNameWithoutExtension(file).Substring(0, 2)) < beginD)
+ {
+ FileOperation.Delete(file);
+ }
+ }
+ }
+ }
+ }
+ catch
+ {
+ }
+ }
+
+ #endregion
+
+ #region �����������@Private Functions�@����������
+
+ private void RaiseOutputEvent(string msg)
+ {
+ if (OutPut != null) { OutPut(this, new MessageEventArgs(msg)); }
+ }
+
+ private string GetFileName()
+ {
+ if (m_FileMaxSize == 0) { return DateTime.Now.Day.ToString("00", NumberFormatInfo.CurrentInfo); }
+
+ string dir = rootPath + DateTime.Now.ToString("yyyyMM");
+ string fileBase = DateTime.Now.Day.ToString("00", NumberFormatInfo.CurrentInfo) + "_{0}";
+
+ while (true)
+ {
+ string fileName = string.Format(fileBase, m_FileIndex);
+ string fileFullPath = dir + Path.DirectorySeparatorChar + fileName + ".log";
+ if (!File.Exists(fileFullPath))
+ {
+ File.WriteAllText(fileFullPath, "��������,���e" + Environment.NewLine, Encoding.UTF8);
+ return fileName;
+ }
+
+ FileInfo fileInfo = new FileInfo(fileFullPath);
+ if (fileInfo.Length < (m_FileMaxSize * 1024)) { return fileName; }
+ RaiseOutputEvent("GetFileName�F" + fileFullPath);
+ m_FileIndex++;
+ }
+ }
+
+ /// <summary>
+ /// logger������
+ /// </summary>
+ private void InitLogger()
+ {
+ try
+ {
+ string dir = rootPath + DateTime.Now.ToString("yyyyMM");
+ if (!Directory.Exists(dir))
+ {
+ Directory.CreateDirectory(dir);
+ m_FileIndex = 1;
+ }
+ string filePath = dir + Path.DirectorySeparatorChar + GetFileName() + ".log";
+ if (!File.Exists(filePath))
+ {
+ File.WriteAllText(filePath, "��������,���e" + Environment.NewLine, Encoding.UTF8);
+ }
+ //this.projectName = Assembly.GetCallingAssembly().ManifestModule.Name;
+ }
+ catch (Exception ex)
+ {
+ RaiseOutputEvent("InitLogger�F" + ex.Message);
+ }
+ }
+
+ public void WriteLog(string message)
+ {
+ WriteLog(message, LogLevelType.Normal);
+ }
+
+ public void WriteLog(string message, LogLevelType level)
+ {
+ if (!m_Enabled) { return; }
+ if ((int)m_Level < (int)level) { return; }
+
+ lock (SyncRoot)
+ {
+ InitLogger(); //���������
+
+ try
+ {
+ string filePath = rootPath + DateTime.Now.ToString("yyyyMM") + Path.DirectorySeparatorChar + GetFileName() + ".log";
+ using (StreamWriter sw = new StreamWriter(filePath, true, Encoding.UTF8))
+ {
+ sw.WriteLine(string.Format("�y{0}�z{1}", DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss fff"), message));
+ sw.Close();
+ }
+ }
+ catch (Exception ex)
+ {
+ RaiseOutputEvent("WriteLog�F" + ex.Message);
+ }
+ }
+ }
+
+ public static void Write(string msg)
+ {
+ Write(msg, LogLevelType.Normal);
+ }
+
+ public static void Write(string msg, LogLevelType level)
+ {
+ try
+ {
+ //������
+ ParameterizedThreadStart theradStart = new ParameterizedThreadStart(delegate(object data)
+ {
+ LogInfo item = data as LogInfo;
+ OperationLog.Instance.WriteLog(item.Message, item.Level);
+ });
+ Thread tr = new Thread(theradStart);
+ tr.Start(new LogInfo(msg, level));
+ }
+ catch
+ {
+ return;
+ }
+ }
+
+ public static void Clear(int delayMonth)
+ {
+ try
+ {
+ //������
+ ParameterizedThreadStart theradStart = new ParameterizedThreadStart(delegate(object data)
+ {
+ OperationLog.Instance.ClearLog(int.Parse(data.ToString()));
+ });
+ Thread tr = new Thread(theradStart);
+ tr.Start(delayMonth);
+ }
+ catch
+ {
+ return;
+ }
+ }
+
+
+ #endregion
+ }
+}
diff --git a/HotelPms.Share/NetWork/SubdirectoryHandler.cs b/HotelPms.Share/NetWork/SubdirectoryHandler.cs
new file mode 100644
index 0000000..c2d9e6b
--- /dev/null
+++ b/HotelPms.Share/NetWork/SubdirectoryHandler.cs
@@ -0,0 +1,25 @@
+namespace HotelPms.Share.NetWork
+{
+ /// <summary>
+ /// A delegating handler that will add a subdirectory to the URI of gRPC requests.
+ /// </summary>
+ public class SubdirectoryHandler : DelegatingHandler
+ {
+ private readonly string _subdirectory;
+
+ public SubdirectoryHandler(HttpMessageHandler innerHandler, string subdirectory) : base(innerHandler)
+ {
+ _subdirectory = subdirectory;
+ }
+
+ protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
+ {
+ if (request.RequestUri != null)
+ {
+ var url = $"{request.RequestUri.Scheme}://{request.RequestUri.Host}{_subdirectory}{request.RequestUri.AbsolutePath}";
+ request.RequestUri = new Uri(url, UriKind.Absolute);
+ }
+ return base.SendAsync(request, cancellationToken);
+ }
+ }
+}
diff --git a/HotelPms.Share/NetWork/TcpIP.cs b/HotelPms.Share/NetWork/TcpIP.cs
new file mode 100644
index 0000000..e5b1e0c
--- /dev/null
+++ b/HotelPms.Share/NetWork/TcpIP.cs
@@ -0,0 +1,93 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Net.Sockets;
+using System.Net;
+
+namespace Common.NetWork
+{
+ public class TcpIP
+ {
+ /// <summary>
+ /// ip���A���g�p�|�[�g�̎擾
+ /// (1024�`65535)
+ /// </summary>
+ /// <param name="ip4"></param>
+ /// <returns>0:�擾���s</returns>
+ public static int GetFreePort(string ip4)
+ {
+ for (int i = 1024; i < 65535; i++)
+ {
+ if (IsFreePort(ip4, i)) { return i; }
+ }
+ return 0;
+ }
+
+ /// <summary>
+ /// �w�肵���|�[�g�͎g�p�\���ǂ���
+ /// </summary>
+ /// <param name="ip4"></param>
+ /// <param name="port"></param>
+ /// <returns></returns>
+ public static bool IsFreePort(string ip4, int port)
+ {
+ using (TcpClient tc = new TcpClient())
+ {
+ try
+ {
+ tc.Connect(ip4, port);
+ return true;
+ }
+ catch (Exception e)
+ {
+ System.Diagnostics.Debug.WriteLine(e.Message);
+ }
+ }
+ return false;
+ }
+
+ /// <summary> ����IP�̎擾
+ /// </summary>
+ /// <returns></returns>
+ public static List<string> GetLocalIpv4()
+ {
+ IPAddress[] localIPs = Dns.GetHostAddresses(Dns.GetHostName());
+ List<string> IpCollection = new List<string>();
+ foreach (IPAddress ip in localIPs)
+ {
+ if (ip.AddressFamily == AddressFamily.InterNetwork) { IpCollection.Add(ip.ToString()); }
+ }
+ return IpCollection;
+ }
+
+ /// <summary> ����IP�̎擾
+ /// </summary>
+ /// <returns></returns>
+ public static string GetFirstLocalIpv4()
+ {
+ //192.168.�D��I�I�I
+ IPAddress[] localIPs = Dns.GetHostAddresses(Dns.GetHostName());
+ SortedList<string, string> IpCollection = new SortedList<string, string>();
+ foreach (IPAddress ip in localIPs)
+ {
+ if (ip.AddressFamily == AddressFamily.InterNetwork) { IpCollection.Add(string.Format("{0}-{1}", ip.ToString().StartsWith("192") ? "0" : "1", ip.ToString()), ip.ToString()); }
+ }
+ return IpCollection.Count == 0 ? string.Empty : IpCollection.Values[0];
+ }
+
+ /// <summary> ����IP�̎擾
+ /// </summary>
+ /// <returns></returns>
+ public static IPAddress GetFirstLocalIp4Address()
+ {
+ //192.168.�D��I�I�I
+ IPAddress[] localIPs = Dns.GetHostAddresses(Dns.GetHostName());
+ SortedList<string, IPAddress> IpCollection = new SortedList<string, IPAddress>();
+ foreach (IPAddress ip in localIPs)
+ {
+ if (ip.AddressFamily == AddressFamily.InterNetwork) { IpCollection.Add(string.Format("{0}-{1}", ip.ToString().StartsWith("192") ? "0" : "1", ip.ToString()), ip); }
+ }
+ return IpCollection.Count == 0 ? null : IpCollection.Values[0];
+ }
+ }
+}
diff --git a/HotelPms.Share/Util/CConvert.cs b/HotelPms.Share/Util/CConvert.cs
new file mode 100644
index 0000000..80f67d9
--- /dev/null
+++ b/HotelPms.Share/Util/CConvert.cs
Binary files differ
diff --git a/HotelPms.Share/Util/DictionarySetting.cs b/HotelPms.Share/Util/DictionarySetting.cs
new file mode 100644
index 0000000..199b1e7
--- /dev/null
+++ b/HotelPms.Share/Util/DictionarySetting.cs
@@ -0,0 +1,54 @@
+namespace HotelPms.Share.Util
+{
+ public abstract class DictionarySetting
+ {
+ public string FileName { get; set; } = string.Empty;
+
+ /// <summary>
+ /// 設定データ
+ /// </summary>
+ public Dictionary<string, string> Data { get; set; } = new Dictionary<string, string>();
+
+ /// <summary>
+ /// 設定値取得
+ /// </summary>
+ /// <param name="key"></param>
+ /// <returns></returns>
+ public string GetValue(string key)
+ {
+ return Data[key];
+ }
+
+ /// <summary>
+ /// 項目値設定
+ /// </summary>
+ /// <param name="key"></param>
+ /// <param name="value"></param>
+ public void SetValue(string key, string value)
+ {
+ Data[key] = value;
+ }
+
+ /// <summary>
+ /// 設定保存
+ /// </summary>
+ public void Save()
+ {
+ if (File.Exists(FileName)) { File.Delete(FileName); }
+ CConvert.ToJsonFile(Data, FileName);
+ }
+
+ public abstract void SetDefault();
+
+ public void Load()
+ {
+ if (File.Exists(FileName))
+ {
+ Dictionary<string, string>? ret = CConvert.ToInstanceFromJsonFile<Dictionary<string, string>>(FileName);
+ if (ret != null) { Data = ret; }
+ }
+ SetDefault();
+ }
+
+ }
+}
diff --git a/HotelPms.Share/Util/DynamicJsonConverter.cs b/HotelPms.Share/Util/DynamicJsonConverter.cs
new file mode 100644
index 0000000..052051f
--- /dev/null
+++ b/HotelPms.Share/Util/DynamicJsonConverter.cs
@@ -0,0 +1,160 @@
+using System.Dynamic;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+
+namespace HotelPms.Share.Util
+{
+ public class DynamicJsonConverter : JsonConverter<dynamic>
+ {
+ public override dynamic Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
+ {
+
+ if (reader.TokenType == JsonTokenType.True)
+ {
+ return true;
+ }
+
+ if (reader.TokenType == JsonTokenType.False)
+ {
+ return false;
+ }
+
+ if (reader.TokenType == JsonTokenType.Number)
+ {
+ if (reader.TryGetInt64(out long l))
+ {
+ return l;
+ }
+
+ return reader.GetDouble();
+ }
+
+ if (reader.TokenType == JsonTokenType.String)
+ {
+ if (reader.TryGetDateTime(out DateTime datetime))
+ {
+ return datetime;
+ }
+
+ return reader.GetString();
+ }
+
+ if (reader.TokenType == JsonTokenType.StartObject)
+ {
+ using JsonDocument documentV = JsonDocument.ParseValue(ref reader);
+ return ReadObject(documentV.RootElement);
+ }
+
+ if (reader.TokenType == JsonTokenType.StartArray)
+ {
+ using JsonDocument documentV = JsonDocument.ParseValue(ref reader);
+ return ReadList(documentV.RootElement);
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return document.RootElement.Clone();
+ }
+
+ private object ReadObject(JsonElement jsonElement)
+ {
+ IDictionary<string, object> expandoObject = new ExpandoObject();
+ foreach (var obj in jsonElement.EnumerateObject())
+ {
+ var k = obj.Name;
+ var value = ReadValue(obj.Value);
+ expandoObject[k] = value;
+ }
+ return expandoObject;
+ }
+
+ private object ReadValue(JsonElement jsonElement)
+ {
+ object result = null;
+ switch (jsonElement.ValueKind)
+ {
+ case JsonValueKind.Object:
+ result = ReadObject(jsonElement);
+ break;
+ case JsonValueKind.Array:
+ result = ReadList(jsonElement);
+ break;
+ case JsonValueKind.String:
+ result = jsonElement.GetString();
+ break;
+ case JsonValueKind.Number:
+ if (jsonElement.TryGetDecimal(out decimal d))
+ {
+ result = d;
+ }
+ else if (jsonElement.TryGetInt64(out long l))
+ {
+ result = l;
+ }
+ else
+ {
+ result = 0;
+ }
+ break;
+ case JsonValueKind.True:
+ result = true;
+ break;
+ case JsonValueKind.False:
+ result = false;
+ break;
+ case JsonValueKind.Undefined:
+ case JsonValueKind.Null:
+ result = null;
+ break;
+ default:
+ throw new ArgumentOutOfRangeException();
+ }
+ return result;
+ }
+
+ private object ReadList(JsonElement jsonElement)
+ {
+ IList<object> list = new List<object>();
+ foreach (var item in jsonElement.EnumerateArray())
+ {
+ list.Add(ReadValue(item));
+ }
+ return list.Count == 0 ? null : list;
+ }
+
+ public override void Write(Utf8JsonWriter writer, dynamic value, JsonSerializerOptions options)
+ {
+ // https://docs.microsoft.com/en-us/dotnet/api/system.typecode
+ switch (Type.GetTypeCode(value.GetType()))
+ {
+ case TypeCode.Boolean:
+ writer.WriteBooleanValue(Convert.ToBoolean(value));
+ break;
+ case TypeCode.Int16:
+ case TypeCode.Int32:
+ case TypeCode.Int64:
+ case TypeCode.UInt16:
+ case TypeCode.UInt32:
+ case TypeCode.UInt64:
+ writer.WriteNumberValue(Convert.ToInt64(value));
+ break;
+ case TypeCode.Decimal:
+ writer.WriteNumberValue(Convert.ToDecimal(value));
+ break;
+ case TypeCode.Char:
+ case TypeCode.Empty:
+ case TypeCode.String:
+ writer.WriteStringValue(Convert.ToString(value));
+ break;
+ case TypeCode.DateTime:
+ writer.WriteStringValue(Convert.ToDateTime(value).ToString("yyyy-MM-dd HH:mm:ss"));
+ break;
+ case TypeCode.DBNull:
+ writer.WriteNullValue();
+ break;
+ default:
+ writer.WriteRawValue(JsonSerializer.Serialize(value, new JsonSerializerOptions() { WriteIndented = true }));
+ break;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.Share/Util/MessageEventArgs.cs b/HotelPms.Share/Util/MessageEventArgs.cs
new file mode 100644
index 0000000..8a521be
--- /dev/null
+++ b/HotelPms.Share/Util/MessageEventArgs.cs
@@ -0,0 +1,60 @@
+using System;
+
+namespace HotelPms.Share.Util
+{
+ public class MessageEventArgs : EventArgs
+ {
+ private string m_Message = string.Empty;
+ private int m_TotalCount = 0;
+ private int m_CurrentCount = 0;
+ private object m_Tag = null;
+ private bool m_Cancel = false;
+
+ public bool Cancel
+ {
+ get { return m_Cancel; }
+ set { m_Cancel = value; }
+ }
+
+ public int CurrentCount
+ {
+ get { return m_CurrentCount; }
+ set { m_CurrentCount = value; }
+ }
+
+ public int TotalCount
+ {
+ get { return m_TotalCount; }
+ set { m_TotalCount = value; }
+ }
+
+ public string Message
+ {
+ get { return m_Message; }
+ set { m_Message = value; }
+ }
+
+ public object Tag
+ {
+ get { return m_Tag; }
+ set { m_Tag = value; }
+ }
+
+ public object Response { get; set; }
+
+ public MessageEventArgs(string message)
+ {
+ m_Message = message;
+ }
+
+ public MessageEventArgs(string message, int total, int count) : this(message, total, count, null) { }
+
+ public MessageEventArgs(string message, int total, int count, object tag)
+ {
+ m_Message = message;
+ m_TotalCount = total;
+ m_CurrentCount = count;
+ m_Tag = tag;
+ }
+ }
+}
diff --git a/HotelPms.Share/Util/MessageEventHandler.cs b/HotelPms.Share/Util/MessageEventHandler.cs
new file mode 100644
index 0000000..567055c
--- /dev/null
+++ b/HotelPms.Share/Util/MessageEventHandler.cs
@@ -0,0 +1,16 @@
+using System;
+
+namespace HotelPms.Share.Util
+{
+ // �T�v:
+ // System.Data.SqlClient.SqlConnection �� System.Data.SqlClient.SqlConnection.InfoMessage
+ // �C�x���g���������郁�\�b�h��\���܂��B
+ //
+ // �p�����[�^:
+ // sender:
+ // �C�x���g�̃\�[�X�B
+ //
+ // e:
+ // �C�x���g �f�[�^���i�[������ MessageEventArgs �I�u�W�F�N�g�B
+ public delegate void MessageEventHandler(object sender, MessageEventArgs e);
+}
diff --git a/HotelPms.Share/Util/ObjectEx.cs b/HotelPms.Share/Util/ObjectEx.cs
new file mode 100644
index 0000000..9d1bbbe
--- /dev/null
+++ b/HotelPms.Share/Util/ObjectEx.cs
@@ -0,0 +1,135 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Data;
+using System.Reflection;
+using System.Text;
+
+namespace HotelPms.Share.Util
+{
+ public static class ObjectEx
+ {
+ public enum Days
+ {
+ [Description("小木ですよ、 -~\"#$%#%$#\"===")]
+ Sun,
+ [Description("今天星期一 猴子穿新衣")]
+ Mon,
+ [Description("今天星期二 猴子肚子餓")]
+ Tue,
+ [Description("今天星期三 猴子去爬山")]
+ Wed,
+ [Description("今天星期四 猴子去考試")]
+ Thu,
+ [Description("今天星期五 猴子去跳舞")]
+ Fri,
+ [Description("今天星期六 猴子去斗六")]
+ Sat,
+ Inter,
+ }
+
+ /// <summary>
+ /// 返回枚举类型的注释
+ /// </summary>
+ /// <typeparam name="T"></typeparam>
+ /// 例:
+ /// public enum Days
+ /// {
+ /// [Description("小木ですよ、 -~\"#$%#%$#\"===")]
+ /// Sun,
+ /// [Description("今天星期一 猴子穿新衣")]
+ /// Mon,
+ /// [Description("今天星期二 猴子肚子餓")]
+ /// Tue,
+ /// [Description("今天星期三 猴子去爬山")]
+ /// Wed,
+ /// [Description("今天星期四 猴子去考試")]
+ /// Thu,
+ /// [Description("今天星期五 猴子去跳舞")]
+ /// Fri,
+ /// [Description("今天星期六 猴子去斗六")]
+ /// Sat,
+ /// Inter,
+ /// }
+ /// <param name="source"></param>
+ /// <returns></returns>
+ public static string ToDescription<T>(this T source) where T : Enum
+ {
+ try
+ {
+ FieldInfo fi = source.GetType().GetField(source.ToString());
+ DescriptionAttribute[] attributes = (DescriptionAttribute[])fi.GetCustomAttributes(typeof(DescriptionAttribute), false);
+ if (attributes != null && attributes.Length > 0) { return attributes[0].Description; } else { return source.ToString(); }
+ }
+ catch
+ {
+ return string.Empty;
+ }
+ }
+
+ /// <summary>
+ /// 任意オブジェクトのAttribute取得
+ /// </summary>
+ /// <param name="source"></param>
+ /// <returns></returns>
+ public static string GetDisplayName<T>(this T source, string property) where T : class
+ {
+ try
+ {
+ PropertyInfo p = source.GetType().GetProperty(property);
+ DisplayAttribute[] attributes = (DisplayAttribute[])p.GetCustomAttributes(typeof(DisplayAttribute), false);
+ if (attributes != null && attributes.Length > 0) { return attributes[0].Name; } else { return string.Empty; }
+ }
+ catch
+ {
+ return string.Empty;
+ }
+ }
+
+ /// <summary>
+ /// 任意オブジェクトのハンドル取得
+ /// </summary>
+ /// <param name="source"></param>
+ /// <returns></returns>
+ public static long ToHandle64<T>(this T source) where T : class
+ {
+ try
+ {
+ return source.GetType().TypeHandle.Value.ToInt64();
+ }
+ catch
+ {
+ return 0;
+ }
+ }
+
+ /// <summary>
+ /// Null判断
+ /// </summary>
+ /// <param name="dataReader"></param>
+ /// <param name="columnName"></param>
+ /// <returns></returns>
+ public static bool IsNull(this IDataReader dataReader, string columnName)
+ {
+ return dataReader[columnName] == DBNull.Value;
+ }
+
+ //public static T ToInstance<T>(long handle) where T : class
+ //{
+ // try
+ // {
+ // unsafe
+ // {
+ // IntPtr ptr = new IntPtr(handle);
+ // Object obj = Pointer.Box((void*)ptr, typeof(T));
+ // return obj as T;
+ // }
+ // }
+ // catch
+ // {
+ // return default(T);
+ // }
+ //}
+ }
+}
diff --git a/HotelPms.Share/Util/ScriptCreator.cs b/HotelPms.Share/Util/ScriptCreator.cs
new file mode 100644
index 0000000..c1dd97d
--- /dev/null
+++ b/HotelPms.Share/Util/ScriptCreator.cs
@@ -0,0 +1,165 @@
+using HotelPms.Share.Data;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HotelPms.Share.Util
+{
+ /// <summary>
+ /// ソースコード自動作成
+ /// </summary>
+ public static class ScriptCreator
+ {
+ /// <summary>
+ /// クラス名でCreateInstance
+ /// </summary>
+ /// <param name="hoObj">hoObj</param>
+ /// <returns>string</returns>
+ public static object ClassForName(string codeBase, string hsClsName)
+ {
+ System.Reflection.Assembly woAssem = null;
+ Type woType = null;
+ try
+ {
+ woAssem = System.Reflection.Assembly.Load(codeBase);
+ woType = woAssem.GetType(hsClsName);
+ return Activator.CreateInstance(woType);
+ }
+ catch(Exception ex)
+ {
+ return null;
+ }
+ }
+
+ /// <summary>
+ /// クラス名でCreateInstance
+ /// </summary>
+ /// <param name="hoObj">hoObj</param>
+ /// <returns>string</returns>
+ public static object ClassForName(string hsClsName)
+ {
+ return ClassForName(System.Reflection.Assembly.GetExecutingAssembly().GetName().Name, hsClsName);
+ }
+
+ /// <summary>
+ /// クラス ⇒ テキストボックス
+ /// </summary>
+ /// <param name="codeBase"></param>
+ /// <param name="className"></param>
+ /// <returns></returns>
+ public static string GetClassToTextBox(string codeBase, string className)
+ {
+ StringBuilder sb = new StringBuilder();
+ object item = ClassForName(codeBase, className);
+ Type type = item.GetType();
+ PropertyInfo[] infos = type.GetProperties();
+ foreach (PropertyInfo field in infos)
+ {
+ string name = field.Name;
+ if (field.PropertyType.FullName.Contains("System.Collections.Generic.List")) { continue; }
+ if (field.PropertyType.FullName.Contains("System.Data.DataSet")) { continue; }
+ if (field.PropertyType.FullName.Contains("System.Object")) { continue; }
+
+ if ("System.Boolean".Equals(field.PropertyType.FullName))
+ {
+ sb.AppendLine($"txt{name}.Text = item.{name} ? \"1\" : \"0\";");
+ }
+ else if ("System.Decimal".Equals(field.PropertyType.FullName))
+ {
+ sb.AppendLine($"txt{name}.Text = item.{name}.ToString();");
+ }
+ else if ("System.Int32".Equals(field.PropertyType.FullName))
+ {
+ sb.AppendLine($"txt{name}.Text = item.{name}.ToString();");
+ }
+ else if ("System.String".Equals(field.PropertyType.FullName))
+ {
+ sb.AppendLine($"txt{name}.Text = item.{name};");
+ }
+ else if ("System.DateTime".Equals(field.PropertyType.FullName))
+ {
+ sb.AppendLine($"txt{name}.Text = CConvert.ToDateString(item.{name});");
+ }
+ else if ("customTypes.Date".Equals(field.PropertyType.FullName))
+ {
+ sb.AppendLine($"txt{name}.Text = CConvert.ToDateString(item.{name}.ToDateTime());");
+ }
+ else if ("customTypes.DecimalValue".Equals(field.PropertyType.FullName))
+ {
+ sb.AppendLine($"txt{name}.Text = item.{name}.ToText();");
+ }
+ else if ("Google.Protobuf.WellKnownTypes.Timestamp".Equals(field.PropertyType.FullName))
+ {
+ sb.AppendLine($"txt{name}.Text = CConvert.ToDateString(item.{name}.ToDateTime());");
+ }
+ else
+ {
+ continue;
+ }
+ }
+ return sb.ToString();
+ }
+
+ /// <summary>
+ /// テキストボックス⇒クラス
+ /// </summary>
+ /// <param name="codeBase">Projectの名称:例えば Forms、Lib</param>
+ /// <param name="className"></param>
+ /// <returns></returns>
+ public static string GetTextBoxToClass(string codeBase, string className)
+ {
+ StringBuilder sb = new StringBuilder();
+ object item = ClassForName(codeBase, className);
+ Type type = item.GetType();
+ PropertyInfo[] infos = type.GetProperties();
+ foreach(PropertyInfo field in infos)
+ {
+ string name = field.Name;
+ if (field.PropertyType.FullName.Contains("System.Collections.Generic.List")) { continue; }
+ if (field.PropertyType.FullName.Contains("System.Data.DataSet")) { continue; }
+ if (field.PropertyType.FullName.Contains("System.Object")) { continue; }
+
+ if ("System.Boolean".Equals(field.PropertyType.FullName))
+ {
+ sb.AppendLine($"item.{name} = CConvert.ToBool(txt{name}.Text);");
+ }
+ else if ("System.Decimal".Equals(field.PropertyType.FullName))
+ {
+ sb.AppendLine($"item.{name} = CConvert.ToDecimal(txt{name}.Text);");
+ }
+ else if ("System.Int32".Equals(field.PropertyType.FullName))
+ {
+ sb.AppendLine($"item.{name} = CConvert.ToInt(txt{name}.Text);");
+ }
+ else if ("System.String".Equals(field.PropertyType.FullName))
+ {
+ sb.AppendLine($"item.{name} = txt{name}.Text;");
+ }
+ else if ("System.DateTime".Equals(field.PropertyType.FullName))
+ {
+ sb.AppendLine($"item.{name} = CConvert.ToDateTime(txt{name}.Text);");
+ }
+ else if ("customTypes.Date".Equals(field.PropertyType.FullName))
+ {
+ sb.AppendLine($"item.{name} = new Date(CConvert.ToDateInt(txt{name}.Text));");
+ }
+ else if ("customTypes.DecimalValue".Equals(field.PropertyType.FullName))
+ {
+ sb.AppendLine($"item.{name} = CConvert.ToDecimal(txt{name}.Text);");
+ }
+ else if ("Google.Protobuf.WellKnownTypes.Timestamp".Equals(field.PropertyType.FullName))
+ {
+ sb.AppendLine($"item.{name} = CConvert.ToTimestamp(CConvert.ToDateTime(txt{name}.Text));");
+ }
+ else
+ {
+ continue;
+ }
+ }
+ return sb.ToString();
+ }
+ }
+}
diff --git a/HotelPms.Share/Util/ServiceCore.cs b/HotelPms.Share/Util/ServiceCore.cs
new file mode 100644
index 0000000..51cdf06
--- /dev/null
+++ b/HotelPms.Share/Util/ServiceCore.cs
@@ -0,0 +1,434 @@
+using System;
+using System.Diagnostics;
+using System.Runtime.InteropServices;
+using System.Security;
+
+namespace HotelPms.Share.Util
+{
+ public class ServiceCore
+ {
+ #region DLLImport
+
+ [DllImport("advapi32.dll")]
+ public static extern IntPtr OpenSCManager(string lpMachineName, string lpSCDB, int scParameter);
+ [DllImport("Advapi32.dll")]
+ public static extern IntPtr CreateService(IntPtr SC_HANDLE, string lpSvcName, string lpDisplayName,
+ int dwDesiredAccess, int dwServiceType, int dwStartType, int dwErrorControl, string lpPathName,
+ string lpLoadOrderGroup, int lpdwTagId, string lpDependencies, string lpServiceStartName, string lpPassword);
+ [DllImport("advapi32.dll")]
+ public static extern void CloseServiceHandle(IntPtr SCHANDLE);
+ [DllImport("advapi32.dll")]
+ public static extern int StartService(IntPtr SVHANDLE, int dwNumServiceArgs, string lpServiceArgVectors);
+ [DllImport("advapi32.dll", SetLastError = true)]
+ public static extern IntPtr OpenService(IntPtr SCHANDLE, string lpSvcName, int dwNumServiceArgs);
+ [DllImport("advapi32.dll")]
+ public static extern int DeleteService(IntPtr SVHANDLE);
+ [DllImport("kernel32.dll")]
+ public static extern int GetLastError();
+
+ const int SERVICE_CONFIG_DESCRIPTION = 0x01;
+
+ [DllImport("advapi32.dll", SetLastError = true, CharSet = CharSet.Auto)]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool ChangeServiceConfig2(IntPtr hService, int dwInfoLevel, [MarshalAs(UnmanagedType.Struct)] ref SERVICE_DESCRIPTION lpInfo);
+
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
+ public struct SERVICE_DESCRIPTION
+ {
+ public string lpDescription;
+ }
+
+ #endregion DLLImport
+
+ #region Constants declaration.
+
+ private const int SC_MANAGER_CREATE_SERVICE = 0x0002;
+ private const int SERVICE_WIN32_OWN_PROCESS = 0x00000010;
+ //int SERVICE_DEMAND_START = 0x00000003;
+ private const int SERVICE_ERROR_NORMAL = 0x00000001;
+ private const int STANDARD_RIGHTS_REQUIRED = 0xF0000;
+ private const int SERVICE_QUERY_CONFIG = 0x0001;
+ private const int SERVICE_CHANGE_CONFIG = 0x0002;
+ private const int SERVICE_QUERY_STATUS = 0x0004;
+ private const int SERVICE_ENUMERATE_DEPENDENTS = 0x0008;
+ private const int SERVICE_START = 0x0010;
+ private const int SERVICE_STOP = 0x0020;
+ private const int SERVICE_PAUSE_CONTINUE = 0x0040;
+ private const int SERVICE_INTERROGATE = 0x0080;
+ private const int SERVICE_USER_DEFINED_CONTROL = 0x0100;
+ private const int SERVICE_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED |
+ SERVICE_QUERY_CONFIG |
+ SERVICE_CHANGE_CONFIG |
+ SERVICE_QUERY_STATUS |
+ SERVICE_ENUMERATE_DEPENDENTS |
+ SERVICE_START |
+ SERVICE_STOP |
+ SERVICE_PAUSE_CONTINUE |
+ SERVICE_INTERROGATE |
+ SERVICE_USER_DEFINED_CONTROL);
+ private const int SERVICE_AUTO_START = 0x00000002;
+
+ #endregion Constants declaration.
+
+ /// <summary>
+ /// 安装和运行
+ /// </summary>
+ /// <param name="svcPath">程序路径.</param>
+ /// <param name="svcName">服务名</param>
+ /// <param name="svcDispName">服务显示名称.</param>
+ /// <returns>服务安装是否成功.</returns>
+ public static bool Install(string svcPath, string svcName, string svcDispName, string description)
+ {
+ try
+ {
+ IntPtr sc_handle = OpenSCManager(null, null, SC_MANAGER_CREATE_SERVICE);
+ if (sc_handle != IntPtr.Zero)
+ {
+ IntPtr sv_handle = CreateService(sc_handle, svcName, svcDispName, SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS, SERVICE_AUTO_START, SERVICE_ERROR_NORMAL, svcPath, null, 0, null, null, null);
+ if (sv_handle == IntPtr.Zero)
+ {
+ CloseServiceHandle(sc_handle);
+ return false;
+ }
+ else
+ {
+ var pinfo = new SERVICE_DESCRIPTION
+ {
+ lpDescription = description
+ };
+ ChangeServiceConfig2(sv_handle, SERVICE_CONFIG_DESCRIPTION, ref pinfo);
+ //试尝启动服务
+ int i = StartService(sv_handle, 0, null);
+ if (i == 0)
+ {
+ return false;
+ }
+ CloseServiceHandle(sc_handle);
+ return true;
+ }
+ }
+ else
+ return false;
+ }
+ catch
+ {
+ return false;
+ }
+ }
+ /// <summary>
+ /// 反安装服务.
+ /// </summary>
+ /// <param name="svcName">服务名.</param>
+ public static bool UnInstall(string svcName)
+ {
+ IntPtr sc_hndl = IntPtr.Zero;
+ int GENERIC_WRITE = 0x40000000;
+
+ try
+ {
+ sc_hndl = OpenSCManager(null, null, GENERIC_WRITE);
+ if (sc_hndl != IntPtr.Zero)
+ {
+ int DELETE = 0x10000;
+ IntPtr svc_hndl = OpenService(sc_hndl, svcName, DELETE);
+ if (svc_hndl != IntPtr.Zero)
+ {
+ return DeleteService(svc_hndl) != 0;
+ }
+ else
+ return false;
+ }
+ else
+ return false;
+ }
+ catch
+ {
+ return false;
+ }
+ finally
+ {
+ if (sc_hndl != IntPtr.Zero) { CloseServiceHandle(sc_hndl); }
+ }
+ }
+
+
+ #region Structures
+
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct SECURITY_ATTRIBUTES
+ {
+ public int Length;
+ public IntPtr lpSecurityDescriptor;
+ public bool bInheritHandle;
+ }
+
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct STARTUPINFO
+ {
+ public int cb;
+ public String lpReserved;
+ public String lpDesktop;
+ public String lpTitle;
+ public uint dwX;
+ public uint dwY;
+ public uint dwXSize;
+ public uint dwYSize;
+ public uint dwXCountChars;
+ public uint dwYCountChars;
+ public uint dwFillAttribute;
+ public uint dwFlags;
+ public short wShowWindow;
+ public short cbReserved2;
+ public IntPtr lpReserved2;
+ public IntPtr hStdInput;
+ public IntPtr hStdOutput;
+ public IntPtr hStdError;
+ }
+
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct PROCESS_INFORMATION
+ {
+ public IntPtr hProcess;
+ public IntPtr hThread;
+ public uint dwProcessId;
+ public uint dwThreadId;
+ }
+
+
+ #endregion
+
+
+ #region Enumerations
+
+
+ enum TOKEN_TYPE : int
+ {
+ TokenPrimary = 1,
+ TokenImpersonation = 2
+ }
+
+
+ enum SECURITY_IMPERSONATION_LEVEL : int
+ {
+ SecurityAnonymous = 0,
+ SecurityIdentification = 1,
+ SecurityImpersonation = 2,
+ SecurityDelegation = 3,
+ }
+
+
+ enum WTSInfoClass
+ {
+ InitialProgram,
+ ApplicationName,
+ WorkingDirectory,
+ OEMId,
+ SessionId,
+ UserName,
+ WinStationName,
+ DomainName,
+ ConnectState,
+ ClientBuildNumber,
+ ClientName,
+ ClientDirectory,
+ ClientProductId,
+ ClientHardwareId,
+ ClientAddress,
+ ClientDisplay,
+ ClientProtocolType
+ }
+
+
+ #endregion
+
+
+ #region Constants
+
+
+ public const int TOKEN_DUPLICATE = 0x0002;
+ public const uint MAXIMUM_ALLOWED = 0x2000000;
+ public const int CREATE_NEW_CONSOLE = 0x00000010;
+
+
+ public const int IDLE_PRIORITY_CLASS = 0x40;
+ public const int NORMAL_PRIORITY_CLASS = 0x20;
+ public const int HIGH_PRIORITY_CLASS = 0x80;
+ public const int REALTIME_PRIORITY_CLASS = 0x100;
+
+
+ #endregion
+
+
+ #region Win32 API Imports
+
+
+ [DllImport("kernel32.dll", SetLastError = true)]
+ private static extern bool CloseHandle(IntPtr hSnapshot);
+
+
+ [DllImport("kernel32.dll")]
+ static extern uint WTSGetActiveConsoleSessionId();
+
+
+ [DllImport("wtsapi32.dll", CharSet = CharSet.Unicode, SetLastError = true), SuppressUnmanagedCodeSecurityAttribute]
+ static extern bool WTSQuerySessionInformation(System.IntPtr hServer, int sessionId, WTSInfoClass wtsInfoClass, out System.IntPtr ppBuffer, out uint pBytesReturned);
+
+
+ [DllImport("advapi32.dll", EntryPoint = "CreateProcessAsUser", SetLastError = true, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
+ public extern static bool CreateProcessAsUser(IntPtr hToken, String lpApplicationName, String lpCommandLine, ref SECURITY_ATTRIBUTES lpProcessAttributes,
+ ref SECURITY_ATTRIBUTES lpThreadAttributes, bool bInheritHandle, int dwCreationFlags, IntPtr lpEnvironment,
+ String lpCurrentDirectory, ref STARTUPINFO lpStartupInfo, out PROCESS_INFORMATION lpProcessInformation);
+
+
+ [DllImport("kernel32.dll")]
+ static extern bool ProcessIdToSessionId(uint dwProcessId, ref uint pSessionId);
+
+
+ [DllImport("advapi32.dll", EntryPoint = "DuplicateTokenEx")]
+ public extern static bool DuplicateTokenEx(IntPtr ExistingTokenHandle, uint dwDesiredAccess,
+ ref SECURITY_ATTRIBUTES lpThreadAttributes, int TokenType,
+ int ImpersonationLevel, ref IntPtr DuplicateTokenHandle);
+
+
+ [DllImport("kernel32.dll")]
+ static extern IntPtr OpenProcess(uint dwDesiredAccess, bool bInheritHandle, uint dwProcessId);
+
+
+ [DllImport("advapi32", SetLastError = true), SuppressUnmanagedCodeSecurityAttribute]
+ static extern bool OpenProcessToken(IntPtr ProcessHandle, int DesiredAccess, ref IntPtr TokenHandle);
+
+
+ #endregion
+
+
+ public static string GetCurrentActiveUser()
+ {
+ IntPtr hServer = IntPtr.Zero, state = IntPtr.Zero;
+ uint bCount = 0;
+
+
+ // obtain the currently active session id; every logged on user in the system has a unique session id
+ uint dwSessionId = WTSGetActiveConsoleSessionId();
+ string domain = string.Empty, userName = string.Empty;
+
+
+ if (WTSQuerySessionInformation(hServer, (int)dwSessionId, WTSInfoClass.DomainName, out state, out bCount))
+ {
+ domain = Marshal.PtrToStringAuto(state);
+ }
+
+
+ if (WTSQuerySessionInformation(hServer, (int)dwSessionId, WTSInfoClass.UserName, out state, out bCount))
+ {
+ userName = Marshal.PtrToStringAuto(state);
+ }
+
+
+ return string.Format("{0}\\{1}", domain, userName);
+ }
+
+ public static bool StartProcessAndBypassUAC(String applicationName)
+ {
+ PROCESS_INFORMATION procInfo;
+ return StartProcessAndBypassUAC(applicationName, string.Empty, out procInfo);
+ }
+
+ /// <summary>
+ /// Launches the given application with full admin rights, and in addition bypasses the Vista UAC prompt
+ /// </summary>
+ /// <param name="applicationName">The name of the application to launch</param>
+ /// <param name="procInfo">Process information regarding the launched application that gets returned to the caller</param>
+ /// <returns></returns>
+ public static bool StartProcessAndBypassUAC(String applicationName, String command, out PROCESS_INFORMATION procInfo)
+ {
+ uint winlogonPid = 0;
+ IntPtr hUserTokenDup = IntPtr.Zero, hPToken = IntPtr.Zero, hProcess = IntPtr.Zero;
+ procInfo = new PROCESS_INFORMATION();
+
+
+ // obtain the currently active session id; every logged on user in the system has a unique session id
+ uint dwSessionId = WTSGetActiveConsoleSessionId();
+
+
+ // obtain the process id of the winlogon process that is running within the currently active session
+ Process[] processes = Process.GetProcessesByName("winlogon");
+ foreach (Process p in processes)
+ {
+ if ((uint)p.SessionId == dwSessionId)
+ {
+ winlogonPid = (uint)p.Id;
+ }
+ }
+
+
+ // obtain a handle to the winlogon process
+ hProcess = OpenProcess(MAXIMUM_ALLOWED, false, winlogonPid);
+
+
+ // obtain a handle to the access token of the winlogon process
+ if (!OpenProcessToken(hProcess, TOKEN_DUPLICATE, ref hPToken))
+ {
+ CloseHandle(hProcess);
+ return false;
+ }
+
+
+ // Security attibute structure used in DuplicateTokenEx and CreateProcessAsUser
+ // I would prefer to not have to use a security attribute variable and to just
+ // simply pass null and inherit (by default) the security attributes
+ // of the existing token. However, in C# structures are value types and therefore
+ // cannot be assigned the null value.
+ SECURITY_ATTRIBUTES sa = new SECURITY_ATTRIBUTES();
+ sa.Length = Marshal.SizeOf(sa);
+
+
+ // copy the access token of the winlogon process; the newly created token will be a primary token
+ if (!DuplicateTokenEx(hPToken, MAXIMUM_ALLOWED, ref sa, (int)SECURITY_IMPERSONATION_LEVEL.SecurityIdentification, (int)TOKEN_TYPE.TokenPrimary, ref hUserTokenDup))
+ {
+ CloseHandle(hProcess);
+ CloseHandle(hPToken);
+ return false;
+ }
+
+
+ // By default CreateProcessAsUser creates a process on a non-interactive window station, meaning
+ // the window station has a desktop that is invisible and the process is incapable of receiving
+ // user input. To remedy this we set the lpDesktop parameter to indicate we want to enable user
+ // interaction with the new process.
+ STARTUPINFO si = new STARTUPINFO();
+ si.cb = (int)Marshal.SizeOf(si);
+ si.lpDesktop = @"winsta0\default"; // interactive window station parameter; basically this indicates that the process created can display a GUI on the desktop
+
+
+ // flags that specify the priority and creation method of the process
+ int dwCreationFlags = NORMAL_PRIORITY_CLASS | CREATE_NEW_CONSOLE;
+
+
+ // create a new process in the current user's logon session
+ bool result = CreateProcessAsUser(hUserTokenDup, // client's access token
+ applicationName, // file to execute
+ command, // command line
+ ref sa, // pointer to process SECURITY_ATTRIBUTES
+ ref sa, // pointer to thread SECURITY_ATTRIBUTES
+ false, // handles are not inheritable
+ dwCreationFlags, // creation flags
+ IntPtr.Zero, // pointer to new environment block
+ null, // name of current directory
+ ref si, // pointer to STARTUPINFO structure
+ out procInfo // receives information about new process
+ );
+
+
+ // invalidate the handles
+ CloseHandle(hProcess);
+ CloseHandle(hPToken);
+ CloseHandle(hUserTokenDup);
+
+
+ return result; // return the result
+ }
+ }
+}
diff --git a/HotelPms.Share/Util/SystemCommon.cs b/HotelPms.Share/Util/SystemCommon.cs
new file mode 100644
index 0000000..554983d
--- /dev/null
+++ b/HotelPms.Share/Util/SystemCommon.cs
@@ -0,0 +1,47 @@
+using System.Diagnostics;
+using System.Runtime.InteropServices;
+
+namespace HotelPms.Share.Util
+{
+ public class SystemCommon
+ {
+ [DllImport("user32.dll", SetLastError = true)]
+ private static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
+
+ /// <summary> 待ち
+ /// </summary>
+ /// <param name="milliseconds"></param>
+ public static void Wait(double milliseconds)
+ {
+ DateTime t = DateTime.Now.AddMilliseconds(milliseconds);
+ while (DateTime.Now < t)
+ {
+ Thread.Sleep(1);
+ if (DateTime.Now.AddMilliseconds(milliseconds + 1000) < t) { break; } //途中でシステム時間変わった!!
+ }
+ }
+
+ //public static void WaitDisktop()
+ //{
+ // // wait until desktop ready
+ // IntPtr lHwnd = IntPtr.Zero;
+ // do
+ // {
+ // lHwnd = FindWindow("Shell_TrayWnd", null);
+ // Thread.Sleep(100);
+ // } while (lHwnd == IntPtr.Zero);
+ //}
+
+ public static void WaitDisktop()
+ {
+ while (true)
+ {
+ if (Process.GetProcessesByName("winlogon").Length > 0 && Process.GetProcessesByName("explorer").Length > 0)
+ {
+ break;
+ }
+ Thread.Sleep(1);
+ }
+ }
+ }
+}
diff --git a/HotelPms.Share/Util/SystemStorage.cs b/HotelPms.Share/Util/SystemStorage.cs
new file mode 100644
index 0000000..f7cd3e3
--- /dev/null
+++ b/HotelPms.Share/Util/SystemStorage.cs
@@ -0,0 +1,76 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace HotelPms.Share.Util
+{
+ /// ****************************** Description *******************************
+ /// ���V�X�e������
+ /// �@�ėp�N���X
+ /// ���T�v
+ /// �@�V�X�e�����ʕϐ��i�[�p
+ /// ������
+ /// �@20070803 ���@���� �V�K�쐬
+ /// ****************************** Declarations ******************************
+ public class SystemStorage
+ {
+ private static SystemStorage? systemStorage;
+ private Dictionary<string,object> dictionary;
+
+ public SystemStorage()
+ {
+ dictionary = new Dictionary<string, object>();
+ }
+
+ ~SystemStorage()
+ {
+ dictionary.Clear();
+ }
+
+ public static SystemStorage Instance()
+ {
+ if (systemStorage == null)
+ {
+ systemStorage = new SystemStorage();
+ }
+ return systemStorage;
+ }
+
+ public void SetItem(string key, object value)
+ {
+ dictionary.Add(key, value);
+ }
+
+ public bool ContainsKey(string key)
+ {
+ return dictionary.ContainsKey(key);
+ }
+
+ public object GetItem(string key)
+ {
+ return dictionary[key];
+ }
+
+ public void ReMoveItem(string key)
+ {
+ try
+ {
+ dictionary.Remove(key);
+ }
+ catch
+ {
+ }
+ }
+
+ public void ReMoveAll()
+ {
+ try
+ {
+ dictionary.Clear();
+ }
+ catch
+ {
+ }
+ }
+ }
+}
diff --git a/HotelPms.Share/Xml/ConfigXml.cs b/HotelPms.Share/Xml/ConfigXml.cs
new file mode 100644
index 0000000..972e8dd
--- /dev/null
+++ b/HotelPms.Share/Xml/ConfigXml.cs
@@ -0,0 +1,164 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using HotelPms.Share.Util;
+using System.Xml;
+using System.IO;
+
+namespace HotelPms.Share.Xml
+{
+ /// ****************************** Description *******************************
+ /// ���V�X�e������
+ /// �@�ėp�N���X
+ /// ���T�v
+ /// �@Config.xml��Ǎ�
+ /// ������
+ /// �@20070803 ���@���� �V�K�쐬
+ /// ****************************** Declarations ******************************
+ public class ConfigXml
+ {
+ private static string configXmlPath = System.AppDomain.CurrentDomain.BaseDirectory + @"Config.xml";
+ private static string dBServer = string.Empty;
+ private static string dBName = string.Empty;
+ private static string dBUser = string.Empty;
+ private static string dBPassWord = string.Empty;
+
+ public static string DBName
+ {
+ get { return dBName; }
+ set { dBName = value; }
+ }
+
+ public static string DBServer
+ {
+ get { return dBServer; }
+ set { dBServer = value; }
+ }
+
+ public static string DBUser
+ {
+ get { return dBUser; }
+ set { dBUser = value; }
+ }
+
+ public static string DBPassWord
+ {
+ get { return dBPassWord; }
+ set { dBPassWord = value; }
+ }
+
+ public static string ConfigXmlPath
+ {
+ get { return configXmlPath; }
+ set { configXmlPath = value; }
+ }
+
+ /// <summary>
+ /// �[���ݒ�̓ǂݍ���
+ /// </summary>
+ public static void GetConfigXml()
+ {
+ try
+ {
+ if (!File.Exists(configXmlPath))
+ {
+ try
+ {
+ string[] connectInfo = new string[4];
+ //�Ȃ���ΐ�������
+ StringBuilder fileBuilder = new StringBuilder();
+ fileBuilder.AppendLine("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
+ fileBuilder.AppendLine("<environment>");
+ fileBuilder.AppendLine(" <param>");
+ fileBuilder.AppendLine(" <name>DataSource</name>");
+ fileBuilder.AppendLine(string.Format(" <value>{0}</value>", connectInfo[0]));
+ fileBuilder.AppendLine(" </param>");
+ fileBuilder.AppendLine(" <param>");
+ fileBuilder.AppendLine(" <name>InitialCatalog</name>");
+ fileBuilder.AppendLine(string.Format(" <value>{0}</value>", connectInfo[1]));
+ fileBuilder.AppendLine(" </param>");
+ fileBuilder.AppendLine(" <param>");
+ fileBuilder.AppendLine(" <name>UserID</name>");
+ fileBuilder.AppendLine(string.Format(" <value>{0}</value>", connectInfo[2]));
+ fileBuilder.AppendLine(" </param>");
+ fileBuilder.AppendLine(" <param>");
+ fileBuilder.AppendLine(" <name>Password</name>");
+ fileBuilder.AppendLine(string.Format(" <value>{0}</value>", connectInfo[3]));
+ fileBuilder.AppendLine(" </param>");
+ fileBuilder.AppendLine("</environment>");
+ File.WriteAllText(configXmlPath, fileBuilder.ToString(), Encoding.UTF8);
+ }
+ catch
+ {
+ return;
+ }
+ }
+
+ Dictionary<string, string> dic = SysXmlMgr.GetNormalXml(configXmlPath);
+ dBServer = dic["DataSource"];
+ dBName = dic["InitialCatalog"];
+ dBUser = dic["UserID"];
+ dBPassWord = dic["Password"];
+ dic.Clear();
+ }
+ catch { }
+ }
+
+ /// <summary>
+ /// ���ѕW���̂w�l�k��ǂ�
+ /// </summary>
+ /// <param name="hvConfigXml">̧���߽</param>
+ /// <param name="hsKeyName">SystemStorage�̃L�[</param>
+ /// <returns>bool</returns>
+ public static bool GetNormalXml(object hvConfigXml, string hsKeyName)
+ {
+ Dictionary<string, string> config = new Dictionary<string, string>();
+ XmlDocument doc = new XmlDocument();
+ string itemName = string.Empty;
+ string itemValue = string.Empty;
+ try
+ {
+ if (hvConfigXml is Stream)
+ {
+ doc.Load((hvConfigXml as Stream));
+ }
+ else
+ {
+ doc.Load((hvConfigXml as string));
+ }
+ XmlNode rootnode = doc.DocumentElement;
+ foreach (XmlNode child in rootnode.ChildNodes)
+ {
+ if (child.NodeType == XmlNodeType.Element)
+ {
+ if (child.HasChildNodes)
+ {
+ foreach (XmlNode woItem in child.ChildNodes)
+ {
+ if (woItem.NodeType == XmlNodeType.Element)
+ {
+ if (woItem.Name == "name")
+ {
+ itemName = woItem.InnerText;
+ }
+ else if (woItem.Name == "value")
+ {
+ itemValue = woItem.InnerText;
+ }
+ }
+ }
+ config.Add(itemName, itemValue);
+ }
+ }
+ }
+ SystemStorage.Instance().SetItem(hsKeyName, config);
+ return true;
+ }
+ catch
+ {
+ return false;
+ }
+ }
+
+ }
+}
diff --git a/HotelPms.Share/Xml/SysXmlMgr.cs b/HotelPms.Share/Xml/SysXmlMgr.cs
new file mode 100644
index 0000000..f58c220
--- /dev/null
+++ b/HotelPms.Share/Xml/SysXmlMgr.cs
@@ -0,0 +1,223 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.IO;
+using System.Xml;
+using HotelPms.Share.IO;
+using HotelPms.Share.Util;
+
+namespace HotelPms.Share.Xml
+{
+ public class SysXmlMgr :IDisposable
+ {
+ /// ****************************** Description *******************************
+ /// ���V�X�e������
+ /// �@�ėp�N���X
+ /// ���T�v
+ /// �@XML�̑���F�lj��A�C���A�폜�A�����Ȃ�
+ /// <>�g�p���@
+ /// ������
+ /// �@2007/11/10 ���@���� �V�K�쐬
+ /// ****************************** Declarations ******************************
+ #region �����������@Declartions�@����������
+
+ private string fileName;
+ private Dictionary<string, string>? fileInfo;
+
+ #endregion
+
+ #region �����������@Property�@����������
+
+ public string FileName
+ {
+ get { return fileName; }
+ set { fileName = value; }
+ }
+
+ public Dictionary<string, string> FileInfo
+ {
+ get { return fileInfo; }
+ set { fileInfo = value; }
+ }
+
+ #endregion
+
+ #region �����������@Class Event�@����������
+
+ public SysXmlMgr()
+ : this("")
+ {
+ }
+
+ public SysXmlMgr(string fileName)
+ {
+ if (!fileName.Equals(""))
+ {
+ this.fileName = fileName;
+ }
+ if (!File.Exists(this.fileName))
+ {
+ fileInfo = new Dictionary<string, string>();
+ }
+ else
+ {
+ fileInfo = GetNormalXml(this.fileName);
+ }
+
+ }
+
+ #endregion
+
+ #region �����������@Private Function�@����������
+ #endregion
+
+ #region �����������@Public Function�@����������
+
+ public static Dictionary<string, string> GetNormalXml(object hvConfigXml)
+ {
+ Dictionary<string, string> config = new Dictionary<string, string>();
+ XmlDocument doc = new XmlDocument();
+ string itemName = string.Empty;
+ string itemValue = string.Empty;
+ try
+ {
+ if (hvConfigXml is Stream)
+ {
+ doc.Load((hvConfigXml as Stream));
+ }
+ else
+ {
+ doc.Load((hvConfigXml as string));
+ }
+ XmlNode rootnode = doc.DocumentElement;
+ foreach (XmlNode child in rootnode.ChildNodes)
+ {
+ if (child.NodeType == XmlNodeType.Element)
+ {
+ if (child.HasChildNodes)
+ {
+ foreach (XmlNode woItem in child.ChildNodes)
+ {
+ if (woItem.NodeType == XmlNodeType.Element)
+ {
+ if (woItem.Name == "name")
+ {
+ itemName = woItem.InnerText;
+ }
+ else if (woItem.Name == "value")
+ {
+ itemValue = woItem.InnerText;
+ }
+ }
+ }
+ config.Add(itemName, itemValue);
+ }
+ }
+ }
+ return config;
+ }
+ catch
+ {
+ return null;
+ }
+ }
+
+ public int GetInt(string name)
+ {
+ return CConvert.ToInt(GetItem(name));
+ }
+
+ public bool GetBool(string name)
+ {
+ return CConvert.ToBool(GetItem(name));
+ }
+
+ public string GetItem(string name)
+ {
+ if (fileInfo.ContainsKey(name))
+ {
+ return fileInfo[name];
+ }
+ else
+ {
+ return string.Empty;
+ }
+ }
+
+ public bool SetItem(string name, string value)
+ {
+ return SetItem(name, value, false);
+ }
+
+ public bool SetItem(string name, string value, bool forceAdd)
+ {
+ if (fileInfo.ContainsKey(name))
+ {
+ fileInfo[name] = value;
+ return true;
+ }
+ else
+ {
+ if (forceAdd)
+ {
+ Add(name, value);
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ }
+
+ public void Remove(string name)
+ {
+ fileInfo.Remove(name);
+ }
+
+ public void Add(string name,string value)
+ {
+ fileInfo.Add(name, value);
+ }
+
+ /// <summary>
+ /// �ۑ�����
+ /// </summary>
+ /// <returns></returns>
+ public bool Save()
+ {
+ try
+ {
+ StringBuilder fileBuilder = new StringBuilder();
+ fileBuilder.AppendLine("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
+ fileBuilder.AppendLine("<environment>");
+ foreach (string item in fileInfo.Keys)
+ {
+ fileBuilder.AppendLine(" <param>");
+ fileBuilder.AppendLine(" <name>" + item + "</name>");
+ fileBuilder.AppendLine(" <value>" + fileInfo[item] + "</value>");
+ fileBuilder.AppendLine(" </param>");
+ }
+ fileBuilder.AppendLine("</environment>");
+ FileOperation.Delete(fileName);
+ File.WriteAllText(fileName, fileBuilder.ToString(), Encoding.UTF8);
+ return true;
+ }
+ catch
+ {
+ return false;
+ }
+ }
+
+ public void ReLoad()
+ {
+ this.fileInfo = GetNormalXml(this.fileName);
+ }
+
+ public void Dispose()
+ {
+ }
+
+ #endregion
+ }
+}
diff --git a/HotelPms.Share/Xml/XmlOperation.cs b/HotelPms.Share/Xml/XmlOperation.cs
new file mode 100644
index 0000000..0b84e8c
--- /dev/null
+++ b/HotelPms.Share/Xml/XmlOperation.cs
@@ -0,0 +1,135 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+
+namespace HotelPms.Share.Xml
+{
+ public class XmlOperation
+ {
+ /// ****************************** Description *******************************
+ /// ���V�X�e������
+ /// �@�ėp�N���X
+ /// ���T�v
+ /// �@XML�̑���F�lj��A�C���A�폜�A�����Ȃ�
+ /// <>�g�p���@
+ /// ������
+ /// �@2007/11/10 ���@���� �V�K�쐬
+ /// ****************************** Declarations ******************************
+ #region �����������@Declartions�@����������
+
+ private string fileName;
+ private XmlDocument? xd;
+
+ #endregion
+
+ #region �����������@Property�@����������
+
+ public string FileName
+ {
+ get { return fileName; }
+ set { fileName = value; }
+ }
+
+ #endregion
+
+ #region �����������@Class Event�@����������
+
+ public XmlOperation()
+ : this("")
+ {
+ }
+
+ public XmlOperation(string fileName)
+ {
+ if (!fileName.Equals(""))
+ {
+ this.fileName = fileName;
+ }
+ xd = new XmlDocument();
+ xd.Load(this.fileName);
+ }
+
+ #endregion
+
+ #region �����������@Private Function�@����������
+ #endregion
+
+ #region �����������@Public Function�@����������
+
+ public XmlElement? AddNode(string parentXPath, string key, string value)
+ {
+ try
+ {
+ XmlElement ownerNode = (XmlElement)xd.SelectSingleNode(parentXPath);
+ XmlElement newNode = xd.CreateElement(key);
+ newNode.InnerText = value;
+ ownerNode.AppendChild(newNode);
+ return newNode;
+ }
+ catch
+ {
+ return null;
+ }
+ }
+
+ /// <summary>
+ /// Node��Text�̏C��
+ /// </summary>
+ /// <param name="xPath"></param>
+ /// <param name="value"></param>
+ /// <returns></returns>
+ public bool SetNodeText(string xPath,string value)
+ {
+ try
+ {
+ xd.SelectSingleNode(xPath).InnerText = value;
+ return true;
+ }
+ catch
+ {
+ return false;
+ }
+ }
+
+ /// <summary>
+ /// Node��Text���擾����
+ /// </summary>
+ /// <param name="xPath"></param>
+ /// <returns></returns>
+ public string GetNodeText(string xPath)
+ {
+ return xd.SelectSingleNode(xPath).InnerText;
+ }
+
+
+ /// <summary>
+ /// Node����
+ /// </summary>
+ /// <param name="xPath"></param>
+ /// <returns></returns>
+ public XmlNode? SelectSingleNode(string xPath)
+ {
+ return xd.SelectSingleNode(xPath);
+ }
+
+ /// <summary>
+ /// �ۑ�����
+ /// </summary>
+ /// <returns></returns>
+ public bool Save()
+ {
+ try
+ {
+ xd.Save(fileName);
+ return true;
+ }
+ catch
+ {
+ return false;
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/HotelPms.SourceFactory/BeanCreator.cs b/HotelPms.SourceFactory/BeanCreator.cs
new file mode 100644
index 0000000..59a8e28
--- /dev/null
+++ b/HotelPms.SourceFactory/BeanCreator.cs
@@ -0,0 +1,525 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Text;
+using System.IO;
+using System.Windows.Forms;
+using HotelPms.Share.Windows.Util;
+using HotelPms.Share.Util;
+using HotelPms.SourceFactory.Util;
+using HotelPms.Share.Data;
+using System.Diagnostics;
+
+namespace HotelPms.SourceFactory
+{
+ public partial class BeanCreator : FormBase
+ {
+ private MsSqlNet msSqlNet;
+
+ public BeanCreator()
+ {
+ InitializeComponent();
+ }
+
+ private void BeanCreator_Load(object sender, EventArgs e)
+ {
+ GeneralSub.InitDataGridView(dataGridView1, true);
+ GeneralSub.InitDataGridView(dataGridView2, true);
+ msSqlNet = EnvironmentSetting.Default.CreateDBAccess();
+ dataGridView1.DataSource = msSqlNet.GetTableList();
+ dataGridView2.ReadOnly = false;
+ dataGridView1.ColumnHeadersDefaultCellStyle.SelectionBackColor = SystemColors.Control;
+ dataGridView1.EnableHeadersVisualStyles = false;
+ dataGridView2.ColumnHeadersDefaultCellStyle.SelectionBackColor = SystemColors.Control;
+ dataGridView2.EnableHeadersVisualStyles = false;
+
+
+ foreach (DataGridViewRow row in dataGridView1.Rows)
+ {
+ System.Diagnostics.Debug.WriteLine(row.Cells[0].Value.ToString() + ",");
+ }
+ }
+
+ private void dataGridView1_SelectionChanged(object sender, EventArgs e)
+ {
+ if (dataGridView1.CurrentRow == null) { return; }
+ dataGridView2.DataSource = msSqlNet.GetFieldList(dataGridView1.CurrentRow.Cells[0].Value.ToString());
+ foreach (DataGridViewRow row in dataGridView2.Rows) { row.Cells["colFieldSel"].Value = true; }
+
+ txtTsBeanClassName.Text = dataGridView1.CurrentRow.Cells[0].Value.ToString().Substring(2);
+ txtTsBeanInterfaceName.Text = $"I{dataGridView1.CurrentRow.Cells[0].Value.ToString().Substring(2)}";
+ txtTsAccessClassName.Text = dataGridView1.CurrentRow.Cells[0].Value.ToString().Substring(2) + "Api";
+
+ string baseName = dataGridView1.CurrentRow.Cells[0].Value.ToString().Substring(2);
+ lblBlazorViewModel.Text = $"{baseName}.cs";
+ chkBlazorViewModel.Checked = false;
+
+ lblProtos.Text = $"{baseName.ToLower()}.proto";
+ chkProtos.Checked = false;
+
+ chkStartup.Checked = false;
+
+ lblServices.Text = $"{baseName}Service.cs";
+ chkServices.Checked = false;
+
+ lblClientAccess.Text = $"{baseName}Access.cs";
+ chkClientAccess.Checked = false;
+ lblClientDirectAccess.Text = $"{baseName}Access.cs";
+ chkClientDirectAccess.Checked = false;
+ lblClientMaster.Text = $"{baseName}.cs";
+ chkClientMaster.Checked = false;
+ lblClientTable.Text = $"{baseName}Table.cs";
+ chkClientTable.Checked = false;
+ lblClientUse.Text = $"{baseName}.cs";
+ chkClientUse.Checked = false;
+ }
+
+ public object GetField(string name)
+ {
+ if (name.ToLower() == "".ToLower()) { return name; }
+ else if (name.ToLower() == "".ToLower()) { return name; }
+ else { return string.Empty; }
+ }
+
+ public Dictionary<string, int> GetPrimaryKey()
+ {
+ Dictionary<string, int> dict = new Dictionary<string, int>();
+ dict.Add("", 0);
+ dict.Add("ddd", 1);
+ return dict;
+ }
+
+ private void button1_Click(object sender, EventArgs e)
+ {
+
+ }
+
+ private string ToProto3Type(string type)
+ {
+ if (type.ToLower() == "int") { return "int32"; }
+ else if (type.ToLower() == "bytestring") { return "bytes"; }
+ else if (type.ToLower() == "long") { return "int64"; }
+ else if (type.ToLower() == "datetime") { return "google.protobuf.Timestamp"; }
+ else { return type.ToLower(); }
+ }
+
+
+ private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
+ {
+
+ }
+
+ private void button2_Click(object sender, EventArgs e)
+ {
+// /// ****************************** Description *******************************
+// /// ���V�X�e������
+// /// �@PMS FrameWork 1.0
+// /// ���T�v
+// /// �@SPA��
+// /// ������
+// /// �@�}�X�^�f�[�^�̊�b
+// /// ****************************** Declarations ******************************
+// export default interface IMasterListRowBase
+// {
+// ID: number;
+// Name: string;
+//}
+
+
+ //����Ȋ���
+ // import MasterBase from './MasterBase';
+
+ // export default class Login extends MasterBase
+ // {
+ // public GroupID: number = 0;
+ // public Kana: string = '';
+ // public Password: string = '';
+ // public PWCreateDate: Date = new Date();
+ // public LanguageType: number = 0;
+ //}
+
+
+ DirectoryInfo dir = Directory.CreateDirectory(Application.StartupPath + Path.DirectorySeparatorChar + @"Work");
+
+ //�N���X
+ string[] items = new string[17];
+ items[0] = txtTsBeanClassName.Text;
+ items[1] = CConvert.ToDateString(DateTime.Now);
+ items[2] = txtTsBeanClassName.Text;
+ items[3] = string.Empty;
+
+ //�C���^�[�t�F�[�X
+ string[] accessItems = new string[11];
+ accessItems[0] = txtTsBeanInterfaceName.Text;
+ accessItems[1] = CConvert.ToDateString(DateTime.Now);
+ accessItems[2] = txtTsBeanInterfaceName.Text;
+ accessItems[3] = string.Empty;
+
+ int index = 0;
+ foreach (DataGridViewRow row in dataGridView2.Rows)
+ {
+ if (!CConvert.ToBool(row.Cells["colFieldSel"].Value)) { continue; }
+
+ string type = TypeScriptFactory.ToTsType(row.Cells["Type"].Value.ToString());
+ string name = row.Cells["Field"].Value.ToString();
+ if(name.ToUpper() == "ID" || name.ToUpper() == "NAME") { continue; }
+
+ if(index > 0)
+ {
+ items[3] += Environment.NewLine;
+ accessItems[3] += Environment.NewLine;
+ }
+
+ items[3] += $" public {name}: {type} = {TypeScriptFactory.GetDefValue(row.Cells["Type"].Value.ToString())};";
+ accessItems[3] += $" {name}: {type};";
+ index++;
+ }
+
+ string fileInfo = EnvironmentSetting.TsBeanFileMode;
+ for (int i = 0; i < items.Length; i++)
+ {
+ fileInfo = fileInfo.Replace("@" + i.ToString() + "@", items[i]);
+ }
+ if (!Directory.Exists(dir.FullName + Path.DirectorySeparatorChar + @"Ts\")) { Directory.CreateDirectory(dir.FullName + Path.DirectorySeparatorChar + @"Ts\"); }
+ File.WriteAllText(dir.FullName + Path.DirectorySeparatorChar + @"Ts\" + txtTsBeanClassName.Text + ".ts", fileInfo, Encoding.UTF8);
+
+ fileInfo = EnvironmentSetting.TsInterfaceFileMode;
+ for (int i = 0; i < accessItems.Length; i++)
+ {
+ fileInfo = fileInfo.Replace("@" + i.ToString() + "@", accessItems[i]);
+ }
+ if (!Directory.Exists(dir.FullName + Path.DirectorySeparatorChar + @"Ts\")) { Directory.CreateDirectory(dir.FullName + Path.DirectorySeparatorChar + @"Ts\"); }
+ File.WriteAllText(dir.FullName + Path.DirectorySeparatorChar + @"Ts\" + txtTsBeanInterfaceName.Text + ".ts", fileInfo, Encoding.UTF8);
+
+ MessageBox.Show("OK");
+
+ }
+
+ private void BeanCreator_FormClosed(object sender, FormClosedEventArgs e)
+ {
+ if (msSqlNet != null) { msSqlNet.Dispose(); }
+ }
+
+ private void btnCreate_Click(object sender, EventArgs e)
+ {
+ string tableName = dataGridView1.CurrentRow.Cells[0].Value.ToString();
+ string baseName = tableName.Substring(2);
+
+ string root = Path.Combine(Application.StartupPath, @"Work");
+ if (!Directory.Exists(root)) { Directory.CreateDirectory(root); }
+ string[] accessItems = new string[6];
+ accessItems[0] = baseName;
+ accessItems[1] = tableName;
+ accessItems[2] = ""; //2.int id,int id....
+ accessItems[3] = ""; //3.ID = {id}
+ accessItems[4] = "HotelPms.DataAccessGrpc.Client";
+ accessItems[5] = chkUseInfo.Checked ? "UseInfo" : "Master";
+
+ string[] beanItems = new string[15];
+ beanItems[0] = baseName; //�N���X
+ beanItems[1] = ""; //1.�v���C�}���[�L�[�ꗗ
+ beanItems[2] = ""; //2.CompareTo
+ beanItems[3] = ""; //3.CopyTo
+ beanItems[4] = ""; //4.Clear
+ beanItems[5] = ""; //5.ConvertDataRow�A
+ beanItems[6] = ""; //6.ToDataRow
+ beanItems[7] = ""; //7.AddSql
+ beanItems[8] = ""; //8.UpdateSql
+ beanItems[9] = ""; //9.ToText
+ beanItems[10] = ""; //10.GetField
+ beanItems[11] = "internal";
+ beanItems[12] = chkUseInfo.Checked ? "HotelPms.Data.UseInfo" : "HotelPms.Data.Master";
+ beanItems[13] = ""; //13.SetField
+ beanItems[14] = ""; //14.ConvertReader
+
+ string[] viewModelItems = new string[2];
+ viewModelItems[0] = baseName;
+ viewModelItems[1] = "";
+
+
+ string[] tableItems = new string[2];
+ tableItems[0] = "internal";
+ tableItems[1] = baseName;
+
+ string[] proto3Items = new string[5];
+ proto3Items[0] = baseName;
+ proto3Items[1] = "";
+ proto3Items[2] = "";
+ proto3Items[3] = chkUseInfo.Checked ? "UseInfo" : "Master";
+ proto3Items[4] = "";
+
+ string[] serviceItems = new string[3];
+ serviceItems[0] = baseName;
+ serviceItems[1] = tableName;
+ serviceItems[2] = chkUseInfo.Checked ? "UseInfo" : "Master";
+
+
+ string fieldList = string.Empty;
+ string indexList = string.Empty;
+ int addIndex = 0;
+ string ret = string.Empty;
+
+ string ret1 = string.Empty;
+ string fieldList1 = string.Empty;
+ int fieldCount = 0;
+ string whereList = string.Empty;
+ int whereCount = 0;
+ int uptIndex = 0;
+
+ int index = 0;
+ int pkCount = 0;
+ foreach (DataGridViewRow row in dataGridView2.Rows)
+ {
+ if (!CConvert.ToBool(row.Cells["colFieldSel"].Value)) { continue; }
+
+ string sqlType = row.Cells["Type"].Value.ToString();
+ string type = CommonFunc.ConvertToCsType(sqlType);
+ string name = row.Cells["Field"].Value.ToString();
+ string varName = $"p{name}";
+ string caption = row.Cells["Caption"].Value.ToString();
+ int maxLen = CConvert.ToInt(row.Cells["MaxLen"].Value);
+
+ if (CConvert.ToInt(row.Cells["PKFlg"].Value.ToString()) == 1)
+ {
+ beanItems[1] += $" PrimaryKey.TryAdd(\"{name}\", 0); " + Environment.NewLine;
+
+ //�����L�[
+ accessItems[2] += (accessItems[2].Length == 0 ? string.Empty : ",") + type + " " + varName;
+ accessItems[3] += (accessItems[3].Length == 0 ? string.Empty : " AND ") + name + " = " + CommonFunc.ToSqlValue(type, varName);
+ pkCount++;
+ }
+
+ beanItems[2] += (index == 0 ? "" : " || ");
+ beanItems[2] += $"{name}.CompareTo(item.{name}) != 0";
+ beanItems[2] += Environment.NewLine;
+
+ beanItems[3] += string.Format(" item.{0} = {0};" + Environment.NewLine, name);
+ beanItems[4] += string.Format(" {0} = {1};" + Environment.NewLine, name, CommonFunc.GetDefValue(sqlType));
+ beanItems[5] += CommonFunc.GetConvertDataRowCode(type, name);
+ beanItems[14] += CommonFunc.GetConvertReaderCode(sqlType, name);
+ beanItems[6] += $" row[\"{name}\"] = {CommonFunc.ToDataRow(type, name)};" + Environment.NewLine;
+ beanItems[9] += (" text.AppendFormat(\"" + name + "={0};\", " + name + ");" + Environment.NewLine);
+ beanItems[10] += (Environment.NewLine + $" {(index == 0 ? string.Empty : "else ")}if (name == \"{name}\")" + " { return " + name + "; }");
+ beanItems[13] += (Environment.NewLine + $" {(index == 0 ? string.Empty : "else ")}if (name == \"{name}\")" + " { " + CommonFunc.GetConvertValue(type, name) + "return true; }");
+
+ if (sqlType.ToLower() == "datetime" && proto3Items[2].Length == 0) { proto3Items[2] = "import \"google/protobuf/timestamp.proto\";"; }
+ if ((sqlType.ToLower() == "decimal" || sqlType.ToLower() == "date") && proto3Items[4].Length == 0) { proto3Items[4] = "import \"customTypes.proto\";"; }
+ proto3Items[1] += $" {CommonFunc.ToProto3Type(type)} {name} = {index + 1};{Environment.NewLine}";
+
+ viewModelItems[1] += (Environment.NewLine + " Add(new ValidField() { Name = \"" + name + "\", Caption = \"" + caption + "\", MaxLenth = " + maxLen.ToString() + ", InputChar = " + CommonFunc.ToInputChar(sqlType) + " });");
+
+ #region �lj�sql
+
+ if (name.Equals("UpdateDate"))
+ {
+ fieldList += ",UpdateDate";
+ indexList += ",GETDATE()";
+ }
+ else
+ {
+ if (addIndex > 0) { fieldList += ","; indexList += ","; ret += ","; }
+ fieldList += name;
+ indexList += CommonFunc.ToSqlValue(type, name);
+ addIndex++;
+ }
+
+
+ #endregion
+
+ #region �X�Vsql
+
+ if (name.Equals("UpdateDate"))
+ {
+ fieldList1 += ",UpdateDate = GETDATE()";
+ }
+ else
+ {
+ if (uptIndex > 0) { ret1 += ","; }
+
+ //�u����={index}�v�̎�
+ string item = name + " = ";
+ item += CommonFunc.ToSqlValue(type, name);
+
+ if (CConvert.ToInt(row.Cells["PKFlg"].Value.ToString()) == 1)
+ {
+ if (whereCount > 0) { whereList += " AND "; }
+ whereList += item;
+ whereCount++;
+ }
+ else
+ {
+ if (fieldCount > 0) { fieldList1 += ","; }
+ fieldList1 += item;
+ fieldCount++;
+ }
+ uptIndex++;
+ }
+
+ #endregion
+
+ index++;
+ }
+
+ beanItems[7] = " " + "return $@\"" + $"INSERT INTO {tableName}({fieldList}) VALUES({indexList});" + "\";";
+ beanItems[8] = " " + "return $@\"" + $"UPDATE {tableName} SET {fieldList1} WHERE {whereList};" + "\";";
+
+ #region Work���ꎞ�t�@�C���쐬
+
+ //HotelPms.Client.Blazor>>ViewModel
+ CreateCsFile(root + @"\HotelPms.Client.Blazor\ViewModel", EnvironmentSetting.ViewModel, viewModelItems, $"{baseName}.cs");
+
+ //Protos
+ CreateCsFile(root + @"\Protos", EnvironmentSetting.Proto3Master, proto3Items, $"{baseName.ToLower()}.proto");
+
+ //HotelPms.GrpcService>>Service
+ CreateCsFile(root + @"\HotelPms.GrpcService\Services", EnvironmentSetting.BeanFileMode_ProtoEx_Service, serviceItems, $"{baseName}Service.cs");
+
+ //HotelPms.DataAccessGrpc.Client
+ accessItems[4] = "HotelPms.DataAccessGrpc.Client";
+ CreateCsFile(root + @"\HotelPms.DataAccessGrpc.Client", EnvironmentSetting.DataAccessFileMode, accessItems, $"{baseName}Access.cs");
+
+ beanItems[11] = "public";
+ tableItems[0] = "public";
+ if (chkUseInfo.Checked)
+ {
+ //ProtosExpan>>UseInfo>>
+ CreateCsFile(root + @"\ProtosExpan\UseInfo", EnvironmentSetting.BeanFileMode, beanItems, $"{baseName}.cs");
+ }
+ else
+ {
+ //ProtosExpan>>Master>>
+ CreateCsFile(root + @"\ProtosExpan\Master", EnvironmentSetting.BeanFileMode, beanItems, $"{baseName}.cs");
+ CreateCsFile(root + @"\ProtosExpan\Master", EnvironmentSetting.BeanFileMode_ProtoEx_Table, tableItems, $"{baseName}Table.cs");
+ }
+
+ #endregion
+
+ if (!chkCopy.Checked)
+ {
+ CConvert.StartFile(root);
+ return;
+ }
+
+ #region Copy To Project
+
+ string projDir = @"\HotelPms.Client.Blazor\";
+ using (FileEdit.Core core = new FileEdit.Core())
+ {
+ FileEdit.Item item;
+ FileEdit.EditData edit;
+
+ //HotelPms.Client.Blazor>>ViewModel
+ File.Copy(root + @"\HotelPms.Client.Blazor\ViewModel\" + $"{baseName}.cs", txtSlnDir.Text + projDir + @"ViewModel\" + $"{baseName}.cs", true);
+ chkBlazorViewModel.Checked = true;
+
+ File.Copy(root + @"\Protos\" + $"{baseName.ToLower()}.proto", txtSlnDir.Text + @"\Protos\" + $"{baseName.ToLower()}.proto", true);
+ chkProtos.Checked = true;
+
+ //HotelPms.GrpcService>>Service
+ projDir = @"\HotelPms.GrpcService\";
+ edit = new FileEdit.EditData { FilePath = txtSlnDir.Text + $@"{projDir}Program.cs", Encoding = Encoding.UTF8 };
+ string line = $"app.MapGrpcService<{baseName}Service>().RequireCors(\"AllowAll\");";
+ if (!edit.Exists(line))
+ {
+ item = new FileEdit.Item { Key1 = "app.MapControllers()", Key2 = "app.MapGrpcService" };
+ item.Data.Add(line);
+ edit.Data.Add(item);
+ }
+ core.Execute(edit);
+ chkStartup.Checked = true;
+
+
+ File.Copy(root + @"\HotelPms.GrpcService\Services\" + $"{baseName}Service.cs", txtSlnDir.Text + projDir + @"Services\" + $"{baseName}Service.cs", true);
+ chkServices.Checked = true;
+
+ //HotelPms.DataAccessGrpc.Client
+ projDir = @"\HotelPms.DataAccessGrpc.Client\";
+
+ File.Copy(root + @"\HotelPms.DataAccessGrpc.Client\" + $"{baseName}Access.cs", txtSlnDir.Text + projDir + $"{baseName}Access.cs", true);
+ chkClientAccess.Checked = true;
+
+ edit = new FileEdit.EditData { FilePath = txtSlnDir.Text + $@"\HotelPms.Data.Client\HotelPms.Data.Client.csproj", Encoding = Encoding.UTF8 };
+ var edit2 = new FileEdit.EditData { FilePath = txtSlnDir.Text + $@"\HotelPms.Data.Server\HotelPms.Data.Server.csproj", Encoding = Encoding.UTF8 };
+
+ if (chkUseInfo.Checked)
+ {
+ //HotelPms.Data.Client>>UseInfo>>
+ File.Copy(root + @"\ProtosExpan\UseInfo\" + $"{baseName}.cs", txtSlnDir.Text + @"\ProtosExpan\UseInfo\" + $"{baseName}.cs", true);
+ chkClientUse.Checked = true;
+
+ //�N���C�A���g��
+ line = $" <Compile Include=\"..\\ProtosExpan\\UseInfo\\{baseName}.cs\" Link=\"ProtosExpan\\UseInfo\\{baseName}.cs\" />";
+ item = new FileEdit.Item { Key1 = "<ItemGroup>", Key2 = "<Compile Include=\"..\\ProtosExpan" };
+ item.Data.Add(line);
+ if (!edit.Exists(line)) { edit.Data.Add(item); }
+
+ //�T�[�o�[��
+ if (!edit2.Exists(line)) { edit2.Data.Add(item); }
+ }
+ else
+ {
+ //HotelPms.Data.Client>>Master>>
+ File.Copy(root + @"\ProtosExpan\Master\" + $"{baseName}.cs", txtSlnDir.Text + @"\ProtosExpan\Master\" + $"{baseName}.cs", true);
+ chkClientMaster.Checked = true;
+
+ //�N���C�A���g��
+ line = $" <Compile Include=\"..\\ProtosExpan\\Master\\{baseName}.cs\" Link=\"ProtosExpan\\Master\\{baseName}.cs\" />";
+ item = new FileEdit.Item { Key1 = "<ItemGroup>", Key2 = "<Compile Include=\"..\\ProtosExpan" };
+ item.Data.Add(line);
+ if (!edit.Exists(line)) { edit.Data.Add(item); }
+
+ //�T�[�o�[��
+ if (!edit2.Exists(line)) { edit2.Data.Add(item); }
+
+
+ #region ?????Table.cs
+
+ File.Copy(root + @"\ProtosExpan\Master\" + $"{baseName}Table.cs", txtSlnDir.Text + @"\ProtosExpan\Master\" + $"{baseName}Table.cs", true);
+ chkClientTable.Checked = true;
+
+ //�N���C�A���g���̂�
+ line = $" <Compile Include=\"..\\ProtosExpan\\Master\\{baseName}Table.cs\" Link=\"ProtosExpan\\Master\\{baseName}Table.cs\" />";
+ item = new FileEdit.Item { Key1 = "<ItemGroup>", Key2 = "<Compile Include=\"..\\ProtosExpan" };
+ item.Data.Add(line);
+ if(!edit.Exists(line)) { edit.Data.Add(item); }
+
+ #endregion
+ }
+
+ //�@HotelPms.Data.Client.csproj
+ line = $" <Protobuf Include=\"..\\Protos\\{baseName.ToLower()}.proto\" GrpcServices=\"Client\" Link=\"Protos\\{baseName.ToLower()}.proto\" />";
+ item = new FileEdit.Item { Key1 = "<ItemGroup>", Key2 = "<Protobuf" };
+ item.Data.Add(line);
+ if (!edit.Exists(line)) { edit.Data.Add(item); }
+ core.Execute(edit);
+ chkClient.Checked = true;
+
+ //HotelPms.Data.Server
+ line = $" <Protobuf Include=\"..\\Protos\\{baseName.ToLower()}.proto\" GrpcServices=\"Server\" Link=\"Protos\\{baseName.ToLower()}.proto\" />";
+ projDir = @"\HotelPms.Data.Server\";
+ item = new FileEdit.Item { Key1 = "<ItemGroup>", Key2 = "<Protobuf" };
+ item.Data.Add(line);
+ if (!edit2.Exists(line)) { edit2.Data.Add(item); }
+ core.Execute(edit2);
+ chkServer.Checked = true;
+ }
+
+ #endregion
+
+ MessageBox.Show("OK");
+ }
+
+ private void CreateCsFile(string root, string template, string[] items, string fileName)
+ {
+ if (!Directory.Exists(root)) { Directory.CreateDirectory(root); }
+ string fileInfo = template;
+ for (int i = 0; i < items.Length; i++)
+ {
+ fileInfo = fileInfo.Replace($"@{i}@", items[i]);
+ }
+ File.WriteAllText(root + Path.DirectorySeparatorChar + fileName, fileInfo, Encoding.UTF8);
+ }
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.SourceFactory/BeanCreator.designer.cs b/HotelPms.SourceFactory/BeanCreator.designer.cs
new file mode 100644
index 0000000..27bdb94
--- /dev/null
+++ b/HotelPms.SourceFactory/BeanCreator.designer.cs
@@ -0,0 +1,1018 @@
+namespace HotelPms.SourceFactory
+{
+ partial class BeanCreator
+ {
+ /// <summary>
+ /// 必要なデザイナ変数です。
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// 使用中のリソースをすべてクリーンアップします。
+ /// </summary>
+ /// <param name="disposing">マネージ リソースが破棄される場合 true、破棄されない場合は false です。</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows フォーム デザイナで生成されたコード
+
+ /// <summary>
+ /// デザイナ サポートに必要なメソッドです。このメソッドの内容を
+ /// コード エディタで変更しないでください。
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.panel1 = new System.Windows.Forms.Panel();
+ this.dataGridView2 = new System.Windows.Forms.DataGridView();
+ this.colFieldSel = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+ this.panel2 = new System.Windows.Forms.Panel();
+ this.tabControl1 = new System.Windows.Forms.TabControl();
+ this.tabPage1 = new System.Windows.Forms.TabPage();
+ this.groupBox5 = new System.Windows.Forms.GroupBox();
+ this.label1 = new System.Windows.Forms.Label();
+ this.chkCopy = new System.Windows.Forms.CheckBox();
+ this.label10 = new System.Windows.Forms.Label();
+ this.txtSlnDir = new System.Windows.Forms.TextBox();
+ this.chkUseInfo = new System.Windows.Forms.CheckBox();
+ this.pnlServices = new System.Windows.Forms.Panel();
+ this.lblServices = new System.Windows.Forms.Label();
+ this.chkServices = new System.Windows.Forms.CheckBox();
+ this.label36 = new System.Windows.Forms.Label();
+ this.pnlStartup = new System.Windows.Forms.Panel();
+ this.lblStartup = new System.Windows.Forms.Label();
+ this.chkStartup = new System.Windows.Forms.CheckBox();
+ this.label33 = new System.Windows.Forms.Label();
+ this.btnCreate = new System.Windows.Forms.Button();
+ this.chkServer = new System.Windows.Forms.CheckBox();
+ this.label35 = new System.Windows.Forms.Label();
+ this.pnlClientUse = new System.Windows.Forms.Panel();
+ this.lblClientUse = new System.Windows.Forms.Label();
+ this.chkClientUse = new System.Windows.Forms.CheckBox();
+ this.label22 = new System.Windows.Forms.Label();
+ this.chkClient = new System.Windows.Forms.CheckBox();
+ this.pnlClientTable = new System.Windows.Forms.Panel();
+ this.lblClientTable = new System.Windows.Forms.Label();
+ this.chkClientTable = new System.Windows.Forms.CheckBox();
+ this.pnlClientMaster = new System.Windows.Forms.Panel();
+ this.lblClientMaster = new System.Windows.Forms.Label();
+ this.chkClientMaster = new System.Windows.Forms.CheckBox();
+ this.label25 = new System.Windows.Forms.Label();
+ this.pnlClientAccess = new System.Windows.Forms.Panel();
+ this.lblClientAccess = new System.Windows.Forms.Label();
+ this.chkClientAccess = new System.Windows.Forms.CheckBox();
+ this.label28 = new System.Windows.Forms.Label();
+ this.pnlBlazorViewModel = new System.Windows.Forms.Panel();
+ this.lblBlazorViewModel = new System.Windows.Forms.Label();
+ this.chkBlazorViewModel = new System.Windows.Forms.CheckBox();
+ this.label19 = new System.Windows.Forms.Label();
+ this.chkBlazor = new System.Windows.Forms.CheckBox();
+ this.pnlProtos = new System.Windows.Forms.Panel();
+ this.lblProtos = new System.Windows.Forms.Label();
+ this.chkProtos = new System.Windows.Forms.CheckBox();
+ this.label14 = new System.Windows.Forms.Label();
+ this.label8 = new System.Windows.Forms.Label();
+ this.tabPage2 = new System.Windows.Forms.TabPage();
+ this.button2 = new System.Windows.Forms.Button();
+ this.groupBox4 = new System.Windows.Forms.GroupBox();
+ this.txtTsAccessClassName = new System.Windows.Forms.TextBox();
+ this.label7 = new System.Windows.Forms.Label();
+ this.groupBox3 = new System.Windows.Forms.GroupBox();
+ this.label5 = new System.Windows.Forms.Label();
+ this.txtTsBeanInterfaceName = new System.Windows.Forms.TextBox();
+ this.label6 = new System.Windows.Forms.Label();
+ this.txtTsBeanClassName = new System.Windows.Forms.TextBox();
+ this.splitter1 = new System.Windows.Forms.Splitter();
+ this.dataGridView1 = new System.Windows.Forms.DataGridView();
+ this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.chkClientDirect = new System.Windows.Forms.CheckBox();
+ this.pnlClientDirectAccess = new System.Windows.Forms.Panel();
+ this.lblClientDirectAccess = new System.Windows.Forms.Label();
+ this.chkClientDirectAccess = new System.Windows.Forms.CheckBox();
+ this.label4 = new System.Windows.Forms.Label();
+ this.pnlMain.SuspendLayout();
+ this.panel1.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).BeginInit();
+ this.panel2.SuspendLayout();
+ this.tabControl1.SuspendLayout();
+ this.tabPage1.SuspendLayout();
+ this.groupBox5.SuspendLayout();
+ this.pnlServices.SuspendLayout();
+ this.pnlStartup.SuspendLayout();
+ this.pnlClientUse.SuspendLayout();
+ this.pnlClientTable.SuspendLayout();
+ this.pnlClientMaster.SuspendLayout();
+ this.pnlClientAccess.SuspendLayout();
+ this.pnlBlazorViewModel.SuspendLayout();
+ this.pnlProtos.SuspendLayout();
+ this.tabPage2.SuspendLayout();
+ this.groupBox4.SuspendLayout();
+ this.groupBox3.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
+ this.pnlClientDirectAccess.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // pnlMain
+ //
+ this.pnlMain.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(43)))), ((int)(((byte)(43)))), ((int)(((byte)(43)))));
+ this.pnlMain.Controls.Add(this.dataGridView1);
+ this.pnlMain.Controls.Add(this.splitter1);
+ this.pnlMain.Controls.Add(this.panel1);
+ this.pnlMain.Padding = new System.Windows.Forms.Padding(5);
+ this.pnlMain.Size = new System.Drawing.Size(1198, 619);
+ //
+ // LoadingObj
+ //
+ this.LoadingObj.Size = new System.Drawing.Size(1198, 619);
+ //
+ // panel1
+ //
+ this.panel1.Controls.Add(this.dataGridView2);
+ this.panel1.Controls.Add(this.panel2);
+ this.panel1.Dock = System.Windows.Forms.DockStyle.Right;
+ this.panel1.Location = new System.Drawing.Point(161, 5);
+ this.panel1.Margin = new System.Windows.Forms.Padding(4);
+ this.panel1.Name = "panel1";
+ this.panel1.Size = new System.Drawing.Size(1032, 609);
+ this.panel1.TabIndex = 0;
+ //
+ // dataGridView2
+ //
+ this.dataGridView2.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+ this.dataGridView2.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
+ this.colFieldSel});
+ this.dataGridView2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.dataGridView2.Location = new System.Drawing.Point(0, 0);
+ this.dataGridView2.Margin = new System.Windows.Forms.Padding(4);
+ this.dataGridView2.Name = "dataGridView2";
+ this.dataGridView2.RowTemplate.Height = 21;
+ this.dataGridView2.Size = new System.Drawing.Size(1032, 221);
+ this.dataGridView2.TabIndex = 1;
+ //
+ // colFieldSel
+ //
+ this.colFieldSel.HeaderText = "選択";
+ this.colFieldSel.Name = "colFieldSel";
+ this.colFieldSel.Width = 50;
+ //
+ // panel2
+ //
+ this.panel2.Controls.Add(this.tabControl1);
+ this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.panel2.Location = new System.Drawing.Point(0, 221);
+ this.panel2.Margin = new System.Windows.Forms.Padding(4);
+ this.panel2.Name = "panel2";
+ this.panel2.Size = new System.Drawing.Size(1032, 388);
+ this.panel2.TabIndex = 0;
+ //
+ // tabControl1
+ //
+ this.tabControl1.Controls.Add(this.tabPage1);
+ this.tabControl1.Controls.Add(this.tabPage2);
+ this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tabControl1.Location = new System.Drawing.Point(0, 0);
+ this.tabControl1.Margin = new System.Windows.Forms.Padding(4);
+ this.tabControl1.Name = "tabControl1";
+ this.tabControl1.SelectedIndex = 0;
+ this.tabControl1.Size = new System.Drawing.Size(1032, 388);
+ this.tabControl1.TabIndex = 11;
+ //
+ // tabPage1
+ //
+ this.tabPage1.Controls.Add(this.groupBox5);
+ this.tabPage1.Location = new System.Drawing.Point(4, 24);
+ this.tabPage1.Margin = new System.Windows.Forms.Padding(4);
+ this.tabPage1.Name = "tabPage1";
+ this.tabPage1.Padding = new System.Windows.Forms.Padding(4);
+ this.tabPage1.Size = new System.Drawing.Size(1024, 360);
+ this.tabPage1.TabIndex = 0;
+ this.tabPage1.Text = "Net6";
+ this.tabPage1.UseVisualStyleBackColor = true;
+ //
+ // groupBox5
+ //
+ this.groupBox5.Controls.Add(this.chkClientDirect);
+ this.groupBox5.Controls.Add(this.pnlClientDirectAccess);
+ this.groupBox5.Controls.Add(this.label4);
+ this.groupBox5.Controls.Add(this.label1);
+ this.groupBox5.Controls.Add(this.chkCopy);
+ this.groupBox5.Controls.Add(this.label10);
+ this.groupBox5.Controls.Add(this.txtSlnDir);
+ this.groupBox5.Controls.Add(this.chkUseInfo);
+ this.groupBox5.Controls.Add(this.pnlServices);
+ this.groupBox5.Controls.Add(this.label36);
+ this.groupBox5.Controls.Add(this.pnlStartup);
+ this.groupBox5.Controls.Add(this.label33);
+ this.groupBox5.Controls.Add(this.btnCreate);
+ this.groupBox5.Controls.Add(this.chkServer);
+ this.groupBox5.Controls.Add(this.label35);
+ this.groupBox5.Controls.Add(this.pnlClientUse);
+ this.groupBox5.Controls.Add(this.label22);
+ this.groupBox5.Controls.Add(this.chkClient);
+ this.groupBox5.Controls.Add(this.pnlClientTable);
+ this.groupBox5.Controls.Add(this.pnlClientMaster);
+ this.groupBox5.Controls.Add(this.label25);
+ this.groupBox5.Controls.Add(this.pnlClientAccess);
+ this.groupBox5.Controls.Add(this.label28);
+ this.groupBox5.Controls.Add(this.pnlBlazorViewModel);
+ this.groupBox5.Controls.Add(this.label19);
+ this.groupBox5.Controls.Add(this.chkBlazor);
+ this.groupBox5.Controls.Add(this.pnlProtos);
+ this.groupBox5.Controls.Add(this.label14);
+ this.groupBox5.Controls.Add(this.label8);
+ this.groupBox5.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.groupBox5.Location = new System.Drawing.Point(4, 4);
+ this.groupBox5.Name = "groupBox5";
+ this.groupBox5.Size = new System.Drawing.Size(1016, 352);
+ this.groupBox5.TabIndex = 13;
+ this.groupBox5.TabStop = false;
+ this.groupBox5.Text = "進捗";
+ //
+ // label1
+ //
+ this.label1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
+ this.label1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.label1.ForeColor = System.Drawing.Color.White;
+ this.label1.Location = new System.Drawing.Point(317, 19);
+ this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(140, 21);
+ this.label1.TabIndex = 42;
+ this.label1.Text = "ProtosExpan";
+ this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // chkCopy
+ //
+ this.chkCopy.AutoSize = true;
+ this.chkCopy.Checked = true;
+ this.chkCopy.CheckState = System.Windows.Forms.CheckState.Checked;
+ this.chkCopy.Location = new System.Drawing.Point(140, 305);
+ this.chkCopy.Margin = new System.Windows.Forms.Padding(4);
+ this.chkCopy.Name = "chkCopy";
+ this.chkCopy.Size = new System.Drawing.Size(77, 19);
+ this.chkCopy.TabIndex = 41;
+ this.chkCopy.Text = "Slnへコピー";
+ this.chkCopy.UseVisualStyleBackColor = true;
+ //
+ // label10
+ //
+ this.label10.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(0)))), ((int)(((byte)(64)))));
+ this.label10.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.label10.ForeColor = System.Drawing.Color.White;
+ this.label10.Location = new System.Drawing.Point(19, 272);
+ this.label10.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.label10.Name = "label10";
+ this.label10.Size = new System.Drawing.Size(128, 23);
+ this.label10.TabIndex = 40;
+ this.label10.Text = "ソリューションフォルダー";
+ this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // txtSlnDir
+ //
+ this.txtSlnDir.Location = new System.Drawing.Point(146, 272);
+ this.txtSlnDir.Name = "txtSlnDir";
+ this.txtSlnDir.Size = new System.Drawing.Size(216, 23);
+ this.txtSlnDir.TabIndex = 39;
+ this.txtSlnDir.Text = "D:\\Pms\\HotelPms";
+ //
+ // chkUseInfo
+ //
+ this.chkUseInfo.AutoSize = true;
+ this.chkUseInfo.Location = new System.Drawing.Point(19, 305);
+ this.chkUseInfo.Margin = new System.Windows.Forms.Padding(4);
+ this.chkUseInfo.Name = "chkUseInfo";
+ this.chkUseInfo.Size = new System.Drawing.Size(76, 19);
+ this.chkUseInfo.TabIndex = 38;
+ this.chkUseInfo.Text = "利用データ";
+ this.chkUseInfo.UseVisualStyleBackColor = true;
+ //
+ // pnlServices
+ //
+ this.pnlServices.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.pnlServices.Controls.Add(this.lblServices);
+ this.pnlServices.Controls.Add(this.chkServices);
+ this.pnlServices.Location = new System.Drawing.Point(64, 215);
+ this.pnlServices.Name = "pnlServices";
+ this.pnlServices.Padding = new System.Windows.Forms.Padding(0, 0, 10, 0);
+ this.pnlServices.Size = new System.Drawing.Size(163, 23);
+ this.pnlServices.TabIndex = 37;
+ //
+ // lblServices
+ //
+ this.lblServices.BackColor = System.Drawing.Color.White;
+ this.lblServices.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.lblServices.ForeColor = System.Drawing.Color.Black;
+ this.lblServices.Location = new System.Drawing.Point(0, 0);
+ this.lblServices.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.lblServices.Name = "lblServices";
+ this.lblServices.Size = new System.Drawing.Size(136, 21);
+ this.lblServices.TabIndex = 4;
+ this.lblServices.Text = "BuildingService.cs";
+ this.lblServices.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // chkServices
+ //
+ this.chkServices.Dock = System.Windows.Forms.DockStyle.Right;
+ this.chkServices.Location = new System.Drawing.Point(136, 0);
+ this.chkServices.Name = "chkServices";
+ this.chkServices.Size = new System.Drawing.Size(15, 21);
+ this.chkServices.TabIndex = 0;
+ this.chkServices.UseVisualStyleBackColor = true;
+ //
+ // label36
+ //
+ this.label36.BackColor = System.Drawing.Color.Khaki;
+ this.label36.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.label36.ForeColor = System.Drawing.Color.Black;
+ this.label36.Location = new System.Drawing.Point(43, 193);
+ this.label36.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.label36.Name = "label36";
+ this.label36.Size = new System.Drawing.Size(100, 20);
+ this.label36.TabIndex = 36;
+ this.label36.Text = "Services";
+ this.label36.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // pnlStartup
+ //
+ this.pnlStartup.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.pnlStartup.Controls.Add(this.lblStartup);
+ this.pnlStartup.Controls.Add(this.chkStartup);
+ this.pnlStartup.Location = new System.Drawing.Point(65, 168);
+ this.pnlStartup.Name = "pnlStartup";
+ this.pnlStartup.Padding = new System.Windows.Forms.Padding(0, 0, 10, 0);
+ this.pnlStartup.Size = new System.Drawing.Size(163, 23);
+ this.pnlStartup.TabIndex = 34;
+ //
+ // lblStartup
+ //
+ this.lblStartup.BackColor = System.Drawing.Color.White;
+ this.lblStartup.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.lblStartup.ForeColor = System.Drawing.Color.Black;
+ this.lblStartup.Location = new System.Drawing.Point(0, 0);
+ this.lblStartup.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.lblStartup.Name = "lblStartup";
+ this.lblStartup.Size = new System.Drawing.Size(136, 21);
+ this.lblStartup.TabIndex = 4;
+ this.lblStartup.Text = "Program.cs";
+ this.lblStartup.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // chkStartup
+ //
+ this.chkStartup.Dock = System.Windows.Forms.DockStyle.Right;
+ this.chkStartup.Location = new System.Drawing.Point(136, 0);
+ this.chkStartup.Name = "chkStartup";
+ this.chkStartup.Size = new System.Drawing.Size(15, 21);
+ this.chkStartup.TabIndex = 0;
+ this.chkStartup.UseVisualStyleBackColor = true;
+ //
+ // label33
+ //
+ this.label33.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
+ this.label33.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.label33.ForeColor = System.Drawing.Color.White;
+ this.label33.Location = new System.Drawing.Point(19, 145);
+ this.label33.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.label33.Name = "label33";
+ this.label33.Size = new System.Drawing.Size(140, 21);
+ this.label33.TabIndex = 35;
+ this.label33.Text = "HotelPms.GrpcService";
+ this.label33.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // btnCreate
+ //
+ this.btnCreate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.btnCreate.Location = new System.Drawing.Point(251, 302);
+ this.btnCreate.Margin = new System.Windows.Forms.Padding(4);
+ this.btnCreate.Name = "btnCreate";
+ this.btnCreate.Size = new System.Drawing.Size(111, 35);
+ this.btnCreate.TabIndex = 2;
+ this.btnCreate.Text = "生成";
+ this.btnCreate.UseVisualStyleBackColor = true;
+ this.btnCreate.Click += new System.EventHandler(this.btnCreate_Click);
+ //
+ // chkServer
+ //
+ this.chkServer.Location = new System.Drawing.Point(796, 16);
+ this.chkServer.Name = "chkServer";
+ this.chkServer.Size = new System.Drawing.Size(115, 26);
+ this.chkServer.TabIndex = 31;
+ this.chkServer.Text = "更新";
+ this.chkServer.UseVisualStyleBackColor = true;
+ //
+ // label35
+ //
+ this.label35.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
+ this.label35.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.label35.ForeColor = System.Drawing.Color.White;
+ this.label35.Location = new System.Drawing.Point(649, 19);
+ this.label35.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.label35.Name = "label35";
+ this.label35.Size = new System.Drawing.Size(140, 21);
+ this.label35.TabIndex = 25;
+ this.label35.Text = "HotelPms.Data.Server";
+ this.label35.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // pnlClientUse
+ //
+ this.pnlClientUse.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.pnlClientUse.Controls.Add(this.lblClientUse);
+ this.pnlClientUse.Controls.Add(this.chkClientUse);
+ this.pnlClientUse.Location = new System.Drawing.Point(355, 135);
+ this.pnlClientUse.Name = "pnlClientUse";
+ this.pnlClientUse.Padding = new System.Windows.Forms.Padding(0, 0, 10, 0);
+ this.pnlClientUse.Size = new System.Drawing.Size(163, 23);
+ this.pnlClientUse.TabIndex = 24;
+ //
+ // lblClientUse
+ //
+ this.lblClientUse.BackColor = System.Drawing.Color.White;
+ this.lblClientUse.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.lblClientUse.ForeColor = System.Drawing.Color.Black;
+ this.lblClientUse.Location = new System.Drawing.Point(0, 0);
+ this.lblClientUse.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.lblClientUse.Name = "lblClientUse";
+ this.lblClientUse.Size = new System.Drawing.Size(136, 21);
+ this.lblClientUse.TabIndex = 4;
+ this.lblClientUse.Text = "Building.cs";
+ this.lblClientUse.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // chkClientUse
+ //
+ this.chkClientUse.Dock = System.Windows.Forms.DockStyle.Right;
+ this.chkClientUse.Location = new System.Drawing.Point(136, 0);
+ this.chkClientUse.Name = "chkClientUse";
+ this.chkClientUse.Size = new System.Drawing.Size(15, 21);
+ this.chkClientUse.TabIndex = 0;
+ this.chkClientUse.UseVisualStyleBackColor = true;
+ //
+ // label22
+ //
+ this.label22.BackColor = System.Drawing.Color.Khaki;
+ this.label22.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.label22.ForeColor = System.Drawing.Color.Black;
+ this.label22.Location = new System.Drawing.Point(334, 113);
+ this.label22.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.label22.Name = "label22";
+ this.label22.Size = new System.Drawing.Size(100, 20);
+ this.label22.TabIndex = 23;
+ this.label22.Text = "UseInfo";
+ this.label22.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // chkClient
+ //
+ this.chkClient.Location = new System.Drawing.Point(546, 159);
+ this.chkClient.Name = "chkClient";
+ this.chkClient.Size = new System.Drawing.Size(115, 26);
+ this.chkClient.TabIndex = 22;
+ this.chkClient.Text = "更新";
+ this.chkClient.UseVisualStyleBackColor = true;
+ //
+ // pnlClientTable
+ //
+ this.pnlClientTable.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.pnlClientTable.Controls.Add(this.lblClientTable);
+ this.pnlClientTable.Controls.Add(this.chkClientTable);
+ this.pnlClientTable.Location = new System.Drawing.Point(355, 88);
+ this.pnlClientTable.Name = "pnlClientTable";
+ this.pnlClientTable.Padding = new System.Windows.Forms.Padding(0, 0, 10, 0);
+ this.pnlClientTable.Size = new System.Drawing.Size(163, 23);
+ this.pnlClientTable.TabIndex = 21;
+ //
+ // lblClientTable
+ //
+ this.lblClientTable.BackColor = System.Drawing.Color.White;
+ this.lblClientTable.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.lblClientTable.ForeColor = System.Drawing.Color.Black;
+ this.lblClientTable.Location = new System.Drawing.Point(0, 0);
+ this.lblClientTable.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.lblClientTable.Name = "lblClientTable";
+ this.lblClientTable.Size = new System.Drawing.Size(136, 21);
+ this.lblClientTable.TabIndex = 4;
+ this.lblClientTable.Text = "BuildingTable.cs";
+ this.lblClientTable.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // chkClientTable
+ //
+ this.chkClientTable.Dock = System.Windows.Forms.DockStyle.Right;
+ this.chkClientTable.Location = new System.Drawing.Point(136, 0);
+ this.chkClientTable.Name = "chkClientTable";
+ this.chkClientTable.Size = new System.Drawing.Size(15, 21);
+ this.chkClientTable.TabIndex = 0;
+ this.chkClientTable.UseVisualStyleBackColor = true;
+ //
+ // pnlClientMaster
+ //
+ this.pnlClientMaster.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.pnlClientMaster.Controls.Add(this.lblClientMaster);
+ this.pnlClientMaster.Controls.Add(this.chkClientMaster);
+ this.pnlClientMaster.Location = new System.Drawing.Point(355, 63);
+ this.pnlClientMaster.Name = "pnlClientMaster";
+ this.pnlClientMaster.Padding = new System.Windows.Forms.Padding(0, 0, 10, 0);
+ this.pnlClientMaster.Size = new System.Drawing.Size(163, 23);
+ this.pnlClientMaster.TabIndex = 20;
+ //
+ // lblClientMaster
+ //
+ this.lblClientMaster.BackColor = System.Drawing.Color.White;
+ this.lblClientMaster.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.lblClientMaster.ForeColor = System.Drawing.Color.Black;
+ this.lblClientMaster.Location = new System.Drawing.Point(0, 0);
+ this.lblClientMaster.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.lblClientMaster.Name = "lblClientMaster";
+ this.lblClientMaster.Size = new System.Drawing.Size(136, 21);
+ this.lblClientMaster.TabIndex = 4;
+ this.lblClientMaster.Text = "Building.cs";
+ this.lblClientMaster.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // chkClientMaster
+ //
+ this.chkClientMaster.Dock = System.Windows.Forms.DockStyle.Right;
+ this.chkClientMaster.Location = new System.Drawing.Point(136, 0);
+ this.chkClientMaster.Name = "chkClientMaster";
+ this.chkClientMaster.Size = new System.Drawing.Size(15, 21);
+ this.chkClientMaster.TabIndex = 0;
+ this.chkClientMaster.UseVisualStyleBackColor = true;
+ //
+ // label25
+ //
+ this.label25.BackColor = System.Drawing.Color.Khaki;
+ this.label25.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.label25.ForeColor = System.Drawing.Color.Black;
+ this.label25.Location = new System.Drawing.Point(334, 41);
+ this.label25.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.label25.Name = "label25";
+ this.label25.Size = new System.Drawing.Size(100, 20);
+ this.label25.TabIndex = 19;
+ this.label25.Text = "Master";
+ this.label25.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // pnlClientAccess
+ //
+ this.pnlClientAccess.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.pnlClientAccess.Controls.Add(this.lblClientAccess);
+ this.pnlClientAccess.Controls.Add(this.chkClientAccess);
+ this.pnlClientAccess.Location = new System.Drawing.Point(356, 185);
+ this.pnlClientAccess.Name = "pnlClientAccess";
+ this.pnlClientAccess.Padding = new System.Windows.Forms.Padding(0, 0, 10, 0);
+ this.pnlClientAccess.Size = new System.Drawing.Size(163, 23);
+ this.pnlClientAccess.TabIndex = 18;
+ //
+ // lblClientAccess
+ //
+ this.lblClientAccess.BackColor = System.Drawing.Color.White;
+ this.lblClientAccess.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.lblClientAccess.ForeColor = System.Drawing.Color.Black;
+ this.lblClientAccess.Location = new System.Drawing.Point(0, 0);
+ this.lblClientAccess.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.lblClientAccess.Name = "lblClientAccess";
+ this.lblClientAccess.Size = new System.Drawing.Size(136, 21);
+ this.lblClientAccess.TabIndex = 4;
+ this.lblClientAccess.Text = "BuildingAccess.cs";
+ this.lblClientAccess.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // chkClientAccess
+ //
+ this.chkClientAccess.Dock = System.Windows.Forms.DockStyle.Right;
+ this.chkClientAccess.Location = new System.Drawing.Point(136, 0);
+ this.chkClientAccess.Name = "chkClientAccess";
+ this.chkClientAccess.Size = new System.Drawing.Size(15, 21);
+ this.chkClientAccess.TabIndex = 0;
+ this.chkClientAccess.UseVisualStyleBackColor = true;
+ //
+ // label28
+ //
+ this.label28.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
+ this.label28.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.label28.ForeColor = System.Drawing.Color.White;
+ this.label28.Location = new System.Drawing.Point(317, 161);
+ this.label28.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.label28.Name = "label28";
+ this.label28.Size = new System.Drawing.Size(218, 21);
+ this.label28.TabIndex = 16;
+ this.label28.Text = "HotelPms.DataAccessGrpc.Client";
+ this.label28.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // pnlBlazorViewModel
+ //
+ this.pnlBlazorViewModel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.pnlBlazorViewModel.Controls.Add(this.lblBlazorViewModel);
+ this.pnlBlazorViewModel.Controls.Add(this.chkBlazorViewModel);
+ this.pnlBlazorViewModel.Location = new System.Drawing.Point(64, 63);
+ this.pnlBlazorViewModel.Name = "pnlBlazorViewModel";
+ this.pnlBlazorViewModel.Padding = new System.Windows.Forms.Padding(0, 0, 10, 0);
+ this.pnlBlazorViewModel.Size = new System.Drawing.Size(163, 23);
+ this.pnlBlazorViewModel.TabIndex = 13;
+ //
+ // lblBlazorViewModel
+ //
+ this.lblBlazorViewModel.BackColor = System.Drawing.Color.White;
+ this.lblBlazorViewModel.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.lblBlazorViewModel.ForeColor = System.Drawing.Color.Black;
+ this.lblBlazorViewModel.Location = new System.Drawing.Point(0, 0);
+ this.lblBlazorViewModel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.lblBlazorViewModel.Name = "lblBlazorViewModel";
+ this.lblBlazorViewModel.Size = new System.Drawing.Size(136, 21);
+ this.lblBlazorViewModel.TabIndex = 4;
+ this.lblBlazorViewModel.Text = "Building.cs";
+ this.lblBlazorViewModel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // chkBlazorViewModel
+ //
+ this.chkBlazorViewModel.Dock = System.Windows.Forms.DockStyle.Right;
+ this.chkBlazorViewModel.Location = new System.Drawing.Point(136, 0);
+ this.chkBlazorViewModel.Name = "chkBlazorViewModel";
+ this.chkBlazorViewModel.Size = new System.Drawing.Size(15, 21);
+ this.chkBlazorViewModel.TabIndex = 0;
+ this.chkBlazorViewModel.UseVisualStyleBackColor = true;
+ //
+ // label19
+ //
+ this.label19.BackColor = System.Drawing.Color.Khaki;
+ this.label19.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.label19.ForeColor = System.Drawing.Color.Black;
+ this.label19.Location = new System.Drawing.Point(43, 41);
+ this.label19.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.label19.Name = "label19";
+ this.label19.Size = new System.Drawing.Size(100, 20);
+ this.label19.TabIndex = 12;
+ this.label19.Text = "ViewModel";
+ this.label19.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // chkBlazor
+ //
+ this.chkBlazor.Location = new System.Drawing.Point(164, 16);
+ this.chkBlazor.Name = "chkBlazor";
+ this.chkBlazor.Size = new System.Drawing.Size(114, 26);
+ this.chkBlazor.TabIndex = 9;
+ this.chkBlazor.Text = "更新";
+ this.chkBlazor.UseVisualStyleBackColor = true;
+ //
+ // pnlProtos
+ //
+ this.pnlProtos.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.pnlProtos.Controls.Add(this.lblProtos);
+ this.pnlProtos.Controls.Add(this.chkProtos);
+ this.pnlProtos.Location = new System.Drawing.Point(65, 115);
+ this.pnlProtos.Name = "pnlProtos";
+ this.pnlProtos.Padding = new System.Windows.Forms.Padding(0, 0, 10, 0);
+ this.pnlProtos.Size = new System.Drawing.Size(163, 23);
+ this.pnlProtos.TabIndex = 5;
+ //
+ // lblProtos
+ //
+ this.lblProtos.BackColor = System.Drawing.Color.White;
+ this.lblProtos.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.lblProtos.ForeColor = System.Drawing.Color.Black;
+ this.lblProtos.Location = new System.Drawing.Point(0, 0);
+ this.lblProtos.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.lblProtos.Name = "lblProtos";
+ this.lblProtos.Size = new System.Drawing.Size(136, 21);
+ this.lblProtos.TabIndex = 4;
+ this.lblProtos.Text = "building.proto";
+ this.lblProtos.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // chkProtos
+ //
+ this.chkProtos.Dock = System.Windows.Forms.DockStyle.Right;
+ this.chkProtos.Location = new System.Drawing.Point(136, 0);
+ this.chkProtos.Name = "chkProtos";
+ this.chkProtos.Size = new System.Drawing.Size(15, 21);
+ this.chkProtos.TabIndex = 0;
+ this.chkProtos.UseVisualStyleBackColor = true;
+ //
+ // label14
+ //
+ this.label14.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
+ this.label14.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.label14.ForeColor = System.Drawing.Color.White;
+ this.label14.Location = new System.Drawing.Point(19, 92);
+ this.label14.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.label14.Name = "label14";
+ this.label14.Size = new System.Drawing.Size(140, 21);
+ this.label14.TabIndex = 8;
+ this.label14.Text = "Protos";
+ this.label14.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // label8
+ //
+ this.label8.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
+ this.label8.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.label8.ForeColor = System.Drawing.Color.White;
+ this.label8.Location = new System.Drawing.Point(17, 19);
+ this.label8.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.label8.Name = "label8";
+ this.label8.Size = new System.Drawing.Size(140, 21);
+ this.label8.TabIndex = 1;
+ this.label8.Text = "HotelPms.Client.Blazor";
+ this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // tabPage2
+ //
+ this.tabPage2.Controls.Add(this.button2);
+ this.tabPage2.Controls.Add(this.groupBox4);
+ this.tabPage2.Controls.Add(this.groupBox3);
+ this.tabPage2.Location = new System.Drawing.Point(4, 24);
+ this.tabPage2.Margin = new System.Windows.Forms.Padding(4);
+ this.tabPage2.Name = "tabPage2";
+ this.tabPage2.Padding = new System.Windows.Forms.Padding(4);
+ this.tabPage2.Size = new System.Drawing.Size(1024, 360);
+ this.tabPage2.TabIndex = 1;
+ this.tabPage2.Text = "TypeScript";
+ this.tabPage2.UseVisualStyleBackColor = true;
+ //
+ // button2
+ //
+ this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.button2.Location = new System.Drawing.Point(868, 291);
+ this.button2.Margin = new System.Windows.Forms.Padding(4);
+ this.button2.Name = "button2";
+ this.button2.Size = new System.Drawing.Size(111, 35);
+ this.button2.TabIndex = 12;
+ this.button2.Text = "生成";
+ this.button2.UseVisualStyleBackColor = true;
+ this.button2.Click += new System.EventHandler(this.button2_Click);
+ //
+ // groupBox4
+ //
+ this.groupBox4.Controls.Add(this.txtTsAccessClassName);
+ this.groupBox4.Controls.Add(this.label7);
+ this.groupBox4.Location = new System.Drawing.Point(7, 112);
+ this.groupBox4.Margin = new System.Windows.Forms.Padding(4);
+ this.groupBox4.Name = "groupBox4";
+ this.groupBox4.Padding = new System.Windows.Forms.Padding(4);
+ this.groupBox4.Size = new System.Drawing.Size(407, 84);
+ this.groupBox4.TabIndex = 11;
+ this.groupBox4.TabStop = false;
+ this.groupBox4.Text = "Access";
+ //
+ // txtTsAccessClassName
+ //
+ this.txtTsAccessClassName.Location = new System.Drawing.Point(125, 22);
+ this.txtTsAccessClassName.Margin = new System.Windows.Forms.Padding(4);
+ this.txtTsAccessClassName.Name = "txtTsAccessClassName";
+ this.txtTsAccessClassName.Size = new System.Drawing.Size(219, 23);
+ this.txtTsAccessClassName.TabIndex = 8;
+ //
+ // label7
+ //
+ this.label7.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.label7.Location = new System.Drawing.Point(15, 22);
+ this.label7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.label7.Name = "label7";
+ this.label7.Size = new System.Drawing.Size(108, 23);
+ this.label7.TabIndex = 7;
+ this.label7.Text = "ClassName";
+ this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // groupBox3
+ //
+ this.groupBox3.Controls.Add(this.label5);
+ this.groupBox3.Controls.Add(this.txtTsBeanInterfaceName);
+ this.groupBox3.Controls.Add(this.label6);
+ this.groupBox3.Controls.Add(this.txtTsBeanClassName);
+ this.groupBox3.Location = new System.Drawing.Point(7, 8);
+ this.groupBox3.Margin = new System.Windows.Forms.Padding(4);
+ this.groupBox3.Name = "groupBox3";
+ this.groupBox3.Padding = new System.Windows.Forms.Padding(4);
+ this.groupBox3.Size = new System.Drawing.Size(407, 85);
+ this.groupBox3.TabIndex = 10;
+ this.groupBox3.TabStop = false;
+ this.groupBox3.Text = "Bean";
+ //
+ // label5
+ //
+ this.label5.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.label5.Location = new System.Drawing.Point(15, 45);
+ this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.label5.Name = "label5";
+ this.label5.Size = new System.Drawing.Size(108, 23);
+ this.label5.TabIndex = 5;
+ this.label5.Text = "InterfaceName";
+ this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // txtTsBeanInterfaceName
+ //
+ this.txtTsBeanInterfaceName.Location = new System.Drawing.Point(125, 45);
+ this.txtTsBeanInterfaceName.Margin = new System.Windows.Forms.Padding(4);
+ this.txtTsBeanInterfaceName.Name = "txtTsBeanInterfaceName";
+ this.txtTsBeanInterfaceName.Size = new System.Drawing.Size(219, 23);
+ this.txtTsBeanInterfaceName.TabIndex = 6;
+ //
+ // label6
+ //
+ this.label6.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.label6.Location = new System.Drawing.Point(15, 22);
+ this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.label6.Name = "label6";
+ this.label6.Size = new System.Drawing.Size(108, 23);
+ this.label6.TabIndex = 3;
+ this.label6.Text = "ClassName";
+ this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // txtTsBeanClassName
+ //
+ this.txtTsBeanClassName.Location = new System.Drawing.Point(125, 22);
+ this.txtTsBeanClassName.Margin = new System.Windows.Forms.Padding(4);
+ this.txtTsBeanClassName.Name = "txtTsBeanClassName";
+ this.txtTsBeanClassName.Size = new System.Drawing.Size(219, 23);
+ this.txtTsBeanClassName.TabIndex = 4;
+ //
+ // splitter1
+ //
+ this.splitter1.Dock = System.Windows.Forms.DockStyle.Right;
+ this.splitter1.Location = new System.Drawing.Point(155, 5);
+ this.splitter1.Margin = new System.Windows.Forms.Padding(4);
+ this.splitter1.Name = "splitter1";
+ this.splitter1.Size = new System.Drawing.Size(6, 609);
+ this.splitter1.TabIndex = 1;
+ this.splitter1.TabStop = false;
+ //
+ // dataGridView1
+ //
+ this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+ this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
+ this.Column1});
+ this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.dataGridView1.Location = new System.Drawing.Point(5, 5);
+ this.dataGridView1.Margin = new System.Windows.Forms.Padding(4);
+ this.dataGridView1.Name = "dataGridView1";
+ this.dataGridView1.RowTemplate.Height = 21;
+ this.dataGridView1.Size = new System.Drawing.Size(150, 609);
+ this.dataGridView1.TabIndex = 2;
+ this.dataGridView1.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellContentClick);
+ this.dataGridView1.SelectionChanged += new System.EventHandler(this.dataGridView1_SelectionChanged);
+ //
+ // Column1
+ //
+ this.Column1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
+ this.Column1.DataPropertyName = "Name";
+ this.Column1.HeaderText = "名称";
+ this.Column1.Name = "Column1";
+ //
+ // chkClientDirect
+ //
+ this.chkClientDirect.Location = new System.Drawing.Point(546, 209);
+ this.chkClientDirect.Name = "chkClientDirect";
+ this.chkClientDirect.Size = new System.Drawing.Size(115, 26);
+ this.chkClientDirect.TabIndex = 46;
+ this.chkClientDirect.Text = "更新";
+ this.chkClientDirect.UseVisualStyleBackColor = true;
+ //
+ // pnlClientDirectAccess
+ //
+ this.pnlClientDirectAccess.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.pnlClientDirectAccess.Controls.Add(this.lblClientDirectAccess);
+ this.pnlClientDirectAccess.Controls.Add(this.chkClientDirectAccess);
+ this.pnlClientDirectAccess.Location = new System.Drawing.Point(357, 235);
+ this.pnlClientDirectAccess.Name = "pnlClientDirectAccess";
+ this.pnlClientDirectAccess.Padding = new System.Windows.Forms.Padding(0, 0, 10, 0);
+ this.pnlClientDirectAccess.Size = new System.Drawing.Size(163, 23);
+ this.pnlClientDirectAccess.TabIndex = 45;
+ //
+ // lblClientDirectAccess
+ //
+ this.lblClientDirectAccess.BackColor = System.Drawing.Color.White;
+ this.lblClientDirectAccess.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.lblClientDirectAccess.ForeColor = System.Drawing.Color.Black;
+ this.lblClientDirectAccess.Location = new System.Drawing.Point(0, 0);
+ this.lblClientDirectAccess.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.lblClientDirectAccess.Name = "lblClientDirectAccess";
+ this.lblClientDirectAccess.Size = new System.Drawing.Size(136, 21);
+ this.lblClientDirectAccess.TabIndex = 4;
+ this.lblClientDirectAccess.Text = "BuildingAccess.cs";
+ this.lblClientDirectAccess.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // chkClientDirectAccess
+ //
+ this.chkClientDirectAccess.Dock = System.Windows.Forms.DockStyle.Right;
+ this.chkClientDirectAccess.Location = new System.Drawing.Point(136, 0);
+ this.chkClientDirectAccess.Name = "chkClientDirectAccess";
+ this.chkClientDirectAccess.Size = new System.Drawing.Size(15, 21);
+ this.chkClientDirectAccess.TabIndex = 0;
+ this.chkClientDirectAccess.UseVisualStyleBackColor = true;
+ //
+ // label4
+ //
+ this.label4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
+ this.label4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.label4.ForeColor = System.Drawing.Color.White;
+ this.label4.Location = new System.Drawing.Point(317, 211);
+ this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.label4.Name = "label4";
+ this.label4.Size = new System.Drawing.Size(218, 21);
+ this.label4.TabIndex = 43;
+ this.label4.Text = "HotelPms.DataAccessDirect.Client";
+ this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // BeanCreator
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(1200, 656);
+ this.Name = "BeanCreator";
+ this.Text = "テーブル制御クラス作成(HotelPms専用)";
+ this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.BeanCreator_FormClosed);
+ this.Load += new System.EventHandler(this.BeanCreator_Load);
+ this.pnlMain.ResumeLayout(false);
+ this.panel1.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).EndInit();
+ this.panel2.ResumeLayout(false);
+ this.tabControl1.ResumeLayout(false);
+ this.tabPage1.ResumeLayout(false);
+ this.groupBox5.ResumeLayout(false);
+ this.groupBox5.PerformLayout();
+ this.pnlServices.ResumeLayout(false);
+ this.pnlStartup.ResumeLayout(false);
+ this.pnlClientUse.ResumeLayout(false);
+ this.pnlClientTable.ResumeLayout(false);
+ this.pnlClientMaster.ResumeLayout(false);
+ this.pnlClientAccess.ResumeLayout(false);
+ this.pnlBlazorViewModel.ResumeLayout(false);
+ this.pnlProtos.ResumeLayout(false);
+ this.tabPage2.ResumeLayout(false);
+ this.groupBox4.ResumeLayout(false);
+ this.groupBox4.PerformLayout();
+ this.groupBox3.ResumeLayout(false);
+ this.groupBox3.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
+ this.pnlClientDirectAccess.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Panel panel1;
+ private System.Windows.Forms.DataGridView dataGridView2;
+ private System.Windows.Forms.Panel panel2;
+ private System.Windows.Forms.Splitter splitter1;
+ private System.Windows.Forms.DataGridView dataGridView1;
+ private System.Windows.Forms.Button btnCreate;
+ private System.Windows.Forms.DataGridViewCheckBoxColumn colFieldSel;
+ private System.Windows.Forms.TabControl tabControl1;
+ private System.Windows.Forms.TabPage tabPage1;
+ private System.Windows.Forms.TabPage tabPage2;
+ private System.Windows.Forms.GroupBox groupBox4;
+ private System.Windows.Forms.TextBox txtTsAccessClassName;
+ private System.Windows.Forms.Label label7;
+ private System.Windows.Forms.GroupBox groupBox3;
+ private System.Windows.Forms.Label label6;
+ private System.Windows.Forms.TextBox txtTsBeanClassName;
+ private System.Windows.Forms.Button button2;
+ private System.Windows.Forms.Label label5;
+ private System.Windows.Forms.TextBox txtTsBeanInterfaceName;
+ private System.Windows.Forms.DataGridViewTextBoxColumn Column1;
+ private System.Windows.Forms.GroupBox groupBox5;
+ private System.Windows.Forms.Label label8;
+ private System.Windows.Forms.Panel pnlProtos;
+ private System.Windows.Forms.Label lblProtos;
+ private System.Windows.Forms.CheckBox chkProtos;
+ private System.Windows.Forms.Label label14;
+ private System.Windows.Forms.CheckBox chkBlazor;
+ private System.Windows.Forms.Panel pnlBlazorViewModel;
+ private System.Windows.Forms.Label lblBlazorViewModel;
+ private System.Windows.Forms.CheckBox chkBlazorViewModel;
+ private System.Windows.Forms.Label label19;
+ private System.Windows.Forms.Panel pnlClientUse;
+ private System.Windows.Forms.Label lblClientUse;
+ private System.Windows.Forms.CheckBox chkClientUse;
+ private System.Windows.Forms.Label label22;
+ private System.Windows.Forms.CheckBox chkClient;
+ private System.Windows.Forms.Panel pnlClientTable;
+ private System.Windows.Forms.Label lblClientTable;
+ private System.Windows.Forms.CheckBox chkClientTable;
+ private System.Windows.Forms.Panel pnlClientMaster;
+ private System.Windows.Forms.Label lblClientMaster;
+ private System.Windows.Forms.CheckBox chkClientMaster;
+ private System.Windows.Forms.Label label25;
+ private System.Windows.Forms.Panel pnlClientAccess;
+ private System.Windows.Forms.Label lblClientAccess;
+ private System.Windows.Forms.CheckBox chkClientAccess;
+ private System.Windows.Forms.Label label28;
+ private System.Windows.Forms.Panel pnlStartup;
+ private System.Windows.Forms.Label lblStartup;
+ private System.Windows.Forms.CheckBox chkStartup;
+ private System.Windows.Forms.Label label33;
+ private System.Windows.Forms.CheckBox chkServer;
+ private System.Windows.Forms.Label label35;
+ private System.Windows.Forms.Panel pnlServices;
+ private System.Windows.Forms.Label lblServices;
+ private System.Windows.Forms.CheckBox chkServices;
+ private System.Windows.Forms.Label label36;
+ private System.Windows.Forms.CheckBox chkUseInfo;
+ private System.Windows.Forms.Label label10;
+ private System.Windows.Forms.TextBox txtSlnDir;
+ private CheckBox chkCopy;
+ private Label label1;
+ private CheckBox chkClientDirect;
+ private Panel pnlClientDirectAccess;
+ private Label lblClientDirectAccess;
+ private CheckBox chkClientDirectAccess;
+ private Label label4;
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.SourceFactory/BeanCreator.resx b/HotelPms.SourceFactory/BeanCreator.resx
new file mode 100644
index 0000000..e5339cc
--- /dev/null
+++ b/HotelPms.SourceFactory/BeanCreator.resx
@@ -0,0 +1,270 @@
+<root>
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <metadata name="pnlMain.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="dataGridView1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="Column1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="splitter1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="panel1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="dataGridView2.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="colFieldSel.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="panel2.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="tabControl1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="tabPage1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="groupBox5.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="chkClientDirect.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="pnlClientDirectAccess.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="lblClientDirectAccess.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="chkClientDirectAccess.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="label4.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="label1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="chkCopy.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="label10.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="txtSlnDir.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="chkUseInfo.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="pnlServices.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="lblServices.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="chkServices.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="label36.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="pnlStartup.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="lblStartup.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="chkStartup.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="label33.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="btnCreate.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="chkServer.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="label35.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="pnlClientUse.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="lblClientUse.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="chkClientUse.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="label22.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="chkClient.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="pnlClientTable.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="lblClientTable.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="chkClientTable.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="pnlClientMaster.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="lblClientMaster.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="chkClientMaster.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="label25.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="pnlClientAccess.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="lblClientAccess.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="chkClientAccess.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="label28.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="pnlBlazorViewModel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="lblBlazorViewModel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="chkBlazorViewModel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="label19.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="chkBlazor.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="pnlProtos.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="lblProtos.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="chkProtos.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="label14.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="label8.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="tabPage2.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="button2.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="groupBox4.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="txtTsAccessClassName.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="label7.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="groupBox3.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="label5.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="txtTsBeanInterfaceName.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="label6.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="txtTsBeanClassName.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="LoadingObj.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+</root>
\ No newline at end of file
diff --git a/HotelPms.SourceFactory/ExcelCopy.Designer.cs b/HotelPms.SourceFactory/ExcelCopy.Designer.cs
new file mode 100644
index 0000000..b709740
--- /dev/null
+++ b/HotelPms.SourceFactory/ExcelCopy.Designer.cs
@@ -0,0 +1,233 @@
+namespace HotelPms.SourceFactory
+{
+ partial class ExcelCopy
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.cmbSheet = new System.Windows.Forms.ComboBox();
+ this.txtExcelPath = new System.Windows.Forms.TextBox();
+ this.OpenExcel = new System.Windows.Forms.Button();
+ this.groupBox1 = new System.Windows.Forms.GroupBox();
+ this.label1 = new System.Windows.Forms.Label();
+ this.label4 = new System.Windows.Forms.Label();
+ this.txtSrcBegin = new System.Windows.Forms.TextBox();
+ this.groupBox2 = new System.Windows.Forms.GroupBox();
+ this.txtDstBegin = new System.Windows.Forms.TextBox();
+ this.label5 = new System.Windows.Forms.Label();
+ this.label8 = new System.Windows.Forms.Label();
+ this.comboBox1 = new System.Windows.Forms.ComboBox();
+ this.button1 = new System.Windows.Forms.Button();
+ this.label6 = new System.Windows.Forms.Label();
+ this.txtSrcEnd = new System.Windows.Forms.TextBox();
+ this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
+ this.groupBox1.SuspendLayout();
+ this.groupBox2.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // cmbSheet
+ //
+ this.cmbSheet.FormattingEnabled = true;
+ this.cmbSheet.Location = new System.Drawing.Point(105, 33);
+ this.cmbSheet.Name = "cmbSheet";
+ this.cmbSheet.Size = new System.Drawing.Size(534, 23);
+ this.cmbSheet.TabIndex = 5;
+ //
+ // txtExcelPath
+ //
+ this.txtExcelPath.Location = new System.Drawing.Point(22, 12);
+ this.txtExcelPath.Name = "txtExcelPath";
+ this.txtExcelPath.Size = new System.Drawing.Size(568, 23);
+ this.txtExcelPath.TabIndex = 4;
+ //
+ // OpenExcel
+ //
+ this.OpenExcel.Location = new System.Drawing.Point(605, 12);
+ this.OpenExcel.Name = "OpenExcel";
+ this.OpenExcel.Size = new System.Drawing.Size(184, 52);
+ this.OpenExcel.TabIndex = 3;
+ this.OpenExcel.Text = "開く";
+ this.OpenExcel.UseVisualStyleBackColor = true;
+ this.OpenExcel.Click += new System.EventHandler(this.OpenExcel_Click);
+ //
+ // groupBox1
+ //
+ this.groupBox1.Controls.Add(this.txtSrcEnd);
+ this.groupBox1.Controls.Add(this.label6);
+ this.groupBox1.Controls.Add(this.txtSrcBegin);
+ this.groupBox1.Controls.Add(this.label4);
+ this.groupBox1.Controls.Add(this.label1);
+ this.groupBox1.Controls.Add(this.cmbSheet);
+ this.groupBox1.Location = new System.Drawing.Point(22, 82);
+ this.groupBox1.Name = "groupBox1";
+ this.groupBox1.Size = new System.Drawing.Size(766, 115);
+ this.groupBox1.TabIndex = 6;
+ this.groupBox1.TabStop = false;
+ this.groupBox1.Text = "Src";
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(15, 36);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(36, 15);
+ this.label1.TabIndex = 6;
+ this.label1.Text = "Sheet";
+ //
+ // label4
+ //
+ this.label4.AutoSize = true;
+ this.label4.Location = new System.Drawing.Point(15, 71);
+ this.label4.Name = "label4";
+ this.label4.Size = new System.Drawing.Size(59, 15);
+ this.label4.TabIndex = 11;
+ this.label4.Text = "Row&Col";
+ //
+ // txtSrcBegin
+ //
+ this.txtSrcBegin.Location = new System.Drawing.Point(105, 68);
+ this.txtSrcBegin.Name = "txtSrcBegin";
+ this.txtSrcBegin.Size = new System.Drawing.Size(87, 23);
+ this.txtSrcBegin.TabIndex = 12;
+ //
+ // groupBox2
+ //
+ this.groupBox2.Controls.Add(this.txtDstBegin);
+ this.groupBox2.Controls.Add(this.label5);
+ this.groupBox2.Controls.Add(this.label8);
+ this.groupBox2.Controls.Add(this.comboBox1);
+ this.groupBox2.Location = new System.Drawing.Point(22, 211);
+ this.groupBox2.Name = "groupBox2";
+ this.groupBox2.Size = new System.Drawing.Size(766, 119);
+ this.groupBox2.TabIndex = 7;
+ this.groupBox2.TabStop = false;
+ this.groupBox2.Text = "Dest";
+ //
+ // txtDstBegin
+ //
+ this.txtDstBegin.Location = new System.Drawing.Point(105, 73);
+ this.txtDstBegin.Name = "txtDstBegin";
+ this.txtDstBegin.Size = new System.Drawing.Size(87, 23);
+ this.txtDstBegin.TabIndex = 12;
+ //
+ // label5
+ //
+ this.label5.AutoSize = true;
+ this.label5.Location = new System.Drawing.Point(15, 76);
+ this.label5.Name = "label5";
+ this.label5.Size = new System.Drawing.Size(59, 15);
+ this.label5.TabIndex = 11;
+ this.label5.Text = "Row&Col";
+ //
+ // label8
+ //
+ this.label8.AutoSize = true;
+ this.label8.Location = new System.Drawing.Point(15, 36);
+ this.label8.Name = "label8";
+ this.label8.Size = new System.Drawing.Size(36, 15);
+ this.label8.TabIndex = 6;
+ this.label8.Text = "Sheet";
+ //
+ // comboBox1
+ //
+ this.comboBox1.FormattingEnabled = true;
+ this.comboBox1.Location = new System.Drawing.Point(105, 33);
+ this.comboBox1.Name = "comboBox1";
+ this.comboBox1.Size = new System.Drawing.Size(534, 23);
+ this.comboBox1.TabIndex = 5;
+ //
+ // button1
+ //
+ this.button1.Location = new System.Drawing.Point(318, 348);
+ this.button1.Name = "button1";
+ this.button1.Size = new System.Drawing.Size(184, 52);
+ this.button1.TabIndex = 8;
+ this.button1.Text = "Copy";
+ this.button1.UseVisualStyleBackColor = true;
+ this.button1.Click += new System.EventHandler(this.button1_Click);
+ //
+ // label6
+ //
+ this.label6.AutoSize = true;
+ this.label6.Location = new System.Drawing.Point(198, 71);
+ this.label6.Name = "label6";
+ this.label6.Size = new System.Drawing.Size(19, 15);
+ this.label6.TabIndex = 13;
+ this.label6.Text = "~";
+ //
+ // txtSrcEnd
+ //
+ this.txtSrcEnd.Location = new System.Drawing.Point(223, 68);
+ this.txtSrcEnd.Name = "txtSrcEnd";
+ this.txtSrcEnd.Size = new System.Drawing.Size(87, 23);
+ this.txtSrcEnd.TabIndex = 14;
+ //
+ // openFileDialog1
+ //
+ this.openFileDialog1.FileName = "openFileDialog1";
+ this.openFileDialog1.Filter = "Excel2003以降|*.xlsx|Excel2003以前|*.xls|すべてのファイル|*.*";
+ //
+ // ExcelCopy
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(800, 413);
+ this.Controls.Add(this.button1);
+ this.Controls.Add(this.groupBox2);
+ this.Controls.Add(this.groupBox1);
+ this.Controls.Add(this.txtExcelPath);
+ this.Controls.Add(this.OpenExcel);
+ this.Name = "ExcelCopy";
+ this.Text = "ExcelCopy";
+ this.groupBox1.ResumeLayout(false);
+ this.groupBox1.PerformLayout();
+ this.groupBox2.ResumeLayout(false);
+ this.groupBox2.PerformLayout();
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private ComboBox cmbSheet;
+ private TextBox txtExcelPath;
+ private Button OpenExcel;
+ private GroupBox groupBox1;
+ private TextBox txtSrcEnd;
+ private Label label6;
+ private TextBox txtSrcBegin;
+ private Label label4;
+ private Label label1;
+ private GroupBox groupBox2;
+ private TextBox txtDstBegin;
+ private Label label5;
+ private Label label8;
+ private ComboBox comboBox1;
+ private Button button1;
+ private OpenFileDialog openFileDialog1;
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.SourceFactory/ExcelCopy.cs b/HotelPms.SourceFactory/ExcelCopy.cs
new file mode 100644
index 0000000..71782c3
--- /dev/null
+++ b/HotelPms.SourceFactory/ExcelCopy.cs
@@ -0,0 +1,66 @@
+using HotelPms.Share.Windows.Util;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace HotelPms.SourceFactory
+{
+ public partial class ExcelCopy : Form
+ {
+ public ExcelCopy()
+ {
+ InitializeComponent();
+ }
+
+ private void OpenExcel_Click(object sender, EventArgs e)
+ {
+ if (openFileDialog1.ShowDialog() != DialogResult.OK) { return; }
+ txtExcelPath.Text = openFileDialog1.FileName;
+
+ cmbSheet.Items.Clear();
+ comboBox1.Items.Clear();
+ using (NPOIExcel excel = new NPOIExcel(txtExcelPath.Text))
+ {
+ for (int i = 0; i < excel.Workbook.NumberOfSheets; i++)
+ {
+ cmbSheet.Items.Add(excel.Workbook.GetSheetAt(i).SheetName);
+ comboBox1.Items.Add(excel.Workbook.GetSheetAt(i).SheetName);
+ }
+ }
+ }
+
+ private void button1_Click(object sender, EventArgs e)
+ {
+ List<string> srcData = new List<string>();
+ using (NPOIExcel excel = new NPOIExcel(txtExcelPath.Text))
+ {
+ //元
+ excel.SetCurrentSheet(excel.Workbook.GetSheetIndex(cmbSheet.SelectedItem.ToString()));
+ Point begin = NPOIExcel.GetCellPoint(txtSrcBegin.Text);
+ Point end = NPOIExcel.GetCellPoint(txtSrcEnd.Text);
+
+ for(int r = begin.Y; r <= end.Y; r++)
+ {
+ srcData.Add(excel.GetCellString($"{NPOIExcel.ToColName(begin.X + 1)}{r + 1}"));
+ }
+
+ //コピー
+ excel.SetCurrentSheet(excel.Workbook.GetSheetIndex(comboBox1.SelectedItem.ToString()));
+ begin = NPOIExcel.GetCellPoint(txtDstBegin.Text);
+ for (int i = 1; i <= srcData.Count; i++)
+ {
+ excel.SetCell($"{NPOIExcel.ToColName(begin.X + 1)}{begin.Y + i}", srcData[i - 1]);
+ }
+
+ excel.Save();
+ }
+ MessageBox.Show("ok");
+ }
+ }
+}
diff --git a/HotelPms.SourceFactory/ExcelCopy.resx b/HotelPms.SourceFactory/ExcelCopy.resx
new file mode 100644
index 0000000..4a03187
--- /dev/null
+++ b/HotelPms.SourceFactory/ExcelCopy.resx
@@ -0,0 +1,63 @@
+<root>
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <metadata name="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>17, 17</value>
+ </metadata>
+</root>
\ No newline at end of file
diff --git a/HotelPms.SourceFactory/ExcelToTable.Designer.cs b/HotelPms.SourceFactory/ExcelToTable.Designer.cs
new file mode 100644
index 0000000..c34c0c6
--- /dev/null
+++ b/HotelPms.SourceFactory/ExcelToTable.Designer.cs
@@ -0,0 +1,289 @@
+namespace HotelPms.SourceFactory
+{
+ partial class ExcelToTable
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.groupBox1 = new System.Windows.Forms.GroupBox();
+ this.txtPassword = new System.Windows.Forms.TextBox();
+ this.label4 = new System.Windows.Forms.Label();
+ this.txtUser = new System.Windows.Forms.TextBox();
+ this.label3 = new System.Windows.Forms.Label();
+ this.txtDB = new System.Windows.Forms.TextBox();
+ this.label2 = new System.Windows.Forms.Label();
+ this.txtHost = new System.Windows.Forms.TextBox();
+ this.label1 = new System.Windows.Forms.Label();
+ this.button3 = new System.Windows.Forms.Button();
+ this.cmbSheet = new System.Windows.Forms.ComboBox();
+ this.txtExcelPath = new System.Windows.Forms.TextBox();
+ this.OpenExcel = new System.Windows.Forms.Button();
+ this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
+ this.button1 = new System.Windows.Forms.Button();
+ this.button2 = new System.Windows.Forms.Button();
+ this.button4 = new System.Windows.Forms.Button();
+ this.panel1 = new System.Windows.Forms.Panel();
+ this.panel2 = new System.Windows.Forms.Panel();
+ this.txtContext = new System.Windows.Forms.TextBox();
+ this.groupBox1.SuspendLayout();
+ this.panel1.SuspendLayout();
+ this.panel2.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // groupBox1
+ //
+ this.groupBox1.Controls.Add(this.txtPassword);
+ this.groupBox1.Controls.Add(this.label4);
+ this.groupBox1.Controls.Add(this.txtUser);
+ this.groupBox1.Controls.Add(this.label3);
+ this.groupBox1.Controls.Add(this.txtDB);
+ this.groupBox1.Controls.Add(this.label2);
+ this.groupBox1.Controls.Add(this.txtHost);
+ this.groupBox1.Controls.Add(this.label1);
+ this.groupBox1.Location = new System.Drawing.Point(7, 134);
+ this.groupBox1.Name = "groupBox1";
+ this.groupBox1.Size = new System.Drawing.Size(770, 96);
+ this.groupBox1.TabIndex = 7;
+ this.groupBox1.TabStop = false;
+ this.groupBox1.Text = "DB";
+ //
+ // txtPassword
+ //
+ this.txtPassword.Location = new System.Drawing.Point(261, 48);
+ this.txtPassword.Name = "txtPassword";
+ this.txtPassword.Size = new System.Drawing.Size(129, 23);
+ this.txtPassword.TabIndex = 7;
+ this.txtPassword.Text = "oatcti";
+ //
+ // label4
+ //
+ this.label4.AutoSize = true;
+ this.label4.Location = new System.Drawing.Point(200, 51);
+ this.label4.Name = "label4";
+ this.label4.Size = new System.Drawing.Size(57, 15);
+ this.label4.TabIndex = 6;
+ this.label4.Text = "Password";
+ //
+ // txtUser
+ //
+ this.txtUser.Location = new System.Drawing.Point(58, 48);
+ this.txtUser.Name = "txtUser";
+ this.txtUser.Size = new System.Drawing.Size(129, 23);
+ this.txtUser.TabIndex = 5;
+ this.txtUser.Text = "sa";
+ //
+ // label3
+ //
+ this.label3.AutoSize = true;
+ this.label3.Location = new System.Drawing.Point(19, 51);
+ this.label3.Name = "label3";
+ this.label3.Size = new System.Drawing.Size(30, 15);
+ this.label3.TabIndex = 4;
+ this.label3.Text = "User";
+ //
+ // txtDB
+ //
+ this.txtDB.Location = new System.Drawing.Point(261, 19);
+ this.txtDB.Name = "txtDB";
+ this.txtDB.Size = new System.Drawing.Size(129, 23);
+ this.txtDB.TabIndex = 3;
+ this.txtDB.Text = "HotelPms";
+ //
+ // label2
+ //
+ this.label2.AutoSize = true;
+ this.label2.Location = new System.Drawing.Point(200, 22);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(22, 15);
+ this.label2.TabIndex = 2;
+ this.label2.Text = "DB";
+ //
+ // txtHost
+ //
+ this.txtHost.Location = new System.Drawing.Point(58, 19);
+ this.txtHost.Name = "txtHost";
+ this.txtHost.Size = new System.Drawing.Size(129, 23);
+ this.txtHost.TabIndex = 1;
+ this.txtHost.Text = "NAVC2-OGI2";
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(19, 22);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(32, 15);
+ this.label1.TabIndex = 0;
+ this.label1.Text = "Host";
+ //
+ // button3
+ //
+ this.button3.Location = new System.Drawing.Point(593, 64);
+ this.button3.Name = "button3";
+ this.button3.Size = new System.Drawing.Size(184, 50);
+ this.button3.TabIndex = 13;
+ this.button3.Text = "CreateTable一括";
+ this.button3.UseVisualStyleBackColor = true;
+ this.button3.Click += new System.EventHandler(this.button3_Click);
+ //
+ // cmbSheet
+ //
+ this.cmbSheet.FormattingEnabled = true;
+ this.cmbSheet.Location = new System.Drawing.Point(10, 35);
+ this.cmbSheet.Name = "cmbSheet";
+ this.cmbSheet.Size = new System.Drawing.Size(568, 23);
+ this.cmbSheet.TabIndex = 6;
+ //
+ // txtExcelPath
+ //
+ this.txtExcelPath.Location = new System.Drawing.Point(10, 6);
+ this.txtExcelPath.Name = "txtExcelPath";
+ this.txtExcelPath.Size = new System.Drawing.Size(568, 23);
+ this.txtExcelPath.TabIndex = 5;
+ this.txtExcelPath.Text = "D:\\Pms\\HotelPms\\Document\\HotelPmsDB設計_利用.xlsx";
+ //
+ // OpenExcel
+ //
+ this.OpenExcel.Location = new System.Drawing.Point(593, 6);
+ this.OpenExcel.Name = "OpenExcel";
+ this.OpenExcel.Size = new System.Drawing.Size(184, 52);
+ this.OpenExcel.TabIndex = 4;
+ this.OpenExcel.Text = "開く";
+ this.OpenExcel.UseVisualStyleBackColor = true;
+ this.OpenExcel.Click += new System.EventHandler(this.OpenExcel_Click);
+ //
+ // openFileDialog1
+ //
+ this.openFileDialog1.FileName = "openFileDialog1";
+ this.openFileDialog1.Filter = "Excel2003以降|*.xlsx|Excel2003以前|*.xls|すべてのファイル|*.*";
+ //
+ // button1
+ //
+ this.button1.Location = new System.Drawing.Point(7, 64);
+ this.button1.Name = "button1";
+ this.button1.Size = new System.Drawing.Size(184, 50);
+ this.button1.TabIndex = 14;
+ this.button1.Text = "test";
+ this.button1.UseVisualStyleBackColor = true;
+ this.button1.Click += new System.EventHandler(this.button1_Click);
+ //
+ // button2
+ //
+ this.button2.Location = new System.Drawing.Point(455, 63);
+ this.button2.Name = "button2";
+ this.button2.Size = new System.Drawing.Size(110, 42);
+ this.button2.TabIndex = 15;
+ this.button2.Text = "Table単位作成";
+ this.button2.UseVisualStyleBackColor = true;
+ this.button2.Click += new System.EventHandler(this.button2_Click);
+ //
+ // button4
+ //
+ this.button4.Location = new System.Drawing.Point(287, 68);
+ this.button4.Name = "button4";
+ this.button4.Size = new System.Drawing.Size(110, 42);
+ this.button4.TabIndex = 16;
+ this.button4.Text = "Enum作成";
+ this.button4.UseVisualStyleBackColor = true;
+ this.button4.Click += new System.EventHandler(this.button4_Click);
+ //
+ // panel1
+ //
+ this.panel1.Controls.Add(this.txtExcelPath);
+ this.panel1.Controls.Add(this.button4);
+ this.panel1.Controls.Add(this.OpenExcel);
+ this.panel1.Controls.Add(this.button2);
+ this.panel1.Controls.Add(this.cmbSheet);
+ this.panel1.Controls.Add(this.button1);
+ this.panel1.Controls.Add(this.groupBox1);
+ this.panel1.Controls.Add(this.button3);
+ this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.panel1.Location = new System.Drawing.Point(0, 0);
+ this.panel1.Name = "panel1";
+ this.panel1.Size = new System.Drawing.Size(800, 236);
+ this.panel1.TabIndex = 17;
+ //
+ // panel2
+ //
+ this.panel2.Controls.Add(this.txtContext);
+ this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.panel2.Location = new System.Drawing.Point(0, 236);
+ this.panel2.Name = "panel2";
+ this.panel2.Size = new System.Drawing.Size(800, 214);
+ this.panel2.TabIndex = 18;
+ //
+ // txtContext
+ //
+ this.txtContext.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.txtContext.Location = new System.Drawing.Point(0, 0);
+ this.txtContext.Multiline = true;
+ this.txtContext.Name = "txtContext";
+ this.txtContext.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
+ this.txtContext.Size = new System.Drawing.Size(800, 214);
+ this.txtContext.TabIndex = 0;
+ //
+ // ExcelToTable
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(800, 450);
+ this.Controls.Add(this.panel2);
+ this.Controls.Add(this.panel1);
+ this.Name = "ExcelToTable";
+ this.Text = "ExcelToTable";
+ this.groupBox1.ResumeLayout(false);
+ this.groupBox1.PerformLayout();
+ this.panel1.ResumeLayout(false);
+ this.panel1.PerformLayout();
+ this.panel2.ResumeLayout(false);
+ this.panel2.PerformLayout();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private GroupBox groupBox1;
+ private Button button3;
+ private TextBox txtPassword;
+ private Label label4;
+ private TextBox txtUser;
+ private Label label3;
+ private TextBox txtDB;
+ private Label label2;
+ private TextBox txtHost;
+ private Label label1;
+ private ComboBox cmbSheet;
+ private TextBox txtExcelPath;
+ private Button OpenExcel;
+ private OpenFileDialog openFileDialog1;
+ private Button button1;
+ private Button button2;
+ private Button button4;
+ private Panel panel1;
+ private Panel panel2;
+ private TextBox txtContext;
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.SourceFactory/ExcelToTable.cs b/HotelPms.SourceFactory/ExcelToTable.cs
new file mode 100644
index 0000000..24508ad
--- /dev/null
+++ b/HotelPms.SourceFactory/ExcelToTable.cs
@@ -0,0 +1,90 @@
+using HotelPms.Share.Data;
+using HotelPms.Share.Windows.Util;
+using HotelPms.SourceFactory.Table;
+using HotelPms.SourceFactory.Util;
+using NPOI.SS.UserModel;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace HotelPms.SourceFactory
+{
+ public partial class ExcelToTable : Form
+ {
+ public ExcelToTable()
+ {
+ InitializeComponent();
+ }
+
+ private void OpenExcel_Click(object sender, EventArgs e)
+ {
+ if (txtExcelPath.Text.Length == 0)
+ {
+ openFileDialog1.InitialDirectory = Application.StartupPath;
+ if (openFileDialog1.ShowDialog() != DialogResult.OK) { return; }
+ txtExcelPath.Text = openFileDialog1.FileName;
+ }
+
+ cmbSheet.Items.Clear();
+ using (NPOIExcel excel = new NPOIExcel(txtExcelPath.Text))
+ {
+ for (int i = 0; i < excel.Workbook.NumberOfSheets; i++)
+ {
+ cmbSheet.Items.Add(excel.Workbook.GetSheetAt(i).SheetName);
+ }
+ }
+ }
+
+ private void button3_Click(object sender, EventArgs e)
+ {
+ using(SqlFactory sqlFactory = new SqlFactory())
+ {
+ sqlFactory.CreateByExcel(txtExcelPath.Text, new DBConnectItem() { HostName = txtHost.Text, UserID = txtUser.Text, Password = txtPassword.Text, DBName = txtDB.Text });
+ }
+ }
+
+ private void button1_Click(object sender, EventArgs e)
+ {
+ using (NPOIExcel excel = new NPOIExcel(txtExcelPath.Text))
+ {
+ ICell A1 = excel.GetCell("A1");
+ ICell B1 = excel.GetCell("B1");
+ ICell C1 = excel.GetCell("C1");
+ ICell D1 = excel.GetCell("D1");
+ ICell E1 = excel.GetCell("E1");
+ ICell F1 = excel.GetCell("F1");
+ ICell G1 = excel.GetCell("G1");
+ ICell H1 = excel.GetCell("H1");
+ ICell I1 = excel.GetCell("I1");
+ ICell J1 = excel.GetCell("J1");
+ ICell K1 = excel.GetCell("K1");
+ ICell L1 = excel.GetCell("L1");
+ }
+ }
+
+ private void button2_Click(object sender, EventArgs e)
+ {
+ using (NPOIExcel excel = new NPOIExcel(txtExcelPath.Text))
+ {
+ excel.SetCurrentSheet(cmbSheet.SelectedIndex);
+ using (SqlFactory sqlFactory = new())
+ {
+ sqlFactory.DBSetting = new DBConnectItem() { HostName = txtHost.Text, UserID = txtUser.Text, Password = txtPassword.Text, DBName = txtDB.Text };
+ bool ret = sqlFactory.CreateBySheet(excel);
+ MessageBox.Show($"結果:{ret}");
+ }
+ }
+ }
+
+ private void button4_Click(object sender, EventArgs e)
+ {
+ txtContext.Text = EnumFactory.Create(txtExcelPath.Text, cmbSheet.SelectedIndex);
+ }
+ }
+}
diff --git a/HotelPms.SourceFactory/ExcelToTable.resx b/HotelPms.SourceFactory/ExcelToTable.resx
new file mode 100644
index 0000000..4a03187
--- /dev/null
+++ b/HotelPms.SourceFactory/ExcelToTable.resx
@@ -0,0 +1,63 @@
+<root>
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <metadata name="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>17, 17</value>
+ </metadata>
+</root>
\ No newline at end of file
diff --git a/HotelPms.SourceFactory/FileEdit/Core.cs b/HotelPms.SourceFactory/FileEdit/Core.cs
new file mode 100644
index 0000000..e26a07d
--- /dev/null
+++ b/HotelPms.SourceFactory/FileEdit/Core.cs
@@ -0,0 +1,70 @@
+using NPOI.SS.Formula.Functions;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HotelPms.SourceFactory.FileEdit
+{
+ public class Core : IDisposable
+ {
+ private EditData curEditData = null;
+ private List<string> fileContent = new List<string>();
+
+ public Core()
+ {
+
+ }
+
+ public void Dispose()
+ {
+ curEditData = null;
+ fileContent.Clear();
+ fileContent = null;
+ }
+
+ public void Execute(EditData data)
+ {
+ curEditData = data;
+ if(curEditData.Data.Count == 0) { return; }
+
+ //ファイルをメモリー中の読む
+ string line;
+ fileContent.Clear();
+ using (StreamReader sr = new StreamReader(curEditData.FilePath, curEditData.Encoding))
+ {
+ while ((line = sr.ReadLine()) != null)
+ {
+ fileContent.Add(line);
+
+ //検索
+ foreach(Item item in curEditData.Data)
+ {
+ if (item.HitIndex2 == -1 && line.Trim().StartsWith(item.Key1)) { item.HitIndex1 = fileContent.Count - 1; }
+ if (item.HitIndex1 != -1 && item.Key2.Length > 0 && line.Trim().StartsWith(item.Key2)) { item.HitIndex2 = fileContent.Count - 1; }
+ }
+ }
+ }
+
+ using (StreamWriter sw = new StreamWriter(curEditData.FilePath, false, curEditData.Encoding))
+ {
+ int i = 0;
+ foreach (string content in fileContent)
+ {
+ sw.WriteLine(content);
+
+ foreach (Item item in curEditData.Data)
+ {
+ if (item.HitIndex1 == -1) { continue; }
+ int index = item.HitIndex2 == -1 ? item.HitIndex1 : item.HitIndex2;
+ if (index != i) { continue; }
+ foreach(string addLine in item.Data) { sw.WriteLine(addLine); }
+ }
+ i++;
+ }
+ }
+ }
+ }
+}
diff --git a/HotelPms.SourceFactory/FileEdit/EditData.cs b/HotelPms.SourceFactory/FileEdit/EditData.cs
new file mode 100644
index 0000000..eea3f7e
--- /dev/null
+++ b/HotelPms.SourceFactory/FileEdit/EditData.cs
@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HotelPms.SourceFactory.FileEdit
+{
+ public class EditData
+ {
+ public string FilePath { get; set; } = string.Empty;
+
+
+ public Encoding Encoding { get; set; } = Encoding.UTF8;
+
+ public List<Item> Data { get; set; } = new List<Item>();
+
+ /// <summary>
+ /// 存在かどうか
+ /// </summary>
+ /// <param name="key"></param>
+ /// <returns></returns>
+ public bool Exists(string key)
+ {
+ string context = File.ReadAllText(FilePath, Encoding);
+ return context.Contains(key);
+ }
+ }
+}
diff --git a/HotelPms.SourceFactory/FileEdit/Item.cs b/HotelPms.SourceFactory/FileEdit/Item.cs
new file mode 100644
index 0000000..3b3e975
--- /dev/null
+++ b/HotelPms.SourceFactory/FileEdit/Item.cs
@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HotelPms.SourceFactory.FileEdit
+{
+ public class Item
+ {
+ /// <summary>
+ /// 対象キーが始まる行の直後(改行後)
+ /// 複数があった場合、一個目
+ /// </summary>
+ public string Key1 { get; set; } = string.Empty;
+
+ public int HitIndex1 { get; set; } = -1;
+
+ /// <summary>
+ /// Key1の直後、更に対象キーが始まる行の直後(改行後)
+ /// 複数があった場合、一個目
+ /// </summary>
+ public string Key2 { get; set; } = string.Empty;
+
+ public int HitIndex2 { get; set; } = -1;
+
+ /// <summary>
+ /// 追加対象行
+ /// </summary>
+ public List<string> Data = new List<string>();
+ }
+}
diff --git a/HotelPms.SourceFactory/Form1.Designer.cs b/HotelPms.SourceFactory/Form1.Designer.cs
new file mode 100644
index 0000000..cb42ff3
--- /dev/null
+++ b/HotelPms.SourceFactory/Form1.Designer.cs
@@ -0,0 +1,104 @@
+namespace HotelPms.SourceFactory
+{
+ partial class Form1
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ calendar1 = new HotelPms.Share.Windows.Component.Calendar();
+ propertyGrid1 = new PropertyGrid();
+ SuspendLayout();
+ //
+ // calendar1
+ //
+ calendar1.ButtonBackColor = Color.FromArgb(64, 64, 64);
+ calendar1.ButtonDownColor = Color.Black;
+ calendar1.ButtonFont = new Font("メイリオ", 12F);
+ calendar1.ButtonForeColor = Color.White;
+ calendar1.ButtonOverColor = Color.Gray;
+ calendar1.DayBackColor = Color.FromArgb(255, 245, 210);
+ calendar1.DayDownColor = Color.FromArgb(0, 192, 0);
+ calendar1.DayFont = new Font("メイリオ", 14F);
+ calendar1.DayForeColor = Color.Black;
+ calendar1.DayOverColor = Color.FromArgb(192, 255, 255);
+ calendar1.DayStyle = Share.Windows.Component.Calendar.DayStyleType.Row4;
+ calendar1.Format = "yyyy/MM/dd";
+ calendar1.HolidayFont = new Font("メイリオ", 7F);
+ calendar1.HolidayForeColor = Color.Red;
+ calendar1.Language = Share.Windows.Component.Calendar.LanguageType.Japanese;
+ calendar1.Location = new Point(39, 12);
+ calendar1.MemoFont = new Font("メイリオ", 9F);
+ calendar1.MemoForeColor = Color.Black;
+ calendar1.MonthFont = new Font("メイリオ", 36F);
+ calendar1.MonthForeColor = Color.Purple;
+ calendar1.Name = "calendar1";
+ calendar1.RokuyouFont = new Font("メイリオ", 8F);
+ calendar1.RokuyouForeColor = Color.FromArgb(0, 64, 0);
+ calendar1.RokuyouVisible = true;
+ calendar1.SelDayBackColor = Color.FromArgb(192, 255, 192);
+ calendar1.SelectDateFont = new Font("メイリオ", 12F);
+ calendar1.SelectDateForeColor = Color.Navy;
+ calendar1.ShowStyle = Share.Windows.Component.Calendar.ShowStyleType.TreeMonth;
+ calendar1.Size = new Size(552, 498);
+ calendar1.SmallFont = new Font("メイリオ", 7F);
+ calendar1.SmallYearFont = new Font("メイリオ", 12F);
+ calendar1.SmallYearForeColor = Color.Black;
+ calendar1.TabIndex = 0;
+ calendar1.Text = "2025/05/22";
+ calendar1.Value = new DateTime(2025, 5, 22, 0, 0, 0, 0);
+ calendar1.WeekBackColor = Color.FromArgb(0, 192, 0);
+ calendar1.WeekFont = new Font("メイリオ", 10F);
+ calendar1.WeekForeColor = Color.White;
+ calendar1.YearFont = new Font("メイリオ", 14F);
+ calendar1.YearForeColor = Color.Purple;
+ //
+ // propertyGrid1
+ //
+ propertyGrid1.BackColor = SystemColors.Control;
+ propertyGrid1.Location = new Point(619, 41);
+ propertyGrid1.Name = "propertyGrid1";
+ propertyGrid1.SelectedObject = calendar1;
+ propertyGrid1.Size = new Size(283, 469);
+ propertyGrid1.TabIndex = 1;
+ //
+ // Form1
+ //
+ AutoScaleDimensions = new SizeF(7F, 15F);
+ AutoScaleMode = AutoScaleMode.Font;
+ ClientSize = new Size(938, 558);
+ Controls.Add(propertyGrid1);
+ Controls.Add(calendar1);
+ Name = "Form1";
+ Text = "Form1";
+ ResumeLayout(false);
+ }
+
+ #endregion
+
+ private Share.Windows.Component.Calendar calendar1;
+ private PropertyGrid propertyGrid1;
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.SourceFactory/Form1.cs b/HotelPms.SourceFactory/Form1.cs
new file mode 100644
index 0000000..228c0b4
--- /dev/null
+++ b/HotelPms.SourceFactory/Form1.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace HotelPms.SourceFactory
+{
+ public partial class Form1 : Form
+ {
+ public Form1()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/HotelPms.SourceFactory/Form1.resx b/HotelPms.SourceFactory/Form1.resx
new file mode 100644
index 0000000..8b2ff64
--- /dev/null
+++ b/HotelPms.SourceFactory/Form1.resx
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root>
\ No newline at end of file
diff --git a/HotelPms.SourceFactory/Form2.Designer.cs b/HotelPms.SourceFactory/Form2.Designer.cs
new file mode 100644
index 0000000..04be5f6
--- /dev/null
+++ b/HotelPms.SourceFactory/Form2.Designer.cs
@@ -0,0 +1,39 @@
+namespace HotelPms.SourceFactory
+{
+ partial class Form2
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.components = new System.ComponentModel.Container();
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(800, 450);
+ this.Text = "Form2";
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.SourceFactory/Form2.cs b/HotelPms.SourceFactory/Form2.cs
new file mode 100644
index 0000000..7a3224c
--- /dev/null
+++ b/HotelPms.SourceFactory/Form2.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace HotelPms.SourceFactory
+{
+ public partial class Form2 : Form
+ {
+ public Form2()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/HotelPms.SourceFactory/Form2.resx b/HotelPms.SourceFactory/Form2.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/HotelPms.SourceFactory/Form2.resx
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root>
\ No newline at end of file
diff --git a/HotelPms.SourceFactory/FormEdge.Designer.cs b/HotelPms.SourceFactory/FormEdge.Designer.cs
new file mode 100644
index 0000000..b79d3aa
--- /dev/null
+++ b/HotelPms.SourceFactory/FormEdge.Designer.cs
@@ -0,0 +1,171 @@
+
+namespace HotelPms.SourceFactory
+{
+ partial class FormEdge
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.panel1 = new System.Windows.Forms.Panel();
+ this.button3 = new System.Windows.Forms.Button();
+ this.button2 = new System.Windows.Forms.Button();
+ this.button1 = new System.Windows.Forms.Button();
+ this.textBox1 = new System.Windows.Forms.TextBox();
+ this.panel2 = new System.Windows.Forms.Panel();
+ this.webView21 = new Microsoft.Web.WebView2.WinForms.WebView2();
+ this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
+ this.button4 = new System.Windows.Forms.Button();
+ this.pnlMain.SuspendLayout();
+ this.panel1.SuspendLayout();
+ this.panel2.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.webView21)).BeginInit();
+ this.SuspendLayout();
+ //
+ // pnlMain
+ //
+ this.pnlMain.Controls.Add(this.panel2);
+ this.pnlMain.Controls.Add(this.panel1);
+ this.pnlMain.Size = new System.Drawing.Size(820, 492);
+ //
+ // LoadingObj
+ //
+ this.LoadingObj.Size = new System.Drawing.Size(820, 492);
+ //
+ // panel1
+ //
+ this.panel1.Controls.Add(this.button4);
+ this.panel1.Controls.Add(this.button3);
+ this.panel1.Controls.Add(this.button2);
+ this.panel1.Controls.Add(this.button1);
+ this.panel1.Controls.Add(this.textBox1);
+ this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.panel1.Location = new System.Drawing.Point(0, 0);
+ this.panel1.Name = "panel1";
+ this.panel1.Size = new System.Drawing.Size(820, 113);
+ this.panel1.TabIndex = 0;
+ //
+ // button3
+ //
+ this.button3.Location = new System.Drawing.Point(685, 11);
+ this.button3.Name = "button3";
+ this.button3.Size = new System.Drawing.Size(119, 39);
+ this.button3.TabIndex = 3;
+ this.button3.Text = "Print PDF";
+ this.button3.UseVisualStyleBackColor = true;
+ this.button3.Click += new System.EventHandler(this.button3_Click);
+ //
+ // button2
+ //
+ this.button2.Location = new System.Drawing.Point(556, 11);
+ this.button2.Name = "button2";
+ this.button2.Size = new System.Drawing.Size(119, 39);
+ this.button2.TabIndex = 2;
+ this.button2.Text = "PDF";
+ this.button2.UseVisualStyleBackColor = true;
+ this.button2.Click += new System.EventHandler(this.button2_Click);
+ //
+ // button1
+ //
+ this.button1.Location = new System.Drawing.Point(419, 11);
+ this.button1.Name = "button1";
+ this.button1.Size = new System.Drawing.Size(119, 39);
+ this.button1.TabIndex = 1;
+ this.button1.Text = "GO";
+ this.button1.UseVisualStyleBackColor = true;
+ this.button1.Click += new System.EventHandler(this.button1_Click);
+ //
+ // textBox1
+ //
+ this.textBox1.Location = new System.Drawing.Point(12, 27);
+ this.textBox1.Name = "textBox1";
+ this.textBox1.Size = new System.Drawing.Size(392, 23);
+ this.textBox1.TabIndex = 0;
+ //
+ // panel2
+ //
+ this.panel2.Controls.Add(this.webView21);
+ this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.panel2.Location = new System.Drawing.Point(0, 113);
+ this.panel2.Name = "panel2";
+ this.panel2.Size = new System.Drawing.Size(820, 379);
+ this.panel2.TabIndex = 1;
+ //
+ // webView21
+ //
+ this.webView21.AllowExternalDrop = true;
+ this.webView21.CreationProperties = null;
+ this.webView21.DefaultBackgroundColor = System.Drawing.Color.White;
+ this.webView21.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.webView21.Location = new System.Drawing.Point(0, 0);
+ this.webView21.Name = "webView21";
+ this.webView21.Size = new System.Drawing.Size(820, 379);
+ this.webView21.TabIndex = 0;
+ this.webView21.ZoomFactor = 1D;
+ //
+ // openFileDialog1
+ //
+ this.openFileDialog1.FileName = "openFileDialog1";
+ //
+ // button4
+ //
+ this.button4.Location = new System.Drawing.Point(678, 63);
+ this.button4.Name = "button4";
+ this.button4.Size = new System.Drawing.Size(121, 38);
+ this.button4.TabIndex = 4;
+ this.button4.Text = "js Print";
+ this.button4.UseVisualStyleBackColor = true;
+ this.button4.Click += new System.EventHandler(this.button4_Click);
+ //
+ // FormEdge
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(822, 529);
+ this.Name = "FormEdge";
+ this.Text = "FormEdge";
+ this.Load += new System.EventHandler(this.FormEdge_Load);
+ this.pnlMain.ResumeLayout(false);
+ this.panel1.ResumeLayout(false);
+ this.panel1.PerformLayout();
+ this.panel2.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.webView21)).EndInit();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Panel panel1;
+ private System.Windows.Forms.Panel panel2;
+ private System.Windows.Forms.Button button1;
+ private System.Windows.Forms.TextBox textBox1;
+ private Microsoft.Web.WebView2.WinForms.WebView2 webView21;
+ private Button button3;
+ private Button button2;
+ private OpenFileDialog openFileDialog1;
+ private Button button4;
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.SourceFactory/FormEdge.cs b/HotelPms.SourceFactory/FormEdge.cs
new file mode 100644
index 0000000..296a0c0
--- /dev/null
+++ b/HotelPms.SourceFactory/FormEdge.cs
@@ -0,0 +1,190 @@
+using ClosedXML.Excel;
+using HotelPms.Share.Windows.Util;
+using Microsoft.Web.WebView2.Core;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Security.Policy;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace HotelPms.SourceFactory
+{
+ public partial class FormEdge : FormBase
+ {
+ public FormEdge()
+ {
+ InitializeComponent();
+ //webView21.Source = new Uri("https://www.google.co.jp");
+ webView21.CoreWebView2InitializationCompleted += new System.EventHandler<Microsoft.Web.WebView2.Core.CoreWebView2InitializationCompletedEventArgs>(webView21_CoreWebView2InitializationCompleted);
+ }
+
+ private string ConvertExcelToHtml(string filePath)
+ {
+ var sb = new StringBuilder();
+ sb.AppendLine("<html><head><meta charset='UTF-8'><style>table, th, td { border: 1px solid black; border-collapse: collapse; padding: 4px; }</style></head><body>");
+
+ using var workbook = new XLWorkbook(filePath);
+ var worksheet = workbook.Worksheet(1);
+ var range = worksheet.RangeUsed();
+
+ sb.AppendLine("<table>");
+ foreach (var row in range.Rows())
+ {
+ sb.AppendLine("<tr>");
+ foreach (var cell in row.Cells())
+ {
+ sb.Append("<td>").Append(cell.GetValue<string>()).Append("</td>");
+ }
+ sb.AppendLine("</tr>");
+ }
+ sb.AppendLine("</table></body></html>");
+ return sb.ToString();
+ }
+
+
+ private void button1_Click(object sender, EventArgs e)
+ {
+ if (webView21 != null && webView21.CoreWebView2 != null)
+ {
+ //string html = ConvertExcelToHtml(@"D:\Pms\HotelPms\HotelPms.SourceFactory\PivotTables.xlsx");
+ //string tempPath = Path.Combine(Path.GetTempPath(), "excel_preview.html");
+ //File.WriteAllText(tempPath, html, Encoding.UTF8);
+ //webView21.Source = new Uri(tempPath);
+
+ var bytes = File.ReadAllBytes(@"D:\Pms\HotelPms\HotelPms.SourceFactory\PivotTables.xlsx");
+ var base64 = Convert.ToBase64String(bytes);
+ webView21.CoreWebView2.ExecuteScriptAsync($"loadExcelFromBase64('{base64}')");
+ //webView21.CoreWebView2.Navigate(textBox1.Text);
+ }
+ }
+
+ private string GenerateSheetJSTemplate()
+ {
+ return @"<!DOCTYPE html>
+<html>
+<head>
+ <meta charset='UTF-8'>
+ <script src='https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.18.5/xlsx.full.min.js'></script>
+</head>
+<body>
+ <h2>Excel Preview (SheetJS)</h2>
+ <select id='sheetSelector' onchange='renderSheet()'></select>
+ <div id='excelContent'></div>
+
+ <script>
+ let workbook = null;
+
+ function loadExcelFromBase64(base64) {
+ const binary = atob(base64);
+ const len = binary.length;
+ const bytes = new Uint8Array(len);
+ for (let i = 0; i < len; i++) {
+ bytes[i] = binary.charCodeAt(i);
+ }
+ workbook = XLSX.read(bytes, { type: 'array' });
+
+ const selector = document.getElementById('sheetSelector');
+ selector.innerHTML = '';
+ workbook.SheetNames.forEach(name => {
+ const opt = document.createElement('option');
+ opt.value = name;
+ opt.text = name;
+ selector.appendChild(opt);
+ });
+ renderSheet();
+ }
+
+ function renderSheet() {
+ const name = document.getElementById('sheetSelector').value;
+ const ws = workbook.Sheets[name];
+ const html = XLSX.utils.sheet_to_html(ws);
+ document.getElementById('excelContent').innerHTML = html;
+ }
+ </script>
+</body>
+</html>";
+ }
+
+ //private bool bInitialized = false;
+
+ private void webView21_CoreWebView2InitializationCompleted(object sender, Microsoft.Web.WebView2.Core.CoreWebView2InitializationCompletedEventArgs e)
+ {
+ //bInitialized = true;
+ webView21.CoreWebView2.NavigationCompleted += webView21_NavigationCompleted;
+ webView21.CoreWebView2.AddWebResourceRequestedFilter("*", Microsoft.Web.WebView2.Core.CoreWebView2WebResourceContext.All);
+ webView21.CoreWebView2.WebResourceRequested += webView21_WebResourceRequested;
+ webView21.CoreWebView2.WebResourceResponseReceived += webView21_WebResourceResponseReceived;
+
+ string html = GenerateSheetJSTemplate();
+ string templatePath = Path.Combine(Path.GetTempPath(), "excel_viewer_sheetjs.html");
+ File.WriteAllText(templatePath, html);
+ webView21.Source = new Uri(templatePath);
+ }
+
+ private void webView21_NavigationCompleted(object sender, Microsoft.Web.WebView2.Core.CoreWebView2NavigationCompletedEventArgs e)
+ {
+ System.Diagnostics.Debug.Print("NavigationCompleted");
+ }
+ private void webView21_WebResourceRequested(object sender, Microsoft.Web.WebView2.Core.CoreWebView2WebResourceRequestedEventArgs e)
+ {
+ System.Diagnostics.Debug.Print("WebResourceRequested");
+ System.Diagnostics.Debug.Print(e.Request.Uri);
+ // Add other Debug.Print...
+ }
+ private void webView21_WebResourceResponseReceived(object sender, Microsoft.Web.WebView2.Core.CoreWebView2WebResourceResponseReceivedEventArgs e)
+ {
+ System.Diagnostics.Debug.Print("WebResourceResponseReceived");
+ // Add other Debug.Print...
+ }
+
+
+ private async void FormEdge_Load(object sender, EventArgs e)
+ {
+ LoadingObj.ShowWaiting();
+ await webView21.EnsureCoreWebView2Async();
+ await webView21.CoreWebView2.Profile.ClearBrowsingDataAsync();
+ //webView21.CoreWebView2.Navigate("http://comtab.jp");
+ LoadingObj.CloseWaiting();
+ }
+
+ private string url = string.Empty;
+
+ private void button2_Click(object sender, EventArgs e)
+ {
+ if (openFileDialog1.ShowDialog() != DialogResult.OK) { return; }
+ url = openFileDialog1.FileName;
+
+ LoadingObj.ShowWaiting();
+ webView21.CoreWebView2.Navigate(url);
+ LoadingObj.CloseWaiting();
+ }
+
+ private async void button3_Click(object sender, EventArgs e)
+ {
+ CoreWebView2PrintSettings printSettings = webView21.CoreWebView2.Environment.CreatePrintSettings();
+ //printSettings.Orientation = CoreWebView2PrintOrientation.Landscape;
+ //printSettings.PrinterName = "Microsoft Print to PDF";
+ //printSettings.Orientation = CoreWebView2PrintOrientation.Portrait;
+
+ printSettings.PrinterName = "RICOH imagio MP C2800";
+ printSettings.MediaSize = CoreWebView2PrintMediaSize.Custom;
+ printSettings.PageHeight = 11.69; // A4 paper size
+ printSettings.PageWidth = 8.27;
+ printSettings.MarginLeft = 0;
+ printSettings.MarginTop = 0;
+ //printSettings.ShouldPrintBackgrounds = true;
+ //var result = await webView21.CoreWebView2.PrintToPdfAsync(url, printSettings);
+ var result = await webView21.CoreWebView2.PrintAsync(printSettings);
+ }
+
+ private void button4_Click(object sender, EventArgs e)
+ {
+ webView21.CoreWebView2.ExecuteScriptAsync("window.print();");
+ }
+ }
+}
diff --git a/HotelPms.SourceFactory/FormEdge.resx b/HotelPms.SourceFactory/FormEdge.resx
new file mode 100644
index 0000000..4a03187
--- /dev/null
+++ b/HotelPms.SourceFactory/FormEdge.resx
@@ -0,0 +1,63 @@
+<root>
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <metadata name="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>17, 17</value>
+ </metadata>
+</root>
\ No newline at end of file
diff --git a/HotelPms.SourceFactory/FormExProperty.Designer.cs b/HotelPms.SourceFactory/FormExProperty.Designer.cs
new file mode 100644
index 0000000..54804f9
--- /dev/null
+++ b/HotelPms.SourceFactory/FormExProperty.Designer.cs
@@ -0,0 +1,105 @@
+
+namespace HotelPms.SourceFactory
+{
+ partial class FormExProperty
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.label1 = new System.Windows.Forms.Label();
+ this.textBox1 = new System.Windows.Forms.TextBox();
+ this.textBox2 = new System.Windows.Forms.TextBox();
+ this.textBox3 = new System.Windows.Forms.TextBox();
+ this.button1 = new System.Windows.Forms.Button();
+ this.SuspendLayout();
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(349, 24);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(38, 15);
+ this.label1.TabIndex = 0;
+ this.label1.Text = "label1";
+ //
+ // textBox1
+ //
+ this.textBox1.Location = new System.Drawing.Point(342, 54);
+ this.textBox1.Name = "textBox1";
+ this.textBox1.Size = new System.Drawing.Size(229, 23);
+ this.textBox1.TabIndex = 1;
+ //
+ // textBox2
+ //
+ this.textBox2.Location = new System.Drawing.Point(331, 90);
+ this.textBox2.Name = "textBox2";
+ this.textBox2.Size = new System.Drawing.Size(272, 23);
+ this.textBox2.TabIndex = 2;
+ //
+ // textBox3
+ //
+ this.textBox3.Location = new System.Drawing.Point(365, 144);
+ this.textBox3.Name = "textBox3";
+ this.textBox3.Size = new System.Drawing.Size(272, 23);
+ this.textBox3.TabIndex = 3;
+ //
+ // button1
+ //
+ this.button1.Location = new System.Drawing.Point(456, 232);
+ this.button1.Name = "button1";
+ this.button1.Size = new System.Drawing.Size(232, 62);
+ this.button1.TabIndex = 4;
+ this.button1.Text = "button1";
+ this.button1.UseVisualStyleBackColor = true;
+ this.button1.Click += new System.EventHandler(this.button1_Click);
+ //
+ // FormExProperty
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(800, 450);
+ this.Controls.Add(this.button1);
+ this.Controls.Add(this.textBox3);
+ this.Controls.Add(this.textBox2);
+ this.Controls.Add(this.textBox1);
+ this.Controls.Add(this.label1);
+ this.Name = "FormExProperty";
+ this.Text = "FormExProperty";
+ this.Load += new System.EventHandler(this.FormExProperty_Load);
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.TextBox textBox1;
+ private System.Windows.Forms.TextBox textBox2;
+ private System.Windows.Forms.TextBox textBox3;
+ private System.Windows.Forms.Button button1;
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.SourceFactory/FormExProperty.cs b/HotelPms.SourceFactory/FormExProperty.cs
new file mode 100644
index 0000000..5d4ee25
--- /dev/null
+++ b/HotelPms.SourceFactory/FormExProperty.cs
@@ -0,0 +1,53 @@
+using HotelPms.Share.Windows.Component;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace HotelPms.SourceFactory
+{
+ public partial class FormExProperty : Form
+ {
+ public FormExProperty()
+ {
+ InitializeComponent();
+ }
+
+ private void FormExProperty_Load(object sender, EventArgs e)
+ {
+ var item = new ControlPropertyEx();
+ item.Addition.Add("NameEx", label1.Name + "__ex");
+ item.Addition.Add("Count", label1.Handle.ToInt32());
+ item.Addition.Add("UpdateDate", DateTime.Now);
+ ControlPropertyEx.Data.Add(label1, item);
+
+ item = new ControlPropertyEx();
+ item.Addition.Add("NameEx", textBox1.Name + "__ex");
+ item.Addition.Add("Count", textBox1.Handle.ToInt32());
+ item.Addition.Add("UpdateDate", DateTime.Now);
+ ControlPropertyEx.Data.Add(textBox1, item);
+
+ item = new ControlPropertyEx();
+ item.Addition.Add("NameEx", textBox2.Name + "__ex");
+ item.Addition.Add("Count", textBox2.Handle.ToInt32());
+ item.Addition.Add("UpdateDate", DateTime.Now);
+ ControlPropertyEx.Data.Add(textBox2, item);
+
+ item = new ControlPropertyEx();
+ item.Addition.Add("NameEx", textBox3.Name + "__ex");
+ item.Addition.Add("Count", textBox3.Handle.ToInt32());
+ item.Addition.Add("UpdateDate", DateTime.Now);
+ ControlPropertyEx.Data.Add(textBox3, item);
+ }
+
+ private void button1_Click(object sender, EventArgs e)
+ {
+ MessageBox.Show(textBox2.GetPropertyData().ToString());
+ }
+ }
+}
diff --git a/HotelPms.SourceFactory/FormExProperty.resx b/HotelPms.SourceFactory/FormExProperty.resx
new file mode 100644
index 0000000..f298a7b
--- /dev/null
+++ b/HotelPms.SourceFactory/FormExProperty.resx
@@ -0,0 +1,60 @@
+<root>
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root>
\ No newline at end of file
diff --git a/HotelPms.SourceFactory/FormGdi.Designer.cs b/HotelPms.SourceFactory/FormGdi.Designer.cs
new file mode 100644
index 0000000..622e7a2
--- /dev/null
+++ b/HotelPms.SourceFactory/FormGdi.Designer.cs
@@ -0,0 +1,196 @@
+
+namespace HotelPms.SourceFactory
+{
+ partial class FormGdi
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.textBox1 = new System.Windows.Forms.TextBox();
+ this.panel1 = new System.Windows.Forms.Panel();
+ this.panel2 = new System.Windows.Forms.Panel();
+ this.button1 = new System.Windows.Forms.Button();
+ this.textBox2 = new System.Windows.Forms.TextBox();
+ this.textBox3 = new System.Windows.Forms.TextBox();
+ this.button2 = new System.Windows.Forms.Button();
+ this.label1 = new System.Windows.Forms.Label();
+ this.label2 = new System.Windows.Forms.Label();
+ this.textBox4 = new System.Windows.Forms.TextBox();
+ this.textBox5 = new System.Windows.Forms.TextBox();
+ this.panel3 = new System.Windows.Forms.Panel();
+ this.SuspendLayout();
+ //
+ // textBox1
+ //
+ this.textBox1.Location = new System.Drawing.Point(81, 12);
+ this.textBox1.Name = "textBox1";
+ this.textBox1.Size = new System.Drawing.Size(271, 23);
+ this.textBox1.TabIndex = 0;
+ //
+ // panel1
+ //
+ this.panel1.BackColor = System.Drawing.Color.Red;
+ this.panel1.Location = new System.Drawing.Point(27, 180);
+ this.panel1.Name = "panel1";
+ this.panel1.Size = new System.Drawing.Size(307, 186);
+ this.panel1.TabIndex = 1;
+ this.panel1.DoubleClick += new System.EventHandler(this.panel2_DoubleClick);
+ this.panel1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel2_MouseDown);
+ this.panel1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.panel2_MouseMove);
+ this.panel1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.panel2_MouseUp);
+ //
+ // panel2
+ //
+ this.panel2.BackColor = System.Drawing.Color.Lime;
+ this.panel2.Location = new System.Drawing.Point(382, 196);
+ this.panel2.Name = "panel2";
+ this.panel2.Size = new System.Drawing.Size(160, 126);
+ this.panel2.TabIndex = 2;
+ this.panel2.DoubleClick += new System.EventHandler(this.panel2_DoubleClick);
+ this.panel2.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel2_MouseDown);
+ this.panel2.MouseMove += new System.Windows.Forms.MouseEventHandler(this.panel2_MouseMove);
+ this.panel2.MouseUp += new System.Windows.Forms.MouseEventHandler(this.panel2_MouseUp);
+ //
+ // button1
+ //
+ this.button1.Location = new System.Drawing.Point(362, 7);
+ this.button1.Name = "button1";
+ this.button1.Size = new System.Drawing.Size(137, 31);
+ this.button1.TabIndex = 3;
+ this.button1.Text = "判断";
+ this.button1.UseVisualStyleBackColor = true;
+ this.button1.Click += new System.EventHandler(this.button1_Click);
+ //
+ // textBox2
+ //
+ this.textBox2.Location = new System.Drawing.Point(81, 44);
+ this.textBox2.Name = "textBox2";
+ this.textBox2.Size = new System.Drawing.Size(271, 23);
+ this.textBox2.TabIndex = 4;
+ //
+ // textBox3
+ //
+ this.textBox3.Location = new System.Drawing.Point(81, 73);
+ this.textBox3.Name = "textBox3";
+ this.textBox3.Size = new System.Drawing.Size(271, 23);
+ this.textBox3.TabIndex = 5;
+ //
+ // button2
+ //
+ this.button2.Location = new System.Drawing.Point(505, 7);
+ this.button2.Name = "button2";
+ this.button2.Size = new System.Drawing.Size(137, 31);
+ this.button2.TabIndex = 6;
+ this.button2.Text = "判断2";
+ this.button2.UseVisualStyleBackColor = true;
+ this.button2.Click += new System.EventHandler(this.button2_Click);
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(37, 47);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(17, 15);
+ this.label1.TabIndex = 7;
+ this.label1.Text = "r1";
+ //
+ // label2
+ //
+ this.label2.AutoSize = true;
+ this.label2.Location = new System.Drawing.Point(37, 76);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(17, 15);
+ this.label2.TabIndex = 8;
+ this.label2.Text = "r2";
+ //
+ // textBox4
+ //
+ this.textBox4.Location = new System.Drawing.Point(37, 102);
+ this.textBox4.Name = "textBox4";
+ this.textBox4.Size = new System.Drawing.Size(616, 23);
+ this.textBox4.TabIndex = 9;
+ this.textBox4.Text = "!(r1.Right < r2.Left || r1.Bottom < r2.Top || r2.Right < r1.Left || r2.Bottom < r" +
+ "1.Top)";
+ //
+ // textBox5
+ //
+ this.textBox5.Location = new System.Drawing.Point(37, 131);
+ this.textBox5.Name = "textBox5";
+ this.textBox5.Size = new System.Drawing.Size(616, 23);
+ this.textBox5.TabIndex = 10;
+ //
+ // panel3
+ //
+ this.panel3.Location = new System.Drawing.Point(674, 17);
+ this.panel3.Name = "panel3";
+ this.panel3.Size = new System.Drawing.Size(615, 647);
+ this.panel3.TabIndex = 11;
+ //
+ // FormGdi
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(1306, 676);
+ this.Controls.Add(this.panel3);
+ this.Controls.Add(this.textBox5);
+ this.Controls.Add(this.textBox4);
+ this.Controls.Add(this.label2);
+ this.Controls.Add(this.label1);
+ this.Controls.Add(this.button2);
+ this.Controls.Add(this.textBox3);
+ this.Controls.Add(this.textBox2);
+ this.Controls.Add(this.button1);
+ this.Controls.Add(this.panel2);
+ this.Controls.Add(this.panel1);
+ this.Controls.Add(this.textBox1);
+ this.KeyPreview = true;
+ this.Name = "FormGdi";
+ this.Text = "FormGdi";
+ this.Paint += new System.Windows.Forms.PaintEventHandler(this.Form1_Paint);
+ this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FormGdi_KeyDown);
+ this.MouseClick += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseClick);
+ this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseMove);
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.TextBox textBox1;
+ private System.Windows.Forms.Panel panel1;
+ private System.Windows.Forms.Panel panel2;
+ private System.Windows.Forms.Button button1;
+ private System.Windows.Forms.TextBox textBox2;
+ private System.Windows.Forms.TextBox textBox3;
+ private System.Windows.Forms.Button button2;
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.TextBox textBox4;
+ private System.Windows.Forms.TextBox textBox5;
+ private System.Windows.Forms.Panel panel3;
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.SourceFactory/FormGdi.cs b/HotelPms.SourceFactory/FormGdi.cs
new file mode 100644
index 0000000..989977a
--- /dev/null
+++ b/HotelPms.SourceFactory/FormGdi.cs
@@ -0,0 +1,351 @@
+using HotelPms.Share.Windows.GraphicsApi;
+using HotelPms.Share.Windows.Util;
+//using NetTopologySuite.Operation.Buffer;
+using Org.BouncyCastle.Bcpg;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+//using Topology = NetTopologySuite.Geometries;
+
+namespace HotelPms.SourceFactory
+{
+ public partial class FormGdi : Form
+ {
+ // 存储当鼠标在PictureBox中左键按下的位置,相对于PictureBox左上角坐标点的位置来讲。
+ private Point mouseDownPoint = new Point();
+ private bool isDown = false;
+
+ Region r = new System.Drawing.Region();
+ PointF start = PointF.Empty;
+ PointF continues = PointF.Empty;
+ PointF end = PointF.Empty;
+ int isDrawing = 0;
+ List<List<PointF>> drawpaths = new List<List<PointF>>();
+ List<PointF> drawpathtemp = new List<PointF>();
+
+
+ public FormGdi()
+ {
+ InitializeComponent();
+ }
+
+ private void button1_Click(object sender, EventArgs e)
+ {
+ Rectangle r1 = new Rectangle(panel1.Location, panel1.Size);
+ Rectangle r2 = new Rectangle(panel2.Location, panel2.Size);
+ textBox2.Text = $"({r1.Left}, {r1.Top})-({r1.Right},{r1.Bottom})";
+ textBox3.Text = $"({r2.Left}, {r2.Top})-({r2.Right},{r2.Bottom})";
+ textBox1.Text = Overlap.RectRect(r1, r2) ? "相交" : "分离";
+
+ textBox5.Text = $"!({r1.Right} < {r2.Left} || {r1.Bottom} < {r2.Top} || {r2.Right} < {r1.Left} || {r2.Bottom} < {r1.Top})";
+ }
+
+ private void button2_Click(object sender, EventArgs e)
+ {
+ Rectangle r1 = new Rectangle(panel1.Location, panel1.Size);
+ Rectangle r2 = new Rectangle(panel2.Location, panel2.Size);
+ textBox2.Text = $"({r1.Left}, {r1.Top})-({r1.Right},{r1.Bottom})";
+ textBox3.Text = $"({r2.Left}, {r2.Top})-({r2.Right},{r2.Bottom})";
+ textBox1.Text = Overlap.RectRect2(r1, r2) ? "相交" : "分离";
+ textBox5.Text = string.Empty;
+ }
+
+ private void panel2_MouseDown(object sender, MouseEventArgs e)
+ {
+ isDown = true;
+ if (e.Button == System.Windows.Forms.MouseButtons.Left)
+ {
+ mouseDownPoint = e.Location;
+ }
+ }
+
+ private void panel2_MouseMove(object sender, MouseEventArgs e)
+ {
+ if (isDown)
+ {
+ Panel obj = sender as Panel;
+
+ //PointToClient 将指定屏幕点的位置计算成工作区坐标(控件内)。坐标原点为黄色区域(控件)左上角,X轴方向从左到右,Y轴方向从上到下,坐标单位为像素;
+
+ //PointToScreen 将指定工作区点的位置计算成屏幕坐标。坐标原点在屏幕左上角,X轴方向从左到右,Y轴方向从上到下,坐标单位为像素。
+
+ //1、PointToClient(Point p)
+ //这里的p,坐标原点为Screen左上角,即(0, 0)。
+ //它计算以当前Control的位置在Screen位置为坐标原点,返回p相对于坐标原点的值。
+ //如上图例,btn在screen中位置为(328, 188),那么,screen上点(10, 10)相对于(320, 188)即为结果(-318, -178),同理screen上点(0, 0)相对于pnl来说,是(-183, -185)。
+ //Control在Screen上点计算方式为:窗体Location加上其各级Parent的Location。
+
+ //2、PointToScreen(Point p)
+ //这里的p,坐标原点相对于Control的Location。
+ //这是求p于Control的Locaton在Screen上点迭加结果。
+ //如上例,pnl相对于窗体位置为(80, 60),其加上窗体Location(200, 100),再加上边框宽度3、标题栏高度25,即得185。
+ //btn.PointToScreen(new Point(30, 20)): { X = 358,Y = 208}
+ //此值即为:btn在Screen上位置(328, 188)加上(30, 20)所得。
+
+ // 先获取到当前鼠标所在位置,并减去鼠标左键按下时相对PictureBox左上角的坐标点,就是当前坐标要停留的坐标点位置。
+ Point point = this.PointToClient(obj.PointToScreen(new Point(e.X - mouseDownPoint.X, e.Y - mouseDownPoint.Y)));
+ obj.Location = point;
+ }
+ }
+
+ private void panel2_MouseUp(object sender, MouseEventArgs e)
+ {
+ if (isDown)
+ {
+ }
+
+ isDown = false;
+ }
+
+ private void Form1_Paint(object sender, PaintEventArgs e)
+ {
+ System.Drawing.Pen pen = new Pen(Color.Red);
+ if (isDrawing == 1)
+ {
+ if (drawpaths.Count >= 1)
+ {
+ foreach (List<PointF> drawpath in drawpaths)
+ {
+ if (drawpath.Count >= 2)
+ {
+ e.Graphics.DrawLines(pen, drawpath.ToArray());
+ if (continues.Equals(PointF.Empty) == false)
+ {
+ e.Graphics.DrawLine(pen, start, continues);
+ }
+ }
+ else
+ {
+ if (continues.Equals(PointF.Empty) == false)
+ {
+ e.Graphics.DrawLine(pen, start, continues);
+ }
+ }
+ }
+ }
+ if (drawpathtemp.Count >= 2)
+ {
+ e.Graphics.DrawLines(pen, drawpathtemp.ToArray());
+ if (continues.Equals(PointF.Empty) == false)
+ {
+ e.Graphics.DrawLine(pen, start, continues);
+ }
+ }
+ else
+ {
+ if (continues.Equals(PointF.Empty) == false)
+ {
+ e.Graphics.DrawLine(pen, start, continues);
+ }
+ }
+ }
+ else if (isDrawing == 0)
+ {
+ foreach (List<PointF> drawpath in drawpaths)
+ {
+ if (drawpath.Count >= 2)
+ {
+ e.Graphics.DrawLines(pen, drawpath.ToArray());
+ }
+ }
+ }
+
+ }
+
+ private void Form1_MouseClick(object sender, MouseEventArgs e)
+ {
+ if (e.Button == MouseButtons.Left)
+ {
+ if (isDrawing == 0)
+ {
+ start = e.Location;
+ isDrawing = 1;
+ drawpathtemp.Add(start);
+ }
+ else if (isDrawing == 1)
+ {
+ start = e.Location;
+ drawpathtemp.Add(start);
+ }
+ else if (isDrawing == 2)
+ {
+
+ }
+ this.Refresh();
+ }
+ if (e.Button == MouseButtons.Right)
+ {
+ if (r.IsVisible(e.Location))
+ {
+ MessageBox.Show("在选中区域内");
+ }
+ else
+ {
+ MessageBox.Show("不在选中区域内");
+ }
+ }
+ }
+
+ private void Form1_MouseMove(object sender, MouseEventArgs e)
+ {
+ if (isDrawing == 1)
+ {
+ continues = e.Location;
+ this.Refresh();
+ }
+
+ }
+
+ private void FormGdi_KeyDown(object sender, KeyEventArgs e)
+ {
+ switch (e.KeyCode)
+ {
+ case Keys.Escape:
+ drawpathtemp.Add(drawpathtemp.ElementAt(0));
+ List<PointF> temp = new List<PointF>();
+ if (drawpathtemp.Count > 2)
+ {
+ temp = drawpathtemp.GetRange(0, drawpathtemp.Count);
+ drawpaths.Add(temp);
+ }
+ drawpathtemp.Clear();
+ start = PointF.Empty;
+ end = PointF.Empty;
+ continues = PointF.Empty;
+ isDrawing = 0;
+ GraphicsPath gp = new GraphicsPath();
+ gp.Reset();
+ foreach (List<PointF> item in drawpaths)
+ {
+ gp.AddPolygon(item.ToArray());
+ r.MakeEmpty();
+ r.Union(gp);
+ }
+ this.Refresh();
+ break;
+ default:
+ break;
+ }
+ }
+
+#if false
+ private PointF[] ToPointF(Topology.Coordinate[] coordinates)
+ {
+ PointF[] pointFs = new PointF[coordinates.Length];
+ int i = 0;
+ foreach (Topology.Coordinate item in coordinates)
+ {
+
+ pointFs[i] = new PointF((float)item.X, (float)item.Y);
+ i++;
+ }
+ return pointFs;
+ }
+
+ private List<PointD> ToPointD(Topology.Coordinate[] coordinates)
+ {
+ List<PointD> pointFs = new List<PointD>();
+ int i = 0;
+ foreach (Topology.Coordinate item in coordinates)
+ {
+
+ pointFs.Add(new PointD(item.X, item.Y));
+ i++;
+ }
+ return pointFs;
+ }
+#endif
+
+ private void panel2_DoubleClick(object sender, EventArgs e)
+ {
+ (sender as Panel).BringToFront();
+ }
+
+#if false
+ private void panel3_Paint(object sender, PaintEventArgs e)
+ {
+ e.Graphics.SmoothingMode = SmoothingMode.AntiAlias; //使绘图质量最高,即消除锯齿
+ //g.InterpolationMode = InterpolationMode.HighQualityBicubic; //要らない!!!
+ //g.CompositingQuality = CompositingQuality.HighQuality; //要らない!!!
+
+ //32.923023515806,130.70006035416
+ //32.933253514755,130.69430969802
+ //32.936999415636,130.7124199733
+ //32.929507455233,130.73954247087
+
+ //double rate = 1D;
+ Topology.LineString ls = new Topology.LineString(
+ new Topology.Coordinate[] {
+ //new Topology.Coordinate { X = 32.923023515806 * rate, Y = 130.70006035416* rate },
+ //new Topology.Coordinate { X = 32.933253514755 * rate, Y = 130.69430969802* rate },
+ //new Topology.Coordinate { X = 32.936999415636 * rate, Y = 130.7124199733* rate },
+ //new Topology.Coordinate { X = 32.929507455233 * rate , Y = 130.73954247087* rate }
+ new Topology.Coordinate { X = 32.923023515806, Y = 130.70006035416 },
+ new Topology.Coordinate { X = 32.933253514755, Y = 130.69430969802 },
+ new Topology.Coordinate { X = 32.936999415636, Y = 130.7124199733 },
+ new Topology.Coordinate { X = 32.929507455233 , Y = 130.73954247087 }
+ //new Topology.Coordinate { X = 25, Y = 28 },
+ //new Topology.Coordinate { X = 200, Y = 32 },
+ //new Topology.Coordinate { X = 250, Y = 326 },
+ //new Topology.Coordinate { X = 350, Y = 326 },
+ //new Topology.Coordinate { X = 350, Y = 426 },
+ //new Topology.Coordinate { X = 150, Y = 476 }
+ });
+ //Topology.Polygon result = ls.Buffer(10, NetTopologySuite.Operation.Buffer.EndCapStyle.Flat) as Topology.Polygon;
+
+ PointF[] pointFs = ToPointF(ls.Coordinates);
+ e.Graphics.DrawLines(new Pen(Color.Red, 3), pointFs);
+ //pointFs = ToPointF(result.Coordinates);
+ //e.Graphics.DrawPolygon(new Pen(Color.Blue, 3), pointFs);
+
+ List<PointD> pointDs = ToPointD(ls.Coordinates);
+ List<PointD> r1 = Geometry.OffsetCoords(pointDs, 0.0005) as List<PointD>;
+ StringBuilder text = new StringBuilder();
+ foreach (PointD item in r1)
+ {
+ text.AppendLine("{" + $" lat: {item.X}, lng: {item.Y} " + "},");
+ }
+ System.Diagnostics.Debug.WriteLine(text.ToString());
+
+ e.Graphics.DrawLines(new Pen(Color.Green, 3), PointD.ToPointF(r1).ToArray());
+
+ List<PointD> r2 = Geometry.OffsetCoords(pointDs, -0.0005) as List<PointD>;
+ StringBuilder text1 = new StringBuilder();
+ foreach (PointD item in r2)
+ {
+ text1.AppendLine("{" + $" lat: {item.X}, lng: {item.Y} " + "},");
+ }
+ System.Diagnostics.Debug.WriteLine(text1.ToString());
+ e.Graphics.DrawLines(new Pen(Color.Green, 3), PointD.ToPointF(r2).ToArray());
+
+ r2.Reverse();
+ r1.AddRange(r2);
+
+ StringBuilder text2 = new StringBuilder();
+ foreach (PointD item in r1)
+ {
+ text2.AppendLine("{" + $" lat: {item.X}, lng: {item.Y} " + "},");
+ }
+ System.Diagnostics.Debug.WriteLine(text2.ToString());
+
+ StringBuilder text3 = new StringBuilder();
+ foreach (PointD item in r1)
+ {
+ text3.AppendLine($"{item.X},{item.Y}");
+ }
+ System.Diagnostics.Debug.WriteLine(text3.ToString());
+
+ e.Graphics.DrawPolygon(new Pen(Color.Blue, 3), PointD.ToPointF(r1).ToArray());
+
+ e.Graphics.SmoothingMode = SmoothingMode.Default;
+ }
+#endif
+ }
+}
diff --git a/HotelPms.SourceFactory/FormGdi.resx b/HotelPms.SourceFactory/FormGdi.resx
new file mode 100644
index 0000000..f298a7b
--- /dev/null
+++ b/HotelPms.SourceFactory/FormGdi.resx
@@ -0,0 +1,60 @@
+<root>
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root>
\ No newline at end of file
diff --git a/HotelPms.SourceFactory/FormMain.Designer.cs b/HotelPms.SourceFactory/FormMain.Designer.cs
new file mode 100644
index 0000000..b357521
--- /dev/null
+++ b/HotelPms.SourceFactory/FormMain.Designer.cs
@@ -0,0 +1,645 @@
+
+namespace HotelPms.SourceFactory
+{
+ partial class FormMain
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormMain));
+ panel1 = new Panel();
+ button29 = new Button();
+ button28 = new Button();
+ button27 = new Button();
+ button26 = new Button();
+ button25 = new Button();
+ button24 = new Button();
+ button23 = new Button();
+ button22 = new Button();
+ button21 = new Button();
+ button20 = new Button();
+ button19 = new Button();
+ button18 = new Button();
+ textBox3 = new TextBox();
+ button17 = new Button();
+ button16 = new Button();
+ button15 = new Button();
+ button14 = new Button();
+ button13 = new Button();
+ button12 = new Button();
+ button11 = new Button();
+ button10 = new Button();
+ button9 = new Button();
+ button8 = new Button();
+ button7 = new Button();
+ button5 = new Button();
+ button4 = new Button();
+ button3 = new Button();
+ textBox1 = new TextBox();
+ button2 = new Button();
+ button1 = new Button();
+ panel2 = new Panel();
+ tabControl1 = new TabControl();
+ tabPage1 = new TabPage();
+ panel4 = new Panel();
+ richTextBox1 = new RichTextBox();
+ panel3 = new Panel();
+ textBox2 = new TextBox();
+ label1 = new Label();
+ numericUpDown2 = new NumericUpDown();
+ numericUpDown1 = new NumericUpDown();
+ button6 = new Button();
+ tabPage2 = new TabPage();
+ button30 = new Button();
+ pnlMain.SuspendLayout();
+ panel1.SuspendLayout();
+ panel2.SuspendLayout();
+ tabControl1.SuspendLayout();
+ tabPage1.SuspendLayout();
+ panel4.SuspendLayout();
+ panel3.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)numericUpDown2).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)numericUpDown1).BeginInit();
+ SuspendLayout();
+ //
+ // pnlMain
+ //
+ pnlMain.Controls.Add(panel2);
+ pnlMain.Controls.Add(panel1);
+ pnlMain.Size = new Size(1004, 609);
+ //
+ // LoadingObj
+ //
+ LoadingObj.Alpha = 200;
+ LoadingObj.BackColor = Color.FromArgb(224, 224, 224);
+ LoadingObj.Size = new Size(1004, 609);
+ //
+ // panel1
+ //
+ panel1.Controls.Add(button30);
+ panel1.Controls.Add(button29);
+ panel1.Controls.Add(button28);
+ panel1.Controls.Add(button27);
+ panel1.Controls.Add(button26);
+ panel1.Controls.Add(button25);
+ panel1.Controls.Add(button24);
+ panel1.Controls.Add(button23);
+ panel1.Controls.Add(button22);
+ panel1.Controls.Add(button21);
+ panel1.Controls.Add(button20);
+ panel1.Controls.Add(button19);
+ panel1.Controls.Add(button18);
+ panel1.Controls.Add(textBox3);
+ panel1.Controls.Add(button17);
+ panel1.Controls.Add(button16);
+ panel1.Controls.Add(button15);
+ panel1.Controls.Add(button14);
+ panel1.Controls.Add(button13);
+ panel1.Controls.Add(button12);
+ panel1.Controls.Add(button11);
+ panel1.Controls.Add(button10);
+ panel1.Controls.Add(button9);
+ panel1.Controls.Add(button8);
+ panel1.Controls.Add(button7);
+ panel1.Controls.Add(button5);
+ panel1.Controls.Add(button4);
+ panel1.Controls.Add(button3);
+ panel1.Controls.Add(textBox1);
+ panel1.Controls.Add(button2);
+ panel1.Controls.Add(button1);
+ panel1.Dock = DockStyle.Top;
+ panel1.Location = new Point(0, 0);
+ panel1.Name = "panel1";
+ panel1.Size = new Size(1004, 282);
+ panel1.TabIndex = 0;
+ //
+ // button29
+ //
+ button29.Location = new Point(718, 187);
+ button29.Name = "button29";
+ button29.Size = new Size(117, 27);
+ button29.TabIndex = 29;
+ button29.Text = "button29";
+ button29.UseVisualStyleBackColor = true;
+ button29.Click += button29_Click;
+ //
+ // button28
+ //
+ button28.Location = new Point(538, 231);
+ button28.Name = "button28";
+ button28.Size = new Size(216, 34);
+ button28.TabIndex = 28;
+ button28.Text = "gRpc To Linux(Grpc Http2)";
+ button28.UseVisualStyleBackColor = true;
+ button28.Click += button28_Click;
+ //
+ // button27
+ //
+ button27.Location = new Point(316, 231);
+ button27.Name = "button27";
+ button27.Size = new Size(216, 34);
+ button27.TabIndex = 27;
+ button27.Text = "gRpc To Linux(GrpcWebHandler)";
+ button27.UseVisualStyleBackColor = true;
+ button27.Click += button27_Click;
+ //
+ // button26
+ //
+ button26.Location = new Point(144, 233);
+ button26.Name = "button26";
+ button26.Size = new Size(144, 35);
+ button26.TabIndex = 26;
+ button26.Text = "Json ⇔ 動態クラス";
+ button26.UseVisualStyleBackColor = true;
+ button26.Click += button26_Click;
+ //
+ // button25
+ //
+ button25.Location = new Point(21, 231);
+ button25.Name = "button25";
+ button25.Size = new Size(97, 34);
+ button25.TabIndex = 25;
+ button25.Text = "DB VersionUp";
+ button25.UseVisualStyleBackColor = true;
+ button25.Click += button25_Click;
+ //
+ // button24
+ //
+ button24.Location = new Point(866, 180);
+ button24.Name = "button24";
+ button24.Size = new Size(107, 34);
+ button24.TabIndex = 24;
+ button24.Text = "Excel Copy";
+ button24.UseVisualStyleBackColor = true;
+ button24.Click += button24_Click;
+ //
+ // button23
+ //
+ button23.Location = new Point(526, 180);
+ button23.Name = "button23";
+ button23.Size = new Size(107, 34);
+ button23.TabIndex = 23;
+ button23.Text = "gRpc To IIS";
+ button23.UseVisualStyleBackColor = true;
+ button23.Click += button23_Click;
+ //
+ // button22
+ //
+ button22.Location = new Point(411, 177);
+ button22.Name = "button22";
+ button22.Size = new Size(97, 35);
+ button22.TabIndex = 22;
+ button22.Text = "gRpc Client";
+ button22.UseVisualStyleBackColor = true;
+ button22.Click += button22_Click;
+ //
+ // button21
+ //
+ button21.Location = new Point(262, 176);
+ button21.Name = "button21";
+ button21.Size = new Size(126, 35);
+ button21.TabIndex = 21;
+ button21.Text = "gRpc Client Async";
+ button21.UseVisualStyleBackColor = true;
+ button21.Click += button21_Click;
+ //
+ // button20
+ //
+ button20.Location = new Point(135, 176);
+ button20.Name = "button20";
+ button20.Size = new Size(97, 35);
+ button20.TabIndex = 20;
+ button20.Text = "Script生成";
+ button20.UseVisualStyleBackColor = true;
+ button20.Click += button20_Click;
+ //
+ // button19
+ //
+ button19.Location = new Point(21, 176);
+ button19.Name = "button19";
+ button19.Size = new Size(97, 35);
+ button19.TabIndex = 19;
+ button19.Text = "ExcelToTable";
+ button19.UseVisualStyleBackColor = true;
+ button19.Click += button19_Click;
+ //
+ // button18
+ //
+ button18.Location = new Point(21, 17);
+ button18.Name = "button18";
+ button18.Size = new Size(117, 25);
+ button18.TabIndex = 18;
+ button18.Text = "button18";
+ button18.UseVisualStyleBackColor = true;
+ button18.Click += button18_Click;
+ //
+ // textBox3
+ //
+ textBox3.Location = new Point(454, 3);
+ textBox3.Name = "textBox3";
+ textBox3.Size = new Size(381, 23);
+ textBox3.TabIndex = 17;
+ textBox3.Text = "2022/12/03";
+ //
+ // button17
+ //
+ button17.Location = new Point(757, 68);
+ button17.Name = "button17";
+ button17.Size = new Size(56, 31);
+ button17.TabIndex = 16;
+ button17.Text = "Three";
+ button17.UseVisualStyleBackColor = true;
+ button17.Click += button17_Click;
+ //
+ // button16
+ //
+ button16.Location = new Point(695, 68);
+ button16.Name = "button16";
+ button16.Size = new Size(56, 31);
+ button16.TabIndex = 15;
+ button16.Text = "One";
+ button16.UseVisualStyleBackColor = true;
+ button16.Click += button16_Click;
+ //
+ // button15
+ //
+ button15.Location = new Point(557, 135);
+ button15.Name = "button15";
+ button15.Size = new Size(143, 35);
+ button15.TabIndex = 14;
+ button15.Text = "GetReader";
+ button15.UseVisualStyleBackColor = true;
+ button15.Click += button15_Click;
+ //
+ // button14
+ //
+ button14.Location = new Point(557, 85);
+ button14.Name = "button14";
+ button14.Size = new Size(97, 35);
+ button14.TabIndex = 13;
+ button14.Text = "SignalR";
+ button14.UseVisualStyleBackColor = true;
+ button14.Click += button14_Click;
+ //
+ // button13
+ //
+ button13.Location = new Point(908, 109);
+ button13.Name = "button13";
+ button13.Size = new Size(64, 60);
+ button13.TabIndex = 12;
+ button13.Text = "Edge";
+ button13.UseVisualStyleBackColor = true;
+ button13.Click += button13_Click;
+ //
+ // button12
+ //
+ button12.BackColor = Color.FromArgb(192, 192, 255);
+ button12.Location = new Point(21, 135);
+ button12.Name = "button12";
+ button12.Size = new Size(194, 35);
+ button12.TabIndex = 11;
+ button12.Text = "Table制御クラスセット生成";
+ button12.UseVisualStyleBackColor = false;
+ button12.Click += button12_Click;
+ //
+ // button11
+ //
+ button11.Location = new Point(240, 135);
+ button11.Name = "button11";
+ button11.Size = new Size(194, 35);
+ button11.TabIndex = 10;
+ button11.Text = "String";
+ button11.UseVisualStyleBackColor = true;
+ button11.Click += button11_Click;
+ //
+ // button10
+ //
+ button10.Location = new Point(240, 85);
+ button10.Name = "button10";
+ button10.Size = new Size(194, 35);
+ button10.TabIndex = 9;
+ button10.Text = "帳票";
+ button10.UseVisualStyleBackColor = true;
+ button10.Click += button10_Click;
+ //
+ // button9
+ //
+ button9.Location = new Point(729, 143);
+ button9.Name = "button9";
+ button9.Size = new Size(157, 28);
+ button9.TabIndex = 8;
+ button9.Text = "拡張プロパティ表示";
+ button9.UseVisualStyleBackColor = true;
+ button9.Click += button9_Click;
+ //
+ // button8
+ //
+ button8.Location = new Point(729, 105);
+ button8.Name = "button8";
+ button8.Size = new Size(157, 28);
+ button8.TabIndex = 7;
+ button8.Text = "拡張プロパティ画面";
+ button8.UseVisualStyleBackColor = true;
+ button8.Click += button8_Click;
+ //
+ // button7
+ //
+ button7.Location = new Point(866, 56);
+ button7.Name = "button7";
+ button7.Size = new Size(106, 31);
+ button7.TabIndex = 6;
+ button7.Text = "button7";
+ button7.UseVisualStyleBackColor = true;
+ button7.Click += button7_Click;
+ //
+ // button5
+ //
+ button5.Location = new Point(454, 134);
+ button5.Name = "button5";
+ button5.Size = new Size(97, 37);
+ button5.TabIndex = 5;
+ button5.Text = "SendMail";
+ button5.UseVisualStyleBackColor = true;
+ button5.Click += button5_Click;
+ //
+ // button4
+ //
+ button4.BackColor = Color.FromArgb(192, 192, 255);
+ button4.Location = new Point(21, 85);
+ button4.Name = "button4";
+ button4.Size = new Size(194, 35);
+ button4.TabIndex = 4;
+ button4.Text = "Gdi Demo";
+ button4.UseVisualStyleBackColor = false;
+ button4.Click += button4_Click;
+ //
+ // button3
+ //
+ button3.Location = new Point(454, 85);
+ button3.Name = "button3";
+ button3.Size = new Size(97, 35);
+ button3.TabIndex = 3;
+ button3.Text = "Excel";
+ button3.UseVisualStyleBackColor = true;
+ button3.Click += button3_Click;
+ //
+ // textBox1
+ //
+ textBox1.Location = new Point(454, 56);
+ textBox1.Name = "textBox1";
+ textBox1.Size = new Size(215, 23);
+ textBox1.TabIndex = 2;
+ //
+ // button2
+ //
+ button2.Cursor = Cursors.Hand;
+ button2.Location = new Point(240, 48);
+ button2.Name = "button2";
+ button2.Size = new Size(194, 31);
+ button2.TabIndex = 1;
+ button2.Text = "PostgreSqlDemo";
+ button2.UseVisualStyleBackColor = true;
+ button2.Click += button2_Click;
+ //
+ // button1
+ //
+ button1.BackColor = Color.FromArgb(192, 192, 255);
+ button1.Location = new Point(21, 48);
+ button1.Name = "button1";
+ button1.Size = new Size(194, 31);
+ button1.TabIndex = 0;
+ button1.Text = "button1";
+ button1.UseVisualStyleBackColor = false;
+ button1.Click += button1_Click;
+ //
+ // panel2
+ //
+ panel2.Controls.Add(tabControl1);
+ panel2.Dock = DockStyle.Fill;
+ panel2.Location = new Point(0, 282);
+ panel2.Name = "panel2";
+ panel2.Size = new Size(1004, 327);
+ panel2.TabIndex = 1;
+ //
+ // tabControl1
+ //
+ tabControl1.Controls.Add(tabPage1);
+ tabControl1.Controls.Add(tabPage2);
+ tabControl1.Dock = DockStyle.Fill;
+ tabControl1.Location = new Point(0, 0);
+ tabControl1.Name = "tabControl1";
+ tabControl1.SelectedIndex = 0;
+ tabControl1.Size = new Size(1004, 327);
+ tabControl1.TabIndex = 0;
+ //
+ // tabPage1
+ //
+ tabPage1.BackColor = Color.FromArgb(43, 43, 43);
+ tabPage1.Controls.Add(panel4);
+ tabPage1.Controls.Add(panel3);
+ tabPage1.Location = new Point(4, 24);
+ tabPage1.Name = "tabPage1";
+ tabPage1.Padding = new Padding(3);
+ tabPage1.Size = new Size(996, 299);
+ tabPage1.TabIndex = 0;
+ tabPage1.Text = "tabPage1";
+ //
+ // panel4
+ //
+ panel4.Controls.Add(richTextBox1);
+ panel4.Dock = DockStyle.Fill;
+ panel4.Location = new Point(3, 75);
+ panel4.Name = "panel4";
+ panel4.Size = new Size(990, 221);
+ panel4.TabIndex = 1;
+ //
+ // richTextBox1
+ //
+ richTextBox1.Dock = DockStyle.Fill;
+ richTextBox1.Location = new Point(0, 0);
+ richTextBox1.Name = "richTextBox1";
+ richTextBox1.Size = new Size(990, 221);
+ richTextBox1.TabIndex = 0;
+ richTextBox1.Text = "";
+ //
+ // panel3
+ //
+ panel3.Controls.Add(textBox2);
+ panel3.Controls.Add(label1);
+ panel3.Controls.Add(numericUpDown2);
+ panel3.Controls.Add(numericUpDown1);
+ panel3.Controls.Add(button6);
+ panel3.Dock = DockStyle.Top;
+ panel3.Location = new Point(3, 3);
+ panel3.Name = "panel3";
+ panel3.Size = new Size(990, 72);
+ panel3.TabIndex = 0;
+ //
+ // textBox2
+ //
+ textBox2.BorderStyle = BorderStyle.FixedSingle;
+ textBox2.Dock = DockStyle.Right;
+ textBox2.Location = new Point(414, 0);
+ textBox2.Multiline = true;
+ textBox2.Name = "textBox2";
+ textBox2.ScrollBars = ScrollBars.Both;
+ textBox2.Size = new Size(576, 72);
+ textBox2.TabIndex = 4;
+ textBox2.Text = resources.GetString("textBox2.Text");
+ //
+ // label1
+ //
+ label1.AutoSize = true;
+ label1.ForeColor = Color.White;
+ label1.Location = new Point(272, 24);
+ label1.Name = "label1";
+ label1.Size = new Size(19, 15);
+ label1.TabIndex = 3;
+ label1.Text = "~";
+ //
+ // numericUpDown2
+ //
+ numericUpDown2.Location = new Point(297, 22);
+ numericUpDown2.Maximum = new decimal(new int[] { 10000, 0, 0, 0 });
+ numericUpDown2.Name = "numericUpDown2";
+ numericUpDown2.Size = new Size(67, 23);
+ numericUpDown2.TabIndex = 2;
+ numericUpDown2.Value = new decimal(new int[] { 7, 0, 0, 0 });
+ //
+ // numericUpDown1
+ //
+ numericUpDown1.Location = new Point(192, 20);
+ numericUpDown1.Maximum = new decimal(new int[] { 10000, 0, 0, 0 });
+ numericUpDown1.Name = "numericUpDown1";
+ numericUpDown1.Size = new Size(67, 23);
+ numericUpDown1.TabIndex = 1;
+ //
+ // button6
+ //
+ button6.Location = new Point(14, 17);
+ button6.Name = "button6";
+ button6.Size = new Size(151, 36);
+ button6.TabIndex = 0;
+ button6.Text = "実行";
+ button6.UseVisualStyleBackColor = true;
+ button6.Click += button6_Click;
+ //
+ // tabPage2
+ //
+ tabPage2.BackColor = Color.FromArgb(43, 43, 43);
+ tabPage2.Location = new Point(4, 24);
+ tabPage2.Name = "tabPage2";
+ tabPage2.Padding = new Padding(3);
+ tabPage2.Size = new Size(996, 299);
+ tabPage2.TabIndex = 1;
+ tabPage2.Text = "tabPage2";
+ //
+ // button30
+ //
+ button30.Location = new Point(810, 231);
+ button30.Name = "button30";
+ button30.Size = new Size(117, 27);
+ button30.TabIndex = 30;
+ button30.Text = "button30";
+ button30.UseVisualStyleBackColor = true;
+ button30.Click += button30_Click;
+ //
+ // FormMain
+ //
+ AutoScaleDimensions = new SizeF(7F, 15F);
+ AutoScaleMode = AutoScaleMode.Font;
+ BackColor = Color.FromArgb(43, 43, 43);
+ ClientSize = new Size(1006, 646);
+ Name = "FormMain";
+ StartPosition = FormStartPosition.CenterScreen;
+ Text = "Form1";
+ Load += FormMain_Load;
+ Shown += FormMain_Shown;
+ KeyDown += FormMain_KeyDown;
+ pnlMain.ResumeLayout(false);
+ panel1.ResumeLayout(false);
+ panel1.PerformLayout();
+ panel2.ResumeLayout(false);
+ tabControl1.ResumeLayout(false);
+ tabPage1.ResumeLayout(false);
+ panel4.ResumeLayout(false);
+ panel3.ResumeLayout(false);
+ panel3.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)numericUpDown2).EndInit();
+ ((System.ComponentModel.ISupportInitialize)numericUpDown1).EndInit();
+ ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Panel panel1;
+ private System.Windows.Forms.Button button1;
+ private System.Windows.Forms.Panel panel2;
+ private System.Windows.Forms.TabControl tabControl1;
+ private System.Windows.Forms.TabPage tabPage1;
+ private System.Windows.Forms.TabPage tabPage2;
+ private System.Windows.Forms.Button button2;
+ private System.Windows.Forms.TextBox textBox1;
+ private System.Windows.Forms.Button button3;
+ private System.Windows.Forms.Button button4;
+ private System.Windows.Forms.Button button5;
+ private System.Windows.Forms.Panel panel4;
+ private System.Windows.Forms.RichTextBox richTextBox1;
+ private System.Windows.Forms.Panel panel3;
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.NumericUpDown numericUpDown2;
+ private System.Windows.Forms.NumericUpDown numericUpDown1;
+ private System.Windows.Forms.Button button6;
+ private System.Windows.Forms.TextBox textBox2;
+ private System.Windows.Forms.Button button7;
+ private System.Windows.Forms.Button button8;
+ private System.Windows.Forms.Button button9;
+ private System.Windows.Forms.Button button10;
+ private System.Windows.Forms.Button button11;
+ private System.Windows.Forms.Button button12;
+ private System.Windows.Forms.Button button13;
+ private System.Windows.Forms.Button button14;
+ private System.Windows.Forms.Button button15;
+ private System.Windows.Forms.Button button16;
+ private System.Windows.Forms.Button button17;
+ private System.Windows.Forms.TextBox textBox3;
+ private System.Windows.Forms.Button button18;
+ private Button button19;
+ private Button button20;
+ private Button button21;
+ private Button button22;
+ private Button button23;
+ private Button button24;
+ private Button button25;
+ private Button button26;
+ private Button button27;
+ private Button button28;
+ private Button button29;
+ private Button button30;
+ }
+}
+
diff --git a/HotelPms.SourceFactory/FormMain.cs b/HotelPms.SourceFactory/FormMain.cs
new file mode 100644
index 0000000..5d00783
--- /dev/null
+++ b/HotelPms.SourceFactory/FormMain.cs
@@ -0,0 +1,724 @@
+using Grpc.Net.Client;
+using Grpc.Net.Client.Web;
+using HotelPms.Data;
+using HotelPms.Data.Client;
+using HotelPms.Data.Common;
+using HotelPms.Data.UseInfo;
+using HotelPms.DataAccessGrpc.Client;
+using HotelPms.Share.Data;
+using HotelPms.Share.NetWork;
+using HotelPms.Share.Util;
+using HotelPms.Share.Windows.Component;
+using HotelPms.Share.Windows.Tool;
+using HotelPms.Share.Windows.Util;
+using HotelPms.SourceFactory.Util;
+using HotelPms.VerUp.DataBase;
+using MailKit.Net.Smtp;
+using MailKit.Security;
+using MimeKit;
+using NPOI.HSSF.UserModel;
+using NPOI.SS.UserModel;
+using NPOI.XSSF.UserModel;
+using System.Data;
+using System.Data.Common;
+using System.Diagnostics;
+using System.IO;
+using System.Text;
+using System.Text.Json;
+
+namespace HotelPms.SourceFactory
+{
+ public partial class FormMain : FormBase
+ {
+ public FormMain()
+ {
+ InitializeComponent();
+ }
+
+ private void button1_Click(object sender, EventArgs e)
+ {
+
+ string file = @"C:\Temp\newdd.xls";
+ if (File.Exists(file)) { File.Delete(file); }
+ File.Copy(@"C:\Users\Administrator\Desktop\AESDemo\AESDemo\temp.xls", file);
+
+ using (NPOIExcel excel = new NPOIExcel(file))
+ {
+ int tmpRow1 = 0;
+ int tmpRow2 = 1;
+
+ //excel.SetCurrentSheet(1);
+ //excel.SetCell("D1", "15");
+ //excel.SetCellComment("D1", "UseNo");
+
+ //一個目の入区分の数でtmpRow2を偏移する
+ int persons = 2;
+ excel.SetCurrentSheet(0);
+
+ for (int i = 1; i <= 2; i++)
+ {
+ excel.Sheet.CopyRow(tmpRow1, tmpRow2 + i);
+ excel.Sheet.GetRow(tmpRow2 + i).Height = excel.Sheet.GetRow(tmpRow1).Height;
+ }
+
+ //CellRangeAddress cellRangeAddress = new CellRangeAddress(tmpRow2 + 1, tmpRow2 + persons, 0, 1);
+ //excel.Sheet.AddMergedRegion(cellRangeAddress);
+
+ //cellRangeAddress = new CellRangeAddress(tmpRow2 + 1, tmpRow2 + persons, 2, 3);
+ //excel.Sheet.AddMergedRegion(cellRangeAddress);
+
+ int r = excel.Sheet.LastRowNum;
+ for (int i = 1; i <= 2; i++)
+ {
+ r += 1;
+ excel.Sheet.CopyRow(tmpRow2, r);
+ excel.Sheet.GetRow(r).Height = excel.Sheet.GetRow(tmpRow2).Height;
+ string col = ((int)(r + 1)).ToString();
+ excel.SetCell("A" + col, col);
+ }
+
+ r = excel.Sheet.LastRowNum + 1;
+ excel.Sheet.CopyRow(tmpRow1, r);
+ excel.Sheet.GetRow(r).Height = excel.Sheet.GetRow(tmpRow1).Height;
+
+ //excel.Sheet.GetRow(tmpRow2).ZeroHeight = true;
+ //excel.Sheet.GetRow(tmpRow1).ZeroHeight = true;
+ excel.Sheet.RemoveRow(excel.Sheet.GetRow(tmpRow2));
+ excel.Sheet.RemoveRow(excel.Sheet.GetRow(tmpRow1));
+
+ excel.Sheet.ShiftRows(2, excel.Sheet.LastRowNum, -2, true, false);
+ }
+
+ Process.Start(@"C:\Temp\newdd.xls");
+ }
+
+ private void button2_Click(object sender, EventArgs e)
+ {
+ //new PostgreSqlDemo().Show();
+ HSSFWorkbook workbook = new HSSFWorkbook();
+ HSSFSheet sheet = (HSSFSheet)workbook.CreateSheet("Sheet1");
+ HSSFRow row = (HSSFRow)sheet.CreateRow(0);
+ HSSFCell cell = (HSSFCell)row.CreateCell(0);
+ cell.SetCellValue("Cell1");
+
+ // Create the drawing patriarch (top level container for all shapes including cell comments)
+ IDrawing patriarch = (HSSFPatriarch)sheet.CreateDrawingPatriarch();
+
+ // Client anchor defines size and position of the comment in the worksheet
+ IComment comment = patriarch.CreateCellComment(new HSSFClientAnchor(0, 0, 0, 0, 2, 1, 4, 4));
+
+ // Set comment author
+ comment.Author = "Author";
+
+ // Set text in the comment
+ comment.String = new HSSFRichTextString($"{comment.Author}:{Environment.NewLine}A comment");
+
+ // If you want the author displayed in bold on top like in Excel
+ // The author will be displayed in the status bar when on mouse over the commented cell
+ IFont font = workbook.CreateFont();
+ font.Boldweight = (short)FontBoldWeight.Bold;
+ comment.String.ApplyFont(0, comment.Author.Length, font);
+
+ // Set comment visible
+ comment.Visible = true;
+
+ // Assign comment to a cell
+ cell.CellComment = comment;
+
+ //using (MemoryStream exportData = new MemoryStream())
+ //{
+ // workbook.Write(exportData);
+ // //Response.ContentEncoding = Encoding.UTF8;
+ // //Response.Charset = Encoding.UTF8.EncodingName;
+ // //Response.ContentType = "application/vnd.ms-excel";
+ // //Response.AddHeader("content-disposition", $"attachment; filename=test.xls");
+ // //Response.Clear();
+ // //Response.BinaryWrite(exportData.GetBuffer());
+ // //Response.End();
+ //}
+ }
+
+ private void FormMain_KeyDown(object sender, KeyEventArgs e)
+ {
+
+ }
+
+ private Task<string> GetData()
+ {
+ System.Diagnostics.Debug.WriteLine($"【{DateTime.Now.ToString("HH:mm:ss fff")}】GetData開始");
+ return Task<string>.Run(() =>
+ {
+ Thread.Sleep(20000);
+ return "結果ですよ:" + DateTime.Now.ToString("HH:mm:ss fff");
+ });
+ }
+
+ private Task<string> GetData(object param)
+ {
+ Func<object, string> action = (o) =>
+ {
+ Thread.Sleep((int)o);
+ return "aaaa結果ですよ:" + DateTime.Now.ToString("HH:mm:ss fff");
+ };
+ return new TaskFactory().StartNew<string>(action, param);
+ }
+
+
+ private async void FormMain_Load(object sender, EventArgs e)
+ {
+ this.ActiveControl = LoadingObj;
+ LoadingObj.ShowWaiting();
+ string data = await GetData(2000);
+ textBox1.Text = data;
+ LoadingObj.CloseWaiting();
+
+ Dictionary<string, int> dict = new Dictionary<string, int>();
+ dict["Name"] = 180;
+
+ dict["Name"] = 30;
+ textBox3.Text = $"【{DateTime.Now.ToString("HH:mm:ss fff")}】FormMain_Load準備OK";
+
+ Use item = new()
+ {
+ ID = 1
+ };
+ //var a = item.GetCinDate();
+ }
+
+ private void button3_Click(object sender, EventArgs e)
+ {
+ new TableToExcel().Show();
+ }
+
+ private void button4_Click(object sender, EventArgs e)
+ {
+ //Json Object
+ var cc = new { ID = 1, Name = "小木", Other = "aaa" };
+ //cc["Name"] = "aa";
+
+
+ string name = cc.Name;
+ int id = cc.ID;
+
+
+
+ new FormGdi().Show();
+ }
+
+ private void button5_Click(object sender, EventArgs e)
+ {
+ var message = new MimeMessage();
+ message.From.Add(new MailboxAddress("小木勝龍", "liangbenyinjp@yahoo.co.jp"));
+ message.To.Add(new MailboxAddress("小木勝龍", "shr.ogi@sj-sol.com"));
+ message.Subject = "How you doin'?";
+
+ message.Body = new TextPart("plain")
+ {
+ Text = @"Hey Chandler,
+
+I just wanted to let you know that Monica and I were going to go play some paintball, you in?
+
+-- Joey"
+ };
+
+ //using (var client = new SmtpClient())
+ //{
+ // client.ServerCertificateValidationCallback =
+ // (sender, certificate, certChainType, errors) => true;
+ // client.AuthenticationMechanisms.Remove("XOAUTH2");
+
+ // client.Connect("smtp.mail.yahoo.co.jp", 465, true);
+
+ // // Note: only needed if the SMTP server requires authentication
+ // client.Authenticate("liangbenyinjp", "lby10180331");
+
+ // client.Send(message);
+ // client.Disconnect(true);
+ //}
+
+ //GmailのSMTPサーバーアドレス:smtp.gmail.com
+ //GmailのSMTP名:あなたの氏名
+ //GmailのSMTPユーザー名:あなたのGmailアドレス(例:you @gmail.com)
+ //GmailのSMTPパスワード:あなたのGmailのログインパスワード
+ //GmailのSMTPポート(TLS): 587
+ //GmailのSMTPポート(SSL): 465
+
+ using (var mySmtpClient = new SmtpClient())
+ {
+ string host = "smtp.mail.yahoo.co.jp";
+ int port = 465; // 587
+ string userId = "liangbenyinjp";
+ string password = "lby10180331";
+
+ mySmtpClient.Connect(host, port, SecureSocketOptions.Auto);
+ mySmtpClient.Authenticate(new SaslMechanismLogin(userId, password));
+ mySmtpClient.Send(message);
+ mySmtpClient.Disconnect(true);
+ }
+ }
+
+ private void button6_Click(object sender, EventArgs e)
+ {
+ StringBuilder sb = new StringBuilder();
+ for (int i = (int)numericUpDown1.Value; i < (int)numericUpDown2.Value; i++)
+ {
+ sb.AppendLine(string.Format(textBox2.Text, i));
+ }
+ richTextBox1.Text = sb.ToString();
+ }
+
+ private void button7_Click(object sender, EventArgs e)
+ {
+ byte[] data;
+ using (DataTable table = new DataTable())
+ {
+ for (int i = 0; i < 50; i++)
+ {
+ table.Columns.Add($"Fields{i}");
+ }
+
+ for (int r = 0; r < 500; r++)
+ {
+ DataRow row = table.NewRow();
+ table.Rows.Add(row);
+
+ for (int i = 0; i < 50; i++)
+ {
+ row[$"Fields{i}"] = $"データだよData({r},{i})";
+ }
+ }
+ data = Export(table, "xls");
+ }
+ }
+
+ public static byte[] Export(DataTable dt, string type = "xlsx")
+ {
+ const int headerRowIndex = 0;
+
+ // ブック作成
+ IWorkbook book;
+ switch (type)
+ {
+ case "xls":
+ book = new HSSFWorkbook();
+ break;
+ case "xlsx":
+ book = new XSSFWorkbook();
+ break;
+ default:
+ return null;
+ }
+
+ // シート作成
+ var sheet = book.CreateSheet("Table");
+
+ // ヘッダ行作成
+ var headerRow = sheet.CreateRow(0);
+ foreach (DataColumn col in dt.Columns)
+ {
+ ICell cell = headerRow.CreateCell(dt.Columns.IndexOf(col));
+ cell.SetCellValue(col.ColumnName);
+ }
+
+ // データ行作成
+ foreach (DataRow row in dt.Rows)
+ {
+ var dataRow = sheet.CreateRow(headerRowIndex + 1 + dt.Rows.IndexOf(row));
+
+ foreach (DataColumn col in dt.Columns)
+ {
+ var colIndex = dt.Columns.IndexOf(col);
+ if (row[colIndex] == DBNull.Value) continue;
+
+ ICell cell = dataRow.CreateCell(colIndex);
+ cell.SetCellValue(row[colIndex].ToString());
+ }
+ }
+
+
+ // ブックを出力(保存)
+ //using (var ms = new MemoryStream())
+ //{
+ var ms = new MemoryStream();
+ book.Write(ms, true);
+ byte[] data = ms.ToArray();
+ ms.Close();
+
+ File.WriteAllBytes("1.xls", data);
+ return data;
+ //}
+ }
+
+ private void button8_Click(object sender, EventArgs e)
+ {
+ new FormExProperty().Show();
+ }
+
+ private void button9_Click(object sender, EventArgs e)
+ {
+ GC.Collect(); //使う前に一回メモリー回収必要
+ StringBuilder sb = new StringBuilder();
+ foreach (KeyValuePair<Control, ControlPropertyEx> item in ControlPropertyEx.Data)
+ {
+ if (item.Key.IsDisposed)
+ {
+ sb.AppendLine($"IsDisposed⇒{item.Value}");
+ }
+ else
+ {
+ sb.AppendLine($"{item.Key.Name}({item.Key.Handle})⇒{item.Value}");
+ }
+ }
+ richTextBox1.Text = sb.ToString();
+ }
+
+ private void button10_Click(object sender, EventArgs e)
+ {
+ new FormReport().Show();
+ }
+
+ private void button11_Click(object sender, EventArgs e)
+ {
+ string a = string.Empty;
+ for (int i = 0; i < int.MaxValue; i++)
+ {
+ a += "s";
+ System.Diagnostics.Debug.WriteLine(i);
+ }
+
+ System.Diagnostics.Debug.WriteLine(a.Length);
+ }
+
+ private void button12_Click(object sender, EventArgs e)
+ {
+ using (DBLogin login = new DBLogin())
+ {
+ if (login.ShowDialog() != DialogResult.OK) { return; }
+ EnvironmentSetting.Default.DataBase = new Share.Data.DBConnectItem(login.DataSource, login.Catalog, login.UseID, login.PassWord);
+ }
+
+ using (BeanCreator form = new BeanCreator())
+ {
+ form.ShowDialog();
+ }
+ }
+
+ private void button13_Click(object sender, EventArgs e)
+ {
+ new FormEdge().Show();
+ }
+
+ private void button14_Click(object sender, EventArgs e)
+ {
+ new FormSignalR().Show();
+ }
+
+ private void FetchReport(DbDataReader reader, List<TestBean> data)
+ {
+ while (reader.Read())
+ {
+ var testBean = new TestBean
+ {
+ ID = CConvert.ToInt(reader["ID"]),
+ Name = reader["Name"].ToString()
+ };
+ data.Add(testBean);
+ }
+ }
+
+ private void FetchRoomType(DbDataReader reader, List<TestBean> data)
+ {
+ while (reader.Read())
+ {
+ var testBean = new TestBean
+ {
+ ID = CConvert.ToInt(reader["RoomTypeNo"]),
+ Name = reader["RoomTypeName"].ToString()
+ };
+ data.Add(testBean);
+ }
+ }
+
+ private void button15_Click(object sender, EventArgs e)
+ {
+ using (MsSqlNet msSqlNet = new MsSqlNet("localhost", "sa", "oatcti", "HotelPms"))
+ {
+ var result = msSqlNet.GetDataReader<List<TestBean>>("SELECT * FROM M_Room", (reader, data) =>
+ {
+ while (reader.Read())
+ {
+ var testBean = new TestBean
+ {
+ ID = CConvert.ToInt(reader["ID"]),
+ Name = reader["Name"].ToString()
+ };
+ data.Add(testBean);
+ }
+ });
+
+ if (result == null) { return; }
+
+ foreach (TestBean item in result)
+ {
+ System.Diagnostics.Debug.WriteLine($"{item.ID}.{item.Name}");
+ }
+
+ var demo = msSqlNet.GetDataReader<List<HotelPms.Data.Master.Demo>>(@"SELECT ID,[Name],FInt,FTinyInt,FSmallInt,FFloat,FBit,FDecimal,FDate,UpdateDate,UpdateID FROM M_Demo", (reader, data) =>
+ {
+ while (reader.Read())
+ {
+ var testBean = new HotelPms.Data.Master.Demo();
+ testBean.ConvertReader(reader);
+ System.Diagnostics.Debug.WriteLine(testBean.ToText());
+ data.Add(testBean);
+ }
+ });
+
+
+ result = msSqlNet.GetDataReader<List<TestBean>>("SELECT * FROM S_Report", FetchReport);
+
+ if (result == null) { return; }
+
+ foreach (TestBean item in result)
+ {
+ System.Diagnostics.Debug.WriteLine($"{item.ID}.{item.Name}");
+ }
+
+ result = msSqlNet.GetDataReader<List<TestBean>>("SELECT * FROM M_RoomType", (reader, data) => FetchRoomType(reader, data));
+
+ if (result == null) { return; }
+
+ foreach (TestBean item in result)
+ {
+ System.Diagnostics.Debug.WriteLine($"{item.ID}.{item.Name}");
+ }
+ }
+ }
+
+ private void button16_Click(object sender, EventArgs e)
+ {
+ CalendarSelectorOne.Execute(textBox3);
+ }
+
+ private void button17_Click(object sender, EventArgs e)
+ {
+ CalendarSelector.Execute(textBox3);
+ }
+
+ private void FormMain_Shown(object sender, EventArgs e)
+ {
+ richTextBox1.Text = $"【{DateTime.Now.ToString("HH:mm:ss fff")}】FormMain_Shown準備OK";
+ }
+
+ private void button18_Click(object sender, EventArgs e)
+ {
+ new FormValid().Show();
+ }
+
+ private void button19_Click(object sender, EventArgs e)
+ {
+ new ExcelToTable().Show();
+ }
+
+ private void button20_Click(object sender, EventArgs e)
+ {
+ new FormScript().Show();
+ }
+
+ private async void button21_Click(object sender, EventArgs e)
+ {
+ var httpClientHandler = new HttpClientHandler();
+ httpClientHandler.ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator;
+ GrpcChannelOptions options = new GrpcChannelOptions()
+ {
+ MaxReceiveMessageSize = int.MaxValue,
+ HttpHandler = httpClientHandler
+ };
+ using (var Channel = GrpcChannel.ForAddress("https://localhost:7228", options))
+ {
+ HelloRequest request = new HelloRequest();
+ request.Name = "aaa";
+ var client = new Greeter.GreeterClient(Channel);
+ HelloReply reply = await client.SayHelloAsync(request);
+ richTextBox1.Text = reply.ToString();
+
+ //GrpcSet grpcSet = await GrpcClient.GetDataSet(Channel, (int)ESetActionType.ColSetting, $"localhost,Web,10000");
+ //DataSet ds = grpcSet.ToDataSet();
+
+ //using (RoomViewLayoutAccess access = new RoomViewLayoutAccess(Channel))
+ //{
+ // DataSet ds1 = await access.GetRoomViewData($"2022/07/13,1");
+ //}
+ }
+ }
+
+ private void button22_Click(object sender, EventArgs e)
+ {
+ var httpClientHandler = new HttpClientHandler();
+ httpClientHandler.ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator;
+ var httpHandler = new GrpcWebHandler(GrpcWebMode.GrpcWeb, httpClientHandler);
+ //var httpClient = new HttpClient(httpClientHandler);
+ GrpcChannelOptions options = new GrpcChannelOptions()
+ {
+ MaxReceiveMessageSize = int.MaxValue,
+ HttpHandler = httpHandler //httpClientHandler
+ };
+ using (var Channel = GrpcChannel.ForAddress("https://localhost:7240", options))
+ {
+ HelloRequest request = new HelloRequest();
+ request.Name = "aaa";
+ var client = new Greeter.GreeterClient(Channel);
+ HelloReply reply = client.SayHello(request);
+ richTextBox1.Text = reply.ToString();
+ }
+ }
+
+ private async void button23_Click(object sender, EventArgs e)
+ {
+ var httpClientHandler = new HttpClientHandler();
+ httpClientHandler.ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator;
+ var handler = new SubdirectoryHandler(httpClientHandler, "/grpc");
+ var httpHandler = new GrpcWebHandler(GrpcWebMode.GrpcWebText, handler);
+ GrpcChannelOptions options = new GrpcChannelOptions()
+ {
+ MaxReceiveMessageSize = int.MaxValue,
+ HttpHandler = httpHandler
+ };
+ using (var Channel = GrpcChannel.ForAddress("https://www.navc2.net", options))
+ {
+ HelloRequest request = new HelloRequest();
+ request.Name = "IIS CALLだぞ ";
+ var client = new Greeter.GreeterClient(Channel);
+ HelloReply reply = await client.SayHelloAsync(request);
+ richTextBox1.Text = reply.ToString();
+ }
+ }
+
+ private void button24_Click(object sender, EventArgs e)
+ {
+ new ExcelCopy().Show();
+ }
+
+ private void button25_Click(object sender, EventArgs e)
+ {
+ using (DBCore core = new DBCore(new DBConnectItem("localhost", "HotelPms", "sa", "oatcti")))
+ {
+ core.Output += Core_Output;
+ core.Execute();
+ }
+ MessageBox.Show("OK");
+ }
+
+ private void Core_Output(object sender, MessageEventArgs e)
+ {
+ richTextBox1.AppendText(Environment.NewLine);
+ richTextBox1.AppendText(e.Message);
+ }
+
+ private void button26_Click(object sender, EventArgs e)
+ {
+ var serializerOptions = new JsonSerializerOptions
+ {
+ Converters = { new DynamicJsonConverter() },
+ WriteIndented = true
+ };
+
+ var jsonText = File.ReadAllText("sample.json");
+
+ dynamic obj = JsonSerializer.Deserialize<dynamic>(jsonText, serializerOptions);
+
+ string id = obj.id;
+ string type = obj.type;
+
+ string json = JsonSerializer.Serialize(obj, serializerOptions);
+
+ obj = new { ID = 1, Name = "aaa" };
+ json = JsonSerializer.Serialize(obj, serializerOptions);
+
+ }
+
+ private async void button27_Click(object sender, EventArgs e)
+ {
+ //AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);
+ var httpClientHandler = new HttpClientHandler();
+ httpClientHandler.ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator;
+ var handler = new SubdirectoryHandler(httpClientHandler, "/grpc");
+ var httpHandler = new GrpcWebHandler(GrpcWebMode.GrpcWebText, handler);
+ GrpcChannelOptions options = new GrpcChannelOptions()
+ {
+ MaxReceiveMessageSize = int.MaxValue,
+ HttpHandler = httpHandler
+ };
+ //using (var Channel = GrpcChannel.ForAddress("https://www.navc2.net", options))
+ using (var Channel = GrpcChannel.ForAddress("https://ginbow.eu.org", options))
+ {
+ HelloRequest request = new HelloRequest();
+ request.Name = "IIS CALLだぞ ";
+ var client = new Greeter.GreeterClient(Channel);
+ HelloReply reply = await client.SayHelloAsync(request);
+ richTextBox1.Text = reply.ToString();
+
+ GrpcSet grpcSet = await GrpcClient.GetDataSet(Channel, (int)ESetActionType.ColSetting, $"localhost,Web,10000");
+ DataSet ds = grpcSet.ToDataSet();
+
+ using (RoomViewLayoutAccess access = new RoomViewLayoutAccess(Channel))
+ {
+ DataSet ds1 = await access.GetRoomViewData($"2022/07/13,1");
+ }
+ }
+ }
+
+ private async void button28_Click(object sender, EventArgs e)
+ {
+ //Content-Type application/grpc
+ var httpClientHandler = new HttpClientHandler();
+ httpClientHandler.ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator;
+ var httpHandler = new GrpcWebHandler(GrpcWebMode.GrpcWeb, httpClientHandler);
+ GrpcChannelOptions options = new GrpcChannelOptions()
+ {
+ MaxReceiveMessageSize = int.MaxValue,
+ //HttpHandler = httpClientHandler
+ HttpHandler = httpHandler
+ };
+ using (var Channel = GrpcChannel.ForAddress("https://ginbow.eu.org", options))
+ {
+ HelloRequest request = new HelloRequest();
+ request.Name = "aaa";
+ var client = new Greeter.GreeterClient(Channel);
+ HelloReply reply = await client.SayHelloAsync(request);
+ richTextBox1.Text = reply.ToString();
+
+ GrpcSet grpcSet = await GrpcClient.GetDataSet(Channel, (int)ESetActionType.ColSetting, $"localhost,Web,10000");
+ DataSet ds = grpcSet.ToDataSet();
+
+ using (RoomViewLayoutAccess access = new RoomViewLayoutAccess(Channel))
+ {
+ DataSet ds1 = await access.GetRoomViewData($"2022/07/13,1");
+ }
+ }
+ }
+
+ private void button29_Click(object sender, EventArgs e)
+ {
+ Process.Start(new ProcessStartInfo
+ {
+ FileName = "cmd",
+ Arguments = $"/c start \"\" \"notepad.exe\"",
+ CreateNoWindow = true,
+ UseShellExecute = false
+ });
+
+ //Process.Start(new ProcessStartInfo
+ //{
+ // FileName = "notepad.exe",
+ // Arguments = @"c:\temp\LabelPrinterUtility.ini", // 虽然打不开内容,但能验证是否递归
+ // UseShellExecute = true
+ //});
+ }
+
+ private void button30_Click(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
diff --git a/HotelPms.SourceFactory/FormMain.resx b/HotelPms.SourceFactory/FormMain.resx
new file mode 100644
index 0000000..f1e83f7
--- /dev/null
+++ b/HotelPms.SourceFactory/FormMain.resx
@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <data name="textBox2.Text" xml:space="preserve">
+ <value> <MudItem xs="12">
+ <MudTextField @bind-Value="Data.Fields[{0}].Text" Error="@Data.Fields[{0}].Error" ErrorText="@Data.Fields[{0}].ErrorText" @ref="Data.Fields[{0}].Ref" T="string" Label="@Data.Fields[{0}].Caption"
+ OnKeyDown="@(e => Data.KeyDown(Data.Fields[{0}].Index, e))" KeyDownPreventDefault="@Data.KeyDownPreventDefault"
+ OnKeyPress="@(e => Data.KeyPress(Data.Fields[{0}].Index, e))" KeyPressPreventDefault="@Data.KeyPressPreventDefault"
+ OnBlur="@(e => Data.Leave(Data.Fields[{0}].Index, e))"
+ @onfocus="(e => Data.Enter({0}, e))" Margin="Margin.Dense" maxlength="@Data.Fields[{0}].MaxLenth"
+ Adornment="@(Data.Fields[{0}].ShowStyle == EShowStyle.ShowList ? Adornment.End : Adornment.None)"
+ AdornmentIcon="@(Data.Fields[{0}].ShowStyle == EShowStyle.ShowList ? Icons.Material.Filled.ListAlt : string.Empty)"
+ OnAdornmentClick="@(() => ShowListAction(Data.Fields[{0}]))" />
+ </MudItem></value>
+ </data>
+</root>
\ No newline at end of file
diff --git a/HotelPms.SourceFactory/FormReport.Designer.cs b/HotelPms.SourceFactory/FormReport.Designer.cs
new file mode 100644
index 0000000..a453db5
--- /dev/null
+++ b/HotelPms.SourceFactory/FormReport.Designer.cs
@@ -0,0 +1,707 @@
+
+namespace HotelPms.SourceFactory
+{
+ partial class FormReport
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ DataGridViewCellStyle dataGridViewCellStyle1 = new DataGridViewCellStyle();
+ panel1 = new Panel();
+ label4 = new Label();
+ label3 = new Label();
+ numericUpDown1 = new NumericUpDown();
+ button2 = new Button();
+ button1 = new Button();
+ panel2 = new Panel();
+ tabControl1 = new TabControl();
+ tabPage1 = new TabPage();
+ pnlPaper = new Panel();
+ panel5 = new Panel();
+ pnlDetail = new Panel();
+ txtField9 = new Button();
+ panel11 = new Panel();
+ txtField8 = new Label();
+ txtField7 = new Label();
+ txtField6 = new Label();
+ panel12 = new Panel();
+ txtField5 = new Label();
+ txtField4 = new Label();
+ txtField3 = new Label();
+ txtField2 = new Button();
+ panel13 = new Panel();
+ txtField1 = new Label();
+ txtField0 = new Label();
+ pnlGroupHeader = new Panel();
+ txtCaption9 = new Button();
+ panel10 = new Panel();
+ txtCaption8 = new Label();
+ txtCaption7 = new Label();
+ txtCaption6 = new Label();
+ panel9 = new Panel();
+ txtCaption5 = new Label();
+ txtCaption4 = new Label();
+ txtCaption3 = new Label();
+ txtCaption2 = new Button();
+ panel8 = new Panel();
+ txtCaption1 = new Label();
+ txtCaption0 = new Label();
+ pnlPageHeader = new Panel();
+ label21 = new Label();
+ label2 = new Label();
+ label1 = new Label();
+ tabPage2 = new TabPage();
+ dataGridView1 = new DataGridView();
+ tabPage3 = new TabPage();
+ printPreviewControl1 = new PrintPreviewControl();
+ panel1.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)numericUpDown1).BeginInit();
+ panel2.SuspendLayout();
+ tabControl1.SuspendLayout();
+ tabPage1.SuspendLayout();
+ pnlPaper.SuspendLayout();
+ panel5.SuspendLayout();
+ pnlDetail.SuspendLayout();
+ panel11.SuspendLayout();
+ panel12.SuspendLayout();
+ panel13.SuspendLayout();
+ pnlGroupHeader.SuspendLayout();
+ panel10.SuspendLayout();
+ panel9.SuspendLayout();
+ panel8.SuspendLayout();
+ pnlPageHeader.SuspendLayout();
+ tabPage2.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)dataGridView1).BeginInit();
+ tabPage3.SuspendLayout();
+ SuspendLayout();
+ //
+ // panel1
+ //
+ panel1.Controls.Add(label4);
+ panel1.Controls.Add(label3);
+ panel1.Controls.Add(numericUpDown1);
+ panel1.Controls.Add(button2);
+ panel1.Controls.Add(button1);
+ panel1.Dock = DockStyle.Top;
+ panel1.Location = new Point(0, 0);
+ panel1.Name = "panel1";
+ panel1.Size = new Size(1126, 78);
+ panel1.TabIndex = 0;
+ //
+ // label4
+ //
+ label4.AutoSize = true;
+ label4.Font = new Font("Yu Gothic UI", 18F);
+ label4.Location = new Point(504, 20);
+ label4.Name = "label4";
+ label4.Size = new Size(66, 32);
+ label4.TabIndex = 4;
+ label4.Text = "1000";
+ //
+ // label3
+ //
+ label3.AutoSize = true;
+ label3.Font = new Font("Yu Gothic UI", 18F);
+ label3.Location = new Point(475, 20);
+ label3.Name = "label3";
+ label3.Size = new Size(23, 32);
+ label3.TabIndex = 3;
+ label3.Text = "/";
+ //
+ // numericUpDown1
+ //
+ numericUpDown1.Font = new Font("Yu Gothic UI", 18F);
+ numericUpDown1.Location = new Point(375, 17);
+ numericUpDown1.Name = "numericUpDown1";
+ numericUpDown1.Size = new Size(94, 39);
+ numericUpDown1.TabIndex = 2;
+ //
+ // button2
+ //
+ button2.Location = new Point(158, 12);
+ button2.Name = "button2";
+ button2.Size = new Size(140, 45);
+ button2.TabIndex = 1;
+ button2.Text = "出力";
+ button2.UseVisualStyleBackColor = true;
+ button2.Click += button2_Click;
+ //
+ // button1
+ //
+ button1.Location = new Point(12, 12);
+ button1.Name = "button1";
+ button1.Size = new Size(140, 45);
+ button1.TabIndex = 0;
+ button1.Text = "PreView";
+ button1.UseVisualStyleBackColor = true;
+ //
+ // panel2
+ //
+ panel2.Controls.Add(tabControl1);
+ panel2.Dock = DockStyle.Fill;
+ panel2.Location = new Point(0, 78);
+ panel2.Name = "panel2";
+ panel2.Padding = new Padding(2);
+ panel2.Size = new Size(1126, 639);
+ panel2.TabIndex = 1;
+ //
+ // tabControl1
+ //
+ tabControl1.Controls.Add(tabPage1);
+ tabControl1.Controls.Add(tabPage2);
+ tabControl1.Controls.Add(tabPage3);
+ tabControl1.Dock = DockStyle.Fill;
+ tabControl1.Location = new Point(2, 2);
+ tabControl1.Name = "tabControl1";
+ tabControl1.SelectedIndex = 0;
+ tabControl1.Size = new Size(1122, 635);
+ tabControl1.TabIndex = 0;
+ //
+ // tabPage1
+ //
+ tabPage1.AutoScroll = true;
+ tabPage1.BackColor = Color.Gray;
+ tabPage1.Controls.Add(pnlPaper);
+ tabPage1.Location = new Point(4, 24);
+ tabPage1.Name = "tabPage1";
+ tabPage1.Padding = new Padding(20);
+ tabPage1.Size = new Size(1114, 607);
+ tabPage1.TabIndex = 0;
+ tabPage1.Text = "自由式";
+ //
+ // pnlPaper
+ //
+ pnlPaper.BackColor = Color.White;
+ pnlPaper.Controls.Add(panel5);
+ pnlPaper.Controls.Add(pnlPageHeader);
+ pnlPaper.Location = new Point(23, 24);
+ pnlPaper.Name = "pnlPaper";
+ pnlPaper.Padding = new Padding(5);
+ pnlPaper.Size = new Size(1068, 545);
+ pnlPaper.TabIndex = 0;
+ //
+ // panel5
+ //
+ panel5.Controls.Add(pnlDetail);
+ panel5.Controls.Add(pnlGroupHeader);
+ panel5.Dock = DockStyle.Top;
+ panel5.Location = new Point(5, 74);
+ panel5.Name = "panel5";
+ panel5.Size = new Size(1058, 128);
+ panel5.TabIndex = 3;
+ //
+ // pnlDetail
+ //
+ pnlDetail.Controls.Add(txtField9);
+ pnlDetail.Controls.Add(panel11);
+ pnlDetail.Controls.Add(panel12);
+ pnlDetail.Controls.Add(txtField2);
+ pnlDetail.Controls.Add(panel13);
+ pnlDetail.Dock = DockStyle.Top;
+ pnlDetail.Location = new Point(0, 54);
+ pnlDetail.Name = "pnlDetail";
+ pnlDetail.Size = new Size(1058, 54);
+ pnlDetail.TabIndex = 1;
+ //
+ // txtField9
+ //
+ txtField9.Dock = DockStyle.Fill;
+ txtField9.FlatAppearance.BorderColor = Color.Green;
+ txtField9.FlatStyle = FlatStyle.Flat;
+ txtField9.Location = new Point(779, 0);
+ txtField9.Name = "txtField9";
+ txtField9.Size = new Size(279, 54);
+ txtField9.TabIndex = 5;
+ txtField9.UseVisualStyleBackColor = true;
+ //
+ // panel11
+ //
+ panel11.Controls.Add(txtField8);
+ panel11.Controls.Add(txtField7);
+ panel11.Controls.Add(txtField6);
+ panel11.Dock = DockStyle.Left;
+ panel11.Location = new Point(497, 0);
+ panel11.Name = "panel11";
+ panel11.Size = new Size(282, 54);
+ panel11.TabIndex = 4;
+ //
+ // txtField8
+ //
+ txtField8.BorderStyle = BorderStyle.FixedSingle;
+ txtField8.Dock = DockStyle.Fill;
+ txtField8.FlatStyle = FlatStyle.Flat;
+ txtField8.Location = new Point(137, 27);
+ txtField8.Name = "txtField8";
+ txtField8.Size = new Size(145, 27);
+ txtField8.TabIndex = 4;
+ txtField8.TextAlign = ContentAlignment.MiddleCenter;
+ //
+ // txtField7
+ //
+ txtField7.BorderStyle = BorderStyle.FixedSingle;
+ txtField7.Dock = DockStyle.Left;
+ txtField7.FlatStyle = FlatStyle.Flat;
+ txtField7.Location = new Point(0, 27);
+ txtField7.Name = "txtField7";
+ txtField7.Size = new Size(137, 27);
+ txtField7.TabIndex = 3;
+ txtField7.TextAlign = ContentAlignment.MiddleCenter;
+ //
+ // txtField6
+ //
+ txtField6.BorderStyle = BorderStyle.FixedSingle;
+ txtField6.Dock = DockStyle.Top;
+ txtField6.FlatStyle = FlatStyle.Flat;
+ txtField6.Location = new Point(0, 0);
+ txtField6.Name = "txtField6";
+ txtField6.Size = new Size(282, 27);
+ txtField6.TabIndex = 1;
+ txtField6.TextAlign = ContentAlignment.MiddleCenter;
+ //
+ // panel12
+ //
+ panel12.Controls.Add(txtField5);
+ panel12.Controls.Add(txtField4);
+ panel12.Controls.Add(txtField3);
+ panel12.Dock = DockStyle.Left;
+ panel12.Location = new Point(215, 0);
+ panel12.Name = "panel12";
+ panel12.Size = new Size(282, 54);
+ panel12.TabIndex = 3;
+ //
+ // txtField5
+ //
+ txtField5.BorderStyle = BorderStyle.FixedSingle;
+ txtField5.Dock = DockStyle.Fill;
+ txtField5.FlatStyle = FlatStyle.Flat;
+ txtField5.Location = new Point(137, 27);
+ txtField5.Name = "txtField5";
+ txtField5.Size = new Size(145, 27);
+ txtField5.TabIndex = 3;
+ txtField5.TextAlign = ContentAlignment.MiddleCenter;
+ //
+ // txtField4
+ //
+ txtField4.BorderStyle = BorderStyle.FixedSingle;
+ txtField4.Dock = DockStyle.Left;
+ txtField4.FlatStyle = FlatStyle.Flat;
+ txtField4.Location = new Point(0, 27);
+ txtField4.Name = "txtField4";
+ txtField4.Size = new Size(137, 27);
+ txtField4.TabIndex = 2;
+ txtField4.TextAlign = ContentAlignment.MiddleCenter;
+ //
+ // txtField3
+ //
+ txtField3.BorderStyle = BorderStyle.FixedSingle;
+ txtField3.Dock = DockStyle.Top;
+ txtField3.FlatStyle = FlatStyle.Flat;
+ txtField3.Location = new Point(0, 0);
+ txtField3.Name = "txtField3";
+ txtField3.Size = new Size(282, 27);
+ txtField3.TabIndex = 1;
+ txtField3.TextAlign = ContentAlignment.MiddleCenter;
+ //
+ // txtField2
+ //
+ txtField2.Dock = DockStyle.Left;
+ txtField2.FlatAppearance.BorderColor = Color.Red;
+ txtField2.FlatStyle = FlatStyle.Flat;
+ txtField2.Location = new Point(125, 0);
+ txtField2.Name = "txtField2";
+ txtField2.Size = new Size(90, 54);
+ txtField2.TabIndex = 1;
+ txtField2.UseVisualStyleBackColor = true;
+ //
+ // panel13
+ //
+ panel13.Controls.Add(txtField1);
+ panel13.Controls.Add(txtField0);
+ panel13.Dock = DockStyle.Left;
+ panel13.Location = new Point(0, 0);
+ panel13.Name = "panel13";
+ panel13.Size = new Size(125, 54);
+ panel13.TabIndex = 2;
+ //
+ // txtField1
+ //
+ txtField1.BorderStyle = BorderStyle.FixedSingle;
+ txtField1.Dock = DockStyle.Top;
+ txtField1.FlatStyle = FlatStyle.Flat;
+ txtField1.Location = new Point(0, 27);
+ txtField1.Name = "txtField1";
+ txtField1.Size = new Size(125, 27);
+ txtField1.TabIndex = 1;
+ txtField1.TextAlign = ContentAlignment.MiddleCenter;
+ //
+ // txtField0
+ //
+ txtField0.BorderStyle = BorderStyle.FixedSingle;
+ txtField0.Dock = DockStyle.Top;
+ txtField0.FlatStyle = FlatStyle.Flat;
+ txtField0.Location = new Point(0, 0);
+ txtField0.Name = "txtField0";
+ txtField0.Size = new Size(125, 27);
+ txtField0.TabIndex = 0;
+ txtField0.TextAlign = ContentAlignment.MiddleCenter;
+ //
+ // pnlGroupHeader
+ //
+ pnlGroupHeader.Controls.Add(txtCaption9);
+ pnlGroupHeader.Controls.Add(panel10);
+ pnlGroupHeader.Controls.Add(panel9);
+ pnlGroupHeader.Controls.Add(txtCaption2);
+ pnlGroupHeader.Controls.Add(panel8);
+ pnlGroupHeader.Dock = DockStyle.Top;
+ pnlGroupHeader.Location = new Point(0, 0);
+ pnlGroupHeader.Name = "pnlGroupHeader";
+ pnlGroupHeader.Size = new Size(1058, 54);
+ pnlGroupHeader.TabIndex = 0;
+ //
+ // txtCaption9
+ //
+ txtCaption9.Dock = DockStyle.Fill;
+ txtCaption9.FlatAppearance.BorderColor = Color.Green;
+ txtCaption9.FlatStyle = FlatStyle.Flat;
+ txtCaption9.Location = new Point(779, 0);
+ txtCaption9.Name = "txtCaption9";
+ txtCaption9.Size = new Size(279, 54);
+ txtCaption9.TabIndex = 5;
+ txtCaption9.Text = "備考";
+ txtCaption9.UseVisualStyleBackColor = true;
+ //
+ // panel10
+ //
+ panel10.Controls.Add(txtCaption8);
+ panel10.Controls.Add(txtCaption7);
+ panel10.Controls.Add(txtCaption6);
+ panel10.Dock = DockStyle.Left;
+ panel10.Location = new Point(497, 0);
+ panel10.Name = "panel10";
+ panel10.Size = new Size(282, 54);
+ panel10.TabIndex = 4;
+ //
+ // txtCaption8
+ //
+ txtCaption8.BorderStyle = BorderStyle.FixedSingle;
+ txtCaption8.Dock = DockStyle.Fill;
+ txtCaption8.FlatStyle = FlatStyle.Flat;
+ txtCaption8.Location = new Point(137, 27);
+ txtCaption8.Name = "txtCaption8";
+ txtCaption8.Size = new Size(145, 27);
+ txtCaption8.TabIndex = 4;
+ txtCaption8.Text = "クレジット";
+ txtCaption8.TextAlign = ContentAlignment.MiddleCenter;
+ //
+ // txtCaption7
+ //
+ txtCaption7.BorderStyle = BorderStyle.FixedSingle;
+ txtCaption7.Dock = DockStyle.Left;
+ txtCaption7.FlatStyle = FlatStyle.Flat;
+ txtCaption7.Location = new Point(0, 27);
+ txtCaption7.Name = "txtCaption7";
+ txtCaption7.Size = new Size(137, 27);
+ txtCaption7.TabIndex = 3;
+ txtCaption7.Text = "現金";
+ txtCaption7.TextAlign = ContentAlignment.MiddleCenter;
+ //
+ // txtCaption6
+ //
+ txtCaption6.BorderStyle = BorderStyle.FixedSingle;
+ txtCaption6.Dock = DockStyle.Top;
+ txtCaption6.FlatStyle = FlatStyle.Flat;
+ txtCaption6.Location = new Point(0, 0);
+ txtCaption6.Name = "txtCaption6";
+ txtCaption6.Size = new Size(282, 27);
+ txtCaption6.TabIndex = 1;
+ txtCaption6.Text = "入金";
+ txtCaption6.TextAlign = ContentAlignment.MiddleCenter;
+ //
+ // panel9
+ //
+ panel9.Controls.Add(txtCaption5);
+ panel9.Controls.Add(txtCaption4);
+ panel9.Controls.Add(txtCaption3);
+ panel9.Dock = DockStyle.Left;
+ panel9.Location = new Point(215, 0);
+ panel9.Name = "panel9";
+ panel9.Size = new Size(282, 54);
+ panel9.TabIndex = 3;
+ //
+ // txtCaption5
+ //
+ txtCaption5.BorderStyle = BorderStyle.FixedSingle;
+ txtCaption5.Dock = DockStyle.Fill;
+ txtCaption5.FlatStyle = FlatStyle.Flat;
+ txtCaption5.Location = new Point(137, 27);
+ txtCaption5.Name = "txtCaption5";
+ txtCaption5.Size = new Size(145, 27);
+ txtCaption5.TabIndex = 3;
+ txtCaption5.Text = "付帯料金";
+ txtCaption5.TextAlign = ContentAlignment.MiddleCenter;
+ //
+ // txtCaption4
+ //
+ txtCaption4.BorderStyle = BorderStyle.FixedSingle;
+ txtCaption4.Dock = DockStyle.Left;
+ txtCaption4.FlatStyle = FlatStyle.Flat;
+ txtCaption4.Location = new Point(0, 27);
+ txtCaption4.Name = "txtCaption4";
+ txtCaption4.Size = new Size(137, 27);
+ txtCaption4.TabIndex = 2;
+ txtCaption4.Text = "宿泊料金";
+ txtCaption4.TextAlign = ContentAlignment.MiddleCenter;
+ //
+ // txtCaption3
+ //
+ txtCaption3.BorderStyle = BorderStyle.FixedSingle;
+ txtCaption3.Dock = DockStyle.Top;
+ txtCaption3.FlatStyle = FlatStyle.Flat;
+ txtCaption3.Location = new Point(0, 0);
+ txtCaption3.Name = "txtCaption3";
+ txtCaption3.Size = new Size(282, 27);
+ txtCaption3.TabIndex = 1;
+ txtCaption3.Text = "売上";
+ txtCaption3.TextAlign = ContentAlignment.MiddleCenter;
+ //
+ // txtCaption2
+ //
+ txtCaption2.Dock = DockStyle.Left;
+ txtCaption2.FlatAppearance.BorderColor = Color.Red;
+ txtCaption2.FlatStyle = FlatStyle.Flat;
+ txtCaption2.Location = new Point(125, 0);
+ txtCaption2.Name = "txtCaption2";
+ txtCaption2.Size = new Size(90, 54);
+ txtCaption2.TabIndex = 1;
+ txtCaption2.Text = "部屋番号";
+ txtCaption2.UseVisualStyleBackColor = true;
+ //
+ // panel8
+ //
+ panel8.Controls.Add(txtCaption1);
+ panel8.Controls.Add(txtCaption0);
+ panel8.Dock = DockStyle.Left;
+ panel8.Location = new Point(0, 0);
+ panel8.Name = "panel8";
+ panel8.Size = new Size(125, 54);
+ panel8.TabIndex = 2;
+ //
+ // txtCaption1
+ //
+ txtCaption1.BorderStyle = BorderStyle.FixedSingle;
+ txtCaption1.Dock = DockStyle.Top;
+ txtCaption1.FlatStyle = FlatStyle.Flat;
+ txtCaption1.Location = new Point(0, 27);
+ txtCaption1.Name = "txtCaption1";
+ txtCaption1.Size = new Size(125, 27);
+ txtCaption1.TabIndex = 1;
+ txtCaption1.Text = "時間";
+ txtCaption1.TextAlign = ContentAlignment.MiddleCenter;
+ //
+ // txtCaption0
+ //
+ txtCaption0.BorderStyle = BorderStyle.FixedSingle;
+ txtCaption0.Dock = DockStyle.Top;
+ txtCaption0.FlatStyle = FlatStyle.Flat;
+ txtCaption0.Location = new Point(0, 0);
+ txtCaption0.Name = "txtCaption0";
+ txtCaption0.Size = new Size(125, 27);
+ txtCaption0.TabIndex = 0;
+ txtCaption0.Text = "日付";
+ txtCaption0.TextAlign = ContentAlignment.MiddleCenter;
+ //
+ // pnlPageHeader
+ //
+ pnlPageHeader.Controls.Add(label21);
+ pnlPageHeader.Controls.Add(label2);
+ pnlPageHeader.Controls.Add(label1);
+ pnlPageHeader.Dock = DockStyle.Top;
+ pnlPageHeader.Location = new Point(5, 5);
+ pnlPageHeader.Name = "pnlPageHeader";
+ pnlPageHeader.Size = new Size(1058, 69);
+ pnlPageHeader.TabIndex = 2;
+ //
+ // label21
+ //
+ label21.AutoSize = true;
+ label21.Location = new Point(904, 41);
+ label21.Name = "label21";
+ label21.Size = new Size(134, 15);
+ label21.TabIndex = 2;
+ label21.Text = "yyyy/MM/dd HH:mm:ss";
+ //
+ // label2
+ //
+ label2.AutoSize = true;
+ label2.Location = new Point(843, 41);
+ label2.Name = "label2";
+ label2.Size = new Size(55, 15);
+ label2.TabIndex = 1;
+ label2.Text = "出力日時";
+ //
+ // label1
+ //
+ label1.Font = new Font("Yu Gothic UI", 18F);
+ label1.Location = new Point(331, 21);
+ label1.Name = "label1";
+ label1.Size = new Size(318, 35);
+ label1.TabIndex = 0;
+ label1.Text = "売掛発生確認表";
+ label1.TextAlign = ContentAlignment.MiddleCenter;
+ //
+ // tabPage2
+ //
+ tabPage2.Controls.Add(dataGridView1);
+ tabPage2.Location = new Point(4, 24);
+ tabPage2.Name = "tabPage2";
+ tabPage2.Padding = new Padding(3);
+ tabPage2.Size = new Size(1114, 607);
+ tabPage2.TabIndex = 1;
+ tabPage2.Text = "一覧式";
+ tabPage2.UseVisualStyleBackColor = true;
+ //
+ // dataGridView1
+ //
+ dataGridViewCellStyle1.Alignment = DataGridViewContentAlignment.MiddleLeft;
+ dataGridViewCellStyle1.BackColor = SystemColors.Control;
+ dataGridViewCellStyle1.Font = new Font("游ゴシック", 9.75F, FontStyle.Bold | FontStyle.Italic);
+ dataGridViewCellStyle1.ForeColor = SystemColors.WindowText;
+ dataGridViewCellStyle1.SelectionBackColor = SystemColors.Highlight;
+ dataGridViewCellStyle1.SelectionForeColor = SystemColors.HighlightText;
+ dataGridViewCellStyle1.WrapMode = DataGridViewTriState.True;
+ dataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
+ dataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+ dataGridView1.Dock = DockStyle.Fill;
+ dataGridView1.Location = new Point(3, 3);
+ dataGridView1.Name = "dataGridView1";
+ dataGridView1.Size = new Size(1108, 601);
+ dataGridView1.TabIndex = 0;
+ //
+ // tabPage3
+ //
+ tabPage3.Controls.Add(printPreviewControl1);
+ tabPage3.Location = new Point(4, 24);
+ tabPage3.Name = "tabPage3";
+ tabPage3.Size = new Size(1114, 607);
+ tabPage3.TabIndex = 2;
+ tabPage3.Text = "PreView";
+ tabPage3.UseVisualStyleBackColor = true;
+ //
+ // printPreviewControl1
+ //
+ printPreviewControl1.Dock = DockStyle.Fill;
+ printPreviewControl1.Location = new Point(0, 0);
+ printPreviewControl1.Name = "printPreviewControl1";
+ printPreviewControl1.Size = new Size(1114, 607);
+ printPreviewControl1.TabIndex = 0;
+ //
+ // FormReport
+ //
+ AutoScaleDimensions = new SizeF(7F, 15F);
+ AutoScaleMode = AutoScaleMode.Font;
+ ClientSize = new Size(1126, 717);
+ Controls.Add(panel2);
+ Controls.Add(panel1);
+ Name = "FormReport";
+ StartPosition = FormStartPosition.CenterScreen;
+ Text = "FormReport";
+ Load += FormReport_Load;
+ panel1.ResumeLayout(false);
+ panel1.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)numericUpDown1).EndInit();
+ panel2.ResumeLayout(false);
+ tabControl1.ResumeLayout(false);
+ tabPage1.ResumeLayout(false);
+ pnlPaper.ResumeLayout(false);
+ panel5.ResumeLayout(false);
+ pnlDetail.ResumeLayout(false);
+ panel11.ResumeLayout(false);
+ panel12.ResumeLayout(false);
+ panel13.ResumeLayout(false);
+ pnlGroupHeader.ResumeLayout(false);
+ panel10.ResumeLayout(false);
+ panel9.ResumeLayout(false);
+ panel8.ResumeLayout(false);
+ pnlPageHeader.ResumeLayout(false);
+ pnlPageHeader.PerformLayout();
+ tabPage2.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)dataGridView1).EndInit();
+ tabPage3.ResumeLayout(false);
+ ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Panel panel1;
+ private System.Windows.Forms.Button button2;
+ private System.Windows.Forms.Button button1;
+ private System.Windows.Forms.Panel panel2;
+ private System.Windows.Forms.TabControl tabControl1;
+ private System.Windows.Forms.TabPage tabPage1;
+ private System.Windows.Forms.Panel pnlPaper;
+ private System.Windows.Forms.TabPage tabPage2;
+ private System.Windows.Forms.DataGridView dataGridView1;
+ private System.Windows.Forms.Label label4;
+ private System.Windows.Forms.Label label3;
+ private System.Windows.Forms.NumericUpDown numericUpDown1;
+ private System.Windows.Forms.Panel panel5;
+ private System.Windows.Forms.Panel pnlGroupHeader;
+ private System.Windows.Forms.Panel pnlPageHeader;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.Panel pnlDetail;
+ private System.Windows.Forms.Button txtField9;
+ private System.Windows.Forms.Panel panel11;
+ private System.Windows.Forms.Label txtField8;
+ private System.Windows.Forms.Label txtField7;
+ private System.Windows.Forms.Label txtField6;
+ private System.Windows.Forms.Panel panel12;
+ private System.Windows.Forms.Label txtField5;
+ private System.Windows.Forms.Label txtField4;
+ private System.Windows.Forms.Label txtField3;
+ private System.Windows.Forms.Button txtField2;
+ private System.Windows.Forms.Panel panel13;
+ private System.Windows.Forms.Label txtField1;
+ private System.Windows.Forms.Label txtField0;
+ private System.Windows.Forms.Button txtCaption9;
+ private System.Windows.Forms.Panel panel10;
+ private System.Windows.Forms.Label txtCaption8;
+ private System.Windows.Forms.Label txtCaption7;
+ private System.Windows.Forms.Label txtCaption6;
+ private System.Windows.Forms.Panel panel9;
+ private System.Windows.Forms.Label txtCaption5;
+ private System.Windows.Forms.Label txtCaption4;
+ private System.Windows.Forms.Label txtCaption3;
+ private System.Windows.Forms.Button txtCaption2;
+ private System.Windows.Forms.Panel panel8;
+ private System.Windows.Forms.Label txtCaption1;
+ private System.Windows.Forms.Label txtCaption0;
+ private System.Windows.Forms.Label label21;
+ private System.Windows.Forms.TabPage tabPage3;
+ private System.Windows.Forms.PrintPreviewControl printPreviewControl1;
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.SourceFactory/FormReport.cs b/HotelPms.SourceFactory/FormReport.cs
new file mode 100644
index 0000000..29ce2a4
--- /dev/null
+++ b/HotelPms.SourceFactory/FormReport.cs
@@ -0,0 +1,367 @@
+using HotelPms.Share.Windows.Component;
+using HotelPms.Share.Windows.Report;
+using HotelPms.Share.Windows.Report.Member;
+using HotelPms.Share.Windows.Util;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace HotelPms.SourceFactory
+{
+ public partial class FormReport : Form
+ {
+ private DataTable listData;
+
+ private DataTable data;
+
+ public FormReport()
+ {
+ InitializeComponent();
+ }
+
+ private void FormReport_Load(object sender, EventArgs e)
+ {
+ GeneralSub.SetDoubleBuffered(dataGridView1);
+ GeneralSub.InitDataGridView(dataGridView1, true);
+ InitData();
+ InitReport();
+
+ CreateTestData();
+ dataGridView1.DataSource = listData;
+ SetGridStyle();
+ }
+
+ private void InitData()
+ {
+ data = new DataTable();
+ data.Columns.Add("Field0", typeof(DateTime));
+ data.Columns.Add("Field1", typeof(DateTime));
+ data.Columns.Add("Field2", typeof(int));
+ data.Columns.Add("Field3", typeof(int));
+ data.Columns.Add("Field4", typeof(int));
+ data.Columns.Add("Field5", typeof(int));
+ data.Columns.Add("Field6", typeof(int));
+ data.Columns.Add("Field7", typeof(int));
+ data.Columns.Add("Field8", typeof(int));
+ data.Columns.Add("Field9", typeof(string));
+
+ for (int i = 0; i < 100; i++)
+ {
+ DataRow row = data.NewRow();
+ row["Field0"] = DateTime.Now.AddDays((double)i);
+ row["Field1"] = DateTime.Now.AddMinutes(i);
+ row["Field2"] = i + 10000;
+ row["Field3"] = i + 5000;
+ row["Field4"] = i + 6000;
+ row["Field5"] = i + 7000;
+ row["Field6"] = i + 8000;
+ row["Field7"] = i + 9000;
+ row["Field8"] = i + 4000;
+ row["Field9"] = $"備考ですよ:{i}";
+ }
+ }
+
+ private void InitReport()
+ {
+ pnlPageHeader.SetPropertyEx("ReportTag", new ReportControl() { ItemType = ReportControl.EItemType.PageHeader });
+ pnlGroupHeader.SetPropertyEx("ReportTag", new ReportControl() { ItemType = ReportControl.EItemType.GroupHeader });
+ pnlDetail.SetPropertyEx("ReportTag", new ReportControl() { ItemType = ReportControl.EItemType.Detail });
+ }
+
+ private void SetGridStyle()
+ {
+ dataGridView1.ColumnHeadersDefaultCellStyle.SelectionBackColor = SystemColors.Control;
+
+ dataGridView1.Columns[0].Width = 250;
+ dataGridView1.Columns[1].Width = 100;
+ dataGridView1.Columns[2].Width = 80;
+ dataGridView1.Columns[2].DefaultCellStyle.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
+ dataGridView1.Columns[3].Width = 200;
+ dataGridView1.Columns[4].Width = 150;
+ dataGridView1.Columns[5].Width = 100;
+ dataGridView1.Columns[6].Width = 60;
+ dataGridView1.Columns[6].DefaultCellStyle.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
+ dataGridView1.Columns[7].Width = 100;
+ dataGridView1.Columns[8].Width = 100;
+ dataGridView1.Columns[9].Width = 150;
+ dataGridView1.Columns[10].Width = 150;
+ dataGridView1.Columns[10].DefaultCellStyle.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
+ dataGridView1.Columns[11].Width = 100;
+ dataGridView1.Columns[11].DefaultCellStyle.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
+ dataGridView1.Columns[12].Width = 100;
+ dataGridView1.Columns[12].DefaultCellStyle.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
+ dataGridView1.Columns[13].Width = 100;
+ dataGridView1.Columns[13].DefaultCellStyle.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
+ dataGridView1.Columns[14].Width = 100;
+ dataGridView1.Columns[14].DefaultCellStyle.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
+ }
+
+
+ private void CreateTestData()
+ {
+ listData = new DataTable();
+ listData.Columns.Add("予約No", typeof(string));
+ listData.Columns.Add("部屋タイプ", typeof(string));
+ listData.Columns.Add("部屋No", typeof(int));
+ listData.Columns.Add("氏名", typeof(string));
+ listData.Columns.Add("カナ", typeof(string));
+ listData.Columns.Add("到着日", typeof(DateTime));
+ listData.Columns.Add("泊数", typeof(int));
+ listData.Columns.Add("出発日", typeof(DateTime));
+ listData.Columns.Add("部屋人数", typeof(int));
+ listData.Columns.Add("利用合計", typeof(int));
+ listData.Columns.Add("入金合計", typeof(int));
+ listData.Columns.Add("現金", typeof(int));
+ listData.Columns.Add("クレジット", typeof(int));
+ listData.Columns.Add("クーポン", typeof(int));
+ listData.Columns.Add("その他", typeof(int));
+
+ for (int i = 0; i < 100; i++)
+ {
+ Random rd = new Random(Guid.NewGuid().GetHashCode());
+
+ DataRow row = listData.NewRow();
+ listData.Rows.Add(row);
+
+ row["予約No"] = Guid.NewGuid().ToString();
+ row["部屋タイプ"] = GetType(rd.Next(1, 4));
+ row["部屋No"] = rd.Next(101, 3000);
+ int nameId = rd.Next(1, 11);
+ row["氏名"] = GetName(nameId) + " " + GetKanjiNumber(rd.Next(1, 11)) + "郎";
+ row["カナ"] = GetNameKana(nameId);
+
+ DateTime cinDate = DateTime.Now.Date.AddDays((double)rd.Next(1, 10));
+ int stay = rd.Next(1, 99);
+ DateTime coutDate = cinDate.AddDays((double)stay);
+ row["到着日"] = cinDate;
+ row["泊数"] = stay;
+ row["出発日"] = coutDate;
+ row["部屋人数"] = rd.Next(1, 11);
+
+ int cash = rd.Next(0, 100000);
+ int credit = rd.Next(0, 100000);
+ int coupon = rd.Next(0, 100000);
+ int other = rd.Next(0, 100000);
+
+ row["利用合計"] = cash + credit + coupon + other;
+ row["入金合計"] = cash + credit + coupon + other;
+ row["現金"] = cash;
+ row["クレジット"] = credit;
+ row["クーポン"] = coupon;
+ row["その他"] = other;
+ }
+ }
+
+ private string GetKanjiNumber(int type)
+ {
+ switch (type)
+ {
+ case 1:
+ return "一";
+ case 2:
+ return "二";
+ case 3:
+ return "三";
+ case 4:
+ return "四";
+ case 5:
+ return "五";
+ case 6:
+ return "六";
+ case 7:
+ return "七";
+ case 8:
+ return "八";
+ case 9:
+ return "九";
+ case 10:
+ return "十";
+ default:
+ return "太";
+ }
+ }
+
+ private string GetNameKana(int type)
+ {
+ switch (type)
+ {
+ case 1:
+ return "クマモト";
+ case 2:
+ return "フクオカ";
+ case 3:
+ return "サトウ";
+ case 4:
+ return "ナカタ";
+ case 5:
+ return "ナカノ";
+ case 6:
+ return "タムラ";
+ case 7:
+ return "キムラ";
+ case 8:
+ return "ヨシカワ";
+ case 9:
+ return "キチセ";
+ case 10:
+ return "ヨシカワ";
+ default:
+ return "タナカ";
+ }
+ }
+
+ private string GetName(int type)
+ {
+ switch (type)
+ {
+ case 1:
+ return "熊本";
+ case 2:
+ return "福岡";
+ case 3:
+ return "佐藤";
+ case 4:
+ return "中田";
+ case 5:
+ return "中野";
+ case 6:
+ return "田村";
+ case 7:
+ return "木村";
+ case 8:
+ return "吉川";
+ case 9:
+ return "吉瀬";
+ case 10:
+ return "吉岡";
+ default:
+ return "田中";
+ }
+ }
+
+ private string GetType(int type)
+ {
+ switch(type)
+ {
+ case 1:
+ return "シングル";
+ case 2:
+ return "ダブル";
+ default:
+ return "ツイン";
+ }
+ }
+
+ private void button2_Click(object sender, EventArgs e)
+ {
+ if (dataGridView1.Rows.Count == 0)
+ {
+ MessageBox.Show("印刷対象を選択してください。", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
+ return;
+ }
+ //using (Graphics g = this.CreateGraphics())
+ //{
+ // g.PageUnit = GraphicsUnit.Pixel;
+ // using (Font font = new Font("MS UI Gothic", 9F))
+ // {
+ // float w = g.MeasureString("濃", font).Width;
+ // }
+ //}
+
+ // Truncate([numChars*7+5]/7*256)/256
+ using (DataTable data = (dataGridView1.DataSource as DataTable).Copy())
+ {
+ GridStyle style = new GridStyle();
+ style.DefaultRowStyle.Padding = new Padding(10);
+ style.DefaultCellStyle.Font = dataGridView1.DefaultCellStyle.Font;
+
+ //ヘッダー情報設定
+ style.Header.DefaultRowStyle.Font = new Font("MS UI Gothic", 12F);
+ style.Header.DefaultRowStyle.Padding = new Padding(5);
+ style.Header.DefaultCellStyle.Font = new Font("MS UI Gothic", 12F);
+
+ #region 一行目
+ PrintRow printRow = new PrintRow();
+ style.Header.Rows.Add(printRow);
+
+ //右下⇒印刷日時+頁:
+ CellStyle cellTyle = new CellStyle
+ {
+ Dock = DockStyle.Right,
+ WidthMode = CellStyle.EWidthMode.TextWidth,
+ Padding = new Padding(0, 3, 3, 0),
+ Font = new Font("メイリオ", 10F),
+ Alignment = StringAlignment.Far,
+ LineAlignment = StringAlignment.Far,
+ Template = "印刷日時:{0}\r\n頁:{1} / {2}"
+ };
+ //cellTyle.TopBorder.Visible = cellTyle.LeftBorder.Visible = cellTyle.RightBorder.Visible = cellTyle.BottomBorder.Visible = true;
+ Cell cell = new Cell { CellType = Cell.CellKind.TimeAndPage, Style = cellTyle };
+ printRow.Cells.Add(cell);
+
+ //タイトル
+ cellTyle = new CellStyle
+ {
+ Dock = DockStyle.Fill,
+ WidthMode = CellStyle.EWidthMode.AutoFill,
+ Padding = new Padding(0, 3, 3, 0),
+ Font = new Font("メイリオ", 18F),
+ Alignment = StringAlignment.Near,
+ LineAlignment = StringAlignment.Center,
+ };
+ //cellTyle.TopBorder.Visible = cellTyle.LeftBorder.Visible = cellTyle.RightBorder.Visible = cellTyle.BottomBorder.Visible = true;
+ cell = new Cell { CellType = Cell.CellKind.Text, Style = cellTyle, Text = "部屋別売上一覧" };
+ printRow.Cells.Add(cell);
+ #endregion
+
+ #region 二行目
+
+ printRow = new PrintRow();
+ style.Header.Rows.Add(printRow);
+
+ cellTyle = new CellStyle
+ {
+ LocalXMode = CellStyle.ELocalXMode.BeginOfCol,
+ WidthMode = CellStyle.EWidthMode.EndOfCol,
+ BeginCol = 0,
+ EndCol = 3,
+ Padding = new Padding(0, 3, 3, 0),
+ Font = new Font("メイリオ", 10F),
+ Alignment = StringAlignment.Near,
+ LineAlignment = StringAlignment.Center,
+ Template = "利用期間:{0}"
+ };
+ //cellTyle.TopBorder.Visible = cellTyle.LeftBorder.Visible = cellTyle.RightBorder.Visible = cellTyle.BottomBorder.Visible = true;
+ cell = new Cell { CellType = Cell.CellKind.Text, Style = cellTyle, Text = "2021/09/01~2021/09/30" };
+ printRow.Cells.Add(cell);
+
+ cellTyle = new CellStyle
+ {
+ LocalXMode = CellStyle.ELocalXMode.BeginOfCol,
+ WidthMode = CellStyle.EWidthMode.TextWidth,
+ BeginCol = 4,
+ Padding = new Padding(0, 3, 3, 0),
+ Font = new Font("メイリオ", 10F),
+ Alignment = StringAlignment.Near,
+ LineAlignment = StringAlignment.Center,
+ };
+ //cellTyle.TopBorder.Visible = cellTyle.LeftBorder.Visible = cellTyle.RightBorder.Visible = cellTyle.BottomBorder.Visible = true;
+ cell = new Cell { CellType = Cell.CellKind.Text, Style = cellTyle, Text = "利用状態:在室、アウト" };
+ printRow.Cells.Add(cell);
+
+ #endregion
+
+ ReportBase.CreateColumnStyle(dataGridView1, style);
+ ReportFactory.OutputGrid(data, style);
+ }
+
+ MessageBox.Show("OK");
+ }
+ }
+}
diff --git a/HotelPms.SourceFactory/FormReport.resx b/HotelPms.SourceFactory/FormReport.resx
new file mode 100644
index 0000000..8b2ff64
--- /dev/null
+++ b/HotelPms.SourceFactory/FormReport.resx
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root>
\ No newline at end of file
diff --git a/HotelPms.SourceFactory/FormScript.Designer.cs b/HotelPms.SourceFactory/FormScript.Designer.cs
new file mode 100644
index 0000000..0c3ebeb
--- /dev/null
+++ b/HotelPms.SourceFactory/FormScript.Designer.cs
@@ -0,0 +1,203 @@
+namespace HotelPms.SourceFactory
+{
+ partial class FormScript
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.panel1 = new System.Windows.Forms.Panel();
+ this.label2 = new System.Windows.Forms.Label();
+ this.label1 = new System.Windows.Forms.Label();
+ this.textBox2 = new System.Windows.Forms.TextBox();
+ this.textBox1 = new System.Windows.Forms.TextBox();
+ this.materialButton3 = new HotelPms.Share.Windows.Component.MaterialButton();
+ this.materialButton2 = new HotelPms.Share.Windows.Component.MaterialButton();
+ this.btnTextToClass = new HotelPms.Share.Windows.Component.MaterialButton();
+ this.btnPartition = new System.Windows.Forms.Button();
+ this.panel2 = new System.Windows.Forms.Panel();
+ this.txtScript = new System.Windows.Forms.RichTextBox();
+ this.panel1.SuspendLayout();
+ this.panel2.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // panel1
+ //
+ this.panel1.Controls.Add(this.label2);
+ this.panel1.Controls.Add(this.label1);
+ this.panel1.Controls.Add(this.textBox2);
+ this.panel1.Controls.Add(this.textBox1);
+ this.panel1.Controls.Add(this.materialButton3);
+ this.panel1.Controls.Add(this.materialButton2);
+ this.panel1.Controls.Add(this.btnTextToClass);
+ this.panel1.Controls.Add(this.btnPartition);
+ this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.panel1.Location = new System.Drawing.Point(0, 0);
+ this.panel1.Name = "panel1";
+ this.panel1.Size = new System.Drawing.Size(800, 180);
+ this.panel1.TabIndex = 0;
+ //
+ // label2
+ //
+ this.label2.AutoSize = true;
+ this.label2.Location = new System.Drawing.Point(390, 59);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(33, 15);
+ this.label2.TabIndex = 7;
+ this.label2.Text = "Class";
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(185, 59);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(27, 15);
+ this.label1.TabIndex = 6;
+ this.label1.Text = "DLL";
+ //
+ // textBox2
+ //
+ this.textBox2.Location = new System.Drawing.Point(429, 56);
+ this.textBox2.Name = "textBox2";
+ this.textBox2.Size = new System.Drawing.Size(166, 23);
+ this.textBox2.TabIndex = 5;
+ this.textBox2.Text = "HotelPms.Data.Master.Demo";
+ //
+ // textBox1
+ //
+ this.textBox1.Location = new System.Drawing.Point(218, 56);
+ this.textBox1.Name = "textBox1";
+ this.textBox1.Size = new System.Drawing.Size(157, 23);
+ this.textBox1.TabIndex = 4;
+ this.textBox1.Text = "HotelPms.Data.Client";
+ //
+ // materialButton3
+ //
+ this.materialButton3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(105)))), ((int)(((byte)(217)))));
+ this.materialButton3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.materialButton3.ForeColor = System.Drawing.Color.White;
+ this.materialButton3.Location = new System.Drawing.Point(8, 135);
+ this.materialButton3.Name = "materialButton3";
+ this.materialButton3.Radius = 10F;
+ this.materialButton3.Size = new System.Drawing.Size(162, 39);
+ this.materialButton3.TabIndex = 3;
+ this.materialButton3.Text = "DataGridView ⇒ TextBox";
+ this.materialButton3.UseVisualStyleBackColor = false;
+ //
+ // materialButton2
+ //
+ this.materialButton2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(105)))), ((int)(((byte)(217)))));
+ this.materialButton2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.materialButton2.ForeColor = System.Drawing.Color.White;
+ this.materialButton2.Location = new System.Drawing.Point(8, 92);
+ this.materialButton2.Name = "materialButton2";
+ this.materialButton2.Radius = 10F;
+ this.materialButton2.Size = new System.Drawing.Size(162, 39);
+ this.materialButton2.TabIndex = 2;
+ this.materialButton2.Text = "Class ⇒ TextBox";
+ this.materialButton2.UseVisualStyleBackColor = false;
+ this.materialButton2.Click += new System.EventHandler(this.materialButton2_Click);
+ //
+ // btnTextToClass
+ //
+ this.btnTextToClass.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(105)))), ((int)(((byte)(217)))));
+ this.btnTextToClass.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.btnTextToClass.ForeColor = System.Drawing.Color.White;
+ this.btnTextToClass.Location = new System.Drawing.Point(8, 47);
+ this.btnTextToClass.Name = "btnTextToClass";
+ this.btnTextToClass.Radius = 10F;
+ this.btnTextToClass.Size = new System.Drawing.Size(162, 39);
+ this.btnTextToClass.TabIndex = 1;
+ this.btnTextToClass.Text = "TextBox ⇒ Class";
+ this.btnTextToClass.UseVisualStyleBackColor = false;
+ this.btnTextToClass.Click += new System.EventHandler(this.btnTextToClass_Click);
+ //
+ // btnPartition
+ //
+ this.btnPartition.BackColor = System.Drawing.Color.RoyalBlue;
+ this.btnPartition.Cursor = System.Windows.Forms.Cursors.Hand;
+ this.btnPartition.FlatAppearance.BorderSize = 0;
+ this.btnPartition.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.btnPartition.ForeColor = System.Drawing.Color.White;
+ this.btnPartition.Location = new System.Drawing.Point(8, 4);
+ this.btnPartition.Name = "btnPartition";
+ this.btnPartition.Size = new System.Drawing.Size(162, 37);
+ this.btnPartition.TabIndex = 0;
+ this.btnPartition.Text = "パーティション作成";
+ this.btnPartition.UseVisualStyleBackColor = false;
+ this.btnPartition.Click += new System.EventHandler(this.btnPartition_Click);
+ //
+ // panel2
+ //
+ this.panel2.BackColor = System.Drawing.Color.LightSteelBlue;
+ this.panel2.Controls.Add(this.txtScript);
+ this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.panel2.Location = new System.Drawing.Point(0, 180);
+ this.panel2.Name = "panel2";
+ this.panel2.Padding = new System.Windows.Forms.Padding(3);
+ this.panel2.Size = new System.Drawing.Size(800, 270);
+ this.panel2.TabIndex = 1;
+ //
+ // txtScript
+ //
+ this.txtScript.BorderStyle = System.Windows.Forms.BorderStyle.None;
+ this.txtScript.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.txtScript.Location = new System.Drawing.Point(3, 3);
+ this.txtScript.Name = "txtScript";
+ this.txtScript.Size = new System.Drawing.Size(794, 264);
+ this.txtScript.TabIndex = 0;
+ this.txtScript.Text = "";
+ //
+ // FormScript
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(800, 450);
+ this.Controls.Add(this.panel2);
+ this.Controls.Add(this.panel1);
+ this.Name = "FormScript";
+ this.Text = "スクリプト自動生成";
+ this.panel1.ResumeLayout(false);
+ this.panel1.PerformLayout();
+ this.panel2.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private Panel panel1;
+ private Button btnPartition;
+ private Panel panel2;
+ private RichTextBox txtScript;
+ private Share.Windows.Component.MaterialButton materialButton3;
+ private Share.Windows.Component.MaterialButton materialButton2;
+ private Share.Windows.Component.MaterialButton btnTextToClass;
+ private Label label2;
+ private Label label1;
+ private TextBox textBox2;
+ private TextBox textBox1;
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.SourceFactory/FormScript.cs b/HotelPms.SourceFactory/FormScript.cs
new file mode 100644
index 0000000..7c2bab6
--- /dev/null
+++ b/HotelPms.SourceFactory/FormScript.cs
@@ -0,0 +1,32 @@
+using HotelPms.Share.Data.Script;
+using HotelPms.Share.Util;
+using HotelPms.Share.Windows.Util;
+
+namespace HotelPms.SourceFactory
+{
+ public partial class FormScript : Form
+ {
+ public FormScript()
+ {
+ InitializeComponent();
+ }
+
+ private void btnPartition_Click(object sender, EventArgs e)
+ {
+ txtScript.Text = DataBaseCreator.CreatePartitionScript(@"C:\MsSqlData\Data\", "HotelPms", DateTime.Now);
+ GeneralSub.CopyToClipboard(txtScript.Text);
+ }
+
+ private void btnTextToClass_Click(object sender, EventArgs e)
+ {
+ txtScript.Text = ScriptCreator.GetTextBoxToClass(textBox1.Text, textBox2.Text);
+ GeneralSub.CopyToClipboard(txtScript.Text);
+ }
+
+ private void materialButton2_Click(object sender, EventArgs e)
+ {
+ txtScript.Text = ScriptCreator.GetClassToTextBox(textBox1.Text, textBox2.Text);
+ GeneralSub.CopyToClipboard(txtScript.Text);
+ }
+ }
+}
diff --git a/HotelPms.SourceFactory/FormScript.resx b/HotelPms.SourceFactory/FormScript.resx
new file mode 100644
index 0000000..f298a7b
--- /dev/null
+++ b/HotelPms.SourceFactory/FormScript.resx
@@ -0,0 +1,60 @@
+<root>
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root>
\ No newline at end of file
diff --git a/HotelPms.SourceFactory/FormSignalR.Designer.cs b/HotelPms.SourceFactory/FormSignalR.Designer.cs
new file mode 100644
index 0000000..13dd15b
--- /dev/null
+++ b/HotelPms.SourceFactory/FormSignalR.Designer.cs
@@ -0,0 +1,151 @@
+
+namespace HotelPms.SourceFactory
+{
+ partial class FormSignalR
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.panel1 = new System.Windows.Forms.Panel();
+ this.label1 = new System.Windows.Forms.Label();
+ this.textBox1 = new System.Windows.Forms.TextBox();
+ this.button3 = new System.Windows.Forms.Button();
+ this.button2 = new System.Windows.Forms.Button();
+ this.button1 = new System.Windows.Forms.Button();
+ this.panel2 = new System.Windows.Forms.Panel();
+ this.listBox1 = new System.Windows.Forms.ListBox();
+ this.panel1.SuspendLayout();
+ this.panel2.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // panel1
+ //
+ this.panel1.Controls.Add(this.label1);
+ this.panel1.Controls.Add(this.textBox1);
+ this.panel1.Controls.Add(this.button3);
+ this.panel1.Controls.Add(this.button2);
+ this.panel1.Controls.Add(this.button1);
+ this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.panel1.Location = new System.Drawing.Point(0, 0);
+ this.panel1.Name = "panel1";
+ this.panel1.Size = new System.Drawing.Size(800, 72);
+ this.panel1.TabIndex = 0;
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(305, 44);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(38, 15);
+ this.label1.TabIndex = 4;
+ this.label1.Text = "label1";
+ //
+ // textBox1
+ //
+ this.textBox1.Location = new System.Drawing.Point(305, 18);
+ this.textBox1.Name = "textBox1";
+ this.textBox1.Size = new System.Drawing.Size(244, 23);
+ this.textBox1.TabIndex = 3;
+ //
+ // button3
+ //
+ this.button3.Location = new System.Drawing.Point(555, 13);
+ this.button3.Name = "button3";
+ this.button3.Size = new System.Drawing.Size(122, 32);
+ this.button3.TabIndex = 2;
+ this.button3.Text = "Send";
+ this.button3.UseVisualStyleBackColor = true;
+ this.button3.Click += new System.EventHandler(this.button3_Click);
+ //
+ // button2
+ //
+ this.button2.Cursor = System.Windows.Forms.Cursors.Hand;
+ this.button2.Location = new System.Drawing.Point(125, 12);
+ this.button2.Name = "button2";
+ this.button2.Size = new System.Drawing.Size(105, 33);
+ this.button2.TabIndex = 1;
+ this.button2.Text = "Close";
+ this.button2.UseVisualStyleBackColor = true;
+ this.button2.Click += new System.EventHandler(this.button2_Click);
+ //
+ // button1
+ //
+ this.button1.Cursor = System.Windows.Forms.Cursors.Hand;
+ this.button1.Location = new System.Drawing.Point(12, 12);
+ this.button1.Name = "button1";
+ this.button1.Size = new System.Drawing.Size(107, 33);
+ this.button1.TabIndex = 0;
+ this.button1.Text = "Open";
+ this.button1.UseVisualStyleBackColor = true;
+ this.button1.Click += new System.EventHandler(this.button1_Click);
+ //
+ // panel2
+ //
+ this.panel2.Controls.Add(this.listBox1);
+ this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.panel2.Location = new System.Drawing.Point(0, 72);
+ this.panel2.Name = "panel2";
+ this.panel2.Size = new System.Drawing.Size(800, 378);
+ this.panel2.TabIndex = 1;
+ //
+ // listBox1
+ //
+ this.listBox1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.listBox1.FormattingEnabled = true;
+ this.listBox1.ItemHeight = 15;
+ this.listBox1.Location = new System.Drawing.Point(0, 0);
+ this.listBox1.Name = "listBox1";
+ this.listBox1.Size = new System.Drawing.Size(800, 378);
+ this.listBox1.TabIndex = 0;
+ //
+ // FormSignalR
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(800, 450);
+ this.Controls.Add(this.panel2);
+ this.Controls.Add(this.panel1);
+ this.Name = "FormSignalR";
+ this.Text = "FormSignalR";
+ this.panel1.ResumeLayout(false);
+ this.panel1.PerformLayout();
+ this.panel2.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Panel panel1;
+ private System.Windows.Forms.Button button2;
+ private System.Windows.Forms.Button button1;
+ private System.Windows.Forms.Panel panel2;
+ private System.Windows.Forms.ListBox listBox1;
+ private System.Windows.Forms.TextBox textBox1;
+ private System.Windows.Forms.Button button3;
+ private System.Windows.Forms.Label label1;
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.SourceFactory/FormSignalR.cs b/HotelPms.SourceFactory/FormSignalR.cs
new file mode 100644
index 0000000..3f23d70
--- /dev/null
+++ b/HotelPms.SourceFactory/FormSignalR.cs
@@ -0,0 +1,81 @@
+using HotelPms.Data.Common.Dtos;
+using Microsoft.AspNetCore.SignalR.Client;
+using Microsoft.Extensions.DependencyInjection;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace HotelPms.SourceFactory
+{
+ public partial class FormSignalR : Form
+ {
+ private HubConnection hubConnection;
+
+ public FormSignalR()
+ {
+ InitializeComponent();
+ }
+
+ private async void button1_Click(object sender, EventArgs e)
+ {
+ hubConnection = new HubConnectionBuilder()
+ //.WithUrl(NavigationManager.ToAbsoluteUri("/notifyhub"))
+ .WithUrl("https://localhost:44375/notifyhub")
+ .AddMessagePackProtocol()
+ .Build();
+
+ hubConnection.On<MessageDto>("ReceiveMessage", (data) =>
+ {
+ var encodedMsg = $"【{data.Id}】【{data.ConnectionId} ⇒ {data.DestConnectionId}】{data.Data};{data.Tag}";
+ listBox1.Items.Add(encodedMsg);
+
+ var options = new JsonSerializerOptions
+ {
+ WriteIndented = true
+ };
+ string json = JsonSerializer.Serialize(data, options);
+ System.Diagnostics.Debug.WriteLine(json);
+ });
+
+ await hubConnection.StartAsync();
+ label1.Text = hubConnection.ConnectionId;
+ }
+
+ private async Task Send()
+ {
+ MessageDto dto = new MessageDto()
+ {
+ Id = Guid.NewGuid(),
+ UserID = "Client1",
+ Data = textBox1.Text,
+ Tag = "1000",
+ };
+ await hubConnection.SendAsync("SendMessage", dto);
+ }
+
+ public bool IsConnected =>
+ hubConnection.State == HubConnectionState.Connected;
+
+ public async ValueTask DisposeAsync()
+ {
+ await hubConnection.DisposeAsync();
+ }
+
+ private void button3_Click(object sender, EventArgs e)
+ {
+ _= Send();
+ }
+
+ private void button2_Click(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
diff --git a/HotelPms.SourceFactory/FormSignalR.resx b/HotelPms.SourceFactory/FormSignalR.resx
new file mode 100644
index 0000000..f298a7b
--- /dev/null
+++ b/HotelPms.SourceFactory/FormSignalR.resx
@@ -0,0 +1,60 @@
+<root>
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root>
\ No newline at end of file
diff --git a/HotelPms.SourceFactory/FormTableAccessCreator.Designer.cs b/HotelPms.SourceFactory/FormTableAccessCreator.Designer.cs
new file mode 100644
index 0000000..9909a12
--- /dev/null
+++ b/HotelPms.SourceFactory/FormTableAccessCreator.Designer.cs
@@ -0,0 +1,85 @@
+
+namespace HotelPms.SourceFactory
+{
+ partial class FormTableAccessCreator
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.panel1 = new System.Windows.Forms.Panel();
+ this.panel2 = new System.Windows.Forms.Panel();
+ this.button1 = new System.Windows.Forms.Button();
+ this.panel1.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // panel1
+ //
+ this.panel1.Controls.Add(this.button1);
+ this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.panel1.Location = new System.Drawing.Point(0, 0);
+ this.panel1.Name = "panel1";
+ this.panel1.Size = new System.Drawing.Size(851, 100);
+ this.panel1.TabIndex = 0;
+ //
+ // panel2
+ //
+ this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.panel2.Location = new System.Drawing.Point(0, 100);
+ this.panel2.Name = "panel2";
+ this.panel2.Size = new System.Drawing.Size(851, 370);
+ this.panel2.TabIndex = 1;
+ //
+ // button1
+ //
+ this.button1.Location = new System.Drawing.Point(12, 12);
+ this.button1.Name = "button1";
+ this.button1.Size = new System.Drawing.Size(200, 43);
+ this.button1.TabIndex = 0;
+ this.button1.Text = "テーブル毎の制御クラス作成";
+ this.button1.UseVisualStyleBackColor = true;
+ this.button1.Click += new System.EventHandler(this.button1_Click);
+ //
+ // FormTableAccessCreator
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(851, 470);
+ this.Controls.Add(this.panel2);
+ this.Controls.Add(this.panel1);
+ this.Name = "FormTableAccessCreator";
+ this.Text = "FormTableAccessCreator";
+ this.panel1.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Panel panel1;
+ private System.Windows.Forms.Panel panel2;
+ private System.Windows.Forms.Button button1;
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.SourceFactory/FormTableAccessCreator.cs b/HotelPms.SourceFactory/FormTableAccessCreator.cs
new file mode 100644
index 0000000..d2a3061
--- /dev/null
+++ b/HotelPms.SourceFactory/FormTableAccessCreator.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace HotelPms.SourceFactory
+{
+ public partial class FormTableAccessCreator : Form
+ {
+ public FormTableAccessCreator()
+ {
+ InitializeComponent();
+ }
+
+ private void button1_Click(object sender, EventArgs e)
+ {
+ using (BeanCreator form = new BeanCreator())
+ {
+ form.ShowDialog();
+ }
+ }
+ }
+}
diff --git a/HotelPms.SourceFactory/FormTableAccessCreator.resx b/HotelPms.SourceFactory/FormTableAccessCreator.resx
new file mode 100644
index 0000000..f298a7b
--- /dev/null
+++ b/HotelPms.SourceFactory/FormTableAccessCreator.resx
@@ -0,0 +1,60 @@
+<root>
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root>
\ No newline at end of file
diff --git a/HotelPms.SourceFactory/FormValid.Designer.cs b/HotelPms.SourceFactory/FormValid.Designer.cs
new file mode 100644
index 0000000..3645243
--- /dev/null
+++ b/HotelPms.SourceFactory/FormValid.Designer.cs
@@ -0,0 +1,142 @@
+namespace HotelPms.SourceFactory
+{
+ partial class FormValid
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.textBox1 = new System.Windows.Forms.TextBox();
+ this.textBox2 = new System.Windows.Forms.TextBox();
+ this.textBox3 = new System.Windows.Forms.TextBox();
+ this.textBox4 = new System.Windows.Forms.TextBox();
+ this.textBox5 = new System.Windows.Forms.TextBox();
+ this.button1 = new System.Windows.Forms.Button();
+ this.button2 = new System.Windows.Forms.Button();
+ this.SuspendLayout();
+ //
+ // textBox1
+ //
+ this.textBox1.Location = new System.Drawing.Point(230, 15);
+ this.textBox1.Name = "textBox1";
+ this.textBox1.Size = new System.Drawing.Size(198, 23);
+ this.textBox1.TabIndex = 0;
+ this.textBox1.Enter += new System.EventHandler(this.textBox1_Enter);
+ this.textBox1.Leave += new System.EventHandler(this.textBox1_Leave);
+ this.textBox1.Validating += new System.ComponentModel.CancelEventHandler(this.textBox1_Validating);
+ //
+ // textBox2
+ //
+ this.textBox2.Location = new System.Drawing.Point(230, 65);
+ this.textBox2.Name = "textBox2";
+ this.textBox2.Size = new System.Drawing.Size(198, 23);
+ this.textBox2.TabIndex = 1;
+ this.textBox2.Validating += new System.ComponentModel.CancelEventHandler(this.textBox2_Validating);
+ //
+ // textBox3
+ //
+ this.textBox3.Location = new System.Drawing.Point(230, 124);
+ this.textBox3.Name = "textBox3";
+ this.textBox3.Size = new System.Drawing.Size(198, 23);
+ this.textBox3.TabIndex = 2;
+ this.textBox3.Validating += new System.ComponentModel.CancelEventHandler(this.textBox3_Validating);
+ //
+ // textBox4
+ //
+ this.textBox4.Location = new System.Drawing.Point(230, 178);
+ this.textBox4.Name = "textBox4";
+ this.textBox4.Size = new System.Drawing.Size(198, 23);
+ this.textBox4.TabIndex = 3;
+ this.textBox4.Enter += new System.EventHandler(this.textBox4_Enter);
+ this.textBox4.Leave += new System.EventHandler(this.textBox4_Leave);
+ this.textBox4.Validating += new System.ComponentModel.CancelEventHandler(this.textBox4_Validating);
+ //
+ // textBox5
+ //
+ this.textBox5.Location = new System.Drawing.Point(230, 231);
+ this.textBox5.Name = "textBox5";
+ this.textBox5.Size = new System.Drawing.Size(198, 23);
+ this.textBox5.TabIndex = 4;
+ this.textBox5.Enter += new System.EventHandler(this.textBox5_Enter);
+ this.textBox5.Leave += new System.EventHandler(this.textBox5_Leave);
+ this.textBox5.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.textBox5_PreviewKeyDown);
+ this.textBox5.Validating += new System.ComponentModel.CancelEventHandler(this.textBox5_Validating);
+ //
+ // button1
+ //
+ this.button1.CausesValidation = false;
+ this.button1.Location = new System.Drawing.Point(257, 310);
+ this.button1.Name = "button1";
+ this.button1.Size = new System.Drawing.Size(143, 47);
+ this.button1.TabIndex = 6;
+ this.button1.Text = "F1";
+ this.button1.UseVisualStyleBackColor = true;
+ this.button1.Click += new System.EventHandler(this.button1_Click);
+ //
+ // button2
+ //
+ this.button2.CausesValidation = false;
+ this.button2.Location = new System.Drawing.Point(433, 310);
+ this.button2.Name = "button2";
+ this.button2.Size = new System.Drawing.Size(143, 47);
+ this.button2.TabIndex = 5;
+ this.button2.Text = "F12";
+ this.button2.UseVisualStyleBackColor = true;
+ this.button2.Click += new System.EventHandler(this.button2_Click);
+ //
+ // FormValid
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.CausesValidation = false;
+ this.ClientSize = new System.Drawing.Size(800, 450);
+ this.Controls.Add(this.button2);
+ this.Controls.Add(this.button1);
+ this.Controls.Add(this.textBox5);
+ this.Controls.Add(this.textBox4);
+ this.Controls.Add(this.textBox3);
+ this.Controls.Add(this.textBox2);
+ this.Controls.Add(this.textBox1);
+ this.KeyPreview = true;
+ this.Name = "FormValid";
+ this.Text = "FormValid";
+ this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FormValid_FormClosing);
+ this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FormValid_KeyDown);
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.TextBox textBox1;
+ private System.Windows.Forms.TextBox textBox2;
+ private System.Windows.Forms.TextBox textBox3;
+ private System.Windows.Forms.TextBox textBox4;
+ private System.Windows.Forms.TextBox textBox5;
+ private System.Windows.Forms.Button button1;
+ private System.Windows.Forms.Button button2;
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.SourceFactory/FormValid.cs b/HotelPms.SourceFactory/FormValid.cs
new file mode 100644
index 0000000..a5d5c89
--- /dev/null
+++ b/HotelPms.SourceFactory/FormValid.cs
@@ -0,0 +1,156 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace HotelPms.SourceFactory
+{
+ public partial class FormValid : Form
+ {
+ /// <summary>
+ /// Validatingチェック&メッセージ表示攻略
+ /// ①CausesValidationItemを作成
+ /// ②終了ボタンのCausesValidation = falseでValidatingを一旦止める(※注意:フォーカスを離れると、Validatingは再度走る)
+ /// ③WndProcで×ボタンを押した時に、Validatingを一旦止める仕掛け this.ActiveControl = 終了ボタン;
+ /// ④FormValid_KeyDownを押した時に、Validatingを一旦止める仕掛け this.ActiveControl = 終了ボタン;
+ /// ⑤全部Validatingの先頭に下記の追加(CausesValidation = falseで一旦止めたValidatingは再度走る防止するため)
+ /// if (!CausesValidationItem(sender)) { return; }
+ /// </summary>
+ public FormValid()
+ {
+ InitializeComponent();
+ button1.CausesValidation = true;
+ // button2.TabIndex = 0;
+ button2.CausesValidation = false; //終了
+ }
+
+ private bool CausesValidationItem(object sender)
+ {
+ return this.ActiveControl.CausesValidation;
+ }
+
+ private void textBox1_Validating(object sender, CancelEventArgs e)
+ {
+ if (!CausesValidationItem(sender)) { return; }
+ MessageBox.Show("textBox1_Validating");
+ }
+
+ private void textBox2_Validating(object sender, CancelEventArgs e)
+ {
+ if (!CausesValidationItem(sender)) { return; }
+ //if (!this.CausesValidation) { return; }
+ MessageBox.Show("textBox2_Validating");
+ }
+
+ private void textBox3_Validating(object sender, CancelEventArgs e)
+ {
+ if (!CausesValidationItem(sender)) { return; }
+ MessageBox.Show("textBox3_Validating");
+ }
+
+ private void textBox4_Validating(object sender, CancelEventArgs e)
+ {
+ if (!CausesValidationItem(sender)) { return; }
+ MessageBox.Show("textBox4_Validating");
+ }
+
+ private void textBox5_Validating(object sender, CancelEventArgs e)
+ {
+ System.Diagnostics.Debug.WriteLine("Raise textBox5_Validating ");
+ if (!CausesValidationItem(sender)) { return; }
+ MessageBox.Show("textBox5_Validating");
+ }
+
+ private void button2_Click(object sender, EventArgs e)
+ {
+ //Focus時、前のコントロールのValidatingを一旦止める
+
+ this.Close(); //この時点、ボタンをフォーカスを離れるので、前のコントロールのValidatingを再度走る
+ }
+
+ private void button1_Click(object sender, EventArgs e)
+ {
+ MessageBox.Show("button1_Click");
+ }
+
+ private void FormValid_KeyDown(object sender, KeyEventArgs e)
+ {
+ if (e.KeyCode == Keys.F1)
+ {
+ this.ActiveControl = button1;
+ button1.PerformClick();
+ }
+ else if (e.KeyCode == Keys.F12)
+ {
+ this.ActiveControl = button2;
+ button2.PerformClick();
+ }
+ }
+
+ protected override void WndProc(ref Message m)
+ {
+ //Console.WriteLine(m.Msg);
+ const int WM_SYSCOMMAND = 0x0112;
+ const int SC_CLOSE = 0xF060;
+ if (m.Msg == WM_SYSCOMMAND && (int)m.WParam == SC_CLOSE)
+ {
+ //windowsの×ボタンを押すとき
+ this.ActiveControl = button2;
+ }
+ base.WndProc(ref m);
+ }
+
+ private void FormValid_FormClosing(object sender, FormClosingEventArgs e)
+ {
+ //コントロールのValidatingの後
+ this.ActiveControl = button2;
+ }
+
+ private void textBox5_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
+ {
+ switch(e.KeyCode)
+ {
+ case Keys.Tab:
+ //enterや、tabでボタンへフォーカスする時、まだ終了していないので、チェックすることは望ましい
+ textBox5_Validating(sender, new CancelEventArgs());
+ e.IsInputKey = false;
+ break;
+ }
+ }
+
+ private void textBox5_Enter(object sender, EventArgs e)
+ {
+ textBox5.BackColor = Color.Cyan;
+ }
+
+ private void textBox5_Leave(object sender, EventArgs e)
+ {
+ textBox5.BackColor = Color.White;
+ }
+
+ private void textBox4_Enter(object sender, EventArgs e)
+ {
+ textBox4.BackColor = Color.Cyan;
+ }
+
+ private void textBox4_Leave(object sender, EventArgs e)
+ {
+ textBox4.BackColor = Color.White;
+ }
+
+ private void textBox1_Enter(object sender, EventArgs e)
+ {
+ textBox1.BackColor = Color.Cyan;
+ }
+
+ private void textBox1_Leave(object sender, EventArgs e)
+ {
+ textBox1.BackColor = Color.White;
+ }
+ }
+}
diff --git a/HotelPms.SourceFactory/FormValid.resx b/HotelPms.SourceFactory/FormValid.resx
new file mode 100644
index 0000000..f298a7b
--- /dev/null
+++ b/HotelPms.SourceFactory/FormValid.resx
@@ -0,0 +1,60 @@
+<root>
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root>
\ No newline at end of file
diff --git a/HotelPms.SourceFactory/HotelPms.SourceFactory.csproj b/HotelPms.SourceFactory/HotelPms.SourceFactory.csproj
new file mode 100644
index 0000000..f73c631
--- /dev/null
+++ b/HotelPms.SourceFactory/HotelPms.SourceFactory.csproj
@@ -0,0 +1,62 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <OutputType>WinExe</OutputType>
+ <TargetFramework>net9.0-windows7.0</TargetFramework>
+ <Nullable>enable</Nullable>
+ <UseWindowsForms>true</UseWindowsForms>
+ <ImplicitUsings>enable</ImplicitUsings>
+ <AssemblyVersion>1.0.0.1</AssemblyVersion>
+ <FileVersion>1.0.0.2</FileVersion>
+ <PlatformTarget>AnyCPU</PlatformTarget>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <None Remove="Template\BeanFileMode.txt" />
+ <None Remove="Template\BeanFileMode_ProtoEx.txt" />
+ <None Remove="Template\BeanFileMode_ProtoEx_Service.txt" />
+ <None Remove="Template\BeanFileMode_ProtoEx_Table.txt" />
+ <None Remove="Template\BeanFileMode_ts.txt" />
+ <None Remove="Template\BeanFileMode_tsinterface.txt" />
+ <None Remove="Template\DataAccessFileMode.txt" />
+ <None Remove="Template\Detail.designer.txt" />
+ <None Remove="Template\Detail.txt" />
+ <None Remove="Template\Proto3Master.txt" />
+ <None Remove="Template\Proto3Msg.txt" />
+ <None Remove="Template\Proto3MsgAll.txt" />
+ <None Remove="Template\ViewModel.txt" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <EmbeddedResource Include="Template\BeanFileMode.txt" />
+ <EmbeddedResource Include="Template\BeanFileMode_ProtoEx.txt" />
+ <EmbeddedResource Include="Template\BeanFileMode_ProtoEx_Service.txt" />
+ <EmbeddedResource Include="Template\BeanFileMode_ProtoEx_Table.txt" />
+ <EmbeddedResource Include="Template\BeanFileMode_ts.txt" />
+ <EmbeddedResource Include="Template\BeanFileMode_tsinterface.txt" />
+ <EmbeddedResource Include="Template\DataAccessFileMode.txt" />
+ <EmbeddedResource Include="Template\Detail.designer.txt" />
+ <EmbeddedResource Include="Template\Detail.txt" />
+ <EmbeddedResource Include="Template\Proto3Master.txt" />
+ <EmbeddedResource Include="Template\Proto3Msg.txt" />
+ <EmbeddedResource Include="Template\Proto3MsgAll.txt" />
+ <EmbeddedResource Include="Template\ViewModel.txt" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <PackageReference Include="ClosedXML" Version="0.105.0" />
+ <PackageReference Include="MailKit" Version="4.11.0" />
+ <PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.MessagePack" Version="9.0.3" />
+ <PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3124.44" />
+ <PackageReference Include="NPOI" Version="2.7.3" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <ProjectReference Include="..\HotelPms.Data.Client\HotelPms.Data.Client.csproj" />
+ <ProjectReference Include="..\HotelPms.Data.Common\HotelPms.Data.Common.csproj" />
+ <ProjectReference Include="..\HotelPms.DataAccessGrpc.Client\HotelPms.DataAccessGrpc.Client.csproj" />
+ <ProjectReference Include="..\HotelPms.Share.Windows\HotelPms.Share.Windows.csproj" />
+ <ProjectReference Include="..\HotelPms.Share\HotelPms.Share.csproj" />
+ <ProjectReference Include="..\HotelPms.VerUp\HotelPms.VerUp.csproj" />
+ </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/HotelPms.SourceFactory/PivotTables.xlsx b/HotelPms.SourceFactory/PivotTables.xlsx
new file mode 100644
index 0000000..9368343
--- /dev/null
+++ b/HotelPms.SourceFactory/PivotTables.xlsx
Binary files differ
diff --git a/HotelPms.SourceFactory/PostgreSqlDemo.Designer.cs b/HotelPms.SourceFactory/PostgreSqlDemo.Designer.cs
new file mode 100644
index 0000000..7fd2725
--- /dev/null
+++ b/HotelPms.SourceFactory/PostgreSqlDemo.Designer.cs
@@ -0,0 +1,233 @@
+
+namespace HotelPms.SourceFactory
+{
+ partial class PostgreSqlDemo
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.label1 = new System.Windows.Forms.Label();
+ this.txtHost = new System.Windows.Forms.TextBox();
+ this.txtUser = new System.Windows.Forms.TextBox();
+ this.label2 = new System.Windows.Forms.Label();
+ this.panel1 = new System.Windows.Forms.Panel();
+ this.button1 = new System.Windows.Forms.Button();
+ this.txtDB = new System.Windows.Forms.TextBox();
+ this.label4 = new System.Windows.Forms.Label();
+ this.txtPassword = new System.Windows.Forms.TextBox();
+ this.label3 = new System.Windows.Forms.Label();
+ this.panel2 = new System.Windows.Forms.Panel();
+ this.dataGridView1 = new System.Windows.Forms.DataGridView();
+ this.txtSql = new System.Windows.Forms.TextBox();
+ this.button2 = new System.Windows.Forms.Button();
+ this.label5 = new System.Windows.Forms.Label();
+ this.panel1.SuspendLayout();
+ this.panel2.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
+ this.SuspendLayout();
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(29, 22);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(30, 15);
+ this.label1.TabIndex = 0;
+ this.label1.Text = "host";
+ //
+ // txtHost
+ //
+ this.txtHost.Location = new System.Drawing.Point(65, 18);
+ this.txtHost.Name = "txtHost";
+ this.txtHost.Size = new System.Drawing.Size(83, 23);
+ this.txtHost.TabIndex = 1;
+ this.txtHost.Text = "127.0.0.1";
+ //
+ // txtUser
+ //
+ this.txtUser.Location = new System.Drawing.Point(189, 18);
+ this.txtUser.Name = "txtUser";
+ this.txtUser.Size = new System.Drawing.Size(76, 23);
+ this.txtUser.TabIndex = 3;
+ this.txtUser.Text = "postgres";
+ //
+ // label2
+ //
+ this.label2.AutoSize = true;
+ this.label2.Location = new System.Drawing.Point(154, 22);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(29, 15);
+ this.label2.TabIndex = 2;
+ this.label2.Text = "user";
+ //
+ // panel1
+ //
+ this.panel1.Controls.Add(this.label5);
+ this.panel1.Controls.Add(this.button2);
+ this.panel1.Controls.Add(this.txtSql);
+ this.panel1.Controls.Add(this.button1);
+ this.panel1.Controls.Add(this.txtDB);
+ this.panel1.Controls.Add(this.label4);
+ this.panel1.Controls.Add(this.txtPassword);
+ this.panel1.Controls.Add(this.label3);
+ this.panel1.Controls.Add(this.label1);
+ this.panel1.Controls.Add(this.txtUser);
+ this.panel1.Controls.Add(this.txtHost);
+ this.panel1.Controls.Add(this.label2);
+ this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.panel1.Location = new System.Drawing.Point(0, 0);
+ this.panel1.Name = "panel1";
+ this.panel1.Size = new System.Drawing.Size(800, 214);
+ this.panel1.TabIndex = 4;
+ //
+ // button1
+ //
+ this.button1.Location = new System.Drawing.Point(583, 11);
+ this.button1.Name = "button1";
+ this.button1.Size = new System.Drawing.Size(121, 35);
+ this.button1.TabIndex = 8;
+ this.button1.Text = "DB作成";
+ this.button1.UseVisualStyleBackColor = true;
+ this.button1.Click += new System.EventHandler(this.button1_Click);
+ //
+ // txtDB
+ //
+ this.txtDB.Location = new System.Drawing.Point(482, 18);
+ this.txtDB.Name = "txtDB";
+ this.txtDB.Size = new System.Drawing.Size(76, 23);
+ this.txtDB.TabIndex = 7;
+ this.txtDB.Text = "HotelPms";
+ //
+ // label4
+ //
+ this.label4.AutoSize = true;
+ this.label4.Location = new System.Drawing.Point(441, 22);
+ this.label4.Name = "label4";
+ this.label4.Size = new System.Drawing.Size(22, 15);
+ this.label4.TabIndex = 6;
+ this.label4.Text = "DB";
+ //
+ // txtPassword
+ //
+ this.txtPassword.Location = new System.Drawing.Point(345, 18);
+ this.txtPassword.Name = "txtPassword";
+ this.txtPassword.Size = new System.Drawing.Size(76, 23);
+ this.txtPassword.TabIndex = 5;
+ this.txtPassword.Text = "oatcti";
+ //
+ // label3
+ //
+ this.label3.AutoSize = true;
+ this.label3.Location = new System.Drawing.Point(282, 22);
+ this.label3.Name = "label3";
+ this.label3.Size = new System.Drawing.Size(57, 15);
+ this.label3.TabIndex = 4;
+ this.label3.Text = "password";
+ //
+ // panel2
+ //
+ this.panel2.Controls.Add(this.dataGridView1);
+ this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.panel2.Location = new System.Drawing.Point(0, 214);
+ this.panel2.Name = "panel2";
+ this.panel2.Size = new System.Drawing.Size(800, 283);
+ this.panel2.TabIndex = 5;
+ //
+ // dataGridView1
+ //
+ this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+ this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.dataGridView1.Location = new System.Drawing.Point(0, 0);
+ this.dataGridView1.Name = "dataGridView1";
+ this.dataGridView1.RowTemplate.Height = 25;
+ this.dataGridView1.Size = new System.Drawing.Size(800, 283);
+ this.dataGridView1.TabIndex = 0;
+ //
+ // txtSql
+ //
+ this.txtSql.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.txtSql.Location = new System.Drawing.Point(0, 119);
+ this.txtSql.Multiline = true;
+ this.txtSql.Name = "txtSql";
+ this.txtSql.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
+ this.txtSql.Size = new System.Drawing.Size(800, 95);
+ this.txtSql.TabIndex = 9;
+ //
+ // button2
+ //
+ this.button2.Location = new System.Drawing.Point(91, 78);
+ this.button2.Name = "button2";
+ this.button2.Size = new System.Drawing.Size(121, 35);
+ this.button2.TabIndex = 10;
+ this.button2.Text = "GetDataTable";
+ this.button2.UseVisualStyleBackColor = true;
+ this.button2.Click += new System.EventHandler(this.button2_Click);
+ //
+ // label5
+ //
+ this.label5.AutoSize = true;
+ this.label5.Location = new System.Drawing.Point(12, 98);
+ this.label5.Name = "label5";
+ this.label5.Size = new System.Drawing.Size(23, 15);
+ this.label5.TabIndex = 11;
+ this.label5.Text = "Sql";
+ //
+ // PostgreSqlDemo
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(800, 497);
+ this.Controls.Add(this.panel2);
+ this.Controls.Add(this.panel1);
+ this.Name = "PostgreSqlDemo";
+ this.Text = "PostgreSqlDemo";
+ this.panel1.ResumeLayout(false);
+ this.panel1.PerformLayout();
+ this.panel2.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.TextBox txtHost;
+ private System.Windows.Forms.TextBox txtUser;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.Panel panel1;
+ private System.Windows.Forms.Button button1;
+ private System.Windows.Forms.TextBox txtDB;
+ private System.Windows.Forms.Label label4;
+ private System.Windows.Forms.TextBox txtPassword;
+ private System.Windows.Forms.Label label3;
+ private System.Windows.Forms.Panel panel2;
+ private System.Windows.Forms.DataGridView dataGridView1;
+ private System.Windows.Forms.Label label5;
+ private System.Windows.Forms.Button button2;
+ private System.Windows.Forms.TextBox txtSql;
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.SourceFactory/PostgreSqlDemo.cs b/HotelPms.SourceFactory/PostgreSqlDemo.cs
new file mode 100644
index 0000000..566ede9
--- /dev/null
+++ b/HotelPms.SourceFactory/PostgreSqlDemo.cs
@@ -0,0 +1,49 @@
+using HotelPms.Share.Data;
+using HotelPms.Share.Windows.Util;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace HotelPms.SourceFactory
+{
+ public partial class PostgreSqlDemo : Form
+ {
+ public PostgreSqlDemo()
+ {
+ InitializeComponent();
+ GeneralSub.InitDataGridView(dataGridView1, true);
+ }
+
+ private void button1_Click(object sender, EventArgs e)
+ {
+ bool ret = PostgreSqlNet.CreateDataBase(new DBConnectItem(txtHost.Text, txtDB.Text, txtUser.Text, txtPassword.Text, 5433));
+ dataGridView1.DataSource = ToTable(ret.ToString());
+
+ }
+
+
+ public DataTable ToTable(string msg)
+ {
+ DataTable table = new DataTable();
+ table.Columns.Add("内容", typeof(string));
+ DataRow row = table.NewRow();
+ table.Rows.Add(row);
+ row[0] = msg;
+ return table;
+ }
+
+ private void button2_Click(object sender, EventArgs e)
+ {
+ using (PostgreSqlNet postgreSqlNet = new PostgreSqlNet(new DBConnectItem(txtHost.Text, txtDB.Text, txtUser.Text, txtPassword.Text, 5433)))
+ {
+ dataGridView1.DataSource = postgreSqlNet.GetDataTable(txtSql.Text);
+ }
+ }
+ }
+}
diff --git a/HotelPms.SourceFactory/PostgreSqlDemo.resx b/HotelPms.SourceFactory/PostgreSqlDemo.resx
new file mode 100644
index 0000000..f298a7b
--- /dev/null
+++ b/HotelPms.SourceFactory/PostgreSqlDemo.resx
@@ -0,0 +1,60 @@
+<root>
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root>
\ No newline at end of file
diff --git a/HotelPms.SourceFactory/Program.cs b/HotelPms.SourceFactory/Program.cs
new file mode 100644
index 0000000..9dae9fb
--- /dev/null
+++ b/HotelPms.SourceFactory/Program.cs
@@ -0,0 +1,21 @@
+using HotelPms.SourceFactory.Util;
+
+namespace HotelPms.SourceFactory
+{
+ static class Program
+ {
+ /// <summary>
+ /// The main entry point for the application.
+ /// </summary>
+ [STAThread]
+ static void Main()
+ {
+ Application.SetHighDpiMode(HighDpiMode.SystemAware);
+ Application.EnableVisualStyles();
+ Application.SetCompatibleTextRenderingDefault(false);
+ EnvironmentSetting.Init();
+ Application.Run(new FormMain());
+ //Application.Run(new Form1());
+ }
+ }
+}
diff --git a/HotelPms.SourceFactory/Table/SqlFactory.cs b/HotelPms.SourceFactory/Table/SqlFactory.cs
new file mode 100644
index 0000000..0d0ae6d
--- /dev/null
+++ b/HotelPms.SourceFactory/Table/SqlFactory.cs
@@ -0,0 +1,207 @@
+using HotelPms.Share.Data;
+using HotelPms.Share.Data.Script;
+using HotelPms.Share.IO;
+using HotelPms.Share.Windows.Util;
+using System.Reflection;
+using System.Text;
+
+namespace HotelPms.SourceFactory.Table
+{
+ /// <summary>
+ /// Excelのテーブル定義書より、
+ /// SqlScriptを作成する
+ /// </summary>
+ public class SqlFactory : IDisposable
+ {
+ public DBConnectItem? DBSetting { get; set; }
+ public string ExcelFile { get; set; } = string.Empty;
+
+ public void Dispose()
+ {
+
+ }
+
+ public bool CreateByExcel(string file, DBConnectItem dbSetting)
+ {
+ try
+ {
+ ExcelFile = file;
+ DBSetting = dbSetting;
+ using (NPOIExcel excel = new NPOIExcel(file))
+ {
+ for (int i = 0; i < excel.Workbook.NumberOfSheets; i++)
+ {
+ excel.SetCurrentSheet(i);
+ if (!IsTableSheet(excel)) { continue; }
+ CreateBySheet(excel);
+ }
+ }
+ return true;
+ }
+ catch (Exception ex)
+ {
+ OperationLog.Instance.WriteLog($"{MethodInfo.GetCurrentMethod()}:{ex.Message}");
+ return false;
+ }
+ }
+
+ /// <summary>
+ /// 対象シートはテーブル定義のシートかどうか
+ /// B4 = "テーブル名" ⇒ TABLE = G4
+ /// </summary>
+ /// <param name="sheet"></param>
+ /// <returns></returns>
+ private bool IsTableSheet(NPOIExcel excel)
+ {
+ bool result = false;
+ try
+ {
+ if("テンプレート" == excel.Sheet.SheetName
+ || excel.GetCellForceString("B4") != "テーブル名"
+ || excel.GetCellForceString("B6") != "No"
+ || excel.GetCellForceString("B7") != "1"
+ || excel.GetCellForceString("D6") != "項目名"
+ || excel.GetCellForceString("K6") != "説明"
+ || excel.GetCellForceString("S6") != "型"
+ || excel.GetCellForceString("X6") != "PK")
+ {
+ result = false;
+ return result;
+ }
+
+ result = true;
+ return result;
+ }
+ catch (Exception ex)
+ {
+ OperationLog.Instance.WriteLog($"{MethodInfo.GetCurrentMethod()}:{ex.Message}");
+ result = false;
+ return result;
+ }
+ finally
+ {
+ OperationLog.Instance.WriteLog($"{excel.Sheet.SheetName} ⇒ テーブル定義シート:{ (result ? "Yes" : "No") }");
+ }
+ }
+
+ /// <summary>
+ /// シート情報よりテーブル作成する
+ /// </summary>
+ /// <param name="sheet"></param>
+ public bool CreateBySheet(NPOIExcel excel)
+ {
+ try
+ {
+ OperationLog.Instance.WriteLog($"{MethodInfo.GetCurrentMethod()}:{excel.Sheet.SheetName}");
+ string[] tables = excel.GetCellString("G4").Split(new char[] { ',' });
+
+ using (TableCreator creator = new TableCreator())
+ using (DataAccess dataAccess = new MsSqlNet(DBSetting))
+ {
+
+ //DB中のデータ取得
+ var dbFields = dataAccess.GetDataReader<Dictionary<string, Field>>($"EXECUTE [dbo].[GetTableDefine] '{tables[0]}'", (reader, data) =>
+ {
+ while (reader.Read())
+ {
+ var item = new Field(reader);
+ data.Add(item.Name, item);
+ }
+ });
+
+ bool isNew = dbFields == null || dbFields.Count == 0;
+ StringBuilder sqlEdit = new StringBuilder();
+
+ //Excelを読込む
+ List<Field> curFields = new List<Field>();
+ int r = 0;
+ for (int i = 6; i < excel.Sheet.LastRowNum; i++)
+ {
+ int no = excel.GetCellInt($"B{i + 1}");
+ if (no != (r + 1)) { continue; } //必ず連続
+ r++;
+ string colName = excel.GetCellString($"D{i + 1}");
+ if (colName.Length == 0) { break; }
+
+ string pk = excel.GetCellString($"X{i + 1}").ToUpper();
+ var curItem = new Field
+ {
+ Name = colName,
+ Description = excel.GetCellString($"K{i + 1}"),
+ DataType = excel.GetCellString($"S{i + 1}"),
+ IsPrimaryKey = pk.Length > 0,
+ IsIdentity = pk == "AUTO"
+ };
+
+ creator.Fields.Add(curItem); //無条件追加、データ型変更した場合、テーブル再作成になる
+
+ Field dbItem;
+ if (dbFields != null && dbFields.TryGetValue(colName, out dbItem))
+ {
+ //突合(追加・変更分のみ)
+ int ret = dbItem.CompareTo(curItem);
+ if (ret == 1 || ret == 12)
+ {
+ //削除
+ sqlEdit.AppendLine($@"IF EXISTS(SELECT * FROM SYS.EXTENDED_PROPERTIES WHERE [major_id] = OBJECT_ID('*TableName*') AND [name] = N'MS_Description' AND [minor_id] = (SELECT [column_id] FROM SYS.COLUMNS WHERE [name] = '{curItem.Name}' AND [object_id] = OBJECT_ID('*TableName*')))
+EXEC sys.sp_dropextendedproperty @name=N'MS_Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'*TableName*', @level2type=N'COLUMN',@level2name=N'{curItem.Name}';");
+
+
+ if (curItem.Description.Length > 0)
+ {
+ sqlEdit.AppendLine($"EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'{curItem.Description}' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'*TableName*', @level2type=N'COLUMN',@level2name=N'{curItem.Name}';");
+ }
+ }
+
+ if (ret == 2 || ret == 12)
+ {
+ //タイプ変更があったら、削除してから、再作成のほうが増し
+ isNew = true;
+ //例:DateTime⇒intではダメ
+ //sqlEdit.AppendLine($"ALTER TABLE [*TableName*] ALTER COLUMN {curItem.Name} {curItem.DataType} NULL;");
+ //sqlEdit.AppendLine($"ALTER TABLE [*TableName*] DROP COLUMN {curItem.Name};");
+ //sqlEdit.AppendLine($"ALTER TABLE [*TableName*] ADD {curItem.Name} {curItem.DataType} NULL;");
+ }
+ }
+ else
+ {
+ //新規追加
+ sqlEdit.AppendLine($"ALTER TABLE [*TableName*] ADD {curItem.Name} {curItem.DataType} NULL;");
+ }
+ }
+
+ if(!isNew && sqlEdit.Length == 0) { return true; }
+
+ //作成
+ string sql = String.Empty;
+ foreach (string tableName in tables)
+ {
+ if (isNew)
+ {
+ creator.Name = tableName;
+ creator.Description = excel.GetCellString("G5");
+ creator.PartitionSchema = excel.GetCellString("X4");
+ creator.PartitionKey = excel.GetCellString("AH4");
+ sql = creator.ToString();
+ }
+ else
+ {
+ sql = sqlEdit.ToString().Replace("*TableName*", tableName);
+ }
+
+ int ret = dataAccess.ExecuteNonQuery(sql);
+ OperationLog.Instance.WriteLog(sql);
+ if (ret == -1) { return false; }
+ }
+ }
+ return true;
+ }
+ catch (Exception ex)
+ {
+ OperationLog.Instance.WriteLog($"{MethodInfo.GetCurrentMethod()}:{ex.Message}");
+ return false;
+ }
+ }
+
+ }
+}
diff --git a/HotelPms.SourceFactory/TableToExcel.Designer.cs b/HotelPms.SourceFactory/TableToExcel.Designer.cs
new file mode 100644
index 0000000..b1f7110
--- /dev/null
+++ b/HotelPms.SourceFactory/TableToExcel.Designer.cs
@@ -0,0 +1,360 @@
+
+namespace HotelPms.SourceFactory
+{
+ partial class TableToExcel
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.panel1 = new System.Windows.Forms.Panel();
+ this.txtNewSheet = new System.Windows.Forms.TextBox();
+ this.btnCopySheet = new System.Windows.Forms.Button();
+ this.groupBox1 = new System.Windows.Forms.GroupBox();
+ this.label6 = new System.Windows.Forms.Label();
+ this.lblStatus = new System.Windows.Forms.Label();
+ this.txtTableConditon = new System.Windows.Forms.TextBox();
+ this.button3 = new System.Windows.Forms.Button();
+ this.button2 = new System.Windows.Forms.Button();
+ this.button1 = new System.Windows.Forms.Button();
+ this.btnOpenDB = new System.Windows.Forms.Button();
+ this.label5 = new System.Windows.Forms.Label();
+ this.cmbTable = new System.Windows.Forms.ComboBox();
+ this.txtPassword = new System.Windows.Forms.TextBox();
+ this.label4 = new System.Windows.Forms.Label();
+ this.txtUser = new System.Windows.Forms.TextBox();
+ this.label3 = new System.Windows.Forms.Label();
+ this.txtDB = new System.Windows.Forms.TextBox();
+ this.label2 = new System.Windows.Forms.Label();
+ this.txtHost = new System.Windows.Forms.TextBox();
+ this.label1 = new System.Windows.Forms.Label();
+ this.cmbSheet = new System.Windows.Forms.ComboBox();
+ this.txtExcelPath = new System.Windows.Forms.TextBox();
+ this.OpenExcel = new System.Windows.Forms.Button();
+ this.panel2 = new System.Windows.Forms.Panel();
+ this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
+ this.panel1.SuspendLayout();
+ this.groupBox1.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // panel1
+ //
+ this.panel1.Controls.Add(this.txtNewSheet);
+ this.panel1.Controls.Add(this.btnCopySheet);
+ this.panel1.Controls.Add(this.groupBox1);
+ this.panel1.Controls.Add(this.cmbSheet);
+ this.panel1.Controls.Add(this.txtExcelPath);
+ this.panel1.Controls.Add(this.OpenExcel);
+ this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.panel1.Location = new System.Drawing.Point(0, 0);
+ this.panel1.Name = "panel1";
+ this.panel1.Size = new System.Drawing.Size(800, 324);
+ this.panel1.TabIndex = 0;
+ //
+ // txtNewSheet
+ //
+ this.txtNewSheet.Location = new System.Drawing.Point(160, 74);
+ this.txtNewSheet.Name = "txtNewSheet";
+ this.txtNewSheet.Size = new System.Drawing.Size(129, 23);
+ this.txtNewSheet.TabIndex = 5;
+ //
+ // btnCopySheet
+ //
+ this.btnCopySheet.Location = new System.Drawing.Point(21, 68);
+ this.btnCopySheet.Name = "btnCopySheet";
+ this.btnCopySheet.Size = new System.Drawing.Size(133, 32);
+ this.btnCopySheet.TabIndex = 4;
+ this.btnCopySheet.Text = "CopySheet To";
+ this.btnCopySheet.UseVisualStyleBackColor = true;
+ this.btnCopySheet.Click += new System.EventHandler(this.btnCopySheet_Click);
+ //
+ // groupBox1
+ //
+ this.groupBox1.Controls.Add(this.label6);
+ this.groupBox1.Controls.Add(this.lblStatus);
+ this.groupBox1.Controls.Add(this.txtTableConditon);
+ this.groupBox1.Controls.Add(this.button3);
+ this.groupBox1.Controls.Add(this.button2);
+ this.groupBox1.Controls.Add(this.button1);
+ this.groupBox1.Controls.Add(this.btnOpenDB);
+ this.groupBox1.Controls.Add(this.label5);
+ this.groupBox1.Controls.Add(this.cmbTable);
+ this.groupBox1.Controls.Add(this.txtPassword);
+ this.groupBox1.Controls.Add(this.label4);
+ this.groupBox1.Controls.Add(this.txtUser);
+ this.groupBox1.Controls.Add(this.label3);
+ this.groupBox1.Controls.Add(this.txtDB);
+ this.groupBox1.Controls.Add(this.label2);
+ this.groupBox1.Controls.Add(this.txtHost);
+ this.groupBox1.Controls.Add(this.label1);
+ this.groupBox1.Location = new System.Drawing.Point(18, 138);
+ this.groupBox1.Name = "groupBox1";
+ this.groupBox1.Size = new System.Drawing.Size(770, 174);
+ this.groupBox1.TabIndex = 3;
+ this.groupBox1.TabStop = false;
+ this.groupBox1.Text = "DB";
+ //
+ // label6
+ //
+ this.label6.AutoSize = true;
+ this.label6.Location = new System.Drawing.Point(21, 95);
+ this.label6.Name = "label6";
+ this.label6.Size = new System.Drawing.Size(153, 15);
+ this.label6.TabIndex = 16;
+ this.label6.Text = "指定シート、テーブルを書き込む";
+ //
+ // lblStatus
+ //
+ this.lblStatus.BackColor = System.Drawing.Color.Red;
+ this.lblStatus.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.lblStatus.Font = new System.Drawing.Font("メイリオ", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.lblStatus.ForeColor = System.Drawing.Color.White;
+ this.lblStatus.Location = new System.Drawing.Point(639, 95);
+ this.lblStatus.Name = "lblStatus";
+ this.lblStatus.Size = new System.Drawing.Size(125, 62);
+ this.lblStatus.TabIndex = 15;
+ this.lblStatus.Text = "1";
+ this.lblStatus.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // txtTableConditon
+ //
+ this.txtTableConditon.Location = new System.Drawing.Point(547, 95);
+ this.txtTableConditon.Name = "txtTableConditon";
+ this.txtTableConditon.Size = new System.Drawing.Size(86, 23);
+ this.txtTableConditon.TabIndex = 14;
+ this.txtTableConditon.Text = "M_";
+ //
+ // button3
+ //
+ this.button3.Location = new System.Drawing.Point(408, 125);
+ this.button3.Name = "button3";
+ this.button3.Size = new System.Drawing.Size(133, 32);
+ this.button3.TabIndex = 13;
+ this.button3.Text = "WriteTable";
+ this.button3.UseVisualStyleBackColor = true;
+ this.button3.Click += new System.EventHandler(this.button3_Click);
+ //
+ // button2
+ //
+ this.button2.Location = new System.Drawing.Point(408, 89);
+ this.button2.Name = "button2";
+ this.button2.Size = new System.Drawing.Size(133, 32);
+ this.button2.TabIndex = 12;
+ this.button2.Text = "WriteTo目次";
+ this.button2.UseVisualStyleBackColor = true;
+ this.button2.Click += new System.EventHandler(this.button2_Click);
+ //
+ // button1
+ //
+ this.button1.Location = new System.Drawing.Point(180, 86);
+ this.button1.Name = "button1";
+ this.button1.Size = new System.Drawing.Size(133, 32);
+ this.button1.TabIndex = 11;
+ this.button1.Text = "WriteToSheet ";
+ this.button1.UseVisualStyleBackColor = true;
+ this.button1.Click += new System.EventHandler(this.button1_Click);
+ //
+ // btnOpenDB
+ //
+ this.btnOpenDB.Location = new System.Drawing.Point(408, 47);
+ this.btnOpenDB.Name = "btnOpenDB";
+ this.btnOpenDB.Size = new System.Drawing.Size(287, 31);
+ this.btnOpenDB.TabIndex = 10;
+ this.btnOpenDB.Text = "OpenDB";
+ this.btnOpenDB.UseVisualStyleBackColor = true;
+ this.btnOpenDB.Click += new System.EventHandler(this.btnOpenDB_Click);
+ //
+ // label5
+ //
+ this.label5.AutoSize = true;
+ this.label5.Location = new System.Drawing.Point(408, 22);
+ this.label5.Name = "label5";
+ this.label5.Size = new System.Drawing.Size(34, 15);
+ this.label5.TabIndex = 9;
+ this.label5.Text = "Table";
+ //
+ // cmbTable
+ //
+ this.cmbTable.FormattingEnabled = true;
+ this.cmbTable.Location = new System.Drawing.Point(449, 19);
+ this.cmbTable.Name = "cmbTable";
+ this.cmbTable.Size = new System.Drawing.Size(246, 23);
+ this.cmbTable.TabIndex = 8;
+ //
+ // txtPassword
+ //
+ this.txtPassword.Location = new System.Drawing.Point(261, 48);
+ this.txtPassword.Name = "txtPassword";
+ this.txtPassword.Size = new System.Drawing.Size(129, 23);
+ this.txtPassword.TabIndex = 7;
+ this.txtPassword.Text = "oatcti";
+ //
+ // label4
+ //
+ this.label4.AutoSize = true;
+ this.label4.Location = new System.Drawing.Point(200, 51);
+ this.label4.Name = "label4";
+ this.label4.Size = new System.Drawing.Size(57, 15);
+ this.label4.TabIndex = 6;
+ this.label4.Text = "Password";
+ //
+ // txtUser
+ //
+ this.txtUser.Location = new System.Drawing.Point(58, 48);
+ this.txtUser.Name = "txtUser";
+ this.txtUser.Size = new System.Drawing.Size(129, 23);
+ this.txtUser.TabIndex = 5;
+ this.txtUser.Text = "sa";
+ //
+ // label3
+ //
+ this.label3.AutoSize = true;
+ this.label3.Location = new System.Drawing.Point(19, 51);
+ this.label3.Name = "label3";
+ this.label3.Size = new System.Drawing.Size(30, 15);
+ this.label3.TabIndex = 4;
+ this.label3.Text = "User";
+ //
+ // txtDB
+ //
+ this.txtDB.Location = new System.Drawing.Point(261, 19);
+ this.txtDB.Name = "txtDB";
+ this.txtDB.Size = new System.Drawing.Size(129, 23);
+ this.txtDB.TabIndex = 3;
+ this.txtDB.Text = "BHotelTR";
+ //
+ // label2
+ //
+ this.label2.AutoSize = true;
+ this.label2.Location = new System.Drawing.Point(200, 22);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(22, 15);
+ this.label2.TabIndex = 2;
+ this.label2.Text = "DB";
+ //
+ // txtHost
+ //
+ this.txtHost.Location = new System.Drawing.Point(58, 19);
+ this.txtHost.Name = "txtHost";
+ this.txtHost.Size = new System.Drawing.Size(129, 23);
+ this.txtHost.TabIndex = 1;
+ this.txtHost.Text = "NAVC2-OGI2";
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(19, 22);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(32, 15);
+ this.label1.TabIndex = 0;
+ this.label1.Text = "Host";
+ //
+ // cmbSheet
+ //
+ this.cmbSheet.FormattingEnabled = true;
+ this.cmbSheet.Location = new System.Drawing.Point(21, 39);
+ this.cmbSheet.Name = "cmbSheet";
+ this.cmbSheet.Size = new System.Drawing.Size(568, 23);
+ this.cmbSheet.TabIndex = 2;
+ this.cmbSheet.SelectedIndexChanged += new System.EventHandler(this.cmbSheet_SelectedIndexChanged);
+ //
+ // txtExcelPath
+ //
+ this.txtExcelPath.Location = new System.Drawing.Point(21, 10);
+ this.txtExcelPath.Name = "txtExcelPath";
+ this.txtExcelPath.Size = new System.Drawing.Size(568, 23);
+ this.txtExcelPath.TabIndex = 1;
+ this.txtExcelPath.TextChanged += new System.EventHandler(this.txtExcelPath_TextChanged);
+ //
+ // OpenExcel
+ //
+ this.OpenExcel.Location = new System.Drawing.Point(604, 10);
+ this.OpenExcel.Name = "OpenExcel";
+ this.OpenExcel.Size = new System.Drawing.Size(184, 52);
+ this.OpenExcel.TabIndex = 0;
+ this.OpenExcel.Text = "開く";
+ this.OpenExcel.UseVisualStyleBackColor = true;
+ this.OpenExcel.Click += new System.EventHandler(this.OpenExcel_Click);
+ //
+ // panel2
+ //
+ this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.panel2.Location = new System.Drawing.Point(0, 324);
+ this.panel2.Name = "panel2";
+ this.panel2.Size = new System.Drawing.Size(800, 126);
+ this.panel2.TabIndex = 1;
+ //
+ // openFileDialog1
+ //
+ this.openFileDialog1.FileName = "openFileDialog1";
+ this.openFileDialog1.Filter = "Excel2003以降|*.xlsx|Excel2003以前|*.xls|すべてのファイル|*.*";
+ //
+ // TableToExcel
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(800, 450);
+ this.Controls.Add(this.panel2);
+ this.Controls.Add(this.panel1);
+ this.Name = "TableToExcel";
+ this.Text = "TableToExcel";
+ this.panel1.ResumeLayout(false);
+ this.panel1.PerformLayout();
+ this.groupBox1.ResumeLayout(false);
+ this.groupBox1.PerformLayout();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Panel panel1;
+ private System.Windows.Forms.Panel panel2;
+ private System.Windows.Forms.OpenFileDialog openFileDialog1;
+ private System.Windows.Forms.GroupBox groupBox1;
+ private System.Windows.Forms.Button btnOpenDB;
+ private System.Windows.Forms.Label label5;
+ private System.Windows.Forms.ComboBox cmbTable;
+ private System.Windows.Forms.TextBox txtPassword;
+ private System.Windows.Forms.Label label4;
+ private System.Windows.Forms.TextBox txtUser;
+ private System.Windows.Forms.Label label3;
+ private System.Windows.Forms.TextBox txtDB;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.TextBox txtHost;
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.ComboBox cmbSheet;
+ private System.Windows.Forms.TextBox txtExcelPath;
+ private System.Windows.Forms.Button OpenExcel;
+ private System.Windows.Forms.TextBox txtNewSheet;
+ private System.Windows.Forms.Button btnCopySheet;
+ private System.Windows.Forms.Button button1;
+ private System.Windows.Forms.Button button2;
+ private System.Windows.Forms.Button button3;
+ private System.Windows.Forms.TextBox txtTableConditon;
+ private System.Windows.Forms.Label lblStatus;
+ private System.Windows.Forms.Label label6;
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.SourceFactory/TableToExcel.cs b/HotelPms.SourceFactory/TableToExcel.cs
new file mode 100644
index 0000000..6cf3bfe
--- /dev/null
+++ b/HotelPms.SourceFactory/TableToExcel.cs
@@ -0,0 +1,246 @@
+using HotelPms.Share.Data;
+using HotelPms.Share.Util;
+using HotelPms.Share.Windows.Util;
+using NPOI.SS.UserModel;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace HotelPms.SourceFactory
+{
+ public partial class TableToExcel : Form
+ {
+ public TableToExcel()
+ {
+ InitializeComponent();
+ }
+
+ private void OpenExcel_Click(object sender, EventArgs e)
+ {
+ openFileDialog1.InitialDirectory = Application.StartupPath;
+ if (openFileDialog1.ShowDialog() != DialogResult.OK) { return; }
+ txtExcelPath.Text = openFileDialog1.FileName;
+
+ cmbSheet.Items.Clear();
+ using (NPOIExcel excel = new NPOIExcel(txtExcelPath.Text))
+ {
+ for (int i = 0; i < excel.Workbook.NumberOfSheets; i++)
+ {
+ cmbSheet.Items.Add(excel.Workbook.GetSheetAt(i).SheetName);
+ }
+ }
+
+ }
+
+ private void btnCopySheet_Click(object sender, EventArgs e)
+ {
+ using (NPOIExcel excel = new NPOIExcel(txtExcelPath.Text))
+ {
+ ISheet sheet = excel.Workbook.GetSheetAt(excel.Workbook.GetSheetIndex(cmbSheet.SelectedItem.ToString()));
+ sheet.CopyTo(excel.Workbook, txtNewSheet.Text, true, true); //2.5.2のNET5.0版にBUGがあって、keepFormulasを使えない 2.5.3でFixした
+ //sheet.CopyTo(excel.Workbook, txtNewSheet.Text, true, false);
+ excel.Save();
+
+ MessageBox.Show("OK");
+ }
+
+ }
+
+ private void btnOpenDB_Click(object sender, EventArgs e)
+ {
+ using (DataAccess dataAccess = new MsSqlNet(new DBConnectItem() { HostName = txtHost.Text, UserID = txtUser.Text, Password = txtPassword.Text, DBName = txtDB.Text }))
+ {
+ using (DataTable data = dataAccess.GetTableList())
+ {
+ cmbTable.Items.Clear();
+ foreach(DataRow row in data.Rows)
+ {
+ cmbTable.Items.Add(row["Name"]);
+ }
+
+ if (cmbTable.Items.Count > 0) { cmbTable.SelectedIndex = 0; }
+ }
+ }
+ }
+
+ private void CopyPage(NPOIExcel excel, int beginRowdx, int pageRowCount)
+ {
+ int j = beginRowdx;
+ for (int i = 0; i < pageRowCount; i++)
+ {
+ excel.Sheet.CopyRow(i, j);
+ j++;
+ }
+ }
+
+ private void SetTableToSheet(DataTable data, NPOIExcel excel, string sheetName)
+ {
+ excel.SetCurrentSheet(excel.Workbook.GetSheetIndex(sheetName));
+
+ int pageRowCount = 50;
+ int pageNo = 1;
+
+ int rowIdx = 7;
+ foreach (DataRow row in data.Rows)
+ {
+ if (rowIdx % pageRowCount == 0)
+ {
+ //ページ最後の空行
+ pageNo++;
+
+ //ページコピー
+ if ((excel.Sheet.LastRowNum + 1) < pageNo * pageRowCount)
+ {
+ CopyPage(excel, rowIdx + 1, pageRowCount);
+ }
+
+ rowIdx += 7;
+ }
+
+ excel.SetCell($"G{rowIdx - 3}", sheetName);
+ excel.SetCell($"AC{rowIdx - 2}", DateTime.Now.ToString("yyyy/MM/dd"));
+
+ excel.SetCell($"D{rowIdx}", row["Field"].ToString()); //TableName
+ int len = CConvert.ToInt(row["max_length"]);
+ string type = row["type"].ToString().ToUpper();
+ if (type == "NVARCHAR") { len /= 2; }
+ else if (type == "INT" || type == "DATETIME" || type == "SMALLDATETIME" || type == "SMALLINT" || type == "TINYINT" || type == "BIT") { len = -1; }
+ string lenText = (len == -1 ? string.Empty : $"({len})");
+
+ excel.SetCell($"S{rowIdx}", $"{row["type"].ToString().ToUpper()}{lenText}"); //型(長さ)
+ excel.SetCell($"X{rowIdx}", row["PKFlg"].ToString() == "1" ? "〇" : string.Empty); //PK
+ rowIdx++; //次の行番号
+ }
+ }
+
+ private void button1_Click(object sender, EventArgs e)
+ {
+ if(cmbSheet.SelectedIndex == -1)
+ {
+ MessageBox.Show("シートを選んでください。");
+ cmbSheet.Focus();
+ return;
+ }
+
+ if (cmbTable.SelectedIndex == -1)
+ {
+ MessageBox.Show("テーブルを選んでください。");
+ cmbSheet.Focus();
+ return;
+ }
+
+ using (MsSqlNet dataAccess = new MsSqlNet(new DBConnectItem() { HostName = txtHost.Text, UserID = txtUser.Text, Password = txtPassword.Text, DBName = txtDB.Text }))
+ {
+ using (DataTable data = dataAccess.GetFieldList(cmbTable.SelectedItem.ToString()))
+ {
+ using (NPOIExcel excel = new NPOIExcel(txtExcelPath.Text))
+ {
+ SetTableToSheet(data, excel, cmbSheet.SelectedItem.ToString());
+ excel.Save();
+ MessageBox.Show("OK");
+ }
+ }
+ }
+ }
+
+ private bool ExistsKey(string data, Dictionary<string, int> keyDict)
+ {
+ if (keyDict.Count == 0) { return true; }
+ foreach(KeyValuePair<string, int> item in keyDict)
+ {
+ if (data.StartsWith(item.Key)) { return true; }
+ }
+ return false;
+ }
+
+ private void button2_Click(object sender, EventArgs e)
+ {
+ Dictionary<string, int> keyDict = GetTableKey();
+
+ using (NPOIExcel excel = new NPOIExcel(txtExcelPath.Text))
+ {
+ excel.SetCurrentSheet(excel.Workbook.GetSheetIndex("目次"));
+ int rowIdx = 5;
+ int i = 1;
+ foreach (string item in cmbTable.Items)
+ {
+ if (!ExistsKey(item, keyDict)) { continue; }
+ excel.SetCell($"D{rowIdx}", item); //TableName
+ rowIdx++;
+ i++;
+ if (i == 52)
+ {
+ rowIdx += 5;
+ i = 1;
+ }
+ }
+
+ excel.Save();
+ MessageBox.Show("OK");
+ }
+ }
+
+ private Dictionary<string, int> GetTableKey()
+ {
+ Dictionary<string, int> keyDict = new Dictionary<string, int>();
+ if (txtTableConditon.Text.Length > 0)
+ {
+ string[] condList = txtTableConditon.Text.Split(new char[] { ',' });
+ foreach (string key in condList)
+ {
+ keyDict.Add(key, 0);
+ }
+ }
+ return keyDict;
+ }
+
+
+ private void button3_Click(object sender, EventArgs e)
+ {
+ if (cmbTable.Items.Count == 0)
+ {
+ MessageBox.Show("テーブル一覧がない。");
+ cmbSheet.Focus();
+ }
+
+ Dictionary<string, int> keyDict = GetTableKey();
+
+ using (MsSqlNet dataAccess = new MsSqlNet(new DBConnectItem() { HostName = txtHost.Text, UserID = txtUser.Text, Password = txtPassword.Text, DBName = txtDB.Text }))
+ {
+ using (NPOIExcel excel = new NPOIExcel(txtExcelPath.Text))
+ {
+ int i = 0;
+ foreach (string tableName in cmbTable.Items)
+ {
+ if (!ExistsKey(tableName, keyDict)) { continue; }
+ using (DataTable data = dataAccess.GetFieldList(tableName))
+ {
+ SetTableToSheet(data, excel, tableName);
+ }
+ i++;
+ lblStatus.Text = i.ToString();
+ lblStatus.Refresh();
+ }
+ excel.Save();
+ MessageBox.Show("OK");
+ }
+ }
+ }
+
+ private void txtExcelPath_TextChanged(object sender, EventArgs e)
+ {
+
+ }
+
+ private void cmbSheet_SelectedIndexChanged(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
diff --git a/HotelPms.SourceFactory/TableToExcel.resx b/HotelPms.SourceFactory/TableToExcel.resx
new file mode 100644
index 0000000..4a03187
--- /dev/null
+++ b/HotelPms.SourceFactory/TableToExcel.resx
@@ -0,0 +1,63 @@
+<root>
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <metadata name="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>17, 17</value>
+ </metadata>
+</root>
\ No newline at end of file
diff --git a/HotelPms.SourceFactory/Template/BeanFileMode.txt b/HotelPms.SourceFactory/Template/BeanFileMode.txt
new file mode 100644
index 0000000..bc58d70
--- /dev/null
+++ b/HotelPms.SourceFactory/Template/BeanFileMode.txt
@@ -0,0 +1,116 @@
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Text;
+using HotelPms.Share.Data;
+using HotelPms.Share.Util;
+using Google.Protobuf.WellKnownTypes;
+using customTypes;
+using System.Data.Common;
+
+namespace @12@;
+
+/// ****************************** Description *******************************
+/// ◇システム名称
+/// ホテルPMS
+/// ◇概要
+///
+/// ◇履歴
+/// 2021/05/14 コード作成ツール 自動作成
+/// ****************************** Declarations ******************************
+[Serializable()]
+@11@ partial class @0@ : RecordBase
+{
+ #region ★★★★★ Property ★★★★★
+
+ public static ConcurrentDictionary<string, int> PrimaryKey { get; } = new ConcurrentDictionary<string, int>();
+
+ #endregion
+
+ partial void OnConstruction()
+ {
+ if (PrimaryKey.Count == 0)
+ {
+@1@
+ }
+ }
+
+ #region ★★★★★ Function ★★★★★
+
+ public bool CompareTo(@0@ item)
+ {
+ if (@2@)
+ {
+ return false;
+ }
+ return true;
+ }
+
+
+ public override void CopyTo(object dest)
+ {
+ @0@ item = dest as @0@;
+@3@
+ }
+
+ public override void Clear()
+ {
+@4@
+ }
+
+ public @0@ DeepClone()
+ {
+ @0@ item = new @0@();
+@3@
+ return item;
+ }
+
+ public override bool ConvertDataRow(System.Data.DataRow row)
+ {
+@5@
+ return true;
+ }
+
+ public void ToDataRow(System.Data.DataRow row)
+ {
+@6@
+ }
+
+ public void ConvertReader(DbDataReader row)
+ {
+ int i = 0;
+@14@
+ }
+
+ public string AddSql()
+ {
+@7@
+ }
+
+ public string UpdateSql()
+ {
+@8@
+ }
+
+ public string ToText()
+ {
+ StringBuilder text = new StringBuilder();
+@9@
+ return text.ToString();
+ }
+
+ public override object GetField(string name)
+ {
+@10@
+ else { return null; }
+ }
+
+ public override bool SetField(string name, object value)
+ {
+@13@
+ else { return false; }
+ }
+
+ #endregion
+}
\ No newline at end of file
diff --git a/HotelPms.SourceFactory/Template/BeanFileMode_ProtoEx.txt b/HotelPms.SourceFactory/Template/BeanFileMode_ProtoEx.txt
new file mode 100644
index 0000000..cc70660
--- /dev/null
+++ b/HotelPms.SourceFactory/Template/BeanFileMode_ProtoEx.txt
@@ -0,0 +1,98 @@
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Text;
+using Pms.Share.Data;
+using Pms.Share.Util;
+@0@
+
+namespace @1@;
+
+/// ****************************** Description *******************************
+/// ���V�X�e������
+/// �@@2@
+/// ���T�v
+/// �@@3@
+/// ������
+/// �@@4@ �R�[�h�쐬�c�[�� �����쐬
+/// ****************************** Declarations ******************************
+[Serializable()]
+public partial class @5@ : RecordBase
+{
+ #region �����������@Property�@����������
+
+ public static ConcurrentDictionary<string, int> PrimaryKey { get; } = new ConcurrentDictionary<string, int>();
+
+ #endregion
+
+ @18@()
+ {
+ if (PrimaryKey.Count == 0)
+ {
+@17@
+ }
+ }
+
+ #region �����������@Function�@����������
+@8@
+
+ public override void CopyTo(object dest)
+ {
+ @5@ item = dest as @5@;
+@12@
+ }
+
+ public override void Clear()
+ {
+@13@
+ }
+
+ public @5@ DeepClone()
+ {
+ @5@ item = new @5@();
+@9@
+ return item;
+ }
+
+ public override bool ConvertDataRow(System.Data.DataRow row)
+ {
+@10@
+ return true;
+ }
+
+ public void ToDataRow(System.Data.DataRow row)
+ {
+@19@
+ }
+
+ public void ConvertReader(SqlDataReader row)
+ {
+@10@
+ }
+
+ public string AddSql()
+ {
+@11@
+ }
+
+ public string UpdateSql()
+ {
+@15@
+ }
+
+ public string ToText()
+ {
+ StringBuilder text = new StringBuilder();
+@14@
+ return text.ToString();
+ }
+
+ public object GetField(string name)
+ {
+@16@
+ else { return null; }
+ }
+
+ #endregion
+}
diff --git a/HotelPms.SourceFactory/Template/BeanFileMode_ProtoEx_Service.txt b/HotelPms.SourceFactory/Template/BeanFileMode_ProtoEx_Service.txt
new file mode 100644
index 0000000..0c90772
--- /dev/null
+++ b/HotelPms.SourceFactory/Template/BeanFileMode_ProtoEx_Service.txt
@@ -0,0 +1,368 @@
+using HotelPms.Data;
+using HotelPms.Data.Common.Pagination;
+using HotelPms.Data.@2@;
+using HotelPms.GrpcService.Util;
+using HotelPms.Share.Data;
+using HotelPms.Share.IO;
+using HotelPms.Share.Util;
+using Google.Protobuf;
+using Grpc.Core;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
+using System.Data;
+using System.Data.SqlClient;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Tasks;
+
+namespace HotelPms.GrpcService;
+
+/// <summary>
+/// ■攻略
+/// 1.@0@.proto(message:@0@、@0@Table;Service:@0@Core) ⇒ projectファイルのInclude
+/// 2.@0@.cs(両方)
+/// 3.@0@Table.cs(両方)
+/// 4.@0@Service.cs(サーバー側) ⇒ StartupでMapGrpcServiceの処理が必要
+/// 5.@0@Access.cs(クライアント側)
+/// </summary>
+public class @0@Service : @0@Core.@0@CoreBase
+{
+ #region ★★★★★ Declartions ★★★★★
+
+ private static string TableName = "@1@";
+ private readonly ILogger<@0@Service> _logger;
+ private IConfiguration m_Configuration;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public @0@Service(ILogger<@0@Service> logger, IConfiguration configuration)
+ {
+ _logger = logger;
+ m_Configuration = configuration;
+ }
+
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+
+ private string GetSql(DataRequest request)
+ {
+ StringBuilder sql = new StringBuilder();
+ if (request.ActionType == 0)
+ {
+ sql.Append($"SELECT * FROM {TableName} {(string.IsNullOrEmpty(request.Data) ? string.Empty : $"WHERE {request.Data}")}");
+ }
+ else if (request.ActionType == 1 || request.ActionType == 2)
+ {
+ PagingRequest pagingRequest = JsonSerializer.Deserialize<PagingRequest>(request.Data);
+ sql.Append($"EXECUTE Pagination {pagingRequest.PageNumber},{pagingRequest.PageSize},'{pagingRequest.Table}','{pagingRequest.Field}','{pagingRequest.OrderBy}','{CConvert.FromBase64(pagingRequest.Filter)}'");
+ }
+ return sql.ToString();
+ }
+
+ private DataTable GetDataTable(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+ DataTable table = null;
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 2)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ table = set.Tables[0];
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+
+ private @0@Table Get(DataRequest request)
+ {
+ //ActionType、Dataの組み合わせでデータを取得する
+
+ @0@Table table = new @0@Table() { ErrNo = 0, ErrData = string.Empty, Name = nameof(@0@Table) };
+ OperationLog.Instance.WriteLog($"データ請求:{request.ToString()}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ string sql = GetSql(request);
+ if (request.ActionType == 0)
+ {
+ using (SqlConnection dbConnect = msSqlNet.Open())
+ {
+ using (SqlCommand command = new SqlCommand(sql, dbConnect))
+ {
+ OperationLog.Instance.WriteLog($"データ読込:{sql}");
+ command.CommandTimeout = 60000 * 100;
+ using (SqlDataReader reader = command.ExecuteReader(CommandBehavior.Default))
+ {
+ //エラーまだ対応していない
+ if (reader == null)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ while (reader.Read())
+ {
+ @0@ item = new @0@();
+ item.ConvertReader(reader);
+ table.Rows.Add(item);
+ }
+ }
+ reader.Close();
+ }
+ }
+ }
+ }
+ else if (request.ActionType == 1)
+ {
+ using (DataSet set = msSqlNet.GetDataSet(sql))
+ {
+ if (set == null || set.Tables.Count == 0)
+ {
+ OperationLog.Instance.WriteLog("null");
+ table.ErrNo = msSqlNet.ErrNo;
+ table.ErrData = msSqlNet.ErrInfo;
+ }
+ else
+ {
+ if (set.Tables.Count == 2)
+ {
+ foreach (DataRow row in set.Tables[0].Rows)
+ {
+ @0@ item = new @0@();
+ item.ConvertDataRow(row);
+ table.Rows.Add(item);
+ }
+
+ table.Tag = JsonSerializer.Serialize(new PagingRespone()
+ {
+ MaxPage = CConvert.ToInt(set.Tables[1].Rows[0]["MaxPage"]),
+ TotalRow = CConvert.ToInt(set.Tables[1].Rows[0]["TotalRow"])
+ });
+ }
+ else
+ {
+ table.ErrNo = -1;
+ table.ErrData = set.Tables[0].Rows[0]["Descript"].ToString();
+ }
+ }
+ }
+ }
+ }
+ OperationLog.Instance.WriteLog("データ読込完了");
+ return table;
+ }
+
+ private DataResult Set(@0@Table table)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{table.Rows.Count}");
+
+ StringBuilder sql = new StringBuilder();
+ if (table.BeforeUpdate.Length > 0) { sql.AppendLine(table.BeforeUpdate.ToStringUtf8()); }
+
+ foreach (@0@ item in table.Rows)
+ {
+ sql.AppendLine(table.UpdateType == 2 ? item.UpdateSql() : item.AddSql());
+ }
+
+ if (table.AfterUpdate.Length > 0) { sql.AppendLine(table.AfterUpdate.ToStringUtf8()); }
+
+ string sqlCmd = sql.ToString();
+ OperationLog.Instance.WriteLog($"Sql生成:{sqlCmd}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (!msSqlNet.ExecuteNonQueryWithTran(sqlCmd))
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private DataResult AddOrUpdate(bool add, @0@ item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = add ? item.AddSql() : item.UpdateSql();
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ private async Task AddOrUpdate(bool add, IAsyncStreamReader<@0@> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ @0@ item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = AddOrUpdate(add, item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ private DataResult Delete(SqlWhere item)
+ {
+ DataResult result = new DataResult() { ErrNo = 0, ErrData = string.Empty };
+ OperationLog.Instance.WriteLog($"データ請求:{item.ToString()}");
+
+ string sql = $"DELETE FROM {TableName} WHERE {item.Data.ToStringUtf8()}";
+ OperationLog.Instance.WriteLog($"Sql生成:{sql}");
+
+ using (MsSqlNet msSqlNet = new MsSqlNet(Setting.HotelPmsDB))
+ {
+ if (msSqlNet.ExecuteNonQuery(sql) == -1)
+ {
+ result.ErrNo = msSqlNet.ErrNo;
+ result.ErrData = msSqlNet.ErrInfo;
+ }
+ }
+ OperationLog.Instance.WriteLog($"更新:{result.ToString()}");
+ return result;
+ }
+
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+
+ public async override Task OutputStream(DataRequest request, IServerStreamWriter<FileGrpcData> responseStream, ServerCallContext context)
+ {
+ try
+ {
+ using (DataTable data = GetDataTable(request))
+ {
+ byte[] bytes = Excel.Export(data);
+ FileGrpcData fileGrpcData = new FileGrpcData
+ {
+ Block = 1,
+ FileName = "Data",
+ Content = ByteString.CopyFrom(bytes)
+ };
+ await responseStream.WriteAsync(fileGrpcData);
+ }
+ }
+ catch { }
+ }
+
+ /// <summary>
+ /// 同期実行
+ /// </summary>
+ /// <param name="request"></param>
+ /// <param name="context"></param>
+ /// <returns></returns>
+ public override Task<@0@Table> GetData(DataRequest request, ServerCallContext context)
+ {
+ return Task.FromResult(Get(request));
+ }
+
+ public async override Task GetDataStream(IAsyncStreamReader<DataRequest> requestStream, IServerStreamWriter<@0@Table> responseStream, ServerCallContext context)
+ {
+ DataRequest request = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ request = message;
+ break;
+ }
+ @0@Table table = Get(request);
+ await responseStream.WriteAsync(table); //データ送信
+ }
+
+ public override Task<DataResult> SetData(@0@Table request, ServerCallContext context)
+ {
+ return Task.FromResult(Set(request));
+ }
+
+ public async override Task SetDataStream(IAsyncStreamReader<@0@Table> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ @0@Table table = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ table = message;
+ break;
+ }
+
+ DataResult result = Set(table);
+ //データ送信
+ await responseStream.WriteAsync(result);
+ }
+
+ public override Task<DataResult> Add(@0@ request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(true, request));
+ }
+
+ public async override Task AddStream(IAsyncStreamReader<@0@> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(true, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Update(@0@ request, ServerCallContext context)
+ {
+ return Task.FromResult(AddOrUpdate(false, request));
+ }
+
+ public async override Task UpdateStream(IAsyncStreamReader<@0@> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ await AddOrUpdate(false, requestStream, responseStream, context);
+ }
+
+ public override Task<DataResult> Remove(SqlWhere request, ServerCallContext context)
+ {
+ return Task.FromResult(Delete(request));
+ }
+
+ public async override Task RemoveStream(IAsyncStreamReader<SqlWhere> requestStream, IServerStreamWriter<DataResult> responseStream, ServerCallContext context)
+ {
+ SqlWhere item = null;
+ await foreach (var message in requestStream.ReadAllAsync())
+ {
+ item = message;
+ break;
+ }
+
+ DataResult result = Delete(item);
+ await responseStream.WriteAsync(result); //データ送信
+ }
+
+ #endregion
+}
diff --git a/HotelPms.SourceFactory/Template/BeanFileMode_ProtoEx_Table.txt b/HotelPms.SourceFactory/Template/BeanFileMode_ProtoEx_Table.txt
new file mode 100644
index 0000000..74c0a84
--- /dev/null
+++ b/HotelPms.SourceFactory/Template/BeanFileMode_ProtoEx_Table.txt
@@ -0,0 +1,42 @@
+using HotelPms.Share.Util;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Diagnostics;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HotelPms.Data.Master;
+
+@0@ partial class @1@Table
+{
+ /// <summary>
+ /// 自動データテーブル生成
+ /// </summary>
+ /// <returns></returns>
+ public DataTable ToDataTable()
+ {
+ DataTable dataTable = new DataTable();
+ dataTable.TableName = Name;
+ PropertyInfo[] myInfo = typeof(@1@).GetProperties(BindingFlags.Public | BindingFlags.Instance);
+ foreach (PropertyInfo item in myInfo)
+ {
+ System.Diagnostics.Debug.WriteLine(item.Name);
+
+ Attribute attribute = item.GetCustomAttribute(typeof(DebuggerNonUserCodeAttribute));
+ if (attribute == null) { continue; }
+ dataTable.Columns.Add(item.Name, item.PropertyType);
+ }
+
+ //データ
+ foreach (@1@ row in Rows)
+ {
+ DataRow dtRow = dataTable.NewRow();
+ row.ToDataRow(dtRow);
+ dataTable.Rows.Add(dtRow);
+ }
+ return dataTable;
+ }
+}
diff --git a/HotelPms.SourceFactory/Template/BeanFileMode_ts.txt b/HotelPms.SourceFactory/Template/BeanFileMode_ts.txt
new file mode 100644
index 0000000..18a8feb
--- /dev/null
+++ b/HotelPms.SourceFactory/Template/BeanFileMode_ts.txt
@@ -0,0 +1,13 @@
+/// ****************************** Description *******************************
+/// ���V�X�e������
+/// �@PMS FrameWork 1.0
+/// ���T�v
+/// �@@0@
+/// ������
+/// �@@1@ �R�[�h�쐬�c�[�� �����쐬
+/// ****************************** Declarations ******************************
+import MasterBase from './MasterBase';
+
+export default class @2@ extends MasterBase {
+@3@
+}
\ No newline at end of file
diff --git a/HotelPms.SourceFactory/Template/BeanFileMode_tsinterface.txt b/HotelPms.SourceFactory/Template/BeanFileMode_tsinterface.txt
new file mode 100644
index 0000000..5f46ffe
--- /dev/null
+++ b/HotelPms.SourceFactory/Template/BeanFileMode_tsinterface.txt
@@ -0,0 +1,13 @@
+/// ****************************** Description *******************************
+/// ���V�X�e������
+/// �@PMS FrameWork 1.0
+/// ���T�v
+/// �@@0@
+/// ������
+/// �@@1@ �R�[�h�쐬�c�[�� �����쐬
+/// ****************************** Declarations ******************************
+import IMasterBase from './IMasterBase';
+
+export default interface @2@ extends IMasterBase {
+@3@
+}
\ No newline at end of file
diff --git a/HotelPms.SourceFactory/Template/DataAccessFileMode.txt b/HotelPms.SourceFactory/Template/DataAccessFileMode.txt
new file mode 100644
index 0000000..8530781
--- /dev/null
+++ b/HotelPms.SourceFactory/Template/DataAccessFileMode.txt
@@ -0,0 +1,268 @@
+using customTypes;
+using Google.Protobuf;
+using Grpc.Core;
+using Grpc.Net.Client;
+using HotelPms.Data;
+using HotelPms.Data.Client;
+using HotelPms.Data.Common;
+using HotelPms.Data.Common.Pagination;
+using HotelPms.Data.UseInfo;
+using System.Data;
+using System.Text.Json;
+
+namespace @4@;
+
+public class @0@Access : IDisposable
+{
+ /// <summary>
+ /// チャネル
+ /// </summary>
+ public GrpcChannel Channel { get; private set; } = null;
+ public @0@Core.@0@CoreClient Client { get; private set; } = null;
+
+
+ public @0@Access(GrpcChannel channel)
+ {
+ Channel = channel;
+ Client = new @0@Core.@0@CoreClient(Channel);
+ }
+
+ public void Dispose()
+ {
+
+ }
+
+ public bool Exists(@2@)
+ {
+ return GrpcClient.ExecuteScalarSync(Channel, $"IF EXISTS(SELECT 1 FROM @1@ WHERE @3@) SELECT 1 ELSE SELECT 0") == "1";
+
+ }
+
+ public async Task<bool> ExistsAsync(@2@)
+ {
+ return await GrpcClient.ExecuteScalar(Channel, $"IF EXISTS(SELECT 1 FROM @1@ WHERE @3@) SELECT 1 ELSE SELECT 0") == "1";
+
+ }
+
+ public async Task<FileGrpcData> OutputStream(PagingRequest request)
+ {
+ FileGrpcData data = null;
+ request.Table = "@1@";
+ string json = JsonSerializer.Serialize(request);
+ using (var call = Client.OutputStream(GrpcClient.CreateDataRequest(2, json)))
+ {
+ var reaponseStream = call.ResponseStream;
+ //データの取得
+ while (await reaponseStream.MoveNext(CancellationToken.None))
+ {
+ data = reaponseStream.Current;
+ }
+ }
+ return data;
+ }
+
+ public async Task<@0@Table> GetPageData(PagingRequest request)
+ {
+ request.Table = "@1@";
+ string json = JsonSerializer.Serialize(request);
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(1, json));
+ }
+
+
+ public DataTable GetMasterGridData(string where)
+ {
+ GrpcTable table = GrpcClient.GetTable(Channel, (int)ETableActionType.BuildingMasterGrid, where);
+ return table.ToDataTable();
+ }
+
+ /// <summary>
+ /// 同期データ取得
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public @0@Table GetData(string where)
+ {
+ return Client.GetData(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ public async Task<@0@Table> GetDataAsync(string where)
+ {
+ return await Client.GetDataAsync(GrpcClient.CreateDataRequest(0, where));
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public @0@ GetItem(@2@)
+ {
+ @0@Table table = GetData($"@3@");
+ if(table == null || table.ErrNo != 0 || table.Rows.Count == 0) { return null; }
+ return table.Rows[0];
+ }
+
+ public async Task<@0@Table> GetDataStream()
+ {
+ return await GetDataStream(string.Empty);
+ }
+
+ /// <summary>
+ /// データ取得
+ /// </summary>
+ /// <returns></returns>
+ public async Task<@0@Table> GetDataStream(string where)
+ {
+ @0@Table table = null;
+ using (var call = Client.GetDataStream())
+ {
+ await call.RequestStream.WriteAsync(GrpcClient.CreateDataRequest(0, where));
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<@0@Table>())
+ {
+ table = message;
+ break;
+ }
+ }
+ return table;
+ }
+
+ public async Task<DataResult> AddAsync(@0@ data)
+ {
+ return await Client.AddAsync(data);
+ }
+
+ public DataResult Add(@0@ data)
+ {
+ return Client.Add(data);
+ }
+
+ public async Task<DataResult> UpdateAsync(@0@ data)
+ {
+ return await Client.UpdateAsync(data);
+ }
+
+ public DataResult Update(@0@ data)
+ {
+ return Client.Update(data);
+ }
+
+ /// <summary>
+ /// 追加若しくは更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <param name="add"></param>
+ /// <returns></returns>
+ private async Task<DataResult> AddOrUpdateStream(@0@ data, bool add)
+ {
+ DataResult result = null;
+ using (var call = add ? Client.AddStream() : Client.UpdateStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ /// <summary>
+ /// 追加
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> AddStream(@0@ data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ /// <summary>
+ /// 更新
+ /// </summary>
+ /// <param name="data"></param>
+ /// <returns></returns>
+ public async Task<DataResult> UpdateStream(@0@ data)
+ {
+ return await AddOrUpdateStream(data, true);
+ }
+
+ public DataResult Remove(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return Client.Remove(data);
+ }
+
+ public async Task<DataResult> RemoveAsync(string where)
+ {
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+ return await Client.RemoveAsync(data);
+ }
+
+ /// <summary>
+ /// 削除
+ /// </summary>
+ /// <param name="where"></param>
+ /// <returns></returns>
+ public async Task<DataResult> RemoveStream(string where)
+ {
+ DataResult result = null;
+ SqlWhere data = new SqlWhere()
+ {
+ Data = ByteString.CopyFromUtf8(where)
+ };
+
+ using (var call = Client.RemoveStream())
+ {
+ await call.RequestStream.WriteAsync(data);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+
+ public DataResult SetData(@0@Table table)
+ {
+ return Client.SetData(table);
+ }
+
+ /// <summary>
+ /// バッチ更新
+ /// </summary>
+ /// <param name="table"></param>
+ /// <returns></returns>
+ public async Task<DataResult> SetDataStream(@0@Table table)
+ {
+ DataResult result = null;
+ using (var call = Client.SetDataStream())
+ {
+ await call.RequestStream.WriteAsync(table);
+ await call.RequestStream.CompleteAsync(); // Finish call and report results
+
+ //データの取得
+ await foreach (var message in call.ResponseStream.ReadAllAsync<DataResult>())
+ {
+ result = message;
+ break;
+ }
+ }
+ return result;
+ }
+}
diff --git a/HotelPms.SourceFactory/Template/Detail.designer.txt b/HotelPms.SourceFactory/Template/Detail.designer.txt
new file mode 100644
index 0000000..d8bb5fa
--- /dev/null
+++ b/HotelPms.SourceFactory/Template/Detail.designer.txt
@@ -0,0 +1,84 @@
+namespace Pms.Forms.Master
+{
+ partial class @0@
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+@1@
+ this.pnlDetail.SuspendLayout();
+ this.pnlTopMain.SuspendLayout();
+ this.pnlMain.SuspendLayout();
+ this.pnlSearch.SuspendLayout();
+ this.pnlFunction.SuspendLayout();
+ this.grpSearch.SuspendLayout();
+ this.pnlMainBackBase.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // pnlDetail
+ //
+@2@
+ this.pnlDetail.Location = new System.Drawing.Point(0, 346);
+ this.pnlDetail.Size = new System.Drawing.Size(725, 172);
+ this.pnlDetail.TabIndex = 0;
+@3@
+ //
+ // pnlGrid
+ //
+ this.pnlGrid.Size = new System.Drawing.Size(725, 280);
+ //
+ // lblEditStatus
+ //
+ this.lblEditStatus.BackColor = System.Drawing.Color.Teal;
+ this.lblEditStatus.Location = new System.Drawing.Point(590, 7);
+@4@
+ //
+ // FormRoom
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(784, 561);
+ this.Name = "@0@";
+ this.Text = "@5@";
+ this.Load += new System.EventHandler(this.Form_Load);
+ this.pnlDetail.ResumeLayout(false);
+ this.pnlDetail.PerformLayout();
+ this.pnlTopMain.ResumeLayout(false);
+ this.pnlMain.ResumeLayout(false);
+ this.pnlSearch.ResumeLayout(false);
+ this.pnlFunction.ResumeLayout(false);
+ this.grpSearch.ResumeLayout(false);
+ this.grpSearch.PerformLayout();
+ this.pnlMainBackBase.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+@6@
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.SourceFactory/Template/Detail.txt b/HotelPms.SourceFactory/Template/Detail.txt
new file mode 100644
index 0000000..c723da8
--- /dev/null
+++ b/HotelPms.SourceFactory/Template/Detail.txt
@@ -0,0 +1,201 @@
+using Common.WinForm.Component;
+using Common.Util;
+using Common.WinForm.Util;
+using Pms.Forms.Util;
+using Pms.Core.Interface;
+using System;
+using System.Data;
+using System.Windows.Forms;
+
+namespace Pms.Forms.Master
+{
+ /// <summary>
+ /// ****************************** Description *******************************
+ /// ���V�X�e������
+ /// �@@2@
+ /// ���T�v
+ /// �@@3@
+ /// ������
+ /// �@@4@�@�����쐬
+ /// ****************************** Declarations ******************************
+ /// </summary>
+ public partial class @0@ : BaseMaster, IMasterCtrl
+ {
+ #region �����������@Declartions�@����������
+
+ private Pms.Core.Access.@1@ m_DataAccess = null;
+
+ #endregion
+
+ #region �����������@Property�@����������
+ #endregion
+
+ #region �����������@Class Event�@����������
+
+ public @0@()
+ {
+ InitializeComponent();
+ base.MasterCtrl = this;
+ }
+
+ private void Form_Load(object sender, EventArgs e)
+ {
+ m_DataAccess = new Pms.Core.Access.@1@();
+ MasterCtrl.ShowData();
+ if (dgvData.Rows.Count == 0)
+ {
+ SetNewMode();
+ }
+ }
+
+ #endregion
+
+ #region �����������@Control Event�@����������
+ #endregion
+
+ #region �����������@Private Function�@����������
+ #endregion
+
+ #region �����������@Public Function�@����������
+
+ public bool Save()
+ {
+ if (m_ValueChangeListener.CurUpdateMode != UpdateFormMode.Inputting && m_ValueChangeListener.CurUpdateMode != UpdateFormMode.Edit) { return true; }
+
+ bool isNew = false;
+ Pms.Data.Master.@5@ item = null;
+ UpdateFormMode orgMode = m_ValueChangeListener.CurUpdateMode;
+ if (orgMode == UpdateFormMode.Edit) { item = m_DataAccess.GetItem(msSqlNet, @11@); }
+ if (item == null)
+ {
+ item = new Pms.Data.Master.@5@();
+ isNew = true;
+ }
+@6@
+
+ int orgIndex = (dgvData.CurrentRow == null) ? 0 : dgvData.CurrentRow.Index;
+ bool result = msSqlNet.ExecuteNonQuery(isNew ? item.AddSql() : item.UpdateSql()) != -1;
+
+ MasterCtrl.ShowData(orgIndex);
+ if (orgMode == UpdateFormMode.Inputting) { SetNewMode(); }
+ m_ValueChangeListener.SetUpdateFormMode(orgMode == UpdateFormMode.Edit ? UpdateFormMode.Normal : UpdateFormMode.New);
+ return result;
+ }
+
+ public void SetDispName(TextBox sender)
+ {
+@8@
+#if false
+ if(sender.Equals(txtTypeID))
+ {
+ tbArray.MstNameCtrlDict[sender].Text = Setting.Master.GetName(MasterData.DataType.HM_RoomType, CConvert.ToInt(sender.Text).ToString());
+ }
+ else if (sender.Equals(txtOpeFlg))
+ {
+ tbArray.MstNameCtrlDict[sender].Text = Setting.Master.GetName(MasterData.DataType.BoolType, CConvert.ToInt(sender.Text).ToString());
+ }
+ else if (sender.Equals(txtSmorkType))
+ {
+ tbArray.MstNameCtrlDict[sender].Text = Setting.Master.GetName(MasterData.DataType.SmorkType, CConvert.ToInt(sender.Text).ToString());
+ }
+#endif
+ }
+
+
+ public void ShowList(CTextBox sender)
+ {
+ DataTable data = null;
+@9@
+#if false
+ if (sender.Equals(txtTypeID)) { data = Setting.Master.GetTable(MasterData.DataType.HM_RoomType); }
+ else if (sender.Equals(txtOpeFlg)) { data = Setting.Master.GetTable(MasterData.DataType.BoolType); }
+ else if (sender.Equals(txtSmorkType)) { data = Setting.Master.GetTable(MasterData.DataType.SmorkType); }
+#endif
+
+ if (data == null) { return; }
+ string ret = MstList.ExecuteTable(sender, data);
+ if (ret.Length == 0) { return; }
+ sender.Text = ret;
+ tbArray.PerformKeyDown(sender, new KeyEventArgs(Keys.Enter));
+ }
+
+ public bool IsCorrectEtc(object sender, bool isCheckAll, bool isShowErrMsg)
+ {
+ if(sender.Equals(@10@) && m_ValueChangeListener.CurUpdateMode == UpdateFormMode.Inputting)
+ {
+ if (m_DataAccess.Exists(msSqlNet, @11@))
+ {
+ MessageBox.Show(ExistsMsg, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
+ @10@.Focus();
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+
+ public void ShowData()
+ {
+ ShowData(0);
+ }
+
+ public void ShowData(int gridIndex)
+ {
+ try
+ {
+ m_DisableSelectionChanged = true;
+ DataTable orgData = m_Data;
+ string where = string.Empty;
+ if (txtSearchKey.Text.Trim().Length > 0)
+ {
+ where += string.Format(" WHERE A.Name LIKE '%{0}%' ", txtSearchKey.Text);
+ }
+
+ string sql = string.Format(@"@12@", where);
+ m_Data = msSqlNet.GetDataTable(sql);
+ dgvData.DataSource = m_Data;
+ SetGridColNameDict();
+ SetGridStyle();
+ if (dgvData.Rows.Count > 0)
+ {
+ SetCellFocus(gridIndex, 0, true);
+ ShowDetail();
+ }
+ if (orgData != null) { orgData.Dispose(); orgData = null; }
+ }
+ catch { }
+ finally
+ {
+ m_DisableSelectionChanged = false;
+ }
+ }
+
+ private void SetGridStyle()
+ {
+ DataGridViewColumn col = null;
+@13@
+ }
+
+ public void ShowDetail()
+ {
+ if (dgvData.CurrentRow == null) { return; }
+ tbArray.DisbleValidating = true;
+ int index = dgvData.CurrentRow.Index;
+@14@
+ m_ValueChangeListener.SetUpdateFormMode(UpdateFormMode.Normal);
+ tbArray.DisbleValidating = false;
+ }
+
+ public bool Delete()
+ {
+ int orgIndex = dgvData.CurrentRow.Index;
+@15@
+ ShowData(orgIndex < dgvData.RowCount ? orgIndex : dgvData.RowCount - 1);
+ if (dgvData.Rows.Count == 0) { SetNewMode(); }
+ return true;
+ }
+
+ #endregion
+ }
+}
diff --git a/HotelPms.SourceFactory/Template/Proto3Master.txt b/HotelPms.SourceFactory/Template/Proto3Master.txt
new file mode 100644
index 0000000..a1ece41
--- /dev/null
+++ b/HotelPms.SourceFactory/Template/Proto3Master.txt
@@ -0,0 +1,39 @@
+syntax = "proto3";
+
+import "datarequest.proto";
+import "dataresult.proto";
+import "sqlwhere.proto";
+import "file.proto";
+@2@
+@4@
+
+package HotelPms.Data.@3@;
+
+message @0@ {
+@1@
+}
+
+message @0@Table {
+ int32 ErrNo = 1;
+ string ErrData = 2;
+ string Name = 3;
+ int32 UpdateType = 4; //0.なし 1.Insert 2.Update
+ string Tag = 5;
+ bytes BeforeUpdate = 6;
+ bytes AfterUpdate = 7;
+ repeated @0@ Rows = 8;
+}
+
+service @0@Core {
+ rpc GetData (HotelPms.Data.DataRequest) returns (@0@Table);
+ rpc SetData (@0@Table) returns (HotelPms.Data.DataResult);
+ rpc Add (@0@) returns (HotelPms.Data.DataResult);
+ rpc Update (@0@) returns (HotelPms.Data.DataResult);
+ rpc Remove (HotelPms.Data.SqlWhere) returns (HotelPms.Data.DataResult);
+ rpc GetDataStream (stream HotelPms.Data.DataRequest) returns (stream @0@Table);
+ rpc SetDataStream (stream @0@Table) returns (stream HotelPms.Data.DataResult);
+ rpc AddStream (stream @0@) returns (stream HotelPms.Data.DataResult);
+ rpc UpdateStream (stream @0@) returns (stream HotelPms.Data.DataResult);
+ rpc RemoveStream (stream HotelPms.Data.SqlWhere) returns (stream HotelPms.Data.DataResult);
+ rpc OutputStream (HotelPms.Data.DataRequest) returns (stream HotelPms.Data.FileGrpcData);
+}
\ No newline at end of file
diff --git a/HotelPms.SourceFactory/Template/Proto3Msg.txt b/HotelPms.SourceFactory/Template/Proto3Msg.txt
new file mode 100644
index 0000000..49fbd50
--- /dev/null
+++ b/HotelPms.SourceFactory/Template/Proto3Msg.txt
@@ -0,0 +1,16 @@
+syntax = "proto3";
+
+import "datarequest.proto";
+import "dataresult.proto";
+@3@
+
+package @0@;
+
+message @1@ {
+@2@
+}
+
+service @1@Core {
+ rpc GetData (stream Pms.Data.DataRequest) returns (stream @1@);
+ rpc SetData (stream @1@) returns (stream Pms.Data.DataResult);
+}
\ No newline at end of file
diff --git a/HotelPms.SourceFactory/Template/Proto3MsgAll.txt b/HotelPms.SourceFactory/Template/Proto3MsgAll.txt
new file mode 100644
index 0000000..a8efb4e
--- /dev/null
+++ b/HotelPms.SourceFactory/Template/Proto3MsgAll.txt
@@ -0,0 +1,31 @@
+syntax = "proto3";
+
+import "datarequest.proto";
+import "dataresult.proto";
+import "sqlwhere.proto";
+@3@
+
+package @0@;
+
+message @1@ {
+@2@
+}
+
+message @1@Table {
+ int32 ErrNo = 1;
+ string ErrData = 2;
+ string Name = 3;
+ int32 UpdateType = 4; //0.なし 1.Insert 2.Update
+ string Tag = 5;
+ bytes BeforeUpdate = 6;
+ bytes AfterUpdate = 7;
+ repeated @1@ Rows = 8;
+}
+
+service @1@Core {
+ rpc GetData (stream Pms.Data.DataRequest) returns (stream @1@Table);
+ rpc SetData (stream @1@Table) returns (stream Pms.Data.DataResult);
+ rpc Add (stream @1@) returns (stream Pms.Data.DataResult);
+ rpc Update (stream @1@) returns (stream Pms.Data.DataResult);
+ rpc Remove (stream Pms.Data.SqlWhere) returns (stream Pms.Data.DataResult);
+}
\ No newline at end of file
diff --git a/HotelPms.SourceFactory/Template/ViewModel.txt b/HotelPms.SourceFactory/Template/ViewModel.txt
new file mode 100644
index 0000000..e2bfcd2
--- /dev/null
+++ b/HotelPms.SourceFactory/Template/ViewModel.txt
@@ -0,0 +1,21 @@
+using HotelPms.Share.Util;
+using Microsoft.JSInterop;
+using System.ComponentModel.DataAnnotations;
+using static HotelPms.Client.Blazor.Util.SystemEnum;
+
+namespace HotelPms.Client.Blazor.ViewModel;
+
+/// <summary>
+/// 画面表示・編集用
+/// </summary>
+public class @0@ : ValidModel
+{
+ /// <summary>
+ /// 初期化
+ /// </summary>
+ public @0@(IJSRuntime js) : base(js)
+ {
+@1@
+ }
+}
+
diff --git a/HotelPms.SourceFactory/Util/BOMStream.cs b/HotelPms.SourceFactory/Util/BOMStream.cs
new file mode 100644
index 0000000..f1a870e
--- /dev/null
+++ b/HotelPms.SourceFactory/Util/BOMStream.cs
Binary files differ
diff --git a/HotelPms.SourceFactory/Util/CommonFunc.cs b/HotelPms.SourceFactory/Util/CommonFunc.cs
new file mode 100644
index 0000000..58323cf
--- /dev/null
+++ b/HotelPms.SourceFactory/Util/CommonFunc.cs
@@ -0,0 +1,523 @@
+using HotelPms.Share.Util;
+using System;
+using System.Text;
+using System.Windows.Forms;
+
+namespace HotelPms.SourceFactory.Util
+{
+ public class CommonFunc
+ {
+ /// <summary>
+ /// cs�̌^��Proto3Type
+ /// </summary>
+ /// <param name="type">cs�̌^</param>
+ /// <returns></returns>
+ public static string ToProto3Type(string type)
+ {
+ if (type.ToLower() == "int") { return "int32"; }
+ else if (type.ToLower() == "bytestring") { return "bytes"; }
+ else if (type.ToLower() == "long") { return "int64"; }
+ else if (type.ToLower() == "datetime") { return "google.protobuf.Timestamp"; }
+ else if (type.ToLower() == "timestamp") { return "google.protobuf.Timestamp"; }
+ else if (type.ToLower() == "decimal") { return "customTypes.DecimalValue"; }
+ else if (type.ToLower() == "decimalvalue") { return "customTypes.DecimalValue"; }
+ else if (type.ToLower() == "date") { return "customTypes.Date"; }
+ else { return type.ToLower(); }
+ }
+
+ /// <summary>
+ /// �ϐ����SQL���̍쐬
+ /// </summary>
+ /// <param name="type">CS�̌^</param>
+ /// <param name="name"></param>
+ /// <returns></returns>
+ public static string ToSqlValue(string type, string name)
+ {
+ if ("bool".Equals(type))
+ {
+ return "{(" + (name + " ? 1 : 0") + ")}";
+ }
+ else if ("decimal".Equals(type) || "int".Equals(type) || "float".Equals(type))
+ {
+ return "{" + name + "}";
+ }
+ else if ("DateTime".Equals(type))
+ {
+ return "{" + "CConvert.ToSqlValue(" + name + ")" + "}";
+ }
+ else if ("Timestamp".Equals(type))
+ {
+ return "{(" + name + " == null ? \"NULL\" : " + "CConvert.ToSqlValue(" + name + ".ToDateTime())" + ")}";
+ }
+ else if ("DecimalValue".Equals(type))
+ {
+ return "{(" + name + " == null ? \"0\" : " + name + ".ToSqlValue()" + ")}";
+ }
+ else if ("Date".Equals(type))
+ {
+ return "{(" + name + " == null ? \"NULL\" : " + name + ".ToSqlValue()" + ")}";
+ }
+ else
+ {
+ return "N'{" + name + "}'";
+ }
+ }
+
+ public static string ToInputChar(string sqlType)
+ {
+ switch (sqlType)
+ {
+ case "int":
+ case "tinyint":
+ case "smallint":
+ case "decimal":
+ case "bit":
+ return "EInputChar.Num";
+ case "float":
+ return "EInputChar.Num | EInputChar.Dot";
+ case "date":
+ case "smalldatetime":
+ case "datetime":
+ return "EInputChar.Num | EInputChar.Slash, InputStyle = EInputStyle.Date";
+ default:
+ return "EInputChar.None";
+ }
+ }
+
+ /// <summary>
+ /// DB�̃^�C�v��CS�^�C�v
+ /// </summary>
+ /// <param name="sqlType"></param>
+ /// <returns></returns>
+ public static string ConvertToCsType(string sqlType)
+ {
+ switch (sqlType)
+ {
+ case "int":
+ case "tinyint":
+ case "smallint":
+ return "int";
+ case "decimal":
+ return "DecimalValue";
+ case "bit":
+ return "bool";
+ case "date":
+ return "Date";
+ case "smalldatetime":
+ case "datetime":
+ return "Timestamp";
+ case "float":
+ return "float";
+ default:
+ return "string";
+ }
+ }
+
+ /// <summary>
+ /// SQL�^�C�v�̏����l
+ /// </summary>
+ /// <param name="sqlType"></param>
+ /// <returns></returns>
+ public static string GetDefValue(string sqlType)
+ {
+ switch (sqlType)
+ {
+ case "int":
+ case "tinyint":
+ case "smallint":
+ return "0";
+ case "date":
+ return "Date.Default";
+ case "decimal":
+ case "DecimalValue":
+ case "float":
+ return "0";
+ case "bit":
+ return "false";
+ case "smalldatetime":
+ case "datetime":
+ return "CConvert.ToTimestamp(DateTime.MinValue)";
+ default:
+ return "string.Empty";
+ }
+ }
+
+ /// <summary>
+ /// ��`�쐬
+ /// </summary>
+ /// <param name="sqlType"></param>
+ /// <param name="varName"></param>
+ /// <returns></returns>
+ public static string GetDeclare(string sqlType,string varName)
+ {
+ return new string(' ', 8) + "private " + ConvertToCsType(sqlType) + " " + varName + " = " + GetDefValue(sqlType) + ";" + Environment.NewLine;
+ }
+
+ /// <summary>
+ /// DataGridView�̍��ځ�txt����
+ /// </summary>
+ /// <param name="sqlType"></param>
+ /// <param name="context"></param>
+ /// <returns></returns>
+ public static string GetToTextFunction(string sqlType, string context)
+ {
+ switch (sqlType)
+ {
+ case "int":
+ case "tinyint":
+ case "smallint":
+ return string.Format("GeneralSub.ToFormText(CConvert.ToInt({0}))", context);
+ case "bit":
+ return string.Format("CConvert.ToBool({0}) ? \"1\" : \"0\"", context);
+ case "decimal":
+ return string.Format("CConvert.ToDecimal({0})", context);
+ case "float":
+ return string.Format("CConvert.ToFloat({0})", context);
+ case "smalldatetime":
+ case "datetime":
+ case "date":
+ return string.Format("CConvert.ToDateString({0})", context);
+ default:
+ return string.Format("CConvert.ToString({0})", context);
+ }
+ }
+
+ /// <summary>
+ /// ShowDetail�p
+ /// DataGridView�̍��ځ�txt����
+ /// </summary>
+ /// <param name="sqlType"></param>
+ /// <param name="field"></param>
+ /// <param name="usingEndKey"></param>
+ /// <returns></returns>
+ public static string GetDataRowToText(string sqlType, string field, bool usingEndKey)
+ {
+ StringBuilder text = new StringBuilder();
+ text.Append(new string(' ', 12));
+
+ string context = string.Format("GetCellValue(\"{0}\")", field);
+ text.AppendFormat("txt{0}.Text = {1};", field, GetToTextFunction(sqlType, context));
+ if (usingEndKey) { text.Append(Environment.NewLine); text.AppendFormat("SetDispName(txt{0});", field); }
+ text.Append(Environment.NewLine);
+ return text.ToString();
+ }
+
+ public static string GetChangeFunction(string sqlType)
+ {
+ switch (sqlType)
+ {
+ case "int":
+ case "tinyint":
+ case "smallint":
+ return "CConvert.ToInt";
+ case "decimal":
+ return "CConvert.ToDecimal";
+ case "bit":
+ return "CConvert.ToBool";
+ case "float":
+ return "CConvert.ToFloat";
+ case "smalldatetime":
+ case "datetime":
+ case "date":
+ return "CConvert.ToDateTime";
+ default:
+ return "CConvert.ToString";
+ }
+ }
+
+ /// <summary>
+ /// ToDataRow�̒l
+ /// </summary>
+ /// <param name="type">cs�̌^</param>
+ /// <param name="fieldName"></param>
+ /// <returns></returns>
+ public static string ToDataRow(string type, string name)
+ {
+ if ("Timestamp".Equals(type))
+ {
+ return $"{name}.ToDateTime()";
+ }
+ else if ("Date".Equals(type))
+ {
+ return $"{name}.ToDateTime()";
+ }
+ else if ("DecimalValue".Equals(type))
+ {
+ return $"{name}.ToDecimal()";
+ }
+ else
+ {
+ return name;
+ }
+ }
+
+
+ /// <summary>
+ /// SetField�p
+ /// ��ʓ��͂���������ŃN���X�֍X�V����
+ /// </summary>
+ /// <param name="type">cs�̌^</param>
+ /// <param name="fieldName"></param>
+ /// <returns></returns>
+ public static string GetConvertValue(string type, string fieldName)
+ {
+ if ("bool".Equals(type))
+ {
+ return $"{fieldName} = CConvert.ToBool(value); ";
+ }
+ else if ("decimal".Equals(type) || "DecimalValue".Equals(type))
+ {
+ return $"{fieldName} = CConvert.ToDecimal(value); ";
+ }
+ else if ("int".Equals(type))
+ {
+ return $"{fieldName} = CConvert.ToInt(value); ";
+ }
+ else if ("float".Equals(type))
+ {
+ return $"{fieldName} = CConvert.ToFloat(value); ";
+ }
+ else if ("string".Equals(type))
+ {
+ return $"{fieldName} = value.ToString(); ";
+ }
+ else if ("DateTime".Equals(type))
+ {
+ return $"{fieldName} = CConvert.ToDateTime(value); ";
+ }
+ else if ("Timestamp".Equals(type))
+ {
+ return $"{fieldName} = CConvert.ToTimestamp(CConvert.ToDateTime(value)); ";
+ }
+ else if ("Date".Equals(type))
+ {
+ return $"{fieldName} = new Date(CConvert.ToDateInt(value)); ";
+ }
+ else
+ {
+ return $"{fieldName} = ({type})value; ";
+ }
+ }
+
+ /// <summary>
+ /// DataRow �� cs�̃N���X��
+ /// </summary>
+ /// <param name="type">cs�̌^</param>
+ /// <param name="fieldName"></param>
+ /// <returns></returns>
+ public static string GetConvertDataRowCode(string type, string fieldName)
+ {
+ string ret = string.Empty;
+ if ("bool".Equals(type))
+ {
+ ret += string.Format("{0} = CConvert.ToBool(row[\"{0}\"]); ", fieldName) + Environment.NewLine;
+ }
+ else if ("decimal".Equals(type) || "DecimalValue".Equals(type))
+ {
+ ret += string.Format("{0} = CConvert.ToDecimal(row[\"{0}\"]); ", fieldName) + Environment.NewLine;
+ }
+ else if ("int".Equals(type))
+ {
+ ret += string.Format("{0} = CConvert.ToInt(row[\"{0}\"],{0}); ", fieldName) + Environment.NewLine;
+ }
+ else if ("float".Equals(type))
+ {
+ ret += string.Format("{0} = CConvert.ToFloat(row[\"{0}\"],{0}); ", fieldName) + Environment.NewLine;
+ }
+ else if ("string".Equals(type))
+ {
+ ret += string.Format("{0} = row[\"{0}\"].ToString(); ", fieldName) + Environment.NewLine;
+ }
+ else if ("DateTime".Equals(type))
+ {
+ ret += string.Format("{0} = row.IsNull(\"{0}\") ? DateTime.MinValue : (System.DateTime)row[\"{0}\"]; ", fieldName) + Environment.NewLine;
+ }
+ else if ("Date".Equals(type))
+ {
+ ret += string.Format("{0} = new Date(row.IsNull(\"{0}\") ? 0 : CConvert.ToDateInt((System.DateTime)row[\"{0}\"])); ", fieldName) + Environment.NewLine;
+ }
+ else if ("Timestamp".Equals(type))
+ {
+ ret += string.Format("{0} = CConvert.ToTimestamp(row.IsNull(\"{0}\") ? DateTime.MinValue : (System.DateTime)row[\"{0}\"]); ", fieldName) + Environment.NewLine;
+ }
+ else
+ {
+ ret += string.Format("{0} = ({1})ConvertDBValue(row[\"{0}\"],{0}); ", fieldName, type) + Environment.NewLine;
+ }
+ return " " + ret;
+ }
+
+ public static string GetAddSql(DataGridView dgvData, string tableName)
+ {
+ string ret = string.Empty;
+ string fieldList = string.Empty;
+ string indexList = string.Empty;
+ int i = 0;
+ foreach (DataGridViewRow row in dgvData.Rows)
+ {
+ string type = CommonFunc.ConvertToCsType(row.Cells["Type"].Value.ToString());
+ string name = row.Cells["Field"].Value.ToString();
+
+ if (name.Equals("UpdateDate"))
+ {
+ fieldList += ",UpdateDate";
+ indexList += ",GETDATE()";
+ }
+ else
+ {
+ if (i > 0) { fieldList += ","; indexList += ","; ret += ","; }
+ fieldList += name;
+
+ if ("bool".Equals(type))
+ {
+ indexList += ("{" + i.ToString() + "}");
+ ret += (name + " ? 1 : 0 ");
+ }
+ else if ("decimal".Equals(type) || "int".Equals(type) || "float".Equals(type))
+ {
+ indexList += ("{" + i.ToString() + "}");
+ ret += (name);
+ }
+ else if ("DateTime".Equals(type))
+ {
+ indexList += ("{" + i.ToString() + "}");
+ ret += ("CConvert.ToSqlValue(" + name + ".ToDateTime())");
+ }
+ else
+ {
+ indexList += ("N'{" + i.ToString() + "}'");
+ ret += (name);
+ }
+ i++;
+ }
+ }
+
+ return "return string.Format(@\"" + string.Format("INSERT INTO {0}(", tableName) + fieldList + ") VALUES(" + indexList + ");" + "\"," + ret + ");";
+
+ }
+
+ public static string GetUpdateSql(DataGridView dgvData, string tableName)
+ {
+ string ret = string.Empty;
+ string fieldList = string.Empty;
+ int fieldCount = 0;
+ string whereList = string.Empty;
+ int whereCount = 0;
+ int i = 0;
+ foreach (DataGridViewRow row in dgvData.Rows)
+ {
+ string type = CommonFunc.ConvertToCsType(row.Cells["Type"].Value.ToString());
+ string name = row.Cells["Field"].Value.ToString();
+
+ if (name.Equals("UpdateDate"))
+ {
+ fieldList += ",UpdateDate = GETDATE()";
+ }
+ else
+ {
+ if (i > 0) { ret += ","; }
+
+ //�u����={index}�v�̎�
+ string item = name + " = ";
+
+ if ("bool".Equals(type))
+ {
+ item += ("{" + i.ToString() + "}");
+ ret += (name + " ? 1 : 0 ");
+ }
+ else if ("decimal".Equals(type) || "int".Equals(type) || "float".Equals(type))
+ {
+ item += ("{" + i.ToString() + "}");
+ ret += name;
+ }
+ else if ("DateTime".Equals(type))
+ {
+ item += ("{" + i.ToString() + "}");
+ ret += "CConvert.ToSqlValue(" + name + ".ToDateTime())";
+ }
+ else
+ {
+ item += ("N'{" + i.ToString() + "}'");
+ ret += name;
+ }
+
+
+ if (CConvert.ToInt(row.Cells["PKFlg"].Value.ToString()) == 1)
+ {
+ if (whereCount > 0) { whereList += ","; }
+ whereList += item;
+ whereCount++;
+ }
+ else
+ {
+ if (fieldCount > 0) { fieldList += ","; }
+ fieldList += item;
+ fieldCount++;
+ }
+ i++;
+ }
+ }
+
+ return "return string.Format(@\"" + string.Format("UPDATE {0} SET ", tableName) + fieldList + " WHERE " + whereList + ";" + "\"," + ret + ");";
+
+ }
+
+ public static string GetConvertReaderCode(string sqlType, string fieldName)
+ {
+ string ret = string.Empty;
+ if ("bigint".Equals(sqlType))
+ {
+ ret = $"{fieldName} = (long)(row.IsDBNull(i) ? 0 : row.GetInt64 (i)); i++;";
+ }
+ else if ("binary".Equals(sqlType))
+ {
+ //ret = $"{fieldName} = (long)(row.IsDBNull(i) ? null : row.GetBytes(i)); i++;";
+ }
+ else if ("bit".Equals(sqlType))
+ {
+ ret = $"{fieldName} = (bool)(row.IsDBNull(i) ? false : row.GetBoolean(i)); i++;";
+ }
+ else if ("date".Equals(sqlType))
+ {
+ ret = $"{fieldName} = new Date(row.IsDBNull(i) ? 0 : CConvert.ToDateInt(row.GetDateTime(i))); i++;";
+ }
+ else if ("datetime".Equals(sqlType) || "datetime2".Equals(sqlType) || "smalldatetime".Equals(sqlType) || "time".Equals(sqlType))
+ {
+ ret = $"{fieldName} = CConvert.ToTimestamp(row.IsDBNull(i) ? DateTime.MinValue : row.GetDateTime(i)); i++;";
+ }
+ else if ("datetimeoffset".Equals(sqlType))
+ {
+ //ret = $"{fieldName} = (DateTimeOffset)(row.IsDBNull(i) ? 0 : row.GetBytes(i)); i++;";
+ }
+ else if ("decimal".Equals(sqlType) || "money".Equals(sqlType) || "numeric".Equals(sqlType) || "smallmoney".Equals(sqlType))
+ {
+ ret = $"{fieldName} = (decimal)(row.IsDBNull(i) ? 0M : row.GetDecimal(i)); i++;";
+ }
+ else if ("float".Equals(sqlType))
+ {
+ ret = $"{fieldName} = (float)(row.IsDBNull(i) ? 0D : row.GetDouble(i)); i++;";
+ }
+ else if ("int".Equals(sqlType))
+ {
+ ret = $"{fieldName} = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;";
+ }
+ else if ("real".Equals(sqlType))
+ {
+ ret = $"{fieldName} = (float)(row.IsDBNull(i) ? 0F : row.GetFloat(i)); i++;";
+ }
+ else if ("smallint".Equals(sqlType))
+ {
+ ret = $"{fieldName} = (int)(row.IsDBNull(i) ? 0 : row.GetInt16(i)); i++;";
+ }
+ else if ("tinyint".Equals(sqlType))
+ {
+ ret = $"{fieldName} = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;";
+ }
+ else
+ {
+ ret = $"{fieldName} = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;";
+ }
+ return " " + ret + Environment.NewLine;
+ }
+ }
+}
diff --git a/HotelPms.SourceFactory/Util/EnumFactory.cs b/HotelPms.SourceFactory/Util/EnumFactory.cs
new file mode 100644
index 0000000..10a12fa
--- /dev/null
+++ b/HotelPms.SourceFactory/Util/EnumFactory.cs
@@ -0,0 +1,50 @@
+using HotelPms.Share.Windows.Util;
+using HotelPms.SourceFactory.Table;
+using System.Text;
+
+namespace HotelPms.SourceFactory.Util;
+
+public class EnumFactory
+{
+ public static string Create(string path, int sheetIndex)
+ {
+ StringBuilder text = new();
+ using NPOIExcel excel = new(path);
+ excel.SetCurrentSheet(sheetIndex);
+ bool start = false;
+ for (int i = 0; i < excel.Sheet.LastRowNum; i++)
+ {
+ string line = excel.GetCellString($"B{i+1}");
+ if(line.Length > 0 && line.Substring(0,1) == "■")
+ {
+ int p1 = line.IndexOf('(');
+ int p2 = line.IndexOf(')');
+ string name = line.Substring(p1 + 1, p2 - p1 - 1);
+ text.Append(Environment.NewLine);
+ text.AppendLine($"public enum {name} : int");
+ text.AppendLine("{");
+ start = true;
+ }
+ else
+ {
+ if (start)
+ {
+ string itemLine = excel.GetCellString($"C{i + 1}").Trim();
+ if (itemLine.Length == 0) { text.AppendLine("}"); start = false; }
+ else if (itemLine == "名称") { continue; }
+ else
+ {
+ text.AppendLine($"[Description(\"{excel.GetCellString($"R{i + 1}").Trim()}\")]");
+ text.AppendLine($"{itemLine} = {excel.GetCellInt($"O{i + 1}")},");
+ }
+ }
+
+ }
+
+ }
+
+ return text.ToString();
+ }
+
+}
+
diff --git a/HotelPms.SourceFactory/Util/EnvironmentSetting.cs b/HotelPms.SourceFactory/Util/EnvironmentSetting.cs
new file mode 100644
index 0000000..7fe2ecf
--- /dev/null
+++ b/HotelPms.SourceFactory/Util/EnvironmentSetting.cs
@@ -0,0 +1,105 @@
+using HotelPms.Share.Data;
+using System;
+using System.IO;
+using System.Reflection;
+using System.Text;
+
+namespace HotelPms.SourceFactory.Util
+{
+ public class EnvironmentSetting
+ {
+ private static Setting m_Default = null;
+
+ public static Setting Default
+ {
+ get
+ {
+ if (m_Default == null) {
+ m_Default = new Setting
+ {
+ DataBase = new DBConnectItem("NAVC2-OGI2", "HotelPms", "sa", "oatcti"),
+ };
+ }
+ return m_Default;
+ }
+ }
+
+ #region ★★★★★ Function ★★★★★
+
+ public static void Init()
+ {
+ string[] files = Assembly.GetExecutingAssembly().GetManifestResourceNames();
+ EnvironmentSetting.BeanFileMode = GetResourceString("HotelPms.SourceFactory.Template.BeanFileMode.txt");
+ BeanFileMode_ProtoEx = GetResourceString("HotelPms.SourceFactory.Template.BeanFileMode_ProtoEx.txt");
+ BeanFileMode_ProtoEx_Table = GetResourceString("HotelPms.SourceFactory.Template.BeanFileMode_ProtoEx_Table.txt");
+ BeanFileMode_ProtoEx_Service = GetResourceString("HotelPms.SourceFactory.Template.BeanFileMode_ProtoEx_Service.txt");
+
+ EnvironmentSetting.DataAccessFileMode = GetResourceString("HotelPms.SourceFactory.Template.DataAccessFileMode.txt");
+ //EnvironmentSetting.GridFileMode = GetResourceString("DBSuperMamager.FileMode.Grid.txt");
+ //EnvironmentSetting.GridDesignerFileMode = GetResourceString("DBSuperMamager.FileMode.Grid.designer.txt");
+ //EnvironmentSetting.GridResxFileMode = GetResourceString("DBSuperMamager.FileMode.Grid.resx.txt");
+ EnvironmentSetting.DetailFileMode = GetResourceString("HotelPms.SourceFactory.Template.Detail.txt");
+ EnvironmentSetting.DetailDesignerFileMode = GetResourceString("HotelPms.SourceFactory.Template.Detail.designer.txt");
+ //EnvironmentSetting.DetailResxFileMode = GetResourceString("DBSuperMamager.FileMode.Detail.resx.txt");
+ //EnvironmentSetting.DetailXmlFileMode = GetResourceString("DBSuperMamager.FileMode.DetailXml.txt");
+
+ TsBeanFileMode = GetResourceString("HotelPms.SourceFactory.Template.BeanFileMode_ts.txt");
+ TsInterfaceFileMode = GetResourceString("HotelPms.SourceFactory.Template.BeanFileMode_tsinterface.txt");
+
+ Proto3FileMode = GetResourceString("HotelPms.SourceFactory.Template.Proto3Msg.txt");
+ Proto3FileAllMode = GetResourceString("HotelPms.SourceFactory.Template.Proto3MsgAll.txt");
+
+ ViewModel = GetResourceString("HotelPms.SourceFactory.Template.ViewModel.txt");
+ Proto3Master = GetResourceString("HotelPms.SourceFactory.Template.Proto3Master.txt");
+ }
+
+ public static string GetResourceString(string name)
+ {
+ using (Stream st = Assembly.GetExecutingAssembly().GetManifestResourceStream(name))
+ {
+ using (StreamReader sr = new StreamReader(st, Encoding.UTF8))
+ {
+ string info = sr.ReadToEnd();
+ return info;
+ }
+ }
+ }
+
+ #endregion
+
+
+ #region ★★★★★ ファイルの雛型 ★★★★★
+
+ public static string PropertyMode = @"
+ ///<summary>{1}</summary>
+ public {0} {1} { get; set; } = {2};
+" + Environment.NewLine;
+
+ public static string DeclareMode = @" private {0} m_{1} = {2}; //{3}" + Environment.NewLine;
+
+ public static string BeanFileMode = string.Empty;
+ public static string BeanFileMode_ProtoEx = string.Empty;
+ public static string BeanFileMode_ProtoEx_Table = string.Empty;
+ public static string BeanFileMode_ProtoEx_Service = string.Empty;
+
+ public static string DataAccessFileMode = string.Empty;
+ public static string GridFileMode = string.Empty;
+ public static string GridDesignerFileMode = string.Empty;
+ public static string GridResxFileMode = string.Empty;
+ public static string DetailFileMode = string.Empty;
+ public static string DetailDesignerFileMode = string.Empty;
+ public static string DetailResxFileMode = string.Empty;
+ public static string DetailXmlFileMode = string.Empty;
+
+ public static string TsBeanFileMode = string.Empty;
+ public static string TsInterfaceFileMode = string.Empty;
+
+ public static string Proto3FileMode = string.Empty;
+ public static string Proto3FileAllMode = string.Empty;
+
+ public static string ViewModel = string.Empty;
+ public static string Proto3Master = string.Empty;
+
+ #endregion
+ }
+}
diff --git a/HotelPms.SourceFactory/Util/Setting.cs b/HotelPms.SourceFactory/Util/Setting.cs
new file mode 100644
index 0000000..f5e399c
--- /dev/null
+++ b/HotelPms.SourceFactory/Util/Setting.cs
@@ -0,0 +1,21 @@
+using HotelPms.Share.Data;
+
+namespace HotelPms.SourceFactory.Util
+{
+ public class Setting
+ {
+ /// <summary>
+ /// DB接続情報
+ /// </summary>
+ public DBConnectItem? DataBase { get; set; }
+
+ /// <summary>
+ /// DBアクセスクラス生成
+ /// </summary>
+ /// <returns></returns>
+ public MsSqlNet CreateDBAccess()
+ {
+ return new MsSqlNet(DataBase);
+ }
+ }
+}
diff --git a/HotelPms.SourceFactory/Util/TestBean.cs b/HotelPms.SourceFactory/Util/TestBean.cs
new file mode 100644
index 0000000..65c141f
--- /dev/null
+++ b/HotelPms.SourceFactory/Util/TestBean.cs
@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HotelPms.SourceFactory.Util
+{
+ public class TestBean
+ {
+ public int ID { get; set; }
+ public string Name { get; set; }
+ }
+}
diff --git a/HotelPms.SourceFactory/Util/TypeScriptFactory.cs b/HotelPms.SourceFactory/Util/TypeScriptFactory.cs
new file mode 100644
index 0000000..52b5028
--- /dev/null
+++ b/HotelPms.SourceFactory/Util/TypeScriptFactory.cs
@@ -0,0 +1,46 @@
+namespace HotelPms.SourceFactory.Util
+{
+ public class TypeScriptFactory
+ {
+ public static string ToTsType(string sqlType)
+ {
+ switch (sqlType)
+ {
+ case "int":
+ case "tinyint":
+ case "smallint":
+ case "decimal":
+ case "float":
+ return "number";
+ case "bit":
+ return "boolean";
+ case "smalldatetime":
+ case "datetime":
+ return "Date";
+ default:
+ return "string";
+ }
+ }
+
+ public static string GetDefValue(string sqlType)
+ {
+ switch (sqlType)
+ {
+ case "int":
+ case "tinyint":
+ case "smallint":
+ return "0";
+ case "decimal":
+ case "float":
+ return "0";
+ case "bit":
+ return "false";
+ case "smalldatetime":
+ case "datetime":
+ return "new Date()";
+ default:
+ return "''";
+ }
+ }
+ }
+}
diff --git a/HotelPms.SourceFactory/sample.json b/HotelPms.SourceFactory/sample.json
new file mode 100644
index 0000000..0015601
--- /dev/null
+++ b/HotelPms.SourceFactory/sample.json
@@ -0,0 +1,26 @@
+{
+ "id": "0001",
+ "type": "donut",
+ "name": "Cake",
+ "enabled": true,
+ "ppu": 0.55,
+ "birthday": "2022-06-11 21:42:55",
+ "nothing": null,
+ "batters": {
+ "batter": [
+ { "id": "1001", "type": "Regular" },
+ { "id": "1002", "type": "Chocolate" },
+ { "id": "1003", "type": "Blueberry" },
+ { "id": "1004", "type": "Devil's Food" }
+ ]
+ },
+ "topping": [
+ { "id": "5001", "type": "None" },
+ { "id": "5002", "type": "Glazed" },
+ { "id": "5005", "type": "Sugar" },
+ { "id": "5007", "type": "Powdered Sugar" },
+ { "id": "5006", "type": "Chocolate with Sprinkles" },
+ { "id": "5003", "type": "Chocolate" },
+ { "id": "5004", "type": "Maple" }
+ ]
+}
\ No newline at end of file
diff --git a/HotelPms.VerUp/Application/Core.cs b/HotelPms.VerUp/Application/Core.cs
new file mode 100644
index 0000000..2a1b8d8
--- /dev/null
+++ b/HotelPms.VerUp/Application/Core.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HotelPms.VerUp.Application
+{
+ internal class Core
+ {
+ }
+}
diff --git a/HotelPms.VerUp/DataBase/DBCore.cs b/HotelPms.VerUp/DataBase/DBCore.cs
new file mode 100644
index 0000000..d85049a
--- /dev/null
+++ b/HotelPms.VerUp/DataBase/DBCore.cs
@@ -0,0 +1,197 @@
+using HotelPms.Share.Data;
+using HotelPms.Share.IO;
+using HotelPms.Share.Util;
+using HotelPms.VerUp.Util;
+using System.Diagnostics;
+using System.Reflection;
+using System.Text;
+using System.Text.Json;
+
+namespace HotelPms.VerUp.DataBase
+{
+ public class DBCore : IDisposable
+ {
+ /// <summary>
+ /// 通知イベント
+ /// </summary>
+ public event MessageEventHandler Output;
+
+ /// <summary>
+ /// 設定ファイル
+ /// </summary>
+ public string ConfigFile { get; set; } = AppDomain.CurrentDomain.BaseDirectory + @"Sql\Config.json";
+
+ /// <summary>
+ /// DB接続情報
+ /// </summary>
+ public DBConnectItem? DBConnectItem { get; set; }
+
+ /// <summary>
+ /// エラー発生時続くかどうか
+ /// </summary>
+ public bool IgnoreError { get; set; } = false;
+
+ /// <summary>
+ /// 設定
+ /// </summary>
+ private Config? m_Config;
+ private string? rootPath = string.Empty;
+
+ public DBCore(DBConnectItem connectItem) :this(connectItem, string.Empty)
+ {
+ }
+
+ public DBCore(DBConnectItem connectItem, string config)
+ {
+ DBConnectItem = connectItem;
+ if(config.Length > 0) { ConfigFile = config; }
+ }
+
+ public void Dispose()
+ {
+
+ }
+
+ /// <summary>
+ /// 実行
+ /// </summary>
+ /// <returns></returns>
+ public bool Execute()
+ {
+ try
+ {
+ if(!ReadConfig()) { return false; }
+
+ int appVer = GetAppVersion();
+ rootPath = Path.GetDirectoryName(ConfigFile);
+
+ using (MsSqlNet access = new MsSqlNet(DBConnectItem))
+ {
+ foreach (ConfigData item in m_Config.Data)
+ {
+ RaiseEvent($"Name:{item.Name},Type:{item.Type}");
+
+ // Sql特定
+ string sql = GetSql(item);
+ if (sql.Length == 0) { if (IgnoreError) { continue; } else { return false; } }
+ if (item.Type == (int)ConfigData.DataType.ExeReaderResult)
+ {
+ string ret = CConvert.ToString(access.ExecuteScalar(sql));
+ if(ret.Length > 0) { sql = ret; } else { continue; }
+ }
+
+ // 実行
+ if (access.ExecuteNonQuery(sql) == -1)
+ {
+ RaiseEvent($"{access.ErrNo}.{access.ErrInfo}");
+ if (!IgnoreError) { return false; }
+ }
+ }
+ }
+ return true;
+ }
+ catch(Exception ex)
+ {
+ RaiseEvent(ex.Message);
+ return false;
+ }
+ }
+
+ private string GetSql(ConfigData item)
+ {
+ try
+ {
+ if (item.Type == (int)ConfigData.DataType.ExeCommand || item.Type == (int)ConfigData.DataType.ExeReaderResult)
+ {
+ return item.Name;
+ }
+ else
+ {
+ string file = Path.Combine(rootPath, item.Name);
+ if (!File.Exists(file)) { return string.Empty; }
+
+ StringBuilder sql = new StringBuilder();
+ string name = Path.GetFileNameWithoutExtension(item.Name);
+ if (item.Type == (int)ConfigData.DataType.View)
+ {
+ sql.AppendLine($"IF EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[{name}]')) DROP View [dbo].[{name}];");
+ }
+ else if (item.Type == (int)ConfigData.DataType.Fuction)
+ {
+ sql.AppendLine($"IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[{name}]') AND type in (N'FN', N'IF', N'TF', N'FS', N'FT')) DROP FUNCTION [dbo].[{name}];");
+ }
+ else if (item.Type == (int)ConfigData.DataType.Procedure)
+ {
+ sql.AppendLine($"IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[{name}]') AND type in (N'P', N'PC')) DROP PROCEDURE [dbo].[{name}];");
+ }
+ sql.Append(File.ReadAllText(file, Encoding.UTF8));
+ return sql.ToString();
+ }
+ }
+ catch(Exception ex)
+ {
+ RaiseEvent(ex.Message);
+ return string.Empty;
+ }
+ }
+
+ /// <summary>
+ /// イベント通知
+ /// </summary>
+ /// <param name="msg"></param>
+ private void RaiseEvent(string msg)
+ {
+ if(Output != null) { Output(this, new MessageEventArgs(msg)); }
+ OperationLog.Instance.WriteLog(msg);
+ }
+
+ /// <summary>
+ /// ConfigFileを読込
+ /// </summary>
+ /// <returns></returns>
+ private bool ReadConfig()
+ {
+ try
+ {
+ if (!File.Exists(ConfigFile))
+ {
+ RaiseEvent($"設定ファイルが存在しません。{Environment.NewLine}{ConfigFile}");
+ return false;
+ }
+ string json = File.ReadAllText(ConfigFile, Encoding.UTF8);
+ m_Config = JsonSerializer.Deserialize<Config>(json);
+ return true;
+ }
+ catch (Exception ex)
+ {
+ RaiseEvent(ex.Message);
+ return false;
+ }
+ }
+
+ private int GetDbVersion(MsSqlNet access)
+ {
+ try
+ {
+ return CConvert.ToInt(access.ExecuteScalar("SELECT TOP 1 Version FROM S_Config"));
+ }
+ catch
+ {
+ return 0;
+ }
+ }
+
+ /// <summary>
+ /// Exeのバージョン番号を取得する
+ /// </summary>
+ /// <returns></returns>
+ private int GetAppVersion()
+ {
+ string verInfo = string.Empty;
+ string[] ver = Assembly.GetEntryAssembly().GetName().Version.ToString().Split(new char[] { '.' });
+ verInfo = ver[0] + ver[1] + ver[2].PadLeft(3, '0') + ver[3].PadLeft(3, '0');
+ RaiseEvent(verInfo);
+ return CConvert.ToInt(verInfo);
+ }
+ }
+}
diff --git a/HotelPms.VerUp/HotelPms.VerUp.csproj b/HotelPms.VerUp/HotelPms.VerUp.csproj
new file mode 100644
index 0000000..c67289d
--- /dev/null
+++ b/HotelPms.VerUp/HotelPms.VerUp.csproj
@@ -0,0 +1,13 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <TargetFramework>net9.0</TargetFramework>
+ <ImplicitUsings>enable</ImplicitUsings>
+ <Nullable>enable</Nullable>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <ProjectReference Include="..\HotelPms.Share\HotelPms.Share.csproj" />
+ </ItemGroup>
+
+</Project>
diff --git a/HotelPms.VerUp/Util/Config.cs b/HotelPms.VerUp/Util/Config.cs
new file mode 100644
index 0000000..7c90377
--- /dev/null
+++ b/HotelPms.VerUp/Util/Config.cs
@@ -0,0 +1,8 @@
+namespace HotelPms.VerUp.Util
+{
+ internal class Config
+ {
+ public string? Desc { get; set; }
+ public List<ConfigData>? Data { get; set; }
+ }
+}
diff --git a/HotelPms.VerUp/Util/ConfigData.cs b/HotelPms.VerUp/Util/ConfigData.cs
new file mode 100644
index 0000000..df1c37e
--- /dev/null
+++ b/HotelPms.VerUp/Util/ConfigData.cs
@@ -0,0 +1,42 @@
+using System.ComponentModel;
+
+namespace HotelPms.VerUp.Util
+{
+ internal class ConfigData
+ {
+ /// <summary>
+ /// 種類
+ /// </summary>
+ public enum DataType : int
+ {
+ [Description("Sql更新、Create Table,Create Indexなど")]
+ ExeFile = 0,
+ [Description("SQL文直接発行")]
+ ExeCommand,
+ [Description("Create View文(旧Viewを自動削除)")]
+ View,
+ [Description("CreateProcedure文(旧Procedureを自動削除)")]
+ Procedure,
+ [Description("Create Fuction文(旧Fuctionを自動削除)")]
+ Fuction,
+ [Description("SqlコマンドよりSql文を生成し、実行する")]
+ ExeReaderResult,
+ }
+
+ /// <summary>
+ /// 名称
+ /// </summary>
+ public string Name { get; set; }
+
+ /// <summary>
+ /// 種類
+ /// 0.ExeFile(Sql更新、Create Table,Create Indexなど)
+ /// 1.ExeCommand(SQL文直接発行)
+ /// 2.View(Create View文(旧Viewを自動削除))
+ /// 3.Procedure(Create Procedure文(旧Proctrueを自動削除))
+ /// 4.Fuction(Create Fuction文(旧Fuctionを自動削除))
+ /// 5.ExeReaderResult(SqlコマンドよりSql文を生成し、実行する)
+ /// </summary>
+ public int Type { get; set; }
+ }
+}
diff --git a/HotelPms.WinApp/HotelPms.WinApp.csproj b/HotelPms.WinApp/HotelPms.WinApp.csproj
new file mode 100644
index 0000000..b880d00
--- /dev/null
+++ b/HotelPms.WinApp/HotelPms.WinApp.csproj
@@ -0,0 +1,22 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <OutputType>WinExe</OutputType>
+ <TargetFramework>net9.0-windows7.0</TargetFramework>
+ <Nullable>enable</Nullable>
+ <UseWindowsForms>true</UseWindowsForms>
+ <ImplicitUsings>enable</ImplicitUsings>
+ <Product>ホテルシステム</Product>
+ <AssemblyVersion>1.0.0.1</AssemblyVersion>
+ <FileVersion>1.0.0.1</FileVersion>
+ <Version>1.0.0</Version>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <ProjectReference Include="..\HotelPms.Data.Server\HotelPms.Data.Server.csproj" />
+ <ProjectReference Include="..\HotelPms.Share.Windows\HotelPms.Share.Windows.csproj" />
+ <ProjectReference Include="..\HotelPms.Share\HotelPms.Share.csproj" />
+ <ProjectReference Include="..\HotelPms.WinForm\HotelPms.WinForm.csproj" />
+ </ItemGroup>
+
+</Project>
\ No newline at end of file
diff --git a/HotelPms.WinApp/Program.cs b/HotelPms.WinApp/Program.cs
new file mode 100644
index 0000000..684d6e2
--- /dev/null
+++ b/HotelPms.WinApp/Program.cs
@@ -0,0 +1,37 @@
+using HotelPms.Share.Windows.Util;
+using HotelPms.WinForm.Common.Util;
+using System.Diagnostics;
+using PmsForm = HotelPms.WinForm.View;
+
+namespace HotelPms.WinApp
+{
+ internal static class Program
+ {
+ /// <summary>
+ /// The main entry point for the application.
+ /// </summary>
+ [STAThread]
+ static void Main()
+ {
+ UnhandledExceptionListener.Execute();
+ ApplicationConfiguration.Initialize();
+
+ //��d�N�����`�F�b�N����
+ if (Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName).Length > 1)
+ {
+ Application.Exit();
+ return;
+ }
+
+ using (System.Threading.Mutex mutex = new System.Threading.Mutex(false, Application.ProductName))
+ {
+ if (mutex.WaitOne(0, false))
+ {
+ if (EnvironmentSetting.Init()) { Application.Run(new PmsForm.Menu()); }
+ }
+ GC.KeepAlive(mutex);
+ mutex.Close();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.WinForm.Common/HotelPms.WinForm.Common.csproj b/HotelPms.WinForm.Common/HotelPms.WinForm.Common.csproj
new file mode 100644
index 0000000..ae98036
--- /dev/null
+++ b/HotelPms.WinForm.Common/HotelPms.WinForm.Common.csproj
@@ -0,0 +1,44 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <TargetFramework>net9.0-windows7.0</TargetFramework>
+ <Nullable>enable</Nullable>
+ <UseWindowsForms>true</UseWindowsForms>
+ <ImplicitUsings>enable</ImplicitUsings>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <None Remove="Resources\avatar5.png" />
+ <None Remove="Resources\find.png" />
+ <None Remove="Resources\ooopic_1462956507.png" />
+ <None Remove="Resources\ooopic_1463994291.png" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <EmbeddedResource Include="Resources\avatar5.png" />
+ <EmbeddedResource Include="Resources\find.png" />
+ <EmbeddedResource Include="Resources\ooopic_1462956507.png" />
+ <EmbeddedResource Include="Resources\ooopic_1463994291.png" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <ProjectReference Include="..\HotelPms.Share.Windows\HotelPms.Share.Windows.csproj" />
+ <ProjectReference Include="..\HotelPms.Share\HotelPms.Share.csproj" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <Compile Update="Properties\Resources.Designer.cs">
+ <DesignTime>True</DesignTime>
+ <AutoGen>True</AutoGen>
+ <DependentUpon>Resources.resx</DependentUpon>
+ </Compile>
+ </ItemGroup>
+
+ <ItemGroup>
+ <EmbeddedResource Update="Properties\Resources.resx">
+ <Generator>ResXFileCodeGenerator</Generator>
+ <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+ </EmbeddedResource>
+ </ItemGroup>
+
+</Project>
diff --git a/HotelPms.WinForm.Common/Interface/IMasterCtrl.cs b/HotelPms.WinForm.Common/Interface/IMasterCtrl.cs
new file mode 100644
index 0000000..800da73
--- /dev/null
+++ b/HotelPms.WinForm.Common/Interface/IMasterCtrl.cs
@@ -0,0 +1,16 @@
+using HotelPms.Share.Windows.Component;
+
+namespace HotelPms.WinForm.Common.Interface
+{
+ public interface IMasterCtrl
+ {
+ bool Save();
+ void SetDispName(CTextBox sender);
+ void ShowList(CTextBox sender);
+ bool IsCorrectEtc(object sender, bool isCheckAll, bool isShowErrMsg);
+ void ShowData();
+ void ShowData(int id);
+ void ShowDetail();
+ bool Delete();
+ }
+}
diff --git a/HotelPms.WinForm.Common/MasterBase.Designer.cs b/HotelPms.WinForm.Common/MasterBase.Designer.cs
new file mode 100644
index 0000000..e22b285
--- /dev/null
+++ b/HotelPms.WinForm.Common/MasterBase.Designer.cs
@@ -0,0 +1,355 @@
+namespace HotelPms.WinForm.Common
+{
+ partial class MasterBase
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
+ this.pnlBar = new HotelPms.Share.Windows.Component.PanelEx();
+ this.btnMsg = new HotelPms.Share.Windows.Component.CountButton();
+ this.btnLogin = new HotelPms.Share.Windows.Component.ButtonFlat();
+ this.btnExit = new HotelPms.Share.Windows.Component.MaterialButton();
+ this.txtSearchKey = new HotelPms.Share.Windows.Component.CTextBox();
+ this.btnEdit = new HotelPms.Share.Windows.Component.MaterialButton();
+ this.btnNew = new HotelPms.Share.Windows.Component.MaterialButton();
+ this.lblStatus = new HotelPms.Share.Windows.Component.AntLabel();
+ this.pnlInput = new HotelPms.Share.Windows.Component.PanelEx();
+ this.btnSave = new HotelPms.Share.Windows.Component.MaterialButton();
+ this.pnlList = new HotelPms.Share.Windows.Component.PanelEx();
+ this.dgvData = new System.Windows.Forms.DataGridView();
+ this.pnlMain.SuspendLayout();
+ this.pnlBar.SuspendLayout();
+ this.pnlInput.SuspendLayout();
+ this.pnlList.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.dgvData)).BeginInit();
+ this.SuspendLayout();
+ //
+ // pnlMain
+ //
+ this.pnlMain.BackColor = System.Drawing.Color.White;
+ this.pnlMain.Controls.Add(this.pnlList);
+ this.pnlMain.Controls.Add(this.pnlInput);
+ this.pnlMain.Controls.Add(this.pnlBar);
+ this.pnlMain.Size = new System.Drawing.Size(1018, 629);
+ //
+ // LoadingObj
+ //
+ this.LoadingObj.Size = new System.Drawing.Size(1018, 629);
+ //
+ // pnlBar
+ //
+ this.pnlBar.ActiveName = "";
+ this.pnlBar.ArcWidth = 16;
+ this.pnlBar.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(39)))), ((int)(((byte)(95)))), ((int)(((byte)(172)))));
+ this.pnlBar.Blur = 15;
+ this.pnlBar.Controls.Add(this.btnMsg);
+ this.pnlBar.Controls.Add(this.btnLogin);
+ this.pnlBar.Controls.Add(this.btnExit);
+ this.pnlBar.Controls.Add(this.txtSearchKey);
+ this.pnlBar.Controls.Add(this.btnEdit);
+ this.pnlBar.Controls.Add(this.btnNew);
+ this.pnlBar.Controls.Add(this.lblStatus);
+ this.pnlBar.Dock = System.Windows.Forms.DockStyle.Top;
+ this.pnlBar.Expan = true;
+ this.pnlBar.Location = new System.Drawing.Point(0, 0);
+ this.pnlBar.MaxHeight = -1;
+ this.pnlBar.Name = "pnlBar";
+ this.pnlBar.OffsetX = 0;
+ this.pnlBar.OffsetY = 0;
+ this.pnlBar.Padding = new System.Windows.Forms.Padding(0, 2, 0, 2);
+ this.pnlBar.SignFont = new System.Drawing.Font("Yu Gothic UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.pnlBar.Size = new System.Drawing.Size(1018, 48);
+ this.pnlBar.Spread = 15;
+ this.pnlBar.TabIndex = 1;
+ this.pnlBar.Title = "";
+ this.pnlBar.TitleBackColor = System.Drawing.Color.Gainsboro;
+ this.pnlBar.TitleBookMarkColor = System.Drawing.Color.Pink;
+ this.pnlBar.TitleFont = new System.Drawing.Font("Yu Gothic UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.pnlBar.TitleForeColor = System.Drawing.Color.Black;
+ this.pnlBar.TitleHeight = 0;
+ this.pnlBar.UseTitleBookMark = true;
+ //
+ // btnMsg
+ //
+ this.btnMsg.Count = 99;
+ this.btnMsg.CountBackColor = System.Drawing.Color.Red;
+ this.btnMsg.CountForeColor = System.Drawing.Color.White;
+ this.btnMsg.Dock = System.Windows.Forms.DockStyle.Right;
+ this.btnMsg.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.btnMsg.GradientColor = System.Drawing.Color.Empty;
+ this.btnMsg.Image = global::HotelPms.WinForm.Common.Properties.Resources.ooopic_1462956507;
+ this.btnMsg.Location = new System.Drawing.Point(716, 2);
+ this.btnMsg.Name = "btnMsg";
+ this.btnMsg.Size = new System.Drawing.Size(56, 44);
+ this.btnMsg.TabIndex = 4;
+ this.btnMsg.Text = "99";
+ this.btnMsg.UseVisualStyleBackColor = true;
+ //
+ // btnLogin
+ //
+ this.btnLogin.Dock = System.Windows.Forms.DockStyle.Right;
+ this.btnLogin.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.btnLogin.Font = new System.Drawing.Font("Yu Gothic UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.btnLogin.ForeColor = System.Drawing.Color.White;
+ this.btnLogin.GradientColor = System.Drawing.Color.Empty;
+ this.btnLogin.Image = global::HotelPms.WinForm.Common.Properties.Resources.avatar5;
+ this.btnLogin.Location = new System.Drawing.Point(772, 2);
+ this.btnLogin.Name = "btnLogin";
+ this.btnLogin.Size = new System.Drawing.Size(140, 44);
+ this.btnLogin.TabIndex = 6;
+ this.btnLogin.Text = "担当者 一郎";
+ this.btnLogin.UseVisualStyleBackColor = true;
+ //
+ // btnExit
+ //
+ this.btnExit.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(39)))), ((int)(((byte)(95)))), ((int)(((byte)(172)))));
+ this.btnExit.Dock = System.Windows.Forms.DockStyle.Right;
+ this.btnExit.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.btnExit.Font = new System.Drawing.Font("Yu Gothic UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.btnExit.ForeColor = System.Drawing.Color.White;
+ this.btnExit.Location = new System.Drawing.Point(912, 2);
+ this.btnExit.Name = "btnExit";
+ this.btnExit.Radius = 5F;
+ this.btnExit.Size = new System.Drawing.Size(106, 44);
+ this.btnExit.TabIndex = 5;
+ this.btnExit.Text = "終了[Esc]";
+ this.btnExit.UseVisualStyleBackColor = false;
+ this.btnExit.Click += new System.EventHandler(this.btnExit_Click);
+ //
+ // txtSearchKey
+ //
+ this.txtSearchKey.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(122)))), ((int)(((byte)(122)))), ((int)(((byte)(122)))));
+ this.txtSearchKey.BorderFocusColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(120)))), ((int)(((byte)(215)))));
+ this.txtSearchKey.BorderStyle = System.Windows.Forms.BorderStyle.None;
+ this.txtSearchKey.Font = new System.Drawing.Font("Yu Gothic UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.txtSearchKey.ForeImage = global::HotelPms.WinForm.Common.Properties.Resources.find;
+ this.txtSearchKey.InputType = "0x1";
+ this.txtSearchKey.Location = new System.Drawing.Point(459, 13);
+ this.txtSearchKey.MstNameCtrl = null;
+ this.txtSearchKey.Name = "txtSearchKey";
+ this.txtSearchKey.OrgText = "";
+ this.txtSearchKey.PanelExEnabled = true;
+ this.txtSearchKey.ShadowColor = System.Drawing.Color.FromArgb(((int)(((byte)(140)))), ((int)(((byte)(0)))), ((int)(((byte)(120)))), ((int)(((byte)(215)))));
+ this.txtSearchKey.Size = new System.Drawing.Size(231, 22);
+ this.txtSearchKey.TabIndex = 3;
+ this.txtSearchKey.TipText = "";
+ this.txtSearchKey.TitleBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
+ this.txtSearchKey.TitleFont = new System.Drawing.Font("MS UI Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.txtSearchKey.TitleForeColor = System.Drawing.Color.White;
+ this.txtSearchKey.TitleStyle = HotelPms.Share.Windows.Component.CTextBox.ETitleStyle.Icon;
+ this.txtSearchKey.TitleText = "";
+ this.txtSearchKey.TitleWidth = 50;
+ this.txtSearchKey.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtSearchKey_KeyDown);
+ //
+ // btnEdit
+ //
+ this.btnEdit.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(39)))), ((int)(((byte)(95)))), ((int)(((byte)(172)))));
+ this.btnEdit.Cursor = System.Windows.Forms.Cursors.Hand;
+ this.btnEdit.Dock = System.Windows.Forms.DockStyle.Left;
+ this.btnEdit.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.btnEdit.Font = new System.Drawing.Font("Yu Gothic UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.btnEdit.ForeColor = System.Drawing.Color.White;
+ this.btnEdit.Location = new System.Drawing.Point(232, 2);
+ this.btnEdit.Name = "btnEdit";
+ this.btnEdit.Radius = 5F;
+ this.btnEdit.Size = new System.Drawing.Size(116, 44);
+ this.btnEdit.TabIndex = 2;
+ this.btnEdit.Text = "変更[F2]";
+ this.btnEdit.UseVisualStyleBackColor = false;
+ this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click);
+ //
+ // btnNew
+ //
+ this.btnNew.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(39)))), ((int)(((byte)(95)))), ((int)(((byte)(172)))));
+ this.btnNew.Cursor = System.Windows.Forms.Cursors.Hand;
+ this.btnNew.Dock = System.Windows.Forms.DockStyle.Left;
+ this.btnNew.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.btnNew.Font = new System.Drawing.Font("Yu Gothic UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.btnNew.ForeColor = System.Drawing.Color.White;
+ this.btnNew.Location = new System.Drawing.Point(116, 2);
+ this.btnNew.Name = "btnNew";
+ this.btnNew.Radius = 5F;
+ this.btnNew.Size = new System.Drawing.Size(116, 44);
+ this.btnNew.TabIndex = 1;
+ this.btnNew.Text = "新規[F1]";
+ this.btnNew.UseVisualStyleBackColor = false;
+ this.btnNew.Click += new System.EventHandler(this.btnNew_Click);
+ //
+ // lblStatus
+ //
+ this.lblStatus.AnimationEnabled = false;
+ this.lblStatus.Dock = System.Windows.Forms.DockStyle.Left;
+ this.lblStatus.EndBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(39)))), ((int)(((byte)(95)))), ((int)(((byte)(172)))));
+ this.lblStatus.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.lblStatus.Font = new System.Drawing.Font("Yu Gothic UI", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.lblStatus.ForeColor = System.Drawing.Color.Lime;
+ this.lblStatus.GradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical;
+ this.lblStatus.Interval = 300;
+ this.lblStatus.Location = new System.Drawing.Point(0, 2);
+ this.lblStatus.Name = "lblStatus";
+ this.lblStatus.Size = new System.Drawing.Size(116, 44);
+ this.lblStatus.TabIndex = 0;
+ this.lblStatus.Text = "新規";
+ //
+ // pnlInput
+ //
+ this.pnlInput.ActiveName = "";
+ this.pnlInput.ArcWidth = 16;
+ this.pnlInput.Blur = 15;
+ this.pnlInput.Controls.Add(this.btnSave);
+ this.pnlInput.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.pnlInput.Expan = true;
+ this.pnlInput.Location = new System.Drawing.Point(0, 336);
+ this.pnlInput.MaxHeight = -1;
+ this.pnlInput.Name = "pnlInput";
+ this.pnlInput.OffsetX = 0;
+ this.pnlInput.OffsetY = 0;
+ this.pnlInput.SignFont = new System.Drawing.Font("Yu Gothic UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.pnlInput.Size = new System.Drawing.Size(1018, 293);
+ this.pnlInput.Spread = 15;
+ this.pnlInput.TabIndex = 2;
+ this.pnlInput.Title = "";
+ this.pnlInput.TitleBackColor = System.Drawing.Color.Gainsboro;
+ this.pnlInput.TitleBookMarkColor = System.Drawing.Color.Pink;
+ this.pnlInput.TitleFont = new System.Drawing.Font("Yu Gothic UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.pnlInput.TitleForeColor = System.Drawing.Color.Black;
+ this.pnlInput.TitleHeight = 0;
+ this.pnlInput.UseTitleBookMark = true;
+ //
+ // btnSave
+ //
+ this.btnSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this.btnSave.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(105)))), ((int)(((byte)(217)))));
+ this.btnSave.FlatAppearance.BorderSize = 0;
+ this.btnSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.btnSave.Font = new System.Drawing.Font("Yu Gothic UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.btnSave.ForeColor = System.Drawing.Color.White;
+ this.btnSave.Location = new System.Drawing.Point(861, 14);
+ this.btnSave.Name = "btnSave";
+ this.btnSave.Radius = 10F;
+ this.btnSave.Size = new System.Drawing.Size(144, 45);
+ this.btnSave.TabIndex = 0;
+ this.btnSave.Text = "登録[F12]";
+ this.btnSave.UseVisualStyleBackColor = false;
+ this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
+ //
+ // pnlList
+ //
+ this.pnlList.ActiveName = "";
+ this.pnlList.ArcWidth = 16;
+ this.pnlList.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(39)))), ((int)(((byte)(95)))), ((int)(((byte)(172)))));
+ this.pnlList.Blur = 15;
+ this.pnlList.Controls.Add(this.dgvData);
+ this.pnlList.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.pnlList.Expan = true;
+ this.pnlList.Location = new System.Drawing.Point(0, 48);
+ this.pnlList.MaxHeight = -1;
+ this.pnlList.Name = "pnlList";
+ this.pnlList.OffsetX = 0;
+ this.pnlList.OffsetY = 0;
+ this.pnlList.Padding = new System.Windows.Forms.Padding(0, 0, 0, 1);
+ this.pnlList.SignFont = new System.Drawing.Font("Yu Gothic UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.pnlList.Size = new System.Drawing.Size(1018, 288);
+ this.pnlList.Spread = 15;
+ this.pnlList.TabIndex = 3;
+ this.pnlList.Title = "";
+ this.pnlList.TitleBackColor = System.Drawing.Color.Gainsboro;
+ this.pnlList.TitleBookMarkColor = System.Drawing.Color.Pink;
+ this.pnlList.TitleFont = new System.Drawing.Font("Yu Gothic UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.pnlList.TitleForeColor = System.Drawing.Color.Black;
+ this.pnlList.TitleHeight = 0;
+ this.pnlList.UseTitleBookMark = true;
+ //
+ // dgvData
+ //
+ this.dgvData.AllowUserToAddRows = false;
+ this.dgvData.AllowUserToDeleteRows = false;
+ this.dgvData.BackgroundColor = System.Drawing.Color.White;
+ this.dgvData.BorderStyle = System.Windows.Forms.BorderStyle.None;
+ this.dgvData.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
+ dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
+ dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control;
+ dataGridViewCellStyle2.Font = new System.Drawing.Font("Yu Gothic UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText;
+ dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.ButtonFace;
+ dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
+ dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
+ this.dgvData.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
+ this.dgvData.ColumnHeadersHeight = 30;
+ this.dgvData.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.dgvData.EnableHeadersVisualStyles = false;
+ this.dgvData.Location = new System.Drawing.Point(0, 0);
+ this.dgvData.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
+ this.dgvData.MultiSelect = false;
+ this.dgvData.Name = "dgvData";
+ this.dgvData.RowHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None;
+ this.dgvData.RowHeadersVisible = false;
+ this.dgvData.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
+ this.dgvData.Size = new System.Drawing.Size(1018, 287);
+ this.dgvData.TabIndex = 0;
+ this.dgvData.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvData_CellClick);
+ this.dgvData.SelectionChanged += new System.EventHandler(this.dgvData_SelectionChanged);
+ //
+ // MasterBase
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(1020, 666);
+ this.Name = "MasterBase";
+ this.ShowHelpIcon = true;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+ this.Text = "マスタ設定";
+ this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MasterBase_FormClosing);
+ this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.MasterBase_FormClosed);
+ this.Load += new System.EventHandler(this.MasterBase_Load);
+ this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.MasterBase_KeyDown);
+ this.pnlMain.ResumeLayout(false);
+ this.pnlBar.ResumeLayout(false);
+ this.pnlBar.PerformLayout();
+ this.pnlInput.ResumeLayout(false);
+ this.pnlList.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.dgvData)).EndInit();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ public Share.Windows.Component.PanelEx pnlBar;
+ public Share.Windows.Component.MaterialButton btnEdit;
+ public Share.Windows.Component.MaterialButton btnNew;
+ public Share.Windows.Component.AntLabel lblStatus;
+ public Share.Windows.Component.PanelEx pnlList;
+ public Share.Windows.Component.PanelEx pnlInput;
+ public Share.Windows.Component.MaterialButton btnSave;
+ public Share.Windows.Component.CTextBox txtSearchKey;
+ public DataGridView dgvData;
+ public Share.Windows.Component.CountButton btnMsg;
+ public Share.Windows.Component.ButtonFlat btnLogin;
+ public Share.Windows.Component.MaterialButton btnExit;
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.WinForm.Common/MasterBase.cs b/HotelPms.WinForm.Common/MasterBase.cs
new file mode 100644
index 0000000..81a0982
--- /dev/null
+++ b/HotelPms.WinForm.Common/MasterBase.cs
@@ -0,0 +1,394 @@
+using HotelPms.Share.Windows.Component;
+using HotelPms.Share.Windows.Tool;
+using HotelPms.Share.Windows.Util;
+using HotelPms.WinForm.Common.Interface;
+using System.Data;
+
+namespace HotelPms.WinForm.Common
+{
+ public partial class MasterBase : FormBase
+ {
+ #region ★★★★★ Declartions ★★★★★
+
+ protected DataTable? m_Data;
+ protected bool m_DisableSelectionChanged = false;
+ protected CTextBoxArray? tbArray;
+ protected ValueChangeListener? m_ValueChangeListener = null;
+ protected static string DelMsg = "選択されたデータを削除しますか?";
+ protected static string ExistsMsg = "該当データが既に存在します。";
+ protected static string NotExistsMsg = "指定したコードがマスタに存在しません。";
+ protected static string LockMsg = $"現在の情報は他の端末か他の機能で更新済です。{Environment.NewLine}最新情報を取得しますか?";
+ protected Dictionary<string, string> m_GridColNameDict = new Dictionary<string, string>();
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+
+ public IMasterCtrl? MasterCtrl { get; set; }
+
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public MasterBase() => InitializeComponent();
+
+ private void MasterBase_Load(object sender, EventArgs e)
+ {
+ if (DesignMode) { return; }
+ System.Diagnostics.Debug.WriteLine("MasterBase_Load");
+ InitGrid();
+
+ tbArray = new CTextBoxArray(true, this);
+ tbArray.ValueChanged += CTextBoxArray_ValueChanged;
+ tbArray.IsCorrectEtc += CTextBoxArray_IsCorrectEtc;
+ tbArray.KeyEnd += CTextBoxArray_KeyEnd;
+ tbArray.TextChanged += CTextBoxArray_TextChanged;
+ tbArray.BeforeAutoNextFocus += CTextBoxArray_BeforeAutoNextFocus;
+
+ m_ValueChangeListener = new ValueChangeListener(lblStatus);
+ m_ValueChangeListener.SetUpdateFormMode(UpdateFormMode.Normal);
+ }
+
+ private void MasterBase_FormClosing(object sender, FormClosingEventArgs e)
+ {
+ if (DesignMode) { return; }
+ //編集中の時に警告メッセージを出す
+ if (m_ValueChangeListener.CurUpdateMode == UpdateFormMode.Inputting || m_ValueChangeListener.CurUpdateMode == UpdateFormMode.Edit)
+ {
+ switch (ExitDialog.ExecuteDialog())
+ {
+ case DialogResult.Cancel:
+ e.Cancel = true;
+ return;
+ case DialogResult.OK:
+ tbArray.DisbleValidating = true;
+ if (!MasterCtrl.Save())
+ {
+ e.Cancel = true;
+ return;
+ }
+ tbArray.DisbleValidating = false;
+ break;
+ case DialogResult.Abort:
+ break;
+ }
+ }
+ }
+
+ private void MasterBase_KeyDown(object sender, KeyEventArgs e)
+ {
+ switch (e.KeyCode)
+ {
+ case Keys.Escape:
+ ActiveControl = btnExit;
+ btnExit_Click(btnExit, e);
+ e.Handled = true;
+ break;
+ case Keys.F1:
+ ActiveControl = btnNew;
+ btnNew_Click(btnExit, e);
+ e.Handled = true;
+ break;
+ case Keys.F2:
+ ActiveControl = btnEdit;
+ btnEdit_Click(btnExit, e);
+ e.Handled = true;
+ break;
+ case Keys.F12:
+ ActiveControl = btnSave;
+ btnSave_Click(btnExit, e);
+ e.Handled = true;
+ break;
+ }
+ }
+
+ private void MasterBase_FormClosed(object sender, FormClosedEventArgs e)
+ {
+ if (DesignMode) { return; }
+ if (m_Data != null) { m_Data.Dispose(); m_Data = null; }
+ if (m_ValueChangeListener != null) { m_ValueChangeListener.Dispose(); m_ValueChangeListener = null; }
+ System.Diagnostics.Debug.WriteLine("MasterBase_FormClosed");
+ }
+
+ #endregion
+
+ #region ★★★★★ Control Event ★★★★★
+
+ private void txtSearchKey_KeyDown(object sender, KeyEventArgs e)
+ {
+ if (e.KeyCode == Keys.Return)
+ {
+ MasterCtrl.ShowData();
+ }
+ }
+
+ private void btnSave_Click(object sender, EventArgs e)
+ {
+ MasterCtrl.Save();
+ }
+
+ private void btnExit_Click(object sender, EventArgs e)
+ {
+ Close();
+ }
+
+ private void btnNew_Click(object sender, EventArgs e)
+ {
+ if (m_ValueChangeListener.CurUpdateMode == UpdateFormMode.Inputting || m_ValueChangeListener.CurUpdateMode == UpdateFormMode.New) { return; }
+
+ //編集中の時に警告メッセージを出す
+ if (m_ValueChangeListener.CurUpdateMode == UpdateFormMode.Edit)
+ {
+ switch (ExitDialog.ExecuteDialog())
+ {
+ case DialogResult.Cancel:
+ return;
+ case DialogResult.OK:
+ tbArray.DisbleValidating = true;
+ if (!MasterCtrl.Save()) { return; }
+ tbArray.DisbleValidating = false;
+ break;
+ case DialogResult.Abort:
+ break;
+ }
+ }
+
+ SetNewMode();
+ }
+
+ private void btnEdit_Click(object sender, EventArgs e)
+ {
+ if (m_ValueChangeListener.CurUpdateMode == UpdateFormMode.Normal || m_ValueChangeListener.CurUpdateMode == UpdateFormMode.Edit) { return; }
+ if (dgvData.Rows.Count == 0) { return; }
+
+ //編集中の時に警告メッセージを出す
+ if (m_ValueChangeListener.CurUpdateMode == UpdateFormMode.Inputting)
+ {
+ switch (ExitDialog.ExecuteDialog())
+ {
+ case DialogResult.Cancel:
+ return;
+ case DialogResult.OK:
+ tbArray.DisbleValidating = true;
+ if (!MasterCtrl.Save()) { return; }
+ tbArray.DisbleValidating = false;
+ break;
+ case DialogResult.Abort:
+ break;
+ }
+ }
+
+ //閲覧へ
+ MasterCtrl.ShowDetail();
+ }
+
+ private void dgvData_SelectionChanged(object sender, EventArgs e)
+ {
+ if (m_DisableSelectionChanged) { return; }
+ if (m_ValueChangeListener.CurUpdateMode == UpdateFormMode.New || m_ValueChangeListener.CurUpdateMode == UpdateFormMode.Inputting) { return; }
+
+ if (m_ValueChangeListener.CurUpdateMode == UpdateFormMode.Edit)
+ {
+ tbArray.DisbleValidating = true;
+ MasterCtrl.Save();
+ tbArray.DisbleValidating = false;
+ }
+ MasterCtrl.ShowDetail();
+ }
+
+ private void dgvData_CellClick(object sender, DataGridViewCellEventArgs e)
+ {
+ if (e.RowIndex < 0 || e.ColumnIndex < 0) { return; }
+ if (e.ColumnIndex == dgvData.Columns["colDel"].Index) { MasterCtrl.Delete(); }
+ }
+
+
+ protected virtual void CTextBoxArray_BeforeAutoNextFocus(object sender, int index, KeyEventArgs e)
+ {
+ switch (e.KeyCode)
+ {
+ case Keys.Return:
+ if (tbArray.Items[index].Equals(tbArray.Items[tbArray.Items.Count - 1])) { btnSave.Focus(); }
+ break;
+ }
+ }
+
+ protected virtual void CTextBoxArray_TextChanged(object sender, int index, EventArgs e)
+ {
+ tbArray.DisbleTextChanged = true;
+ //名称をクリア
+ if (tbArray.Items[index].MstNameCtrl != null) { tbArray.Items[index].MstNameCtrl.Text = string.Empty; }
+ tbArray.DisbleTextChanged = false;
+ }
+
+ protected virtual void CTextBoxArray_KeyEnd(object sender, int index, KeyEventArgs e)
+ {
+ MasterCtrl.ShowList(tbArray.Items[index]);
+ }
+
+ protected virtual bool CTextBoxArray_IsCorrectEtc(object sender, int index, CTextBoxArrayBaseEventArgs e)
+ {
+ if (m_ValueChangeListener.CurUpdateMode != UpdateFormMode.Inputting && m_ValueChangeListener.CurUpdateMode != UpdateFormMode.Edit) { return true; }
+
+ try
+ {
+ CTextBox obj = tbArray.Items[index];
+ if (!MasterCtrl.IsCorrectEtc(obj, e.CheckAll, e.ShowErrMsg)) { return false; }
+
+ //コード存在チェック
+ if (obj.Text.Length > 0 && obj.MstNameCtrl != null)
+ {
+ if (!IsCDExists(obj))
+ {
+ if (e.ShowErrMsg)
+ {
+ ShowIDErrMsg(obj);
+ return false;
+ }
+ else
+ {
+ obj.Text = obj.OrgText;
+ IsCDExists(obj);
+ return true;
+ }
+ }
+ }
+ return true;
+ }
+ catch (Exception ex)
+ {
+ if (e.ShowErrMsg) { MessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); }
+ return false;
+ }
+ }
+
+ protected virtual void CTextBoxArray_ValueChanged(object sender, int index, CTextBoxArrayBaseEventArgs e)
+ {
+ //編集状態
+ switch (m_ValueChangeListener.ChangeToEditingMode())
+ {
+ case ChangeEditingModeResult.Error:
+ e.Cancel = true;
+ return;
+ case ChangeEditingModeResult.ReLoad:
+ e.Cancel = true;
+ e.ResetOrgValue = false;
+ return;
+ }
+ }
+
+
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+
+ private void InitGrid()
+ {
+ GeneralSub.SetDoubleBuffered(dgvData);
+ GeneralSub.InitDataGridView(dgvData, true);
+ //dgvData.RowsDefaultCellStyle.BackColor = Color.FromArgb(60, 63, 65);
+ //dgvData.RowsDefaultCellStyle.ForeColor = Color.White;
+
+ dgvData.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
+ //dgvData.ColumnHeadersDefaultCellStyle.BackColor = Color.FromArgb(60, 63, 65);
+ dgvData.ColumnHeadersDefaultCellStyle.BackColor = Color.FromArgb(240, 240, 240);
+ dgvData.ColumnHeadersDefaultCellStyle.ForeColor = Color.Black;
+ dgvData.ColumnHeadersDefaultCellStyle.SelectionBackColor = dgvData.ColumnHeadersDefaultCellStyle.BackColor;
+
+ dgvData.DefaultCellStyle.SelectionBackColor = Color.LemonChiffon;
+ dgvData.DefaultCellStyle.SelectionForeColor = Color.Black;
+
+ //DataGridViewButtonColumn col = new DataGridViewButtonColumn();
+ DataGridViewLinkColumn col = new DataGridViewLinkColumn();
+ col.Name = "colDel";
+ col.Text = "削除";
+ col.HeaderText = string.Empty;
+ //col.UseColumnTextForButtonValue = true;
+ col.UseColumnTextForLinkValue = true;
+ col.Width = 50;
+ col.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
+
+
+ dgvData.Columns.Add(col);
+ }
+
+ protected void SetGridColNameDict()
+ {
+ m_GridColNameDict.Clear();
+ foreach (DataGridViewColumn col in dgvData.Columns)
+ {
+ if (string.IsNullOrEmpty(col.DataPropertyName)) { continue; }
+ m_GridColNameDict.Add(col.DataPropertyName, col.Name);
+ }
+ }
+
+ protected object GetCellValue(string dataField)
+ {
+ return GetCellValue(dataField, dgvData.CurrentRow);
+ }
+
+ protected object GetCellValue(string dataField, DataGridViewRow row)
+ {
+ return row.Cells[m_GridColNameDict[dataField]].Value;
+ }
+
+ protected virtual void SetNewMode()
+ {
+ tbArray.DisbleValidating = true;
+ foreach (TextBox item in tbArray.Items)
+ {
+ if ((item as CTextBox).IsPrimaryKey) { (item as CTextBox).Enabled = true; }
+ (item as CTextBox).Text = string.Empty;
+ }
+ this.ActiveControl = tbArray.Items[0];
+ m_ValueChangeListener.SetUpdateFormMode(UpdateFormMode.New);
+ tbArray.DisbleValidating = false;
+ }
+
+
+ /// <summary>
+ /// コードの存在チェック
+ /// </summary>
+ /// <returns></returns>
+ protected bool IsCDExists(CTextBox sender)
+ {
+ MasterCtrl.SetDispName(sender);
+ return sender.MstNameCtrl.Text.Length > 0;
+ }
+
+ /// <summary>
+ /// 指定コードが存在しない時のエラーメッセージ
+ /// </summary>
+ protected void ShowIDErrMsg(CTextBox sender)
+ {
+ MessageBox.Show(NotExistsMsg, sender.TipText, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
+ }
+
+ /// <summary>
+ /// 項目遷移(Mouse、キー以外でコードからFocus()を使う)の時に、
+ /// 前の項目のValidatingイベント発生しないようにしないといけない
+ /// </summary>
+ /// <param name="ctrl"></param>
+ protected void SetCellFocus(int row, int col, bool isFocus)
+ {
+ try
+ {
+ m_DisableSelectionChanged = true;
+ dgvData.Rows[row].Cells[col].Selected = true;
+ dgvData.CurrentCell = dgvData.Rows[row].Cells[col];
+ if (isFocus) { dgvData.Focus(); }
+ }
+ catch { }
+ finally
+ {
+ m_DisableSelectionChanged = false;
+ }
+ }
+
+
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+ #endregion
+ }
+}
diff --git a/HotelPms.WinForm.Common/MasterBase.resx b/HotelPms.WinForm.Common/MasterBase.resx
new file mode 100644
index 0000000..f298a7b
--- /dev/null
+++ b/HotelPms.WinForm.Common/MasterBase.resx
@@ -0,0 +1,60 @@
+<root>
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root>
\ No newline at end of file
diff --git a/HotelPms.WinForm.Common/Properties/Resources.Designer.cs b/HotelPms.WinForm.Common/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..8683235
--- /dev/null
+++ b/HotelPms.WinForm.Common/Properties/Resources.Designer.cs
@@ -0,0 +1,103 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+// このコードはツールによって生成されました。
+// ランタイム バージョン:4.0.30319.42000
+//
+// このファイルへの変更は、以下の状況下で不正な動作の原因になったり、
+// コードが再生成されるときに損失したりします。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace HotelPms.WinForm.Common.Properties {
+ using System;
+
+
+ /// <summary>
+ /// ローカライズされた文字列などを検索するための、厳密に型指定されたリソース クラスです。
+ /// </summary>
+ // このクラスは StronglyTypedResourceBuilder クラスが ResGen
+ // または Visual Studio のようなツールを使用して自動生成されました。
+ // メンバーを追加または削除するには、.ResX ファイルを編集して、/str オプションと共に
+ // ResGen を実行し直すか、または VS プロジェクトをビルドし直します。
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources() {
+ }
+
+ /// <summary>
+ /// このクラスで使用されているキャッシュされた ResourceManager インスタンスを返します。
+ /// </summary>
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("HotelPms.WinForm.Common.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ /// <summary>
+ /// すべてについて、現在のスレッドの CurrentUICulture プロパティをオーバーライドします
+ /// 現在のスレッドの CurrentUICulture プロパティをオーバーライドします。
+ /// </summary>
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ /// <summary>
+ /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。
+ /// </summary>
+ internal static System.Drawing.Bitmap avatar5 {
+ get {
+ object obj = ResourceManager.GetObject("avatar5", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ /// <summary>
+ /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。
+ /// </summary>
+ internal static System.Drawing.Bitmap find {
+ get {
+ object obj = ResourceManager.GetObject("find", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ /// <summary>
+ /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。
+ /// </summary>
+ internal static System.Drawing.Bitmap ooopic_1462956507 {
+ get {
+ object obj = ResourceManager.GetObject("ooopic_1462956507", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ /// <summary>
+ /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。
+ /// </summary>
+ internal static System.Drawing.Bitmap ooopic_1463994291 {
+ get {
+ object obj = ResourceManager.GetObject("ooopic_1463994291", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+ }
+}
diff --git a/HotelPms.WinForm.Common/Properties/Resources.resx b/HotelPms.WinForm.Common/Properties/Resources.resx
new file mode 100644
index 0000000..d1dd166
--- /dev/null
+++ b/HotelPms.WinForm.Common/Properties/Resources.resx
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <data name="avatar5" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <value>..\Resources\avatar5.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+ </data>
+ <data name="find" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <value>..\Resources\find.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+ </data>
+ <data name="ooopic_1462956507" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <value>..\Resources\ooopic_1462956507.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+ </data>
+ <data name="ooopic_1463994291" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <value>..\Resources\ooopic_1463994291.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+ </data>
+</root>
\ No newline at end of file
diff --git a/HotelPms.WinForm.Common/Resources/avatar5.png b/HotelPms.WinForm.Common/Resources/avatar5.png
new file mode 100644
index 0000000..c561fc1
--- /dev/null
+++ b/HotelPms.WinForm.Common/Resources/avatar5.png
Binary files differ
diff --git a/HotelPms.WinForm.Common/Resources/find.png b/HotelPms.WinForm.Common/Resources/find.png
new file mode 100644
index 0000000..36482b6
--- /dev/null
+++ b/HotelPms.WinForm.Common/Resources/find.png
Binary files differ
diff --git a/HotelPms.WinForm.Common/Resources/ooopic_1462956507.png b/HotelPms.WinForm.Common/Resources/ooopic_1462956507.png
new file mode 100644
index 0000000..31a1f99
--- /dev/null
+++ b/HotelPms.WinForm.Common/Resources/ooopic_1462956507.png
Binary files differ
diff --git a/HotelPms.WinForm.Common/Resources/ooopic_1463994291.png b/HotelPms.WinForm.Common/Resources/ooopic_1463994291.png
new file mode 100644
index 0000000..50f3f38
--- /dev/null
+++ b/HotelPms.WinForm.Common/Resources/ooopic_1463994291.png
Binary files differ
diff --git a/HotelPms.WinForm.Common/Util/Config.cs b/HotelPms.WinForm.Common/Util/Config.cs
new file mode 100644
index 0000000..feff3a7
--- /dev/null
+++ b/HotelPms.WinForm.Common/Util/Config.cs
@@ -0,0 +1,75 @@
+using HotelPms.Share.IO;
+using HotelPms.Share.Util;
+using System.Text;
+
+namespace HotelPms.WinForm.Common.Util
+{
+ public class Config : DictionarySetting
+ {
+ public enum SettingKey : int
+ {
+ HostName,
+ DBName,
+ UserID,
+ Password,
+ }
+
+ private static Config? m_Instance;
+ public static Config? Instance
+ {
+ get
+ {
+ if (m_Instance == null) { Initialize(); }
+ return m_Instance;
+ }
+ }
+
+ public string Get(SettingKey key)
+ {
+ return GetValue(key.ToString());
+ }
+
+ public void Set(SettingKey key, string value)
+ {
+ SetValue(key.ToString(), value);
+ }
+
+ /// <summary>
+ /// アプリケーションの初期化
+ /// </summary>
+ /// <returns></returns>
+ private static bool Initialize()
+ {
+ try
+ {
+ m_Instance = new Config();
+ m_Instance.FileName = Application.StartupPath + @"Config.json";
+ m_Instance.Load();
+ return true;
+ }
+ catch (Exception ex)
+ {
+ OperationLog.Instance.WriteLog($"Config.Initialize異常エラー:{ex.Message}");
+ return false;
+ }
+ }
+
+ public override void SetDefault()
+ {
+ if (!Data.ContainsKey(SettingKey.HostName.ToString())) { Data.Add(SettingKey.HostName.ToString(), "localhost"); }
+ if (!Data.ContainsKey(SettingKey.DBName.ToString())) { Data.Add(SettingKey.DBName.ToString(), "HotelPms"); }
+ if (!Data.ContainsKey(SettingKey.UserID.ToString())) { Data.Add(SettingKey.UserID.ToString(), "sa"); }
+ if (!Data.ContainsKey(SettingKey.Password.ToString())) { Data.Add(SettingKey.Password.ToString(), "oatcti"); }
+ }
+
+ public override string ToString()
+ {
+ StringBuilder text = new StringBuilder();
+ foreach (KeyValuePair<string, string> item in Data)
+ {
+ text.AppendLine($"{item.Key}={item.Value}");
+ }
+ return text.ToString();
+ }
+ }
+}
diff --git a/HotelPms.WinForm.Common/Util/EnvironmentSetting.cs b/HotelPms.WinForm.Common/Util/EnvironmentSetting.cs
new file mode 100644
index 0000000..65e9375
--- /dev/null
+++ b/HotelPms.WinForm.Common/Util/EnvironmentSetting.cs
@@ -0,0 +1,66 @@
+using HotelPms.Share.Data;
+using HotelPms.Share.IO;
+using System.Reflection;
+using System.Text;
+
+namespace HotelPms.WinForm.Common.Util
+{
+ public static class EnvironmentSetting
+ {
+ private static Setting? m_Default;
+
+ public static Setting Default
+ {
+ get
+ {
+ if (m_Default == null) {
+ //var aa = Config.Instance.Get(Config.SettingKey.HostName);
+
+ m_Default = new Setting
+ {
+ DataBase = new DBConnectItem(Config.Instance.Get(Config.SettingKey.HostName),
+ Config.Instance.Get(Config.SettingKey.DBName),
+ Config.Instance.Get(Config.SettingKey.UserID),
+ Config.Instance.Get(Config.SettingKey.Password)),
+ };
+ OperationLog.Instance.WriteLog(Config.Instance.ToString());
+ }
+ return m_Default;
+ }
+ }
+
+ #region ★★★★★ Function ★★★★★
+
+ /// <summary>
+ /// 初期化
+ /// </summary>
+ /// <returns></returns>
+ public static bool Init()
+ {
+ try
+ {
+ return true;
+ }
+ catch(Exception ex)
+ {
+ OperationLog.Instance.WriteLog($"{MethodInfo.GetCurrentMethod()}:{ex.Message}");
+ return false;
+ }
+ }
+
+ public static string GetResourceString(string name)
+ {
+ using (Stream st = Assembly.GetExecutingAssembly().GetManifestResourceStream(name))
+ {
+ using (StreamReader sr = new StreamReader(st, Encoding.UTF8))
+ {
+ string info = sr.ReadToEnd();
+ return info;
+ }
+ }
+ }
+
+ #endregion
+
+ }
+}
diff --git a/HotelPms.WinForm.Common/Util/Setting.cs b/HotelPms.WinForm.Common/Util/Setting.cs
new file mode 100644
index 0000000..4aa9d02
--- /dev/null
+++ b/HotelPms.WinForm.Common/Util/Setting.cs
@@ -0,0 +1,21 @@
+using HotelPms.Share.Data;
+
+namespace HotelPms.WinForm.Common.Util
+{
+ public class Setting
+ {
+ /// <summary>
+ /// DB接続情報
+ /// </summary>
+ public DBConnectItem? DataBase { get; set; }
+
+ /// <summary>
+ /// DBアクセスクラス生成
+ /// </summary>
+ /// <returns></returns>
+ public MsSqlNet CreateDBAccess()
+ {
+ return new MsSqlNet(DataBase);
+ }
+ }
+}
diff --git a/HotelPms.WinForm.Master/Demo.Designer.cs b/HotelPms.WinForm.Master/Demo.Designer.cs
new file mode 100644
index 0000000..3cfc241
--- /dev/null
+++ b/HotelPms.WinForm.Master/Demo.Designer.cs
@@ -0,0 +1,577 @@
+namespace HotelPms.WinForm.Master
+{
+ partial class Demo
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.txtID = new HotelPms.Share.Windows.Component.CTextBox();
+ this.lblName = new System.Windows.Forms.Label();
+ this.txtName = new HotelPms.Share.Windows.Component.CTextBox();
+ this.txtFInt = new HotelPms.Share.Windows.Component.CTextBox();
+ this.lblFInt = new System.Windows.Forms.Label();
+ this.txtFTinyInt = new HotelPms.Share.Windows.Component.CTextBox();
+ this.lblFTinyInt = new System.Windows.Forms.Label();
+ this.txtFBit = new HotelPms.Share.Windows.Component.CTextBox();
+ this.txtFBitName = new HotelPms.Share.Windows.Component.CTextBox();
+ this.lblFBit = new System.Windows.Forms.Label();
+ this.txtFFloat = new HotelPms.Share.Windows.Component.CTextBox();
+ this.lblFFloat = new System.Windows.Forms.Label();
+ this.txtFSmallInt = new HotelPms.Share.Windows.Component.CTextBox();
+ this.lblFSmallInt = new System.Windows.Forms.Label();
+ this.txtUpdateDate = new HotelPms.Share.Windows.Component.CTextBox();
+ this.lblUpdateDate = new System.Windows.Forms.Label();
+ this.txtFDate = new HotelPms.Share.Windows.Component.CTextBox();
+ this.lblFDate = new System.Windows.Forms.Label();
+ this.txtFDecimal = new HotelPms.Share.Windows.Component.CTextBox();
+ this.lblFDecimal = new System.Windows.Forms.Label();
+ this.pnlBar.SuspendLayout();
+ this.pnlInput.SuspendLayout();
+ this.pnlMain.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // pnlBar
+ //
+ this.pnlBar.Size = new System.Drawing.Size(955, 48);
+ //
+ // pnlList
+ //
+ this.pnlList.Size = new System.Drawing.Size(955, 205);
+ //
+ // pnlInput
+ //
+ this.pnlInput.Controls.Add(this.txtFBitName);
+ this.pnlInput.Controls.Add(this.txtUpdateDate);
+ this.pnlInput.Controls.Add(this.lblUpdateDate);
+ this.pnlInput.Controls.Add(this.txtFDate);
+ this.pnlInput.Controls.Add(this.lblFDate);
+ this.pnlInput.Controls.Add(this.txtFDecimal);
+ this.pnlInput.Controls.Add(this.lblFDecimal);
+ this.pnlInput.Controls.Add(this.txtFBit);
+ this.pnlInput.Controls.Add(this.lblFBit);
+ this.pnlInput.Controls.Add(this.txtFFloat);
+ this.pnlInput.Controls.Add(this.lblFFloat);
+ this.pnlInput.Controls.Add(this.txtFSmallInt);
+ this.pnlInput.Controls.Add(this.lblFSmallInt);
+ this.pnlInput.Controls.Add(this.txtFTinyInt);
+ this.pnlInput.Controls.Add(this.lblFTinyInt);
+ this.pnlInput.Controls.Add(this.txtFInt);
+ this.pnlInput.Controls.Add(this.lblFInt);
+ this.pnlInput.Controls.Add(this.txtName);
+ this.pnlInput.Controls.Add(this.lblName);
+ this.pnlInput.Controls.Add(this.txtID);
+ this.pnlInput.Location = new System.Drawing.Point(0, 253);
+ this.pnlInput.Size = new System.Drawing.Size(955, 293);
+ this.pnlInput.Controls.SetChildIndex(this.btnSave, 0);
+ this.pnlInput.Controls.SetChildIndex(this.txtID, 0);
+ this.pnlInput.Controls.SetChildIndex(this.lblName, 0);
+ this.pnlInput.Controls.SetChildIndex(this.txtName, 0);
+ this.pnlInput.Controls.SetChildIndex(this.lblFInt, 0);
+ this.pnlInput.Controls.SetChildIndex(this.txtFInt, 0);
+ this.pnlInput.Controls.SetChildIndex(this.lblFTinyInt, 0);
+ this.pnlInput.Controls.SetChildIndex(this.txtFTinyInt, 0);
+ this.pnlInput.Controls.SetChildIndex(this.lblFSmallInt, 0);
+ this.pnlInput.Controls.SetChildIndex(this.txtFSmallInt, 0);
+ this.pnlInput.Controls.SetChildIndex(this.lblFFloat, 0);
+ this.pnlInput.Controls.SetChildIndex(this.txtFFloat, 0);
+ this.pnlInput.Controls.SetChildIndex(this.lblFBit, 0);
+ this.pnlInput.Controls.SetChildIndex(this.txtFBit, 0);
+ this.pnlInput.Controls.SetChildIndex(this.lblFDecimal, 0);
+ this.pnlInput.Controls.SetChildIndex(this.txtFDecimal, 0);
+ this.pnlInput.Controls.SetChildIndex(this.lblFDate, 0);
+ this.pnlInput.Controls.SetChildIndex(this.txtFDate, 0);
+ this.pnlInput.Controls.SetChildIndex(this.lblUpdateDate, 0);
+ this.pnlInput.Controls.SetChildIndex(this.txtUpdateDate, 0);
+ this.pnlInput.Controls.SetChildIndex(this.txtFBitName, 0);
+ //
+ // btnSave
+ //
+ this.btnSave.FlatAppearance.BorderSize = 0;
+ this.btnSave.Location = new System.Drawing.Point(735, 14);
+ this.btnSave.TabIndex = 10;
+ //
+ // txtSearchKey
+ //
+ this.txtSearchKey.Location = new System.Drawing.Point(407, 12);
+ //
+ // btnMsg
+ //
+ this.btnMsg.Location = new System.Drawing.Point(653, 2);
+ //
+ // btnLogin
+ //
+ this.btnLogin.FlatAppearance.BorderSize = 0;
+ this.btnLogin.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(39)))), ((int)(((byte)(95)))), ((int)(((byte)(172)))));
+ this.btnLogin.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(39)))), ((int)(((byte)(95)))), ((int)(((byte)(172)))));
+ this.btnLogin.Location = new System.Drawing.Point(709, 2);
+ //
+ // btnExit
+ //
+ this.btnExit.Location = new System.Drawing.Point(849, 2);
+ //
+ // pnlMain
+ //
+ this.pnlMain.Size = new System.Drawing.Size(955, 546);
+ //
+ // LoadingObj
+ //
+ this.LoadingObj.Size = new System.Drawing.Size(955, 546);
+ //
+ // txtID
+ //
+ this.txtID.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(122)))), ((int)(((byte)(122)))), ((int)(((byte)(122)))));
+ this.txtID.BorderFocusColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(120)))), ((int)(((byte)(215)))));
+ this.txtID.BorderStyle = System.Windows.Forms.BorderStyle.None;
+ this.txtID.CurMMddInputStyle = HotelPms.Share.Windows.Component.MMddInputStyle.Future;
+ this.txtID.Font = new System.Drawing.Font("Yu Gothic UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.txtID.ForeImage = null;
+ this.txtID.InputType = "0x2";
+ this.txtID.IsChkData = true;
+ this.txtID.IsPrimaryKey = true;
+ this.txtID.Location = new System.Drawing.Point(72, 30);
+ this.txtID.MaxLength = 7;
+ this.txtID.MstNameCtrl = null;
+ this.txtID.Name = "txtID";
+ this.txtID.NotNull = true;
+ this.txtID.OrgText = "";
+ this.txtID.PanelExEnabled = true;
+ this.txtID.ShadowColor = System.Drawing.Color.FromArgb(((int)(((byte)(140)))), ((int)(((byte)(123)))), ((int)(((byte)(193)))), ((int)(((byte)(247)))));
+ this.txtID.Size = new System.Drawing.Size(106, 18);
+ this.txtID.TabIndex = 0;
+ this.txtID.TextBoxArrayMember = true;
+ this.txtID.TipText = "";
+ this.txtID.TitleBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(109)))), ((int)(((byte)(189)))));
+ this.txtID.TitleFont = new System.Drawing.Font("MS UI Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.txtID.TitleForeColor = System.Drawing.Color.White;
+ this.txtID.TitleStyle = HotelPms.Share.Windows.Component.CTextBox.ETitleStyle.Label;
+ this.txtID.TitleText = "ID";
+ this.txtID.TitleWidth = 50;
+ //
+ // lblName
+ //
+ this.lblName.AutoSize = true;
+ this.lblName.Location = new System.Drawing.Point(13, 87);
+ this.lblName.Name = "lblName";
+ this.lblName.Size = new System.Drawing.Size(31, 15);
+ this.lblName.TabIndex = 2;
+ this.lblName.Text = "名称";
+ //
+ // txtName
+ //
+ this.txtName.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(122)))), ((int)(((byte)(122)))), ((int)(((byte)(122)))));
+ this.txtName.BorderFocusColor = System.Drawing.Color.FromArgb(((int)(((byte)(39)))), ((int)(((byte)(95)))), ((int)(((byte)(172)))));
+ this.txtName.BorderStyle = System.Windows.Forms.BorderStyle.None;
+ this.txtName.CurMMddInputStyle = HotelPms.Share.Windows.Component.MMddInputStyle.Future;
+ this.txtName.Font = new System.Drawing.Font("Yu Gothic UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.txtName.ForeImage = null;
+ this.txtName.InputType = "0x1";
+ this.txtName.IsChkData = true;
+ this.txtName.Location = new System.Drawing.Point(17, 105);
+ this.txtName.MaxLength = 50;
+ this.txtName.MstNameCtrl = null;
+ this.txtName.Name = "txtName";
+ this.txtName.OrgText = "";
+ this.txtName.PanelExEnabled = true;
+ this.txtName.ShadowColor = System.Drawing.Color.FromArgb(((int)(((byte)(39)))), ((int)(((byte)(95)))), ((int)(((byte)(172)))));
+ this.txtName.Size = new System.Drawing.Size(201, 18);
+ this.txtName.TabIndex = 1;
+ this.txtName.TextBoxArrayMember = true;
+ this.txtName.TipText = "";
+ this.txtName.TitleBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
+ this.txtName.TitleFont = new System.Drawing.Font("MS UI Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.txtName.TitleForeColor = System.Drawing.Color.White;
+ this.txtName.TitleStyle = HotelPms.Share.Windows.Component.CTextBox.ETitleStyle.Material;
+ this.txtName.TitleText = "";
+ this.txtName.TitleWidth = 50;
+ //
+ // txtFInt
+ //
+ this.txtFInt.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(122)))), ((int)(((byte)(122)))), ((int)(((byte)(122)))));
+ this.txtFInt.BorderFocusColor = System.Drawing.Color.FromArgb(((int)(((byte)(39)))), ((int)(((byte)(95)))), ((int)(((byte)(172)))));
+ this.txtFInt.BorderStyle = System.Windows.Forms.BorderStyle.None;
+ this.txtFInt.CurMMddInputStyle = HotelPms.Share.Windows.Component.MMddInputStyle.Future;
+ this.txtFInt.Font = new System.Drawing.Font("Yu Gothic UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.txtFInt.ForeImage = null;
+ this.txtFInt.InputType = "0x2";
+ this.txtFInt.IsChkData = true;
+ this.txtFInt.Location = new System.Drawing.Point(280, 105);
+ this.txtFInt.MaxLength = 7;
+ this.txtFInt.MstNameCtrl = null;
+ this.txtFInt.Name = "txtFInt";
+ this.txtFInt.OrgText = "";
+ this.txtFInt.PanelExEnabled = true;
+ this.txtFInt.ShadowColor = System.Drawing.Color.FromArgb(((int)(((byte)(39)))), ((int)(((byte)(95)))), ((int)(((byte)(172)))));
+ this.txtFInt.Size = new System.Drawing.Size(201, 18);
+ this.txtFInt.TabIndex = 2;
+ this.txtFInt.TextBoxArrayMember = true;
+ this.txtFInt.TipText = "";
+ this.txtFInt.TitleBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
+ this.txtFInt.TitleFont = new System.Drawing.Font("MS UI Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.txtFInt.TitleForeColor = System.Drawing.Color.White;
+ this.txtFInt.TitleStyle = HotelPms.Share.Windows.Component.CTextBox.ETitleStyle.Material;
+ this.txtFInt.TitleText = "";
+ this.txtFInt.TitleWidth = 50;
+ //
+ // lblFInt
+ //
+ this.lblFInt.AutoSize = true;
+ this.lblFInt.Location = new System.Drawing.Point(276, 87);
+ this.lblFInt.Name = "lblFInt";
+ this.lblFInt.Size = new System.Drawing.Size(64, 15);
+ this.lblFInt.TabIndex = 4;
+ this.lblFInt.Text = "数字4バイト";
+ //
+ // txtFTinyInt
+ //
+ this.txtFTinyInt.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(122)))), ((int)(((byte)(122)))), ((int)(((byte)(122)))));
+ this.txtFTinyInt.BorderFocusColor = System.Drawing.Color.FromArgb(((int)(((byte)(39)))), ((int)(((byte)(95)))), ((int)(((byte)(172)))));
+ this.txtFTinyInt.BorderStyle = System.Windows.Forms.BorderStyle.None;
+ this.txtFTinyInt.CurMMddInputStyle = HotelPms.Share.Windows.Component.MMddInputStyle.Future;
+ this.txtFTinyInt.Font = new System.Drawing.Font("Yu Gothic UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.txtFTinyInt.ForeImage = null;
+ this.txtFTinyInt.In_Range = "[1,255]";
+ this.txtFTinyInt.InputType = "0x2";
+ this.txtFTinyInt.IsChkData = true;
+ this.txtFTinyInt.Location = new System.Drawing.Point(550, 105);
+ this.txtFTinyInt.MstNameCtrl = null;
+ this.txtFTinyInt.Name = "txtFTinyInt";
+ this.txtFTinyInt.OrgText = "";
+ this.txtFTinyInt.PanelExEnabled = true;
+ this.txtFTinyInt.ShadowColor = System.Drawing.Color.FromArgb(((int)(((byte)(39)))), ((int)(((byte)(95)))), ((int)(((byte)(172)))));
+ this.txtFTinyInt.Size = new System.Drawing.Size(201, 18);
+ this.txtFTinyInt.TabIndex = 3;
+ this.txtFTinyInt.TextBoxArrayMember = true;
+ this.txtFTinyInt.TipText = "";
+ this.txtFTinyInt.TitleBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
+ this.txtFTinyInt.TitleFont = new System.Drawing.Font("MS UI Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.txtFTinyInt.TitleForeColor = System.Drawing.Color.White;
+ this.txtFTinyInt.TitleStyle = HotelPms.Share.Windows.Component.CTextBox.ETitleStyle.Material;
+ this.txtFTinyInt.TitleText = "";
+ this.txtFTinyInt.TitleWidth = 50;
+ //
+ // lblFTinyInt
+ //
+ this.lblFTinyInt.AutoSize = true;
+ this.lblFTinyInt.Location = new System.Drawing.Point(546, 87);
+ this.lblFTinyInt.Name = "lblFTinyInt";
+ this.lblFTinyInt.Size = new System.Drawing.Size(64, 15);
+ this.lblFTinyInt.TabIndex = 6;
+ this.lblFTinyInt.Text = "数字1バイト";
+ //
+ // txtFBit
+ //
+ this.txtFBit.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(122)))), ((int)(((byte)(122)))), ((int)(((byte)(122)))));
+ this.txtFBit.BorderFocusColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
+ this.txtFBit.BorderStyle = System.Windows.Forms.BorderStyle.None;
+ this.txtFBit.CurMMddInputStyle = HotelPms.Share.Windows.Component.MMddInputStyle.Future;
+ this.txtFBit.Font = new System.Drawing.Font("Yu Gothic UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.txtFBit.ForeImage = null;
+ this.txtFBit.In_Range = "[0,1]";
+ this.txtFBit.InputType = "0x2";
+ this.txtFBit.IsChkData = true;
+ this.txtFBit.Location = new System.Drawing.Point(550, 171);
+ this.txtFBit.MstNameCtrl = this.txtFBitName;
+ this.txtFBit.Name = "txtFBit";
+ this.txtFBit.OrgText = "";
+ this.txtFBit.PanelExEnabled = true;
+ this.txtFBit.ShadowColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128)))));
+ this.txtFBit.ShowStyle = "0x8";
+ this.txtFBit.Size = new System.Drawing.Size(64, 18);
+ this.txtFBit.TabIndex = 6;
+ this.txtFBit.TextBoxArrayMember = true;
+ this.txtFBit.TipText = "";
+ this.txtFBit.TitleBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
+ this.txtFBit.TitleFont = new System.Drawing.Font("MS UI Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.txtFBit.TitleForeColor = System.Drawing.Color.White;
+ this.txtFBit.TitleStyle = HotelPms.Share.Windows.Component.CTextBox.ETitleStyle.Material;
+ this.txtFBit.TitleText = "";
+ this.txtFBit.TitleWidth = 50;
+ //
+ // txtFBitName
+ //
+ this.txtFBitName.BackColor = System.Drawing.Color.White;
+ this.txtFBitName.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(122)))), ((int)(((byte)(122)))), ((int)(((byte)(122)))));
+ this.txtFBitName.BorderFocusColor = System.Drawing.Color.FromArgb(((int)(((byte)(39)))), ((int)(((byte)(95)))), ((int)(((byte)(172)))));
+ this.txtFBitName.BorderStyle = System.Windows.Forms.BorderStyle.None;
+ this.txtFBitName.CurMMddInputStyle = HotelPms.Share.Windows.Component.MMddInputStyle.Future;
+ this.txtFBitName.Font = new System.Drawing.Font("Yu Gothic UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.txtFBitName.ForeImage = null;
+ this.txtFBitName.InputType = "0x1";
+ this.txtFBitName.IsChkData = true;
+ this.txtFBitName.Location = new System.Drawing.Point(611, 171);
+ this.txtFBitName.MstNameCtrl = null;
+ this.txtFBitName.Name = "txtFBitName";
+ this.txtFBitName.OrgText = "";
+ this.txtFBitName.PanelExEnabled = true;
+ this.txtFBitName.ReadOnly = true;
+ this.txtFBitName.ShadowColor = System.Drawing.Color.FromArgb(((int)(((byte)(39)))), ((int)(((byte)(95)))), ((int)(((byte)(172)))));
+ this.txtFBitName.Size = new System.Drawing.Size(117, 18);
+ this.txtFBitName.TabIndex = 20;
+ this.txtFBitName.TabStop = false;
+ this.txtFBitName.TipText = "";
+ this.txtFBitName.TitleBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
+ this.txtFBitName.TitleFont = new System.Drawing.Font("MS UI Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.txtFBitName.TitleForeColor = System.Drawing.Color.White;
+ this.txtFBitName.TitleStyle = HotelPms.Share.Windows.Component.CTextBox.ETitleStyle.Material;
+ this.txtFBitName.TitleText = "";
+ this.txtFBitName.TitleWidth = 50;
+ //
+ // lblFBit
+ //
+ this.lblFBit.AutoSize = true;
+ this.lblFBit.Location = new System.Drawing.Point(546, 153);
+ this.lblFBit.Name = "lblFBit";
+ this.lblFBit.Size = new System.Drawing.Size(62, 15);
+ this.lblFBit.TabIndex = 12;
+ this.lblFBit.Text = "Boolean型";
+ //
+ // txtFFloat
+ //
+ this.txtFFloat.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(122)))), ((int)(((byte)(122)))), ((int)(((byte)(122)))));
+ this.txtFFloat.BorderFocusColor = System.Drawing.Color.FromArgb(((int)(((byte)(39)))), ((int)(((byte)(95)))), ((int)(((byte)(172)))));
+ this.txtFFloat.BorderStyle = System.Windows.Forms.BorderStyle.None;
+ this.txtFFloat.CurMMddInputStyle = HotelPms.Share.Windows.Component.MMddInputStyle.Future;
+ this.txtFFloat.Font = new System.Drawing.Font("Yu Gothic UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.txtFFloat.ForeImage = null;
+ this.txtFFloat.InputType = "0x2,0x2000";
+ this.txtFFloat.IsChkData = true;
+ this.txtFFloat.Location = new System.Drawing.Point(280, 171);
+ this.txtFFloat.MaxLength = 12;
+ this.txtFFloat.MstNameCtrl = null;
+ this.txtFFloat.Name = "txtFFloat";
+ this.txtFFloat.OrgText = "";
+ this.txtFFloat.PanelExEnabled = true;
+ this.txtFFloat.ShadowColor = System.Drawing.Color.FromArgb(((int)(((byte)(39)))), ((int)(((byte)(95)))), ((int)(((byte)(172)))));
+ this.txtFFloat.Size = new System.Drawing.Size(201, 18);
+ this.txtFFloat.TabIndex = 5;
+ this.txtFFloat.TextBoxArrayMember = true;
+ this.txtFFloat.TipText = "";
+ this.txtFFloat.TitleBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
+ this.txtFFloat.TitleFont = new System.Drawing.Font("MS UI Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.txtFFloat.TitleForeColor = System.Drawing.Color.White;
+ this.txtFFloat.TitleStyle = HotelPms.Share.Windows.Component.CTextBox.ETitleStyle.Material;
+ this.txtFFloat.TitleText = "";
+ this.txtFFloat.TitleWidth = 50;
+ //
+ // lblFFloat
+ //
+ this.lblFFloat.AutoSize = true;
+ this.lblFFloat.Location = new System.Drawing.Point(276, 153);
+ this.lblFFloat.Name = "lblFFloat";
+ this.lblFFloat.Size = new System.Drawing.Size(57, 15);
+ this.lblFFloat.TabIndex = 10;
+ this.lblFFloat.Text = "数字Float";
+ //
+ // txtFSmallInt
+ //
+ this.txtFSmallInt.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(122)))), ((int)(((byte)(122)))), ((int)(((byte)(122)))));
+ this.txtFSmallInt.BorderFocusColor = System.Drawing.Color.FromArgb(((int)(((byte)(39)))), ((int)(((byte)(95)))), ((int)(((byte)(172)))));
+ this.txtFSmallInt.BorderStyle = System.Windows.Forms.BorderStyle.None;
+ this.txtFSmallInt.CurMMddInputStyle = HotelPms.Share.Windows.Component.MMddInputStyle.Future;
+ this.txtFSmallInt.Font = new System.Drawing.Font("Yu Gothic UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.txtFSmallInt.ForeImage = null;
+ this.txtFSmallInt.InputType = "0x2";
+ this.txtFSmallInt.IsChkData = true;
+ this.txtFSmallInt.Location = new System.Drawing.Point(17, 171);
+ this.txtFSmallInt.MaxLength = 4;
+ this.txtFSmallInt.MstNameCtrl = null;
+ this.txtFSmallInt.Name = "txtFSmallInt";
+ this.txtFSmallInt.OrgText = "";
+ this.txtFSmallInt.PanelExEnabled = true;
+ this.txtFSmallInt.ShadowColor = System.Drawing.Color.FromArgb(((int)(((byte)(39)))), ((int)(((byte)(95)))), ((int)(((byte)(172)))));
+ this.txtFSmallInt.Size = new System.Drawing.Size(201, 18);
+ this.txtFSmallInt.TabIndex = 4;
+ this.txtFSmallInt.TextBoxArrayMember = true;
+ this.txtFSmallInt.TipText = "";
+ this.txtFSmallInt.TitleBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
+ this.txtFSmallInt.TitleFont = new System.Drawing.Font("MS UI Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.txtFSmallInt.TitleForeColor = System.Drawing.Color.White;
+ this.txtFSmallInt.TitleStyle = HotelPms.Share.Windows.Component.CTextBox.ETitleStyle.Material;
+ this.txtFSmallInt.TitleText = "";
+ this.txtFSmallInt.TitleWidth = 50;
+ //
+ // lblFSmallInt
+ //
+ this.lblFSmallInt.AutoSize = true;
+ this.lblFSmallInt.Location = new System.Drawing.Point(13, 153);
+ this.lblFSmallInt.Name = "lblFSmallInt";
+ this.lblFSmallInt.Size = new System.Drawing.Size(64, 15);
+ this.lblFSmallInt.TabIndex = 8;
+ this.lblFSmallInt.Text = "数字2バイト";
+ //
+ // txtUpdateDate
+ //
+ this.txtUpdateDate.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(122)))), ((int)(((byte)(122)))), ((int)(((byte)(122)))));
+ this.txtUpdateDate.BorderFocusColor = System.Drawing.Color.FromArgb(((int)(((byte)(39)))), ((int)(((byte)(95)))), ((int)(((byte)(172)))));
+ this.txtUpdateDate.BorderStyle = System.Windows.Forms.BorderStyle.None;
+ this.txtUpdateDate.CurMMddInputStyle = HotelPms.Share.Windows.Component.MMddInputStyle.Future;
+ this.txtUpdateDate.Font = new System.Drawing.Font("Yu Gothic UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.txtUpdateDate.ForeImage = null;
+ this.txtUpdateDate.InputType = "0x1";
+ this.txtUpdateDate.IsChkData = true;
+ this.txtUpdateDate.Location = new System.Drawing.Point(550, 244);
+ this.txtUpdateDate.MstNameCtrl = null;
+ this.txtUpdateDate.Name = "txtUpdateDate";
+ this.txtUpdateDate.OrgText = "";
+ this.txtUpdateDate.PanelExEnabled = true;
+ this.txtUpdateDate.ShadowColor = System.Drawing.Color.FromArgb(((int)(((byte)(39)))), ((int)(((byte)(95)))), ((int)(((byte)(172)))));
+ this.txtUpdateDate.Size = new System.Drawing.Size(201, 18);
+ this.txtUpdateDate.TabIndex = 9;
+ this.txtUpdateDate.TextBoxArrayMember = true;
+ this.txtUpdateDate.TipText = "";
+ this.txtUpdateDate.TitleBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
+ this.txtUpdateDate.TitleFont = new System.Drawing.Font("MS UI Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.txtUpdateDate.TitleForeColor = System.Drawing.Color.White;
+ this.txtUpdateDate.TitleStyle = HotelPms.Share.Windows.Component.CTextBox.ETitleStyle.Material;
+ this.txtUpdateDate.TitleText = "";
+ this.txtUpdateDate.TitleWidth = 50;
+ //
+ // lblUpdateDate
+ //
+ this.lblUpdateDate.AutoSize = true;
+ this.lblUpdateDate.Location = new System.Drawing.Point(546, 226);
+ this.lblUpdateDate.Name = "lblUpdateDate";
+ this.lblUpdateDate.Size = new System.Drawing.Size(98, 15);
+ this.lblUpdateDate.TabIndex = 18;
+ this.lblUpdateDate.Text = "日付(時間まで)";
+ //
+ // txtFDate
+ //
+ this.txtFDate.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(122)))), ((int)(((byte)(122)))), ((int)(((byte)(122)))));
+ this.txtFDate.BorderFocusColor = System.Drawing.Color.FromArgb(((int)(((byte)(39)))), ((int)(((byte)(95)))), ((int)(((byte)(172)))));
+ this.txtFDate.BorderStyle = System.Windows.Forms.BorderStyle.None;
+ this.txtFDate.CurMMddInputStyle = HotelPms.Share.Windows.Component.MMddInputStyle.Future;
+ this.txtFDate.Font = new System.Drawing.Font("Yu Gothic UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.txtFDate.ForeImage = null;
+ this.txtFDate.InputStyle = HotelPms.Share.Windows.Component.InputStyleSelection.Date;
+ this.txtFDate.InputType = "0x2,0x4000";
+ this.txtFDate.IsChkData = true;
+ this.txtFDate.IsDate = true;
+ this.txtFDate.Location = new System.Drawing.Point(280, 244);
+ this.txtFDate.MaxLength = 10;
+ this.txtFDate.MstNameCtrl = null;
+ this.txtFDate.Name = "txtFDate";
+ this.txtFDate.OrgText = "";
+ this.txtFDate.PanelExEnabled = true;
+ this.txtFDate.ShadowColor = System.Drawing.Color.FromArgb(((int)(((byte)(39)))), ((int)(((byte)(95)))), ((int)(((byte)(172)))));
+ this.txtFDate.Size = new System.Drawing.Size(201, 18);
+ this.txtFDate.TabIndex = 8;
+ this.txtFDate.TextBoxArrayMember = true;
+ this.txtFDate.TipText = "";
+ this.txtFDate.TitleBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
+ this.txtFDate.TitleFont = new System.Drawing.Font("MS UI Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.txtFDate.TitleForeColor = System.Drawing.Color.White;
+ this.txtFDate.TitleStyle = HotelPms.Share.Windows.Component.CTextBox.ETitleStyle.Material;
+ this.txtFDate.TitleText = "";
+ this.txtFDate.TitleWidth = 50;
+ //
+ // lblFDate
+ //
+ this.lblFDate.AutoSize = true;
+ this.lblFDate.Location = new System.Drawing.Point(276, 226);
+ this.lblFDate.Name = "lblFDate";
+ this.lblFDate.Size = new System.Drawing.Size(52, 15);
+ this.lblFDate.TabIndex = 16;
+ this.lblFDate.Text = "日付のみ";
+ //
+ // txtFDecimal
+ //
+ this.txtFDecimal.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(122)))), ((int)(((byte)(122)))), ((int)(((byte)(122)))));
+ this.txtFDecimal.BorderFocusColor = System.Drawing.Color.FromArgb(((int)(((byte)(39)))), ((int)(((byte)(95)))), ((int)(((byte)(172)))));
+ this.txtFDecimal.BorderStyle = System.Windows.Forms.BorderStyle.None;
+ this.txtFDecimal.CurMMddInputStyle = HotelPms.Share.Windows.Component.MMddInputStyle.Future;
+ this.txtFDecimal.Font = new System.Drawing.Font("Yu Gothic UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.txtFDecimal.ForeImage = null;
+ this.txtFDecimal.InputType = "0x2,0x2000";
+ this.txtFDecimal.IsChkData = true;
+ this.txtFDecimal.Location = new System.Drawing.Point(17, 244);
+ this.txtFDecimal.MaxLength = 19;
+ this.txtFDecimal.MstNameCtrl = null;
+ this.txtFDecimal.Name = "txtFDecimal";
+ this.txtFDecimal.OrgText = "";
+ this.txtFDecimal.PanelExEnabled = true;
+ this.txtFDecimal.ShadowColor = System.Drawing.Color.FromArgb(((int)(((byte)(39)))), ((int)(((byte)(95)))), ((int)(((byte)(172)))));
+ this.txtFDecimal.Size = new System.Drawing.Size(201, 18);
+ this.txtFDecimal.TabIndex = 7;
+ this.txtFDecimal.TextBoxArrayMember = true;
+ this.txtFDecimal.TipText = "";
+ this.txtFDecimal.TitleBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
+ this.txtFDecimal.TitleFont = new System.Drawing.Font("MS UI Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.txtFDecimal.TitleForeColor = System.Drawing.Color.White;
+ this.txtFDecimal.TitleStyle = HotelPms.Share.Windows.Component.CTextBox.ETitleStyle.Material;
+ this.txtFDecimal.TitleText = "";
+ this.txtFDecimal.TitleWidth = 50;
+ //
+ // lblFDecimal
+ //
+ this.lblFDecimal.AutoSize = true;
+ this.lblFDecimal.Location = new System.Drawing.Point(13, 226);
+ this.lblFDecimal.Name = "lblFDecimal";
+ this.lblFDecimal.Size = new System.Drawing.Size(55, 15);
+ this.lblFDecimal.TabIndex = 14;
+ this.lblFDecimal.Text = "数字金額";
+ //
+ // Demo
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(957, 583);
+ this.Name = "Demo";
+ this.Text = "Demo";
+ this.Load += new System.EventHandler(this.Form_Load);
+ this.pnlBar.ResumeLayout(false);
+ this.pnlBar.PerformLayout();
+ this.pnlInput.ResumeLayout(false);
+ this.pnlInput.PerformLayout();
+ this.pnlMain.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private Share.Windows.Component.CTextBox txtID;
+ private Share.Windows.Component.CTextBox txtName;
+ private Label lblName;
+ private Share.Windows.Component.CTextBox txtUpdateDate;
+ private Label lblUpdateDate;
+ private Share.Windows.Component.CTextBox txtFDate;
+ private Label lblFDate;
+ private Share.Windows.Component.CTextBox txtFDecimal;
+ private Label lblFDecimal;
+ private Share.Windows.Component.CTextBox txtFBit;
+ private Label lblFBit;
+ private Share.Windows.Component.CTextBox txtFFloat;
+ private Label lblFFloat;
+ private Share.Windows.Component.CTextBox txtFSmallInt;
+ private Label lblFSmallInt;
+ private Share.Windows.Component.CTextBox txtFTinyInt;
+ private Label lblFTinyInt;
+ private Share.Windows.Component.CTextBox txtFInt;
+ private Label lblFInt;
+ private Share.Windows.Component.CTextBox txtFBitName;
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.WinForm.Master/Demo.cs b/HotelPms.WinForm.Master/Demo.cs
new file mode 100644
index 0000000..cae67c1
--- /dev/null
+++ b/HotelPms.WinForm.Master/Demo.cs
@@ -0,0 +1,295 @@
+using customTypes;
+using HotelPms.Data.Common;
+using HotelPms.Data.Common.Interface.Access;
+using HotelPms.DataAccessGrpc.Client;
+using HotelPms.Share.Util;
+using HotelPms.Share.Windows.Component;
+using HotelPms.Share.Windows.Util;
+using HotelPms.WinForm.Common;
+using HotelPms.WinForm.Common.Interface;
+using HotelPms.WinForm.Common.Util;
+using System.Data;
+
+namespace HotelPms.WinForm.Master
+{
+ public partial class Demo : MasterBase, IMasterCtrl
+ {
+ #region ★★★★★ Declartions ★★★★★
+
+ private IDemo? demoAccess;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public Demo(IDemo access)
+ {
+ InitializeComponent();
+ demoAccess = access;
+ MasterCtrl = this;
+ dgvData.Visible = false;
+ }
+
+ private void Form_Load(object sender, EventArgs e)
+ {
+ Cursor = Cursors.WaitCursor;
+ MasterCtrl.ShowData();
+ System.Diagnostics.Debug.WriteLine(dgvData.Rows.Count);
+ if (dgvData.Rows.Count == 0)
+ {
+ SetNewMode();
+ }
+ dgvData.Visible = true;
+ Cursor = Cursors.Default;
+ }
+
+ #endregion
+
+ #region ★★★★★ Control Event ★★★★★
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+
+ public bool Delete()
+ {
+ int orgIndex = dgvData.CurrentRow.Index;
+ int pID = CConvert.ToInt(GetCellValue("ID"));
+ if (MessageBox.Show(string.Format(DelMsg + Environment.NewLine + "ID = {0}", pID),
+ Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == System.Windows.Forms.DialogResult.No) { return false; }
+
+
+ //排他チェック
+ if (demoAccess.GetUpdateID(pID) != CConvert.ToInt(GetCellValue("UpdateID")))
+ {
+ if (MessageBox.Show(LockMsg, this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
+ {
+ MasterCtrl.ShowData(pID);
+ m_ValueChangeListener.SetUpdateFormMode(UpdateFormMode.Normal);
+ }
+ return false;
+ }
+
+ Data.DataResult dataResult = demoAccess.Remove($"ID = {pID}");
+ if (dataResult.ErrNo != 0)
+ {
+ MessageBox.Show("削除に失敗しました。" + Environment.NewLine + $"{dataResult.ErrNo}.{dataResult.ErrData}", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
+ return false;
+ }
+
+ ShowData(orgIndex < dgvData.RowCount ? orgIndex : dgvData.RowCount - 1);
+ if (dgvData.Rows.Count == 0) { SetNewMode(); }
+ return true;
+ }
+
+ public bool IsCorrectEtc(object sender, bool isCheckAll, bool isShowErrMsg)
+ {
+ if (sender.Equals(txtID) && m_ValueChangeListener.CurUpdateMode == UpdateFormMode.Inputting)
+ {
+ if (demoAccess.Exists(CConvert.ToInt(txtID.Text)))
+ {
+ MessageBox.Show(ExistsMsg, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
+ txtID.Focus();
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public bool Save()
+ {
+ if (m_ValueChangeListener.CurUpdateMode != UpdateFormMode.Inputting && m_ValueChangeListener.CurUpdateMode != UpdateFormMode.Edit) { return true; }
+
+ //ソートがあるため、index正しくない
+ int id = (dgvData.CurrentRow == null) ? 0 : CConvert.ToInt(GetCellValue("ID"));
+ bool isNew = false;
+ HotelPms.Data.Master.Demo item = null;
+ UpdateFormMode orgMode = m_ValueChangeListener.CurUpdateMode;
+ if (orgMode == UpdateFormMode.Edit)
+ {
+ item = demoAccess.GetItem(CConvert.ToInt(txtID.Text));
+
+ //排他チェック
+ if(item.UpdateID != CConvert.ToInt(GetCellValue("UpdateID")))
+ {
+ if(MessageBox.Show(LockMsg, this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
+ {
+ MasterCtrl.ShowData(id);
+ m_ValueChangeListener.SetUpdateFormMode(UpdateFormMode.Normal);
+ }
+ return false;
+ }
+ }
+ if (item == null)
+ {
+ item = new HotelPms.Data.Master.Demo();
+ isNew = true;
+ }
+ item.ID = CConvert.ToInt(txtID.Text);
+ item.Name = txtName.Text;
+ item.FInt = CConvert.ToInt(txtFInt.Text);
+ item.FTinyInt = CConvert.ToInt(txtFTinyInt.Text);
+ item.FSmallInt = CConvert.ToInt(txtFSmallInt.Text);
+ item.FBit = CConvert.ToBool(txtFBit.Text);
+ item.FFloat = CConvert.ToFloat(txtFFloat.Text);
+ item.FDecimal = CConvert.ToDecimal(txtFDecimal.Text);
+ item.FDate = new Date(CConvert.ToDateInt(txtFDate.Text));
+ item.UpdateDate = CConvert.ToTimestamp(CConvert.ToDateTime(txtUpdateDate.Text));
+ item.UpdateID++;
+ Data.DataResult dataResult = isNew ? demoAccess.Add(item) : demoAccess.Update(item);
+
+ MasterCtrl.ShowData(id);
+ if (orgMode == UpdateFormMode.Inputting) { SetNewMode(); }
+ m_ValueChangeListener.SetUpdateFormMode(orgMode == UpdateFormMode.Edit ? UpdateFormMode.Normal : UpdateFormMode.New);
+ return dataResult.ErrNo == 0;
+ }
+
+ public void SetDispName(CTextBox sender)
+ {
+ if (sender.Equals(txtFBit))
+ {
+ sender.MstNameCtrl.Text = CConvert.GetEnumDescription<EVisible>(CConvert.ToInt(sender.Text));
+ }
+ }
+
+ public void ShowData()
+ {
+ ShowData(0);
+ }
+
+ private int FindRowIndex(int id)
+ {
+ for (int i = 0; i < m_Data.Rows.Count; i++)
+ {
+ if (id == CConvert.ToInt(m_Data.Rows[i]["ID"])) { return i; }
+ }
+ return 0;
+ }
+
+ public void ShowData(int id)
+ {
+ try
+ {
+ m_DisableSelectionChanged = true;
+ DataTable orgData = m_Data;
+ string where = string.Empty;
+ if (txtSearchKey.Text.Trim().Length > 0)
+ {
+ where += string.Format(" A.Name LIKE '%{0}%' ", txtSearchKey.Text);
+ }
+
+ m_Data = demoAccess.GetMasterGridData(where); //同期実行
+ dgvData.DataSource = m_Data;
+ SetGridColNameDict();
+ SetGridStyle();
+ if (dgvData.Rows.Count > 0)
+ {
+ SetCellFocus(FindRowIndex(id), 0, true);
+ ShowDetail();
+ }
+ if (orgData != null) { orgData.Dispose(); orgData = null; }
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message);
+ }
+ finally
+ {
+ m_DisableSelectionChanged = false;
+ }
+ }
+
+ private void SetGridStyle()
+ {
+ DataGridViewColumn col = null;
+ col = dgvData.Columns["ID"];
+ col.HeaderText = "ID";
+ col.Width = 100;
+ col.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
+ col = dgvData.Columns["Name"];
+ col.HeaderText = "名称";
+ col.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
+ col.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
+ col.Width = 100;
+ col = dgvData.Columns["FInt"];
+ col.HeaderText = "FInt";
+ col.Width = 100;
+ col.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
+ col = dgvData.Columns["FTinyInt"];
+ col.HeaderText = "FTinyInt";
+ col.Width = 100;
+ col.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
+ col = dgvData.Columns["FSmallInt"];
+ col.HeaderText = "FSmallInt";
+ col.Width = 100;
+ col.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
+ col = dgvData.Columns["FFloat"];
+ col.HeaderText = "FFloat";
+ col.Width = 100;
+ col.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
+ col = dgvData.Columns["FBit"];
+ col.HeaderText = "FBit";
+ col.Width = 100;
+ col.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
+ col = dgvData.Columns["FDecimal"];
+ col.HeaderText = "FDecimal";
+ col.Width = 100;
+ col.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
+ col = dgvData.Columns["FDate"];
+ col.HeaderText = "FDate";
+ col.Width = 100;
+ col.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
+
+ col = dgvData.Columns["UpdateDate"];
+ col.Visible = false;
+ col = dgvData.Columns["UpdateID"];
+ col.Visible = false;
+ }
+
+ public void ShowDetail()
+ {
+ if (dgvData.CurrentRow == null) { return; }
+ tbArray.DisbleValidating = true;
+ int index = dgvData.CurrentRow.Index;
+ txtName.Text = CConvert.ToString(GetCellValue("Name"));
+ this.ActiveControl = txtName;
+ tbArray.PerformEnter(txtName, null);
+ txtID.Enabled = false;
+ txtID.Text = GeneralSub.ToFormText(CConvert.ToInt(GetCellValue("ID")));
+ txtFInt.Text = GeneralSub.ToFormText(CConvert.ToInt(GetCellValue("FInt")));
+ txtFTinyInt.Text = GeneralSub.ToFormText(CConvert.ToInt(GetCellValue("FTinyInt")));
+ txtFSmallInt.Text = GeneralSub.ToFormText(CConvert.ToInt(GetCellValue("FSmallInt")));
+ txtFFloat.Text = CConvert.ToFloat(GetCellValue("FFloat")).ToString();
+ txtFBit.Text = CConvert.ToBool(GetCellValue("FBit")) ? "1" : "0";
+ SetDispName(txtFBit);
+ txtFDecimal.Text = CConvert.ToDecimal(GetCellValue("FDecimal")).ToString();
+ txtFDate.Text = CConvert.ToDateString(GetCellValue("FDate"));
+ txtUpdateDate.Text = GetCellValue("UpdateDate").ToString();
+
+ m_ValueChangeListener.SetUpdateFormMode(UpdateFormMode.Normal);
+ tbArray.DisbleValidating = false;
+ }
+
+ public void ShowList(CTextBox sender)
+ {
+ DataTable data = null;
+
+ if (sender.Equals(txtFBit)) { data = CConvert.GetEnumTypeList<EVisible>(); }
+
+ if (data == null) { return; }
+ string ret = HotelPms.Share.Windows.Tool.DataSelector.Execute(sender, data, new Size(250, 120), string.Empty, string.Empty, null, HotelPms.Share.Windows.Tool.DataSelector.Style.HideBottom);
+ if (ret.Length == 0) { return; }
+ sender.Text = ret;
+ tbArray.PerformKeyDown(sender, new KeyEventArgs(Keys.Enter));
+ }
+
+
+ #endregion
+ }
+}
diff --git a/HotelPms.WinForm.Master/Demo.resx b/HotelPms.WinForm.Master/Demo.resx
new file mode 100644
index 0000000..f298a7b
--- /dev/null
+++ b/HotelPms.WinForm.Master/Demo.resx
@@ -0,0 +1,60 @@
+<root>
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root>
\ No newline at end of file
diff --git a/HotelPms.WinForm.Master/HotelPms.WinForm.Master.csproj b/HotelPms.WinForm.Master/HotelPms.WinForm.Master.csproj
new file mode 100644
index 0000000..88cc2ce
--- /dev/null
+++ b/HotelPms.WinForm.Master/HotelPms.WinForm.Master.csproj
@@ -0,0 +1,18 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <TargetFramework>net9.0-windows7.0</TargetFramework>
+ <Nullable>enable</Nullable>
+ <UseWindowsForms>true</UseWindowsForms>
+ <ImplicitUsings>enable</ImplicitUsings>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <ProjectReference Include="..\HotelPms.Data.Client\HotelPms.Data.Client.csproj" />
+ <ProjectReference Include="..\HotelPms.DataAccessGrpc.Client\HotelPms.DataAccessGrpc.Client.csproj" />
+ <ProjectReference Include="..\HotelPms.Share.Windows\HotelPms.Share.Windows.csproj" />
+ <ProjectReference Include="..\HotelPms.Share\HotelPms.Share.csproj" />
+ <ProjectReference Include="..\HotelPms.WinForm.Common\HotelPms.WinForm.Common.csproj" />
+ </ItemGroup>
+
+</Project>
diff --git a/HotelPms.WinForm/HotelPms.WinForm.csproj b/HotelPms.WinForm/HotelPms.WinForm.csproj
new file mode 100644
index 0000000..8865193
--- /dev/null
+++ b/HotelPms.WinForm/HotelPms.WinForm.csproj
@@ -0,0 +1,26 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <TargetFramework>net9.0-windows7.0</TargetFramework>
+ <Nullable>enable</Nullable>
+ <UseWindowsForms>true</UseWindowsForms>
+ <ImplicitUsings>enable</ImplicitUsings>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <ProjectReference Include="..\HotelPms.DataAccessDirect.Client\HotelPms.DataAccessDirect.Client.csproj" />
+ <ProjectReference Include="..\HotelPms.Share.Windows\HotelPms.Share.Windows.csproj" />
+ <ProjectReference Include="..\HotelPms.WinForm.Common\HotelPms.WinForm.Common.csproj" />
+ <ProjectReference Include="..\HotelPms.WinForm.Master\HotelPms.WinForm.Master.csproj" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <Compile Update="View\Menu.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Update="View\UseInput\Detail.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ </ItemGroup>
+
+</Project>
diff --git a/HotelPms.WinForm/View/Menu.Designer.cs b/HotelPms.WinForm/View/Menu.Designer.cs
new file mode 100644
index 0000000..fbb127e
--- /dev/null
+++ b/HotelPms.WinForm/View/Menu.Designer.cs
@@ -0,0 +1,138 @@
+namespace HotelPms.WinForm.View
+{
+ partial class Menu
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.pnlTop = new System.Windows.Forms.Panel();
+ this.pnlBody = new System.Windows.Forms.Panel();
+ this.materialButton2 = new HotelPms.Share.Windows.Component.MaterialButton();
+ this.materialButton1 = new HotelPms.Share.Windows.Component.MaterialButton();
+ this.materialButton3 = new HotelPms.Share.Windows.Component.MaterialButton();
+ this.pnlMain.SuspendLayout();
+ this.pnlBody.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // pnlMain
+ //
+ this.pnlMain.Controls.Add(this.pnlBody);
+ this.pnlMain.Controls.Add(this.pnlTop);
+ this.pnlMain.Size = new System.Drawing.Size(798, 413);
+ //
+ // LoadingObj
+ //
+ this.LoadingObj.Size = new System.Drawing.Size(798, 413);
+ //
+ // pnlTop
+ //
+ this.pnlTop.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(39)))), ((int)(((byte)(95)))), ((int)(((byte)(172)))));
+ this.pnlTop.Dock = System.Windows.Forms.DockStyle.Top;
+ this.pnlTop.Location = new System.Drawing.Point(0, 0);
+ this.pnlTop.Name = "pnlTop";
+ this.pnlTop.Size = new System.Drawing.Size(798, 48);
+ this.pnlTop.TabIndex = 0;
+ //
+ // pnlBody
+ //
+ this.pnlBody.BackColor = System.Drawing.Color.White;
+ this.pnlBody.Controls.Add(this.materialButton3);
+ this.pnlBody.Controls.Add(this.materialButton2);
+ this.pnlBody.Controls.Add(this.materialButton1);
+ this.pnlBody.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.pnlBody.Location = new System.Drawing.Point(0, 48);
+ this.pnlBody.Name = "pnlBody";
+ this.pnlBody.Size = new System.Drawing.Size(798, 365);
+ this.pnlBody.TabIndex = 1;
+ //
+ // materialButton2
+ //
+ this.materialButton2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(105)))), ((int)(((byte)(217)))));
+ this.materialButton2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.materialButton2.Font = new System.Drawing.Font("Yu Gothic UI", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.materialButton2.ForeColor = System.Drawing.Color.White;
+ this.materialButton2.Location = new System.Drawing.Point(47, 107);
+ this.materialButton2.Name = "materialButton2";
+ this.materialButton2.Radius = 10F;
+ this.materialButton2.Size = new System.Drawing.Size(242, 56);
+ this.materialButton2.TabIndex = 1;
+ this.materialButton2.Text = "チェックイン";
+ this.materialButton2.UseVisualStyleBackColor = false;
+ //
+ // materialButton1
+ //
+ this.materialButton1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(105)))), ((int)(((byte)(217)))));
+ this.materialButton1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.materialButton1.Font = new System.Drawing.Font("Yu Gothic UI", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.materialButton1.ForeColor = System.Drawing.Color.White;
+ this.materialButton1.Location = new System.Drawing.Point(47, 27);
+ this.materialButton1.Name = "materialButton1";
+ this.materialButton1.Radius = 10F;
+ this.materialButton1.Size = new System.Drawing.Size(242, 56);
+ this.materialButton1.TabIndex = 0;
+ this.materialButton1.Text = "予約登録";
+ this.materialButton1.UseVisualStyleBackColor = false;
+ this.materialButton1.Click += new System.EventHandler(this.materialButton1_Click);
+ //
+ // materialButton3
+ //
+ this.materialButton3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(105)))), ((int)(((byte)(217)))));
+ this.materialButton3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.materialButton3.Font = new System.Drawing.Font("Yu Gothic UI", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.materialButton3.ForeColor = System.Drawing.Color.White;
+ this.materialButton3.Location = new System.Drawing.Point(47, 194);
+ this.materialButton3.Name = "materialButton3";
+ this.materialButton3.Radius = 10F;
+ this.materialButton3.Size = new System.Drawing.Size(242, 56);
+ this.materialButton3.TabIndex = 2;
+ this.materialButton3.Text = "デモ";
+ this.materialButton3.UseVisualStyleBackColor = false;
+ this.materialButton3.Click += new System.EventHandler(this.materialButton3_Click);
+ //
+ // Menu
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(800, 450);
+ this.Name = "Menu";
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+ this.Text = "Menu";
+ this.Load += new System.EventHandler(this.Menu_Load);
+ this.pnlMain.ResumeLayout(false);
+ this.pnlBody.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private Panel pnlTop;
+ private Panel pnlBody;
+ private Share.Windows.Component.MaterialButton materialButton2;
+ private Share.Windows.Component.MaterialButton materialButton1;
+ private Share.Windows.Component.MaterialButton materialButton3;
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.WinForm/View/Menu.cs b/HotelPms.WinForm/View/Menu.cs
new file mode 100644
index 0000000..fa3c58d
--- /dev/null
+++ b/HotelPms.WinForm/View/Menu.cs
@@ -0,0 +1,41 @@
+using HotelPms.Share.Windows.Util;
+using MasterForm = HotelPms.WinForm.Master;
+using HotelPms.WinForm.View.UseInput;
+using HotelPms.DataAccessGrpc.Client;
+using HotelPms.Share.Data;
+using HotelPms.WinForm.Common.Util;
+
+namespace HotelPms.WinForm.View
+{
+ public partial class Menu : FormBase
+ {
+ public Menu()
+ {
+ InitializeComponent();
+ }
+
+ private void Menu_Load(object sender, EventArgs e)
+ {
+ Text = $"{Application.ProductName}【Ver.{Application.ProductVersion}】";
+ //pnlTop.BackColor = ColorTranslator.FromHtml("#1E88E5");
+ pnlTop.BackColor = Color.FromArgb(255,39, 95, 172);
+ }
+
+ private void materialButton1_Click(object sender, EventArgs e)
+ {
+ new Detail().Show();
+ }
+
+ private void materialButton3_Click(object sender, EventArgs e)
+ {
+ // direct
+ using (MsSqlNet msSqlNet = EnvironmentSetting.Default.CreateDBAccess())
+ {
+ new MasterForm.Demo(new HotelPms.DataAccessDirect.Client.DemoAccess(msSqlNet)).Show();
+ }
+
+ // grpc
+ //new MasterForm.Demo(DemoAccess.Instance).Show();
+ }
+ }
+}
diff --git a/HotelPms.WinForm/View/Menu.resx b/HotelPms.WinForm/View/Menu.resx
new file mode 100644
index 0000000..f298a7b
--- /dev/null
+++ b/HotelPms.WinForm/View/Menu.resx
@@ -0,0 +1,60 @@
+<root>
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root>
\ No newline at end of file
diff --git a/HotelPms.WinForm/View/UseInput/Detail.Designer.cs b/HotelPms.WinForm/View/UseInput/Detail.Designer.cs
new file mode 100644
index 0000000..b24ff50
--- /dev/null
+++ b/HotelPms.WinForm/View/UseInput/Detail.Designer.cs
@@ -0,0 +1,346 @@
+namespace HotelPms.WinForm.View.UseInput
+{
+ partial class Detail
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.txtGroupKana = new HotelPms.Share.Windows.Component.CTextBox();
+ this.lblGroupName = new System.Windows.Forms.Label();
+ this.lblGroupKana = new System.Windows.Forms.Label();
+ this.txtGroupName = new HotelPms.Share.Windows.Component.TextBoxFurigana();
+ this.txtID = new HotelPms.Share.Windows.Component.TextBoxFurigana();
+ this.lblID = new System.Windows.Forms.Label();
+ this.label1 = new System.Windows.Forms.Label();
+ this.txtResvType = new HotelPms.Share.Windows.Component.CTextBox();
+ this.panelEx1 = new HotelPms.Share.Windows.Component.PanelEx();
+ this.txtName = new HotelPms.Share.Windows.Component.TextBoxFurigana();
+ this.txtKana = new HotelPms.Share.Windows.Component.CTextBox();
+ this.label4 = new System.Windows.Forms.Label();
+ this.label3 = new System.Windows.Forms.Label();
+ this.pnlMain.SuspendLayout();
+ this.panelEx1.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // pnlMain
+ //
+ this.pnlMain.BackColor = System.Drawing.Color.White;
+ this.pnlMain.Controls.Add(this.panelEx1);
+ this.pnlMain.Controls.Add(this.txtResvType);
+ this.pnlMain.Controls.Add(this.label1);
+ this.pnlMain.Controls.Add(this.txtID);
+ this.pnlMain.Controls.Add(this.lblID);
+ this.pnlMain.Controls.Add(this.txtGroupName);
+ this.pnlMain.Controls.Add(this.lblGroupKana);
+ this.pnlMain.Controls.Add(this.lblGroupName);
+ this.pnlMain.Controls.Add(this.txtGroupKana);
+ this.pnlMain.Size = new System.Drawing.Size(798, 413);
+ //
+ // LoadingObj
+ //
+ this.LoadingObj.Size = new System.Drawing.Size(798, 413);
+ //
+ // txtGroupKana
+ //
+ this.txtGroupKana.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(122)))), ((int)(((byte)(122)))), ((int)(((byte)(122)))));
+ this.txtGroupKana.BorderFocusColor = System.Drawing.Color.FromArgb(((int)(((byte)(39)))), ((int)(((byte)(95)))), ((int)(((byte)(172)))));
+ this.txtGroupKana.BorderStyle = System.Windows.Forms.BorderStyle.None;
+ this.txtGroupKana.Font = new System.Drawing.Font("Yu Gothic UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.txtGroupKana.ForeImage = null;
+ this.txtGroupKana.InputType = "0x1";
+ this.txtGroupKana.Location = new System.Drawing.Point(57, 194);
+ this.txtGroupKana.MstNameCtrl = null;
+ this.txtGroupKana.Name = "txtGroupKana";
+ this.txtGroupKana.OrgText = "";
+ this.txtGroupKana.PanelExEnabled = true;
+ this.txtGroupKana.ShadowColor = System.Drawing.Color.FromArgb(((int)(((byte)(39)))), ((int)(((byte)(95)))), ((int)(((byte)(172)))));
+ this.txtGroupKana.Size = new System.Drawing.Size(195, 18);
+ this.txtGroupKana.TabIndex = 0;
+ this.txtGroupKana.TextBoxArrayMember = true;
+ this.txtGroupKana.TipText = "カナ";
+ this.txtGroupKana.TitleBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(109)))), ((int)(((byte)(189)))));
+ this.txtGroupKana.TitleFont = new System.Drawing.Font("Yu Gothic UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.txtGroupKana.TitleForeColor = System.Drawing.Color.White;
+ this.txtGroupKana.TitleStyle = HotelPms.Share.Windows.Component.CTextBox.ETitleStyle.Material;
+ this.txtGroupKana.TitleText = "団体カナ";
+ this.txtGroupKana.TitleWidth = 100;
+ //
+ // lblGroupName
+ //
+ this.lblGroupName.AutoSize = true;
+ this.lblGroupName.Font = new System.Drawing.Font("Yu Gothic UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.lblGroupName.Location = new System.Drawing.Point(57, 77);
+ this.lblGroupName.Name = "lblGroupName";
+ this.lblGroupName.Size = new System.Drawing.Size(60, 17);
+ this.lblGroupName.TabIndex = 1;
+ this.lblGroupName.Text = "団体名称";
+ //
+ // lblGroupKana
+ //
+ this.lblGroupKana.AutoSize = true;
+ this.lblGroupKana.Font = new System.Drawing.Font("游ゴシック", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.lblGroupKana.ForeColor = System.Drawing.Color.Navy;
+ this.lblGroupKana.Location = new System.Drawing.Point(51, 175);
+ this.lblGroupKana.Name = "lblGroupKana";
+ this.lblGroupKana.Size = new System.Drawing.Size(55, 16);
+ this.lblGroupKana.TabIndex = 3;
+ this.lblGroupKana.Text = "団体カナ";
+ //
+ // txtGroupName
+ //
+ this.txtGroupName.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(122)))), ((int)(((byte)(122)))), ((int)(((byte)(122)))));
+ this.txtGroupName.BorderFocusColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(120)))), ((int)(((byte)(215)))));
+ this.txtGroupName.ChildControl = this.txtGroupKana;
+ this.txtGroupName.Font = new System.Drawing.Font("Yu Gothic UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.txtGroupName.ForeImage = null;
+ this.txtGroupName.InputType = "0x1";
+ this.txtGroupName.Location = new System.Drawing.Point(118, 74);
+ this.txtGroupName.MstNameCtrl = null;
+ this.txtGroupName.Name = "txtGroupName";
+ this.txtGroupName.OrgText = "";
+ this.txtGroupName.PanelExEnabled = false;
+ this.txtGroupName.ShadowColor = System.Drawing.Color.FromArgb(((int)(((byte)(140)))), ((int)(((byte)(123)))), ((int)(((byte)(193)))), ((int)(((byte)(247)))));
+ this.txtGroupName.Size = new System.Drawing.Size(195, 25);
+ this.txtGroupName.TabIndex = 4;
+ this.txtGroupName.TextBoxArrayMember = true;
+ this.txtGroupName.TipText = "";
+ this.txtGroupName.TitleBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
+ this.txtGroupName.TitleFont = new System.Drawing.Font("Yu Gothic UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.txtGroupName.TitleForeColor = System.Drawing.Color.White;
+ this.txtGroupName.TitleStyle = HotelPms.Share.Windows.Component.CTextBox.ETitleStyle.None;
+ this.txtGroupName.TitleText = "";
+ this.txtGroupName.TitleWidth = 50;
+ //
+ // txtID
+ //
+ this.txtID.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(122)))), ((int)(((byte)(122)))), ((int)(((byte)(122)))));
+ this.txtID.BorderFocusColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(120)))), ((int)(((byte)(215)))));
+ this.txtID.ChildControl = this.txtGroupKana;
+ this.txtID.Font = new System.Drawing.Font("Yu Gothic UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.txtID.ForeImage = null;
+ this.txtID.InputType = "0x1";
+ this.txtID.Location = new System.Drawing.Point(87, 11);
+ this.txtID.MstNameCtrl = null;
+ this.txtID.Name = "txtID";
+ this.txtID.OrgText = "";
+ this.txtID.PanelExEnabled = false;
+ this.txtID.ShadowColor = System.Drawing.Color.FromArgb(((int)(((byte)(140)))), ((int)(((byte)(123)))), ((int)(((byte)(193)))), ((int)(((byte)(247)))));
+ this.txtID.Size = new System.Drawing.Size(195, 25);
+ this.txtID.TabIndex = 6;
+ this.txtID.TextBoxArrayMember = true;
+ this.txtID.TipText = "";
+ this.txtID.TitleBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
+ this.txtID.TitleFont = new System.Drawing.Font("Yu Gothic UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.txtID.TitleForeColor = System.Drawing.Color.White;
+ this.txtID.TitleStyle = HotelPms.Share.Windows.Component.CTextBox.ETitleStyle.None;
+ this.txtID.TitleText = "";
+ this.txtID.TitleWidth = 50;
+ //
+ // lblID
+ //
+ this.lblID.AutoSize = true;
+ this.lblID.Font = new System.Drawing.Font("Yu Gothic UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.lblID.Location = new System.Drawing.Point(26, 14);
+ this.lblID.Name = "lblID";
+ this.lblID.Size = new System.Drawing.Size(46, 17);
+ this.lblID.TabIndex = 5;
+ this.lblID.Text = "利用ID";
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Font = new System.Drawing.Font("Yu Gothic UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.label1.Location = new System.Drawing.Point(42, 299);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(60, 17);
+ this.label1.TabIndex = 7;
+ this.label1.Text = "予約区分";
+ //
+ // txtResvType
+ //
+ this.txtResvType.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(122)))), ((int)(((byte)(122)))), ((int)(((byte)(122)))));
+ this.txtResvType.BorderFocusColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(120)))), ((int)(((byte)(215)))));
+ this.txtResvType.BorderStyle = System.Windows.Forms.BorderStyle.None;
+ this.txtResvType.Font = new System.Drawing.Font("Yu Gothic UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.txtResvType.ForeImage = null;
+ this.txtResvType.InputType = "0x1";
+ this.txtResvType.Location = new System.Drawing.Point(140, 258);
+ this.txtResvType.MstNameCtrl = null;
+ this.txtResvType.Name = "txtResvType";
+ this.txtResvType.OrgText = "";
+ this.txtResvType.PanelExEnabled = true;
+ this.txtResvType.ShadowColor = System.Drawing.Color.FromArgb(((int)(((byte)(140)))), ((int)(((byte)(123)))), ((int)(((byte)(193)))), ((int)(((byte)(247)))));
+ this.txtResvType.Size = new System.Drawing.Size(195, 18);
+ this.txtResvType.TabIndex = 8;
+ this.txtResvType.TextBoxArrayMember = true;
+ this.txtResvType.TipText = "予約区分";
+ this.txtResvType.TitleBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(109)))), ((int)(((byte)(189)))));
+ this.txtResvType.TitleFont = new System.Drawing.Font("Yu Gothic UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.txtResvType.TitleForeColor = System.Drawing.Color.White;
+ this.txtResvType.TitleStyle = HotelPms.Share.Windows.Component.CTextBox.ETitleStyle.Label;
+ this.txtResvType.TitleText = "予約区分";
+ this.txtResvType.TitleWidth = 100;
+ //
+ // panelEx1
+ //
+ this.panelEx1.ActiveName = "";
+ this.panelEx1.ArcWidth = 16;
+ this.panelEx1.BackColor = System.Drawing.Color.WhiteSmoke;
+ this.panelEx1.Blur = 15;
+ this.panelEx1.Controls.Add(this.txtName);
+ this.panelEx1.Controls.Add(this.label4);
+ this.panelEx1.Controls.Add(this.txtKana);
+ this.panelEx1.Controls.Add(this.label3);
+ this.panelEx1.Expan = true;
+ this.panelEx1.Location = new System.Drawing.Point(361, 59);
+ this.panelEx1.MaxHeight = -1;
+ this.panelEx1.Name = "panelEx1";
+ this.panelEx1.OffsetX = 0;
+ this.panelEx1.OffsetY = 0;
+ this.panelEx1.Padding = new System.Windows.Forms.Padding(0, 35, 0, 0);
+ this.panelEx1.SignFont = new System.Drawing.Font("Yu Gothic UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.panelEx1.Size = new System.Drawing.Size(390, 290);
+ this.panelEx1.Spread = 15;
+ this.panelEx1.TabIndex = 9;
+ this.panelEx1.Title = "宿泊者情報";
+ this.panelEx1.TitleBackColor = System.Drawing.Color.Gainsboro;
+ this.panelEx1.TitleBookMarkColor = System.Drawing.Color.DeepPink;
+ this.panelEx1.TitleFont = new System.Drawing.Font("Yu Gothic UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.panelEx1.TitleForeColor = System.Drawing.Color.Black;
+ this.panelEx1.TitleHeight = 35;
+ this.panelEx1.UseTitleBookMark = true;
+ //
+ // txtName
+ //
+ this.txtName.BackColor = System.Drawing.Color.WhiteSmoke;
+ this.txtName.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(122)))), ((int)(((byte)(122)))), ((int)(((byte)(122)))));
+ this.txtName.BorderFocusColor = System.Drawing.Color.FromArgb(((int)(((byte)(39)))), ((int)(((byte)(95)))), ((int)(((byte)(172)))));
+ this.txtName.BorderStyle = System.Windows.Forms.BorderStyle.None;
+ this.txtName.ChildControl = this.txtKana;
+ this.txtName.Font = new System.Drawing.Font("Yu Gothic UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.txtName.ForeImage = null;
+ this.txtName.InputType = "0x1";
+ this.txtName.Location = new System.Drawing.Point(23, 70);
+ this.txtName.MstNameCtrl = null;
+ this.txtName.Name = "txtName";
+ this.txtName.OrgText = "";
+ this.txtName.PanelExEnabled = true;
+ this.txtName.ShadowColor = System.Drawing.Color.FromArgb(((int)(((byte)(39)))), ((int)(((byte)(95)))), ((int)(((byte)(172)))));
+ this.txtName.Size = new System.Drawing.Size(195, 18);
+ this.txtName.TabIndex = 8;
+ this.txtName.TextBoxArrayMember = true;
+ this.txtName.TipText = "";
+ this.txtName.TitleBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
+ this.txtName.TitleFont = new System.Drawing.Font("Yu Gothic UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.txtName.TitleForeColor = System.Drawing.Color.White;
+ this.txtName.TitleStyle = HotelPms.Share.Windows.Component.CTextBox.ETitleStyle.Material;
+ this.txtName.TitleText = "";
+ this.txtName.TitleWidth = 50;
+ //
+ // txtKana
+ //
+ this.txtKana.BackColor = System.Drawing.Color.WhiteSmoke;
+ this.txtKana.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(122)))), ((int)(((byte)(122)))), ((int)(((byte)(122)))));
+ this.txtKana.BorderFocusColor = System.Drawing.Color.FromArgb(((int)(((byte)(39)))), ((int)(((byte)(95)))), ((int)(((byte)(172)))));
+ this.txtKana.BorderStyle = System.Windows.Forms.BorderStyle.None;
+ this.txtKana.Font = new System.Drawing.Font("Yu Gothic UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.txtKana.ForeImage = null;
+ this.txtKana.InputType = "0x1";
+ this.txtKana.Location = new System.Drawing.Point(23, 124);
+ this.txtKana.MstNameCtrl = null;
+ this.txtKana.Name = "txtKana";
+ this.txtKana.OrgText = "";
+ this.txtKana.PanelExEnabled = true;
+ this.txtKana.ShadowColor = System.Drawing.Color.FromArgb(((int)(((byte)(39)))), ((int)(((byte)(95)))), ((int)(((byte)(172)))));
+ this.txtKana.Size = new System.Drawing.Size(195, 18);
+ this.txtKana.TabIndex = 6;
+ this.txtKana.TextBoxArrayMember = true;
+ this.txtKana.TipText = "";
+ this.txtKana.TitleBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(109)))), ((int)(((byte)(189)))));
+ this.txtKana.TitleFont = new System.Drawing.Font("Yu Gothic UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.txtKana.TitleForeColor = System.Drawing.Color.White;
+ this.txtKana.TitleStyle = HotelPms.Share.Windows.Component.CTextBox.ETitleStyle.Material;
+ this.txtKana.TitleText = "団体カナ";
+ this.txtKana.TitleWidth = 100;
+ //
+ // label4
+ //
+ this.label4.AutoSize = true;
+ this.label4.Font = new System.Drawing.Font("游ゴシック", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.label4.ForeColor = System.Drawing.Color.Navy;
+ this.label4.Location = new System.Drawing.Point(23, 105);
+ this.label4.Name = "label4";
+ this.label4.Size = new System.Drawing.Size(31, 16);
+ this.label4.TabIndex = 7;
+ this.label4.Text = "カナ";
+ //
+ // label3
+ //
+ this.label3.AutoSize = true;
+ this.label3.Font = new System.Drawing.Font("游ゴシック", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
+ this.label3.ForeColor = System.Drawing.Color.Navy;
+ this.label3.Location = new System.Drawing.Point(23, 51);
+ this.label3.Name = "label3";
+ this.label3.Size = new System.Drawing.Size(31, 16);
+ this.label3.TabIndex = 5;
+ this.label3.Text = "氏名";
+ //
+ // Detail
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(800, 450);
+ this.Name = "Detail";
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+ this.Text = "詳細画面";
+ this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Detail_FormClosing);
+ this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.Detail_FormClosed);
+ this.Load += new System.EventHandler(this.Detail_Load);
+ this.pnlMain.ResumeLayout(false);
+ this.pnlMain.PerformLayout();
+ this.panelEx1.ResumeLayout(false);
+ this.panelEx1.PerformLayout();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private Label lblGroupName;
+ private Share.Windows.Component.CTextBox txtGroupKana;
+ private Label lblGroupKana;
+ private Share.Windows.Component.TextBoxFurigana txtGroupName;
+ private Share.Windows.Component.TextBoxFurigana txtID;
+ private Label lblID;
+ private Label label1;
+ private Share.Windows.Component.CTextBox txtResvType;
+ private Share.Windows.Component.PanelEx panelEx1;
+ private Share.Windows.Component.TextBoxFurigana txtName;
+ private Label label4;
+ private Share.Windows.Component.CTextBox txtKana;
+ private Label label3;
+ }
+}
\ No newline at end of file
diff --git a/HotelPms.WinForm/View/UseInput/Detail.cs b/HotelPms.WinForm/View/UseInput/Detail.cs
new file mode 100644
index 0000000..84c4abc
--- /dev/null
+++ b/HotelPms.WinForm/View/UseInput/Detail.cs
@@ -0,0 +1,74 @@
+using HotelPms.Data.UseInfo;
+using HotelPms.Share.Data;
+using HotelPms.Share.Windows.Util;
+using HotelPms.WinForm.Common.Util;
+
+namespace HotelPms.WinForm.View.UseInput
+{
+ /// <summary>
+ /// ◇機能名
+ /// 予約・チエックイン画面
+ /// ◇履歴
+ /// 2022/04/05 小木 勝龍 新規作成
+ /// </summary>
+ public partial class Detail : FormBase
+ {
+ #region ★★★★★ Declartions ★★★★★
+
+ private DataAccess dataAccess;
+
+ #endregion
+
+ #region ★★★★★ Property ★★★★★
+
+ /// <summary>
+ /// 利用データ
+ /// </summary>
+ public Use? UseData { get; set; }
+
+ #endregion
+
+ #region ★★★★★ Class Event ★★★★★
+
+ public Detail()
+ {
+ InitializeComponent();
+ }
+
+ private void Detail_Load(object sender, EventArgs e)
+ {
+ dataAccess = EnvironmentSetting.Default.CreateDBAccess();
+ UseData = Use.Get(0, dataAccess);
+ txtID.Text = UseData.ID.ToString();
+ txtGroupName.Text = UseData.GroupName;
+ txtGroupKana.Text = UseData.GroupKana;
+ }
+
+ private void Detail_FormClosed(object sender, FormClosedEventArgs e)
+ {
+ if(dataAccess != null) { dataAccess.Dispose(); }
+ }
+
+ private void Detail_FormClosing(object sender, FormClosingEventArgs e)
+ {
+
+ }
+
+
+ #endregion
+
+ #region ★★★★★ Control Event ★★★★★
+ #endregion
+
+ #region ★★★★★ Private Function ★★★★★
+ #endregion
+
+ #region ★★★★★ Public Function ★★★★★
+ #endregion
+
+ private void button1_Click(object sender, EventArgs e)
+ {
+ panelEx1.Expan = !panelEx1.Expan;
+ }
+ }
+}
diff --git a/HotelPms.WinForm/View/UseInput/Detail.resx b/HotelPms.WinForm/View/UseInput/Detail.resx
new file mode 100644
index 0000000..f298a7b
--- /dev/null
+++ b/HotelPms.WinForm/View/UseInput/Detail.resx
@@ -0,0 +1,60 @@
+<root>
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root>
\ No newline at end of file
diff --git a/HotelPms.sln b/HotelPms.sln
new file mode 100644
index 0000000..3df37aa
--- /dev/null
+++ b/HotelPms.sln
@@ -0,0 +1,150 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.1.32113.165
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HotelPms.Share", "HotelPms.Share\HotelPms.Share.csproj", "{26472449-50A0-4C85-AD07-EC8078B17431}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HotelPms.Data.Common", "HotelPms.Data.Common\HotelPms.Data.Common.csproj", "{B371155C-0FE3-4DB8-8657-EE585576BA0D}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HotelPms.Share.Windows", "HotelPms.Share.Windows\HotelPms.Share.Windows.csproj", "{D1F45B8E-1A6F-40F6-9EDA-904A32A8E6BF}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HotelPms.SourceFactory", "HotelPms.SourceFactory\HotelPms.SourceFactory.csproj", "{95C3BC9D-8974-4F0C-897E-EAC42127A4F2}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{F882FFAD-A899-455B-9BC0-2C91C05435F0}"
+ ProjectSection(SolutionItems) = preProject
+ .editorconfig = .editorconfig
+ EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Document", "Document", "{4AD9E991-8D1A-4175-8E3C-75C964525382}"
+ ProjectSection(SolutionItems) = preProject
+ Document\Config.json = Document\Config.json
+ Document\Git.xlsx = Document\Git.xlsx
+ Document\HotelCommonDB設計.xlsx = Document\HotelCommonDB設計.xlsx
+ Document\HotelPmsDB設計_マスタ.xlsx = Document\HotelPmsDB設計_マスタ.xlsx
+ Document\HotelPmsDB設計_利用.xlsx = Document\HotelPmsDB設計_利用.xlsx
+ Document\Memo.txt = Document\Memo.txt
+ Document\SystemCenterDB設計.xlsx = Document\SystemCenterDB設計.xlsx
+ Document\システム構成図.xlsx = Document\システム構成図.xlsx
+ EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Sql", "Sql", "{0E711F43-73E7-4577-B9CE-B8C4BED67BEC}"
+ ProjectSection(SolutionItems) = preProject
+ Document\Sql\Import HotelPms.sql = Document\Sql\Import HotelPms.sql
+ Document\Sql\Partition.sql = Document\Sql\Partition.sql
+ Document\Sql\列設定追加.sql = Document\Sql\列設定追加.sql
+ EndProjectSection
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HotelPms.GrpcService", "HotelPms.GrpcService\HotelPms.GrpcService.csproj", "{C61F1FEF-7578-43AC-8854-ACC46DC574ED}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HotelPms.Data.Server", "HotelPms.Data.Server\HotelPms.Data.Server.csproj", "{AF32E5F2-A28B-450E-8D73-49B48D6438F2}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HotelPms.Data.Client", "HotelPms.Data.Client\HotelPms.Data.Client.csproj", "{45A7A521-3531-47F4-83A8-2DD7E6A92D7D}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HotelPms.VerUp", "HotelPms.VerUp\HotelPms.VerUp.csproj", "{58F20DE1-74EC-47CB-A76F-FB6B88AAE64E}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HotelPms.Client.Blazor", "HotelPms.Client.Blazor\HotelPms.Client.Blazor.csproj", "{35BE81E7-EAFA-42C3-9FF1-0026654EB12C}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HotelPms.WinApp", "HotelPms.WinApp\HotelPms.WinApp.csproj", "{7511A6CE-81B9-4BFA-95EB-CEA24D631676}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HotelPms.WinForm.Common", "HotelPms.WinForm.Common\HotelPms.WinForm.Common.csproj", "{AF9ACEE4-CAEB-46FE-AEA3-1C44619E5B9F}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HotelPms.WinForm.Master", "HotelPms.WinForm.Master\HotelPms.WinForm.Master.csproj", "{91857DA5-D64A-49CB-B92B-16D85C306BF5}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HotelPms.WinForm", "HotelPms.WinForm\HotelPms.WinForm.csproj", "{67ADB8F7-2AAB-4081-8807-882A9A3F92ED}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HotelPms.DataAccessGrpc.Client", "HotelPms.DataAccessGrpc.Client\HotelPms.DataAccessGrpc.Client.csproj", "{FC70EB02-A771-490F-B802-1ACCD2E994FA}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HotelPms.DataAccessDirect.Client", "HotelPms.DataAccessDirect.Client\HotelPms.DataAccessDirect.Client.csproj", "{D3CAF4ED-BC0B-4461-BFC0-18ABC3918A88}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HotelPms.DataAccessDirect.Server", "HotelPms.DataAccessDirect.Server\HotelPms.DataAccessDirect.Server.csproj", "{DA82B272-0B00-4327-97CE-06328B12BD89}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Etc", "Etc", "{6C269D50-CC0C-4D54-9E6E-5410E539933F}"
+ ProjectSection(SolutionItems) = preProject
+ Document\Etc\Backup20220701.zip = Document\Etc\Backup20220701.zip
+ Document\Etc\列設定.png = Document\Etc\列設定.png
+ Document\Etc\部屋別一覧.png = Document\Etc\部屋別一覧.png
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {26472449-50A0-4C85-AD07-EC8078B17431}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {26472449-50A0-4C85-AD07-EC8078B17431}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {26472449-50A0-4C85-AD07-EC8078B17431}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {26472449-50A0-4C85-AD07-EC8078B17431}.Release|Any CPU.Build.0 = Release|Any CPU
+ {B371155C-0FE3-4DB8-8657-EE585576BA0D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B371155C-0FE3-4DB8-8657-EE585576BA0D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B371155C-0FE3-4DB8-8657-EE585576BA0D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B371155C-0FE3-4DB8-8657-EE585576BA0D}.Release|Any CPU.Build.0 = Release|Any CPU
+ {D1F45B8E-1A6F-40F6-9EDA-904A32A8E6BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {D1F45B8E-1A6F-40F6-9EDA-904A32A8E6BF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {D1F45B8E-1A6F-40F6-9EDA-904A32A8E6BF}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {D1F45B8E-1A6F-40F6-9EDA-904A32A8E6BF}.Release|Any CPU.Build.0 = Release|Any CPU
+ {95C3BC9D-8974-4F0C-897E-EAC42127A4F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {95C3BC9D-8974-4F0C-897E-EAC42127A4F2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {95C3BC9D-8974-4F0C-897E-EAC42127A4F2}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {95C3BC9D-8974-4F0C-897E-EAC42127A4F2}.Release|Any CPU.Build.0 = Release|Any CPU
+ {C61F1FEF-7578-43AC-8854-ACC46DC574ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C61F1FEF-7578-43AC-8854-ACC46DC574ED}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {C61F1FEF-7578-43AC-8854-ACC46DC574ED}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {C61F1FEF-7578-43AC-8854-ACC46DC574ED}.Release|Any CPU.Build.0 = Release|Any CPU
+ {AF32E5F2-A28B-450E-8D73-49B48D6438F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {AF32E5F2-A28B-450E-8D73-49B48D6438F2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {AF32E5F2-A28B-450E-8D73-49B48D6438F2}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {AF32E5F2-A28B-450E-8D73-49B48D6438F2}.Release|Any CPU.Build.0 = Release|Any CPU
+ {45A7A521-3531-47F4-83A8-2DD7E6A92D7D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {45A7A521-3531-47F4-83A8-2DD7E6A92D7D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {45A7A521-3531-47F4-83A8-2DD7E6A92D7D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {45A7A521-3531-47F4-83A8-2DD7E6A92D7D}.Release|Any CPU.Build.0 = Release|Any CPU
+ {58F20DE1-74EC-47CB-A76F-FB6B88AAE64E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {58F20DE1-74EC-47CB-A76F-FB6B88AAE64E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {58F20DE1-74EC-47CB-A76F-FB6B88AAE64E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {58F20DE1-74EC-47CB-A76F-FB6B88AAE64E}.Release|Any CPU.Build.0 = Release|Any CPU
+ {35BE81E7-EAFA-42C3-9FF1-0026654EB12C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {35BE81E7-EAFA-42C3-9FF1-0026654EB12C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {35BE81E7-EAFA-42C3-9FF1-0026654EB12C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {35BE81E7-EAFA-42C3-9FF1-0026654EB12C}.Release|Any CPU.Build.0 = Release|Any CPU
+ {7511A6CE-81B9-4BFA-95EB-CEA24D631676}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {7511A6CE-81B9-4BFA-95EB-CEA24D631676}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {7511A6CE-81B9-4BFA-95EB-CEA24D631676}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {7511A6CE-81B9-4BFA-95EB-CEA24D631676}.Release|Any CPU.Build.0 = Release|Any CPU
+ {AF9ACEE4-CAEB-46FE-AEA3-1C44619E5B9F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {AF9ACEE4-CAEB-46FE-AEA3-1C44619E5B9F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {AF9ACEE4-CAEB-46FE-AEA3-1C44619E5B9F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {AF9ACEE4-CAEB-46FE-AEA3-1C44619E5B9F}.Release|Any CPU.Build.0 = Release|Any CPU
+ {91857DA5-D64A-49CB-B92B-16D85C306BF5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {91857DA5-D64A-49CB-B92B-16D85C306BF5}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {91857DA5-D64A-49CB-B92B-16D85C306BF5}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {91857DA5-D64A-49CB-B92B-16D85C306BF5}.Release|Any CPU.Build.0 = Release|Any CPU
+ {67ADB8F7-2AAB-4081-8807-882A9A3F92ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {67ADB8F7-2AAB-4081-8807-882A9A3F92ED}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {67ADB8F7-2AAB-4081-8807-882A9A3F92ED}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {67ADB8F7-2AAB-4081-8807-882A9A3F92ED}.Release|Any CPU.Build.0 = Release|Any CPU
+ {FC70EB02-A771-490F-B802-1ACCD2E994FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {FC70EB02-A771-490F-B802-1ACCD2E994FA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {FC70EB02-A771-490F-B802-1ACCD2E994FA}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {FC70EB02-A771-490F-B802-1ACCD2E994FA}.Release|Any CPU.Build.0 = Release|Any CPU
+ {D3CAF4ED-BC0B-4461-BFC0-18ABC3918A88}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {D3CAF4ED-BC0B-4461-BFC0-18ABC3918A88}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {D3CAF4ED-BC0B-4461-BFC0-18ABC3918A88}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {D3CAF4ED-BC0B-4461-BFC0-18ABC3918A88}.Release|Any CPU.Build.0 = Release|Any CPU
+ {DA82B272-0B00-4327-97CE-06328B12BD89}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {DA82B272-0B00-4327-97CE-06328B12BD89}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {DA82B272-0B00-4327-97CE-06328B12BD89}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {DA82B272-0B00-4327-97CE-06328B12BD89}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(NestedProjects) = preSolution
+ {0E711F43-73E7-4577-B9CE-B8C4BED67BEC} = {4AD9E991-8D1A-4175-8E3C-75C964525382}
+ {6C269D50-CC0C-4D54-9E6E-5410E539933F} = {4AD9E991-8D1A-4175-8E3C-75C964525382}
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {48E7DAF6-831D-49A6-A520-E75D97B8DF52}
+ EndGlobalSection
+EndGlobal
diff --git a/MudBlazorTemplates1/App.razor b/MudBlazorTemplates1/App.razor
new file mode 100644
index 0000000..b80db76
--- /dev/null
+++ b/MudBlazorTemplates1/App.razor
@@ -0,0 +1,11 @@
+<Router AppAssembly="@typeof(App).Assembly">
+ <Found Context="routeData">
+ <RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
+ </Found>
+ <NotFound>
+ <PageTitle>Not found</PageTitle>
+ <LayoutView Layout="@typeof(MainLayout)">
+ <p role="alert">Sorry, there's nothing at this address.</p>
+ </LayoutView>
+ </NotFound>
+</Router>
\ No newline at end of file
diff --git a/MudBlazorTemplates1/MudBlazorTemplates1.csproj b/MudBlazorTemplates1/MudBlazorTemplates1.csproj
new file mode 100644
index 0000000..25d1674
--- /dev/null
+++ b/MudBlazorTemplates1/MudBlazorTemplates1.csproj
@@ -0,0 +1,20 @@
+<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
+
+ <PropertyGroup>
+ <TargetFramework>net7.0</TargetFramework>
+ <Nullable>enable</Nullable>
+ <ImplicitUsings>enable</ImplicitUsings>
+ <ServiceWorkerAssetsManifest>service-worker-assets.js</ServiceWorkerAssetsManifest>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.10" />
+ <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.10" PrivateAssets="all" />
+ <PackageReference Include="MudBlazor" Version="6.8.0" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <ServiceWorker Include="wwwroot\service-worker.js" PublishedContent="wwwroot\service-worker.published.js" />
+ </ItemGroup>
+
+</Project>
diff --git a/MudBlazorTemplates1/MudBlazorTemplates1.sln b/MudBlazorTemplates1/MudBlazorTemplates1.sln
new file mode 100644
index 0000000..778f2a4
--- /dev/null
+++ b/MudBlazorTemplates1/MudBlazorTemplates1.sln
@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.0.31717.71
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MudBlazorTemplates1", "MudBlazorTemplates1.csproj", "{0E04C512-21CB-4078-AD67-9256AD1DC1A7}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {0E04C512-21CB-4078-AD67-9256AD1DC1A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {0E04C512-21CB-4078-AD67-9256AD1DC1A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {0E04C512-21CB-4078-AD67-9256AD1DC1A7}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {0E04C512-21CB-4078-AD67-9256AD1DC1A7}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {EB0B4BDF-A5D8-42E8-B302-9EC0FE6F7BE1}
+ EndGlobalSection
+EndGlobal
\ No newline at end of file
diff --git a/MudBlazorTemplates1/Pages/Counter.razor b/MudBlazorTemplates1/Pages/Counter.razor
new file mode 100644
index 0000000..0cc164c
--- /dev/null
+++ b/MudBlazorTemplates1/Pages/Counter.razor
@@ -0,0 +1,17 @@
+@page "/counter"
+
+<PageTitle>Counter</PageTitle>
+
+<MudText Typo="Typo.h3" GutterBottom="true">Counter</MudText>
+<MudText Class="mb-4">Current count: @currentCount</MudText>
+<MudButton Color="Color.Primary" Variant="Variant.Filled" @onclick="IncrementCount">Click me</MudButton>
+
+
+@code {
+ private int currentCount = 0;
+
+ private void IncrementCount()
+ {
+ currentCount++;
+ }
+}
diff --git a/MudBlazorTemplates1/Pages/FetchData.razor b/MudBlazorTemplates1/Pages/FetchData.razor
new file mode 100644
index 0000000..b97ff64
--- /dev/null
+++ b/MudBlazorTemplates1/Pages/FetchData.razor
@@ -0,0 +1,52 @@
+@page "/fetchdata"
+@inject HttpClient Http
+@using MudBlazorTemplates1.Shared
+
+<PageTitle>Weather forecast</PageTitle>
+
+<MudText Typo="Typo.h3" GutterBottom="true">Weather forecast</MudText>
+<MudText Class="mb-8">This component demonstrates fetching data from the server.</MudText>
+@if (forecasts == null)
+{
+ <MudProgressCircular Color="Color.Default" Indeterminate="true" />
+}
+else
+{
+ <MudTable Items="forecasts" Hover="true" SortLabel="Sort By" Elevation="0">
+ <HeaderContent>
+ <MudTh><MudTableSortLabel InitialDirection="SortDirection.Ascending" SortBy="new Func<WeatherForecast, object>(x=>x.Date)">Date</MudTableSortLabel></MudTh>
+ <MudTh><MudTableSortLabel SortBy="new Func<WeatherForecast, object>(x=>x.TemperatureC)">Temp. (C)</MudTableSortLabel></MudTh>
+ <MudTh><MudTableSortLabel SortBy="new Func<WeatherForecast, object>(x=>x.TemperatureF)">Temp. (F)</MudTableSortLabel></MudTh>
+ <MudTh><MudTableSortLabel SortBy="new Func<WeatherForecast, object>(x=>x.Summary!)">Summary</MudTableSortLabel></MudTh>
+ </HeaderContent>
+ <RowTemplate>
+ <MudTd DataLabel="Date">@context.Date</MudTd>
+ <MudTd DataLabel="Temp. (C)">@context.TemperatureC</MudTd>
+ <MudTd DataLabel="Temp. (F)">@context.TemperatureF</MudTd>
+ <MudTd DataLabel="Summary">@context.Summary</MudTd>
+ </RowTemplate>
+ <PagerContent>
+ <MudTablePager PageSizeOptions="new int[]{50, 100}" />
+ </PagerContent>
+ </MudTable>
+}
+
+
+@code {
+ private WeatherForecast[]? forecasts;
+
+ protected override async Task OnInitializedAsync()
+ {
+ forecasts = await Http.GetFromJsonAsync<WeatherForecast[]>("sample-data/weather.json");
+ }
+ public class WeatherForecast
+ {
+ public DateTime Date { get; set; }
+
+ public int TemperatureC { get; set; }
+
+ public string? Summary { get; set; }
+
+ public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
+ }
+}
diff --git a/MudBlazorTemplates1/Pages/Index.razor b/MudBlazorTemplates1/Pages/Index.razor
new file mode 100644
index 0000000..7994d54
--- /dev/null
+++ b/MudBlazorTemplates1/Pages/Index.razor
@@ -0,0 +1,7 @@
+@page "/"
+
+<PageTitle>Index</PageTitle>
+
+<MudText Typo="Typo.h3" GutterBottom="true">Hello, world!</MudText>
+<MudText Class="mb-8">Welcome to your new app, powered by MudBlazor!</MudText>
+<MudAlert Severity="Severity.Normal">You can find documentation and examples on our website here: <MudLink Href="https://mudblazor.com" Typo="Typo.body2" Color="Color.Inherit"><b>www.mudblazor.com</b></MudLink></MudAlert>
diff --git a/MudBlazorTemplates1/Program.cs b/MudBlazorTemplates1/Program.cs
new file mode 100644
index 0000000..d408eb3
--- /dev/null
+++ b/MudBlazorTemplates1/Program.cs
@@ -0,0 +1,13 @@
+using Microsoft.AspNetCore.Components.Web;
+using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
+using MudBlazor.Services;
+using MudBlazorTemplates1;
+
+var builder = WebAssemblyHostBuilder.CreateDefault(args);
+builder.RootComponents.Add<App>("#app");
+builder.RootComponents.Add<HeadOutlet>("head::after");
+
+builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
+builder.Services.AddMudServices();
+
+await builder.Build().RunAsync();
diff --git a/MudBlazorTemplates1/Properties/launchSettings.json b/MudBlazorTemplates1/Properties/launchSettings.json
new file mode 100644
index 0000000..bb34c40
--- /dev/null
+++ b/MudBlazorTemplates1/Properties/launchSettings.json
@@ -0,0 +1,30 @@
+{
+ "iisSettings": {
+ "windowsAuthentication": false,
+ "anonymousAuthentication": true,
+ "iisExpress": {
+ "applicationUrl": "http://localhost:65283",
+ "sslPort": 44398
+ }
+ },
+ "profiles": {
+ "IIS Express": {
+ "commandName": "IISExpress",
+ "launchBrowser": true,
+ "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ },
+ "Mudblazor.Template": {
+ "commandName": "Project",
+ "dotnetRunMessages": "true",
+ "launchBrowser": true,
+ "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
+ "applicationUrl": "https://localhost:5001;http://localhost:5000",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ }
+ }
+}
diff --git a/MudBlazorTemplates1/Shared/MainLayout.razor b/MudBlazorTemplates1/Shared/MainLayout.razor
new file mode 100644
index 0000000..e610ca0
--- /dev/null
+++ b/MudBlazorTemplates1/Shared/MainLayout.razor
@@ -0,0 +1,34 @@
+@inherits LayoutComponentBase
+
+<MudThemeProvider />
+<MudDialogProvider />
+<MudSnackbarProvider />
+
+<MudLayout>
+ <MudAppBar Elevation="0">
+ <MudIconButton Icon="@Icons.Material.Filled.Menu" Color="Color.Inherit" Edge="Edge.Start" OnClick="@((e) => DrawerToggle())" />
+ <MudSpacer />
+ <MudIconButton Icon="@Icons.Custom.Brands.MudBlazor" Color="Color.Inherit" Link="https://mudblazor.com/" Target="_blank" />
+ <MudIconButton Icon="@Icons.Custom.Brands.GitHub" Color="Color.Inherit" Link="https://github.com/MudBlazor/MudBlazor/" Target="_blank" />
+ </MudAppBar>
+ <MudDrawer @bind-Open="_drawerOpen" Elevation="1">
+ <MudDrawerHeader>
+ <MudText Typo="Typo.h6">MudBlazorTemplates1</MudText>
+ </MudDrawerHeader>
+ <NavMenu />
+ </MudDrawer>
+ <MudMainContent>
+ <MudContainer MaxWidth="MaxWidth.Large" Class="my-16 pt-16">
+ @Body
+ </MudContainer>
+ </MudMainContent>
+</MudLayout>
+
+@code {
+ bool _drawerOpen = true;
+
+ void DrawerToggle()
+ {
+ _drawerOpen = !_drawerOpen;
+ }
+}
\ No newline at end of file
diff --git a/MudBlazorTemplates1/Shared/NavMenu.razor b/MudBlazorTemplates1/Shared/NavMenu.razor
new file mode 100644
index 0000000..0772484
--- /dev/null
+++ b/MudBlazorTemplates1/Shared/NavMenu.razor
@@ -0,0 +1,5 @@
+<MudNavMenu>
+ <MudNavLink Href="" Match="NavLinkMatch.All" Icon="@Icons.Material.Filled.Home">Home</MudNavLink>
+ <MudNavLink Href="counter" Match="NavLinkMatch.Prefix" Icon="@Icons.Material.Filled.Add">Counter</MudNavLink>
+ <MudNavLink Href="fetchdata" Match="NavLinkMatch.Prefix" Icon="@Icons.Material.Filled.List">Fetch data</MudNavLink>
+</MudNavMenu>
diff --git a/MudBlazorTemplates1/_Imports.razor b/MudBlazorTemplates1/_Imports.razor
new file mode 100644
index 0000000..74b1e40
--- /dev/null
+++ b/MudBlazorTemplates1/_Imports.razor
@@ -0,0 +1,11 @@
+@using System.Net.Http
+@using System.Net.Http.Json
+@using Microsoft.AspNetCore.Components.Forms
+@using Microsoft.AspNetCore.Components.Routing
+@using Microsoft.AspNetCore.Components.Web
+@using Microsoft.AspNetCore.Components.Web.Virtualization
+@using Microsoft.AspNetCore.Components.WebAssembly.Http
+@using Microsoft.JSInterop
+@using MudBlazor
+@using MudBlazorTemplates1
+@using MudBlazorTemplates1.Shared
diff --git a/MudBlazorTemplates1/wwwroot/favicon.ico b/MudBlazorTemplates1/wwwroot/favicon.ico
new file mode 100644
index 0000000..1239223
--- /dev/null
+++ b/MudBlazorTemplates1/wwwroot/favicon.ico
Binary files differ
diff --git a/MudBlazorTemplates1/wwwroot/icon-512.png b/MudBlazorTemplates1/wwwroot/icon-512.png
new file mode 100644
index 0000000..59ab776
--- /dev/null
+++ b/MudBlazorTemplates1/wwwroot/icon-512.png
Binary files differ
diff --git a/MudBlazorTemplates1/wwwroot/index.html b/MudBlazorTemplates1/wwwroot/index.html
new file mode 100644
index 0000000..97af48a
--- /dev/null
+++ b/MudBlazorTemplates1/wwwroot/index.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
+ <title>MudBlazorTemplates1</title>
+ <base href="/" />
+ <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" rel="stylesheet" />
+ <link href="_content/MudBlazor/MudBlazor.min.css" rel="stylesheet" />
+ <link href="manifest.json" rel="manifest" />
+ <link rel="apple-touch-icon" sizes="512x512" href="icon-512.png" />
+</head>
+
+<body>
+ <div id="app">Loading...</div>
+
+ <div id="blazor-error-ui">
+ An unhandled error has occurred.
+ <a href="" class="reload">Reload</a>
+ <a class="dismiss">🗙</a>
+ </div>
+ <script src="_framework/blazor.webassembly.js"></script>
+ <script src="_content/MudBlazor/MudBlazor.min.js"></script>
+ <script>navigator.serviceWorker.register('service-worker.js');</script>
+</body>
+
+</html>
\ No newline at end of file
diff --git a/MudBlazorTemplates1/wwwroot/manifest.json b/MudBlazorTemplates1/wwwroot/manifest.json
new file mode 100644
index 0000000..d87c1f7
--- /dev/null
+++ b/MudBlazorTemplates1/wwwroot/manifest.json
@@ -0,0 +1,16 @@
+{
+ "name": "MudBlazorTemplates1",
+ "short_name": "MudBlazorTemplates1",
+ "start_url": "./",
+ "display": "standalone",
+ "background_color": "#ffffff",
+ "theme_color": "#03173d",
+ "prefer_related_applications": false,
+ "icons": [
+ {
+ "src": "icon-512.png",
+ "type": "image/png",
+ "sizes": "512x512"
+ }
+ ]
+}
diff --git a/MudBlazorTemplates1/wwwroot/sample-data/weather.json b/MudBlazorTemplates1/wwwroot/sample-data/weather.json
new file mode 100644
index 0000000..06463c0
--- /dev/null
+++ b/MudBlazorTemplates1/wwwroot/sample-data/weather.json
@@ -0,0 +1,27 @@
+[
+ {
+ "date": "2018-05-06",
+ "temperatureC": 1,
+ "summary": "Freezing"
+ },
+ {
+ "date": "2018-05-07",
+ "temperatureC": 14,
+ "summary": "Bracing"
+ },
+ {
+ "date": "2018-05-08",
+ "temperatureC": -13,
+ "summary": "Freezing"
+ },
+ {
+ "date": "2018-05-09",
+ "temperatureC": -16,
+ "summary": "Balmy"
+ },
+ {
+ "date": "2018-05-10",
+ "temperatureC": -2,
+ "summary": "Chilly"
+ }
+]
diff --git a/MudBlazorTemplates1/wwwroot/service-worker.js b/MudBlazorTemplates1/wwwroot/service-worker.js
new file mode 100644
index 0000000..fe614da
--- /dev/null
+++ b/MudBlazorTemplates1/wwwroot/service-worker.js
@@ -0,0 +1,4 @@
+// In development, always fetch from the network and do not enable offline support.
+// This is because caching would make development more difficult (changes would not
+// be reflected on the first load after each change).
+self.addEventListener('fetch', () => { });
diff --git a/MudBlazorTemplates1/wwwroot/service-worker.published.js b/MudBlazorTemplates1/wwwroot/service-worker.published.js
new file mode 100644
index 0000000..0d9986f
--- /dev/null
+++ b/MudBlazorTemplates1/wwwroot/service-worker.published.js
@@ -0,0 +1,48 @@
+// Caution! Be sure you understand the caveats before publishing an application with
+// offline support. See https://aka.ms/blazor-offline-considerations
+
+self.importScripts('./service-worker-assets.js');
+self.addEventListener('install', event => event.waitUntil(onInstall(event)));
+self.addEventListener('activate', event => event.waitUntil(onActivate(event)));
+self.addEventListener('fetch', event => event.respondWith(onFetch(event)));
+
+const cacheNamePrefix = 'offline-cache-';
+const cacheName = `${cacheNamePrefix}${self.assetsManifest.version}`;
+const offlineAssetsInclude = [ /\.dll$/, /\.pdb$/, /\.wasm/, /\.html/, /\.js$/, /\.json$/, /\.css$/, /\.woff$/, /\.png$/, /\.jpe?g$/, /\.gif$/, /\.ico$/, /\.blat$/, /\.dat$/ ];
+const offlineAssetsExclude = [ /^service-worker\.js$/ ];
+
+async function onInstall(event) {
+ console.info('Service worker: Install');
+
+ // Fetch and cache all matching items from the assets manifest
+ const assetsRequests = self.assetsManifest.assets
+ .filter(asset => offlineAssetsInclude.some(pattern => pattern.test(asset.url)))
+ .filter(asset => !offlineAssetsExclude.some(pattern => pattern.test(asset.url)))
+ .map(asset => new Request(asset.url, { integrity: asset.hash, cache: 'no-cache' }));
+ await caches.open(cacheName).then(cache => cache.addAll(assetsRequests));
+}
+
+async function onActivate(event) {
+ console.info('Service worker: Activate');
+
+ // Delete unused caches
+ const cacheKeys = await caches.keys();
+ await Promise.all(cacheKeys
+ .filter(key => key.startsWith(cacheNamePrefix) && key !== cacheName)
+ .map(key => caches.delete(key)));
+}
+
+async function onFetch(event) {
+ let cachedResponse = null;
+ if (event.request.method === 'GET') {
+ // For all navigation requests, try to serve index.html from cache
+ // If you need some URLs to be server-rendered, edit the following check to exclude those URLs
+ const shouldServeIndexHtml = event.request.mode === 'navigate';
+
+ const request = shouldServeIndexHtml ? 'index.html' : event.request;
+ const cache = await caches.open(cacheName);
+ cachedResponse = await cache.match(request);
+ }
+
+ return cachedResponse || fetch(event.request);
+}
diff --git a/Protos/arrange.proto b/Protos/arrange.proto
new file mode 100644
index 0000000..9bd953f
--- /dev/null
+++ b/Protos/arrange.proto
@@ -0,0 +1,51 @@
+syntax = "proto3";
+
+import "datarequest.proto";
+import "dataresult.proto";
+import "sqlwhere.proto";
+import "file.proto";
+import "customTypes.proto";
+
+package HotelPms.Data.UseInfo;
+
+message Arrange {
+ int32 ID = 1;
+ int32 DetailID = 2;
+ customTypes.Date UseDate = 3;
+ int32 TraderID = 4;
+ int32 SubID = 5;
+ int32 SaleID = 6;
+ int32 Status = 7;
+ customTypes.Date AcceptDate = 8;
+ int32 AcceptStuffID = 9;
+ customTypes.Date FinishDate = 10;
+ int32 FinishStuffID = 11;
+ int32 Amount = 12;
+ string FixturesID = 13;
+ string Memo = 14;
+}
+
+message ArrangeTable {
+ int32 ErrNo = 1;
+ string ErrData = 2;
+ string Name = 3;
+ int32 UpdateType = 4; //0.なし 1.Insert 2.Update
+ string Tag = 5;
+ bytes BeforeUpdate = 6;
+ bytes AfterUpdate = 7;
+ repeated Arrange Rows = 8;
+}
+
+service ArrangeCore {
+ rpc GetData (HotelPms.Data.DataRequest) returns (ArrangeTable);
+ rpc SetData (ArrangeTable) returns (HotelPms.Data.DataResult);
+ rpc Add (Arrange) returns (HotelPms.Data.DataResult);
+ rpc Update (Arrange) returns (HotelPms.Data.DataResult);
+ rpc Remove (HotelPms.Data.SqlWhere) returns (HotelPms.Data.DataResult);
+ rpc GetDataStream (stream HotelPms.Data.DataRequest) returns (stream ArrangeTable);
+ rpc SetDataStream (stream ArrangeTable) returns (stream HotelPms.Data.DataResult);
+ rpc AddStream (stream Arrange) returns (stream HotelPms.Data.DataResult);
+ rpc UpdateStream (stream Arrange) returns (stream HotelPms.Data.DataResult);
+ rpc RemoveStream (stream HotelPms.Data.SqlWhere) returns (stream HotelPms.Data.DataResult);
+ rpc OutputStream (HotelPms.Data.DataRequest) returns (stream HotelPms.Data.FileGrpcData);
+}
\ No newline at end of file
diff --git a/Protos/building.proto b/Protos/building.proto
new file mode 100644
index 0000000..02e6c81
--- /dev/null
+++ b/Protos/building.proto
@@ -0,0 +1,53 @@
+syntax = "proto3";
+
+import "datarequest.proto";
+import "dataresult.proto";
+import "sqlwhere.proto";
+import "file.proto";
+import "google/protobuf/timestamp.proto";
+
+
+package HotelPms.Data.Master;
+
+message Building {
+ int32 ID = 1;
+ string Name = 2;
+ string ShortName = 3;
+ string ZipCode = 4;
+ string Prefecture = 5;
+ string Address2 = 6;
+ string Address3 = 7;
+ string Address4 = 8;
+ string Tel = 9;
+ string Fax = 10;
+ google.protobuf.Timestamp UpdateDate = 11;
+ int32 UpdateLoginID = 12;
+ string UpdatePcName = 13;
+ int32 UpdateID = 14;
+
+}
+
+message BuildingTable {
+ int32 ErrNo = 1;
+ string ErrData = 2;
+ string Name = 3;
+ int32 UpdateType = 4; //0.なし 1.Insert 2.Update
+ string Tag = 5;
+ bytes BeforeUpdate = 6;
+ bytes AfterUpdate = 7;
+ repeated Building Rows = 8;
+}
+
+service BuildingCore {
+ rpc GetData (HotelPms.Data.DataRequest) returns (BuildingTable);
+ rpc SetData (BuildingTable) returns (HotelPms.Data.DataResult);
+ rpc Add (Building) returns (HotelPms.Data.DataResult);
+ rpc Update (Building) returns (HotelPms.Data.DataResult);
+ rpc Remove (HotelPms.Data.SqlWhere) returns (HotelPms.Data.DataResult);
+ rpc GetDataStream (stream HotelPms.Data.DataRequest) returns (stream BuildingTable);
+ rpc SetDataStream (stream BuildingTable) returns (stream HotelPms.Data.DataResult);
+ rpc AddStream (stream Building) returns (stream HotelPms.Data.DataResult);
+ rpc UpdateStream (stream Building) returns (stream HotelPms.Data.DataResult);
+ rpc RemoveStream (stream HotelPms.Data.SqlWhere) returns (stream HotelPms.Data.DataResult);
+ rpc OutputStream (HotelPms.Data.DataRequest) returns (stream HotelPms.Data.FileGrpcData);
+}
\ No newline at end of file
diff --git a/Protos/customTypes.proto b/Protos/customTypes.proto
new file mode 100644
index 0000000..5c3f3cc
--- /dev/null
+++ b/Protos/customTypes.proto
@@ -0,0 +1,21 @@
+syntax = "proto3";
+
+option csharp_namespace = "customTypes";
+
+package customTypes;
+
+// Example: 12345.6789 -> { units = 12345, nanos = 678900000 }
+message DecimalValue {
+
+ // Whole units part of the amount
+ int64 units = 1;
+
+ // Nano units of the amount (10^-9)
+ // Must be same sign as units
+ sfixed32 nanos = 2;
+}
+
+// 日付型: yyyyMMdd
+message Date {
+ int32 Value = 1;
+}
\ No newline at end of file
diff --git a/Protos/datarequest.proto b/Protos/datarequest.proto
new file mode 100644
index 0000000..439f166
--- /dev/null
+++ b/Protos/datarequest.proto
@@ -0,0 +1,17 @@
+syntax = "proto3";
+
+package HotelPms.Data;
+
+message DataRequest {
+ string CustomerID = 1;
+ string LoginID = 2;
+ string Password = 3;
+ int32 SystemID = 4;
+ int32 ActionType = 5; //各自Serviceの解釈
+ int32 DataType = 6; //Dataの拡張用
+ string Data = 7;
+ string RefTables = 8;
+ string MachineName = 9;
+ string IP = 10;
+ string OS = 11;
+}
diff --git a/Protos/dataresult.proto b/Protos/dataresult.proto
new file mode 100644
index 0000000..4072d8b
--- /dev/null
+++ b/Protos/dataresult.proto
@@ -0,0 +1,8 @@
+syntax = "proto3";
+
+package HotelPms.Data;
+
+message DataResult {
+ int32 ErrNo = 1;
+ string ErrData = 2;
+}
diff --git a/Protos/demo.proto b/Protos/demo.proto
new file mode 100644
index 0000000..99fc439
--- /dev/null
+++ b/Protos/demo.proto
@@ -0,0 +1,49 @@
+syntax = "proto3";
+
+import "datarequest.proto";
+import "dataresult.proto";
+import "sqlwhere.proto";
+import "file.proto";
+import "google/protobuf/timestamp.proto";
+import "customTypes.proto";
+
+package HotelPms.Data.Master;
+
+message Demo {
+ int32 ID = 1;
+ string Name = 2;
+ int32 FInt = 3;
+ int32 FTinyInt = 4;
+ int32 FSmallInt = 5;
+ float FFloat = 6;
+ bool FBit = 7;
+ customTypes.DecimalValue FDecimal = 8;
+ customTypes.Date FDate = 9;
+ google.protobuf.Timestamp UpdateDate = 10;
+ int32 UpdateID = 11;
+}
+
+message DemoTable {
+ int32 ErrNo = 1;
+ string ErrData = 2;
+ string Name = 3;
+ int32 UpdateType = 4; //0.なし 1.Insert 2.Update
+ string Tag = 5;
+ bytes BeforeUpdate = 6;
+ bytes AfterUpdate = 7;
+ repeated Demo Rows = 8;
+}
+
+service DemoCore {
+ rpc GetData (HotelPms.Data.DataRequest) returns (DemoTable);
+ rpc SetData (DemoTable) returns (HotelPms.Data.DataResult);
+ rpc Add (Demo) returns (HotelPms.Data.DataResult);
+ rpc Update (Demo) returns (HotelPms.Data.DataResult);
+ rpc Remove (HotelPms.Data.SqlWhere) returns (HotelPms.Data.DataResult);
+ rpc GetDataStream (stream HotelPms.Data.DataRequest) returns (stream DemoTable);
+ rpc SetDataStream (stream DemoTable) returns (stream HotelPms.Data.DataResult);
+ rpc AddStream (stream Demo) returns (stream HotelPms.Data.DataResult);
+ rpc UpdateStream (stream Demo) returns (stream HotelPms.Data.DataResult);
+ rpc RemoveStream (stream HotelPms.Data.SqlWhere) returns (stream HotelPms.Data.DataResult);
+ rpc OutputStream (HotelPms.Data.DataRequest) returns (stream HotelPms.Data.FileGrpcData);
+}
\ No newline at end of file
diff --git a/Protos/file.proto b/Protos/file.proto
new file mode 100644
index 0000000..1424b43
--- /dev/null
+++ b/Protos/file.proto
@@ -0,0 +1,19 @@
+syntax = "proto3";
+
+package HotelPms.Data;
+
+message FileGrpcHead {
+ string FileName = 1;
+ int64 Size = 2;
+}
+
+message FileGrpcData {
+ string FileName = 1;
+ int32 Block = 2;
+ bytes Content = 3;
+}
+
+service FileCore {
+ rpc DownLoad (FileGrpcHead) returns (stream FileGrpcData);
+ rpc UpLoad (stream FileGrpcData) returns(FileGrpcHead);
+}
diff --git a/Protos/greet.proto b/Protos/greet.proto
new file mode 100644
index 0000000..11f80c2
--- /dev/null
+++ b/Protos/greet.proto
@@ -0,0 +1,19 @@
+syntax = "proto3";
+
+package HotelPms.Data;
+
+// The greeting service definition.
+service Greeter {
+ // Sends a greeting
+ rpc SayHello (HelloRequest) returns (HelloReply);
+}
+
+// The request message containing the user's name.
+message HelloRequest {
+ string name = 1;
+}
+
+// The response message containing the greetings.
+message HelloReply {
+ string message = 1;
+}
diff --git a/Protos/grpcdict.proto b/Protos/grpcdict.proto
new file mode 100644
index 0000000..67555e8
--- /dev/null
+++ b/Protos/grpcdict.proto
@@ -0,0 +1,12 @@
+syntax = "proto3";
+
+package GinBow.Data;
+
+message GrpcPair {
+ string Key = 1;
+ string Value = 2;
+}
+
+message GrpcDict {
+ repeated GrpcPair Items = 1;
+}
diff --git a/Protos/grpcset.proto b/Protos/grpcset.proto
new file mode 100644
index 0000000..bd0363f
--- /dev/null
+++ b/Protos/grpcset.proto
@@ -0,0 +1,19 @@
+syntax = "proto3";
+
+import "grpctable.proto";
+import "datarequest.proto";
+import "dataresult.proto";
+
+package HotelPms.Data;
+
+message GrpcSet {
+ int32 ErrNo = 1;
+ string ErrData = 2;
+ repeated GrpcTable Tables = 3;
+}
+
+service GrpcSetCore {
+ rpc GetData (DataRequest) returns (GrpcSet);
+ rpc GetDataStream (stream DataRequest) returns (stream GrpcSet);
+ rpc SetData (stream GrpcSet) returns (stream DataResult);
+}
\ No newline at end of file
diff --git a/Protos/grpctable.proto b/Protos/grpctable.proto
new file mode 100644
index 0000000..6064303
--- /dev/null
+++ b/Protos/grpctable.proto
@@ -0,0 +1,34 @@
+syntax = "proto3";
+
+import "datarequest.proto";
+import "dataresult.proto";
+
+package HotelPms.Data;
+
+message GrpcCol {
+ string Name = 1;
+ int32 FieldType = 2;
+ bool PrimaryKey = 3;
+}
+
+message GrpcRow {
+ bytes Data = 1;
+}
+
+message GrpcTable {
+ int32 ErrNo = 1;
+ string ErrData = 2;
+ string Name = 3;
+ int32 UpdateType = 4; //0.なし 1.Insert 2.Update
+ bytes BeforeUpdate = 5;
+ bytes AfterUpdate = 6;
+ repeated GrpcCol Cols = 7;
+ repeated GrpcRow Rows = 8;
+}
+
+service GrpcTableCore {
+ rpc GetData (DataRequest) returns (GrpcTable);
+ rpc GetDataStream (stream DataRequest) returns (stream GrpcTable);
+ rpc SetData (stream GrpcTable) returns (stream DataResult);
+}
+
diff --git a/Protos/hotel.proto b/Protos/hotel.proto
new file mode 100644
index 0000000..a90f52f
--- /dev/null
+++ b/Protos/hotel.proto
@@ -0,0 +1,54 @@
+syntax = "proto3";
+
+import "datarequest.proto";
+import "dataresult.proto";
+import "sqlwhere.proto";
+import "file.proto";
+
+import "customTypes.proto";
+
+package HotelPms.Data.Master;
+
+message Hotel {
+ int32 ID = 1;
+ string Name = 2;
+ customTypes.Date HotelDate = 3;
+ int32 RoomCount = 4;
+ string ZipCode = 5;
+ string Prefecture = 6;
+ string Address2 = 7;
+ string Address3 = 8;
+ string Address4 = 9;
+ string Tel = 10;
+ string Fax = 11;
+ int32 StartDate = 12;
+ customTypes.Date CreateDate = 13;
+ customTypes.Date SumDate = 14;
+ int32 CloseDate = 15;
+
+}
+
+message HotelTable {
+ int32 ErrNo = 1;
+ string ErrData = 2;
+ string Name = 3;
+ int32 UpdateType = 4; //0.なし 1.Insert 2.Update
+ string Tag = 5;
+ bytes BeforeUpdate = 6;
+ bytes AfterUpdate = 7;
+ repeated Hotel Rows = 8;
+}
+
+service HotelCore {
+ rpc GetData (HotelPms.Data.DataRequest) returns (HotelTable);
+ rpc SetData (HotelTable) returns (HotelPms.Data.DataResult);
+ rpc Add (Hotel) returns (HotelPms.Data.DataResult);
+ rpc Update (Hotel) returns (HotelPms.Data.DataResult);
+ rpc Remove (HotelPms.Data.SqlWhere) returns (HotelPms.Data.DataResult);
+ rpc GetDataStream (stream HotelPms.Data.DataRequest) returns (stream HotelTable);
+ rpc SetDataStream (stream HotelTable) returns (stream HotelPms.Data.DataResult);
+ rpc AddStream (stream Hotel) returns (stream HotelPms.Data.DataResult);
+ rpc UpdateStream (stream Hotel) returns (stream HotelPms.Data.DataResult);
+ rpc RemoveStream (stream HotelPms.Data.SqlWhere) returns (stream HotelPms.Data.DataResult);
+ rpc OutputStream (HotelPms.Data.DataRequest) returns (stream HotelPms.Data.FileGrpcData);
+}
\ No newline at end of file
diff --git a/Protos/item.proto b/Protos/item.proto
new file mode 100644
index 0000000..949a029
--- /dev/null
+++ b/Protos/item.proto
@@ -0,0 +1,87 @@
+syntax = "proto3";
+
+import "datarequest.proto";
+import "dataresult.proto";
+import "sqlwhere.proto";
+import "file.proto";
+import "google/protobuf/timestamp.proto";
+import "customTypes.proto";
+
+package HotelPms.Data.Master;
+
+message Item {
+ string ID = 1;
+ string Name = 2;
+ string EnName = 3;
+ string Name2 = 4;
+ string ReceiptName = 5;
+ int32 RoomTypeID = 6;
+ int32 PersonCount = 7;
+ customTypes.DecimalValue Price = 8;
+ customTypes.DecimalValue DiscountRate = 9;
+ customTypes.DecimalValue DiscountSummary = 10;
+ int32 DiscountID = 11;
+ int32 ServiceIOType = 12;
+ customTypes.DecimalValue ServiceRate = 13;
+ int32 TaxType = 14;
+ int32 TaxIOType = 15;
+ int32 BathTaxIOType = 16;
+ int32 AccTaxIOType = 17;
+ int32 SaleSectionID = 18;
+ int32 SumSectionID = 19;
+ int32 Kind = 20;
+ bool NextDay = 21;
+ int32 AgentID = 22;
+ int32 AgentBranchID = 23;
+ bool PointFlg = 24;
+ bool PointInTax = 25;
+ customTypes.DecimalValue PointRate = 26;
+ int32 PointPrice = 27;
+ int32 PointSumType = 28;
+ int32 Point = 29;
+ bool DayUse = 30;
+ int32 ReceiptPrtType = 31;
+ bool LongStayFlg = 32;
+ int32 RentalType = 33;
+ int32 TraderID = 34;
+ string TraderMemo = 35;
+ bool PackFlg = 36;
+ int32 SortID = 37;
+ int32 Fraction = 38;
+ bool InRoomSales = 39;
+ int32 MealType = 40;
+ int32 UseType = 41;
+ int32 PersonType = 42;
+ bool Parking = 43;
+ bool HallFee = 44;
+ google.protobuf.Timestamp UpdateDate = 45;
+ int32 UpdateLoginID = 46;
+ string UpdatePcName = 47;
+ int32 UpdateID = 48;
+
+}
+
+message ItemTable {
+ int32 ErrNo = 1;
+ string ErrData = 2;
+ string Name = 3;
+ int32 UpdateType = 4; //0.なし 1.Insert 2.Update
+ string Tag = 5;
+ bytes BeforeUpdate = 6;
+ bytes AfterUpdate = 7;
+ repeated Item Rows = 8;
+}
+
+service ItemCore {
+ rpc GetData (HotelPms.Data.DataRequest) returns (ItemTable);
+ rpc SetData (ItemTable) returns (HotelPms.Data.DataResult);
+ rpc Add (Item) returns (HotelPms.Data.DataResult);
+ rpc Update (Item) returns (HotelPms.Data.DataResult);
+ rpc Remove (HotelPms.Data.SqlWhere) returns (HotelPms.Data.DataResult);
+ rpc GetDataStream (stream HotelPms.Data.DataRequest) returns (stream ItemTable);
+ rpc SetDataStream (stream ItemTable) returns (stream HotelPms.Data.DataResult);
+ rpc AddStream (stream Item) returns (stream HotelPms.Data.DataResult);
+ rpc UpdateStream (stream Item) returns (stream HotelPms.Data.DataResult);
+ rpc RemoveStream (stream HotelPms.Data.SqlWhere) returns (stream HotelPms.Data.DataResult);
+ rpc OutputStream (HotelPms.Data.DataRequest) returns (stream HotelPms.Data.FileGrpcData);
+}
\ No newline at end of file
diff --git a/Protos/loginresult.proto b/Protos/loginresult.proto
new file mode 100644
index 0000000..58ac2a2
--- /dev/null
+++ b/Protos/loginresult.proto
@@ -0,0 +1,17 @@
+syntax = "proto3";
+
+import "datarequest.proto";
+
+package HotelPms.Data;
+
+message LoginResult {
+ int32 ErrNo = 1;
+ string ErrData = 2;
+ string AccessToKen = 3;
+ string RefreshToKen = 4;
+}
+
+service AuthCore {
+ rpc Login (HotelPms.Data.DataRequest) returns (LoginResult);
+ rpc Logout (HotelPms.Data.DataRequest) returns (LoginResult);
+}
\ No newline at end of file
diff --git a/Protos/option.proto b/Protos/option.proto
new file mode 100644
index 0000000..cd9acef
--- /dev/null
+++ b/Protos/option.proto
@@ -0,0 +1,42 @@
+syntax = "proto3";
+
+import "datarequest.proto";
+import "dataresult.proto";
+import "sqlwhere.proto";
+import "file.proto";
+
+
+
+package HotelPms.Data.Master;
+
+message Option {
+ string Type = 1;
+ string Key = 2;
+ string Value = 3;
+
+}
+
+message OptionTable {
+ int32 ErrNo = 1;
+ string ErrData = 2;
+ string Name = 3;
+ int32 UpdateType = 4; //0.なし 1.Insert 2.Update
+ string Tag = 5;
+ bytes BeforeUpdate = 6;
+ bytes AfterUpdate = 7;
+ repeated Option Rows = 8;
+}
+
+service OptionCore {
+ rpc GetData (HotelPms.Data.DataRequest) returns (OptionTable);
+ rpc SetData (OptionTable) returns (HotelPms.Data.DataResult);
+ rpc Add (Option) returns (HotelPms.Data.DataResult);
+ rpc Update (Option) returns (HotelPms.Data.DataResult);
+ rpc Remove (HotelPms.Data.SqlWhere) returns (HotelPms.Data.DataResult);
+ rpc GetDataStream (stream HotelPms.Data.DataRequest) returns (stream OptionTable);
+ rpc SetDataStream (stream OptionTable) returns (stream HotelPms.Data.DataResult);
+ rpc AddStream (stream Option) returns (stream HotelPms.Data.DataResult);
+ rpc UpdateStream (stream Option) returns (stream HotelPms.Data.DataResult);
+ rpc RemoveStream (stream HotelPms.Data.SqlWhere) returns (stream HotelPms.Data.DataResult);
+ rpc OutputStream (HotelPms.Data.DataRequest) returns (stream HotelPms.Data.FileGrpcData);
+}
\ No newline at end of file
diff --git a/Protos/output.proto b/Protos/output.proto
new file mode 100644
index 0000000..4a891f2
--- /dev/null
+++ b/Protos/output.proto
@@ -0,0 +1,53 @@
+syntax = "proto3";
+
+import "datarequest.proto";
+import "dataresult.proto";
+import "sqlwhere.proto";
+import "file.proto";
+import "google/protobuf/timestamp.proto";
+import "outputitem.proto";
+
+package HotelPms.Data.Master;
+
+message Output {
+ string MachineName = 1;
+ string UserName = 2;
+ int32 ReportID = 3;
+ int32 ID = 4;
+ string Name = 5;
+ int32 FixedID = 6;
+ string Sort = 7;
+ string Tag = 8;
+ google.protobuf.Timestamp UpdateDate = 9;
+ int32 UpdateLoginID = 10;
+ string UpdatePcName = 11;
+ int32 UpdateID = 12;
+ repeated OutputItem Items = 13;
+ map<string, string> FieldMap = 14;
+ map<int32, string> SelectList = 15;
+}
+
+message OutputTable {
+ int32 ErrNo = 1;
+ string ErrData = 2;
+ string Name = 3;
+ int32 UpdateType = 4; //0.なし 1.Insert 2.Update
+ string Tag = 5;
+ bytes BeforeUpdate = 6;
+ bytes AfterUpdate = 7;
+ repeated Output Rows = 8;
+}
+
+service OutputCore {
+ rpc GetData (HotelPms.Data.DataRequest) returns (OutputTable);
+ rpc SetData (OutputTable) returns (HotelPms.Data.DataResult);
+ rpc Add (Output) returns (HotelPms.Data.DataResult);
+ rpc Update (Output) returns (HotelPms.Data.DataResult);
+ rpc Remove (HotelPms.Data.SqlWhere) returns (HotelPms.Data.DataResult);
+ rpc GetDataStream (stream HotelPms.Data.DataRequest) returns (stream OutputTable);
+ rpc SetDataStream (stream OutputTable) returns (stream HotelPms.Data.DataResult);
+ rpc AddStream (stream Output) returns (stream HotelPms.Data.DataResult);
+ rpc UpdateStream (stream Output) returns (stream HotelPms.Data.DataResult);
+ rpc RemoveStream (stream HotelPms.Data.SqlWhere) returns (stream HotelPms.Data.DataResult);
+ rpc OutputStream (HotelPms.Data.DataRequest) returns (stream HotelPms.Data.FileGrpcData);
+}
\ No newline at end of file
diff --git a/Protos/outputitem.proto b/Protos/outputitem.proto
new file mode 100644
index 0000000..d9078b6
--- /dev/null
+++ b/Protos/outputitem.proto
@@ -0,0 +1,47 @@
+syntax = "proto3";
+
+import "datarequest.proto";
+import "dataresult.proto";
+import "sqlwhere.proto";
+import "file.proto";
+
+
+
+package HotelPms.Data.Master;
+
+message OutputItem {
+ string MachineName = 1;
+ string UserName = 2;
+ int32 ReportID = 3;
+ int32 OutputID = 4;
+ int32 ID = 5;
+ string Name = 6;
+ float Width = 7;
+ string Tag = 8;
+
+}
+
+message OutputItemTable {
+ int32 ErrNo = 1;
+ string ErrData = 2;
+ string Name = 3;
+ int32 UpdateType = 4; //0.なし 1.Insert 2.Update
+ string Tag = 5;
+ bytes BeforeUpdate = 6;
+ bytes AfterUpdate = 7;
+ repeated OutputItem Rows = 8;
+}
+
+service OutputItemCore {
+ rpc GetData (HotelPms.Data.DataRequest) returns (OutputItemTable);
+ rpc SetData (OutputItemTable) returns (HotelPms.Data.DataResult);
+ rpc Add (OutputItem) returns (HotelPms.Data.DataResult);
+ rpc Update (OutputItem) returns (HotelPms.Data.DataResult);
+ rpc Remove (HotelPms.Data.SqlWhere) returns (HotelPms.Data.DataResult);
+ rpc GetDataStream (stream HotelPms.Data.DataRequest) returns (stream OutputItemTable);
+ rpc SetDataStream (stream OutputItemTable) returns (stream HotelPms.Data.DataResult);
+ rpc AddStream (stream OutputItem) returns (stream HotelPms.Data.DataResult);
+ rpc UpdateStream (stream OutputItem) returns (stream HotelPms.Data.DataResult);
+ rpc RemoveStream (stream HotelPms.Data.SqlWhere) returns (stream HotelPms.Data.DataResult);
+ rpc OutputStream (HotelPms.Data.DataRequest) returns (stream HotelPms.Data.FileGrpcData);
+}
\ No newline at end of file
diff --git a/Protos/pay.proto b/Protos/pay.proto
new file mode 100644
index 0000000..27b87d4
--- /dev/null
+++ b/Protos/pay.proto
@@ -0,0 +1,54 @@
+syntax = "proto3";
+
+import "datarequest.proto";
+import "dataresult.proto";
+import "sqlwhere.proto";
+import "file.proto";
+import "customTypes.proto";
+
+package HotelPms.Data.UseInfo;
+
+message Pay {
+ int32 ID = 1;
+ int32 DetailID = 2;
+ customTypes.Date UseDate = 3;
+ int32 PayID = 4;
+ int32 ReceiptID = 5;
+ int32 PayType = 6;
+ string ItemID = 7;
+ string ItemName = 8;
+ customTypes.DecimalValue PaySummary = 9;
+ int32 PackSaleID = 10;
+ string ReceiptItemName = 11;
+ int32 ReceiptPrtType = 12;
+ int32 ReceiptPage = 13;
+ int32 AgentID = 14;
+ int32 AgentBranchID = 15;
+ int32 CustomerID = 16;
+
+}
+
+message PayTable {
+ int32 ErrNo = 1;
+ string ErrData = 2;
+ string Name = 3;
+ int32 UpdateType = 4; //0.なし 1.Insert 2.Update
+ string Tag = 5;
+ bytes BeforeUpdate = 6;
+ bytes AfterUpdate = 7;
+ repeated Pay Rows = 8;
+}
+
+service PayCore {
+ rpc GetData (HotelPms.Data.DataRequest) returns (PayTable);
+ rpc SetData (PayTable) returns (HotelPms.Data.DataResult);
+ rpc Add (Pay) returns (HotelPms.Data.DataResult);
+ rpc Update (Pay) returns (HotelPms.Data.DataResult);
+ rpc Remove (HotelPms.Data.SqlWhere) returns (HotelPms.Data.DataResult);
+ rpc GetDataStream (stream HotelPms.Data.DataRequest) returns (stream PayTable);
+ rpc SetDataStream (stream PayTable) returns (stream HotelPms.Data.DataResult);
+ rpc AddStream (stream Pay) returns (stream HotelPms.Data.DataResult);
+ rpc UpdateStream (stream Pay) returns (stream HotelPms.Data.DataResult);
+ rpc RemoveStream (stream HotelPms.Data.SqlWhere) returns (stream HotelPms.Data.DataResult);
+ rpc OutputStream (HotelPms.Data.DataRequest) returns (stream HotelPms.Data.FileGrpcData);
+}
\ No newline at end of file
diff --git a/Protos/paydiv.proto b/Protos/paydiv.proto
new file mode 100644
index 0000000..0eca740
--- /dev/null
+++ b/Protos/paydiv.proto
@@ -0,0 +1,49 @@
+syntax = "proto3";
+
+import "datarequest.proto";
+import "dataresult.proto";
+import "sqlwhere.proto";
+import "file.proto";
+import "google/protobuf/timestamp.proto";
+import "customTypes.proto";
+
+package HotelPms.Data.UseInfo;
+
+message PayDiv {
+ int32 ID = 1;
+ int32 DetailID = 2;
+ google.protobuf.Timestamp UseDate = 3;
+ int32 PayID = 4;
+ int32 RowNo = 5;
+ int32 ReceiptID = 6;
+ customTypes.DecimalValue PaySummary = 7;
+ int32 SaleRowNo = 8;
+ int32 ReceiptPrtType = 9;
+ int32 ReceiptPage = 10;
+
+}
+
+message PayDivTable {
+ int32 ErrNo = 1;
+ string ErrData = 2;
+ string Name = 3;
+ int32 UpdateType = 4; //0.なし 1.Insert 2.Update
+ string Tag = 5;
+ bytes BeforeUpdate = 6;
+ bytes AfterUpdate = 7;
+ repeated PayDiv Rows = 8;
+}
+
+service PayDivCore {
+ rpc GetData (HotelPms.Data.DataRequest) returns (PayDivTable);
+ rpc SetData (PayDivTable) returns (HotelPms.Data.DataResult);
+ rpc Add (PayDiv) returns (HotelPms.Data.DataResult);
+ rpc Update (PayDiv) returns (HotelPms.Data.DataResult);
+ rpc Remove (HotelPms.Data.SqlWhere) returns (HotelPms.Data.DataResult);
+ rpc GetDataStream (stream HotelPms.Data.DataRequest) returns (stream PayDivTable);
+ rpc SetDataStream (stream PayDivTable) returns (stream HotelPms.Data.DataResult);
+ rpc AddStream (stream PayDiv) returns (stream HotelPms.Data.DataResult);
+ rpc UpdateStream (stream PayDiv) returns (stream HotelPms.Data.DataResult);
+ rpc RemoveStream (stream HotelPms.Data.SqlWhere) returns (stream HotelPms.Data.DataResult);
+ rpc OutputStream (HotelPms.Data.DataRequest) returns (stream HotelPms.Data.FileGrpcData);
+}
\ No newline at end of file
diff --git a/Protos/receipt.proto b/Protos/receipt.proto
new file mode 100644
index 0000000..6d268a0
--- /dev/null
+++ b/Protos/receipt.proto
@@ -0,0 +1,64 @@
+syntax = "proto3";
+
+import "datarequest.proto";
+import "dataresult.proto";
+import "sqlwhere.proto";
+import "file.proto";
+import "google/protobuf/timestamp.proto";
+import "customTypes.proto";
+package HotelPms.Data.UseInfo;
+
+message Receipt {
+ int32 ID = 1;
+ int32 ReceiptID = 2;
+ int32 PersonID = 3;
+ int32 ReceiptNo = 4;
+ int32 IssueStatus = 5;
+ google.protobuf.Timestamp IssueDate = 6;
+ int32 IssueCount = 7;
+ int32 IssuePageCount = 8;
+ string Name = 9;
+ int32 LanguageType = 10;
+ int32 DivID = 11;
+ customTypes.Date UseDate = 12;
+ int32 CorpID = 13;
+ int32 CustomerID = 14;
+ int32 PayKind = 15;
+ int32 Person = 16;
+ int32 RoomID = 17;
+ string VoidReason = 18;
+ customTypes.DecimalValue TotalSummary = 19;
+ customTypes.DecimalValue PaySummary = 20;
+ customTypes.DecimalValue Summary = 21;
+ customTypes.DecimalValue ServiceSummary = 22;
+ customTypes.DecimalValue TaxSummary = 23;
+ customTypes.DecimalValue BathTaxSummary = 24;
+ customTypes.DecimalValue AccTaxSummary = 25;
+ customTypes.DecimalValue DiscountSummary = 26;
+
+}
+
+message ReceiptTable {
+ int32 ErrNo = 1;
+ string ErrData = 2;
+ string Name = 3;
+ int32 UpdateType = 4; //0.なし 1.Insert 2.Update
+ string Tag = 5;
+ bytes BeforeUpdate = 6;
+ bytes AfterUpdate = 7;
+ repeated Receipt Rows = 8;
+}
+
+service ReceiptCore {
+ rpc GetData (HotelPms.Data.DataRequest) returns (ReceiptTable);
+ rpc SetData (ReceiptTable) returns (HotelPms.Data.DataResult);
+ rpc Add (Receipt) returns (HotelPms.Data.DataResult);
+ rpc Update (Receipt) returns (HotelPms.Data.DataResult);
+ rpc Remove (HotelPms.Data.SqlWhere) returns (HotelPms.Data.DataResult);
+ rpc GetDataStream (stream HotelPms.Data.DataRequest) returns (stream ReceiptTable);
+ rpc SetDataStream (stream ReceiptTable) returns (stream HotelPms.Data.DataResult);
+ rpc AddStream (stream Receipt) returns (stream HotelPms.Data.DataResult);
+ rpc UpdateStream (stream Receipt) returns (stream HotelPms.Data.DataResult);
+ rpc RemoveStream (stream HotelPms.Data.SqlWhere) returns (stream HotelPms.Data.DataResult);
+ rpc OutputStream (HotelPms.Data.DataRequest) returns (stream HotelPms.Data.FileGrpcData);
+}
\ No newline at end of file
diff --git a/Protos/rental.proto b/Protos/rental.proto
new file mode 100644
index 0000000..ad81720
--- /dev/null
+++ b/Protos/rental.proto
@@ -0,0 +1,45 @@
+syntax = "proto3";
+
+import "datarequest.proto";
+import "dataresult.proto";
+import "sqlwhere.proto";
+import "file.proto";
+import "customTypes.proto";
+
+package HotelPms.Data.UseInfo;
+
+message Rental {
+ int32 ID = 1;
+ int32 DetailID = 2;
+ customTypes.Date BeginDate = 3;
+ string FixturesID = 4;
+ int32 Amount = 5;
+ customTypes.Date ReturnPlanDate = 6;
+ bool ReturnStatus = 7;
+ int32 ReturnStuffID = 8;
+}
+
+message RentalTable {
+ int32 ErrNo = 1;
+ string ErrData = 2;
+ string Name = 3;
+ int32 UpdateType = 4; //0.なし 1.Insert 2.Update
+ string Tag = 5;
+ bytes BeforeUpdate = 6;
+ bytes AfterUpdate = 7;
+ repeated Rental Rows = 8;
+}
+
+service RentalCore {
+ rpc GetData (HotelPms.Data.DataRequest) returns (RentalTable);
+ rpc SetData (RentalTable) returns (HotelPms.Data.DataResult);
+ rpc Add (Rental) returns (HotelPms.Data.DataResult);
+ rpc Update (Rental) returns (HotelPms.Data.DataResult);
+ rpc Remove (HotelPms.Data.SqlWhere) returns (HotelPms.Data.DataResult);
+ rpc GetDataStream (stream HotelPms.Data.DataRequest) returns (stream RentalTable);
+ rpc SetDataStream (stream RentalTable) returns (stream HotelPms.Data.DataResult);
+ rpc AddStream (stream Rental) returns (stream HotelPms.Data.DataResult);
+ rpc UpdateStream (stream Rental) returns (stream HotelPms.Data.DataResult);
+ rpc RemoveStream (stream HotelPms.Data.SqlWhere) returns (stream HotelPms.Data.DataResult);
+ rpc OutputStream (HotelPms.Data.DataRequest) returns (stream HotelPms.Data.FileGrpcData);
+}
\ No newline at end of file
diff --git a/Protos/reportcol.proto b/Protos/reportcol.proto
new file mode 100644
index 0000000..d5f515f
--- /dev/null
+++ b/Protos/reportcol.proto
@@ -0,0 +1,40 @@
+syntax = "proto3";
+
+import "datarequest.proto";
+import "dataresult.proto";
+import "sqlwhere.proto";
+
+package HotelPms.Data.Master;
+
+message ReportCol {
+ int32 SystemID = 1;
+ int32 ReportID = 2;
+ int32 ID = 3;
+ string Name = 4;
+ int32 Type = 5;
+ string DispName = 6;
+
+}
+
+message ReportColTable {
+ int32 ErrNo = 1;
+ string ErrData = 2;
+ string Name = 3;
+ int32 UpdateType = 4; //0.なし 1.Insert 2.Update
+ bytes BeforeUpdate = 5;
+ bytes AfterUpdate = 6;
+ repeated ReportCol Rows = 7;
+}
+
+service ReportColCore {
+ rpc GetData (HotelPms.Data.DataRequest) returns (ReportColTable);
+ rpc SetData (ReportColTable) returns ( HotelPms.Data.DataResult);
+ rpc Add (ReportCol) returns ( HotelPms.Data.DataResult);
+ rpc Update (ReportCol) returns ( HotelPms.Data.DataResult);
+ rpc Remove (HotelPms.Data.SqlWhere) returns ( HotelPms.Data.DataResult);
+ rpc GetDataStream (stream HotelPms.Data.DataRequest) returns (stream ReportColTable);
+ rpc SetDataStream (stream ReportColTable) returns (stream HotelPms.Data.DataResult);
+ rpc AddStream (stream ReportCol) returns (stream HotelPms.Data.DataResult);
+ rpc UpdateStream (stream ReportCol) returns (stream HotelPms.Data.DataResult);
+ rpc RemoveStream (stream HotelPms.Data.SqlWhere) returns (stream HotelPms.Data.DataResult);
+}
\ No newline at end of file
diff --git a/Protos/roomcell.proto b/Protos/roomcell.proto
new file mode 100644
index 0000000..1aca14d
--- /dev/null
+++ b/Protos/roomcell.proto
@@ -0,0 +1,57 @@
+syntax = "proto3";
+
+import "datarequest.proto";
+import "dataresult.proto";
+import "sqlwhere.proto";
+import "file.proto";
+
+
+
+package HotelPms.Data.Master;
+
+message RoomCell {
+ int32 TabID = 1;
+ string CtrlName = 2;
+ int32 ID = 3;
+ string Content = 4;
+ int32 TextAlign = 5;
+ float Top = 6;
+ float Left = 7;
+ float Width = 8;
+ float Heigh = 9;
+ string BackColor = 10;
+ string ForeColor = 11;
+ int32 BorderStyle = 12;
+ string FontName = 13;
+ int32 FontSize = 14;
+ bool FontBold = 15;
+ bool FontItalic = 16;
+ bool FontUnderline = 17;
+ string Memo = 18;
+
+}
+
+message RoomCellTable {
+ int32 ErrNo = 1;
+ string ErrData = 2;
+ string Name = 3;
+ int32 UpdateType = 4; //0.なし 1.Insert 2.Update
+ string Tag = 5;
+ bytes BeforeUpdate = 6;
+ bytes AfterUpdate = 7;
+ repeated RoomCell Rows = 8;
+}
+
+service RoomCellCore {
+ rpc GetData (HotelPms.Data.DataRequest) returns (RoomCellTable);
+ rpc SetData (RoomCellTable) returns (HotelPms.Data.DataResult);
+ rpc Add (RoomCell) returns (HotelPms.Data.DataResult);
+ rpc Update (RoomCell) returns (HotelPms.Data.DataResult);
+ rpc Remove (HotelPms.Data.SqlWhere) returns (HotelPms.Data.DataResult);
+ rpc GetDataStream (stream HotelPms.Data.DataRequest) returns (stream RoomCellTable);
+ rpc SetDataStream (stream RoomCellTable) returns (stream HotelPms.Data.DataResult);
+ rpc AddStream (stream RoomCell) returns (stream HotelPms.Data.DataResult);
+ rpc UpdateStream (stream RoomCell) returns (stream HotelPms.Data.DataResult);
+ rpc RemoveStream (stream HotelPms.Data.SqlWhere) returns (stream HotelPms.Data.DataResult);
+ rpc OutputStream (HotelPms.Data.DataRequest) returns (stream HotelPms.Data.FileGrpcData);
+}
\ No newline at end of file
diff --git a/Protos/roomstatus.proto b/Protos/roomstatus.proto
new file mode 100644
index 0000000..53447a2
--- /dev/null
+++ b/Protos/roomstatus.proto
@@ -0,0 +1,53 @@
+syntax = "proto3";
+
+import "datarequest.proto";
+import "dataresult.proto";
+import "sqlwhere.proto";
+import "file.proto";
+import "google/protobuf/timestamp.proto";
+
+
+package HotelPms.Data.Master;
+
+message RoomStatus {
+ int32 ID = 1;
+ string Name = 2;
+ string ShortName = 3;
+ string EnName = 4;
+ int32 SortID = 5;
+ string ForeColor = 6;
+ string BackColor = 7;
+ int32 MaidType = 8;
+ bool Selectable = 9;
+ string Memo = 10;
+ google.protobuf.Timestamp UpdateDate = 11;
+ int32 UpdateLoginID = 12;
+ string UpdatePcName = 13;
+ int32 UpdateID = 14;
+
+}
+
+message RoomStatusTable {
+ int32 ErrNo = 1;
+ string ErrData = 2;
+ string Name = 3;
+ int32 UpdateType = 4; //0.なし 1.Insert 2.Update
+ string Tag = 5;
+ bytes BeforeUpdate = 6;
+ bytes AfterUpdate = 7;
+ repeated RoomStatus Rows = 8;
+}
+
+service RoomStatusCore {
+ rpc GetData (HotelPms.Data.DataRequest) returns (RoomStatusTable);
+ rpc SetData (RoomStatusTable) returns (HotelPms.Data.DataResult);
+ rpc Add (RoomStatus) returns (HotelPms.Data.DataResult);
+ rpc Update (RoomStatus) returns (HotelPms.Data.DataResult);
+ rpc Remove (HotelPms.Data.SqlWhere) returns (HotelPms.Data.DataResult);
+ rpc GetDataStream (stream HotelPms.Data.DataRequest) returns (stream RoomStatusTable);
+ rpc SetDataStream (stream RoomStatusTable) returns (stream HotelPms.Data.DataResult);
+ rpc AddStream (stream RoomStatus) returns (stream HotelPms.Data.DataResult);
+ rpc UpdateStream (stream RoomStatus) returns (stream HotelPms.Data.DataResult);
+ rpc RemoveStream (stream HotelPms.Data.SqlWhere) returns (stream HotelPms.Data.DataResult);
+ rpc OutputStream (HotelPms.Data.DataRequest) returns (stream HotelPms.Data.FileGrpcData);
+}
\ No newline at end of file
diff --git a/Protos/roomtype.proto b/Protos/roomtype.proto
new file mode 100644
index 0000000..6e5dfca
--- /dev/null
+++ b/Protos/roomtype.proto
@@ -0,0 +1,56 @@
+syntax = "proto3";
+
+import "datarequest.proto";
+import "dataresult.proto";
+import "sqlwhere.proto";
+import "file.proto";
+import "google/protobuf/timestamp.proto";
+
+
+package HotelPms.Data.Master;
+
+message RoomType {
+ int32 ID = 1;
+ string Name = 2;
+ string ShortName = 3;
+ int32 Kind = 4;
+ int32 SortID = 5;
+ bool Visible = 6;
+ bool TypeListVisible = 7;
+ int32 TypeListAlertCount = 8;
+ string TypeListAlertColor = 9;
+ string WebType = 10;
+ int32 SendRate = 11;
+ int32 SendLimit = 12;
+ string Memo = 13;
+ google.protobuf.Timestamp UpdateDate = 14;
+ int32 UpdateLoginID = 15;
+ string UpdatePcName = 16;
+ int32 UpdateID = 17;
+
+}
+
+message RoomTypeTable {
+ int32 ErrNo = 1;
+ string ErrData = 2;
+ string Name = 3;
+ int32 UpdateType = 4; //0.なし 1.Insert 2.Update
+ string Tag = 5;
+ bytes BeforeUpdate = 6;
+ bytes AfterUpdate = 7;
+ repeated RoomType Rows = 8;
+}
+
+service RoomTypeCore {
+ rpc GetData (HotelPms.Data.DataRequest) returns (RoomTypeTable);
+ rpc SetData (RoomTypeTable) returns (HotelPms.Data.DataResult);
+ rpc Add (RoomType) returns (HotelPms.Data.DataResult);
+ rpc Update (RoomType) returns (HotelPms.Data.DataResult);
+ rpc Remove (HotelPms.Data.SqlWhere) returns (HotelPms.Data.DataResult);
+ rpc GetDataStream (stream HotelPms.Data.DataRequest) returns (stream RoomTypeTable);
+ rpc SetDataStream (stream RoomTypeTable) returns (stream HotelPms.Data.DataResult);
+ rpc AddStream (stream RoomType) returns (stream HotelPms.Data.DataResult);
+ rpc UpdateStream (stream RoomType) returns (stream HotelPms.Data.DataResult);
+ rpc RemoveStream (stream HotelPms.Data.SqlWhere) returns (stream HotelPms.Data.DataResult);
+ rpc OutputStream (HotelPms.Data.DataRequest) returns (stream HotelPms.Data.FileGrpcData);
+}
\ No newline at end of file
diff --git a/Protos/roomviewlayout.proto b/Protos/roomviewlayout.proto
new file mode 100644
index 0000000..0dc7da3
--- /dev/null
+++ b/Protos/roomviewlayout.proto
@@ -0,0 +1,59 @@
+syntax = "proto3";
+
+import "datarequest.proto";
+import "dataresult.proto";
+import "sqlwhere.proto";
+import "file.proto";
+import "google/protobuf/timestamp.proto";
+
+
+package HotelPms.Data.Master;
+
+message RoomViewLayout {
+ int32 TabID = 1;
+ int32 Row = 2;
+ int32 Col = 3;
+ int32 RoomID = 4;
+ string DisplayName = 5;
+ int32 RowHeight = 6;
+ int32 ColWidth = 7;
+ string BackColor = 8;
+ string ForeColor = 9;
+ int32 Floor = 10;
+ string FontName = 11;
+ int32 FontSize = 12;
+ bool FontBold = 13;
+ bool FontItalic = 14;
+ bool FontUnderline = 15;
+ string TextAlign = 16;
+ google.protobuf.Timestamp UpdateDate = 17;
+ int32 UpdateLoginID = 18;
+ string UpdatePcName = 19;
+ int32 UpdateID = 20;
+
+}
+
+message RoomViewLayoutTable {
+ int32 ErrNo = 1;
+ string ErrData = 2;
+ string Name = 3;
+ int32 UpdateType = 4; //0.なし 1.Insert 2.Update
+ string Tag = 5;
+ bytes BeforeUpdate = 6;
+ bytes AfterUpdate = 7;
+ repeated RoomViewLayout Rows = 8;
+}
+
+service RoomViewLayoutCore {
+ rpc GetData (HotelPms.Data.DataRequest) returns (RoomViewLayoutTable);
+ rpc SetData (RoomViewLayoutTable) returns (HotelPms.Data.DataResult);
+ rpc Add (RoomViewLayout) returns (HotelPms.Data.DataResult);
+ rpc Update (RoomViewLayout) returns (HotelPms.Data.DataResult);
+ rpc Remove (HotelPms.Data.SqlWhere) returns (HotelPms.Data.DataResult);
+ rpc GetDataStream (stream HotelPms.Data.DataRequest) returns (stream RoomViewLayoutTable);
+ rpc SetDataStream (stream RoomViewLayoutTable) returns (stream HotelPms.Data.DataResult);
+ rpc AddStream (stream RoomViewLayout) returns (stream HotelPms.Data.DataResult);
+ rpc UpdateStream (stream RoomViewLayout) returns (stream HotelPms.Data.DataResult);
+ rpc RemoveStream (stream HotelPms.Data.SqlWhere) returns (stream HotelPms.Data.DataResult);
+ rpc OutputStream (HotelPms.Data.DataRequest) returns (stream HotelPms.Data.FileGrpcData);
+}
\ No newline at end of file
diff --git a/Protos/roomviewtab.proto b/Protos/roomviewtab.proto
new file mode 100644
index 0000000..fbaec5d
--- /dev/null
+++ b/Protos/roomviewtab.proto
@@ -0,0 +1,45 @@
+syntax = "proto3";
+
+import "datarequest.proto";
+import "dataresult.proto";
+import "sqlwhere.proto";
+import "file.proto";
+import "google/protobuf/timestamp.proto";
+
+
+package HotelPms.Data.Master;
+
+message RoomViewTab {
+ int32 ID = 1;
+ string Name = 2;
+ google.protobuf.Timestamp UpdateDate = 3;
+ int32 UpdateLoginID = 4;
+ string UpdatePcName = 5;
+ int32 UpdateID = 6;
+
+}
+
+message RoomViewTabTable {
+ int32 ErrNo = 1;
+ string ErrData = 2;
+ string Name = 3;
+ int32 UpdateType = 4; //0.なし 1.Insert 2.Update
+ string Tag = 5;
+ bytes BeforeUpdate = 6;
+ bytes AfterUpdate = 7;
+ repeated RoomViewTab Rows = 8;
+}
+
+service RoomViewTabCore {
+ rpc GetData (HotelPms.Data.DataRequest) returns (RoomViewTabTable);
+ rpc SetData (RoomViewTabTable) returns (HotelPms.Data.DataResult);
+ rpc Add (RoomViewTab) returns (HotelPms.Data.DataResult);
+ rpc Update (RoomViewTab) returns (HotelPms.Data.DataResult);
+ rpc Remove (HotelPms.Data.SqlWhere) returns (HotelPms.Data.DataResult);
+ rpc GetDataStream (stream HotelPms.Data.DataRequest) returns (stream RoomViewTabTable);
+ rpc SetDataStream (stream RoomViewTabTable) returns (stream HotelPms.Data.DataResult);
+ rpc AddStream (stream RoomViewTab) returns (stream HotelPms.Data.DataResult);
+ rpc UpdateStream (stream RoomViewTab) returns (stream HotelPms.Data.DataResult);
+ rpc RemoveStream (stream HotelPms.Data.SqlWhere) returns (stream HotelPms.Data.DataResult);
+ rpc OutputStream (HotelPms.Data.DataRequest) returns (stream HotelPms.Data.FileGrpcData);
+}
\ No newline at end of file
diff --git a/Protos/sale.proto b/Protos/sale.proto
new file mode 100644
index 0000000..1308b66
--- /dev/null
+++ b/Protos/sale.proto
@@ -0,0 +1,81 @@
+syntax = "proto3";
+
+import "datarequest.proto";
+import "dataresult.proto";
+import "sqlwhere.proto";
+import "file.proto";
+
+import "customTypes.proto";
+
+package HotelPms.Data.UseInfo;
+
+message Sale {
+ int32 ID = 1;
+ int32 DetailID = 2;
+ customTypes.Date UseDate = 3;
+ int32 SaleID = 4;
+ int32 ReceiptID = 5;
+ string ItemID = 6;
+ string ItemName = 7;
+ customTypes.DecimalValue Price = 8;
+ int32 Amount = 9;
+ customTypes.DecimalValue Summary = 10;
+ int32 ServiceIOType = 11;
+ customTypes.DecimalValue ServiceSummary = 12;
+ customTypes.DecimalValue ServiceRate = 13;
+ int32 TaxType = 14;
+ int32 TaxIOType = 15;
+ customTypes.DecimalValue TaxSummary = 16;
+ customTypes.DecimalValue TaxRate = 17;
+ int32 BathTaxIOType = 18;
+ int32 BathTaxType = 19;
+ customTypes.DecimalValue BathTaxUnitPrice = 20;
+ customTypes.DecimalValue BathTaxSummary = 21;
+ int32 AccTaxIOType = 22;
+ customTypes.DecimalValue AccTaxSummary = 23;
+ customTypes.DecimalValue TotalSummary = 24;
+ customTypes.DecimalValue DiscountRate = 25;
+ customTypes.DecimalValue DiscountSummary = 26;
+ int32 DiscountID = 27;
+ bool Pack = 28;
+ bool PackChild = 29;
+ int32 PackSaleID = 30;
+ int32 PersonType = 31;
+ int32 PersonCount = 32;
+ int32 InFemale = 33;
+ int32 UseType = 34;
+ int32 BaseAmount = 35;
+ bool PersonRef = 36;
+ string ReceiptItemName = 37;
+ int32 ReceiptPrtType = 38;
+ int32 ReceiptPage = 39;
+ int32 SrcType = 40;
+ string FixturesID = 41;
+ int32 ItemKind = 42;
+
+}
+
+message SaleTable {
+ int32 ErrNo = 1;
+ string ErrData = 2;
+ string Name = 3;
+ int32 UpdateType = 4; //0.なし 1.Insert 2.Update
+ string Tag = 5;
+ bytes BeforeUpdate = 6;
+ bytes AfterUpdate = 7;
+ repeated Sale Rows = 8;
+}
+
+service SaleCore {
+ rpc GetData (HotelPms.Data.DataRequest) returns (SaleTable);
+ rpc SetData (SaleTable) returns (HotelPms.Data.DataResult);
+ rpc Add (Sale) returns (HotelPms.Data.DataResult);
+ rpc Update (Sale) returns (HotelPms.Data.DataResult);
+ rpc Remove (HotelPms.Data.SqlWhere) returns (HotelPms.Data.DataResult);
+ rpc GetDataStream (stream HotelPms.Data.DataRequest) returns (stream SaleTable);
+ rpc SetDataStream (stream SaleTable) returns (stream HotelPms.Data.DataResult);
+ rpc AddStream (stream Sale) returns (stream HotelPms.Data.DataResult);
+ rpc UpdateStream (stream Sale) returns (stream HotelPms.Data.DataResult);
+ rpc RemoveStream (stream HotelPms.Data.SqlWhere) returns (stream HotelPms.Data.DataResult);
+ rpc OutputStream (HotelPms.Data.DataRequest) returns (stream HotelPms.Data.FileGrpcData);
+}
\ No newline at end of file
diff --git a/Protos/salediv.proto b/Protos/salediv.proto
new file mode 100644
index 0000000..21dd2ef
--- /dev/null
+++ b/Protos/salediv.proto
@@ -0,0 +1,56 @@
+syntax = "proto3";
+
+import "datarequest.proto";
+import "dataresult.proto";
+import "sqlwhere.proto";
+import "file.proto";
+import "google/protobuf/timestamp.proto";
+import "customTypes.proto";
+
+package HotelPms.Data.UseInfo;
+
+message SaleDiv {
+ int32 ID = 1;
+ int32 DetailID = 2;
+ google.protobuf.Timestamp UseDate = 3;
+ int32 SaleID = 4;
+ int32 RowNo = 5;
+ int32 ReceiptID = 6;
+ customTypes.DecimalValue Price = 7;
+ int32 Amount = 8;
+ customTypes.DecimalValue Summary = 9;
+ customTypes.DecimalValue ServiceSummary = 10;
+ customTypes.DecimalValue TaxSummary = 11;
+ customTypes.DecimalValue BathTaxSummary = 12;
+ customTypes.DecimalValue AccTaxSummary = 13;
+ customTypes.DecimalValue TotalSummary = 14;
+ customTypes.DecimalValue DiscountSummary = 15;
+ int32 ReceiptPrtType = 16;
+ int32 ReceiptPage = 17;
+
+}
+
+message SaleDivTable {
+ int32 ErrNo = 1;
+ string ErrData = 2;
+ string Name = 3;
+ int32 UpdateType = 4; //0.なし 1.Insert 2.Update
+ string Tag = 5;
+ bytes BeforeUpdate = 6;
+ bytes AfterUpdate = 7;
+ repeated SaleDiv Rows = 8;
+}
+
+service SaleDivCore {
+ rpc GetData (HotelPms.Data.DataRequest) returns (SaleDivTable);
+ rpc SetData (SaleDivTable) returns (HotelPms.Data.DataResult);
+ rpc Add (SaleDiv) returns (HotelPms.Data.DataResult);
+ rpc Update (SaleDiv) returns (HotelPms.Data.DataResult);
+ rpc Remove (HotelPms.Data.SqlWhere) returns (HotelPms.Data.DataResult);
+ rpc GetDataStream (stream HotelPms.Data.DataRequest) returns (stream SaleDivTable);
+ rpc SetDataStream (stream SaleDivTable) returns (stream HotelPms.Data.DataResult);
+ rpc AddStream (stream SaleDiv) returns (stream HotelPms.Data.DataResult);
+ rpc UpdateStream (stream SaleDiv) returns (stream HotelPms.Data.DataResult);
+ rpc RemoveStream (stream HotelPms.Data.SqlWhere) returns (stream HotelPms.Data.DataResult);
+ rpc OutputStream (HotelPms.Data.DataRequest) returns (stream HotelPms.Data.FileGrpcData);
+}
\ No newline at end of file
diff --git a/Protos/sqlwhere.proto b/Protos/sqlwhere.proto
new file mode 100644
index 0000000..05c8188
--- /dev/null
+++ b/Protos/sqlwhere.proto
@@ -0,0 +1,7 @@
+syntax = "proto3";
+
+package HotelPms.Data;
+
+message SqlWhere {
+ bytes Data = 1;
+}
diff --git a/Protos/use.proto b/Protos/use.proto
new file mode 100644
index 0000000..8be7705
--- /dev/null
+++ b/Protos/use.proto
@@ -0,0 +1,48 @@
+syntax = "proto3";
+
+import "datarequest.proto";
+import "dataresult.proto";
+import "useperson.proto";
+import "usedetail.proto";
+import "usememo.proto";
+import "usefree.proto";
+import "google/protobuf/timestamp.proto";
+import "customTypes.proto";
+
+package HotelPms.Data.UseInfo;
+
+message Use {
+ int32 ID = 1;
+ int32 DetailID = 2;
+ int32 ResvType = 3;
+ int32 GroupType = 4;
+ string GroupName = 5;
+ string GroupKana = 6;
+ int32 ReceiptPrtWay = 7;
+ int32 PayWay = 8;
+ customTypes.Date CancelHotelDate = 9;
+ google.protobuf.Timestamp CancelDate = 10;
+ int32 CancelLoginID = 11;
+ string CancelName = 12;
+ string CancelReason = 13;
+ google.protobuf.Timestamp CreateDate = 14;
+ int32 CreateLoginID = 15;
+ string CreatePcName = 16;
+ int32 CreateClass = 17;
+ google.protobuf.Timestamp UpdateDate = 18;
+ int32 UpdateLoginID = 19;
+ string UpdatePcName = 20;
+ int32 UpdateClass = 21;
+ int32 UpdateID = 22;
+ repeated UsePerson PersonlList = 23;
+ repeated UseDetail DetailList = 24;
+ repeated UseMemo MemoList = 25;
+ repeated UseFree FreeList = 26;
+}
+
+service UseCore {
+ rpc GetData (HotelPms.Data.DataRequest) returns (Use);
+ rpc SetData (Use) returns (HotelPms.Data.DataResult);
+ rpc GetDataStream (stream HotelPms.Data.DataRequest) returns (stream Use);
+ rpc SetDataStream (stream Use) returns (stream HotelPms.Data.DataResult);
+}
\ No newline at end of file
diff --git a/Protos/useallo.proto b/Protos/useallo.proto
new file mode 100644
index 0000000..9807bb0
--- /dev/null
+++ b/Protos/useallo.proto
@@ -0,0 +1,42 @@
+syntax = "proto3";
+
+import "datarequest.proto";
+import "dataresult.proto";
+import "sqlwhere.proto";
+import "file.proto";
+import "customTypes.proto";
+
+package HotelPms.Data.UseInfo;
+
+message UseAllo {
+ int32 ID = 1;
+ int32 DetailID = 2;
+ customTypes.Date UseDate = 3;
+ int32 PersonID = 4;
+
+}
+
+message UseAlloTable {
+ int32 ErrNo = 1;
+ string ErrData = 2;
+ string Name = 3;
+ int32 UpdateType = 4; //0.なし 1.Insert 2.Update
+ string Tag = 5;
+ bytes BeforeUpdate = 6;
+ bytes AfterUpdate = 7;
+ repeated UseAllo Rows = 8;
+}
+
+service UseAlloCore {
+ rpc GetData (HotelPms.Data.DataRequest) returns (UseAlloTable);
+ rpc SetData (UseAlloTable) returns (HotelPms.Data.DataResult);
+ rpc Add (UseAllo) returns (HotelPms.Data.DataResult);
+ rpc Update (UseAllo) returns (HotelPms.Data.DataResult);
+ rpc Remove (HotelPms.Data.SqlWhere) returns (HotelPms.Data.DataResult);
+ rpc GetDataStream (stream HotelPms.Data.DataRequest) returns (stream UseAlloTable);
+ rpc SetDataStream (stream UseAlloTable) returns (stream HotelPms.Data.DataResult);
+ rpc AddStream (stream UseAllo) returns (stream HotelPms.Data.DataResult);
+ rpc UpdateStream (stream UseAllo) returns (stream HotelPms.Data.DataResult);
+ rpc RemoveStream (stream HotelPms.Data.SqlWhere) returns (stream HotelPms.Data.DataResult);
+ rpc OutputStream (HotelPms.Data.DataRequest) returns (stream HotelPms.Data.FileGrpcData);
+}
\ No newline at end of file
diff --git a/Protos/usedetail.proto b/Protos/usedetail.proto
new file mode 100644
index 0000000..57350a7
--- /dev/null
+++ b/Protos/usedetail.proto
@@ -0,0 +1,79 @@
+syntax = "proto3";
+
+import "datarequest.proto";
+import "dataresult.proto";
+import "sqlwhere.proto";
+import "file.proto";
+import "google/protobuf/timestamp.proto";
+import "usememo.proto";
+import "usefree.proto";
+import "useroom.proto";
+import "rental.proto";
+import "customTypes.proto";
+
+package HotelPms.Data.UseInfo;
+
+message UseDetail {
+ int32 ID = 1;
+ int32 DetailID = 2;
+ int32 UseStatus = 3;
+ int32 SubStatus = 4;
+ int32 ExtenStatus = 5;
+ customTypes.Date CinDate = 6;
+ int32 CinTime = 7;
+ int32 Stay = 8;
+ customTypes.Date CoutDate = 9;
+ int32 CoutTime = 10;
+ int32 AgentID = 11;
+ int32 AgentBranchID = 12;
+ string ResvNo = 13;
+ google.protobuf.Timestamp ResvDate = 14;
+ customTypes.Date ResvHotelDate = 15;
+ int32 ResvType = 16;
+ int32 ResvPersonID = 17;
+ int32 SalesLoginID = 18;
+ int32 PayType = 19;
+ string PayItemID = 20;
+ int32 PayAgentID = 21;
+ int32 PayAgentBranchID = 22;
+ customTypes.Date LimitDate = 23;
+ bool RoomAssign = 24;
+ google.protobuf.Timestamp CreateDate = 25;
+ int32 CreateLoginID = 26;
+ string CreatePcName = 27;
+ int32 CreateClass = 28;
+ google.protobuf.Timestamp UpdateDate = 29;
+ int32 UpdateLoginID = 30;
+ string UpdatePcName = 31;
+ int32 UpdateClass = 32;
+ int32 UpdateID = 33;
+ repeated UseRoom UseRoomList = 34;
+ repeated UseMemo MemoList = 35;
+ repeated UseFree FreeList = 36;
+ repeated Rental RentalList = 37;
+}
+
+message UseDetailTable {
+ int32 ErrNo = 1;
+ string ErrData = 2;
+ string Name = 3;
+ int32 UpdateType = 4; //0.なし 1.Insert 2.Update
+ string Tag = 5;
+ bytes BeforeUpdate = 6;
+ bytes AfterUpdate = 7;
+ repeated UseDetail Rows = 8;
+}
+
+service UseDetailCore {
+ rpc GetData (HotelPms.Data.DataRequest) returns (UseDetailTable);
+ rpc SetData (UseDetailTable) returns (HotelPms.Data.DataResult);
+ rpc Add (UseDetail) returns (HotelPms.Data.DataResult);
+ rpc Update (UseDetail) returns (HotelPms.Data.DataResult);
+ rpc Remove (HotelPms.Data.SqlWhere) returns (HotelPms.Data.DataResult);
+ rpc GetDataStream (stream HotelPms.Data.DataRequest) returns (stream UseDetailTable);
+ rpc SetDataStream (stream UseDetailTable) returns (stream HotelPms.Data.DataResult);
+ rpc AddStream (stream UseDetail) returns (stream HotelPms.Data.DataResult);
+ rpc UpdateStream (stream UseDetail) returns (stream HotelPms.Data.DataResult);
+ rpc RemoveStream (stream HotelPms.Data.SqlWhere) returns (stream HotelPms.Data.DataResult);
+ rpc OutputStream (HotelPms.Data.DataRequest) returns (stream HotelPms.Data.FileGrpcData);
+}
\ No newline at end of file
diff --git a/Protos/usefree.proto b/Protos/usefree.proto
new file mode 100644
index 0000000..2c51c86
--- /dev/null
+++ b/Protos/usefree.proto
@@ -0,0 +1,43 @@
+syntax = "proto3";
+
+import "datarequest.proto";
+import "dataresult.proto";
+import "sqlwhere.proto";
+import "file.proto";
+import "customTypes.proto";
+
+package HotelPms.Data.UseInfo;
+
+message UseFree {
+ int32 ID = 1;
+ int32 DetailID = 2;
+ customTypes.Date UseDate = 3;
+ int32 TypeID = 4;
+ string DataValue = 5;
+
+}
+
+message UseFreeTable {
+ int32 ErrNo = 1;
+ string ErrData = 2;
+ string Name = 3;
+ int32 UpdateType = 4; //0.なし 1.Insert 2.Update
+ string Tag = 5;
+ bytes BeforeUpdate = 6;
+ bytes AfterUpdate = 7;
+ repeated UseFree Rows = 8;
+}
+
+service UseFreeCore {
+ rpc GetData (HotelPms.Data.DataRequest) returns (UseFreeTable);
+ rpc SetData (UseFreeTable) returns (HotelPms.Data.DataResult);
+ rpc Add (UseFree) returns (HotelPms.Data.DataResult);
+ rpc Update (UseFree) returns (HotelPms.Data.DataResult);
+ rpc Remove (HotelPms.Data.SqlWhere) returns (HotelPms.Data.DataResult);
+ rpc GetDataStream (stream HotelPms.Data.DataRequest) returns (stream UseFreeTable);
+ rpc SetDataStream (stream UseFreeTable) returns (stream HotelPms.Data.DataResult);
+ rpc AddStream (stream UseFree) returns (stream HotelPms.Data.DataResult);
+ rpc UpdateStream (stream UseFree) returns (stream HotelPms.Data.DataResult);
+ rpc RemoveStream (stream HotelPms.Data.SqlWhere) returns (stream HotelPms.Data.DataResult);
+ rpc OutputStream (HotelPms.Data.DataRequest) returns (stream HotelPms.Data.FileGrpcData);
+}
\ No newline at end of file
diff --git a/Protos/usememo.proto b/Protos/usememo.proto
new file mode 100644
index 0000000..c17b951
--- /dev/null
+++ b/Protos/usememo.proto
@@ -0,0 +1,43 @@
+syntax = "proto3";
+
+import "datarequest.proto";
+import "dataresult.proto";
+import "sqlwhere.proto";
+import "file.proto";
+
+
+package HotelPms.Data.UseInfo;
+
+message UseMemo {
+ int32 ID = 1;
+ int32 DetailID = 2;
+ int32 TypeID = 3;
+ string Context = 4;
+ bool Alert = 5;
+
+}
+
+message UseMemoTable {
+ int32 ErrNo = 1;
+ string ErrData = 2;
+ string Name = 3;
+ int32 UpdateType = 4; //0.なし 1.Insert 2.Update
+ string Tag = 5;
+ bytes BeforeUpdate = 6;
+ bytes AfterUpdate = 7;
+ repeated UseMemo Rows = 8;
+}
+
+service UseMemoCore {
+ rpc GetData (HotelPms.Data.DataRequest) returns (UseMemoTable);
+ rpc SetData (UseMemoTable) returns (HotelPms.Data.DataResult);
+ rpc Add (UseMemo) returns (HotelPms.Data.DataResult);
+ rpc Update (UseMemo) returns (HotelPms.Data.DataResult);
+ rpc Remove (HotelPms.Data.SqlWhere) returns (HotelPms.Data.DataResult);
+ rpc GetDataStream (stream HotelPms.Data.DataRequest) returns (stream UseMemoTable);
+ rpc SetDataStream (stream UseMemoTable) returns (stream HotelPms.Data.DataResult);
+ rpc AddStream (stream UseMemo) returns (stream HotelPms.Data.DataResult);
+ rpc UpdateStream (stream UseMemo) returns (stream HotelPms.Data.DataResult);
+ rpc RemoveStream (stream HotelPms.Data.SqlWhere) returns (stream HotelPms.Data.DataResult);
+ rpc OutputStream (HotelPms.Data.DataRequest) returns (stream HotelPms.Data.FileGrpcData);
+}
\ No newline at end of file
diff --git a/Protos/useperson.proto b/Protos/useperson.proto
new file mode 100644
index 0000000..15a9d46
--- /dev/null
+++ b/Protos/useperson.proto
@@ -0,0 +1,72 @@
+syntax = "proto3";
+
+import "datarequest.proto";
+import "dataresult.proto";
+import "sqlwhere.proto";
+import "file.proto";
+import "usepersonfree.proto";
+import "usepersontel.proto";
+import "customTypes.proto";
+
+package HotelPms.Data.UseInfo;
+
+message UsePerson {
+ int32 ID = 1;
+ int32 PersonID = 2;
+ int32 CustomerID = 3;
+ string MemberNo = 4;
+ string Kana = 5;
+ string Name = 6;
+ string ReceiptName = 7;
+ string ZipCode = 8;
+ string Prefecture = 9;
+ string Address2 = 10;
+ string Address3 = 11;
+ string Address4 = 12;
+ string Mail = 13;
+ string PassportNo = 14;
+ int32 Sex = 15;
+ customTypes.Date BirthDay = 16;
+ customTypes.Date Anniversary = 17;
+ int32 CharacterType = 18;
+ int32 RankID = 19;
+ int32 CorpID = 20;
+ string CorpKana = 21;
+ string CorpName = 22;
+ string CorpZipCode = 23;
+ string CorpPrefecture = 24;
+ string CorpAddress2 = 25;
+ string CorpAddress3 = 26;
+ string CorpAddress4 = 27;
+ string CorpMail = 28;
+ int32 HonorificTitleID = 29;
+ string Memo = 30;
+ int32 AreaID = 31;
+ repeated UsePersonFree FreeList = 32;
+ repeated UsePersonTel TelList = 33;
+}
+
+message UsePersonTable {
+ int32 ErrNo = 1;
+ string ErrData = 2;
+ string Name = 3;
+ int32 UpdateType = 4; //0.なし 1.Insert 2.Update
+ string Tag = 5;
+ bytes BeforeUpdate = 6;
+ bytes AfterUpdate = 7;
+ repeated UsePerson Rows = 8;
+}
+
+service UsePersonCore {
+ rpc GetData (HotelPms.Data.DataRequest) returns (UsePersonTable);
+ rpc SetData (UsePersonTable) returns (HotelPms.Data.DataResult);
+ rpc Add (UsePerson) returns (HotelPms.Data.DataResult);
+ rpc Update (UsePerson) returns (HotelPms.Data.DataResult);
+ rpc Remove (HotelPms.Data.SqlWhere) returns (HotelPms.Data.DataResult);
+ rpc GetDataStream (stream HotelPms.Data.DataRequest) returns (stream UsePersonTable);
+ rpc SetDataStream (stream UsePersonTable) returns (stream HotelPms.Data.DataResult);
+ rpc AddStream (stream UsePerson) returns (stream HotelPms.Data.DataResult);
+ rpc UpdateStream (stream UsePerson) returns (stream HotelPms.Data.DataResult);
+ rpc RemoveStream (stream HotelPms.Data.SqlWhere) returns (stream HotelPms.Data.DataResult);
+ rpc OutputStream (HotelPms.Data.DataRequest) returns (stream HotelPms.Data.FileGrpcData);
+}
\ No newline at end of file
diff --git a/Protos/usepersonfree.proto b/Protos/usepersonfree.proto
new file mode 100644
index 0000000..f17a843
--- /dev/null
+++ b/Protos/usepersonfree.proto
@@ -0,0 +1,42 @@
+syntax = "proto3";
+
+import "datarequest.proto";
+import "dataresult.proto";
+import "sqlwhere.proto";
+import "file.proto";
+
+
+package HotelPms.Data.UseInfo;
+
+message UsePersonFree {
+ int32 ID = 1;
+ int32 PersonID = 2;
+ int32 TypeID = 3;
+ string DataValue = 4;
+
+}
+
+message UsePersonFreeTable {
+ int32 ErrNo = 1;
+ string ErrData = 2;
+ string Name = 3;
+ int32 UpdateType = 4; //0.なし 1.Insert 2.Update
+ string Tag = 5;
+ bytes BeforeUpdate = 6;
+ bytes AfterUpdate = 7;
+ repeated UsePersonFree Rows = 8;
+}
+
+service UsePersonFreeCore {
+ rpc GetData (HotelPms.Data.DataRequest) returns (UsePersonFreeTable);
+ rpc SetData (UsePersonFreeTable) returns (HotelPms.Data.DataResult);
+ rpc Add (UsePersonFree) returns (HotelPms.Data.DataResult);
+ rpc Update (UsePersonFree) returns (HotelPms.Data.DataResult);
+ rpc Remove (HotelPms.Data.SqlWhere) returns (HotelPms.Data.DataResult);
+ rpc GetDataStream (stream HotelPms.Data.DataRequest) returns (stream UsePersonFreeTable);
+ rpc SetDataStream (stream UsePersonFreeTable) returns (stream HotelPms.Data.DataResult);
+ rpc AddStream (stream UsePersonFree) returns (stream HotelPms.Data.DataResult);
+ rpc UpdateStream (stream UsePersonFree) returns (stream HotelPms.Data.DataResult);
+ rpc RemoveStream (stream HotelPms.Data.SqlWhere) returns (stream HotelPms.Data.DataResult);
+ rpc OutputStream (HotelPms.Data.DataRequest) returns (stream HotelPms.Data.FileGrpcData);
+}
\ No newline at end of file
diff --git a/Protos/usepersontel.proto b/Protos/usepersontel.proto
new file mode 100644
index 0000000..1afb06d
--- /dev/null
+++ b/Protos/usepersontel.proto
@@ -0,0 +1,44 @@
+syntax = "proto3";
+
+import "datarequest.proto";
+import "dataresult.proto";
+import "sqlwhere.proto";
+import "file.proto";
+
+
+package HotelPms.Data.UseInfo;
+
+message UsePersonTel {
+ int32 ID = 1;
+ int32 PersonID = 2;
+ string Tel = 3;
+ int32 Kind = 4;
+ string SearchKey = 5;
+ int32 SortID = 6;
+
+}
+
+message UsePersonTelTable {
+ int32 ErrNo = 1;
+ string ErrData = 2;
+ string Name = 3;
+ int32 UpdateType = 4; //0.なし 1.Insert 2.Update
+ string Tag = 5;
+ bytes BeforeUpdate = 6;
+ bytes AfterUpdate = 7;
+ repeated UsePersonTel Rows = 8;
+}
+
+service UsePersonTelCore {
+ rpc GetData (HotelPms.Data.DataRequest) returns (UsePersonTelTable);
+ rpc SetData (UsePersonTelTable) returns (HotelPms.Data.DataResult);
+ rpc Add (UsePersonTel) returns (HotelPms.Data.DataResult);
+ rpc Update (UsePersonTel) returns (HotelPms.Data.DataResult);
+ rpc Remove (HotelPms.Data.SqlWhere) returns (HotelPms.Data.DataResult);
+ rpc GetDataStream (stream HotelPms.Data.DataRequest) returns (stream UsePersonTelTable);
+ rpc SetDataStream (stream UsePersonTelTable) returns (stream HotelPms.Data.DataResult);
+ rpc AddStream (stream UsePersonTel) returns (stream HotelPms.Data.DataResult);
+ rpc UpdateStream (stream UsePersonTel) returns (stream HotelPms.Data.DataResult);
+ rpc RemoveStream (stream HotelPms.Data.SqlWhere) returns (stream HotelPms.Data.DataResult);
+ rpc OutputStream (HotelPms.Data.DataRequest) returns (stream HotelPms.Data.FileGrpcData);
+}
\ No newline at end of file
diff --git a/Protos/useroom.proto b/Protos/useroom.proto
new file mode 100644
index 0000000..c63080b
--- /dev/null
+++ b/Protos/useroom.proto
@@ -0,0 +1,74 @@
+syntax = "proto3";
+
+import "datarequest.proto";
+import "dataresult.proto";
+import "sqlwhere.proto";
+import "file.proto";
+import "useallo.proto";
+import "usefree.proto";
+import "sale.proto";
+import "pay.proto";
+import "arrange.proto";
+import "customTypes.proto";
+
+package HotelPms.Data.UseInfo;
+
+message UseRoom {
+ int32 ID = 1;
+ int32 DetailID = 2;
+ customTypes.Date UseDate = 3;
+ int32 BeginTime = 4;
+ int32 EndTime = 5;
+ int32 RoomTypeID = 6;
+ int32 RoomKind = 7;
+ int32 RoomID = 8;
+ int32 AgentID = 9;
+ int32 AgentBranchID = 10;
+ int32 PersionCount = 11;
+ int32 Adult = 12;
+ int32 ChildA = 13;
+ int32 ChildB = 14;
+ int32 ChildC = 15;
+ int32 ChildD = 16;
+ int32 ChildE = 17;
+ int32 ChildF = 18;
+ int32 Infant = 19;
+ int32 InFemaleAdult = 20;
+ int32 InFemaleChildA = 21;
+ int32 InFemaleChildB = 22;
+ int32 InFemaleChildC = 23;
+ int32 InFemaleChildD = 24;
+ int32 InFemaleChildE = 25;
+ int32 InFemaleChildF = 26;
+ int32 InFemaleInfant = 27;
+ repeated UseAllo UseAlloList = 28;
+ repeated UseFree FreeList = 29;
+ repeated Sale SaleList = 30;
+ repeated Pay PayList = 31;
+ repeated Arrange ArrangeList = 32;
+}
+
+message UseRoomTable {
+ int32 ErrNo = 1;
+ string ErrData = 2;
+ string Name = 3;
+ int32 UpdateType = 4; //0.なし 1.Insert 2.Update
+ string Tag = 5;
+ bytes BeforeUpdate = 6;
+ bytes AfterUpdate = 7;
+ repeated UseRoom Rows = 8;
+}
+
+service UseRoomCore {
+ rpc GetData (HotelPms.Data.DataRequest) returns (UseRoomTable);
+ rpc SetData (UseRoomTable) returns (HotelPms.Data.DataResult);
+ rpc Add (UseRoom) returns (HotelPms.Data.DataResult);
+ rpc Update (UseRoom) returns (HotelPms.Data.DataResult);
+ rpc Remove (HotelPms.Data.SqlWhere) returns (HotelPms.Data.DataResult);
+ rpc GetDataStream (stream HotelPms.Data.DataRequest) returns (stream UseRoomTable);
+ rpc SetDataStream (stream UseRoomTable) returns (stream HotelPms.Data.DataResult);
+ rpc AddStream (stream UseRoom) returns (stream HotelPms.Data.DataResult);
+ rpc UpdateStream (stream UseRoom) returns (stream HotelPms.Data.DataResult);
+ rpc RemoveStream (stream HotelPms.Data.SqlWhere) returns (stream HotelPms.Data.DataResult);
+ rpc OutputStream (HotelPms.Data.DataRequest) returns (stream HotelPms.Data.FileGrpcData);
+}
\ No newline at end of file
diff --git a/ProtosExpan/CustomTypes/Date.cs b/ProtosExpan/CustomTypes/Date.cs
new file mode 100644
index 0000000..c82bd8f
--- /dev/null
+++ b/ProtosExpan/CustomTypes/Date.cs
@@ -0,0 +1,128 @@
+namespace customTypes
+{
+ /// <summary>
+ /// gRPC送信用Date
+ /// SqlServerのDate型対応
+ /// </summary>
+ public partial class Date
+ {
+ public static readonly int MinValue = 10000101;
+ public static readonly DateTime MinDate = DateTime.Parse("1000/01/01");
+ public static readonly Date Default = new Date(0);
+
+ /// <summary>
+ /// 利用情報のプライマリーキー:1901/01/01
+ /// </summary>
+ public static readonly Date MinUseDate = new Date(19010101);
+
+ public Date(int val)
+ {
+ Value = val;
+ }
+
+ public Date(string val)
+ {
+ Value = int.Parse(val.Replace("/", string.Empty).Replace("-", string.Empty));
+ }
+
+ /// <summary>
+ /// 暗然変換
+ /// DateTime = Date
+ /// </summary>
+ /// <param name="grpcDecimal"></param>
+ public static implicit operator DateTime(Date grpcDate)
+ {
+ try
+ {
+ if (grpcDate.Value <= MinValue) { return MinDate; }
+ string date = grpcDate.Value.ToString();
+ int year = System.Convert.ToInt32(date.Substring(0, 4));
+ int mon = System.Convert.ToInt32(date.Substring(4, 2));
+ int day = System.Convert.ToInt32(date.Substring(6, 2));
+ return new DateTime(year, mon, day);
+ }
+ catch
+ {
+ return MinDate;
+ }
+ }
+
+ /// <summary>
+ /// 暗然変換
+ /// Date = DateTime
+ /// </summary>
+ /// <param name="value"></param>
+ public static implicit operator Date(DateTime value)
+ {
+ return new Date(int.Parse(value.ToString("yyyyMMdd")));
+ }
+
+ /// <summary>
+ /// 比較
+ /// </summary>
+ /// <param name="val"></param>
+ /// <returns></returns>
+ public int CompareTo(Date val)
+ {
+ DateTime self = this;
+ DateTime inVal = val;
+ return self.CompareTo(inVal);
+ }
+
+ /// <summary>
+ /// c#基本型の値を返す
+ /// </summary>
+ /// <returns></returns>
+ public DateTime ToDateTime()
+ {
+ DateTime self = this;
+ return self;
+ }
+
+ /// <summary>
+ /// 文字列
+ /// </summary>
+ /// <returns></returns>
+ public string ToText(string format = "yyyy/MM/dd")
+ {
+ DateTime self = this;
+ if (format.Length > 0) { return self.ToString(format); }
+ return self.ToString();
+ }
+
+ /// <summary>
+ /// SQL文の値セット
+ /// </summary>
+ /// <returns></returns>
+ public string ToSqlValue()
+ {
+ DateTime self = this;
+ return Value <= MinValue || self.CompareTo(MinDate) <= 0 ? "NULL" : $"'{self.ToString("yyyy/MM/dd")}'";
+ }
+
+ /// <summary>
+ /// 日付の±
+ /// </summary>
+ /// <param name="day"></param>
+ /// <returns></returns>
+ public Date Add(int day)
+ {
+ DateTime self = this;
+ Date date = self.AddDays((double)day);
+ return date;
+ }
+
+ /// <summary>
+ /// 日付引く
+ /// </summary>
+ /// <param name="beginDate"></param>
+ /// <returns></returns>
+ public int Subtract(Date beginDate)
+ {
+ DateTime end = this;
+ DateTime begin = beginDate;
+ TimeSpan ts = end - begin;
+ return ts.Days;
+ }
+ }
+}
diff --git a/ProtosExpan/CustomTypes/DecimalValue.cs b/ProtosExpan/CustomTypes/DecimalValue.cs
new file mode 100644
index 0000000..3e4fdba
--- /dev/null
+++ b/ProtosExpan/CustomTypes/DecimalValue.cs
@@ -0,0 +1,80 @@
+namespace customTypes
+{
+ /// <summary>
+ /// gRPC送信用decimal
+ /// </summary>
+ public partial class DecimalValue
+ {
+ private const decimal NanoFactor = 1_000_000_000;
+ public DecimalValue(long units, int nanos)
+ {
+ Units = units;
+ Nanos = nanos;
+ }
+
+ /// <summary>
+ /// 暗然変換
+ /// decimal = DecimalValue
+ /// </summary>
+ /// <param name="grpcDecimal"></param>
+ public static implicit operator decimal(DecimalValue grpcDecimal)
+ {
+ return grpcDecimal.Units + grpcDecimal.Nanos / NanoFactor;
+ }
+
+ /// <summary>
+ /// 暗然変換
+ /// DecimalValue = decimal
+ /// </summary>
+ /// <param name="value"></param>
+ public static implicit operator DecimalValue(decimal value)
+ {
+ var units = decimal.ToInt64(value);
+ var nanos = decimal.ToInt32((value - units) * NanoFactor);
+ return new DecimalValue(units, nanos);
+ }
+
+ /// <summary>
+ /// 比較
+ /// </summary>
+ /// <param name="val"></param>
+ /// <returns></returns>
+ public int CompareTo(DecimalValue val)
+ {
+ decimal self = this;
+ decimal inVal = val;
+ return self.CompareTo(inVal);
+ }
+
+ /// <summary>
+ /// c#基本型の値を返す
+ /// </summary>
+ /// <returns></returns>
+ public decimal ToDecimal()
+ {
+ decimal self = this;
+ return self;
+ }
+
+ /// <summary>
+ /// 文字列
+ /// </summary>
+ /// <returns></returns>
+ public string ToText(string format = "")
+ {
+ decimal self = this;
+ if (format.Length > 0) { return self.ToString(format); }
+ return self.ToString();
+ }
+
+ /// <summary>
+ /// SQL文の値セット
+ /// </summary>
+ /// <returns></returns>
+ public string ToSqlValue()
+ {
+ decimal self = this;
+ return self.ToString();
+ }
+ }
+}
diff --git a/ProtosExpan/GrpcSet.cs b/ProtosExpan/GrpcSet.cs
new file mode 100644
index 0000000..efd8a31
--- /dev/null
+++ b/ProtosExpan/GrpcSet.cs
@@ -0,0 +1,24 @@
+using System.Data;
+
+namespace HotelPms.Data
+{
+ /// <summary>
+ /// GrpcSetの拡張
+ /// </summary>
+ public partial class GrpcSet
+ {
+ /// <summary>
+ /// データセットを返す
+ /// </summary>
+ /// <returns></returns>
+ public DataSet ToDataSet()
+ {
+ DataSet ds = new DataSet();
+ foreach (GrpcTable table in Tables)
+ {
+ ds.Tables.Add(table.ToDataTable());
+ }
+ return ds;
+ }
+ }
+}
diff --git a/ProtosExpan/GrpcTable.cs b/ProtosExpan/GrpcTable.cs
new file mode 100644
index 0000000..4b76a0c
--- /dev/null
+++ b/ProtosExpan/GrpcTable.cs
@@ -0,0 +1,210 @@
+using HotelPms.Share.Data;
+using HotelPms.Share.Util;
+using System.Data;
+using System.Reflection;
+
+namespace HotelPms.Data
+{
+ /// <summary>
+ /// GrpcTableの拡張
+ /// </summary>
+ public partial class GrpcTable
+ {
+ /// <summary>
+ /// 汎用クラスへバラス
+ /// </summary>
+ /// <typeparam name="T"></typeparam>
+ /// <returns></returns>
+ public List<T> Convert<T>() where T : new()
+ {
+ List<string> nameList = new List<string>();
+ List<Type> typeList = new List<Type>();
+ foreach (GrpcCol col in Cols)
+ {
+ Type type = CConvert.ToType(col.FieldType);
+ typeList.Add(type);
+ nameList.Add(col.Name);
+ }
+
+ List<T> list = new List<T>();
+
+ //TはRecordBaseの子供クラス
+ if (typeof(T).IsSubclassOf(typeof(RecordBase)))
+ {
+ foreach (GrpcRow row in this.Rows)
+ {
+ T item = new T();
+ int p = 0;
+ for (int i = 0; i < typeList.Count; i++)
+ {
+ Type type = typeList[i];
+ object val = GetFieldValue(type, row, ref p);
+ (item as RecordBase).SetField(nameList[i], val);
+ }
+ list.Add(item);
+ }
+ }
+ else
+ {
+ foreach (GrpcRow row in this.Rows)
+ {
+ T item = GetItem<T>(row, typeList, nameList);
+ list.Add(item);
+ }
+ }
+ return list;
+ }
+
+ /// <summary>
+ /// 一行目、一列目を返す
+ /// </summary>
+ /// <param name="type"></param>
+ /// <returns></returns>
+ public object? GetValue(Type type)
+ {
+ try
+ {
+ if (Rows.Count == 0) { return null; }
+ int p = 0;
+ return GetFieldValue(type, Rows[0], ref p);
+ }
+ catch
+ {
+ return null;
+ }
+ }
+
+ private T GetItem<T>(GrpcRow row, List<Type> typeList, List<string> nameList) where T : new()
+ {
+ Type temp = typeof(T);
+ T obj = new T();
+
+ int p = 0;
+ for (int i = 0; i < typeList.Count; i++)
+ {
+ Type type = typeList[i];
+ object val = GetFieldValue(type, row, ref p);
+
+ //↓効率悪い
+ foreach (PropertyInfo pro in temp.GetProperties())
+ {
+ if (pro.Name.ToUpper() == nameList[i].ToUpper())
+ {
+ pro.SetValue(obj, val, null);
+ break;
+ }
+ else
+ {
+ continue;
+ }
+ }
+ }
+
+ return obj;
+ }
+
+ /// <summary>
+ /// 値を返す
+ /// </summary>
+ /// <param name="type"></param>
+ /// <param name="row"></param>
+ /// <param name="p"></param>
+ /// <returns></returns>
+ private object GetFieldValue(Type type, GrpcRow row, ref int p)
+ {
+ object ret = null;
+ if (type == typeof(System.Int32))
+ {
+ ret = BitConverter.ToInt32(row.Data.Span.Slice(p, 4).ToArray());
+ p += 4;
+ }
+ else if (type == typeof(bool))
+ {
+ ret = BitConverter.ToBoolean(row.Data.Span.Slice(p, 1).ToArray());
+ p += 1;
+ }
+ else if (type == typeof(DateTime))
+ {
+ DateTime dateTime = CConvert.ToDateTimeFromBytes(row.Data.Span.Slice(p, 8).ToArray());
+ ret = (dateTime.CompareTo(DateTime.MinValue) == 0) ? DBNull.Value : dateTime;
+ p += 8;
+ }
+ else if (type == typeof(float))
+ {
+ ret = BitConverter.ToSingle(row.Data.Span.Slice(p, 4).ToArray());
+ p += 4;
+ }
+ else if (type == typeof(double))
+ {
+ ret = BitConverter.ToDouble(row.Data.Span.Slice(p, 8).ToArray());
+ p += 8;
+ }
+ else if (type == typeof(decimal))
+ {
+ ret = CConvert.ToDecimal(row.Data.Span.Slice(p, 16).ToArray());
+ p += 16;
+ }
+ else if (type == typeof(System.Byte))
+ {
+ ret = row.Data.Span[p];
+ p += 1;
+ }
+ else if (type == typeof(System.Int16))
+ {
+ ret = BitConverter.ToInt16(row.Data.Span.Slice(p, 2).ToArray());
+ p += 2;
+ }
+ else
+ {
+ //0x00まで
+ List<byte> list = new List<byte>();
+ while (true)
+ {
+ byte val = row.Data.Span[p];
+ if (val == 0x00) { p++; break; }
+ list.Add(val);
+ p++;
+ }
+ ret = System.Text.Encoding.UTF8.GetString(list.ToArray());
+ }
+
+ return ret;
+ }
+
+ /// <summary>
+ ///
+ /// </summary>
+ /// <returns></returns>
+ public DataTable ToDataTable()
+ {
+ Console.WriteLine($"ToDataTable⇒Begin:{DateTime.Now.ToString("HH:mm:ss fff")}");
+ DataTable dataTable = new DataTable();
+ dataTable.TableName = Name;
+ List<Type> typeList = new List<Type>();
+ foreach (GrpcCol col in Cols)
+ {
+ Type type = CConvert.ToType(col.FieldType);
+ typeList.Add(type);
+ dataTable.Columns.Add(col.Name, type);
+ }
+
+ //データ
+ foreach (GrpcRow row in Rows)
+ {
+ DataRow dtRow = dataTable.NewRow();
+ dataTable.Rows.Add(dtRow);
+
+ object[] rowArray = new object[typeList.Count];
+ int p = 0;
+ for (int i = 0; i < typeList.Count; i++)
+ {
+ Type type = typeList[i];
+ rowArray[i] = GetFieldValue(type, row, ref p);
+ }
+ dtRow.ItemArray = rowArray;
+ }
+ Console.WriteLine($"ToDataTable⇒End:{DateTime.Now.ToString("HH:mm:ss fff")}");
+ return dataTable;
+ }
+ }
+}
diff --git a/ProtosExpan/Master/Building.cs b/ProtosExpan/Master/Building.cs
new file mode 100644
index 0000000..79788b3
--- /dev/null
+++ b/ProtosExpan/Master/Building.cs
@@ -0,0 +1,261 @@
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Text;
+using HotelPms.Share.Data;
+using HotelPms.Share.Util;
+using Google.Protobuf.WellKnownTypes;
+using customTypes;
+using System.Data.Common;
+
+namespace HotelPms.Data.Master
+{
+ /// ****************************** Description *******************************
+ /// ◇システム名称
+ /// ホテルPMS
+ /// ◇概要
+ ///
+ /// ◇履歴
+ /// 2021/05/14 コード作成ツール 自動作成
+ /// ****************************** Declarations ******************************
+ [Serializable()]
+ public partial class Building : RecordBase
+ {
+ #region ★★★★★ Property ★★★★★
+
+ public static ConcurrentDictionary<string, int> PrimaryKey { get; } = new ConcurrentDictionary<string, int>();
+
+ #endregion
+
+ partial void OnConstruction()
+ {
+ if (PrimaryKey.Count == 0)
+ {
+ PrimaryKey.TryAdd("ID", 0);
+
+ }
+ }
+
+ #region ★★★★★ Function ★★★★★
+
+ public bool CompareTo(Building item)
+ {
+ if (ID.CompareTo(item.ID) != 0
+ || Name.CompareTo(item.Name) != 0
+ || ShortName.CompareTo(item.ShortName) != 0
+ || ZipCode.CompareTo(item.ZipCode) != 0
+ || Prefecture.CompareTo(item.Prefecture) != 0
+ || Address2.CompareTo(item.Address2) != 0
+ || Address3.CompareTo(item.Address3) != 0
+ || Address4.CompareTo(item.Address4) != 0
+ || Tel.CompareTo(item.Tel) != 0
+ || Fax.CompareTo(item.Fax) != 0
+ || UpdateDate.CompareTo(item.UpdateDate) != 0
+ || UpdateLoginID.CompareTo(item.UpdateLoginID) != 0
+ || UpdatePcName.CompareTo(item.UpdatePcName) != 0
+ || UpdateID.CompareTo(item.UpdateID) != 0
+)
+ {
+ return false;
+ }
+ return true;
+ }
+
+
+ public override void CopyTo(object dest)
+ {
+ Building item = dest as Building;
+ item.ID = ID;
+ item.Name = Name;
+ item.ShortName = ShortName;
+ item.ZipCode = ZipCode;
+ item.Prefecture = Prefecture;
+ item.Address2 = Address2;
+ item.Address3 = Address3;
+ item.Address4 = Address4;
+ item.Tel = Tel;
+ item.Fax = Fax;
+ item.UpdateDate = UpdateDate;
+ item.UpdateLoginID = UpdateLoginID;
+ item.UpdatePcName = UpdatePcName;
+ item.UpdateID = UpdateID;
+
+ }
+
+ public override void Clear()
+ {
+ ID = 0;
+ Name = string.Empty;
+ ShortName = string.Empty;
+ ZipCode = string.Empty;
+ Prefecture = string.Empty;
+ Address2 = string.Empty;
+ Address3 = string.Empty;
+ Address4 = string.Empty;
+ Tel = string.Empty;
+ Fax = string.Empty;
+ UpdateDate = CConvert.ToTimestamp(DateTime.MinValue);
+ UpdateLoginID = 0;
+ UpdatePcName = string.Empty;
+ UpdateID = 0;
+
+ }
+
+ public Building DeepClone()
+ {
+ Building item = new Building();
+ item.ID = ID;
+ item.Name = Name;
+ item.ShortName = ShortName;
+ item.ZipCode = ZipCode;
+ item.Prefecture = Prefecture;
+ item.Address2 = Address2;
+ item.Address3 = Address3;
+ item.Address4 = Address4;
+ item.Tel = Tel;
+ item.Fax = Fax;
+ item.UpdateDate = UpdateDate;
+ item.UpdateLoginID = UpdateLoginID;
+ item.UpdatePcName = UpdatePcName;
+ item.UpdateID = UpdateID;
+
+ return item;
+ }
+
+ public override bool ConvertDataRow(System.Data.DataRow row)
+ {
+ ID = CConvert.ToInt(row["ID"],ID);
+ Name = row["Name"].ToString();
+ ShortName = row["ShortName"].ToString();
+ ZipCode = row["ZipCode"].ToString();
+ Prefecture = row["Prefecture"].ToString();
+ Address2 = row["Address2"].ToString();
+ Address3 = row["Address3"].ToString();
+ Address4 = row["Address4"].ToString();
+ Tel = row["Tel"].ToString();
+ Fax = row["Fax"].ToString();
+ UpdateDate = CConvert.ToTimestamp(row.IsNull("UpdateDate") ? DateTime.MinValue : (System.DateTime)row["UpdateDate"]);
+ UpdateLoginID = CConvert.ToInt(row["UpdateLoginID"],UpdateLoginID);
+ UpdatePcName = row["UpdatePcName"].ToString();
+ UpdateID = CConvert.ToInt(row["UpdateID"],UpdateID);
+
+ return true;
+ }
+
+ public void ToDataRow(System.Data.DataRow row)
+ {
+ row["ID"] = ID;
+ row["Name"] = Name;
+ row["ShortName"] = ShortName;
+ row["ZipCode"] = ZipCode;
+ row["Prefecture"] = Prefecture;
+ row["Address2"] = Address2;
+ row["Address3"] = Address3;
+ row["Address4"] = Address4;
+ row["Tel"] = Tel;
+ row["Fax"] = Fax;
+ row["UpdateDate"] = UpdateDate.ToDateTime();
+ row["UpdateLoginID"] = UpdateLoginID;
+ row["UpdatePcName"] = UpdatePcName;
+ row["UpdateID"] = UpdateID;
+
+ }
+
+ /// <summary>
+ /// 必ず順番にしないといけない
+ /// </summary>
+ /// <param name="row"></param>
+ public void ConvertReader(DbDataReader row)
+ {
+ ID = CConvert.ToInt(row["ID"],ID);
+ Name = row["Name"].ToString();
+ ShortName = row["ShortName"].ToString();
+ ZipCode = row["ZipCode"].ToString();
+ Prefecture = row["Prefecture"].ToString();
+ Address2 = row["Address2"].ToString();
+ Address3 = row["Address3"].ToString();
+ Address4 = row["Address4"].ToString();
+ Tel = row["Tel"].ToString();
+ Fax = row["Fax"].ToString();
+ UpdateDate = CConvert.ToTimestamp(row.IsNull("UpdateDate") ? DateTime.MinValue : (System.DateTime)row["UpdateDate"]);
+ UpdateLoginID = CConvert.ToInt(row["UpdateLoginID"],UpdateLoginID);
+ UpdatePcName = row["UpdatePcName"].ToString();
+ UpdateID = CConvert.ToInt(row["UpdateID"],UpdateID);
+
+ }
+
+ public string AddSql()
+ {
+ return $@"INSERT INTO M_Building(ID,Name,ShortName,ZipCode,Prefecture,Address2,Address3,Address4,Tel,Fax,UpdateDate,UpdateLoginID,UpdatePcName,UpdateID) VALUES({ID},N'{Name}',N'{ShortName}',N'{ZipCode}',N'{Prefecture}',N'{Address2}',N'{Address3}',N'{Address4}',N'{Tel}',N'{Fax}',GETDATE(),{UpdateLoginID},N'{UpdatePcName}',{UpdateID});";
+ }
+
+ public string UpdateSql()
+ {
+ return $@"UPDATE M_Building SET Name = N'{Name}',ShortName = N'{ShortName}',ZipCode = N'{ZipCode}',Prefecture = N'{Prefecture}',Address2 = N'{Address2}',Address3 = N'{Address3}',Address4 = N'{Address4}',Tel = N'{Tel}',Fax = N'{Fax}',UpdateDate = GETDATE(),UpdateLoginID = {UpdateLoginID},UpdatePcName = N'{UpdatePcName}',UpdateID = {UpdateID} WHERE ID = {ID};";
+ }
+
+ public string ToText()
+ {
+ StringBuilder text = new StringBuilder();
+ text.AppendFormat("ID={0};", ID);
+ text.AppendFormat("Name={0};", Name);
+ text.AppendFormat("ShortName={0};", ShortName);
+ text.AppendFormat("ZipCode={0};", ZipCode);
+ text.AppendFormat("Prefecture={0};", Prefecture);
+ text.AppendFormat("Address2={0};", Address2);
+ text.AppendFormat("Address3={0};", Address3);
+ text.AppendFormat("Address4={0};", Address4);
+ text.AppendFormat("Tel={0};", Tel);
+ text.AppendFormat("Fax={0};", Fax);
+ text.AppendFormat("UpdateDate={0};", UpdateDate);
+ text.AppendFormat("UpdateLoginID={0};", UpdateLoginID);
+ text.AppendFormat("UpdatePcName={0};", UpdatePcName);
+ text.AppendFormat("UpdateID={0};", UpdateID);
+
+ return text.ToString();
+ }
+
+ public override object GetField(string name)
+ {
+
+ if (name == "ID") { return ID; }
+ else if (name == "Name") { return Name; }
+ else if (name == "ShortName") { return ShortName; }
+ else if (name == "ZipCode") { return ZipCode; }
+ else if (name == "Prefecture") { return Prefecture; }
+ else if (name == "Address2") { return Address2; }
+ else if (name == "Address3") { return Address3; }
+ else if (name == "Address4") { return Address4; }
+ else if (name == "Tel") { return Tel; }
+ else if (name == "Fax") { return Fax; }
+ else if (name == "UpdateDate") { return UpdateDate; }
+ else if (name == "UpdateLoginID") { return UpdateLoginID; }
+ else if (name == "UpdatePcName") { return UpdatePcName; }
+ else if (name == "UpdateID") { return UpdateID; }
+ else { return null; }
+ }
+
+ public override bool SetField(string name, object value)
+ {
+
+ if (name == "ID") { ID = CConvert.ToInt(value); return true; }
+ else if (name == "Name") { Name = value.ToString(); return true; }
+ else if (name == "ShortName") { ShortName = value.ToString(); return true; }
+ else if (name == "ZipCode") { ZipCode = value.ToString(); return true; }
+ else if (name == "Prefecture") { Prefecture = value.ToString(); return true; }
+ else if (name == "Address2") { Address2 = value.ToString(); return true; }
+ else if (name == "Address3") { Address3 = value.ToString(); return true; }
+ else if (name == "Address4") { Address4 = value.ToString(); return true; }
+ else if (name == "Tel") { Tel = value.ToString(); return true; }
+ else if (name == "Fax") { Fax = value.ToString(); return true; }
+ else if (name == "UpdateDate") { UpdateDate = CConvert.ToTimestamp(CConvert.ToDateTime(value)); return true; }
+ else if (name == "UpdateLoginID") { UpdateLoginID = CConvert.ToInt(value); return true; }
+ else if (name == "UpdatePcName") { UpdatePcName = value.ToString(); return true; }
+ else if (name == "UpdateID") { UpdateID = CConvert.ToInt(value); return true; }
+ else { return false; }
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/ProtosExpan/Master/BuildingTable.cs b/ProtosExpan/Master/BuildingTable.cs
new file mode 100644
index 0000000..bb0d8cd
--- /dev/null
+++ b/ProtosExpan/Master/BuildingTable.cs
@@ -0,0 +1,43 @@
+using HotelPms.Share.Util;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Diagnostics;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HotelPms.Data.Master
+{
+ public partial class BuildingTable
+ {
+ /// <summary>
+ /// 自動データテーブル生成
+ /// </summary>
+ /// <returns></returns>
+ public DataTable ToDataTable()
+ {
+ DataTable dataTable = new DataTable();
+ dataTable.TableName = Name;
+ PropertyInfo[] myInfo = typeof(Building).GetProperties(BindingFlags.Public | BindingFlags.Instance);
+ foreach (PropertyInfo item in myInfo)
+ {
+ System.Diagnostics.Debug.WriteLine(item.Name);
+
+ Attribute attribute = item.GetCustomAttribute(typeof(DebuggerNonUserCodeAttribute));
+ if (attribute == null) { continue; }
+ dataTable.Columns.Add(item.Name, item.PropertyType);
+ }
+
+ //データ
+ foreach (Building row in Rows)
+ {
+ DataRow dtRow = dataTable.NewRow();
+ row.ToDataRow(dtRow);
+ dataTable.Rows.Add(dtRow);
+ }
+ return dataTable;
+ }
+ }
+}
diff --git a/ProtosExpan/Master/Demo.cs b/ProtosExpan/Master/Demo.cs
new file mode 100644
index 0000000..440ec07
--- /dev/null
+++ b/ProtosExpan/Master/Demo.cs
@@ -0,0 +1,225 @@
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Text;
+using HotelPms.Share.Data;
+using HotelPms.Share.Util;
+using Google.Protobuf.WellKnownTypes;
+using customTypes;
+using System.Data.Common;
+
+namespace HotelPms.Data.Master
+{
+ /// ****************************** Description *******************************
+ /// ◇システム名称
+ /// ホテルPMS
+ /// ◇概要
+ ///
+ /// ◇履歴
+ /// 2021/05/14 コード作成ツール 自動作成
+ /// ****************************** Declarations ******************************
+ [Serializable()]
+ public partial class Demo : RecordBase
+ {
+ #region ★★★★★ Property ★★★★★
+
+ public static ConcurrentDictionary<string, int> PrimaryKey { get; } = new ConcurrentDictionary<string, int>();
+
+ #endregion
+
+ partial void OnConstruction()
+ {
+ if (PrimaryKey.Count == 0)
+ {
+ PrimaryKey.TryAdd("ID", 0);
+
+ }
+ }
+
+ #region ★★★★★ Function ★★★★★
+
+ public bool CompareTo(Demo item)
+ {
+ if (ID.CompareTo(item.ID) != 0
+ || Name.CompareTo(item.Name) != 0
+ || FInt.CompareTo(item.FInt) != 0
+ || FTinyInt.CompareTo(item.FTinyInt) != 0
+ || FSmallInt.CompareTo(item.FSmallInt) != 0
+ || FFloat.CompareTo(item.FFloat) != 0
+ || FBit.CompareTo(item.FBit) != 0
+ || FDecimal.CompareTo(item.FDecimal) != 0
+ || FDate.CompareTo(item.FDate) != 0
+ || UpdateDate.CompareTo(item.UpdateDate) != 0
+ || UpdateID.CompareTo(item.UpdateID) != 0
+ )
+ {
+ return false;
+ }
+ return true;
+ }
+
+
+ public override void CopyTo(object dest)
+ {
+ Demo item = dest as Demo;
+ item.ID = ID;
+ item.Name = Name;
+ item.FInt = FInt;
+ item.FTinyInt = FTinyInt;
+ item.FSmallInt = FSmallInt;
+ item.FFloat = FFloat;
+ item.FBit = FBit;
+ item.FDecimal = FDecimal;
+ item.FDate = FDate;
+ item.UpdateDate = UpdateDate;
+ item.UpdateID = UpdateID;
+ }
+
+ public override void Clear()
+ {
+ ID = 0;
+ Name = string.Empty;
+ FInt = 0;
+ FTinyInt = 0;
+ FSmallInt = 0;
+ FFloat = 0;
+ FBit = false;
+ FDecimal = 0;
+ FDate = Date.Default;
+ UpdateDate = CConvert.ToTimestamp(DateTime.MinValue);
+ UpdateID = 0;
+ }
+
+ public Demo DeepClone()
+ {
+ Demo item = new Demo();
+ item.ID = ID;
+ item.Name = Name;
+ item.FInt = FInt;
+ item.FTinyInt = FTinyInt;
+ item.FSmallInt = FSmallInt;
+ item.FFloat = FFloat;
+ item.FBit = FBit;
+ item.FDecimal = FDecimal;
+ item.FDate = FDate;
+ item.UpdateDate = UpdateDate;
+ item.UpdateID = UpdateID;
+ return item;
+ }
+
+ public override bool ConvertDataRow(System.Data.DataRow row)
+ {
+ ID = CConvert.ToInt(row["ID"],ID);
+ Name = row["Name"].ToString();
+ FInt = CConvert.ToInt(row["FInt"],FInt);
+ FTinyInt = CConvert.ToInt(row["FTinyInt"],FTinyInt);
+ FSmallInt = CConvert.ToInt(row["FSmallInt"],FSmallInt);
+ FFloat = CConvert.ToFloat(row["FFloat"],FFloat);
+ FBit = CConvert.ToBool(row["FBit"]);
+ FDecimal = CConvert.ToDecimal(row["FDecimal"]);
+ FDate = new Date(row.IsNull("FDate") ? 0 : CConvert.ToDateInt((System.DateTime)row["FDate"]));
+ UpdateDate = CConvert.ToTimestamp(row.IsNull("UpdateDate") ? DateTime.MinValue : (System.DateTime)row["UpdateDate"]);
+ UpdateID = CConvert.ToInt(row["UpdateID"], UpdateID);
+ return true;
+ }
+
+ public void ToDataRow(System.Data.DataRow row)
+ {
+ row["ID"] = ID;
+ row["Name"] = Name;
+ row["FInt"] = FInt;
+ row["FTinyInt"] = FTinyInt;
+ row["FSmallInt"] = FSmallInt;
+ row["FFloat"] = FFloat;
+ row["FBit"] = FBit;
+ row["FDecimal"] = FDecimal.ToDecimal();
+ row["FDate"] = FDate.ToDateTime();
+ row["UpdateDate"] = UpdateDate.ToDateTime();
+ row["UpdateID"] = UpdateID;
+ }
+
+ /// <summary>
+ /// 必ず順番にしないといけない
+ /// </summary>
+ /// <param name="row"></param>
+ public void ConvertReader(DbDataReader row)
+ {
+ int i = 0;
+ ID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ Name = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ FInt = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ FTinyInt = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ FSmallInt = (int)(row.IsDBNull(i) ? 0 : row.GetInt16(i)); i++;
+ FFloat = (float)(row.IsDBNull(i) ? 0D : row.GetDouble(i)); i++;
+ FBit = (bool)(row.IsDBNull(i) ? false : row.GetBoolean(i)); i++;
+ FDecimal = (decimal)(row.IsDBNull(i) ? 0M : row.GetDecimal(i)); i++;
+ FDate = new Date(row.IsDBNull(i) ? 0 : CConvert.ToDateInt(row.GetDateTime(i))); i++;
+ UpdateDate = CConvert.ToTimestamp(row.IsDBNull(i) ? DateTime.MinValue : row.GetDateTime(i)); i++;
+ UpdateID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ }
+
+ public string AddSql()
+ {
+ return $@"INSERT INTO M_Demo(ID,Name,FInt,FTinyInt,FSmallInt,FFloat,FBit,FDecimal,FDate,UpdateDate,UpdateID) VALUES({ID},N'{Name}',{FInt},{FTinyInt},{FSmallInt},{FFloat},{(FBit ? 1 : 0)},{FDecimal.ToSqlValue()},{FDate.ToSqlValue()},GETDATE(),{UpdateID});";
+ }
+
+ public string UpdateSql()
+ {
+ return $@"UPDATE M_Demo SET Name = N'{Name}',FInt = {FInt},FTinyInt = {FTinyInt},FSmallInt = {FSmallInt},FFloat = {FFloat},FBit = {(FBit ? 1 : 0)},FDecimal = {FDecimal.ToSqlValue()},FDate = {FDate.ToSqlValue()},UpdateDate = GETDATE(),UpdateID={UpdateID} WHERE ID = {ID};";
+ }
+
+ public string ToText()
+ {
+ StringBuilder text = new StringBuilder();
+ text.AppendFormat("ID={0};", ID);
+ text.AppendFormat("Name={0};", Name);
+ text.AppendFormat("FInt={0};", FInt);
+ text.AppendFormat("FTinyInt={0};", FTinyInt);
+ text.AppendFormat("FSmallInt={0};", FSmallInt);
+ text.AppendFormat("FFloat={0};", FFloat);
+ text.AppendFormat("FBit={0};", FBit);
+ text.AppendFormat("FDecimal={0};", FDecimal.ToText());
+ text.AppendFormat("FDate={0};", FDate.ToText());
+ text.AppendFormat("UpdateDate={0};", UpdateDate);
+ text.AppendFormat("UpdateID={0};", UpdateID);
+ return text.ToString();
+ }
+
+ public override object GetField(string name)
+ {
+
+ if (name == "ID") { return ID; }
+ else if (name == "Name") { return Name; }
+ else if (name == "FInt") { return FInt; }
+ else if (name == "FTinyInt") { return FTinyInt; }
+ else if (name == "FSmallInt") { return FSmallInt; }
+ else if (name == "FFloat") { return FFloat; }
+ else if (name == "FBit") { return FBit; }
+ else if (name == "FDecimal") { return FDecimal; }
+ else if (name == "FDate") { return FDate; }
+ else if (name == "UpdateDate") { return UpdateDate; }
+ else if (name == "UpdateID") { return UpdateID; }
+ else { return null; }
+ }
+
+ public override bool SetField(string name, object value)
+ {
+
+ if (name == "ID") { ID = CConvert.ToInt(value); return true; }
+ else if (name == "Name") { Name = value.ToString(); return true; }
+ else if (name == "FInt") { FInt = CConvert.ToInt(value); return true; }
+ else if (name == "FTinyInt") { FTinyInt = CConvert.ToInt(value); return true; }
+ else if (name == "FSmallInt") { FSmallInt = CConvert.ToInt(value); return true; }
+ else if (name == "FFloat") { FFloat = CConvert.ToFloat(value); return true; }
+ else if (name == "FBit") { FBit = CConvert.ToBool(value); return true; }
+ else if (name == "FDecimal") { FDecimal = CConvert.ToDecimal(value); return true; }
+ else if (name == "FDate") { FDate = new Date(CConvert.ToDateInt(value)); return true; }
+ else if (name == "UpdateDate") { UpdateDate = CConvert.ToTimestamp(CConvert.ToDateTime(value)); return true; }
+ else if (name == "UpdateID") { UpdateID = CConvert.ToInt(value); return true; }
+ else { return false; }
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/ProtosExpan/Master/DemoTable.cs b/ProtosExpan/Master/DemoTable.cs
new file mode 100644
index 0000000..ab0a5b9
--- /dev/null
+++ b/ProtosExpan/Master/DemoTable.cs
@@ -0,0 +1,43 @@
+using HotelPms.Share.Util;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Diagnostics;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HotelPms.Data.Master
+{
+ public partial class DemoTable
+ {
+ /// <summary>
+ /// 自動データテーブル生成
+ /// </summary>
+ /// <returns></returns>
+ public DataTable ToDataTable()
+ {
+ DataTable dataTable = new DataTable();
+ dataTable.TableName = Name;
+ PropertyInfo[] myInfo = typeof(Demo).GetProperties(BindingFlags.Public | BindingFlags.Instance);
+ foreach (PropertyInfo item in myInfo)
+ {
+ System.Diagnostics.Debug.WriteLine(item.Name);
+
+ Attribute attribute = item.GetCustomAttribute(typeof(DebuggerNonUserCodeAttribute));
+ if (attribute == null) { continue; }
+ dataTable.Columns.Add(item.Name, item.PropertyType);
+ }
+
+ //データ
+ foreach (Demo row in Rows)
+ {
+ DataRow dtRow = dataTable.NewRow();
+ row.ToDataRow(dtRow);
+ dataTable.Rows.Add(dtRow);
+ }
+ return dataTable;
+ }
+ }
+}
diff --git a/ProtosExpan/Master/Hotel.cs b/ProtosExpan/Master/Hotel.cs
new file mode 100644
index 0000000..60db2d5
--- /dev/null
+++ b/ProtosExpan/Master/Hotel.cs
@@ -0,0 +1,266 @@
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Text;
+using HotelPms.Share.Data;
+using HotelPms.Share.Util;
+using Google.Protobuf.WellKnownTypes;
+using customTypes;
+
+namespace HotelPms.Data.Master
+{
+ /// ****************************** Description *******************************
+ /// ◇システム名称
+ /// ホテルPMS
+ /// ◇概要
+ ///
+ /// ◇履歴
+ /// 2021/05/14 コード作成ツール 自動作成
+ /// ****************************** Declarations ******************************
+ [Serializable()]
+ public partial class Hotel : RecordBase
+ {
+ #region ★★★★★ Property ★★★★★
+
+ public static ConcurrentDictionary<string, int> PrimaryKey { get; } = new ConcurrentDictionary<string, int>();
+
+ #endregion
+
+ partial void OnConstruction()
+ {
+ if (PrimaryKey.Count == 0)
+ {
+ PrimaryKey.TryAdd("ID", 0);
+
+ }
+ }
+
+ #region ★★★★★ Function ★★★★★
+
+ public bool CompareTo(Hotel item)
+ {
+ if (ID.CompareTo(item.ID) != 0
+ || Name.CompareTo(item.Name) != 0
+ || HotelDate.CompareTo(item.HotelDate) != 0
+ || RoomCount.CompareTo(item.RoomCount) != 0
+ || ZipCode.CompareTo(item.ZipCode) != 0
+ || Prefecture.CompareTo(item.Prefecture) != 0
+ || Address2.CompareTo(item.Address2) != 0
+ || Address3.CompareTo(item.Address3) != 0
+ || Address4.CompareTo(item.Address4) != 0
+ || Tel.CompareTo(item.Tel) != 0
+ || Fax.CompareTo(item.Fax) != 0
+ || StartDate.CompareTo(item.StartDate) != 0
+ || CreateDate.CompareTo(item.CreateDate) != 0
+ || SumDate.CompareTo(item.SumDate) != 0
+ || CloseDate.CompareTo(item.CloseDate) != 0
+)
+ {
+ return false;
+ }
+ return true;
+ }
+
+
+ public override void CopyTo(object dest)
+ {
+ Hotel item = dest as Hotel;
+ item.ID = ID;
+ item.Name = Name;
+ item.HotelDate = HotelDate;
+ item.RoomCount = RoomCount;
+ item.ZipCode = ZipCode;
+ item.Prefecture = Prefecture;
+ item.Address2 = Address2;
+ item.Address3 = Address3;
+ item.Address4 = Address4;
+ item.Tel = Tel;
+ item.Fax = Fax;
+ item.StartDate = StartDate;
+ item.CreateDate = CreateDate;
+ item.SumDate = SumDate;
+ item.CloseDate = CloseDate;
+
+ }
+
+ public override void Clear()
+ {
+ ID = 0;
+ Name = string.Empty;
+ HotelDate = Date.Default;
+ RoomCount = 0;
+ ZipCode = string.Empty;
+ Prefecture = string.Empty;
+ Address2 = string.Empty;
+ Address3 = string.Empty;
+ Address4 = string.Empty;
+ Tel = string.Empty;
+ Fax = string.Empty;
+ StartDate = 0;
+ CreateDate = Date.Default;
+ SumDate = Date.Default;
+ CloseDate = 0;
+
+ }
+
+ public Hotel DeepClone()
+ {
+ Hotel item = new Hotel();
+ item.ID = ID;
+ item.Name = Name;
+ item.HotelDate = HotelDate;
+ item.RoomCount = RoomCount;
+ item.ZipCode = ZipCode;
+ item.Prefecture = Prefecture;
+ item.Address2 = Address2;
+ item.Address3 = Address3;
+ item.Address4 = Address4;
+ item.Tel = Tel;
+ item.Fax = Fax;
+ item.StartDate = StartDate;
+ item.CreateDate = CreateDate;
+ item.SumDate = SumDate;
+ item.CloseDate = CloseDate;
+
+ return item;
+ }
+
+ public override bool ConvertDataRow(System.Data.DataRow row)
+ {
+ ID = CConvert.ToInt(row["ID"],ID);
+ Name = row["Name"].ToString();
+ HotelDate = new Date(row.IsNull("HotelDate") ? 0 : CConvert.ToDateInt((System.DateTime)row["HotelDate"]));
+ RoomCount = CConvert.ToInt(row["RoomCount"],RoomCount);
+ ZipCode = row["ZipCode"].ToString();
+ Prefecture = row["Prefecture"].ToString();
+ Address2 = row["Address2"].ToString();
+ Address3 = row["Address3"].ToString();
+ Address4 = row["Address4"].ToString();
+ Tel = row["Tel"].ToString();
+ Fax = row["Fax"].ToString();
+ StartDate = CConvert.ToInt(row["StartDate"],StartDate);
+ CreateDate = new Date(row.IsNull("CreateDate") ? 0 : CConvert.ToDateInt((System.DateTime)row["CreateDate"]));
+ SumDate = new Date(row.IsNull("SumDate") ? 0 : CConvert.ToDateInt((System.DateTime)row["SumDate"]));
+ CloseDate = CConvert.ToInt(row["CloseDate"],CloseDate);
+
+ return true;
+ }
+
+ public void ToDataRow(System.Data.DataRow row)
+ {
+ row["ID"] = ID;
+ row["Name"] = Name;
+ row["HotelDate"] = HotelDate.ToDateTime();
+ row["RoomCount"] = RoomCount;
+ row["ZipCode"] = ZipCode;
+ row["Prefecture"] = Prefecture;
+ row["Address2"] = Address2;
+ row["Address3"] = Address3;
+ row["Address4"] = Address4;
+ row["Tel"] = Tel;
+ row["Fax"] = Fax;
+ row["StartDate"] = StartDate;
+ row["CreateDate"] = CreateDate.ToDateTime();
+ row["SumDate"] = SumDate.ToDateTime();
+ row["CloseDate"] = CloseDate;
+
+ }
+
+ public void ConvertReader(SqlDataReader row)
+ {
+ ID = CConvert.ToInt(row["ID"],ID);
+ Name = row["Name"].ToString();
+ HotelDate = new Date(row.IsNull("HotelDate") ? 0 : CConvert.ToDateInt((System.DateTime)row["HotelDate"]));
+ RoomCount = CConvert.ToInt(row["RoomCount"],RoomCount);
+ ZipCode = row["ZipCode"].ToString();
+ Prefecture = row["Prefecture"].ToString();
+ Address2 = row["Address2"].ToString();
+ Address3 = row["Address3"].ToString();
+ Address4 = row["Address4"].ToString();
+ Tel = row["Tel"].ToString();
+ Fax = row["Fax"].ToString();
+ StartDate = CConvert.ToInt(row["StartDate"],StartDate);
+ CreateDate = new Date(row.IsNull("CreateDate") ? 0 : CConvert.ToDateInt((System.DateTime)row["CreateDate"]));
+ SumDate = new Date(row.IsNull("SumDate") ? 0 : CConvert.ToDateInt((System.DateTime)row["SumDate"]));
+ CloseDate = CConvert.ToInt(row["CloseDate"],CloseDate);
+
+ }
+
+ public string AddSql()
+ {
+ return $@"INSERT INTO S_Hotel(ID,Name,HotelDate,RoomCount,ZipCode,Prefecture,Address2,Address3,Address4,Tel,Fax,StartDate,CreateDate,SumDate,CloseDate) VALUES({ID},N'{Name}',{HotelDate.ToSqlValue()},{RoomCount},N'{ZipCode}',N'{Prefecture}',N'{Address2}',N'{Address3}',N'{Address4}',N'{Tel}',N'{Fax}',{StartDate},{CreateDate.ToSqlValue()},{SumDate.ToSqlValue()},{CloseDate});";
+ }
+
+ public string UpdateSql()
+ {
+ return $@"UPDATE S_Hotel SET Name = N'{Name}',HotelDate = {HotelDate.ToSqlValue()},RoomCount = {RoomCount},ZipCode = N'{ZipCode}',Prefecture = N'{Prefecture}',Address2 = N'{Address2}',Address3 = N'{Address3}',Address4 = N'{Address4}',Tel = N'{Tel}',Fax = N'{Fax}',StartDate = {StartDate},CreateDate = {CreateDate.ToSqlValue()},SumDate = {SumDate.ToSqlValue()},CloseDate = {CloseDate} WHERE ID = {ID};";
+ }
+
+ public string ToText()
+ {
+ StringBuilder text = new StringBuilder();
+ text.AppendFormat("ID={0};", ID);
+ text.AppendFormat("Name={0};", Name);
+ text.AppendFormat("HotelDate={0};", HotelDate);
+ text.AppendFormat("RoomCount={0};", RoomCount);
+ text.AppendFormat("ZipCode={0};", ZipCode);
+ text.AppendFormat("Prefecture={0};", Prefecture);
+ text.AppendFormat("Address2={0};", Address2);
+ text.AppendFormat("Address3={0};", Address3);
+ text.AppendFormat("Address4={0};", Address4);
+ text.AppendFormat("Tel={0};", Tel);
+ text.AppendFormat("Fax={0};", Fax);
+ text.AppendFormat("StartDate={0};", StartDate);
+ text.AppendFormat("CreateDate={0};", CreateDate);
+ text.AppendFormat("SumDate={0};", SumDate);
+ text.AppendFormat("CloseDate={0};", CloseDate);
+
+ return text.ToString();
+ }
+
+ public override object GetField(string name)
+ {
+
+ if (name == "ID") { return ID; }
+ else if (name == "Name") { return Name; }
+ else if (name == "HotelDate") { return HotelDate; }
+ else if (name == "RoomCount") { return RoomCount; }
+ else if (name == "ZipCode") { return ZipCode; }
+ else if (name == "Prefecture") { return Prefecture; }
+ else if (name == "Address2") { return Address2; }
+ else if (name == "Address3") { return Address3; }
+ else if (name == "Address4") { return Address4; }
+ else if (name == "Tel") { return Tel; }
+ else if (name == "Fax") { return Fax; }
+ else if (name == "StartDate") { return StartDate; }
+ else if (name == "CreateDate") { return CreateDate; }
+ else if (name == "SumDate") { return SumDate; }
+ else if (name == "CloseDate") { return CloseDate; }
+ else { return null; }
+ }
+
+ public override bool SetField(string name, object value)
+ {
+
+ if (name == "ID") { ID = CConvert.ToInt(value); return true; }
+ else if (name == "Name") { Name = value.ToString(); return true; }
+ else if (name == "HotelDate") { HotelDate = new Date(CConvert.ToDateInt(value)); return true; }
+ else if (name == "RoomCount") { RoomCount = CConvert.ToInt(value); return true; }
+ else if (name == "ZipCode") { ZipCode = value.ToString(); return true; }
+ else if (name == "Prefecture") { Prefecture = value.ToString(); return true; }
+ else if (name == "Address2") { Address2 = value.ToString(); return true; }
+ else if (name == "Address3") { Address3 = value.ToString(); return true; }
+ else if (name == "Address4") { Address4 = value.ToString(); return true; }
+ else if (name == "Tel") { Tel = value.ToString(); return true; }
+ else if (name == "Fax") { Fax = value.ToString(); return true; }
+ else if (name == "StartDate") { StartDate = CConvert.ToInt(value); return true; }
+ else if (name == "CreateDate") { CreateDate = new Date(CConvert.ToDateInt(value)); return true; }
+ else if (name == "SumDate") { SumDate = new Date(CConvert.ToDateInt(value)); return true; }
+ else if (name == "CloseDate") { CloseDate = CConvert.ToInt(value); return true; }
+ else { return false; }
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/ProtosExpan/Master/HotelTable.cs b/ProtosExpan/Master/HotelTable.cs
new file mode 100644
index 0000000..eb2cb4b
--- /dev/null
+++ b/ProtosExpan/Master/HotelTable.cs
@@ -0,0 +1,43 @@
+using HotelPms.Share.Util;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Diagnostics;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HotelPms.Data.Master
+{
+ public partial class HotelTable
+ {
+ /// <summary>
+ /// 自動データテーブル生成
+ /// </summary>
+ /// <returns></returns>
+ public DataTable ToDataTable()
+ {
+ DataTable dataTable = new DataTable();
+ dataTable.TableName = Name;
+ PropertyInfo[] myInfo = typeof(Hotel).GetProperties(BindingFlags.Public | BindingFlags.Instance);
+ foreach (PropertyInfo item in myInfo)
+ {
+ System.Diagnostics.Debug.WriteLine(item.Name);
+
+ Attribute attribute = item.GetCustomAttribute(typeof(DebuggerNonUserCodeAttribute));
+ if (attribute == null) { continue; }
+ dataTable.Columns.Add(item.Name, item.PropertyType);
+ }
+
+ //データ
+ foreach (Hotel row in Rows)
+ {
+ DataRow dtRow = dataTable.NewRow();
+ row.ToDataRow(dtRow);
+ dataTable.Rows.Add(dtRow);
+ }
+ return dataTable;
+ }
+ }
+}
diff --git a/ProtosExpan/Master/Item.cs b/ProtosExpan/Master/Item.cs
new file mode 100644
index 0000000..9b89c56
--- /dev/null
+++ b/ProtosExpan/Master/Item.cs
@@ -0,0 +1,597 @@
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Text;
+using HotelPms.Share.Data;
+using HotelPms.Share.Util;
+using Google.Protobuf.WellKnownTypes;
+using customTypes;
+using System.Data.Common;
+
+namespace HotelPms.Data.Master;
+
+/// ****************************** Description *******************************
+/// ◇システム名称
+/// ホテルPMS
+/// ◇概要
+///
+/// ◇履歴
+/// 2021/05/14 コード作成ツール 自動作成
+/// ****************************** Declarations ******************************
+[Serializable()]
+public partial class Item : RecordBase
+{
+ #region ★★★★★ Property ★★★★★
+
+ public static ConcurrentDictionary<string, int> PrimaryKey { get; } = new ConcurrentDictionary<string, int>();
+
+ #endregion
+
+ partial void OnConstruction()
+ {
+ if (PrimaryKey.Count == 0)
+ {
+ PrimaryKey.TryAdd("ID", 0);
+
+ }
+ }
+
+ #region ★★★★★ Function ★★★★★
+
+ public bool CompareTo(Item item)
+ {
+ if (ID.CompareTo(item.ID) != 0
+ || Name.CompareTo(item.Name) != 0
+ || EnName.CompareTo(item.EnName) != 0
+ || Name2.CompareTo(item.Name2) != 0
+ || ReceiptName.CompareTo(item.ReceiptName) != 0
+ || RoomTypeID.CompareTo(item.RoomTypeID) != 0
+ || PersonCount.CompareTo(item.PersonCount) != 0
+ || Price.CompareTo(item.Price) != 0
+ || DiscountRate.CompareTo(item.DiscountRate) != 0
+ || DiscountSummary.CompareTo(item.DiscountSummary) != 0
+ || DiscountID.CompareTo(item.DiscountID) != 0
+ || ServiceIOType.CompareTo(item.ServiceIOType) != 0
+ || ServiceRate.CompareTo(item.ServiceRate) != 0
+ || TaxType.CompareTo(item.TaxType) != 0
+ || TaxIOType.CompareTo(item.TaxIOType) != 0
+ || BathTaxIOType.CompareTo(item.BathTaxIOType) != 0
+ || AccTaxIOType.CompareTo(item.AccTaxIOType) != 0
+ || SaleSectionID.CompareTo(item.SaleSectionID) != 0
+ || SumSectionID.CompareTo(item.SumSectionID) != 0
+ || Kind.CompareTo(item.Kind) != 0
+ || NextDay.CompareTo(item.NextDay) != 0
+ || AgentID.CompareTo(item.AgentID) != 0
+ || AgentBranchID.CompareTo(item.AgentBranchID) != 0
+ || PointFlg.CompareTo(item.PointFlg) != 0
+ || PointInTax.CompareTo(item.PointInTax) != 0
+ || PointRate.CompareTo(item.PointRate) != 0
+ || PointPrice.CompareTo(item.PointPrice) != 0
+ || PointSumType.CompareTo(item.PointSumType) != 0
+ || Point.CompareTo(item.Point) != 0
+ || DayUse.CompareTo(item.DayUse) != 0
+ || ReceiptPrtType.CompareTo(item.ReceiptPrtType) != 0
+ || LongStayFlg.CompareTo(item.LongStayFlg) != 0
+ || RentalType.CompareTo(item.RentalType) != 0
+ || TraderID.CompareTo(item.TraderID) != 0
+ || TraderMemo.CompareTo(item.TraderMemo) != 0
+ || PackFlg.CompareTo(item.PackFlg) != 0
+ || SortID.CompareTo(item.SortID) != 0
+ || Fraction.CompareTo(item.Fraction) != 0
+ || InRoomSales.CompareTo(item.InRoomSales) != 0
+ || MealType.CompareTo(item.MealType) != 0
+ || UseType.CompareTo(item.UseType) != 0
+ || PersonType.CompareTo(item.PersonType) != 0
+ || Parking.CompareTo(item.Parking) != 0
+ || HallFee.CompareTo(item.HallFee) != 0
+ || UpdateDate.CompareTo(item.UpdateDate) != 0
+ || UpdateLoginID.CompareTo(item.UpdateLoginID) != 0
+ || UpdatePcName.CompareTo(item.UpdatePcName) != 0
+ || UpdateID.CompareTo(item.UpdateID) != 0
+)
+ {
+ return false;
+ }
+ return true;
+ }
+
+
+ public override void CopyTo(object dest)
+ {
+ Item item = dest as Item;
+ item.ID = ID;
+ item.Name = Name;
+ item.EnName = EnName;
+ item.Name2 = Name2;
+ item.ReceiptName = ReceiptName;
+ item.RoomTypeID = RoomTypeID;
+ item.PersonCount = PersonCount;
+ item.Price = Price;
+ item.DiscountRate = DiscountRate;
+ item.DiscountSummary = DiscountSummary;
+ item.DiscountID = DiscountID;
+ item.ServiceIOType = ServiceIOType;
+ item.ServiceRate = ServiceRate;
+ item.TaxType = TaxType;
+ item.TaxIOType = TaxIOType;
+ item.BathTaxIOType = BathTaxIOType;
+ item.AccTaxIOType = AccTaxIOType;
+ item.SaleSectionID = SaleSectionID;
+ item.SumSectionID = SumSectionID;
+ item.Kind = Kind;
+ item.NextDay = NextDay;
+ item.AgentID = AgentID;
+ item.AgentBranchID = AgentBranchID;
+ item.PointFlg = PointFlg;
+ item.PointInTax = PointInTax;
+ item.PointRate = PointRate;
+ item.PointPrice = PointPrice;
+ item.PointSumType = PointSumType;
+ item.Point = Point;
+ item.DayUse = DayUse;
+ item.ReceiptPrtType = ReceiptPrtType;
+ item.LongStayFlg = LongStayFlg;
+ item.RentalType = RentalType;
+ item.TraderID = TraderID;
+ item.TraderMemo = TraderMemo;
+ item.PackFlg = PackFlg;
+ item.SortID = SortID;
+ item.Fraction = Fraction;
+ item.InRoomSales = InRoomSales;
+ item.MealType = MealType;
+ item.UseType = UseType;
+ item.PersonType = PersonType;
+ item.Parking = Parking;
+ item.HallFee = HallFee;
+ item.UpdateDate = UpdateDate;
+ item.UpdateLoginID = UpdateLoginID;
+ item.UpdatePcName = UpdatePcName;
+ item.UpdateID = UpdateID;
+
+ }
+
+ public override void Clear()
+ {
+ ID = string.Empty;
+ Name = string.Empty;
+ EnName = string.Empty;
+ Name2 = string.Empty;
+ ReceiptName = string.Empty;
+ RoomTypeID = 0;
+ PersonCount = 0;
+ Price = 0;
+ DiscountRate = 0;
+ DiscountSummary = 0;
+ DiscountID = 0;
+ ServiceIOType = 0;
+ ServiceRate = 0;
+ TaxType = 0;
+ TaxIOType = 0;
+ BathTaxIOType = 0;
+ AccTaxIOType = 0;
+ SaleSectionID = 0;
+ SumSectionID = 0;
+ Kind = 0;
+ NextDay = false;
+ AgentID = 0;
+ AgentBranchID = 0;
+ PointFlg = false;
+ PointInTax = false;
+ PointRate = 0;
+ PointPrice = 0;
+ PointSumType = 0;
+ Point = 0;
+ DayUse = false;
+ ReceiptPrtType = 0;
+ LongStayFlg = false;
+ RentalType = 0;
+ TraderID = 0;
+ TraderMemo = string.Empty;
+ PackFlg = false;
+ SortID = 0;
+ Fraction = 0;
+ InRoomSales = false;
+ MealType = 0;
+ UseType = 0;
+ PersonType = 0;
+ Parking = false;
+ HallFee = false;
+ UpdateDate = CConvert.ToTimestamp(DateTime.MinValue);
+ UpdateLoginID = 0;
+ UpdatePcName = string.Empty;
+ UpdateID = 0;
+
+ }
+
+ public Item DeepClone()
+ {
+ Item item = new Item();
+ item.ID = ID;
+ item.Name = Name;
+ item.EnName = EnName;
+ item.Name2 = Name2;
+ item.ReceiptName = ReceiptName;
+ item.RoomTypeID = RoomTypeID;
+ item.PersonCount = PersonCount;
+ item.Price = Price;
+ item.DiscountRate = DiscountRate;
+ item.DiscountSummary = DiscountSummary;
+ item.DiscountID = DiscountID;
+ item.ServiceIOType = ServiceIOType;
+ item.ServiceRate = ServiceRate;
+ item.TaxType = TaxType;
+ item.TaxIOType = TaxIOType;
+ item.BathTaxIOType = BathTaxIOType;
+ item.AccTaxIOType = AccTaxIOType;
+ item.SaleSectionID = SaleSectionID;
+ item.SumSectionID = SumSectionID;
+ item.Kind = Kind;
+ item.NextDay = NextDay;
+ item.AgentID = AgentID;
+ item.AgentBranchID = AgentBranchID;
+ item.PointFlg = PointFlg;
+ item.PointInTax = PointInTax;
+ item.PointRate = PointRate;
+ item.PointPrice = PointPrice;
+ item.PointSumType = PointSumType;
+ item.Point = Point;
+ item.DayUse = DayUse;
+ item.ReceiptPrtType = ReceiptPrtType;
+ item.LongStayFlg = LongStayFlg;
+ item.RentalType = RentalType;
+ item.TraderID = TraderID;
+ item.TraderMemo = TraderMemo;
+ item.PackFlg = PackFlg;
+ item.SortID = SortID;
+ item.Fraction = Fraction;
+ item.InRoomSales = InRoomSales;
+ item.MealType = MealType;
+ item.UseType = UseType;
+ item.PersonType = PersonType;
+ item.Parking = Parking;
+ item.HallFee = HallFee;
+ item.UpdateDate = UpdateDate;
+ item.UpdateLoginID = UpdateLoginID;
+ item.UpdatePcName = UpdatePcName;
+ item.UpdateID = UpdateID;
+
+ return item;
+ }
+
+ public override bool ConvertDataRow(System.Data.DataRow row)
+ {
+ ID = row["ID"].ToString();
+ Name = row["Name"].ToString();
+ EnName = row["EnName"].ToString();
+ Name2 = row["Name2"].ToString();
+ ReceiptName = row["ReceiptName"].ToString();
+ RoomTypeID = CConvert.ToInt(row["RoomTypeID"],RoomTypeID);
+ PersonCount = CConvert.ToInt(row["PersonCount"],PersonCount);
+ Price = CConvert.ToDecimal(row["Price"]);
+ DiscountRate = CConvert.ToDecimal(row["DiscountRate"]);
+ DiscountSummary = CConvert.ToDecimal(row["DiscountSummary"]);
+ DiscountID = CConvert.ToInt(row["DiscountID"],DiscountID);
+ ServiceIOType = CConvert.ToInt(row["ServiceIOType"],ServiceIOType);
+ ServiceRate = CConvert.ToDecimal(row["ServiceRate"]);
+ TaxType = CConvert.ToInt(row["TaxType"],TaxType);
+ TaxIOType = CConvert.ToInt(row["TaxIOType"],TaxIOType);
+ BathTaxIOType = CConvert.ToInt(row["BathTaxIOType"],BathTaxIOType);
+ AccTaxIOType = CConvert.ToInt(row["AccTaxIOType"],AccTaxIOType);
+ SaleSectionID = CConvert.ToInt(row["SaleSectionID"],SaleSectionID);
+ SumSectionID = CConvert.ToInt(row["SumSectionID"],SumSectionID);
+ Kind = CConvert.ToInt(row["Kind"],Kind);
+ NextDay = CConvert.ToBool(row["NextDay"]);
+ AgentID = CConvert.ToInt(row["AgentID"],AgentID);
+ AgentBranchID = CConvert.ToInt(row["AgentBranchID"],AgentBranchID);
+ PointFlg = CConvert.ToBool(row["PointFlg"]);
+ PointInTax = CConvert.ToBool(row["PointInTax"]);
+ PointRate = CConvert.ToDecimal(row["PointRate"]);
+ PointPrice = CConvert.ToInt(row["PointPrice"],PointPrice);
+ PointSumType = CConvert.ToInt(row["PointSumType"],PointSumType);
+ Point = CConvert.ToInt(row["Point"],Point);
+ DayUse = CConvert.ToBool(row["DayUse"]);
+ ReceiptPrtType = CConvert.ToInt(row["ReceiptPrtType"],ReceiptPrtType);
+ LongStayFlg = CConvert.ToBool(row["LongStayFlg"]);
+ RentalType = CConvert.ToInt(row["RentalType"],RentalType);
+ TraderID = CConvert.ToInt(row["TraderID"],TraderID);
+ TraderMemo = row["TraderMemo"].ToString();
+ PackFlg = CConvert.ToBool(row["PackFlg"]);
+ SortID = CConvert.ToInt(row["SortID"],SortID);
+ Fraction = CConvert.ToInt(row["Fraction"],Fraction);
+ InRoomSales = CConvert.ToBool(row["InRoomSales"]);
+ MealType = CConvert.ToInt(row["MealType"],MealType);
+ UseType = CConvert.ToInt(row["UseType"],UseType);
+ PersonType = CConvert.ToInt(row["PersonType"],PersonType);
+ Parking = CConvert.ToBool(row["Parking"]);
+ HallFee = CConvert.ToBool(row["HallFee"]);
+ UpdateDate = CConvert.ToTimestamp(row.IsNull("UpdateDate") ? DateTime.MinValue : (System.DateTime)row["UpdateDate"]);
+ UpdateLoginID = CConvert.ToInt(row["UpdateLoginID"],UpdateLoginID);
+ UpdatePcName = row["UpdatePcName"].ToString();
+ UpdateID = CConvert.ToInt(row["UpdateID"],UpdateID);
+
+ return true;
+ }
+
+ public void ToDataRow(System.Data.DataRow row)
+ {
+ row["ID"] = ID;
+ row["Name"] = Name;
+ row["EnName"] = EnName;
+ row["Name2"] = Name2;
+ row["ReceiptName"] = ReceiptName;
+ row["RoomTypeID"] = RoomTypeID;
+ row["PersonCount"] = PersonCount;
+ row["Price"] = Price.ToDecimal();
+ row["DiscountRate"] = DiscountRate.ToDecimal();
+ row["DiscountSummary"] = DiscountSummary.ToDecimal();
+ row["DiscountID"] = DiscountID;
+ row["ServiceIOType"] = ServiceIOType;
+ row["ServiceRate"] = ServiceRate.ToDecimal();
+ row["TaxType"] = TaxType;
+ row["TaxIOType"] = TaxIOType;
+ row["BathTaxIOType"] = BathTaxIOType;
+ row["AccTaxIOType"] = AccTaxIOType;
+ row["SaleSectionID"] = SaleSectionID;
+ row["SumSectionID"] = SumSectionID;
+ row["Kind"] = Kind;
+ row["NextDay"] = NextDay;
+ row["AgentID"] = AgentID;
+ row["AgentBranchID"] = AgentBranchID;
+ row["PointFlg"] = PointFlg;
+ row["PointInTax"] = PointInTax;
+ row["PointRate"] = PointRate.ToDecimal();
+ row["PointPrice"] = PointPrice;
+ row["PointSumType"] = PointSumType;
+ row["Point"] = Point;
+ row["DayUse"] = DayUse;
+ row["ReceiptPrtType"] = ReceiptPrtType;
+ row["LongStayFlg"] = LongStayFlg;
+ row["RentalType"] = RentalType;
+ row["TraderID"] = TraderID;
+ row["TraderMemo"] = TraderMemo;
+ row["PackFlg"] = PackFlg;
+ row["SortID"] = SortID;
+ row["Fraction"] = Fraction;
+ row["InRoomSales"] = InRoomSales;
+ row["MealType"] = MealType;
+ row["UseType"] = UseType;
+ row["PersonType"] = PersonType;
+ row["Parking"] = Parking;
+ row["HallFee"] = HallFee;
+ row["UpdateDate"] = UpdateDate.ToDateTime();
+ row["UpdateLoginID"] = UpdateLoginID;
+ row["UpdatePcName"] = UpdatePcName;
+ row["UpdateID"] = UpdateID;
+
+ }
+
+ public void ConvertReader(DbDataReader row)
+ {
+ int i = 0;
+ ID = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ Name = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ EnName = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ Name2 = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ ReceiptName = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ RoomTypeID = (int)(row.IsDBNull(i) ? 0 : row.GetInt16(i)); i++;
+ PersonCount = (int)(row.IsDBNull(i) ? 0 : row.GetInt16(i)); i++;
+ Price = (decimal)(row.IsDBNull(i) ? 0M : row.GetDecimal(i)); i++;
+ DiscountRate = (decimal)(row.IsDBNull(i) ? 0M : row.GetDecimal(i)); i++;
+ DiscountSummary = (decimal)(row.IsDBNull(i) ? 0M : row.GetDecimal(i)); i++;
+ DiscountID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ ServiceIOType = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ ServiceRate = (decimal)(row.IsDBNull(i) ? 0M : row.GetDecimal(i)); i++;
+ TaxType = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ TaxIOType = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ BathTaxIOType = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ AccTaxIOType = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ SaleSectionID = (int)(row.IsDBNull(i) ? 0 : row.GetInt16(i)); i++;
+ SumSectionID = (int)(row.IsDBNull(i) ? 0 : row.GetInt16(i)); i++;
+ Kind = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ NextDay = (bool)(row.IsDBNull(i) ? false : row.GetBoolean(i)); i++;
+ AgentID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ AgentBranchID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ PointFlg = (bool)(row.IsDBNull(i) ? false : row.GetBoolean(i)); i++;
+ PointInTax = (bool)(row.IsDBNull(i) ? false : row.GetBoolean(i)); i++;
+ PointRate = (decimal)(row.IsDBNull(i) ? 0M : row.GetDecimal(i)); i++;
+ PointPrice = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ PointSumType = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ Point = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ DayUse = (bool)(row.IsDBNull(i) ? false : row.GetBoolean(i)); i++;
+ ReceiptPrtType = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ LongStayFlg = (bool)(row.IsDBNull(i) ? false : row.GetBoolean(i)); i++;
+ RentalType = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ TraderID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ TraderMemo = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ PackFlg = (bool)(row.IsDBNull(i) ? false : row.GetBoolean(i)); i++;
+ SortID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ Fraction = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ InRoomSales = (bool)(row.IsDBNull(i) ? false : row.GetBoolean(i)); i++;
+ MealType = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ UseType = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ PersonType = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ Parking = (bool)(row.IsDBNull(i) ? false : row.GetBoolean(i)); i++;
+ HallFee = (bool)(row.IsDBNull(i) ? false : row.GetBoolean(i)); i++;
+ UpdateDate = CConvert.ToTimestamp(row.IsDBNull(i) ? DateTime.MinValue : row.GetDateTime(i)); i++;
+ UpdateLoginID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ UpdatePcName = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ UpdateID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+
+ }
+
+ public string AddSql()
+ {
+ return $@"INSERT INTO M_Item(ID,Name,EnName,Name2,ReceiptName,RoomTypeID,PersonCount,Price,DiscountRate,DiscountSummary,DiscountID,ServiceIOType,ServiceRate,TaxType,TaxIOType,BathTaxIOType,AccTaxIOType,SaleSectionID,SumSectionID,Kind,NextDay,AgentID,AgentBranchID,PointFlg,PointInTax,PointRate,PointPrice,PointSumType,Point,DayUse,ReceiptPrtType,LongStayFlg,RentalType,TraderID,TraderMemo,PackFlg,SortID,Fraction,InRoomSales,MealType,UseType,PersonType,Parking,HallFee,UpdateDate,UpdateLoginID,UpdatePcName,UpdateID) VALUES(N'{ID}',N'{Name}',N'{EnName}',N'{Name2}',N'{ReceiptName}',{RoomTypeID},{PersonCount},{(Price == null ? "0" : Price.ToSqlValue())},{(DiscountRate == null ? "0" : DiscountRate.ToSqlValue())},{(DiscountSummary == null ? "0" : DiscountSummary.ToSqlValue())},{DiscountID},{ServiceIOType},{(ServiceRate == null ? "0" : ServiceRate.ToSqlValue())},{TaxType},{TaxIOType},{BathTaxIOType},{AccTaxIOType},{SaleSectionID},{SumSectionID},{Kind},{(NextDay ? 1 : 0)},{AgentID},{AgentBranchID},{(PointFlg ? 1 : 0)},{(PointInTax ? 1 : 0)},{(PointRate == null ? "0" : PointRate.ToSqlValue())},{PointPrice},{PointSumType},{Point},{(DayUse ? 1 : 0)},{ReceiptPrtType},{(LongStayFlg ? 1 : 0)},{RentalType},{TraderID},N'{TraderMemo}',{(PackFlg ? 1 : 0)},{SortID},{Fraction},{(InRoomSales ? 1 : 0)},{MealType},{UseType},{PersonType},{(Parking ? 1 : 0)},{(HallFee ? 1 : 0)},GETDATE(),{UpdateLoginID},N'{UpdatePcName}',{UpdateID});";
+ }
+
+ public string UpdateSql()
+ {
+ return $@"UPDATE M_Item SET Name = N'{Name}',EnName = N'{EnName}',Name2 = N'{Name2}',ReceiptName = N'{ReceiptName}',RoomTypeID = {RoomTypeID},PersonCount = {PersonCount},Price = {(Price == null ? "0" : Price.ToSqlValue())},DiscountRate = {(DiscountRate == null ? "0" : DiscountRate.ToSqlValue())},DiscountSummary = {(DiscountSummary == null ? "0" : DiscountSummary.ToSqlValue())},DiscountID = {DiscountID},ServiceIOType = {ServiceIOType},ServiceRate = {(ServiceRate == null ? "0" : ServiceRate.ToSqlValue())},TaxType = {TaxType},TaxIOType = {TaxIOType},BathTaxIOType = {BathTaxIOType},AccTaxIOType = {AccTaxIOType},SaleSectionID = {SaleSectionID},SumSectionID = {SumSectionID},Kind = {Kind},NextDay = {(NextDay ? 1 : 0)},AgentID = {AgentID},AgentBranchID = {AgentBranchID},PointFlg = {(PointFlg ? 1 : 0)},PointInTax = {(PointInTax ? 1 : 0)},PointRate = {(PointRate == null ? "0" : PointRate.ToSqlValue())},PointPrice = {PointPrice},PointSumType = {PointSumType},Point = {Point},DayUse = {(DayUse ? 1 : 0)},ReceiptPrtType = {ReceiptPrtType},LongStayFlg = {(LongStayFlg ? 1 : 0)},RentalType = {RentalType},TraderID = {TraderID},TraderMemo = N'{TraderMemo}',PackFlg = {(PackFlg ? 1 : 0)},SortID = {SortID},Fraction = {Fraction},InRoomSales = {(InRoomSales ? 1 : 0)},MealType = {MealType},UseType = {UseType},PersonType = {PersonType},Parking = {(Parking ? 1 : 0)},HallFee = {(HallFee ? 1 : 0)},UpdateDate = GETDATE(),UpdateLoginID = {UpdateLoginID},UpdatePcName = N'{UpdatePcName}',UpdateID = {UpdateID} WHERE ID = N'{ID}';";
+ }
+
+ public string ToText()
+ {
+ StringBuilder text = new StringBuilder();
+ text.AppendFormat("ID={0};", ID);
+ text.AppendFormat("Name={0};", Name);
+ text.AppendFormat("EnName={0};", EnName);
+ text.AppendFormat("Name2={0};", Name2);
+ text.AppendFormat("ReceiptName={0};", ReceiptName);
+ text.AppendFormat("RoomTypeID={0};", RoomTypeID);
+ text.AppendFormat("PersonCount={0};", PersonCount);
+ text.AppendFormat("Price={0};", Price);
+ text.AppendFormat("DiscountRate={0};", DiscountRate);
+ text.AppendFormat("DiscountSummary={0};", DiscountSummary);
+ text.AppendFormat("DiscountID={0};", DiscountID);
+ text.AppendFormat("ServiceIOType={0};", ServiceIOType);
+ text.AppendFormat("ServiceRate={0};", ServiceRate);
+ text.AppendFormat("TaxType={0};", TaxType);
+ text.AppendFormat("TaxIOType={0};", TaxIOType);
+ text.AppendFormat("BathTaxIOType={0};", BathTaxIOType);
+ text.AppendFormat("AccTaxIOType={0};", AccTaxIOType);
+ text.AppendFormat("SaleSectionID={0};", SaleSectionID);
+ text.AppendFormat("SumSectionID={0};", SumSectionID);
+ text.AppendFormat("Kind={0};", Kind);
+ text.AppendFormat("NextDay={0};", NextDay);
+ text.AppendFormat("AgentID={0};", AgentID);
+ text.AppendFormat("AgentBranchID={0};", AgentBranchID);
+ text.AppendFormat("PointFlg={0};", PointFlg);
+ text.AppendFormat("PointInTax={0};", PointInTax);
+ text.AppendFormat("PointRate={0};", PointRate);
+ text.AppendFormat("PointPrice={0};", PointPrice);
+ text.AppendFormat("PointSumType={0};", PointSumType);
+ text.AppendFormat("Point={0};", Point);
+ text.AppendFormat("DayUse={0};", DayUse);
+ text.AppendFormat("ReceiptPrtType={0};", ReceiptPrtType);
+ text.AppendFormat("LongStayFlg={0};", LongStayFlg);
+ text.AppendFormat("RentalType={0};", RentalType);
+ text.AppendFormat("TraderID={0};", TraderID);
+ text.AppendFormat("TraderMemo={0};", TraderMemo);
+ text.AppendFormat("PackFlg={0};", PackFlg);
+ text.AppendFormat("SortID={0};", SortID);
+ text.AppendFormat("Fraction={0};", Fraction);
+ text.AppendFormat("InRoomSales={0};", InRoomSales);
+ text.AppendFormat("MealType={0};", MealType);
+ text.AppendFormat("UseType={0};", UseType);
+ text.AppendFormat("PersonType={0};", PersonType);
+ text.AppendFormat("Parking={0};", Parking);
+ text.AppendFormat("HallFee={0};", HallFee);
+ text.AppendFormat("UpdateDate={0};", UpdateDate);
+ text.AppendFormat("UpdateLoginID={0};", UpdateLoginID);
+ text.AppendFormat("UpdatePcName={0};", UpdatePcName);
+ text.AppendFormat("UpdateID={0};", UpdateID);
+
+ return text.ToString();
+ }
+
+ public override object GetField(string name)
+ {
+
+ if (name == "ID") { return ID; }
+ else if (name == "Name") { return Name; }
+ else if (name == "EnName") { return EnName; }
+ else if (name == "Name2") { return Name2; }
+ else if (name == "ReceiptName") { return ReceiptName; }
+ else if (name == "RoomTypeID") { return RoomTypeID; }
+ else if (name == "PersonCount") { return PersonCount; }
+ else if (name == "Price") { return Price; }
+ else if (name == "DiscountRate") { return DiscountRate; }
+ else if (name == "DiscountSummary") { return DiscountSummary; }
+ else if (name == "DiscountID") { return DiscountID; }
+ else if (name == "ServiceIOType") { return ServiceIOType; }
+ else if (name == "ServiceRate") { return ServiceRate; }
+ else if (name == "TaxType") { return TaxType; }
+ else if (name == "TaxIOType") { return TaxIOType; }
+ else if (name == "BathTaxIOType") { return BathTaxIOType; }
+ else if (name == "AccTaxIOType") { return AccTaxIOType; }
+ else if (name == "SaleSectionID") { return SaleSectionID; }
+ else if (name == "SumSectionID") { return SumSectionID; }
+ else if (name == "Kind") { return Kind; }
+ else if (name == "NextDay") { return NextDay; }
+ else if (name == "AgentID") { return AgentID; }
+ else if (name == "AgentBranchID") { return AgentBranchID; }
+ else if (name == "PointFlg") { return PointFlg; }
+ else if (name == "PointInTax") { return PointInTax; }
+ else if (name == "PointRate") { return PointRate; }
+ else if (name == "PointPrice") { return PointPrice; }
+ else if (name == "PointSumType") { return PointSumType; }
+ else if (name == "Point") { return Point; }
+ else if (name == "DayUse") { return DayUse; }
+ else if (name == "ReceiptPrtType") { return ReceiptPrtType; }
+ else if (name == "LongStayFlg") { return LongStayFlg; }
+ else if (name == "RentalType") { return RentalType; }
+ else if (name == "TraderID") { return TraderID; }
+ else if (name == "TraderMemo") { return TraderMemo; }
+ else if (name == "PackFlg") { return PackFlg; }
+ else if (name == "SortID") { return SortID; }
+ else if (name == "Fraction") { return Fraction; }
+ else if (name == "InRoomSales") { return InRoomSales; }
+ else if (name == "MealType") { return MealType; }
+ else if (name == "UseType") { return UseType; }
+ else if (name == "PersonType") { return PersonType; }
+ else if (name == "Parking") { return Parking; }
+ else if (name == "HallFee") { return HallFee; }
+ else if (name == "UpdateDate") { return UpdateDate; }
+ else if (name == "UpdateLoginID") { return UpdateLoginID; }
+ else if (name == "UpdatePcName") { return UpdatePcName; }
+ else if (name == "UpdateID") { return UpdateID; }
+ else { return null; }
+ }
+
+ public override bool SetField(string name, object value)
+ {
+
+ if (name == "ID") { ID = value.ToString(); return true; }
+ else if (name == "Name") { Name = value.ToString(); return true; }
+ else if (name == "EnName") { EnName = value.ToString(); return true; }
+ else if (name == "Name2") { Name2 = value.ToString(); return true; }
+ else if (name == "ReceiptName") { ReceiptName = value.ToString(); return true; }
+ else if (name == "RoomTypeID") { RoomTypeID = CConvert.ToInt(value); return true; }
+ else if (name == "PersonCount") { PersonCount = CConvert.ToInt(value); return true; }
+ else if (name == "Price") { Price = CConvert.ToDecimal(value); return true; }
+ else if (name == "DiscountRate") { DiscountRate = CConvert.ToDecimal(value); return true; }
+ else if (name == "DiscountSummary") { DiscountSummary = CConvert.ToDecimal(value); return true; }
+ else if (name == "DiscountID") { DiscountID = CConvert.ToInt(value); return true; }
+ else if (name == "ServiceIOType") { ServiceIOType = CConvert.ToInt(value); return true; }
+ else if (name == "ServiceRate") { ServiceRate = CConvert.ToDecimal(value); return true; }
+ else if (name == "TaxType") { TaxType = CConvert.ToInt(value); return true; }
+ else if (name == "TaxIOType") { TaxIOType = CConvert.ToInt(value); return true; }
+ else if (name == "BathTaxIOType") { BathTaxIOType = CConvert.ToInt(value); return true; }
+ else if (name == "AccTaxIOType") { AccTaxIOType = CConvert.ToInt(value); return true; }
+ else if (name == "SaleSectionID") { SaleSectionID = CConvert.ToInt(value); return true; }
+ else if (name == "SumSectionID") { SumSectionID = CConvert.ToInt(value); return true; }
+ else if (name == "Kind") { Kind = CConvert.ToInt(value); return true; }
+ else if (name == "NextDay") { NextDay = CConvert.ToBool(value); return true; }
+ else if (name == "AgentID") { AgentID = CConvert.ToInt(value); return true; }
+ else if (name == "AgentBranchID") { AgentBranchID = CConvert.ToInt(value); return true; }
+ else if (name == "PointFlg") { PointFlg = CConvert.ToBool(value); return true; }
+ else if (name == "PointInTax") { PointInTax = CConvert.ToBool(value); return true; }
+ else if (name == "PointRate") { PointRate = CConvert.ToDecimal(value); return true; }
+ else if (name == "PointPrice") { PointPrice = CConvert.ToInt(value); return true; }
+ else if (name == "PointSumType") { PointSumType = CConvert.ToInt(value); return true; }
+ else if (name == "Point") { Point = CConvert.ToInt(value); return true; }
+ else if (name == "DayUse") { DayUse = CConvert.ToBool(value); return true; }
+ else if (name == "ReceiptPrtType") { ReceiptPrtType = CConvert.ToInt(value); return true; }
+ else if (name == "LongStayFlg") { LongStayFlg = CConvert.ToBool(value); return true; }
+ else if (name == "RentalType") { RentalType = CConvert.ToInt(value); return true; }
+ else if (name == "TraderID") { TraderID = CConvert.ToInt(value); return true; }
+ else if (name == "TraderMemo") { TraderMemo = value.ToString(); return true; }
+ else if (name == "PackFlg") { PackFlg = CConvert.ToBool(value); return true; }
+ else if (name == "SortID") { SortID = CConvert.ToInt(value); return true; }
+ else if (name == "Fraction") { Fraction = CConvert.ToInt(value); return true; }
+ else if (name == "InRoomSales") { InRoomSales = CConvert.ToBool(value); return true; }
+ else if (name == "MealType") { MealType = CConvert.ToInt(value); return true; }
+ else if (name == "UseType") { UseType = CConvert.ToInt(value); return true; }
+ else if (name == "PersonType") { PersonType = CConvert.ToInt(value); return true; }
+ else if (name == "Parking") { Parking = CConvert.ToBool(value); return true; }
+ else if (name == "HallFee") { HallFee = CConvert.ToBool(value); return true; }
+ else if (name == "UpdateDate") { UpdateDate = CConvert.ToTimestamp(CConvert.ToDateTime(value)); return true; }
+ else if (name == "UpdateLoginID") { UpdateLoginID = CConvert.ToInt(value); return true; }
+ else if (name == "UpdatePcName") { UpdatePcName = value.ToString(); return true; }
+ else if (name == "UpdateID") { UpdateID = CConvert.ToInt(value); return true; }
+ else { return false; }
+ }
+
+ #endregion
+}
\ No newline at end of file
diff --git a/ProtosExpan/Master/ItemTable.cs b/ProtosExpan/Master/ItemTable.cs
new file mode 100644
index 0000000..1aa6a99
--- /dev/null
+++ b/ProtosExpan/Master/ItemTable.cs
@@ -0,0 +1,42 @@
+using HotelPms.Share.Util;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Diagnostics;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HotelPms.Data.Master;
+
+public partial class ItemTable
+{
+ /// <summary>
+ /// 自動データテーブル生成
+ /// </summary>
+ /// <returns></returns>
+ public DataTable ToDataTable()
+ {
+ DataTable dataTable = new DataTable();
+ dataTable.TableName = Name;
+ PropertyInfo[] myInfo = typeof(Item).GetProperties(BindingFlags.Public | BindingFlags.Instance);
+ foreach (PropertyInfo item in myInfo)
+ {
+ System.Diagnostics.Debug.WriteLine(item.Name);
+
+ Attribute attribute = item.GetCustomAttribute(typeof(DebuggerNonUserCodeAttribute));
+ if (attribute == null) { continue; }
+ dataTable.Columns.Add(item.Name, item.PropertyType);
+ }
+
+ //データ
+ foreach (Item row in Rows)
+ {
+ DataRow dtRow = dataTable.NewRow();
+ row.ToDataRow(dtRow);
+ dataTable.Rows.Add(dtRow);
+ }
+ return dataTable;
+ }
+}
diff --git a/ProtosExpan/Master/Option.cs b/ProtosExpan/Master/Option.cs
new file mode 100644
index 0000000..f0c9d04
--- /dev/null
+++ b/ProtosExpan/Master/Option.cs
@@ -0,0 +1,148 @@
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Text;
+using HotelPms.Share.Data;
+using HotelPms.Share.Util;
+using Google.Protobuf.WellKnownTypes;
+using customTypes;
+using System.Data.Common;
+
+namespace HotelPms.Data.Master
+{
+ /// ****************************** Description *******************************
+ /// ◇システム名称
+ /// ホテルPMS
+ /// ◇概要
+ ///
+ /// ◇履歴
+ /// 2021/05/14 コード作成ツール 自動作成
+ /// ****************************** Declarations ******************************
+ [Serializable()]
+ public partial class Option : RecordBase
+ {
+ #region ★★★★★ Property ★★★★★
+
+ public static ConcurrentDictionary<string, int> PrimaryKey { get; } = new ConcurrentDictionary<string, int>();
+
+ #endregion
+
+ partial void OnConstruction()
+ {
+ if (PrimaryKey.Count == 0)
+ {
+ PrimaryKey.TryAdd("Type", 0);
+ PrimaryKey.TryAdd("Key", 0);
+
+ }
+ }
+
+ #region ★★★★★ Function ★★★★★
+
+ public bool CompareTo(Option item)
+ {
+ if (Type.CompareTo(item.Type) != 0
+ || Key.CompareTo(item.Key) != 0
+ || Value.CompareTo(item.Value) != 0
+)
+ {
+ return false;
+ }
+ return true;
+ }
+
+
+ public override void CopyTo(object dest)
+ {
+ Option item = dest as Option;
+ item.Type = Type;
+ item.Key = Key;
+ item.Value = Value;
+
+ }
+
+ public override void Clear()
+ {
+ Type = string.Empty;
+ Key = string.Empty;
+ Value = string.Empty;
+
+ }
+
+ public Option DeepClone()
+ {
+ Option item = new Option();
+ item.Type = Type;
+ item.Key = Key;
+ item.Value = Value;
+
+ return item;
+ }
+
+ public override bool ConvertDataRow(System.Data.DataRow row)
+ {
+ Type = row["Type"].ToString();
+ Key = row["Key"].ToString();
+ Value = row["Value"].ToString();
+
+ return true;
+ }
+
+ public void ToDataRow(System.Data.DataRow row)
+ {
+ row["Type"] = Type;
+ row["Key"] = Key;
+ row["Value"] = Value;
+
+ }
+
+ public void ConvertReader(DbDataReader row)
+ {
+ Type = row["Type"].ToString();
+ Key = row["Key"].ToString();
+ Value = row["Value"].ToString();
+
+ }
+
+ public string AddSql()
+ {
+ return $@"INSERT INTO S_Option(Type,Key,Value) VALUES(N'{Type}',N'{Key}',N'{Value}');";
+ }
+
+ public string UpdateSql()
+ {
+ return $@"UPDATE S_Option SET Value = N'{Value}' WHERE Type = N'{Type}' AND Key = N'{Key}';";
+ }
+
+ public string ToText()
+ {
+ StringBuilder text = new StringBuilder();
+ text.AppendFormat("Type={0};", Type);
+ text.AppendFormat("Key={0};", Key);
+ text.AppendFormat("Value={0};", Value);
+
+ return text.ToString();
+ }
+
+ public override object GetField(string name)
+ {
+
+ if (name == "Type") { return Type; }
+ else if (name == "Key") { return Key; }
+ else if (name == "Value") { return Value; }
+ else { return null; }
+ }
+
+ public override bool SetField(string name, object value)
+ {
+
+ if (name == "Type") { Type = value.ToString(); return true; }
+ else if (name == "Key") { Key = value.ToString(); return true; }
+ else if (name == "Value") { Value = value.ToString(); return true; }
+ else { return false; }
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/ProtosExpan/Master/OptionTable.cs b/ProtosExpan/Master/OptionTable.cs
new file mode 100644
index 0000000..eb0323e
--- /dev/null
+++ b/ProtosExpan/Master/OptionTable.cs
@@ -0,0 +1,43 @@
+using HotelPms.Share.Util;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Diagnostics;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HotelPms.Data.Master
+{
+ public partial class OptionTable
+ {
+ /// <summary>
+ /// 自動データテーブル生成
+ /// </summary>
+ /// <returns></returns>
+ public DataTable ToDataTable()
+ {
+ DataTable dataTable = new DataTable();
+ dataTable.TableName = Name;
+ PropertyInfo[] myInfo = typeof(Option).GetProperties(BindingFlags.Public | BindingFlags.Instance);
+ foreach (PropertyInfo item in myInfo)
+ {
+ System.Diagnostics.Debug.WriteLine(item.Name);
+
+ Attribute attribute = item.GetCustomAttribute(typeof(DebuggerNonUserCodeAttribute));
+ if (attribute == null) { continue; }
+ dataTable.Columns.Add(item.Name, item.PropertyType);
+ }
+
+ //データ
+ foreach (Option row in Rows)
+ {
+ DataRow dtRow = dataTable.NewRow();
+ row.ToDataRow(dtRow);
+ dataTable.Rows.Add(dtRow);
+ }
+ return dataTable;
+ }
+ }
+}
diff --git a/ProtosExpan/Master/Output.cs b/ProtosExpan/Master/Output.cs
new file mode 100644
index 0000000..c209a96
--- /dev/null
+++ b/ProtosExpan/Master/Output.cs
@@ -0,0 +1,240 @@
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Text;
+using HotelPms.Share.Data;
+using HotelPms.Share.Util;
+using Google.Protobuf.WellKnownTypes;
+using customTypes;
+using System.Data.Common;
+
+namespace HotelPms.Data.Master
+{
+ /// ****************************** Description *******************************
+ /// ◇システム名称
+ /// ホテルPMS
+ /// ◇概要
+ ///
+ /// ◇履歴
+ /// 2021/05/14 コード作成ツール 自動作成
+ /// ****************************** Declarations ******************************
+ [Serializable()]
+ public partial class Output : RecordBase
+ {
+ #region ★★★★★ Property ★★★★★
+
+ public static ConcurrentDictionary<string, int> PrimaryKey { get; } = new ConcurrentDictionary<string, int>();
+
+ #endregion
+
+ partial void OnConstruction()
+ {
+ if (PrimaryKey.Count == 0)
+ {
+ PrimaryKey.TryAdd("MachineName", 0);
+ PrimaryKey.TryAdd("UserName", 0);
+ PrimaryKey.TryAdd("ReportID", 0);
+ PrimaryKey.TryAdd("ID", 0);
+
+ }
+ }
+
+ #region ★★★★★ Function ★★★★★
+
+ public bool CompareTo(Output item)
+ {
+ if (MachineName.CompareTo(item.MachineName) != 0
+ || UserName.CompareTo(item.UserName) != 0
+ || ReportID.CompareTo(item.ReportID) != 0
+ || ID.CompareTo(item.ID) != 0
+ || Name.CompareTo(item.Name) != 0
+ || FixedID.CompareTo(item.FixedID) != 0
+ || Sort.CompareTo(item.Sort) != 0
+ || Tag.CompareTo(item.Tag) != 0
+ || UpdateDate.CompareTo(item.UpdateDate) != 0
+ || UpdateLoginID.CompareTo(item.UpdateLoginID) != 0
+ || UpdatePcName.CompareTo(item.UpdatePcName) != 0
+ || UpdateID.CompareTo(item.UpdateID) != 0
+)
+ {
+ return false;
+ }
+ return true;
+ }
+
+
+ public override void CopyTo(object dest)
+ {
+ Output item = dest as Output;
+ item.MachineName = MachineName;
+ item.UserName = UserName;
+ item.ReportID = ReportID;
+ item.ID = ID;
+ item.Name = Name;
+ item.FixedID = FixedID;
+ item.Sort = Sort;
+ item.Tag = Tag;
+ item.UpdateDate = UpdateDate;
+ item.UpdateLoginID = UpdateLoginID;
+ item.UpdatePcName = UpdatePcName;
+ item.UpdateID = UpdateID;
+
+ }
+
+ public override void Clear()
+ {
+ MachineName = string.Empty;
+ UserName = string.Empty;
+ ReportID = 0;
+ ID = 0;
+ Name = string.Empty;
+ FixedID = 0;
+ Sort = string.Empty;
+ Tag = string.Empty;
+ UpdateDate = CConvert.ToTimestamp(DateTime.MinValue);
+ UpdateLoginID = 0;
+ UpdatePcName = string.Empty;
+ UpdateID = 0;
+
+ }
+
+ public Output DeepClone()
+ {
+ Output item = new Output();
+ item.MachineName = MachineName;
+ item.UserName = UserName;
+ item.ReportID = ReportID;
+ item.ID = ID;
+ item.Name = Name;
+ item.FixedID = FixedID;
+ item.Sort = Sort;
+ item.Tag = Tag;
+ item.UpdateDate = UpdateDate;
+ item.UpdateLoginID = UpdateLoginID;
+ item.UpdatePcName = UpdatePcName;
+ item.UpdateID = UpdateID;
+
+ return item;
+ }
+
+ public override bool ConvertDataRow(System.Data.DataRow row)
+ {
+ MachineName = row["MachineName"].ToString();
+ UserName = row["UserName"].ToString();
+ ReportID = CConvert.ToInt(row["ReportID"],ReportID);
+ ID = CConvert.ToInt(row["ID"],ID);
+ Name = row["Name"].ToString();
+ FixedID = CConvert.ToInt(row["FixedID"],FixedID);
+ Sort = row["Sort"].ToString();
+ Tag = row["Tag"].ToString();
+ //UpdateDate = CConvert.ToTimestamp(row.IsNull("UpdateDate") ? DateTime.MinValue : (System.DateTime)row["UpdateDate"]);
+ //UpdateLoginID = CConvert.ToInt(row["UpdateLoginID"],UpdateLoginID);
+ //UpdatePcName = row["UpdatePcName"].ToString();
+ //UpdateID = CConvert.ToInt(row["UpdateID"],UpdateID);
+
+ return true;
+ }
+
+ public void ToDataRow(System.Data.DataRow row)
+ {
+ row["MachineName"] = MachineName;
+ row["UserName"] = UserName;
+ row["ReportID"] = ReportID;
+ row["ID"] = ID;
+ row["Name"] = Name;
+ row["FixedID"] = FixedID;
+ row["Sort"] = Sort;
+ row["Tag"] = Tag;
+ row["UpdateDate"] = UpdateDate.ToDateTime();
+ row["UpdateLoginID"] = UpdateLoginID;
+ row["UpdatePcName"] = UpdatePcName;
+ row["UpdateID"] = UpdateID;
+
+ }
+
+ public void ConvertReader(DbDataReader row)
+ {
+ MachineName = row["MachineName"].ToString();
+ UserName = row["UserName"].ToString();
+ ReportID = CConvert.ToInt(row["ReportID"],ReportID);
+ ID = CConvert.ToInt(row["ID"],ID);
+ Name = row["Name"].ToString();
+ FixedID = CConvert.ToInt(row["FixedID"],FixedID);
+ Sort = row["Sort"].ToString();
+ Tag = row["Tag"].ToString();
+ UpdateDate = CConvert.ToTimestamp(row.IsNull("UpdateDate") ? DateTime.MinValue : (System.DateTime)row["UpdateDate"]);
+ UpdateLoginID = CConvert.ToInt(row["UpdateLoginID"],UpdateLoginID);
+ UpdatePcName = row["UpdatePcName"].ToString();
+ UpdateID = CConvert.ToInt(row["UpdateID"],UpdateID);
+
+ }
+
+ public string AddSql()
+ {
+ return $@"INSERT INTO M_Output(MachineName,UserName,ReportID,ID,Name,FixedID,Sort,Tag,UpdateDate,UpdateLoginID,UpdatePcName,UpdateID) VALUES(N'{MachineName}',N'{UserName}',{ReportID},{ID},N'{Name}',{FixedID},N'{Sort}',N'{Tag}',GETDATE(),{UpdateLoginID},N'{UpdatePcName}',{UpdateID});";
+ }
+
+ public string UpdateSql()
+ {
+ return $@"UPDATE M_Output SET Name = N'{Name}',FixedID = {FixedID},Sort = N'{Sort}',Tag = N'{Tag}',UpdateDate = GETDATE(),UpdateLoginID = {UpdateLoginID},UpdatePcName = N'{UpdatePcName}',UpdateID = {UpdateID} WHERE MachineName = N'{MachineName}' AND UserName = N'{UserName}' AND ReportID = {ReportID} AND ID = {ID};";
+ }
+
+ public string ToText()
+ {
+ StringBuilder text = new StringBuilder();
+ text.AppendFormat("MachineName={0};", MachineName);
+ text.AppendFormat("UserName={0};", UserName);
+ text.AppendFormat("ReportID={0};", ReportID);
+ text.AppendFormat("ID={0};", ID);
+ text.AppendFormat("Name={0};", Name);
+ text.AppendFormat("FixedID={0};", FixedID);
+ text.AppendFormat("Sort={0};", Sort);
+ text.AppendFormat("Tag={0};", Tag);
+ text.AppendFormat("UpdateDate={0};", UpdateDate);
+ text.AppendFormat("UpdateLoginID={0};", UpdateLoginID);
+ text.AppendFormat("UpdatePcName={0};", UpdatePcName);
+ text.AppendFormat("UpdateID={0};", UpdateID);
+
+ return text.ToString();
+ }
+
+ public override object GetField(string name)
+ {
+
+ if (name == "MachineName") { return MachineName; }
+ else if (name == "UserName") { return UserName; }
+ else if (name == "ReportID") { return ReportID; }
+ else if (name == "ID") { return ID; }
+ else if (name == "Name") { return Name; }
+ else if (name == "FixedID") { return FixedID; }
+ else if (name == "Sort") { return Sort; }
+ else if (name == "Tag") { return Tag; }
+ else if (name == "UpdateDate") { return UpdateDate; }
+ else if (name == "UpdateLoginID") { return UpdateLoginID; }
+ else if (name == "UpdatePcName") { return UpdatePcName; }
+ else if (name == "UpdateID") { return UpdateID; }
+ else { return null; }
+ }
+
+ public override bool SetField(string name, object value)
+ {
+
+ if (name == "MachineName") { MachineName = value.ToString(); return true; }
+ else if (name == "UserName") { UserName = value.ToString(); return true; }
+ else if (name == "ReportID") { ReportID = CConvert.ToInt(value); return true; }
+ else if (name == "ID") { ID = CConvert.ToInt(value); return true; }
+ else if (name == "Name") { Name = value.ToString(); return true; }
+ else if (name == "FixedID") { FixedID = CConvert.ToInt(value); return true; }
+ else if (name == "Sort") { Sort = value.ToString(); return true; }
+ else if (name == "Tag") { Tag = value.ToString(); return true; }
+ else if (name == "UpdateDate") { UpdateDate = CConvert.ToTimestamp(CConvert.ToDateTime(value)); return true; }
+ else if (name == "UpdateLoginID") { UpdateLoginID = CConvert.ToInt(value); return true; }
+ else if (name == "UpdatePcName") { UpdatePcName = value.ToString(); return true; }
+ else if (name == "UpdateID") { UpdateID = CConvert.ToInt(value); return true; }
+ else { return false; }
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/ProtosExpan/Master/OutputItem.cs b/ProtosExpan/Master/OutputItem.cs
new file mode 100644
index 0000000..d49a8e1
--- /dev/null
+++ b/ProtosExpan/Master/OutputItem.cs
@@ -0,0 +1,201 @@
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Text;
+using HotelPms.Share.Data;
+using HotelPms.Share.Util;
+using Google.Protobuf.WellKnownTypes;
+using customTypes;
+using System.Data.Common;
+
+namespace HotelPms.Data.Master
+{
+ /// ****************************** Description *******************************
+ /// ◇システム名称
+ /// ホテルPMS
+ /// ◇概要
+ ///
+ /// ◇履歴
+ /// 2021/05/14 コード作成ツール 自動作成
+ /// ****************************** Declarations ******************************
+ [Serializable()]
+ public partial class OutputItem : RecordBase
+ {
+ #region ★★★★★ Property ★★★★★
+
+ public static ConcurrentDictionary<string, int> PrimaryKey { get; } = new ConcurrentDictionary<string, int>();
+
+ #endregion
+
+ partial void OnConstruction()
+ {
+ if (PrimaryKey.Count == 0)
+ {
+ PrimaryKey.TryAdd("MachineName", 0);
+ PrimaryKey.TryAdd("UserName", 0);
+ PrimaryKey.TryAdd("ReportID", 0);
+ PrimaryKey.TryAdd("OutputID", 0);
+ PrimaryKey.TryAdd("ID", 0);
+
+ }
+ }
+
+ #region ★★★★★ Function ★★★★★
+
+ public bool CompareTo(OutputItem item)
+ {
+ if (MachineName.CompareTo(item.MachineName) != 0
+ || UserName.CompareTo(item.UserName) != 0
+ || ReportID.CompareTo(item.ReportID) != 0
+ || OutputID.CompareTo(item.OutputID) != 0
+ || ID.CompareTo(item.ID) != 0
+ || Name.CompareTo(item.Name) != 0
+ || Width.CompareTo(item.Width) != 0
+ || Tag.CompareTo(item.Tag) != 0
+)
+ {
+ return false;
+ }
+ return true;
+ }
+
+
+ public override void CopyTo(object dest)
+ {
+ OutputItem item = dest as OutputItem;
+ item.MachineName = MachineName;
+ item.UserName = UserName;
+ item.ReportID = ReportID;
+ item.OutputID = OutputID;
+ item.ID = ID;
+ item.Name = Name;
+ item.Width = Width;
+ item.Tag = Tag;
+
+ }
+
+ public override void Clear()
+ {
+ MachineName = string.Empty;
+ UserName = string.Empty;
+ ReportID = 0;
+ OutputID = 0;
+ ID = 0;
+ Name = string.Empty;
+ Width = 0;
+ Tag = string.Empty;
+
+ }
+
+ public OutputItem DeepClone()
+ {
+ OutputItem item = new OutputItem();
+ item.MachineName = MachineName;
+ item.UserName = UserName;
+ item.ReportID = ReportID;
+ item.OutputID = OutputID;
+ item.ID = ID;
+ item.Name = Name;
+ item.Width = Width;
+ item.Tag = Tag;
+
+ return item;
+ }
+
+ public override bool ConvertDataRow(System.Data.DataRow row)
+ {
+ MachineName = row["MachineName"].ToString();
+ UserName = row["UserName"].ToString();
+ ReportID = CConvert.ToInt(row["ReportID"],ReportID);
+ OutputID = CConvert.ToInt(row["OutputID"],OutputID);
+ ID = CConvert.ToInt(row["ID"],ID);
+ Name = row["Name"].ToString();
+ Width = CConvert.ToFloat(row["Width"],Width);
+ Tag = row["Tag"].ToString();
+
+ return true;
+ }
+
+ public void ToDataRow(System.Data.DataRow row)
+ {
+ row["MachineName"] = MachineName;
+ row["UserName"] = UserName;
+ row["ReportID"] = ReportID;
+ row["OutputID"] = OutputID;
+ row["ID"] = ID;
+ row["Name"] = Name;
+ row["Width"] = Width;
+ row["Tag"] = Tag;
+
+ }
+
+ public void ConvertReader(DbDataReader row)
+ {
+ MachineName = row["MachineName"].ToString();
+ UserName = row["UserName"].ToString();
+ ReportID = CConvert.ToInt(row["ReportID"],ReportID);
+ OutputID = CConvert.ToInt(row["OutputID"],OutputID);
+ ID = CConvert.ToInt(row["ID"],ID);
+ Name = row["Name"].ToString();
+ Width = CConvert.ToFloat(row["Width"],Width);
+ Tag = row["Tag"].ToString();
+
+ }
+
+ public string AddSql()
+ {
+ return $@"INSERT INTO M_OutputItem(MachineName,UserName,ReportID,OutputID,ID,Name,Width,Tag) VALUES(N'{MachineName}',N'{UserName}',{ReportID},{OutputID},{ID},N'{Name}',{Width},N'{Tag}');";
+ }
+
+ public string UpdateSql()
+ {
+ return $@"UPDATE M_OutputItem SET Name = N'{Name}',Width = {Width},Tag = N'{Tag}' WHERE MachineName = N'{MachineName}' AND UserName = N'{UserName}' AND ReportID = {ReportID} AND OutputID = {OutputID} AND ID = {ID};";
+ }
+
+ public string ToText()
+ {
+ StringBuilder text = new StringBuilder();
+ text.AppendFormat("MachineName={0};", MachineName);
+ text.AppendFormat("UserName={0};", UserName);
+ text.AppendFormat("ReportID={0};", ReportID);
+ text.AppendFormat("OutputID={0};", OutputID);
+ text.AppendFormat("ID={0};", ID);
+ text.AppendFormat("Name={0};", Name);
+ text.AppendFormat("Width={0};", Width);
+ text.AppendFormat("Tag={0};", Tag);
+
+ return text.ToString();
+ }
+
+ public override object GetField(string name)
+ {
+
+ if (name == "MachineName") { return MachineName; }
+ else if (name == "UserName") { return UserName; }
+ else if (name == "ReportID") { return ReportID; }
+ else if (name == "OutputID") { return OutputID; }
+ else if (name == "ID") { return ID; }
+ else if (name == "Name") { return Name; }
+ else if (name == "Width") { return Width; }
+ else if (name == "Tag") { return Tag; }
+ else { return null; }
+ }
+
+ public override bool SetField(string name, object value)
+ {
+
+ if (name == "MachineName") { MachineName = value.ToString(); return true; }
+ else if (name == "UserName") { UserName = value.ToString(); return true; }
+ else if (name == "ReportID") { ReportID = CConvert.ToInt(value); return true; }
+ else if (name == "OutputID") { OutputID = CConvert.ToInt(value); return true; }
+ else if (name == "ID") { ID = CConvert.ToInt(value); return true; }
+ else if (name == "Name") { Name = value.ToString(); return true; }
+ else if (name == "Width") { Width = CConvert.ToFloat(value); return true; }
+ else if (name == "Tag") { Tag = value.ToString(); return true; }
+ else { return false; }
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/ProtosExpan/Master/OutputItemTable.cs b/ProtosExpan/Master/OutputItemTable.cs
new file mode 100644
index 0000000..d84e6af
--- /dev/null
+++ b/ProtosExpan/Master/OutputItemTable.cs
@@ -0,0 +1,43 @@
+using HotelPms.Share.Util;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Diagnostics;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HotelPms.Data.Master
+{
+ public partial class OutputItemTable
+ {
+ /// <summary>
+ /// 自動データテーブル生成
+ /// </summary>
+ /// <returns></returns>
+ public DataTable ToDataTable()
+ {
+ DataTable dataTable = new DataTable();
+ dataTable.TableName = Name;
+ PropertyInfo[] myInfo = typeof(OutputItem).GetProperties(BindingFlags.Public | BindingFlags.Instance);
+ foreach (PropertyInfo item in myInfo)
+ {
+ System.Diagnostics.Debug.WriteLine(item.Name);
+
+ Attribute attribute = item.GetCustomAttribute(typeof(DebuggerNonUserCodeAttribute));
+ if (attribute == null) { continue; }
+ dataTable.Columns.Add(item.Name, item.PropertyType);
+ }
+
+ //データ
+ foreach (OutputItem row in Rows)
+ {
+ DataRow dtRow = dataTable.NewRow();
+ row.ToDataRow(dtRow);
+ dataTable.Rows.Add(dtRow);
+ }
+ return dataTable;
+ }
+ }
+}
diff --git a/ProtosExpan/Master/OutputTable.cs b/ProtosExpan/Master/OutputTable.cs
new file mode 100644
index 0000000..7b1d2a8
--- /dev/null
+++ b/ProtosExpan/Master/OutputTable.cs
@@ -0,0 +1,43 @@
+using HotelPms.Share.Util;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Diagnostics;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HotelPms.Data.Master
+{
+ public partial class OutputTable
+ {
+ /// <summary>
+ /// 自動データテーブル生成
+ /// </summary>
+ /// <returns></returns>
+ public DataTable ToDataTable()
+ {
+ DataTable dataTable = new DataTable();
+ dataTable.TableName = Name;
+ PropertyInfo[] myInfo = typeof(Output).GetProperties(BindingFlags.Public | BindingFlags.Instance);
+ foreach (PropertyInfo item in myInfo)
+ {
+ System.Diagnostics.Debug.WriteLine(item.Name);
+
+ Attribute attribute = item.GetCustomAttribute(typeof(DebuggerNonUserCodeAttribute));
+ if (attribute == null) { continue; }
+ dataTable.Columns.Add(item.Name, item.PropertyType);
+ }
+
+ //データ
+ foreach (Output row in Rows)
+ {
+ DataRow dtRow = dataTable.NewRow();
+ row.ToDataRow(dtRow);
+ dataTable.Rows.Add(dtRow);
+ }
+ return dataTable;
+ }
+ }
+}
diff --git a/ProtosExpan/Master/RoomCell.cs b/ProtosExpan/Master/RoomCell.cs
new file mode 100644
index 0000000..3636c68
--- /dev/null
+++ b/ProtosExpan/Master/RoomCell.cs
@@ -0,0 +1,298 @@
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Text;
+using HotelPms.Share.Data;
+using HotelPms.Share.Util;
+using Google.Protobuf.WellKnownTypes;
+using customTypes;
+using System.Data.Common;
+
+namespace HotelPms.Data.Master
+{
+ /// ****************************** Description *******************************
+ /// ◇システム名称
+ /// ホテルPMS
+ /// ◇概要
+ ///
+ /// ◇履歴
+ /// 2021/05/14 コード作成ツール 自動作成
+ /// ****************************** Declarations ******************************
+ [Serializable()]
+ public partial class RoomCell : RecordBase
+ {
+ #region ★★★★★ Property ★★★★★
+
+ public static ConcurrentDictionary<string, int> PrimaryKey { get; } = new ConcurrentDictionary<string, int>();
+
+ #endregion
+
+ partial void OnConstruction()
+ {
+ if (PrimaryKey.Count == 0)
+ {
+ PrimaryKey.TryAdd("TabID", 0);
+ PrimaryKey.TryAdd("CtrlName", 0);
+
+ }
+ }
+
+ #region ★★★★★ Function ★★★★★
+
+ public bool CompareTo(RoomCell item)
+ {
+ if (TabID.CompareTo(item.TabID) != 0
+ || CtrlName.CompareTo(item.CtrlName) != 0
+ || ID.CompareTo(item.ID) != 0
+ || Content.CompareTo(item.Content) != 0
+ || TextAlign.CompareTo(item.TextAlign) != 0
+ || Top.CompareTo(item.Top) != 0
+ || Left.CompareTo(item.Left) != 0
+ || Width.CompareTo(item.Width) != 0
+ || Heigh.CompareTo(item.Heigh) != 0
+ || BackColor.CompareTo(item.BackColor) != 0
+ || ForeColor.CompareTo(item.ForeColor) != 0
+ || BorderStyle.CompareTo(item.BorderStyle) != 0
+ || FontName.CompareTo(item.FontName) != 0
+ || FontSize.CompareTo(item.FontSize) != 0
+ || FontBold.CompareTo(item.FontBold) != 0
+ || FontItalic.CompareTo(item.FontItalic) != 0
+ || FontUnderline.CompareTo(item.FontUnderline) != 0
+ || Memo.CompareTo(item.Memo) != 0
+)
+ {
+ return false;
+ }
+ return true;
+ }
+
+
+ public override void CopyTo(object dest)
+ {
+ RoomCell item = dest as RoomCell;
+ item.TabID = TabID;
+ item.CtrlName = CtrlName;
+ item.ID = ID;
+ item.Content = Content;
+ item.TextAlign = TextAlign;
+ item.Top = Top;
+ item.Left = Left;
+ item.Width = Width;
+ item.Heigh = Heigh;
+ item.BackColor = BackColor;
+ item.ForeColor = ForeColor;
+ item.BorderStyle = BorderStyle;
+ item.FontName = FontName;
+ item.FontSize = FontSize;
+ item.FontBold = FontBold;
+ item.FontItalic = FontItalic;
+ item.FontUnderline = FontUnderline;
+ item.Memo = Memo;
+
+ }
+
+ public override void Clear()
+ {
+ TabID = 0;
+ CtrlName = string.Empty;
+ ID = 0;
+ Content = string.Empty;
+ TextAlign = 0;
+ Top = 0;
+ Left = 0;
+ Width = 0;
+ Heigh = 0;
+ BackColor = string.Empty;
+ ForeColor = string.Empty;
+ BorderStyle = 0;
+ FontName = string.Empty;
+ FontSize = 0;
+ FontBold = false;
+ FontItalic = false;
+ FontUnderline = false;
+ Memo = string.Empty;
+
+ }
+
+ public RoomCell DeepClone()
+ {
+ RoomCell item = new RoomCell();
+ item.TabID = TabID;
+ item.CtrlName = CtrlName;
+ item.ID = ID;
+ item.Content = Content;
+ item.TextAlign = TextAlign;
+ item.Top = Top;
+ item.Left = Left;
+ item.Width = Width;
+ item.Heigh = Heigh;
+ item.BackColor = BackColor;
+ item.ForeColor = ForeColor;
+ item.BorderStyle = BorderStyle;
+ item.FontName = FontName;
+ item.FontSize = FontSize;
+ item.FontBold = FontBold;
+ item.FontItalic = FontItalic;
+ item.FontUnderline = FontUnderline;
+ item.Memo = Memo;
+
+ return item;
+ }
+
+ public override bool ConvertDataRow(System.Data.DataRow row)
+ {
+ TabID = CConvert.ToInt(row["TabID"],TabID);
+ CtrlName = row["CtrlName"].ToString();
+ ID = CConvert.ToInt(row["ID"],ID);
+ Content = row["Content"].ToString();
+ TextAlign = CConvert.ToInt(row["TextAlign"],TextAlign);
+ Top = CConvert.ToFloat(row["Top"],Top);
+ Left = CConvert.ToFloat(row["Left"],Left);
+ Width = CConvert.ToFloat(row["Width"],Width);
+ Heigh = CConvert.ToFloat(row["Heigh"],Heigh);
+ BackColor = row["BackColor"].ToString();
+ ForeColor = row["ForeColor"].ToString();
+ BorderStyle = CConvert.ToInt(row["BorderStyle"],BorderStyle);
+ FontName = row["FontName"].ToString();
+ FontSize = CConvert.ToInt(row["FontSize"],FontSize);
+ FontBold = CConvert.ToBool(row["FontBold"]);
+ FontItalic = CConvert.ToBool(row["FontItalic"]);
+ FontUnderline = CConvert.ToBool(row["FontUnderline"]);
+ Memo = row["Memo"].ToString();
+
+ return true;
+ }
+
+ public void ToDataRow(System.Data.DataRow row)
+ {
+ row["TabID"] = TabID;
+ row["CtrlName"] = CtrlName;
+ row["ID"] = ID;
+ row["Content"] = Content;
+ row["TextAlign"] = TextAlign;
+ row["Top"] = Top;
+ row["Left"] = Left;
+ row["Width"] = Width;
+ row["Heigh"] = Heigh;
+ row["BackColor"] = BackColor;
+ row["ForeColor"] = ForeColor;
+ row["BorderStyle"] = BorderStyle;
+ row["FontName"] = FontName;
+ row["FontSize"] = FontSize;
+ row["FontBold"] = FontBold;
+ row["FontItalic"] = FontItalic;
+ row["FontUnderline"] = FontUnderline;
+ row["Memo"] = Memo;
+
+ }
+
+ public void ConvertReader(DbDataReader row)
+ {
+ TabID = CConvert.ToInt(row["TabID"],TabID);
+ CtrlName = row["CtrlName"].ToString();
+ ID = CConvert.ToInt(row["ID"],ID);
+ Content = row["Content"].ToString();
+ TextAlign = CConvert.ToInt(row["TextAlign"],TextAlign);
+ Top = CConvert.ToFloat(row["Top"],Top);
+ Left = CConvert.ToFloat(row["Left"],Left);
+ Width = CConvert.ToFloat(row["Width"],Width);
+ Heigh = CConvert.ToFloat(row["Heigh"],Heigh);
+ BackColor = row["BackColor"].ToString();
+ ForeColor = row["ForeColor"].ToString();
+ BorderStyle = CConvert.ToInt(row["BorderStyle"],BorderStyle);
+ FontName = row["FontName"].ToString();
+ FontSize = CConvert.ToInt(row["FontSize"],FontSize);
+ FontBold = CConvert.ToBool(row["FontBold"]);
+ FontItalic = CConvert.ToBool(row["FontItalic"]);
+ FontUnderline = CConvert.ToBool(row["FontUnderline"]);
+ Memo = row["Memo"].ToString();
+
+ }
+
+ public string AddSql()
+ {
+ return $@"INSERT INTO M_RoomCell(TabID,CtrlName,ID,Content,TextAlign,Top,Left,Width,Heigh,BackColor,ForeColor,BorderStyle,FontName,FontSize,FontBold,FontItalic,FontUnderline,Memo) VALUES({TabID},N'{CtrlName}',{ID},N'{Content}',{TextAlign},{Top},{Left},{Width},{Heigh},N'{BackColor}',N'{ForeColor}',{BorderStyle},N'{FontName}',{FontSize},{(FontBold ? 1 : 0)},{(FontItalic ? 1 : 0)},{(FontUnderline ? 1 : 0)},N'{Memo}');";
+ }
+
+ public string UpdateSql()
+ {
+ return $@"UPDATE M_RoomCell SET ID = {ID},Content = N'{Content}',TextAlign = {TextAlign},Top = {Top},Left = {Left},Width = {Width},Heigh = {Heigh},BackColor = N'{BackColor}',ForeColor = N'{ForeColor}',BorderStyle = {BorderStyle},FontName = N'{FontName}',FontSize = {FontSize},FontBold = {(FontBold ? 1 : 0)},FontItalic = {(FontItalic ? 1 : 0)},FontUnderline = {(FontUnderline ? 1 : 0)},Memo = N'{Memo}' WHERE TabID = {TabID} AND CtrlName = N'{CtrlName}';";
+ }
+
+ public string ToText()
+ {
+ StringBuilder text = new StringBuilder();
+ text.AppendFormat("TabID={0};", TabID);
+ text.AppendFormat("CtrlName={0};", CtrlName);
+ text.AppendFormat("ID={0};", ID);
+ text.AppendFormat("Content={0};", Content);
+ text.AppendFormat("TextAlign={0};", TextAlign);
+ text.AppendFormat("Top={0};", Top);
+ text.AppendFormat("Left={0};", Left);
+ text.AppendFormat("Width={0};", Width);
+ text.AppendFormat("Heigh={0};", Heigh);
+ text.AppendFormat("BackColor={0};", BackColor);
+ text.AppendFormat("ForeColor={0};", ForeColor);
+ text.AppendFormat("BorderStyle={0};", BorderStyle);
+ text.AppendFormat("FontName={0};", FontName);
+ text.AppendFormat("FontSize={0};", FontSize);
+ text.AppendFormat("FontBold={0};", FontBold);
+ text.AppendFormat("FontItalic={0};", FontItalic);
+ text.AppendFormat("FontUnderline={0};", FontUnderline);
+ text.AppendFormat("Memo={0};", Memo);
+
+ return text.ToString();
+ }
+
+ public override object GetField(string name)
+ {
+
+ if (name == "TabID") { return TabID; }
+ else if (name == "CtrlName") { return CtrlName; }
+ else if (name == "ID") { return ID; }
+ else if (name == "Content") { return Content; }
+ else if (name == "TextAlign") { return TextAlign; }
+ else if (name == "Top") { return Top; }
+ else if (name == "Left") { return Left; }
+ else if (name == "Width") { return Width; }
+ else if (name == "Heigh") { return Heigh; }
+ else if (name == "BackColor") { return BackColor; }
+ else if (name == "ForeColor") { return ForeColor; }
+ else if (name == "BorderStyle") { return BorderStyle; }
+ else if (name == "FontName") { return FontName; }
+ else if (name == "FontSize") { return FontSize; }
+ else if (name == "FontBold") { return FontBold; }
+ else if (name == "FontItalic") { return FontItalic; }
+ else if (name == "FontUnderline") { return FontUnderline; }
+ else if (name == "Memo") { return Memo; }
+ else { return null; }
+ }
+
+ public override bool SetField(string name, object value)
+ {
+
+ if (name == "TabID") { TabID = CConvert.ToInt(value); return true; }
+ else if (name == "CtrlName") { CtrlName = value.ToString(); return true; }
+ else if (name == "ID") { ID = CConvert.ToInt(value); return true; }
+ else if (name == "Content") { Content = value.ToString(); return true; }
+ else if (name == "TextAlign") { TextAlign = CConvert.ToInt(value); return true; }
+ else if (name == "Top") { Top = CConvert.ToFloat(value); return true; }
+ else if (name == "Left") { Left = CConvert.ToFloat(value); return true; }
+ else if (name == "Width") { Width = CConvert.ToFloat(value); return true; }
+ else if (name == "Heigh") { Heigh = CConvert.ToFloat(value); return true; }
+ else if (name == "BackColor") { BackColor = value.ToString(); return true; }
+ else if (name == "ForeColor") { ForeColor = value.ToString(); return true; }
+ else if (name == "BorderStyle") { BorderStyle = CConvert.ToInt(value); return true; }
+ else if (name == "FontName") { FontName = value.ToString(); return true; }
+ else if (name == "FontSize") { FontSize = CConvert.ToInt(value); return true; }
+ else if (name == "FontBold") { FontBold = CConvert.ToBool(value); return true; }
+ else if (name == "FontItalic") { FontItalic = CConvert.ToBool(value); return true; }
+ else if (name == "FontUnderline") { FontUnderline = CConvert.ToBool(value); return true; }
+ else if (name == "Memo") { Memo = value.ToString(); return true; }
+ else { return false; }
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/ProtosExpan/Master/RoomCellTable.cs b/ProtosExpan/Master/RoomCellTable.cs
new file mode 100644
index 0000000..c88eebd
--- /dev/null
+++ b/ProtosExpan/Master/RoomCellTable.cs
@@ -0,0 +1,43 @@
+using HotelPms.Share.Util;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Diagnostics;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HotelPms.Data.Master
+{
+ public partial class RoomCellTable
+ {
+ /// <summary>
+ /// 自動データテーブル生成
+ /// </summary>
+ /// <returns></returns>
+ public DataTable ToDataTable()
+ {
+ DataTable dataTable = new DataTable();
+ dataTable.TableName = Name;
+ PropertyInfo[] myInfo = typeof(RoomCell).GetProperties(BindingFlags.Public | BindingFlags.Instance);
+ foreach (PropertyInfo item in myInfo)
+ {
+ System.Diagnostics.Debug.WriteLine(item.Name);
+
+ Attribute attribute = item.GetCustomAttribute(typeof(DebuggerNonUserCodeAttribute));
+ if (attribute == null) { continue; }
+ dataTable.Columns.Add(item.Name, item.PropertyType);
+ }
+
+ //データ
+ foreach (RoomCell row in Rows)
+ {
+ DataRow dtRow = dataTable.NewRow();
+ row.ToDataRow(dtRow);
+ dataTable.Rows.Add(dtRow);
+ }
+ return dataTable;
+ }
+ }
+}
diff --git a/ProtosExpan/Master/RoomStatus.cs b/ProtosExpan/Master/RoomStatus.cs
new file mode 100644
index 0000000..6a4cb2b
--- /dev/null
+++ b/ProtosExpan/Master/RoomStatus.cs
@@ -0,0 +1,258 @@
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Text;
+using HotelPms.Share.Data;
+using HotelPms.Share.Util;
+using Google.Protobuf.WellKnownTypes;
+using customTypes;
+using System.Data.Common;
+
+namespace HotelPms.Data.Master
+{
+ /// ****************************** Description *******************************
+ /// ◇システム名称
+ /// ホテルPMS
+ /// ◇概要
+ ///
+ /// ◇履歴
+ /// 2021/05/14 コード作成ツール 自動作成
+ /// ****************************** Declarations ******************************
+ [Serializable()]
+ public partial class RoomStatus : RecordBase
+ {
+ #region ★★★★★ Property ★★★★★
+
+ public static ConcurrentDictionary<string, int> PrimaryKey { get; } = new ConcurrentDictionary<string, int>();
+
+ #endregion
+
+ partial void OnConstruction()
+ {
+ if (PrimaryKey.Count == 0)
+ {
+ PrimaryKey.TryAdd("ID", 0);
+
+ }
+ }
+
+ #region ★★★★★ Function ★★★★★
+
+ public bool CompareTo(RoomStatus item)
+ {
+ if (ID.CompareTo(item.ID) != 0
+ || Name.CompareTo(item.Name) != 0
+ || ShortName.CompareTo(item.ShortName) != 0
+ || EnName.CompareTo(item.EnName) != 0
+ || SortID.CompareTo(item.SortID) != 0
+ || ForeColor.CompareTo(item.ForeColor) != 0
+ || BackColor.CompareTo(item.BackColor) != 0
+ || MaidType.CompareTo(item.MaidType) != 0
+ || Selectable.CompareTo(item.Selectable) != 0
+ || Memo.CompareTo(item.Memo) != 0
+ || UpdateDate.CompareTo(item.UpdateDate) != 0
+ || UpdateLoginID.CompareTo(item.UpdateLoginID) != 0
+ || UpdatePcName.CompareTo(item.UpdatePcName) != 0
+ || UpdateID.CompareTo(item.UpdateID) != 0
+)
+ {
+ return false;
+ }
+ return true;
+ }
+
+
+ public override void CopyTo(object dest)
+ {
+ RoomStatus item = dest as RoomStatus;
+ item.ID = ID;
+ item.Name = Name;
+ item.ShortName = ShortName;
+ item.EnName = EnName;
+ item.SortID = SortID;
+ item.ForeColor = ForeColor;
+ item.BackColor = BackColor;
+ item.MaidType = MaidType;
+ item.Selectable = Selectable;
+ item.Memo = Memo;
+ item.UpdateDate = UpdateDate;
+ item.UpdateLoginID = UpdateLoginID;
+ item.UpdatePcName = UpdatePcName;
+ item.UpdateID = UpdateID;
+
+ }
+
+ public override void Clear()
+ {
+ ID = 0;
+ Name = string.Empty;
+ ShortName = string.Empty;
+ EnName = string.Empty;
+ SortID = 0;
+ ForeColor = string.Empty;
+ BackColor = string.Empty;
+ MaidType = 0;
+ Selectable = false;
+ Memo = string.Empty;
+ UpdateDate = CConvert.ToTimestamp(DateTime.MinValue);
+ UpdateLoginID = 0;
+ UpdatePcName = string.Empty;
+ UpdateID = 0;
+
+ }
+
+ public RoomStatus DeepClone()
+ {
+ RoomStatus item = new RoomStatus();
+ item.ID = ID;
+ item.Name = Name;
+ item.ShortName = ShortName;
+ item.EnName = EnName;
+ item.SortID = SortID;
+ item.ForeColor = ForeColor;
+ item.BackColor = BackColor;
+ item.MaidType = MaidType;
+ item.Selectable = Selectable;
+ item.Memo = Memo;
+ item.UpdateDate = UpdateDate;
+ item.UpdateLoginID = UpdateLoginID;
+ item.UpdatePcName = UpdatePcName;
+ item.UpdateID = UpdateID;
+
+ return item;
+ }
+
+ public override bool ConvertDataRow(System.Data.DataRow row)
+ {
+ ID = CConvert.ToInt(row["ID"],ID);
+ Name = row["Name"].ToString();
+ ShortName = row["ShortName"].ToString();
+ EnName = row["EnName"].ToString();
+ SortID = CConvert.ToInt(row["SortID"],SortID);
+ ForeColor = row["ForeColor"].ToString();
+ BackColor = row["BackColor"].ToString();
+ MaidType = CConvert.ToInt(row["MaidType"],MaidType);
+ Selectable = CConvert.ToBool(row["Selectable"]);
+ Memo = row["Memo"].ToString();
+ UpdateDate = CConvert.ToTimestamp(row.IsNull("UpdateDate") ? DateTime.MinValue : (System.DateTime)row["UpdateDate"]);
+ UpdateLoginID = CConvert.ToInt(row["UpdateLoginID"],UpdateLoginID);
+ UpdatePcName = row["UpdatePcName"].ToString();
+ UpdateID = CConvert.ToInt(row["UpdateID"],UpdateID);
+
+ return true;
+ }
+
+ public void ToDataRow(System.Data.DataRow row)
+ {
+ row["ID"] = ID;
+ row["Name"] = Name;
+ row["ShortName"] = ShortName;
+ row["EnName"] = EnName;
+ row["SortID"] = SortID;
+ row["ForeColor"] = ForeColor;
+ row["BackColor"] = BackColor;
+ row["MaidType"] = MaidType;
+ row["Selectable"] = Selectable;
+ row["Memo"] = Memo;
+ row["UpdateDate"] = UpdateDate.ToDateTime();
+ row["UpdateLoginID"] = UpdateLoginID;
+ row["UpdatePcName"] = UpdatePcName;
+ row["UpdateID"] = UpdateID;
+
+ }
+
+ public void ConvertReader(DbDataReader row)
+ {
+ int i = 0;
+ ID = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ Name = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ ShortName = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ EnName = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ SortID = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ ForeColor = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ BackColor = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ MaidType = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ Selectable = (bool)(row.IsDBNull(i) ? false : row.GetBoolean(i)); i++;
+ Memo = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ UpdateDate = CConvert.ToTimestamp(row.IsDBNull(i) ? DateTime.MinValue : row.GetDateTime(i)); i++;
+ UpdateLoginID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ UpdatePcName = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ UpdateID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+
+ }
+
+ public string AddSql()
+ {
+ return $@"INSERT INTO M_RoomStatus(ID,Name,ShortName,EnName,SortID,ForeColor,BackColor,MaidType,Selectable,Memo,UpdateDate,UpdateLoginID,UpdatePcName,UpdateID) VALUES({ID},N'{Name}',N'{ShortName}',N'{EnName}',{SortID},N'{ForeColor}',N'{BackColor}',{MaidType},{(Selectable ? 1 : 0)},N'{Memo}',GETDATE(),{UpdateLoginID},N'{UpdatePcName}',{UpdateID});";
+ }
+
+ public string UpdateSql()
+ {
+ return $@"UPDATE M_RoomStatus SET Name = N'{Name}',ShortName = N'{ShortName}',EnName = N'{EnName}',SortID = {SortID},ForeColor = N'{ForeColor}',BackColor = N'{BackColor}',MaidType = {MaidType},Selectable = {(Selectable ? 1 : 0)},Memo = N'{Memo}',UpdateDate = GETDATE(),UpdateLoginID = {UpdateLoginID},UpdatePcName = N'{UpdatePcName}',UpdateID = {UpdateID} WHERE ID = {ID};";
+ }
+
+ public string ToText()
+ {
+ StringBuilder text = new StringBuilder();
+ text.AppendFormat("ID={0};", ID);
+ text.AppendFormat("Name={0};", Name);
+ text.AppendFormat("ShortName={0};", ShortName);
+ text.AppendFormat("EnName={0};", EnName);
+ text.AppendFormat("SortID={0};", SortID);
+ text.AppendFormat("ForeColor={0};", ForeColor);
+ text.AppendFormat("BackColor={0};", BackColor);
+ text.AppendFormat("MaidType={0};", MaidType);
+ text.AppendFormat("Selectable={0};", Selectable);
+ text.AppendFormat("Memo={0};", Memo);
+ text.AppendFormat("UpdateDate={0};", UpdateDate);
+ text.AppendFormat("UpdateLoginID={0};", UpdateLoginID);
+ text.AppendFormat("UpdatePcName={0};", UpdatePcName);
+ text.AppendFormat("UpdateID={0};", UpdateID);
+
+ return text.ToString();
+ }
+
+ public override object GetField(string name)
+ {
+
+ if (name == "ID") { return ID; }
+ else if (name == "Name") { return Name; }
+ else if (name == "ShortName") { return ShortName; }
+ else if (name == "EnName") { return EnName; }
+ else if (name == "SortID") { return SortID; }
+ else if (name == "ForeColor") { return ForeColor; }
+ else if (name == "BackColor") { return BackColor; }
+ else if (name == "MaidType") { return MaidType; }
+ else if (name == "Selectable") { return Selectable; }
+ else if (name == "Memo") { return Memo; }
+ else if (name == "UpdateDate") { return UpdateDate; }
+ else if (name == "UpdateLoginID") { return UpdateLoginID; }
+ else if (name == "UpdatePcName") { return UpdatePcName; }
+ else if (name == "UpdateID") { return UpdateID; }
+ else { return null; }
+ }
+
+ public override bool SetField(string name, object value)
+ {
+
+ if (name == "ID") { ID = CConvert.ToInt(value); return true; }
+ else if (name == "Name") { Name = value.ToString(); return true; }
+ else if (name == "ShortName") { ShortName = value.ToString(); return true; }
+ else if (name == "EnName") { EnName = value.ToString(); return true; }
+ else if (name == "SortID") { SortID = CConvert.ToInt(value); return true; }
+ else if (name == "ForeColor") { ForeColor = value.ToString(); return true; }
+ else if (name == "BackColor") { BackColor = value.ToString(); return true; }
+ else if (name == "MaidType") { MaidType = CConvert.ToInt(value); return true; }
+ else if (name == "Selectable") { Selectable = CConvert.ToBool(value); return true; }
+ else if (name == "Memo") { Memo = value.ToString(); return true; }
+ else if (name == "UpdateDate") { UpdateDate = CConvert.ToTimestamp(CConvert.ToDateTime(value)); return true; }
+ else if (name == "UpdateLoginID") { UpdateLoginID = CConvert.ToInt(value); return true; }
+ else if (name == "UpdatePcName") { UpdatePcName = value.ToString(); return true; }
+ else if (name == "UpdateID") { UpdateID = CConvert.ToInt(value); return true; }
+ else { return false; }
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/ProtosExpan/Master/RoomStatusTable.cs b/ProtosExpan/Master/RoomStatusTable.cs
new file mode 100644
index 0000000..315d5d6
--- /dev/null
+++ b/ProtosExpan/Master/RoomStatusTable.cs
@@ -0,0 +1,43 @@
+using HotelPms.Share.Util;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Diagnostics;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HotelPms.Data.Master
+{
+ public partial class RoomStatusTable
+ {
+ /// <summary>
+ /// 自動データテーブル生成
+ /// </summary>
+ /// <returns></returns>
+ public DataTable ToDataTable()
+ {
+ DataTable dataTable = new DataTable();
+ dataTable.TableName = Name;
+ PropertyInfo[] myInfo = typeof(RoomStatus).GetProperties(BindingFlags.Public | BindingFlags.Instance);
+ foreach (PropertyInfo item in myInfo)
+ {
+ System.Diagnostics.Debug.WriteLine(item.Name);
+
+ Attribute attribute = item.GetCustomAttribute(typeof(DebuggerNonUserCodeAttribute));
+ if (attribute == null) { continue; }
+ dataTable.Columns.Add(item.Name, item.PropertyType);
+ }
+
+ //データ
+ foreach (RoomStatus row in Rows)
+ {
+ DataRow dtRow = dataTable.NewRow();
+ row.ToDataRow(dtRow);
+ dataTable.Rows.Add(dtRow);
+ }
+ return dataTable;
+ }
+ }
+}
diff --git a/ProtosExpan/Master/RoomType.cs b/ProtosExpan/Master/RoomType.cs
new file mode 100644
index 0000000..0592fce
--- /dev/null
+++ b/ProtosExpan/Master/RoomType.cs
@@ -0,0 +1,287 @@
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Text;
+using HotelPms.Share.Data;
+using HotelPms.Share.Util;
+using Google.Protobuf.WellKnownTypes;
+using customTypes;
+using System.Data.Common;
+
+namespace HotelPms.Data.Master;
+
+/// ****************************** Description *******************************
+/// ◇システム名称
+/// ホテルPMS
+/// ◇概要
+///
+/// ◇履歴
+/// 2021/05/14 コード作成ツール 自動作成
+/// ****************************** Declarations ******************************
+[Serializable()]
+public partial class RoomType : RecordBase
+{
+ #region ★★★★★ Property ★★★★★
+
+ public static ConcurrentDictionary<string, int> PrimaryKey { get; } = new ConcurrentDictionary<string, int>();
+
+ #endregion
+
+ partial void OnConstruction()
+ {
+ if (PrimaryKey.Count == 0)
+ {
+ PrimaryKey.TryAdd("ID", 0);
+
+ }
+ }
+
+ #region ★★★★★ Function ★★★★★
+
+ public bool CompareTo(RoomType item)
+ {
+ if (ID.CompareTo(item.ID) != 0
+ || Name.CompareTo(item.Name) != 0
+ || ShortName.CompareTo(item.ShortName) != 0
+ || Kind.CompareTo(item.Kind) != 0
+ || SortID.CompareTo(item.SortID) != 0
+ || Visible.CompareTo(item.Visible) != 0
+ || TypeListVisible.CompareTo(item.TypeListVisible) != 0
+ || TypeListAlertCount.CompareTo(item.TypeListAlertCount) != 0
+ || TypeListAlertColor.CompareTo(item.TypeListAlertColor) != 0
+ || WebType.CompareTo(item.WebType) != 0
+ || SendRate.CompareTo(item.SendRate) != 0
+ || SendLimit.CompareTo(item.SendLimit) != 0
+ || Memo.CompareTo(item.Memo) != 0
+ || UpdateDate.CompareTo(item.UpdateDate) != 0
+ || UpdateLoginID.CompareTo(item.UpdateLoginID) != 0
+ || UpdatePcName.CompareTo(item.UpdatePcName) != 0
+ || UpdateID.CompareTo(item.UpdateID) != 0
+)
+ {
+ return false;
+ }
+ return true;
+ }
+
+
+ public override void CopyTo(object dest)
+ {
+ RoomType item = dest as RoomType;
+ item.ID = ID;
+ item.Name = Name;
+ item.ShortName = ShortName;
+ item.Kind = Kind;
+ item.SortID = SortID;
+ item.Visible = Visible;
+ item.TypeListVisible = TypeListVisible;
+ item.TypeListAlertCount = TypeListAlertCount;
+ item.TypeListAlertColor = TypeListAlertColor;
+ item.WebType = WebType;
+ item.SendRate = SendRate;
+ item.SendLimit = SendLimit;
+ item.Memo = Memo;
+ item.UpdateDate = UpdateDate;
+ item.UpdateLoginID = UpdateLoginID;
+ item.UpdatePcName = UpdatePcName;
+ item.UpdateID = UpdateID;
+
+ }
+
+ public override void Clear()
+ {
+ ID = 0;
+ Name = string.Empty;
+ ShortName = string.Empty;
+ Kind = 0;
+ SortID = 0;
+ Visible = false;
+ TypeListVisible = false;
+ TypeListAlertCount = 0;
+ TypeListAlertColor = string.Empty;
+ WebType = string.Empty;
+ SendRate = 0;
+ SendLimit = 0;
+ Memo = string.Empty;
+ UpdateDate = CConvert.ToTimestamp(DateTime.MinValue);
+ UpdateLoginID = 0;
+ UpdatePcName = string.Empty;
+ UpdateID = 0;
+
+ }
+
+ public RoomType DeepClone()
+ {
+ RoomType item = new RoomType();
+ item.ID = ID;
+ item.Name = Name;
+ item.ShortName = ShortName;
+ item.Kind = Kind;
+ item.SortID = SortID;
+ item.Visible = Visible;
+ item.TypeListVisible = TypeListVisible;
+ item.TypeListAlertCount = TypeListAlertCount;
+ item.TypeListAlertColor = TypeListAlertColor;
+ item.WebType = WebType;
+ item.SendRate = SendRate;
+ item.SendLimit = SendLimit;
+ item.Memo = Memo;
+ item.UpdateDate = UpdateDate;
+ item.UpdateLoginID = UpdateLoginID;
+ item.UpdatePcName = UpdatePcName;
+ item.UpdateID = UpdateID;
+
+ return item;
+ }
+
+ public override bool ConvertDataRow(System.Data.DataRow row)
+ {
+ ID = CConvert.ToInt(row["ID"],ID);
+ Name = row["Name"].ToString();
+ ShortName = row["ShortName"].ToString();
+ Kind = CConvert.ToInt(row["Kind"],Kind);
+ SortID = CConvert.ToInt(row["SortID"],SortID);
+ Visible = CConvert.ToBool(row["Visible"]);
+ TypeListVisible = CConvert.ToBool(row["TypeListVisible"]);
+ TypeListAlertCount = CConvert.ToInt(row["TypeListAlertCount"],TypeListAlertCount);
+ TypeListAlertColor = row["TypeListAlertColor"].ToString();
+ WebType = row["WebType"].ToString();
+ SendRate = CConvert.ToInt(row["SendRate"],SendRate);
+ SendLimit = CConvert.ToInt(row["SendLimit"],SendLimit);
+ Memo = row["Memo"].ToString();
+ UpdateDate = CConvert.ToTimestamp(row.IsNull("UpdateDate") ? DateTime.MinValue : (System.DateTime)row["UpdateDate"]);
+ UpdateLoginID = CConvert.ToInt(row["UpdateLoginID"],UpdateLoginID);
+ UpdatePcName = row["UpdatePcName"].ToString();
+ UpdateID = CConvert.ToInt(row["UpdateID"],UpdateID);
+
+ return true;
+ }
+
+ public void ToDataRow(System.Data.DataRow row)
+ {
+ row["ID"] = ID;
+ row["Name"] = Name;
+ row["ShortName"] = ShortName;
+ row["Kind"] = Kind;
+ row["SortID"] = SortID;
+ row["Visible"] = Visible;
+ row["TypeListVisible"] = TypeListVisible;
+ row["TypeListAlertCount"] = TypeListAlertCount;
+ row["TypeListAlertColor"] = TypeListAlertColor;
+ row["WebType"] = WebType;
+ row["SendRate"] = SendRate;
+ row["SendLimit"] = SendLimit;
+ row["Memo"] = Memo;
+ row["UpdateDate"] = UpdateDate.ToDateTime();
+ row["UpdateLoginID"] = UpdateLoginID;
+ row["UpdatePcName"] = UpdatePcName;
+ row["UpdateID"] = UpdateID;
+
+ }
+
+ public void ConvertReader(DbDataReader row)
+ {
+ int i = 0;
+ ID = (int)(row.IsDBNull(i) ? 0 : row.GetInt16(i)); i++;
+ Name = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ ShortName = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ Kind = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ SortID = (int)(row.IsDBNull(i) ? 0 : row.GetInt16(i)); i++;
+ Visible = (bool)(row.IsDBNull(i) ? false : row.GetBoolean(i)); i++;
+ TypeListVisible = (bool)(row.IsDBNull(i) ? false : row.GetBoolean(i)); i++;
+ TypeListAlertCount = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ TypeListAlertColor = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ WebType = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ SendRate = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ SendLimit = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ Memo = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ UpdateDate = CConvert.ToTimestamp(row.IsDBNull(i) ? DateTime.MinValue : row.GetDateTime(i)); i++;
+ UpdateLoginID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ UpdatePcName = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ UpdateID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+
+ }
+
+ public string AddSql()
+ {
+ return $@"INSERT INTO M_RoomType(ID,Name,ShortName,Kind,SortID,Visible,TypeListVisible,TypeListAlertCount,TypeListAlertColor,WebType,SendRate,SendLimit,Memo,UpdateDate,UpdateLoginID,UpdatePcName,UpdateID) VALUES({ID},N'{Name}',N'{ShortName}',{Kind},{SortID},{(Visible ? 1 : 0)},{(TypeListVisible ? 1 : 0)},{TypeListAlertCount},N'{TypeListAlertColor}',N'{WebType}',{SendRate},{SendLimit},N'{Memo}',GETDATE(),{UpdateLoginID},N'{UpdatePcName}',{UpdateID});";
+ }
+
+ public string UpdateSql()
+ {
+ return $@"UPDATE M_RoomType SET Name = N'{Name}',ShortName = N'{ShortName}',Kind = {Kind},SortID = {SortID},Visible = {(Visible ? 1 : 0)},TypeListVisible = {(TypeListVisible ? 1 : 0)},TypeListAlertCount = {TypeListAlertCount},TypeListAlertColor = N'{TypeListAlertColor}',WebType = N'{WebType}',SendRate = {SendRate},SendLimit = {SendLimit},Memo = N'{Memo}',UpdateDate = GETDATE(),UpdateLoginID = {UpdateLoginID},UpdatePcName = N'{UpdatePcName}',UpdateID = {UpdateID} WHERE ID = {ID};";
+ }
+
+ public string ToText()
+ {
+ StringBuilder text = new StringBuilder();
+ text.AppendFormat("ID={0};", ID);
+ text.AppendFormat("Name={0};", Name);
+ text.AppendFormat("ShortName={0};", ShortName);
+ text.AppendFormat("Kind={0};", Kind);
+ text.AppendFormat("SortID={0};", SortID);
+ text.AppendFormat("Visible={0};", Visible);
+ text.AppendFormat("TypeListVisible={0};", TypeListVisible);
+ text.AppendFormat("TypeListAlertCount={0};", TypeListAlertCount);
+ text.AppendFormat("TypeListAlertColor={0};", TypeListAlertColor);
+ text.AppendFormat("WebType={0};", WebType);
+ text.AppendFormat("SendRate={0};", SendRate);
+ text.AppendFormat("SendLimit={0};", SendLimit);
+ text.AppendFormat("Memo={0};", Memo);
+ text.AppendFormat("UpdateDate={0};", UpdateDate);
+ text.AppendFormat("UpdateLoginID={0};", UpdateLoginID);
+ text.AppendFormat("UpdatePcName={0};", UpdatePcName);
+ text.AppendFormat("UpdateID={0};", UpdateID);
+
+ return text.ToString();
+ }
+
+ public override object GetField(string name)
+ {
+
+ if (name == "ID") { return ID; }
+ else if (name == "Name") { return Name; }
+ else if (name == "ShortName") { return ShortName; }
+ else if (name == "Kind") { return Kind; }
+ else if (name == "SortID") { return SortID; }
+ else if (name == "Visible") { return Visible; }
+ else if (name == "TypeListVisible") { return TypeListVisible; }
+ else if (name == "TypeListAlertCount") { return TypeListAlertCount; }
+ else if (name == "TypeListAlertColor") { return TypeListAlertColor; }
+ else if (name == "WebType") { return WebType; }
+ else if (name == "SendRate") { return SendRate; }
+ else if (name == "SendLimit") { return SendLimit; }
+ else if (name == "Memo") { return Memo; }
+ else if (name == "UpdateDate") { return UpdateDate; }
+ else if (name == "UpdateLoginID") { return UpdateLoginID; }
+ else if (name == "UpdatePcName") { return UpdatePcName; }
+ else if (name == "UpdateID") { return UpdateID; }
+ else { return null; }
+ }
+
+ public override bool SetField(string name, object value)
+ {
+
+ if (name == "ID") { ID = CConvert.ToInt(value); return true; }
+ else if (name == "Name") { Name = value.ToString(); return true; }
+ else if (name == "ShortName") { ShortName = value.ToString(); return true; }
+ else if (name == "Kind") { Kind = CConvert.ToInt(value); return true; }
+ else if (name == "SortID") { SortID = CConvert.ToInt(value); return true; }
+ else if (name == "Visible") { Visible = CConvert.ToBool(value); return true; }
+ else if (name == "TypeListVisible") { TypeListVisible = CConvert.ToBool(value); return true; }
+ else if (name == "TypeListAlertCount") { TypeListAlertCount = CConvert.ToInt(value); return true; }
+ else if (name == "TypeListAlertColor") { TypeListAlertColor = value.ToString(); return true; }
+ else if (name == "WebType") { WebType = value.ToString(); return true; }
+ else if (name == "SendRate") { SendRate = CConvert.ToInt(value); return true; }
+ else if (name == "SendLimit") { SendLimit = CConvert.ToInt(value); return true; }
+ else if (name == "Memo") { Memo = value.ToString(); return true; }
+ else if (name == "UpdateDate") { UpdateDate = CConvert.ToTimestamp(CConvert.ToDateTime(value)); return true; }
+ else if (name == "UpdateLoginID") { UpdateLoginID = CConvert.ToInt(value); return true; }
+ else if (name == "UpdatePcName") { UpdatePcName = value.ToString(); return true; }
+ else if (name == "UpdateID") { UpdateID = CConvert.ToInt(value); return true; }
+ else { return false; }
+ }
+
+ #endregion
+}
\ No newline at end of file
diff --git a/ProtosExpan/Master/RoomTypeTable.cs b/ProtosExpan/Master/RoomTypeTable.cs
new file mode 100644
index 0000000..c3c0bea
--- /dev/null
+++ b/ProtosExpan/Master/RoomTypeTable.cs
@@ -0,0 +1,42 @@
+using HotelPms.Share.Util;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Diagnostics;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HotelPms.Data.Master;
+
+public partial class RoomTypeTable
+{
+ /// <summary>
+ /// 自動データテーブル生成
+ /// </summary>
+ /// <returns></returns>
+ public DataTable ToDataTable()
+ {
+ DataTable dataTable = new DataTable();
+ dataTable.TableName = Name;
+ PropertyInfo[] myInfo = typeof(RoomType).GetProperties(BindingFlags.Public | BindingFlags.Instance);
+ foreach (PropertyInfo item in myInfo)
+ {
+ System.Diagnostics.Debug.WriteLine(item.Name);
+
+ Attribute attribute = item.GetCustomAttribute(typeof(DebuggerNonUserCodeAttribute));
+ if (attribute == null) { continue; }
+ dataTable.Columns.Add(item.Name, item.PropertyType);
+ }
+
+ //データ
+ foreach (RoomType row in Rows)
+ {
+ DataRow dtRow = dataTable.NewRow();
+ row.ToDataRow(dtRow);
+ dataTable.Rows.Add(dtRow);
+ }
+ return dataTable;
+ }
+}
diff --git a/ProtosExpan/Master/RoomViewLayout.cs b/ProtosExpan/Master/RoomViewLayout.cs
new file mode 100644
index 0000000..4c65557
--- /dev/null
+++ b/ProtosExpan/Master/RoomViewLayout.cs
@@ -0,0 +1,319 @@
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Text;
+using HotelPms.Share.Data;
+using HotelPms.Share.Util;
+using Google.Protobuf.WellKnownTypes;
+using customTypes;
+using System.Data.Common;
+
+namespace HotelPms.Data.Master
+{
+ /// ****************************** Description *******************************
+ /// ◇システム名称
+ /// ホテルPMS
+ /// ◇概要
+ ///
+ /// ◇履歴
+ /// 2021/05/14 コード作成ツール 自動作成
+ /// ****************************** Declarations ******************************
+ [Serializable()]
+ public partial class RoomViewLayout : RecordBase
+ {
+ #region ★★★★★ Property ★★★★★
+
+ public static ConcurrentDictionary<string, int> PrimaryKey { get; } = new ConcurrentDictionary<string, int>();
+
+ #endregion
+
+ partial void OnConstruction()
+ {
+ if (PrimaryKey.Count == 0)
+ {
+ PrimaryKey.TryAdd("TabID", 0);
+ PrimaryKey.TryAdd("Row", 0);
+ PrimaryKey.TryAdd("Col", 0);
+
+ }
+ }
+
+ #region ★★★★★ Function ★★★★★
+
+ public bool CompareTo(RoomViewLayout item)
+ {
+ if (TabID.CompareTo(item.TabID) != 0
+ || Row.CompareTo(item.Row) != 0
+ || Col.CompareTo(item.Col) != 0
+ || RoomID.CompareTo(item.RoomID) != 0
+ || DisplayName.CompareTo(item.DisplayName) != 0
+ || RowHeight.CompareTo(item.RowHeight) != 0
+ || ColWidth.CompareTo(item.ColWidth) != 0
+ || BackColor.CompareTo(item.BackColor) != 0
+ || ForeColor.CompareTo(item.ForeColor) != 0
+ || Floor.CompareTo(item.Floor) != 0
+ || FontName.CompareTo(item.FontName) != 0
+ || FontSize.CompareTo(item.FontSize) != 0
+ || FontBold.CompareTo(item.FontBold) != 0
+ || FontItalic.CompareTo(item.FontItalic) != 0
+ || FontUnderline.CompareTo(item.FontUnderline) != 0
+ || TextAlign.CompareTo(item.TextAlign) != 0
+ || UpdateDate.CompareTo(item.UpdateDate) != 0
+ || UpdateLoginID.CompareTo(item.UpdateLoginID) != 0
+ || UpdatePcName.CompareTo(item.UpdatePcName) != 0
+ || UpdateID.CompareTo(item.UpdateID) != 0
+)
+ {
+ return false;
+ }
+ return true;
+ }
+
+
+ public override void CopyTo(object dest)
+ {
+ RoomViewLayout item = dest as RoomViewLayout;
+ item.TabID = TabID;
+ item.Row = Row;
+ item.Col = Col;
+ item.RoomID = RoomID;
+ item.DisplayName = DisplayName;
+ item.RowHeight = RowHeight;
+ item.ColWidth = ColWidth;
+ item.BackColor = BackColor;
+ item.ForeColor = ForeColor;
+ item.Floor = Floor;
+ item.FontName = FontName;
+ item.FontSize = FontSize;
+ item.FontBold = FontBold;
+ item.FontItalic = FontItalic;
+ item.FontUnderline = FontUnderline;
+ item.TextAlign = TextAlign;
+ item.UpdateDate = UpdateDate;
+ item.UpdateLoginID = UpdateLoginID;
+ item.UpdatePcName = UpdatePcName;
+ item.UpdateID = UpdateID;
+
+ }
+
+ public override void Clear()
+ {
+ TabID = 0;
+ Row = 0;
+ Col = 0;
+ RoomID = 0;
+ DisplayName = string.Empty;
+ RowHeight = 0;
+ ColWidth = 0;
+ BackColor = string.Empty;
+ ForeColor = string.Empty;
+ Floor = 0;
+ FontName = string.Empty;
+ FontSize = 0;
+ FontBold = false;
+ FontItalic = false;
+ FontUnderline = false;
+ TextAlign = string.Empty;
+ UpdateDate = CConvert.ToTimestamp(DateTime.MinValue);
+ UpdateLoginID = 0;
+ UpdatePcName = string.Empty;
+ UpdateID = 0;
+
+ }
+
+ public RoomViewLayout DeepClone()
+ {
+ RoomViewLayout item = new RoomViewLayout();
+ item.TabID = TabID;
+ item.Row = Row;
+ item.Col = Col;
+ item.RoomID = RoomID;
+ item.DisplayName = DisplayName;
+ item.RowHeight = RowHeight;
+ item.ColWidth = ColWidth;
+ item.BackColor = BackColor;
+ item.ForeColor = ForeColor;
+ item.Floor = Floor;
+ item.FontName = FontName;
+ item.FontSize = FontSize;
+ item.FontBold = FontBold;
+ item.FontItalic = FontItalic;
+ item.FontUnderline = FontUnderline;
+ item.TextAlign = TextAlign;
+ item.UpdateDate = UpdateDate;
+ item.UpdateLoginID = UpdateLoginID;
+ item.UpdatePcName = UpdatePcName;
+ item.UpdateID = UpdateID;
+
+ return item;
+ }
+
+ public override bool ConvertDataRow(System.Data.DataRow row)
+ {
+ TabID = CConvert.ToInt(row["TabID"],TabID);
+ Row = CConvert.ToInt(row["Row"],Row);
+ Col = CConvert.ToInt(row["Col"],Col);
+ RoomID = CConvert.ToInt(row["RoomID"],RoomID);
+ DisplayName = row["DisplayName"].ToString();
+ RowHeight = CConvert.ToInt(row["RowHeight"],RowHeight);
+ ColWidth = CConvert.ToInt(row["ColWidth"],ColWidth);
+ BackColor = row["BackColor"].ToString();
+ ForeColor = row["ForeColor"].ToString();
+ Floor = CConvert.ToInt(row["Floor"],Floor);
+ FontName = row["FontName"].ToString();
+ FontSize = CConvert.ToInt(row["FontSize"],FontSize);
+ FontBold = CConvert.ToBool(row["FontBold"]);
+ FontItalic = CConvert.ToBool(row["FontItalic"]);
+ FontUnderline = CConvert.ToBool(row["FontUnderline"]);
+ TextAlign = row["TextAlign"].ToString();
+ UpdateDate = CConvert.ToTimestamp(row.IsNull("UpdateDate") ? DateTime.MinValue : (System.DateTime)row["UpdateDate"]);
+ UpdateLoginID = CConvert.ToInt(row["UpdateLoginID"],UpdateLoginID);
+ UpdatePcName = row["UpdatePcName"].ToString();
+ UpdateID = CConvert.ToInt(row["UpdateID"],UpdateID);
+
+ return true;
+ }
+
+ public void ToDataRow(System.Data.DataRow row)
+ {
+ row["TabID"] = TabID;
+ row["Row"] = Row;
+ row["Col"] = Col;
+ row["RoomID"] = RoomID;
+ row["DisplayName"] = DisplayName;
+ row["RowHeight"] = RowHeight;
+ row["ColWidth"] = ColWidth;
+ row["BackColor"] = BackColor;
+ row["ForeColor"] = ForeColor;
+ row["Floor"] = Floor;
+ row["FontName"] = FontName;
+ row["FontSize"] = FontSize;
+ row["FontBold"] = FontBold;
+ row["FontItalic"] = FontItalic;
+ row["FontUnderline"] = FontUnderline;
+ row["TextAlign"] = TextAlign;
+ row["UpdateDate"] = UpdateDate.ToDateTime();
+ row["UpdateLoginID"] = UpdateLoginID;
+ row["UpdatePcName"] = UpdatePcName;
+ row["UpdateID"] = UpdateID;
+
+ }
+
+ public void ConvertReader(DbDataReader row)
+ {
+ TabID = CConvert.ToInt(row["TabID"],TabID);
+ Row = CConvert.ToInt(row["Row"],Row);
+ Col = CConvert.ToInt(row["Col"],Col);
+ RoomID = CConvert.ToInt(row["RoomID"],RoomID);
+ DisplayName = row["DisplayName"].ToString();
+ RowHeight = CConvert.ToInt(row["RowHeight"],RowHeight);
+ ColWidth = CConvert.ToInt(row["ColWidth"],ColWidth);
+ BackColor = row["BackColor"].ToString();
+ ForeColor = row["ForeColor"].ToString();
+ Floor = CConvert.ToInt(row["Floor"],Floor);
+ FontName = row["FontName"].ToString();
+ FontSize = CConvert.ToInt(row["FontSize"],FontSize);
+ FontBold = CConvert.ToBool(row["FontBold"]);
+ FontItalic = CConvert.ToBool(row["FontItalic"]);
+ FontUnderline = CConvert.ToBool(row["FontUnderline"]);
+ TextAlign = row["TextAlign"].ToString();
+ UpdateDate = CConvert.ToTimestamp(row.IsNull("UpdateDate") ? DateTime.MinValue : (System.DateTime)row["UpdateDate"]);
+ UpdateLoginID = CConvert.ToInt(row["UpdateLoginID"],UpdateLoginID);
+ UpdatePcName = row["UpdatePcName"].ToString();
+ UpdateID = CConvert.ToInt(row["UpdateID"],UpdateID);
+
+ }
+
+ public string AddSql()
+ {
+ return $@"INSERT INTO M_RoomViewLayout(TabID,Row,Col,RoomID,DisplayName,RowHeight,ColWidth,BackColor,ForeColor,Floor,FontName,FontSize,FontBold,FontItalic,FontUnderline,TextAlign,UpdateDate,UpdateLoginID,UpdatePcName,UpdateID) VALUES({TabID},{Row},{Col},{RoomID},N'{DisplayName}',{RowHeight},{ColWidth},N'{BackColor}',N'{ForeColor}',{Floor},N'{FontName}',{FontSize},{(FontBold ? 1 : 0)},{(FontItalic ? 1 : 0)},{(FontUnderline ? 1 : 0)},N'{TextAlign}',GETDATE(),{UpdateLoginID},N'{UpdatePcName}',{UpdateID});";
+ }
+
+ public string UpdateSql()
+ {
+ return $@"UPDATE M_RoomViewLayout SET RoomID = {RoomID},DisplayName = N'{DisplayName}',RowHeight = {RowHeight},ColWidth = {ColWidth},BackColor = N'{BackColor}',ForeColor = N'{ForeColor}',Floor = {Floor},FontName = N'{FontName}',FontSize = {FontSize},FontBold = {(FontBold ? 1 : 0)},FontItalic = {(FontItalic ? 1 : 0)},FontUnderline = {(FontUnderline ? 1 : 0)},TextAlign = N'{TextAlign}',UpdateDate = GETDATE(),UpdateLoginID = {UpdateLoginID},UpdatePcName = N'{UpdatePcName}',UpdateID = {UpdateID} WHERE TabID = {TabID} AND Row = {Row} AND Col = {Col};";
+ }
+
+ public string ToText()
+ {
+ StringBuilder text = new StringBuilder();
+ text.AppendFormat("TabID={0};", TabID);
+ text.AppendFormat("Row={0};", Row);
+ text.AppendFormat("Col={0};", Col);
+ text.AppendFormat("RoomID={0};", RoomID);
+ text.AppendFormat("DisplayName={0};", DisplayName);
+ text.AppendFormat("RowHeight={0};", RowHeight);
+ text.AppendFormat("ColWidth={0};", ColWidth);
+ text.AppendFormat("BackColor={0};", BackColor);
+ text.AppendFormat("ForeColor={0};", ForeColor);
+ text.AppendFormat("Floor={0};", Floor);
+ text.AppendFormat("FontName={0};", FontName);
+ text.AppendFormat("FontSize={0};", FontSize);
+ text.AppendFormat("FontBold={0};", FontBold);
+ text.AppendFormat("FontItalic={0};", FontItalic);
+ text.AppendFormat("FontUnderline={0};", FontUnderline);
+ text.AppendFormat("TextAlign={0};", TextAlign);
+ text.AppendFormat("UpdateDate={0};", UpdateDate);
+ text.AppendFormat("UpdateLoginID={0};", UpdateLoginID);
+ text.AppendFormat("UpdatePcName={0};", UpdatePcName);
+ text.AppendFormat("UpdateID={0};", UpdateID);
+
+ return text.ToString();
+ }
+
+ public override object GetField(string name)
+ {
+
+ if (name == "TabID") { return TabID; }
+ else if (name == "Row") { return Row; }
+ else if (name == "Col") { return Col; }
+ else if (name == "RoomID") { return RoomID; }
+ else if (name == "DisplayName") { return DisplayName; }
+ else if (name == "RowHeight") { return RowHeight; }
+ else if (name == "ColWidth") { return ColWidth; }
+ else if (name == "BackColor") { return BackColor; }
+ else if (name == "ForeColor") { return ForeColor; }
+ else if (name == "Floor") { return Floor; }
+ else if (name == "FontName") { return FontName; }
+ else if (name == "FontSize") { return FontSize; }
+ else if (name == "FontBold") { return FontBold; }
+ else if (name == "FontItalic") { return FontItalic; }
+ else if (name == "FontUnderline") { return FontUnderline; }
+ else if (name == "TextAlign") { return TextAlign; }
+ else if (name == "UpdateDate") { return UpdateDate; }
+ else if (name == "UpdateLoginID") { return UpdateLoginID; }
+ else if (name == "UpdatePcName") { return UpdatePcName; }
+ else if (name == "UpdateID") { return UpdateID; }
+ else { return null; }
+ }
+
+ public override bool SetField(string name, object value)
+ {
+
+ if (name == "TabID") { TabID = CConvert.ToInt(value); return true; }
+ else if (name == "Row") { Row = CConvert.ToInt(value); return true; }
+ else if (name == "Col") { Col = CConvert.ToInt(value); return true; }
+ else if (name == "RoomID") { RoomID = CConvert.ToInt(value); return true; }
+ else if (name == "DisplayName") { DisplayName = value.ToString(); return true; }
+ else if (name == "RowHeight") { RowHeight = CConvert.ToInt(value); return true; }
+ else if (name == "ColWidth") { ColWidth = CConvert.ToInt(value); return true; }
+ else if (name == "BackColor") { BackColor = value.ToString(); return true; }
+ else if (name == "ForeColor") { ForeColor = value.ToString(); return true; }
+ else if (name == "Floor") { Floor = CConvert.ToInt(value); return true; }
+ else if (name == "FontName") { FontName = value.ToString(); return true; }
+ else if (name == "FontSize") { FontSize = CConvert.ToInt(value); return true; }
+ else if (name == "FontBold") { FontBold = CConvert.ToBool(value); return true; }
+ else if (name == "FontItalic") { FontItalic = CConvert.ToBool(value); return true; }
+ else if (name == "FontUnderline") { FontUnderline = CConvert.ToBool(value); return true; }
+ else if (name == "TextAlign") { TextAlign = value.ToString(); return true; }
+ else if (name == "UpdateDate") { UpdateDate = CConvert.ToTimestamp(CConvert.ToDateTime(value)); return true; }
+ else if (name == "UpdateLoginID") { UpdateLoginID = CConvert.ToInt(value); return true; }
+ else if (name == "UpdatePcName") { UpdatePcName = value.ToString(); return true; }
+ else if (name == "UpdateID") { UpdateID = CConvert.ToInt(value); return true; }
+ else { return false; }
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/ProtosExpan/Master/RoomViewLayoutTable.cs b/ProtosExpan/Master/RoomViewLayoutTable.cs
new file mode 100644
index 0000000..be52636
--- /dev/null
+++ b/ProtosExpan/Master/RoomViewLayoutTable.cs
@@ -0,0 +1,43 @@
+using HotelPms.Share.Util;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Diagnostics;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HotelPms.Data.Master
+{
+ public partial class RoomViewLayoutTable
+ {
+ /// <summary>
+ /// 自動データテーブル生成
+ /// </summary>
+ /// <returns></returns>
+ public DataTable ToDataTable()
+ {
+ DataTable dataTable = new DataTable();
+ dataTable.TableName = Name;
+ PropertyInfo[] myInfo = typeof(RoomViewLayout).GetProperties(BindingFlags.Public | BindingFlags.Instance);
+ foreach (PropertyInfo item in myInfo)
+ {
+ System.Diagnostics.Debug.WriteLine(item.Name);
+
+ Attribute attribute = item.GetCustomAttribute(typeof(DebuggerNonUserCodeAttribute));
+ if (attribute == null) { continue; }
+ dataTable.Columns.Add(item.Name, item.PropertyType);
+ }
+
+ //データ
+ foreach (RoomViewLayout row in Rows)
+ {
+ DataRow dtRow = dataTable.NewRow();
+ row.ToDataRow(dtRow);
+ dataTable.Rows.Add(dtRow);
+ }
+ return dataTable;
+ }
+ }
+}
diff --git a/ProtosExpan/Master/RoomViewTab.cs b/ProtosExpan/Master/RoomViewTab.cs
new file mode 100644
index 0000000..07b847e
--- /dev/null
+++ b/ProtosExpan/Master/RoomViewTab.cs
@@ -0,0 +1,177 @@
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Text;
+using HotelPms.Share.Data;
+using HotelPms.Share.Util;
+using Google.Protobuf.WellKnownTypes;
+using customTypes;
+using System.Data.Common;
+
+namespace HotelPms.Data.Master
+{
+ /// ****************************** Description *******************************
+ /// ◇システム名称
+ /// ホテルPMS
+ /// ◇概要
+ ///
+ /// ◇履歴
+ /// 2021/05/14 コード作成ツール 自動作成
+ /// ****************************** Declarations ******************************
+ [Serializable()]
+ public partial class RoomViewTab : RecordBase
+ {
+ #region ★★★★★ Property ★★★★★
+
+ public static ConcurrentDictionary<string, int> PrimaryKey { get; } = new ConcurrentDictionary<string, int>();
+
+ #endregion
+
+ partial void OnConstruction()
+ {
+ if (PrimaryKey.Count == 0)
+ {
+ PrimaryKey.TryAdd("ID", 0);
+
+ }
+ }
+
+ #region ★★★★★ Function ★★★★★
+
+ public bool CompareTo(RoomViewTab item)
+ {
+ if (ID.CompareTo(item.ID) != 0
+ || Name.CompareTo(item.Name) != 0
+ || UpdateDate.CompareTo(item.UpdateDate) != 0
+ || UpdateLoginID.CompareTo(item.UpdateLoginID) != 0
+ || UpdatePcName.CompareTo(item.UpdatePcName) != 0
+ || UpdateID.CompareTo(item.UpdateID) != 0
+)
+ {
+ return false;
+ }
+ return true;
+ }
+
+
+ public override void CopyTo(object dest)
+ {
+ RoomViewTab item = dest as RoomViewTab;
+ item.ID = ID;
+ item.Name = Name;
+ item.UpdateDate = UpdateDate;
+ item.UpdateLoginID = UpdateLoginID;
+ item.UpdatePcName = UpdatePcName;
+ item.UpdateID = UpdateID;
+
+ }
+
+ public override void Clear()
+ {
+ ID = 0;
+ Name = string.Empty;
+ UpdateDate = CConvert.ToTimestamp(DateTime.MinValue);
+ UpdateLoginID = 0;
+ UpdatePcName = string.Empty;
+ UpdateID = 0;
+
+ }
+
+ public RoomViewTab DeepClone()
+ {
+ RoomViewTab item = new RoomViewTab();
+ item.ID = ID;
+ item.Name = Name;
+ item.UpdateDate = UpdateDate;
+ item.UpdateLoginID = UpdateLoginID;
+ item.UpdatePcName = UpdatePcName;
+ item.UpdateID = UpdateID;
+
+ return item;
+ }
+
+ public override bool ConvertDataRow(System.Data.DataRow row)
+ {
+ ID = CConvert.ToInt(row["ID"],ID);
+ Name = row["Name"].ToString();
+ UpdateDate = CConvert.ToTimestamp(row.IsNull("UpdateDate") ? DateTime.MinValue : (System.DateTime)row["UpdateDate"]);
+ UpdateLoginID = CConvert.ToInt(row["UpdateLoginID"],UpdateLoginID);
+ UpdatePcName = row["UpdatePcName"].ToString();
+ UpdateID = CConvert.ToInt(row["UpdateID"],UpdateID);
+
+ return true;
+ }
+
+ public void ToDataRow(System.Data.DataRow row)
+ {
+ row["ID"] = ID;
+ row["Name"] = Name;
+ row["UpdateDate"] = UpdateDate.ToDateTime();
+ row["UpdateLoginID"] = UpdateLoginID;
+ row["UpdatePcName"] = UpdatePcName;
+ row["UpdateID"] = UpdateID;
+
+ }
+
+ public void ConvertReader(DbDataReader row)
+ {
+ ID = CConvert.ToInt(row["ID"],ID);
+ Name = row["Name"].ToString();
+ UpdateDate = CConvert.ToTimestamp(row.IsNull("UpdateDate") ? DateTime.MinValue : (System.DateTime)row["UpdateDate"]);
+ UpdateLoginID = CConvert.ToInt(row["UpdateLoginID"],UpdateLoginID);
+ UpdatePcName = row["UpdatePcName"].ToString();
+ UpdateID = CConvert.ToInt(row["UpdateID"],UpdateID);
+
+ }
+
+ public string AddSql()
+ {
+ return $@"INSERT INTO M_RoomViewTab(ID,Name,UpdateDate,UpdateLoginID,UpdatePcName,UpdateID) VALUES({ID},N'{Name}',GETDATE(),{UpdateLoginID},N'{UpdatePcName}',{UpdateID});";
+ }
+
+ public string UpdateSql()
+ {
+ return $@"UPDATE M_RoomViewTab SET Name = N'{Name}',UpdateDate = GETDATE(),UpdateLoginID = {UpdateLoginID},UpdatePcName = N'{UpdatePcName}',UpdateID = {UpdateID} WHERE ID = {ID};";
+ }
+
+ public string ToText()
+ {
+ StringBuilder text = new StringBuilder();
+ text.AppendFormat("ID={0};", ID);
+ text.AppendFormat("Name={0};", Name);
+ text.AppendFormat("UpdateDate={0};", UpdateDate);
+ text.AppendFormat("UpdateLoginID={0};", UpdateLoginID);
+ text.AppendFormat("UpdatePcName={0};", UpdatePcName);
+ text.AppendFormat("UpdateID={0};", UpdateID);
+
+ return text.ToString();
+ }
+
+ public override object GetField(string name)
+ {
+
+ if (name == "ID") { return ID; }
+ else if (name == "Name") { return Name; }
+ else if (name == "UpdateDate") { return UpdateDate; }
+ else if (name == "UpdateLoginID") { return UpdateLoginID; }
+ else if (name == "UpdatePcName") { return UpdatePcName; }
+ else if (name == "UpdateID") { return UpdateID; }
+ else { return null; }
+ }
+
+ public override bool SetField(string name, object value)
+ {
+
+ if (name == "ID") { ID = CConvert.ToInt(value); return true; }
+ else if (name == "Name") { Name = value.ToString(); return true; }
+ else if (name == "UpdateDate") { UpdateDate = CConvert.ToTimestamp(CConvert.ToDateTime(value)); return true; }
+ else if (name == "UpdateLoginID") { UpdateLoginID = CConvert.ToInt(value); return true; }
+ else if (name == "UpdatePcName") { UpdatePcName = value.ToString(); return true; }
+ else if (name == "UpdateID") { UpdateID = CConvert.ToInt(value); return true; }
+ else { return false; }
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/ProtosExpan/Master/RoomViewTabTable.cs b/ProtosExpan/Master/RoomViewTabTable.cs
new file mode 100644
index 0000000..b2c9e7d
--- /dev/null
+++ b/ProtosExpan/Master/RoomViewTabTable.cs
@@ -0,0 +1,43 @@
+using HotelPms.Share.Util;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Diagnostics;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HotelPms.Data.Master
+{
+ public partial class RoomViewTabTable
+ {
+ /// <summary>
+ /// 自動データテーブル生成
+ /// </summary>
+ /// <returns></returns>
+ public DataTable ToDataTable()
+ {
+ DataTable dataTable = new DataTable();
+ dataTable.TableName = Name;
+ PropertyInfo[] myInfo = typeof(RoomViewTab).GetProperties(BindingFlags.Public | BindingFlags.Instance);
+ foreach (PropertyInfo item in myInfo)
+ {
+ System.Diagnostics.Debug.WriteLine(item.Name);
+
+ Attribute attribute = item.GetCustomAttribute(typeof(DebuggerNonUserCodeAttribute));
+ if (attribute == null) { continue; }
+ dataTable.Columns.Add(item.Name, item.PropertyType);
+ }
+
+ //データ
+ foreach (RoomViewTab row in Rows)
+ {
+ DataRow dtRow = dataTable.NewRow();
+ row.ToDataRow(dtRow);
+ dataTable.Rows.Add(dtRow);
+ }
+ return dataTable;
+ }
+ }
+}
diff --git a/ProtosExpan/UseInfo/Arrange.cs b/ProtosExpan/UseInfo/Arrange.cs
new file mode 100644
index 0000000..96b37c2
--- /dev/null
+++ b/ProtosExpan/UseInfo/Arrange.cs
@@ -0,0 +1,259 @@
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Text;
+using HotelPms.Share.Data;
+using HotelPms.Share.Util;
+using Google.Protobuf.WellKnownTypes;
+using customTypes;
+using System.Data.Common;
+
+namespace HotelPms.Data.UseInfo;
+
+/// ****************************** Description *******************************
+/// ◇システム名称
+/// ホテルPMS
+/// ◇概要
+///
+/// ◇履歴
+/// 2021/05/14 コード作成ツール 自動作成
+/// ****************************** Declarations ******************************
+[Serializable()]
+public partial class Arrange : RecordBase
+{
+ #region ★★★★★ Property ★★★★★
+
+ public static ConcurrentDictionary<string, int> PrimaryKey { get; } = new ConcurrentDictionary<string, int>();
+
+ #endregion
+
+ partial void OnConstruction()
+ {
+ if (PrimaryKey.Count == 0)
+ {
+ PrimaryKey.TryAdd("ID", 0);
+ PrimaryKey.TryAdd("DetailID", 0);
+ PrimaryKey.TryAdd("UseDate", 0);
+
+ }
+ }
+
+ #region ★★★★★ Function ★★★★★
+
+ public bool CompareTo(Arrange item)
+ {
+ if (ID.CompareTo(item.ID) != 0
+ || DetailID.CompareTo(item.DetailID) != 0
+ || UseDate.CompareTo(item.UseDate) != 0
+ || TraderID.CompareTo(item.TraderID) != 0
+ || SubID.CompareTo(item.SubID) != 0
+ || SaleID.CompareTo(item.SaleID) != 0
+ || Status.CompareTo(item.Status) != 0
+ || AcceptDate.CompareTo(item.AcceptDate) != 0
+ || AcceptStuffID.CompareTo(item.AcceptStuffID) != 0
+ || FinishDate.CompareTo(item.FinishDate) != 0
+ || FinishStuffID.CompareTo(item.FinishStuffID) != 0
+ || Amount.CompareTo(item.Amount) != 0
+ || FixturesID.CompareTo(item.FixturesID) != 0
+ || Memo.CompareTo(item.Memo) != 0
+)
+ {
+ return false;
+ }
+ return true;
+ }
+
+
+ public override void CopyTo(object dest)
+ {
+ Arrange item = dest as Arrange;
+ item.ID = ID;
+ item.DetailID = DetailID;
+ item.UseDate = UseDate;
+ item.TraderID = TraderID;
+ item.SubID = SubID;
+ item.SaleID = SaleID;
+ item.Status = Status;
+ item.AcceptDate = AcceptDate;
+ item.AcceptStuffID = AcceptStuffID;
+ item.FinishDate = FinishDate;
+ item.FinishStuffID = FinishStuffID;
+ item.Amount = Amount;
+ item.FixturesID = FixturesID;
+ item.Memo = Memo;
+
+ }
+
+ public override void Clear()
+ {
+ ID = 0;
+ DetailID = 0;
+ UseDate = Date.Default;
+ TraderID = 0;
+ SubID = 0;
+ SaleID = 0;
+ Status = 0;
+ AcceptDate = Date.Default;
+ AcceptStuffID = 0;
+ FinishDate = Date.Default;
+ FinishStuffID = 0;
+ Amount = 0;
+ FixturesID = string.Empty;
+ Memo = string.Empty;
+
+ }
+
+ public Arrange DeepClone()
+ {
+ Arrange item = new Arrange();
+ item.ID = ID;
+ item.DetailID = DetailID;
+ item.UseDate = UseDate;
+ item.TraderID = TraderID;
+ item.SubID = SubID;
+ item.SaleID = SaleID;
+ item.Status = Status;
+ item.AcceptDate = AcceptDate;
+ item.AcceptStuffID = AcceptStuffID;
+ item.FinishDate = FinishDate;
+ item.FinishStuffID = FinishStuffID;
+ item.Amount = Amount;
+ item.FixturesID = FixturesID;
+ item.Memo = Memo;
+
+ return item;
+ }
+
+ public override bool ConvertDataRow(System.Data.DataRow row)
+ {
+ ID = CConvert.ToInt(row["ID"],ID);
+ DetailID = CConvert.ToInt(row["DetailID"],DetailID);
+ UseDate = new Date(row.IsNull("UseDate") ? 0 : CConvert.ToDateInt((System.DateTime)row["UseDate"]));
+ TraderID = CConvert.ToInt(row["TraderID"],TraderID);
+ SubID = CConvert.ToInt(row["SubID"],SubID);
+ SaleID = CConvert.ToInt(row["SaleID"],SaleID);
+ Status = CConvert.ToInt(row["Status"],Status);
+ AcceptDate = new Date(row.IsNull("AcceptDate") ? 0 : CConvert.ToDateInt((System.DateTime)row["AcceptDate"]));
+ AcceptStuffID = CConvert.ToInt(row["AcceptStuffID"],AcceptStuffID);
+ FinishDate = new Date(row.IsNull("FinishDate") ? 0 : CConvert.ToDateInt((System.DateTime)row["FinishDate"]));
+ FinishStuffID = CConvert.ToInt(row["FinishStuffID"],FinishStuffID);
+ Amount = CConvert.ToInt(row["Amount"],Amount);
+ FixturesID = row["FixturesID"].ToString();
+ Memo = row["Memo"].ToString();
+
+ return true;
+ }
+
+ public void ToDataRow(System.Data.DataRow row)
+ {
+ row["ID"] = ID;
+ row["DetailID"] = DetailID;
+ row["UseDate"] = UseDate.ToDateTime();
+ row["TraderID"] = TraderID;
+ row["SubID"] = SubID;
+ row["SaleID"] = SaleID;
+ row["Status"] = Status;
+ row["AcceptDate"] = AcceptDate.ToDateTime();
+ row["AcceptStuffID"] = AcceptStuffID;
+ row["FinishDate"] = FinishDate.ToDateTime();
+ row["FinishStuffID"] = FinishStuffID;
+ row["Amount"] = Amount;
+ row["FixturesID"] = FixturesID;
+ row["Memo"] = Memo;
+
+ }
+
+ public void ConvertReader(DbDataReader row)
+ {
+ int i = 0;
+ ID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ DetailID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ UseDate = new Date(row.IsDBNull(i) ? 0 : CConvert.ToDateInt(row.GetDateTime(i))); i++;
+ TraderID = (int)(row.IsDBNull(i) ? 0 : row.GetInt16(i)); i++;
+ SubID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ SaleID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ Status = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ AcceptDate = new Date(row.IsDBNull(i) ? 0 : CConvert.ToDateInt(row.GetDateTime(i))); i++;
+ AcceptStuffID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ FinishDate = new Date(row.IsDBNull(i) ? 0 : CConvert.ToDateInt(row.GetDateTime(i))); i++;
+ FinishStuffID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ Amount = (int)(row.IsDBNull(i) ? 0 : row.GetInt16(i)); i++;
+ FixturesID = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ Memo = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+
+ }
+
+ public string AddSql()
+ {
+ return $@"INSERT INTO D_Arrange(ID,DetailID,UseDate,TraderID,SubID,SaleID,Status,AcceptDate,AcceptStuffID,FinishDate,FinishStuffID,Amount,FixturesID,Memo) VALUES({ID},{DetailID},{(UseDate == null ? "NULL" : UseDate.ToSqlValue())},{TraderID},{SubID},{SaleID},{Status},{(AcceptDate == null ? "NULL" : AcceptDate.ToSqlValue())},{AcceptStuffID},{(FinishDate == null ? "NULL" : FinishDate.ToSqlValue())},{FinishStuffID},{Amount},N'{FixturesID}',N'{Memo}');";
+ }
+
+ public string UpdateSql()
+ {
+ return $@"UPDATE D_Arrange SET TraderID = {TraderID},SubID = {SubID},SaleID = {SaleID},Status = {Status},AcceptDate = {(AcceptDate == null ? "NULL" : AcceptDate.ToSqlValue())},AcceptStuffID = {AcceptStuffID},FinishDate = {(FinishDate == null ? "NULL" : FinishDate.ToSqlValue())},FinishStuffID = {FinishStuffID},Amount = {Amount},FixturesID = N'{FixturesID}',Memo = N'{Memo}' WHERE ID = {ID} AND DetailID = {DetailID} AND UseDate = {(UseDate == null ? "NULL" : UseDate.ToSqlValue())};";
+ }
+
+ public string ToText()
+ {
+ StringBuilder text = new StringBuilder();
+ text.AppendFormat("ID={0};", ID);
+ text.AppendFormat("DetailID={0};", DetailID);
+ text.AppendFormat("UseDate={0};", UseDate);
+ text.AppendFormat("TraderID={0};", TraderID);
+ text.AppendFormat("SubID={0};", SubID);
+ text.AppendFormat("SaleID={0};", SaleID);
+ text.AppendFormat("Status={0};", Status);
+ text.AppendFormat("AcceptDate={0};", AcceptDate);
+ text.AppendFormat("AcceptStuffID={0};", AcceptStuffID);
+ text.AppendFormat("FinishDate={0};", FinishDate);
+ text.AppendFormat("FinishStuffID={0};", FinishStuffID);
+ text.AppendFormat("Amount={0};", Amount);
+ text.AppendFormat("FixturesID={0};", FixturesID);
+ text.AppendFormat("Memo={0};", Memo);
+
+ return text.ToString();
+ }
+
+ public override object GetField(string name)
+ {
+
+ if (name == "ID") { return ID; }
+ else if (name == "DetailID") { return DetailID; }
+ else if (name == "UseDate") { return UseDate; }
+ else if (name == "TraderID") { return TraderID; }
+ else if (name == "SubID") { return SubID; }
+ else if (name == "SaleID") { return SaleID; }
+ else if (name == "Status") { return Status; }
+ else if (name == "AcceptDate") { return AcceptDate; }
+ else if (name == "AcceptStuffID") { return AcceptStuffID; }
+ else if (name == "FinishDate") { return FinishDate; }
+ else if (name == "FinishStuffID") { return FinishStuffID; }
+ else if (name == "Amount") { return Amount; }
+ else if (name == "FixturesID") { return FixturesID; }
+ else if (name == "Memo") { return Memo; }
+ else { return null; }
+ }
+
+ public override bool SetField(string name, object value)
+ {
+
+ if (name == "ID") { ID = CConvert.ToInt(value); return true; }
+ else if (name == "DetailID") { DetailID = CConvert.ToInt(value); return true; }
+ else if (name == "UseDate") { UseDate = new Date(CConvert.ToDateInt(value)); return true; }
+ else if (name == "TraderID") { TraderID = CConvert.ToInt(value); return true; }
+ else if (name == "SubID") { SubID = CConvert.ToInt(value); return true; }
+ else if (name == "SaleID") { SaleID = CConvert.ToInt(value); return true; }
+ else if (name == "Status") { Status = CConvert.ToInt(value); return true; }
+ else if (name == "AcceptDate") { AcceptDate = new Date(CConvert.ToDateInt(value)); return true; }
+ else if (name == "AcceptStuffID") { AcceptStuffID = CConvert.ToInt(value); return true; }
+ else if (name == "FinishDate") { FinishDate = new Date(CConvert.ToDateInt(value)); return true; }
+ else if (name == "FinishStuffID") { FinishStuffID = CConvert.ToInt(value); return true; }
+ else if (name == "Amount") { Amount = CConvert.ToInt(value); return true; }
+ else if (name == "FixturesID") { FixturesID = value.ToString(); return true; }
+ else if (name == "Memo") { Memo = value.ToString(); return true; }
+ else { return false; }
+ }
+
+ #endregion
+}
\ No newline at end of file
diff --git a/ProtosExpan/UseInfo/Pay.cs b/ProtosExpan/UseInfo/Pay.cs
new file mode 100644
index 0000000..4e291a2
--- /dev/null
+++ b/ProtosExpan/UseInfo/Pay.cs
@@ -0,0 +1,280 @@
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Text;
+using HotelPms.Share.Data;
+using HotelPms.Share.Util;
+using Google.Protobuf.WellKnownTypes;
+using customTypes;
+using System.Data.Common;
+
+namespace HotelPms.Data.UseInfo;
+
+/// ****************************** Description *******************************
+/// ◇システム名称
+/// ホテルPMS
+/// ◇概要
+///
+/// ◇履歴
+/// 2021/05/14 コード作成ツール 自動作成
+/// ****************************** Declarations ******************************
+[Serializable()]
+public partial class Pay : RecordBase
+{
+ #region ★★★★★ Property ★★★★★
+
+ public static ConcurrentDictionary<string, int> PrimaryKey { get; } = new ConcurrentDictionary<string, int>();
+
+ #endregion
+
+ partial void OnConstruction()
+ {
+ if (PrimaryKey.Count == 0)
+ {
+ PrimaryKey.TryAdd("ID", 0);
+ PrimaryKey.TryAdd("DetailID", 0);
+ PrimaryKey.TryAdd("UseDate", 0);
+ PrimaryKey.TryAdd("PayID", 0);
+
+ }
+ }
+
+ #region ★★★★★ Function ★★★★★
+
+ public bool CompareTo(Pay item)
+ {
+ if (ID.CompareTo(item.ID) != 0
+ || DetailID.CompareTo(item.DetailID) != 0
+ || UseDate.CompareTo(item.UseDate) != 0
+ || PayID.CompareTo(item.PayID) != 0
+ || ReceiptID.CompareTo(item.ReceiptID) != 0
+ || PayType.CompareTo(item.PayType) != 0
+ || ItemID.CompareTo(item.ItemID) != 0
+ || ItemName.CompareTo(item.ItemName) != 0
+ || PaySummary.CompareTo(item.PaySummary) != 0
+ || PackSaleID.CompareTo(item.PackSaleID) != 0
+ || ReceiptItemName.CompareTo(item.ReceiptItemName) != 0
+ || ReceiptPrtType.CompareTo(item.ReceiptPrtType) != 0
+ || ReceiptPage.CompareTo(item.ReceiptPage) != 0
+ || AgentID.CompareTo(item.AgentID) != 0
+ || AgentBranchID.CompareTo(item.AgentBranchID) != 0
+ || CustomerID.CompareTo(item.CustomerID) != 0
+)
+ {
+ return false;
+ }
+ return true;
+ }
+
+
+ public override void CopyTo(object dest)
+ {
+ Pay item = dest as Pay;
+ item.ID = ID;
+ item.DetailID = DetailID;
+ item.UseDate = UseDate;
+ item.PayID = PayID;
+ item.ReceiptID = ReceiptID;
+ item.PayType = PayType;
+ item.ItemID = ItemID;
+ item.ItemName = ItemName;
+ item.PaySummary = PaySummary;
+ item.PackSaleID = PackSaleID;
+ item.ReceiptItemName = ReceiptItemName;
+ item.ReceiptPrtType = ReceiptPrtType;
+ item.ReceiptPage = ReceiptPage;
+ item.AgentID = AgentID;
+ item.AgentBranchID = AgentBranchID;
+ item.CustomerID = CustomerID;
+
+ }
+
+ public override void Clear()
+ {
+ ID = 0;
+ DetailID = 0;
+ UseDate = Date.Default;
+ PayID = 0;
+ ReceiptID = 0;
+ PayType = 0;
+ ItemID = string.Empty;
+ ItemName = string.Empty;
+ PaySummary = 0;
+ PackSaleID = 0;
+ ReceiptItemName = string.Empty;
+ ReceiptPrtType = 0;
+ ReceiptPage = 0;
+ AgentID = 0;
+ AgentBranchID = 0;
+ CustomerID = 0;
+
+ }
+
+ public Pay DeepClone()
+ {
+ Pay item = new Pay();
+ item.ID = ID;
+ item.DetailID = DetailID;
+ item.UseDate = UseDate;
+ item.PayID = PayID;
+ item.ReceiptID = ReceiptID;
+ item.PayType = PayType;
+ item.ItemID = ItemID;
+ item.ItemName = ItemName;
+ item.PaySummary = PaySummary;
+ item.PackSaleID = PackSaleID;
+ item.ReceiptItemName = ReceiptItemName;
+ item.ReceiptPrtType = ReceiptPrtType;
+ item.ReceiptPage = ReceiptPage;
+ item.AgentID = AgentID;
+ item.AgentBranchID = AgentBranchID;
+ item.CustomerID = CustomerID;
+
+ return item;
+ }
+
+ public override bool ConvertDataRow(System.Data.DataRow row)
+ {
+ ID = CConvert.ToInt(row["ID"],ID);
+ DetailID = CConvert.ToInt(row["DetailID"],DetailID);
+ UseDate = new Date(row.IsNull("UseDate") ? 0 : CConvert.ToDateInt((System.DateTime)row["UseDate"]));
+ PayID = CConvert.ToInt(row["PayID"],PayID);
+ ReceiptID = CConvert.ToInt(row["ReceiptID"],ReceiptID);
+ PayType = CConvert.ToInt(row["PayType"],PayType);
+ ItemID = row["ItemID"].ToString();
+ ItemName = row["ItemName"].ToString();
+ PaySummary = CConvert.ToDecimal(row["PaySummary"]);
+ PackSaleID = CConvert.ToInt(row["PackSaleID"],PackSaleID);
+ ReceiptItemName = row["ReceiptItemName"].ToString();
+ ReceiptPrtType = CConvert.ToInt(row["ReceiptPrtType"],ReceiptPrtType);
+ ReceiptPage = CConvert.ToInt(row["ReceiptPage"],ReceiptPage);
+ AgentID = CConvert.ToInt(row["AgentID"],AgentID);
+ AgentBranchID = CConvert.ToInt(row["AgentBranchID"],AgentBranchID);
+ CustomerID = CConvert.ToInt(row["CustomerID"],CustomerID);
+
+ return true;
+ }
+
+ public void ToDataRow(System.Data.DataRow row)
+ {
+ row["ID"] = ID;
+ row["DetailID"] = DetailID;
+ row["UseDate"] = UseDate.ToDateTime();
+ row["PayID"] = PayID;
+ row["ReceiptID"] = ReceiptID;
+ row["PayType"] = PayType;
+ row["ItemID"] = ItemID;
+ row["ItemName"] = ItemName;
+ row["PaySummary"] = PaySummary.ToDecimal();
+ row["PackSaleID"] = PackSaleID;
+ row["ReceiptItemName"] = ReceiptItemName;
+ row["ReceiptPrtType"] = ReceiptPrtType;
+ row["ReceiptPage"] = ReceiptPage;
+ row["AgentID"] = AgentID;
+ row["AgentBranchID"] = AgentBranchID;
+ row["CustomerID"] = CustomerID;
+
+ }
+
+ public void ConvertReader(DbDataReader row)
+ {
+ int i = 0;
+ ID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ DetailID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ UseDate = new Date(row.IsDBNull(i) ? 0 : CConvert.ToDateInt(row.GetDateTime(i))); i++;
+ PayID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ ReceiptID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ PayType = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ ItemID = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ ItemName = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ PaySummary = (decimal)(row.IsDBNull(i) ? 0M : row.GetDecimal(i)); i++;
+ PackSaleID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ ReceiptItemName = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ ReceiptPrtType = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ ReceiptPage = (int)(row.IsDBNull(i) ? 0 : row.GetInt16(i)); i++;
+ AgentID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ AgentBranchID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ CustomerID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+
+ }
+
+ public string AddSql()
+ {
+ return $@"INSERT INTO D_Pay(ID,DetailID,UseDate,PayID,ReceiptID,PayType,ItemID,ItemName,PaySummary,PackSaleID,ReceiptItemName,ReceiptPrtType,ReceiptPage,AgentID,AgentBranchID,CustomerID) VALUES({ID},{DetailID},{(UseDate == null ? "NULL" : UseDate.ToSqlValue())},{PayID},{ReceiptID},{PayType},N'{ItemID}',N'{ItemName}',{(PaySummary == null ? "0" : PaySummary.ToSqlValue())},{PackSaleID},N'{ReceiptItemName}',{ReceiptPrtType},{ReceiptPage},{AgentID},{AgentBranchID},{CustomerID});";
+ }
+
+ public string UpdateSql()
+ {
+ return $@"UPDATE D_Pay SET ReceiptID = {ReceiptID},PayType = {PayType},ItemID = N'{ItemID}',ItemName = N'{ItemName}',PaySummary = {(PaySummary == null ? "0" : PaySummary.ToSqlValue())},PackSaleID = {PackSaleID},ReceiptItemName = N'{ReceiptItemName}',ReceiptPrtType = {ReceiptPrtType},ReceiptPage = {ReceiptPage},AgentID = {AgentID},AgentBranchID = {AgentBranchID},CustomerID = {CustomerID} WHERE ID = {ID} AND DetailID = {DetailID} AND UseDate = {(UseDate == null ? "NULL" : UseDate.ToSqlValue())} AND PayID = {PayID};";
+ }
+
+ public string ToText()
+ {
+ StringBuilder text = new StringBuilder();
+ text.AppendFormat("ID={0};", ID);
+ text.AppendFormat("DetailID={0};", DetailID);
+ text.AppendFormat("UseDate={0};", UseDate);
+ text.AppendFormat("PayID={0};", PayID);
+ text.AppendFormat("ReceiptID={0};", ReceiptID);
+ text.AppendFormat("PayType={0};", PayType);
+ text.AppendFormat("ItemID={0};", ItemID);
+ text.AppendFormat("ItemName={0};", ItemName);
+ text.AppendFormat("PaySummary={0};", PaySummary);
+ text.AppendFormat("PackSaleID={0};", PackSaleID);
+ text.AppendFormat("ReceiptItemName={0};", ReceiptItemName);
+ text.AppendFormat("ReceiptPrtType={0};", ReceiptPrtType);
+ text.AppendFormat("ReceiptPage={0};", ReceiptPage);
+ text.AppendFormat("AgentID={0};", AgentID);
+ text.AppendFormat("AgentBranchID={0};", AgentBranchID);
+ text.AppendFormat("CustomerID={0};", CustomerID);
+
+ return text.ToString();
+ }
+
+ public override object GetField(string name)
+ {
+
+ if (name == "ID") { return ID; }
+ else if (name == "DetailID") { return DetailID; }
+ else if (name == "UseDate") { return UseDate; }
+ else if (name == "PayID") { return PayID; }
+ else if (name == "ReceiptID") { return ReceiptID; }
+ else if (name == "PayType") { return PayType; }
+ else if (name == "ItemID") { return ItemID; }
+ else if (name == "ItemName") { return ItemName; }
+ else if (name == "PaySummary") { return PaySummary; }
+ else if (name == "PackSaleID") { return PackSaleID; }
+ else if (name == "ReceiptItemName") { return ReceiptItemName; }
+ else if (name == "ReceiptPrtType") { return ReceiptPrtType; }
+ else if (name == "ReceiptPage") { return ReceiptPage; }
+ else if (name == "AgentID") { return AgentID; }
+ else if (name == "AgentBranchID") { return AgentBranchID; }
+ else if (name == "CustomerID") { return CustomerID; }
+ else { return null; }
+ }
+
+ public override bool SetField(string name, object value)
+ {
+
+ if (name == "ID") { ID = CConvert.ToInt(value); return true; }
+ else if (name == "DetailID") { DetailID = CConvert.ToInt(value); return true; }
+ else if (name == "UseDate") { UseDate = new Date(CConvert.ToDateInt(value)); return true; }
+ else if (name == "PayID") { PayID = CConvert.ToInt(value); return true; }
+ else if (name == "ReceiptID") { ReceiptID = CConvert.ToInt(value); return true; }
+ else if (name == "PayType") { PayType = CConvert.ToInt(value); return true; }
+ else if (name == "ItemID") { ItemID = value.ToString(); return true; }
+ else if (name == "ItemName") { ItemName = value.ToString(); return true; }
+ else if (name == "PaySummary") { PaySummary = CConvert.ToDecimal(value); return true; }
+ else if (name == "PackSaleID") { PackSaleID = CConvert.ToInt(value); return true; }
+ else if (name == "ReceiptItemName") { ReceiptItemName = value.ToString(); return true; }
+ else if (name == "ReceiptPrtType") { ReceiptPrtType = CConvert.ToInt(value); return true; }
+ else if (name == "ReceiptPage") { ReceiptPage = CConvert.ToInt(value); return true; }
+ else if (name == "AgentID") { AgentID = CConvert.ToInt(value); return true; }
+ else if (name == "AgentBranchID") { AgentBranchID = CConvert.ToInt(value); return true; }
+ else if (name == "CustomerID") { CustomerID = CConvert.ToInt(value); return true; }
+ else { return false; }
+ }
+
+ #endregion
+}
\ No newline at end of file
diff --git a/ProtosExpan/UseInfo/PayDiv.cs b/ProtosExpan/UseInfo/PayDiv.cs
new file mode 100644
index 0000000..8720e44
--- /dev/null
+++ b/ProtosExpan/UseInfo/PayDiv.cs
@@ -0,0 +1,224 @@
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Text;
+using HotelPms.Share.Data;
+using HotelPms.Share.Util;
+using Google.Protobuf.WellKnownTypes;
+
+namespace HotelPms.Data.UseInfo
+{
+ /// ****************************** Description *******************************
+ /// ◇システム名称
+ /// ホテルPMS
+ /// ◇概要
+ ///
+ /// ◇履歴
+ /// 2021/05/14 コード作成ツール 自動作成
+ /// ****************************** Declarations ******************************
+ [Serializable()]
+ public partial class PayDiv : RecordBase
+ {
+ #region ★★★★★ Property ★★★★★
+
+ public static ConcurrentDictionary<string, int> PrimaryKey { get; } = new ConcurrentDictionary<string, int>();
+
+ #endregion
+
+ partial void OnConstruction()
+ {
+ if (PrimaryKey.Count == 0)
+ {
+ PrimaryKey.TryAdd("ID", 0);
+ PrimaryKey.TryAdd("DetailID", 0);
+ PrimaryKey.TryAdd("UseDate", 0);
+ PrimaryKey.TryAdd("PayID", 0);
+ PrimaryKey.TryAdd("RowNo", 0);
+
+ }
+ }
+
+ #region ★★★★★ Function ★★★★★
+
+ private Timestamp ToTimestamp(DateTime dateTime)
+ {
+ return Timestamp.FromDateTime(DateTime.SpecifyKind(dateTime, DateTimeKind.Utc));
+ }
+
+ public bool CompareTo(PayDiv item)
+ {
+ if (ID.CompareTo(item.ID) != 0
+ || DetailID.CompareTo(item.DetailID) != 0
+ || UseDate.CompareTo(item.UseDate) != 0
+ || PayID.CompareTo(item.PayID) != 0
+ || RowNo.CompareTo(item.RowNo) != 0
+ || ReceiptID.CompareTo(item.ReceiptID) != 0
+ || PaySummary.CompareTo(item.PaySummary) != 0
+ || SaleRowNo.CompareTo(item.SaleRowNo) != 0
+ || ReceiptPrtType.CompareTo(item.ReceiptPrtType) != 0
+ || ReceiptPage.CompareTo(item.ReceiptPage) != 0
+)
+ {
+ return false;
+ }
+ return true;
+ }
+
+
+ public override void CopyTo(object dest)
+ {
+ PayDiv item = dest as PayDiv;
+ item.ID = ID;
+ item.DetailID = DetailID;
+ item.UseDate = UseDate;
+ item.PayID = PayID;
+ item.RowNo = RowNo;
+ item.ReceiptID = ReceiptID;
+ item.PaySummary = PaySummary;
+ item.SaleRowNo = SaleRowNo;
+ item.ReceiptPrtType = ReceiptPrtType;
+ item.ReceiptPage = ReceiptPage;
+
+ }
+
+ public override void Clear()
+ {
+ ID = 0;
+ DetailID = 0;
+ UseDate = ToTimestamp(DateTime.MinValue);
+ PayID = 0;
+ RowNo = 0;
+ ReceiptID = 0;
+ PaySummary = 0;
+ SaleRowNo = 0;
+ ReceiptPrtType = 0;
+ ReceiptPage = 0;
+
+ }
+
+ public PayDiv DeepClone()
+ {
+ PayDiv item = new PayDiv();
+ item.ID = ID;
+ item.DetailID = DetailID;
+ item.UseDate = UseDate;
+ item.PayID = PayID;
+ item.RowNo = RowNo;
+ item.ReceiptID = ReceiptID;
+ item.PaySummary = PaySummary;
+ item.SaleRowNo = SaleRowNo;
+ item.ReceiptPrtType = ReceiptPrtType;
+ item.ReceiptPage = ReceiptPage;
+
+ return item;
+ }
+
+ public override bool ConvertDataRow(System.Data.DataRow row)
+ {
+ ID = CConvert.ToInt(row["ID"],ID);
+ DetailID = CConvert.ToInt(row["DetailID"],DetailID);
+ UseDate = ToTimestamp(row.IsNull("UseDate") ? DateTime.MinValue : (System.DateTime)row["UseDate"]);
+ PayID = CConvert.ToInt(row["PayID"],PayID);
+ RowNo = CConvert.ToInt(row["RowNo"],RowNo);
+ ReceiptID = CConvert.ToInt(row["ReceiptID"],ReceiptID);
+ PaySummary = CConvert.ToDecimal(row["PaySummary"]);
+ SaleRowNo = CConvert.ToInt(row["SaleRowNo"],SaleRowNo);
+ ReceiptPrtType = CConvert.ToInt(row["ReceiptPrtType"],ReceiptPrtType);
+ ReceiptPage = CConvert.ToInt(row["ReceiptPage"],ReceiptPage);
+
+ return true;
+ }
+
+ public void ToDataRow(System.Data.DataRow row)
+ {
+ row["ID"] = ID;
+ row["DetailID"] = DetailID;
+ row["UseDate"] = UseDate;
+ row["PayID"] = PayID;
+ row["RowNo"] = RowNo;
+ row["ReceiptID"] = ReceiptID;
+ row["PaySummary"] = PaySummary;
+ row["SaleRowNo"] = SaleRowNo;
+ row["ReceiptPrtType"] = ReceiptPrtType;
+ row["ReceiptPage"] = ReceiptPage;
+
+ }
+
+ public void ConvertReader(SqlDataReader row)
+ {
+ ID = CConvert.ToInt(row["ID"],ID);
+ DetailID = CConvert.ToInt(row["DetailID"],DetailID);
+ UseDate = ToTimestamp(row.IsNull("UseDate") ? DateTime.MinValue : (System.DateTime)row["UseDate"]);
+ PayID = CConvert.ToInt(row["PayID"],PayID);
+ RowNo = CConvert.ToInt(row["RowNo"],RowNo);
+ ReceiptID = CConvert.ToInt(row["ReceiptID"],ReceiptID);
+ PaySummary = CConvert.ToDecimal(row["PaySummary"]);
+ SaleRowNo = CConvert.ToInt(row["SaleRowNo"],SaleRowNo);
+ ReceiptPrtType = CConvert.ToInt(row["ReceiptPrtType"],ReceiptPrtType);
+ ReceiptPage = CConvert.ToInt(row["ReceiptPage"],ReceiptPage);
+
+ }
+
+ public string AddSql()
+ {
+ return $@"INSERT INTO D_PayDiv(ID,DetailID,UseDate,PayID,RowNo,ReceiptID,PaySummary,SaleRowNo,ReceiptPrtType,ReceiptPage) VALUES({ID},{DetailID},{CConvert.ToSqlValue(UseDate)},{PayID},{RowNo},{ReceiptID},{PaySummary},{SaleRowNo},{ReceiptPrtType},{ReceiptPage});";
+ }
+
+ public string UpdateSql()
+ {
+ return $@"UPDATE D_PayDiv SET ReceiptID = {ReceiptID},PaySummary = {PaySummary},SaleRowNo = {SaleRowNo},ReceiptPrtType = {ReceiptPrtType},ReceiptPage = {ReceiptPage} WHERE ID = {ID} AND DetailID = {DetailID} AND UseDate = {CConvert.ToSqlValue(UseDate)} AND PayID = {PayID} AND RowNo = {RowNo};";
+ }
+
+ public string ToText()
+ {
+ StringBuilder text = new StringBuilder();
+ text.AppendFormat("ID={0};", ID);
+ text.AppendFormat("DetailID={0};", DetailID);
+ text.AppendFormat("UseDate={0};", UseDate);
+ text.AppendFormat("PayID={0};", PayID);
+ text.AppendFormat("RowNo={0};", RowNo);
+ text.AppendFormat("ReceiptID={0};", ReceiptID);
+ text.AppendFormat("PaySummary={0};", PaySummary);
+ text.AppendFormat("SaleRowNo={0};", SaleRowNo);
+ text.AppendFormat("ReceiptPrtType={0};", ReceiptPrtType);
+ text.AppendFormat("ReceiptPage={0};", ReceiptPage);
+
+ return text.ToString();
+ }
+
+ public override object GetField(string name)
+ {
+
+ if (name == "ID") { return ID; }
+ else if (name == "DetailID") { return DetailID; }
+ else if (name == "UseDate") { return UseDate; }
+ else if (name == "PayID") { return PayID; }
+ else if (name == "RowNo") { return RowNo; }
+ else if (name == "ReceiptID") { return ReceiptID; }
+ else if (name == "PaySummary") { return PaySummary; }
+ else if (name == "SaleRowNo") { return SaleRowNo; }
+ else if (name == "ReceiptPrtType") { return ReceiptPrtType; }
+ else if (name == "ReceiptPage") { return ReceiptPage; }
+ else { return null; }
+ }
+
+ public override bool SetField(string name, object value)
+ {
+
+ if (name == "ID") { ID = CConvert.ToInt(value); return true; }
+ else if (name == "DetailID") { DetailID = CConvert.ToInt(value); return true; }
+ else if (name == "UseDate") { UseDate = ToTimestamp(CConvert.ToDateTime(value)); return true; }
+ else if (name == "PayID") { PayID = CConvert.ToInt(value); return true; }
+ else if (name == "RowNo") { RowNo = CConvert.ToInt(value); return true; }
+ else if (name == "ReceiptID") { ReceiptID = CConvert.ToInt(value); return true; }
+ else if (name == "PaySummary") { PaySummary = CConvert.ToDecimal(value); return true; }
+ else if (name == "SaleRowNo") { SaleRowNo = CConvert.ToInt(value); return true; }
+ else if (name == "ReceiptPrtType") { ReceiptPrtType = CConvert.ToInt(value); return true; }
+ else if (name == "ReceiptPage") { ReceiptPage = CConvert.ToInt(value); return true; }
+ else { return false; }
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/ProtosExpan/UseInfo/Receipt.cs b/ProtosExpan/UseInfo/Receipt.cs
new file mode 100644
index 0000000..08226b7
--- /dev/null
+++ b/ProtosExpan/UseInfo/Receipt.cs
@@ -0,0 +1,378 @@
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Text;
+using HotelPms.Share.Data;
+using HotelPms.Share.Util;
+using Google.Protobuf.WellKnownTypes;
+using customTypes;
+using System.Data.Common;
+
+namespace HotelPms.Data.UseInfo;
+
+/// ****************************** Description *******************************
+/// ◇システム名称
+/// ホテルPMS
+/// ◇概要
+///
+/// ◇履歴
+/// 2021/05/14 コード作成ツール 自動作成
+/// ****************************** Declarations ******************************
+[Serializable()]
+public partial class Receipt : RecordBase
+{
+ #region ★★★★★ Property ★★★★★
+
+ public static ConcurrentDictionary<string, int> PrimaryKey { get; } = new ConcurrentDictionary<string, int>();
+
+ #endregion
+
+ partial void OnConstruction()
+ {
+ if (PrimaryKey.Count == 0)
+ {
+ PrimaryKey.TryAdd("ID", 0);
+ PrimaryKey.TryAdd("ReceiptID", 0);
+
+ }
+ }
+
+ #region ★★★★★ Function ★★★★★
+
+ public bool CompareTo(Receipt item)
+ {
+ if (ID.CompareTo(item.ID) != 0
+ || ReceiptID.CompareTo(item.ReceiptID) != 0
+ || PersonID.CompareTo(item.PersonID) != 0
+ || ReceiptNo.CompareTo(item.ReceiptNo) != 0
+ || IssueStatus.CompareTo(item.IssueStatus) != 0
+ || IssueDate.CompareTo(item.IssueDate) != 0
+ || IssueCount.CompareTo(item.IssueCount) != 0
+ || IssuePageCount.CompareTo(item.IssuePageCount) != 0
+ || Name.CompareTo(item.Name) != 0
+ || LanguageType.CompareTo(item.LanguageType) != 0
+ || DivID.CompareTo(item.DivID) != 0
+ || UseDate.CompareTo(item.UseDate) != 0
+ || CorpID.CompareTo(item.CorpID) != 0
+ || CustomerID.CompareTo(item.CustomerID) != 0
+ || PayKind.CompareTo(item.PayKind) != 0
+ || Person.CompareTo(item.Person) != 0
+ || RoomID.CompareTo(item.RoomID) != 0
+ || VoidReason.CompareTo(item.VoidReason) != 0
+ || TotalSummary.CompareTo(item.TotalSummary) != 0
+ || PaySummary.CompareTo(item.PaySummary) != 0
+ || Summary.CompareTo(item.Summary) != 0
+ || ServiceSummary.CompareTo(item.ServiceSummary) != 0
+ || TaxSummary.CompareTo(item.TaxSummary) != 0
+ || BathTaxSummary.CompareTo(item.BathTaxSummary) != 0
+ || AccTaxSummary.CompareTo(item.AccTaxSummary) != 0
+ || DiscountSummary.CompareTo(item.DiscountSummary) != 0
+)
+ {
+ return false;
+ }
+ return true;
+ }
+
+
+ public override void CopyTo(object dest)
+ {
+ Receipt item = dest as Receipt;
+ item.ID = ID;
+ item.ReceiptID = ReceiptID;
+ item.PersonID = PersonID;
+ item.ReceiptNo = ReceiptNo;
+ item.IssueStatus = IssueStatus;
+ item.IssueDate = IssueDate;
+ item.IssueCount = IssueCount;
+ item.IssuePageCount = IssuePageCount;
+ item.Name = Name;
+ item.LanguageType = LanguageType;
+ item.DivID = DivID;
+ item.UseDate = UseDate;
+ item.CorpID = CorpID;
+ item.CustomerID = CustomerID;
+ item.PayKind = PayKind;
+ item.Person = Person;
+ item.RoomID = RoomID;
+ item.VoidReason = VoidReason;
+ item.TotalSummary = TotalSummary;
+ item.PaySummary = PaySummary;
+ item.Summary = Summary;
+ item.ServiceSummary = ServiceSummary;
+ item.TaxSummary = TaxSummary;
+ item.BathTaxSummary = BathTaxSummary;
+ item.AccTaxSummary = AccTaxSummary;
+ item.DiscountSummary = DiscountSummary;
+
+ }
+
+ public override void Clear()
+ {
+ ID = 0;
+ ReceiptID = 0;
+ PersonID = 0;
+ ReceiptNo = 0;
+ IssueStatus = 0;
+ IssueDate = CConvert.ToTimestamp(DateTime.MinValue);
+ IssueCount = 0;
+ IssuePageCount = 0;
+ Name = string.Empty;
+ LanguageType = 0;
+ DivID = 0;
+ UseDate = Date.Default;
+ CorpID = 0;
+ CustomerID = 0;
+ PayKind = 0;
+ Person = 0;
+ RoomID = 0;
+ VoidReason = string.Empty;
+ TotalSummary = 0;
+ PaySummary = 0;
+ Summary = 0;
+ ServiceSummary = 0;
+ TaxSummary = 0;
+ BathTaxSummary = 0;
+ AccTaxSummary = 0;
+ DiscountSummary = 0;
+
+ }
+
+ public Receipt DeepClone()
+ {
+ Receipt item = new Receipt();
+ item.ID = ID;
+ item.ReceiptID = ReceiptID;
+ item.PersonID = PersonID;
+ item.ReceiptNo = ReceiptNo;
+ item.IssueStatus = IssueStatus;
+ item.IssueDate = IssueDate;
+ item.IssueCount = IssueCount;
+ item.IssuePageCount = IssuePageCount;
+ item.Name = Name;
+ item.LanguageType = LanguageType;
+ item.DivID = DivID;
+ item.UseDate = UseDate;
+ item.CorpID = CorpID;
+ item.CustomerID = CustomerID;
+ item.PayKind = PayKind;
+ item.Person = Person;
+ item.RoomID = RoomID;
+ item.VoidReason = VoidReason;
+ item.TotalSummary = TotalSummary;
+ item.PaySummary = PaySummary;
+ item.Summary = Summary;
+ item.ServiceSummary = ServiceSummary;
+ item.TaxSummary = TaxSummary;
+ item.BathTaxSummary = BathTaxSummary;
+ item.AccTaxSummary = AccTaxSummary;
+ item.DiscountSummary = DiscountSummary;
+
+ return item;
+ }
+
+ public override bool ConvertDataRow(System.Data.DataRow row)
+ {
+ ID = CConvert.ToInt(row["ID"],ID);
+ ReceiptID = CConvert.ToInt(row["ReceiptID"],ReceiptID);
+ PersonID = CConvert.ToInt(row["PersonID"],PersonID);
+ ReceiptNo = CConvert.ToInt(row["ReceiptNo"],ReceiptNo);
+ IssueStatus = CConvert.ToInt(row["IssueStatus"],IssueStatus);
+ IssueDate = CConvert.ToTimestamp(row.IsNull("IssueDate") ? DateTime.MinValue : (System.DateTime)row["IssueDate"]);
+ IssueCount = CConvert.ToInt(row["IssueCount"],IssueCount);
+ IssuePageCount = CConvert.ToInt(row["IssuePageCount"],IssuePageCount);
+ Name = row["Name"].ToString();
+ LanguageType = CConvert.ToInt(row["LanguageType"],LanguageType);
+ DivID = CConvert.ToInt(row["DivID"],DivID);
+ UseDate = new Date(row.IsNull("UseDate") ? 0 : CConvert.ToDateInt((System.DateTime)row["UseDate"]));
+ CorpID = CConvert.ToInt(row["CorpID"],CorpID);
+ CustomerID = CConvert.ToInt(row["CustomerID"],CustomerID);
+ PayKind = CConvert.ToInt(row["PayKind"],PayKind);
+ Person = CConvert.ToInt(row["Person"],Person);
+ RoomID = CConvert.ToInt(row["RoomID"],RoomID);
+ VoidReason = row["VoidReason"].ToString();
+ TotalSummary = CConvert.ToDecimal(row["TotalSummary"]);
+ PaySummary = CConvert.ToDecimal(row["PaySummary"]);
+ Summary = CConvert.ToDecimal(row["Summary"]);
+ ServiceSummary = CConvert.ToDecimal(row["ServiceSummary"]);
+ TaxSummary = CConvert.ToDecimal(row["TaxSummary"]);
+ BathTaxSummary = CConvert.ToDecimal(row["BathTaxSummary"]);
+ AccTaxSummary = CConvert.ToDecimal(row["AccTaxSummary"]);
+ DiscountSummary = CConvert.ToDecimal(row["DiscountSummary"]);
+
+ return true;
+ }
+
+ public void ToDataRow(System.Data.DataRow row)
+ {
+ row["ID"] = ID;
+ row["ReceiptID"] = ReceiptID;
+ row["PersonID"] = PersonID;
+ row["ReceiptNo"] = ReceiptNo;
+ row["IssueStatus"] = IssueStatus;
+ row["IssueDate"] = IssueDate.ToDateTime();
+ row["IssueCount"] = IssueCount;
+ row["IssuePageCount"] = IssuePageCount;
+ row["Name"] = Name;
+ row["LanguageType"] = LanguageType;
+ row["DivID"] = DivID;
+ row["UseDate"] = UseDate.ToDateTime();
+ row["CorpID"] = CorpID;
+ row["CustomerID"] = CustomerID;
+ row["PayKind"] = PayKind;
+ row["Person"] = Person;
+ row["RoomID"] = RoomID;
+ row["VoidReason"] = VoidReason;
+ row["TotalSummary"] = TotalSummary.ToDecimal();
+ row["PaySummary"] = PaySummary.ToDecimal();
+ row["Summary"] = Summary.ToDecimal();
+ row["ServiceSummary"] = ServiceSummary.ToDecimal();
+ row["TaxSummary"] = TaxSummary.ToDecimal();
+ row["BathTaxSummary"] = BathTaxSummary.ToDecimal();
+ row["AccTaxSummary"] = AccTaxSummary.ToDecimal();
+ row["DiscountSummary"] = DiscountSummary.ToDecimal();
+
+ }
+
+ public void ConvertReader(DbDataReader row)
+ {
+ int i = 0;
+ ID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ ReceiptID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ PersonID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ ReceiptNo = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ IssueStatus = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ IssueDate = CConvert.ToTimestamp(row.IsDBNull(i) ? DateTime.MinValue : row.GetDateTime(i)); i++;
+ IssueCount = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ IssuePageCount = (int)(row.IsDBNull(i) ? 0 : row.GetInt16(i)); i++;
+ Name = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ LanguageType = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ DivID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ UseDate = new Date(row.IsDBNull(i) ? 0 : CConvert.ToDateInt(row.GetDateTime(i))); i++;
+ CorpID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ CustomerID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ PayKind = (int)(row.IsDBNull(i) ? 0 : row.GetInt16(i)); i++;
+ Person = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ RoomID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ VoidReason = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ TotalSummary = (decimal)(row.IsDBNull(i) ? 0M : row.GetDecimal(i)); i++;
+ PaySummary = (decimal)(row.IsDBNull(i) ? 0M : row.GetDecimal(i)); i++;
+ Summary = (decimal)(row.IsDBNull(i) ? 0M : row.GetDecimal(i)); i++;
+ ServiceSummary = (decimal)(row.IsDBNull(i) ? 0M : row.GetDecimal(i)); i++;
+ TaxSummary = (decimal)(row.IsDBNull(i) ? 0M : row.GetDecimal(i)); i++;
+ BathTaxSummary = (decimal)(row.IsDBNull(i) ? 0M : row.GetDecimal(i)); i++;
+ AccTaxSummary = (decimal)(row.IsDBNull(i) ? 0M : row.GetDecimal(i)); i++;
+ DiscountSummary = (decimal)(row.IsDBNull(i) ? 0M : row.GetDecimal(i)); i++;
+
+ }
+
+ public string AddSql()
+ {
+ return $@"INSERT INTO D_Receipt(ID,ReceiptID,PersonID,ReceiptNo,IssueStatus,IssueDate,IssueCount,IssuePageCount,Name,LanguageType,DivID,UseDate,CorpID,CustomerID,PayKind,Person,RoomID,VoidReason,TotalSummary,PaySummary,Summary,ServiceSummary,TaxSummary,BathTaxSummary,AccTaxSummary,DiscountSummary) VALUES({ID},{ReceiptID},{PersonID},{ReceiptNo},{IssueStatus},{(IssueDate == null ? "NULL" : CConvert.ToSqlValue(IssueDate.ToDateTime()))},{IssueCount},{IssuePageCount},N'{Name}',{LanguageType},{DivID},{(UseDate == null ? "NULL" : UseDate.ToSqlValue())},{CorpID},{CustomerID},{PayKind},{Person},{RoomID},N'{VoidReason}',{(TotalSummary == null ? "0" : TotalSummary.ToSqlValue())},{(PaySummary == null ? "0" : PaySummary.ToSqlValue())},{(Summary == null ? "0" : Summary.ToSqlValue())},{(ServiceSummary == null ? "0" : ServiceSummary.ToSqlValue())},{(TaxSummary == null ? "0" : TaxSummary.ToSqlValue())},{(BathTaxSummary == null ? "0" : BathTaxSummary.ToSqlValue())},{(AccTaxSummary == null ? "0" : AccTaxSummary.ToSqlValue())},{(DiscountSummary == null ? "0" : DiscountSummary.ToSqlValue())});";
+ }
+
+ public string UpdateSql()
+ {
+ return $@"UPDATE D_Receipt SET PersonID = {PersonID},ReceiptNo = {ReceiptNo},IssueStatus = {IssueStatus},IssueDate = {(IssueDate == null ? "NULL" : CConvert.ToSqlValue(IssueDate.ToDateTime()))},IssueCount = {IssueCount},IssuePageCount = {IssuePageCount},Name = N'{Name}',LanguageType = {LanguageType},DivID = {DivID},UseDate = {(UseDate == null ? "NULL" : UseDate.ToSqlValue())},CorpID = {CorpID},CustomerID = {CustomerID},PayKind = {PayKind},Person = {Person},RoomID = {RoomID},VoidReason = N'{VoidReason}',TotalSummary = {(TotalSummary == null ? "0" : TotalSummary.ToSqlValue())},PaySummary = {(PaySummary == null ? "0" : PaySummary.ToSqlValue())},Summary = {(Summary == null ? "0" : Summary.ToSqlValue())},ServiceSummary = {(ServiceSummary == null ? "0" : ServiceSummary.ToSqlValue())},TaxSummary = {(TaxSummary == null ? "0" : TaxSummary.ToSqlValue())},BathTaxSummary = {(BathTaxSummary == null ? "0" : BathTaxSummary.ToSqlValue())},AccTaxSummary = {(AccTaxSummary == null ? "0" : AccTaxSummary.ToSqlValue())},DiscountSummary = {(DiscountSummary == null ? "0" : DiscountSummary.ToSqlValue())} WHERE ID = {ID} AND ReceiptID = {ReceiptID};";
+ }
+
+ public string ToText()
+ {
+ StringBuilder text = new StringBuilder();
+ text.AppendFormat("ID={0};", ID);
+ text.AppendFormat("ReceiptID={0};", ReceiptID);
+ text.AppendFormat("PersonID={0};", PersonID);
+ text.AppendFormat("ReceiptNo={0};", ReceiptNo);
+ text.AppendFormat("IssueStatus={0};", IssueStatus);
+ text.AppendFormat("IssueDate={0};", IssueDate);
+ text.AppendFormat("IssueCount={0};", IssueCount);
+ text.AppendFormat("IssuePageCount={0};", IssuePageCount);
+ text.AppendFormat("Name={0};", Name);
+ text.AppendFormat("LanguageType={0};", LanguageType);
+ text.AppendFormat("DivID={0};", DivID);
+ text.AppendFormat("UseDate={0};", UseDate);
+ text.AppendFormat("CorpID={0};", CorpID);
+ text.AppendFormat("CustomerID={0};", CustomerID);
+ text.AppendFormat("PayKind={0};", PayKind);
+ text.AppendFormat("Person={0};", Person);
+ text.AppendFormat("RoomID={0};", RoomID);
+ text.AppendFormat("VoidReason={0};", VoidReason);
+ text.AppendFormat("TotalSummary={0};", TotalSummary);
+ text.AppendFormat("PaySummary={0};", PaySummary);
+ text.AppendFormat("Summary={0};", Summary);
+ text.AppendFormat("ServiceSummary={0};", ServiceSummary);
+ text.AppendFormat("TaxSummary={0};", TaxSummary);
+ text.AppendFormat("BathTaxSummary={0};", BathTaxSummary);
+ text.AppendFormat("AccTaxSummary={0};", AccTaxSummary);
+ text.AppendFormat("DiscountSummary={0};", DiscountSummary);
+
+ return text.ToString();
+ }
+
+ public override object GetField(string name)
+ {
+
+ if (name == "ID") { return ID; }
+ else if (name == "ReceiptID") { return ReceiptID; }
+ else if (name == "PersonID") { return PersonID; }
+ else if (name == "ReceiptNo") { return ReceiptNo; }
+ else if (name == "IssueStatus") { return IssueStatus; }
+ else if (name == "IssueDate") { return IssueDate; }
+ else if (name == "IssueCount") { return IssueCount; }
+ else if (name == "IssuePageCount") { return IssuePageCount; }
+ else if (name == "Name") { return Name; }
+ else if (name == "LanguageType") { return LanguageType; }
+ else if (name == "DivID") { return DivID; }
+ else if (name == "UseDate") { return UseDate; }
+ else if (name == "CorpID") { return CorpID; }
+ else if (name == "CustomerID") { return CustomerID; }
+ else if (name == "PayKind") { return PayKind; }
+ else if (name == "Person") { return Person; }
+ else if (name == "RoomID") { return RoomID; }
+ else if (name == "VoidReason") { return VoidReason; }
+ else if (name == "TotalSummary") { return TotalSummary; }
+ else if (name == "PaySummary") { return PaySummary; }
+ else if (name == "Summary") { return Summary; }
+ else if (name == "ServiceSummary") { return ServiceSummary; }
+ else if (name == "TaxSummary") { return TaxSummary; }
+ else if (name == "BathTaxSummary") { return BathTaxSummary; }
+ else if (name == "AccTaxSummary") { return AccTaxSummary; }
+ else if (name == "DiscountSummary") { return DiscountSummary; }
+ else { return null; }
+ }
+
+ public override bool SetField(string name, object value)
+ {
+
+ if (name == "ID") { ID = CConvert.ToInt(value); return true; }
+ else if (name == "ReceiptID") { ReceiptID = CConvert.ToInt(value); return true; }
+ else if (name == "PersonID") { PersonID = CConvert.ToInt(value); return true; }
+ else if (name == "ReceiptNo") { ReceiptNo = CConvert.ToInt(value); return true; }
+ else if (name == "IssueStatus") { IssueStatus = CConvert.ToInt(value); return true; }
+ else if (name == "IssueDate") { IssueDate = CConvert.ToTimestamp(CConvert.ToDateTime(value)); return true; }
+ else if (name == "IssueCount") { IssueCount = CConvert.ToInt(value); return true; }
+ else if (name == "IssuePageCount") { IssuePageCount = CConvert.ToInt(value); return true; }
+ else if (name == "Name") { Name = value.ToString(); return true; }
+ else if (name == "LanguageType") { LanguageType = CConvert.ToInt(value); return true; }
+ else if (name == "DivID") { DivID = CConvert.ToInt(value); return true; }
+ else if (name == "UseDate") { UseDate = new Date(CConvert.ToDateInt(value)); return true; }
+ else if (name == "CorpID") { CorpID = CConvert.ToInt(value); return true; }
+ else if (name == "CustomerID") { CustomerID = CConvert.ToInt(value); return true; }
+ else if (name == "PayKind") { PayKind = CConvert.ToInt(value); return true; }
+ else if (name == "Person") { Person = CConvert.ToInt(value); return true; }
+ else if (name == "RoomID") { RoomID = CConvert.ToInt(value); return true; }
+ else if (name == "VoidReason") { VoidReason = value.ToString(); return true; }
+ else if (name == "TotalSummary") { TotalSummary = CConvert.ToDecimal(value); return true; }
+ else if (name == "PaySummary") { PaySummary = CConvert.ToDecimal(value); return true; }
+ else if (name == "Summary") { Summary = CConvert.ToDecimal(value); return true; }
+ else if (name == "ServiceSummary") { ServiceSummary = CConvert.ToDecimal(value); return true; }
+ else if (name == "TaxSummary") { TaxSummary = CConvert.ToDecimal(value); return true; }
+ else if (name == "BathTaxSummary") { BathTaxSummary = CConvert.ToDecimal(value); return true; }
+ else if (name == "AccTaxSummary") { AccTaxSummary = CConvert.ToDecimal(value); return true; }
+ else if (name == "DiscountSummary") { DiscountSummary = CConvert.ToDecimal(value); return true; }
+ else { return false; }
+ }
+
+ #endregion
+}
\ No newline at end of file
diff --git a/ProtosExpan/UseInfo/Rental.cs b/ProtosExpan/UseInfo/Rental.cs
new file mode 100644
index 0000000..c384207
--- /dev/null
+++ b/ProtosExpan/UseInfo/Rental.cs
@@ -0,0 +1,200 @@
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Text;
+using HotelPms.Share.Data;
+using HotelPms.Share.Util;
+using Google.Protobuf.WellKnownTypes;
+using customTypes;
+using System.Data.Common;
+
+namespace HotelPms.Data.UseInfo;
+
+/// ****************************** Description *******************************
+/// ◇システム名称
+/// ホテルPMS
+/// ◇概要
+///
+/// ◇履歴
+/// 2021/05/14 コード作成ツール 自動作成
+/// ****************************** Declarations ******************************
+[Serializable()]
+public partial class Rental : RecordBase
+{
+ #region ★★★★★ Property ★★★★★
+
+ public static ConcurrentDictionary<string, int> PrimaryKey { get; } = new ConcurrentDictionary<string, int>();
+
+ #endregion
+
+ partial void OnConstruction()
+ {
+ if (PrimaryKey.Count == 0)
+ {
+ PrimaryKey.TryAdd("ID", 0);
+ PrimaryKey.TryAdd("DetailID", 0);
+ PrimaryKey.TryAdd("BeginDate", 0);
+ PrimaryKey.TryAdd("FixturesID", 0);
+
+ }
+ }
+
+ #region ★★★★★ Function ★★★★★
+
+ public bool CompareTo(Rental item)
+ {
+ if (ID.CompareTo(item.ID) != 0
+ || DetailID.CompareTo(item.DetailID) != 0
+ || BeginDate.CompareTo(item.BeginDate) != 0
+ || FixturesID.CompareTo(item.FixturesID) != 0
+ || Amount.CompareTo(item.Amount) != 0
+ || ReturnPlanDate.CompareTo(item.ReturnPlanDate) != 0
+ || ReturnStatus.CompareTo(item.ReturnStatus) != 0
+ || ReturnStuffID.CompareTo(item.ReturnStuffID) != 0
+)
+ {
+ return false;
+ }
+ return true;
+ }
+
+
+ public override void CopyTo(object dest)
+ {
+ Rental item = dest as Rental;
+ item.ID = ID;
+ item.DetailID = DetailID;
+ item.BeginDate = BeginDate;
+ item.FixturesID = FixturesID;
+ item.Amount = Amount;
+ item.ReturnPlanDate = ReturnPlanDate;
+ item.ReturnStatus = ReturnStatus;
+ item.ReturnStuffID = ReturnStuffID;
+
+ }
+
+ public override void Clear()
+ {
+ ID = 0;
+ DetailID = 0;
+ BeginDate = Date.Default;
+ FixturesID = string.Empty;
+ Amount = 0;
+ ReturnPlanDate = Date.Default;
+ ReturnStatus = false;
+ ReturnStuffID = 0;
+
+ }
+
+ public Rental DeepClone()
+ {
+ Rental item = new Rental();
+ item.ID = ID;
+ item.DetailID = DetailID;
+ item.BeginDate = BeginDate;
+ item.FixturesID = FixturesID;
+ item.Amount = Amount;
+ item.ReturnPlanDate = ReturnPlanDate;
+ item.ReturnStatus = ReturnStatus;
+ item.ReturnStuffID = ReturnStuffID;
+
+ return item;
+ }
+
+ public override bool ConvertDataRow(System.Data.DataRow row)
+ {
+ ID = CConvert.ToInt(row["ID"],ID);
+ DetailID = CConvert.ToInt(row["DetailID"],DetailID);
+ BeginDate = new Date(row.IsNull("BeginDate") ? 0 : CConvert.ToDateInt((System.DateTime)row["BeginDate"]));
+ FixturesID = row["FixturesID"].ToString();
+ Amount = CConvert.ToInt(row["Amount"],Amount);
+ ReturnPlanDate = new Date(row.IsNull("ReturnPlanDate") ? 0 : CConvert.ToDateInt((System.DateTime)row["ReturnPlanDate"]));
+ ReturnStatus = CConvert.ToBool(row["ReturnStatus"]);
+ ReturnStuffID = CConvert.ToInt(row["ReturnStuffID"],ReturnStuffID);
+
+ return true;
+ }
+
+ public void ToDataRow(System.Data.DataRow row)
+ {
+ row["ID"] = ID;
+ row["DetailID"] = DetailID;
+ row["BeginDate"] = BeginDate.ToDateTime();
+ row["FixturesID"] = FixturesID;
+ row["Amount"] = Amount;
+ row["ReturnPlanDate"] = ReturnPlanDate.ToDateTime();
+ row["ReturnStatus"] = ReturnStatus;
+ row["ReturnStuffID"] = ReturnStuffID;
+
+ }
+
+ public void ConvertReader(DbDataReader row)
+ {
+ int i = 0;
+ ID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ DetailID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ BeginDate = new Date(row.IsDBNull(i) ? 0 : CConvert.ToDateInt(row.GetDateTime(i))); i++;
+ FixturesID = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ Amount = (int)(row.IsDBNull(i) ? 0 : row.GetInt16(i)); i++;
+ ReturnPlanDate = new Date(row.IsDBNull(i) ? 0 : CConvert.ToDateInt(row.GetDateTime(i))); i++;
+ ReturnStatus = (bool)(row.IsDBNull(i) ? false : row.GetBoolean(i)); i++;
+ ReturnStuffID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+
+ }
+
+ public string AddSql()
+ {
+ return $@"INSERT INTO D_Rental(ID,DetailID,BeginDate,FixturesID,Amount,ReturnPlanDate,ReturnStatus,ReturnStuffID) VALUES({ID},{DetailID},{(BeginDate == null ? "NULL" : BeginDate.ToSqlValue())},N'{FixturesID}',{Amount},{(ReturnPlanDate == null ? "NULL" : ReturnPlanDate.ToSqlValue())},{(ReturnStatus ? 1 : 0)},{ReturnStuffID});";
+ }
+
+ public string UpdateSql()
+ {
+ return $@"UPDATE D_Rental SET Amount = {Amount},ReturnPlanDate = {(ReturnPlanDate == null ? "NULL" : ReturnPlanDate.ToSqlValue())},ReturnStatus = {(ReturnStatus ? 1 : 0)},ReturnStuffID = {ReturnStuffID} WHERE ID = {ID} AND DetailID = {DetailID} AND BeginDate = {(BeginDate == null ? "NULL" : BeginDate.ToSqlValue())} AND FixturesID = N'{FixturesID}';";
+ }
+
+ public string ToText()
+ {
+ StringBuilder text = new StringBuilder();
+ text.AppendFormat("ID={0};", ID);
+ text.AppendFormat("DetailID={0};", DetailID);
+ text.AppendFormat("BeginDate={0};", BeginDate);
+ text.AppendFormat("FixturesID={0};", FixturesID);
+ text.AppendFormat("Amount={0};", Amount);
+ text.AppendFormat("ReturnPlanDate={0};", ReturnPlanDate);
+ text.AppendFormat("ReturnStatus={0};", ReturnStatus);
+ text.AppendFormat("ReturnStuffID={0};", ReturnStuffID);
+
+ return text.ToString();
+ }
+
+ public override object GetField(string name)
+ {
+
+ if (name == "ID") { return ID; }
+ else if (name == "DetailID") { return DetailID; }
+ else if (name == "BeginDate") { return BeginDate; }
+ else if (name == "FixturesID") { return FixturesID; }
+ else if (name == "Amount") { return Amount; }
+ else if (name == "ReturnPlanDate") { return ReturnPlanDate; }
+ else if (name == "ReturnStatus") { return ReturnStatus; }
+ else if (name == "ReturnStuffID") { return ReturnStuffID; }
+ else { return null; }
+ }
+
+ public override bool SetField(string name, object value)
+ {
+
+ if (name == "ID") { ID = CConvert.ToInt(value); return true; }
+ else if (name == "DetailID") { DetailID = CConvert.ToInt(value); return true; }
+ else if (name == "BeginDate") { BeginDate = new Date(CConvert.ToDateInt(value)); return true; }
+ else if (name == "FixturesID") { FixturesID = value.ToString(); return true; }
+ else if (name == "Amount") { Amount = CConvert.ToInt(value); return true; }
+ else if (name == "ReturnPlanDate") { ReturnPlanDate = new Date(CConvert.ToDateInt(value)); return true; }
+ else if (name == "ReturnStatus") { ReturnStatus = CConvert.ToBool(value); return true; }
+ else if (name == "ReturnStuffID") { ReturnStuffID = CConvert.ToInt(value); return true; }
+ else { return false; }
+ }
+
+ #endregion
+}
\ No newline at end of file
diff --git a/ProtosExpan/UseInfo/Sale.Client.cs b/ProtosExpan/UseInfo/Sale.Client.cs
new file mode 100644
index 0000000..9078bc3
--- /dev/null
+++ b/ProtosExpan/UseInfo/Sale.Client.cs
@@ -0,0 +1,46 @@
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Text;
+using HotelPms.Share.Data;
+using HotelPms.Share.Util;
+using Google.Protobuf.WellKnownTypes;
+using customTypes;
+using System.Data.Common;
+
+namespace HotelPms.Data.UseInfo;
+
+/// ****************************** Description *******************************
+/// ◇システム名称
+/// ホテルPMS
+/// ◇概要
+///
+/// ◇履歴
+/// 2021/05/14 コード作成ツール 自動作成
+/// ****************************** Declarations ******************************
+public partial class Sale
+{
+ #region ★★★★★ Property ★★★★★
+
+ #endregion
+
+ #region ★★★★★ Function ★★★★★
+
+ /// <summary>
+ /// ①領収書発行済
+ /// ②締めた
+ /// </summary>
+ /// <returns></returns>
+ public bool IsReadOnly()
+ {
+ return false;
+ }
+
+ public bool AddChild()
+ {
+ return true;
+ }
+
+ #endregion
+}
\ No newline at end of file
diff --git a/ProtosExpan/UseInfo/Sale.cs b/ProtosExpan/UseInfo/Sale.cs
new file mode 100644
index 0000000..107fdcc
--- /dev/null
+++ b/ProtosExpan/UseInfo/Sale.cs
@@ -0,0 +1,540 @@
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Text;
+using HotelPms.Share.Data;
+using HotelPms.Share.Util;
+using Google.Protobuf.WellKnownTypes;
+using customTypes;
+using System.Data.Common;
+
+namespace HotelPms.Data.UseInfo;
+
+/// ****************************** Description *******************************
+/// ◇システム名称
+/// ホテルPMS
+/// ◇概要
+///
+/// ◇履歴
+/// 2021/05/14 コード作成ツール 自動作成
+/// ****************************** Declarations ******************************
+[Serializable()]
+public partial class Sale : RecordBase
+{
+ #region ★★★★★ Property ★★★★★
+
+ public static ConcurrentDictionary<string, int> PrimaryKey { get; } = new ConcurrentDictionary<string, int>();
+
+ #endregion
+
+ partial void OnConstruction()
+ {
+ if (PrimaryKey.Count == 0)
+ {
+ PrimaryKey.TryAdd("ID", 0);
+ PrimaryKey.TryAdd("DetailID", 0);
+ PrimaryKey.TryAdd("UseDate", 0);
+ PrimaryKey.TryAdd("SaleID", 0);
+
+ }
+ }
+
+ #region ★★★★★ Function ★★★★★
+
+ public bool CompareTo(Sale item)
+ {
+ if (ID.CompareTo(item.ID) != 0
+ || DetailID.CompareTo(item.DetailID) != 0
+ || UseDate.CompareTo(item.UseDate) != 0
+ || SaleID.CompareTo(item.SaleID) != 0
+ || ReceiptID.CompareTo(item.ReceiptID) != 0
+ || ItemID.CompareTo(item.ItemID) != 0
+ || ItemName.CompareTo(item.ItemName) != 0
+ || Price.CompareTo(item.Price) != 0
+ || Amount.CompareTo(item.Amount) != 0
+ || Summary.CompareTo(item.Summary) != 0
+ || ServiceIOType.CompareTo(item.ServiceIOType) != 0
+ || ServiceSummary.CompareTo(item.ServiceSummary) != 0
+ || ServiceRate.CompareTo(item.ServiceRate) != 0
+ || TaxType.CompareTo(item.TaxType) != 0
+ || TaxIOType.CompareTo(item.TaxIOType) != 0
+ || TaxSummary.CompareTo(item.TaxSummary) != 0
+ || TaxRate.CompareTo(item.TaxRate) != 0
+ || BathTaxIOType.CompareTo(item.BathTaxIOType) != 0
+ || BathTaxType.CompareTo(item.BathTaxType) != 0
+ || BathTaxUnitPrice.CompareTo(item.BathTaxUnitPrice) != 0
+ || BathTaxSummary.CompareTo(item.BathTaxSummary) != 0
+ || AccTaxIOType.CompareTo(item.AccTaxIOType) != 0
+ || AccTaxSummary.CompareTo(item.AccTaxSummary) != 0
+ || TotalSummary.CompareTo(item.TotalSummary) != 0
+ || DiscountRate.CompareTo(item.DiscountRate) != 0
+ || DiscountSummary.CompareTo(item.DiscountSummary) != 0
+ || DiscountID.CompareTo(item.DiscountID) != 0
+ || Pack.CompareTo(item.Pack) != 0
+ || PackChild.CompareTo(item.PackChild) != 0
+ || PackSaleID.CompareTo(item.PackSaleID) != 0
+ || PersonType.CompareTo(item.PersonType) != 0
+ || PersonCount.CompareTo(item.PersonCount) != 0
+ || InFemale.CompareTo(item.InFemale) != 0
+ || UseType.CompareTo(item.UseType) != 0
+ || BaseAmount.CompareTo(item.BaseAmount) != 0
+ || PersonRef.CompareTo(item.PersonRef) != 0
+ || ReceiptItemName.CompareTo(item.ReceiptItemName) != 0
+ || ReceiptPrtType.CompareTo(item.ReceiptPrtType) != 0
+ || ReceiptPage.CompareTo(item.ReceiptPage) != 0
+ || SrcType.CompareTo(item.SrcType) != 0
+ || FixturesID.CompareTo(item.FixturesID) != 0
+ || ItemKind.CompareTo(item.ItemKind) != 0
+)
+ {
+ return false;
+ }
+ return true;
+ }
+
+
+ public override void CopyTo(object dest)
+ {
+ Sale item = dest as Sale;
+ item.ID = ID;
+ item.DetailID = DetailID;
+ item.UseDate = UseDate;
+ item.SaleID = SaleID;
+ item.ReceiptID = ReceiptID;
+ item.ItemID = ItemID;
+ item.ItemName = ItemName;
+ item.Price = Price;
+ item.Amount = Amount;
+ item.Summary = Summary;
+ item.ServiceIOType = ServiceIOType;
+ item.ServiceSummary = ServiceSummary;
+ item.ServiceRate = ServiceRate;
+ item.TaxType = TaxType;
+ item.TaxIOType = TaxIOType;
+ item.TaxSummary = TaxSummary;
+ item.TaxRate = TaxRate;
+ item.BathTaxIOType = BathTaxIOType;
+ item.BathTaxType = BathTaxType;
+ item.BathTaxUnitPrice = BathTaxUnitPrice;
+ item.BathTaxSummary = BathTaxSummary;
+ item.AccTaxIOType = AccTaxIOType;
+ item.AccTaxSummary = AccTaxSummary;
+ item.TotalSummary = TotalSummary;
+ item.DiscountRate = DiscountRate;
+ item.DiscountSummary = DiscountSummary;
+ item.DiscountID = DiscountID;
+ item.Pack = Pack;
+ item.PackChild = PackChild;
+ item.PackSaleID = PackSaleID;
+ item.PersonType = PersonType;
+ item.PersonCount = PersonCount;
+ item.InFemale = InFemale;
+ item.UseType = UseType;
+ item.BaseAmount = BaseAmount;
+ item.PersonRef = PersonRef;
+ item.ReceiptItemName = ReceiptItemName;
+ item.ReceiptPrtType = ReceiptPrtType;
+ item.ReceiptPage = ReceiptPage;
+ item.SrcType = SrcType;
+ item.FixturesID = FixturesID;
+ item.ItemKind = ItemKind;
+
+ }
+
+ public override void Clear()
+ {
+ ID = 0;
+ DetailID = 0;
+ UseDate = Date.Default;
+ SaleID = 0;
+ ReceiptID = 0;
+ ItemID = string.Empty;
+ ItemName = string.Empty;
+ Price = 0;
+ Amount = 0;
+ Summary = 0;
+ ServiceIOType = 0;
+ ServiceSummary = 0;
+ ServiceRate = 0;
+ TaxType = 0;
+ TaxIOType = 0;
+ TaxSummary = 0;
+ TaxRate = 0;
+ BathTaxIOType = 0;
+ BathTaxType = 0;
+ BathTaxUnitPrice = 0;
+ BathTaxSummary = 0;
+ AccTaxIOType = 0;
+ AccTaxSummary = 0;
+ TotalSummary = 0;
+ DiscountRate = 0;
+ DiscountSummary = 0;
+ DiscountID = 0;
+ Pack = false;
+ PackChild = false;
+ PackSaleID = 0;
+ PersonType = 0;
+ PersonCount = 0;
+ InFemale = 0;
+ UseType = 0;
+ BaseAmount = 0;
+ PersonRef = false;
+ ReceiptItemName = string.Empty;
+ ReceiptPrtType = 0;
+ ReceiptPage = 0;
+ SrcType = 0;
+ FixturesID = string.Empty;
+ ItemKind = 0;
+
+ }
+
+ public Sale DeepClone()
+ {
+ Sale item = new Sale();
+ item.ID = ID;
+ item.DetailID = DetailID;
+ item.UseDate = UseDate;
+ item.SaleID = SaleID;
+ item.ReceiptID = ReceiptID;
+ item.ItemID = ItemID;
+ item.ItemName = ItemName;
+ item.Price = Price;
+ item.Amount = Amount;
+ item.Summary = Summary;
+ item.ServiceIOType = ServiceIOType;
+ item.ServiceSummary = ServiceSummary;
+ item.ServiceRate = ServiceRate;
+ item.TaxType = TaxType;
+ item.TaxIOType = TaxIOType;
+ item.TaxSummary = TaxSummary;
+ item.TaxRate = TaxRate;
+ item.BathTaxIOType = BathTaxIOType;
+ item.BathTaxType = BathTaxType;
+ item.BathTaxUnitPrice = BathTaxUnitPrice;
+ item.BathTaxSummary = BathTaxSummary;
+ item.AccTaxIOType = AccTaxIOType;
+ item.AccTaxSummary = AccTaxSummary;
+ item.TotalSummary = TotalSummary;
+ item.DiscountRate = DiscountRate;
+ item.DiscountSummary = DiscountSummary;
+ item.DiscountID = DiscountID;
+ item.Pack = Pack;
+ item.PackChild = PackChild;
+ item.PackSaleID = PackSaleID;
+ item.PersonType = PersonType;
+ item.PersonCount = PersonCount;
+ item.InFemale = InFemale;
+ item.UseType = UseType;
+ item.BaseAmount = BaseAmount;
+ item.PersonRef = PersonRef;
+ item.ReceiptItemName = ReceiptItemName;
+ item.ReceiptPrtType = ReceiptPrtType;
+ item.ReceiptPage = ReceiptPage;
+ item.SrcType = SrcType;
+ item.FixturesID = FixturesID;
+ item.ItemKind = ItemKind;
+
+ return item;
+ }
+
+ public override bool ConvertDataRow(System.Data.DataRow row)
+ {
+ ID = CConvert.ToInt(row["ID"],ID);
+ DetailID = CConvert.ToInt(row["DetailID"],DetailID);
+ UseDate = new Date(row.IsNull("UseDate") ? 0 : CConvert.ToDateInt((System.DateTime)row["UseDate"]));
+ SaleID = CConvert.ToInt(row["SaleID"],SaleID);
+ ReceiptID = CConvert.ToInt(row["ReceiptID"],ReceiptID);
+ ItemID = row["ItemID"].ToString();
+ ItemName = row["ItemName"].ToString();
+ Price = CConvert.ToDecimal(row["Price"]);
+ Amount = CConvert.ToInt(row["Amount"],Amount);
+ Summary = CConvert.ToDecimal(row["Summary"]);
+ ServiceIOType = CConvert.ToInt(row["ServiceIOType"],ServiceIOType);
+ ServiceSummary = CConvert.ToDecimal(row["ServiceSummary"]);
+ ServiceRate = CConvert.ToDecimal(row["ServiceRate"]);
+ TaxType = CConvert.ToInt(row["TaxType"],TaxType);
+ TaxIOType = CConvert.ToInt(row["TaxIOType"],TaxIOType);
+ TaxSummary = CConvert.ToDecimal(row["TaxSummary"]);
+ TaxRate = CConvert.ToDecimal(row["TaxRate"]);
+ BathTaxIOType = CConvert.ToInt(row["BathTaxIOType"],BathTaxIOType);
+ BathTaxType = CConvert.ToInt(row["BathTaxType"],BathTaxType);
+ BathTaxUnitPrice = CConvert.ToDecimal(row["BathTaxUnitPrice"]);
+ BathTaxSummary = CConvert.ToDecimal(row["BathTaxSummary"]);
+ AccTaxIOType = CConvert.ToInt(row["AccTaxIOType"],AccTaxIOType);
+ AccTaxSummary = CConvert.ToDecimal(row["AccTaxSummary"]);
+ TotalSummary = CConvert.ToDecimal(row["TotalSummary"]);
+ DiscountRate = CConvert.ToDecimal(row["DiscountRate"]);
+ DiscountSummary = CConvert.ToDecimal(row["DiscountSummary"]);
+ DiscountID = CConvert.ToInt(row["DiscountID"],DiscountID);
+ Pack = CConvert.ToBool(row["Pack"]);
+ PackChild = CConvert.ToBool(row["PackChild"]);
+ PackSaleID = CConvert.ToInt(row["PackSaleID"],PackSaleID);
+ PersonType = CConvert.ToInt(row["PersonType"],PersonType);
+ PersonCount = CConvert.ToInt(row["PersonCount"],PersonCount);
+ InFemale = CConvert.ToInt(row["InFemale"],InFemale);
+ UseType = CConvert.ToInt(row["UseType"],UseType);
+ BaseAmount = CConvert.ToInt(row["BaseAmount"],BaseAmount);
+ PersonRef = CConvert.ToBool(row["PersonRef"]);
+ ReceiptItemName = row["ReceiptItemName"].ToString();
+ ReceiptPrtType = CConvert.ToInt(row["ReceiptPrtType"],ReceiptPrtType);
+ ReceiptPage = CConvert.ToInt(row["ReceiptPage"],ReceiptPage);
+ SrcType = CConvert.ToInt(row["SrcType"],SrcType);
+ FixturesID = row["FixturesID"].ToString();
+ ItemKind = CConvert.ToInt(row["ItemKind"],ItemKind);
+
+ return true;
+ }
+
+ public void ToDataRow(System.Data.DataRow row)
+ {
+ row["ID"] = ID;
+ row["DetailID"] = DetailID;
+ row["UseDate"] = UseDate.ToDateTime();
+ row["SaleID"] = SaleID;
+ row["ReceiptID"] = ReceiptID;
+ row["ItemID"] = ItemID;
+ row["ItemName"] = ItemName;
+ row["Price"] = Price.ToDecimal();
+ row["Amount"] = Amount;
+ row["Summary"] = Summary.ToDecimal();
+ row["ServiceIOType"] = ServiceIOType;
+ row["ServiceSummary"] = ServiceSummary.ToDecimal();
+ row["ServiceRate"] = ServiceRate.ToDecimal();
+ row["TaxType"] = TaxType;
+ row["TaxIOType"] = TaxIOType;
+ row["TaxSummary"] = TaxSummary.ToDecimal();
+ row["TaxRate"] = TaxRate.ToDecimal();
+ row["BathTaxIOType"] = BathTaxIOType;
+ row["BathTaxType"] = BathTaxType;
+ row["BathTaxUnitPrice"] = BathTaxUnitPrice.ToDecimal();
+ row["BathTaxSummary"] = BathTaxSummary.ToDecimal();
+ row["AccTaxIOType"] = AccTaxIOType;
+ row["AccTaxSummary"] = AccTaxSummary.ToDecimal();
+ row["TotalSummary"] = TotalSummary.ToDecimal();
+ row["DiscountRate"] = DiscountRate.ToDecimal();
+ row["DiscountSummary"] = DiscountSummary.ToDecimal();
+ row["DiscountID"] = DiscountID;
+ row["Pack"] = Pack;
+ row["PackChild"] = PackChild;
+ row["PackSaleID"] = PackSaleID;
+ row["PersonType"] = PersonType;
+ row["PersonCount"] = PersonCount;
+ row["InFemale"] = InFemale;
+ row["UseType"] = UseType;
+ row["BaseAmount"] = BaseAmount;
+ row["PersonRef"] = PersonRef;
+ row["ReceiptItemName"] = ReceiptItemName;
+ row["ReceiptPrtType"] = ReceiptPrtType;
+ row["ReceiptPage"] = ReceiptPage;
+ row["SrcType"] = SrcType;
+ row["FixturesID"] = FixturesID;
+ row["ItemKind"] = ItemKind;
+
+ }
+
+ public void ConvertReader(DbDataReader row)
+ {
+ int i = 0;
+ ID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ DetailID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ UseDate = new Date(row.IsDBNull(i) ? 0 : CConvert.ToDateInt(row.GetDateTime(i))); i++;
+ SaleID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ ReceiptID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ ItemID = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ ItemName = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ Price = (decimal)(row.IsDBNull(i) ? 0M : row.GetDecimal(i)); i++;
+ Amount = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ Summary = (decimal)(row.IsDBNull(i) ? 0M : row.GetDecimal(i)); i++;
+ ServiceIOType = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ ServiceSummary = (decimal)(row.IsDBNull(i) ? 0M : row.GetDecimal(i)); i++;
+ ServiceRate = (decimal)(row.IsDBNull(i) ? 0M : row.GetDecimal(i)); i++;
+ TaxType = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ TaxIOType = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ TaxSummary = (decimal)(row.IsDBNull(i) ? 0M : row.GetDecimal(i)); i++;
+ TaxRate = (decimal)(row.IsDBNull(i) ? 0M : row.GetDecimal(i)); i++;
+ BathTaxIOType = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ BathTaxType = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ BathTaxUnitPrice = (decimal)(row.IsDBNull(i) ? 0M : row.GetDecimal(i)); i++;
+ BathTaxSummary = (decimal)(row.IsDBNull(i) ? 0M : row.GetDecimal(i)); i++;
+ AccTaxIOType = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ AccTaxSummary = (decimal)(row.IsDBNull(i) ? 0M : row.GetDecimal(i)); i++;
+ TotalSummary = (decimal)(row.IsDBNull(i) ? 0M : row.GetDecimal(i)); i++;
+ DiscountRate = (decimal)(row.IsDBNull(i) ? 0M : row.GetDecimal(i)); i++;
+ DiscountSummary = (decimal)(row.IsDBNull(i) ? 0M : row.GetDecimal(i)); i++;
+ DiscountID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ Pack = (bool)(row.IsDBNull(i) ? false : row.GetBoolean(i)); i++;
+ PackChild = (bool)(row.IsDBNull(i) ? false : row.GetBoolean(i)); i++;
+ PackSaleID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ PersonType = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ PersonCount = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ InFemale = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ UseType = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ BaseAmount = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ PersonRef = (bool)(row.IsDBNull(i) ? false : row.GetBoolean(i)); i++;
+ ReceiptItemName = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ ReceiptPrtType = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ ReceiptPage = (int)(row.IsDBNull(i) ? 0 : row.GetInt16(i)); i++;
+ SrcType = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ FixturesID = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ ItemKind = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+
+ }
+
+ public string AddSql()
+ {
+ return $@"INSERT INTO D_Sale(ID,DetailID,UseDate,SaleID,ReceiptID,ItemID,ItemName,Price,Amount,Summary,ServiceIOType,ServiceSummary,ServiceRate,TaxType,TaxIOType,TaxSummary,TaxRate,BathTaxIOType,BathTaxType,BathTaxUnitPrice,BathTaxSummary,AccTaxIOType,AccTaxSummary,TotalSummary,DiscountRate,DiscountSummary,DiscountID,Pack,PackChild,PackSaleID,PersonType,PersonCount,InFemale,UseType,BaseAmount,PersonRef,ReceiptItemName,ReceiptPrtType,ReceiptPage,SrcType,FixturesID,ItemKind) VALUES({ID},{DetailID},{(UseDate == null ? "NULL" : UseDate.ToSqlValue())},{SaleID},{ReceiptID},N'{ItemID}',N'{ItemName}',{(Price == null ? "0" : Price.ToSqlValue())},{Amount},{(Summary == null ? "0" : Summary.ToSqlValue())},{ServiceIOType},{(ServiceSummary == null ? "0" : ServiceSummary.ToSqlValue())},{(ServiceRate == null ? "0" : ServiceRate.ToSqlValue())},{TaxType},{TaxIOType},{(TaxSummary == null ? "0" : TaxSummary.ToSqlValue())},{(TaxRate == null ? "0" : TaxRate.ToSqlValue())},{BathTaxIOType},{BathTaxType},{(BathTaxUnitPrice == null ? "0" : BathTaxUnitPrice.ToSqlValue())},{(BathTaxSummary == null ? "0" : BathTaxSummary.ToSqlValue())},{AccTaxIOType},{(AccTaxSummary == null ? "0" : AccTaxSummary.ToSqlValue())},{(TotalSummary == null ? "0" : TotalSummary.ToSqlValue())},{(DiscountRate == null ? "0" : DiscountRate.ToSqlValue())},{(DiscountSummary == null ? "0" : DiscountSummary.ToSqlValue())},{DiscountID},{(Pack ? 1 : 0)},{(PackChild ? 1 : 0)},{PackSaleID},{PersonType},{PersonCount},{InFemale},{UseType},{BaseAmount},{(PersonRef ? 1 : 0)},N'{ReceiptItemName}',{ReceiptPrtType},{ReceiptPage},{SrcType},N'{FixturesID}',{ItemKind});";
+ }
+
+ public string UpdateSql()
+ {
+ return $@"UPDATE D_Sale SET ReceiptID = {ReceiptID},ItemID = N'{ItemID}',ItemName = N'{ItemName}',Price = {(Price == null ? "0" : Price.ToSqlValue())},Amount = {Amount},Summary = {(Summary == null ? "0" : Summary.ToSqlValue())},ServiceIOType = {ServiceIOType},ServiceSummary = {(ServiceSummary == null ? "0" : ServiceSummary.ToSqlValue())},ServiceRate = {(ServiceRate == null ? "0" : ServiceRate.ToSqlValue())},TaxType = {TaxType},TaxIOType = {TaxIOType},TaxSummary = {(TaxSummary == null ? "0" : TaxSummary.ToSqlValue())},TaxRate = {(TaxRate == null ? "0" : TaxRate.ToSqlValue())},BathTaxIOType = {BathTaxIOType},BathTaxType = {BathTaxType},BathTaxUnitPrice = {(BathTaxUnitPrice == null ? "0" : BathTaxUnitPrice.ToSqlValue())},BathTaxSummary = {(BathTaxSummary == null ? "0" : BathTaxSummary.ToSqlValue())},AccTaxIOType = {AccTaxIOType},AccTaxSummary = {(AccTaxSummary == null ? "0" : AccTaxSummary.ToSqlValue())},TotalSummary = {(TotalSummary == null ? "0" : TotalSummary.ToSqlValue())},DiscountRate = {(DiscountRate == null ? "0" : DiscountRate.ToSqlValue())},DiscountSummary = {(DiscountSummary == null ? "0" : DiscountSummary.ToSqlValue())},DiscountID = {DiscountID},Pack = {(Pack ? 1 : 0)},PackChild = {(PackChild ? 1 : 0)},PackSaleID = {PackSaleID},PersonType = {PersonType},PersonCount = {PersonCount},InFemale = {InFemale},UseType = {UseType},BaseAmount = {BaseAmount},PersonRef = {(PersonRef ? 1 : 0)},ReceiptItemName = N'{ReceiptItemName}',ReceiptPrtType = {ReceiptPrtType},ReceiptPage = {ReceiptPage},SrcType = {SrcType},FixturesID = N'{FixturesID}',ItemKind = {ItemKind} WHERE ID = {ID} AND DetailID = {DetailID} AND UseDate = {(UseDate == null ? "NULL" : UseDate.ToSqlValue())} AND SaleID = {SaleID};";
+ }
+
+ public string ToText()
+ {
+ StringBuilder text = new StringBuilder();
+ text.AppendFormat("ID={0};", ID);
+ text.AppendFormat("DetailID={0};", DetailID);
+ text.AppendFormat("UseDate={0};", UseDate);
+ text.AppendFormat("SaleID={0};", SaleID);
+ text.AppendFormat("ReceiptID={0};", ReceiptID);
+ text.AppendFormat("ItemID={0};", ItemID);
+ text.AppendFormat("ItemName={0};", ItemName);
+ text.AppendFormat("Price={0};", Price);
+ text.AppendFormat("Amount={0};", Amount);
+ text.AppendFormat("Summary={0};", Summary);
+ text.AppendFormat("ServiceIOType={0};", ServiceIOType);
+ text.AppendFormat("ServiceSummary={0};", ServiceSummary);
+ text.AppendFormat("ServiceRate={0};", ServiceRate);
+ text.AppendFormat("TaxType={0};", TaxType);
+ text.AppendFormat("TaxIOType={0};", TaxIOType);
+ text.AppendFormat("TaxSummary={0};", TaxSummary);
+ text.AppendFormat("TaxRate={0};", TaxRate);
+ text.AppendFormat("BathTaxIOType={0};", BathTaxIOType);
+ text.AppendFormat("BathTaxType={0};", BathTaxType);
+ text.AppendFormat("BathTaxUnitPrice={0};", BathTaxUnitPrice);
+ text.AppendFormat("BathTaxSummary={0};", BathTaxSummary);
+ text.AppendFormat("AccTaxIOType={0};", AccTaxIOType);
+ text.AppendFormat("AccTaxSummary={0};", AccTaxSummary);
+ text.AppendFormat("TotalSummary={0};", TotalSummary);
+ text.AppendFormat("DiscountRate={0};", DiscountRate);
+ text.AppendFormat("DiscountSummary={0};", DiscountSummary);
+ text.AppendFormat("DiscountID={0};", DiscountID);
+ text.AppendFormat("Pack={0};", Pack);
+ text.AppendFormat("PackChild={0};", PackChild);
+ text.AppendFormat("PackSaleID={0};", PackSaleID);
+ text.AppendFormat("PersonType={0};", PersonType);
+ text.AppendFormat("PersonCount={0};", PersonCount);
+ text.AppendFormat("InFemale={0};", InFemale);
+ text.AppendFormat("UseType={0};", UseType);
+ text.AppendFormat("BaseAmount={0};", BaseAmount);
+ text.AppendFormat("PersonRef={0};", PersonRef);
+ text.AppendFormat("ReceiptItemName={0};", ReceiptItemName);
+ text.AppendFormat("ReceiptPrtType={0};", ReceiptPrtType);
+ text.AppendFormat("ReceiptPage={0};", ReceiptPage);
+ text.AppendFormat("SrcType={0};", SrcType);
+ text.AppendFormat("FixturesID={0};", FixturesID);
+ text.AppendFormat("ItemKind={0};", ItemKind);
+
+ return text.ToString();
+ }
+
+ public override object GetField(string name)
+ {
+
+ if (name == "ID") { return ID; }
+ else if (name == "DetailID") { return DetailID; }
+ else if (name == "UseDate") { return UseDate; }
+ else if (name == "SaleID") { return SaleID; }
+ else if (name == "ReceiptID") { return ReceiptID; }
+ else if (name == "ItemID") { return ItemID; }
+ else if (name == "ItemName") { return ItemName; }
+ else if (name == "Price") { return Price; }
+ else if (name == "Amount") { return Amount; }
+ else if (name == "Summary") { return Summary; }
+ else if (name == "ServiceIOType") { return ServiceIOType; }
+ else if (name == "ServiceSummary") { return ServiceSummary; }
+ else if (name == "ServiceRate") { return ServiceRate; }
+ else if (name == "TaxType") { return TaxType; }
+ else if (name == "TaxIOType") { return TaxIOType; }
+ else if (name == "TaxSummary") { return TaxSummary; }
+ else if (name == "TaxRate") { return TaxRate; }
+ else if (name == "BathTaxIOType") { return BathTaxIOType; }
+ else if (name == "BathTaxType") { return BathTaxType; }
+ else if (name == "BathTaxUnitPrice") { return BathTaxUnitPrice; }
+ else if (name == "BathTaxSummary") { return BathTaxSummary; }
+ else if (name == "AccTaxIOType") { return AccTaxIOType; }
+ else if (name == "AccTaxSummary") { return AccTaxSummary; }
+ else if (name == "TotalSummary") { return TotalSummary; }
+ else if (name == "DiscountRate") { return DiscountRate; }
+ else if (name == "DiscountSummary") { return DiscountSummary; }
+ else if (name == "DiscountID") { return DiscountID; }
+ else if (name == "Pack") { return Pack; }
+ else if (name == "PackChild") { return PackChild; }
+ else if (name == "PackSaleID") { return PackSaleID; }
+ else if (name == "PersonType") { return PersonType; }
+ else if (name == "PersonCount") { return PersonCount; }
+ else if (name == "InFemale") { return InFemale; }
+ else if (name == "UseType") { return UseType; }
+ else if (name == "BaseAmount") { return BaseAmount; }
+ else if (name == "PersonRef") { return PersonRef; }
+ else if (name == "ReceiptItemName") { return ReceiptItemName; }
+ else if (name == "ReceiptPrtType") { return ReceiptPrtType; }
+ else if (name == "ReceiptPage") { return ReceiptPage; }
+ else if (name == "SrcType") { return SrcType; }
+ else if (name == "FixturesID") { return FixturesID; }
+ else if (name == "ItemKind") { return ItemKind; }
+ else { return null; }
+ }
+
+ public override bool SetField(string name, object value)
+ {
+
+ if (name == "ID") { ID = CConvert.ToInt(value); return true; }
+ else if (name == "DetailID") { DetailID = CConvert.ToInt(value); return true; }
+ else if (name == "UseDate") { UseDate = new Date(CConvert.ToDateInt(value)); return true; }
+ else if (name == "SaleID") { SaleID = CConvert.ToInt(value); return true; }
+ else if (name == "ReceiptID") { ReceiptID = CConvert.ToInt(value); return true; }
+ else if (name == "ItemID") { ItemID = value.ToString(); return true; }
+ else if (name == "ItemName") { ItemName = value.ToString(); return true; }
+ else if (name == "Price") { Price = CConvert.ToDecimal(value); return true; }
+ else if (name == "Amount") { Amount = CConvert.ToInt(value); return true; }
+ else if (name == "Summary") { Summary = CConvert.ToDecimal(value); return true; }
+ else if (name == "ServiceIOType") { ServiceIOType = CConvert.ToInt(value); return true; }
+ else if (name == "ServiceSummary") { ServiceSummary = CConvert.ToDecimal(value); return true; }
+ else if (name == "ServiceRate") { ServiceRate = CConvert.ToDecimal(value); return true; }
+ else if (name == "TaxType") { TaxType = CConvert.ToInt(value); return true; }
+ else if (name == "TaxIOType") { TaxIOType = CConvert.ToInt(value); return true; }
+ else if (name == "TaxSummary") { TaxSummary = CConvert.ToDecimal(value); return true; }
+ else if (name == "TaxRate") { TaxRate = CConvert.ToDecimal(value); return true; }
+ else if (name == "BathTaxIOType") { BathTaxIOType = CConvert.ToInt(value); return true; }
+ else if (name == "BathTaxType") { BathTaxType = CConvert.ToInt(value); return true; }
+ else if (name == "BathTaxUnitPrice") { BathTaxUnitPrice = CConvert.ToDecimal(value); return true; }
+ else if (name == "BathTaxSummary") { BathTaxSummary = CConvert.ToDecimal(value); return true; }
+ else if (name == "AccTaxIOType") { AccTaxIOType = CConvert.ToInt(value); return true; }
+ else if (name == "AccTaxSummary") { AccTaxSummary = CConvert.ToDecimal(value); return true; }
+ else if (name == "TotalSummary") { TotalSummary = CConvert.ToDecimal(value); return true; }
+ else if (name == "DiscountRate") { DiscountRate = CConvert.ToDecimal(value); return true; }
+ else if (name == "DiscountSummary") { DiscountSummary = CConvert.ToDecimal(value); return true; }
+ else if (name == "DiscountID") { DiscountID = CConvert.ToInt(value); return true; }
+ else if (name == "Pack") { Pack = CConvert.ToBool(value); return true; }
+ else if (name == "PackChild") { PackChild = CConvert.ToBool(value); return true; }
+ else if (name == "PackSaleID") { PackSaleID = CConvert.ToInt(value); return true; }
+ else if (name == "PersonType") { PersonType = CConvert.ToInt(value); return true; }
+ else if (name == "PersonCount") { PersonCount = CConvert.ToInt(value); return true; }
+ else if (name == "InFemale") { InFemale = CConvert.ToInt(value); return true; }
+ else if (name == "UseType") { UseType = CConvert.ToInt(value); return true; }
+ else if (name == "BaseAmount") { BaseAmount = CConvert.ToInt(value); return true; }
+ else if (name == "PersonRef") { PersonRef = CConvert.ToBool(value); return true; }
+ else if (name == "ReceiptItemName") { ReceiptItemName = value.ToString(); return true; }
+ else if (name == "ReceiptPrtType") { ReceiptPrtType = CConvert.ToInt(value); return true; }
+ else if (name == "ReceiptPage") { ReceiptPage = CConvert.ToInt(value); return true; }
+ else if (name == "SrcType") { SrcType = CConvert.ToInt(value); return true; }
+ else if (name == "FixturesID") { FixturesID = value.ToString(); return true; }
+ else if (name == "ItemKind") { ItemKind = CConvert.ToInt(value); return true; }
+ else { return false; }
+ }
+
+ #endregion
+}
\ No newline at end of file
diff --git a/ProtosExpan/UseInfo/SaleDiv.cs b/ProtosExpan/UseInfo/SaleDiv.cs
new file mode 100644
index 0000000..6fb666b
--- /dev/null
+++ b/ProtosExpan/UseInfo/SaleDiv.cs
@@ -0,0 +1,294 @@
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Text;
+using HotelPms.Share.Data;
+using HotelPms.Share.Util;
+using Google.Protobuf.WellKnownTypes;
+
+namespace HotelPms.Data.UseInfo
+{
+ /// ****************************** Description *******************************
+ /// ◇システム名称
+ /// ホテルPMS
+ /// ◇概要
+ ///
+ /// ◇履歴
+ /// 2021/05/14 コード作成ツール 自動作成
+ /// ****************************** Declarations ******************************
+ [Serializable()]
+ public partial class SaleDiv : RecordBase
+ {
+ #region ★★★★★ Property ★★★★★
+
+ public static ConcurrentDictionary<string, int> PrimaryKey { get; } = new ConcurrentDictionary<string, int>();
+
+ #endregion
+
+ partial void OnConstruction()
+ {
+ if (PrimaryKey.Count == 0)
+ {
+ PrimaryKey.TryAdd("ID", 0);
+ PrimaryKey.TryAdd("DetailID", 0);
+ PrimaryKey.TryAdd("UseDate", 0);
+ PrimaryKey.TryAdd("SaleID", 0);
+ PrimaryKey.TryAdd("RowNo", 0);
+
+ }
+ }
+
+ #region ★★★★★ Function ★★★★★
+
+ private Timestamp ToTimestamp(DateTime dateTime)
+ {
+ return Timestamp.FromDateTime(DateTime.SpecifyKind(dateTime, DateTimeKind.Utc));
+ }
+
+ public bool CompareTo(SaleDiv item)
+ {
+ if (ID.CompareTo(item.ID) != 0
+ || DetailID.CompareTo(item.DetailID) != 0
+ || UseDate.CompareTo(item.UseDate) != 0
+ || SaleID.CompareTo(item.SaleID) != 0
+ || RowNo.CompareTo(item.RowNo) != 0
+ || ReceiptID.CompareTo(item.ReceiptID) != 0
+ || Price.CompareTo(item.Price) != 0
+ || Amount.CompareTo(item.Amount) != 0
+ || Summary.CompareTo(item.Summary) != 0
+ || ServiceSummary.CompareTo(item.ServiceSummary) != 0
+ || TaxSummary.CompareTo(item.TaxSummary) != 0
+ || BathTaxSummary.CompareTo(item.BathTaxSummary) != 0
+ || AccTaxSummary.CompareTo(item.AccTaxSummary) != 0
+ || TotalSummary.CompareTo(item.TotalSummary) != 0
+ || DiscountSummary.CompareTo(item.DiscountSummary) != 0
+ || ReceiptPrtType.CompareTo(item.ReceiptPrtType) != 0
+ || ReceiptPage.CompareTo(item.ReceiptPage) != 0
+)
+ {
+ return false;
+ }
+ return true;
+ }
+
+
+ public override void CopyTo(object dest)
+ {
+ SaleDiv item = dest as SaleDiv;
+ item.ID = ID;
+ item.DetailID = DetailID;
+ item.UseDate = UseDate;
+ item.SaleID = SaleID;
+ item.RowNo = RowNo;
+ item.ReceiptID = ReceiptID;
+ item.Price = Price;
+ item.Amount = Amount;
+ item.Summary = Summary;
+ item.ServiceSummary = ServiceSummary;
+ item.TaxSummary = TaxSummary;
+ item.BathTaxSummary = BathTaxSummary;
+ item.AccTaxSummary = AccTaxSummary;
+ item.TotalSummary = TotalSummary;
+ item.DiscountSummary = DiscountSummary;
+ item.ReceiptPrtType = ReceiptPrtType;
+ item.ReceiptPage = ReceiptPage;
+
+ }
+
+ public override void Clear()
+ {
+ ID = 0;
+ DetailID = 0;
+ UseDate = ToTimestamp(DateTime.MinValue);
+ SaleID = 0;
+ RowNo = 0;
+ ReceiptID = 0;
+ Price = 0;
+ Amount = 0;
+ Summary = 0;
+ ServiceSummary = 0;
+ TaxSummary = 0;
+ BathTaxSummary = 0;
+ AccTaxSummary = 0;
+ TotalSummary = 0;
+ DiscountSummary = 0;
+ ReceiptPrtType = 0;
+ ReceiptPage = 0;
+
+ }
+
+ public SaleDiv DeepClone()
+ {
+ SaleDiv item = new SaleDiv();
+ item.ID = ID;
+ item.DetailID = DetailID;
+ item.UseDate = UseDate;
+ item.SaleID = SaleID;
+ item.RowNo = RowNo;
+ item.ReceiptID = ReceiptID;
+ item.Price = Price;
+ item.Amount = Amount;
+ item.Summary = Summary;
+ item.ServiceSummary = ServiceSummary;
+ item.TaxSummary = TaxSummary;
+ item.BathTaxSummary = BathTaxSummary;
+ item.AccTaxSummary = AccTaxSummary;
+ item.TotalSummary = TotalSummary;
+ item.DiscountSummary = DiscountSummary;
+ item.ReceiptPrtType = ReceiptPrtType;
+ item.ReceiptPage = ReceiptPage;
+
+ return item;
+ }
+
+ public override bool ConvertDataRow(System.Data.DataRow row)
+ {
+ ID = CConvert.ToInt(row["ID"],ID);
+ DetailID = CConvert.ToInt(row["DetailID"],DetailID);
+ UseDate = ToTimestamp(row.IsNull("UseDate") ? DateTime.MinValue : (System.DateTime)row["UseDate"]);
+ SaleID = CConvert.ToInt(row["SaleID"],SaleID);
+ RowNo = CConvert.ToInt(row["RowNo"],RowNo);
+ ReceiptID = CConvert.ToInt(row["ReceiptID"],ReceiptID);
+ Price = CConvert.ToDecimal(row["Price"]);
+ Amount = CConvert.ToInt(row["Amount"],Amount);
+ Summary = CConvert.ToDecimal(row["Summary"]);
+ ServiceSummary = CConvert.ToDecimal(row["ServiceSummary"]);
+ TaxSummary = CConvert.ToDecimal(row["TaxSummary"]);
+ BathTaxSummary = CConvert.ToDecimal(row["BathTaxSummary"]);
+ AccTaxSummary = CConvert.ToDecimal(row["AccTaxSummary"]);
+ TotalSummary = CConvert.ToDecimal(row["TotalSummary"]);
+ DiscountSummary = CConvert.ToDecimal(row["DiscountSummary"]);
+ ReceiptPrtType = CConvert.ToInt(row["ReceiptPrtType"],ReceiptPrtType);
+ ReceiptPage = CConvert.ToInt(row["ReceiptPage"],ReceiptPage);
+
+ return true;
+ }
+
+ public void ToDataRow(System.Data.DataRow row)
+ {
+ row["ID"] = ID;
+ row["DetailID"] = DetailID;
+ row["UseDate"] = UseDate;
+ row["SaleID"] = SaleID;
+ row["RowNo"] = RowNo;
+ row["ReceiptID"] = ReceiptID;
+ row["Price"] = Price;
+ row["Amount"] = Amount;
+ row["Summary"] = Summary;
+ row["ServiceSummary"] = ServiceSummary;
+ row["TaxSummary"] = TaxSummary;
+ row["BathTaxSummary"] = BathTaxSummary;
+ row["AccTaxSummary"] = AccTaxSummary;
+ row["TotalSummary"] = TotalSummary;
+ row["DiscountSummary"] = DiscountSummary;
+ row["ReceiptPrtType"] = ReceiptPrtType;
+ row["ReceiptPage"] = ReceiptPage;
+
+ }
+
+ public void ConvertReader(SqlDataReader row)
+ {
+ ID = CConvert.ToInt(row["ID"],ID);
+ DetailID = CConvert.ToInt(row["DetailID"],DetailID);
+ UseDate = ToTimestamp(row.IsNull("UseDate") ? DateTime.MinValue : (System.DateTime)row["UseDate"]);
+ SaleID = CConvert.ToInt(row["SaleID"],SaleID);
+ RowNo = CConvert.ToInt(row["RowNo"],RowNo);
+ ReceiptID = CConvert.ToInt(row["ReceiptID"],ReceiptID);
+ Price = CConvert.ToDecimal(row["Price"]);
+ Amount = CConvert.ToInt(row["Amount"],Amount);
+ Summary = CConvert.ToDecimal(row["Summary"]);
+ ServiceSummary = CConvert.ToDecimal(row["ServiceSummary"]);
+ TaxSummary = CConvert.ToDecimal(row["TaxSummary"]);
+ BathTaxSummary = CConvert.ToDecimal(row["BathTaxSummary"]);
+ AccTaxSummary = CConvert.ToDecimal(row["AccTaxSummary"]);
+ TotalSummary = CConvert.ToDecimal(row["TotalSummary"]);
+ DiscountSummary = CConvert.ToDecimal(row["DiscountSummary"]);
+ ReceiptPrtType = CConvert.ToInt(row["ReceiptPrtType"],ReceiptPrtType);
+ ReceiptPage = CConvert.ToInt(row["ReceiptPage"],ReceiptPage);
+
+ }
+
+ public string AddSql()
+ {
+ return $@"INSERT INTO D_SaleDiv(ID,DetailID,UseDate,SaleID,RowNo,ReceiptID,Price,Amount,Summary,ServiceSummary,TaxSummary,BathTaxSummary,AccTaxSummary,TotalSummary,DiscountSummary,ReceiptPrtType,ReceiptPage) VALUES({ID},{DetailID},{CConvert.ToSqlValue(UseDate)},{SaleID},{RowNo},{ReceiptID},{Price},{Amount},{Summary},{ServiceSummary},{TaxSummary},{BathTaxSummary},{AccTaxSummary},{TotalSummary},{DiscountSummary},{ReceiptPrtType},{ReceiptPage});";
+ }
+
+ public string UpdateSql()
+ {
+ return $@"UPDATE D_SaleDiv SET ReceiptID = {ReceiptID},Price = {Price},Amount = {Amount},Summary = {Summary},ServiceSummary = {ServiceSummary},TaxSummary = {TaxSummary},BathTaxSummary = {BathTaxSummary},AccTaxSummary = {AccTaxSummary},TotalSummary = {TotalSummary},DiscountSummary = {DiscountSummary},ReceiptPrtType = {ReceiptPrtType},ReceiptPage = {ReceiptPage} WHERE ID = {ID} AND DetailID = {DetailID} AND UseDate = {CConvert.ToSqlValue(UseDate)} AND SaleID = {SaleID} AND RowNo = {RowNo};";
+ }
+
+ public string ToText()
+ {
+ StringBuilder text = new StringBuilder();
+ text.AppendFormat("ID={0};", ID);
+ text.AppendFormat("DetailID={0};", DetailID);
+ text.AppendFormat("UseDate={0};", UseDate);
+ text.AppendFormat("SaleID={0};", SaleID);
+ text.AppendFormat("RowNo={0};", RowNo);
+ text.AppendFormat("ReceiptID={0};", ReceiptID);
+ text.AppendFormat("Price={0};", Price);
+ text.AppendFormat("Amount={0};", Amount);
+ text.AppendFormat("Summary={0};", Summary);
+ text.AppendFormat("ServiceSummary={0};", ServiceSummary);
+ text.AppendFormat("TaxSummary={0};", TaxSummary);
+ text.AppendFormat("BathTaxSummary={0};", BathTaxSummary);
+ text.AppendFormat("AccTaxSummary={0};", AccTaxSummary);
+ text.AppendFormat("TotalSummary={0};", TotalSummary);
+ text.AppendFormat("DiscountSummary={0};", DiscountSummary);
+ text.AppendFormat("ReceiptPrtType={0};", ReceiptPrtType);
+ text.AppendFormat("ReceiptPage={0};", ReceiptPage);
+
+ return text.ToString();
+ }
+
+ public override object GetField(string name)
+ {
+
+ if (name == "ID") { return ID; }
+ else if (name == "DetailID") { return DetailID; }
+ else if (name == "UseDate") { return UseDate; }
+ else if (name == "SaleID") { return SaleID; }
+ else if (name == "RowNo") { return RowNo; }
+ else if (name == "ReceiptID") { return ReceiptID; }
+ else if (name == "Price") { return Price; }
+ else if (name == "Amount") { return Amount; }
+ else if (name == "Summary") { return Summary; }
+ else if (name == "ServiceSummary") { return ServiceSummary; }
+ else if (name == "TaxSummary") { return TaxSummary; }
+ else if (name == "BathTaxSummary") { return BathTaxSummary; }
+ else if (name == "AccTaxSummary") { return AccTaxSummary; }
+ else if (name == "TotalSummary") { return TotalSummary; }
+ else if (name == "DiscountSummary") { return DiscountSummary; }
+ else if (name == "ReceiptPrtType") { return ReceiptPrtType; }
+ else if (name == "ReceiptPage") { return ReceiptPage; }
+ else { return null; }
+ }
+
+ public override bool SetField(string name, object value)
+ {
+
+ if (name == "ID") { ID = CConvert.ToInt(value); return true; }
+ else if (name == "DetailID") { DetailID = CConvert.ToInt(value); return true; }
+ else if (name == "UseDate") { UseDate = ToTimestamp(CConvert.ToDateTime(value)); return true; }
+ else if (name == "SaleID") { SaleID = CConvert.ToInt(value); return true; }
+ else if (name == "RowNo") { RowNo = CConvert.ToInt(value); return true; }
+ else if (name == "ReceiptID") { ReceiptID = CConvert.ToInt(value); return true; }
+ else if (name == "Price") { Price = CConvert.ToDecimal(value); return true; }
+ else if (name == "Amount") { Amount = CConvert.ToInt(value); return true; }
+ else if (name == "Summary") { Summary = CConvert.ToDecimal(value); return true; }
+ else if (name == "ServiceSummary") { ServiceSummary = CConvert.ToDecimal(value); return true; }
+ else if (name == "TaxSummary") { TaxSummary = CConvert.ToDecimal(value); return true; }
+ else if (name == "BathTaxSummary") { BathTaxSummary = CConvert.ToDecimal(value); return true; }
+ else if (name == "AccTaxSummary") { AccTaxSummary = CConvert.ToDecimal(value); return true; }
+ else if (name == "TotalSummary") { TotalSummary = CConvert.ToDecimal(value); return true; }
+ else if (name == "DiscountSummary") { DiscountSummary = CConvert.ToDecimal(value); return true; }
+ else if (name == "ReceiptPrtType") { ReceiptPrtType = CConvert.ToInt(value); return true; }
+ else if (name == "ReceiptPage") { ReceiptPage = CConvert.ToInt(value); return true; }
+ else { return false; }
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/ProtosExpan/UseInfo/Use.Client.cs b/ProtosExpan/UseInfo/Use.Client.cs
new file mode 100644
index 0000000..34959b7
--- /dev/null
+++ b/ProtosExpan/UseInfo/Use.Client.cs
@@ -0,0 +1,60 @@
+using System.Collections.Generic;
+
+namespace HotelPms.Data.UseInfo;
+
+/// <summary>
+/// 画面中制御時データの加工
+/// </summary>
+public partial class Use
+{
+ public int GetTotalStay()
+ {
+ var cinDate = DetailList[0].CinDate;
+ var coutDate = DetailList[0].CoutDate;
+ for (int i = 1; i < DetailList.Count; i++)
+ {
+ if (DetailList[i].CinDate.CompareTo(cinDate) < 0) { cinDate = DetailList[i].CinDate; }
+ if (DetailList[i].CoutDate.CompareTo(coutDate) > 0) { coutDate = DetailList[i].CoutDate; }
+ }
+ return coutDate.Subtract(cinDate);
+ }
+
+ /// <summary>
+ /// 利用日を指定し、データを返す
+ /// </summary>
+ /// <param name="useDate"></param>
+ /// <returns></returns>
+ public List<UseRoom> GetUseRoomList(string useDate)
+ {
+ List<UseRoom> list = new();
+ foreach (UseDetail detail in DetailList)
+ {
+ list.AddRange(detail.GetUseRoomList(useDate));
+ }
+ return list;
+ }
+
+ /// <summary>
+ /// 利用部屋存在しない明細を取得する
+ /// </summary>
+ /// <param name="useDate"></param>
+ /// <returns></returns>
+ public UseDetail? GetDetailWithoutUseRoom(string useDate)
+ {
+ try
+ {
+ foreach(var detail in DetailList)
+ {
+ if (!detail.ExistsUseRoom(useDate))
+ {
+ return detail;
+ }
+ }
+ return null;
+ }
+ catch
+ {
+ return null;
+ }
+ }
+}
diff --git a/ProtosExpan/UseInfo/Use.Server.cs b/ProtosExpan/UseInfo/Use.Server.cs
new file mode 100644
index 0000000..f2228d9
--- /dev/null
+++ b/ProtosExpan/UseInfo/Use.Server.cs
@@ -0,0 +1,353 @@
+using HotelPms.Data.Common.Util;
+using HotelPms.Share.Data;
+using HotelPms.Share.IO;
+using System.Data.Common;
+using System.Reflection;
+using System.Text;
+
+namespace HotelPms.Data.UseInfo
+{
+ /// <summary>
+ /// サーバー側の処理
+ /// ①データR/W
+ /// ②クラウド中の計算
+ /// </summary>
+ public partial class Use
+ {
+ private Dictionary<int, UsePerson> personDict = new();
+ private Dictionary<int, UseDetail> detailDict = new();
+ private Dictionary<string, UseRoom> useRoomDict = new(); //DetailID,UseDate
+
+ /// <summary>
+ /// 利用情報の更新SQL生成
+ /// </summary>
+ /// <returns></returns>
+ public string ToSql()
+ {
+ bool isNew = UpdateID == 0;
+ UseSql useSql = new UseSql(isNew, ID);
+
+ foreach (UsePerson person in PersonlList)
+ {
+ foreach(UsePersonFree personFree in person.FreeList) { useSql.UsePersonFree.AppendLine(personFree.AddSql()); }
+ foreach (UsePersonTel personTel in person.TelList) { useSql.UsePersonTel.AppendLine(personTel.AddSql()); }
+ useSql.UsePerson.AppendLine(person.AddSql());
+ }
+
+ foreach (UseMemo useMemo in MemoList) { useSql.UseMemo.AppendLine(useMemo.AddSql()); }
+ foreach (UseFree useFree in FreeList) { useSql.UseFree.AppendLine(useFree.AddSql()); }
+
+ // 利用明細
+ foreach (UseDetail useDetail in DetailList)
+ {
+ foreach (UseMemo useMemo in useDetail.MemoList) { useSql.UseMemo.AppendLine(useMemo.AddSql()); }
+ foreach (UseFree useFree in useDetail.FreeList) { useSql.UseFree.AppendLine(useFree.AddSql()); }
+ foreach (Rental rental in useDetail.RentalList) { useSql.Rental.AppendLine(rental.AddSql()); }
+ foreach (UseRoom useRoom in useDetail.UseRoomList)
+ {
+ foreach (UseFree useFree in useRoom.FreeList) { useSql.UseFree.AppendLine(useFree.AddSql()); }
+ foreach (UseAllo useAllo in useRoom.UseAlloList) { useSql.UseAllo.AppendLine(useAllo.AddSql()); }
+ foreach (Arrange arrange in useRoom.ArrangeList) { useSql.Arrange.AppendLine(arrange.AddSql()); }
+ foreach (Sale sale in useRoom.SaleList) { useSql.Sale.AppendLine(sale.AddSql()); }
+ foreach (Pay pay in useRoom.PayList) { useSql.Pay.AppendLine(pay.AddSql()); }
+ useSql.UseRoom.AppendLine(useRoom.AddSql());
+ }
+ useSql.UseDetail.AppendLine(useDetail.AddSql());
+ }
+
+ //更新直前にカウントする
+ UpdateID++;
+ useSql.Use.AppendLine(isNew ? AddSql() : UpdateSql());
+
+
+ StringBuilder sql = new StringBuilder();
+ sql.Append(useSql.ToString());
+ sql.AppendLine($"EXECUTE SaveUseAfter {ID}");
+ return sql.ToString();
+ }
+
+ /// <summary>
+ /// 利用者情報
+ /// </summary>
+ /// <param name="reader"></param>
+ /// <param name="use"></param>
+ public void SetUsePerson(DbDataReader reader)
+ {
+ while (reader.Read())
+ {
+ UsePerson item = new();
+ item.ConvertReader(reader);
+ PersonlList.Add(item);
+ personDict.Add(item.PersonID, item);
+ }
+ reader.NextResult();
+ }
+
+ /// <summary>
+ /// 個人自由集計
+ /// </summary>
+ /// <param name="reader"></param>
+ public void SetUsePersonFree(DbDataReader reader)
+ {
+ while (reader.Read())
+ {
+ UsePersonFree item = new();
+ item.ConvertReader(reader);
+ UsePerson person = personDict[item.PersonID];
+ person.FreeList.Add(item);
+ }
+ reader.NextResult();
+ }
+
+ /// <summary>
+ /// 個人電話
+ /// </summary>
+ /// <param name="reader"></param>
+ public void SetUsePersonTel(DbDataReader reader)
+ {
+ while (reader.Read())
+ {
+ UsePersonTel item = new();
+ item.ConvertReader(reader);
+ UsePerson person = personDict[item.PersonID];
+ person.TelList.Add(item);
+ }
+ reader.NextResult();
+ }
+
+ /// <summary>
+ /// 利用明細
+ /// </summary>
+ /// <param name="reader"></param>
+ /// <param name="use"></param>
+ public void SetUseDetail(DbDataReader reader)
+ {
+ while (reader.Read())
+ {
+ UseDetail item = new();
+ item.ConvertReader(reader);
+ DetailList.Add(item);
+ detailDict.Add(item.DetailID, item);
+ }
+ reader.NextResult();
+ }
+
+ /// <summary>
+ /// 利用部屋
+ /// </summary>
+ /// <param name="reader"></param>
+ public void SetUseRoom(DbDataReader reader)
+ {
+ while (reader.Read())
+ {
+ UseRoom item = new();
+ item.ConvertReader(reader);
+ UseDetail detail = detailDict[item.DetailID];
+ detail.UseRoomList.Add(item);
+ item.Parent = detail;
+ useRoomDict.Add($"{item.DetailID},{item.UseDate.Value}", item);
+ }
+ reader.NextResult();
+ }
+
+ /// <summary>
+ /// 部屋割り
+ /// </summary>
+ /// <param name="reader"></param>
+ public void SetUseAllo(DbDataReader reader)
+ {
+ while (reader.Read())
+ {
+ UseAllo item = new();
+ item.ConvertReader(reader);
+ UseRoom useRoom = useRoomDict[$"{item.DetailID},{item.UseDate.Value}"];
+ useRoom.UseAlloList.Add(item);
+ item.Parent = useRoom;
+ item.Detail = detailDict[item.DetailID];
+ item.Person = personDict[item.PersonID];
+ }
+ reader.NextResult();
+ }
+
+ /// <summary>
+ /// 自由集計
+ /// </summary>
+ /// <param name="reader"></param>
+ /// <param name="use"></param>
+ public void SetUseFree(DbDataReader reader)
+ {
+ while (reader.Read())
+ {
+ UseFree item = new();
+ item.ConvertReader(reader);
+
+ if (item.DetailID == 0)
+ {
+ //利用情報の自由集計
+ FreeList.Add(item);
+ item.Parent = this;
+ }
+ else if (item.UseDate.CompareTo(customTypes.Date.MinUseDate) <= 0)
+ {
+ //利用明細の自由集計
+ UseDetail detail = detailDict[item.DetailID];
+ detail.FreeList.Add(item);
+ item.Parent = detail;
+ }
+ else
+ {
+ //利用部屋の自由集計
+ UseRoom useRoom = useRoomDict[$"{item.DetailID},{item.UseDate.Value}"];
+ useRoom.FreeList.Add(item);
+ item.Parent = useRoom;
+ }
+ }
+ reader.NextResult();
+ }
+
+ /// <summary>
+ /// メモ
+ /// </summary>
+ /// <param name="reader"></param>
+ /// <param name="use"></param>
+ public void SetUseMemo(DbDataReader reader)
+ {
+ while (reader.Read())
+ {
+ UseMemo item = new();
+ item.ConvertReader(reader);
+
+ if (item.DetailID == 0)
+ {
+ //利用情報
+ MemoList.Add(item);
+ item.Parent = this;
+ }
+ else
+ {
+ //利用明細
+ UseDetail detail = detailDict[item.DetailID];
+ detail.MemoList.Add(item);
+ item.Parent = detail;
+ }
+ }
+ reader.NextResult();
+ }
+
+ /// <summary>
+ /// 売上
+ /// </summary>
+ /// <param name="reader"></param>
+ public void SetSale(DbDataReader reader)
+ {
+ while (reader.Read())
+ {
+ Sale item = new();
+ item.ConvertReader(reader);
+ UseRoom useRoom = useRoomDict[$"{item.DetailID},{item.UseDate.Value}"];
+ useRoom.SaleList.Add(item);
+ item.Parent = useRoom;
+ }
+ reader.NextResult();
+ }
+
+ /// <summary>
+ /// 入金
+ /// </summary>
+ /// <param name="reader"></param>
+ public void SetPay(DbDataReader reader)
+ {
+ while (reader.Read())
+ {
+ Pay item = new();
+ item.ConvertReader(reader);
+ UseRoom useRoom = useRoomDict[$"{item.DetailID},{item.UseDate.Value}"];
+ useRoom.PayList.Add(item);
+ item.Parent = useRoom;
+ }
+ reader.NextResult();
+ }
+
+ /// <summary>
+ /// 手配情報
+ /// </summary>
+ /// <param name="reader"></param>
+ public void SetArrange(DbDataReader reader)
+ {
+ while (reader.Read())
+ {
+ Arrange item = new();
+ item.ConvertReader(reader);
+ UseRoom useRoom = useRoomDict[$"{item.DetailID},{item.UseDate.Value}"];
+ useRoom.ArrangeList.Add(item);
+ item.Parent = useRoom;
+ }
+ reader.NextResult();
+ }
+
+ /// <summary>
+ /// 備品情報
+ /// </summary>
+ /// <param name="reader"></param>
+ public void SetRental(DbDataReader reader)
+ {
+ while (reader.Read())
+ {
+ Rental item = new();
+ item.ConvertReader(reader);
+ UseDetail detail = detailDict[item.DetailID];
+ detail.RentalList.Add(item);
+ item.Parent = detail;
+ }
+ reader.NextResult();
+ }
+
+ /// <summary>
+ /// バッファークリア
+ /// </summary>
+ public void ClearDict()
+ {
+ personDict.Clear();
+ detailDict.Clear();
+ useRoomDict.Clear();
+ }
+
+ /// <summary>
+ /// 利用情報取得
+ /// ※サーバー中のバッファーより、マスタ名も取得する
+ /// </summary>
+ /// <param name="id"></param>
+ /// <returns></returns>
+ public static Use? Get(int id, DataAccess access)
+ {
+ try
+ {
+ string sql = $"EXECUTE GetUse {id}";
+ OperationLog.Instance.WriteLog($"データ読込:{sql}");
+ Use item = access.GetDataReader<Use>(sql, (reader, use) =>
+ {
+ use.ClearDict();
+ if (reader.Read()) { use.ConvertReader(reader); reader.NextResult(); } //D_Use
+ use.SetUsePerson(reader); //D_UsePerson
+ use.SetUsePersonFree(reader); //D_UsePersonFree
+ use.SetUsePersonTel(reader); //D_UsePersonTel
+ use.SetUseDetail(reader); //D_UseDetail
+ use.SetUseRoom(reader); //D_UseRoom
+ use.SetUseAllo(reader); //D_UseAllo
+ use.SetUseFree(reader); //D_UseFree
+ use.SetUseMemo(reader); //D_UseMemo
+ use.SetRental(reader); //D_Rental
+ use.SetSale(reader); //D_Sale
+ use.SetPay(reader); //D_Pay
+ use.SetArrange(reader); //D_Arrange
+ });
+ return item;
+ }
+ catch (Exception ex)
+ {
+ OperationLog.Instance.WriteLog($"{MethodInfo.GetCurrentMethod()}:{ex.Message}");
+ return null;
+ }
+ }
+ }
+}
diff --git a/ProtosExpan/UseInfo/Use.cs b/ProtosExpan/UseInfo/Use.cs
new file mode 100644
index 0000000..4d63573
--- /dev/null
+++ b/ProtosExpan/UseInfo/Use.cs
@@ -0,0 +1,336 @@
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Text;
+using HotelPms.Share.Data;
+using HotelPms.Share.Util;
+using Google.Protobuf.WellKnownTypes;
+using customTypes;
+using System.Data.Common;
+
+namespace HotelPms.Data.UseInfo;
+
+/// ****************************** Description *******************************
+/// ◇システム名称
+/// ホテルPMS
+/// ◇概要
+///
+/// ◇履歴
+/// 2021/05/14 コード作成ツール 自動作成
+/// ****************************** Declarations ******************************
+[Serializable()]
+public partial class Use : RecordBase
+{
+ #region ★★★★★ Property ★★★★★
+
+ public static ConcurrentDictionary<string, int> PrimaryKey { get; } = new ConcurrentDictionary<string, int>();
+
+ #endregion
+
+ partial void OnConstruction()
+ {
+ if (PrimaryKey.Count == 0)
+ {
+ PrimaryKey.TryAdd("ID", 0);
+
+ }
+ }
+
+ #region ★★★★★ Function ★★★★★
+
+ public bool CompareTo(Use item)
+ {
+ if (ID.CompareTo(item.ID) != 0
+ || DetailID.CompareTo(item.DetailID) != 0
+ || ResvType.CompareTo(item.ResvType) != 0
+ || GroupType.CompareTo(item.GroupType) != 0
+ || GroupName.CompareTo(item.GroupName) != 0
+ || GroupKana.CompareTo(item.GroupKana) != 0
+ || ReceiptPrtWay.CompareTo(item.ReceiptPrtWay) != 0
+ || PayWay.CompareTo(item.PayWay) != 0
+ || CancelHotelDate.CompareTo(item.CancelHotelDate) != 0
+ || CancelDate.CompareTo(item.CancelDate) != 0
+ || CancelLoginID.CompareTo(item.CancelLoginID) != 0
+ || CancelName.CompareTo(item.CancelName) != 0
+ || CancelReason.CompareTo(item.CancelReason) != 0
+ || CreateDate.CompareTo(item.CreateDate) != 0
+ || CreateLoginID.CompareTo(item.CreateLoginID) != 0
+ || CreatePcName.CompareTo(item.CreatePcName) != 0
+ || CreateClass.CompareTo(item.CreateClass) != 0
+ || UpdateDate.CompareTo(item.UpdateDate) != 0
+ || UpdateLoginID.CompareTo(item.UpdateLoginID) != 0
+ || UpdatePcName.CompareTo(item.UpdatePcName) != 0
+ || UpdateClass.CompareTo(item.UpdateClass) != 0
+ || UpdateID.CompareTo(item.UpdateID) != 0
+)
+ {
+ return false;
+ }
+ return true;
+ }
+
+
+ public override void CopyTo(object dest)
+ {
+ Use item = dest as Use;
+ item.ID = ID;
+ item.DetailID = DetailID;
+ item.ResvType = ResvType;
+ item.GroupType = GroupType;
+ item.GroupName = GroupName;
+ item.GroupKana = GroupKana;
+ item.ReceiptPrtWay = ReceiptPrtWay;
+ item.PayWay = PayWay;
+ item.CancelHotelDate = CancelHotelDate;
+ item.CancelDate = CancelDate;
+ item.CancelLoginID = CancelLoginID;
+ item.CancelName = CancelName;
+ item.CancelReason = CancelReason;
+ item.CreateDate = CreateDate;
+ item.CreateLoginID = CreateLoginID;
+ item.CreatePcName = CreatePcName;
+ item.CreateClass = CreateClass;
+ item.UpdateDate = UpdateDate;
+ item.UpdateLoginID = UpdateLoginID;
+ item.UpdatePcName = UpdatePcName;
+ item.UpdateClass = UpdateClass;
+ item.UpdateID = UpdateID;
+
+ }
+
+ public override void Clear()
+ {
+ ID = 0;
+ DetailID = 0;
+ ResvType = 0;
+ GroupType = 0;
+ GroupName = string.Empty;
+ GroupKana = string.Empty;
+ ReceiptPrtWay = 0;
+ PayWay = 0;
+ CancelHotelDate = Date.Default;
+ CancelDate = CConvert.ToTimestamp(DateTime.MinValue);
+ CancelLoginID = 0;
+ CancelName = string.Empty;
+ CancelReason = string.Empty;
+ CreateDate = CConvert.ToTimestamp(DateTime.MinValue);
+ CreateLoginID = 0;
+ CreatePcName = string.Empty;
+ CreateClass = 0;
+ UpdateDate = CConvert.ToTimestamp(DateTime.MinValue);
+ UpdateLoginID = 0;
+ UpdatePcName = string.Empty;
+ UpdateClass = 0;
+ UpdateID = 0;
+
+ }
+
+ public Use DeepClone()
+ {
+ Use item = new Use();
+ item.ID = ID;
+ item.DetailID = DetailID;
+ item.ResvType = ResvType;
+ item.GroupType = GroupType;
+ item.GroupName = GroupName;
+ item.GroupKana = GroupKana;
+ item.ReceiptPrtWay = ReceiptPrtWay;
+ item.PayWay = PayWay;
+ item.CancelHotelDate = CancelHotelDate;
+ item.CancelDate = CancelDate;
+ item.CancelLoginID = CancelLoginID;
+ item.CancelName = CancelName;
+ item.CancelReason = CancelReason;
+ item.CreateDate = CreateDate;
+ item.CreateLoginID = CreateLoginID;
+ item.CreatePcName = CreatePcName;
+ item.CreateClass = CreateClass;
+ item.UpdateDate = UpdateDate;
+ item.UpdateLoginID = UpdateLoginID;
+ item.UpdatePcName = UpdatePcName;
+ item.UpdateClass = UpdateClass;
+ item.UpdateID = UpdateID;
+
+ return item;
+ }
+
+ public override bool ConvertDataRow(System.Data.DataRow row)
+ {
+ ID = CConvert.ToInt(row["ID"], ID);
+ DetailID = CConvert.ToInt(row["DetailID"], DetailID);
+ ResvType = CConvert.ToInt(row["ResvType"], ResvType);
+ GroupType = CConvert.ToInt(row["GroupType"], GroupType);
+ GroupName = row["GroupName"].ToString();
+ GroupKana = row["GroupKana"].ToString();
+ ReceiptPrtWay = CConvert.ToInt(row["ReceiptPrtWay"], ReceiptPrtWay);
+ PayWay = CConvert.ToInt(row["PayWay"], PayWay);
+ CancelHotelDate = new Date(row.IsNull("CancelHotelDate") ? 0 : CConvert.ToDateInt((System.DateTime)row["CancelHotelDate"]));
+ CancelDate = CConvert.ToTimestamp(row.IsNull("CancelDate") ? DateTime.MinValue : (System.DateTime)row["CancelDate"]);
+ CancelLoginID = CConvert.ToInt(row["CancelLoginID"], CancelLoginID);
+ CancelName = row["CancelName"].ToString();
+ CancelReason = row["CancelReason"].ToString();
+ CreateDate = CConvert.ToTimestamp(row.IsNull("CreateDate") ? DateTime.MinValue : (System.DateTime)row["CreateDate"]);
+ CreateLoginID = CConvert.ToInt(row["CreateLoginID"], CreateLoginID);
+ CreatePcName = row["CreatePcName"].ToString();
+ CreateClass = CConvert.ToInt(row["CreateClass"], CreateClass);
+ UpdateDate = CConvert.ToTimestamp(row.IsNull("UpdateDate") ? DateTime.MinValue : (System.DateTime)row["UpdateDate"]);
+ UpdateLoginID = CConvert.ToInt(row["UpdateLoginID"], UpdateLoginID);
+ UpdatePcName = row["UpdatePcName"].ToString();
+ UpdateClass = CConvert.ToInt(row["UpdateClass"], UpdateClass);
+ UpdateID = CConvert.ToInt(row["UpdateID"], UpdateID);
+
+ return true;
+ }
+
+ public void ToDataRow(System.Data.DataRow row)
+ {
+ row["ID"] = ID;
+ row["DetailID"] = DetailID;
+ row["ResvType"] = ResvType;
+ row["GroupType"] = GroupType;
+ row["GroupName"] = GroupName;
+ row["GroupKana"] = GroupKana;
+ row["ReceiptPrtWay"] = ReceiptPrtWay;
+ row["PayWay"] = PayWay;
+ row["CancelHotelDate"] = CancelHotelDate.ToDateTime();
+ row["CancelDate"] = CancelDate.ToDateTime();
+ row["CancelLoginID"] = CancelLoginID;
+ row["CancelName"] = CancelName;
+ row["CancelReason"] = CancelReason;
+ row["CreateDate"] = CreateDate.ToDateTime();
+ row["CreateLoginID"] = CreateLoginID;
+ row["CreatePcName"] = CreatePcName;
+ row["CreateClass"] = CreateClass;
+ row["UpdateDate"] = UpdateDate.ToDateTime();
+ row["UpdateLoginID"] = UpdateLoginID;
+ row["UpdatePcName"] = UpdatePcName;
+ row["UpdateClass"] = UpdateClass;
+ row["UpdateID"] = UpdateID;
+
+ }
+
+ public void ConvertReader(DbDataReader row)
+ {
+ int i = 0;
+ ID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ DetailID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ ResvType = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ GroupType = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ GroupName = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ GroupKana = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ ReceiptPrtWay = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ PayWay = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ CancelHotelDate = new Date(row.IsDBNull(i) ? 0 : CConvert.ToDateInt(row.GetDateTime(i))); i++;
+ CancelDate = CConvert.ToTimestamp(row.IsDBNull(i) ? DateTime.MinValue : row.GetDateTime(i)); i++;
+ CancelLoginID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ CancelName = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ CancelReason = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ CreateDate = CConvert.ToTimestamp(row.IsDBNull(i) ? DateTime.MinValue : row.GetDateTime(i)); i++;
+ CreateLoginID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ CreatePcName = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ CreateClass = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ UpdateDate = CConvert.ToTimestamp(row.IsDBNull(i) ? DateTime.MinValue : row.GetDateTime(i)); i++;
+ UpdateLoginID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ UpdatePcName = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ UpdateClass = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ UpdateID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ }
+
+ public string AddSql()
+ {
+ return $@"INSERT INTO D_Use(ID,DetailID,ResvType,GroupType,GroupName,GroupKana,ReceiptPrtWay,PayWay,CancelHotelDate,CancelDate,CancelLoginID,CancelName,CancelReason,CreateDate,CreateLoginID,CreatePcName,CreateClass,UpdateDate,UpdateLoginID,UpdatePcName,UpdateClass,UpdateID) VALUES({ID},{DetailID},{ResvType},{GroupType},N'{GroupName}',N'{GroupKana}',{ReceiptPrtWay},{PayWay},{(CancelHotelDate == null ? "NULL" : CancelHotelDate.ToSqlValue())},{(CancelDate == null ? "NULL" : CConvert.ToSqlValue(CancelDate.ToDateTime()))},{CancelLoginID},N'{CancelName}',N'{CancelReason}',{(CreateDate == null ? "NULL" : CConvert.ToSqlValue(CreateDate.ToDateTime()))},{CreateLoginID},N'{CreatePcName}',{CreateClass},GETDATE(),{UpdateLoginID},N'{UpdatePcName}',{UpdateClass},{UpdateID});";
+ }
+
+ public string UpdateSql()
+ {
+ return $@"UPDATE D_Use SET DetailID = {DetailID},ResvType = {ResvType},GroupType = {GroupType},GroupName = N'{GroupName}',GroupKana = N'{GroupKana}',ReceiptPrtWay = {ReceiptPrtWay},PayWay = {PayWay},CancelHotelDate = {(CancelHotelDate == null ? "NULL" : CancelHotelDate.ToSqlValue())},CancelDate = {(CancelDate == null ? "NULL" : CConvert.ToSqlValue(CancelDate.ToDateTime()))},CancelLoginID = {CancelLoginID},CancelName = N'{CancelName}',CancelReason = N'{CancelReason}',CreateDate = {(CreateDate == null ? "NULL" : CConvert.ToSqlValue(CreateDate.ToDateTime()))},CreateLoginID = {CreateLoginID},CreatePcName = N'{CreatePcName}',CreateClass = {CreateClass},UpdateDate = GETDATE(),UpdateLoginID = {UpdateLoginID},UpdatePcName = N'{UpdatePcName}',UpdateClass = {UpdateClass},UpdateID = {UpdateID} WHERE ID = {ID};";
+ }
+
+ public string ToText()
+ {
+ StringBuilder text = new StringBuilder();
+ text.AppendFormat("ID={0};", ID);
+ text.AppendFormat("DetailID={0};", DetailID);
+ text.AppendFormat("ResvType={0};", ResvType);
+ text.AppendFormat("GroupType={0};", GroupType);
+ text.AppendFormat("GroupName={0};", GroupName);
+ text.AppendFormat("GroupKana={0};", GroupKana);
+ text.AppendFormat("ReceiptPrtWay={0};", ReceiptPrtWay);
+ text.AppendFormat("PayWay={0};", PayWay);
+ text.AppendFormat("CancelHotelDate={0};", CancelHotelDate);
+ text.AppendFormat("CancelDate={0};", CancelDate);
+ text.AppendFormat("CancelLoginID={0};", CancelLoginID);
+ text.AppendFormat("CancelName={0};", CancelName);
+ text.AppendFormat("CancelReason={0};", CancelReason);
+ text.AppendFormat("CreateDate={0};", CreateDate);
+ text.AppendFormat("CreateLoginID={0};", CreateLoginID);
+ text.AppendFormat("CreatePcName={0};", CreatePcName);
+ text.AppendFormat("CreateClass={0};", CreateClass);
+ text.AppendFormat("UpdateDate={0};", UpdateDate);
+ text.AppendFormat("UpdateLoginID={0};", UpdateLoginID);
+ text.AppendFormat("UpdatePcName={0};", UpdatePcName);
+ text.AppendFormat("UpdateClass={0};", UpdateClass);
+ text.AppendFormat("UpdateID={0};", UpdateID);
+
+ return text.ToString();
+ }
+
+ public override object GetField(string name)
+ {
+
+ if (name == "ID") { return ID; }
+ else if (name == "DetailID") { return DetailID; }
+ else if (name == "ResvType") { return ResvType; }
+ else if (name == "GroupType") { return GroupType; }
+ else if (name == "GroupName") { return GroupName; }
+ else if (name == "GroupKana") { return GroupKana; }
+ else if (name == "ReceiptPrtWay") { return ReceiptPrtWay; }
+ else if (name == "PayWay") { return PayWay; }
+ else if (name == "CancelHotelDate") { return CancelHotelDate; }
+ else if (name == "CancelDate") { return CancelDate; }
+ else if (name == "CancelLoginID") { return CancelLoginID; }
+ else if (name == "CancelName") { return CancelName; }
+ else if (name == "CancelReason") { return CancelReason; }
+ else if (name == "CreateDate") { return CreateDate; }
+ else if (name == "CreateLoginID") { return CreateLoginID; }
+ else if (name == "CreatePcName") { return CreatePcName; }
+ else if (name == "CreateClass") { return CreateClass; }
+ else if (name == "UpdateDate") { return UpdateDate; }
+ else if (name == "UpdateLoginID") { return UpdateLoginID; }
+ else if (name == "UpdatePcName") { return UpdatePcName; }
+ else if (name == "UpdateClass") { return UpdateClass; }
+ else if (name == "UpdateID") { return UpdateID; }
+ else { return null; }
+ }
+
+ public override bool SetField(string name, object value)
+ {
+
+ if (name == "ID") { ID = CConvert.ToInt(value); return true; }
+ else if (name == "DetailID") { DetailID = CConvert.ToInt(value); return true; }
+ else if (name == "ResvType") { ResvType = CConvert.ToInt(value); return true; }
+ else if (name == "GroupType") { GroupType = CConvert.ToInt(value); return true; }
+ else if (name == "GroupName") { GroupName = value.ToString(); return true; }
+ else if (name == "GroupKana") { GroupKana = value.ToString(); return true; }
+ else if (name == "ReceiptPrtWay") { ReceiptPrtWay = CConvert.ToInt(value); return true; }
+ else if (name == "PayWay") { PayWay = CConvert.ToInt(value); return true; }
+ else if (name == "CancelHotelDate") { CancelHotelDate = new Date(CConvert.ToDateInt(value)); return true; }
+ else if (name == "CancelDate") { CancelDate = CConvert.ToTimestamp(CConvert.ToDateTime(value)); return true; }
+ else if (name == "CancelLoginID") { CancelLoginID = CConvert.ToInt(value); return true; }
+ else if (name == "CancelName") { CancelName = value.ToString(); return true; }
+ else if (name == "CancelReason") { CancelReason = value.ToString(); return true; }
+ else if (name == "CreateDate") { CreateDate = CConvert.ToTimestamp(CConvert.ToDateTime(value)); return true; }
+ else if (name == "CreateLoginID") { CreateLoginID = CConvert.ToInt(value); return true; }
+ else if (name == "CreatePcName") { CreatePcName = value.ToString(); return true; }
+ else if (name == "CreateClass") { CreateClass = CConvert.ToInt(value); return true; }
+ else if (name == "UpdateDate") { UpdateDate = CConvert.ToTimestamp(CConvert.ToDateTime(value)); return true; }
+ else if (name == "UpdateLoginID") { UpdateLoginID = CConvert.ToInt(value); return true; }
+ else if (name == "UpdatePcName") { UpdatePcName = value.ToString(); return true; }
+ else if (name == "UpdateClass") { UpdateClass = CConvert.ToInt(value); return true; }
+ else if (name == "UpdateID") { UpdateID = CConvert.ToInt(value); return true; }
+ else { return false; }
+ }
+
+ #endregion
+}
\ No newline at end of file
diff --git a/ProtosExpan/UseInfo/UseAllo.Server.cs b/ProtosExpan/UseInfo/UseAllo.Server.cs
new file mode 100644
index 0000000..4e9614e
--- /dev/null
+++ b/ProtosExpan/UseInfo/UseAllo.Server.cs
@@ -0,0 +1,40 @@
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Text;
+using HotelPms.Share.Data;
+using HotelPms.Share.Util;
+using Google.Protobuf.WellKnownTypes;
+using customTypes;
+using System.Data.Common;
+
+namespace HotelPms.Data.UseInfo;
+
+/// ****************************** Description *******************************
+/// ◇システム名称
+/// ホテルPMS
+/// ◇概要
+///
+/// ◇履歴
+/// 2021/05/14 コード作成ツール 自動作成
+/// ****************************** Declarations ******************************
+public partial class UseAllo
+{
+ #region ★★★★★ Property ★★★★★
+
+ /// <summary>
+ /// 利用明細(連泊部屋)
+ /// </summary>
+ public UseDetail Detail { get; set; }
+
+ /// <summary>
+ /// 利用者
+ /// </summary>
+ public UsePerson Person { get; set; }
+
+ #endregion
+
+ #region ★★★★★ Function ★★★★★
+ #endregion
+}
\ No newline at end of file
diff --git a/ProtosExpan/UseInfo/UseAllo.cs b/ProtosExpan/UseInfo/UseAllo.cs
new file mode 100644
index 0000000..5b5df16
--- /dev/null
+++ b/ProtosExpan/UseInfo/UseAllo.cs
@@ -0,0 +1,160 @@
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Text;
+using HotelPms.Share.Data;
+using HotelPms.Share.Util;
+using Google.Protobuf.WellKnownTypes;
+using customTypes;
+using System.Data.Common;
+
+namespace HotelPms.Data.UseInfo;
+
+/// ****************************** Description *******************************
+/// ◇システム名称
+/// ホテルPMS
+/// ◇概要
+///
+/// ◇履歴
+/// 2021/05/14 コード作成ツール 自動作成
+/// ****************************** Declarations ******************************
+[Serializable()]
+public partial class UseAllo : RecordBase
+{
+ #region ★★★★★ Property ★★★★★
+
+ public static ConcurrentDictionary<string, int> PrimaryKey { get; } = new ConcurrentDictionary<string, int>();
+
+ #endregion
+
+ partial void OnConstruction()
+ {
+ if (PrimaryKey.Count == 0)
+ {
+ PrimaryKey.TryAdd("ID", 0);
+ PrimaryKey.TryAdd("DetailID", 0);
+ PrimaryKey.TryAdd("UseDate", 0);
+ PrimaryKey.TryAdd("PersonID", 0);
+
+ }
+ }
+
+ #region ★★★★★ Function ★★★★★
+
+ public bool CompareTo(UseAllo item)
+ {
+ if (ID.CompareTo(item.ID) != 0
+ || DetailID.CompareTo(item.DetailID) != 0
+ || UseDate.CompareTo(item.UseDate) != 0
+ || PersonID.CompareTo(item.PersonID) != 0
+)
+ {
+ return false;
+ }
+ return true;
+ }
+
+
+ public override void CopyTo(object dest)
+ {
+ UseAllo item = dest as UseAllo;
+ item.ID = ID;
+ item.DetailID = DetailID;
+ item.UseDate = UseDate;
+ item.PersonID = PersonID;
+
+ }
+
+ public override void Clear()
+ {
+ ID = 0;
+ DetailID = 0;
+ UseDate = Date.Default;
+ PersonID = 0;
+
+ }
+
+ public UseAllo DeepClone()
+ {
+ UseAllo item = new UseAllo();
+ item.ID = ID;
+ item.DetailID = DetailID;
+ item.UseDate = UseDate;
+ item.PersonID = PersonID;
+
+ return item;
+ }
+
+ public override bool ConvertDataRow(System.Data.DataRow row)
+ {
+ ID = CConvert.ToInt(row["ID"],ID);
+ DetailID = CConvert.ToInt(row["DetailID"],DetailID);
+ UseDate = new Date(row.IsNull("UseDate") ? 0 : CConvert.ToDateInt((System.DateTime)row["UseDate"]));
+ PersonID = CConvert.ToInt(row["PersonID"],PersonID);
+
+ return true;
+ }
+
+ public void ToDataRow(System.Data.DataRow row)
+ {
+ row["ID"] = ID;
+ row["DetailID"] = DetailID;
+ row["UseDate"] = UseDate.ToDateTime();
+ row["PersonID"] = PersonID;
+
+ }
+
+ public void ConvertReader(DbDataReader row)
+ {
+ int i = 0;
+ ID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ DetailID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ UseDate = new Date(row.IsDBNull(i) ? 0 : CConvert.ToDateInt(row.GetDateTime(i))); i++;
+ PersonID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+
+ }
+
+ public string AddSql()
+ {
+ return $@"INSERT INTO D_UseAllo(ID,DetailID,UseDate,PersonID) VALUES({ID},{DetailID},{(UseDate == null ? "NULL" : UseDate.ToSqlValue())},{PersonID});";
+ }
+
+ public string UpdateSql()
+ {
+ return $@"UPDATE D_UseAllo SET WHERE ID = {ID} AND DetailID = {DetailID} AND UseDate = {(UseDate == null ? "NULL" : UseDate.ToSqlValue())} AND PersonID = {PersonID};";
+ }
+
+ public string ToText()
+ {
+ StringBuilder text = new StringBuilder();
+ text.AppendFormat("ID={0};", ID);
+ text.AppendFormat("DetailID={0};", DetailID);
+ text.AppendFormat("UseDate={0};", UseDate);
+ text.AppendFormat("PersonID={0};", PersonID);
+
+ return text.ToString();
+ }
+
+ public override object GetField(string name)
+ {
+
+ if (name == "ID") { return ID; }
+ else if (name == "DetailID") { return DetailID; }
+ else if (name == "UseDate") { return UseDate; }
+ else if (name == "PersonID") { return PersonID; }
+ else { return null; }
+ }
+
+ public override bool SetField(string name, object value)
+ {
+
+ if (name == "ID") { ID = CConvert.ToInt(value); return true; }
+ else if (name == "DetailID") { DetailID = CConvert.ToInt(value); return true; }
+ else if (name == "UseDate") { UseDate = new Date(CConvert.ToDateInt(value)); return true; }
+ else if (name == "PersonID") { PersonID = CConvert.ToInt(value); return true; }
+ else { return false; }
+ }
+
+ #endregion
+}
\ No newline at end of file
diff --git a/ProtosExpan/UseInfo/UseDetail.Client.cs b/ProtosExpan/UseInfo/UseDetail.Client.cs
new file mode 100644
index 0000000..5c5fb2a
--- /dev/null
+++ b/ProtosExpan/UseInfo/UseDetail.Client.cs
@@ -0,0 +1,60 @@
+using HotelPms.Data.Common;
+using HotelPms.Share.Util;
+using System.Collections.Generic;
+
+namespace HotelPms.Data.UseInfo;
+
+/// <summary>
+/// 画面中制御時データの加工
+/// </summary>
+public partial class UseDetail
+{
+ /// <summary>
+ /// 利用日を指定し、データを返す
+ /// </summary>
+ /// <param name="useDate"></param>
+ /// <returns></returns>
+ public List<UseRoom> GetUseRoomList(string useDate)
+ {
+ List<UseRoom> list = new();
+ if (useDate.Length == 0)
+ {
+ list.AddRange(UseRoomList);
+ }
+ else
+ {
+ list.AddRange(UseRoomList.Where(x => x.UseDate.CompareTo(new customTypes.Date(useDate)) == 0)); //一件しかない
+ }
+ return list;
+ }
+
+ /// <summary>
+ /// 利用部屋存在するかどうか
+ /// </summary>
+ /// <param name="useDate"></param>
+ /// <returns></returns>
+ public bool ExistsUseRoom(string useDate)
+ {
+ if (useDate.Length == 0)
+ {
+ return UseRoomList.Count > 0;
+ }
+ else
+ {
+ var a = UseRoomList.Any(x => x.UseDate.CompareTo(new customTypes.Date(useDate)) == 0); //存在
+ return a;
+ }
+ }
+
+ /// <summary>
+ /// 利用日の追加による利用期間調整
+ /// </summary>
+ /// <param name="useDate"></param>
+ public void SetUseRange(string useDate)
+ {
+ customTypes.Date date = new(useDate);
+ if (date.CompareTo(CinDate) < 0) { CinDate = date; }
+ if (date.CompareTo(CoutDate) > 0) { CoutDate = date; }
+ Stay = CoutDate.Subtract(CinDate);
+ }
+}
diff --git a/ProtosExpan/UseInfo/UseDetail.Server.cs b/ProtosExpan/UseInfo/UseDetail.Server.cs
new file mode 100644
index 0000000..e100a20
--- /dev/null
+++ b/ProtosExpan/UseInfo/UseDetail.Server.cs
@@ -0,0 +1,16 @@
+using HotelPms.Data.Common;
+using HotelPms.Share.Util;
+using System.Collections.Generic;
+
+namespace HotelPms.Data.UseInfo;
+
+/// <summary>
+/// 画面中制御時データの加工
+/// </summary>
+public partial class UseDetail
+{
+ /// <summary>
+ /// 予約者
+ /// </summary>
+ public UsePerson ResvPerson { get; set; }
+}
diff --git a/ProtosExpan/UseInfo/UseDetail.cs b/ProtosExpan/UseInfo/UseDetail.cs
new file mode 100644
index 0000000..3dda378
--- /dev/null
+++ b/ProtosExpan/UseInfo/UseDetail.cs
@@ -0,0 +1,448 @@
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Text;
+using HotelPms.Share.Data;
+using HotelPms.Share.Util;
+using Google.Protobuf.WellKnownTypes;
+using customTypes;
+using System.Data.Common;
+
+namespace HotelPms.Data.UseInfo;
+
+/// ****************************** Description *******************************
+/// ◇システム名称
+/// ホテルPMS
+/// ◇概要
+///
+/// ◇履歴
+/// 2021/05/14 コード作成ツール 自動作成
+/// ****************************** Declarations ******************************
+[Serializable()]
+public partial class UseDetail : RecordBase
+{
+ #region ★★★★★ Property ★★★★★
+
+ public static ConcurrentDictionary<string, int> PrimaryKey { get; } = new ConcurrentDictionary<string, int>();
+
+ #endregion
+
+ partial void OnConstruction()
+ {
+ if (PrimaryKey.Count == 0)
+ {
+ PrimaryKey.TryAdd("ID", 0);
+ PrimaryKey.TryAdd("DetailID", 0);
+
+ }
+ }
+
+ #region ★★★★★ Function ★★★★★
+
+ public bool CompareTo(UseDetail item)
+ {
+ if (ID.CompareTo(item.ID) != 0
+ || DetailID.CompareTo(item.DetailID) != 0
+ || UseStatus.CompareTo(item.UseStatus) != 0
+ || SubStatus.CompareTo(item.SubStatus) != 0
+ || ExtenStatus.CompareTo(item.ExtenStatus) != 0
+ || CinDate.CompareTo(item.CinDate) != 0
+ || CinTime.CompareTo(item.CinTime) != 0
+ || Stay.CompareTo(item.Stay) != 0
+ || CoutDate.CompareTo(item.CoutDate) != 0
+ || CoutTime.CompareTo(item.CoutTime) != 0
+ || AgentID.CompareTo(item.AgentID) != 0
+ || AgentBranchID.CompareTo(item.AgentBranchID) != 0
+ || ResvNo.CompareTo(item.ResvNo) != 0
+ || ResvDate.CompareTo(item.ResvDate) != 0
+ || ResvHotelDate.CompareTo(item.ResvHotelDate) != 0
+ || ResvType.CompareTo(item.ResvType) != 0
+ || ResvPersonID.CompareTo(item.ResvPersonID) != 0
+ || SalesLoginID.CompareTo(item.SalesLoginID) != 0
+ || PayType.CompareTo(item.PayType) != 0
+ || PayItemID.CompareTo(item.PayItemID) != 0
+ || PayAgentID.CompareTo(item.PayAgentID) != 0
+ || PayAgentBranchID.CompareTo(item.PayAgentBranchID) != 0
+ || LimitDate.CompareTo(item.LimitDate) != 0
+ || RoomAssign.CompareTo(item.RoomAssign) != 0
+ || CreateDate.CompareTo(item.CreateDate) != 0
+ || CreateLoginID.CompareTo(item.CreateLoginID) != 0
+ || CreatePcName.CompareTo(item.CreatePcName) != 0
+ || CreateClass.CompareTo(item.CreateClass) != 0
+ || UpdateDate.CompareTo(item.UpdateDate) != 0
+ || UpdateLoginID.CompareTo(item.UpdateLoginID) != 0
+ || UpdatePcName.CompareTo(item.UpdatePcName) != 0
+ || UpdateClass.CompareTo(item.UpdateClass) != 0
+ || UpdateID.CompareTo(item.UpdateID) != 0
+)
+ {
+ return false;
+ }
+ return true;
+ }
+
+
+ public override void CopyTo(object dest)
+ {
+ UseDetail item = dest as UseDetail;
+ item.ID = ID;
+ item.DetailID = DetailID;
+ item.UseStatus = UseStatus;
+ item.SubStatus = SubStatus;
+ item.ExtenStatus = ExtenStatus;
+ item.CinDate = CinDate;
+ item.CinTime = CinTime;
+ item.Stay = Stay;
+ item.CoutDate = CoutDate;
+ item.CoutTime = CoutTime;
+ item.AgentID = AgentID;
+ item.AgentBranchID = AgentBranchID;
+ item.ResvNo = ResvNo;
+ item.ResvDate = ResvDate;
+ item.ResvHotelDate = ResvHotelDate;
+ item.ResvType = ResvType;
+ item.ResvPersonID = ResvPersonID;
+ item.SalesLoginID = SalesLoginID;
+ item.PayType = PayType;
+ item.PayItemID = PayItemID;
+ item.PayAgentID = PayAgentID;
+ item.PayAgentBranchID = PayAgentBranchID;
+ item.LimitDate = LimitDate;
+ item.RoomAssign = RoomAssign;
+ item.CreateDate = CreateDate;
+ item.CreateLoginID = CreateLoginID;
+ item.CreatePcName = CreatePcName;
+ item.CreateClass = CreateClass;
+ item.UpdateDate = UpdateDate;
+ item.UpdateLoginID = UpdateLoginID;
+ item.UpdatePcName = UpdatePcName;
+ item.UpdateClass = UpdateClass;
+ item.UpdateID = UpdateID;
+
+ }
+
+ public override void Clear()
+ {
+ ID = 0;
+ DetailID = 0;
+ UseStatus = 0;
+ SubStatus = 0;
+ ExtenStatus = 0;
+ CinDate = Date.Default;
+ CinTime = 0;
+ Stay = 0;
+ CoutDate = Date.Default;
+ CoutTime = 0;
+ AgentID = 0;
+ AgentBranchID = 0;
+ ResvNo = string.Empty;
+ ResvDate = CConvert.ToTimestamp(DateTime.MinValue);
+ ResvHotelDate = Date.Default;
+ ResvType = 0;
+ ResvPersonID = 0;
+ SalesLoginID = 0;
+ PayType = 0;
+ PayItemID = string.Empty;
+ PayAgentID = 0;
+ PayAgentBranchID = 0;
+ LimitDate = Date.Default;
+ RoomAssign = false;
+ CreateDate = CConvert.ToTimestamp(DateTime.MinValue);
+ CreateLoginID = 0;
+ CreatePcName = string.Empty;
+ CreateClass = 0;
+ UpdateDate = CConvert.ToTimestamp(DateTime.MinValue);
+ UpdateLoginID = 0;
+ UpdatePcName = string.Empty;
+ UpdateClass = 0;
+ UpdateID = 0;
+
+ }
+
+ public UseDetail DeepClone()
+ {
+ UseDetail item = new UseDetail();
+ item.ID = ID;
+ item.DetailID = DetailID;
+ item.UseStatus = UseStatus;
+ item.SubStatus = SubStatus;
+ item.ExtenStatus = ExtenStatus;
+ item.CinDate = CinDate;
+ item.CinTime = CinTime;
+ item.Stay = Stay;
+ item.CoutDate = CoutDate;
+ item.CoutTime = CoutTime;
+ item.AgentID = AgentID;
+ item.AgentBranchID = AgentBranchID;
+ item.ResvNo = ResvNo;
+ item.ResvDate = ResvDate;
+ item.ResvHotelDate = ResvHotelDate;
+ item.ResvType = ResvType;
+ item.ResvPersonID = ResvPersonID;
+ item.SalesLoginID = SalesLoginID;
+ item.PayType = PayType;
+ item.PayItemID = PayItemID;
+ item.PayAgentID = PayAgentID;
+ item.PayAgentBranchID = PayAgentBranchID;
+ item.LimitDate = LimitDate;
+ item.RoomAssign = RoomAssign;
+ item.CreateDate = CreateDate;
+ item.CreateLoginID = CreateLoginID;
+ item.CreatePcName = CreatePcName;
+ item.CreateClass = CreateClass;
+ item.UpdateDate = UpdateDate;
+ item.UpdateLoginID = UpdateLoginID;
+ item.UpdatePcName = UpdatePcName;
+ item.UpdateClass = UpdateClass;
+ item.UpdateID = UpdateID;
+
+ return item;
+ }
+
+ public override bool ConvertDataRow(System.Data.DataRow row)
+ {
+ ID = CConvert.ToInt(row["ID"],ID);
+ DetailID = CConvert.ToInt(row["DetailID"],DetailID);
+ UseStatus = CConvert.ToInt(row["UseStatus"],UseStatus);
+ SubStatus = CConvert.ToInt(row["SubStatus"],SubStatus);
+ ExtenStatus = CConvert.ToInt(row["ExtenStatus"],ExtenStatus);
+ CinDate = new Date(row.IsNull("CinDate") ? 0 : CConvert.ToDateInt((System.DateTime)row["CinDate"]));
+ CinTime = CConvert.ToInt(row["CinTime"],CinTime);
+ Stay = CConvert.ToInt(row["Stay"],Stay);
+ CoutDate = new Date(row.IsNull("CoutDate") ? 0 : CConvert.ToDateInt((System.DateTime)row["CoutDate"]));
+ CoutTime = CConvert.ToInt(row["CoutTime"],CoutTime);
+ AgentID = CConvert.ToInt(row["AgentID"],AgentID);
+ AgentBranchID = CConvert.ToInt(row["AgentBranchID"],AgentBranchID);
+ ResvNo = row["ResvNo"].ToString();
+ ResvDate = CConvert.ToTimestamp(row.IsNull("ResvDate") ? DateTime.MinValue : (System.DateTime)row["ResvDate"]);
+ ResvHotelDate = new Date(row.IsNull("ResvHotelDate") ? 0 : CConvert.ToDateInt((System.DateTime)row["ResvHotelDate"]));
+ ResvType = CConvert.ToInt(row["ResvType"],ResvType);
+ ResvPersonID = CConvert.ToInt(row["ResvPersonID"],ResvPersonID);
+ SalesLoginID = CConvert.ToInt(row["SalesLoginID"],SalesLoginID);
+ PayType = CConvert.ToInt(row["PayType"],PayType);
+ PayItemID = row["PayItemID"].ToString();
+ PayAgentID = CConvert.ToInt(row["PayAgentID"],PayAgentID);
+ PayAgentBranchID = CConvert.ToInt(row["PayAgentBranchID"],PayAgentBranchID);
+ LimitDate = new Date(row.IsNull("LimitDate") ? 0 : CConvert.ToDateInt((System.DateTime)row["LimitDate"]));
+ RoomAssign = CConvert.ToBool(row["RoomAssign"]);
+ CreateDate = CConvert.ToTimestamp(row.IsNull("CreateDate") ? DateTime.MinValue : (System.DateTime)row["CreateDate"]);
+ CreateLoginID = CConvert.ToInt(row["CreateLoginID"],CreateLoginID);
+ CreatePcName = row["CreatePcName"].ToString();
+ CreateClass = CConvert.ToInt(row["CreateClass"],CreateClass);
+ UpdateDate = CConvert.ToTimestamp(row.IsNull("UpdateDate") ? DateTime.MinValue : (System.DateTime)row["UpdateDate"]);
+ UpdateLoginID = CConvert.ToInt(row["UpdateLoginID"],UpdateLoginID);
+ UpdatePcName = row["UpdatePcName"].ToString();
+ UpdateClass = CConvert.ToInt(row["UpdateClass"],UpdateClass);
+ UpdateID = CConvert.ToInt(row["UpdateID"],UpdateID);
+
+ return true;
+ }
+
+ public void ToDataRow(System.Data.DataRow row)
+ {
+ row["ID"] = ID;
+ row["DetailID"] = DetailID;
+ row["UseStatus"] = UseStatus;
+ row["SubStatus"] = SubStatus;
+ row["ExtenStatus"] = ExtenStatus;
+ row["CinDate"] = CinDate.ToDateTime();
+ row["CinTime"] = CinTime;
+ row["Stay"] = Stay;
+ row["CoutDate"] = CoutDate.ToDateTime();
+ row["CoutTime"] = CoutTime;
+ row["AgentID"] = AgentID;
+ row["AgentBranchID"] = AgentBranchID;
+ row["ResvNo"] = ResvNo;
+ row["ResvDate"] = ResvDate.ToDateTime();
+ row["ResvHotelDate"] = ResvHotelDate.ToDateTime();
+ row["ResvType"] = ResvType;
+ row["ResvPersonID"] = ResvPersonID;
+ row["SalesLoginID"] = SalesLoginID;
+ row["PayType"] = PayType;
+ row["PayItemID"] = PayItemID;
+ row["PayAgentID"] = PayAgentID;
+ row["PayAgentBranchID"] = PayAgentBranchID;
+ row["LimitDate"] = LimitDate.ToDateTime();
+ row["RoomAssign"] = RoomAssign;
+ row["CreateDate"] = CreateDate.ToDateTime();
+ row["CreateLoginID"] = CreateLoginID;
+ row["CreatePcName"] = CreatePcName;
+ row["CreateClass"] = CreateClass;
+ row["UpdateDate"] = UpdateDate.ToDateTime();
+ row["UpdateLoginID"] = UpdateLoginID;
+ row["UpdatePcName"] = UpdatePcName;
+ row["UpdateClass"] = UpdateClass;
+ row["UpdateID"] = UpdateID;
+
+ }
+
+ public void ConvertReader(DbDataReader row)
+ {
+ int i = 0;
+ ID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ DetailID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ UseStatus = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ SubStatus = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ ExtenStatus = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ CinDate = new Date(row.IsDBNull(i) ? 0 : CConvert.ToDateInt(row.GetDateTime(i))); i++;
+ CinTime = (int)(row.IsDBNull(i) ? 0 : row.GetInt16(i)); i++;
+ Stay = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ CoutDate = new Date(row.IsDBNull(i) ? 0 : CConvert.ToDateInt(row.GetDateTime(i))); i++;
+ CoutTime = (int)(row.IsDBNull(i) ? 0 : row.GetInt16(i)); i++;
+ AgentID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ AgentBranchID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ ResvNo = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ ResvDate = CConvert.ToTimestamp(row.IsDBNull(i) ? DateTime.MinValue : row.GetDateTime(i)); i++;
+ ResvHotelDate = new Date(row.IsDBNull(i) ? 0 : CConvert.ToDateInt(row.GetDateTime(i))); i++;
+ ResvType = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ ResvPersonID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ SalesLoginID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ PayType = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ PayItemID = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ PayAgentID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ PayAgentBranchID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ LimitDate = new Date(row.IsDBNull(i) ? 0 : CConvert.ToDateInt(row.GetDateTime(i))); i++;
+ RoomAssign = (bool)(row.IsDBNull(i) ? false : row.GetBoolean(i)); i++;
+ CreateDate = CConvert.ToTimestamp(row.IsDBNull(i) ? DateTime.MinValue : row.GetDateTime(i)); i++;
+ CreateLoginID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ CreatePcName = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ CreateClass = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ UpdateDate = CConvert.ToTimestamp(row.IsDBNull(i) ? DateTime.MinValue : row.GetDateTime(i)); i++;
+ UpdateLoginID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ UpdatePcName = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ UpdateClass = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ UpdateID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+
+ }
+
+ public string AddSql()
+ {
+ return $@"INSERT INTO D_UseDetail(ID,DetailID,UseStatus,SubStatus,ExtenStatus,CinDate,CinTime,Stay,CoutDate,CoutTime,AgentID,AgentBranchID,ResvNo,ResvDate,ResvHotelDate,ResvType,ResvPersonID,SalesLoginID,PayType,PayItemID,PayAgentID,PayAgentBranchID,LimitDate,RoomAssign,CreateDate,CreateLoginID,CreatePcName,CreateClass,UpdateDate,UpdateLoginID,UpdatePcName,UpdateClass,UpdateID) VALUES({ID},{DetailID},{UseStatus},{SubStatus},{ExtenStatus},{(CinDate == null ? "NULL" : CinDate.ToSqlValue())},{CinTime},{Stay},{(CoutDate == null ? "NULL" : CoutDate.ToSqlValue())},{CoutTime},{AgentID},{AgentBranchID},N'{ResvNo}',{(ResvDate == null ? "NULL" : CConvert.ToSqlValue(ResvDate.ToDateTime()))},{(ResvHotelDate == null ? "NULL" : ResvHotelDate.ToSqlValue())},{ResvType},{ResvPersonID},{SalesLoginID},{PayType},N'{PayItemID}',{PayAgentID},{PayAgentBranchID},{(LimitDate == null ? "NULL" : LimitDate.ToSqlValue())},{(RoomAssign ? 1 : 0)},{(CreateDate == null ? "NULL" : CConvert.ToSqlValue(CreateDate.ToDateTime()))},{CreateLoginID},N'{CreatePcName}',{CreateClass},GETDATE(),{UpdateLoginID},N'{UpdatePcName}',{UpdateClass},{UpdateID});";
+ }
+
+ public string UpdateSql()
+ {
+ return $@"UPDATE D_UseDetail SET UseStatus = {UseStatus},SubStatus = {SubStatus},ExtenStatus = {ExtenStatus},CinDate = {(CinDate == null ? "NULL" : CinDate.ToSqlValue())},CinTime = {CinTime},Stay = {Stay},CoutDate = {(CoutDate == null ? "NULL" : CoutDate.ToSqlValue())},CoutTime = {CoutTime},AgentID = {AgentID},AgentBranchID = {AgentBranchID},ResvNo = N'{ResvNo}',ResvDate = {(ResvDate == null ? "NULL" : CConvert.ToSqlValue(ResvDate.ToDateTime()))},ResvHotelDate = {(ResvHotelDate == null ? "NULL" : ResvHotelDate.ToSqlValue())},ResvType = {ResvType},ResvPersonID = {ResvPersonID},SalesLoginID = {SalesLoginID},PayType = {PayType},PayItemID = N'{PayItemID}',PayAgentID = {PayAgentID},PayAgentBranchID = {PayAgentBranchID},LimitDate = {(LimitDate == null ? "NULL" : LimitDate.ToSqlValue())},RoomAssign = {(RoomAssign ? 1 : 0)},CreateDate = {(CreateDate == null ? "NULL" : CConvert.ToSqlValue(CreateDate.ToDateTime()))},CreateLoginID = {CreateLoginID},CreatePcName = N'{CreatePcName}',CreateClass = {CreateClass},UpdateDate = GETDATE(),UpdateLoginID = {UpdateLoginID},UpdatePcName = N'{UpdatePcName}',UpdateClass = {UpdateClass},UpdateID = {UpdateID} WHERE ID = {ID} AND DetailID = {DetailID};";
+ }
+
+ public string ToText()
+ {
+ StringBuilder text = new StringBuilder();
+ text.AppendFormat("ID={0};", ID);
+ text.AppendFormat("DetailID={0};", DetailID);
+ text.AppendFormat("UseStatus={0};", UseStatus);
+ text.AppendFormat("SubStatus={0};", SubStatus);
+ text.AppendFormat("ExtenStatus={0};", ExtenStatus);
+ text.AppendFormat("CinDate={0};", CinDate);
+ text.AppendFormat("CinTime={0};", CinTime);
+ text.AppendFormat("Stay={0};", Stay);
+ text.AppendFormat("CoutDate={0};", CoutDate);
+ text.AppendFormat("CoutTime={0};", CoutTime);
+ text.AppendFormat("AgentID={0};", AgentID);
+ text.AppendFormat("AgentBranchID={0};", AgentBranchID);
+ text.AppendFormat("ResvNo={0};", ResvNo);
+ text.AppendFormat("ResvDate={0};", ResvDate);
+ text.AppendFormat("ResvHotelDate={0};", ResvHotelDate);
+ text.AppendFormat("ResvType={0};", ResvType);
+ text.AppendFormat("ResvPersonID={0};", ResvPersonID);
+ text.AppendFormat("SalesLoginID={0};", SalesLoginID);
+ text.AppendFormat("PayType={0};", PayType);
+ text.AppendFormat("PayItemID={0};", PayItemID);
+ text.AppendFormat("PayAgentID={0};", PayAgentID);
+ text.AppendFormat("PayAgentBranchID={0};", PayAgentBranchID);
+ text.AppendFormat("LimitDate={0};", LimitDate);
+ text.AppendFormat("RoomAssign={0};", RoomAssign);
+ text.AppendFormat("CreateDate={0};", CreateDate);
+ text.AppendFormat("CreateLoginID={0};", CreateLoginID);
+ text.AppendFormat("CreatePcName={0};", CreatePcName);
+ text.AppendFormat("CreateClass={0};", CreateClass);
+ text.AppendFormat("UpdateDate={0};", UpdateDate);
+ text.AppendFormat("UpdateLoginID={0};", UpdateLoginID);
+ text.AppendFormat("UpdatePcName={0};", UpdatePcName);
+ text.AppendFormat("UpdateClass={0};", UpdateClass);
+ text.AppendFormat("UpdateID={0};", UpdateID);
+
+ return text.ToString();
+ }
+
+ public override object GetField(string name)
+ {
+
+ if (name == "ID") { return ID; }
+ else if (name == "DetailID") { return DetailID; }
+ else if (name == "UseStatus") { return UseStatus; }
+ else if (name == "SubStatus") { return SubStatus; }
+ else if (name == "ExtenStatus") { return ExtenStatus; }
+ else if (name == "CinDate") { return CinDate; }
+ else if (name == "CinTime") { return CinTime; }
+ else if (name == "Stay") { return Stay; }
+ else if (name == "CoutDate") { return CoutDate; }
+ else if (name == "CoutTime") { return CoutTime; }
+ else if (name == "AgentID") { return AgentID; }
+ else if (name == "AgentBranchID") { return AgentBranchID; }
+ else if (name == "ResvNo") { return ResvNo; }
+ else if (name == "ResvDate") { return ResvDate; }
+ else if (name == "ResvHotelDate") { return ResvHotelDate; }
+ else if (name == "ResvType") { return ResvType; }
+ else if (name == "ResvPersonID") { return ResvPersonID; }
+ else if (name == "SalesLoginID") { return SalesLoginID; }
+ else if (name == "PayType") { return PayType; }
+ else if (name == "PayItemID") { return PayItemID; }
+ else if (name == "PayAgentID") { return PayAgentID; }
+ else if (name == "PayAgentBranchID") { return PayAgentBranchID; }
+ else if (name == "LimitDate") { return LimitDate; }
+ else if (name == "RoomAssign") { return RoomAssign; }
+ else if (name == "CreateDate") { return CreateDate; }
+ else if (name == "CreateLoginID") { return CreateLoginID; }
+ else if (name == "CreatePcName") { return CreatePcName; }
+ else if (name == "CreateClass") { return CreateClass; }
+ else if (name == "UpdateDate") { return UpdateDate; }
+ else if (name == "UpdateLoginID") { return UpdateLoginID; }
+ else if (name == "UpdatePcName") { return UpdatePcName; }
+ else if (name == "UpdateClass") { return UpdateClass; }
+ else if (name == "UpdateID") { return UpdateID; }
+ else { return null; }
+ }
+
+ public override bool SetField(string name, object value)
+ {
+
+ if (name == "ID") { ID = CConvert.ToInt(value); return true; }
+ else if (name == "DetailID") { DetailID = CConvert.ToInt(value); return true; }
+ else if (name == "UseStatus") { UseStatus = CConvert.ToInt(value); return true; }
+ else if (name == "SubStatus") { SubStatus = CConvert.ToInt(value); return true; }
+ else if (name == "ExtenStatus") { ExtenStatus = CConvert.ToInt(value); return true; }
+ else if (name == "CinDate") { CinDate = new Date(CConvert.ToDateInt(value)); return true; }
+ else if (name == "CinTime") { CinTime = CConvert.ToInt(value); return true; }
+ else if (name == "Stay") { Stay = CConvert.ToInt(value); return true; }
+ else if (name == "CoutDate") { CoutDate = new Date(CConvert.ToDateInt(value)); return true; }
+ else if (name == "CoutTime") { CoutTime = CConvert.ToInt(value); return true; }
+ else if (name == "AgentID") { AgentID = CConvert.ToInt(value); return true; }
+ else if (name == "AgentBranchID") { AgentBranchID = CConvert.ToInt(value); return true; }
+ else if (name == "ResvNo") { ResvNo = value.ToString(); return true; }
+ else if (name == "ResvDate") { ResvDate = CConvert.ToTimestamp(CConvert.ToDateTime(value)); return true; }
+ else if (name == "ResvHotelDate") { ResvHotelDate = new Date(CConvert.ToDateInt(value)); return true; }
+ else if (name == "ResvType") { ResvType = CConvert.ToInt(value); return true; }
+ else if (name == "ResvPersonID") { ResvPersonID = CConvert.ToInt(value); return true; }
+ else if (name == "SalesLoginID") { SalesLoginID = CConvert.ToInt(value); return true; }
+ else if (name == "PayType") { PayType = CConvert.ToInt(value); return true; }
+ else if (name == "PayItemID") { PayItemID = value.ToString(); return true; }
+ else if (name == "PayAgentID") { PayAgentID = CConvert.ToInt(value); return true; }
+ else if (name == "PayAgentBranchID") { PayAgentBranchID = CConvert.ToInt(value); return true; }
+ else if (name == "LimitDate") { LimitDate = new Date(CConvert.ToDateInt(value)); return true; }
+ else if (name == "RoomAssign") { RoomAssign = CConvert.ToBool(value); return true; }
+ else if (name == "CreateDate") { CreateDate = CConvert.ToTimestamp(CConvert.ToDateTime(value)); return true; }
+ else if (name == "CreateLoginID") { CreateLoginID = CConvert.ToInt(value); return true; }
+ else if (name == "CreatePcName") { CreatePcName = value.ToString(); return true; }
+ else if (name == "CreateClass") { CreateClass = CConvert.ToInt(value); return true; }
+ else if (name == "UpdateDate") { UpdateDate = CConvert.ToTimestamp(CConvert.ToDateTime(value)); return true; }
+ else if (name == "UpdateLoginID") { UpdateLoginID = CConvert.ToInt(value); return true; }
+ else if (name == "UpdatePcName") { UpdatePcName = value.ToString(); return true; }
+ else if (name == "UpdateClass") { UpdateClass = CConvert.ToInt(value); return true; }
+ else if (name == "UpdateID") { UpdateID = CConvert.ToInt(value); return true; }
+ else { return false; }
+ }
+
+ #endregion
+}
\ No newline at end of file
diff --git a/ProtosExpan/UseInfo/UseFree.cs b/ProtosExpan/UseInfo/UseFree.cs
new file mode 100644
index 0000000..21d2f8f
--- /dev/null
+++ b/ProtosExpan/UseInfo/UseFree.cs
@@ -0,0 +1,170 @@
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Text;
+using HotelPms.Share.Data;
+using HotelPms.Share.Util;
+using Google.Protobuf.WellKnownTypes;
+using customTypes;
+using System.Data.Common;
+
+namespace HotelPms.Data.UseInfo;
+
+/// ****************************** Description *******************************
+/// ◇システム名称
+/// ホテルPMS
+/// ◇概要
+///
+/// ◇履歴
+/// 2021/05/14 コード作成ツール 自動作成
+/// ****************************** Declarations ******************************
+[Serializable()]
+public partial class UseFree : RecordBase
+{
+ #region ★★★★★ Property ★★★★★
+
+ public static ConcurrentDictionary<string, int> PrimaryKey { get; } = new ConcurrentDictionary<string, int>();
+
+ #endregion
+
+ partial void OnConstruction()
+ {
+ if (PrimaryKey.Count == 0)
+ {
+ PrimaryKey.TryAdd("ID", 0);
+ PrimaryKey.TryAdd("DetailID", 0);
+ PrimaryKey.TryAdd("UseDate", 0);
+ PrimaryKey.TryAdd("TypeID", 0);
+
+ }
+ }
+
+ #region ★★★★★ Function ★★★★★
+
+ public bool CompareTo(UseFree item)
+ {
+ if (ID.CompareTo(item.ID) != 0
+ || DetailID.CompareTo(item.DetailID) != 0
+ || UseDate.CompareTo(item.UseDate) != 0
+ || TypeID.CompareTo(item.TypeID) != 0
+ || DataValue.CompareTo(item.DataValue) != 0
+)
+ {
+ return false;
+ }
+ return true;
+ }
+
+
+ public override void CopyTo(object dest)
+ {
+ UseFree item = dest as UseFree;
+ item.ID = ID;
+ item.DetailID = DetailID;
+ item.UseDate = UseDate;
+ item.TypeID = TypeID;
+ item.DataValue = DataValue;
+
+ }
+
+ public override void Clear()
+ {
+ ID = 0;
+ DetailID = 0;
+ UseDate = Date.Default;
+ TypeID = 0;
+ DataValue = string.Empty;
+
+ }
+
+ public UseFree DeepClone()
+ {
+ UseFree item = new UseFree();
+ item.ID = ID;
+ item.DetailID = DetailID;
+ item.UseDate = UseDate;
+ item.TypeID = TypeID;
+ item.DataValue = DataValue;
+
+ return item;
+ }
+
+ public override bool ConvertDataRow(System.Data.DataRow row)
+ {
+ ID = CConvert.ToInt(row["ID"],ID);
+ DetailID = CConvert.ToInt(row["DetailID"],DetailID);
+ UseDate = new Date(row.IsNull("UseDate") ? 0 : CConvert.ToDateInt((System.DateTime)row["UseDate"]));
+ TypeID = CConvert.ToInt(row["TypeID"],TypeID);
+ DataValue = row["DataValue"].ToString();
+
+ return true;
+ }
+
+ public void ToDataRow(System.Data.DataRow row)
+ {
+ row["ID"] = ID;
+ row["DetailID"] = DetailID;
+ row["UseDate"] = UseDate.ToDateTime();
+ row["TypeID"] = TypeID;
+ row["DataValue"] = DataValue;
+
+ }
+
+ public void ConvertReader(DbDataReader row)
+ {
+ int i = 0;
+ ID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ DetailID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ UseDate = new Date(row.IsDBNull(i) ? 0 : CConvert.ToDateInt(row.GetDateTime(i))); i++;
+ TypeID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ DataValue = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+
+ }
+
+ public string AddSql()
+ {
+ return $@"INSERT INTO D_UseFree(ID,DetailID,UseDate,TypeID,DataValue) VALUES({ID},{DetailID},{(UseDate == null ? "NULL" : UseDate.ToSqlValue())},{TypeID},N'{DataValue}');";
+ }
+
+ public string UpdateSql()
+ {
+ return $@"UPDATE D_UseFree SET DataValue = N'{DataValue}' WHERE ID = {ID} AND DetailID = {DetailID} AND UseDate = {(UseDate == null ? "NULL" : UseDate.ToSqlValue())} AND TypeID = {TypeID};";
+ }
+
+ public string ToText()
+ {
+ StringBuilder text = new StringBuilder();
+ text.AppendFormat("ID={0};", ID);
+ text.AppendFormat("DetailID={0};", DetailID);
+ text.AppendFormat("UseDate={0};", UseDate);
+ text.AppendFormat("TypeID={0};", TypeID);
+ text.AppendFormat("DataValue={0};", DataValue);
+
+ return text.ToString();
+ }
+
+ public override object GetField(string name)
+ {
+
+ if (name == "ID") { return ID; }
+ else if (name == "DetailID") { return DetailID; }
+ else if (name == "UseDate") { return UseDate; }
+ else if (name == "TypeID") { return TypeID; }
+ else if (name == "DataValue") { return DataValue; }
+ else { return null; }
+ }
+
+ public override bool SetField(string name, object value)
+ {
+
+ if (name == "ID") { ID = CConvert.ToInt(value); return true; }
+ else if (name == "DetailID") { DetailID = CConvert.ToInt(value); return true; }
+ else if (name == "UseDate") { UseDate = new Date(CConvert.ToDateInt(value)); return true; }
+ else if (name == "TypeID") { TypeID = CConvert.ToInt(value); return true; }
+ else if (name == "DataValue") { DataValue = value.ToString(); return true; }
+ else { return false; }
+ }
+
+ #endregion
+}
\ No newline at end of file
diff --git a/ProtosExpan/UseInfo/UseMemo.cs b/ProtosExpan/UseInfo/UseMemo.cs
new file mode 100644
index 0000000..e4357f2
--- /dev/null
+++ b/ProtosExpan/UseInfo/UseMemo.cs
@@ -0,0 +1,169 @@
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Text;
+using HotelPms.Share.Data;
+using HotelPms.Share.Util;
+using Google.Protobuf.WellKnownTypes;
+using customTypes;
+using System.Data.Common;
+
+namespace HotelPms.Data.UseInfo;
+
+/// ****************************** Description *******************************
+/// ◇システム名称
+/// ホテルPMS
+/// ◇概要
+///
+/// ◇履歴
+/// 2021/05/14 コード作成ツール 自動作成
+/// ****************************** Declarations ******************************
+[Serializable()]
+public partial class UseMemo : RecordBase
+{
+ #region ★★★★★ Property ★★★★★
+
+ public static ConcurrentDictionary<string, int> PrimaryKey { get; } = new ConcurrentDictionary<string, int>();
+
+ #endregion
+
+ partial void OnConstruction()
+ {
+ if (PrimaryKey.Count == 0)
+ {
+ PrimaryKey.TryAdd("ID", 0);
+ PrimaryKey.TryAdd("DetailID", 0);
+ PrimaryKey.TryAdd("TypeID", 0);
+
+ }
+ }
+
+ #region ★★★★★ Function ★★★★★
+
+ public bool CompareTo(UseMemo item)
+ {
+ if (ID.CompareTo(item.ID) != 0
+ || DetailID.CompareTo(item.DetailID) != 0
+ || TypeID.CompareTo(item.TypeID) != 0
+ || Context.CompareTo(item.Context) != 0
+ || Alert.CompareTo(item.Alert) != 0
+)
+ {
+ return false;
+ }
+ return true;
+ }
+
+
+ public override void CopyTo(object dest)
+ {
+ UseMemo item = dest as UseMemo;
+ item.ID = ID;
+ item.DetailID = DetailID;
+ item.TypeID = TypeID;
+ item.Context = Context;
+ item.Alert = Alert;
+
+ }
+
+ public override void Clear()
+ {
+ ID = 0;
+ DetailID = 0;
+ TypeID = 0;
+ Context = string.Empty;
+ Alert = false;
+
+ }
+
+ public UseMemo DeepClone()
+ {
+ UseMemo item = new UseMemo();
+ item.ID = ID;
+ item.DetailID = DetailID;
+ item.TypeID = TypeID;
+ item.Context = Context;
+ item.Alert = Alert;
+
+ return item;
+ }
+
+ public override bool ConvertDataRow(System.Data.DataRow row)
+ {
+ ID = CConvert.ToInt(row["ID"],ID);
+ DetailID = CConvert.ToInt(row["DetailID"],DetailID);
+ TypeID = CConvert.ToInt(row["TypeID"],TypeID);
+ Context = row["Context"].ToString();
+ Alert = CConvert.ToBool(row["Alert"]);
+
+ return true;
+ }
+
+ public void ToDataRow(System.Data.DataRow row)
+ {
+ row["ID"] = ID;
+ row["DetailID"] = DetailID;
+ row["TypeID"] = TypeID;
+ row["Context"] = Context;
+ row["Alert"] = Alert;
+
+ }
+
+ public void ConvertReader(DbDataReader row)
+ {
+ int i = 0;
+ ID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ DetailID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ TypeID = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ Context = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ Alert = (bool)(row.IsDBNull(i) ? false : row.GetBoolean(i)); i++;
+
+ }
+
+ public string AddSql()
+ {
+ return $@"INSERT INTO D_UseMemo(ID,DetailID,TypeID,Context,Alert) VALUES({ID},{DetailID},{TypeID},N'{Context}',{(Alert ? 1 : 0)});";
+ }
+
+ public string UpdateSql()
+ {
+ return $@"UPDATE D_UseMemo SET Context = N'{Context}',Alert = {(Alert ? 1 : 0)} WHERE ID = {ID} AND DetailID = {DetailID} AND TypeID = {TypeID};";
+ }
+
+ public string ToText()
+ {
+ StringBuilder text = new StringBuilder();
+ text.AppendFormat("ID={0};", ID);
+ text.AppendFormat("DetailID={0};", DetailID);
+ text.AppendFormat("TypeID={0};", TypeID);
+ text.AppendFormat("Context={0};", Context);
+ text.AppendFormat("Alert={0};", Alert);
+
+ return text.ToString();
+ }
+
+ public override object GetField(string name)
+ {
+
+ if (name == "ID") { return ID; }
+ else if (name == "DetailID") { return DetailID; }
+ else if (name == "TypeID") { return TypeID; }
+ else if (name == "Context") { return Context; }
+ else if (name == "Alert") { return Alert; }
+ else { return null; }
+ }
+
+ public override bool SetField(string name, object value)
+ {
+
+ if (name == "ID") { ID = CConvert.ToInt(value); return true; }
+ else if (name == "DetailID") { DetailID = CConvert.ToInt(value); return true; }
+ else if (name == "TypeID") { TypeID = CConvert.ToInt(value); return true; }
+ else if (name == "Context") { Context = value.ToString(); return true; }
+ else if (name == "Alert") { Alert = CConvert.ToBool(value); return true; }
+ else { return false; }
+ }
+
+ #endregion
+}
\ No newline at end of file
diff --git a/ProtosExpan/UseInfo/UsePerson.cs b/ProtosExpan/UseInfo/UsePerson.cs
new file mode 100644
index 0000000..fc3c59b
--- /dev/null
+++ b/ProtosExpan/UseInfo/UsePerson.cs
@@ -0,0 +1,428 @@
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Text;
+using HotelPms.Share.Data;
+using HotelPms.Share.Util;
+using Google.Protobuf.WellKnownTypes;
+using customTypes;
+using System.Data.Common;
+
+namespace HotelPms.Data.UseInfo;
+
+/// ****************************** Description *******************************
+/// ◇システム名称
+/// ホテルPMS
+/// ◇概要
+///
+/// ◇履歴
+/// 2021/05/14 コード作成ツール 自動作成
+/// ****************************** Declarations ******************************
+[Serializable()]
+public partial class UsePerson : RecordBase
+{
+ #region ★★★★★ Property ★★★★★
+
+ public static ConcurrentDictionary<string, int> PrimaryKey { get; } = new ConcurrentDictionary<string, int>();
+
+ #endregion
+
+ partial void OnConstruction()
+ {
+ if (PrimaryKey.Count == 0)
+ {
+ PrimaryKey.TryAdd("ID", 0);
+ PrimaryKey.TryAdd("PersonID", 0);
+
+ }
+ }
+
+ #region ★★★★★ Function ★★★★★
+
+ public bool CompareTo(UsePerson item)
+ {
+ if (ID.CompareTo(item.ID) != 0
+ || PersonID.CompareTo(item.PersonID) != 0
+ || CustomerID.CompareTo(item.CustomerID) != 0
+ || MemberNo.CompareTo(item.MemberNo) != 0
+ || Kana.CompareTo(item.Kana) != 0
+ || Name.CompareTo(item.Name) != 0
+ || ReceiptName.CompareTo(item.ReceiptName) != 0
+ || ZipCode.CompareTo(item.ZipCode) != 0
+ || Prefecture.CompareTo(item.Prefecture) != 0
+ || Address2.CompareTo(item.Address2) != 0
+ || Address3.CompareTo(item.Address3) != 0
+ || Address4.CompareTo(item.Address4) != 0
+ || Mail.CompareTo(item.Mail) != 0
+ || PassportNo.CompareTo(item.PassportNo) != 0
+ || Sex.CompareTo(item.Sex) != 0
+ || BirthDay.CompareTo(item.BirthDay) != 0
+ || Anniversary.CompareTo(item.Anniversary) != 0
+ || CharacterType.CompareTo(item.CharacterType) != 0
+ || RankID.CompareTo(item.RankID) != 0
+ || CorpID.CompareTo(item.CorpID) != 0
+ || CorpKana.CompareTo(item.CorpKana) != 0
+ || CorpName.CompareTo(item.CorpName) != 0
+ || CorpZipCode.CompareTo(item.CorpZipCode) != 0
+ || CorpPrefecture.CompareTo(item.CorpPrefecture) != 0
+ || CorpAddress2.CompareTo(item.CorpAddress2) != 0
+ || CorpAddress3.CompareTo(item.CorpAddress3) != 0
+ || CorpAddress4.CompareTo(item.CorpAddress4) != 0
+ || CorpMail.CompareTo(item.CorpMail) != 0
+ || HonorificTitleID.CompareTo(item.HonorificTitleID) != 0
+ || Memo.CompareTo(item.Memo) != 0
+ || AreaID.CompareTo(item.AreaID) != 0
+)
+ {
+ return false;
+ }
+ return true;
+ }
+
+
+ public override void CopyTo(object dest)
+ {
+ UsePerson item = dest as UsePerson;
+ item.ID = ID;
+ item.PersonID = PersonID;
+ item.CustomerID = CustomerID;
+ item.MemberNo = MemberNo;
+ item.Kana = Kana;
+ item.Name = Name;
+ item.ReceiptName = ReceiptName;
+ item.ZipCode = ZipCode;
+ item.Prefecture = Prefecture;
+ item.Address2 = Address2;
+ item.Address3 = Address3;
+ item.Address4 = Address4;
+ item.Mail = Mail;
+ item.PassportNo = PassportNo;
+ item.Sex = Sex;
+ item.BirthDay = BirthDay;
+ item.Anniversary = Anniversary;
+ item.CharacterType = CharacterType;
+ item.RankID = RankID;
+ item.CorpID = CorpID;
+ item.CorpKana = CorpKana;
+ item.CorpName = CorpName;
+ item.CorpZipCode = CorpZipCode;
+ item.CorpPrefecture = CorpPrefecture;
+ item.CorpAddress2 = CorpAddress2;
+ item.CorpAddress3 = CorpAddress3;
+ item.CorpAddress4 = CorpAddress4;
+ item.CorpMail = CorpMail;
+ item.HonorificTitleID = HonorificTitleID;
+ item.Memo = Memo;
+ item.AreaID = AreaID;
+
+ }
+
+ public override void Clear()
+ {
+ ID = 0;
+ PersonID = 0;
+ CustomerID = 0;
+ MemberNo = string.Empty;
+ Kana = string.Empty;
+ Name = string.Empty;
+ ReceiptName = string.Empty;
+ ZipCode = string.Empty;
+ Prefecture = string.Empty;
+ Address2 = string.Empty;
+ Address3 = string.Empty;
+ Address4 = string.Empty;
+ Mail = string.Empty;
+ PassportNo = string.Empty;
+ Sex = 0;
+ BirthDay = Date.Default;
+ Anniversary = Date.Default;
+ CharacterType = 0;
+ RankID = 0;
+ CorpID = 0;
+ CorpKana = string.Empty;
+ CorpName = string.Empty;
+ CorpZipCode = string.Empty;
+ CorpPrefecture = string.Empty;
+ CorpAddress2 = string.Empty;
+ CorpAddress3 = string.Empty;
+ CorpAddress4 = string.Empty;
+ CorpMail = string.Empty;
+ HonorificTitleID = 0;
+ Memo = string.Empty;
+ AreaID = 0;
+
+ }
+
+ public UsePerson DeepClone()
+ {
+ UsePerson item = new UsePerson();
+ item.ID = ID;
+ item.PersonID = PersonID;
+ item.CustomerID = CustomerID;
+ item.MemberNo = MemberNo;
+ item.Kana = Kana;
+ item.Name = Name;
+ item.ReceiptName = ReceiptName;
+ item.ZipCode = ZipCode;
+ item.Prefecture = Prefecture;
+ item.Address2 = Address2;
+ item.Address3 = Address3;
+ item.Address4 = Address4;
+ item.Mail = Mail;
+ item.PassportNo = PassportNo;
+ item.Sex = Sex;
+ item.BirthDay = BirthDay;
+ item.Anniversary = Anniversary;
+ item.CharacterType = CharacterType;
+ item.RankID = RankID;
+ item.CorpID = CorpID;
+ item.CorpKana = CorpKana;
+ item.CorpName = CorpName;
+ item.CorpZipCode = CorpZipCode;
+ item.CorpPrefecture = CorpPrefecture;
+ item.CorpAddress2 = CorpAddress2;
+ item.CorpAddress3 = CorpAddress3;
+ item.CorpAddress4 = CorpAddress4;
+ item.CorpMail = CorpMail;
+ item.HonorificTitleID = HonorificTitleID;
+ item.Memo = Memo;
+ item.AreaID = AreaID;
+
+ return item;
+ }
+
+ public override bool ConvertDataRow(System.Data.DataRow row)
+ {
+ ID = CConvert.ToInt(row["ID"],ID);
+ PersonID = CConvert.ToInt(row["PersonID"],PersonID);
+ CustomerID = CConvert.ToInt(row["CustomerID"],CustomerID);
+ MemberNo = row["MemberNo"].ToString();
+ Kana = row["Kana"].ToString();
+ Name = row["Name"].ToString();
+ ReceiptName = row["ReceiptName"].ToString();
+ ZipCode = row["ZipCode"].ToString();
+ Prefecture = row["Prefecture"].ToString();
+ Address2 = row["Address2"].ToString();
+ Address3 = row["Address3"].ToString();
+ Address4 = row["Address4"].ToString();
+ Mail = row["Mail"].ToString();
+ PassportNo = row["PassportNo"].ToString();
+ Sex = CConvert.ToInt(row["Sex"],Sex);
+ BirthDay = new Date(row.IsNull("BirthDay") ? 0 : CConvert.ToDateInt((System.DateTime)row["BirthDay"]));
+ Anniversary = new Date(row.IsNull("Anniversary") ? 0 : CConvert.ToDateInt((System.DateTime)row["Anniversary"]));
+ CharacterType = CConvert.ToInt(row["CharacterType"],CharacterType);
+ RankID = CConvert.ToInt(row["RankID"],RankID);
+ CorpID = CConvert.ToInt(row["CorpID"],CorpID);
+ CorpKana = row["CorpKana"].ToString();
+ CorpName = row["CorpName"].ToString();
+ CorpZipCode = row["CorpZipCode"].ToString();
+ CorpPrefecture = row["CorpPrefecture"].ToString();
+ CorpAddress2 = row["CorpAddress2"].ToString();
+ CorpAddress3 = row["CorpAddress3"].ToString();
+ CorpAddress4 = row["CorpAddress4"].ToString();
+ CorpMail = row["CorpMail"].ToString();
+ HonorificTitleID = CConvert.ToInt(row["HonorificTitleID"],HonorificTitleID);
+ Memo = row["Memo"].ToString();
+ AreaID = CConvert.ToInt(row["AreaID"],AreaID);
+
+ return true;
+ }
+
+ public void ToDataRow(System.Data.DataRow row)
+ {
+ row["ID"] = ID;
+ row["PersonID"] = PersonID;
+ row["CustomerID"] = CustomerID;
+ row["MemberNo"] = MemberNo;
+ row["Kana"] = Kana;
+ row["Name"] = Name;
+ row["ReceiptName"] = ReceiptName;
+ row["ZipCode"] = ZipCode;
+ row["Prefecture"] = Prefecture;
+ row["Address2"] = Address2;
+ row["Address3"] = Address3;
+ row["Address4"] = Address4;
+ row["Mail"] = Mail;
+ row["PassportNo"] = PassportNo;
+ row["Sex"] = Sex;
+ row["BirthDay"] = BirthDay.ToDateTime();
+ row["Anniversary"] = Anniversary.ToDateTime();
+ row["CharacterType"] = CharacterType;
+ row["RankID"] = RankID;
+ row["CorpID"] = CorpID;
+ row["CorpKana"] = CorpKana;
+ row["CorpName"] = CorpName;
+ row["CorpZipCode"] = CorpZipCode;
+ row["CorpPrefecture"] = CorpPrefecture;
+ row["CorpAddress2"] = CorpAddress2;
+ row["CorpAddress3"] = CorpAddress3;
+ row["CorpAddress4"] = CorpAddress4;
+ row["CorpMail"] = CorpMail;
+ row["HonorificTitleID"] = HonorificTitleID;
+ row["Memo"] = Memo;
+ row["AreaID"] = AreaID;
+
+ }
+
+ public void ConvertReader(DbDataReader row)
+ {
+ int i = 0;
+ ID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ PersonID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ CustomerID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ MemberNo = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ Kana = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ Name = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ ReceiptName = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ ZipCode = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ Prefecture = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ Address2 = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ Address3 = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ Address4 = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ Mail = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ PassportNo = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ Sex = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ BirthDay = new Date(row.IsDBNull(i) ? 0 : CConvert.ToDateInt(row.GetDateTime(i))); i++;
+ Anniversary = new Date(row.IsDBNull(i) ? 0 : CConvert.ToDateInt(row.GetDateTime(i))); i++;
+ CharacterType = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ RankID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ CorpID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ CorpKana = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ CorpName = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ CorpZipCode = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ CorpPrefecture = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ CorpAddress2 = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ CorpAddress3 = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ CorpAddress4 = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ CorpMail = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ HonorificTitleID = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ Memo = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ AreaID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+
+ }
+
+ public string AddSql()
+ {
+ return $@"INSERT INTO D_UsePerson(ID,PersonID,CustomerID,MemberNo,Kana,Name,ReceiptName,ZipCode,Prefecture,Address2,Address3,Address4,Mail,PassportNo,Sex,BirthDay,Anniversary,CharacterType,RankID,CorpID,CorpKana,CorpName,CorpZipCode,CorpPrefecture,CorpAddress2,CorpAddress3,CorpAddress4,CorpMail,HonorificTitleID,Memo,AreaID) VALUES({ID},{PersonID},{CustomerID},N'{MemberNo}',N'{Kana}',N'{Name}',N'{ReceiptName}',N'{ZipCode}',N'{Prefecture}',N'{Address2}',N'{Address3}',N'{Address4}',N'{Mail}',N'{PassportNo}',{Sex},{(BirthDay == null ? "NULL" : BirthDay.ToSqlValue())},{(Anniversary == null ? "NULL" : Anniversary.ToSqlValue())},{CharacterType},{RankID},{CorpID},N'{CorpKana}',N'{CorpName}',N'{CorpZipCode}',N'{CorpPrefecture}',N'{CorpAddress2}',N'{CorpAddress3}',N'{CorpAddress4}',N'{CorpMail}',{HonorificTitleID},N'{Memo}',{AreaID});";
+ }
+
+ public string UpdateSql()
+ {
+ return $@"UPDATE D_UsePerson SET CustomerID = {CustomerID},MemberNo = N'{MemberNo}',Kana = N'{Kana}',Name = N'{Name}',ReceiptName = N'{ReceiptName}',ZipCode = N'{ZipCode}',Prefecture = N'{Prefecture}',Address2 = N'{Address2}',Address3 = N'{Address3}',Address4 = N'{Address4}',Mail = N'{Mail}',PassportNo = N'{PassportNo}',Sex = {Sex},BirthDay = {(BirthDay == null ? "NULL" : BirthDay.ToSqlValue())},Anniversary = {(Anniversary == null ? "NULL" : Anniversary.ToSqlValue())},CharacterType = {CharacterType},RankID = {RankID},CorpID = {CorpID},CorpKana = N'{CorpKana}',CorpName = N'{CorpName}',CorpZipCode = N'{CorpZipCode}',CorpPrefecture = N'{CorpPrefecture}',CorpAddress2 = N'{CorpAddress2}',CorpAddress3 = N'{CorpAddress3}',CorpAddress4 = N'{CorpAddress4}',CorpMail = N'{CorpMail}',HonorificTitleID = {HonorificTitleID},Memo = N'{Memo}',AreaID = {AreaID} WHERE ID = {ID} AND PersonID = {PersonID};";
+ }
+
+ public string ToText()
+ {
+ StringBuilder text = new StringBuilder();
+ text.AppendFormat("ID={0};", ID);
+ text.AppendFormat("PersonID={0};", PersonID);
+ text.AppendFormat("CustomerID={0};", CustomerID);
+ text.AppendFormat("MemberNo={0};", MemberNo);
+ text.AppendFormat("Kana={0};", Kana);
+ text.AppendFormat("Name={0};", Name);
+ text.AppendFormat("ReceiptName={0};", ReceiptName);
+ text.AppendFormat("ZipCode={0};", ZipCode);
+ text.AppendFormat("Prefecture={0};", Prefecture);
+ text.AppendFormat("Address2={0};", Address2);
+ text.AppendFormat("Address3={0};", Address3);
+ text.AppendFormat("Address4={0};", Address4);
+ text.AppendFormat("Mail={0};", Mail);
+ text.AppendFormat("PassportNo={0};", PassportNo);
+ text.AppendFormat("Sex={0};", Sex);
+ text.AppendFormat("BirthDay={0};", BirthDay);
+ text.AppendFormat("Anniversary={0};", Anniversary);
+ text.AppendFormat("CharacterType={0};", CharacterType);
+ text.AppendFormat("RankID={0};", RankID);
+ text.AppendFormat("CorpID={0};", CorpID);
+ text.AppendFormat("CorpKana={0};", CorpKana);
+ text.AppendFormat("CorpName={0};", CorpName);
+ text.AppendFormat("CorpZipCode={0};", CorpZipCode);
+ text.AppendFormat("CorpPrefecture={0};", CorpPrefecture);
+ text.AppendFormat("CorpAddress2={0};", CorpAddress2);
+ text.AppendFormat("CorpAddress3={0};", CorpAddress3);
+ text.AppendFormat("CorpAddress4={0};", CorpAddress4);
+ text.AppendFormat("CorpMail={0};", CorpMail);
+ text.AppendFormat("HonorificTitleID={0};", HonorificTitleID);
+ text.AppendFormat("Memo={0};", Memo);
+ text.AppendFormat("AreaID={0};", AreaID);
+
+ return text.ToString();
+ }
+
+ public override object GetField(string name)
+ {
+
+ if (name == "ID") { return ID; }
+ else if (name == "PersonID") { return PersonID; }
+ else if (name == "CustomerID") { return CustomerID; }
+ else if (name == "MemberNo") { return MemberNo; }
+ else if (name == "Kana") { return Kana; }
+ else if (name == "Name") { return Name; }
+ else if (name == "ReceiptName") { return ReceiptName; }
+ else if (name == "ZipCode") { return ZipCode; }
+ else if (name == "Prefecture") { return Prefecture; }
+ else if (name == "Address2") { return Address2; }
+ else if (name == "Address3") { return Address3; }
+ else if (name == "Address4") { return Address4; }
+ else if (name == "Mail") { return Mail; }
+ else if (name == "PassportNo") { return PassportNo; }
+ else if (name == "Sex") { return Sex; }
+ else if (name == "BirthDay") { return BirthDay; }
+ else if (name == "Anniversary") { return Anniversary; }
+ else if (name == "CharacterType") { return CharacterType; }
+ else if (name == "RankID") { return RankID; }
+ else if (name == "CorpID") { return CorpID; }
+ else if (name == "CorpKana") { return CorpKana; }
+ else if (name == "CorpName") { return CorpName; }
+ else if (name == "CorpZipCode") { return CorpZipCode; }
+ else if (name == "CorpPrefecture") { return CorpPrefecture; }
+ else if (name == "CorpAddress2") { return CorpAddress2; }
+ else if (name == "CorpAddress3") { return CorpAddress3; }
+ else if (name == "CorpAddress4") { return CorpAddress4; }
+ else if (name == "CorpMail") { return CorpMail; }
+ else if (name == "HonorificTitleID") { return HonorificTitleID; }
+ else if (name == "Memo") { return Memo; }
+ else if (name == "AreaID") { return AreaID; }
+ else { return null; }
+ }
+
+ public override bool SetField(string name, object value)
+ {
+
+ if (name == "ID") { ID = CConvert.ToInt(value); return true; }
+ else if (name == "PersonID") { PersonID = CConvert.ToInt(value); return true; }
+ else if (name == "CustomerID") { CustomerID = CConvert.ToInt(value); return true; }
+ else if (name == "MemberNo") { MemberNo = value.ToString(); return true; }
+ else if (name == "Kana") { Kana = value.ToString(); return true; }
+ else if (name == "Name") { Name = value.ToString(); return true; }
+ else if (name == "ReceiptName") { ReceiptName = value.ToString(); return true; }
+ else if (name == "ZipCode") { ZipCode = value.ToString(); return true; }
+ else if (name == "Prefecture") { Prefecture = value.ToString(); return true; }
+ else if (name == "Address2") { Address2 = value.ToString(); return true; }
+ else if (name == "Address3") { Address3 = value.ToString(); return true; }
+ else if (name == "Address4") { Address4 = value.ToString(); return true; }
+ else if (name == "Mail") { Mail = value.ToString(); return true; }
+ else if (name == "PassportNo") { PassportNo = value.ToString(); return true; }
+ else if (name == "Sex") { Sex = CConvert.ToInt(value); return true; }
+ else if (name == "BirthDay") { BirthDay = new Date(CConvert.ToDateInt(value)); return true; }
+ else if (name == "Anniversary") { Anniversary = new Date(CConvert.ToDateInt(value)); return true; }
+ else if (name == "CharacterType") { CharacterType = CConvert.ToInt(value); return true; }
+ else if (name == "RankID") { RankID = CConvert.ToInt(value); return true; }
+ else if (name == "CorpID") { CorpID = CConvert.ToInt(value); return true; }
+ else if (name == "CorpKana") { CorpKana = value.ToString(); return true; }
+ else if (name == "CorpName") { CorpName = value.ToString(); return true; }
+ else if (name == "CorpZipCode") { CorpZipCode = value.ToString(); return true; }
+ else if (name == "CorpPrefecture") { CorpPrefecture = value.ToString(); return true; }
+ else if (name == "CorpAddress2") { CorpAddress2 = value.ToString(); return true; }
+ else if (name == "CorpAddress3") { CorpAddress3 = value.ToString(); return true; }
+ else if (name == "CorpAddress4") { CorpAddress4 = value.ToString(); return true; }
+ else if (name == "CorpMail") { CorpMail = value.ToString(); return true; }
+ else if (name == "HonorificTitleID") { HonorificTitleID = CConvert.ToInt(value); return true; }
+ else if (name == "Memo") { Memo = value.ToString(); return true; }
+ else if (name == "AreaID") { AreaID = CConvert.ToInt(value); return true; }
+ else { return false; }
+ }
+
+ #endregion
+}
\ No newline at end of file
diff --git a/ProtosExpan/UseInfo/UsePersonFree.cs b/ProtosExpan/UseInfo/UsePersonFree.cs
new file mode 100644
index 0000000..1f6926c
--- /dev/null
+++ b/ProtosExpan/UseInfo/UsePersonFree.cs
@@ -0,0 +1,159 @@
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Text;
+using HotelPms.Share.Data;
+using HotelPms.Share.Util;
+using Google.Protobuf.WellKnownTypes;
+using customTypes;
+using System.Data.Common;
+
+namespace HotelPms.Data.UseInfo;
+
+/// ****************************** Description *******************************
+/// ◇システム名称
+/// ホテルPMS
+/// ◇概要
+///
+/// ◇履歴
+/// 2021/05/14 コード作成ツール 自動作成
+/// ****************************** Declarations ******************************
+[Serializable()]
+public partial class UsePersonFree : RecordBase
+{
+ #region ★★★★★ Property ★★★★★
+
+ public static ConcurrentDictionary<string, int> PrimaryKey { get; } = new ConcurrentDictionary<string, int>();
+
+ #endregion
+
+ partial void OnConstruction()
+ {
+ if (PrimaryKey.Count == 0)
+ {
+ PrimaryKey.TryAdd("ID", 0);
+ PrimaryKey.TryAdd("PersonID", 0);
+ PrimaryKey.TryAdd("TypeID", 0);
+
+ }
+ }
+
+ #region ★★★★★ Function ★★★★★
+
+ public bool CompareTo(UsePersonFree item)
+ {
+ if (ID.CompareTo(item.ID) != 0
+ || PersonID.CompareTo(item.PersonID) != 0
+ || TypeID.CompareTo(item.TypeID) != 0
+ || DataValue.CompareTo(item.DataValue) != 0
+)
+ {
+ return false;
+ }
+ return true;
+ }
+
+
+ public override void CopyTo(object dest)
+ {
+ UsePersonFree item = dest as UsePersonFree;
+ item.ID = ID;
+ item.PersonID = PersonID;
+ item.TypeID = TypeID;
+ item.DataValue = DataValue;
+
+ }
+
+ public override void Clear()
+ {
+ ID = 0;
+ PersonID = 0;
+ TypeID = 0;
+ DataValue = string.Empty;
+
+ }
+
+ public UsePersonFree DeepClone()
+ {
+ UsePersonFree item = new UsePersonFree();
+ item.ID = ID;
+ item.PersonID = PersonID;
+ item.TypeID = TypeID;
+ item.DataValue = DataValue;
+
+ return item;
+ }
+
+ public override bool ConvertDataRow(System.Data.DataRow row)
+ {
+ ID = CConvert.ToInt(row["ID"],ID);
+ PersonID = CConvert.ToInt(row["PersonID"],PersonID);
+ TypeID = CConvert.ToInt(row["TypeID"],TypeID);
+ DataValue = row["DataValue"].ToString();
+
+ return true;
+ }
+
+ public void ToDataRow(System.Data.DataRow row)
+ {
+ row["ID"] = ID;
+ row["PersonID"] = PersonID;
+ row["TypeID"] = TypeID;
+ row["DataValue"] = DataValue;
+
+ }
+
+ public void ConvertReader(DbDataReader row)
+ {
+ int i = 0;
+ ID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ PersonID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ TypeID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ DataValue = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+
+ }
+
+ public string AddSql()
+ {
+ return $@"INSERT INTO D_UsePersonFree(ID,PersonID,TypeID,DataValue) VALUES({ID},{PersonID},{TypeID},N'{DataValue}');";
+ }
+
+ public string UpdateSql()
+ {
+ return $@"UPDATE D_UsePersonFree SET DataValue = N'{DataValue}' WHERE ID = {ID} AND PersonID = {PersonID} AND TypeID = {TypeID};";
+ }
+
+ public string ToText()
+ {
+ StringBuilder text = new StringBuilder();
+ text.AppendFormat("ID={0};", ID);
+ text.AppendFormat("PersonID={0};", PersonID);
+ text.AppendFormat("TypeID={0};", TypeID);
+ text.AppendFormat("DataValue={0};", DataValue);
+
+ return text.ToString();
+ }
+
+ public override object GetField(string name)
+ {
+
+ if (name == "ID") { return ID; }
+ else if (name == "PersonID") { return PersonID; }
+ else if (name == "TypeID") { return TypeID; }
+ else if (name == "DataValue") { return DataValue; }
+ else { return null; }
+ }
+
+ public override bool SetField(string name, object value)
+ {
+
+ if (name == "ID") { ID = CConvert.ToInt(value); return true; }
+ else if (name == "PersonID") { PersonID = CConvert.ToInt(value); return true; }
+ else if (name == "TypeID") { TypeID = CConvert.ToInt(value); return true; }
+ else if (name == "DataValue") { DataValue = value.ToString(); return true; }
+ else { return false; }
+ }
+
+ #endregion
+}
\ No newline at end of file
diff --git a/ProtosExpan/UseInfo/UsePersonTel.cs b/ProtosExpan/UseInfo/UsePersonTel.cs
new file mode 100644
index 0000000..046f6c9
--- /dev/null
+++ b/ProtosExpan/UseInfo/UsePersonTel.cs
@@ -0,0 +1,179 @@
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Text;
+using HotelPms.Share.Data;
+using HotelPms.Share.Util;
+using Google.Protobuf.WellKnownTypes;
+using customTypes;
+using System.Data.Common;
+
+namespace HotelPms.Data.UseInfo;
+
+/// ****************************** Description *******************************
+/// ◇システム名称
+/// ホテルPMS
+/// ◇概要
+///
+/// ◇履歴
+/// 2021/05/14 コード作成ツール 自動作成
+/// ****************************** Declarations ******************************
+[Serializable()]
+public partial class UsePersonTel : RecordBase
+{
+ #region ★★★★★ Property ★★★★★
+
+ public static ConcurrentDictionary<string, int> PrimaryKey { get; } = new ConcurrentDictionary<string, int>();
+
+ #endregion
+
+ partial void OnConstruction()
+ {
+ if (PrimaryKey.Count == 0)
+ {
+ PrimaryKey.TryAdd("ID", 0);
+ PrimaryKey.TryAdd("PersonID", 0);
+ PrimaryKey.TryAdd("Tel", 0);
+
+ }
+ }
+
+ #region ★★★★★ Function ★★★★★
+
+ public bool CompareTo(UsePersonTel item)
+ {
+ if (ID.CompareTo(item.ID) != 0
+ || PersonID.CompareTo(item.PersonID) != 0
+ || Tel.CompareTo(item.Tel) != 0
+ || Kind.CompareTo(item.Kind) != 0
+ || SearchKey.CompareTo(item.SearchKey) != 0
+ || SortID.CompareTo(item.SortID) != 0
+)
+ {
+ return false;
+ }
+ return true;
+ }
+
+
+ public override void CopyTo(object dest)
+ {
+ UsePersonTel item = dest as UsePersonTel;
+ item.ID = ID;
+ item.PersonID = PersonID;
+ item.Tel = Tel;
+ item.Kind = Kind;
+ item.SearchKey = SearchKey;
+ item.SortID = SortID;
+
+ }
+
+ public override void Clear()
+ {
+ ID = 0;
+ PersonID = 0;
+ Tel = string.Empty;
+ Kind = 0;
+ SearchKey = string.Empty;
+ SortID = 0;
+
+ }
+
+ public UsePersonTel DeepClone()
+ {
+ UsePersonTel item = new UsePersonTel();
+ item.ID = ID;
+ item.PersonID = PersonID;
+ item.Tel = Tel;
+ item.Kind = Kind;
+ item.SearchKey = SearchKey;
+ item.SortID = SortID;
+
+ return item;
+ }
+
+ public override bool ConvertDataRow(System.Data.DataRow row)
+ {
+ ID = CConvert.ToInt(row["ID"],ID);
+ PersonID = CConvert.ToInt(row["PersonID"],PersonID);
+ Tel = row["Tel"].ToString();
+ Kind = CConvert.ToInt(row["Kind"],Kind);
+ SearchKey = row["SearchKey"].ToString();
+ SortID = CConvert.ToInt(row["SortID"],SortID);
+
+ return true;
+ }
+
+ public void ToDataRow(System.Data.DataRow row)
+ {
+ row["ID"] = ID;
+ row["PersonID"] = PersonID;
+ row["Tel"] = Tel;
+ row["Kind"] = Kind;
+ row["SearchKey"] = SearchKey;
+ row["SortID"] = SortID;
+
+ }
+
+ public void ConvertReader(DbDataReader row)
+ {
+ int i = 0;
+ ID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ PersonID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ Tel = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ Kind = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ SearchKey = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++;
+ SortID = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+
+ }
+
+ public string AddSql()
+ {
+ return $@"INSERT INTO D_UsePersonTel(ID,PersonID,Tel,Kind,SearchKey,SortID) VALUES({ID},{PersonID},N'{Tel}',{Kind},N'{SearchKey}',{SortID});";
+ }
+
+ public string UpdateSql()
+ {
+ return $@"UPDATE D_UsePersonTel SET Kind = {Kind},SearchKey = N'{SearchKey}',SortID = {SortID} WHERE ID = {ID} AND PersonID = {PersonID} AND Tel = N'{Tel}';";
+ }
+
+ public string ToText()
+ {
+ StringBuilder text = new StringBuilder();
+ text.AppendFormat("ID={0};", ID);
+ text.AppendFormat("PersonID={0};", PersonID);
+ text.AppendFormat("Tel={0};", Tel);
+ text.AppendFormat("Kind={0};", Kind);
+ text.AppendFormat("SearchKey={0};", SearchKey);
+ text.AppendFormat("SortID={0};", SortID);
+
+ return text.ToString();
+ }
+
+ public override object GetField(string name)
+ {
+
+ if (name == "ID") { return ID; }
+ else if (name == "PersonID") { return PersonID; }
+ else if (name == "Tel") { return Tel; }
+ else if (name == "Kind") { return Kind; }
+ else if (name == "SearchKey") { return SearchKey; }
+ else if (name == "SortID") { return SortID; }
+ else { return null; }
+ }
+
+ public override bool SetField(string name, object value)
+ {
+
+ if (name == "ID") { ID = CConvert.ToInt(value); return true; }
+ else if (name == "PersonID") { PersonID = CConvert.ToInt(value); return true; }
+ else if (name == "Tel") { Tel = value.ToString(); return true; }
+ else if (name == "Kind") { Kind = CConvert.ToInt(value); return true; }
+ else if (name == "SearchKey") { SearchKey = value.ToString(); return true; }
+ else if (name == "SortID") { SortID = CConvert.ToInt(value); return true; }
+ else { return false; }
+ }
+
+ #endregion
+}
\ No newline at end of file
diff --git a/ProtosExpan/UseInfo/UseRoom.Client.cs b/ProtosExpan/UseInfo/UseRoom.Client.cs
new file mode 100644
index 0000000..c0f3e7c
--- /dev/null
+++ b/ProtosExpan/UseInfo/UseRoom.Client.cs
@@ -0,0 +1,169 @@
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Text;
+using HotelPms.Share.Data;
+using HotelPms.Share.Util;
+using Google.Protobuf.WellKnownTypes;
+using customTypes;
+using System.Data.Common;
+using HotelPms.Share.IO;
+using System.Reflection;
+using HotelPms.Data.Common;
+
+namespace HotelPms.Data.UseInfo;
+
+/// ****************************** Description *******************************
+/// ◇システム名称
+/// ホテルPMS
+/// ◇概要
+///
+/// ◇履歴
+/// 2021/05/14 コード作成ツール 自動作成
+/// ****************************** Declarations ******************************
+public partial class UseRoom
+{
+ #region ★★★★★ Property ★★★★★
+
+ #endregion
+
+ #region ★★★★★ Function ★★★★★
+
+ /// <summary>
+ /// 通常売上伝票の削除
+ /// ※手配、備品の関連売上伝票除外
+ /// ※パックの場合、子伝票も削除する
+ /// </summary>
+ /// <returns></returns>
+ public bool RemoveSale(Sale item)
+ {
+ try
+ {
+ if (item.Pack)
+ {
+ List<Sale> childList = new List<Sale>();
+ foreach (Sale child in SaleList)
+ {
+ if (child.PackSaleID == item.SaleID) { childList.Add(child); }
+ }
+ foreach (var child in childList) { SaleList.Remove(child); }
+ }
+
+ //売上伝票削除
+ SaleList.Remove(item);
+ return true;
+ }
+ catch (Exception ex)
+ {
+ OperationLog.Instance.WriteLog($"{MethodInfo.GetCurrentMethod()}:{ex.Message}");
+ return false;
+ }
+ }
+
+ /// <summary>
+ /// 部屋に売上伝票を追加
+ /// </summary>
+ /// <param name="item"></param>
+ public void AddSale(Sale item)
+ {
+ item.Parent = this;
+ SaleList.Add(item);
+ }
+
+ /// <summary>
+ /// 科目より売上伝票を作成する
+ /// 完全新規
+ /// </summary>
+ /// <param name="item"></param>
+ /// <returns></returns>
+ public Sale AddSaleByItem(int saleID, int taxRate, HotelPms.Data.Master.Item item)
+ {
+ return AddSaleByItem(saleID, taxRate, item, null);
+ }
+
+ /// <summary>
+ /// 科目より売上伝票を作成する
+ /// </summary>
+ /// <param name="item"></param>
+ /// <param name="orgSale"></param>
+ /// <returns></returns>
+ public Sale AddSaleByItem(int saleID, int taxRate, HotelPms.Data.Master.Item item, Sale? orgSale)
+ {
+ Sale sale = new()
+ {
+ ID = ID,
+ DetailID = DetailID,
+ UseDate = UseDate,
+ SaleID = saleID,
+ ReceiptID = 0,
+ ItemID = item.ID,
+ ItemName = item.Name,
+ Price = item.Price,
+ Amount = 1,
+ ServiceIOType = item.ServiceIOType, //サービス料区分
+ ServiceRate = item.ServiceRate,
+ TaxType = item.TaxType, //0.消費税 1.軽減税
+ TaxIOType = item.TaxIOType, //消費税区分
+ TaxRate = (decimal)taxRate,
+ BathTaxIOType = item.BathTaxIOType,
+ AccTaxIOType = item.AccTaxIOType,
+ DiscountRate = item.DiscountRate,
+ DiscountSummary = item.DiscountSummary,
+ DiscountID = item.DiscountID,
+ Pack = item.PackFlg,
+ PackChild = false,
+ PackSaleID = 0,
+ PersonType = item.PersonType,
+ PersonCount = item.PersonCount,
+ InFemale = 0,
+ UseType = item.UseType, //0.ルームチャージ 1.一人単価
+ BaseAmount = 1, //一人単価時の基本数量(人数連動用)
+ PersonRef = false, //人数連動があるかどうか
+ SrcType = 0, //生成元 0.通常 1.PBX課金 2.会場料金 3.手配 4.貸出 5.手配貸出
+ FixturesID = string.Empty,
+ ItemKind = item.Kind, //科目種別
+
+ //インボイス制度:内訳計算必要???
+ Summary = 0,
+ ServiceSummary = 0,
+ TaxSummary = 0,
+ BathTaxSummary = 0,
+ AccTaxSummary = 0,
+ TotalSummary = 0,
+ };
+
+ if (sale.ItemKind == (int)EItemKind.StayBase || sale.ItemKind == (int)EItemKind.DayUseBase)
+ {
+ sale.BathTaxType = 0; //0.固定 1.可変(マスタ参照)
+ sale.BathTaxUnitPrice = 0; //一人毎入湯税
+ }
+
+ //旧情報を引き継ぐ
+ if(orgSale == null)
+ {
+ sale.ReceiptItemName = item.ReceiptName;
+ sale.ReceiptPrtType = item.ReceiptPrtType;
+ sale.ReceiptPage = 1;
+ }
+ else
+ {
+ sale.ReceiptItemName = orgSale.ReceiptItemName;
+ sale.ReceiptPrtType = orgSale.ReceiptPrtType;
+ sale.ReceiptPage = orgSale.ReceiptPage;
+ sale.FixturesID = orgSale.FixturesID;
+ }
+
+ //パックの場合、子科目の追加
+ if(item.PackFlg) { sale.AddChild(); }
+
+ //親UseRoom
+ sale.Parent = this;
+
+ //部屋の売上一覧に追加する
+ SaleList.Add(sale);
+ return sale;
+ }
+
+ #endregion
+}
\ No newline at end of file
diff --git a/ProtosExpan/UseInfo/UseRoom.cs b/ProtosExpan/UseInfo/UseRoom.cs
new file mode 100644
index 0000000..0425696
--- /dev/null
+++ b/ProtosExpan/UseInfo/UseRoom.cs
@@ -0,0 +1,389 @@
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Text;
+using HotelPms.Share.Data;
+using HotelPms.Share.Util;
+using Google.Protobuf.WellKnownTypes;
+using customTypes;
+using System.Data.Common;
+
+namespace HotelPms.Data.UseInfo;
+
+/// ****************************** Description *******************************
+/// ◇システム名称
+/// ホテルPMS
+/// ◇概要
+///
+/// ◇履歴
+/// 2021/05/14 コード作成ツール 自動作成
+/// ****************************** Declarations ******************************
+[Serializable()]
+public partial class UseRoom : RecordBase
+{
+ #region ★★★★★ Property ★★★★★
+
+ public static ConcurrentDictionary<string, int> PrimaryKey { get; } = new ConcurrentDictionary<string, int>();
+
+ #endregion
+
+ partial void OnConstruction()
+ {
+ if (PrimaryKey.Count == 0)
+ {
+ PrimaryKey.TryAdd("ID", 0);
+ PrimaryKey.TryAdd("DetailID", 0);
+ PrimaryKey.TryAdd("UseDate", 0);
+
+ }
+ }
+
+ #region ★★★★★ Function ★★★★★
+
+ public bool CompareTo(UseRoom item)
+ {
+ if (ID.CompareTo(item.ID) != 0
+ || DetailID.CompareTo(item.DetailID) != 0
+ || UseDate.CompareTo(item.UseDate) != 0
+ || BeginTime.CompareTo(item.BeginTime) != 0
+ || EndTime.CompareTo(item.EndTime) != 0
+ || RoomTypeID.CompareTo(item.RoomTypeID) != 0
+ || RoomKind.CompareTo(item.RoomKind) != 0
+ || RoomID.CompareTo(item.RoomID) != 0
+ || AgentID.CompareTo(item.AgentID) != 0
+ || AgentBranchID.CompareTo(item.AgentBranchID) != 0
+ || PersionCount.CompareTo(item.PersionCount) != 0
+ || Adult.CompareTo(item.Adult) != 0
+ || ChildA.CompareTo(item.ChildA) != 0
+ || ChildB.CompareTo(item.ChildB) != 0
+ || ChildC.CompareTo(item.ChildC) != 0
+ || ChildD.CompareTo(item.ChildD) != 0
+ || ChildE.CompareTo(item.ChildE) != 0
+ || ChildF.CompareTo(item.ChildF) != 0
+ || Infant.CompareTo(item.Infant) != 0
+ || InFemaleAdult.CompareTo(item.InFemaleAdult) != 0
+ || InFemaleChildA.CompareTo(item.InFemaleChildA) != 0
+ || InFemaleChildB.CompareTo(item.InFemaleChildB) != 0
+ || InFemaleChildC.CompareTo(item.InFemaleChildC) != 0
+ || InFemaleChildD.CompareTo(item.InFemaleChildD) != 0
+ || InFemaleChildE.CompareTo(item.InFemaleChildE) != 0
+ || InFemaleChildF.CompareTo(item.InFemaleChildF) != 0
+ || InFemaleInfant.CompareTo(item.InFemaleInfant) != 0
+)
+ {
+ return false;
+ }
+ return true;
+ }
+
+
+ public override void CopyTo(object dest)
+ {
+ UseRoom item = dest as UseRoom;
+ item.ID = ID;
+ item.DetailID = DetailID;
+ item.UseDate = UseDate;
+ item.BeginTime = BeginTime;
+ item.EndTime = EndTime;
+ item.RoomTypeID = RoomTypeID;
+ item.RoomKind = RoomKind;
+ item.RoomID = RoomID;
+ item.AgentID = AgentID;
+ item.AgentBranchID = AgentBranchID;
+ item.PersionCount = PersionCount;
+ item.Adult = Adult;
+ item.ChildA = ChildA;
+ item.ChildB = ChildB;
+ item.ChildC = ChildC;
+ item.ChildD = ChildD;
+ item.ChildE = ChildE;
+ item.ChildF = ChildF;
+ item.Infant = Infant;
+ item.InFemaleAdult = InFemaleAdult;
+ item.InFemaleChildA = InFemaleChildA;
+ item.InFemaleChildB = InFemaleChildB;
+ item.InFemaleChildC = InFemaleChildC;
+ item.InFemaleChildD = InFemaleChildD;
+ item.InFemaleChildE = InFemaleChildE;
+ item.InFemaleChildF = InFemaleChildF;
+ item.InFemaleInfant = InFemaleInfant;
+
+ }
+
+ public override void Clear()
+ {
+ ID = 0;
+ DetailID = 0;
+ UseDate = Date.Default;
+ BeginTime = 0;
+ EndTime = 0;
+ RoomTypeID = 0;
+ RoomKind = 0;
+ RoomID = 0;
+ AgentID = 0;
+ AgentBranchID = 0;
+ PersionCount = 0;
+ Adult = 0;
+ ChildA = 0;
+ ChildB = 0;
+ ChildC = 0;
+ ChildD = 0;
+ ChildE = 0;
+ ChildF = 0;
+ Infant = 0;
+ InFemaleAdult = 0;
+ InFemaleChildA = 0;
+ InFemaleChildB = 0;
+ InFemaleChildC = 0;
+ InFemaleChildD = 0;
+ InFemaleChildE = 0;
+ InFemaleChildF = 0;
+ InFemaleInfant = 0;
+
+ }
+
+ public UseRoom DeepClone()
+ {
+ UseRoom item = new UseRoom();
+ item.ID = ID;
+ item.DetailID = DetailID;
+ item.UseDate = UseDate;
+ item.BeginTime = BeginTime;
+ item.EndTime = EndTime;
+ item.RoomTypeID = RoomTypeID;
+ item.RoomKind = RoomKind;
+ item.RoomID = RoomID;
+ item.AgentID = AgentID;
+ item.AgentBranchID = AgentBranchID;
+ item.PersionCount = PersionCount;
+ item.Adult = Adult;
+ item.ChildA = ChildA;
+ item.ChildB = ChildB;
+ item.ChildC = ChildC;
+ item.ChildD = ChildD;
+ item.ChildE = ChildE;
+ item.ChildF = ChildF;
+ item.Infant = Infant;
+ item.InFemaleAdult = InFemaleAdult;
+ item.InFemaleChildA = InFemaleChildA;
+ item.InFemaleChildB = InFemaleChildB;
+ item.InFemaleChildC = InFemaleChildC;
+ item.InFemaleChildD = InFemaleChildD;
+ item.InFemaleChildE = InFemaleChildE;
+ item.InFemaleChildF = InFemaleChildF;
+ item.InFemaleInfant = InFemaleInfant;
+
+ return item;
+ }
+
+ public override bool ConvertDataRow(System.Data.DataRow row)
+ {
+ ID = CConvert.ToInt(row["ID"],ID);
+ DetailID = CConvert.ToInt(row["DetailID"],DetailID);
+ UseDate = new Date(row.IsNull("UseDate") ? 0 : CConvert.ToDateInt((System.DateTime)row["UseDate"]));
+ BeginTime = CConvert.ToInt(row["BeginTime"],BeginTime);
+ EndTime = CConvert.ToInt(row["EndTime"],EndTime);
+ RoomTypeID = CConvert.ToInt(row["RoomTypeID"],RoomTypeID);
+ RoomKind = CConvert.ToInt(row["RoomKind"],RoomKind);
+ RoomID = CConvert.ToInt(row["RoomID"],RoomID);
+ AgentID = CConvert.ToInt(row["AgentID"],AgentID);
+ AgentBranchID = CConvert.ToInt(row["AgentBranchID"],AgentBranchID);
+ PersionCount = CConvert.ToInt(row["PersionCount"],PersionCount);
+ Adult = CConvert.ToInt(row["Adult"],Adult);
+ ChildA = CConvert.ToInt(row["ChildA"],ChildA);
+ ChildB = CConvert.ToInt(row["ChildB"],ChildB);
+ ChildC = CConvert.ToInt(row["ChildC"],ChildC);
+ ChildD = CConvert.ToInt(row["ChildD"],ChildD);
+ ChildE = CConvert.ToInt(row["ChildE"],ChildE);
+ ChildF = CConvert.ToInt(row["ChildF"],ChildF);
+ Infant = CConvert.ToInt(row["Infant"],Infant);
+ InFemaleAdult = CConvert.ToInt(row["InFemaleAdult"],InFemaleAdult);
+ InFemaleChildA = CConvert.ToInt(row["InFemaleChildA"],InFemaleChildA);
+ InFemaleChildB = CConvert.ToInt(row["InFemaleChildB"],InFemaleChildB);
+ InFemaleChildC = CConvert.ToInt(row["InFemaleChildC"],InFemaleChildC);
+ InFemaleChildD = CConvert.ToInt(row["InFemaleChildD"],InFemaleChildD);
+ InFemaleChildE = CConvert.ToInt(row["InFemaleChildE"],InFemaleChildE);
+ InFemaleChildF = CConvert.ToInt(row["InFemaleChildF"],InFemaleChildF);
+ InFemaleInfant = CConvert.ToInt(row["InFemaleInfant"],InFemaleInfant);
+
+ return true;
+ }
+
+ public void ToDataRow(System.Data.DataRow row)
+ {
+ row["ID"] = ID;
+ row["DetailID"] = DetailID;
+ row["UseDate"] = UseDate.ToDateTime();
+ row["BeginTime"] = BeginTime;
+ row["EndTime"] = EndTime;
+ row["RoomTypeID"] = RoomTypeID;
+ row["RoomKind"] = RoomKind;
+ row["RoomID"] = RoomID;
+ row["AgentID"] = AgentID;
+ row["AgentBranchID"] = AgentBranchID;
+ row["PersionCount"] = PersionCount;
+ row["Adult"] = Adult;
+ row["ChildA"] = ChildA;
+ row["ChildB"] = ChildB;
+ row["ChildC"] = ChildC;
+ row["ChildD"] = ChildD;
+ row["ChildE"] = ChildE;
+ row["ChildF"] = ChildF;
+ row["Infant"] = Infant;
+ row["InFemaleAdult"] = InFemaleAdult;
+ row["InFemaleChildA"] = InFemaleChildA;
+ row["InFemaleChildB"] = InFemaleChildB;
+ row["InFemaleChildC"] = InFemaleChildC;
+ row["InFemaleChildD"] = InFemaleChildD;
+ row["InFemaleChildE"] = InFemaleChildE;
+ row["InFemaleChildF"] = InFemaleChildF;
+ row["InFemaleInfant"] = InFemaleInfant;
+
+ }
+
+ public void ConvertReader(DbDataReader row)
+ {
+ int i = 0;
+ ID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ DetailID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ UseDate = new Date(row.IsDBNull(i) ? 0 : CConvert.ToDateInt(row.GetDateTime(i))); i++;
+ BeginTime = (int)(row.IsDBNull(i) ? 0 : row.GetInt16(i)); i++;
+ EndTime = (int)(row.IsDBNull(i) ? 0 : row.GetInt16(i)); i++;
+ RoomTypeID = (int)(row.IsDBNull(i) ? 0 : row.GetInt16(i)); i++;
+ RoomKind = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++;
+ RoomID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ AgentID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ AgentBranchID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ PersionCount = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ Adult = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ ChildA = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ ChildB = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ ChildC = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ ChildD = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ ChildE = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ ChildF = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ Infant = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ InFemaleAdult = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ InFemaleChildA = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ InFemaleChildB = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ InFemaleChildC = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ InFemaleChildD = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ InFemaleChildE = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ InFemaleChildF = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+ InFemaleInfant = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++;
+
+ }
+
+ public string AddSql()
+ {
+ return $@"INSERT INTO D_UseRoom(ID,DetailID,UseDate,BeginTime,EndTime,RoomTypeID,RoomKind,RoomID,AgentID,AgentBranchID,PersionCount,Adult,ChildA,ChildB,ChildC,ChildD,ChildE,ChildF,Infant,InFemaleAdult,InFemaleChildA,InFemaleChildB,InFemaleChildC,InFemaleChildD,InFemaleChildE,InFemaleChildF,InFemaleInfant) VALUES({ID},{DetailID},{(UseDate == null ? "NULL" : UseDate.ToSqlValue())},{BeginTime},{EndTime},{RoomTypeID},{RoomKind},{RoomID},{AgentID},{AgentBranchID},{PersionCount},{Adult},{ChildA},{ChildB},{ChildC},{ChildD},{ChildE},{ChildF},{Infant},{InFemaleAdult},{InFemaleChildA},{InFemaleChildB},{InFemaleChildC},{InFemaleChildD},{InFemaleChildE},{InFemaleChildF},{InFemaleInfant});";
+ }
+
+ public string UpdateSql()
+ {
+ return $@"UPDATE D_UseRoom SET BeginTime = {BeginTime},EndTime = {EndTime},RoomTypeID = {RoomTypeID},RoomKind = {RoomKind},RoomID = {RoomID},AgentID = {AgentID},AgentBranchID = {AgentBranchID},PersionCount = {PersionCount},Adult = {Adult},ChildA = {ChildA},ChildB = {ChildB},ChildC = {ChildC},ChildD = {ChildD},ChildE = {ChildE},ChildF = {ChildF},Infant = {Infant},InFemaleAdult = {InFemaleAdult},InFemaleChildA = {InFemaleChildA},InFemaleChildB = {InFemaleChildB},InFemaleChildC = {InFemaleChildC},InFemaleChildD = {InFemaleChildD},InFemaleChildE = {InFemaleChildE},InFemaleChildF = {InFemaleChildF},InFemaleInfant = {InFemaleInfant} WHERE ID = {ID} AND DetailID = {DetailID} AND UseDate = {(UseDate == null ? "NULL" : UseDate.ToSqlValue())};";
+ }
+
+ public string ToText()
+ {
+ StringBuilder text = new StringBuilder();
+ text.AppendFormat("ID={0};", ID);
+ text.AppendFormat("DetailID={0};", DetailID);
+ text.AppendFormat("UseDate={0};", UseDate);
+ text.AppendFormat("BeginTime={0};", BeginTime);
+ text.AppendFormat("EndTime={0};", EndTime);
+ text.AppendFormat("RoomTypeID={0};", RoomTypeID);
+ text.AppendFormat("RoomKind={0};", RoomKind);
+ text.AppendFormat("RoomID={0};", RoomID);
+ text.AppendFormat("AgentID={0};", AgentID);
+ text.AppendFormat("AgentBranchID={0};", AgentBranchID);
+ text.AppendFormat("PersionCount={0};", PersionCount);
+ text.AppendFormat("Adult={0};", Adult);
+ text.AppendFormat("ChildA={0};", ChildA);
+ text.AppendFormat("ChildB={0};", ChildB);
+ text.AppendFormat("ChildC={0};", ChildC);
+ text.AppendFormat("ChildD={0};", ChildD);
+ text.AppendFormat("ChildE={0};", ChildE);
+ text.AppendFormat("ChildF={0};", ChildF);
+ text.AppendFormat("Infant={0};", Infant);
+ text.AppendFormat("InFemaleAdult={0};", InFemaleAdult);
+ text.AppendFormat("InFemaleChildA={0};", InFemaleChildA);
+ text.AppendFormat("InFemaleChildB={0};", InFemaleChildB);
+ text.AppendFormat("InFemaleChildC={0};", InFemaleChildC);
+ text.AppendFormat("InFemaleChildD={0};", InFemaleChildD);
+ text.AppendFormat("InFemaleChildE={0};", InFemaleChildE);
+ text.AppendFormat("InFemaleChildF={0};", InFemaleChildF);
+ text.AppendFormat("InFemaleInfant={0};", InFemaleInfant);
+
+ return text.ToString();
+ }
+
+ public override object GetField(string name)
+ {
+
+ if (name == "ID") { return ID; }
+ else if (name == "DetailID") { return DetailID; }
+ else if (name == "UseDate") { return UseDate; }
+ else if (name == "BeginTime") { return BeginTime; }
+ else if (name == "EndTime") { return EndTime; }
+ else if (name == "RoomTypeID") { return RoomTypeID; }
+ else if (name == "RoomKind") { return RoomKind; }
+ else if (name == "RoomID") { return RoomID; }
+ else if (name == "AgentID") { return AgentID; }
+ else if (name == "AgentBranchID") { return AgentBranchID; }
+ else if (name == "PersionCount") { return PersionCount; }
+ else if (name == "Adult") { return Adult; }
+ else if (name == "ChildA") { return ChildA; }
+ else if (name == "ChildB") { return ChildB; }
+ else if (name == "ChildC") { return ChildC; }
+ else if (name == "ChildD") { return ChildD; }
+ else if (name == "ChildE") { return ChildE; }
+ else if (name == "ChildF") { return ChildF; }
+ else if (name == "Infant") { return Infant; }
+ else if (name == "InFemaleAdult") { return InFemaleAdult; }
+ else if (name == "InFemaleChildA") { return InFemaleChildA; }
+ else if (name == "InFemaleChildB") { return InFemaleChildB; }
+ else if (name == "InFemaleChildC") { return InFemaleChildC; }
+ else if (name == "InFemaleChildD") { return InFemaleChildD; }
+ else if (name == "InFemaleChildE") { return InFemaleChildE; }
+ else if (name == "InFemaleChildF") { return InFemaleChildF; }
+ else if (name == "InFemaleInfant") { return InFemaleInfant; }
+ else { return null; }
+ }
+
+ public override bool SetField(string name, object value)
+ {
+
+ if (name == "ID") { ID = CConvert.ToInt(value); return true; }
+ else if (name == "DetailID") { DetailID = CConvert.ToInt(value); return true; }
+ else if (name == "UseDate") { UseDate = new Date(CConvert.ToDateInt(value)); return true; }
+ else if (name == "BeginTime") { BeginTime = CConvert.ToInt(value); return true; }
+ else if (name == "EndTime") { EndTime = CConvert.ToInt(value); return true; }
+ else if (name == "RoomTypeID") { RoomTypeID = CConvert.ToInt(value); return true; }
+ else if (name == "RoomKind") { RoomKind = CConvert.ToInt(value); return true; }
+ else if (name == "RoomID") { RoomID = CConvert.ToInt(value); return true; }
+ else if (name == "AgentID") { AgentID = CConvert.ToInt(value); return true; }
+ else if (name == "AgentBranchID") { AgentBranchID = CConvert.ToInt(value); return true; }
+ else if (name == "PersionCount") { PersionCount = CConvert.ToInt(value); return true; }
+ else if (name == "Adult") { Adult = CConvert.ToInt(value); return true; }
+ else if (name == "ChildA") { ChildA = CConvert.ToInt(value); return true; }
+ else if (name == "ChildB") { ChildB = CConvert.ToInt(value); return true; }
+ else if (name == "ChildC") { ChildC = CConvert.ToInt(value); return true; }
+ else if (name == "ChildD") { ChildD = CConvert.ToInt(value); return true; }
+ else if (name == "ChildE") { ChildE = CConvert.ToInt(value); return true; }
+ else if (name == "ChildF") { ChildF = CConvert.ToInt(value); return true; }
+ else if (name == "Infant") { Infant = CConvert.ToInt(value); return true; }
+ else if (name == "InFemaleAdult") { InFemaleAdult = CConvert.ToInt(value); return true; }
+ else if (name == "InFemaleChildA") { InFemaleChildA = CConvert.ToInt(value); return true; }
+ else if (name == "InFemaleChildB") { InFemaleChildB = CConvert.ToInt(value); return true; }
+ else if (name == "InFemaleChildC") { InFemaleChildC = CConvert.ToInt(value); return true; }
+ else if (name == "InFemaleChildD") { InFemaleChildD = CConvert.ToInt(value); return true; }
+ else if (name == "InFemaleChildE") { InFemaleChildE = CConvert.ToInt(value); return true; }
+ else if (name == "InFemaleChildF") { InFemaleChildF = CConvert.ToInt(value); return true; }
+ else if (name == "InFemaleInfant") { InFemaleInfant = CConvert.ToInt(value); return true; }
+ else { return false; }
+ }
+
+ #endregion
+}
\ No newline at end of file
--
Gitblit v1.10.0