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