ホテル管理システム
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
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
    }
}