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
|
}
|