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 Sale : RecordBase { #region ★★★★★ Property ★★★★★ public static ConcurrentDictionary PrimaryKey { get; } = new ConcurrentDictionary(); #endregion partial void OnConstruction() { if (PrimaryKey.Count == 0) { PrimaryKey.TryAdd("ID", 0); PrimaryKey.TryAdd("DetailID", 0); PrimaryKey.TryAdd("UseDate", 0); PrimaryKey.TryAdd("SaleID", 0); } } #region ★★★★★ Function ★★★★★ public bool CompareTo(Sale item) { if (ID.CompareTo(item.ID) != 0 || DetailID.CompareTo(item.DetailID) != 0 || UseDate.CompareTo(item.UseDate) != 0 || SaleID.CompareTo(item.SaleID) != 0 || ReceiptID.CompareTo(item.ReceiptID) != 0 || ItemID.CompareTo(item.ItemID) != 0 || ItemName.CompareTo(item.ItemName) != 0 || Price.CompareTo(item.Price) != 0 || Amount.CompareTo(item.Amount) != 0 || Summary.CompareTo(item.Summary) != 0 || ServiceIOType.CompareTo(item.ServiceIOType) != 0 || ServiceSummary.CompareTo(item.ServiceSummary) != 0 || ServiceRate.CompareTo(item.ServiceRate) != 0 || TaxType.CompareTo(item.TaxType) != 0 || TaxIOType.CompareTo(item.TaxIOType) != 0 || TaxSummary.CompareTo(item.TaxSummary) != 0 || TaxRate.CompareTo(item.TaxRate) != 0 || BathTaxIOType.CompareTo(item.BathTaxIOType) != 0 || BathTaxType.CompareTo(item.BathTaxType) != 0 || BathTaxUnitPrice.CompareTo(item.BathTaxUnitPrice) != 0 || BathTaxSummary.CompareTo(item.BathTaxSummary) != 0 || AccTaxIOType.CompareTo(item.AccTaxIOType) != 0 || AccTaxSummary.CompareTo(item.AccTaxSummary) != 0 || TotalSummary.CompareTo(item.TotalSummary) != 0 || DiscountRate.CompareTo(item.DiscountRate) != 0 || DiscountSummary.CompareTo(item.DiscountSummary) != 0 || DiscountID.CompareTo(item.DiscountID) != 0 || Pack.CompareTo(item.Pack) != 0 || PackChild.CompareTo(item.PackChild) != 0 || PackSaleID.CompareTo(item.PackSaleID) != 0 || PersonType.CompareTo(item.PersonType) != 0 || PersonCount.CompareTo(item.PersonCount) != 0 || InFemale.CompareTo(item.InFemale) != 0 || UseType.CompareTo(item.UseType) != 0 || BaseAmount.CompareTo(item.BaseAmount) != 0 || PersonRef.CompareTo(item.PersonRef) != 0 || ReceiptItemName.CompareTo(item.ReceiptItemName) != 0 || ReceiptPrtType.CompareTo(item.ReceiptPrtType) != 0 || ReceiptPage.CompareTo(item.ReceiptPage) != 0 || SrcType.CompareTo(item.SrcType) != 0 || FixturesID.CompareTo(item.FixturesID) != 0 || ItemKind.CompareTo(item.ItemKind) != 0 ) { return false; } return true; } public override void CopyTo(object dest) { Sale item = dest as Sale; item.ID = ID; item.DetailID = DetailID; item.UseDate = UseDate; item.SaleID = SaleID; item.ReceiptID = ReceiptID; item.ItemID = ItemID; item.ItemName = ItemName; item.Price = Price; item.Amount = Amount; item.Summary = Summary; item.ServiceIOType = ServiceIOType; item.ServiceSummary = ServiceSummary; item.ServiceRate = ServiceRate; item.TaxType = TaxType; item.TaxIOType = TaxIOType; item.TaxSummary = TaxSummary; item.TaxRate = TaxRate; item.BathTaxIOType = BathTaxIOType; item.BathTaxType = BathTaxType; item.BathTaxUnitPrice = BathTaxUnitPrice; item.BathTaxSummary = BathTaxSummary; item.AccTaxIOType = AccTaxIOType; item.AccTaxSummary = AccTaxSummary; item.TotalSummary = TotalSummary; item.DiscountRate = DiscountRate; item.DiscountSummary = DiscountSummary; item.DiscountID = DiscountID; item.Pack = Pack; item.PackChild = PackChild; item.PackSaleID = PackSaleID; item.PersonType = PersonType; item.PersonCount = PersonCount; item.InFemale = InFemale; item.UseType = UseType; item.BaseAmount = BaseAmount; item.PersonRef = PersonRef; item.ReceiptItemName = ReceiptItemName; item.ReceiptPrtType = ReceiptPrtType; item.ReceiptPage = ReceiptPage; item.SrcType = SrcType; item.FixturesID = FixturesID; item.ItemKind = ItemKind; } public override void Clear() { ID = 0; DetailID = 0; UseDate = Date.Default; SaleID = 0; ReceiptID = 0; ItemID = string.Empty; ItemName = string.Empty; Price = 0; Amount = 0; Summary = 0; ServiceIOType = 0; ServiceSummary = 0; ServiceRate = 0; TaxType = 0; TaxIOType = 0; TaxSummary = 0; TaxRate = 0; BathTaxIOType = 0; BathTaxType = 0; BathTaxUnitPrice = 0; BathTaxSummary = 0; AccTaxIOType = 0; AccTaxSummary = 0; TotalSummary = 0; DiscountRate = 0; DiscountSummary = 0; DiscountID = 0; Pack = false; PackChild = false; PackSaleID = 0; PersonType = 0; PersonCount = 0; InFemale = 0; UseType = 0; BaseAmount = 0; PersonRef = false; ReceiptItemName = string.Empty; ReceiptPrtType = 0; ReceiptPage = 0; SrcType = 0; FixturesID = string.Empty; ItemKind = 0; } public Sale DeepClone() { Sale item = new Sale(); item.ID = ID; item.DetailID = DetailID; item.UseDate = UseDate; item.SaleID = SaleID; item.ReceiptID = ReceiptID; item.ItemID = ItemID; item.ItemName = ItemName; item.Price = Price; item.Amount = Amount; item.Summary = Summary; item.ServiceIOType = ServiceIOType; item.ServiceSummary = ServiceSummary; item.ServiceRate = ServiceRate; item.TaxType = TaxType; item.TaxIOType = TaxIOType; item.TaxSummary = TaxSummary; item.TaxRate = TaxRate; item.BathTaxIOType = BathTaxIOType; item.BathTaxType = BathTaxType; item.BathTaxUnitPrice = BathTaxUnitPrice; item.BathTaxSummary = BathTaxSummary; item.AccTaxIOType = AccTaxIOType; item.AccTaxSummary = AccTaxSummary; item.TotalSummary = TotalSummary; item.DiscountRate = DiscountRate; item.DiscountSummary = DiscountSummary; item.DiscountID = DiscountID; item.Pack = Pack; item.PackChild = PackChild; item.PackSaleID = PackSaleID; item.PersonType = PersonType; item.PersonCount = PersonCount; item.InFemale = InFemale; item.UseType = UseType; item.BaseAmount = BaseAmount; item.PersonRef = PersonRef; item.ReceiptItemName = ReceiptItemName; item.ReceiptPrtType = ReceiptPrtType; item.ReceiptPage = ReceiptPage; item.SrcType = SrcType; item.FixturesID = FixturesID; item.ItemKind = ItemKind; return item; } public override bool ConvertDataRow(System.Data.DataRow row) { ID = CConvert.ToInt(row["ID"],ID); DetailID = CConvert.ToInt(row["DetailID"],DetailID); UseDate = new Date(row.IsNull("UseDate") ? 0 : CConvert.ToDateInt((System.DateTime)row["UseDate"])); SaleID = CConvert.ToInt(row["SaleID"],SaleID); ReceiptID = CConvert.ToInt(row["ReceiptID"],ReceiptID); ItemID = row["ItemID"].ToString(); ItemName = row["ItemName"].ToString(); Price = CConvert.ToDecimal(row["Price"]); Amount = CConvert.ToInt(row["Amount"],Amount); Summary = CConvert.ToDecimal(row["Summary"]); ServiceIOType = CConvert.ToInt(row["ServiceIOType"],ServiceIOType); ServiceSummary = CConvert.ToDecimal(row["ServiceSummary"]); ServiceRate = CConvert.ToDecimal(row["ServiceRate"]); TaxType = CConvert.ToInt(row["TaxType"],TaxType); TaxIOType = CConvert.ToInt(row["TaxIOType"],TaxIOType); TaxSummary = CConvert.ToDecimal(row["TaxSummary"]); TaxRate = CConvert.ToDecimal(row["TaxRate"]); BathTaxIOType = CConvert.ToInt(row["BathTaxIOType"],BathTaxIOType); BathTaxType = CConvert.ToInt(row["BathTaxType"],BathTaxType); BathTaxUnitPrice = CConvert.ToDecimal(row["BathTaxUnitPrice"]); BathTaxSummary = CConvert.ToDecimal(row["BathTaxSummary"]); AccTaxIOType = CConvert.ToInt(row["AccTaxIOType"],AccTaxIOType); AccTaxSummary = CConvert.ToDecimal(row["AccTaxSummary"]); TotalSummary = CConvert.ToDecimal(row["TotalSummary"]); DiscountRate = CConvert.ToDecimal(row["DiscountRate"]); DiscountSummary = CConvert.ToDecimal(row["DiscountSummary"]); DiscountID = CConvert.ToInt(row["DiscountID"],DiscountID); Pack = CConvert.ToBool(row["Pack"]); PackChild = CConvert.ToBool(row["PackChild"]); PackSaleID = CConvert.ToInt(row["PackSaleID"],PackSaleID); PersonType = CConvert.ToInt(row["PersonType"],PersonType); PersonCount = CConvert.ToInt(row["PersonCount"],PersonCount); InFemale = CConvert.ToInt(row["InFemale"],InFemale); UseType = CConvert.ToInt(row["UseType"],UseType); BaseAmount = CConvert.ToInt(row["BaseAmount"],BaseAmount); PersonRef = CConvert.ToBool(row["PersonRef"]); ReceiptItemName = row["ReceiptItemName"].ToString(); ReceiptPrtType = CConvert.ToInt(row["ReceiptPrtType"],ReceiptPrtType); ReceiptPage = CConvert.ToInt(row["ReceiptPage"],ReceiptPage); SrcType = CConvert.ToInt(row["SrcType"],SrcType); FixturesID = row["FixturesID"].ToString(); ItemKind = CConvert.ToInt(row["ItemKind"],ItemKind); return true; } public void ToDataRow(System.Data.DataRow row) { row["ID"] = ID; row["DetailID"] = DetailID; row["UseDate"] = UseDate.ToDateTime(); row["SaleID"] = SaleID; row["ReceiptID"] = ReceiptID; row["ItemID"] = ItemID; row["ItemName"] = ItemName; row["Price"] = Price.ToDecimal(); row["Amount"] = Amount; row["Summary"] = Summary.ToDecimal(); row["ServiceIOType"] = ServiceIOType; row["ServiceSummary"] = ServiceSummary.ToDecimal(); row["ServiceRate"] = ServiceRate.ToDecimal(); row["TaxType"] = TaxType; row["TaxIOType"] = TaxIOType; row["TaxSummary"] = TaxSummary.ToDecimal(); row["TaxRate"] = TaxRate.ToDecimal(); row["BathTaxIOType"] = BathTaxIOType; row["BathTaxType"] = BathTaxType; row["BathTaxUnitPrice"] = BathTaxUnitPrice.ToDecimal(); row["BathTaxSummary"] = BathTaxSummary.ToDecimal(); row["AccTaxIOType"] = AccTaxIOType; row["AccTaxSummary"] = AccTaxSummary.ToDecimal(); row["TotalSummary"] = TotalSummary.ToDecimal(); row["DiscountRate"] = DiscountRate.ToDecimal(); row["DiscountSummary"] = DiscountSummary.ToDecimal(); row["DiscountID"] = DiscountID; row["Pack"] = Pack; row["PackChild"] = PackChild; row["PackSaleID"] = PackSaleID; row["PersonType"] = PersonType; row["PersonCount"] = PersonCount; row["InFemale"] = InFemale; row["UseType"] = UseType; row["BaseAmount"] = BaseAmount; row["PersonRef"] = PersonRef; row["ReceiptItemName"] = ReceiptItemName; row["ReceiptPrtType"] = ReceiptPrtType; row["ReceiptPage"] = ReceiptPage; row["SrcType"] = SrcType; row["FixturesID"] = FixturesID; row["ItemKind"] = ItemKind; } public void ConvertReader(DbDataReader row) { int i = 0; ID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++; DetailID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++; UseDate = new Date(row.IsDBNull(i) ? 0 : CConvert.ToDateInt(row.GetDateTime(i))); i++; SaleID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++; ReceiptID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++; ItemID = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++; ItemName = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++; Price = (decimal)(row.IsDBNull(i) ? 0M : row.GetDecimal(i)); i++; Amount = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++; Summary = (decimal)(row.IsDBNull(i) ? 0M : row.GetDecimal(i)); i++; ServiceIOType = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++; ServiceSummary = (decimal)(row.IsDBNull(i) ? 0M : row.GetDecimal(i)); i++; ServiceRate = (decimal)(row.IsDBNull(i) ? 0M : row.GetDecimal(i)); i++; TaxType = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++; TaxIOType = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++; TaxSummary = (decimal)(row.IsDBNull(i) ? 0M : row.GetDecimal(i)); i++; TaxRate = (decimal)(row.IsDBNull(i) ? 0M : row.GetDecimal(i)); i++; BathTaxIOType = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++; BathTaxType = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++; BathTaxUnitPrice = (decimal)(row.IsDBNull(i) ? 0M : row.GetDecimal(i)); i++; BathTaxSummary = (decimal)(row.IsDBNull(i) ? 0M : row.GetDecimal(i)); i++; AccTaxIOType = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++; AccTaxSummary = (decimal)(row.IsDBNull(i) ? 0M : row.GetDecimal(i)); i++; TotalSummary = (decimal)(row.IsDBNull(i) ? 0M : row.GetDecimal(i)); i++; DiscountRate = (decimal)(row.IsDBNull(i) ? 0M : row.GetDecimal(i)); i++; DiscountSummary = (decimal)(row.IsDBNull(i) ? 0M : row.GetDecimal(i)); i++; DiscountID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++; Pack = (bool)(row.IsDBNull(i) ? false : row.GetBoolean(i)); i++; PackChild = (bool)(row.IsDBNull(i) ? false : row.GetBoolean(i)); i++; PackSaleID = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++; PersonType = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++; PersonCount = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++; InFemale = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++; UseType = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++; BaseAmount = (int)(row.IsDBNull(i) ? 0 : row.GetInt32(i)); i++; PersonRef = (bool)(row.IsDBNull(i) ? false : row.GetBoolean(i)); i++; ReceiptItemName = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++; ReceiptPrtType = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++; ReceiptPage = (int)(row.IsDBNull(i) ? 0 : row.GetInt16(i)); i++; SrcType = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++; FixturesID = (row.IsDBNull(i) ? string.Empty : row.GetString(i)); i++; ItemKind = (byte)(row.IsDBNull(i) ? 0x00 : row.GetByte(i)); i++; } public string AddSql() { return $@"INSERT INTO D_Sale(ID,DetailID,UseDate,SaleID,ReceiptID,ItemID,ItemName,Price,Amount,Summary,ServiceIOType,ServiceSummary,ServiceRate,TaxType,TaxIOType,TaxSummary,TaxRate,BathTaxIOType,BathTaxType,BathTaxUnitPrice,BathTaxSummary,AccTaxIOType,AccTaxSummary,TotalSummary,DiscountRate,DiscountSummary,DiscountID,Pack,PackChild,PackSaleID,PersonType,PersonCount,InFemale,UseType,BaseAmount,PersonRef,ReceiptItemName,ReceiptPrtType,ReceiptPage,SrcType,FixturesID,ItemKind) VALUES({ID},{DetailID},{(UseDate == null ? "NULL" : UseDate.ToSqlValue())},{SaleID},{ReceiptID},N'{ItemID}',N'{ItemName}',{(Price == null ? "0" : Price.ToSqlValue())},{Amount},{(Summary == null ? "0" : Summary.ToSqlValue())},{ServiceIOType},{(ServiceSummary == null ? "0" : ServiceSummary.ToSqlValue())},{(ServiceRate == null ? "0" : ServiceRate.ToSqlValue())},{TaxType},{TaxIOType},{(TaxSummary == null ? "0" : TaxSummary.ToSqlValue())},{(TaxRate == null ? "0" : TaxRate.ToSqlValue())},{BathTaxIOType},{BathTaxType},{(BathTaxUnitPrice == null ? "0" : BathTaxUnitPrice.ToSqlValue())},{(BathTaxSummary == null ? "0" : BathTaxSummary.ToSqlValue())},{AccTaxIOType},{(AccTaxSummary == null ? "0" : AccTaxSummary.ToSqlValue())},{(TotalSummary == null ? "0" : TotalSummary.ToSqlValue())},{(DiscountRate == null ? "0" : DiscountRate.ToSqlValue())},{(DiscountSummary == null ? "0" : DiscountSummary.ToSqlValue())},{DiscountID},{(Pack ? 1 : 0)},{(PackChild ? 1 : 0)},{PackSaleID},{PersonType},{PersonCount},{InFemale},{UseType},{BaseAmount},{(PersonRef ? 1 : 0)},N'{ReceiptItemName}',{ReceiptPrtType},{ReceiptPage},{SrcType},N'{FixturesID}',{ItemKind});"; } public string UpdateSql() { return $@"UPDATE D_Sale SET ReceiptID = {ReceiptID},ItemID = N'{ItemID}',ItemName = N'{ItemName}',Price = {(Price == null ? "0" : Price.ToSqlValue())},Amount = {Amount},Summary = {(Summary == null ? "0" : Summary.ToSqlValue())},ServiceIOType = {ServiceIOType},ServiceSummary = {(ServiceSummary == null ? "0" : ServiceSummary.ToSqlValue())},ServiceRate = {(ServiceRate == null ? "0" : ServiceRate.ToSqlValue())},TaxType = {TaxType},TaxIOType = {TaxIOType},TaxSummary = {(TaxSummary == null ? "0" : TaxSummary.ToSqlValue())},TaxRate = {(TaxRate == null ? "0" : TaxRate.ToSqlValue())},BathTaxIOType = {BathTaxIOType},BathTaxType = {BathTaxType},BathTaxUnitPrice = {(BathTaxUnitPrice == null ? "0" : BathTaxUnitPrice.ToSqlValue())},BathTaxSummary = {(BathTaxSummary == null ? "0" : BathTaxSummary.ToSqlValue())},AccTaxIOType = {AccTaxIOType},AccTaxSummary = {(AccTaxSummary == null ? "0" : AccTaxSummary.ToSqlValue())},TotalSummary = {(TotalSummary == null ? "0" : TotalSummary.ToSqlValue())},DiscountRate = {(DiscountRate == null ? "0" : DiscountRate.ToSqlValue())},DiscountSummary = {(DiscountSummary == null ? "0" : DiscountSummary.ToSqlValue())},DiscountID = {DiscountID},Pack = {(Pack ? 1 : 0)},PackChild = {(PackChild ? 1 : 0)},PackSaleID = {PackSaleID},PersonType = {PersonType},PersonCount = {PersonCount},InFemale = {InFemale},UseType = {UseType},BaseAmount = {BaseAmount},PersonRef = {(PersonRef ? 1 : 0)},ReceiptItemName = N'{ReceiptItemName}',ReceiptPrtType = {ReceiptPrtType},ReceiptPage = {ReceiptPage},SrcType = {SrcType},FixturesID = N'{FixturesID}',ItemKind = {ItemKind} WHERE ID = {ID} AND DetailID = {DetailID} AND UseDate = {(UseDate == null ? "NULL" : UseDate.ToSqlValue())} AND SaleID = {SaleID};"; } public string ToText() { StringBuilder text = new StringBuilder(); text.AppendFormat("ID={0};", ID); text.AppendFormat("DetailID={0};", DetailID); text.AppendFormat("UseDate={0};", UseDate); text.AppendFormat("SaleID={0};", SaleID); text.AppendFormat("ReceiptID={0};", ReceiptID); text.AppendFormat("ItemID={0};", ItemID); text.AppendFormat("ItemName={0};", ItemName); text.AppendFormat("Price={0};", Price); text.AppendFormat("Amount={0};", Amount); text.AppendFormat("Summary={0};", Summary); text.AppendFormat("ServiceIOType={0};", ServiceIOType); text.AppendFormat("ServiceSummary={0};", ServiceSummary); text.AppendFormat("ServiceRate={0};", ServiceRate); text.AppendFormat("TaxType={0};", TaxType); text.AppendFormat("TaxIOType={0};", TaxIOType); text.AppendFormat("TaxSummary={0};", TaxSummary); text.AppendFormat("TaxRate={0};", TaxRate); text.AppendFormat("BathTaxIOType={0};", BathTaxIOType); text.AppendFormat("BathTaxType={0};", BathTaxType); text.AppendFormat("BathTaxUnitPrice={0};", BathTaxUnitPrice); text.AppendFormat("BathTaxSummary={0};", BathTaxSummary); text.AppendFormat("AccTaxIOType={0};", AccTaxIOType); text.AppendFormat("AccTaxSummary={0};", AccTaxSummary); text.AppendFormat("TotalSummary={0};", TotalSummary); text.AppendFormat("DiscountRate={0};", DiscountRate); text.AppendFormat("DiscountSummary={0};", DiscountSummary); text.AppendFormat("DiscountID={0};", DiscountID); text.AppendFormat("Pack={0};", Pack); text.AppendFormat("PackChild={0};", PackChild); text.AppendFormat("PackSaleID={0};", PackSaleID); text.AppendFormat("PersonType={0};", PersonType); text.AppendFormat("PersonCount={0};", PersonCount); text.AppendFormat("InFemale={0};", InFemale); text.AppendFormat("UseType={0};", UseType); text.AppendFormat("BaseAmount={0};", BaseAmount); text.AppendFormat("PersonRef={0};", PersonRef); text.AppendFormat("ReceiptItemName={0};", ReceiptItemName); text.AppendFormat("ReceiptPrtType={0};", ReceiptPrtType); text.AppendFormat("ReceiptPage={0};", ReceiptPage); text.AppendFormat("SrcType={0};", SrcType); text.AppendFormat("FixturesID={0};", FixturesID); text.AppendFormat("ItemKind={0};", ItemKind); return text.ToString(); } public override object GetField(string name) { if (name == "ID") { return ID; } else if (name == "DetailID") { return DetailID; } else if (name == "UseDate") { return UseDate; } else if (name == "SaleID") { return SaleID; } else if (name == "ReceiptID") { return ReceiptID; } else if (name == "ItemID") { return ItemID; } else if (name == "ItemName") { return ItemName; } else if (name == "Price") { return Price; } else if (name == "Amount") { return Amount; } else if (name == "Summary") { return Summary; } else if (name == "ServiceIOType") { return ServiceIOType; } else if (name == "ServiceSummary") { return ServiceSummary; } else if (name == "ServiceRate") { return ServiceRate; } else if (name == "TaxType") { return TaxType; } else if (name == "TaxIOType") { return TaxIOType; } else if (name == "TaxSummary") { return TaxSummary; } else if (name == "TaxRate") { return TaxRate; } else if (name == "BathTaxIOType") { return BathTaxIOType; } else if (name == "BathTaxType") { return BathTaxType; } else if (name == "BathTaxUnitPrice") { return BathTaxUnitPrice; } else if (name == "BathTaxSummary") { return BathTaxSummary; } else if (name == "AccTaxIOType") { return AccTaxIOType; } else if (name == "AccTaxSummary") { return AccTaxSummary; } else if (name == "TotalSummary") { return TotalSummary; } else if (name == "DiscountRate") { return DiscountRate; } else if (name == "DiscountSummary") { return DiscountSummary; } else if (name == "DiscountID") { return DiscountID; } else if (name == "Pack") { return Pack; } else if (name == "PackChild") { return PackChild; } else if (name == "PackSaleID") { return PackSaleID; } else if (name == "PersonType") { return PersonType; } else if (name == "PersonCount") { return PersonCount; } else if (name == "InFemale") { return InFemale; } else if (name == "UseType") { return UseType; } else if (name == "BaseAmount") { return BaseAmount; } else if (name == "PersonRef") { return PersonRef; } else if (name == "ReceiptItemName") { return ReceiptItemName; } else if (name == "ReceiptPrtType") { return ReceiptPrtType; } else if (name == "ReceiptPage") { return ReceiptPage; } else if (name == "SrcType") { return SrcType; } else if (name == "FixturesID") { return FixturesID; } else if (name == "ItemKind") { return ItemKind; } else { return null; } } public override bool SetField(string name, object value) { if (name == "ID") { ID = CConvert.ToInt(value); return true; } else if (name == "DetailID") { DetailID = CConvert.ToInt(value); return true; } else if (name == "UseDate") { UseDate = new Date(CConvert.ToDateInt(value)); return true; } else if (name == "SaleID") { SaleID = CConvert.ToInt(value); return true; } else if (name == "ReceiptID") { ReceiptID = CConvert.ToInt(value); return true; } else if (name == "ItemID") { ItemID = value.ToString(); return true; } else if (name == "ItemName") { ItemName = value.ToString(); return true; } else if (name == "Price") { Price = CConvert.ToDecimal(value); return true; } else if (name == "Amount") { Amount = CConvert.ToInt(value); return true; } else if (name == "Summary") { Summary = CConvert.ToDecimal(value); return true; } else if (name == "ServiceIOType") { ServiceIOType = CConvert.ToInt(value); return true; } else if (name == "ServiceSummary") { ServiceSummary = CConvert.ToDecimal(value); return true; } else if (name == "ServiceRate") { ServiceRate = CConvert.ToDecimal(value); return true; } else if (name == "TaxType") { TaxType = CConvert.ToInt(value); return true; } else if (name == "TaxIOType") { TaxIOType = CConvert.ToInt(value); return true; } else if (name == "TaxSummary") { TaxSummary = CConvert.ToDecimal(value); return true; } else if (name == "TaxRate") { TaxRate = CConvert.ToDecimal(value); return true; } else if (name == "BathTaxIOType") { BathTaxIOType = CConvert.ToInt(value); return true; } else if (name == "BathTaxType") { BathTaxType = CConvert.ToInt(value); return true; } else if (name == "BathTaxUnitPrice") { BathTaxUnitPrice = CConvert.ToDecimal(value); return true; } else if (name == "BathTaxSummary") { BathTaxSummary = CConvert.ToDecimal(value); return true; } else if (name == "AccTaxIOType") { AccTaxIOType = CConvert.ToInt(value); return true; } else if (name == "AccTaxSummary") { AccTaxSummary = CConvert.ToDecimal(value); return true; } else if (name == "TotalSummary") { TotalSummary = CConvert.ToDecimal(value); return true; } else if (name == "DiscountRate") { DiscountRate = CConvert.ToDecimal(value); return true; } else if (name == "DiscountSummary") { DiscountSummary = CConvert.ToDecimal(value); return true; } else if (name == "DiscountID") { DiscountID = CConvert.ToInt(value); return true; } else if (name == "Pack") { Pack = CConvert.ToBool(value); return true; } else if (name == "PackChild") { PackChild = CConvert.ToBool(value); return true; } else if (name == "PackSaleID") { PackSaleID = CConvert.ToInt(value); return true; } else if (name == "PersonType") { PersonType = CConvert.ToInt(value); return true; } else if (name == "PersonCount") { PersonCount = CConvert.ToInt(value); return true; } else if (name == "InFemale") { InFemale = CConvert.ToInt(value); return true; } else if (name == "UseType") { UseType = CConvert.ToInt(value); return true; } else if (name == "BaseAmount") { BaseAmount = CConvert.ToInt(value); return true; } else if (name == "PersonRef") { PersonRef = CConvert.ToBool(value); return true; } else if (name == "ReceiptItemName") { ReceiptItemName = value.ToString(); return true; } else if (name == "ReceiptPrtType") { ReceiptPrtType = CConvert.ToInt(value); return true; } else if (name == "ReceiptPage") { ReceiptPage = CConvert.ToInt(value); return true; } else if (name == "SrcType") { SrcType = CConvert.ToInt(value); return true; } else if (name == "FixturesID") { FixturesID = value.ToString(); return true; } else if (name == "ItemKind") { ItemKind = CConvert.ToInt(value); return true; } else { return false; } } #endregion }