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