ホテル管理システム
ogi
yesterday 1a1c8e71fcd14858f595029f089b2d4a00202b32
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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()
            });
        }
    }
}