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 RoomViewLayout : RecordBase
|
{
|
#region ★★★★★ Property ★★★★★
|
|
public static ConcurrentDictionary<string, int> PrimaryKey { get; } = new ConcurrentDictionary<string, int>();
|
|
#endregion
|
|
partial void OnConstruction()
|
{
|
if (PrimaryKey.Count == 0)
|
{
|
PrimaryKey.TryAdd("TabID", 0);
|
PrimaryKey.TryAdd("Row", 0);
|
PrimaryKey.TryAdd("Col", 0);
|
|
}
|
}
|
|
#region ★★★★★ Function ★★★★★
|
|
public bool CompareTo(RoomViewLayout item)
|
{
|
if (TabID.CompareTo(item.TabID) != 0
|
|| Row.CompareTo(item.Row) != 0
|
|| Col.CompareTo(item.Col) != 0
|
|| RoomID.CompareTo(item.RoomID) != 0
|
|| DisplayName.CompareTo(item.DisplayName) != 0
|
|| RowHeight.CompareTo(item.RowHeight) != 0
|
|| ColWidth.CompareTo(item.ColWidth) != 0
|
|| BackColor.CompareTo(item.BackColor) != 0
|
|| ForeColor.CompareTo(item.ForeColor) != 0
|
|| Floor.CompareTo(item.Floor) != 0
|
|| FontName.CompareTo(item.FontName) != 0
|
|| FontSize.CompareTo(item.FontSize) != 0
|
|| FontBold.CompareTo(item.FontBold) != 0
|
|| FontItalic.CompareTo(item.FontItalic) != 0
|
|| FontUnderline.CompareTo(item.FontUnderline) != 0
|
|| TextAlign.CompareTo(item.TextAlign) != 0
|
|| UpdateDate.CompareTo(item.UpdateDate) != 0
|
|| UpdateLoginID.CompareTo(item.UpdateLoginID) != 0
|
|| UpdatePcName.CompareTo(item.UpdatePcName) != 0
|
|| UpdateID.CompareTo(item.UpdateID) != 0
|
)
|
{
|
return false;
|
}
|
return true;
|
}
|
|
|
public override void CopyTo(object dest)
|
{
|
RoomViewLayout item = dest as RoomViewLayout;
|
item.TabID = TabID;
|
item.Row = Row;
|
item.Col = Col;
|
item.RoomID = RoomID;
|
item.DisplayName = DisplayName;
|
item.RowHeight = RowHeight;
|
item.ColWidth = ColWidth;
|
item.BackColor = BackColor;
|
item.ForeColor = ForeColor;
|
item.Floor = Floor;
|
item.FontName = FontName;
|
item.FontSize = FontSize;
|
item.FontBold = FontBold;
|
item.FontItalic = FontItalic;
|
item.FontUnderline = FontUnderline;
|
item.TextAlign = TextAlign;
|
item.UpdateDate = UpdateDate;
|
item.UpdateLoginID = UpdateLoginID;
|
item.UpdatePcName = UpdatePcName;
|
item.UpdateID = UpdateID;
|
|
}
|
|
public override void Clear()
|
{
|
TabID = 0;
|
Row = 0;
|
Col = 0;
|
RoomID = 0;
|
DisplayName = string.Empty;
|
RowHeight = 0;
|
ColWidth = 0;
|
BackColor = string.Empty;
|
ForeColor = string.Empty;
|
Floor = 0;
|
FontName = string.Empty;
|
FontSize = 0;
|
FontBold = false;
|
FontItalic = false;
|
FontUnderline = false;
|
TextAlign = string.Empty;
|
UpdateDate = CConvert.ToTimestamp(DateTime.MinValue);
|
UpdateLoginID = 0;
|
UpdatePcName = string.Empty;
|
UpdateID = 0;
|
|
}
|
|
public RoomViewLayout DeepClone()
|
{
|
RoomViewLayout item = new RoomViewLayout();
|
item.TabID = TabID;
|
item.Row = Row;
|
item.Col = Col;
|
item.RoomID = RoomID;
|
item.DisplayName = DisplayName;
|
item.RowHeight = RowHeight;
|
item.ColWidth = ColWidth;
|
item.BackColor = BackColor;
|
item.ForeColor = ForeColor;
|
item.Floor = Floor;
|
item.FontName = FontName;
|
item.FontSize = FontSize;
|
item.FontBold = FontBold;
|
item.FontItalic = FontItalic;
|
item.FontUnderline = FontUnderline;
|
item.TextAlign = TextAlign;
|
item.UpdateDate = UpdateDate;
|
item.UpdateLoginID = UpdateLoginID;
|
item.UpdatePcName = UpdatePcName;
|
item.UpdateID = UpdateID;
|
|
return item;
|
}
|
|
public override bool ConvertDataRow(System.Data.DataRow row)
|
{
|
TabID = CConvert.ToInt(row["TabID"],TabID);
|
Row = CConvert.ToInt(row["Row"],Row);
|
Col = CConvert.ToInt(row["Col"],Col);
|
RoomID = CConvert.ToInt(row["RoomID"],RoomID);
|
DisplayName = row["DisplayName"].ToString();
|
RowHeight = CConvert.ToInt(row["RowHeight"],RowHeight);
|
ColWidth = CConvert.ToInt(row["ColWidth"],ColWidth);
|
BackColor = row["BackColor"].ToString();
|
ForeColor = row["ForeColor"].ToString();
|
Floor = CConvert.ToInt(row["Floor"],Floor);
|
FontName = row["FontName"].ToString();
|
FontSize = CConvert.ToInt(row["FontSize"],FontSize);
|
FontBold = CConvert.ToBool(row["FontBold"]);
|
FontItalic = CConvert.ToBool(row["FontItalic"]);
|
FontUnderline = CConvert.ToBool(row["FontUnderline"]);
|
TextAlign = row["TextAlign"].ToString();
|
UpdateDate = CConvert.ToTimestamp(row.IsNull("UpdateDate") ? DateTime.MinValue : (System.DateTime)row["UpdateDate"]);
|
UpdateLoginID = CConvert.ToInt(row["UpdateLoginID"],UpdateLoginID);
|
UpdatePcName = row["UpdatePcName"].ToString();
|
UpdateID = CConvert.ToInt(row["UpdateID"],UpdateID);
|
|
return true;
|
}
|
|
public void ToDataRow(System.Data.DataRow row)
|
{
|
row["TabID"] = TabID;
|
row["Row"] = Row;
|
row["Col"] = Col;
|
row["RoomID"] = RoomID;
|
row["DisplayName"] = DisplayName;
|
row["RowHeight"] = RowHeight;
|
row["ColWidth"] = ColWidth;
|
row["BackColor"] = BackColor;
|
row["ForeColor"] = ForeColor;
|
row["Floor"] = Floor;
|
row["FontName"] = FontName;
|
row["FontSize"] = FontSize;
|
row["FontBold"] = FontBold;
|
row["FontItalic"] = FontItalic;
|
row["FontUnderline"] = FontUnderline;
|
row["TextAlign"] = TextAlign;
|
row["UpdateDate"] = UpdateDate.ToDateTime();
|
row["UpdateLoginID"] = UpdateLoginID;
|
row["UpdatePcName"] = UpdatePcName;
|
row["UpdateID"] = UpdateID;
|
|
}
|
|
public void ConvertReader(DbDataReader row)
|
{
|
TabID = CConvert.ToInt(row["TabID"],TabID);
|
Row = CConvert.ToInt(row["Row"],Row);
|
Col = CConvert.ToInt(row["Col"],Col);
|
RoomID = CConvert.ToInt(row["RoomID"],RoomID);
|
DisplayName = row["DisplayName"].ToString();
|
RowHeight = CConvert.ToInt(row["RowHeight"],RowHeight);
|
ColWidth = CConvert.ToInt(row["ColWidth"],ColWidth);
|
BackColor = row["BackColor"].ToString();
|
ForeColor = row["ForeColor"].ToString();
|
Floor = CConvert.ToInt(row["Floor"],Floor);
|
FontName = row["FontName"].ToString();
|
FontSize = CConvert.ToInt(row["FontSize"],FontSize);
|
FontBold = CConvert.ToBool(row["FontBold"]);
|
FontItalic = CConvert.ToBool(row["FontItalic"]);
|
FontUnderline = CConvert.ToBool(row["FontUnderline"]);
|
TextAlign = row["TextAlign"].ToString();
|
UpdateDate = CConvert.ToTimestamp(row.IsNull("UpdateDate") ? DateTime.MinValue : (System.DateTime)row["UpdateDate"]);
|
UpdateLoginID = CConvert.ToInt(row["UpdateLoginID"],UpdateLoginID);
|
UpdatePcName = row["UpdatePcName"].ToString();
|
UpdateID = CConvert.ToInt(row["UpdateID"],UpdateID);
|
|
}
|
|
public string AddSql()
|
{
|
return $@"INSERT INTO M_RoomViewLayout(TabID,Row,Col,RoomID,DisplayName,RowHeight,ColWidth,BackColor,ForeColor,Floor,FontName,FontSize,FontBold,FontItalic,FontUnderline,TextAlign,UpdateDate,UpdateLoginID,UpdatePcName,UpdateID) VALUES({TabID},{Row},{Col},{RoomID},N'{DisplayName}',{RowHeight},{ColWidth},N'{BackColor}',N'{ForeColor}',{Floor},N'{FontName}',{FontSize},{(FontBold ? 1 : 0)},{(FontItalic ? 1 : 0)},{(FontUnderline ? 1 : 0)},N'{TextAlign}',GETDATE(),{UpdateLoginID},N'{UpdatePcName}',{UpdateID});";
|
}
|
|
public string UpdateSql()
|
{
|
return $@"UPDATE M_RoomViewLayout SET RoomID = {RoomID},DisplayName = N'{DisplayName}',RowHeight = {RowHeight},ColWidth = {ColWidth},BackColor = N'{BackColor}',ForeColor = N'{ForeColor}',Floor = {Floor},FontName = N'{FontName}',FontSize = {FontSize},FontBold = {(FontBold ? 1 : 0)},FontItalic = {(FontItalic ? 1 : 0)},FontUnderline = {(FontUnderline ? 1 : 0)},TextAlign = N'{TextAlign}',UpdateDate = GETDATE(),UpdateLoginID = {UpdateLoginID},UpdatePcName = N'{UpdatePcName}',UpdateID = {UpdateID} WHERE TabID = {TabID} AND Row = {Row} AND Col = {Col};";
|
}
|
|
public string ToText()
|
{
|
StringBuilder text = new StringBuilder();
|
text.AppendFormat("TabID={0};", TabID);
|
text.AppendFormat("Row={0};", Row);
|
text.AppendFormat("Col={0};", Col);
|
text.AppendFormat("RoomID={0};", RoomID);
|
text.AppendFormat("DisplayName={0};", DisplayName);
|
text.AppendFormat("RowHeight={0};", RowHeight);
|
text.AppendFormat("ColWidth={0};", ColWidth);
|
text.AppendFormat("BackColor={0};", BackColor);
|
text.AppendFormat("ForeColor={0};", ForeColor);
|
text.AppendFormat("Floor={0};", Floor);
|
text.AppendFormat("FontName={0};", FontName);
|
text.AppendFormat("FontSize={0};", FontSize);
|
text.AppendFormat("FontBold={0};", FontBold);
|
text.AppendFormat("FontItalic={0};", FontItalic);
|
text.AppendFormat("FontUnderline={0};", FontUnderline);
|
text.AppendFormat("TextAlign={0};", TextAlign);
|
text.AppendFormat("UpdateDate={0};", UpdateDate);
|
text.AppendFormat("UpdateLoginID={0};", UpdateLoginID);
|
text.AppendFormat("UpdatePcName={0};", UpdatePcName);
|
text.AppendFormat("UpdateID={0};", UpdateID);
|
|
return text.ToString();
|
}
|
|
public override object GetField(string name)
|
{
|
|
if (name == "TabID") { return TabID; }
|
else if (name == "Row") { return Row; }
|
else if (name == "Col") { return Col; }
|
else if (name == "RoomID") { return RoomID; }
|
else if (name == "DisplayName") { return DisplayName; }
|
else if (name == "RowHeight") { return RowHeight; }
|
else if (name == "ColWidth") { return ColWidth; }
|
else if (name == "BackColor") { return BackColor; }
|
else if (name == "ForeColor") { return ForeColor; }
|
else if (name == "Floor") { return Floor; }
|
else if (name == "FontName") { return FontName; }
|
else if (name == "FontSize") { return FontSize; }
|
else if (name == "FontBold") { return FontBold; }
|
else if (name == "FontItalic") { return FontItalic; }
|
else if (name == "FontUnderline") { return FontUnderline; }
|
else if (name == "TextAlign") { return TextAlign; }
|
else if (name == "UpdateDate") { return UpdateDate; }
|
else if (name == "UpdateLoginID") { return UpdateLoginID; }
|
else if (name == "UpdatePcName") { return UpdatePcName; }
|
else if (name == "UpdateID") { return UpdateID; }
|
else { return null; }
|
}
|
|
public override bool SetField(string name, object value)
|
{
|
|
if (name == "TabID") { TabID = CConvert.ToInt(value); return true; }
|
else if (name == "Row") { Row = CConvert.ToInt(value); return true; }
|
else if (name == "Col") { Col = CConvert.ToInt(value); return true; }
|
else if (name == "RoomID") { RoomID = CConvert.ToInt(value); return true; }
|
else if (name == "DisplayName") { DisplayName = value.ToString(); return true; }
|
else if (name == "RowHeight") { RowHeight = CConvert.ToInt(value); return true; }
|
else if (name == "ColWidth") { ColWidth = CConvert.ToInt(value); return true; }
|
else if (name == "BackColor") { BackColor = value.ToString(); return true; }
|
else if (name == "ForeColor") { ForeColor = value.ToString(); return true; }
|
else if (name == "Floor") { Floor = CConvert.ToInt(value); return true; }
|
else if (name == "FontName") { FontName = value.ToString(); return true; }
|
else if (name == "FontSize") { FontSize = CConvert.ToInt(value); return true; }
|
else if (name == "FontBold") { FontBold = CConvert.ToBool(value); return true; }
|
else if (name == "FontItalic") { FontItalic = CConvert.ToBool(value); return true; }
|
else if (name == "FontUnderline") { FontUnderline = CConvert.ToBool(value); return true; }
|
else if (name == "TextAlign") { TextAlign = value.ToString(); return true; }
|
else if (name == "UpdateDate") { UpdateDate = CConvert.ToTimestamp(CConvert.ToDateTime(value)); return true; }
|
else if (name == "UpdateLoginID") { UpdateLoginID = CConvert.ToInt(value); return true; }
|
else if (name == "UpdatePcName") { UpdatePcName = value.ToString(); return true; }
|
else if (name == "UpdateID") { UpdateID = CConvert.ToInt(value); return true; }
|
else { return false; }
|
}
|
|
#endregion
|
}
|
}
|