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 Option : RecordBase
|
{
|
#region ★★★★★ Property ★★★★★
|
|
public static ConcurrentDictionary<string, int> PrimaryKey { get; } = new ConcurrentDictionary<string, int>();
|
|
#endregion
|
|
partial void OnConstruction()
|
{
|
if (PrimaryKey.Count == 0)
|
{
|
PrimaryKey.TryAdd("Type", 0);
|
PrimaryKey.TryAdd("Key", 0);
|
|
}
|
}
|
|
#region ★★★★★ Function ★★★★★
|
|
public bool CompareTo(Option item)
|
{
|
if (Type.CompareTo(item.Type) != 0
|
|| Key.CompareTo(item.Key) != 0
|
|| Value.CompareTo(item.Value) != 0
|
)
|
{
|
return false;
|
}
|
return true;
|
}
|
|
|
public override void CopyTo(object dest)
|
{
|
Option item = dest as Option;
|
item.Type = Type;
|
item.Key = Key;
|
item.Value = Value;
|
|
}
|
|
public override void Clear()
|
{
|
Type = string.Empty;
|
Key = string.Empty;
|
Value = string.Empty;
|
|
}
|
|
public Option DeepClone()
|
{
|
Option item = new Option();
|
item.Type = Type;
|
item.Key = Key;
|
item.Value = Value;
|
|
return item;
|
}
|
|
public override bool ConvertDataRow(System.Data.DataRow row)
|
{
|
Type = row["Type"].ToString();
|
Key = row["Key"].ToString();
|
Value = row["Value"].ToString();
|
|
return true;
|
}
|
|
public void ToDataRow(System.Data.DataRow row)
|
{
|
row["Type"] = Type;
|
row["Key"] = Key;
|
row["Value"] = Value;
|
|
}
|
|
public void ConvertReader(DbDataReader row)
|
{
|
Type = row["Type"].ToString();
|
Key = row["Key"].ToString();
|
Value = row["Value"].ToString();
|
|
}
|
|
public string AddSql()
|
{
|
return $@"INSERT INTO S_Option(Type,Key,Value) VALUES(N'{Type}',N'{Key}',N'{Value}');";
|
}
|
|
public string UpdateSql()
|
{
|
return $@"UPDATE S_Option SET Value = N'{Value}' WHERE Type = N'{Type}' AND Key = N'{Key}';";
|
}
|
|
public string ToText()
|
{
|
StringBuilder text = new StringBuilder();
|
text.AppendFormat("Type={0};", Type);
|
text.AppendFormat("Key={0};", Key);
|
text.AppendFormat("Value={0};", Value);
|
|
return text.ToString();
|
}
|
|
public override object GetField(string name)
|
{
|
|
if (name == "Type") { return Type; }
|
else if (name == "Key") { return Key; }
|
else if (name == "Value") { return Value; }
|
else { return null; }
|
}
|
|
public override bool SetField(string name, object value)
|
{
|
|
if (name == "Type") { Type = value.ToString(); return true; }
|
else if (name == "Key") { Key = value.ToString(); return true; }
|
else if (name == "Value") { Value = value.ToString(); return true; }
|
else { return false; }
|
}
|
|
#endregion
|
}
|
}
|