Associations
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
@@ -9,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 6-Jun-2024 17:06:27
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:21
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
@@ -50,8 +51,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public ColumnDataString _DeliveryTypeCode { get; } = new ColumnDataString("DeliveryTypeCode");
|
||||
public ColumnDataString _DeliveryMethodCode { get; } = new ColumnDataString("DeliveryMethodCode");
|
||||
public ColumnDataString _DeliveryBookInCode { get; } = new ColumnDataString("DeliveryBookInCode");
|
||||
public ColumnDataDateTime _LastVisitOn { get; } = new ColumnDataDateTime("LastVisitOn");
|
||||
public ColumnDataDateTime _NextVisitOn { get; } = new ColumnDataDateTime("NextVisitOn");
|
||||
public ColumnDataDateTimeNullable _LastVisitOn { get; } = new ColumnDataDateTimeNullable("LastVisitOn");
|
||||
public ColumnDataDateTimeNullable _NextVisitOn { get; } = new ColumnDataDateTimeNullable("NextVisitOn");
|
||||
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
|
||||
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
|
||||
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
|
||||
@@ -117,6 +118,33 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
"Id",
|
||||
};
|
||||
protected static List<String> fieldsNullable { get; } = new List<String>()
|
||||
{
|
||||
"RefExt",
|
||||
"Name",
|
||||
"DescBrief",
|
||||
"Line2",
|
||||
"Line3",
|
||||
"City",
|
||||
"Province",
|
||||
"Postcode",
|
||||
"PostcodeFmt",
|
||||
"Country",
|
||||
"Contact",
|
||||
"Phone",
|
||||
"Fax",
|
||||
"Email",
|
||||
"AccountManagerCode",
|
||||
"AccountHandlerCode",
|
||||
"ContactAreaCode",
|
||||
"ContactHandlerCode",
|
||||
"DeliveryTypeCode",
|
||||
"DeliveryMethodCode",
|
||||
"DeliveryBookInCode",
|
||||
"LastVisitOn",
|
||||
"NextVisitOn",
|
||||
"Notes",
|
||||
};
|
||||
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
|
||||
{
|
||||
"CreateOn",
|
||||
@@ -171,8 +199,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public String _DeliveryTypeCode { get { return Cols._DeliveryTypeCode.Value; } set { Cols._DeliveryTypeCode.Value = value; } }
|
||||
public String _DeliveryMethodCode { get { return Cols._DeliveryMethodCode.Value; } set { Cols._DeliveryMethodCode.Value = value; } }
|
||||
public String _DeliveryBookInCode { get { return Cols._DeliveryBookInCode.Value; } set { Cols._DeliveryBookInCode.Value = value; } }
|
||||
public DateTime _LastVisitOn { get { return Cols._LastVisitOn.Value; } set { Cols._LastVisitOn.Value = value; } }
|
||||
public DateTime _NextVisitOn { get { return Cols._NextVisitOn.Value; } set { Cols._NextVisitOn.Value = value; } }
|
||||
public DateTime? _LastVisitOn { get { return Cols._LastVisitOn.Value; } set { Cols._LastVisitOn.Value = value; } }
|
||||
public DateTime? _NextVisitOn { get { return Cols._NextVisitOn.Value; } set { Cols._NextVisitOn.Value = value; } }
|
||||
public String _Notes { get { return Cols._Notes.Value; } set { Cols._Notes.Value = value; } }
|
||||
public Int16 _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public String _Status { get { return Cols._Status.Value; } set { Cols._Status.Value = value; } }
|
||||
@@ -185,6 +213,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
// Existing columns - confirmed on database if table exists.
|
||||
public List<String> ExistingColumnNames { get { return GetExistingColumnNames(Fields); } }
|
||||
public List<String> ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } }
|
||||
public List<String> UpdatableColumns { get { return ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Population.
|
||||
@@ -234,8 +263,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
_DeliveryTypeCode = GetFieldString(dbDataReader, "DeliveryTypeCode", _DeliveryTypeCode);
|
||||
_DeliveryMethodCode = GetFieldString(dbDataReader, "DeliveryMethodCode", _DeliveryMethodCode);
|
||||
_DeliveryBookInCode = GetFieldString(dbDataReader, "DeliveryBookInCode", _DeliveryBookInCode);
|
||||
_LastVisitOn = GetFieldDateTime(dbDataReader, "LastVisitOn", _LastVisitOn);
|
||||
_NextVisitOn = GetFieldDateTime(dbDataReader, "NextVisitOn", _NextVisitOn);
|
||||
_LastVisitOn = GetFieldDateTimeNullable(dbDataReader, "LastVisitOn", _LastVisitOn);
|
||||
_NextVisitOn = GetFieldDateTimeNullable(dbDataReader, "NextVisitOn", _NextVisitOn);
|
||||
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
|
||||
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
|
||||
_Status = GetFieldString(dbDataReader, "Status", _Status);
|
||||
@@ -317,10 +346,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update command.
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand)
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand, List<String> columnsToUpdate = null)
|
||||
{
|
||||
// Columns to update.
|
||||
List<String> columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList();
|
||||
List<String> columnNames = (columnsToUpdate?.Any() ?? false ? columnsToUpdate : UpdatableColumns).Where(col => UpdatableColumns.ContainsCI(col)).ToList();
|
||||
if (!columnNames.Any())
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} No columns to update. [{GetType().Name}]");
|
||||
return false;
|
||||
}
|
||||
// Construct query.
|
||||
String query = "UPDATE " + TableNameFmt + " SET ";
|
||||
if (dbCommand is SqlCommand)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
@@ -9,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 6-Jun-2024 17:06:27
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:21
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
@@ -23,7 +24,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public ColumnDataInt16 _Type { get; } = new ColumnDataInt16("Type");
|
||||
public ColumnDataString _Name { get; } = new ColumnDataString("Name");
|
||||
public ColumnDataString _Abbrev { get; } = new ColumnDataString("Abbrev");
|
||||
public ColumnDataInt32 _AffIdParent { get; } = new ColumnDataInt32("AffIdParent");
|
||||
public ColumnDataInt32Nullable _AffIdParent { get; } = new ColumnDataInt32Nullable("AffIdParent");
|
||||
public ColumnDataString _Title { get; } = new ColumnDataString("Title");
|
||||
public ColumnDataString _Initials { get; } = new ColumnDataString("Initials");
|
||||
public ColumnDataString _LastName { get; } = new ColumnDataString("LastName");
|
||||
@@ -40,22 +41,22 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public ColumnDataString _PhoneDirect { get; } = new ColumnDataString("PhoneDirect");
|
||||
public ColumnDataString _Email { get; } = new ColumnDataString("Email");
|
||||
public ColumnDataString _Website { get; } = new ColumnDataString("Website");
|
||||
public ColumnDataByte _BirthDay { get; } = new ColumnDataByte("BirthDay");
|
||||
public ColumnDataByte _BirthMonth { get; } = new ColumnDataByte("BirthMonth");
|
||||
public ColumnDataInt16 _BirthYear { get; } = new ColumnDataInt16("BirthYear");
|
||||
public ColumnDataByteNullable _BirthDay { get; } = new ColumnDataByteNullable("BirthDay");
|
||||
public ColumnDataByteNullable _BirthMonth { get; } = new ColumnDataByteNullable("BirthMonth");
|
||||
public ColumnDataInt16Nullable _BirthYear { get; } = new ColumnDataInt16Nullable("BirthYear");
|
||||
public ColumnDataString _MaritalStatus { get; } = new ColumnDataString("MaritalStatus");
|
||||
public ColumnDataString _Spouse { get; } = new ColumnDataString("Spouse");
|
||||
public ColumnDataString _Children { get; } = new ColumnDataString("Children");
|
||||
public ColumnDataString _Hometown { get; } = new ColumnDataString("Hometown");
|
||||
public ColumnDataInt32 _UserId { get; } = new ColumnDataInt32("UserId");
|
||||
public ColumnDataInt32Nullable _UserId { get; } = new ColumnDataInt32Nullable("UserId");
|
||||
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
|
||||
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
|
||||
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
|
||||
public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn");
|
||||
public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy");
|
||||
public ColumnDataInt32Nullable _CreateBy { get; } = new ColumnDataInt32Nullable("CreateBy");
|
||||
public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost");
|
||||
public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn");
|
||||
public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy");
|
||||
public ColumnDataDateTimeNullable _UpdateOn { get; } = new ColumnDataDateTimeNullable("UpdateOn");
|
||||
public ColumnDataInt32Nullable _UpdateBy { get; } = new ColumnDataInt32Nullable("UpdateBy");
|
||||
public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost");
|
||||
}
|
||||
|
||||
@@ -109,6 +110,41 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
"Id",
|
||||
};
|
||||
protected static List<String> fieldsNullable { get; } = new List<String>()
|
||||
{
|
||||
"Abbrev",
|
||||
"AffIdParent",
|
||||
"Title",
|
||||
"Initials",
|
||||
"LastName",
|
||||
"FirstName",
|
||||
"Salutation",
|
||||
"Nature",
|
||||
"CompanyNo",
|
||||
"VatReg",
|
||||
"Contact",
|
||||
"PhoneMain",
|
||||
"PhoneAlt",
|
||||
"PhoneFax",
|
||||
"PhoneMobile",
|
||||
"PhoneDirect",
|
||||
"Email",
|
||||
"Website",
|
||||
"BirthDay",
|
||||
"BirthMonth",
|
||||
"BirthYear",
|
||||
"MaritalStatus",
|
||||
"Spouse",
|
||||
"Children",
|
||||
"Hometown",
|
||||
"UserId",
|
||||
"Notes",
|
||||
"CreateBy",
|
||||
"CreateHost",
|
||||
"UpdateOn",
|
||||
"UpdateBy",
|
||||
"UpdateHost",
|
||||
};
|
||||
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
|
||||
{
|
||||
"CreateOn",
|
||||
@@ -136,7 +172,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public Int16 _Type { get { return Cols._Type.Value; } set { Cols._Type.Value = value; } }
|
||||
public String _Name { get { return Cols._Name.Value; } set { Cols._Name.Value = value; } }
|
||||
public String _Abbrev { get { return Cols._Abbrev.Value; } set { Cols._Abbrev.Value = value; } }
|
||||
public Int32 _AffIdParent { get { return Cols._AffIdParent.Value; } set { Cols._AffIdParent.Value = value; } }
|
||||
public Int32? _AffIdParent { get { return Cols._AffIdParent.Value; } set { Cols._AffIdParent.Value = value; } }
|
||||
public String _Title { get { return Cols._Title.Value; } set { Cols._Title.Value = value; } }
|
||||
public String _Initials { get { return Cols._Initials.Value; } set { Cols._Initials.Value = value; } }
|
||||
public String _LastName { get { return Cols._LastName.Value; } set { Cols._LastName.Value = value; } }
|
||||
@@ -153,26 +189,27 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public String _PhoneDirect { get { return Cols._PhoneDirect.Value; } set { Cols._PhoneDirect.Value = value; } }
|
||||
public String _Email { get { return Cols._Email.Value; } set { Cols._Email.Value = value; } }
|
||||
public String _Website { get { return Cols._Website.Value; } set { Cols._Website.Value = value; } }
|
||||
public Byte _BirthDay { get { return Cols._BirthDay.Value; } set { Cols._BirthDay.Value = value; } }
|
||||
public Byte _BirthMonth { get { return Cols._BirthMonth.Value; } set { Cols._BirthMonth.Value = value; } }
|
||||
public Int16 _BirthYear { get { return Cols._BirthYear.Value; } set { Cols._BirthYear.Value = value; } }
|
||||
public Byte? _BirthDay { get { return Cols._BirthDay.Value; } set { Cols._BirthDay.Value = value; } }
|
||||
public Byte? _BirthMonth { get { return Cols._BirthMonth.Value; } set { Cols._BirthMonth.Value = value; } }
|
||||
public Int16? _BirthYear { get { return Cols._BirthYear.Value; } set { Cols._BirthYear.Value = value; } }
|
||||
public String _MaritalStatus { get { return Cols._MaritalStatus.Value; } set { Cols._MaritalStatus.Value = value; } }
|
||||
public String _Spouse { get { return Cols._Spouse.Value; } set { Cols._Spouse.Value = value; } }
|
||||
public String _Children { get { return Cols._Children.Value; } set { Cols._Children.Value = value; } }
|
||||
public String _Hometown { get { return Cols._Hometown.Value; } set { Cols._Hometown.Value = value; } }
|
||||
public Int32 _UserId { get { return Cols._UserId.Value; } set { Cols._UserId.Value = value; } }
|
||||
public Int32? _UserId { get { return Cols._UserId.Value; } set { Cols._UserId.Value = value; } }
|
||||
public String _Notes { get { return Cols._Notes.Value; } set { Cols._Notes.Value = value; } }
|
||||
public Int16 _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public String _Status { get { return Cols._Status.Value; } set { Cols._Status.Value = value; } }
|
||||
public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public Int32? _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } }
|
||||
public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public DateTime? _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32? _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } }
|
||||
// Existing columns - confirmed on database if table exists.
|
||||
public List<String> ExistingColumnNames { get { return GetExistingColumnNames(Fields); } }
|
||||
public List<String> ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } }
|
||||
public List<String> UpdatableColumns { get { return ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Population.
|
||||
@@ -195,7 +232,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
_Type = GetFieldInt16(dbDataReader, "Type", _Type);
|
||||
_Name = GetFieldString(dbDataReader, "Name", _Name);
|
||||
_Abbrev = GetFieldString(dbDataReader, "Abbrev", _Abbrev);
|
||||
_AffIdParent = GetFieldInt32(dbDataReader, "AffIdParent", _AffIdParent);
|
||||
_AffIdParent = GetFieldInt32Nullable(dbDataReader, "AffIdParent", _AffIdParent);
|
||||
_Title = GetFieldString(dbDataReader, "Title", _Title);
|
||||
_Initials = GetFieldString(dbDataReader, "Initials", _Initials);
|
||||
_LastName = GetFieldString(dbDataReader, "LastName", _LastName);
|
||||
@@ -212,22 +249,22 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
_PhoneDirect = GetFieldString(dbDataReader, "PhoneDirect", _PhoneDirect);
|
||||
_Email = GetFieldString(dbDataReader, "Email", _Email);
|
||||
_Website = GetFieldString(dbDataReader, "Website", _Website);
|
||||
_BirthDay = GetFieldByte(dbDataReader, "BirthDay", _BirthDay);
|
||||
_BirthMonth = GetFieldByte(dbDataReader, "BirthMonth", _BirthMonth);
|
||||
_BirthYear = GetFieldInt16(dbDataReader, "BirthYear", _BirthYear);
|
||||
_BirthDay = GetFieldByteNullable(dbDataReader, "BirthDay", _BirthDay);
|
||||
_BirthMonth = GetFieldByteNullable(dbDataReader, "BirthMonth", _BirthMonth);
|
||||
_BirthYear = GetFieldInt16Nullable(dbDataReader, "BirthYear", _BirthYear);
|
||||
_MaritalStatus = GetFieldString(dbDataReader, "MaritalStatus", _MaritalStatus);
|
||||
_Spouse = GetFieldString(dbDataReader, "Spouse", _Spouse);
|
||||
_Children = GetFieldString(dbDataReader, "Children", _Children);
|
||||
_Hometown = GetFieldString(dbDataReader, "Hometown", _Hometown);
|
||||
_UserId = GetFieldInt32(dbDataReader, "UserId", _UserId);
|
||||
_UserId = GetFieldInt32Nullable(dbDataReader, "UserId", _UserId);
|
||||
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
|
||||
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
|
||||
_Status = GetFieldString(dbDataReader, "Status", _Status);
|
||||
_CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateBy = GetFieldInt32Nullable(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost);
|
||||
_UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateOn = GetFieldDateTimeNullable(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32Nullable(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost);
|
||||
}
|
||||
|
||||
@@ -297,10 +334,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update command.
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand)
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand, List<String> columnsToUpdate = null)
|
||||
{
|
||||
// Columns to update.
|
||||
List<String> columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList();
|
||||
List<String> columnNames = (columnsToUpdate?.Any() ?? false ? columnsToUpdate : UpdatableColumns).Where(col => UpdatableColumns.ContainsCI(col)).ToList();
|
||||
if (!columnNames.Any())
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} No columns to update. [{GetType().Name}]");
|
||||
return false;
|
||||
}
|
||||
// Construct query.
|
||||
String query = "UPDATE " + TableNameFmt + " SET ";
|
||||
if (dbCommand is SqlCommand)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
@@ -9,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 6-Jun-2024 17:06:27
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:21
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
@@ -40,33 +41,33 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public ColumnDataString _ContactHandlerCode { get; } = new ColumnDataString("ContactHandlerCode");
|
||||
public ColumnDataString _ContactMethodCode { get; } = new ColumnDataString("ContactMethodCode");
|
||||
public ColumnDataString _ContactCallCycleCode { get; } = new ColumnDataString("ContactCallCycleCode");
|
||||
public ColumnDataInt16 _CallsPerYear { get; } = new ColumnDataInt16("CallsPerYear");
|
||||
public ColumnDataDateTime _LastCall { get; } = new ColumnDataDateTime("LastCall");
|
||||
public ColumnDataInt32 _CommodityIdSalesDefault { get; } = new ColumnDataInt32("CommodityIdSalesDefault");
|
||||
public ColumnDataInt16Nullable _CallsPerYear { get; } = new ColumnDataInt16Nullable("CallsPerYear");
|
||||
public ColumnDataDateTimeNullable _LastCall { get; } = new ColumnDataDateTimeNullable("LastCall");
|
||||
public ColumnDataInt32Nullable _CommodityIdSalesDefault { get; } = new ColumnDataInt32Nullable("CommodityIdSalesDefault");
|
||||
public ColumnDataString _OrderLeadTimeCode { get; } = new ColumnDataString("OrderLeadTimeCode");
|
||||
public ColumnDataString _DeliveryTypeCode { get; } = new ColumnDataString("DeliveryTypeCode");
|
||||
public ColumnDataString _DeliveryMethodCode { get; } = new ColumnDataString("DeliveryMethodCode");
|
||||
public ColumnDataString _DeliveryCourierCode { get; } = new ColumnDataString("DeliveryCourierCode");
|
||||
public ColumnDataString _DeliveryBookInCode { get; } = new ColumnDataString("DeliveryBookInCode");
|
||||
public ColumnDataDecimal _AmountTransMax { get; } = new ColumnDataDecimal("AmountTransMax");
|
||||
public ColumnDataDecimal _AnnualSalesTarget { get; } = new ColumnDataDecimal("AnnualSalesTarget");
|
||||
public ColumnDataDecimal _CreditLimit { get; } = new ColumnDataDecimal("CreditLimit");
|
||||
public ColumnDataDecimal _AccountBalance { get; } = new ColumnDataDecimal("AccountBalance");
|
||||
public ColumnDataInt16 _DiscountType { get; } = new ColumnDataInt16("DiscountType");
|
||||
public ColumnDataDecimal _DiscountRate { get; } = new ColumnDataDecimal("DiscountRate");
|
||||
public ColumnDataInt32 _PriceSetId { get; } = new ColumnDataInt32("PriceSetId");
|
||||
public ColumnDataInt32 _TaxCodeId { get; } = new ColumnDataInt32("TaxCodeId");
|
||||
public ColumnDataInt16 _PaymentTerms { get; } = new ColumnDataInt16("PaymentTerms");
|
||||
public ColumnDataDecimalNullable _AmountTransMax { get; } = new ColumnDataDecimalNullable("AmountTransMax");
|
||||
public ColumnDataDecimalNullable _AnnualSalesTarget { get; } = new ColumnDataDecimalNullable("AnnualSalesTarget");
|
||||
public ColumnDataDecimalNullable _CreditLimit { get; } = new ColumnDataDecimalNullable("CreditLimit");
|
||||
public ColumnDataDecimalNullable _AccountBalance { get; } = new ColumnDataDecimalNullable("AccountBalance");
|
||||
public ColumnDataInt16Nullable _DiscountType { get; } = new ColumnDataInt16Nullable("DiscountType");
|
||||
public ColumnDataDecimalNullable _DiscountRate { get; } = new ColumnDataDecimalNullable("DiscountRate");
|
||||
public ColumnDataInt32Nullable _PriceSetId { get; } = new ColumnDataInt32Nullable("PriceSetId");
|
||||
public ColumnDataInt32Nullable _TaxCodeId { get; } = new ColumnDataInt32Nullable("TaxCodeId");
|
||||
public ColumnDataInt16Nullable _PaymentTerms { get; } = new ColumnDataInt16Nullable("PaymentTerms");
|
||||
public ColumnDataString _InvoiceDesc { get; } = new ColumnDataString("InvoiceDesc");
|
||||
public ColumnDataInt32 _Terminated { get; } = new ColumnDataInt32("Terminated");
|
||||
public ColumnDataInt32Nullable _Terminated { get; } = new ColumnDataInt32Nullable("Terminated");
|
||||
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
|
||||
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
|
||||
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
|
||||
public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn");
|
||||
public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy");
|
||||
public ColumnDataInt32Nullable _CreateBy { get; } = new ColumnDataInt32Nullable("CreateBy");
|
||||
public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost");
|
||||
public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn");
|
||||
public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy");
|
||||
public ColumnDataDateTimeNullable _UpdateOn { get; } = new ColumnDataDateTimeNullable("UpdateOn");
|
||||
public ColumnDataInt32Nullable _UpdateBy { get; } = new ColumnDataInt32Nullable("UpdateBy");
|
||||
public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost");
|
||||
}
|
||||
|
||||
@@ -131,6 +132,51 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
"Id",
|
||||
};
|
||||
protected static List<String> fieldsNullable { get; } = new List<String>()
|
||||
{
|
||||
"Code",
|
||||
"ExtRef",
|
||||
"Location",
|
||||
"Role",
|
||||
"PhoneMain",
|
||||
"Email",
|
||||
"Group",
|
||||
"DescDetail",
|
||||
"DefaultNominalCode",
|
||||
"AccountManagerCode",
|
||||
"AccountHandlerCode",
|
||||
"AccountTypeCode",
|
||||
"AccountRatingCode",
|
||||
"ContactAreaCode",
|
||||
"ContactHandlerCode",
|
||||
"ContactMethodCode",
|
||||
"ContactCallCycleCode",
|
||||
"CallsPerYear",
|
||||
"LastCall",
|
||||
"CommodityIdSalesDefault",
|
||||
"OrderLeadTimeCode",
|
||||
"DeliveryTypeCode",
|
||||
"DeliveryMethodCode",
|
||||
"DeliveryCourierCode",
|
||||
"DeliveryBookInCode",
|
||||
"AmountTransMax",
|
||||
"AnnualSalesTarget",
|
||||
"CreditLimit",
|
||||
"AccountBalance",
|
||||
"DiscountType",
|
||||
"DiscountRate",
|
||||
"PriceSetId",
|
||||
"TaxCodeId",
|
||||
"PaymentTerms",
|
||||
"InvoiceDesc",
|
||||
"Terminated",
|
||||
"Notes",
|
||||
"CreateBy",
|
||||
"CreateHost",
|
||||
"UpdateOn",
|
||||
"UpdateBy",
|
||||
"UpdateHost",
|
||||
};
|
||||
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
|
||||
{
|
||||
"CreateOn",
|
||||
@@ -175,37 +221,38 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public String _ContactHandlerCode { get { return Cols._ContactHandlerCode.Value; } set { Cols._ContactHandlerCode.Value = value; } }
|
||||
public String _ContactMethodCode { get { return Cols._ContactMethodCode.Value; } set { Cols._ContactMethodCode.Value = value; } }
|
||||
public String _ContactCallCycleCode { get { return Cols._ContactCallCycleCode.Value; } set { Cols._ContactCallCycleCode.Value = value; } }
|
||||
public Int16 _CallsPerYear { get { return Cols._CallsPerYear.Value; } set { Cols._CallsPerYear.Value = value; } }
|
||||
public DateTime _LastCall { get { return Cols._LastCall.Value; } set { Cols._LastCall.Value = value; } }
|
||||
public Int32 _CommodityIdSalesDefault { get { return Cols._CommodityIdSalesDefault.Value; } set { Cols._CommodityIdSalesDefault.Value = value; } }
|
||||
public Int16? _CallsPerYear { get { return Cols._CallsPerYear.Value; } set { Cols._CallsPerYear.Value = value; } }
|
||||
public DateTime? _LastCall { get { return Cols._LastCall.Value; } set { Cols._LastCall.Value = value; } }
|
||||
public Int32? _CommodityIdSalesDefault { get { return Cols._CommodityIdSalesDefault.Value; } set { Cols._CommodityIdSalesDefault.Value = value; } }
|
||||
public String _OrderLeadTimeCode { get { return Cols._OrderLeadTimeCode.Value; } set { Cols._OrderLeadTimeCode.Value = value; } }
|
||||
public String _DeliveryTypeCode { get { return Cols._DeliveryTypeCode.Value; } set { Cols._DeliveryTypeCode.Value = value; } }
|
||||
public String _DeliveryMethodCode { get { return Cols._DeliveryMethodCode.Value; } set { Cols._DeliveryMethodCode.Value = value; } }
|
||||
public String _DeliveryCourierCode { get { return Cols._DeliveryCourierCode.Value; } set { Cols._DeliveryCourierCode.Value = value; } }
|
||||
public String _DeliveryBookInCode { get { return Cols._DeliveryBookInCode.Value; } set { Cols._DeliveryBookInCode.Value = value; } }
|
||||
public Decimal _AmountTransMax { get { return Cols._AmountTransMax.Value; } set { Cols._AmountTransMax.Value = value; } }
|
||||
public Decimal _AnnualSalesTarget { get { return Cols._AnnualSalesTarget.Value; } set { Cols._AnnualSalesTarget.Value = value; } }
|
||||
public Decimal _CreditLimit { get { return Cols._CreditLimit.Value; } set { Cols._CreditLimit.Value = value; } }
|
||||
public Decimal _AccountBalance { get { return Cols._AccountBalance.Value; } set { Cols._AccountBalance.Value = value; } }
|
||||
public Int16 _DiscountType { get { return Cols._DiscountType.Value; } set { Cols._DiscountType.Value = value; } }
|
||||
public Decimal _DiscountRate { get { return Cols._DiscountRate.Value; } set { Cols._DiscountRate.Value = value; } }
|
||||
public Int32 _PriceSetId { get { return Cols._PriceSetId.Value; } set { Cols._PriceSetId.Value = value; } }
|
||||
public Int32 _TaxCodeId { get { return Cols._TaxCodeId.Value; } set { Cols._TaxCodeId.Value = value; } }
|
||||
public Int16 _PaymentTerms { get { return Cols._PaymentTerms.Value; } set { Cols._PaymentTerms.Value = value; } }
|
||||
public Decimal? _AmountTransMax { get { return Cols._AmountTransMax.Value; } set { Cols._AmountTransMax.Value = value; } }
|
||||
public Decimal? _AnnualSalesTarget { get { return Cols._AnnualSalesTarget.Value; } set { Cols._AnnualSalesTarget.Value = value; } }
|
||||
public Decimal? _CreditLimit { get { return Cols._CreditLimit.Value; } set { Cols._CreditLimit.Value = value; } }
|
||||
public Decimal? _AccountBalance { get { return Cols._AccountBalance.Value; } set { Cols._AccountBalance.Value = value; } }
|
||||
public Int16? _DiscountType { get { return Cols._DiscountType.Value; } set { Cols._DiscountType.Value = value; } }
|
||||
public Decimal? _DiscountRate { get { return Cols._DiscountRate.Value; } set { Cols._DiscountRate.Value = value; } }
|
||||
public Int32? _PriceSetId { get { return Cols._PriceSetId.Value; } set { Cols._PriceSetId.Value = value; } }
|
||||
public Int32? _TaxCodeId { get { return Cols._TaxCodeId.Value; } set { Cols._TaxCodeId.Value = value; } }
|
||||
public Int16? _PaymentTerms { get { return Cols._PaymentTerms.Value; } set { Cols._PaymentTerms.Value = value; } }
|
||||
public String _InvoiceDesc { get { return Cols._InvoiceDesc.Value; } set { Cols._InvoiceDesc.Value = value; } }
|
||||
public Int32 _Terminated { get { return Cols._Terminated.Value; } set { Cols._Terminated.Value = value; } }
|
||||
public Int32? _Terminated { get { return Cols._Terminated.Value; } set { Cols._Terminated.Value = value; } }
|
||||
public String _Notes { get { return Cols._Notes.Value; } set { Cols._Notes.Value = value; } }
|
||||
public Int16 _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public String _Status { get { return Cols._Status.Value; } set { Cols._Status.Value = value; } }
|
||||
public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public Int32? _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } }
|
||||
public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public DateTime? _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32? _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } }
|
||||
// Existing columns - confirmed on database if table exists.
|
||||
public List<String> ExistingColumnNames { get { return GetExistingColumnNames(Fields); } }
|
||||
public List<String> ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } }
|
||||
public List<String> UpdatableColumns { get { return ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Population.
|
||||
@@ -245,33 +292,33 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
_ContactHandlerCode = GetFieldString(dbDataReader, "ContactHandlerCode", _ContactHandlerCode);
|
||||
_ContactMethodCode = GetFieldString(dbDataReader, "ContactMethodCode", _ContactMethodCode);
|
||||
_ContactCallCycleCode = GetFieldString(dbDataReader, "ContactCallCycleCode", _ContactCallCycleCode);
|
||||
_CallsPerYear = GetFieldInt16(dbDataReader, "CallsPerYear", _CallsPerYear);
|
||||
_LastCall = GetFieldDateTime(dbDataReader, "LastCall", _LastCall);
|
||||
_CommodityIdSalesDefault = GetFieldInt32(dbDataReader, "CommodityIdSalesDefault", _CommodityIdSalesDefault);
|
||||
_CallsPerYear = GetFieldInt16Nullable(dbDataReader, "CallsPerYear", _CallsPerYear);
|
||||
_LastCall = GetFieldDateTimeNullable(dbDataReader, "LastCall", _LastCall);
|
||||
_CommodityIdSalesDefault = GetFieldInt32Nullable(dbDataReader, "CommodityIdSalesDefault", _CommodityIdSalesDefault);
|
||||
_OrderLeadTimeCode = GetFieldString(dbDataReader, "OrderLeadTimeCode", _OrderLeadTimeCode);
|
||||
_DeliveryTypeCode = GetFieldString(dbDataReader, "DeliveryTypeCode", _DeliveryTypeCode);
|
||||
_DeliveryMethodCode = GetFieldString(dbDataReader, "DeliveryMethodCode", _DeliveryMethodCode);
|
||||
_DeliveryCourierCode = GetFieldString(dbDataReader, "DeliveryCourierCode", _DeliveryCourierCode);
|
||||
_DeliveryBookInCode = GetFieldString(dbDataReader, "DeliveryBookInCode", _DeliveryBookInCode);
|
||||
_AmountTransMax = GetFieldDecimal(dbDataReader, "AmountTransMax", _AmountTransMax);
|
||||
_AnnualSalesTarget = GetFieldDecimal(dbDataReader, "AnnualSalesTarget", _AnnualSalesTarget);
|
||||
_CreditLimit = GetFieldDecimal(dbDataReader, "CreditLimit", _CreditLimit);
|
||||
_AccountBalance = GetFieldDecimal(dbDataReader, "AccountBalance", _AccountBalance);
|
||||
_DiscountType = GetFieldInt16(dbDataReader, "DiscountType", _DiscountType);
|
||||
_DiscountRate = GetFieldDecimal(dbDataReader, "DiscountRate", _DiscountRate);
|
||||
_PriceSetId = GetFieldInt32(dbDataReader, "PriceSetId", _PriceSetId);
|
||||
_TaxCodeId = GetFieldInt32(dbDataReader, "TaxCodeId", _TaxCodeId);
|
||||
_PaymentTerms = GetFieldInt16(dbDataReader, "PaymentTerms", _PaymentTerms);
|
||||
_AmountTransMax = GetFieldDecimalNullable(dbDataReader, "AmountTransMax", _AmountTransMax);
|
||||
_AnnualSalesTarget = GetFieldDecimalNullable(dbDataReader, "AnnualSalesTarget", _AnnualSalesTarget);
|
||||
_CreditLimit = GetFieldDecimalNullable(dbDataReader, "CreditLimit", _CreditLimit);
|
||||
_AccountBalance = GetFieldDecimalNullable(dbDataReader, "AccountBalance", _AccountBalance);
|
||||
_DiscountType = GetFieldInt16Nullable(dbDataReader, "DiscountType", _DiscountType);
|
||||
_DiscountRate = GetFieldDecimalNullable(dbDataReader, "DiscountRate", _DiscountRate);
|
||||
_PriceSetId = GetFieldInt32Nullable(dbDataReader, "PriceSetId", _PriceSetId);
|
||||
_TaxCodeId = GetFieldInt32Nullable(dbDataReader, "TaxCodeId", _TaxCodeId);
|
||||
_PaymentTerms = GetFieldInt16Nullable(dbDataReader, "PaymentTerms", _PaymentTerms);
|
||||
_InvoiceDesc = GetFieldString(dbDataReader, "InvoiceDesc", _InvoiceDesc);
|
||||
_Terminated = GetFieldInt32(dbDataReader, "Terminated", _Terminated);
|
||||
_Terminated = GetFieldInt32Nullable(dbDataReader, "Terminated", _Terminated);
|
||||
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
|
||||
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
|
||||
_Status = GetFieldString(dbDataReader, "Status", _Status);
|
||||
_CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateBy = GetFieldInt32Nullable(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost);
|
||||
_UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateOn = GetFieldDateTimeNullable(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32Nullable(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost);
|
||||
}
|
||||
|
||||
@@ -352,10 +399,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update command.
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand)
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand, List<String> columnsToUpdate = null)
|
||||
{
|
||||
// Columns to update.
|
||||
List<String> columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList();
|
||||
List<String> columnNames = (columnsToUpdate?.Any() ?? false ? columnsToUpdate : UpdatableColumns).Where(col => UpdatableColumns.ContainsCI(col)).ToList();
|
||||
if (!columnNames.Any())
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} No columns to update. [{GetType().Name}]");
|
||||
return false;
|
||||
}
|
||||
// Construct query.
|
||||
String query = "UPDATE " + TableNameFmt + " SET ";
|
||||
if (dbCommand is SqlCommand)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
@@ -9,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 6-Jun-2024 17:06:27
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:21
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
@@ -29,10 +30,10 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
|
||||
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
|
||||
public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn");
|
||||
public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy");
|
||||
public ColumnDataInt32Nullable _CreateBy { get; } = new ColumnDataInt32Nullable("CreateBy");
|
||||
public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost");
|
||||
public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn");
|
||||
public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy");
|
||||
public ColumnDataDateTimeNullable _UpdateOn { get; } = new ColumnDataDateTimeNullable("UpdateOn");
|
||||
public ColumnDataInt32Nullable _UpdateBy { get; } = new ColumnDataInt32Nullable("UpdateBy");
|
||||
public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost");
|
||||
}
|
||||
|
||||
@@ -64,6 +65,17 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
"CommodityId",
|
||||
"AssocIdCustomer",
|
||||
};
|
||||
protected static List<String> fieldsNullable { get; } = new List<String>()
|
||||
{
|
||||
"ProductCode",
|
||||
"PromotionCode",
|
||||
"Notes",
|
||||
"CreateBy",
|
||||
"CreateHost",
|
||||
"UpdateOn",
|
||||
"UpdateBy",
|
||||
"UpdateHost",
|
||||
};
|
||||
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
|
||||
{
|
||||
"CreateOn",
|
||||
@@ -97,14 +109,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public Int16 _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public String _Status { get { return Cols._Status.Value; } set { Cols._Status.Value = value; } }
|
||||
public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public Int32? _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } }
|
||||
public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public DateTime? _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32? _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } }
|
||||
// Existing columns - confirmed on database if table exists.
|
||||
public List<String> ExistingColumnNames { get { return GetExistingColumnNames(Fields); } }
|
||||
public List<String> ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } }
|
||||
public List<String> UpdatableColumns { get { return ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Population.
|
||||
@@ -133,10 +146,10 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
|
||||
_Status = GetFieldString(dbDataReader, "Status", _Status);
|
||||
_CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateBy = GetFieldInt32Nullable(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost);
|
||||
_UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateOn = GetFieldDateTimeNullable(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32Nullable(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost);
|
||||
}
|
||||
|
||||
@@ -183,10 +196,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update command.
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand)
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand, List<String> columnsToUpdate = null)
|
||||
{
|
||||
// Columns to update.
|
||||
List<String> columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList();
|
||||
List<String> columnNames = (columnsToUpdate?.Any() ?? false ? columnsToUpdate : UpdatableColumns).Where(col => UpdatableColumns.ContainsCI(col)).ToList();
|
||||
if (!columnNames.Any())
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} No columns to update. [{GetType().Name}]");
|
||||
return false;
|
||||
}
|
||||
// Construct query.
|
||||
String query = "UPDATE " + TableNameFmt + " SET ";
|
||||
if (dbCommand is SqlCommand)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
@@ -9,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 6-Jun-2024 17:06:27
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:21
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
@@ -22,16 +23,16 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public ColumnDataInt32 _CommodityId { get; } = new ColumnDataInt32("CommodityId");
|
||||
public ColumnDataInt32 _AssocIdSupplier { get; } = new ColumnDataInt32("AssocIdSupplier");
|
||||
public ColumnDataString _ProductCode { get; } = new ColumnDataString("ProductCode");
|
||||
public ColumnDataDecimal _AmountCost { get; } = new ColumnDataDecimal("AmountCost");
|
||||
public ColumnDataInt32 _CurrencyIdCost { get; } = new ColumnDataInt32("CurrencyIdCost");
|
||||
public ColumnDataDecimalNullable _AmountCost { get; } = new ColumnDataDecimalNullable("AmountCost");
|
||||
public ColumnDataInt32Nullable _CurrencyIdCost { get; } = new ColumnDataInt32Nullable("CurrencyIdCost");
|
||||
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
|
||||
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
|
||||
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
|
||||
public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn");
|
||||
public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy");
|
||||
public ColumnDataInt32Nullable _CreateBy { get; } = new ColumnDataInt32Nullable("CreateBy");
|
||||
public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost");
|
||||
public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn");
|
||||
public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy");
|
||||
public ColumnDataDateTimeNullable _UpdateOn { get; } = new ColumnDataDateTimeNullable("UpdateOn");
|
||||
public ColumnDataInt32Nullable _UpdateBy { get; } = new ColumnDataInt32Nullable("UpdateBy");
|
||||
public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost");
|
||||
}
|
||||
|
||||
@@ -62,6 +63,18 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
"CommodityId",
|
||||
"AssocIdSupplier",
|
||||
};
|
||||
protected static List<String> fieldsNullable { get; } = new List<String>()
|
||||
{
|
||||
"ProductCode",
|
||||
"AmountCost",
|
||||
"CurrencyIdCost",
|
||||
"Notes",
|
||||
"CreateBy",
|
||||
"CreateHost",
|
||||
"UpdateOn",
|
||||
"UpdateBy",
|
||||
"UpdateHost",
|
||||
};
|
||||
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
|
||||
{
|
||||
"CreateOn",
|
||||
@@ -88,20 +101,21 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public Int32 _CommodityId { get { return Cols._CommodityId.Value; } set { Cols._CommodityId.Value = value; } }
|
||||
public Int32 _AssocIdSupplier { get { return Cols._AssocIdSupplier.Value; } set { Cols._AssocIdSupplier.Value = value; } }
|
||||
public String _ProductCode { get { return Cols._ProductCode.Value; } set { Cols._ProductCode.Value = value; } }
|
||||
public Decimal _AmountCost { get { return Cols._AmountCost.Value; } set { Cols._AmountCost.Value = value; } }
|
||||
public Int32 _CurrencyIdCost { get { return Cols._CurrencyIdCost.Value; } set { Cols._CurrencyIdCost.Value = value; } }
|
||||
public Decimal? _AmountCost { get { return Cols._AmountCost.Value; } set { Cols._AmountCost.Value = value; } }
|
||||
public Int32? _CurrencyIdCost { get { return Cols._CurrencyIdCost.Value; } set { Cols._CurrencyIdCost.Value = value; } }
|
||||
public String _Notes { get { return Cols._Notes.Value; } set { Cols._Notes.Value = value; } }
|
||||
public Int16 _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public String _Status { get { return Cols._Status.Value; } set { Cols._Status.Value = value; } }
|
||||
public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public Int32? _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } }
|
||||
public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public DateTime? _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32? _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } }
|
||||
// Existing columns - confirmed on database if table exists.
|
||||
public List<String> ExistingColumnNames { get { return GetExistingColumnNames(Fields); } }
|
||||
public List<String> ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } }
|
||||
public List<String> UpdatableColumns { get { return ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Population.
|
||||
@@ -123,16 +137,16 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
_CommodityId = GetFieldInt32(dbDataReader, "CommodityId", _CommodityId);
|
||||
_AssocIdSupplier = GetFieldInt32(dbDataReader, "AssocIdSupplier", _AssocIdSupplier);
|
||||
_ProductCode = GetFieldString(dbDataReader, "ProductCode", _ProductCode);
|
||||
_AmountCost = GetFieldDecimal(dbDataReader, "AmountCost", _AmountCost);
|
||||
_CurrencyIdCost = GetFieldInt32(dbDataReader, "CurrencyIdCost", _CurrencyIdCost);
|
||||
_AmountCost = GetFieldDecimalNullable(dbDataReader, "AmountCost", _AmountCost);
|
||||
_CurrencyIdCost = GetFieldInt32Nullable(dbDataReader, "CurrencyIdCost", _CurrencyIdCost);
|
||||
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
|
||||
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
|
||||
_Status = GetFieldString(dbDataReader, "Status", _Status);
|
||||
_CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateBy = GetFieldInt32Nullable(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost);
|
||||
_UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateOn = GetFieldDateTimeNullable(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32Nullable(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost);
|
||||
}
|
||||
|
||||
@@ -178,10 +192,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update command.
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand)
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand, List<String> columnsToUpdate = null)
|
||||
{
|
||||
// Columns to update.
|
||||
List<String> columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList();
|
||||
List<String> columnNames = (columnsToUpdate?.Any() ?? false ? columnsToUpdate : UpdatableColumns).Where(col => UpdatableColumns.ContainsCI(col)).ToList();
|
||||
if (!columnNames.Any())
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} No columns to update. [{GetType().Name}]");
|
||||
return false;
|
||||
}
|
||||
// Construct query.
|
||||
String query = "UPDATE " + TableNameFmt + " SET ";
|
||||
if (dbCommand is SqlCommand)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
@@ -9,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 6-Jun-2024 17:06:27
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:21
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
@@ -28,7 +29,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public ColumnDataString _DescDetail { get; } = new ColumnDataString("DescDetail");
|
||||
public ColumnDataString _DrawingNo { get; } = new ColumnDataString("DrawingNo");
|
||||
public ColumnDataString _DrawingIssue { get; } = new ColumnDataString("DrawingIssue");
|
||||
public ColumnDataInt32 _AssetCatId { get; } = new ColumnDataInt32("AssetCatId");
|
||||
public ColumnDataInt32Nullable _AssetCatId { get; } = new ColumnDataInt32Nullable("AssetCatId");
|
||||
public ColumnDataString _ImagePath { get; } = new ColumnDataString("ImagePath");
|
||||
public ColumnDataString _Category { get; } = new ColumnDataString("Category");
|
||||
public ColumnDataString _Category2 { get; } = new ColumnDataString("Category2");
|
||||
@@ -36,23 +37,23 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public ColumnDataString _Location { get; } = new ColumnDataString("Location");
|
||||
public ColumnDataString _Department { get; } = new ColumnDataString("Department");
|
||||
public ColumnDataString _CatalogRef { get; } = new ColumnDataString("CatalogRef");
|
||||
public ColumnDataDecimal _Weight { get; } = new ColumnDataDecimal("Weight");
|
||||
public ColumnDataInt32 _UomIdWeight { get; } = new ColumnDataInt32("UomIdWeight");
|
||||
public ColumnDataDecimal _Length { get; } = new ColumnDataDecimal("Length");
|
||||
public ColumnDataInt32 _UomIdLength { get; } = new ColumnDataInt32("UomIdLength");
|
||||
public ColumnDataDecimal _Volume { get; } = new ColumnDataDecimal("Volume");
|
||||
public ColumnDataInt32 _UomIdVolume { get; } = new ColumnDataInt32("UomIdVolume");
|
||||
public ColumnDataDecimal _Density { get; } = new ColumnDataDecimal("Density");
|
||||
public ColumnDataInt32 _UomIdDensity { get; } = new ColumnDataInt32("UomIdDensity");
|
||||
public ColumnDataDecimal _BoxQuantity { get; } = new ColumnDataDecimal("BoxQuantity");
|
||||
public ColumnDataInt32 _UomIdBox { get; } = new ColumnDataInt32("UomIdBox");
|
||||
public ColumnDataDecimalNullable _Weight { get; } = new ColumnDataDecimalNullable("Weight");
|
||||
public ColumnDataInt32Nullable _UomIdWeight { get; } = new ColumnDataInt32Nullable("UomIdWeight");
|
||||
public ColumnDataDecimalNullable _Length { get; } = new ColumnDataDecimalNullable("Length");
|
||||
public ColumnDataInt32Nullable _UomIdLength { get; } = new ColumnDataInt32Nullable("UomIdLength");
|
||||
public ColumnDataDecimalNullable _Volume { get; } = new ColumnDataDecimalNullable("Volume");
|
||||
public ColumnDataInt32Nullable _UomIdVolume { get; } = new ColumnDataInt32Nullable("UomIdVolume");
|
||||
public ColumnDataDecimalNullable _Density { get; } = new ColumnDataDecimalNullable("Density");
|
||||
public ColumnDataInt32Nullable _UomIdDensity { get; } = new ColumnDataInt32Nullable("UomIdDensity");
|
||||
public ColumnDataDecimalNullable _BoxQuantity { get; } = new ColumnDataDecimalNullable("BoxQuantity");
|
||||
public ColumnDataInt32Nullable _UomIdBox { get; } = new ColumnDataInt32Nullable("UomIdBox");
|
||||
public ColumnDataString _Dimensions { get; } = new ColumnDataString("Dimensions");
|
||||
public ColumnDataString _SpecSummary { get; } = new ColumnDataString("SpecSummary");
|
||||
public ColumnDataString _NominalCode { get; } = new ColumnDataString("NominalCode");
|
||||
public ColumnDataString _NominalCodePurchase { get; } = new ColumnDataString("NominalCodePurchase");
|
||||
public ColumnDataString _ICNTariffCode { get; } = new ColumnDataString("ICNTariffCode");
|
||||
public ColumnDataDecimal _TimeProd { get; } = new ColumnDataDecimal("TimeProd");
|
||||
public ColumnDataInt32 _UomIdTimeProd { get; } = new ColumnDataInt32("UomIdTimeProd");
|
||||
public ColumnDataDecimalNullable _TimeProd { get; } = new ColumnDataDecimalNullable("TimeProd");
|
||||
public ColumnDataInt32Nullable _UomIdTimeProd { get; } = new ColumnDataInt32Nullable("UomIdTimeProd");
|
||||
public ColumnDataString _RangeCode { get; } = new ColumnDataString("RangeCode");
|
||||
public ColumnDataString _ColourCode { get; } = new ColumnDataString("ColourCode");
|
||||
public ColumnDataString _SourceCode { get; } = new ColumnDataString("SourceCode");
|
||||
@@ -62,57 +63,57 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public ColumnDataString _MaterialCode { get; } = new ColumnDataString("MaterialCode");
|
||||
public ColumnDataString _FinishCode { get; } = new ColumnDataString("FinishCode");
|
||||
public ColumnDataString _PromotionCode { get; } = new ColumnDataString("PromotionCode");
|
||||
public ColumnDataInt32 _AssIdSupplier { get; } = new ColumnDataInt32("AssIdSupplier");
|
||||
public ColumnDataInt32Nullable _AssIdSupplier { get; } = new ColumnDataInt32Nullable("AssIdSupplier");
|
||||
public ColumnDataString _SupplierRef { get; } = new ColumnDataString("SupplierRef");
|
||||
public ColumnDataDecimal _CostPrice { get; } = new ColumnDataDecimal("CostPrice");
|
||||
public ColumnDataDecimalNullable _CostPrice { get; } = new ColumnDataDecimalNullable("CostPrice");
|
||||
public ColumnDataString _PlaceOfOrigin { get; } = new ColumnDataString("PlaceOfOrigin");
|
||||
public ColumnDataDecimal _MaterialCost { get; } = new ColumnDataDecimal("MaterialCost");
|
||||
public ColumnDataInt32 _CurrencyIdMaterial { get; } = new ColumnDataInt32("CurrencyIdMaterial");
|
||||
public ColumnDataDecimal _ExWorksCost { get; } = new ColumnDataDecimal("ExWorksCost");
|
||||
public ColumnDataInt32 _CurrencyIdExWorks { get; } = new ColumnDataInt32("CurrencyIdExWorks");
|
||||
public ColumnDataDecimal _ReorderLevel { get; } = new ColumnDataDecimal("ReorderLevel");
|
||||
public ColumnDataDecimal _ReorderQty { get; } = new ColumnDataDecimal("ReorderQty");
|
||||
public ColumnDataDecimal _QtyOnOrder { get; } = new ColumnDataDecimal("QtyOnOrder");
|
||||
public ColumnDataInt32 _AssIdCustomer { get; } = new ColumnDataInt32("AssIdCustomer");
|
||||
public ColumnDataDecimal _SalesPrice { get; } = new ColumnDataDecimal("SalesPrice");
|
||||
public ColumnDataDecimal _RetailPrice { get; } = new ColumnDataDecimal("RetailPrice");
|
||||
public ColumnDataDecimal _RetailPricePlanned { get; } = new ColumnDataDecimal("RetailPricePlanned");
|
||||
public ColumnDataInt32 _UomIdSale { get; } = new ColumnDataInt32("UomIdSale");
|
||||
public ColumnDataDecimal _PackQty { get; } = new ColumnDataDecimal("PackQty");
|
||||
public ColumnDataDecimal _CarriageCostIndicative { get; } = new ColumnDataDecimal("CarriageCostIndicative");
|
||||
public ColumnDataDecimal _MinOrderQty { get; } = new ColumnDataDecimal("MinOrderQty");
|
||||
public ColumnDataInt32 _TaxCodeId { get; } = new ColumnDataInt32("TaxCodeId");
|
||||
public ColumnDataDateTime _LastOrderDate { get; } = new ColumnDataDateTime("LastOrderDate");
|
||||
public ColumnDataDecimal _LastOrderQty { get; } = new ColumnDataDecimal("LastOrderQty");
|
||||
public ColumnDataDecimal _QtyInStock { get; } = new ColumnDataDecimal("QtyInStock");
|
||||
public ColumnDataDecimal _QtyAllocated { get; } = new ColumnDataDecimal("QtyAllocated");
|
||||
public ColumnDataDecimal _FreeStock { get; } = new ColumnDataDecimal("FreeStock");
|
||||
public ColumnDataDateTime _StockTakeDate { get; } = new ColumnDataDateTime("StockTakeDate");
|
||||
public ColumnDataDecimal _StockTakeQty { get; } = new ColumnDataDecimal("StockTakeQty");
|
||||
public ColumnDataInt16 _OrderQtyDecimals { get; } = new ColumnDataInt16("OrderQtyDecimals");
|
||||
public ColumnDataInt32 _CommodityIdSalesProj { get; } = new ColumnDataInt32("CommodityIdSalesProj");
|
||||
public ColumnDataDecimalNullable _MaterialCost { get; } = new ColumnDataDecimalNullable("MaterialCost");
|
||||
public ColumnDataInt32Nullable _CurrencyIdMaterial { get; } = new ColumnDataInt32Nullable("CurrencyIdMaterial");
|
||||
public ColumnDataDecimalNullable _ExWorksCost { get; } = new ColumnDataDecimalNullable("ExWorksCost");
|
||||
public ColumnDataInt32Nullable _CurrencyIdExWorks { get; } = new ColumnDataInt32Nullable("CurrencyIdExWorks");
|
||||
public ColumnDataDecimalNullable _ReorderLevel { get; } = new ColumnDataDecimalNullable("ReorderLevel");
|
||||
public ColumnDataDecimalNullable _ReorderQty { get; } = new ColumnDataDecimalNullable("ReorderQty");
|
||||
public ColumnDataDecimalNullable _QtyOnOrder { get; } = new ColumnDataDecimalNullable("QtyOnOrder");
|
||||
public ColumnDataInt32Nullable _AssIdCustomer { get; } = new ColumnDataInt32Nullable("AssIdCustomer");
|
||||
public ColumnDataDecimalNullable _SalesPrice { get; } = new ColumnDataDecimalNullable("SalesPrice");
|
||||
public ColumnDataDecimalNullable _RetailPrice { get; } = new ColumnDataDecimalNullable("RetailPrice");
|
||||
public ColumnDataDecimalNullable _RetailPricePlanned { get; } = new ColumnDataDecimalNullable("RetailPricePlanned");
|
||||
public ColumnDataInt32Nullable _UomIdSale { get; } = new ColumnDataInt32Nullable("UomIdSale");
|
||||
public ColumnDataDecimalNullable _PackQty { get; } = new ColumnDataDecimalNullable("PackQty");
|
||||
public ColumnDataDecimalNullable _CarriageCostIndicative { get; } = new ColumnDataDecimalNullable("CarriageCostIndicative");
|
||||
public ColumnDataDecimalNullable _MinOrderQty { get; } = new ColumnDataDecimalNullable("MinOrderQty");
|
||||
public ColumnDataInt32Nullable _TaxCodeId { get; } = new ColumnDataInt32Nullable("TaxCodeId");
|
||||
public ColumnDataDateTimeNullable _LastOrderDate { get; } = new ColumnDataDateTimeNullable("LastOrderDate");
|
||||
public ColumnDataDecimalNullable _LastOrderQty { get; } = new ColumnDataDecimalNullable("LastOrderQty");
|
||||
public ColumnDataDecimalNullable _QtyInStock { get; } = new ColumnDataDecimalNullable("QtyInStock");
|
||||
public ColumnDataDecimalNullable _QtyAllocated { get; } = new ColumnDataDecimalNullable("QtyAllocated");
|
||||
public ColumnDataDecimalNullable _FreeStock { get; } = new ColumnDataDecimalNullable("FreeStock");
|
||||
public ColumnDataDateTimeNullable _StockTakeDate { get; } = new ColumnDataDateTimeNullable("StockTakeDate");
|
||||
public ColumnDataDecimalNullable _StockTakeQty { get; } = new ColumnDataDecimalNullable("StockTakeQty");
|
||||
public ColumnDataInt16Nullable _OrderQtyDecimals { get; } = new ColumnDataInt16Nullable("OrderQtyDecimals");
|
||||
public ColumnDataInt32Nullable _CommodityIdSalesProj { get; } = new ColumnDataInt32Nullable("CommodityIdSalesProj");
|
||||
public ColumnDataString _SalesProjMonthlyProp { get; } = new ColumnDataString("SalesProjMonthlyProp");
|
||||
public ColumnDataDecimal _SalesProjAnnual { get; } = new ColumnDataDecimal("SalesProjAnnual");
|
||||
public ColumnDataDecimal _SalesProjMonth01 { get; } = new ColumnDataDecimal("SalesProjMonth01");
|
||||
public ColumnDataDecimal _SalesProjMonth02 { get; } = new ColumnDataDecimal("SalesProjMonth02");
|
||||
public ColumnDataDecimal _SalesProjMonth03 { get; } = new ColumnDataDecimal("SalesProjMonth03");
|
||||
public ColumnDataDecimal _SalesProjMonth04 { get; } = new ColumnDataDecimal("SalesProjMonth04");
|
||||
public ColumnDataDecimal _SalesProjMonth05 { get; } = new ColumnDataDecimal("SalesProjMonth05");
|
||||
public ColumnDataDecimal _SalesProjMonth06 { get; } = new ColumnDataDecimal("SalesProjMonth06");
|
||||
public ColumnDataDecimal _SalesProjMonth07 { get; } = new ColumnDataDecimal("SalesProjMonth07");
|
||||
public ColumnDataDecimal _SalesProjMonth08 { get; } = new ColumnDataDecimal("SalesProjMonth08");
|
||||
public ColumnDataDecimal _SalesProjMonth09 { get; } = new ColumnDataDecimal("SalesProjMonth09");
|
||||
public ColumnDataDecimal _SalesProjMonth10 { get; } = new ColumnDataDecimal("SalesProjMonth10");
|
||||
public ColumnDataDecimal _SalesProjMonth11 { get; } = new ColumnDataDecimal("SalesProjMonth11");
|
||||
public ColumnDataDecimal _SalesProjMonth12 { get; } = new ColumnDataDecimal("SalesProjMonth12");
|
||||
public ColumnDataDecimalNullable _SalesProjAnnual { get; } = new ColumnDataDecimalNullable("SalesProjAnnual");
|
||||
public ColumnDataDecimalNullable _SalesProjMonth01 { get; } = new ColumnDataDecimalNullable("SalesProjMonth01");
|
||||
public ColumnDataDecimalNullable _SalesProjMonth02 { get; } = new ColumnDataDecimalNullable("SalesProjMonth02");
|
||||
public ColumnDataDecimalNullable _SalesProjMonth03 { get; } = new ColumnDataDecimalNullable("SalesProjMonth03");
|
||||
public ColumnDataDecimalNullable _SalesProjMonth04 { get; } = new ColumnDataDecimalNullable("SalesProjMonth04");
|
||||
public ColumnDataDecimalNullable _SalesProjMonth05 { get; } = new ColumnDataDecimalNullable("SalesProjMonth05");
|
||||
public ColumnDataDecimalNullable _SalesProjMonth06 { get; } = new ColumnDataDecimalNullable("SalesProjMonth06");
|
||||
public ColumnDataDecimalNullable _SalesProjMonth07 { get; } = new ColumnDataDecimalNullable("SalesProjMonth07");
|
||||
public ColumnDataDecimalNullable _SalesProjMonth08 { get; } = new ColumnDataDecimalNullable("SalesProjMonth08");
|
||||
public ColumnDataDecimalNullable _SalesProjMonth09 { get; } = new ColumnDataDecimalNullable("SalesProjMonth09");
|
||||
public ColumnDataDecimalNullable _SalesProjMonth10 { get; } = new ColumnDataDecimalNullable("SalesProjMonth10");
|
||||
public ColumnDataDecimalNullable _SalesProjMonth11 { get; } = new ColumnDataDecimalNullable("SalesProjMonth11");
|
||||
public ColumnDataDecimalNullable _SalesProjMonth12 { get; } = new ColumnDataDecimalNullable("SalesProjMonth12");
|
||||
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
|
||||
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
|
||||
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
|
||||
public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn");
|
||||
public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy");
|
||||
public ColumnDataInt32Nullable _CreateBy { get; } = new ColumnDataInt32Nullable("CreateBy");
|
||||
public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost");
|
||||
public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn");
|
||||
public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy");
|
||||
public ColumnDataDateTimeNullable _UpdateOn { get; } = new ColumnDataDateTimeNullable("UpdateOn");
|
||||
public ColumnDataInt32Nullable _UpdateBy { get; } = new ColumnDataInt32Nullable("UpdateBy");
|
||||
public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost");
|
||||
}
|
||||
|
||||
@@ -223,6 +224,96 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
"Id",
|
||||
};
|
||||
protected static List<String> fieldsNullable { get; } = new List<String>()
|
||||
{
|
||||
"DescOrder",
|
||||
"DescDetail",
|
||||
"DrawingNo",
|
||||
"DrawingIssue",
|
||||
"AssetCatId",
|
||||
"ImagePath",
|
||||
"Category",
|
||||
"Category2",
|
||||
"Category3",
|
||||
"Location",
|
||||
"Department",
|
||||
"CatalogRef",
|
||||
"Weight",
|
||||
"UomIdWeight",
|
||||
"Length",
|
||||
"UomIdLength",
|
||||
"Volume",
|
||||
"UomIdVolume",
|
||||
"Density",
|
||||
"UomIdDensity",
|
||||
"BoxQuantity",
|
||||
"UomIdBox",
|
||||
"Dimensions",
|
||||
"SpecSummary",
|
||||
"NominalCode",
|
||||
"NominalCodePurchase",
|
||||
"ICNTariffCode",
|
||||
"TimeProd",
|
||||
"UomIdTimeProd",
|
||||
"RangeCode",
|
||||
"ColourCode",
|
||||
"SourceCode",
|
||||
"SupplyMethodCode",
|
||||
"HandlingCode",
|
||||
"DeliveryCode",
|
||||
"MaterialCode",
|
||||
"FinishCode",
|
||||
"PromotionCode",
|
||||
"AssIdSupplier",
|
||||
"SupplierRef",
|
||||
"CostPrice",
|
||||
"PlaceOfOrigin",
|
||||
"MaterialCost",
|
||||
"CurrencyIdMaterial",
|
||||
"ExWorksCost",
|
||||
"CurrencyIdExWorks",
|
||||
"ReorderLevel",
|
||||
"ReorderQty",
|
||||
"QtyOnOrder",
|
||||
"AssIdCustomer",
|
||||
"SalesPrice",
|
||||
"RetailPrice",
|
||||
"RetailPricePlanned",
|
||||
"UomIdSale",
|
||||
"PackQty",
|
||||
"CarriageCostIndicative",
|
||||
"MinOrderQty",
|
||||
"TaxCodeId",
|
||||
"LastOrderDate",
|
||||
"LastOrderQty",
|
||||
"QtyInStock",
|
||||
"QtyAllocated",
|
||||
"FreeStock",
|
||||
"StockTakeDate",
|
||||
"StockTakeQty",
|
||||
"OrderQtyDecimals",
|
||||
"CommodityIdSalesProj",
|
||||
"SalesProjMonthlyProp",
|
||||
"SalesProjAnnual",
|
||||
"SalesProjMonth01",
|
||||
"SalesProjMonth02",
|
||||
"SalesProjMonth03",
|
||||
"SalesProjMonth04",
|
||||
"SalesProjMonth05",
|
||||
"SalesProjMonth06",
|
||||
"SalesProjMonth07",
|
||||
"SalesProjMonth08",
|
||||
"SalesProjMonth09",
|
||||
"SalesProjMonth10",
|
||||
"SalesProjMonth11",
|
||||
"SalesProjMonth12",
|
||||
"Notes",
|
||||
"CreateBy",
|
||||
"CreateHost",
|
||||
"UpdateOn",
|
||||
"UpdateBy",
|
||||
"UpdateHost",
|
||||
};
|
||||
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
|
||||
{
|
||||
"CreateOn",
|
||||
@@ -255,7 +346,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public String _DescDetail { get { return Cols._DescDetail.Value; } set { Cols._DescDetail.Value = value; } }
|
||||
public String _DrawingNo { get { return Cols._DrawingNo.Value; } set { Cols._DrawingNo.Value = value; } }
|
||||
public String _DrawingIssue { get { return Cols._DrawingIssue.Value; } set { Cols._DrawingIssue.Value = value; } }
|
||||
public Int32 _AssetCatId { get { return Cols._AssetCatId.Value; } set { Cols._AssetCatId.Value = value; } }
|
||||
public Int32? _AssetCatId { get { return Cols._AssetCatId.Value; } set { Cols._AssetCatId.Value = value; } }
|
||||
public String _ImagePath { get { return Cols._ImagePath.Value; } set { Cols._ImagePath.Value = value; } }
|
||||
public String _Category { get { return Cols._Category.Value; } set { Cols._Category.Value = value; } }
|
||||
public String _Category2 { get { return Cols._Category2.Value; } set { Cols._Category2.Value = value; } }
|
||||
@@ -263,23 +354,23 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public String _Location { get { return Cols._Location.Value; } set { Cols._Location.Value = value; } }
|
||||
public String _Department { get { return Cols._Department.Value; } set { Cols._Department.Value = value; } }
|
||||
public String _CatalogRef { get { return Cols._CatalogRef.Value; } set { Cols._CatalogRef.Value = value; } }
|
||||
public Decimal _Weight { get { return Cols._Weight.Value; } set { Cols._Weight.Value = value; } }
|
||||
public Int32 _UomIdWeight { get { return Cols._UomIdWeight.Value; } set { Cols._UomIdWeight.Value = value; } }
|
||||
public Decimal _Length { get { return Cols._Length.Value; } set { Cols._Length.Value = value; } }
|
||||
public Int32 _UomIdLength { get { return Cols._UomIdLength.Value; } set { Cols._UomIdLength.Value = value; } }
|
||||
public Decimal _Volume { get { return Cols._Volume.Value; } set { Cols._Volume.Value = value; } }
|
||||
public Int32 _UomIdVolume { get { return Cols._UomIdVolume.Value; } set { Cols._UomIdVolume.Value = value; } }
|
||||
public Decimal _Density { get { return Cols._Density.Value; } set { Cols._Density.Value = value; } }
|
||||
public Int32 _UomIdDensity { get { return Cols._UomIdDensity.Value; } set { Cols._UomIdDensity.Value = value; } }
|
||||
public Decimal _BoxQuantity { get { return Cols._BoxQuantity.Value; } set { Cols._BoxQuantity.Value = value; } }
|
||||
public Int32 _UomIdBox { get { return Cols._UomIdBox.Value; } set { Cols._UomIdBox.Value = value; } }
|
||||
public Decimal? _Weight { get { return Cols._Weight.Value; } set { Cols._Weight.Value = value; } }
|
||||
public Int32? _UomIdWeight { get { return Cols._UomIdWeight.Value; } set { Cols._UomIdWeight.Value = value; } }
|
||||
public Decimal? _Length { get { return Cols._Length.Value; } set { Cols._Length.Value = value; } }
|
||||
public Int32? _UomIdLength { get { return Cols._UomIdLength.Value; } set { Cols._UomIdLength.Value = value; } }
|
||||
public Decimal? _Volume { get { return Cols._Volume.Value; } set { Cols._Volume.Value = value; } }
|
||||
public Int32? _UomIdVolume { get { return Cols._UomIdVolume.Value; } set { Cols._UomIdVolume.Value = value; } }
|
||||
public Decimal? _Density { get { return Cols._Density.Value; } set { Cols._Density.Value = value; } }
|
||||
public Int32? _UomIdDensity { get { return Cols._UomIdDensity.Value; } set { Cols._UomIdDensity.Value = value; } }
|
||||
public Decimal? _BoxQuantity { get { return Cols._BoxQuantity.Value; } set { Cols._BoxQuantity.Value = value; } }
|
||||
public Int32? _UomIdBox { get { return Cols._UomIdBox.Value; } set { Cols._UomIdBox.Value = value; } }
|
||||
public String _Dimensions { get { return Cols._Dimensions.Value; } set { Cols._Dimensions.Value = value; } }
|
||||
public String _SpecSummary { get { return Cols._SpecSummary.Value; } set { Cols._SpecSummary.Value = value; } }
|
||||
public String _NominalCode { get { return Cols._NominalCode.Value; } set { Cols._NominalCode.Value = value; } }
|
||||
public String _NominalCodePurchase { get { return Cols._NominalCodePurchase.Value; } set { Cols._NominalCodePurchase.Value = value; } }
|
||||
public String _ICNTariffCode { get { return Cols._ICNTariffCode.Value; } set { Cols._ICNTariffCode.Value = value; } }
|
||||
public Decimal _TimeProd { get { return Cols._TimeProd.Value; } set { Cols._TimeProd.Value = value; } }
|
||||
public Int32 _UomIdTimeProd { get { return Cols._UomIdTimeProd.Value; } set { Cols._UomIdTimeProd.Value = value; } }
|
||||
public Decimal? _TimeProd { get { return Cols._TimeProd.Value; } set { Cols._TimeProd.Value = value; } }
|
||||
public Int32? _UomIdTimeProd { get { return Cols._UomIdTimeProd.Value; } set { Cols._UomIdTimeProd.Value = value; } }
|
||||
public String _RangeCode { get { return Cols._RangeCode.Value; } set { Cols._RangeCode.Value = value; } }
|
||||
public String _ColourCode { get { return Cols._ColourCode.Value; } set { Cols._ColourCode.Value = value; } }
|
||||
public String _SourceCode { get { return Cols._SourceCode.Value; } set { Cols._SourceCode.Value = value; } }
|
||||
@@ -289,61 +380,62 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public String _MaterialCode { get { return Cols._MaterialCode.Value; } set { Cols._MaterialCode.Value = value; } }
|
||||
public String _FinishCode { get { return Cols._FinishCode.Value; } set { Cols._FinishCode.Value = value; } }
|
||||
public String _PromotionCode { get { return Cols._PromotionCode.Value; } set { Cols._PromotionCode.Value = value; } }
|
||||
public Int32 _AssIdSupplier { get { return Cols._AssIdSupplier.Value; } set { Cols._AssIdSupplier.Value = value; } }
|
||||
public Int32? _AssIdSupplier { get { return Cols._AssIdSupplier.Value; } set { Cols._AssIdSupplier.Value = value; } }
|
||||
public String _SupplierRef { get { return Cols._SupplierRef.Value; } set { Cols._SupplierRef.Value = value; } }
|
||||
public Decimal _CostPrice { get { return Cols._CostPrice.Value; } set { Cols._CostPrice.Value = value; } }
|
||||
public Decimal? _CostPrice { get { return Cols._CostPrice.Value; } set { Cols._CostPrice.Value = value; } }
|
||||
public String _PlaceOfOrigin { get { return Cols._PlaceOfOrigin.Value; } set { Cols._PlaceOfOrigin.Value = value; } }
|
||||
public Decimal _MaterialCost { get { return Cols._MaterialCost.Value; } set { Cols._MaterialCost.Value = value; } }
|
||||
public Int32 _CurrencyIdMaterial { get { return Cols._CurrencyIdMaterial.Value; } set { Cols._CurrencyIdMaterial.Value = value; } }
|
||||
public Decimal _ExWorksCost { get { return Cols._ExWorksCost.Value; } set { Cols._ExWorksCost.Value = value; } }
|
||||
public Int32 _CurrencyIdExWorks { get { return Cols._CurrencyIdExWorks.Value; } set { Cols._CurrencyIdExWorks.Value = value; } }
|
||||
public Decimal _ReorderLevel { get { return Cols._ReorderLevel.Value; } set { Cols._ReorderLevel.Value = value; } }
|
||||
public Decimal _ReorderQty { get { return Cols._ReorderQty.Value; } set { Cols._ReorderQty.Value = value; } }
|
||||
public Decimal _QtyOnOrder { get { return Cols._QtyOnOrder.Value; } set { Cols._QtyOnOrder.Value = value; } }
|
||||
public Int32 _AssIdCustomer { get { return Cols._AssIdCustomer.Value; } set { Cols._AssIdCustomer.Value = value; } }
|
||||
public Decimal _SalesPrice { get { return Cols._SalesPrice.Value; } set { Cols._SalesPrice.Value = value; } }
|
||||
public Decimal _RetailPrice { get { return Cols._RetailPrice.Value; } set { Cols._RetailPrice.Value = value; } }
|
||||
public Decimal _RetailPricePlanned { get { return Cols._RetailPricePlanned.Value; } set { Cols._RetailPricePlanned.Value = value; } }
|
||||
public Int32 _UomIdSale { get { return Cols._UomIdSale.Value; } set { Cols._UomIdSale.Value = value; } }
|
||||
public Decimal _PackQty { get { return Cols._PackQty.Value; } set { Cols._PackQty.Value = value; } }
|
||||
public Decimal _CarriageCostIndicative { get { return Cols._CarriageCostIndicative.Value; } set { Cols._CarriageCostIndicative.Value = value; } }
|
||||
public Decimal _MinOrderQty { get { return Cols._MinOrderQty.Value; } set { Cols._MinOrderQty.Value = value; } }
|
||||
public Int32 _TaxCodeId { get { return Cols._TaxCodeId.Value; } set { Cols._TaxCodeId.Value = value; } }
|
||||
public DateTime _LastOrderDate { get { return Cols._LastOrderDate.Value; } set { Cols._LastOrderDate.Value = value; } }
|
||||
public Decimal _LastOrderQty { get { return Cols._LastOrderQty.Value; } set { Cols._LastOrderQty.Value = value; } }
|
||||
public Decimal _QtyInStock { get { return Cols._QtyInStock.Value; } set { Cols._QtyInStock.Value = value; } }
|
||||
public Decimal _QtyAllocated { get { return Cols._QtyAllocated.Value; } set { Cols._QtyAllocated.Value = value; } }
|
||||
public Decimal _FreeStock { get { return Cols._FreeStock.Value; } set { Cols._FreeStock.Value = value; } }
|
||||
public DateTime _StockTakeDate { get { return Cols._StockTakeDate.Value; } set { Cols._StockTakeDate.Value = value; } }
|
||||
public Decimal _StockTakeQty { get { return Cols._StockTakeQty.Value; } set { Cols._StockTakeQty.Value = value; } }
|
||||
public Int16 _OrderQtyDecimals { get { return Cols._OrderQtyDecimals.Value; } set { Cols._OrderQtyDecimals.Value = value; } }
|
||||
public Int32 _CommodityIdSalesProj { get { return Cols._CommodityIdSalesProj.Value; } set { Cols._CommodityIdSalesProj.Value = value; } }
|
||||
public Decimal? _MaterialCost { get { return Cols._MaterialCost.Value; } set { Cols._MaterialCost.Value = value; } }
|
||||
public Int32? _CurrencyIdMaterial { get { return Cols._CurrencyIdMaterial.Value; } set { Cols._CurrencyIdMaterial.Value = value; } }
|
||||
public Decimal? _ExWorksCost { get { return Cols._ExWorksCost.Value; } set { Cols._ExWorksCost.Value = value; } }
|
||||
public Int32? _CurrencyIdExWorks { get { return Cols._CurrencyIdExWorks.Value; } set { Cols._CurrencyIdExWorks.Value = value; } }
|
||||
public Decimal? _ReorderLevel { get { return Cols._ReorderLevel.Value; } set { Cols._ReorderLevel.Value = value; } }
|
||||
public Decimal? _ReorderQty { get { return Cols._ReorderQty.Value; } set { Cols._ReorderQty.Value = value; } }
|
||||
public Decimal? _QtyOnOrder { get { return Cols._QtyOnOrder.Value; } set { Cols._QtyOnOrder.Value = value; } }
|
||||
public Int32? _AssIdCustomer { get { return Cols._AssIdCustomer.Value; } set { Cols._AssIdCustomer.Value = value; } }
|
||||
public Decimal? _SalesPrice { get { return Cols._SalesPrice.Value; } set { Cols._SalesPrice.Value = value; } }
|
||||
public Decimal? _RetailPrice { get { return Cols._RetailPrice.Value; } set { Cols._RetailPrice.Value = value; } }
|
||||
public Decimal? _RetailPricePlanned { get { return Cols._RetailPricePlanned.Value; } set { Cols._RetailPricePlanned.Value = value; } }
|
||||
public Int32? _UomIdSale { get { return Cols._UomIdSale.Value; } set { Cols._UomIdSale.Value = value; } }
|
||||
public Decimal? _PackQty { get { return Cols._PackQty.Value; } set { Cols._PackQty.Value = value; } }
|
||||
public Decimal? _CarriageCostIndicative { get { return Cols._CarriageCostIndicative.Value; } set { Cols._CarriageCostIndicative.Value = value; } }
|
||||
public Decimal? _MinOrderQty { get { return Cols._MinOrderQty.Value; } set { Cols._MinOrderQty.Value = value; } }
|
||||
public Int32? _TaxCodeId { get { return Cols._TaxCodeId.Value; } set { Cols._TaxCodeId.Value = value; } }
|
||||
public DateTime? _LastOrderDate { get { return Cols._LastOrderDate.Value; } set { Cols._LastOrderDate.Value = value; } }
|
||||
public Decimal? _LastOrderQty { get { return Cols._LastOrderQty.Value; } set { Cols._LastOrderQty.Value = value; } }
|
||||
public Decimal? _QtyInStock { get { return Cols._QtyInStock.Value; } set { Cols._QtyInStock.Value = value; } }
|
||||
public Decimal? _QtyAllocated { get { return Cols._QtyAllocated.Value; } set { Cols._QtyAllocated.Value = value; } }
|
||||
public Decimal? _FreeStock { get { return Cols._FreeStock.Value; } set { Cols._FreeStock.Value = value; } }
|
||||
public DateTime? _StockTakeDate { get { return Cols._StockTakeDate.Value; } set { Cols._StockTakeDate.Value = value; } }
|
||||
public Decimal? _StockTakeQty { get { return Cols._StockTakeQty.Value; } set { Cols._StockTakeQty.Value = value; } }
|
||||
public Int16? _OrderQtyDecimals { get { return Cols._OrderQtyDecimals.Value; } set { Cols._OrderQtyDecimals.Value = value; } }
|
||||
public Int32? _CommodityIdSalesProj { get { return Cols._CommodityIdSalesProj.Value; } set { Cols._CommodityIdSalesProj.Value = value; } }
|
||||
public String _SalesProjMonthlyProp { get { return Cols._SalesProjMonthlyProp.Value; } set { Cols._SalesProjMonthlyProp.Value = value; } }
|
||||
public Decimal _SalesProjAnnual { get { return Cols._SalesProjAnnual.Value; } set { Cols._SalesProjAnnual.Value = value; } }
|
||||
public Decimal _SalesProjMonth01 { get { return Cols._SalesProjMonth01.Value; } set { Cols._SalesProjMonth01.Value = value; } }
|
||||
public Decimal _SalesProjMonth02 { get { return Cols._SalesProjMonth02.Value; } set { Cols._SalesProjMonth02.Value = value; } }
|
||||
public Decimal _SalesProjMonth03 { get { return Cols._SalesProjMonth03.Value; } set { Cols._SalesProjMonth03.Value = value; } }
|
||||
public Decimal _SalesProjMonth04 { get { return Cols._SalesProjMonth04.Value; } set { Cols._SalesProjMonth04.Value = value; } }
|
||||
public Decimal _SalesProjMonth05 { get { return Cols._SalesProjMonth05.Value; } set { Cols._SalesProjMonth05.Value = value; } }
|
||||
public Decimal _SalesProjMonth06 { get { return Cols._SalesProjMonth06.Value; } set { Cols._SalesProjMonth06.Value = value; } }
|
||||
public Decimal _SalesProjMonth07 { get { return Cols._SalesProjMonth07.Value; } set { Cols._SalesProjMonth07.Value = value; } }
|
||||
public Decimal _SalesProjMonth08 { get { return Cols._SalesProjMonth08.Value; } set { Cols._SalesProjMonth08.Value = value; } }
|
||||
public Decimal _SalesProjMonth09 { get { return Cols._SalesProjMonth09.Value; } set { Cols._SalesProjMonth09.Value = value; } }
|
||||
public Decimal _SalesProjMonth10 { get { return Cols._SalesProjMonth10.Value; } set { Cols._SalesProjMonth10.Value = value; } }
|
||||
public Decimal _SalesProjMonth11 { get { return Cols._SalesProjMonth11.Value; } set { Cols._SalesProjMonth11.Value = value; } }
|
||||
public Decimal _SalesProjMonth12 { get { return Cols._SalesProjMonth12.Value; } set { Cols._SalesProjMonth12.Value = value; } }
|
||||
public Decimal? _SalesProjAnnual { get { return Cols._SalesProjAnnual.Value; } set { Cols._SalesProjAnnual.Value = value; } }
|
||||
public Decimal? _SalesProjMonth01 { get { return Cols._SalesProjMonth01.Value; } set { Cols._SalesProjMonth01.Value = value; } }
|
||||
public Decimal? _SalesProjMonth02 { get { return Cols._SalesProjMonth02.Value; } set { Cols._SalesProjMonth02.Value = value; } }
|
||||
public Decimal? _SalesProjMonth03 { get { return Cols._SalesProjMonth03.Value; } set { Cols._SalesProjMonth03.Value = value; } }
|
||||
public Decimal? _SalesProjMonth04 { get { return Cols._SalesProjMonth04.Value; } set { Cols._SalesProjMonth04.Value = value; } }
|
||||
public Decimal? _SalesProjMonth05 { get { return Cols._SalesProjMonth05.Value; } set { Cols._SalesProjMonth05.Value = value; } }
|
||||
public Decimal? _SalesProjMonth06 { get { return Cols._SalesProjMonth06.Value; } set { Cols._SalesProjMonth06.Value = value; } }
|
||||
public Decimal? _SalesProjMonth07 { get { return Cols._SalesProjMonth07.Value; } set { Cols._SalesProjMonth07.Value = value; } }
|
||||
public Decimal? _SalesProjMonth08 { get { return Cols._SalesProjMonth08.Value; } set { Cols._SalesProjMonth08.Value = value; } }
|
||||
public Decimal? _SalesProjMonth09 { get { return Cols._SalesProjMonth09.Value; } set { Cols._SalesProjMonth09.Value = value; } }
|
||||
public Decimal? _SalesProjMonth10 { get { return Cols._SalesProjMonth10.Value; } set { Cols._SalesProjMonth10.Value = value; } }
|
||||
public Decimal? _SalesProjMonth11 { get { return Cols._SalesProjMonth11.Value; } set { Cols._SalesProjMonth11.Value = value; } }
|
||||
public Decimal? _SalesProjMonth12 { get { return Cols._SalesProjMonth12.Value; } set { Cols._SalesProjMonth12.Value = value; } }
|
||||
public String _Notes { get { return Cols._Notes.Value; } set { Cols._Notes.Value = value; } }
|
||||
public Int16 _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public String _Status { get { return Cols._Status.Value; } set { Cols._Status.Value = value; } }
|
||||
public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public Int32? _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } }
|
||||
public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public DateTime? _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32? _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } }
|
||||
// Existing columns - confirmed on database if table exists.
|
||||
public List<String> ExistingColumnNames { get { return GetExistingColumnNames(Fields); } }
|
||||
public List<String> ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } }
|
||||
public List<String> UpdatableColumns { get { return ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Population.
|
||||
@@ -371,7 +463,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
_DescDetail = GetFieldString(dbDataReader, "DescDetail", _DescDetail);
|
||||
_DrawingNo = GetFieldString(dbDataReader, "DrawingNo", _DrawingNo);
|
||||
_DrawingIssue = GetFieldString(dbDataReader, "DrawingIssue", _DrawingIssue);
|
||||
_AssetCatId = GetFieldInt32(dbDataReader, "AssetCatId", _AssetCatId);
|
||||
_AssetCatId = GetFieldInt32Nullable(dbDataReader, "AssetCatId", _AssetCatId);
|
||||
_ImagePath = GetFieldString(dbDataReader, "ImagePath", _ImagePath);
|
||||
_Category = GetFieldString(dbDataReader, "Category", _Category);
|
||||
_Category2 = GetFieldString(dbDataReader, "Category2", _Category2);
|
||||
@@ -379,23 +471,23 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
_Location = GetFieldString(dbDataReader, "Location", _Location);
|
||||
_Department = GetFieldString(dbDataReader, "Department", _Department);
|
||||
_CatalogRef = GetFieldString(dbDataReader, "CatalogRef", _CatalogRef);
|
||||
_Weight = GetFieldDecimal(dbDataReader, "Weight", _Weight);
|
||||
_UomIdWeight = GetFieldInt32(dbDataReader, "UomIdWeight", _UomIdWeight);
|
||||
_Length = GetFieldDecimal(dbDataReader, "Length", _Length);
|
||||
_UomIdLength = GetFieldInt32(dbDataReader, "UomIdLength", _UomIdLength);
|
||||
_Volume = GetFieldDecimal(dbDataReader, "Volume", _Volume);
|
||||
_UomIdVolume = GetFieldInt32(dbDataReader, "UomIdVolume", _UomIdVolume);
|
||||
_Density = GetFieldDecimal(dbDataReader, "Density", _Density);
|
||||
_UomIdDensity = GetFieldInt32(dbDataReader, "UomIdDensity", _UomIdDensity);
|
||||
_BoxQuantity = GetFieldDecimal(dbDataReader, "BoxQuantity", _BoxQuantity);
|
||||
_UomIdBox = GetFieldInt32(dbDataReader, "UomIdBox", _UomIdBox);
|
||||
_Weight = GetFieldDecimalNullable(dbDataReader, "Weight", _Weight);
|
||||
_UomIdWeight = GetFieldInt32Nullable(dbDataReader, "UomIdWeight", _UomIdWeight);
|
||||
_Length = GetFieldDecimalNullable(dbDataReader, "Length", _Length);
|
||||
_UomIdLength = GetFieldInt32Nullable(dbDataReader, "UomIdLength", _UomIdLength);
|
||||
_Volume = GetFieldDecimalNullable(dbDataReader, "Volume", _Volume);
|
||||
_UomIdVolume = GetFieldInt32Nullable(dbDataReader, "UomIdVolume", _UomIdVolume);
|
||||
_Density = GetFieldDecimalNullable(dbDataReader, "Density", _Density);
|
||||
_UomIdDensity = GetFieldInt32Nullable(dbDataReader, "UomIdDensity", _UomIdDensity);
|
||||
_BoxQuantity = GetFieldDecimalNullable(dbDataReader, "BoxQuantity", _BoxQuantity);
|
||||
_UomIdBox = GetFieldInt32Nullable(dbDataReader, "UomIdBox", _UomIdBox);
|
||||
_Dimensions = GetFieldString(dbDataReader, "Dimensions", _Dimensions);
|
||||
_SpecSummary = GetFieldString(dbDataReader, "SpecSummary", _SpecSummary);
|
||||
_NominalCode = GetFieldString(dbDataReader, "NominalCode", _NominalCode);
|
||||
_NominalCodePurchase = GetFieldString(dbDataReader, "NominalCodePurchase", _NominalCodePurchase);
|
||||
_ICNTariffCode = GetFieldString(dbDataReader, "ICNTariffCode", _ICNTariffCode);
|
||||
_TimeProd = GetFieldDecimal(dbDataReader, "TimeProd", _TimeProd);
|
||||
_UomIdTimeProd = GetFieldInt32(dbDataReader, "UomIdTimeProd", _UomIdTimeProd);
|
||||
_TimeProd = GetFieldDecimalNullable(dbDataReader, "TimeProd", _TimeProd);
|
||||
_UomIdTimeProd = GetFieldInt32Nullable(dbDataReader, "UomIdTimeProd", _UomIdTimeProd);
|
||||
_RangeCode = GetFieldString(dbDataReader, "RangeCode", _RangeCode);
|
||||
_ColourCode = GetFieldString(dbDataReader, "ColourCode", _ColourCode);
|
||||
_SourceCode = GetFieldString(dbDataReader, "SourceCode", _SourceCode);
|
||||
@@ -405,57 +497,57 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
_MaterialCode = GetFieldString(dbDataReader, "MaterialCode", _MaterialCode);
|
||||
_FinishCode = GetFieldString(dbDataReader, "FinishCode", _FinishCode);
|
||||
_PromotionCode = GetFieldString(dbDataReader, "PromotionCode", _PromotionCode);
|
||||
_AssIdSupplier = GetFieldInt32(dbDataReader, "AssIdSupplier", _AssIdSupplier);
|
||||
_AssIdSupplier = GetFieldInt32Nullable(dbDataReader, "AssIdSupplier", _AssIdSupplier);
|
||||
_SupplierRef = GetFieldString(dbDataReader, "SupplierRef", _SupplierRef);
|
||||
_CostPrice = GetFieldDecimal(dbDataReader, "CostPrice", _CostPrice);
|
||||
_CostPrice = GetFieldDecimalNullable(dbDataReader, "CostPrice", _CostPrice);
|
||||
_PlaceOfOrigin = GetFieldString(dbDataReader, "PlaceOfOrigin", _PlaceOfOrigin);
|
||||
_MaterialCost = GetFieldDecimal(dbDataReader, "MaterialCost", _MaterialCost);
|
||||
_CurrencyIdMaterial = GetFieldInt32(dbDataReader, "CurrencyIdMaterial", _CurrencyIdMaterial);
|
||||
_ExWorksCost = GetFieldDecimal(dbDataReader, "ExWorksCost", _ExWorksCost);
|
||||
_CurrencyIdExWorks = GetFieldInt32(dbDataReader, "CurrencyIdExWorks", _CurrencyIdExWorks);
|
||||
_ReorderLevel = GetFieldDecimal(dbDataReader, "ReorderLevel", _ReorderLevel);
|
||||
_ReorderQty = GetFieldDecimal(dbDataReader, "ReorderQty", _ReorderQty);
|
||||
_QtyOnOrder = GetFieldDecimal(dbDataReader, "QtyOnOrder", _QtyOnOrder);
|
||||
_AssIdCustomer = GetFieldInt32(dbDataReader, "AssIdCustomer", _AssIdCustomer);
|
||||
_SalesPrice = GetFieldDecimal(dbDataReader, "SalesPrice", _SalesPrice);
|
||||
_RetailPrice = GetFieldDecimal(dbDataReader, "RetailPrice", _RetailPrice);
|
||||
_RetailPricePlanned = GetFieldDecimal(dbDataReader, "RetailPricePlanned", _RetailPricePlanned);
|
||||
_UomIdSale = GetFieldInt32(dbDataReader, "UomIdSale", _UomIdSale);
|
||||
_PackQty = GetFieldDecimal(dbDataReader, "PackQty", _PackQty);
|
||||
_CarriageCostIndicative = GetFieldDecimal(dbDataReader, "CarriageCostIndicative", _CarriageCostIndicative);
|
||||
_MinOrderQty = GetFieldDecimal(dbDataReader, "MinOrderQty", _MinOrderQty);
|
||||
_TaxCodeId = GetFieldInt32(dbDataReader, "TaxCodeId", _TaxCodeId);
|
||||
_LastOrderDate = GetFieldDateTime(dbDataReader, "LastOrderDate", _LastOrderDate);
|
||||
_LastOrderQty = GetFieldDecimal(dbDataReader, "LastOrderQty", _LastOrderQty);
|
||||
_QtyInStock = GetFieldDecimal(dbDataReader, "QtyInStock", _QtyInStock);
|
||||
_QtyAllocated = GetFieldDecimal(dbDataReader, "QtyAllocated", _QtyAllocated);
|
||||
_FreeStock = GetFieldDecimal(dbDataReader, "FreeStock", _FreeStock);
|
||||
_StockTakeDate = GetFieldDateTime(dbDataReader, "StockTakeDate", _StockTakeDate);
|
||||
_StockTakeQty = GetFieldDecimal(dbDataReader, "StockTakeQty", _StockTakeQty);
|
||||
_OrderQtyDecimals = GetFieldInt16(dbDataReader, "OrderQtyDecimals", _OrderQtyDecimals);
|
||||
_CommodityIdSalesProj = GetFieldInt32(dbDataReader, "CommodityIdSalesProj", _CommodityIdSalesProj);
|
||||
_MaterialCost = GetFieldDecimalNullable(dbDataReader, "MaterialCost", _MaterialCost);
|
||||
_CurrencyIdMaterial = GetFieldInt32Nullable(dbDataReader, "CurrencyIdMaterial", _CurrencyIdMaterial);
|
||||
_ExWorksCost = GetFieldDecimalNullable(dbDataReader, "ExWorksCost", _ExWorksCost);
|
||||
_CurrencyIdExWorks = GetFieldInt32Nullable(dbDataReader, "CurrencyIdExWorks", _CurrencyIdExWorks);
|
||||
_ReorderLevel = GetFieldDecimalNullable(dbDataReader, "ReorderLevel", _ReorderLevel);
|
||||
_ReorderQty = GetFieldDecimalNullable(dbDataReader, "ReorderQty", _ReorderQty);
|
||||
_QtyOnOrder = GetFieldDecimalNullable(dbDataReader, "QtyOnOrder", _QtyOnOrder);
|
||||
_AssIdCustomer = GetFieldInt32Nullable(dbDataReader, "AssIdCustomer", _AssIdCustomer);
|
||||
_SalesPrice = GetFieldDecimalNullable(dbDataReader, "SalesPrice", _SalesPrice);
|
||||
_RetailPrice = GetFieldDecimalNullable(dbDataReader, "RetailPrice", _RetailPrice);
|
||||
_RetailPricePlanned = GetFieldDecimalNullable(dbDataReader, "RetailPricePlanned", _RetailPricePlanned);
|
||||
_UomIdSale = GetFieldInt32Nullable(dbDataReader, "UomIdSale", _UomIdSale);
|
||||
_PackQty = GetFieldDecimalNullable(dbDataReader, "PackQty", _PackQty);
|
||||
_CarriageCostIndicative = GetFieldDecimalNullable(dbDataReader, "CarriageCostIndicative", _CarriageCostIndicative);
|
||||
_MinOrderQty = GetFieldDecimalNullable(dbDataReader, "MinOrderQty", _MinOrderQty);
|
||||
_TaxCodeId = GetFieldInt32Nullable(dbDataReader, "TaxCodeId", _TaxCodeId);
|
||||
_LastOrderDate = GetFieldDateTimeNullable(dbDataReader, "LastOrderDate", _LastOrderDate);
|
||||
_LastOrderQty = GetFieldDecimalNullable(dbDataReader, "LastOrderQty", _LastOrderQty);
|
||||
_QtyInStock = GetFieldDecimalNullable(dbDataReader, "QtyInStock", _QtyInStock);
|
||||
_QtyAllocated = GetFieldDecimalNullable(dbDataReader, "QtyAllocated", _QtyAllocated);
|
||||
_FreeStock = GetFieldDecimalNullable(dbDataReader, "FreeStock", _FreeStock);
|
||||
_StockTakeDate = GetFieldDateTimeNullable(dbDataReader, "StockTakeDate", _StockTakeDate);
|
||||
_StockTakeQty = GetFieldDecimalNullable(dbDataReader, "StockTakeQty", _StockTakeQty);
|
||||
_OrderQtyDecimals = GetFieldInt16Nullable(dbDataReader, "OrderQtyDecimals", _OrderQtyDecimals);
|
||||
_CommodityIdSalesProj = GetFieldInt32Nullable(dbDataReader, "CommodityIdSalesProj", _CommodityIdSalesProj);
|
||||
_SalesProjMonthlyProp = GetFieldString(dbDataReader, "SalesProjMonthlyProp", _SalesProjMonthlyProp);
|
||||
_SalesProjAnnual = GetFieldDecimal(dbDataReader, "SalesProjAnnual", _SalesProjAnnual);
|
||||
_SalesProjMonth01 = GetFieldDecimal(dbDataReader, "SalesProjMonth01", _SalesProjMonth01);
|
||||
_SalesProjMonth02 = GetFieldDecimal(dbDataReader, "SalesProjMonth02", _SalesProjMonth02);
|
||||
_SalesProjMonth03 = GetFieldDecimal(dbDataReader, "SalesProjMonth03", _SalesProjMonth03);
|
||||
_SalesProjMonth04 = GetFieldDecimal(dbDataReader, "SalesProjMonth04", _SalesProjMonth04);
|
||||
_SalesProjMonth05 = GetFieldDecimal(dbDataReader, "SalesProjMonth05", _SalesProjMonth05);
|
||||
_SalesProjMonth06 = GetFieldDecimal(dbDataReader, "SalesProjMonth06", _SalesProjMonth06);
|
||||
_SalesProjMonth07 = GetFieldDecimal(dbDataReader, "SalesProjMonth07", _SalesProjMonth07);
|
||||
_SalesProjMonth08 = GetFieldDecimal(dbDataReader, "SalesProjMonth08", _SalesProjMonth08);
|
||||
_SalesProjMonth09 = GetFieldDecimal(dbDataReader, "SalesProjMonth09", _SalesProjMonth09);
|
||||
_SalesProjMonth10 = GetFieldDecimal(dbDataReader, "SalesProjMonth10", _SalesProjMonth10);
|
||||
_SalesProjMonth11 = GetFieldDecimal(dbDataReader, "SalesProjMonth11", _SalesProjMonth11);
|
||||
_SalesProjMonth12 = GetFieldDecimal(dbDataReader, "SalesProjMonth12", _SalesProjMonth12);
|
||||
_SalesProjAnnual = GetFieldDecimalNullable(dbDataReader, "SalesProjAnnual", _SalesProjAnnual);
|
||||
_SalesProjMonth01 = GetFieldDecimalNullable(dbDataReader, "SalesProjMonth01", _SalesProjMonth01);
|
||||
_SalesProjMonth02 = GetFieldDecimalNullable(dbDataReader, "SalesProjMonth02", _SalesProjMonth02);
|
||||
_SalesProjMonth03 = GetFieldDecimalNullable(dbDataReader, "SalesProjMonth03", _SalesProjMonth03);
|
||||
_SalesProjMonth04 = GetFieldDecimalNullable(dbDataReader, "SalesProjMonth04", _SalesProjMonth04);
|
||||
_SalesProjMonth05 = GetFieldDecimalNullable(dbDataReader, "SalesProjMonth05", _SalesProjMonth05);
|
||||
_SalesProjMonth06 = GetFieldDecimalNullable(dbDataReader, "SalesProjMonth06", _SalesProjMonth06);
|
||||
_SalesProjMonth07 = GetFieldDecimalNullable(dbDataReader, "SalesProjMonth07", _SalesProjMonth07);
|
||||
_SalesProjMonth08 = GetFieldDecimalNullable(dbDataReader, "SalesProjMonth08", _SalesProjMonth08);
|
||||
_SalesProjMonth09 = GetFieldDecimalNullable(dbDataReader, "SalesProjMonth09", _SalesProjMonth09);
|
||||
_SalesProjMonth10 = GetFieldDecimalNullable(dbDataReader, "SalesProjMonth10", _SalesProjMonth10);
|
||||
_SalesProjMonth11 = GetFieldDecimalNullable(dbDataReader, "SalesProjMonth11", _SalesProjMonth11);
|
||||
_SalesProjMonth12 = GetFieldDecimalNullable(dbDataReader, "SalesProjMonth12", _SalesProjMonth12);
|
||||
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
|
||||
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
|
||||
_Status = GetFieldString(dbDataReader, "Status", _Status);
|
||||
_CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateBy = GetFieldInt32Nullable(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost);
|
||||
_UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateOn = GetFieldDateTimeNullable(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32Nullable(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost);
|
||||
}
|
||||
|
||||
@@ -582,10 +674,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update command.
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand)
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand, List<String> columnsToUpdate = null)
|
||||
{
|
||||
// Columns to update.
|
||||
List<String> columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList();
|
||||
List<String> columnNames = (columnsToUpdate?.Any() ?? false ? columnsToUpdate : UpdatableColumns).Where(col => UpdatableColumns.ContainsCI(col)).ToList();
|
||||
if (!columnNames.Any())
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} No columns to update. [{GetType().Name}]");
|
||||
return false;
|
||||
}
|
||||
// Construct query.
|
||||
String query = "UPDATE " + TableNameFmt + " SET ";
|
||||
if (dbCommand is SqlCommand)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
@@ -9,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 6-Jun-2024 17:06:27
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:21
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
@@ -21,47 +22,47 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
public ColumnDataInt32 _Id { get; } = new ColumnDataInt32("Id");
|
||||
public ColumnDataInt32 _AffIdOwner { get; } = new ColumnDataInt32("AffIdOwner");
|
||||
public ColumnDataInt32 _AffIdTarget { get; } = new ColumnDataInt32("AffIdTarget");
|
||||
public ColumnDataInt32 _AssocId { get; } = new ColumnDataInt32("AssocId");
|
||||
public ColumnDataInt32 _TransId { get; } = new ColumnDataInt32("TransId");
|
||||
public ColumnDataInt32 _ReqntId { get; } = new ColumnDataInt32("ReqntId");
|
||||
public ColumnDataInt32 _ConstId { get; } = new ColumnDataInt32("ConstId");
|
||||
public ColumnDataInt32 _ProcessId { get; } = new ColumnDataInt32("ProcessId");
|
||||
public ColumnDataInt32 _AssocIdContractor { get; } = new ColumnDataInt32("AssocIdContractor");
|
||||
public ColumnDataInt16 _Type { get; } = new ColumnDataInt16("Type");
|
||||
public ColumnDataInt16 _Seq { get; } = new ColumnDataInt16("Seq");
|
||||
public ColumnDataDateTime _Effective { get; } = new ColumnDataDateTime("Effective");
|
||||
public ColumnDataDateTime _Required { get; } = new ColumnDataDateTime("Required");
|
||||
public ColumnDataDateTime _Started { get; } = new ColumnDataDateTime("Started");
|
||||
public ColumnDataDateTime _Completed { get; } = new ColumnDataDateTime("Completed");
|
||||
public ColumnDataInt32 _AssetId { get; } = new ColumnDataInt32("AssetId");
|
||||
public ColumnDataInt32Nullable _AffIdTarget { get; } = new ColumnDataInt32Nullable("AffIdTarget");
|
||||
public ColumnDataInt32Nullable _AssocId { get; } = new ColumnDataInt32Nullable("AssocId");
|
||||
public ColumnDataInt32Nullable _TransId { get; } = new ColumnDataInt32Nullable("TransId");
|
||||
public ColumnDataInt32Nullable _ReqntId { get; } = new ColumnDataInt32Nullable("ReqntId");
|
||||
public ColumnDataInt32Nullable _ConstId { get; } = new ColumnDataInt32Nullable("ConstId");
|
||||
public ColumnDataInt32Nullable _ProcessId { get; } = new ColumnDataInt32Nullable("ProcessId");
|
||||
public ColumnDataInt32Nullable _AssocIdContractor { get; } = new ColumnDataInt32Nullable("AssocIdContractor");
|
||||
public ColumnDataInt16Nullable _Type { get; } = new ColumnDataInt16Nullable("Type");
|
||||
public ColumnDataInt16Nullable _Seq { get; } = new ColumnDataInt16Nullable("Seq");
|
||||
public ColumnDataDateTimeNullable _Effective { get; } = new ColumnDataDateTimeNullable("Effective");
|
||||
public ColumnDataDateTimeNullable _Required { get; } = new ColumnDataDateTimeNullable("Required");
|
||||
public ColumnDataDateTimeNullable _Started { get; } = new ColumnDataDateTimeNullable("Started");
|
||||
public ColumnDataDateTimeNullable _Completed { get; } = new ColumnDataDateTimeNullable("Completed");
|
||||
public ColumnDataInt32Nullable _AssetId { get; } = new ColumnDataInt32Nullable("AssetId");
|
||||
public ColumnDataString _DescBrief { get; } = new ColumnDataString("DescBrief");
|
||||
public ColumnDataString _DescOutline { get; } = new ColumnDataString("DescOutline");
|
||||
public ColumnDataString _DescDetail { get; } = new ColumnDataString("DescDetail");
|
||||
public ColumnDataInt32 _TaskNumber { get; } = new ColumnDataInt32("TaskNumber");
|
||||
public ColumnDataInt16 _Priority { get; } = new ColumnDataInt16("Priority");
|
||||
public ColumnDataInt32Nullable _TaskNumber { get; } = new ColumnDataInt32Nullable("TaskNumber");
|
||||
public ColumnDataInt16Nullable _Priority { get; } = new ColumnDataInt16Nullable("Priority");
|
||||
public ColumnDataString _Category { get; } = new ColumnDataString("Category");
|
||||
public ColumnDataString _Reference { get; } = new ColumnDataString("Reference");
|
||||
public ColumnDataDecimal _Quantity { get; } = new ColumnDataDecimal("Quantity");
|
||||
public ColumnDataInt32 _UomId { get; } = new ColumnDataInt32("UomId");
|
||||
public ColumnDataDecimal _UnitCost { get; } = new ColumnDataDecimal("UnitCost");
|
||||
public ColumnDataDecimal _AmountEst { get; } = new ColumnDataDecimal("AmountEst");
|
||||
public ColumnDataDecimal _AmountNet { get; } = new ColumnDataDecimal("AmountNet");
|
||||
public ColumnDataInt32 _TaxCodeId { get; } = new ColumnDataInt32("TaxCodeId");
|
||||
public ColumnDataDecimal _TaxRate { get; } = new ColumnDataDecimal("TaxRate");
|
||||
public ColumnDataDecimal _AmountTax { get; } = new ColumnDataDecimal("AmountTax");
|
||||
public ColumnDataDecimal _AmountTot { get; } = new ColumnDataDecimal("AmountTot");
|
||||
public ColumnDataDecimal _TaxRateRebate { get; } = new ColumnDataDecimal("TaxRateRebate");
|
||||
public ColumnDataDecimal _AmountTaxRebate { get; } = new ColumnDataDecimal("AmountTaxRebate");
|
||||
public ColumnDataDecimalNullable _Quantity { get; } = new ColumnDataDecimalNullable("Quantity");
|
||||
public ColumnDataInt32Nullable _UomId { get; } = new ColumnDataInt32Nullable("UomId");
|
||||
public ColumnDataDecimalNullable _UnitCost { get; } = new ColumnDataDecimalNullable("UnitCost");
|
||||
public ColumnDataDecimalNullable _AmountEst { get; } = new ColumnDataDecimalNullable("AmountEst");
|
||||
public ColumnDataDecimalNullable _AmountNet { get; } = new ColumnDataDecimalNullable("AmountNet");
|
||||
public ColumnDataInt32Nullable _TaxCodeId { get; } = new ColumnDataInt32Nullable("TaxCodeId");
|
||||
public ColumnDataDecimalNullable _TaxRate { get; } = new ColumnDataDecimalNullable("TaxRate");
|
||||
public ColumnDataDecimalNullable _AmountTax { get; } = new ColumnDataDecimalNullable("AmountTax");
|
||||
public ColumnDataDecimalNullable _AmountTot { get; } = new ColumnDataDecimalNullable("AmountTot");
|
||||
public ColumnDataDecimalNullable _TaxRateRebate { get; } = new ColumnDataDecimalNullable("TaxRateRebate");
|
||||
public ColumnDataDecimalNullable _AmountTaxRebate { get; } = new ColumnDataDecimalNullable("AmountTaxRebate");
|
||||
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
|
||||
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
|
||||
public ColumnDataInt16Nullable _Flags { get; } = new ColumnDataInt16Nullable("Flags");
|
||||
public ColumnDataString _StatusCat { get; } = new ColumnDataString("StatusCat");
|
||||
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
|
||||
public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn");
|
||||
public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy");
|
||||
public ColumnDataDateTimeNullable _CreateOn { get; } = new ColumnDataDateTimeNullable("CreateOn");
|
||||
public ColumnDataInt32Nullable _CreateBy { get; } = new ColumnDataInt32Nullable("CreateBy");
|
||||
public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost");
|
||||
public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn");
|
||||
public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy");
|
||||
public ColumnDataDateTimeNullable _UpdateOn { get; } = new ColumnDataDateTimeNullable("UpdateOn");
|
||||
public ColumnDataInt32Nullable _UpdateBy { get; } = new ColumnDataInt32Nullable("UpdateBy");
|
||||
public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost");
|
||||
}
|
||||
|
||||
@@ -121,6 +122,51 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
"Id",
|
||||
};
|
||||
protected static List<String> fieldsNullable { get; } = new List<String>()
|
||||
{
|
||||
"AffIdTarget",
|
||||
"AssocId",
|
||||
"TransId",
|
||||
"ReqntId",
|
||||
"ConstId",
|
||||
"ProcessId",
|
||||
"AssocIdContractor",
|
||||
"Type",
|
||||
"Seq",
|
||||
"Effective",
|
||||
"Required",
|
||||
"Started",
|
||||
"Completed",
|
||||
"AssetId",
|
||||
"DescBrief",
|
||||
"DescOutline",
|
||||
"DescDetail",
|
||||
"TaskNumber",
|
||||
"Priority",
|
||||
"Category",
|
||||
"Reference",
|
||||
"Quantity",
|
||||
"UomId",
|
||||
"UnitCost",
|
||||
"AmountEst",
|
||||
"AmountNet",
|
||||
"TaxCodeId",
|
||||
"TaxRate",
|
||||
"AmountTax",
|
||||
"AmountTot",
|
||||
"TaxRateRebate",
|
||||
"AmountTaxRebate",
|
||||
"Notes",
|
||||
"Flags",
|
||||
"StatusCat",
|
||||
"Status",
|
||||
"CreateOn",
|
||||
"CreateBy",
|
||||
"CreateHost",
|
||||
"UpdateOn",
|
||||
"UpdateBy",
|
||||
"UpdateHost",
|
||||
};
|
||||
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
|
||||
{
|
||||
"CreateOn",
|
||||
@@ -146,51 +192,52 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public ColumnsData Cols { get; } = new ColumnsData();
|
||||
public Int32 _Id { get { return Cols._Id.Value; } set { Cols._Id.Value = value; } }
|
||||
public Int32 _AffIdOwner { get { return Cols._AffIdOwner.Value; } set { Cols._AffIdOwner.Value = value; } }
|
||||
public Int32 _AffIdTarget { get { return Cols._AffIdTarget.Value; } set { Cols._AffIdTarget.Value = value; } }
|
||||
public Int32 _AssocId { get { return Cols._AssocId.Value; } set { Cols._AssocId.Value = value; } }
|
||||
public Int32 _TransId { get { return Cols._TransId.Value; } set { Cols._TransId.Value = value; } }
|
||||
public Int32 _ReqntId { get { return Cols._ReqntId.Value; } set { Cols._ReqntId.Value = value; } }
|
||||
public Int32 _ConstId { get { return Cols._ConstId.Value; } set { Cols._ConstId.Value = value; } }
|
||||
public Int32 _ProcessId { get { return Cols._ProcessId.Value; } set { Cols._ProcessId.Value = value; } }
|
||||
public Int32 _AssocIdContractor { get { return Cols._AssocIdContractor.Value; } set { Cols._AssocIdContractor.Value = value; } }
|
||||
public Int16 _Type { get { return Cols._Type.Value; } set { Cols._Type.Value = value; } }
|
||||
public Int16 _Seq { get { return Cols._Seq.Value; } set { Cols._Seq.Value = value; } }
|
||||
public DateTime _Effective { get { return Cols._Effective.Value; } set { Cols._Effective.Value = value; } }
|
||||
public DateTime _Required { get { return Cols._Required.Value; } set { Cols._Required.Value = value; } }
|
||||
public DateTime _Started { get { return Cols._Started.Value; } set { Cols._Started.Value = value; } }
|
||||
public DateTime _Completed { get { return Cols._Completed.Value; } set { Cols._Completed.Value = value; } }
|
||||
public Int32 _AssetId { get { return Cols._AssetId.Value; } set { Cols._AssetId.Value = value; } }
|
||||
public Int32? _AffIdTarget { get { return Cols._AffIdTarget.Value; } set { Cols._AffIdTarget.Value = value; } }
|
||||
public Int32? _AssocId { get { return Cols._AssocId.Value; } set { Cols._AssocId.Value = value; } }
|
||||
public Int32? _TransId { get { return Cols._TransId.Value; } set { Cols._TransId.Value = value; } }
|
||||
public Int32? _ReqntId { get { return Cols._ReqntId.Value; } set { Cols._ReqntId.Value = value; } }
|
||||
public Int32? _ConstId { get { return Cols._ConstId.Value; } set { Cols._ConstId.Value = value; } }
|
||||
public Int32? _ProcessId { get { return Cols._ProcessId.Value; } set { Cols._ProcessId.Value = value; } }
|
||||
public Int32? _AssocIdContractor { get { return Cols._AssocIdContractor.Value; } set { Cols._AssocIdContractor.Value = value; } }
|
||||
public Int16? _Type { get { return Cols._Type.Value; } set { Cols._Type.Value = value; } }
|
||||
public Int16? _Seq { get { return Cols._Seq.Value; } set { Cols._Seq.Value = value; } }
|
||||
public DateTime? _Effective { get { return Cols._Effective.Value; } set { Cols._Effective.Value = value; } }
|
||||
public DateTime? _Required { get { return Cols._Required.Value; } set { Cols._Required.Value = value; } }
|
||||
public DateTime? _Started { get { return Cols._Started.Value; } set { Cols._Started.Value = value; } }
|
||||
public DateTime? _Completed { get { return Cols._Completed.Value; } set { Cols._Completed.Value = value; } }
|
||||
public Int32? _AssetId { get { return Cols._AssetId.Value; } set { Cols._AssetId.Value = value; } }
|
||||
public String _DescBrief { get { return Cols._DescBrief.Value; } set { Cols._DescBrief.Value = value; } }
|
||||
public String _DescOutline { get { return Cols._DescOutline.Value; } set { Cols._DescOutline.Value = value; } }
|
||||
public String _DescDetail { get { return Cols._DescDetail.Value; } set { Cols._DescDetail.Value = value; } }
|
||||
public Int32 _TaskNumber { get { return Cols._TaskNumber.Value; } set { Cols._TaskNumber.Value = value; } }
|
||||
public Int16 _Priority { get { return Cols._Priority.Value; } set { Cols._Priority.Value = value; } }
|
||||
public Int32? _TaskNumber { get { return Cols._TaskNumber.Value; } set { Cols._TaskNumber.Value = value; } }
|
||||
public Int16? _Priority { get { return Cols._Priority.Value; } set { Cols._Priority.Value = value; } }
|
||||
public String _Category { get { return Cols._Category.Value; } set { Cols._Category.Value = value; } }
|
||||
public String _Reference { get { return Cols._Reference.Value; } set { Cols._Reference.Value = value; } }
|
||||
public Decimal _Quantity { get { return Cols._Quantity.Value; } set { Cols._Quantity.Value = value; } }
|
||||
public Int32 _UomId { get { return Cols._UomId.Value; } set { Cols._UomId.Value = value; } }
|
||||
public Decimal _UnitCost { get { return Cols._UnitCost.Value; } set { Cols._UnitCost.Value = value; } }
|
||||
public Decimal _AmountEst { get { return Cols._AmountEst.Value; } set { Cols._AmountEst.Value = value; } }
|
||||
public Decimal _AmountNet { get { return Cols._AmountNet.Value; } set { Cols._AmountNet.Value = value; } }
|
||||
public Int32 _TaxCodeId { get { return Cols._TaxCodeId.Value; } set { Cols._TaxCodeId.Value = value; } }
|
||||
public Decimal _TaxRate { get { return Cols._TaxRate.Value; } set { Cols._TaxRate.Value = value; } }
|
||||
public Decimal _AmountTax { get { return Cols._AmountTax.Value; } set { Cols._AmountTax.Value = value; } }
|
||||
public Decimal _AmountTot { get { return Cols._AmountTot.Value; } set { Cols._AmountTot.Value = value; } }
|
||||
public Decimal _TaxRateRebate { get { return Cols._TaxRateRebate.Value; } set { Cols._TaxRateRebate.Value = value; } }
|
||||
public Decimal _AmountTaxRebate { get { return Cols._AmountTaxRebate.Value; } set { Cols._AmountTaxRebate.Value = value; } }
|
||||
public Decimal? _Quantity { get { return Cols._Quantity.Value; } set { Cols._Quantity.Value = value; } }
|
||||
public Int32? _UomId { get { return Cols._UomId.Value; } set { Cols._UomId.Value = value; } }
|
||||
public Decimal? _UnitCost { get { return Cols._UnitCost.Value; } set { Cols._UnitCost.Value = value; } }
|
||||
public Decimal? _AmountEst { get { return Cols._AmountEst.Value; } set { Cols._AmountEst.Value = value; } }
|
||||
public Decimal? _AmountNet { get { return Cols._AmountNet.Value; } set { Cols._AmountNet.Value = value; } }
|
||||
public Int32? _TaxCodeId { get { return Cols._TaxCodeId.Value; } set { Cols._TaxCodeId.Value = value; } }
|
||||
public Decimal? _TaxRate { get { return Cols._TaxRate.Value; } set { Cols._TaxRate.Value = value; } }
|
||||
public Decimal? _AmountTax { get { return Cols._AmountTax.Value; } set { Cols._AmountTax.Value = value; } }
|
||||
public Decimal? _AmountTot { get { return Cols._AmountTot.Value; } set { Cols._AmountTot.Value = value; } }
|
||||
public Decimal? _TaxRateRebate { get { return Cols._TaxRateRebate.Value; } set { Cols._TaxRateRebate.Value = value; } }
|
||||
public Decimal? _AmountTaxRebate { get { return Cols._AmountTaxRebate.Value; } set { Cols._AmountTaxRebate.Value = value; } }
|
||||
public String _Notes { get { return Cols._Notes.Value; } set { Cols._Notes.Value = value; } }
|
||||
public Int16 _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public Int16? _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public String _StatusCat { get { return Cols._StatusCat.Value; } set { Cols._StatusCat.Value = value; } }
|
||||
public String _Status { get { return Cols._Status.Value; } set { Cols._Status.Value = value; } }
|
||||
public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public DateTime? _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32? _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } }
|
||||
public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public DateTime? _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32? _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } }
|
||||
// Existing columns - confirmed on database if table exists.
|
||||
public List<String> ExistingColumnNames { get { return GetExistingColumnNames(Fields); } }
|
||||
public List<String> ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } }
|
||||
public List<String> UpdatableColumns { get { return ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Population.
|
||||
@@ -211,47 +258,47 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
_Id = GetFieldInt32(dbDataReader, "Id", _Id);
|
||||
_AffIdOwner = GetFieldInt32(dbDataReader, "AffIdOwner", _AffIdOwner);
|
||||
_AffIdTarget = GetFieldInt32(dbDataReader, "AffIdTarget", _AffIdTarget);
|
||||
_AssocId = GetFieldInt32(dbDataReader, "AssocId", _AssocId);
|
||||
_TransId = GetFieldInt32(dbDataReader, "TransId", _TransId);
|
||||
_ReqntId = GetFieldInt32(dbDataReader, "ReqntId", _ReqntId);
|
||||
_ConstId = GetFieldInt32(dbDataReader, "ConstId", _ConstId);
|
||||
_ProcessId = GetFieldInt32(dbDataReader, "ProcessId", _ProcessId);
|
||||
_AssocIdContractor = GetFieldInt32(dbDataReader, "AssocIdContractor", _AssocIdContractor);
|
||||
_Type = GetFieldInt16(dbDataReader, "Type", _Type);
|
||||
_Seq = GetFieldInt16(dbDataReader, "Seq", _Seq);
|
||||
_Effective = GetFieldDateTime(dbDataReader, "Effective", _Effective);
|
||||
_Required = GetFieldDateTime(dbDataReader, "Required", _Required);
|
||||
_Started = GetFieldDateTime(dbDataReader, "Started", _Started);
|
||||
_Completed = GetFieldDateTime(dbDataReader, "Completed", _Completed);
|
||||
_AssetId = GetFieldInt32(dbDataReader, "AssetId", _AssetId);
|
||||
_AffIdTarget = GetFieldInt32Nullable(dbDataReader, "AffIdTarget", _AffIdTarget);
|
||||
_AssocId = GetFieldInt32Nullable(dbDataReader, "AssocId", _AssocId);
|
||||
_TransId = GetFieldInt32Nullable(dbDataReader, "TransId", _TransId);
|
||||
_ReqntId = GetFieldInt32Nullable(dbDataReader, "ReqntId", _ReqntId);
|
||||
_ConstId = GetFieldInt32Nullable(dbDataReader, "ConstId", _ConstId);
|
||||
_ProcessId = GetFieldInt32Nullable(dbDataReader, "ProcessId", _ProcessId);
|
||||
_AssocIdContractor = GetFieldInt32Nullable(dbDataReader, "AssocIdContractor", _AssocIdContractor);
|
||||
_Type = GetFieldInt16Nullable(dbDataReader, "Type", _Type);
|
||||
_Seq = GetFieldInt16Nullable(dbDataReader, "Seq", _Seq);
|
||||
_Effective = GetFieldDateTimeNullable(dbDataReader, "Effective", _Effective);
|
||||
_Required = GetFieldDateTimeNullable(dbDataReader, "Required", _Required);
|
||||
_Started = GetFieldDateTimeNullable(dbDataReader, "Started", _Started);
|
||||
_Completed = GetFieldDateTimeNullable(dbDataReader, "Completed", _Completed);
|
||||
_AssetId = GetFieldInt32Nullable(dbDataReader, "AssetId", _AssetId);
|
||||
_DescBrief = GetFieldString(dbDataReader, "DescBrief", _DescBrief);
|
||||
_DescOutline = GetFieldString(dbDataReader, "DescOutline", _DescOutline);
|
||||
_DescDetail = GetFieldString(dbDataReader, "DescDetail", _DescDetail);
|
||||
_TaskNumber = GetFieldInt32(dbDataReader, "TaskNumber", _TaskNumber);
|
||||
_Priority = GetFieldInt16(dbDataReader, "Priority", _Priority);
|
||||
_TaskNumber = GetFieldInt32Nullable(dbDataReader, "TaskNumber", _TaskNumber);
|
||||
_Priority = GetFieldInt16Nullable(dbDataReader, "Priority", _Priority);
|
||||
_Category = GetFieldString(dbDataReader, "Category", _Category);
|
||||
_Reference = GetFieldString(dbDataReader, "Reference", _Reference);
|
||||
_Quantity = GetFieldDecimal(dbDataReader, "Quantity", _Quantity);
|
||||
_UomId = GetFieldInt32(dbDataReader, "UomId", _UomId);
|
||||
_UnitCost = GetFieldDecimal(dbDataReader, "UnitCost", _UnitCost);
|
||||
_AmountEst = GetFieldDecimal(dbDataReader, "AmountEst", _AmountEst);
|
||||
_AmountNet = GetFieldDecimal(dbDataReader, "AmountNet", _AmountNet);
|
||||
_TaxCodeId = GetFieldInt32(dbDataReader, "TaxCodeId", _TaxCodeId);
|
||||
_TaxRate = GetFieldDecimal(dbDataReader, "TaxRate", _TaxRate);
|
||||
_AmountTax = GetFieldDecimal(dbDataReader, "AmountTax", _AmountTax);
|
||||
_AmountTot = GetFieldDecimal(dbDataReader, "AmountTot", _AmountTot);
|
||||
_TaxRateRebate = GetFieldDecimal(dbDataReader, "TaxRateRebate", _TaxRateRebate);
|
||||
_AmountTaxRebate = GetFieldDecimal(dbDataReader, "AmountTaxRebate", _AmountTaxRebate);
|
||||
_Quantity = GetFieldDecimalNullable(dbDataReader, "Quantity", _Quantity);
|
||||
_UomId = GetFieldInt32Nullable(dbDataReader, "UomId", _UomId);
|
||||
_UnitCost = GetFieldDecimalNullable(dbDataReader, "UnitCost", _UnitCost);
|
||||
_AmountEst = GetFieldDecimalNullable(dbDataReader, "AmountEst", _AmountEst);
|
||||
_AmountNet = GetFieldDecimalNullable(dbDataReader, "AmountNet", _AmountNet);
|
||||
_TaxCodeId = GetFieldInt32Nullable(dbDataReader, "TaxCodeId", _TaxCodeId);
|
||||
_TaxRate = GetFieldDecimalNullable(dbDataReader, "TaxRate", _TaxRate);
|
||||
_AmountTax = GetFieldDecimalNullable(dbDataReader, "AmountTax", _AmountTax);
|
||||
_AmountTot = GetFieldDecimalNullable(dbDataReader, "AmountTot", _AmountTot);
|
||||
_TaxRateRebate = GetFieldDecimalNullable(dbDataReader, "TaxRateRebate", _TaxRateRebate);
|
||||
_AmountTaxRebate = GetFieldDecimalNullable(dbDataReader, "AmountTaxRebate", _AmountTaxRebate);
|
||||
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
|
||||
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
|
||||
_Flags = GetFieldInt16Nullable(dbDataReader, "Flags", _Flags);
|
||||
_StatusCat = GetFieldString(dbDataReader, "StatusCat", _StatusCat);
|
||||
_Status = GetFieldString(dbDataReader, "Status", _Status);
|
||||
_CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateOn = GetFieldDateTimeNullable(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32Nullable(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost);
|
||||
_UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateOn = GetFieldDateTimeNullable(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32Nullable(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost);
|
||||
}
|
||||
|
||||
@@ -327,10 +374,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update command.
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand)
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand, List<String> columnsToUpdate = null)
|
||||
{
|
||||
// Columns to update.
|
||||
List<String> columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList();
|
||||
List<String> columnNames = (columnsToUpdate?.Any() ?? false ? columnsToUpdate : UpdatableColumns).Where(col => UpdatableColumns.ContainsCI(col)).ToList();
|
||||
if (!columnNames.Any())
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} No columns to update. [{GetType().Name}]");
|
||||
return false;
|
||||
}
|
||||
// Construct query.
|
||||
String query = "UPDATE " + TableNameFmt + " SET ";
|
||||
if (dbCommand is SqlCommand)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
@@ -9,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 6-Jun-2024 17:06:27
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:21
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
@@ -23,8 +24,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public ColumnDataInt16 _ItemSeq { get; } = new ColumnDataInt16("ItemSeq");
|
||||
public ColumnDataInt16 _ItemType { get; } = new ColumnDataInt16("ItemType");
|
||||
public ColumnDataInt32 _ItemId { get; } = new ColumnDataInt32("ItemId");
|
||||
public ColumnDataInt16 _ItemTypeSource { get; } = new ColumnDataInt16("ItemTypeSource");
|
||||
public ColumnDataInt32 _ItemIdSource { get; } = new ColumnDataInt32("ItemIdSource");
|
||||
public ColumnDataInt16Nullable _ItemTypeSource { get; } = new ColumnDataInt16Nullable("ItemTypeSource");
|
||||
public ColumnDataInt32Nullable _ItemIdSource { get; } = new ColumnDataInt32Nullable("ItemIdSource");
|
||||
public ColumnDataDecimal _Quantity { get; } = new ColumnDataDecimal("Quantity");
|
||||
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
|
||||
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
|
||||
@@ -32,8 +33,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn");
|
||||
public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy");
|
||||
public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost");
|
||||
public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn");
|
||||
public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy");
|
||||
public ColumnDataDateTimeNullable _UpdateOn { get; } = new ColumnDataDateTimeNullable("UpdateOn");
|
||||
public ColumnDataInt32Nullable _UpdateBy { get; } = new ColumnDataInt32Nullable("UpdateBy");
|
||||
public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost");
|
||||
}
|
||||
|
||||
@@ -68,6 +69,16 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
"ItemType",
|
||||
"ItemId",
|
||||
};
|
||||
protected static List<String> fieldsNullable { get; } = new List<String>()
|
||||
{
|
||||
"ItemTypeSource",
|
||||
"ItemIdSource",
|
||||
"Notes",
|
||||
"CreateHost",
|
||||
"UpdateOn",
|
||||
"UpdateBy",
|
||||
"UpdateHost",
|
||||
};
|
||||
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
|
||||
{
|
||||
"CreateOn",
|
||||
@@ -95,8 +106,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public Int16 _ItemSeq { get { return Cols._ItemSeq.Value; } set { Cols._ItemSeq.Value = value; } }
|
||||
public Int16 _ItemType { get { return Cols._ItemType.Value; } set { Cols._ItemType.Value = value; } }
|
||||
public Int32 _ItemId { get { return Cols._ItemId.Value; } set { Cols._ItemId.Value = value; } }
|
||||
public Int16 _ItemTypeSource { get { return Cols._ItemTypeSource.Value; } set { Cols._ItemTypeSource.Value = value; } }
|
||||
public Int32 _ItemIdSource { get { return Cols._ItemIdSource.Value; } set { Cols._ItemIdSource.Value = value; } }
|
||||
public Int16? _ItemTypeSource { get { return Cols._ItemTypeSource.Value; } set { Cols._ItemTypeSource.Value = value; } }
|
||||
public Int32? _ItemIdSource { get { return Cols._ItemIdSource.Value; } set { Cols._ItemIdSource.Value = value; } }
|
||||
public Decimal _Quantity { get { return Cols._Quantity.Value; } set { Cols._Quantity.Value = value; } }
|
||||
public String _Notes { get { return Cols._Notes.Value; } set { Cols._Notes.Value = value; } }
|
||||
public Int16 _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
@@ -104,12 +115,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } }
|
||||
public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public DateTime? _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32? _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } }
|
||||
// Existing columns - confirmed on database if table exists.
|
||||
public List<String> ExistingColumnNames { get { return GetExistingColumnNames(Fields); } }
|
||||
public List<String> ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } }
|
||||
public List<String> UpdatableColumns { get { return ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Population.
|
||||
@@ -132,8 +144,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
_ItemSeq = GetFieldInt16(dbDataReader, "ItemSeq", _ItemSeq);
|
||||
_ItemType = GetFieldInt16(dbDataReader, "ItemType", _ItemType);
|
||||
_ItemId = GetFieldInt32(dbDataReader, "ItemId", _ItemId);
|
||||
_ItemTypeSource = GetFieldInt16(dbDataReader, "ItemTypeSource", _ItemTypeSource);
|
||||
_ItemIdSource = GetFieldInt32(dbDataReader, "ItemIdSource", _ItemIdSource);
|
||||
_ItemTypeSource = GetFieldInt16Nullable(dbDataReader, "ItemTypeSource", _ItemTypeSource);
|
||||
_ItemIdSource = GetFieldInt32Nullable(dbDataReader, "ItemIdSource", _ItemIdSource);
|
||||
_Quantity = GetFieldDecimal(dbDataReader, "Quantity", _Quantity);
|
||||
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
|
||||
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
|
||||
@@ -141,8 +153,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
_CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost);
|
||||
_UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateOn = GetFieldDateTimeNullable(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32Nullable(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost);
|
||||
}
|
||||
|
||||
@@ -190,10 +202,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update command.
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand)
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand, List<String> columnsToUpdate = null)
|
||||
{
|
||||
// Columns to update.
|
||||
List<String> columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList();
|
||||
List<String> columnNames = (columnsToUpdate?.Any() ?? false ? columnsToUpdate : UpdatableColumns).Where(col => UpdatableColumns.ContainsCI(col)).ToList();
|
||||
if (!columnNames.Any())
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} No columns to update. [{GetType().Name}]");
|
||||
return false;
|
||||
}
|
||||
// Construct query.
|
||||
String query = "UPDATE " + TableNameFmt + " SET ";
|
||||
if (dbCommand is SqlCommand)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
@@ -9,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 6-Jun-2024 17:06:27
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:21
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
@@ -21,22 +22,22 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
public ColumnDataInt32 _Id { get; } = new ColumnDataInt32("Id");
|
||||
public ColumnDataInt32 _AffIdOwner { get; } = new ColumnDataInt32("AffIdOwner");
|
||||
public ColumnDataInt16 _Category { get; } = new ColumnDataInt16("Category");
|
||||
public ColumnDataInt16Nullable _Category { get; } = new ColumnDataInt16Nullable("Category");
|
||||
public ColumnDataString _Type { get; } = new ColumnDataString("Type");
|
||||
public ColumnDataString _Reference { get; } = new ColumnDataString("Reference");
|
||||
public ColumnDataString _DescBrief { get; } = new ColumnDataString("DescBrief");
|
||||
public ColumnDataString _TagId { get; } = new ColumnDataString("TagId");
|
||||
public ColumnDataInt32 _AssIdSupplier { get; } = new ColumnDataInt32("AssIdSupplier");
|
||||
public ColumnDataInt32 _AssIdCustomer { get; } = new ColumnDataInt32("AssIdCustomer");
|
||||
public ColumnDataDateTime _Expected { get; } = new ColumnDataDateTime("Expected");
|
||||
public ColumnDataInt32Nullable _AssIdSupplier { get; } = new ColumnDataInt32Nullable("AssIdSupplier");
|
||||
public ColumnDataInt32Nullable _AssIdCustomer { get; } = new ColumnDataInt32Nullable("AssIdCustomer");
|
||||
public ColumnDataDateTimeNullable _Expected { get; } = new ColumnDataDateTimeNullable("Expected");
|
||||
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
|
||||
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
|
||||
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
|
||||
public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn");
|
||||
public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy");
|
||||
public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost");
|
||||
public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn");
|
||||
public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy");
|
||||
public ColumnDataDateTimeNullable _UpdateOn { get; } = new ColumnDataDateTimeNullable("UpdateOn");
|
||||
public ColumnDataInt32Nullable _UpdateBy { get; } = new ColumnDataInt32Nullable("UpdateBy");
|
||||
public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost");
|
||||
}
|
||||
|
||||
@@ -71,6 +72,20 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
"Id",
|
||||
};
|
||||
protected static List<String> fieldsNullable { get; } = new List<String>()
|
||||
{
|
||||
"Category",
|
||||
"DescBrief",
|
||||
"TagId",
|
||||
"AssIdSupplier",
|
||||
"AssIdCustomer",
|
||||
"Expected",
|
||||
"Notes",
|
||||
"CreateHost",
|
||||
"UpdateOn",
|
||||
"UpdateBy",
|
||||
"UpdateHost",
|
||||
};
|
||||
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
|
||||
{
|
||||
"CreateOn",
|
||||
@@ -96,26 +111,27 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public ColumnsData Cols { get; } = new ColumnsData();
|
||||
public Int32 _Id { get { return Cols._Id.Value; } set { Cols._Id.Value = value; } }
|
||||
public Int32 _AffIdOwner { get { return Cols._AffIdOwner.Value; } set { Cols._AffIdOwner.Value = value; } }
|
||||
public Int16 _Category { get { return Cols._Category.Value; } set { Cols._Category.Value = value; } }
|
||||
public Int16? _Category { get { return Cols._Category.Value; } set { Cols._Category.Value = value; } }
|
||||
public String _Type { get { return Cols._Type.Value; } set { Cols._Type.Value = value; } }
|
||||
public String _Reference { get { return Cols._Reference.Value; } set { Cols._Reference.Value = value; } }
|
||||
public String _DescBrief { get { return Cols._DescBrief.Value; } set { Cols._DescBrief.Value = value; } }
|
||||
public String _TagId { get { return Cols._TagId.Value; } set { Cols._TagId.Value = value; } }
|
||||
public Int32 _AssIdSupplier { get { return Cols._AssIdSupplier.Value; } set { Cols._AssIdSupplier.Value = value; } }
|
||||
public Int32 _AssIdCustomer { get { return Cols._AssIdCustomer.Value; } set { Cols._AssIdCustomer.Value = value; } }
|
||||
public DateTime _Expected { get { return Cols._Expected.Value; } set { Cols._Expected.Value = value; } }
|
||||
public Int32? _AssIdSupplier { get { return Cols._AssIdSupplier.Value; } set { Cols._AssIdSupplier.Value = value; } }
|
||||
public Int32? _AssIdCustomer { get { return Cols._AssIdCustomer.Value; } set { Cols._AssIdCustomer.Value = value; } }
|
||||
public DateTime? _Expected { get { return Cols._Expected.Value; } set { Cols._Expected.Value = value; } }
|
||||
public String _Notes { get { return Cols._Notes.Value; } set { Cols._Notes.Value = value; } }
|
||||
public Int16 _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public String _Status { get { return Cols._Status.Value; } set { Cols._Status.Value = value; } }
|
||||
public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } }
|
||||
public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public DateTime? _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32? _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } }
|
||||
// Existing columns - confirmed on database if table exists.
|
||||
public List<String> ExistingColumnNames { get { return GetExistingColumnNames(Fields); } }
|
||||
public List<String> ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } }
|
||||
public List<String> UpdatableColumns { get { return ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Population.
|
||||
@@ -136,22 +152,22 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
_Id = GetFieldInt32(dbDataReader, "Id", _Id);
|
||||
_AffIdOwner = GetFieldInt32(dbDataReader, "AffIdOwner", _AffIdOwner);
|
||||
_Category = GetFieldInt16(dbDataReader, "Category", _Category);
|
||||
_Category = GetFieldInt16Nullable(dbDataReader, "Category", _Category);
|
||||
_Type = GetFieldString(dbDataReader, "Type", _Type);
|
||||
_Reference = GetFieldString(dbDataReader, "Reference", _Reference);
|
||||
_DescBrief = GetFieldString(dbDataReader, "DescBrief", _DescBrief);
|
||||
_TagId = GetFieldString(dbDataReader, "TagId", _TagId);
|
||||
_AssIdSupplier = GetFieldInt32(dbDataReader, "AssIdSupplier", _AssIdSupplier);
|
||||
_AssIdCustomer = GetFieldInt32(dbDataReader, "AssIdCustomer", _AssIdCustomer);
|
||||
_Expected = GetFieldDateTime(dbDataReader, "Expected", _Expected);
|
||||
_AssIdSupplier = GetFieldInt32Nullable(dbDataReader, "AssIdSupplier", _AssIdSupplier);
|
||||
_AssIdCustomer = GetFieldInt32Nullable(dbDataReader, "AssIdCustomer", _AssIdCustomer);
|
||||
_Expected = GetFieldDateTimeNullable(dbDataReader, "Expected", _Expected);
|
||||
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
|
||||
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
|
||||
_Status = GetFieldString(dbDataReader, "Status", _Status);
|
||||
_CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost);
|
||||
_UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateOn = GetFieldDateTimeNullable(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32Nullable(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost);
|
||||
}
|
||||
|
||||
@@ -202,10 +218,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update command.
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand)
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand, List<String> columnsToUpdate = null)
|
||||
{
|
||||
// Columns to update.
|
||||
List<String> columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList();
|
||||
List<String> columnNames = (columnsToUpdate?.Any() ?? false ? columnsToUpdate : UpdatableColumns).Where(col => UpdatableColumns.ContainsCI(col)).ToList();
|
||||
if (!columnNames.Any())
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} No columns to update. [{GetType().Name}]");
|
||||
return false;
|
||||
}
|
||||
// Construct query.
|
||||
String query = "UPDATE " + TableNameFmt + " SET ";
|
||||
if (dbCommand is SqlCommand)
|
||||
|
||||
@@ -10,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Mon 21-Oct-2024 18:34:08
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:20
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal.Control
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Mon 21-Oct-2024 18:34:08
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:20
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal.Control
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Mon 21-Oct-2024 18:34:08
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:20
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal.Control
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Mon 21-Oct-2024 18:34:08
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:20
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal.Control
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
@@ -9,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 6-Jun-2024 17:06:27
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:21
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
@@ -22,18 +23,18 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public ColumnDataInt32 _Id { get; } = new ColumnDataInt32("Id");
|
||||
public ColumnDataString _Code { get; } = new ColumnDataString("Code");
|
||||
public ColumnDataString _Name { get; } = new ColumnDataString("Name");
|
||||
public ColumnDataInt32 _Primary { get; } = new ColumnDataInt32("Primary");
|
||||
public ColumnDataInt32Nullable _Primary { get; } = new ColumnDataInt32Nullable("Primary");
|
||||
public ColumnDataString _Division { get; } = new ColumnDataString("Division");
|
||||
public ColumnDataInt32 _Region { get; } = new ColumnDataInt32("Region");
|
||||
public ColumnDataInt32Nullable _Region { get; } = new ColumnDataInt32Nullable("Region");
|
||||
public ColumnDataString _Symbol { get; } = new ColumnDataString("Symbol");
|
||||
public ColumnDataBoolean _Suffix { get; } = new ColumnDataBoolean("Suffix");
|
||||
public ColumnDataBoolean _IncSpace { get; } = new ColumnDataBoolean("IncSpace");
|
||||
public ColumnDataInt16 _Decimals { get; } = new ColumnDataInt16("Decimals");
|
||||
public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn");
|
||||
public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy");
|
||||
public ColumnDataInt16Nullable _Decimals { get; } = new ColumnDataInt16Nullable("Decimals");
|
||||
public ColumnDataDateTimeNullable _CreateOn { get; } = new ColumnDataDateTimeNullable("CreateOn");
|
||||
public ColumnDataInt32Nullable _CreateBy { get; } = new ColumnDataInt32Nullable("CreateBy");
|
||||
public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost");
|
||||
public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn");
|
||||
public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy");
|
||||
public ColumnDataDateTimeNullable _UpdateOn { get; } = new ColumnDataDateTimeNullable("UpdateOn");
|
||||
public ColumnDataInt32Nullable _UpdateBy { get; } = new ColumnDataInt32Nullable("UpdateBy");
|
||||
public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost");
|
||||
}
|
||||
|
||||
@@ -65,6 +66,22 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
"Id",
|
||||
};
|
||||
protected static List<String> fieldsNullable { get; } = new List<String>()
|
||||
{
|
||||
"Code",
|
||||
"Name",
|
||||
"Primary",
|
||||
"Division",
|
||||
"Region",
|
||||
"Symbol",
|
||||
"Decimals",
|
||||
"CreateOn",
|
||||
"CreateBy",
|
||||
"CreateHost",
|
||||
"UpdateOn",
|
||||
"UpdateBy",
|
||||
"UpdateHost",
|
||||
};
|
||||
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
|
||||
{
|
||||
"CreateOn",
|
||||
@@ -91,22 +108,23 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public Int32 _Id { get { return Cols._Id.Value; } set { Cols._Id.Value = value; } }
|
||||
public String _Code { get { return Cols._Code.Value; } set { Cols._Code.Value = value; } }
|
||||
public String _Name { get { return Cols._Name.Value; } set { Cols._Name.Value = value; } }
|
||||
public Int32 _Primary { get { return Cols._Primary.Value; } set { Cols._Primary.Value = value; } }
|
||||
public Int32? _Primary { get { return Cols._Primary.Value; } set { Cols._Primary.Value = value; } }
|
||||
public String _Division { get { return Cols._Division.Value; } set { Cols._Division.Value = value; } }
|
||||
public Int32 _Region { get { return Cols._Region.Value; } set { Cols._Region.Value = value; } }
|
||||
public Int32? _Region { get { return Cols._Region.Value; } set { Cols._Region.Value = value; } }
|
||||
public String _Symbol { get { return Cols._Symbol.Value; } set { Cols._Symbol.Value = value; } }
|
||||
public Boolean _Suffix { get { return Cols._Suffix.Value; } set { Cols._Suffix.Value = value; } }
|
||||
public Boolean _IncSpace { get { return Cols._IncSpace.Value; } set { Cols._IncSpace.Value = value; } }
|
||||
public Int16 _Decimals { get { return Cols._Decimals.Value; } set { Cols._Decimals.Value = value; } }
|
||||
public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public Int16? _Decimals { get { return Cols._Decimals.Value; } set { Cols._Decimals.Value = value; } }
|
||||
public DateTime? _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32? _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } }
|
||||
public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public DateTime? _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32? _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } }
|
||||
// Existing columns - confirmed on database if table exists.
|
||||
public List<String> ExistingColumnNames { get { return GetExistingColumnNames(Fields); } }
|
||||
public List<String> ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } }
|
||||
public List<String> UpdatableColumns { get { return ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Population.
|
||||
@@ -128,18 +146,18 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
_Id = GetFieldInt32(dbDataReader, "Id", _Id);
|
||||
_Code = GetFieldString(dbDataReader, "Code", _Code);
|
||||
_Name = GetFieldString(dbDataReader, "Name", _Name);
|
||||
_Primary = GetFieldInt32(dbDataReader, "Primary", _Primary);
|
||||
_Primary = GetFieldInt32Nullable(dbDataReader, "Primary", _Primary);
|
||||
_Division = GetFieldString(dbDataReader, "Division", _Division);
|
||||
_Region = GetFieldInt32(dbDataReader, "Region", _Region);
|
||||
_Region = GetFieldInt32Nullable(dbDataReader, "Region", _Region);
|
||||
_Symbol = GetFieldString(dbDataReader, "Symbol", _Symbol);
|
||||
_Suffix = GetFieldBoolean(dbDataReader, "Suffix", _Suffix);
|
||||
_IncSpace = GetFieldBoolean(dbDataReader, "IncSpace", _IncSpace);
|
||||
_Decimals = GetFieldInt16(dbDataReader, "Decimals", _Decimals);
|
||||
_CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy);
|
||||
_Decimals = GetFieldInt16Nullable(dbDataReader, "Decimals", _Decimals);
|
||||
_CreateOn = GetFieldDateTimeNullable(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32Nullable(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost);
|
||||
_UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateOn = GetFieldDateTimeNullable(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32Nullable(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost);
|
||||
}
|
||||
|
||||
@@ -187,10 +205,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update command.
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand)
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand, List<String> columnsToUpdate = null)
|
||||
{
|
||||
// Columns to update.
|
||||
List<String> columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList();
|
||||
List<String> columnNames = (columnsToUpdate?.Any() ?? false ? columnsToUpdate : UpdatableColumns).Where(col => UpdatableColumns.ContainsCI(col)).ToList();
|
||||
if (!columnNames.Any())
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} No columns to update. [{GetType().Name}]");
|
||||
return false;
|
||||
}
|
||||
// Construct query.
|
||||
String query = "UPDATE " + TableNameFmt + " SET ";
|
||||
if (dbCommand is SqlCommand)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
@@ -9,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 6-Jun-2024 17:06:27
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:21
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
@@ -58,6 +59,9 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
"IndexDefragId",
|
||||
};
|
||||
protected static List<String> fieldsNullable { get; } = new List<String>()
|
||||
{
|
||||
};
|
||||
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
|
||||
{
|
||||
"CreateOn",
|
||||
@@ -96,6 +100,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
// Existing columns - confirmed on database if table exists.
|
||||
public List<String> ExistingColumnNames { get { return GetExistingColumnNames(Fields); } }
|
||||
public List<String> ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } }
|
||||
public List<String> UpdatableColumns { get { return ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Population.
|
||||
@@ -172,12 +177,17 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update command.
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand)
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand, List<String> columnsToUpdate = null)
|
||||
{
|
||||
// Avoid update if Identity field isn't valid.
|
||||
if (_IndexDefragId == 0) throw new Exception("Invalid for Update - item has an invalid Id");
|
||||
// Columns to update.
|
||||
List<String> columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList();
|
||||
List<String> columnNames = (columnsToUpdate?.Any() ?? false ? columnsToUpdate : UpdatableColumns).Where(col => UpdatableColumns.ContainsCI(col)).ToList();
|
||||
if (!columnNames.Any())
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} No columns to update. [{GetType().Name}]");
|
||||
return false;
|
||||
}
|
||||
// Construct query.
|
||||
String query = "UPDATE " + TableNameFmt + " SET ";
|
||||
if (dbCommand is SqlCommand)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
@@ -9,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 6-Jun-2024 17:06:27
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:21
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
@@ -26,18 +27,18 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public ColumnDataInt16 _ItemType { get; } = new ColumnDataInt16("ItemType");
|
||||
public ColumnDataInt32 _ItemId { get; } = new ColumnDataInt32("ItemId");
|
||||
public ColumnDataString _ProcessStatus { get; } = new ColumnDataString("ProcessStatus");
|
||||
public ColumnDataInt32 _ProcessStatusBy { get; } = new ColumnDataInt32("ProcessStatusBy");
|
||||
public ColumnDataInt32 _ProcessStatusOn { get; } = new ColumnDataInt32("ProcessStatusOn");
|
||||
public ColumnDataInt32Nullable _ProcessStatusBy { get; } = new ColumnDataInt32Nullable("ProcessStatusBy");
|
||||
public ColumnDataInt32Nullable _ProcessStatusOn { get; } = new ColumnDataInt32Nullable("ProcessStatusOn");
|
||||
public ColumnDataString _ItemStatus { get; } = new ColumnDataString("ItemStatus");
|
||||
public ColumnDataInt32 _ItemStatusBy { get; } = new ColumnDataInt32("ItemStatusBy");
|
||||
public ColumnDataInt32 _ItemStatusOn { get; } = new ColumnDataInt32("ItemStatusOn");
|
||||
public ColumnDataInt32Nullable _ItemStatusBy { get; } = new ColumnDataInt32Nullable("ItemStatusBy");
|
||||
public ColumnDataInt32Nullable _ItemStatusOn { get; } = new ColumnDataInt32Nullable("ItemStatusOn");
|
||||
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
|
||||
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
|
||||
public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn");
|
||||
public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy");
|
||||
public ColumnDataInt16Nullable _Flags { get; } = new ColumnDataInt16Nullable("Flags");
|
||||
public ColumnDataDateTimeNullable _CreateOn { get; } = new ColumnDataDateTimeNullable("CreateOn");
|
||||
public ColumnDataInt32Nullable _CreateBy { get; } = new ColumnDataInt32Nullable("CreateBy");
|
||||
public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost");
|
||||
public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn");
|
||||
public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy");
|
||||
public ColumnDataDateTimeNullable _UpdateOn { get; } = new ColumnDataDateTimeNullable("UpdateOn");
|
||||
public ColumnDataInt32Nullable _UpdateBy { get; } = new ColumnDataInt32Nullable("UpdateBy");
|
||||
public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost");
|
||||
}
|
||||
|
||||
@@ -73,6 +74,24 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
"Id",
|
||||
};
|
||||
protected static List<String> fieldsNullable { get; } = new List<String>()
|
||||
{
|
||||
"ExternalRef",
|
||||
"ProcessStatus",
|
||||
"ProcessStatusBy",
|
||||
"ProcessStatusOn",
|
||||
"ItemStatus",
|
||||
"ItemStatusBy",
|
||||
"ItemStatusOn",
|
||||
"Notes",
|
||||
"Flags",
|
||||
"CreateOn",
|
||||
"CreateBy",
|
||||
"CreateHost",
|
||||
"UpdateOn",
|
||||
"UpdateBy",
|
||||
"UpdateHost",
|
||||
};
|
||||
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
|
||||
{
|
||||
"CreateOn",
|
||||
@@ -103,22 +122,23 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public Int16 _ItemType { get { return Cols._ItemType.Value; } set { Cols._ItemType.Value = value; } }
|
||||
public Int32 _ItemId { get { return Cols._ItemId.Value; } set { Cols._ItemId.Value = value; } }
|
||||
public String _ProcessStatus { get { return Cols._ProcessStatus.Value; } set { Cols._ProcessStatus.Value = value; } }
|
||||
public Int32 _ProcessStatusBy { get { return Cols._ProcessStatusBy.Value; } set { Cols._ProcessStatusBy.Value = value; } }
|
||||
public Int32 _ProcessStatusOn { get { return Cols._ProcessStatusOn.Value; } set { Cols._ProcessStatusOn.Value = value; } }
|
||||
public Int32? _ProcessStatusBy { get { return Cols._ProcessStatusBy.Value; } set { Cols._ProcessStatusBy.Value = value; } }
|
||||
public Int32? _ProcessStatusOn { get { return Cols._ProcessStatusOn.Value; } set { Cols._ProcessStatusOn.Value = value; } }
|
||||
public String _ItemStatus { get { return Cols._ItemStatus.Value; } set { Cols._ItemStatus.Value = value; } }
|
||||
public Int32 _ItemStatusBy { get { return Cols._ItemStatusBy.Value; } set { Cols._ItemStatusBy.Value = value; } }
|
||||
public Int32 _ItemStatusOn { get { return Cols._ItemStatusOn.Value; } set { Cols._ItemStatusOn.Value = value; } }
|
||||
public Int32? _ItemStatusBy { get { return Cols._ItemStatusBy.Value; } set { Cols._ItemStatusBy.Value = value; } }
|
||||
public Int32? _ItemStatusOn { get { return Cols._ItemStatusOn.Value; } set { Cols._ItemStatusOn.Value = value; } }
|
||||
public String _Notes { get { return Cols._Notes.Value; } set { Cols._Notes.Value = value; } }
|
||||
public Int16 _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public Int16? _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public DateTime? _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32? _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } }
|
||||
public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public DateTime? _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32? _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } }
|
||||
// Existing columns - confirmed on database if table exists.
|
||||
public List<String> ExistingColumnNames { get { return GetExistingColumnNames(Fields); } }
|
||||
public List<String> ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } }
|
||||
public List<String> UpdatableColumns { get { return ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Population.
|
||||
@@ -144,18 +164,18 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
_ItemType = GetFieldInt16(dbDataReader, "ItemType", _ItemType);
|
||||
_ItemId = GetFieldInt32(dbDataReader, "ItemId", _ItemId);
|
||||
_ProcessStatus = GetFieldString(dbDataReader, "ProcessStatus", _ProcessStatus);
|
||||
_ProcessStatusBy = GetFieldInt32(dbDataReader, "ProcessStatusBy", _ProcessStatusBy);
|
||||
_ProcessStatusOn = GetFieldInt32(dbDataReader, "ProcessStatusOn", _ProcessStatusOn);
|
||||
_ProcessStatusBy = GetFieldInt32Nullable(dbDataReader, "ProcessStatusBy", _ProcessStatusBy);
|
||||
_ProcessStatusOn = GetFieldInt32Nullable(dbDataReader, "ProcessStatusOn", _ProcessStatusOn);
|
||||
_ItemStatus = GetFieldString(dbDataReader, "ItemStatus", _ItemStatus);
|
||||
_ItemStatusBy = GetFieldInt32(dbDataReader, "ItemStatusBy", _ItemStatusBy);
|
||||
_ItemStatusOn = GetFieldInt32(dbDataReader, "ItemStatusOn", _ItemStatusOn);
|
||||
_ItemStatusBy = GetFieldInt32Nullable(dbDataReader, "ItemStatusBy", _ItemStatusBy);
|
||||
_ItemStatusOn = GetFieldInt32Nullable(dbDataReader, "ItemStatusOn", _ItemStatusOn);
|
||||
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
|
||||
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
|
||||
_CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy);
|
||||
_Flags = GetFieldInt16Nullable(dbDataReader, "Flags", _Flags);
|
||||
_CreateOn = GetFieldDateTimeNullable(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32Nullable(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost);
|
||||
_UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateOn = GetFieldDateTimeNullable(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32Nullable(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost);
|
||||
}
|
||||
|
||||
@@ -207,10 +227,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update command.
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand)
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand, List<String> columnsToUpdate = null)
|
||||
{
|
||||
// Columns to update.
|
||||
List<String> columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList();
|
||||
List<String> columnNames = (columnsToUpdate?.Any() ?? false ? columnsToUpdate : UpdatableColumns).Where(col => UpdatableColumns.ContainsCI(col)).ToList();
|
||||
if (!columnNames.Any())
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} No columns to update. [{GetType().Name}]");
|
||||
return false;
|
||||
}
|
||||
// Construct query.
|
||||
String query = "UPDATE " + TableNameFmt + " SET ";
|
||||
if (dbCommand is SqlCommand)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
@@ -9,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 6-Jun-2024 17:06:27
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:21
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
@@ -22,13 +23,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public ColumnDataInt32 _ProcessId { get; } = new ColumnDataInt32("ProcessId");
|
||||
public ColumnDataInt32 _InterfaceDataItemId { get; } = new ColumnDataInt32("InterfaceDataItemId");
|
||||
public ColumnDataString _ItemData { get; } = new ColumnDataString("ItemData");
|
||||
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
|
||||
public ColumnDataInt16Nullable _Flags { get; } = new ColumnDataInt16Nullable("Flags");
|
||||
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
|
||||
public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn");
|
||||
public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy");
|
||||
public ColumnDataDateTimeNullable _CreateOn { get; } = new ColumnDataDateTimeNullable("CreateOn");
|
||||
public ColumnDataInt32Nullable _CreateBy { get; } = new ColumnDataInt32Nullable("CreateBy");
|
||||
public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost");
|
||||
public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn");
|
||||
public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy");
|
||||
public ColumnDataDateTimeNullable _UpdateOn { get; } = new ColumnDataDateTimeNullable("UpdateOn");
|
||||
public ColumnDataInt32Nullable _UpdateBy { get; } = new ColumnDataInt32Nullable("UpdateBy");
|
||||
public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost");
|
||||
}
|
||||
|
||||
@@ -56,6 +57,18 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
"ProcessId",
|
||||
"InterfaceDataItemId",
|
||||
};
|
||||
protected static List<String> fieldsNullable { get; } = new List<String>()
|
||||
{
|
||||
"ItemData",
|
||||
"Flags",
|
||||
"Status",
|
||||
"CreateOn",
|
||||
"CreateBy",
|
||||
"CreateHost",
|
||||
"UpdateOn",
|
||||
"UpdateBy",
|
||||
"UpdateHost",
|
||||
};
|
||||
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
|
||||
{
|
||||
"CreateOn",
|
||||
@@ -82,17 +95,18 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public Int32 _ProcessId { get { return Cols._ProcessId.Value; } set { Cols._ProcessId.Value = value; } }
|
||||
public Int32 _InterfaceDataItemId { get { return Cols._InterfaceDataItemId.Value; } set { Cols._InterfaceDataItemId.Value = value; } }
|
||||
public String _ItemData { get { return Cols._ItemData.Value; } set { Cols._ItemData.Value = value; } }
|
||||
public Int16 _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public Int16? _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public String _Status { get { return Cols._Status.Value; } set { Cols._Status.Value = value; } }
|
||||
public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public DateTime? _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32? _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } }
|
||||
public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public DateTime? _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32? _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } }
|
||||
// Existing columns - confirmed on database if table exists.
|
||||
public List<String> ExistingColumnNames { get { return GetExistingColumnNames(Fields); } }
|
||||
public List<String> ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } }
|
||||
public List<String> UpdatableColumns { get { return ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Population.
|
||||
@@ -114,13 +128,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
_ProcessId = GetFieldInt32(dbDataReader, "ProcessId", _ProcessId);
|
||||
_InterfaceDataItemId = GetFieldInt32(dbDataReader, "InterfaceDataItemId", _InterfaceDataItemId);
|
||||
_ItemData = GetFieldString(dbDataReader, "ItemData", _ItemData);
|
||||
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
|
||||
_Flags = GetFieldInt16Nullable(dbDataReader, "Flags", _Flags);
|
||||
_Status = GetFieldString(dbDataReader, "Status", _Status);
|
||||
_CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateOn = GetFieldDateTimeNullable(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32Nullable(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost);
|
||||
_UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateOn = GetFieldDateTimeNullable(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32Nullable(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost);
|
||||
}
|
||||
|
||||
@@ -163,10 +177,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update command.
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand)
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand, List<String> columnsToUpdate = null)
|
||||
{
|
||||
// Columns to update.
|
||||
List<String> columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList();
|
||||
List<String> columnNames = (columnsToUpdate?.Any() ?? false ? columnsToUpdate : UpdatableColumns).Where(col => UpdatableColumns.ContainsCI(col)).ToList();
|
||||
if (!columnNames.Any())
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} No columns to update. [{GetType().Name}]");
|
||||
return false;
|
||||
}
|
||||
// Construct query.
|
||||
String query = "UPDATE " + TableNameFmt + " SET ";
|
||||
if (dbCommand is SqlCommand)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
@@ -9,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 6-Jun-2024 17:06:27
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:21
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
@@ -24,16 +25,16 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public ColumnDataString _MsgType { get; } = new ColumnDataString("MsgType");
|
||||
public ColumnDataString _Msg { get; } = new ColumnDataString("Msg");
|
||||
public ColumnDataString _FileName { get; } = new ColumnDataString("FileName");
|
||||
public ColumnDataInt32 _LineNumber { get; } = new ColumnDataInt32("LineNumber");
|
||||
public ColumnDataInt16 _ItemType { get; } = new ColumnDataInt16("ItemType");
|
||||
public ColumnDataInt32 _ItemId { get; } = new ColumnDataInt32("ItemId");
|
||||
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
|
||||
public ColumnDataInt32Nullable _LineNumber { get; } = new ColumnDataInt32Nullable("LineNumber");
|
||||
public ColumnDataInt16Nullable _ItemType { get; } = new ColumnDataInt16Nullable("ItemType");
|
||||
public ColumnDataInt32Nullable _ItemId { get; } = new ColumnDataInt32Nullable("ItemId");
|
||||
public ColumnDataInt16Nullable _Flags { get; } = new ColumnDataInt16Nullable("Flags");
|
||||
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
|
||||
public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn");
|
||||
public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy");
|
||||
public ColumnDataDateTimeNullable _CreateOn { get; } = new ColumnDataDateTimeNullable("CreateOn");
|
||||
public ColumnDataInt32Nullable _CreateBy { get; } = new ColumnDataInt32Nullable("CreateBy");
|
||||
public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost");
|
||||
public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn");
|
||||
public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy");
|
||||
public ColumnDataDateTimeNullable _UpdateOn { get; } = new ColumnDataDateTimeNullable("UpdateOn");
|
||||
public ColumnDataInt32Nullable _UpdateBy { get; } = new ColumnDataInt32Nullable("UpdateBy");
|
||||
public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost");
|
||||
}
|
||||
|
||||
@@ -65,6 +66,23 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
"Id",
|
||||
};
|
||||
protected static List<String> fieldsNullable { get; } = new List<String>()
|
||||
{
|
||||
"MsgType",
|
||||
"Msg",
|
||||
"FileName",
|
||||
"LineNumber",
|
||||
"ItemType",
|
||||
"ItemId",
|
||||
"Flags",
|
||||
"Status",
|
||||
"CreateOn",
|
||||
"CreateBy",
|
||||
"CreateHost",
|
||||
"UpdateOn",
|
||||
"UpdateBy",
|
||||
"UpdateHost",
|
||||
};
|
||||
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
|
||||
{
|
||||
"CreateOn",
|
||||
@@ -93,20 +111,21 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public String _MsgType { get { return Cols._MsgType.Value; } set { Cols._MsgType.Value = value; } }
|
||||
public String _Msg { get { return Cols._Msg.Value; } set { Cols._Msg.Value = value; } }
|
||||
public String _FileName { get { return Cols._FileName.Value; } set { Cols._FileName.Value = value; } }
|
||||
public Int32 _LineNumber { get { return Cols._LineNumber.Value; } set { Cols._LineNumber.Value = value; } }
|
||||
public Int16 _ItemType { get { return Cols._ItemType.Value; } set { Cols._ItemType.Value = value; } }
|
||||
public Int32 _ItemId { get { return Cols._ItemId.Value; } set { Cols._ItemId.Value = value; } }
|
||||
public Int16 _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public Int32? _LineNumber { get { return Cols._LineNumber.Value; } set { Cols._LineNumber.Value = value; } }
|
||||
public Int16? _ItemType { get { return Cols._ItemType.Value; } set { Cols._ItemType.Value = value; } }
|
||||
public Int32? _ItemId { get { return Cols._ItemId.Value; } set { Cols._ItemId.Value = value; } }
|
||||
public Int16? _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public String _Status { get { return Cols._Status.Value; } set { Cols._Status.Value = value; } }
|
||||
public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public DateTime? _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32? _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } }
|
||||
public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public DateTime? _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32? _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } }
|
||||
// Existing columns - confirmed on database if table exists.
|
||||
public List<String> ExistingColumnNames { get { return GetExistingColumnNames(Fields); } }
|
||||
public List<String> ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } }
|
||||
public List<String> UpdatableColumns { get { return ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Population.
|
||||
@@ -130,16 +149,16 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
_MsgType = GetFieldString(dbDataReader, "MsgType", _MsgType);
|
||||
_Msg = GetFieldString(dbDataReader, "Msg", _Msg);
|
||||
_FileName = GetFieldString(dbDataReader, "FileName", _FileName);
|
||||
_LineNumber = GetFieldInt32(dbDataReader, "LineNumber", _LineNumber);
|
||||
_ItemType = GetFieldInt16(dbDataReader, "ItemType", _ItemType);
|
||||
_ItemId = GetFieldInt32(dbDataReader, "ItemId", _ItemId);
|
||||
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
|
||||
_LineNumber = GetFieldInt32Nullable(dbDataReader, "LineNumber", _LineNumber);
|
||||
_ItemType = GetFieldInt16Nullable(dbDataReader, "ItemType", _ItemType);
|
||||
_ItemId = GetFieldInt32Nullable(dbDataReader, "ItemId", _ItemId);
|
||||
_Flags = GetFieldInt16Nullable(dbDataReader, "Flags", _Flags);
|
||||
_Status = GetFieldString(dbDataReader, "Status", _Status);
|
||||
_CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateOn = GetFieldDateTimeNullable(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32Nullable(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost);
|
||||
_UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateOn = GetFieldDateTimeNullable(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32Nullable(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost);
|
||||
}
|
||||
|
||||
@@ -187,10 +206,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update command.
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand)
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand, List<String> columnsToUpdate = null)
|
||||
{
|
||||
// Columns to update.
|
||||
List<String> columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList();
|
||||
List<String> columnNames = (columnsToUpdate?.Any() ?? false ? columnsToUpdate : UpdatableColumns).Where(col => UpdatableColumns.ContainsCI(col)).ToList();
|
||||
if (!columnNames.Any())
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} No columns to update. [{GetType().Name}]");
|
||||
return false;
|
||||
}
|
||||
// Construct query.
|
||||
String query = "UPDATE " + TableNameFmt + " SET ";
|
||||
if (dbCommand is SqlCommand)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
@@ -9,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 6-Jun-2024 17:06:27
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:21
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
@@ -23,20 +24,20 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public ColumnDataInt32 _InterfaceId { get; } = new ColumnDataInt32("InterfaceId");
|
||||
public ColumnDataInt16 _Direction { get; } = new ColumnDataInt16("Direction");
|
||||
public ColumnDataString _ProcRef { get; } = new ColumnDataString("ProcRef");
|
||||
public ColumnDataInt32 _ProcSeq { get; } = new ColumnDataInt32("ProcSeq");
|
||||
public ColumnDataInt32 _ProcDate { get; } = new ColumnDataInt32("ProcDate");
|
||||
public ColumnDataInt32 _ProcTime { get; } = new ColumnDataInt32("ProcTime");
|
||||
public ColumnDataInt32 _BatchDate { get; } = new ColumnDataInt32("BatchDate");
|
||||
public ColumnDataInt32 _BatchTime { get; } = new ColumnDataInt32("BatchTime");
|
||||
public ColumnDataInt32 _ElapseSecs { get; } = new ColumnDataInt32("ElapseSecs");
|
||||
public ColumnDataInt32 _ItemCount { get; } = new ColumnDataInt32("ItemCount");
|
||||
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
|
||||
public ColumnDataInt32Nullable _ProcSeq { get; } = new ColumnDataInt32Nullable("ProcSeq");
|
||||
public ColumnDataInt32Nullable _ProcDate { get; } = new ColumnDataInt32Nullable("ProcDate");
|
||||
public ColumnDataInt32Nullable _ProcTime { get; } = new ColumnDataInt32Nullable("ProcTime");
|
||||
public ColumnDataInt32Nullable _BatchDate { get; } = new ColumnDataInt32Nullable("BatchDate");
|
||||
public ColumnDataInt32Nullable _BatchTime { get; } = new ColumnDataInt32Nullable("BatchTime");
|
||||
public ColumnDataInt32Nullable _ElapseSecs { get; } = new ColumnDataInt32Nullable("ElapseSecs");
|
||||
public ColumnDataInt32Nullable _ItemCount { get; } = new ColumnDataInt32Nullable("ItemCount");
|
||||
public ColumnDataInt16Nullable _Flags { get; } = new ColumnDataInt16Nullable("Flags");
|
||||
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
|
||||
public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn");
|
||||
public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy");
|
||||
public ColumnDataDateTimeNullable _CreateOn { get; } = new ColumnDataDateTimeNullable("CreateOn");
|
||||
public ColumnDataInt32Nullable _CreateBy { get; } = new ColumnDataInt32Nullable("CreateBy");
|
||||
public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost");
|
||||
public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn");
|
||||
public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy");
|
||||
public ColumnDataDateTimeNullable _UpdateOn { get; } = new ColumnDataDateTimeNullable("UpdateOn");
|
||||
public ColumnDataInt32Nullable _UpdateBy { get; } = new ColumnDataInt32Nullable("UpdateBy");
|
||||
public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost");
|
||||
}
|
||||
|
||||
@@ -71,6 +72,25 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
"Id",
|
||||
};
|
||||
protected static List<String> fieldsNullable { get; } = new List<String>()
|
||||
{
|
||||
"ProcRef",
|
||||
"ProcSeq",
|
||||
"ProcDate",
|
||||
"ProcTime",
|
||||
"BatchDate",
|
||||
"BatchTime",
|
||||
"ElapseSecs",
|
||||
"ItemCount",
|
||||
"Flags",
|
||||
"Status",
|
||||
"CreateOn",
|
||||
"CreateBy",
|
||||
"CreateHost",
|
||||
"UpdateOn",
|
||||
"UpdateBy",
|
||||
"UpdateHost",
|
||||
};
|
||||
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
|
||||
{
|
||||
"CreateOn",
|
||||
@@ -98,24 +118,25 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public Int32 _InterfaceId { get { return Cols._InterfaceId.Value; } set { Cols._InterfaceId.Value = value; } }
|
||||
public Int16 _Direction { get { return Cols._Direction.Value; } set { Cols._Direction.Value = value; } }
|
||||
public String _ProcRef { get { return Cols._ProcRef.Value; } set { Cols._ProcRef.Value = value; } }
|
||||
public Int32 _ProcSeq { get { return Cols._ProcSeq.Value; } set { Cols._ProcSeq.Value = value; } }
|
||||
public Int32 _ProcDate { get { return Cols._ProcDate.Value; } set { Cols._ProcDate.Value = value; } }
|
||||
public Int32 _ProcTime { get { return Cols._ProcTime.Value; } set { Cols._ProcTime.Value = value; } }
|
||||
public Int32 _BatchDate { get { return Cols._BatchDate.Value; } set { Cols._BatchDate.Value = value; } }
|
||||
public Int32 _BatchTime { get { return Cols._BatchTime.Value; } set { Cols._BatchTime.Value = value; } }
|
||||
public Int32 _ElapseSecs { get { return Cols._ElapseSecs.Value; } set { Cols._ElapseSecs.Value = value; } }
|
||||
public Int32 _ItemCount { get { return Cols._ItemCount.Value; } set { Cols._ItemCount.Value = value; } }
|
||||
public Int16 _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public Int32? _ProcSeq { get { return Cols._ProcSeq.Value; } set { Cols._ProcSeq.Value = value; } }
|
||||
public Int32? _ProcDate { get { return Cols._ProcDate.Value; } set { Cols._ProcDate.Value = value; } }
|
||||
public Int32? _ProcTime { get { return Cols._ProcTime.Value; } set { Cols._ProcTime.Value = value; } }
|
||||
public Int32? _BatchDate { get { return Cols._BatchDate.Value; } set { Cols._BatchDate.Value = value; } }
|
||||
public Int32? _BatchTime { get { return Cols._BatchTime.Value; } set { Cols._BatchTime.Value = value; } }
|
||||
public Int32? _ElapseSecs { get { return Cols._ElapseSecs.Value; } set { Cols._ElapseSecs.Value = value; } }
|
||||
public Int32? _ItemCount { get { return Cols._ItemCount.Value; } set { Cols._ItemCount.Value = value; } }
|
||||
public Int16? _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public String _Status { get { return Cols._Status.Value; } set { Cols._Status.Value = value; } }
|
||||
public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public DateTime? _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32? _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } }
|
||||
public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public DateTime? _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32? _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } }
|
||||
// Existing columns - confirmed on database if table exists.
|
||||
public List<String> ExistingColumnNames { get { return GetExistingColumnNames(Fields); } }
|
||||
public List<String> ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } }
|
||||
public List<String> UpdatableColumns { get { return ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Population.
|
||||
@@ -138,20 +159,20 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
_InterfaceId = GetFieldInt32(dbDataReader, "InterfaceId", _InterfaceId);
|
||||
_Direction = GetFieldInt16(dbDataReader, "Direction", _Direction);
|
||||
_ProcRef = GetFieldString(dbDataReader, "ProcRef", _ProcRef);
|
||||
_ProcSeq = GetFieldInt32(dbDataReader, "ProcSeq", _ProcSeq);
|
||||
_ProcDate = GetFieldInt32(dbDataReader, "ProcDate", _ProcDate);
|
||||
_ProcTime = GetFieldInt32(dbDataReader, "ProcTime", _ProcTime);
|
||||
_BatchDate = GetFieldInt32(dbDataReader, "BatchDate", _BatchDate);
|
||||
_BatchTime = GetFieldInt32(dbDataReader, "BatchTime", _BatchTime);
|
||||
_ElapseSecs = GetFieldInt32(dbDataReader, "ElapseSecs", _ElapseSecs);
|
||||
_ItemCount = GetFieldInt32(dbDataReader, "ItemCount", _ItemCount);
|
||||
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
|
||||
_ProcSeq = GetFieldInt32Nullable(dbDataReader, "ProcSeq", _ProcSeq);
|
||||
_ProcDate = GetFieldInt32Nullable(dbDataReader, "ProcDate", _ProcDate);
|
||||
_ProcTime = GetFieldInt32Nullable(dbDataReader, "ProcTime", _ProcTime);
|
||||
_BatchDate = GetFieldInt32Nullable(dbDataReader, "BatchDate", _BatchDate);
|
||||
_BatchTime = GetFieldInt32Nullable(dbDataReader, "BatchTime", _BatchTime);
|
||||
_ElapseSecs = GetFieldInt32Nullable(dbDataReader, "ElapseSecs", _ElapseSecs);
|
||||
_ItemCount = GetFieldInt32Nullable(dbDataReader, "ItemCount", _ItemCount);
|
||||
_Flags = GetFieldInt16Nullable(dbDataReader, "Flags", _Flags);
|
||||
_Status = GetFieldString(dbDataReader, "Status", _Status);
|
||||
_CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateOn = GetFieldDateTimeNullable(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32Nullable(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost);
|
||||
_UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateOn = GetFieldDateTimeNullable(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32Nullable(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost);
|
||||
}
|
||||
|
||||
@@ -202,10 +223,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update command.
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand)
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand, List<String> columnsToUpdate = null)
|
||||
{
|
||||
// Columns to update.
|
||||
List<String> columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList();
|
||||
List<String> columnNames = (columnsToUpdate?.Any() ?? false ? columnsToUpdate : UpdatableColumns).Where(col => UpdatableColumns.ContainsCI(col)).ToList();
|
||||
if (!columnNames.Any())
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} No columns to update. [{GetType().Name}]");
|
||||
return false;
|
||||
}
|
||||
// Construct query.
|
||||
String query = "UPDATE " + TableNameFmt + " SET ";
|
||||
if (dbCommand is SqlCommand)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
@@ -9,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 6-Jun-2024 17:06:27
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:21
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
@@ -22,17 +23,17 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public ColumnDataInt32 _Id { get; } = new ColumnDataInt32("Id");
|
||||
public ColumnDataString _Context { get; } = new ColumnDataString("Context");
|
||||
public ColumnDataString _Code { get; } = new ColumnDataString("Code");
|
||||
public ColumnDataInt16 _Category { get; } = new ColumnDataInt16("Category");
|
||||
public ColumnDataInt16 _Type { get; } = new ColumnDataInt16("Type");
|
||||
public ColumnDataInt16Nullable _Category { get; } = new ColumnDataInt16Nullable("Category");
|
||||
public ColumnDataInt16Nullable _Type { get; } = new ColumnDataInt16Nullable("Type");
|
||||
public ColumnDataString _Caption { get; } = new ColumnDataString("Caption");
|
||||
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
|
||||
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
|
||||
public ColumnDataInt16Nullable _Flags { get; } = new ColumnDataInt16Nullable("Flags");
|
||||
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
|
||||
public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn");
|
||||
public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy");
|
||||
public ColumnDataDateTimeNullable _CreateOn { get; } = new ColumnDataDateTimeNullable("CreateOn");
|
||||
public ColumnDataInt32Nullable _CreateBy { get; } = new ColumnDataInt32Nullable("CreateBy");
|
||||
public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost");
|
||||
public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn");
|
||||
public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy");
|
||||
public ColumnDataDateTimeNullable _UpdateOn { get; } = new ColumnDataDateTimeNullable("UpdateOn");
|
||||
public ColumnDataInt32Nullable _UpdateBy { get; } = new ColumnDataInt32Nullable("UpdateBy");
|
||||
public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost");
|
||||
}
|
||||
|
||||
@@ -63,6 +64,21 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
"Id",
|
||||
};
|
||||
protected static List<String> fieldsNullable { get; } = new List<String>()
|
||||
{
|
||||
"Context",
|
||||
"Category",
|
||||
"Type",
|
||||
"Notes",
|
||||
"Flags",
|
||||
"Status",
|
||||
"CreateOn",
|
||||
"CreateBy",
|
||||
"CreateHost",
|
||||
"UpdateOn",
|
||||
"UpdateBy",
|
||||
"UpdateHost",
|
||||
};
|
||||
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
|
||||
{
|
||||
"CreateOn",
|
||||
@@ -89,21 +105,22 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public Int32 _Id { get { return Cols._Id.Value; } set { Cols._Id.Value = value; } }
|
||||
public String _Context { get { return Cols._Context.Value; } set { Cols._Context.Value = value; } }
|
||||
public String _Code { get { return Cols._Code.Value; } set { Cols._Code.Value = value; } }
|
||||
public Int16 _Category { get { return Cols._Category.Value; } set { Cols._Category.Value = value; } }
|
||||
public Int16 _Type { get { return Cols._Type.Value; } set { Cols._Type.Value = value; } }
|
||||
public Int16? _Category { get { return Cols._Category.Value; } set { Cols._Category.Value = value; } }
|
||||
public Int16? _Type { get { return Cols._Type.Value; } set { Cols._Type.Value = value; } }
|
||||
public String _Caption { get { return Cols._Caption.Value; } set { Cols._Caption.Value = value; } }
|
||||
public String _Notes { get { return Cols._Notes.Value; } set { Cols._Notes.Value = value; } }
|
||||
public Int16 _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public Int16? _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public String _Status { get { return Cols._Status.Value; } set { Cols._Status.Value = value; } }
|
||||
public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public DateTime? _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32? _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } }
|
||||
public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public DateTime? _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32? _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } }
|
||||
// Existing columns - confirmed on database if table exists.
|
||||
public List<String> ExistingColumnNames { get { return GetExistingColumnNames(Fields); } }
|
||||
public List<String> ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } }
|
||||
public List<String> UpdatableColumns { get { return ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Population.
|
||||
@@ -125,17 +142,17 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
_Id = GetFieldInt32(dbDataReader, "Id", _Id);
|
||||
_Context = GetFieldString(dbDataReader, "Context", _Context);
|
||||
_Code = GetFieldString(dbDataReader, "Code", _Code);
|
||||
_Category = GetFieldInt16(dbDataReader, "Category", _Category);
|
||||
_Type = GetFieldInt16(dbDataReader, "Type", _Type);
|
||||
_Category = GetFieldInt16Nullable(dbDataReader, "Category", _Category);
|
||||
_Type = GetFieldInt16Nullable(dbDataReader, "Type", _Type);
|
||||
_Caption = GetFieldString(dbDataReader, "Caption", _Caption);
|
||||
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
|
||||
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
|
||||
_Flags = GetFieldInt16Nullable(dbDataReader, "Flags", _Flags);
|
||||
_Status = GetFieldString(dbDataReader, "Status", _Status);
|
||||
_CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateOn = GetFieldDateTimeNullable(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32Nullable(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost);
|
||||
_UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateOn = GetFieldDateTimeNullable(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32Nullable(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost);
|
||||
}
|
||||
|
||||
@@ -182,10 +199,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update command.
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand)
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand, List<String> columnsToUpdate = null)
|
||||
{
|
||||
// Columns to update.
|
||||
List<String> columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList();
|
||||
List<String> columnNames = (columnsToUpdate?.Any() ?? false ? columnsToUpdate : UpdatableColumns).Where(col => UpdatableColumns.ContainsCI(col)).ToList();
|
||||
if (!columnNames.Any())
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} No columns to update. [{GetType().Name}]");
|
||||
return false;
|
||||
}
|
||||
// Construct query.
|
||||
String query = "UPDATE " + TableNameFmt + " SET ";
|
||||
if (dbCommand is SqlCommand)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
@@ -9,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 6-Jun-2024 17:06:27
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:21
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
@@ -21,7 +22,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
public ColumnDataInt32 _Id { get; } = new ColumnDataInt32("Id");
|
||||
public ColumnDataInt32 _AffIdOwner { get; } = new ColumnDataInt32("AffIdOwner");
|
||||
public ColumnDataInt16 _Type { get; } = new ColumnDataInt16("Type");
|
||||
public ColumnDataInt16Nullable _Type { get; } = new ColumnDataInt16Nullable("Type");
|
||||
public ColumnDataString _Ref { get; } = new ColumnDataString("Ref");
|
||||
public ColumnDataString _ProcessType { get; } = new ColumnDataString("ProcessType");
|
||||
public ColumnDataString _DescBrief { get; } = new ColumnDataString("DescBrief");
|
||||
@@ -31,8 +32,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn");
|
||||
public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy");
|
||||
public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost");
|
||||
public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn");
|
||||
public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy");
|
||||
public ColumnDataDateTimeNullable _UpdateOn { get; } = new ColumnDataDateTimeNullable("UpdateOn");
|
||||
public ColumnDataInt32Nullable _UpdateBy { get; } = new ColumnDataInt32Nullable("UpdateBy");
|
||||
public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost");
|
||||
}
|
||||
|
||||
@@ -63,6 +64,16 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
"Id",
|
||||
};
|
||||
protected static List<String> fieldsNullable { get; } = new List<String>()
|
||||
{
|
||||
"Type",
|
||||
"ProcessType",
|
||||
"DescBrief",
|
||||
"Notes",
|
||||
"UpdateOn",
|
||||
"UpdateBy",
|
||||
"UpdateHost",
|
||||
};
|
||||
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
|
||||
{
|
||||
"CreateOn",
|
||||
@@ -88,7 +99,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public ColumnsData Cols { get; } = new ColumnsData();
|
||||
public Int32 _Id { get { return Cols._Id.Value; } set { Cols._Id.Value = value; } }
|
||||
public Int32 _AffIdOwner { get { return Cols._AffIdOwner.Value; } set { Cols._AffIdOwner.Value = value; } }
|
||||
public Int16 _Type { get { return Cols._Type.Value; } set { Cols._Type.Value = value; } }
|
||||
public Int16? _Type { get { return Cols._Type.Value; } set { Cols._Type.Value = value; } }
|
||||
public String _Ref { get { return Cols._Ref.Value; } set { Cols._Ref.Value = value; } }
|
||||
public String _ProcessType { get { return Cols._ProcessType.Value; } set { Cols._ProcessType.Value = value; } }
|
||||
public String _DescBrief { get { return Cols._DescBrief.Value; } set { Cols._DescBrief.Value = value; } }
|
||||
@@ -98,12 +109,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } }
|
||||
public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public DateTime? _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32? _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } }
|
||||
// Existing columns - confirmed on database if table exists.
|
||||
public List<String> ExistingColumnNames { get { return GetExistingColumnNames(Fields); } }
|
||||
public List<String> ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } }
|
||||
public List<String> UpdatableColumns { get { return ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Population.
|
||||
@@ -124,7 +136,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
_Id = GetFieldInt32(dbDataReader, "Id", _Id);
|
||||
_AffIdOwner = GetFieldInt32(dbDataReader, "AffIdOwner", _AffIdOwner);
|
||||
_Type = GetFieldInt16(dbDataReader, "Type", _Type);
|
||||
_Type = GetFieldInt16Nullable(dbDataReader, "Type", _Type);
|
||||
_Ref = GetFieldString(dbDataReader, "Ref", _Ref);
|
||||
_ProcessType = GetFieldString(dbDataReader, "ProcessType", _ProcessType);
|
||||
_DescBrief = GetFieldString(dbDataReader, "DescBrief", _DescBrief);
|
||||
@@ -134,8 +146,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
_CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost);
|
||||
_UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateOn = GetFieldDateTimeNullable(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32Nullable(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost);
|
||||
}
|
||||
|
||||
@@ -182,10 +194,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update command.
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand)
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand, List<String> columnsToUpdate = null)
|
||||
{
|
||||
// Columns to update.
|
||||
List<String> columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList();
|
||||
List<String> columnNames = (columnsToUpdate?.Any() ?? false ? columnsToUpdate : UpdatableColumns).Where(col => UpdatableColumns.ContainsCI(col)).ToList();
|
||||
if (!columnNames.Any())
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} No columns to update. [{GetType().Name}]");
|
||||
return false;
|
||||
}
|
||||
// Construct query.
|
||||
String query = "UPDATE " + TableNameFmt + " SET ";
|
||||
if (dbCommand is SqlCommand)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
@@ -9,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 6-Jun-2024 17:06:27
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:21
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
@@ -25,16 +26,16 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public ColumnDataInt16 _ItemTypeTo { get; } = new ColumnDataInt16("ItemTypeTo");
|
||||
public ColumnDataInt32 _ItemIdTo { get; } = new ColumnDataInt32("ItemIdTo");
|
||||
public ColumnDataInt16 _Seq { get; } = new ColumnDataInt16("Seq");
|
||||
public ColumnDataDateTime _Completed { get; } = new ColumnDataDateTime("Completed");
|
||||
public ColumnDataDateTimeNullable _Completed { get; } = new ColumnDataDateTimeNullable("Completed");
|
||||
public ColumnDataString _DataContent { get; } = new ColumnDataString("DataContent");
|
||||
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
|
||||
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
|
||||
public ColumnDataInt16Nullable _Flags { get; } = new ColumnDataInt16Nullable("Flags");
|
||||
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
|
||||
public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn");
|
||||
public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy");
|
||||
public ColumnDataDateTimeNullable _CreateOn { get; } = new ColumnDataDateTimeNullable("CreateOn");
|
||||
public ColumnDataInt32Nullable _CreateBy { get; } = new ColumnDataInt32Nullable("CreateBy");
|
||||
public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost");
|
||||
public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn");
|
||||
public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy");
|
||||
public ColumnDataDateTimeNullable _UpdateOn { get; } = new ColumnDataDateTimeNullable("UpdateOn");
|
||||
public ColumnDataInt32Nullable _UpdateBy { get; } = new ColumnDataInt32Nullable("UpdateBy");
|
||||
public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost");
|
||||
}
|
||||
|
||||
@@ -72,6 +73,20 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
"ItemIdTo",
|
||||
"Seq",
|
||||
};
|
||||
protected static List<String> fieldsNullable { get; } = new List<String>()
|
||||
{
|
||||
"Completed",
|
||||
"DataContent",
|
||||
"Notes",
|
||||
"Flags",
|
||||
"Status",
|
||||
"CreateOn",
|
||||
"CreateBy",
|
||||
"CreateHost",
|
||||
"UpdateOn",
|
||||
"UpdateBy",
|
||||
"UpdateHost",
|
||||
};
|
||||
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
|
||||
{
|
||||
"CreateOn",
|
||||
@@ -101,20 +116,21 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public Int16 _ItemTypeTo { get { return Cols._ItemTypeTo.Value; } set { Cols._ItemTypeTo.Value = value; } }
|
||||
public Int32 _ItemIdTo { get { return Cols._ItemIdTo.Value; } set { Cols._ItemIdTo.Value = value; } }
|
||||
public Int16 _Seq { get { return Cols._Seq.Value; } set { Cols._Seq.Value = value; } }
|
||||
public DateTime _Completed { get { return Cols._Completed.Value; } set { Cols._Completed.Value = value; } }
|
||||
public DateTime? _Completed { get { return Cols._Completed.Value; } set { Cols._Completed.Value = value; } }
|
||||
public String _DataContent { get { return Cols._DataContent.Value; } set { Cols._DataContent.Value = value; } }
|
||||
public String _Notes { get { return Cols._Notes.Value; } set { Cols._Notes.Value = value; } }
|
||||
public Int16 _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public Int16? _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public String _Status { get { return Cols._Status.Value; } set { Cols._Status.Value = value; } }
|
||||
public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public DateTime? _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32? _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } }
|
||||
public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public DateTime? _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32? _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } }
|
||||
// Existing columns - confirmed on database if table exists.
|
||||
public List<String> ExistingColumnNames { get { return GetExistingColumnNames(Fields); } }
|
||||
public List<String> ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } }
|
||||
public List<String> UpdatableColumns { get { return ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Population.
|
||||
@@ -139,16 +155,16 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
_ItemTypeTo = GetFieldInt16(dbDataReader, "ItemTypeTo", _ItemTypeTo);
|
||||
_ItemIdTo = GetFieldInt32(dbDataReader, "ItemIdTo", _ItemIdTo);
|
||||
_Seq = GetFieldInt16(dbDataReader, "Seq", _Seq);
|
||||
_Completed = GetFieldDateTime(dbDataReader, "Completed", _Completed);
|
||||
_Completed = GetFieldDateTimeNullable(dbDataReader, "Completed", _Completed);
|
||||
_DataContent = GetFieldString(dbDataReader, "DataContent", _DataContent);
|
||||
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
|
||||
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
|
||||
_Flags = GetFieldInt16Nullable(dbDataReader, "Flags", _Flags);
|
||||
_Status = GetFieldString(dbDataReader, "Status", _Status);
|
||||
_CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateOn = GetFieldDateTimeNullable(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32Nullable(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost);
|
||||
_UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateOn = GetFieldDateTimeNullable(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32Nullable(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost);
|
||||
}
|
||||
|
||||
@@ -197,10 +213,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update command.
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand)
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand, List<String> columnsToUpdate = null)
|
||||
{
|
||||
// Columns to update.
|
||||
List<String> columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList();
|
||||
List<String> columnNames = (columnsToUpdate?.Any() ?? false ? columnsToUpdate : UpdatableColumns).Where(col => UpdatableColumns.ContainsCI(col)).ToList();
|
||||
if (!columnNames.Any())
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} No columns to update. [{GetType().Name}]");
|
||||
return false;
|
||||
}
|
||||
// Construct query.
|
||||
String query = "UPDATE " + TableNameFmt + " SET ";
|
||||
if (dbCommand is SqlCommand)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
@@ -9,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 6-Jun-2024 17:06:27
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:21
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
@@ -22,14 +23,14 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public ColumnDataInt32 _Id { get; } = new ColumnDataInt32("Id");
|
||||
public ColumnDataString _Code { get; } = new ColumnDataString("Code");
|
||||
public ColumnDataString _Name { get; } = new ColumnDataString("Name");
|
||||
public ColumnDataInt32 _Primary { get; } = new ColumnDataInt32("Primary");
|
||||
public ColumnDataInt32Nullable _Primary { get; } = new ColumnDataInt32Nullable("Primary");
|
||||
public ColumnDataBoolean _Unicode { get; } = new ColumnDataBoolean("Unicode");
|
||||
public ColumnDataBoolean _Translation { get; } = new ColumnDataBoolean("Translation");
|
||||
public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn");
|
||||
public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy");
|
||||
public ColumnDataDateTimeNullable _CreateOn { get; } = new ColumnDataDateTimeNullable("CreateOn");
|
||||
public ColumnDataInt32Nullable _CreateBy { get; } = new ColumnDataInt32Nullable("CreateBy");
|
||||
public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost");
|
||||
public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn");
|
||||
public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy");
|
||||
public ColumnDataDateTimeNullable _UpdateOn { get; } = new ColumnDataDateTimeNullable("UpdateOn");
|
||||
public ColumnDataInt32Nullable _UpdateBy { get; } = new ColumnDataInt32Nullable("UpdateBy");
|
||||
public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost");
|
||||
}
|
||||
|
||||
@@ -57,6 +58,16 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
"Id",
|
||||
};
|
||||
protected static List<String> fieldsNullable { get; } = new List<String>()
|
||||
{
|
||||
"Primary",
|
||||
"CreateOn",
|
||||
"CreateBy",
|
||||
"CreateHost",
|
||||
"UpdateOn",
|
||||
"UpdateBy",
|
||||
"UpdateHost",
|
||||
};
|
||||
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
|
||||
{
|
||||
"CreateOn",
|
||||
@@ -83,18 +94,19 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public Int32 _Id { get { return Cols._Id.Value; } set { Cols._Id.Value = value; } }
|
||||
public String _Code { get { return Cols._Code.Value; } set { Cols._Code.Value = value; } }
|
||||
public String _Name { get { return Cols._Name.Value; } set { Cols._Name.Value = value; } }
|
||||
public Int32 _Primary { get { return Cols._Primary.Value; } set { Cols._Primary.Value = value; } }
|
||||
public Int32? _Primary { get { return Cols._Primary.Value; } set { Cols._Primary.Value = value; } }
|
||||
public Boolean _Unicode { get { return Cols._Unicode.Value; } set { Cols._Unicode.Value = value; } }
|
||||
public Boolean _Translation { get { return Cols._Translation.Value; } set { Cols._Translation.Value = value; } }
|
||||
public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public DateTime? _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32? _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } }
|
||||
public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public DateTime? _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32? _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } }
|
||||
// Existing columns - confirmed on database if table exists.
|
||||
public List<String> ExistingColumnNames { get { return GetExistingColumnNames(Fields); } }
|
||||
public List<String> ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } }
|
||||
public List<String> UpdatableColumns { get { return ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Population.
|
||||
@@ -116,14 +128,14 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
_Id = GetFieldInt32(dbDataReader, "Id", _Id);
|
||||
_Code = GetFieldString(dbDataReader, "Code", _Code);
|
||||
_Name = GetFieldString(dbDataReader, "Name", _Name);
|
||||
_Primary = GetFieldInt32(dbDataReader, "Primary", _Primary);
|
||||
_Primary = GetFieldInt32Nullable(dbDataReader, "Primary", _Primary);
|
||||
_Unicode = GetFieldBoolean(dbDataReader, "Unicode", _Unicode);
|
||||
_Translation = GetFieldBoolean(dbDataReader, "Translation", _Translation);
|
||||
_CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateOn = GetFieldDateTimeNullable(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32Nullable(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost);
|
||||
_UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateOn = GetFieldDateTimeNullable(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32Nullable(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost);
|
||||
}
|
||||
|
||||
@@ -167,10 +179,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update command.
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand)
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand, List<String> columnsToUpdate = null)
|
||||
{
|
||||
// Columns to update.
|
||||
List<String> columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList();
|
||||
List<String> columnNames = (columnsToUpdate?.Any() ?? false ? columnsToUpdate : UpdatableColumns).Where(col => UpdatableColumns.ContainsCI(col)).ToList();
|
||||
if (!columnNames.Any())
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} No columns to update. [{GetType().Name}]");
|
||||
return false;
|
||||
}
|
||||
// Construct query.
|
||||
String query = "UPDATE " + TableNameFmt + " SET ";
|
||||
if (dbCommand is SqlCommand)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
@@ -9,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 6-Jun-2024 17:06:27
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:21
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
@@ -30,8 +31,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn");
|
||||
public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy");
|
||||
public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost");
|
||||
public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn");
|
||||
public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy");
|
||||
public ColumnDataDateTimeNullable _UpdateOn { get; } = new ColumnDataDateTimeNullable("UpdateOn");
|
||||
public ColumnDataInt32Nullable _UpdateBy { get; } = new ColumnDataInt32Nullable("UpdateBy");
|
||||
public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost");
|
||||
}
|
||||
|
||||
@@ -61,6 +62,14 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
"Id",
|
||||
};
|
||||
protected static List<String> fieldsNullable { get; } = new List<String>()
|
||||
{
|
||||
"Notes",
|
||||
"CreateHost",
|
||||
"UpdateOn",
|
||||
"UpdateBy",
|
||||
"UpdateHost",
|
||||
};
|
||||
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
|
||||
{
|
||||
"CreateOn",
|
||||
@@ -95,12 +104,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } }
|
||||
public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public DateTime? _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32? _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } }
|
||||
// Existing columns - confirmed on database if table exists.
|
||||
public List<String> ExistingColumnNames { get { return GetExistingColumnNames(Fields); } }
|
||||
public List<String> ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } }
|
||||
public List<String> UpdatableColumns { get { return ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Population.
|
||||
@@ -130,8 +140,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
_CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost);
|
||||
_UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateOn = GetFieldDateTimeNullable(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32Nullable(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost);
|
||||
}
|
||||
|
||||
@@ -177,10 +187,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update command.
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand)
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand, List<String> columnsToUpdate = null)
|
||||
{
|
||||
// Columns to update.
|
||||
List<String> columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList();
|
||||
List<String> columnNames = (columnsToUpdate?.Any() ?? false ? columnsToUpdate : UpdatableColumns).Where(col => UpdatableColumns.ContainsCI(col)).ToList();
|
||||
if (!columnNames.Any())
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} No columns to update. [{GetType().Name}]");
|
||||
return false;
|
||||
}
|
||||
// Construct query.
|
||||
String query = "UPDATE " + TableNameFmt + " SET ";
|
||||
if (dbCommand is SqlCommand)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
@@ -9,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 6-Jun-2024 17:06:27
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:21
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
@@ -22,22 +23,22 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public ColumnDataInt32 _Id { get; } = new ColumnDataInt32("Id");
|
||||
public ColumnDataInt16 _ItemType { get; } = new ColumnDataInt16("ItemType");
|
||||
public ColumnDataInt32 _ItemId { get; } = new ColumnDataInt32("ItemId");
|
||||
public ColumnDataInt16 _Type { get; } = new ColumnDataInt16("Type");
|
||||
public ColumnDataDateTime _Movement { get; } = new ColumnDataDateTime("Movement");
|
||||
public ColumnDataInt32 _LocationIdFrom { get; } = new ColumnDataInt32("LocationIdFrom");
|
||||
public ColumnDataInt32 _LocationIdTo { get; } = new ColumnDataInt32("LocationIdTo");
|
||||
public ColumnDataInt16Nullable _Type { get; } = new ColumnDataInt16Nullable("Type");
|
||||
public ColumnDataDateTimeNullable _Movement { get; } = new ColumnDataDateTimeNullable("Movement");
|
||||
public ColumnDataInt32Nullable _LocationIdFrom { get; } = new ColumnDataInt32Nullable("LocationIdFrom");
|
||||
public ColumnDataInt32Nullable _LocationIdTo { get; } = new ColumnDataInt32Nullable("LocationIdTo");
|
||||
public ColumnDataDecimal _Quantity { get; } = new ColumnDataDecimal("Quantity");
|
||||
public ColumnDataInt32 _MovementIdSource { get; } = new ColumnDataInt32("MovementIdSource");
|
||||
public ColumnDataInt16 _ItemTypeSource { get; } = new ColumnDataInt16("ItemTypeSource");
|
||||
public ColumnDataInt32 _ItemIdSource { get; } = new ColumnDataInt32("ItemIdSource");
|
||||
public ColumnDataInt32Nullable _MovementIdSource { get; } = new ColumnDataInt32Nullable("MovementIdSource");
|
||||
public ColumnDataInt16Nullable _ItemTypeSource { get; } = new ColumnDataInt16Nullable("ItemTypeSource");
|
||||
public ColumnDataInt32Nullable _ItemIdSource { get; } = new ColumnDataInt32Nullable("ItemIdSource");
|
||||
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
|
||||
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
|
||||
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
|
||||
public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn");
|
||||
public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy");
|
||||
public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost");
|
||||
public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn");
|
||||
public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy");
|
||||
public ColumnDataDateTimeNullable _UpdateOn { get; } = new ColumnDataDateTimeNullable("UpdateOn");
|
||||
public ColumnDataInt32Nullable _UpdateBy { get; } = new ColumnDataInt32Nullable("UpdateBy");
|
||||
public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost");
|
||||
}
|
||||
|
||||
@@ -73,6 +74,21 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
"Id",
|
||||
};
|
||||
protected static List<String> fieldsNullable { get; } = new List<String>()
|
||||
{
|
||||
"Type",
|
||||
"Movement",
|
||||
"LocationIdFrom",
|
||||
"LocationIdTo",
|
||||
"MovementIdSource",
|
||||
"ItemTypeSource",
|
||||
"ItemIdSource",
|
||||
"Notes",
|
||||
"CreateHost",
|
||||
"UpdateOn",
|
||||
"UpdateBy",
|
||||
"UpdateHost",
|
||||
};
|
||||
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
|
||||
{
|
||||
"CreateOn",
|
||||
@@ -99,26 +115,27 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public Int32 _Id { get { return Cols._Id.Value; } set { Cols._Id.Value = value; } }
|
||||
public Int16 _ItemType { get { return Cols._ItemType.Value; } set { Cols._ItemType.Value = value; } }
|
||||
public Int32 _ItemId { get { return Cols._ItemId.Value; } set { Cols._ItemId.Value = value; } }
|
||||
public Int16 _Type { get { return Cols._Type.Value; } set { Cols._Type.Value = value; } }
|
||||
public DateTime _Movement { get { return Cols._Movement.Value; } set { Cols._Movement.Value = value; } }
|
||||
public Int32 _LocationIdFrom { get { return Cols._LocationIdFrom.Value; } set { Cols._LocationIdFrom.Value = value; } }
|
||||
public Int32 _LocationIdTo { get { return Cols._LocationIdTo.Value; } set { Cols._LocationIdTo.Value = value; } }
|
||||
public Int16? _Type { get { return Cols._Type.Value; } set { Cols._Type.Value = value; } }
|
||||
public DateTime? _Movement { get { return Cols._Movement.Value; } set { Cols._Movement.Value = value; } }
|
||||
public Int32? _LocationIdFrom { get { return Cols._LocationIdFrom.Value; } set { Cols._LocationIdFrom.Value = value; } }
|
||||
public Int32? _LocationIdTo { get { return Cols._LocationIdTo.Value; } set { Cols._LocationIdTo.Value = value; } }
|
||||
public Decimal _Quantity { get { return Cols._Quantity.Value; } set { Cols._Quantity.Value = value; } }
|
||||
public Int32 _MovementIdSource { get { return Cols._MovementIdSource.Value; } set { Cols._MovementIdSource.Value = value; } }
|
||||
public Int16 _ItemTypeSource { get { return Cols._ItemTypeSource.Value; } set { Cols._ItemTypeSource.Value = value; } }
|
||||
public Int32 _ItemIdSource { get { return Cols._ItemIdSource.Value; } set { Cols._ItemIdSource.Value = value; } }
|
||||
public Int32? _MovementIdSource { get { return Cols._MovementIdSource.Value; } set { Cols._MovementIdSource.Value = value; } }
|
||||
public Int16? _ItemTypeSource { get { return Cols._ItemTypeSource.Value; } set { Cols._ItemTypeSource.Value = value; } }
|
||||
public Int32? _ItemIdSource { get { return Cols._ItemIdSource.Value; } set { Cols._ItemIdSource.Value = value; } }
|
||||
public String _Notes { get { return Cols._Notes.Value; } set { Cols._Notes.Value = value; } }
|
||||
public Int16 _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public String _Status { get { return Cols._Status.Value; } set { Cols._Status.Value = value; } }
|
||||
public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } }
|
||||
public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public DateTime? _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32? _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } }
|
||||
// Existing columns - confirmed on database if table exists.
|
||||
public List<String> ExistingColumnNames { get { return GetExistingColumnNames(Fields); } }
|
||||
public List<String> ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } }
|
||||
public List<String> UpdatableColumns { get { return ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Population.
|
||||
@@ -140,22 +157,22 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
_Id = GetFieldInt32(dbDataReader, "Id", _Id);
|
||||
_ItemType = GetFieldInt16(dbDataReader, "ItemType", _ItemType);
|
||||
_ItemId = GetFieldInt32(dbDataReader, "ItemId", _ItemId);
|
||||
_Type = GetFieldInt16(dbDataReader, "Type", _Type);
|
||||
_Movement = GetFieldDateTime(dbDataReader, "Movement", _Movement);
|
||||
_LocationIdFrom = GetFieldInt32(dbDataReader, "LocationIdFrom", _LocationIdFrom);
|
||||
_LocationIdTo = GetFieldInt32(dbDataReader, "LocationIdTo", _LocationIdTo);
|
||||
_Type = GetFieldInt16Nullable(dbDataReader, "Type", _Type);
|
||||
_Movement = GetFieldDateTimeNullable(dbDataReader, "Movement", _Movement);
|
||||
_LocationIdFrom = GetFieldInt32Nullable(dbDataReader, "LocationIdFrom", _LocationIdFrom);
|
||||
_LocationIdTo = GetFieldInt32Nullable(dbDataReader, "LocationIdTo", _LocationIdTo);
|
||||
_Quantity = GetFieldDecimal(dbDataReader, "Quantity", _Quantity);
|
||||
_MovementIdSource = GetFieldInt32(dbDataReader, "MovementIdSource", _MovementIdSource);
|
||||
_ItemTypeSource = GetFieldInt16(dbDataReader, "ItemTypeSource", _ItemTypeSource);
|
||||
_ItemIdSource = GetFieldInt32(dbDataReader, "ItemIdSource", _ItemIdSource);
|
||||
_MovementIdSource = GetFieldInt32Nullable(dbDataReader, "MovementIdSource", _MovementIdSource);
|
||||
_ItemTypeSource = GetFieldInt16Nullable(dbDataReader, "ItemTypeSource", _ItemTypeSource);
|
||||
_ItemIdSource = GetFieldInt32Nullable(dbDataReader, "ItemIdSource", _ItemIdSource);
|
||||
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
|
||||
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
|
||||
_Status = GetFieldString(dbDataReader, "Status", _Status);
|
||||
_CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost);
|
||||
_UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateOn = GetFieldDateTimeNullable(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32Nullable(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost);
|
||||
}
|
||||
|
||||
@@ -207,10 +224,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update command.
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand)
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand, List<String> columnsToUpdate = null)
|
||||
{
|
||||
// Columns to update.
|
||||
List<String> columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList();
|
||||
List<String> columnNames = (columnsToUpdate?.Any() ?? false ? columnsToUpdate : UpdatableColumns).Where(col => UpdatableColumns.ContainsCI(col)).ToList();
|
||||
if (!columnNames.Any())
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} No columns to update. [{GetType().Name}]");
|
||||
return false;
|
||||
}
|
||||
// Construct query.
|
||||
String query = "UPDATE " + TableNameFmt + " SET ";
|
||||
if (dbCommand is SqlCommand)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
@@ -9,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 6-Jun-2024 17:06:27
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:21
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
@@ -22,7 +23,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public ColumnDataInt32 _Id { get; } = new ColumnDataInt32("Id");
|
||||
public ColumnDataInt32 _AffIdOwner { get; } = new ColumnDataInt32("AffIdOwner");
|
||||
public ColumnDataInt32 _ItemIdParent { get; } = new ColumnDataInt32("ItemIdParent");
|
||||
public ColumnDataInt16 _Seq { get; } = new ColumnDataInt16("Seq");
|
||||
public ColumnDataInt16Nullable _Seq { get; } = new ColumnDataInt16Nullable("Seq");
|
||||
public ColumnDataInt16 _Type { get; } = new ColumnDataInt16("Type");
|
||||
public ColumnDataInt32 _ItemIdRef { get; } = new ColumnDataInt32("ItemIdRef");
|
||||
public ColumnDataString _Code { get; } = new ColumnDataString("Code");
|
||||
@@ -30,15 +31,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public ColumnDataString _Caption { get; } = new ColumnDataString("Caption");
|
||||
public ColumnDataString _DescBrief { get; } = new ColumnDataString("DescBrief");
|
||||
public ColumnDataString _DescDetail { get; } = new ColumnDataString("DescDetail");
|
||||
public ColumnDataInt32 _CommodityId { get; } = new ColumnDataInt32("CommodityId");
|
||||
public ColumnDataInt32Nullable _CommodityId { get; } = new ColumnDataInt32Nullable("CommodityId");
|
||||
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
|
||||
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
|
||||
public ColumnDataInt16Nullable _Flags { get; } = new ColumnDataInt16Nullable("Flags");
|
||||
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
|
||||
public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn");
|
||||
public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy");
|
||||
public ColumnDataDateTimeNullable _CreateOn { get; } = new ColumnDataDateTimeNullable("CreateOn");
|
||||
public ColumnDataInt32Nullable _CreateBy { get; } = new ColumnDataInt32Nullable("CreateBy");
|
||||
public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost");
|
||||
public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn");
|
||||
public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy");
|
||||
public ColumnDataDateTimeNullable _UpdateOn { get; } = new ColumnDataDateTimeNullable("UpdateOn");
|
||||
public ColumnDataInt32Nullable _UpdateBy { get; } = new ColumnDataInt32Nullable("UpdateBy");
|
||||
public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost");
|
||||
}
|
||||
|
||||
@@ -75,6 +76,25 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
"Id",
|
||||
};
|
||||
protected static List<String> fieldsNullable { get; } = new List<String>()
|
||||
{
|
||||
"Seq",
|
||||
"Code",
|
||||
"ShortCut",
|
||||
"Caption",
|
||||
"DescBrief",
|
||||
"DescDetail",
|
||||
"CommodityId",
|
||||
"Notes",
|
||||
"Flags",
|
||||
"Status",
|
||||
"CreateOn",
|
||||
"CreateBy",
|
||||
"CreateHost",
|
||||
"UpdateOn",
|
||||
"UpdateBy",
|
||||
"UpdateHost",
|
||||
};
|
||||
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
|
||||
{
|
||||
"CreateOn",
|
||||
@@ -101,7 +121,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public Int32 _Id { get { return Cols._Id.Value; } set { Cols._Id.Value = value; } }
|
||||
public Int32 _AffIdOwner { get { return Cols._AffIdOwner.Value; } set { Cols._AffIdOwner.Value = value; } }
|
||||
public Int32 _ItemIdParent { get { return Cols._ItemIdParent.Value; } set { Cols._ItemIdParent.Value = value; } }
|
||||
public Int16 _Seq { get { return Cols._Seq.Value; } set { Cols._Seq.Value = value; } }
|
||||
public Int16? _Seq { get { return Cols._Seq.Value; } set { Cols._Seq.Value = value; } }
|
||||
public Int16 _Type { get { return Cols._Type.Value; } set { Cols._Type.Value = value; } }
|
||||
public Int32 _ItemIdRef { get { return Cols._ItemIdRef.Value; } set { Cols._ItemIdRef.Value = value; } }
|
||||
public String _Code { get { return Cols._Code.Value; } set { Cols._Code.Value = value; } }
|
||||
@@ -109,19 +129,20 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public String _Caption { get { return Cols._Caption.Value; } set { Cols._Caption.Value = value; } }
|
||||
public String _DescBrief { get { return Cols._DescBrief.Value; } set { Cols._DescBrief.Value = value; } }
|
||||
public String _DescDetail { get { return Cols._DescDetail.Value; } set { Cols._DescDetail.Value = value; } }
|
||||
public Int32 _CommodityId { get { return Cols._CommodityId.Value; } set { Cols._CommodityId.Value = value; } }
|
||||
public Int32? _CommodityId { get { return Cols._CommodityId.Value; } set { Cols._CommodityId.Value = value; } }
|
||||
public String _Notes { get { return Cols._Notes.Value; } set { Cols._Notes.Value = value; } }
|
||||
public Int16 _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public Int16? _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public String _Status { get { return Cols._Status.Value; } set { Cols._Status.Value = value; } }
|
||||
public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public DateTime? _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32? _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } }
|
||||
public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public DateTime? _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32? _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } }
|
||||
// Existing columns - confirmed on database if table exists.
|
||||
public List<String> ExistingColumnNames { get { return GetExistingColumnNames(Fields); } }
|
||||
public List<String> ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } }
|
||||
public List<String> UpdatableColumns { get { return ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Population.
|
||||
@@ -143,7 +164,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
_Id = GetFieldInt32(dbDataReader, "Id", _Id);
|
||||
_AffIdOwner = GetFieldInt32(dbDataReader, "AffIdOwner", _AffIdOwner);
|
||||
_ItemIdParent = GetFieldInt32(dbDataReader, "ItemIdParent", _ItemIdParent);
|
||||
_Seq = GetFieldInt16(dbDataReader, "Seq", _Seq);
|
||||
_Seq = GetFieldInt16Nullable(dbDataReader, "Seq", _Seq);
|
||||
_Type = GetFieldInt16(dbDataReader, "Type", _Type);
|
||||
_ItemIdRef = GetFieldInt32(dbDataReader, "ItemIdRef", _ItemIdRef);
|
||||
_Code = GetFieldString(dbDataReader, "Code", _Code);
|
||||
@@ -151,15 +172,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
_Caption = GetFieldString(dbDataReader, "Caption", _Caption);
|
||||
_DescBrief = GetFieldString(dbDataReader, "DescBrief", _DescBrief);
|
||||
_DescDetail = GetFieldString(dbDataReader, "DescDetail", _DescDetail);
|
||||
_CommodityId = GetFieldInt32(dbDataReader, "CommodityId", _CommodityId);
|
||||
_CommodityId = GetFieldInt32Nullable(dbDataReader, "CommodityId", _CommodityId);
|
||||
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
|
||||
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
|
||||
_Flags = GetFieldInt16Nullable(dbDataReader, "Flags", _Flags);
|
||||
_Status = GetFieldString(dbDataReader, "Status", _Status);
|
||||
_CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateOn = GetFieldDateTimeNullable(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32Nullable(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost);
|
||||
_UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateOn = GetFieldDateTimeNullable(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32Nullable(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost);
|
||||
}
|
||||
|
||||
@@ -212,10 +233,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update command.
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand)
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand, List<String> columnsToUpdate = null)
|
||||
{
|
||||
// Columns to update.
|
||||
List<String> columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList();
|
||||
List<String> columnNames = (columnsToUpdate?.Any() ?? false ? columnsToUpdate : UpdatableColumns).Where(col => UpdatableColumns.ContainsCI(col)).ToList();
|
||||
if (!columnNames.Any())
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} No columns to update. [{GetType().Name}]");
|
||||
return false;
|
||||
}
|
||||
// Construct query.
|
||||
String query = "UPDATE " + TableNameFmt + " SET ";
|
||||
if (dbCommand is SqlCommand)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
@@ -9,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 6-Jun-2024 17:06:27
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:21
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
@@ -20,20 +21,20 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public class ColumnsData
|
||||
{
|
||||
public ColumnDataInt32 _Id { get; } = new ColumnDataInt32("Id");
|
||||
public ColumnDataInt32 _AffIdOwner { get; } = new ColumnDataInt32("AffIdOwner");
|
||||
public ColumnDataInt16 _Category { get; } = new ColumnDataInt16("Category");
|
||||
public ColumnDataInt16 _Type { get; } = new ColumnDataInt16("Type");
|
||||
public ColumnDataInt16 _Seq { get; } = new ColumnDataInt16("Seq");
|
||||
public ColumnDataInt32Nullable _AffIdOwner { get; } = new ColumnDataInt32Nullable("AffIdOwner");
|
||||
public ColumnDataInt16Nullable _Category { get; } = new ColumnDataInt16Nullable("Category");
|
||||
public ColumnDataInt16Nullable _Type { get; } = new ColumnDataInt16Nullable("Type");
|
||||
public ColumnDataInt16Nullable _Seq { get; } = new ColumnDataInt16Nullable("Seq");
|
||||
public ColumnDataString _DescBrief { get; } = new ColumnDataString("DescBrief");
|
||||
public ColumnDataString _DescOutline { get; } = new ColumnDataString("DescOutline");
|
||||
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
|
||||
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
|
||||
public ColumnDataInt16Nullable _Flags { get; } = new ColumnDataInt16Nullable("Flags");
|
||||
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
|
||||
public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn");
|
||||
public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy");
|
||||
public ColumnDataDateTimeNullable _CreateOn { get; } = new ColumnDataDateTimeNullable("CreateOn");
|
||||
public ColumnDataInt32Nullable _CreateBy { get; } = new ColumnDataInt32Nullable("CreateBy");
|
||||
public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost");
|
||||
public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn");
|
||||
public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy");
|
||||
public ColumnDataDateTimeNullable _UpdateOn { get; } = new ColumnDataDateTimeNullable("UpdateOn");
|
||||
public ColumnDataInt32Nullable _UpdateBy { get; } = new ColumnDataInt32Nullable("UpdateBy");
|
||||
public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost");
|
||||
}
|
||||
|
||||
@@ -65,6 +66,24 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
"Id",
|
||||
};
|
||||
protected static List<String> fieldsNullable { get; } = new List<String>()
|
||||
{
|
||||
"AffIdOwner",
|
||||
"Category",
|
||||
"Type",
|
||||
"Seq",
|
||||
"DescBrief",
|
||||
"DescOutline",
|
||||
"Notes",
|
||||
"Flags",
|
||||
"Status",
|
||||
"CreateOn",
|
||||
"CreateBy",
|
||||
"CreateHost",
|
||||
"UpdateOn",
|
||||
"UpdateBy",
|
||||
"UpdateHost",
|
||||
};
|
||||
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
|
||||
{
|
||||
"CreateOn",
|
||||
@@ -89,24 +108,25 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
// Columns.
|
||||
public ColumnsData Cols { get; } = new ColumnsData();
|
||||
public Int32 _Id { get { return Cols._Id.Value; } set { Cols._Id.Value = value; } }
|
||||
public Int32 _AffIdOwner { get { return Cols._AffIdOwner.Value; } set { Cols._AffIdOwner.Value = value; } }
|
||||
public Int16 _Category { get { return Cols._Category.Value; } set { Cols._Category.Value = value; } }
|
||||
public Int16 _Type { get { return Cols._Type.Value; } set { Cols._Type.Value = value; } }
|
||||
public Int16 _Seq { get { return Cols._Seq.Value; } set { Cols._Seq.Value = value; } }
|
||||
public Int32? _AffIdOwner { get { return Cols._AffIdOwner.Value; } set { Cols._AffIdOwner.Value = value; } }
|
||||
public Int16? _Category { get { return Cols._Category.Value; } set { Cols._Category.Value = value; } }
|
||||
public Int16? _Type { get { return Cols._Type.Value; } set { Cols._Type.Value = value; } }
|
||||
public Int16? _Seq { get { return Cols._Seq.Value; } set { Cols._Seq.Value = value; } }
|
||||
public String _DescBrief { get { return Cols._DescBrief.Value; } set { Cols._DescBrief.Value = value; } }
|
||||
public String _DescOutline { get { return Cols._DescOutline.Value; } set { Cols._DescOutline.Value = value; } }
|
||||
public String _Notes { get { return Cols._Notes.Value; } set { Cols._Notes.Value = value; } }
|
||||
public Int16 _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public Int16? _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public String _Status { get { return Cols._Status.Value; } set { Cols._Status.Value = value; } }
|
||||
public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public DateTime? _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32? _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } }
|
||||
public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public DateTime? _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32? _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } }
|
||||
// Existing columns - confirmed on database if table exists.
|
||||
public List<String> ExistingColumnNames { get { return GetExistingColumnNames(Fields); } }
|
||||
public List<String> ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } }
|
||||
public List<String> UpdatableColumns { get { return ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Population.
|
||||
@@ -126,20 +146,20 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public override void PopulateFrom (DbDataReader dbDataReader)
|
||||
{
|
||||
_Id = GetFieldInt32(dbDataReader, "Id", _Id);
|
||||
_AffIdOwner = GetFieldInt32(dbDataReader, "AffIdOwner", _AffIdOwner);
|
||||
_Category = GetFieldInt16(dbDataReader, "Category", _Category);
|
||||
_Type = GetFieldInt16(dbDataReader, "Type", _Type);
|
||||
_Seq = GetFieldInt16(dbDataReader, "Seq", _Seq);
|
||||
_AffIdOwner = GetFieldInt32Nullable(dbDataReader, "AffIdOwner", _AffIdOwner);
|
||||
_Category = GetFieldInt16Nullable(dbDataReader, "Category", _Category);
|
||||
_Type = GetFieldInt16Nullable(dbDataReader, "Type", _Type);
|
||||
_Seq = GetFieldInt16Nullable(dbDataReader, "Seq", _Seq);
|
||||
_DescBrief = GetFieldString(dbDataReader, "DescBrief", _DescBrief);
|
||||
_DescOutline = GetFieldString(dbDataReader, "DescOutline", _DescOutline);
|
||||
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
|
||||
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
|
||||
_Flags = GetFieldInt16Nullable(dbDataReader, "Flags", _Flags);
|
||||
_Status = GetFieldString(dbDataReader, "Status", _Status);
|
||||
_CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateOn = GetFieldDateTimeNullable(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32Nullable(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost);
|
||||
_UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateOn = GetFieldDateTimeNullable(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32Nullable(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost);
|
||||
}
|
||||
|
||||
@@ -187,10 +207,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update command.
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand)
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand, List<String> columnsToUpdate = null)
|
||||
{
|
||||
// Columns to update.
|
||||
List<String> columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList();
|
||||
List<String> columnNames = (columnsToUpdate?.Any() ?? false ? columnsToUpdate : UpdatableColumns).Where(col => UpdatableColumns.ContainsCI(col)).ToList();
|
||||
if (!columnNames.Any())
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} No columns to update. [{GetType().Name}]");
|
||||
return false;
|
||||
}
|
||||
// Construct query.
|
||||
String query = "UPDATE " + TableNameFmt + " SET ";
|
||||
if (dbCommand is SqlCommand)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
@@ -9,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 6-Jun-2024 17:06:27
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:21
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
@@ -22,15 +23,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public ColumnDataInt32 _Id { get; } = new ColumnDataInt32("Id");
|
||||
public ColumnDataString _Type { get; } = new ColumnDataString("Type");
|
||||
public ColumnDataString _Name { get; } = new ColumnDataString("Name");
|
||||
public ColumnDataInt32 _Parent { get; } = new ColumnDataInt32("Parent");
|
||||
public ColumnDataInt32Nullable _Parent { get; } = new ColumnDataInt32Nullable("Parent");
|
||||
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
|
||||
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
|
||||
public ColumnDataInt16Nullable _Flags { get; } = new ColumnDataInt16Nullable("Flags");
|
||||
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
|
||||
public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn");
|
||||
public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy");
|
||||
public ColumnDataDateTimeNullable _CreateOn { get; } = new ColumnDataDateTimeNullable("CreateOn");
|
||||
public ColumnDataInt32Nullable _CreateBy { get; } = new ColumnDataInt32Nullable("CreateBy");
|
||||
public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost");
|
||||
public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn");
|
||||
public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy");
|
||||
public ColumnDataDateTimeNullable _UpdateOn { get; } = new ColumnDataDateTimeNullable("UpdateOn");
|
||||
public ColumnDataInt32Nullable _UpdateBy { get; } = new ColumnDataInt32Nullable("UpdateBy");
|
||||
public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost");
|
||||
}
|
||||
|
||||
@@ -59,6 +60,20 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
"Id",
|
||||
};
|
||||
protected static List<String> fieldsNullable { get; } = new List<String>()
|
||||
{
|
||||
"Name",
|
||||
"Parent",
|
||||
"Notes",
|
||||
"Flags",
|
||||
"Status",
|
||||
"CreateOn",
|
||||
"CreateBy",
|
||||
"CreateHost",
|
||||
"UpdateOn",
|
||||
"UpdateBy",
|
||||
"UpdateHost",
|
||||
};
|
||||
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
|
||||
{
|
||||
"CreateOn",
|
||||
@@ -85,19 +100,20 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public Int32 _Id { get { return Cols._Id.Value; } set { Cols._Id.Value = value; } }
|
||||
public String _Type { get { return Cols._Type.Value; } set { Cols._Type.Value = value; } }
|
||||
public String _Name { get { return Cols._Name.Value; } set { Cols._Name.Value = value; } }
|
||||
public Int32 _Parent { get { return Cols._Parent.Value; } set { Cols._Parent.Value = value; } }
|
||||
public Int32? _Parent { get { return Cols._Parent.Value; } set { Cols._Parent.Value = value; } }
|
||||
public String _Notes { get { return Cols._Notes.Value; } set { Cols._Notes.Value = value; } }
|
||||
public Int16 _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public Int16? _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public String _Status { get { return Cols._Status.Value; } set { Cols._Status.Value = value; } }
|
||||
public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public DateTime? _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32? _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } }
|
||||
public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public DateTime? _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32? _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } }
|
||||
// Existing columns - confirmed on database if table exists.
|
||||
public List<String> ExistingColumnNames { get { return GetExistingColumnNames(Fields); } }
|
||||
public List<String> ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } }
|
||||
public List<String> UpdatableColumns { get { return ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Population.
|
||||
@@ -119,15 +135,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
_Id = GetFieldInt32(dbDataReader, "Id", _Id);
|
||||
_Type = GetFieldString(dbDataReader, "Type", _Type);
|
||||
_Name = GetFieldString(dbDataReader, "Name", _Name);
|
||||
_Parent = GetFieldInt32(dbDataReader, "Parent", _Parent);
|
||||
_Parent = GetFieldInt32Nullable(dbDataReader, "Parent", _Parent);
|
||||
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
|
||||
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
|
||||
_Flags = GetFieldInt16Nullable(dbDataReader, "Flags", _Flags);
|
||||
_Status = GetFieldString(dbDataReader, "Status", _Status);
|
||||
_CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateOn = GetFieldDateTimeNullable(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32Nullable(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost);
|
||||
_UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateOn = GetFieldDateTimeNullable(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32Nullable(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost);
|
||||
}
|
||||
|
||||
@@ -172,10 +188,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update command.
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand)
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand, List<String> columnsToUpdate = null)
|
||||
{
|
||||
// Columns to update.
|
||||
List<String> columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList();
|
||||
List<String> columnNames = (columnsToUpdate?.Any() ?? false ? columnsToUpdate : UpdatableColumns).Where(col => UpdatableColumns.ContainsCI(col)).ToList();
|
||||
if (!columnNames.Any())
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} No columns to update. [{GetType().Name}]");
|
||||
return false;
|
||||
}
|
||||
// Construct query.
|
||||
String query = "UPDATE " + TableNameFmt + " SET ";
|
||||
if (dbCommand is SqlCommand)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
@@ -9,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 6-Jun-2024 17:06:27
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:21
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
@@ -21,63 +22,63 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
public ColumnDataInt32 _Id { get; } = new ColumnDataInt32("Id");
|
||||
public ColumnDataInt32 _AffIdOwner { get; } = new ColumnDataInt32("AffIdOwner");
|
||||
public ColumnDataInt32 _AssocId { get; } = new ColumnDataInt32("AssocId");
|
||||
public ColumnDataInt32 _TransId { get; } = new ColumnDataInt32("TransId");
|
||||
public ColumnDataInt16 _Type { get; } = new ColumnDataInt16("Type");
|
||||
public ColumnDataInt16 _Seq { get; } = new ColumnDataInt16("Seq");
|
||||
public ColumnDataInt32 _ReqntIdSource { get; } = new ColumnDataInt32("ReqntIdSource");
|
||||
public ColumnDataDateTime _Required { get; } = new ColumnDataDateTime("Required");
|
||||
public ColumnDataDateTime _Started { get; } = new ColumnDataDateTime("Started");
|
||||
public ColumnDataDateTime _Completed { get; } = new ColumnDataDateTime("Completed");
|
||||
public ColumnDataInt32Nullable _AssocId { get; } = new ColumnDataInt32Nullable("AssocId");
|
||||
public ColumnDataInt32Nullable _TransId { get; } = new ColumnDataInt32Nullable("TransId");
|
||||
public ColumnDataInt16Nullable _Type { get; } = new ColumnDataInt16Nullable("Type");
|
||||
public ColumnDataInt16Nullable _Seq { get; } = new ColumnDataInt16Nullable("Seq");
|
||||
public ColumnDataInt32Nullable _ReqntIdSource { get; } = new ColumnDataInt32Nullable("ReqntIdSource");
|
||||
public ColumnDataDateTimeNullable _Required { get; } = new ColumnDataDateTimeNullable("Required");
|
||||
public ColumnDataDateTimeNullable _Started { get; } = new ColumnDataDateTimeNullable("Started");
|
||||
public ColumnDataDateTimeNullable _Completed { get; } = new ColumnDataDateTimeNullable("Completed");
|
||||
public ColumnDataString _JobNumber { get; } = new ColumnDataString("JobNumber");
|
||||
public ColumnDataInt32 _AssIdSubcontract { get; } = new ColumnDataInt32("AssIdSubcontract");
|
||||
public ColumnDataInt32 _CommodityId { get; } = new ColumnDataInt32("CommodityId");
|
||||
public ColumnDataInt32Nullable _AssIdSubcontract { get; } = new ColumnDataInt32Nullable("AssIdSubcontract");
|
||||
public ColumnDataInt32Nullable _CommodityId { get; } = new ColumnDataInt32Nullable("CommodityId");
|
||||
public ColumnDataString _ProductCode { get; } = new ColumnDataString("ProductCode");
|
||||
public ColumnDataInt32 _AssetId { get; } = new ColumnDataInt32("AssetId");
|
||||
public ColumnDataInt32Nullable _AssetId { get; } = new ColumnDataInt32Nullable("AssetId");
|
||||
public ColumnDataString _DescBrief { get; } = new ColumnDataString("DescBrief");
|
||||
public ColumnDataString _DescIntro { get; } = new ColumnDataString("DescIntro");
|
||||
public ColumnDataString _DescOutline { get; } = new ColumnDataString("DescOutline");
|
||||
public ColumnDataString _DescDetail { get; } = new ColumnDataString("DescDetail");
|
||||
public ColumnDataString _PromotionCode { get; } = new ColumnDataString("PromotionCode");
|
||||
public ColumnDataString _NominalCode { get; } = new ColumnDataString("NominalCode");
|
||||
public ColumnDataDecimal _Quantity { get; } = new ColumnDataDecimal("Quantity");
|
||||
public ColumnDataDecimal _QuantityProd { get; } = new ColumnDataDecimal("QuantityProd");
|
||||
public ColumnDataInt32 _UomId { get; } = new ColumnDataInt32("UomId");
|
||||
public ColumnDataDecimal _Weight { get; } = new ColumnDataDecimal("Weight");
|
||||
public ColumnDataInt32 _UomIdWeight { get; } = new ColumnDataInt32("UomIdWeight");
|
||||
public ColumnDataDecimalNullable _Quantity { get; } = new ColumnDataDecimalNullable("Quantity");
|
||||
public ColumnDataDecimalNullable _QuantityProd { get; } = new ColumnDataDecimalNullable("QuantityProd");
|
||||
public ColumnDataInt32Nullable _UomId { get; } = new ColumnDataInt32Nullable("UomId");
|
||||
public ColumnDataDecimalNullable _Weight { get; } = new ColumnDataDecimalNullable("Weight");
|
||||
public ColumnDataInt32Nullable _UomIdWeight { get; } = new ColumnDataInt32Nullable("UomIdWeight");
|
||||
public ColumnDataString _MaterialSourceCode { get; } = new ColumnDataString("MaterialSourceCode");
|
||||
public ColumnDataDecimal _AmountUnit { get; } = new ColumnDataDecimal("AmountUnit");
|
||||
public ColumnDataDecimal _AmountAct { get; } = new ColumnDataDecimal("AmountAct");
|
||||
public ColumnDataDecimal _AmountDisc { get; } = new ColumnDataDecimal("AmountDisc");
|
||||
public ColumnDataDecimal _AmountNet { get; } = new ColumnDataDecimal("AmountNet");
|
||||
public ColumnDataInt32 _TaxCodeId { get; } = new ColumnDataInt32("TaxCodeId");
|
||||
public ColumnDataDecimal _TaxRate { get; } = new ColumnDataDecimal("TaxRate");
|
||||
public ColumnDataDecimal _AmountTax { get; } = new ColumnDataDecimal("AmountTax");
|
||||
public ColumnDataDecimal _AmountTot { get; } = new ColumnDataDecimal("AmountTot");
|
||||
public ColumnDataDecimalNullable _AmountUnit { get; } = new ColumnDataDecimalNullable("AmountUnit");
|
||||
public ColumnDataDecimalNullable _AmountAct { get; } = new ColumnDataDecimalNullable("AmountAct");
|
||||
public ColumnDataDecimalNullable _AmountDisc { get; } = new ColumnDataDecimalNullable("AmountDisc");
|
||||
public ColumnDataDecimalNullable _AmountNet { get; } = new ColumnDataDecimalNullable("AmountNet");
|
||||
public ColumnDataInt32Nullable _TaxCodeId { get; } = new ColumnDataInt32Nullable("TaxCodeId");
|
||||
public ColumnDataDecimalNullable _TaxRate { get; } = new ColumnDataDecimalNullable("TaxRate");
|
||||
public ColumnDataDecimalNullable _AmountTax { get; } = new ColumnDataDecimalNullable("AmountTax");
|
||||
public ColumnDataDecimalNullable _AmountTot { get; } = new ColumnDataDecimalNullable("AmountTot");
|
||||
public ColumnDataString _TimeEstChunks { get; } = new ColumnDataString("TimeEstChunks");
|
||||
public ColumnDataDecimal _TimeEst { get; } = new ColumnDataDecimal("TimeEst");
|
||||
public ColumnDataDecimalNullable _TimeEst { get; } = new ColumnDataDecimalNullable("TimeEst");
|
||||
public ColumnDataString _TimeActChunks { get; } = new ColumnDataString("TimeActChunks");
|
||||
public ColumnDataDecimal _TimeAct { get; } = new ColumnDataDecimal("TimeAct");
|
||||
public ColumnDataDecimal _TimeTot { get; } = new ColumnDataDecimal("TimeTot");
|
||||
public ColumnDataInt32 _LocationIdStock { get; } = new ColumnDataInt32("LocationIdStock");
|
||||
public ColumnDataDecimal _CostLabourHours { get; } = new ColumnDataDecimal("CostLabourHours");
|
||||
public ColumnDataDecimal _CostLabourRateHour { get; } = new ColumnDataDecimal("CostLabourRateHour");
|
||||
public ColumnDataDecimal _CostLabour { get; } = new ColumnDataDecimal("CostLabour");
|
||||
public ColumnDataDecimal _CostCommodity { get; } = new ColumnDataDecimal("CostCommodity");
|
||||
public ColumnDataDecimal _CostPurchase { get; } = new ColumnDataDecimal("CostPurchase");
|
||||
public ColumnDataDecimal _CostProcess { get; } = new ColumnDataDecimal("CostProcess");
|
||||
public ColumnDataDecimal _CostAdditional { get; } = new ColumnDataDecimal("CostAdditional");
|
||||
public ColumnDataDecimal _CostTotal { get; } = new ColumnDataDecimal("CostTotal");
|
||||
public ColumnDataDateTime _CostCalculated { get; } = new ColumnDataDateTime("CostCalculated");
|
||||
public ColumnDataDecimalNullable _TimeAct { get; } = new ColumnDataDecimalNullable("TimeAct");
|
||||
public ColumnDataDecimalNullable _TimeTot { get; } = new ColumnDataDecimalNullable("TimeTot");
|
||||
public ColumnDataInt32Nullable _LocationIdStock { get; } = new ColumnDataInt32Nullable("LocationIdStock");
|
||||
public ColumnDataDecimalNullable _CostLabourHours { get; } = new ColumnDataDecimalNullable("CostLabourHours");
|
||||
public ColumnDataDecimalNullable _CostLabourRateHour { get; } = new ColumnDataDecimalNullable("CostLabourRateHour");
|
||||
public ColumnDataDecimalNullable _CostLabour { get; } = new ColumnDataDecimalNullable("CostLabour");
|
||||
public ColumnDataDecimalNullable _CostCommodity { get; } = new ColumnDataDecimalNullable("CostCommodity");
|
||||
public ColumnDataDecimalNullable _CostPurchase { get; } = new ColumnDataDecimalNullable("CostPurchase");
|
||||
public ColumnDataDecimalNullable _CostProcess { get; } = new ColumnDataDecimalNullable("CostProcess");
|
||||
public ColumnDataDecimalNullable _CostAdditional { get; } = new ColumnDataDecimalNullable("CostAdditional");
|
||||
public ColumnDataDecimalNullable _CostTotal { get; } = new ColumnDataDecimalNullable("CostTotal");
|
||||
public ColumnDataDateTimeNullable _CostCalculated { get; } = new ColumnDataDateTimeNullable("CostCalculated");
|
||||
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
|
||||
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
|
||||
public ColumnDataInt16Nullable _Flags { get; } = new ColumnDataInt16Nullable("Flags");
|
||||
public ColumnDataString _StatusCat { get; } = new ColumnDataString("StatusCat");
|
||||
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
|
||||
public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn");
|
||||
public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy");
|
||||
public ColumnDataDateTimeNullable _CreateOn { get; } = new ColumnDataDateTimeNullable("CreateOn");
|
||||
public ColumnDataInt32Nullable _CreateBy { get; } = new ColumnDataInt32Nullable("CreateBy");
|
||||
public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost");
|
||||
public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn");
|
||||
public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy");
|
||||
public ColumnDataDateTimeNullable _UpdateOn { get; } = new ColumnDataDateTimeNullable("UpdateOn");
|
||||
public ColumnDataInt32Nullable _UpdateBy { get; } = new ColumnDataInt32Nullable("UpdateBy");
|
||||
public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost");
|
||||
}
|
||||
|
||||
@@ -153,6 +154,66 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
"Id",
|
||||
};
|
||||
protected static List<String> fieldsNullable { get; } = new List<String>()
|
||||
{
|
||||
"AssocId",
|
||||
"TransId",
|
||||
"Type",
|
||||
"Seq",
|
||||
"ReqntIdSource",
|
||||
"Required",
|
||||
"Started",
|
||||
"Completed",
|
||||
"JobNumber",
|
||||
"AssIdSubcontract",
|
||||
"CommodityId",
|
||||
"ProductCode",
|
||||
"AssetId",
|
||||
"DescBrief",
|
||||
"DescIntro",
|
||||
"DescOutline",
|
||||
"DescDetail",
|
||||
"PromotionCode",
|
||||
"NominalCode",
|
||||
"Quantity",
|
||||
"QuantityProd",
|
||||
"UomId",
|
||||
"Weight",
|
||||
"UomIdWeight",
|
||||
"MaterialSourceCode",
|
||||
"AmountUnit",
|
||||
"AmountAct",
|
||||
"AmountDisc",
|
||||
"AmountNet",
|
||||
"TaxCodeId",
|
||||
"TaxRate",
|
||||
"AmountTax",
|
||||
"AmountTot",
|
||||
"TimeEst",
|
||||
"TimeActChunks",
|
||||
"TimeAct",
|
||||
"TimeTot",
|
||||
"LocationIdStock",
|
||||
"CostLabourHours",
|
||||
"CostLabourRateHour",
|
||||
"CostLabour",
|
||||
"CostCommodity",
|
||||
"CostPurchase",
|
||||
"CostProcess",
|
||||
"CostAdditional",
|
||||
"CostTotal",
|
||||
"CostCalculated",
|
||||
"Notes",
|
||||
"Flags",
|
||||
"StatusCat",
|
||||
"Status",
|
||||
"CreateOn",
|
||||
"CreateBy",
|
||||
"CreateHost",
|
||||
"UpdateOn",
|
||||
"UpdateBy",
|
||||
"UpdateHost",
|
||||
};
|
||||
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
|
||||
{
|
||||
"CreateOn",
|
||||
@@ -178,67 +239,68 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public ColumnsData Cols { get; } = new ColumnsData();
|
||||
public Int32 _Id { get { return Cols._Id.Value; } set { Cols._Id.Value = value; } }
|
||||
public Int32 _AffIdOwner { get { return Cols._AffIdOwner.Value; } set { Cols._AffIdOwner.Value = value; } }
|
||||
public Int32 _AssocId { get { return Cols._AssocId.Value; } set { Cols._AssocId.Value = value; } }
|
||||
public Int32 _TransId { get { return Cols._TransId.Value; } set { Cols._TransId.Value = value; } }
|
||||
public Int16 _Type { get { return Cols._Type.Value; } set { Cols._Type.Value = value; } }
|
||||
public Int16 _Seq { get { return Cols._Seq.Value; } set { Cols._Seq.Value = value; } }
|
||||
public Int32 _ReqntIdSource { get { return Cols._ReqntIdSource.Value; } set { Cols._ReqntIdSource.Value = value; } }
|
||||
public DateTime _Required { get { return Cols._Required.Value; } set { Cols._Required.Value = value; } }
|
||||
public DateTime _Started { get { return Cols._Started.Value; } set { Cols._Started.Value = value; } }
|
||||
public DateTime _Completed { get { return Cols._Completed.Value; } set { Cols._Completed.Value = value; } }
|
||||
public Int32? _AssocId { get { return Cols._AssocId.Value; } set { Cols._AssocId.Value = value; } }
|
||||
public Int32? _TransId { get { return Cols._TransId.Value; } set { Cols._TransId.Value = value; } }
|
||||
public Int16? _Type { get { return Cols._Type.Value; } set { Cols._Type.Value = value; } }
|
||||
public Int16? _Seq { get { return Cols._Seq.Value; } set { Cols._Seq.Value = value; } }
|
||||
public Int32? _ReqntIdSource { get { return Cols._ReqntIdSource.Value; } set { Cols._ReqntIdSource.Value = value; } }
|
||||
public DateTime? _Required { get { return Cols._Required.Value; } set { Cols._Required.Value = value; } }
|
||||
public DateTime? _Started { get { return Cols._Started.Value; } set { Cols._Started.Value = value; } }
|
||||
public DateTime? _Completed { get { return Cols._Completed.Value; } set { Cols._Completed.Value = value; } }
|
||||
public String _JobNumber { get { return Cols._JobNumber.Value; } set { Cols._JobNumber.Value = value; } }
|
||||
public Int32 _AssIdSubcontract { get { return Cols._AssIdSubcontract.Value; } set { Cols._AssIdSubcontract.Value = value; } }
|
||||
public Int32 _CommodityId { get { return Cols._CommodityId.Value; } set { Cols._CommodityId.Value = value; } }
|
||||
public Int32? _AssIdSubcontract { get { return Cols._AssIdSubcontract.Value; } set { Cols._AssIdSubcontract.Value = value; } }
|
||||
public Int32? _CommodityId { get { return Cols._CommodityId.Value; } set { Cols._CommodityId.Value = value; } }
|
||||
public String _ProductCode { get { return Cols._ProductCode.Value; } set { Cols._ProductCode.Value = value; } }
|
||||
public Int32 _AssetId { get { return Cols._AssetId.Value; } set { Cols._AssetId.Value = value; } }
|
||||
public Int32? _AssetId { get { return Cols._AssetId.Value; } set { Cols._AssetId.Value = value; } }
|
||||
public String _DescBrief { get { return Cols._DescBrief.Value; } set { Cols._DescBrief.Value = value; } }
|
||||
public String _DescIntro { get { return Cols._DescIntro.Value; } set { Cols._DescIntro.Value = value; } }
|
||||
public String _DescOutline { get { return Cols._DescOutline.Value; } set { Cols._DescOutline.Value = value; } }
|
||||
public String _DescDetail { get { return Cols._DescDetail.Value; } set { Cols._DescDetail.Value = value; } }
|
||||
public String _PromotionCode { get { return Cols._PromotionCode.Value; } set { Cols._PromotionCode.Value = value; } }
|
||||
public String _NominalCode { get { return Cols._NominalCode.Value; } set { Cols._NominalCode.Value = value; } }
|
||||
public Decimal _Quantity { get { return Cols._Quantity.Value; } set { Cols._Quantity.Value = value; } }
|
||||
public Decimal _QuantityProd { get { return Cols._QuantityProd.Value; } set { Cols._QuantityProd.Value = value; } }
|
||||
public Int32 _UomId { get { return Cols._UomId.Value; } set { Cols._UomId.Value = value; } }
|
||||
public Decimal _Weight { get { return Cols._Weight.Value; } set { Cols._Weight.Value = value; } }
|
||||
public Int32 _UomIdWeight { get { return Cols._UomIdWeight.Value; } set { Cols._UomIdWeight.Value = value; } }
|
||||
public Decimal? _Quantity { get { return Cols._Quantity.Value; } set { Cols._Quantity.Value = value; } }
|
||||
public Decimal? _QuantityProd { get { return Cols._QuantityProd.Value; } set { Cols._QuantityProd.Value = value; } }
|
||||
public Int32? _UomId { get { return Cols._UomId.Value; } set { Cols._UomId.Value = value; } }
|
||||
public Decimal? _Weight { get { return Cols._Weight.Value; } set { Cols._Weight.Value = value; } }
|
||||
public Int32? _UomIdWeight { get { return Cols._UomIdWeight.Value; } set { Cols._UomIdWeight.Value = value; } }
|
||||
public String _MaterialSourceCode { get { return Cols._MaterialSourceCode.Value; } set { Cols._MaterialSourceCode.Value = value; } }
|
||||
public Decimal _AmountUnit { get { return Cols._AmountUnit.Value; } set { Cols._AmountUnit.Value = value; } }
|
||||
public Decimal _AmountAct { get { return Cols._AmountAct.Value; } set { Cols._AmountAct.Value = value; } }
|
||||
public Decimal _AmountDisc { get { return Cols._AmountDisc.Value; } set { Cols._AmountDisc.Value = value; } }
|
||||
public Decimal _AmountNet { get { return Cols._AmountNet.Value; } set { Cols._AmountNet.Value = value; } }
|
||||
public Int32 _TaxCodeId { get { return Cols._TaxCodeId.Value; } set { Cols._TaxCodeId.Value = value; } }
|
||||
public Decimal _TaxRate { get { return Cols._TaxRate.Value; } set { Cols._TaxRate.Value = value; } }
|
||||
public Decimal _AmountTax { get { return Cols._AmountTax.Value; } set { Cols._AmountTax.Value = value; } }
|
||||
public Decimal _AmountTot { get { return Cols._AmountTot.Value; } set { Cols._AmountTot.Value = value; } }
|
||||
public Decimal? _AmountUnit { get { return Cols._AmountUnit.Value; } set { Cols._AmountUnit.Value = value; } }
|
||||
public Decimal? _AmountAct { get { return Cols._AmountAct.Value; } set { Cols._AmountAct.Value = value; } }
|
||||
public Decimal? _AmountDisc { get { return Cols._AmountDisc.Value; } set { Cols._AmountDisc.Value = value; } }
|
||||
public Decimal? _AmountNet { get { return Cols._AmountNet.Value; } set { Cols._AmountNet.Value = value; } }
|
||||
public Int32? _TaxCodeId { get { return Cols._TaxCodeId.Value; } set { Cols._TaxCodeId.Value = value; } }
|
||||
public Decimal? _TaxRate { get { return Cols._TaxRate.Value; } set { Cols._TaxRate.Value = value; } }
|
||||
public Decimal? _AmountTax { get { return Cols._AmountTax.Value; } set { Cols._AmountTax.Value = value; } }
|
||||
public Decimal? _AmountTot { get { return Cols._AmountTot.Value; } set { Cols._AmountTot.Value = value; } }
|
||||
public String _TimeEstChunks { get { return Cols._TimeEstChunks.Value; } set { Cols._TimeEstChunks.Value = value; } }
|
||||
public Decimal _TimeEst { get { return Cols._TimeEst.Value; } set { Cols._TimeEst.Value = value; } }
|
||||
public Decimal? _TimeEst { get { return Cols._TimeEst.Value; } set { Cols._TimeEst.Value = value; } }
|
||||
public String _TimeActChunks { get { return Cols._TimeActChunks.Value; } set { Cols._TimeActChunks.Value = value; } }
|
||||
public Decimal _TimeAct { get { return Cols._TimeAct.Value; } set { Cols._TimeAct.Value = value; } }
|
||||
public Decimal _TimeTot { get { return Cols._TimeTot.Value; } set { Cols._TimeTot.Value = value; } }
|
||||
public Int32 _LocationIdStock { get { return Cols._LocationIdStock.Value; } set { Cols._LocationIdStock.Value = value; } }
|
||||
public Decimal _CostLabourHours { get { return Cols._CostLabourHours.Value; } set { Cols._CostLabourHours.Value = value; } }
|
||||
public Decimal _CostLabourRateHour { get { return Cols._CostLabourRateHour.Value; } set { Cols._CostLabourRateHour.Value = value; } }
|
||||
public Decimal _CostLabour { get { return Cols._CostLabour.Value; } set { Cols._CostLabour.Value = value; } }
|
||||
public Decimal _CostCommodity { get { return Cols._CostCommodity.Value; } set { Cols._CostCommodity.Value = value; } }
|
||||
public Decimal _CostPurchase { get { return Cols._CostPurchase.Value; } set { Cols._CostPurchase.Value = value; } }
|
||||
public Decimal _CostProcess { get { return Cols._CostProcess.Value; } set { Cols._CostProcess.Value = value; } }
|
||||
public Decimal _CostAdditional { get { return Cols._CostAdditional.Value; } set { Cols._CostAdditional.Value = value; } }
|
||||
public Decimal _CostTotal { get { return Cols._CostTotal.Value; } set { Cols._CostTotal.Value = value; } }
|
||||
public DateTime _CostCalculated { get { return Cols._CostCalculated.Value; } set { Cols._CostCalculated.Value = value; } }
|
||||
public Decimal? _TimeAct { get { return Cols._TimeAct.Value; } set { Cols._TimeAct.Value = value; } }
|
||||
public Decimal? _TimeTot { get { return Cols._TimeTot.Value; } set { Cols._TimeTot.Value = value; } }
|
||||
public Int32? _LocationIdStock { get { return Cols._LocationIdStock.Value; } set { Cols._LocationIdStock.Value = value; } }
|
||||
public Decimal? _CostLabourHours { get { return Cols._CostLabourHours.Value; } set { Cols._CostLabourHours.Value = value; } }
|
||||
public Decimal? _CostLabourRateHour { get { return Cols._CostLabourRateHour.Value; } set { Cols._CostLabourRateHour.Value = value; } }
|
||||
public Decimal? _CostLabour { get { return Cols._CostLabour.Value; } set { Cols._CostLabour.Value = value; } }
|
||||
public Decimal? _CostCommodity { get { return Cols._CostCommodity.Value; } set { Cols._CostCommodity.Value = value; } }
|
||||
public Decimal? _CostPurchase { get { return Cols._CostPurchase.Value; } set { Cols._CostPurchase.Value = value; } }
|
||||
public Decimal? _CostProcess { get { return Cols._CostProcess.Value; } set { Cols._CostProcess.Value = value; } }
|
||||
public Decimal? _CostAdditional { get { return Cols._CostAdditional.Value; } set { Cols._CostAdditional.Value = value; } }
|
||||
public Decimal? _CostTotal { get { return Cols._CostTotal.Value; } set { Cols._CostTotal.Value = value; } }
|
||||
public DateTime? _CostCalculated { get { return Cols._CostCalculated.Value; } set { Cols._CostCalculated.Value = value; } }
|
||||
public String _Notes { get { return Cols._Notes.Value; } set { Cols._Notes.Value = value; } }
|
||||
public Int16 _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public Int16? _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public String _StatusCat { get { return Cols._StatusCat.Value; } set { Cols._StatusCat.Value = value; } }
|
||||
public String _Status { get { return Cols._Status.Value; } set { Cols._Status.Value = value; } }
|
||||
public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public DateTime? _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32? _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } }
|
||||
public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public DateTime? _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32? _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } }
|
||||
// Existing columns - confirmed on database if table exists.
|
||||
public List<String> ExistingColumnNames { get { return GetExistingColumnNames(Fields); } }
|
||||
public List<String> ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } }
|
||||
public List<String> UpdatableColumns { get { return ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Population.
|
||||
@@ -259,63 +321,63 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
_Id = GetFieldInt32(dbDataReader, "Id", _Id);
|
||||
_AffIdOwner = GetFieldInt32(dbDataReader, "AffIdOwner", _AffIdOwner);
|
||||
_AssocId = GetFieldInt32(dbDataReader, "AssocId", _AssocId);
|
||||
_TransId = GetFieldInt32(dbDataReader, "TransId", _TransId);
|
||||
_Type = GetFieldInt16(dbDataReader, "Type", _Type);
|
||||
_Seq = GetFieldInt16(dbDataReader, "Seq", _Seq);
|
||||
_ReqntIdSource = GetFieldInt32(dbDataReader, "ReqntIdSource", _ReqntIdSource);
|
||||
_Required = GetFieldDateTime(dbDataReader, "Required", _Required);
|
||||
_Started = GetFieldDateTime(dbDataReader, "Started", _Started);
|
||||
_Completed = GetFieldDateTime(dbDataReader, "Completed", _Completed);
|
||||
_AssocId = GetFieldInt32Nullable(dbDataReader, "AssocId", _AssocId);
|
||||
_TransId = GetFieldInt32Nullable(dbDataReader, "TransId", _TransId);
|
||||
_Type = GetFieldInt16Nullable(dbDataReader, "Type", _Type);
|
||||
_Seq = GetFieldInt16Nullable(dbDataReader, "Seq", _Seq);
|
||||
_ReqntIdSource = GetFieldInt32Nullable(dbDataReader, "ReqntIdSource", _ReqntIdSource);
|
||||
_Required = GetFieldDateTimeNullable(dbDataReader, "Required", _Required);
|
||||
_Started = GetFieldDateTimeNullable(dbDataReader, "Started", _Started);
|
||||
_Completed = GetFieldDateTimeNullable(dbDataReader, "Completed", _Completed);
|
||||
_JobNumber = GetFieldString(dbDataReader, "JobNumber", _JobNumber);
|
||||
_AssIdSubcontract = GetFieldInt32(dbDataReader, "AssIdSubcontract", _AssIdSubcontract);
|
||||
_CommodityId = GetFieldInt32(dbDataReader, "CommodityId", _CommodityId);
|
||||
_AssIdSubcontract = GetFieldInt32Nullable(dbDataReader, "AssIdSubcontract", _AssIdSubcontract);
|
||||
_CommodityId = GetFieldInt32Nullable(dbDataReader, "CommodityId", _CommodityId);
|
||||
_ProductCode = GetFieldString(dbDataReader, "ProductCode", _ProductCode);
|
||||
_AssetId = GetFieldInt32(dbDataReader, "AssetId", _AssetId);
|
||||
_AssetId = GetFieldInt32Nullable(dbDataReader, "AssetId", _AssetId);
|
||||
_DescBrief = GetFieldString(dbDataReader, "DescBrief", _DescBrief);
|
||||
_DescIntro = GetFieldString(dbDataReader, "DescIntro", _DescIntro);
|
||||
_DescOutline = GetFieldString(dbDataReader, "DescOutline", _DescOutline);
|
||||
_DescDetail = GetFieldString(dbDataReader, "DescDetail", _DescDetail);
|
||||
_PromotionCode = GetFieldString(dbDataReader, "PromotionCode", _PromotionCode);
|
||||
_NominalCode = GetFieldString(dbDataReader, "NominalCode", _NominalCode);
|
||||
_Quantity = GetFieldDecimal(dbDataReader, "Quantity", _Quantity);
|
||||
_QuantityProd = GetFieldDecimal(dbDataReader, "QuantityProd", _QuantityProd);
|
||||
_UomId = GetFieldInt32(dbDataReader, "UomId", _UomId);
|
||||
_Weight = GetFieldDecimal(dbDataReader, "Weight", _Weight);
|
||||
_UomIdWeight = GetFieldInt32(dbDataReader, "UomIdWeight", _UomIdWeight);
|
||||
_Quantity = GetFieldDecimalNullable(dbDataReader, "Quantity", _Quantity);
|
||||
_QuantityProd = GetFieldDecimalNullable(dbDataReader, "QuantityProd", _QuantityProd);
|
||||
_UomId = GetFieldInt32Nullable(dbDataReader, "UomId", _UomId);
|
||||
_Weight = GetFieldDecimalNullable(dbDataReader, "Weight", _Weight);
|
||||
_UomIdWeight = GetFieldInt32Nullable(dbDataReader, "UomIdWeight", _UomIdWeight);
|
||||
_MaterialSourceCode = GetFieldString(dbDataReader, "MaterialSourceCode", _MaterialSourceCode);
|
||||
_AmountUnit = GetFieldDecimal(dbDataReader, "AmountUnit", _AmountUnit);
|
||||
_AmountAct = GetFieldDecimal(dbDataReader, "AmountAct", _AmountAct);
|
||||
_AmountDisc = GetFieldDecimal(dbDataReader, "AmountDisc", _AmountDisc);
|
||||
_AmountNet = GetFieldDecimal(dbDataReader, "AmountNet", _AmountNet);
|
||||
_TaxCodeId = GetFieldInt32(dbDataReader, "TaxCodeId", _TaxCodeId);
|
||||
_TaxRate = GetFieldDecimal(dbDataReader, "TaxRate", _TaxRate);
|
||||
_AmountTax = GetFieldDecimal(dbDataReader, "AmountTax", _AmountTax);
|
||||
_AmountTot = GetFieldDecimal(dbDataReader, "AmountTot", _AmountTot);
|
||||
_AmountUnit = GetFieldDecimalNullable(dbDataReader, "AmountUnit", _AmountUnit);
|
||||
_AmountAct = GetFieldDecimalNullable(dbDataReader, "AmountAct", _AmountAct);
|
||||
_AmountDisc = GetFieldDecimalNullable(dbDataReader, "AmountDisc", _AmountDisc);
|
||||
_AmountNet = GetFieldDecimalNullable(dbDataReader, "AmountNet", _AmountNet);
|
||||
_TaxCodeId = GetFieldInt32Nullable(dbDataReader, "TaxCodeId", _TaxCodeId);
|
||||
_TaxRate = GetFieldDecimalNullable(dbDataReader, "TaxRate", _TaxRate);
|
||||
_AmountTax = GetFieldDecimalNullable(dbDataReader, "AmountTax", _AmountTax);
|
||||
_AmountTot = GetFieldDecimalNullable(dbDataReader, "AmountTot", _AmountTot);
|
||||
_TimeEstChunks = GetFieldString(dbDataReader, "TimeEstChunks", _TimeEstChunks);
|
||||
_TimeEst = GetFieldDecimal(dbDataReader, "TimeEst", _TimeEst);
|
||||
_TimeEst = GetFieldDecimalNullable(dbDataReader, "TimeEst", _TimeEst);
|
||||
_TimeActChunks = GetFieldString(dbDataReader, "TimeActChunks", _TimeActChunks);
|
||||
_TimeAct = GetFieldDecimal(dbDataReader, "TimeAct", _TimeAct);
|
||||
_TimeTot = GetFieldDecimal(dbDataReader, "TimeTot", _TimeTot);
|
||||
_LocationIdStock = GetFieldInt32(dbDataReader, "LocationIdStock", _LocationIdStock);
|
||||
_CostLabourHours = GetFieldDecimal(dbDataReader, "CostLabourHours", _CostLabourHours);
|
||||
_CostLabourRateHour = GetFieldDecimal(dbDataReader, "CostLabourRateHour", _CostLabourRateHour);
|
||||
_CostLabour = GetFieldDecimal(dbDataReader, "CostLabour", _CostLabour);
|
||||
_CostCommodity = GetFieldDecimal(dbDataReader, "CostCommodity", _CostCommodity);
|
||||
_CostPurchase = GetFieldDecimal(dbDataReader, "CostPurchase", _CostPurchase);
|
||||
_CostProcess = GetFieldDecimal(dbDataReader, "CostProcess", _CostProcess);
|
||||
_CostAdditional = GetFieldDecimal(dbDataReader, "CostAdditional", _CostAdditional);
|
||||
_CostTotal = GetFieldDecimal(dbDataReader, "CostTotal", _CostTotal);
|
||||
_CostCalculated = GetFieldDateTime(dbDataReader, "CostCalculated", _CostCalculated);
|
||||
_TimeAct = GetFieldDecimalNullable(dbDataReader, "TimeAct", _TimeAct);
|
||||
_TimeTot = GetFieldDecimalNullable(dbDataReader, "TimeTot", _TimeTot);
|
||||
_LocationIdStock = GetFieldInt32Nullable(dbDataReader, "LocationIdStock", _LocationIdStock);
|
||||
_CostLabourHours = GetFieldDecimalNullable(dbDataReader, "CostLabourHours", _CostLabourHours);
|
||||
_CostLabourRateHour = GetFieldDecimalNullable(dbDataReader, "CostLabourRateHour", _CostLabourRateHour);
|
||||
_CostLabour = GetFieldDecimalNullable(dbDataReader, "CostLabour", _CostLabour);
|
||||
_CostCommodity = GetFieldDecimalNullable(dbDataReader, "CostCommodity", _CostCommodity);
|
||||
_CostPurchase = GetFieldDecimalNullable(dbDataReader, "CostPurchase", _CostPurchase);
|
||||
_CostProcess = GetFieldDecimalNullable(dbDataReader, "CostProcess", _CostProcess);
|
||||
_CostAdditional = GetFieldDecimalNullable(dbDataReader, "CostAdditional", _CostAdditional);
|
||||
_CostTotal = GetFieldDecimalNullable(dbDataReader, "CostTotal", _CostTotal);
|
||||
_CostCalculated = GetFieldDateTimeNullable(dbDataReader, "CostCalculated", _CostCalculated);
|
||||
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
|
||||
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
|
||||
_Flags = GetFieldInt16Nullable(dbDataReader, "Flags", _Flags);
|
||||
_StatusCat = GetFieldString(dbDataReader, "StatusCat", _StatusCat);
|
||||
_Status = GetFieldString(dbDataReader, "Status", _Status);
|
||||
_CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateOn = GetFieldDateTimeNullable(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32Nullable(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost);
|
||||
_UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateOn = GetFieldDateTimeNullable(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32Nullable(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost);
|
||||
}
|
||||
|
||||
@@ -407,10 +469,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update command.
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand)
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand, List<String> columnsToUpdate = null)
|
||||
{
|
||||
// Columns to update.
|
||||
List<String> columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList();
|
||||
List<String> columnNames = (columnsToUpdate?.Any() ?? false ? columnsToUpdate : UpdatableColumns).Where(col => UpdatableColumns.ContainsCI(col)).ToList();
|
||||
if (!columnNames.Any())
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} No columns to update. [{GetType().Name}]");
|
||||
return false;
|
||||
}
|
||||
// Construct query.
|
||||
String query = "UPDATE " + TableNameFmt + " SET ";
|
||||
if (dbCommand is SqlCommand)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
@@ -9,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 6-Jun-2024 17:06:27
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:21
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
@@ -24,26 +25,26 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public ColumnDataInt16 _AssetType { get; } = new ColumnDataInt16("AssetType");
|
||||
public ColumnDataString _Code { get; } = new ColumnDataString("Code");
|
||||
public ColumnDataString _DescBrief { get; } = new ColumnDataString("DescBrief");
|
||||
public ColumnDataInt16 _IncomeType { get; } = new ColumnDataInt16("IncomeType");
|
||||
public ColumnDataInt32 _AssocIdSupplier { get; } = new ColumnDataInt32("AssocIdSupplier");
|
||||
public ColumnDataInt16 _PaymentTerms { get; } = new ColumnDataInt16("PaymentTerms");
|
||||
public ColumnDataInt32 _TaxCodeIdPurchase { get; } = new ColumnDataInt32("TaxCodeIdPurchase");
|
||||
public ColumnDataInt32 _AssocIdCustomer { get; } = new ColumnDataInt32("AssocIdCustomer");
|
||||
public ColumnDataInt32 _TaxCodeIdSell { get; } = new ColumnDataInt32("TaxCodeIdSell");
|
||||
public ColumnDataInt32 _TaxCodeIdProfit { get; } = new ColumnDataInt32("TaxCodeIdProfit");
|
||||
public ColumnDataInt32 _UomIdRentalCost { get; } = new ColumnDataInt32("UomIdRentalCost");
|
||||
public ColumnDataInt32 _TaxCodeIdRentalCost { get; } = new ColumnDataInt32("TaxCodeIdRentalCost");
|
||||
public ColumnDataInt32 _UomIdRentalPrice { get; } = new ColumnDataInt32("UomIdRentalPrice");
|
||||
public ColumnDataInt32 _TaxCodeIdRentalPrice { get; } = new ColumnDataInt32("TaxCodeIdRentalPrice");
|
||||
public ColumnDataInt16Nullable _IncomeType { get; } = new ColumnDataInt16Nullable("IncomeType");
|
||||
public ColumnDataInt32Nullable _AssocIdSupplier { get; } = new ColumnDataInt32Nullable("AssocIdSupplier");
|
||||
public ColumnDataInt16Nullable _PaymentTerms { get; } = new ColumnDataInt16Nullable("PaymentTerms");
|
||||
public ColumnDataInt32Nullable _TaxCodeIdPurchase { get; } = new ColumnDataInt32Nullable("TaxCodeIdPurchase");
|
||||
public ColumnDataInt32Nullable _AssocIdCustomer { get; } = new ColumnDataInt32Nullable("AssocIdCustomer");
|
||||
public ColumnDataInt32Nullable _TaxCodeIdSell { get; } = new ColumnDataInt32Nullable("TaxCodeIdSell");
|
||||
public ColumnDataInt32Nullable _TaxCodeIdProfit { get; } = new ColumnDataInt32Nullable("TaxCodeIdProfit");
|
||||
public ColumnDataInt32Nullable _UomIdRentalCost { get; } = new ColumnDataInt32Nullable("UomIdRentalCost");
|
||||
public ColumnDataInt32Nullable _TaxCodeIdRentalCost { get; } = new ColumnDataInt32Nullable("TaxCodeIdRentalCost");
|
||||
public ColumnDataInt32Nullable _UomIdRentalPrice { get; } = new ColumnDataInt32Nullable("UomIdRentalPrice");
|
||||
public ColumnDataInt32Nullable _TaxCodeIdRentalPrice { get; } = new ColumnDataInt32Nullable("TaxCodeIdRentalPrice");
|
||||
public ColumnDataString _DisposeCode { get; } = new ColumnDataString("DisposeCode");
|
||||
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
|
||||
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
|
||||
public ColumnDataInt16Nullable _Flags { get; } = new ColumnDataInt16Nullable("Flags");
|
||||
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
|
||||
public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn");
|
||||
public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy");
|
||||
public ColumnDataDateTimeNullable _CreateOn { get; } = new ColumnDataDateTimeNullable("CreateOn");
|
||||
public ColumnDataInt32Nullable _CreateBy { get; } = new ColumnDataInt32Nullable("CreateBy");
|
||||
public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost");
|
||||
public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn");
|
||||
public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy");
|
||||
public ColumnDataDateTimeNullable _UpdateOn { get; } = new ColumnDataDateTimeNullable("UpdateOn");
|
||||
public ColumnDataInt32Nullable _UpdateBy { get; } = new ColumnDataInt32Nullable("UpdateBy");
|
||||
public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost");
|
||||
}
|
||||
|
||||
@@ -85,6 +86,31 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
"Id",
|
||||
};
|
||||
protected static List<String> fieldsNullable { get; } = new List<String>()
|
||||
{
|
||||
"DescBrief",
|
||||
"IncomeType",
|
||||
"AssocIdSupplier",
|
||||
"PaymentTerms",
|
||||
"TaxCodeIdPurchase",
|
||||
"AssocIdCustomer",
|
||||
"TaxCodeIdSell",
|
||||
"TaxCodeIdProfit",
|
||||
"UomIdRentalCost",
|
||||
"TaxCodeIdRentalCost",
|
||||
"UomIdRentalPrice",
|
||||
"TaxCodeIdRentalPrice",
|
||||
"DisposeCode",
|
||||
"Notes",
|
||||
"Flags",
|
||||
"Status",
|
||||
"CreateOn",
|
||||
"CreateBy",
|
||||
"CreateHost",
|
||||
"UpdateOn",
|
||||
"UpdateBy",
|
||||
"UpdateHost",
|
||||
};
|
||||
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
|
||||
{
|
||||
"CreateOn",
|
||||
@@ -113,30 +139,31 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public Int16 _AssetType { get { return Cols._AssetType.Value; } set { Cols._AssetType.Value = value; } }
|
||||
public String _Code { get { return Cols._Code.Value; } set { Cols._Code.Value = value; } }
|
||||
public String _DescBrief { get { return Cols._DescBrief.Value; } set { Cols._DescBrief.Value = value; } }
|
||||
public Int16 _IncomeType { get { return Cols._IncomeType.Value; } set { Cols._IncomeType.Value = value; } }
|
||||
public Int32 _AssocIdSupplier { get { return Cols._AssocIdSupplier.Value; } set { Cols._AssocIdSupplier.Value = value; } }
|
||||
public Int16 _PaymentTerms { get { return Cols._PaymentTerms.Value; } set { Cols._PaymentTerms.Value = value; } }
|
||||
public Int32 _TaxCodeIdPurchase { get { return Cols._TaxCodeIdPurchase.Value; } set { Cols._TaxCodeIdPurchase.Value = value; } }
|
||||
public Int32 _AssocIdCustomer { get { return Cols._AssocIdCustomer.Value; } set { Cols._AssocIdCustomer.Value = value; } }
|
||||
public Int32 _TaxCodeIdSell { get { return Cols._TaxCodeIdSell.Value; } set { Cols._TaxCodeIdSell.Value = value; } }
|
||||
public Int32 _TaxCodeIdProfit { get { return Cols._TaxCodeIdProfit.Value; } set { Cols._TaxCodeIdProfit.Value = value; } }
|
||||
public Int32 _UomIdRentalCost { get { return Cols._UomIdRentalCost.Value; } set { Cols._UomIdRentalCost.Value = value; } }
|
||||
public Int32 _TaxCodeIdRentalCost { get { return Cols._TaxCodeIdRentalCost.Value; } set { Cols._TaxCodeIdRentalCost.Value = value; } }
|
||||
public Int32 _UomIdRentalPrice { get { return Cols._UomIdRentalPrice.Value; } set { Cols._UomIdRentalPrice.Value = value; } }
|
||||
public Int32 _TaxCodeIdRentalPrice { get { return Cols._TaxCodeIdRentalPrice.Value; } set { Cols._TaxCodeIdRentalPrice.Value = value; } }
|
||||
public Int16? _IncomeType { get { return Cols._IncomeType.Value; } set { Cols._IncomeType.Value = value; } }
|
||||
public Int32? _AssocIdSupplier { get { return Cols._AssocIdSupplier.Value; } set { Cols._AssocIdSupplier.Value = value; } }
|
||||
public Int16? _PaymentTerms { get { return Cols._PaymentTerms.Value; } set { Cols._PaymentTerms.Value = value; } }
|
||||
public Int32? _TaxCodeIdPurchase { get { return Cols._TaxCodeIdPurchase.Value; } set { Cols._TaxCodeIdPurchase.Value = value; } }
|
||||
public Int32? _AssocIdCustomer { get { return Cols._AssocIdCustomer.Value; } set { Cols._AssocIdCustomer.Value = value; } }
|
||||
public Int32? _TaxCodeIdSell { get { return Cols._TaxCodeIdSell.Value; } set { Cols._TaxCodeIdSell.Value = value; } }
|
||||
public Int32? _TaxCodeIdProfit { get { return Cols._TaxCodeIdProfit.Value; } set { Cols._TaxCodeIdProfit.Value = value; } }
|
||||
public Int32? _UomIdRentalCost { get { return Cols._UomIdRentalCost.Value; } set { Cols._UomIdRentalCost.Value = value; } }
|
||||
public Int32? _TaxCodeIdRentalCost { get { return Cols._TaxCodeIdRentalCost.Value; } set { Cols._TaxCodeIdRentalCost.Value = value; } }
|
||||
public Int32? _UomIdRentalPrice { get { return Cols._UomIdRentalPrice.Value; } set { Cols._UomIdRentalPrice.Value = value; } }
|
||||
public Int32? _TaxCodeIdRentalPrice { get { return Cols._TaxCodeIdRentalPrice.Value; } set { Cols._TaxCodeIdRentalPrice.Value = value; } }
|
||||
public String _DisposeCode { get { return Cols._DisposeCode.Value; } set { Cols._DisposeCode.Value = value; } }
|
||||
public String _Notes { get { return Cols._Notes.Value; } set { Cols._Notes.Value = value; } }
|
||||
public Int16 _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public Int16? _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public String _Status { get { return Cols._Status.Value; } set { Cols._Status.Value = value; } }
|
||||
public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public DateTime? _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32? _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } }
|
||||
public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public DateTime? _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32? _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } }
|
||||
// Existing columns - confirmed on database if table exists.
|
||||
public List<String> ExistingColumnNames { get { return GetExistingColumnNames(Fields); } }
|
||||
public List<String> ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } }
|
||||
public List<String> UpdatableColumns { get { return ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Population.
|
||||
@@ -160,26 +187,26 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
_AssetType = GetFieldInt16(dbDataReader, "AssetType", _AssetType);
|
||||
_Code = GetFieldString(dbDataReader, "Code", _Code);
|
||||
_DescBrief = GetFieldString(dbDataReader, "DescBrief", _DescBrief);
|
||||
_IncomeType = GetFieldInt16(dbDataReader, "IncomeType", _IncomeType);
|
||||
_AssocIdSupplier = GetFieldInt32(dbDataReader, "AssocIdSupplier", _AssocIdSupplier);
|
||||
_PaymentTerms = GetFieldInt16(dbDataReader, "PaymentTerms", _PaymentTerms);
|
||||
_TaxCodeIdPurchase = GetFieldInt32(dbDataReader, "TaxCodeIdPurchase", _TaxCodeIdPurchase);
|
||||
_AssocIdCustomer = GetFieldInt32(dbDataReader, "AssocIdCustomer", _AssocIdCustomer);
|
||||
_TaxCodeIdSell = GetFieldInt32(dbDataReader, "TaxCodeIdSell", _TaxCodeIdSell);
|
||||
_TaxCodeIdProfit = GetFieldInt32(dbDataReader, "TaxCodeIdProfit", _TaxCodeIdProfit);
|
||||
_UomIdRentalCost = GetFieldInt32(dbDataReader, "UomIdRentalCost", _UomIdRentalCost);
|
||||
_TaxCodeIdRentalCost = GetFieldInt32(dbDataReader, "TaxCodeIdRentalCost", _TaxCodeIdRentalCost);
|
||||
_UomIdRentalPrice = GetFieldInt32(dbDataReader, "UomIdRentalPrice", _UomIdRentalPrice);
|
||||
_TaxCodeIdRentalPrice = GetFieldInt32(dbDataReader, "TaxCodeIdRentalPrice", _TaxCodeIdRentalPrice);
|
||||
_IncomeType = GetFieldInt16Nullable(dbDataReader, "IncomeType", _IncomeType);
|
||||
_AssocIdSupplier = GetFieldInt32Nullable(dbDataReader, "AssocIdSupplier", _AssocIdSupplier);
|
||||
_PaymentTerms = GetFieldInt16Nullable(dbDataReader, "PaymentTerms", _PaymentTerms);
|
||||
_TaxCodeIdPurchase = GetFieldInt32Nullable(dbDataReader, "TaxCodeIdPurchase", _TaxCodeIdPurchase);
|
||||
_AssocIdCustomer = GetFieldInt32Nullable(dbDataReader, "AssocIdCustomer", _AssocIdCustomer);
|
||||
_TaxCodeIdSell = GetFieldInt32Nullable(dbDataReader, "TaxCodeIdSell", _TaxCodeIdSell);
|
||||
_TaxCodeIdProfit = GetFieldInt32Nullable(dbDataReader, "TaxCodeIdProfit", _TaxCodeIdProfit);
|
||||
_UomIdRentalCost = GetFieldInt32Nullable(dbDataReader, "UomIdRentalCost", _UomIdRentalCost);
|
||||
_TaxCodeIdRentalCost = GetFieldInt32Nullable(dbDataReader, "TaxCodeIdRentalCost", _TaxCodeIdRentalCost);
|
||||
_UomIdRentalPrice = GetFieldInt32Nullable(dbDataReader, "UomIdRentalPrice", _UomIdRentalPrice);
|
||||
_TaxCodeIdRentalPrice = GetFieldInt32Nullable(dbDataReader, "TaxCodeIdRentalPrice", _TaxCodeIdRentalPrice);
|
||||
_DisposeCode = GetFieldString(dbDataReader, "DisposeCode", _DisposeCode);
|
||||
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
|
||||
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
|
||||
_Flags = GetFieldInt16Nullable(dbDataReader, "Flags", _Flags);
|
||||
_Status = GetFieldString(dbDataReader, "Status", _Status);
|
||||
_CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateOn = GetFieldDateTimeNullable(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32Nullable(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost);
|
||||
_UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateOn = GetFieldDateTimeNullable(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32Nullable(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost);
|
||||
}
|
||||
|
||||
@@ -237,10 +264,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update command.
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand)
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand, List<String> columnsToUpdate = null)
|
||||
{
|
||||
// Columns to update.
|
||||
List<String> columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList();
|
||||
List<String> columnNames = (columnsToUpdate?.Any() ?? false ? columnsToUpdate : UpdatableColumns).Where(col => UpdatableColumns.ContainsCI(col)).ToList();
|
||||
if (!columnNames.Any())
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} No columns to update. [{GetType().Name}]");
|
||||
return false;
|
||||
}
|
||||
// Construct query.
|
||||
String query = "UPDATE " + TableNameFmt + " SET ";
|
||||
if (dbCommand is SqlCommand)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
@@ -9,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 6-Jun-2024 17:06:27
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:21
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
@@ -20,20 +21,20 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public class ColumnsData
|
||||
{
|
||||
public ColumnDataInt32 _Id { get; } = new ColumnDataInt32("Id");
|
||||
public ColumnDataInt32 _AssetId { get; } = new ColumnDataInt32("AssetId");
|
||||
public ColumnDataInt16 _Seq { get; } = new ColumnDataInt16("Seq");
|
||||
public ColumnDataInt32 _ProcessId { get; } = new ColumnDataInt32("ProcessId");
|
||||
public ColumnDataDateTime _RequiredOn { get; } = new ColumnDataDateTime("RequiredOn");
|
||||
public ColumnDataDateTime _ExpectedOn { get; } = new ColumnDataDateTime("ExpectedOn");
|
||||
public ColumnDataDateTime _ProcessedOn { get; } = new ColumnDataDateTime("ProcessedOn");
|
||||
public ColumnDataInt32Nullable _AssetId { get; } = new ColumnDataInt32Nullable("AssetId");
|
||||
public ColumnDataInt16Nullable _Seq { get; } = new ColumnDataInt16Nullable("Seq");
|
||||
public ColumnDataInt32Nullable _ProcessId { get; } = new ColumnDataInt32Nullable("ProcessId");
|
||||
public ColumnDataDateTimeNullable _RequiredOn { get; } = new ColumnDataDateTimeNullable("RequiredOn");
|
||||
public ColumnDataDateTimeNullable _ExpectedOn { get; } = new ColumnDataDateTimeNullable("ExpectedOn");
|
||||
public ColumnDataDateTimeNullable _ProcessedOn { get; } = new ColumnDataDateTimeNullable("ProcessedOn");
|
||||
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
|
||||
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
|
||||
public ColumnDataInt16Nullable _Flags { get; } = new ColumnDataInt16Nullable("Flags");
|
||||
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
|
||||
public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn");
|
||||
public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy");
|
||||
public ColumnDataDateTimeNullable _CreateOn { get; } = new ColumnDataDateTimeNullable("CreateOn");
|
||||
public ColumnDataInt32Nullable _CreateBy { get; } = new ColumnDataInt32Nullable("CreateBy");
|
||||
public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost");
|
||||
public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn");
|
||||
public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy");
|
||||
public ColumnDataDateTimeNullable _UpdateOn { get; } = new ColumnDataDateTimeNullable("UpdateOn");
|
||||
public ColumnDataInt32Nullable _UpdateBy { get; } = new ColumnDataInt32Nullable("UpdateBy");
|
||||
public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost");
|
||||
}
|
||||
|
||||
@@ -65,6 +66,24 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
"Id",
|
||||
};
|
||||
protected static List<String> fieldsNullable { get; } = new List<String>()
|
||||
{
|
||||
"AssetId",
|
||||
"Seq",
|
||||
"ProcessId",
|
||||
"RequiredOn",
|
||||
"ExpectedOn",
|
||||
"ProcessedOn",
|
||||
"Notes",
|
||||
"Flags",
|
||||
"Status",
|
||||
"CreateOn",
|
||||
"CreateBy",
|
||||
"CreateHost",
|
||||
"UpdateOn",
|
||||
"UpdateBy",
|
||||
"UpdateHost",
|
||||
};
|
||||
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
|
||||
{
|
||||
"CreateOn",
|
||||
@@ -89,24 +108,25 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
// Columns.
|
||||
public ColumnsData Cols { get; } = new ColumnsData();
|
||||
public Int32 _Id { get { return Cols._Id.Value; } set { Cols._Id.Value = value; } }
|
||||
public Int32 _AssetId { get { return Cols._AssetId.Value; } set { Cols._AssetId.Value = value; } }
|
||||
public Int16 _Seq { get { return Cols._Seq.Value; } set { Cols._Seq.Value = value; } }
|
||||
public Int32 _ProcessId { get { return Cols._ProcessId.Value; } set { Cols._ProcessId.Value = value; } }
|
||||
public DateTime _RequiredOn { get { return Cols._RequiredOn.Value; } set { Cols._RequiredOn.Value = value; } }
|
||||
public DateTime _ExpectedOn { get { return Cols._ExpectedOn.Value; } set { Cols._ExpectedOn.Value = value; } }
|
||||
public DateTime _ProcessedOn { get { return Cols._ProcessedOn.Value; } set { Cols._ProcessedOn.Value = value; } }
|
||||
public Int32? _AssetId { get { return Cols._AssetId.Value; } set { Cols._AssetId.Value = value; } }
|
||||
public Int16? _Seq { get { return Cols._Seq.Value; } set { Cols._Seq.Value = value; } }
|
||||
public Int32? _ProcessId { get { return Cols._ProcessId.Value; } set { Cols._ProcessId.Value = value; } }
|
||||
public DateTime? _RequiredOn { get { return Cols._RequiredOn.Value; } set { Cols._RequiredOn.Value = value; } }
|
||||
public DateTime? _ExpectedOn { get { return Cols._ExpectedOn.Value; } set { Cols._ExpectedOn.Value = value; } }
|
||||
public DateTime? _ProcessedOn { get { return Cols._ProcessedOn.Value; } set { Cols._ProcessedOn.Value = value; } }
|
||||
public String _Notes { get { return Cols._Notes.Value; } set { Cols._Notes.Value = value; } }
|
||||
public Int16 _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public Int16? _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public String _Status { get { return Cols._Status.Value; } set { Cols._Status.Value = value; } }
|
||||
public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public DateTime? _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32? _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } }
|
||||
public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public DateTime? _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32? _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } }
|
||||
// Existing columns - confirmed on database if table exists.
|
||||
public List<String> ExistingColumnNames { get { return GetExistingColumnNames(Fields); } }
|
||||
public List<String> ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } }
|
||||
public List<String> UpdatableColumns { get { return ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Population.
|
||||
@@ -126,20 +146,20 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public override void PopulateFrom (DbDataReader dbDataReader)
|
||||
{
|
||||
_Id = GetFieldInt32(dbDataReader, "Id", _Id);
|
||||
_AssetId = GetFieldInt32(dbDataReader, "AssetId", _AssetId);
|
||||
_Seq = GetFieldInt16(dbDataReader, "Seq", _Seq);
|
||||
_ProcessId = GetFieldInt32(dbDataReader, "ProcessId", _ProcessId);
|
||||
_RequiredOn = GetFieldDateTime(dbDataReader, "RequiredOn", _RequiredOn);
|
||||
_ExpectedOn = GetFieldDateTime(dbDataReader, "ExpectedOn", _ExpectedOn);
|
||||
_ProcessedOn = GetFieldDateTime(dbDataReader, "ProcessedOn", _ProcessedOn);
|
||||
_AssetId = GetFieldInt32Nullable(dbDataReader, "AssetId", _AssetId);
|
||||
_Seq = GetFieldInt16Nullable(dbDataReader, "Seq", _Seq);
|
||||
_ProcessId = GetFieldInt32Nullable(dbDataReader, "ProcessId", _ProcessId);
|
||||
_RequiredOn = GetFieldDateTimeNullable(dbDataReader, "RequiredOn", _RequiredOn);
|
||||
_ExpectedOn = GetFieldDateTimeNullable(dbDataReader, "ExpectedOn", _ExpectedOn);
|
||||
_ProcessedOn = GetFieldDateTimeNullable(dbDataReader, "ProcessedOn", _ProcessedOn);
|
||||
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
|
||||
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
|
||||
_Flags = GetFieldInt16Nullable(dbDataReader, "Flags", _Flags);
|
||||
_Status = GetFieldString(dbDataReader, "Status", _Status);
|
||||
_CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateOn = GetFieldDateTimeNullable(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32Nullable(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost);
|
||||
_UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateOn = GetFieldDateTimeNullable(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32Nullable(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost);
|
||||
}
|
||||
|
||||
@@ -187,10 +207,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update command.
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand)
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand, List<String> columnsToUpdate = null)
|
||||
{
|
||||
// Columns to update.
|
||||
List<String> columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList();
|
||||
List<String> columnNames = (columnsToUpdate?.Any() ?? false ? columnsToUpdate : UpdatableColumns).Where(col => UpdatableColumns.ContainsCI(col)).ToList();
|
||||
if (!columnNames.Any())
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} No columns to update. [{GetType().Name}]");
|
||||
return false;
|
||||
}
|
||||
// Construct query.
|
||||
String query = "UPDATE " + TableNameFmt + " SET ";
|
||||
if (dbCommand is SqlCommand)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
@@ -9,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 6-Jun-2024 17:06:27
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:21
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
@@ -20,49 +21,49 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public class ColumnsData
|
||||
{
|
||||
public ColumnDataInt32 _Id { get; } = new ColumnDataInt32("Id");
|
||||
public ColumnDataInt32 _AssetCategoryId { get; } = new ColumnDataInt32("AssetCategoryId");
|
||||
public ColumnDataInt32Nullable _AssetCategoryId { get; } = new ColumnDataInt32Nullable("AssetCategoryId");
|
||||
public ColumnDataString _SerialNumber { get; } = new ColumnDataString("SerialNumber");
|
||||
public ColumnDataString _SerialFmt { get; } = new ColumnDataString("SerialFmt");
|
||||
public ColumnDataString _RefExt { get; } = new ColumnDataString("RefExt");
|
||||
public ColumnDataString _DescBrief { get; } = new ColumnDataString("DescBrief");
|
||||
public ColumnDataInt16 _ItemType { get; } = new ColumnDataInt16("ItemType");
|
||||
public ColumnDataInt32 _ItemId { get; } = new ColumnDataInt32("ItemId");
|
||||
public ColumnDataDateTime _PurchaseOn { get; } = new ColumnDataDateTime("PurchaseOn");
|
||||
public ColumnDataInt32 _AssocIdSupplier { get; } = new ColumnDataInt32("AssocIdSupplier");
|
||||
public ColumnDataInt16Nullable _ItemType { get; } = new ColumnDataInt16Nullable("ItemType");
|
||||
public ColumnDataInt32Nullable _ItemId { get; } = new ColumnDataInt32Nullable("ItemId");
|
||||
public ColumnDataDateTimeNullable _PurchaseOn { get; } = new ColumnDataDateTimeNullable("PurchaseOn");
|
||||
public ColumnDataInt32Nullable _AssocIdSupplier { get; } = new ColumnDataInt32Nullable("AssocIdSupplier");
|
||||
public ColumnDataString _PurchaseInvoiceRef { get; } = new ColumnDataString("PurchaseInvoiceRef");
|
||||
public ColumnDataInt16 _PaymentTerms { get; } = new ColumnDataInt16("PaymentTerms");
|
||||
public ColumnDataDecimal _AmountPurchase { get; } = new ColumnDataDecimal("AmountPurchase");
|
||||
public ColumnDataInt32 _TaxCodeIdPurchase { get; } = new ColumnDataInt32("TaxCodeIdPurchase");
|
||||
public ColumnDataDecimal _AmountPurchaseGross { get; } = new ColumnDataDecimal("AmountPurchaseGross");
|
||||
public ColumnDataDecimal _AmountSettlementGross { get; } = new ColumnDataDecimal("AmountSettlementGross");
|
||||
public ColumnDataDecimal _AmountEnhancementGross { get; } = new ColumnDataDecimal("AmountEnhancementGross");
|
||||
public ColumnDataInt32 _AssocIdCustomer { get; } = new ColumnDataInt32("AssocIdCustomer");
|
||||
public ColumnDataInt16Nullable _PaymentTerms { get; } = new ColumnDataInt16Nullable("PaymentTerms");
|
||||
public ColumnDataDecimalNullable _AmountPurchase { get; } = new ColumnDataDecimalNullable("AmountPurchase");
|
||||
public ColumnDataInt32Nullable _TaxCodeIdPurchase { get; } = new ColumnDataInt32Nullable("TaxCodeIdPurchase");
|
||||
public ColumnDataDecimalNullable _AmountPurchaseGross { get; } = new ColumnDataDecimalNullable("AmountPurchaseGross");
|
||||
public ColumnDataDecimalNullable _AmountSettlementGross { get; } = new ColumnDataDecimalNullable("AmountSettlementGross");
|
||||
public ColumnDataDecimalNullable _AmountEnhancementGross { get; } = new ColumnDataDecimalNullable("AmountEnhancementGross");
|
||||
public ColumnDataInt32Nullable _AssocIdCustomer { get; } = new ColumnDataInt32Nullable("AssocIdCustomer");
|
||||
public ColumnDataString _SellCategoryCode { get; } = new ColumnDataString("SellCategoryCode");
|
||||
public ColumnDataDecimal _AmountSell { get; } = new ColumnDataDecimal("AmountSell");
|
||||
public ColumnDataInt32 _TaxCodeIdSell { get; } = new ColumnDataInt32("TaxCodeIdSell");
|
||||
public ColumnDataDecimal _AmountSellGross { get; } = new ColumnDataDecimal("AmountSellGross");
|
||||
public ColumnDataInt32 _TaxCodeIdProfit { get; } = new ColumnDataInt32("TaxCodeIdProfit");
|
||||
public ColumnDataDateTime _SoldOn { get; } = new ColumnDataDateTime("SoldOn");
|
||||
public ColumnDataDecimal _AmountSold { get; } = new ColumnDataDecimal("AmountSold");
|
||||
public ColumnDataDecimal _AmountSoldGross { get; } = new ColumnDataDecimal("AmountSoldGross");
|
||||
public ColumnDataDecimalNullable _AmountSell { get; } = new ColumnDataDecimalNullable("AmountSell");
|
||||
public ColumnDataInt32Nullable _TaxCodeIdSell { get; } = new ColumnDataInt32Nullable("TaxCodeIdSell");
|
||||
public ColumnDataDecimalNullable _AmountSellGross { get; } = new ColumnDataDecimalNullable("AmountSellGross");
|
||||
public ColumnDataInt32Nullable _TaxCodeIdProfit { get; } = new ColumnDataInt32Nullable("TaxCodeIdProfit");
|
||||
public ColumnDataDateTimeNullable _SoldOn { get; } = new ColumnDataDateTimeNullable("SoldOn");
|
||||
public ColumnDataDecimalNullable _AmountSold { get; } = new ColumnDataDecimalNullable("AmountSold");
|
||||
public ColumnDataDecimalNullable _AmountSoldGross { get; } = new ColumnDataDecimalNullable("AmountSoldGross");
|
||||
public ColumnDataString _DisposeCode { get; } = new ColumnDataString("DisposeCode");
|
||||
public ColumnDataDateTime _DisposeOn { get; } = new ColumnDataDateTime("DisposeOn");
|
||||
public ColumnDataDateTime _DueBackOn { get; } = new ColumnDataDateTime("DueBackOn");
|
||||
public ColumnDataDecimal _AmountRentalCost { get; } = new ColumnDataDecimal("AmountRentalCost");
|
||||
public ColumnDataInt32 _UomIdRentalCost { get; } = new ColumnDataInt32("UomIdRentalCost");
|
||||
public ColumnDataInt32 _TaxCodeIdRentalCost { get; } = new ColumnDataInt32("TaxCodeIdRentalCost");
|
||||
public ColumnDataDecimal _AmountRentalPrice { get; } = new ColumnDataDecimal("AmountRentalPrice");
|
||||
public ColumnDataInt32 _UomIdRentalPrice { get; } = new ColumnDataInt32("UomIdRentalPrice");
|
||||
public ColumnDataInt32 _TaxCodeIdRentalPrice { get; } = new ColumnDataInt32("TaxCodeIdRentalPrice");
|
||||
public ColumnDataInt32 _ProcessIdNext { get; } = new ColumnDataInt32("ProcessIdNext");
|
||||
public ColumnDataDateTimeNullable _DisposeOn { get; } = new ColumnDataDateTimeNullable("DisposeOn");
|
||||
public ColumnDataDateTimeNullable _DueBackOn { get; } = new ColumnDataDateTimeNullable("DueBackOn");
|
||||
public ColumnDataDecimalNullable _AmountRentalCost { get; } = new ColumnDataDecimalNullable("AmountRentalCost");
|
||||
public ColumnDataInt32Nullable _UomIdRentalCost { get; } = new ColumnDataInt32Nullable("UomIdRentalCost");
|
||||
public ColumnDataInt32Nullable _TaxCodeIdRentalCost { get; } = new ColumnDataInt32Nullable("TaxCodeIdRentalCost");
|
||||
public ColumnDataDecimalNullable _AmountRentalPrice { get; } = new ColumnDataDecimalNullable("AmountRentalPrice");
|
||||
public ColumnDataInt32Nullable _UomIdRentalPrice { get; } = new ColumnDataInt32Nullable("UomIdRentalPrice");
|
||||
public ColumnDataInt32Nullable _TaxCodeIdRentalPrice { get; } = new ColumnDataInt32Nullable("TaxCodeIdRentalPrice");
|
||||
public ColumnDataInt32Nullable _ProcessIdNext { get; } = new ColumnDataInt32Nullable("ProcessIdNext");
|
||||
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
|
||||
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
|
||||
public ColumnDataInt16Nullable _Flags { get; } = new ColumnDataInt16Nullable("Flags");
|
||||
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
|
||||
public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn");
|
||||
public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy");
|
||||
public ColumnDataDateTimeNullable _CreateOn { get; } = new ColumnDataDateTimeNullable("CreateOn");
|
||||
public ColumnDataInt32Nullable _CreateBy { get; } = new ColumnDataInt32Nullable("CreateBy");
|
||||
public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost");
|
||||
public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn");
|
||||
public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy");
|
||||
public ColumnDataDateTimeNullable _UpdateOn { get; } = new ColumnDataDateTimeNullable("UpdateOn");
|
||||
public ColumnDataInt32Nullable _UpdateBy { get; } = new ColumnDataInt32Nullable("UpdateBy");
|
||||
public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost");
|
||||
}
|
||||
|
||||
@@ -123,6 +124,53 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
"Id",
|
||||
};
|
||||
protected static List<String> fieldsNullable { get; } = new List<String>()
|
||||
{
|
||||
"AssetCategoryId",
|
||||
"SerialNumber",
|
||||
"SerialFmt",
|
||||
"RefExt",
|
||||
"DescBrief",
|
||||
"ItemType",
|
||||
"ItemId",
|
||||
"PurchaseOn",
|
||||
"AssocIdSupplier",
|
||||
"PurchaseInvoiceRef",
|
||||
"PaymentTerms",
|
||||
"AmountPurchase",
|
||||
"TaxCodeIdPurchase",
|
||||
"AmountPurchaseGross",
|
||||
"AmountSettlementGross",
|
||||
"AmountEnhancementGross",
|
||||
"AssocIdCustomer",
|
||||
"SellCategoryCode",
|
||||
"AmountSell",
|
||||
"TaxCodeIdSell",
|
||||
"AmountSellGross",
|
||||
"TaxCodeIdProfit",
|
||||
"SoldOn",
|
||||
"AmountSold",
|
||||
"AmountSoldGross",
|
||||
"DisposeCode",
|
||||
"DisposeOn",
|
||||
"DueBackOn",
|
||||
"AmountRentalCost",
|
||||
"UomIdRentalCost",
|
||||
"TaxCodeIdRentalCost",
|
||||
"AmountRentalPrice",
|
||||
"UomIdRentalPrice",
|
||||
"TaxCodeIdRentalPrice",
|
||||
"ProcessIdNext",
|
||||
"Notes",
|
||||
"Flags",
|
||||
"Status",
|
||||
"CreateOn",
|
||||
"CreateBy",
|
||||
"CreateHost",
|
||||
"UpdateOn",
|
||||
"UpdateBy",
|
||||
"UpdateHost",
|
||||
};
|
||||
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
|
||||
{
|
||||
"CreateOn",
|
||||
@@ -147,53 +195,54 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
// Columns.
|
||||
public ColumnsData Cols { get; } = new ColumnsData();
|
||||
public Int32 _Id { get { return Cols._Id.Value; } set { Cols._Id.Value = value; } }
|
||||
public Int32 _AssetCategoryId { get { return Cols._AssetCategoryId.Value; } set { Cols._AssetCategoryId.Value = value; } }
|
||||
public Int32? _AssetCategoryId { get { return Cols._AssetCategoryId.Value; } set { Cols._AssetCategoryId.Value = value; } }
|
||||
public String _SerialNumber { get { return Cols._SerialNumber.Value; } set { Cols._SerialNumber.Value = value; } }
|
||||
public String _SerialFmt { get { return Cols._SerialFmt.Value; } set { Cols._SerialFmt.Value = value; } }
|
||||
public String _RefExt { get { return Cols._RefExt.Value; } set { Cols._RefExt.Value = value; } }
|
||||
public String _DescBrief { get { return Cols._DescBrief.Value; } set { Cols._DescBrief.Value = value; } }
|
||||
public Int16 _ItemType { get { return Cols._ItemType.Value; } set { Cols._ItemType.Value = value; } }
|
||||
public Int32 _ItemId { get { return Cols._ItemId.Value; } set { Cols._ItemId.Value = value; } }
|
||||
public DateTime _PurchaseOn { get { return Cols._PurchaseOn.Value; } set { Cols._PurchaseOn.Value = value; } }
|
||||
public Int32 _AssocIdSupplier { get { return Cols._AssocIdSupplier.Value; } set { Cols._AssocIdSupplier.Value = value; } }
|
||||
public Int16? _ItemType { get { return Cols._ItemType.Value; } set { Cols._ItemType.Value = value; } }
|
||||
public Int32? _ItemId { get { return Cols._ItemId.Value; } set { Cols._ItemId.Value = value; } }
|
||||
public DateTime? _PurchaseOn { get { return Cols._PurchaseOn.Value; } set { Cols._PurchaseOn.Value = value; } }
|
||||
public Int32? _AssocIdSupplier { get { return Cols._AssocIdSupplier.Value; } set { Cols._AssocIdSupplier.Value = value; } }
|
||||
public String _PurchaseInvoiceRef { get { return Cols._PurchaseInvoiceRef.Value; } set { Cols._PurchaseInvoiceRef.Value = value; } }
|
||||
public Int16 _PaymentTerms { get { return Cols._PaymentTerms.Value; } set { Cols._PaymentTerms.Value = value; } }
|
||||
public Decimal _AmountPurchase { get { return Cols._AmountPurchase.Value; } set { Cols._AmountPurchase.Value = value; } }
|
||||
public Int32 _TaxCodeIdPurchase { get { return Cols._TaxCodeIdPurchase.Value; } set { Cols._TaxCodeIdPurchase.Value = value; } }
|
||||
public Decimal _AmountPurchaseGross { get { return Cols._AmountPurchaseGross.Value; } set { Cols._AmountPurchaseGross.Value = value; } }
|
||||
public Decimal _AmountSettlementGross { get { return Cols._AmountSettlementGross.Value; } set { Cols._AmountSettlementGross.Value = value; } }
|
||||
public Decimal _AmountEnhancementGross { get { return Cols._AmountEnhancementGross.Value; } set { Cols._AmountEnhancementGross.Value = value; } }
|
||||
public Int32 _AssocIdCustomer { get { return Cols._AssocIdCustomer.Value; } set { Cols._AssocIdCustomer.Value = value; } }
|
||||
public Int16? _PaymentTerms { get { return Cols._PaymentTerms.Value; } set { Cols._PaymentTerms.Value = value; } }
|
||||
public Decimal? _AmountPurchase { get { return Cols._AmountPurchase.Value; } set { Cols._AmountPurchase.Value = value; } }
|
||||
public Int32? _TaxCodeIdPurchase { get { return Cols._TaxCodeIdPurchase.Value; } set { Cols._TaxCodeIdPurchase.Value = value; } }
|
||||
public Decimal? _AmountPurchaseGross { get { return Cols._AmountPurchaseGross.Value; } set { Cols._AmountPurchaseGross.Value = value; } }
|
||||
public Decimal? _AmountSettlementGross { get { return Cols._AmountSettlementGross.Value; } set { Cols._AmountSettlementGross.Value = value; } }
|
||||
public Decimal? _AmountEnhancementGross { get { return Cols._AmountEnhancementGross.Value; } set { Cols._AmountEnhancementGross.Value = value; } }
|
||||
public Int32? _AssocIdCustomer { get { return Cols._AssocIdCustomer.Value; } set { Cols._AssocIdCustomer.Value = value; } }
|
||||
public String _SellCategoryCode { get { return Cols._SellCategoryCode.Value; } set { Cols._SellCategoryCode.Value = value; } }
|
||||
public Decimal _AmountSell { get { return Cols._AmountSell.Value; } set { Cols._AmountSell.Value = value; } }
|
||||
public Int32 _TaxCodeIdSell { get { return Cols._TaxCodeIdSell.Value; } set { Cols._TaxCodeIdSell.Value = value; } }
|
||||
public Decimal _AmountSellGross { get { return Cols._AmountSellGross.Value; } set { Cols._AmountSellGross.Value = value; } }
|
||||
public Int32 _TaxCodeIdProfit { get { return Cols._TaxCodeIdProfit.Value; } set { Cols._TaxCodeIdProfit.Value = value; } }
|
||||
public DateTime _SoldOn { get { return Cols._SoldOn.Value; } set { Cols._SoldOn.Value = value; } }
|
||||
public Decimal _AmountSold { get { return Cols._AmountSold.Value; } set { Cols._AmountSold.Value = value; } }
|
||||
public Decimal _AmountSoldGross { get { return Cols._AmountSoldGross.Value; } set { Cols._AmountSoldGross.Value = value; } }
|
||||
public Decimal? _AmountSell { get { return Cols._AmountSell.Value; } set { Cols._AmountSell.Value = value; } }
|
||||
public Int32? _TaxCodeIdSell { get { return Cols._TaxCodeIdSell.Value; } set { Cols._TaxCodeIdSell.Value = value; } }
|
||||
public Decimal? _AmountSellGross { get { return Cols._AmountSellGross.Value; } set { Cols._AmountSellGross.Value = value; } }
|
||||
public Int32? _TaxCodeIdProfit { get { return Cols._TaxCodeIdProfit.Value; } set { Cols._TaxCodeIdProfit.Value = value; } }
|
||||
public DateTime? _SoldOn { get { return Cols._SoldOn.Value; } set { Cols._SoldOn.Value = value; } }
|
||||
public Decimal? _AmountSold { get { return Cols._AmountSold.Value; } set { Cols._AmountSold.Value = value; } }
|
||||
public Decimal? _AmountSoldGross { get { return Cols._AmountSoldGross.Value; } set { Cols._AmountSoldGross.Value = value; } }
|
||||
public String _DisposeCode { get { return Cols._DisposeCode.Value; } set { Cols._DisposeCode.Value = value; } }
|
||||
public DateTime _DisposeOn { get { return Cols._DisposeOn.Value; } set { Cols._DisposeOn.Value = value; } }
|
||||
public DateTime _DueBackOn { get { return Cols._DueBackOn.Value; } set { Cols._DueBackOn.Value = value; } }
|
||||
public Decimal _AmountRentalCost { get { return Cols._AmountRentalCost.Value; } set { Cols._AmountRentalCost.Value = value; } }
|
||||
public Int32 _UomIdRentalCost { get { return Cols._UomIdRentalCost.Value; } set { Cols._UomIdRentalCost.Value = value; } }
|
||||
public Int32 _TaxCodeIdRentalCost { get { return Cols._TaxCodeIdRentalCost.Value; } set { Cols._TaxCodeIdRentalCost.Value = value; } }
|
||||
public Decimal _AmountRentalPrice { get { return Cols._AmountRentalPrice.Value; } set { Cols._AmountRentalPrice.Value = value; } }
|
||||
public Int32 _UomIdRentalPrice { get { return Cols._UomIdRentalPrice.Value; } set { Cols._UomIdRentalPrice.Value = value; } }
|
||||
public Int32 _TaxCodeIdRentalPrice { get { return Cols._TaxCodeIdRentalPrice.Value; } set { Cols._TaxCodeIdRentalPrice.Value = value; } }
|
||||
public Int32 _ProcessIdNext { get { return Cols._ProcessIdNext.Value; } set { Cols._ProcessIdNext.Value = value; } }
|
||||
public DateTime? _DisposeOn { get { return Cols._DisposeOn.Value; } set { Cols._DisposeOn.Value = value; } }
|
||||
public DateTime? _DueBackOn { get { return Cols._DueBackOn.Value; } set { Cols._DueBackOn.Value = value; } }
|
||||
public Decimal? _AmountRentalCost { get { return Cols._AmountRentalCost.Value; } set { Cols._AmountRentalCost.Value = value; } }
|
||||
public Int32? _UomIdRentalCost { get { return Cols._UomIdRentalCost.Value; } set { Cols._UomIdRentalCost.Value = value; } }
|
||||
public Int32? _TaxCodeIdRentalCost { get { return Cols._TaxCodeIdRentalCost.Value; } set { Cols._TaxCodeIdRentalCost.Value = value; } }
|
||||
public Decimal? _AmountRentalPrice { get { return Cols._AmountRentalPrice.Value; } set { Cols._AmountRentalPrice.Value = value; } }
|
||||
public Int32? _UomIdRentalPrice { get { return Cols._UomIdRentalPrice.Value; } set { Cols._UomIdRentalPrice.Value = value; } }
|
||||
public Int32? _TaxCodeIdRentalPrice { get { return Cols._TaxCodeIdRentalPrice.Value; } set { Cols._TaxCodeIdRentalPrice.Value = value; } }
|
||||
public Int32? _ProcessIdNext { get { return Cols._ProcessIdNext.Value; } set { Cols._ProcessIdNext.Value = value; } }
|
||||
public String _Notes { get { return Cols._Notes.Value; } set { Cols._Notes.Value = value; } }
|
||||
public Int16 _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public Int16? _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public String _Status { get { return Cols._Status.Value; } set { Cols._Status.Value = value; } }
|
||||
public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public DateTime? _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32? _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } }
|
||||
public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public DateTime? _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32? _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } }
|
||||
// Existing columns - confirmed on database if table exists.
|
||||
public List<String> ExistingColumnNames { get { return GetExistingColumnNames(Fields); } }
|
||||
public List<String> ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } }
|
||||
public List<String> UpdatableColumns { get { return ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Population.
|
||||
@@ -213,49 +262,49 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public override void PopulateFrom (DbDataReader dbDataReader)
|
||||
{
|
||||
_Id = GetFieldInt32(dbDataReader, "Id", _Id);
|
||||
_AssetCategoryId = GetFieldInt32(dbDataReader, "AssetCategoryId", _AssetCategoryId);
|
||||
_AssetCategoryId = GetFieldInt32Nullable(dbDataReader, "AssetCategoryId", _AssetCategoryId);
|
||||
_SerialNumber = GetFieldString(dbDataReader, "SerialNumber", _SerialNumber);
|
||||
_SerialFmt = GetFieldString(dbDataReader, "SerialFmt", _SerialFmt);
|
||||
_RefExt = GetFieldString(dbDataReader, "RefExt", _RefExt);
|
||||
_DescBrief = GetFieldString(dbDataReader, "DescBrief", _DescBrief);
|
||||
_ItemType = GetFieldInt16(dbDataReader, "ItemType", _ItemType);
|
||||
_ItemId = GetFieldInt32(dbDataReader, "ItemId", _ItemId);
|
||||
_PurchaseOn = GetFieldDateTime(dbDataReader, "PurchaseOn", _PurchaseOn);
|
||||
_AssocIdSupplier = GetFieldInt32(dbDataReader, "AssocIdSupplier", _AssocIdSupplier);
|
||||
_ItemType = GetFieldInt16Nullable(dbDataReader, "ItemType", _ItemType);
|
||||
_ItemId = GetFieldInt32Nullable(dbDataReader, "ItemId", _ItemId);
|
||||
_PurchaseOn = GetFieldDateTimeNullable(dbDataReader, "PurchaseOn", _PurchaseOn);
|
||||
_AssocIdSupplier = GetFieldInt32Nullable(dbDataReader, "AssocIdSupplier", _AssocIdSupplier);
|
||||
_PurchaseInvoiceRef = GetFieldString(dbDataReader, "PurchaseInvoiceRef", _PurchaseInvoiceRef);
|
||||
_PaymentTerms = GetFieldInt16(dbDataReader, "PaymentTerms", _PaymentTerms);
|
||||
_AmountPurchase = GetFieldDecimal(dbDataReader, "AmountPurchase", _AmountPurchase);
|
||||
_TaxCodeIdPurchase = GetFieldInt32(dbDataReader, "TaxCodeIdPurchase", _TaxCodeIdPurchase);
|
||||
_AmountPurchaseGross = GetFieldDecimal(dbDataReader, "AmountPurchaseGross", _AmountPurchaseGross);
|
||||
_AmountSettlementGross = GetFieldDecimal(dbDataReader, "AmountSettlementGross", _AmountSettlementGross);
|
||||
_AmountEnhancementGross = GetFieldDecimal(dbDataReader, "AmountEnhancementGross", _AmountEnhancementGross);
|
||||
_AssocIdCustomer = GetFieldInt32(dbDataReader, "AssocIdCustomer", _AssocIdCustomer);
|
||||
_PaymentTerms = GetFieldInt16Nullable(dbDataReader, "PaymentTerms", _PaymentTerms);
|
||||
_AmountPurchase = GetFieldDecimalNullable(dbDataReader, "AmountPurchase", _AmountPurchase);
|
||||
_TaxCodeIdPurchase = GetFieldInt32Nullable(dbDataReader, "TaxCodeIdPurchase", _TaxCodeIdPurchase);
|
||||
_AmountPurchaseGross = GetFieldDecimalNullable(dbDataReader, "AmountPurchaseGross", _AmountPurchaseGross);
|
||||
_AmountSettlementGross = GetFieldDecimalNullable(dbDataReader, "AmountSettlementGross", _AmountSettlementGross);
|
||||
_AmountEnhancementGross = GetFieldDecimalNullable(dbDataReader, "AmountEnhancementGross", _AmountEnhancementGross);
|
||||
_AssocIdCustomer = GetFieldInt32Nullable(dbDataReader, "AssocIdCustomer", _AssocIdCustomer);
|
||||
_SellCategoryCode = GetFieldString(dbDataReader, "SellCategoryCode", _SellCategoryCode);
|
||||
_AmountSell = GetFieldDecimal(dbDataReader, "AmountSell", _AmountSell);
|
||||
_TaxCodeIdSell = GetFieldInt32(dbDataReader, "TaxCodeIdSell", _TaxCodeIdSell);
|
||||
_AmountSellGross = GetFieldDecimal(dbDataReader, "AmountSellGross", _AmountSellGross);
|
||||
_TaxCodeIdProfit = GetFieldInt32(dbDataReader, "TaxCodeIdProfit", _TaxCodeIdProfit);
|
||||
_SoldOn = GetFieldDateTime(dbDataReader, "SoldOn", _SoldOn);
|
||||
_AmountSold = GetFieldDecimal(dbDataReader, "AmountSold", _AmountSold);
|
||||
_AmountSoldGross = GetFieldDecimal(dbDataReader, "AmountSoldGross", _AmountSoldGross);
|
||||
_AmountSell = GetFieldDecimalNullable(dbDataReader, "AmountSell", _AmountSell);
|
||||
_TaxCodeIdSell = GetFieldInt32Nullable(dbDataReader, "TaxCodeIdSell", _TaxCodeIdSell);
|
||||
_AmountSellGross = GetFieldDecimalNullable(dbDataReader, "AmountSellGross", _AmountSellGross);
|
||||
_TaxCodeIdProfit = GetFieldInt32Nullable(dbDataReader, "TaxCodeIdProfit", _TaxCodeIdProfit);
|
||||
_SoldOn = GetFieldDateTimeNullable(dbDataReader, "SoldOn", _SoldOn);
|
||||
_AmountSold = GetFieldDecimalNullable(dbDataReader, "AmountSold", _AmountSold);
|
||||
_AmountSoldGross = GetFieldDecimalNullable(dbDataReader, "AmountSoldGross", _AmountSoldGross);
|
||||
_DisposeCode = GetFieldString(dbDataReader, "DisposeCode", _DisposeCode);
|
||||
_DisposeOn = GetFieldDateTime(dbDataReader, "DisposeOn", _DisposeOn);
|
||||
_DueBackOn = GetFieldDateTime(dbDataReader, "DueBackOn", _DueBackOn);
|
||||
_AmountRentalCost = GetFieldDecimal(dbDataReader, "AmountRentalCost", _AmountRentalCost);
|
||||
_UomIdRentalCost = GetFieldInt32(dbDataReader, "UomIdRentalCost", _UomIdRentalCost);
|
||||
_TaxCodeIdRentalCost = GetFieldInt32(dbDataReader, "TaxCodeIdRentalCost", _TaxCodeIdRentalCost);
|
||||
_AmountRentalPrice = GetFieldDecimal(dbDataReader, "AmountRentalPrice", _AmountRentalPrice);
|
||||
_UomIdRentalPrice = GetFieldInt32(dbDataReader, "UomIdRentalPrice", _UomIdRentalPrice);
|
||||
_TaxCodeIdRentalPrice = GetFieldInt32(dbDataReader, "TaxCodeIdRentalPrice", _TaxCodeIdRentalPrice);
|
||||
_ProcessIdNext = GetFieldInt32(dbDataReader, "ProcessIdNext", _ProcessIdNext);
|
||||
_DisposeOn = GetFieldDateTimeNullable(dbDataReader, "DisposeOn", _DisposeOn);
|
||||
_DueBackOn = GetFieldDateTimeNullable(dbDataReader, "DueBackOn", _DueBackOn);
|
||||
_AmountRentalCost = GetFieldDecimalNullable(dbDataReader, "AmountRentalCost", _AmountRentalCost);
|
||||
_UomIdRentalCost = GetFieldInt32Nullable(dbDataReader, "UomIdRentalCost", _UomIdRentalCost);
|
||||
_TaxCodeIdRentalCost = GetFieldInt32Nullable(dbDataReader, "TaxCodeIdRentalCost", _TaxCodeIdRentalCost);
|
||||
_AmountRentalPrice = GetFieldDecimalNullable(dbDataReader, "AmountRentalPrice", _AmountRentalPrice);
|
||||
_UomIdRentalPrice = GetFieldInt32Nullable(dbDataReader, "UomIdRentalPrice", _UomIdRentalPrice);
|
||||
_TaxCodeIdRentalPrice = GetFieldInt32Nullable(dbDataReader, "TaxCodeIdRentalPrice", _TaxCodeIdRentalPrice);
|
||||
_ProcessIdNext = GetFieldInt32Nullable(dbDataReader, "ProcessIdNext", _ProcessIdNext);
|
||||
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
|
||||
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
|
||||
_Flags = GetFieldInt16Nullable(dbDataReader, "Flags", _Flags);
|
||||
_Status = GetFieldString(dbDataReader, "Status", _Status);
|
||||
_CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateOn = GetFieldDateTimeNullable(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32Nullable(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost);
|
||||
_UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateOn = GetFieldDateTimeNullable(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32Nullable(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost);
|
||||
}
|
||||
|
||||
@@ -332,10 +381,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update command.
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand)
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand, List<String> columnsToUpdate = null)
|
||||
{
|
||||
// Columns to update.
|
||||
List<String> columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList();
|
||||
List<String> columnNames = (columnsToUpdate?.Any() ?? false ? columnsToUpdate : UpdatableColumns).Where(col => UpdatableColumns.ContainsCI(col)).ToList();
|
||||
if (!columnNames.Any())
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} No columns to update. [{GetType().Name}]");
|
||||
return false;
|
||||
}
|
||||
// Construct query.
|
||||
String query = "UPDATE " + TableNameFmt + " SET ";
|
||||
if (dbCommand is SqlCommand)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
@@ -9,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 6-Jun-2024 17:06:27
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:21
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
@@ -20,20 +21,20 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public class ColumnsData
|
||||
{
|
||||
public ColumnDataInt32 _Id { get; } = new ColumnDataInt32("Id");
|
||||
public ColumnDataInt16 _Category { get; } = new ColumnDataInt16("Category");
|
||||
public ColumnDataInt16 _Type { get; } = new ColumnDataInt16("Type");
|
||||
public ColumnDataInt16Nullable _Category { get; } = new ColumnDataInt16Nullable("Category");
|
||||
public ColumnDataInt16Nullable _Type { get; } = new ColumnDataInt16Nullable("Type");
|
||||
public ColumnDataDateTime _Start { get; } = new ColumnDataDateTime("Start");
|
||||
public ColumnDataDateTime _Finish { get; } = new ColumnDataDateTime("Finish");
|
||||
public ColumnDataInt32 _Duration { get; } = new ColumnDataInt32("Duration");
|
||||
public ColumnDataDateTimeNullable _Finish { get; } = new ColumnDataDateTimeNullable("Finish");
|
||||
public ColumnDataInt32Nullable _Duration { get; } = new ColumnDataInt32Nullable("Duration");
|
||||
public ColumnDataString _Description { get; } = new ColumnDataString("Description");
|
||||
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
|
||||
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
|
||||
public ColumnDataInt16Nullable _Flags { get; } = new ColumnDataInt16Nullable("Flags");
|
||||
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
|
||||
public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn");
|
||||
public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy");
|
||||
public ColumnDataDateTimeNullable _CreateOn { get; } = new ColumnDataDateTimeNullable("CreateOn");
|
||||
public ColumnDataInt32Nullable _CreateBy { get; } = new ColumnDataInt32Nullable("CreateBy");
|
||||
public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost");
|
||||
public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn");
|
||||
public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy");
|
||||
public ColumnDataDateTimeNullable _UpdateOn { get; } = new ColumnDataDateTimeNullable("UpdateOn");
|
||||
public ColumnDataInt32Nullable _UpdateBy { get; } = new ColumnDataInt32Nullable("UpdateBy");
|
||||
public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost");
|
||||
}
|
||||
|
||||
@@ -65,6 +66,22 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
"Id",
|
||||
};
|
||||
protected static List<String> fieldsNullable { get; } = new List<String>()
|
||||
{
|
||||
"Category",
|
||||
"Type",
|
||||
"Finish",
|
||||
"Duration",
|
||||
"Notes",
|
||||
"Flags",
|
||||
"Status",
|
||||
"CreateOn",
|
||||
"CreateBy",
|
||||
"CreateHost",
|
||||
"UpdateOn",
|
||||
"UpdateBy",
|
||||
"UpdateHost",
|
||||
};
|
||||
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
|
||||
{
|
||||
"CreateOn",
|
||||
@@ -89,24 +106,25 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
// Columns.
|
||||
public ColumnsData Cols { get; } = new ColumnsData();
|
||||
public Int32 _Id { get { return Cols._Id.Value; } set { Cols._Id.Value = value; } }
|
||||
public Int16 _Category { get { return Cols._Category.Value; } set { Cols._Category.Value = value; } }
|
||||
public Int16 _Type { get { return Cols._Type.Value; } set { Cols._Type.Value = value; } }
|
||||
public Int16? _Category { get { return Cols._Category.Value; } set { Cols._Category.Value = value; } }
|
||||
public Int16? _Type { get { return Cols._Type.Value; } set { Cols._Type.Value = value; } }
|
||||
public DateTime _Start { get { return Cols._Start.Value; } set { Cols._Start.Value = value; } }
|
||||
public DateTime _Finish { get { return Cols._Finish.Value; } set { Cols._Finish.Value = value; } }
|
||||
public Int32 _Duration { get { return Cols._Duration.Value; } set { Cols._Duration.Value = value; } }
|
||||
public DateTime? _Finish { get { return Cols._Finish.Value; } set { Cols._Finish.Value = value; } }
|
||||
public Int32? _Duration { get { return Cols._Duration.Value; } set { Cols._Duration.Value = value; } }
|
||||
public String _Description { get { return Cols._Description.Value; } set { Cols._Description.Value = value; } }
|
||||
public String _Notes { get { return Cols._Notes.Value; } set { Cols._Notes.Value = value; } }
|
||||
public Int16 _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public Int16? _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public String _Status { get { return Cols._Status.Value; } set { Cols._Status.Value = value; } }
|
||||
public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public DateTime? _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32? _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } }
|
||||
public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public DateTime? _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32? _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } }
|
||||
// Existing columns - confirmed on database if table exists.
|
||||
public List<String> ExistingColumnNames { get { return GetExistingColumnNames(Fields); } }
|
||||
public List<String> ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } }
|
||||
public List<String> UpdatableColumns { get { return ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Population.
|
||||
@@ -126,20 +144,20 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public override void PopulateFrom (DbDataReader dbDataReader)
|
||||
{
|
||||
_Id = GetFieldInt32(dbDataReader, "Id", _Id);
|
||||
_Category = GetFieldInt16(dbDataReader, "Category", _Category);
|
||||
_Type = GetFieldInt16(dbDataReader, "Type", _Type);
|
||||
_Category = GetFieldInt16Nullable(dbDataReader, "Category", _Category);
|
||||
_Type = GetFieldInt16Nullable(dbDataReader, "Type", _Type);
|
||||
_Start = GetFieldDateTime(dbDataReader, "Start", _Start);
|
||||
_Finish = GetFieldDateTime(dbDataReader, "Finish", _Finish);
|
||||
_Duration = GetFieldInt32(dbDataReader, "Duration", _Duration);
|
||||
_Finish = GetFieldDateTimeNullable(dbDataReader, "Finish", _Finish);
|
||||
_Duration = GetFieldInt32Nullable(dbDataReader, "Duration", _Duration);
|
||||
_Description = GetFieldString(dbDataReader, "Description", _Description);
|
||||
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
|
||||
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
|
||||
_Flags = GetFieldInt16Nullable(dbDataReader, "Flags", _Flags);
|
||||
_Status = GetFieldString(dbDataReader, "Status", _Status);
|
||||
_CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateOn = GetFieldDateTimeNullable(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32Nullable(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost);
|
||||
_UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateOn = GetFieldDateTimeNullable(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32Nullable(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost);
|
||||
}
|
||||
|
||||
@@ -187,10 +205,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update command.
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand)
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand, List<String> columnsToUpdate = null)
|
||||
{
|
||||
// Columns to update.
|
||||
List<String> columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList();
|
||||
List<String> columnNames = (columnsToUpdate?.Any() ?? false ? columnsToUpdate : UpdatableColumns).Where(col => UpdatableColumns.ContainsCI(col)).ToList();
|
||||
if (!columnNames.Any())
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} No columns to update. [{GetType().Name}]");
|
||||
return false;
|
||||
}
|
||||
// Construct query.
|
||||
String query = "UPDATE " + TableNameFmt + " SET ";
|
||||
if (dbCommand is SqlCommand)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
@@ -9,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 6-Jun-2024 17:06:27
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:21
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
@@ -23,13 +24,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public ColumnDataInt16 _ItemType { get; } = new ColumnDataInt16("ItemType");
|
||||
public ColumnDataInt32 _ItemId { get; } = new ColumnDataInt32("ItemId");
|
||||
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
|
||||
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
|
||||
public ColumnDataInt16Nullable _Flags { get; } = new ColumnDataInt16Nullable("Flags");
|
||||
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
|
||||
public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn");
|
||||
public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy");
|
||||
public ColumnDataDateTimeNullable _CreateOn { get; } = new ColumnDataDateTimeNullable("CreateOn");
|
||||
public ColumnDataInt32Nullable _CreateBy { get; } = new ColumnDataInt32Nullable("CreateBy");
|
||||
public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost");
|
||||
public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn");
|
||||
public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy");
|
||||
public ColumnDataDateTimeNullable _UpdateOn { get; } = new ColumnDataDateTimeNullable("UpdateOn");
|
||||
public ColumnDataInt32Nullable _UpdateBy { get; } = new ColumnDataInt32Nullable("UpdateBy");
|
||||
public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost");
|
||||
}
|
||||
|
||||
@@ -59,6 +60,18 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
"ItemType",
|
||||
"ItemId",
|
||||
};
|
||||
protected static List<String> fieldsNullable { get; } = new List<String>()
|
||||
{
|
||||
"Notes",
|
||||
"Flags",
|
||||
"Status",
|
||||
"CreateOn",
|
||||
"CreateBy",
|
||||
"CreateHost",
|
||||
"UpdateOn",
|
||||
"UpdateBy",
|
||||
"UpdateHost",
|
||||
};
|
||||
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
|
||||
{
|
||||
"CreateOn",
|
||||
@@ -86,17 +99,18 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public Int16 _ItemType { get { return Cols._ItemType.Value; } set { Cols._ItemType.Value = value; } }
|
||||
public Int32 _ItemId { get { return Cols._ItemId.Value; } set { Cols._ItemId.Value = value; } }
|
||||
public String _Notes { get { return Cols._Notes.Value; } set { Cols._Notes.Value = value; } }
|
||||
public Int16 _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public Int16? _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public String _Status { get { return Cols._Status.Value; } set { Cols._Status.Value = value; } }
|
||||
public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public DateTime? _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32? _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } }
|
||||
public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public DateTime? _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32? _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } }
|
||||
// Existing columns - confirmed on database if table exists.
|
||||
public List<String> ExistingColumnNames { get { return GetExistingColumnNames(Fields); } }
|
||||
public List<String> ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } }
|
||||
public List<String> UpdatableColumns { get { return ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Population.
|
||||
@@ -119,13 +133,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
_ItemType = GetFieldInt16(dbDataReader, "ItemType", _ItemType);
|
||||
_ItemId = GetFieldInt32(dbDataReader, "ItemId", _ItemId);
|
||||
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
|
||||
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
|
||||
_Flags = GetFieldInt16Nullable(dbDataReader, "Flags", _Flags);
|
||||
_Status = GetFieldString(dbDataReader, "Status", _Status);
|
||||
_CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateOn = GetFieldDateTimeNullable(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32Nullable(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost);
|
||||
_UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateOn = GetFieldDateTimeNullable(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32Nullable(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost);
|
||||
}
|
||||
|
||||
@@ -169,10 +183,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update command.
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand)
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand, List<String> columnsToUpdate = null)
|
||||
{
|
||||
// Columns to update.
|
||||
List<String> columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList();
|
||||
List<String> columnNames = (columnsToUpdate?.Any() ?? false ? columnsToUpdate : UpdatableColumns).Where(col => UpdatableColumns.ContainsCI(col)).ToList();
|
||||
if (!columnNames.Any())
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} No columns to update. [{GetType().Name}]");
|
||||
return false;
|
||||
}
|
||||
// Construct query.
|
||||
String query = "UPDATE " + TableNameFmt + " SET ";
|
||||
if (dbCommand is SqlCommand)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
@@ -9,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 6-Jun-2024 17:06:27
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:21
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
@@ -21,18 +22,18 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
public ColumnDataInt32 _Id { get; } = new ColumnDataInt32("Id");
|
||||
public ColumnDataInt32 _AffIdOwner { get; } = new ColumnDataInt32("AffIdOwner");
|
||||
public ColumnDataInt16 _Type { get; } = new ColumnDataInt16("Type");
|
||||
public ColumnDataInt16Nullable _Type { get; } = new ColumnDataInt16Nullable("Type");
|
||||
public ColumnDataString _Ref { get; } = new ColumnDataString("Ref");
|
||||
public ColumnDataString _Name { get; } = new ColumnDataString("Name");
|
||||
public ColumnDataInt32 _CurrencyId { get; } = new ColumnDataInt32("CurrencyId");
|
||||
public ColumnDataInt32Nullable _CurrencyId { get; } = new ColumnDataInt32Nullable("CurrencyId");
|
||||
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
|
||||
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
|
||||
public ColumnDataInt16Nullable _Flags { get; } = new ColumnDataInt16Nullable("Flags");
|
||||
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
|
||||
public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn");
|
||||
public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy");
|
||||
public ColumnDataDateTimeNullable _CreateOn { get; } = new ColumnDataDateTimeNullable("CreateOn");
|
||||
public ColumnDataInt32Nullable _CreateBy { get; } = new ColumnDataInt32Nullable("CreateBy");
|
||||
public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost");
|
||||
public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn");
|
||||
public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy");
|
||||
public ColumnDataDateTimeNullable _UpdateOn { get; } = new ColumnDataDateTimeNullable("UpdateOn");
|
||||
public ColumnDataInt32Nullable _UpdateBy { get; } = new ColumnDataInt32Nullable("UpdateBy");
|
||||
public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost");
|
||||
}
|
||||
|
||||
@@ -63,6 +64,21 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
"Id",
|
||||
};
|
||||
protected static List<String> fieldsNullable { get; } = new List<String>()
|
||||
{
|
||||
"Type",
|
||||
"Ref",
|
||||
"CurrencyId",
|
||||
"Notes",
|
||||
"Flags",
|
||||
"Status",
|
||||
"CreateOn",
|
||||
"CreateBy",
|
||||
"CreateHost",
|
||||
"UpdateOn",
|
||||
"UpdateBy",
|
||||
"UpdateHost",
|
||||
};
|
||||
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
|
||||
{
|
||||
"CreateOn",
|
||||
@@ -88,22 +104,23 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public ColumnsData Cols { get; } = new ColumnsData();
|
||||
public Int32 _Id { get { return Cols._Id.Value; } set { Cols._Id.Value = value; } }
|
||||
public Int32 _AffIdOwner { get { return Cols._AffIdOwner.Value; } set { Cols._AffIdOwner.Value = value; } }
|
||||
public Int16 _Type { get { return Cols._Type.Value; } set { Cols._Type.Value = value; } }
|
||||
public Int16? _Type { get { return Cols._Type.Value; } set { Cols._Type.Value = value; } }
|
||||
public String _Ref { get { return Cols._Ref.Value; } set { Cols._Ref.Value = value; } }
|
||||
public String _Name { get { return Cols._Name.Value; } set { Cols._Name.Value = value; } }
|
||||
public Int32 _CurrencyId { get { return Cols._CurrencyId.Value; } set { Cols._CurrencyId.Value = value; } }
|
||||
public Int32? _CurrencyId { get { return Cols._CurrencyId.Value; } set { Cols._CurrencyId.Value = value; } }
|
||||
public String _Notes { get { return Cols._Notes.Value; } set { Cols._Notes.Value = value; } }
|
||||
public Int16 _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public Int16? _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public String _Status { get { return Cols._Status.Value; } set { Cols._Status.Value = value; } }
|
||||
public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public DateTime? _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32? _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } }
|
||||
public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public DateTime? _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32? _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } }
|
||||
// Existing columns - confirmed on database if table exists.
|
||||
public List<String> ExistingColumnNames { get { return GetExistingColumnNames(Fields); } }
|
||||
public List<String> ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } }
|
||||
public List<String> UpdatableColumns { get { return ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Population.
|
||||
@@ -124,18 +141,18 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
_Id = GetFieldInt32(dbDataReader, "Id", _Id);
|
||||
_AffIdOwner = GetFieldInt32(dbDataReader, "AffIdOwner", _AffIdOwner);
|
||||
_Type = GetFieldInt16(dbDataReader, "Type", _Type);
|
||||
_Type = GetFieldInt16Nullable(dbDataReader, "Type", _Type);
|
||||
_Ref = GetFieldString(dbDataReader, "Ref", _Ref);
|
||||
_Name = GetFieldString(dbDataReader, "Name", _Name);
|
||||
_CurrencyId = GetFieldInt32(dbDataReader, "CurrencyId", _CurrencyId);
|
||||
_CurrencyId = GetFieldInt32Nullable(dbDataReader, "CurrencyId", _CurrencyId);
|
||||
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
|
||||
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
|
||||
_Flags = GetFieldInt16Nullable(dbDataReader, "Flags", _Flags);
|
||||
_Status = GetFieldString(dbDataReader, "Status", _Status);
|
||||
_CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateOn = GetFieldDateTimeNullable(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32Nullable(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost);
|
||||
_UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateOn = GetFieldDateTimeNullable(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32Nullable(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost);
|
||||
}
|
||||
|
||||
@@ -182,10 +199,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update command.
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand)
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand, List<String> columnsToUpdate = null)
|
||||
{
|
||||
// Columns to update.
|
||||
List<String> columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList();
|
||||
List<String> columnNames = (columnsToUpdate?.Any() ?? false ? columnsToUpdate : UpdatableColumns).Where(col => UpdatableColumns.ContainsCI(col)).ToList();
|
||||
if (!columnNames.Any())
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} No columns to update. [{GetType().Name}]");
|
||||
return false;
|
||||
}
|
||||
// Construct query.
|
||||
String query = "UPDATE " + TableNameFmt + " SET ";
|
||||
if (dbCommand is SqlCommand)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
@@ -9,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 6-Jun-2024 17:06:27
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:21
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
@@ -21,21 +22,21 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
public ColumnDataInt32 _PriceSetId { get; } = new ColumnDataInt32("PriceSetId");
|
||||
public ColumnDataInt32 _CommodityId { get; } = new ColumnDataInt32("CommodityId");
|
||||
public ColumnDataInt16 _Type { get; } = new ColumnDataInt16("Type");
|
||||
public ColumnDataInt16 _CalcMethod { get; } = new ColumnDataInt16("CalcMethod");
|
||||
public ColumnDataDecimal _CalcValue { get; } = new ColumnDataDecimal("CalcValue");
|
||||
public ColumnDataInt16 _RounderMethod { get; } = new ColumnDataInt16("RounderMethod");
|
||||
public ColumnDataInt16 _RounderDirection { get; } = new ColumnDataInt16("RounderDirection");
|
||||
public ColumnDataDecimal _RounderMultipleOf { get; } = new ColumnDataDecimal("RounderMultipleOf");
|
||||
public ColumnDataDecimal _RounderAdjustment { get; } = new ColumnDataDecimal("RounderAdjustment");
|
||||
public ColumnDataInt16Nullable _Type { get; } = new ColumnDataInt16Nullable("Type");
|
||||
public ColumnDataInt16Nullable _CalcMethod { get; } = new ColumnDataInt16Nullable("CalcMethod");
|
||||
public ColumnDataDecimalNullable _CalcValue { get; } = new ColumnDataDecimalNullable("CalcValue");
|
||||
public ColumnDataInt16Nullable _RounderMethod { get; } = new ColumnDataInt16Nullable("RounderMethod");
|
||||
public ColumnDataInt16Nullable _RounderDirection { get; } = new ColumnDataInt16Nullable("RounderDirection");
|
||||
public ColumnDataDecimalNullable _RounderMultipleOf { get; } = new ColumnDataDecimalNullable("RounderMultipleOf");
|
||||
public ColumnDataDecimalNullable _RounderAdjustment { get; } = new ColumnDataDecimalNullable("RounderAdjustment");
|
||||
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
|
||||
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
|
||||
public ColumnDataInt16Nullable _Flags { get; } = new ColumnDataInt16Nullable("Flags");
|
||||
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
|
||||
public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn");
|
||||
public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy");
|
||||
public ColumnDataDateTimeNullable _CreateOn { get; } = new ColumnDataDateTimeNullable("CreateOn");
|
||||
public ColumnDataInt32Nullable _CreateBy { get; } = new ColumnDataInt32Nullable("CreateBy");
|
||||
public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost");
|
||||
public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn");
|
||||
public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy");
|
||||
public ColumnDataDateTimeNullable _UpdateOn { get; } = new ColumnDataDateTimeNullable("UpdateOn");
|
||||
public ColumnDataInt32Nullable _UpdateBy { get; } = new ColumnDataInt32Nullable("UpdateBy");
|
||||
public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost");
|
||||
}
|
||||
|
||||
@@ -70,6 +71,25 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
"PriceSetId",
|
||||
"CommodityId",
|
||||
};
|
||||
protected static List<String> fieldsNullable { get; } = new List<String>()
|
||||
{
|
||||
"Type",
|
||||
"CalcMethod",
|
||||
"CalcValue",
|
||||
"RounderMethod",
|
||||
"RounderDirection",
|
||||
"RounderMultipleOf",
|
||||
"RounderAdjustment",
|
||||
"Notes",
|
||||
"Flags",
|
||||
"Status",
|
||||
"CreateOn",
|
||||
"CreateBy",
|
||||
"CreateHost",
|
||||
"UpdateOn",
|
||||
"UpdateBy",
|
||||
"UpdateHost",
|
||||
};
|
||||
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
|
||||
{
|
||||
"CreateOn",
|
||||
@@ -95,25 +115,26 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public ColumnsData Cols { get; } = new ColumnsData();
|
||||
public Int32 _PriceSetId { get { return Cols._PriceSetId.Value; } set { Cols._PriceSetId.Value = value; } }
|
||||
public Int32 _CommodityId { get { return Cols._CommodityId.Value; } set { Cols._CommodityId.Value = value; } }
|
||||
public Int16 _Type { get { return Cols._Type.Value; } set { Cols._Type.Value = value; } }
|
||||
public Int16 _CalcMethod { get { return Cols._CalcMethod.Value; } set { Cols._CalcMethod.Value = value; } }
|
||||
public Decimal _CalcValue { get { return Cols._CalcValue.Value; } set { Cols._CalcValue.Value = value; } }
|
||||
public Int16 _RounderMethod { get { return Cols._RounderMethod.Value; } set { Cols._RounderMethod.Value = value; } }
|
||||
public Int16 _RounderDirection { get { return Cols._RounderDirection.Value; } set { Cols._RounderDirection.Value = value; } }
|
||||
public Decimal _RounderMultipleOf { get { return Cols._RounderMultipleOf.Value; } set { Cols._RounderMultipleOf.Value = value; } }
|
||||
public Decimal _RounderAdjustment { get { return Cols._RounderAdjustment.Value; } set { Cols._RounderAdjustment.Value = value; } }
|
||||
public Int16? _Type { get { return Cols._Type.Value; } set { Cols._Type.Value = value; } }
|
||||
public Int16? _CalcMethod { get { return Cols._CalcMethod.Value; } set { Cols._CalcMethod.Value = value; } }
|
||||
public Decimal? _CalcValue { get { return Cols._CalcValue.Value; } set { Cols._CalcValue.Value = value; } }
|
||||
public Int16? _RounderMethod { get { return Cols._RounderMethod.Value; } set { Cols._RounderMethod.Value = value; } }
|
||||
public Int16? _RounderDirection { get { return Cols._RounderDirection.Value; } set { Cols._RounderDirection.Value = value; } }
|
||||
public Decimal? _RounderMultipleOf { get { return Cols._RounderMultipleOf.Value; } set { Cols._RounderMultipleOf.Value = value; } }
|
||||
public Decimal? _RounderAdjustment { get { return Cols._RounderAdjustment.Value; } set { Cols._RounderAdjustment.Value = value; } }
|
||||
public String _Notes { get { return Cols._Notes.Value; } set { Cols._Notes.Value = value; } }
|
||||
public Int16 _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public Int16? _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public String _Status { get { return Cols._Status.Value; } set { Cols._Status.Value = value; } }
|
||||
public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public DateTime? _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32? _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } }
|
||||
public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public DateTime? _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32? _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } }
|
||||
// Existing columns - confirmed on database if table exists.
|
||||
public List<String> ExistingColumnNames { get { return GetExistingColumnNames(Fields); } }
|
||||
public List<String> ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } }
|
||||
public List<String> UpdatableColumns { get { return ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Population.
|
||||
@@ -134,21 +155,21 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
_PriceSetId = GetFieldInt32(dbDataReader, "PriceSetId", _PriceSetId);
|
||||
_CommodityId = GetFieldInt32(dbDataReader, "CommodityId", _CommodityId);
|
||||
_Type = GetFieldInt16(dbDataReader, "Type", _Type);
|
||||
_CalcMethod = GetFieldInt16(dbDataReader, "CalcMethod", _CalcMethod);
|
||||
_CalcValue = GetFieldDecimal(dbDataReader, "CalcValue", _CalcValue);
|
||||
_RounderMethod = GetFieldInt16(dbDataReader, "RounderMethod", _RounderMethod);
|
||||
_RounderDirection = GetFieldInt16(dbDataReader, "RounderDirection", _RounderDirection);
|
||||
_RounderMultipleOf = GetFieldDecimal(dbDataReader, "RounderMultipleOf", _RounderMultipleOf);
|
||||
_RounderAdjustment = GetFieldDecimal(dbDataReader, "RounderAdjustment", _RounderAdjustment);
|
||||
_Type = GetFieldInt16Nullable(dbDataReader, "Type", _Type);
|
||||
_CalcMethod = GetFieldInt16Nullable(dbDataReader, "CalcMethod", _CalcMethod);
|
||||
_CalcValue = GetFieldDecimalNullable(dbDataReader, "CalcValue", _CalcValue);
|
||||
_RounderMethod = GetFieldInt16Nullable(dbDataReader, "RounderMethod", _RounderMethod);
|
||||
_RounderDirection = GetFieldInt16Nullable(dbDataReader, "RounderDirection", _RounderDirection);
|
||||
_RounderMultipleOf = GetFieldDecimalNullable(dbDataReader, "RounderMultipleOf", _RounderMultipleOf);
|
||||
_RounderAdjustment = GetFieldDecimalNullable(dbDataReader, "RounderAdjustment", _RounderAdjustment);
|
||||
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
|
||||
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
|
||||
_Flags = GetFieldInt16Nullable(dbDataReader, "Flags", _Flags);
|
||||
_Status = GetFieldString(dbDataReader, "Status", _Status);
|
||||
_CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateOn = GetFieldDateTimeNullable(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32Nullable(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost);
|
||||
_UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateOn = GetFieldDateTimeNullable(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32Nullable(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost);
|
||||
}
|
||||
|
||||
@@ -198,10 +219,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update command.
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand)
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand, List<String> columnsToUpdate = null)
|
||||
{
|
||||
// Columns to update.
|
||||
List<String> columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList();
|
||||
List<String> columnNames = (columnsToUpdate?.Any() ?? false ? columnsToUpdate : UpdatableColumns).Where(col => UpdatableColumns.ContainsCI(col)).ToList();
|
||||
if (!columnNames.Any())
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} No columns to update. [{GetType().Name}]");
|
||||
return false;
|
||||
}
|
||||
// Construct query.
|
||||
String query = "UPDATE " + TableNameFmt + " SET ";
|
||||
if (dbCommand is SqlCommand)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
@@ -9,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 6-Jun-2024 17:06:27
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:21
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
@@ -24,28 +25,28 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public ColumnDataString _Model { get; } = new ColumnDataString("Model");
|
||||
public ColumnDataString _Derivative { get; } = new ColumnDataString("Derivative");
|
||||
public ColumnDataString _DescBrief { get; } = new ColumnDataString("DescBrief");
|
||||
public ColumnDataInt16 _VehicleType { get; } = new ColumnDataInt16("VehicleType");
|
||||
public ColumnDataInt16Nullable _VehicleType { get; } = new ColumnDataInt16Nullable("VehicleType");
|
||||
public ColumnDataString _VehicleCategoryCode { get; } = new ColumnDataString("VehicleCategoryCode");
|
||||
public ColumnDataInt16 _FuelType { get; } = new ColumnDataInt16("FuelType");
|
||||
public ColumnDataInt16 _OdometerUnits { get; } = new ColumnDataInt16("OdometerUnits");
|
||||
public ColumnDataInt16 _Seats { get; } = new ColumnDataInt16("Seats");
|
||||
public ColumnDataDecimal _Weight { get; } = new ColumnDataDecimal("Weight");
|
||||
public ColumnDataInt16Nullable _FuelType { get; } = new ColumnDataInt16Nullable("FuelType");
|
||||
public ColumnDataInt16Nullable _OdometerUnits { get; } = new ColumnDataInt16Nullable("OdometerUnits");
|
||||
public ColumnDataInt16Nullable _Seats { get; } = new ColumnDataInt16Nullable("Seats");
|
||||
public ColumnDataDecimalNullable _Weight { get; } = new ColumnDataDecimalNullable("Weight");
|
||||
public ColumnDataString _InsuranceCode { get; } = new ColumnDataString("InsuranceCode");
|
||||
public ColumnDataInt32 _FirstServiceOdo { get; } = new ColumnDataInt32("FirstServiceOdo");
|
||||
public ColumnDataInt32 _ServiceOdo { get; } = new ColumnDataInt32("ServiceOdo");
|
||||
public ColumnDataInt16 _ServiceWeeks { get; } = new ColumnDataInt16("ServiceWeeks");
|
||||
public ColumnDataDecimal _AmountRentalCost { get; } = new ColumnDataDecimal("AmountRentalCost");
|
||||
public ColumnDataInt32 _UomIdRentalCost { get; } = new ColumnDataInt32("UomIdRentalCost");
|
||||
public ColumnDataDecimal _AmountRentalPrice { get; } = new ColumnDataDecimal("AmountRentalPrice");
|
||||
public ColumnDataInt32 _UomIdRentalPrice { get; } = new ColumnDataInt32("UomIdRentalPrice");
|
||||
public ColumnDataInt32Nullable _FirstServiceOdo { get; } = new ColumnDataInt32Nullable("FirstServiceOdo");
|
||||
public ColumnDataInt32Nullable _ServiceOdo { get; } = new ColumnDataInt32Nullable("ServiceOdo");
|
||||
public ColumnDataInt16Nullable _ServiceWeeks { get; } = new ColumnDataInt16Nullable("ServiceWeeks");
|
||||
public ColumnDataDecimalNullable _AmountRentalCost { get; } = new ColumnDataDecimalNullable("AmountRentalCost");
|
||||
public ColumnDataInt32Nullable _UomIdRentalCost { get; } = new ColumnDataInt32Nullable("UomIdRentalCost");
|
||||
public ColumnDataDecimalNullable _AmountRentalPrice { get; } = new ColumnDataDecimalNullable("AmountRentalPrice");
|
||||
public ColumnDataInt32Nullable _UomIdRentalPrice { get; } = new ColumnDataInt32Nullable("UomIdRentalPrice");
|
||||
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
|
||||
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
|
||||
public ColumnDataInt16Nullable _Flags { get; } = new ColumnDataInt16Nullable("Flags");
|
||||
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
|
||||
public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn");
|
||||
public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy");
|
||||
public ColumnDataDateTimeNullable _CreateOn { get; } = new ColumnDataDateTimeNullable("CreateOn");
|
||||
public ColumnDataInt32Nullable _CreateBy { get; } = new ColumnDataInt32Nullable("CreateBy");
|
||||
public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost");
|
||||
public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn");
|
||||
public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy");
|
||||
public ColumnDataDateTimeNullable _UpdateOn { get; } = new ColumnDataDateTimeNullable("UpdateOn");
|
||||
public ColumnDataInt32Nullable _UpdateBy { get; } = new ColumnDataInt32Nullable("UpdateBy");
|
||||
public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost");
|
||||
}
|
||||
|
||||
@@ -89,6 +90,36 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
"Id",
|
||||
};
|
||||
protected static List<String> fieldsNullable { get; } = new List<String>()
|
||||
{
|
||||
"MakeCode",
|
||||
"Model",
|
||||
"Derivative",
|
||||
"DescBrief",
|
||||
"VehicleType",
|
||||
"VehicleCategoryCode",
|
||||
"FuelType",
|
||||
"OdometerUnits",
|
||||
"Seats",
|
||||
"Weight",
|
||||
"InsuranceCode",
|
||||
"FirstServiceOdo",
|
||||
"ServiceOdo",
|
||||
"ServiceWeeks",
|
||||
"AmountRentalCost",
|
||||
"UomIdRentalCost",
|
||||
"AmountRentalPrice",
|
||||
"UomIdRentalPrice",
|
||||
"Notes",
|
||||
"Flags",
|
||||
"Status",
|
||||
"CreateOn",
|
||||
"CreateBy",
|
||||
"CreateHost",
|
||||
"UpdateOn",
|
||||
"UpdateBy",
|
||||
"UpdateHost",
|
||||
};
|
||||
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
|
||||
{
|
||||
"CreateOn",
|
||||
@@ -117,32 +148,33 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public String _Model { get { return Cols._Model.Value; } set { Cols._Model.Value = value; } }
|
||||
public String _Derivative { get { return Cols._Derivative.Value; } set { Cols._Derivative.Value = value; } }
|
||||
public String _DescBrief { get { return Cols._DescBrief.Value; } set { Cols._DescBrief.Value = value; } }
|
||||
public Int16 _VehicleType { get { return Cols._VehicleType.Value; } set { Cols._VehicleType.Value = value; } }
|
||||
public Int16? _VehicleType { get { return Cols._VehicleType.Value; } set { Cols._VehicleType.Value = value; } }
|
||||
public String _VehicleCategoryCode { get { return Cols._VehicleCategoryCode.Value; } set { Cols._VehicleCategoryCode.Value = value; } }
|
||||
public Int16 _FuelType { get { return Cols._FuelType.Value; } set { Cols._FuelType.Value = value; } }
|
||||
public Int16 _OdometerUnits { get { return Cols._OdometerUnits.Value; } set { Cols._OdometerUnits.Value = value; } }
|
||||
public Int16 _Seats { get { return Cols._Seats.Value; } set { Cols._Seats.Value = value; } }
|
||||
public Decimal _Weight { get { return Cols._Weight.Value; } set { Cols._Weight.Value = value; } }
|
||||
public Int16? _FuelType { get { return Cols._FuelType.Value; } set { Cols._FuelType.Value = value; } }
|
||||
public Int16? _OdometerUnits { get { return Cols._OdometerUnits.Value; } set { Cols._OdometerUnits.Value = value; } }
|
||||
public Int16? _Seats { get { return Cols._Seats.Value; } set { Cols._Seats.Value = value; } }
|
||||
public Decimal? _Weight { get { return Cols._Weight.Value; } set { Cols._Weight.Value = value; } }
|
||||
public String _InsuranceCode { get { return Cols._InsuranceCode.Value; } set { Cols._InsuranceCode.Value = value; } }
|
||||
public Int32 _FirstServiceOdo { get { return Cols._FirstServiceOdo.Value; } set { Cols._FirstServiceOdo.Value = value; } }
|
||||
public Int32 _ServiceOdo { get { return Cols._ServiceOdo.Value; } set { Cols._ServiceOdo.Value = value; } }
|
||||
public Int16 _ServiceWeeks { get { return Cols._ServiceWeeks.Value; } set { Cols._ServiceWeeks.Value = value; } }
|
||||
public Decimal _AmountRentalCost { get { return Cols._AmountRentalCost.Value; } set { Cols._AmountRentalCost.Value = value; } }
|
||||
public Int32 _UomIdRentalCost { get { return Cols._UomIdRentalCost.Value; } set { Cols._UomIdRentalCost.Value = value; } }
|
||||
public Decimal _AmountRentalPrice { get { return Cols._AmountRentalPrice.Value; } set { Cols._AmountRentalPrice.Value = value; } }
|
||||
public Int32 _UomIdRentalPrice { get { return Cols._UomIdRentalPrice.Value; } set { Cols._UomIdRentalPrice.Value = value; } }
|
||||
public Int32? _FirstServiceOdo { get { return Cols._FirstServiceOdo.Value; } set { Cols._FirstServiceOdo.Value = value; } }
|
||||
public Int32? _ServiceOdo { get { return Cols._ServiceOdo.Value; } set { Cols._ServiceOdo.Value = value; } }
|
||||
public Int16? _ServiceWeeks { get { return Cols._ServiceWeeks.Value; } set { Cols._ServiceWeeks.Value = value; } }
|
||||
public Decimal? _AmountRentalCost { get { return Cols._AmountRentalCost.Value; } set { Cols._AmountRentalCost.Value = value; } }
|
||||
public Int32? _UomIdRentalCost { get { return Cols._UomIdRentalCost.Value; } set { Cols._UomIdRentalCost.Value = value; } }
|
||||
public Decimal? _AmountRentalPrice { get { return Cols._AmountRentalPrice.Value; } set { Cols._AmountRentalPrice.Value = value; } }
|
||||
public Int32? _UomIdRentalPrice { get { return Cols._UomIdRentalPrice.Value; } set { Cols._UomIdRentalPrice.Value = value; } }
|
||||
public String _Notes { get { return Cols._Notes.Value; } set { Cols._Notes.Value = value; } }
|
||||
public Int16 _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public Int16? _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public String _Status { get { return Cols._Status.Value; } set { Cols._Status.Value = value; } }
|
||||
public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public DateTime? _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32? _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } }
|
||||
public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public DateTime? _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32? _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } }
|
||||
// Existing columns - confirmed on database if table exists.
|
||||
public List<String> ExistingColumnNames { get { return GetExistingColumnNames(Fields); } }
|
||||
public List<String> ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } }
|
||||
public List<String> UpdatableColumns { get { return ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Population.
|
||||
@@ -166,28 +198,28 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
_Model = GetFieldString(dbDataReader, "Model", _Model);
|
||||
_Derivative = GetFieldString(dbDataReader, "Derivative", _Derivative);
|
||||
_DescBrief = GetFieldString(dbDataReader, "DescBrief", _DescBrief);
|
||||
_VehicleType = GetFieldInt16(dbDataReader, "VehicleType", _VehicleType);
|
||||
_VehicleType = GetFieldInt16Nullable(dbDataReader, "VehicleType", _VehicleType);
|
||||
_VehicleCategoryCode = GetFieldString(dbDataReader, "VehicleCategoryCode", _VehicleCategoryCode);
|
||||
_FuelType = GetFieldInt16(dbDataReader, "FuelType", _FuelType);
|
||||
_OdometerUnits = GetFieldInt16(dbDataReader, "OdometerUnits", _OdometerUnits);
|
||||
_Seats = GetFieldInt16(dbDataReader, "Seats", _Seats);
|
||||
_Weight = GetFieldDecimal(dbDataReader, "Weight", _Weight);
|
||||
_FuelType = GetFieldInt16Nullable(dbDataReader, "FuelType", _FuelType);
|
||||
_OdometerUnits = GetFieldInt16Nullable(dbDataReader, "OdometerUnits", _OdometerUnits);
|
||||
_Seats = GetFieldInt16Nullable(dbDataReader, "Seats", _Seats);
|
||||
_Weight = GetFieldDecimalNullable(dbDataReader, "Weight", _Weight);
|
||||
_InsuranceCode = GetFieldString(dbDataReader, "InsuranceCode", _InsuranceCode);
|
||||
_FirstServiceOdo = GetFieldInt32(dbDataReader, "FirstServiceOdo", _FirstServiceOdo);
|
||||
_ServiceOdo = GetFieldInt32(dbDataReader, "ServiceOdo", _ServiceOdo);
|
||||
_ServiceWeeks = GetFieldInt16(dbDataReader, "ServiceWeeks", _ServiceWeeks);
|
||||
_AmountRentalCost = GetFieldDecimal(dbDataReader, "AmountRentalCost", _AmountRentalCost);
|
||||
_UomIdRentalCost = GetFieldInt32(dbDataReader, "UomIdRentalCost", _UomIdRentalCost);
|
||||
_AmountRentalPrice = GetFieldDecimal(dbDataReader, "AmountRentalPrice", _AmountRentalPrice);
|
||||
_UomIdRentalPrice = GetFieldInt32(dbDataReader, "UomIdRentalPrice", _UomIdRentalPrice);
|
||||
_FirstServiceOdo = GetFieldInt32Nullable(dbDataReader, "FirstServiceOdo", _FirstServiceOdo);
|
||||
_ServiceOdo = GetFieldInt32Nullable(dbDataReader, "ServiceOdo", _ServiceOdo);
|
||||
_ServiceWeeks = GetFieldInt16Nullable(dbDataReader, "ServiceWeeks", _ServiceWeeks);
|
||||
_AmountRentalCost = GetFieldDecimalNullable(dbDataReader, "AmountRentalCost", _AmountRentalCost);
|
||||
_UomIdRentalCost = GetFieldInt32Nullable(dbDataReader, "UomIdRentalCost", _UomIdRentalCost);
|
||||
_AmountRentalPrice = GetFieldDecimalNullable(dbDataReader, "AmountRentalPrice", _AmountRentalPrice);
|
||||
_UomIdRentalPrice = GetFieldInt32Nullable(dbDataReader, "UomIdRentalPrice", _UomIdRentalPrice);
|
||||
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
|
||||
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
|
||||
_Flags = GetFieldInt16Nullable(dbDataReader, "Flags", _Flags);
|
||||
_Status = GetFieldString(dbDataReader, "Status", _Status);
|
||||
_CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateOn = GetFieldDateTimeNullable(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32Nullable(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost);
|
||||
_UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateOn = GetFieldDateTimeNullable(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32Nullable(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost);
|
||||
}
|
||||
|
||||
@@ -247,10 +279,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update command.
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand)
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand, List<String> columnsToUpdate = null)
|
||||
{
|
||||
// Columns to update.
|
||||
List<String> columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList();
|
||||
List<String> columnNames = (columnsToUpdate?.Any() ?? false ? columnsToUpdate : UpdatableColumns).Where(col => UpdatableColumns.ContainsCI(col)).ToList();
|
||||
if (!columnNames.Any())
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} No columns to update. [{GetType().Name}]");
|
||||
return false;
|
||||
}
|
||||
// Construct query.
|
||||
String query = "UPDATE " + TableNameFmt + " SET ";
|
||||
if (dbCommand is SqlCommand)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
@@ -9,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 6-Jun-2024 17:06:27
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:21
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
@@ -20,26 +21,26 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public class ColumnsData
|
||||
{
|
||||
public ColumnDataInt32 _Id { get; } = new ColumnDataInt32("Id");
|
||||
public ColumnDataInt32 _VehicleId { get; } = new ColumnDataInt32("VehicleId");
|
||||
public ColumnDataInt16 _EventType { get; } = new ColumnDataInt16("EventType");
|
||||
public ColumnDataDateTime _StartOn { get; } = new ColumnDataDateTime("StartOn");
|
||||
public ColumnDataDateTime _FinishOn { get; } = new ColumnDataDateTime("FinishOn");
|
||||
public ColumnDataInt32 _Odometer { get; } = new ColumnDataInt32("Odometer");
|
||||
public ColumnDataInt32Nullable _VehicleId { get; } = new ColumnDataInt32Nullable("VehicleId");
|
||||
public ColumnDataInt16Nullable _EventType { get; } = new ColumnDataInt16Nullable("EventType");
|
||||
public ColumnDataDateTimeNullable _StartOn { get; } = new ColumnDataDateTimeNullable("StartOn");
|
||||
public ColumnDataDateTimeNullable _FinishOn { get; } = new ColumnDataDateTimeNullable("FinishOn");
|
||||
public ColumnDataInt32Nullable _Odometer { get; } = new ColumnDataInt32Nullable("Odometer");
|
||||
public ColumnDataString _DescBrief { get; } = new ColumnDataString("DescBrief");
|
||||
public ColumnDataString _DescDetail { get; } = new ColumnDataString("DescDetail");
|
||||
public ColumnDataDecimal _AmountNet { get; } = new ColumnDataDecimal("AmountNet");
|
||||
public ColumnDataInt32 _TaxCodeId { get; } = new ColumnDataInt32("TaxCodeId");
|
||||
public ColumnDataDecimal _TaxRate { get; } = new ColumnDataDecimal("TaxRate");
|
||||
public ColumnDataDecimal _AmountTax { get; } = new ColumnDataDecimal("AmountTax");
|
||||
public ColumnDataDecimal _AmountTot { get; } = new ColumnDataDecimal("AmountTot");
|
||||
public ColumnDataDecimalNullable _AmountNet { get; } = new ColumnDataDecimalNullable("AmountNet");
|
||||
public ColumnDataInt32Nullable _TaxCodeId { get; } = new ColumnDataInt32Nullable("TaxCodeId");
|
||||
public ColumnDataDecimalNullable _TaxRate { get; } = new ColumnDataDecimalNullable("TaxRate");
|
||||
public ColumnDataDecimalNullable _AmountTax { get; } = new ColumnDataDecimalNullable("AmountTax");
|
||||
public ColumnDataDecimalNullable _AmountTot { get; } = new ColumnDataDecimalNullable("AmountTot");
|
||||
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
|
||||
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
|
||||
public ColumnDataInt16Nullable _Flags { get; } = new ColumnDataInt16Nullable("Flags");
|
||||
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
|
||||
public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn");
|
||||
public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy");
|
||||
public ColumnDataDateTimeNullable _CreateOn { get; } = new ColumnDataDateTimeNullable("CreateOn");
|
||||
public ColumnDataInt32Nullable _CreateBy { get; } = new ColumnDataInt32Nullable("CreateBy");
|
||||
public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost");
|
||||
public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn");
|
||||
public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy");
|
||||
public ColumnDataDateTimeNullable _UpdateOn { get; } = new ColumnDataDateTimeNullable("UpdateOn");
|
||||
public ColumnDataInt32Nullable _UpdateBy { get; } = new ColumnDataInt32Nullable("UpdateBy");
|
||||
public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost");
|
||||
}
|
||||
|
||||
@@ -77,6 +78,30 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
"Id",
|
||||
};
|
||||
protected static List<String> fieldsNullable { get; } = new List<String>()
|
||||
{
|
||||
"VehicleId",
|
||||
"EventType",
|
||||
"StartOn",
|
||||
"FinishOn",
|
||||
"Odometer",
|
||||
"DescBrief",
|
||||
"DescDetail",
|
||||
"AmountNet",
|
||||
"TaxCodeId",
|
||||
"TaxRate",
|
||||
"AmountTax",
|
||||
"AmountTot",
|
||||
"Notes",
|
||||
"Flags",
|
||||
"Status",
|
||||
"CreateOn",
|
||||
"CreateBy",
|
||||
"CreateHost",
|
||||
"UpdateOn",
|
||||
"UpdateBy",
|
||||
"UpdateHost",
|
||||
};
|
||||
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
|
||||
{
|
||||
"CreateOn",
|
||||
@@ -101,30 +126,31 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
// Columns.
|
||||
public ColumnsData Cols { get; } = new ColumnsData();
|
||||
public Int32 _Id { get { return Cols._Id.Value; } set { Cols._Id.Value = value; } }
|
||||
public Int32 _VehicleId { get { return Cols._VehicleId.Value; } set { Cols._VehicleId.Value = value; } }
|
||||
public Int16 _EventType { get { return Cols._EventType.Value; } set { Cols._EventType.Value = value; } }
|
||||
public DateTime _StartOn { get { return Cols._StartOn.Value; } set { Cols._StartOn.Value = value; } }
|
||||
public DateTime _FinishOn { get { return Cols._FinishOn.Value; } set { Cols._FinishOn.Value = value; } }
|
||||
public Int32 _Odometer { get { return Cols._Odometer.Value; } set { Cols._Odometer.Value = value; } }
|
||||
public Int32? _VehicleId { get { return Cols._VehicleId.Value; } set { Cols._VehicleId.Value = value; } }
|
||||
public Int16? _EventType { get { return Cols._EventType.Value; } set { Cols._EventType.Value = value; } }
|
||||
public DateTime? _StartOn { get { return Cols._StartOn.Value; } set { Cols._StartOn.Value = value; } }
|
||||
public DateTime? _FinishOn { get { return Cols._FinishOn.Value; } set { Cols._FinishOn.Value = value; } }
|
||||
public Int32? _Odometer { get { return Cols._Odometer.Value; } set { Cols._Odometer.Value = value; } }
|
||||
public String _DescBrief { get { return Cols._DescBrief.Value; } set { Cols._DescBrief.Value = value; } }
|
||||
public String _DescDetail { get { return Cols._DescDetail.Value; } set { Cols._DescDetail.Value = value; } }
|
||||
public Decimal _AmountNet { get { return Cols._AmountNet.Value; } set { Cols._AmountNet.Value = value; } }
|
||||
public Int32 _TaxCodeId { get { return Cols._TaxCodeId.Value; } set { Cols._TaxCodeId.Value = value; } }
|
||||
public Decimal _TaxRate { get { return Cols._TaxRate.Value; } set { Cols._TaxRate.Value = value; } }
|
||||
public Decimal _AmountTax { get { return Cols._AmountTax.Value; } set { Cols._AmountTax.Value = value; } }
|
||||
public Decimal _AmountTot { get { return Cols._AmountTot.Value; } set { Cols._AmountTot.Value = value; } }
|
||||
public Decimal? _AmountNet { get { return Cols._AmountNet.Value; } set { Cols._AmountNet.Value = value; } }
|
||||
public Int32? _TaxCodeId { get { return Cols._TaxCodeId.Value; } set { Cols._TaxCodeId.Value = value; } }
|
||||
public Decimal? _TaxRate { get { return Cols._TaxRate.Value; } set { Cols._TaxRate.Value = value; } }
|
||||
public Decimal? _AmountTax { get { return Cols._AmountTax.Value; } set { Cols._AmountTax.Value = value; } }
|
||||
public Decimal? _AmountTot { get { return Cols._AmountTot.Value; } set { Cols._AmountTot.Value = value; } }
|
||||
public String _Notes { get { return Cols._Notes.Value; } set { Cols._Notes.Value = value; } }
|
||||
public Int16 _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public Int16? _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public String _Status { get { return Cols._Status.Value; } set { Cols._Status.Value = value; } }
|
||||
public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public DateTime? _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32? _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } }
|
||||
public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public DateTime? _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32? _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } }
|
||||
// Existing columns - confirmed on database if table exists.
|
||||
public List<String> ExistingColumnNames { get { return GetExistingColumnNames(Fields); } }
|
||||
public List<String> ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } }
|
||||
public List<String> UpdatableColumns { get { return ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Population.
|
||||
@@ -144,26 +170,26 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public override void PopulateFrom (DbDataReader dbDataReader)
|
||||
{
|
||||
_Id = GetFieldInt32(dbDataReader, "Id", _Id);
|
||||
_VehicleId = GetFieldInt32(dbDataReader, "VehicleId", _VehicleId);
|
||||
_EventType = GetFieldInt16(dbDataReader, "EventType", _EventType);
|
||||
_StartOn = GetFieldDateTime(dbDataReader, "StartOn", _StartOn);
|
||||
_FinishOn = GetFieldDateTime(dbDataReader, "FinishOn", _FinishOn);
|
||||
_Odometer = GetFieldInt32(dbDataReader, "Odometer", _Odometer);
|
||||
_VehicleId = GetFieldInt32Nullable(dbDataReader, "VehicleId", _VehicleId);
|
||||
_EventType = GetFieldInt16Nullable(dbDataReader, "EventType", _EventType);
|
||||
_StartOn = GetFieldDateTimeNullable(dbDataReader, "StartOn", _StartOn);
|
||||
_FinishOn = GetFieldDateTimeNullable(dbDataReader, "FinishOn", _FinishOn);
|
||||
_Odometer = GetFieldInt32Nullable(dbDataReader, "Odometer", _Odometer);
|
||||
_DescBrief = GetFieldString(dbDataReader, "DescBrief", _DescBrief);
|
||||
_DescDetail = GetFieldString(dbDataReader, "DescDetail", _DescDetail);
|
||||
_AmountNet = GetFieldDecimal(dbDataReader, "AmountNet", _AmountNet);
|
||||
_TaxCodeId = GetFieldInt32(dbDataReader, "TaxCodeId", _TaxCodeId);
|
||||
_TaxRate = GetFieldDecimal(dbDataReader, "TaxRate", _TaxRate);
|
||||
_AmountTax = GetFieldDecimal(dbDataReader, "AmountTax", _AmountTax);
|
||||
_AmountTot = GetFieldDecimal(dbDataReader, "AmountTot", _AmountTot);
|
||||
_AmountNet = GetFieldDecimalNullable(dbDataReader, "AmountNet", _AmountNet);
|
||||
_TaxCodeId = GetFieldInt32Nullable(dbDataReader, "TaxCodeId", _TaxCodeId);
|
||||
_TaxRate = GetFieldDecimalNullable(dbDataReader, "TaxRate", _TaxRate);
|
||||
_AmountTax = GetFieldDecimalNullable(dbDataReader, "AmountTax", _AmountTax);
|
||||
_AmountTot = GetFieldDecimalNullable(dbDataReader, "AmountTot", _AmountTot);
|
||||
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
|
||||
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
|
||||
_Flags = GetFieldInt16Nullable(dbDataReader, "Flags", _Flags);
|
||||
_Status = GetFieldString(dbDataReader, "Status", _Status);
|
||||
_CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateOn = GetFieldDateTimeNullable(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32Nullable(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost);
|
||||
_UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateOn = GetFieldDateTimeNullable(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32Nullable(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost);
|
||||
}
|
||||
|
||||
@@ -217,10 +243,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update command.
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand)
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand, List<String> columnsToUpdate = null)
|
||||
{
|
||||
// Columns to update.
|
||||
List<String> columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList();
|
||||
List<String> columnNames = (columnsToUpdate?.Any() ?? false ? columnsToUpdate : UpdatableColumns).Where(col => UpdatableColumns.ContainsCI(col)).ToList();
|
||||
if (!columnNames.Any())
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} No columns to update. [{GetType().Name}]");
|
||||
return false;
|
||||
}
|
||||
// Construct query.
|
||||
String query = "UPDATE " + TableNameFmt + " SET ";
|
||||
if (dbCommand is SqlCommand)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
@@ -9,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 6-Jun-2024 17:06:27
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:21
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
@@ -27,13 +28,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public ColumnDataString _FeatureCode { get; } = new ColumnDataString("FeatureCode");
|
||||
public ColumnDataString _FeatureDesc { get; } = new ColumnDataString("FeatureDesc");
|
||||
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
|
||||
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
|
||||
public ColumnDataInt16Nullable _Flags { get; } = new ColumnDataInt16Nullable("Flags");
|
||||
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
|
||||
public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn");
|
||||
public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy");
|
||||
public ColumnDataDateTimeNullable _CreateOn { get; } = new ColumnDataDateTimeNullable("CreateOn");
|
||||
public ColumnDataInt32Nullable _CreateBy { get; } = new ColumnDataInt32Nullable("CreateBy");
|
||||
public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost");
|
||||
public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn");
|
||||
public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy");
|
||||
public ColumnDataDateTimeNullable _UpdateOn { get; } = new ColumnDataDateTimeNullable("UpdateOn");
|
||||
public ColumnDataInt32Nullable _UpdateBy { get; } = new ColumnDataInt32Nullable("UpdateBy");
|
||||
public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost");
|
||||
}
|
||||
|
||||
@@ -65,6 +66,20 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
"VehicleId",
|
||||
};
|
||||
protected static List<String> fieldsNullable { get; } = new List<String>()
|
||||
{
|
||||
"CategoryDesc",
|
||||
"FeatureDesc",
|
||||
"Notes",
|
||||
"Flags",
|
||||
"Status",
|
||||
"CreateOn",
|
||||
"CreateBy",
|
||||
"CreateHost",
|
||||
"UpdateOn",
|
||||
"UpdateBy",
|
||||
"UpdateHost",
|
||||
};
|
||||
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
|
||||
{
|
||||
"CreateOn",
|
||||
@@ -96,17 +111,18 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public String _FeatureCode { get { return Cols._FeatureCode.Value; } set { Cols._FeatureCode.Value = value; } }
|
||||
public String _FeatureDesc { get { return Cols._FeatureDesc.Value; } set { Cols._FeatureDesc.Value = value; } }
|
||||
public String _Notes { get { return Cols._Notes.Value; } set { Cols._Notes.Value = value; } }
|
||||
public Int16 _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public Int16? _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public String _Status { get { return Cols._Status.Value; } set { Cols._Status.Value = value; } }
|
||||
public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public DateTime? _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32? _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } }
|
||||
public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public DateTime? _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32? _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } }
|
||||
// Existing columns - confirmed on database if table exists.
|
||||
public List<String> ExistingColumnNames { get { return GetExistingColumnNames(Fields); } }
|
||||
public List<String> ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } }
|
||||
public List<String> UpdatableColumns { get { return ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Population.
|
||||
@@ -133,13 +149,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
_FeatureCode = GetFieldString(dbDataReader, "FeatureCode", _FeatureCode);
|
||||
_FeatureDesc = GetFieldString(dbDataReader, "FeatureDesc", _FeatureDesc);
|
||||
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
|
||||
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
|
||||
_Flags = GetFieldInt16Nullable(dbDataReader, "Flags", _Flags);
|
||||
_Status = GetFieldString(dbDataReader, "Status", _Status);
|
||||
_CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateOn = GetFieldDateTimeNullable(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32Nullable(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost);
|
||||
_UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateOn = GetFieldDateTimeNullable(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32Nullable(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost);
|
||||
}
|
||||
|
||||
@@ -187,10 +203,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update command.
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand)
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand, List<String> columnsToUpdate = null)
|
||||
{
|
||||
// Columns to update.
|
||||
List<String> columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList();
|
||||
List<String> columnNames = (columnsToUpdate?.Any() ?? false ? columnsToUpdate : UpdatableColumns).Where(col => UpdatableColumns.ContainsCI(col)).ToList();
|
||||
if (!columnNames.Any())
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} No columns to update. [{GetType().Name}]");
|
||||
return false;
|
||||
}
|
||||
// Construct query.
|
||||
String query = "UPDATE " + TableNameFmt + " SET ";
|
||||
if (dbCommand is SqlCommand)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
@@ -9,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 6-Jun-2024 17:06:27
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:21
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
@@ -20,41 +21,41 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public class ColumnsData
|
||||
{
|
||||
public ColumnDataInt32 _Id { get; } = new ColumnDataInt32("Id");
|
||||
public ColumnDataInt32 _VehicleClassId { get; } = new ColumnDataInt32("VehicleClassId");
|
||||
public ColumnDataInt32Nullable _VehicleClassId { get; } = new ColumnDataInt32Nullable("VehicleClassId");
|
||||
public ColumnDataString _RegNumber { get; } = new ColumnDataString("RegNumber");
|
||||
public ColumnDataString _VIN { get; } = new ColumnDataString("VIN");
|
||||
public ColumnDataString _CapCode { get; } = new ColumnDataString("CapCode");
|
||||
public ColumnDataString _KeyNumber { get; } = new ColumnDataString("KeyNumber");
|
||||
public ColumnDataString _KeyLocation { get; } = new ColumnDataString("KeyLocation");
|
||||
public ColumnDataString _EngineNumber { get; } = new ColumnDataString("EngineNumber");
|
||||
public ColumnDataInt16 _EngineCapacity { get; } = new ColumnDataInt16("EngineCapacity");
|
||||
public ColumnDataInt16 _Seats { get; } = new ColumnDataInt16("Seats");
|
||||
public ColumnDataInt16 _Weight { get; } = new ColumnDataInt16("Weight");
|
||||
public ColumnDataInt16 _ManufactureYear { get; } = new ColumnDataInt16("ManufactureYear");
|
||||
public ColumnDataDateTime _BuildOn { get; } = new ColumnDataDateTime("BuildOn");
|
||||
public ColumnDataDateTime _FirstRegisterOn { get; } = new ColumnDataDateTime("FirstRegisterOn");
|
||||
public ColumnDataDateTime _RegisterOn { get; } = new ColumnDataDateTime("RegisterOn");
|
||||
public ColumnDataInt16Nullable _EngineCapacity { get; } = new ColumnDataInt16Nullable("EngineCapacity");
|
||||
public ColumnDataInt16Nullable _Seats { get; } = new ColumnDataInt16Nullable("Seats");
|
||||
public ColumnDataInt16Nullable _Weight { get; } = new ColumnDataInt16Nullable("Weight");
|
||||
public ColumnDataInt16Nullable _ManufactureYear { get; } = new ColumnDataInt16Nullable("ManufactureYear");
|
||||
public ColumnDataDateTimeNullable _BuildOn { get; } = new ColumnDataDateTimeNullable("BuildOn");
|
||||
public ColumnDataDateTimeNullable _FirstRegisterOn { get; } = new ColumnDataDateTimeNullable("FirstRegisterOn");
|
||||
public ColumnDataDateTimeNullable _RegisterOn { get; } = new ColumnDataDateTimeNullable("RegisterOn");
|
||||
public ColumnDataString _RegNumberPrev { get; } = new ColumnDataString("RegNumberPrev");
|
||||
public ColumnDataInt32 _PurchaseOdo { get; } = new ColumnDataInt32("PurchaseOdo");
|
||||
public ColumnDataInt32Nullable _PurchaseOdo { get; } = new ColumnDataInt32Nullable("PurchaseOdo");
|
||||
public ColumnDataString _TachoCode { get; } = new ColumnDataString("TachoCode");
|
||||
public ColumnDataString _TachoId { get; } = new ColumnDataString("TachoId");
|
||||
public ColumnDataInt32 _LastServiceOdo { get; } = new ColumnDataInt32("LastServiceOdo");
|
||||
public ColumnDataDateTime _LastServiceOn { get; } = new ColumnDataDateTime("LastServiceOn");
|
||||
public ColumnDataInt32 _NextServiceOdo { get; } = new ColumnDataInt32("NextServiceOdo");
|
||||
public ColumnDataDateTime _NextServiceOn { get; } = new ColumnDataDateTime("NextServiceOn");
|
||||
public ColumnDataDateTime _MotOn { get; } = new ColumnDataDateTime("MotOn");
|
||||
public ColumnDataInt32Nullable _LastServiceOdo { get; } = new ColumnDataInt32Nullable("LastServiceOdo");
|
||||
public ColumnDataDateTimeNullable _LastServiceOn { get; } = new ColumnDataDateTimeNullable("LastServiceOn");
|
||||
public ColumnDataInt32Nullable _NextServiceOdo { get; } = new ColumnDataInt32Nullable("NextServiceOdo");
|
||||
public ColumnDataDateTimeNullable _NextServiceOn { get; } = new ColumnDataDateTimeNullable("NextServiceOn");
|
||||
public ColumnDataDateTimeNullable _MotOn { get; } = new ColumnDataDateTimeNullable("MotOn");
|
||||
public ColumnDataString _MotNo { get; } = new ColumnDataString("MotNo");
|
||||
public ColumnDataDateTime _NextTaxOn { get; } = new ColumnDataDateTime("NextTaxOn");
|
||||
public ColumnDataInt32 _LatestOdo { get; } = new ColumnDataInt32("LatestOdo");
|
||||
public ColumnDataDateTime _LatestOdoOn { get; } = new ColumnDataDateTime("LatestOdoOn");
|
||||
public ColumnDataDateTimeNullable _NextTaxOn { get; } = new ColumnDataDateTimeNullable("NextTaxOn");
|
||||
public ColumnDataInt32Nullable _LatestOdo { get; } = new ColumnDataInt32Nullable("LatestOdo");
|
||||
public ColumnDataDateTimeNullable _LatestOdoOn { get; } = new ColumnDataDateTimeNullable("LatestOdoOn");
|
||||
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
|
||||
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
|
||||
public ColumnDataInt16Nullable _Flags { get; } = new ColumnDataInt16Nullable("Flags");
|
||||
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
|
||||
public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn");
|
||||
public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy");
|
||||
public ColumnDataDateTimeNullable _CreateOn { get; } = new ColumnDataDateTimeNullable("CreateOn");
|
||||
public ColumnDataInt32Nullable _CreateBy { get; } = new ColumnDataInt32Nullable("CreateBy");
|
||||
public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost");
|
||||
public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn");
|
||||
public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy");
|
||||
public ColumnDataDateTimeNullable _UpdateOn { get; } = new ColumnDataDateTimeNullable("UpdateOn");
|
||||
public ColumnDataInt32Nullable _UpdateBy { get; } = new ColumnDataInt32Nullable("UpdateBy");
|
||||
public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost");
|
||||
}
|
||||
|
||||
@@ -107,6 +108,45 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
"Id",
|
||||
};
|
||||
protected static List<String> fieldsNullable { get; } = new List<String>()
|
||||
{
|
||||
"VehicleClassId",
|
||||
"RegNumber",
|
||||
"VIN",
|
||||
"CapCode",
|
||||
"KeyNumber",
|
||||
"KeyLocation",
|
||||
"EngineNumber",
|
||||
"EngineCapacity",
|
||||
"Seats",
|
||||
"Weight",
|
||||
"ManufactureYear",
|
||||
"BuildOn",
|
||||
"FirstRegisterOn",
|
||||
"RegisterOn",
|
||||
"RegNumberPrev",
|
||||
"PurchaseOdo",
|
||||
"TachoCode",
|
||||
"TachoId",
|
||||
"LastServiceOdo",
|
||||
"LastServiceOn",
|
||||
"NextServiceOdo",
|
||||
"NextServiceOn",
|
||||
"MotOn",
|
||||
"MotNo",
|
||||
"NextTaxOn",
|
||||
"LatestOdo",
|
||||
"LatestOdoOn",
|
||||
"Notes",
|
||||
"Flags",
|
||||
"Status",
|
||||
"CreateOn",
|
||||
"CreateBy",
|
||||
"CreateHost",
|
||||
"UpdateOn",
|
||||
"UpdateBy",
|
||||
"UpdateHost",
|
||||
};
|
||||
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
|
||||
{
|
||||
"CreateOn",
|
||||
@@ -131,45 +171,46 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
// Columns.
|
||||
public ColumnsData Cols { get; } = new ColumnsData();
|
||||
public Int32 _Id { get { return Cols._Id.Value; } set { Cols._Id.Value = value; } }
|
||||
public Int32 _VehicleClassId { get { return Cols._VehicleClassId.Value; } set { Cols._VehicleClassId.Value = value; } }
|
||||
public Int32? _VehicleClassId { get { return Cols._VehicleClassId.Value; } set { Cols._VehicleClassId.Value = value; } }
|
||||
public String _RegNumber { get { return Cols._RegNumber.Value; } set { Cols._RegNumber.Value = value; } }
|
||||
public String _VIN { get { return Cols._VIN.Value; } set { Cols._VIN.Value = value; } }
|
||||
public String _CapCode { get { return Cols._CapCode.Value; } set { Cols._CapCode.Value = value; } }
|
||||
public String _KeyNumber { get { return Cols._KeyNumber.Value; } set { Cols._KeyNumber.Value = value; } }
|
||||
public String _KeyLocation { get { return Cols._KeyLocation.Value; } set { Cols._KeyLocation.Value = value; } }
|
||||
public String _EngineNumber { get { return Cols._EngineNumber.Value; } set { Cols._EngineNumber.Value = value; } }
|
||||
public Int16 _EngineCapacity { get { return Cols._EngineCapacity.Value; } set { Cols._EngineCapacity.Value = value; } }
|
||||
public Int16 _Seats { get { return Cols._Seats.Value; } set { Cols._Seats.Value = value; } }
|
||||
public Int16 _Weight { get { return Cols._Weight.Value; } set { Cols._Weight.Value = value; } }
|
||||
public Int16 _ManufactureYear { get { return Cols._ManufactureYear.Value; } set { Cols._ManufactureYear.Value = value; } }
|
||||
public DateTime _BuildOn { get { return Cols._BuildOn.Value; } set { Cols._BuildOn.Value = value; } }
|
||||
public DateTime _FirstRegisterOn { get { return Cols._FirstRegisterOn.Value; } set { Cols._FirstRegisterOn.Value = value; } }
|
||||
public DateTime _RegisterOn { get { return Cols._RegisterOn.Value; } set { Cols._RegisterOn.Value = value; } }
|
||||
public Int16? _EngineCapacity { get { return Cols._EngineCapacity.Value; } set { Cols._EngineCapacity.Value = value; } }
|
||||
public Int16? _Seats { get { return Cols._Seats.Value; } set { Cols._Seats.Value = value; } }
|
||||
public Int16? _Weight { get { return Cols._Weight.Value; } set { Cols._Weight.Value = value; } }
|
||||
public Int16? _ManufactureYear { get { return Cols._ManufactureYear.Value; } set { Cols._ManufactureYear.Value = value; } }
|
||||
public DateTime? _BuildOn { get { return Cols._BuildOn.Value; } set { Cols._BuildOn.Value = value; } }
|
||||
public DateTime? _FirstRegisterOn { get { return Cols._FirstRegisterOn.Value; } set { Cols._FirstRegisterOn.Value = value; } }
|
||||
public DateTime? _RegisterOn { get { return Cols._RegisterOn.Value; } set { Cols._RegisterOn.Value = value; } }
|
||||
public String _RegNumberPrev { get { return Cols._RegNumberPrev.Value; } set { Cols._RegNumberPrev.Value = value; } }
|
||||
public Int32 _PurchaseOdo { get { return Cols._PurchaseOdo.Value; } set { Cols._PurchaseOdo.Value = value; } }
|
||||
public Int32? _PurchaseOdo { get { return Cols._PurchaseOdo.Value; } set { Cols._PurchaseOdo.Value = value; } }
|
||||
public String _TachoCode { get { return Cols._TachoCode.Value; } set { Cols._TachoCode.Value = value; } }
|
||||
public String _TachoId { get { return Cols._TachoId.Value; } set { Cols._TachoId.Value = value; } }
|
||||
public Int32 _LastServiceOdo { get { return Cols._LastServiceOdo.Value; } set { Cols._LastServiceOdo.Value = value; } }
|
||||
public DateTime _LastServiceOn { get { return Cols._LastServiceOn.Value; } set { Cols._LastServiceOn.Value = value; } }
|
||||
public Int32 _NextServiceOdo { get { return Cols._NextServiceOdo.Value; } set { Cols._NextServiceOdo.Value = value; } }
|
||||
public DateTime _NextServiceOn { get { return Cols._NextServiceOn.Value; } set { Cols._NextServiceOn.Value = value; } }
|
||||
public DateTime _MotOn { get { return Cols._MotOn.Value; } set { Cols._MotOn.Value = value; } }
|
||||
public Int32? _LastServiceOdo { get { return Cols._LastServiceOdo.Value; } set { Cols._LastServiceOdo.Value = value; } }
|
||||
public DateTime? _LastServiceOn { get { return Cols._LastServiceOn.Value; } set { Cols._LastServiceOn.Value = value; } }
|
||||
public Int32? _NextServiceOdo { get { return Cols._NextServiceOdo.Value; } set { Cols._NextServiceOdo.Value = value; } }
|
||||
public DateTime? _NextServiceOn { get { return Cols._NextServiceOn.Value; } set { Cols._NextServiceOn.Value = value; } }
|
||||
public DateTime? _MotOn { get { return Cols._MotOn.Value; } set { Cols._MotOn.Value = value; } }
|
||||
public String _MotNo { get { return Cols._MotNo.Value; } set { Cols._MotNo.Value = value; } }
|
||||
public DateTime _NextTaxOn { get { return Cols._NextTaxOn.Value; } set { Cols._NextTaxOn.Value = value; } }
|
||||
public Int32 _LatestOdo { get { return Cols._LatestOdo.Value; } set { Cols._LatestOdo.Value = value; } }
|
||||
public DateTime _LatestOdoOn { get { return Cols._LatestOdoOn.Value; } set { Cols._LatestOdoOn.Value = value; } }
|
||||
public DateTime? _NextTaxOn { get { return Cols._NextTaxOn.Value; } set { Cols._NextTaxOn.Value = value; } }
|
||||
public Int32? _LatestOdo { get { return Cols._LatestOdo.Value; } set { Cols._LatestOdo.Value = value; } }
|
||||
public DateTime? _LatestOdoOn { get { return Cols._LatestOdoOn.Value; } set { Cols._LatestOdoOn.Value = value; } }
|
||||
public String _Notes { get { return Cols._Notes.Value; } set { Cols._Notes.Value = value; } }
|
||||
public Int16 _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public Int16? _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public String _Status { get { return Cols._Status.Value; } set { Cols._Status.Value = value; } }
|
||||
public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public DateTime? _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32? _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } }
|
||||
public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public DateTime? _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32? _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } }
|
||||
// Existing columns - confirmed on database if table exists.
|
||||
public List<String> ExistingColumnNames { get { return GetExistingColumnNames(Fields); } }
|
||||
public List<String> ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } }
|
||||
public List<String> UpdatableColumns { get { return ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Population.
|
||||
@@ -189,41 +230,41 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public override void PopulateFrom (DbDataReader dbDataReader)
|
||||
{
|
||||
_Id = GetFieldInt32(dbDataReader, "Id", _Id);
|
||||
_VehicleClassId = GetFieldInt32(dbDataReader, "VehicleClassId", _VehicleClassId);
|
||||
_VehicleClassId = GetFieldInt32Nullable(dbDataReader, "VehicleClassId", _VehicleClassId);
|
||||
_RegNumber = GetFieldString(dbDataReader, "RegNumber", _RegNumber);
|
||||
_VIN = GetFieldString(dbDataReader, "VIN", _VIN);
|
||||
_CapCode = GetFieldString(dbDataReader, "CapCode", _CapCode);
|
||||
_KeyNumber = GetFieldString(dbDataReader, "KeyNumber", _KeyNumber);
|
||||
_KeyLocation = GetFieldString(dbDataReader, "KeyLocation", _KeyLocation);
|
||||
_EngineNumber = GetFieldString(dbDataReader, "EngineNumber", _EngineNumber);
|
||||
_EngineCapacity = GetFieldInt16(dbDataReader, "EngineCapacity", _EngineCapacity);
|
||||
_Seats = GetFieldInt16(dbDataReader, "Seats", _Seats);
|
||||
_Weight = GetFieldInt16(dbDataReader, "Weight", _Weight);
|
||||
_ManufactureYear = GetFieldInt16(dbDataReader, "ManufactureYear", _ManufactureYear);
|
||||
_BuildOn = GetFieldDateTime(dbDataReader, "BuildOn", _BuildOn);
|
||||
_FirstRegisterOn = GetFieldDateTime(dbDataReader, "FirstRegisterOn", _FirstRegisterOn);
|
||||
_RegisterOn = GetFieldDateTime(dbDataReader, "RegisterOn", _RegisterOn);
|
||||
_EngineCapacity = GetFieldInt16Nullable(dbDataReader, "EngineCapacity", _EngineCapacity);
|
||||
_Seats = GetFieldInt16Nullable(dbDataReader, "Seats", _Seats);
|
||||
_Weight = GetFieldInt16Nullable(dbDataReader, "Weight", _Weight);
|
||||
_ManufactureYear = GetFieldInt16Nullable(dbDataReader, "ManufactureYear", _ManufactureYear);
|
||||
_BuildOn = GetFieldDateTimeNullable(dbDataReader, "BuildOn", _BuildOn);
|
||||
_FirstRegisterOn = GetFieldDateTimeNullable(dbDataReader, "FirstRegisterOn", _FirstRegisterOn);
|
||||
_RegisterOn = GetFieldDateTimeNullable(dbDataReader, "RegisterOn", _RegisterOn);
|
||||
_RegNumberPrev = GetFieldString(dbDataReader, "RegNumberPrev", _RegNumberPrev);
|
||||
_PurchaseOdo = GetFieldInt32(dbDataReader, "PurchaseOdo", _PurchaseOdo);
|
||||
_PurchaseOdo = GetFieldInt32Nullable(dbDataReader, "PurchaseOdo", _PurchaseOdo);
|
||||
_TachoCode = GetFieldString(dbDataReader, "TachoCode", _TachoCode);
|
||||
_TachoId = GetFieldString(dbDataReader, "TachoId", _TachoId);
|
||||
_LastServiceOdo = GetFieldInt32(dbDataReader, "LastServiceOdo", _LastServiceOdo);
|
||||
_LastServiceOn = GetFieldDateTime(dbDataReader, "LastServiceOn", _LastServiceOn);
|
||||
_NextServiceOdo = GetFieldInt32(dbDataReader, "NextServiceOdo", _NextServiceOdo);
|
||||
_NextServiceOn = GetFieldDateTime(dbDataReader, "NextServiceOn", _NextServiceOn);
|
||||
_MotOn = GetFieldDateTime(dbDataReader, "MotOn", _MotOn);
|
||||
_LastServiceOdo = GetFieldInt32Nullable(dbDataReader, "LastServiceOdo", _LastServiceOdo);
|
||||
_LastServiceOn = GetFieldDateTimeNullable(dbDataReader, "LastServiceOn", _LastServiceOn);
|
||||
_NextServiceOdo = GetFieldInt32Nullable(dbDataReader, "NextServiceOdo", _NextServiceOdo);
|
||||
_NextServiceOn = GetFieldDateTimeNullable(dbDataReader, "NextServiceOn", _NextServiceOn);
|
||||
_MotOn = GetFieldDateTimeNullable(dbDataReader, "MotOn", _MotOn);
|
||||
_MotNo = GetFieldString(dbDataReader, "MotNo", _MotNo);
|
||||
_NextTaxOn = GetFieldDateTime(dbDataReader, "NextTaxOn", _NextTaxOn);
|
||||
_LatestOdo = GetFieldInt32(dbDataReader, "LatestOdo", _LatestOdo);
|
||||
_LatestOdoOn = GetFieldDateTime(dbDataReader, "LatestOdoOn", _LatestOdoOn);
|
||||
_NextTaxOn = GetFieldDateTimeNullable(dbDataReader, "NextTaxOn", _NextTaxOn);
|
||||
_LatestOdo = GetFieldInt32Nullable(dbDataReader, "LatestOdo", _LatestOdo);
|
||||
_LatestOdoOn = GetFieldDateTimeNullable(dbDataReader, "LatestOdoOn", _LatestOdoOn);
|
||||
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
|
||||
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
|
||||
_Flags = GetFieldInt16Nullable(dbDataReader, "Flags", _Flags);
|
||||
_Status = GetFieldString(dbDataReader, "Status", _Status);
|
||||
_CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateOn = GetFieldDateTimeNullable(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32Nullable(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost);
|
||||
_UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateOn = GetFieldDateTimeNullable(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32Nullable(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost);
|
||||
}
|
||||
|
||||
@@ -292,10 +333,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update command.
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand)
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand, List<String> columnsToUpdate = null)
|
||||
{
|
||||
// Columns to update.
|
||||
List<String> columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList();
|
||||
List<String> columnNames = (columnsToUpdate?.Any() ?? false ? columnsToUpdate : UpdatableColumns).Where(col => UpdatableColumns.ContainsCI(col)).ToList();
|
||||
if (!columnNames.Any())
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} No columns to update. [{GetType().Name}]");
|
||||
return false;
|
||||
}
|
||||
// Construct query.
|
||||
String query = "UPDATE " + TableNameFmt + " SET ";
|
||||
if (dbCommand is SqlCommand)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
@@ -9,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 6-Jun-2024 17:06:27
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:21
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
@@ -20,12 +21,12 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public class ColumnsData
|
||||
{
|
||||
public ColumnDataInt32 _Id { get; } = new ColumnDataInt32("Id");
|
||||
public ColumnDataInt32 _CommodityId { get; } = new ColumnDataInt32("CommodityId");
|
||||
public ColumnDataInt32Nullable _CommodityId { get; } = new ColumnDataInt32Nullable("CommodityId");
|
||||
public ColumnDataInt32 _LocationId { get; } = new ColumnDataInt32("LocationId");
|
||||
public ColumnDataInt16 _Type { get; } = new ColumnDataInt16("Type");
|
||||
public ColumnDataInt16 _Source { get; } = new ColumnDataInt16("Source");
|
||||
public ColumnDataDateTime _Recorded { get; } = new ColumnDataDateTime("Recorded");
|
||||
public ColumnDataDecimal _Quantity { get; } = new ColumnDataDecimal("Quantity");
|
||||
public ColumnDataDateTimeNullable _Recorded { get; } = new ColumnDataDateTimeNullable("Recorded");
|
||||
public ColumnDataDecimalNullable _Quantity { get; } = new ColumnDataDecimalNullable("Quantity");
|
||||
public ColumnDataString _Bay1 { get; } = new ColumnDataString("Bay1");
|
||||
public ColumnDataString _Bay2 { get; } = new ColumnDataString("Bay2");
|
||||
public ColumnDataString _Bay3 { get; } = new ColumnDataString("Bay3");
|
||||
@@ -35,8 +36,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn");
|
||||
public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy");
|
||||
public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost");
|
||||
public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn");
|
||||
public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy");
|
||||
public ColumnDataDateTimeNullable _UpdateOn { get; } = new ColumnDataDateTimeNullable("UpdateOn");
|
||||
public ColumnDataInt32Nullable _UpdateBy { get; } = new ColumnDataInt32Nullable("UpdateBy");
|
||||
public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost");
|
||||
}
|
||||
|
||||
@@ -71,6 +72,20 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
"Id",
|
||||
};
|
||||
protected static List<String> fieldsNullable { get; } = new List<String>()
|
||||
{
|
||||
"CommodityId",
|
||||
"Recorded",
|
||||
"Quantity",
|
||||
"Bay1",
|
||||
"Bay2",
|
||||
"Bay3",
|
||||
"Notes",
|
||||
"CreateHost",
|
||||
"UpdateOn",
|
||||
"UpdateBy",
|
||||
"UpdateHost",
|
||||
};
|
||||
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
|
||||
{
|
||||
"CreateOn",
|
||||
@@ -95,12 +110,12 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
// Columns.
|
||||
public ColumnsData Cols { get; } = new ColumnsData();
|
||||
public Int32 _Id { get { return Cols._Id.Value; } set { Cols._Id.Value = value; } }
|
||||
public Int32 _CommodityId { get { return Cols._CommodityId.Value; } set { Cols._CommodityId.Value = value; } }
|
||||
public Int32? _CommodityId { get { return Cols._CommodityId.Value; } set { Cols._CommodityId.Value = value; } }
|
||||
public Int32 _LocationId { get { return Cols._LocationId.Value; } set { Cols._LocationId.Value = value; } }
|
||||
public Int16 _Type { get { return Cols._Type.Value; } set { Cols._Type.Value = value; } }
|
||||
public Int16 _Source { get { return Cols._Source.Value; } set { Cols._Source.Value = value; } }
|
||||
public DateTime _Recorded { get { return Cols._Recorded.Value; } set { Cols._Recorded.Value = value; } }
|
||||
public Decimal _Quantity { get { return Cols._Quantity.Value; } set { Cols._Quantity.Value = value; } }
|
||||
public DateTime? _Recorded { get { return Cols._Recorded.Value; } set { Cols._Recorded.Value = value; } }
|
||||
public Decimal? _Quantity { get { return Cols._Quantity.Value; } set { Cols._Quantity.Value = value; } }
|
||||
public String _Bay1 { get { return Cols._Bay1.Value; } set { Cols._Bay1.Value = value; } }
|
||||
public String _Bay2 { get { return Cols._Bay2.Value; } set { Cols._Bay2.Value = value; } }
|
||||
public String _Bay3 { get { return Cols._Bay3.Value; } set { Cols._Bay3.Value = value; } }
|
||||
@@ -110,12 +125,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } }
|
||||
public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public DateTime? _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32? _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } }
|
||||
// Existing columns - confirmed on database if table exists.
|
||||
public List<String> ExistingColumnNames { get { return GetExistingColumnNames(Fields); } }
|
||||
public List<String> ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } }
|
||||
public List<String> UpdatableColumns { get { return ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Population.
|
||||
@@ -135,12 +151,12 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public override void PopulateFrom (DbDataReader dbDataReader)
|
||||
{
|
||||
_Id = GetFieldInt32(dbDataReader, "Id", _Id);
|
||||
_CommodityId = GetFieldInt32(dbDataReader, "CommodityId", _CommodityId);
|
||||
_CommodityId = GetFieldInt32Nullable(dbDataReader, "CommodityId", _CommodityId);
|
||||
_LocationId = GetFieldInt32(dbDataReader, "LocationId", _LocationId);
|
||||
_Type = GetFieldInt16(dbDataReader, "Type", _Type);
|
||||
_Source = GetFieldInt16(dbDataReader, "Source", _Source);
|
||||
_Recorded = GetFieldDateTime(dbDataReader, "Recorded", _Recorded);
|
||||
_Quantity = GetFieldDecimal(dbDataReader, "Quantity", _Quantity);
|
||||
_Recorded = GetFieldDateTimeNullable(dbDataReader, "Recorded", _Recorded);
|
||||
_Quantity = GetFieldDecimalNullable(dbDataReader, "Quantity", _Quantity);
|
||||
_Bay1 = GetFieldString(dbDataReader, "Bay1", _Bay1);
|
||||
_Bay2 = GetFieldString(dbDataReader, "Bay2", _Bay2);
|
||||
_Bay3 = GetFieldString(dbDataReader, "Bay3", _Bay3);
|
||||
@@ -150,8 +166,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
_CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost);
|
||||
_UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateOn = GetFieldDateTimeNullable(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32Nullable(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost);
|
||||
}
|
||||
|
||||
@@ -202,10 +218,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update command.
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand)
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand, List<String> columnsToUpdate = null)
|
||||
{
|
||||
// Columns to update.
|
||||
List<String> columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList();
|
||||
List<String> columnNames = (columnsToUpdate?.Any() ?? false ? columnsToUpdate : UpdatableColumns).Where(col => UpdatableColumns.ContainsCI(col)).ToList();
|
||||
if (!columnNames.Any())
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} No columns to update. [{GetType().Name}]");
|
||||
return false;
|
||||
}
|
||||
// Construct query.
|
||||
String query = "UPDATE " + TableNameFmt + " SET ";
|
||||
if (dbCommand is SqlCommand)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
@@ -9,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 6-Jun-2024 17:06:27
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:21
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
@@ -23,16 +24,16 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public ColumnDataInt16 _Cat { get; } = new ColumnDataInt16("Cat");
|
||||
public ColumnDataString _Name { get; } = new ColumnDataString("Name");
|
||||
public ColumnDataString _Value { get; } = new ColumnDataString("Value");
|
||||
public ColumnDataInt32 _AffIdOwner { get; } = new ColumnDataInt32("AffIdOwner");
|
||||
public ColumnDataInt32 _AffIdTarget { get; } = new ColumnDataInt32("AffIdTarget");
|
||||
public ColumnDataInt32 _AssocId { get; } = new ColumnDataInt32("AssocId");
|
||||
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
|
||||
public ColumnDataInt32Nullable _AffIdOwner { get; } = new ColumnDataInt32Nullable("AffIdOwner");
|
||||
public ColumnDataInt32Nullable _AffIdTarget { get; } = new ColumnDataInt32Nullable("AffIdTarget");
|
||||
public ColumnDataInt32Nullable _AssocId { get; } = new ColumnDataInt32Nullable("AssocId");
|
||||
public ColumnDataInt16Nullable _Flags { get; } = new ColumnDataInt16Nullable("Flags");
|
||||
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
|
||||
public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn");
|
||||
public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy");
|
||||
public ColumnDataDateTimeNullable _CreateOn { get; } = new ColumnDataDateTimeNullable("CreateOn");
|
||||
public ColumnDataInt32Nullable _CreateBy { get; } = new ColumnDataInt32Nullable("CreateBy");
|
||||
public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost");
|
||||
public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn");
|
||||
public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy");
|
||||
public ColumnDataDateTimeNullable _UpdateOn { get; } = new ColumnDataDateTimeNullable("UpdateOn");
|
||||
public ColumnDataInt32Nullable _UpdateBy { get; } = new ColumnDataInt32Nullable("UpdateBy");
|
||||
public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost");
|
||||
}
|
||||
|
||||
@@ -63,6 +64,21 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
"Id",
|
||||
};
|
||||
protected static List<String> fieldsNullable { get; } = new List<String>()
|
||||
{
|
||||
"Value",
|
||||
"AffIdOwner",
|
||||
"AffIdTarget",
|
||||
"AssocId",
|
||||
"Flags",
|
||||
"Status",
|
||||
"CreateOn",
|
||||
"CreateBy",
|
||||
"CreateHost",
|
||||
"UpdateOn",
|
||||
"UpdateBy",
|
||||
"UpdateHost",
|
||||
};
|
||||
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
|
||||
{
|
||||
"CreateOn",
|
||||
@@ -90,20 +106,21 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public Int16 _Cat { get { return Cols._Cat.Value; } set { Cols._Cat.Value = value; } }
|
||||
public String _Name { get { return Cols._Name.Value; } set { Cols._Name.Value = value; } }
|
||||
public String _Value { get { return Cols._Value.Value; } set { Cols._Value.Value = value; } }
|
||||
public Int32 _AffIdOwner { get { return Cols._AffIdOwner.Value; } set { Cols._AffIdOwner.Value = value; } }
|
||||
public Int32 _AffIdTarget { get { return Cols._AffIdTarget.Value; } set { Cols._AffIdTarget.Value = value; } }
|
||||
public Int32 _AssocId { get { return Cols._AssocId.Value; } set { Cols._AssocId.Value = value; } }
|
||||
public Int16 _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public Int32? _AffIdOwner { get { return Cols._AffIdOwner.Value; } set { Cols._AffIdOwner.Value = value; } }
|
||||
public Int32? _AffIdTarget { get { return Cols._AffIdTarget.Value; } set { Cols._AffIdTarget.Value = value; } }
|
||||
public Int32? _AssocId { get { return Cols._AssocId.Value; } set { Cols._AssocId.Value = value; } }
|
||||
public Int16? _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public String _Status { get { return Cols._Status.Value; } set { Cols._Status.Value = value; } }
|
||||
public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public DateTime? _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32? _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } }
|
||||
public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public DateTime? _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32? _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } }
|
||||
// Existing columns - confirmed on database if table exists.
|
||||
public List<String> ExistingColumnNames { get { return GetExistingColumnNames(Fields); } }
|
||||
public List<String> ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } }
|
||||
public List<String> UpdatableColumns { get { return ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Population.
|
||||
@@ -126,16 +143,16 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
_Cat = GetFieldInt16(dbDataReader, "Cat", _Cat);
|
||||
_Name = GetFieldString(dbDataReader, "Name", _Name);
|
||||
_Value = GetFieldString(dbDataReader, "Value", _Value);
|
||||
_AffIdOwner = GetFieldInt32(dbDataReader, "AffIdOwner", _AffIdOwner);
|
||||
_AffIdTarget = GetFieldInt32(dbDataReader, "AffIdTarget", _AffIdTarget);
|
||||
_AssocId = GetFieldInt32(dbDataReader, "AssocId", _AssocId);
|
||||
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
|
||||
_AffIdOwner = GetFieldInt32Nullable(dbDataReader, "AffIdOwner", _AffIdOwner);
|
||||
_AffIdTarget = GetFieldInt32Nullable(dbDataReader, "AffIdTarget", _AffIdTarget);
|
||||
_AssocId = GetFieldInt32Nullable(dbDataReader, "AssocId", _AssocId);
|
||||
_Flags = GetFieldInt16Nullable(dbDataReader, "Flags", _Flags);
|
||||
_Status = GetFieldString(dbDataReader, "Status", _Status);
|
||||
_CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateOn = GetFieldDateTimeNullable(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32Nullable(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost);
|
||||
_UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateOn = GetFieldDateTimeNullable(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32Nullable(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost);
|
||||
}
|
||||
|
||||
@@ -182,10 +199,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update command.
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand)
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand, List<String> columnsToUpdate = null)
|
||||
{
|
||||
// Columns to update.
|
||||
List<String> columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList();
|
||||
List<String> columnNames = (columnsToUpdate?.Any() ?? false ? columnsToUpdate : UpdatableColumns).Where(col => UpdatableColumns.ContainsCI(col)).ToList();
|
||||
if (!columnNames.Any())
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} No columns to update. [{GetType().Name}]");
|
||||
return false;
|
||||
}
|
||||
// Construct query.
|
||||
String query = "UPDATE " + TableNameFmt + " SET ";
|
||||
if (dbCommand is SqlCommand)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
@@ -9,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 6-Jun-2024 17:06:27
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:21
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
@@ -22,13 +23,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public ColumnDataInt32 _AccountId { get; } = new ColumnDataInt32("AccountId");
|
||||
public ColumnDataInt32 _UserId { get; } = new ColumnDataInt32("UserId");
|
||||
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
|
||||
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
|
||||
public ColumnDataInt16Nullable _Flags { get; } = new ColumnDataInt16Nullable("Flags");
|
||||
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
|
||||
public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn");
|
||||
public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy");
|
||||
public ColumnDataDateTimeNullable _CreateOn { get; } = new ColumnDataDateTimeNullable("CreateOn");
|
||||
public ColumnDataInt32Nullable _CreateBy { get; } = new ColumnDataInt32Nullable("CreateBy");
|
||||
public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost");
|
||||
public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn");
|
||||
public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy");
|
||||
public ColumnDataDateTimeNullable _UpdateOn { get; } = new ColumnDataDateTimeNullable("UpdateOn");
|
||||
public ColumnDataInt32Nullable _UpdateBy { get; } = new ColumnDataInt32Nullable("UpdateBy");
|
||||
public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost");
|
||||
}
|
||||
|
||||
@@ -56,6 +57,18 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
"AccountId",
|
||||
"UserId",
|
||||
};
|
||||
protected static List<String> fieldsNullable { get; } = new List<String>()
|
||||
{
|
||||
"Notes",
|
||||
"Flags",
|
||||
"Status",
|
||||
"CreateOn",
|
||||
"CreateBy",
|
||||
"CreateHost",
|
||||
"UpdateOn",
|
||||
"UpdateBy",
|
||||
"UpdateHost",
|
||||
};
|
||||
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
|
||||
{
|
||||
"CreateOn",
|
||||
@@ -82,17 +95,18 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public Int32 _AccountId { get { return Cols._AccountId.Value; } set { Cols._AccountId.Value = value; } }
|
||||
public Int32 _UserId { get { return Cols._UserId.Value; } set { Cols._UserId.Value = value; } }
|
||||
public String _Notes { get { return Cols._Notes.Value; } set { Cols._Notes.Value = value; } }
|
||||
public Int16 _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public Int16? _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public String _Status { get { return Cols._Status.Value; } set { Cols._Status.Value = value; } }
|
||||
public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public DateTime? _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32? _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } }
|
||||
public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public DateTime? _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32? _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } }
|
||||
// Existing columns - confirmed on database if table exists.
|
||||
public List<String> ExistingColumnNames { get { return GetExistingColumnNames(Fields); } }
|
||||
public List<String> ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } }
|
||||
public List<String> UpdatableColumns { get { return ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Population.
|
||||
@@ -114,13 +128,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
_AccountId = GetFieldInt32(dbDataReader, "AccountId", _AccountId);
|
||||
_UserId = GetFieldInt32(dbDataReader, "UserId", _UserId);
|
||||
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
|
||||
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
|
||||
_Flags = GetFieldInt16Nullable(dbDataReader, "Flags", _Flags);
|
||||
_Status = GetFieldString(dbDataReader, "Status", _Status);
|
||||
_CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateOn = GetFieldDateTimeNullable(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32Nullable(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost);
|
||||
_UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateOn = GetFieldDateTimeNullable(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32Nullable(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost);
|
||||
}
|
||||
|
||||
@@ -163,10 +177,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update command.
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand)
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand, List<String> columnsToUpdate = null)
|
||||
{
|
||||
// Columns to update.
|
||||
List<String> columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList();
|
||||
List<String> columnNames = (columnsToUpdate?.Any() ?? false ? columnsToUpdate : UpdatableColumns).Where(col => UpdatableColumns.ContainsCI(col)).ToList();
|
||||
if (!columnNames.Any())
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} No columns to update. [{GetType().Name}]");
|
||||
return false;
|
||||
}
|
||||
// Construct query.
|
||||
String query = "UPDATE " + TableNameFmt + " SET ";
|
||||
if (dbCommand is SqlCommand)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
@@ -9,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 6-Jun-2024 17:06:27
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:21
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
@@ -21,20 +22,20 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
public ColumnDataInt32 _Id { get; } = new ColumnDataInt32("Id");
|
||||
public ColumnDataInt32 _AffIdOwner { get; } = new ColumnDataInt32("AffIdOwner");
|
||||
public ColumnDataInt16 _Type { get; } = new ColumnDataInt16("Type");
|
||||
public ColumnDataInt16Nullable _Type { get; } = new ColumnDataInt16Nullable("Type");
|
||||
public ColumnDataInt32 _InterfaceId { get; } = new ColumnDataInt32("InterfaceId");
|
||||
public ColumnDataInt32 _AssocId { get; } = new ColumnDataInt32("AssocId");
|
||||
public ColumnDataString _Code { get; } = new ColumnDataString("Code");
|
||||
public ColumnDataString _Name { get; } = new ColumnDataString("Name");
|
||||
public ColumnDataString _AuthCodeEnc { get; } = new ColumnDataString("AuthCodeEnc");
|
||||
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
|
||||
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
|
||||
public ColumnDataInt16Nullable _Flags { get; } = new ColumnDataInt16Nullable("Flags");
|
||||
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
|
||||
public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn");
|
||||
public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy");
|
||||
public ColumnDataDateTimeNullable _CreateOn { get; } = new ColumnDataDateTimeNullable("CreateOn");
|
||||
public ColumnDataInt32Nullable _CreateBy { get; } = new ColumnDataInt32Nullable("CreateBy");
|
||||
public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost");
|
||||
public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn");
|
||||
public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy");
|
||||
public ColumnDataDateTimeNullable _UpdateOn { get; } = new ColumnDataDateTimeNullable("UpdateOn");
|
||||
public ColumnDataInt32Nullable _UpdateBy { get; } = new ColumnDataInt32Nullable("UpdateBy");
|
||||
public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost");
|
||||
}
|
||||
|
||||
@@ -67,6 +68,22 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
"Id",
|
||||
};
|
||||
protected static List<String> fieldsNullable { get; } = new List<String>()
|
||||
{
|
||||
"Type",
|
||||
"Code",
|
||||
"Name",
|
||||
"AuthCodeEnc",
|
||||
"Notes",
|
||||
"Flags",
|
||||
"Status",
|
||||
"CreateOn",
|
||||
"CreateBy",
|
||||
"CreateHost",
|
||||
"UpdateOn",
|
||||
"UpdateBy",
|
||||
"UpdateHost",
|
||||
};
|
||||
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
|
||||
{
|
||||
"CreateOn",
|
||||
@@ -92,24 +109,25 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public ColumnsData Cols { get; } = new ColumnsData();
|
||||
public Int32 _Id { get { return Cols._Id.Value; } set { Cols._Id.Value = value; } }
|
||||
public Int32 _AffIdOwner { get { return Cols._AffIdOwner.Value; } set { Cols._AffIdOwner.Value = value; } }
|
||||
public Int16 _Type { get { return Cols._Type.Value; } set { Cols._Type.Value = value; } }
|
||||
public Int16? _Type { get { return Cols._Type.Value; } set { Cols._Type.Value = value; } }
|
||||
public Int32 _InterfaceId { get { return Cols._InterfaceId.Value; } set { Cols._InterfaceId.Value = value; } }
|
||||
public Int32 _AssocId { get { return Cols._AssocId.Value; } set { Cols._AssocId.Value = value; } }
|
||||
public String _Code { get { return Cols._Code.Value; } set { Cols._Code.Value = value; } }
|
||||
public String _Name { get { return Cols._Name.Value; } set { Cols._Name.Value = value; } }
|
||||
public String _AuthCodeEnc { get { return Cols._AuthCodeEnc.Value; } set { Cols._AuthCodeEnc.Value = value; } }
|
||||
public String _Notes { get { return Cols._Notes.Value; } set { Cols._Notes.Value = value; } }
|
||||
public Int16 _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public Int16? _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public String _Status { get { return Cols._Status.Value; } set { Cols._Status.Value = value; } }
|
||||
public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public DateTime? _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32? _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } }
|
||||
public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public DateTime? _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32? _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } }
|
||||
// Existing columns - confirmed on database if table exists.
|
||||
public List<String> ExistingColumnNames { get { return GetExistingColumnNames(Fields); } }
|
||||
public List<String> ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } }
|
||||
public List<String> UpdatableColumns { get { return ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Population.
|
||||
@@ -130,20 +148,20 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
_Id = GetFieldInt32(dbDataReader, "Id", _Id);
|
||||
_AffIdOwner = GetFieldInt32(dbDataReader, "AffIdOwner", _AffIdOwner);
|
||||
_Type = GetFieldInt16(dbDataReader, "Type", _Type);
|
||||
_Type = GetFieldInt16Nullable(dbDataReader, "Type", _Type);
|
||||
_InterfaceId = GetFieldInt32(dbDataReader, "InterfaceId", _InterfaceId);
|
||||
_AssocId = GetFieldInt32(dbDataReader, "AssocId", _AssocId);
|
||||
_Code = GetFieldString(dbDataReader, "Code", _Code);
|
||||
_Name = GetFieldString(dbDataReader, "Name", _Name);
|
||||
_AuthCodeEnc = GetFieldString(dbDataReader, "AuthCodeEnc", _AuthCodeEnc);
|
||||
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
|
||||
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
|
||||
_Flags = GetFieldInt16Nullable(dbDataReader, "Flags", _Flags);
|
||||
_Status = GetFieldString(dbDataReader, "Status", _Status);
|
||||
_CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateOn = GetFieldDateTimeNullable(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32Nullable(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost);
|
||||
_UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateOn = GetFieldDateTimeNullable(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32Nullable(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost);
|
||||
}
|
||||
|
||||
@@ -192,10 +210,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update command.
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand)
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand, List<String> columnsToUpdate = null)
|
||||
{
|
||||
// Columns to update.
|
||||
List<String> columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList();
|
||||
List<String> columnNames = (columnsToUpdate?.Any() ?? false ? columnsToUpdate : UpdatableColumns).Where(col => UpdatableColumns.ContainsCI(col)).ToList();
|
||||
if (!columnNames.Any())
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} No columns to update. [{GetType().Name}]");
|
||||
return false;
|
||||
}
|
||||
// Construct query.
|
||||
String query = "UPDATE " + TableNameFmt + " SET ";
|
||||
if (dbCommand is SqlCommand)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
@@ -9,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 6-Jun-2024 17:06:27
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:21
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
@@ -21,18 +22,18 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
public ColumnDataInt32 _Id { get; } = new ColumnDataInt32("Id");
|
||||
public ColumnDataInt32 _AffIdOwner { get; } = new ColumnDataInt32("AffIdOwner");
|
||||
public ColumnDataInt32 _InterfaceId { get; } = new ColumnDataInt32("InterfaceId");
|
||||
public ColumnDataInt32 _AffiliateId { get; } = new ColumnDataInt32("AffiliateId");
|
||||
public ColumnDataInt32Nullable _InterfaceId { get; } = new ColumnDataInt32Nullable("InterfaceId");
|
||||
public ColumnDataInt32Nullable _AffiliateId { get; } = new ColumnDataInt32Nullable("AffiliateId");
|
||||
public ColumnDataString _Code { get; } = new ColumnDataString("Code");
|
||||
public ColumnDataString _AuthCodeEnc { get; } = new ColumnDataString("AuthCodeEnc");
|
||||
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
|
||||
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
|
||||
public ColumnDataInt16Nullable _Flags { get; } = new ColumnDataInt16Nullable("Flags");
|
||||
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
|
||||
public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn");
|
||||
public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy");
|
||||
public ColumnDataDateTimeNullable _CreateOn { get; } = new ColumnDataDateTimeNullable("CreateOn");
|
||||
public ColumnDataInt32Nullable _CreateBy { get; } = new ColumnDataInt32Nullable("CreateBy");
|
||||
public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost");
|
||||
public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn");
|
||||
public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy");
|
||||
public ColumnDataDateTimeNullable _UpdateOn { get; } = new ColumnDataDateTimeNullable("UpdateOn");
|
||||
public ColumnDataInt32Nullable _UpdateBy { get; } = new ColumnDataInt32Nullable("UpdateBy");
|
||||
public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost");
|
||||
}
|
||||
|
||||
@@ -63,6 +64,22 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
"Id",
|
||||
};
|
||||
protected static List<String> fieldsNullable { get; } = new List<String>()
|
||||
{
|
||||
"InterfaceId",
|
||||
"AffiliateId",
|
||||
"Code",
|
||||
"AuthCodeEnc",
|
||||
"Notes",
|
||||
"Flags",
|
||||
"Status",
|
||||
"CreateOn",
|
||||
"CreateBy",
|
||||
"CreateHost",
|
||||
"UpdateOn",
|
||||
"UpdateBy",
|
||||
"UpdateHost",
|
||||
};
|
||||
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
|
||||
{
|
||||
"CreateOn",
|
||||
@@ -88,22 +105,23 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public ColumnsData Cols { get; } = new ColumnsData();
|
||||
public Int32 _Id { get { return Cols._Id.Value; } set { Cols._Id.Value = value; } }
|
||||
public Int32 _AffIdOwner { get { return Cols._AffIdOwner.Value; } set { Cols._AffIdOwner.Value = value; } }
|
||||
public Int32 _InterfaceId { get { return Cols._InterfaceId.Value; } set { Cols._InterfaceId.Value = value; } }
|
||||
public Int32 _AffiliateId { get { return Cols._AffiliateId.Value; } set { Cols._AffiliateId.Value = value; } }
|
||||
public Int32? _InterfaceId { get { return Cols._InterfaceId.Value; } set { Cols._InterfaceId.Value = value; } }
|
||||
public Int32? _AffiliateId { get { return Cols._AffiliateId.Value; } set { Cols._AffiliateId.Value = value; } }
|
||||
public String _Code { get { return Cols._Code.Value; } set { Cols._Code.Value = value; } }
|
||||
public String _AuthCodeEnc { get { return Cols._AuthCodeEnc.Value; } set { Cols._AuthCodeEnc.Value = value; } }
|
||||
public String _Notes { get { return Cols._Notes.Value; } set { Cols._Notes.Value = value; } }
|
||||
public Int16 _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public Int16? _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public String _Status { get { return Cols._Status.Value; } set { Cols._Status.Value = value; } }
|
||||
public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public DateTime? _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32? _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } }
|
||||
public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public DateTime? _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32? _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } }
|
||||
// Existing columns - confirmed on database if table exists.
|
||||
public List<String> ExistingColumnNames { get { return GetExistingColumnNames(Fields); } }
|
||||
public List<String> ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } }
|
||||
public List<String> UpdatableColumns { get { return ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Population.
|
||||
@@ -124,18 +142,18 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
_Id = GetFieldInt32(dbDataReader, "Id", _Id);
|
||||
_AffIdOwner = GetFieldInt32(dbDataReader, "AffIdOwner", _AffIdOwner);
|
||||
_InterfaceId = GetFieldInt32(dbDataReader, "InterfaceId", _InterfaceId);
|
||||
_AffiliateId = GetFieldInt32(dbDataReader, "AffiliateId", _AffiliateId);
|
||||
_InterfaceId = GetFieldInt32Nullable(dbDataReader, "InterfaceId", _InterfaceId);
|
||||
_AffiliateId = GetFieldInt32Nullable(dbDataReader, "AffiliateId", _AffiliateId);
|
||||
_Code = GetFieldString(dbDataReader, "Code", _Code);
|
||||
_AuthCodeEnc = GetFieldString(dbDataReader, "AuthCodeEnc", _AuthCodeEnc);
|
||||
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
|
||||
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
|
||||
_Flags = GetFieldInt16Nullable(dbDataReader, "Flags", _Flags);
|
||||
_Status = GetFieldString(dbDataReader, "Status", _Status);
|
||||
_CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateOn = GetFieldDateTimeNullable(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32Nullable(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost);
|
||||
_UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateOn = GetFieldDateTimeNullable(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32Nullable(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost);
|
||||
}
|
||||
|
||||
@@ -182,10 +200,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update command.
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand)
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand, List<String> columnsToUpdate = null)
|
||||
{
|
||||
// Columns to update.
|
||||
List<String> columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList();
|
||||
List<String> columnNames = (columnsToUpdate?.Any() ?? false ? columnsToUpdate : UpdatableColumns).Where(col => UpdatableColumns.ContainsCI(col)).ToList();
|
||||
if (!columnNames.Any())
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} No columns to update. [{GetType().Name}]");
|
||||
return false;
|
||||
}
|
||||
// Construct query.
|
||||
String query = "UPDATE " + TableNameFmt + " SET ";
|
||||
if (dbCommand is SqlCommand)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
@@ -9,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 6-Jun-2024 17:06:27
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:21
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
@@ -24,20 +25,20 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public ColumnDataString _CodeAlt1 { get; } = new ColumnDataString("CodeAlt1");
|
||||
public ColumnDataString _CodeAlt2 { get; } = new ColumnDataString("CodeAlt2");
|
||||
public ColumnDataString _Description { get; } = new ColumnDataString("Description");
|
||||
public ColumnDataInt32 _RegionId { get; } = new ColumnDataInt32("RegionId");
|
||||
public ColumnDataDateTime _EffectFrom { get; } = new ColumnDataDateTime("EffectFrom");
|
||||
public ColumnDataDateTime _EffectTo { get; } = new ColumnDataDateTime("EffectTo");
|
||||
public ColumnDataDecimal _TaxRate { get; } = new ColumnDataDecimal("TaxRate");
|
||||
public ColumnDataDecimal _TaxRatePrev { get; } = new ColumnDataDecimal("TaxRatePrev");
|
||||
public ColumnDataInt32 _TaxCodeIdLink { get; } = new ColumnDataInt32("TaxCodeIdLink");
|
||||
public ColumnDataInt32Nullable _RegionId { get; } = new ColumnDataInt32Nullable("RegionId");
|
||||
public ColumnDataDateTimeNullable _EffectFrom { get; } = new ColumnDataDateTimeNullable("EffectFrom");
|
||||
public ColumnDataDateTimeNullable _EffectTo { get; } = new ColumnDataDateTimeNullable("EffectTo");
|
||||
public ColumnDataDecimalNullable _TaxRate { get; } = new ColumnDataDecimalNullable("TaxRate");
|
||||
public ColumnDataDecimalNullable _TaxRatePrev { get; } = new ColumnDataDecimalNullable("TaxRatePrev");
|
||||
public ColumnDataInt32Nullable _TaxCodeIdLink { get; } = new ColumnDataInt32Nullable("TaxCodeIdLink");
|
||||
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
|
||||
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
|
||||
public ColumnDataInt16Nullable _Flags { get; } = new ColumnDataInt16Nullable("Flags");
|
||||
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
|
||||
public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn");
|
||||
public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy");
|
||||
public ColumnDataDateTimeNullable _CreateOn { get; } = new ColumnDataDateTimeNullable("CreateOn");
|
||||
public ColumnDataInt32Nullable _CreateBy { get; } = new ColumnDataInt32Nullable("CreateBy");
|
||||
public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost");
|
||||
public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn");
|
||||
public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy");
|
||||
public ColumnDataDateTimeNullable _UpdateOn { get; } = new ColumnDataDateTimeNullable("UpdateOn");
|
||||
public ColumnDataInt32Nullable _UpdateBy { get; } = new ColumnDataInt32Nullable("UpdateBy");
|
||||
public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost");
|
||||
}
|
||||
|
||||
@@ -73,6 +74,28 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
"Id",
|
||||
};
|
||||
protected static List<String> fieldsNullable { get; } = new List<String>()
|
||||
{
|
||||
"Code",
|
||||
"CodeAlt1",
|
||||
"CodeAlt2",
|
||||
"Description",
|
||||
"RegionId",
|
||||
"EffectFrom",
|
||||
"EffectTo",
|
||||
"TaxRate",
|
||||
"TaxRatePrev",
|
||||
"TaxCodeIdLink",
|
||||
"Notes",
|
||||
"Flags",
|
||||
"Status",
|
||||
"CreateOn",
|
||||
"CreateBy",
|
||||
"CreateHost",
|
||||
"UpdateOn",
|
||||
"UpdateBy",
|
||||
"UpdateHost",
|
||||
};
|
||||
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
|
||||
{
|
||||
"CreateOn",
|
||||
@@ -101,24 +124,25 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public String _CodeAlt1 { get { return Cols._CodeAlt1.Value; } set { Cols._CodeAlt1.Value = value; } }
|
||||
public String _CodeAlt2 { get { return Cols._CodeAlt2.Value; } set { Cols._CodeAlt2.Value = value; } }
|
||||
public String _Description { get { return Cols._Description.Value; } set { Cols._Description.Value = value; } }
|
||||
public Int32 _RegionId { get { return Cols._RegionId.Value; } set { Cols._RegionId.Value = value; } }
|
||||
public DateTime _EffectFrom { get { return Cols._EffectFrom.Value; } set { Cols._EffectFrom.Value = value; } }
|
||||
public DateTime _EffectTo { get { return Cols._EffectTo.Value; } set { Cols._EffectTo.Value = value; } }
|
||||
public Decimal _TaxRate { get { return Cols._TaxRate.Value; } set { Cols._TaxRate.Value = value; } }
|
||||
public Decimal _TaxRatePrev { get { return Cols._TaxRatePrev.Value; } set { Cols._TaxRatePrev.Value = value; } }
|
||||
public Int32 _TaxCodeIdLink { get { return Cols._TaxCodeIdLink.Value; } set { Cols._TaxCodeIdLink.Value = value; } }
|
||||
public Int32? _RegionId { get { return Cols._RegionId.Value; } set { Cols._RegionId.Value = value; } }
|
||||
public DateTime? _EffectFrom { get { return Cols._EffectFrom.Value; } set { Cols._EffectFrom.Value = value; } }
|
||||
public DateTime? _EffectTo { get { return Cols._EffectTo.Value; } set { Cols._EffectTo.Value = value; } }
|
||||
public Decimal? _TaxRate { get { return Cols._TaxRate.Value; } set { Cols._TaxRate.Value = value; } }
|
||||
public Decimal? _TaxRatePrev { get { return Cols._TaxRatePrev.Value; } set { Cols._TaxRatePrev.Value = value; } }
|
||||
public Int32? _TaxCodeIdLink { get { return Cols._TaxCodeIdLink.Value; } set { Cols._TaxCodeIdLink.Value = value; } }
|
||||
public String _Notes { get { return Cols._Notes.Value; } set { Cols._Notes.Value = value; } }
|
||||
public Int16 _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public Int16? _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public String _Status { get { return Cols._Status.Value; } set { Cols._Status.Value = value; } }
|
||||
public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public DateTime? _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32? _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } }
|
||||
public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public DateTime? _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32? _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } }
|
||||
// Existing columns - confirmed on database if table exists.
|
||||
public List<String> ExistingColumnNames { get { return GetExistingColumnNames(Fields); } }
|
||||
public List<String> ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } }
|
||||
public List<String> UpdatableColumns { get { return ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Population.
|
||||
@@ -142,20 +166,20 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
_CodeAlt1 = GetFieldString(dbDataReader, "CodeAlt1", _CodeAlt1);
|
||||
_CodeAlt2 = GetFieldString(dbDataReader, "CodeAlt2", _CodeAlt2);
|
||||
_Description = GetFieldString(dbDataReader, "Description", _Description);
|
||||
_RegionId = GetFieldInt32(dbDataReader, "RegionId", _RegionId);
|
||||
_EffectFrom = GetFieldDateTime(dbDataReader, "EffectFrom", _EffectFrom);
|
||||
_EffectTo = GetFieldDateTime(dbDataReader, "EffectTo", _EffectTo);
|
||||
_TaxRate = GetFieldDecimal(dbDataReader, "TaxRate", _TaxRate);
|
||||
_TaxRatePrev = GetFieldDecimal(dbDataReader, "TaxRatePrev", _TaxRatePrev);
|
||||
_TaxCodeIdLink = GetFieldInt32(dbDataReader, "TaxCodeIdLink", _TaxCodeIdLink);
|
||||
_RegionId = GetFieldInt32Nullable(dbDataReader, "RegionId", _RegionId);
|
||||
_EffectFrom = GetFieldDateTimeNullable(dbDataReader, "EffectFrom", _EffectFrom);
|
||||
_EffectTo = GetFieldDateTimeNullable(dbDataReader, "EffectTo", _EffectTo);
|
||||
_TaxRate = GetFieldDecimalNullable(dbDataReader, "TaxRate", _TaxRate);
|
||||
_TaxRatePrev = GetFieldDecimalNullable(dbDataReader, "TaxRatePrev", _TaxRatePrev);
|
||||
_TaxCodeIdLink = GetFieldInt32Nullable(dbDataReader, "TaxCodeIdLink", _TaxCodeIdLink);
|
||||
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
|
||||
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
|
||||
_Flags = GetFieldInt16Nullable(dbDataReader, "Flags", _Flags);
|
||||
_Status = GetFieldString(dbDataReader, "Status", _Status);
|
||||
_CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateOn = GetFieldDateTimeNullable(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32Nullable(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost);
|
||||
_UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateOn = GetFieldDateTimeNullable(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32Nullable(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost);
|
||||
}
|
||||
|
||||
@@ -207,10 +231,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update command.
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand)
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand, List<String> columnsToUpdate = null)
|
||||
{
|
||||
// Columns to update.
|
||||
List<String> columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList();
|
||||
List<String> columnNames = (columnsToUpdate?.Any() ?? false ? columnsToUpdate : UpdatableColumns).Where(col => UpdatableColumns.ContainsCI(col)).ToList();
|
||||
if (!columnNames.Any())
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} No columns to update. [{GetType().Name}]");
|
||||
return false;
|
||||
}
|
||||
// Construct query.
|
||||
String query = "UPDATE " + TableNameFmt + " SET ";
|
||||
if (dbCommand is SqlCommand)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
@@ -9,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 6-Jun-2024 17:06:27
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:21
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
@@ -20,29 +21,29 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public class ColumnsData
|
||||
{
|
||||
public ColumnDataInt32 _Id { get; } = new ColumnDataInt32("Id");
|
||||
public ColumnDataInt32 _AffIdOwner { get; } = new ColumnDataInt32("AffIdOwner");
|
||||
public ColumnDataInt32Nullable _AffIdOwner { get; } = new ColumnDataInt32Nullable("AffIdOwner");
|
||||
public ColumnDataInt32 _AssocId { get; } = new ColumnDataInt32("AssocId");
|
||||
public ColumnDataInt16 _Type { get; } = new ColumnDataInt16("Type");
|
||||
public ColumnDataInt16Nullable _Type { get; } = new ColumnDataInt16Nullable("Type");
|
||||
public ColumnDataString _Ref { get; } = new ColumnDataString("Ref");
|
||||
public ColumnDataInt32 _RefInt { get; } = new ColumnDataInt32("RefInt");
|
||||
public ColumnDataInt32Nullable _RefInt { get; } = new ColumnDataInt32Nullable("RefInt");
|
||||
public ColumnDataString _RefExt { get; } = new ColumnDataString("RefExt");
|
||||
public ColumnDataString _RaisedBy { get; } = new ColumnDataString("RaisedBy");
|
||||
public ColumnDataInt32 _AffIdRaise { get; } = new ColumnDataInt32("AffIdRaise");
|
||||
public ColumnDataInt32 _AssocIdOffice { get; } = new ColumnDataInt32("AssocIdOffice");
|
||||
public ColumnDataInt32Nullable _AffIdRaise { get; } = new ColumnDataInt32Nullable("AffIdRaise");
|
||||
public ColumnDataInt32Nullable _AssocIdOffice { get; } = new ColumnDataInt32Nullable("AssocIdOffice");
|
||||
public ColumnDataString _ContactName { get; } = new ColumnDataString("ContactName");
|
||||
public ColumnDataString _Likelihood { get; } = new ColumnDataString("Likelihood");
|
||||
public ColumnDataInt32 _TransIdSource { get; } = new ColumnDataInt32("TransIdSource");
|
||||
public ColumnDataInt32Nullable _TransIdSource { get; } = new ColumnDataInt32Nullable("TransIdSource");
|
||||
public ColumnDataString _ReferCode { get; } = new ColumnDataString("ReferCode");
|
||||
public ColumnDataString _ReferSource { get; } = new ColumnDataString("ReferSource");
|
||||
public ColumnDataInt32 _AffIdRefer { get; } = new ColumnDataInt32("AffIdRefer");
|
||||
public ColumnDataInt32 _AssocIdContract { get; } = new ColumnDataInt32("AssocIdContract");
|
||||
public ColumnDataInt32 _AssIdDeliver { get; } = new ColumnDataInt32("AssIdDeliver");
|
||||
public ColumnDataDateTime _Raised { get; } = new ColumnDataDateTime("Raised");
|
||||
public ColumnDataDateTime _Required { get; } = new ColumnDataDateTime("Required");
|
||||
public ColumnDataDateTime _InProgress { get; } = new ColumnDataDateTime("InProgress");
|
||||
public ColumnDataDateTime _DeliveredEst { get; } = new ColumnDataDateTime("DeliveredEst");
|
||||
public ColumnDataDateTime _DeliveredAct { get; } = new ColumnDataDateTime("DeliveredAct");
|
||||
public ColumnDataDateTime _Closed { get; } = new ColumnDataDateTime("Closed");
|
||||
public ColumnDataInt32Nullable _AffIdRefer { get; } = new ColumnDataInt32Nullable("AffIdRefer");
|
||||
public ColumnDataInt32Nullable _AssocIdContract { get; } = new ColumnDataInt32Nullable("AssocIdContract");
|
||||
public ColumnDataInt32Nullable _AssIdDeliver { get; } = new ColumnDataInt32Nullable("AssIdDeliver");
|
||||
public ColumnDataDateTimeNullable _Raised { get; } = new ColumnDataDateTimeNullable("Raised");
|
||||
public ColumnDataDateTimeNullable _Required { get; } = new ColumnDataDateTimeNullable("Required");
|
||||
public ColumnDataDateTimeNullable _InProgress { get; } = new ColumnDataDateTimeNullable("InProgress");
|
||||
public ColumnDataDateTimeNullable _DeliveredEst { get; } = new ColumnDataDateTimeNullable("DeliveredEst");
|
||||
public ColumnDataDateTimeNullable _DeliveredAct { get; } = new ColumnDataDateTimeNullable("DeliveredAct");
|
||||
public ColumnDataDateTimeNullable _Closed { get; } = new ColumnDataDateTimeNullable("Closed");
|
||||
public ColumnDataString _Department { get; } = new ColumnDataString("Department");
|
||||
public ColumnDataString _DescBrief { get; } = new ColumnDataString("DescBrief");
|
||||
public ColumnDataString _DescIntro { get; } = new ColumnDataString("DescIntro");
|
||||
@@ -51,21 +52,21 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public ColumnDataString _ResponseCode { get; } = new ColumnDataString("ResponseCode");
|
||||
public ColumnDataString _ContactAreaCode { get; } = new ColumnDataString("ContactAreaCode");
|
||||
public ColumnDataString _Postcode { get; } = new ColumnDataString("Postcode");
|
||||
public ColumnDataInt32 _CurrencyId { get; } = new ColumnDataInt32("CurrencyId");
|
||||
public ColumnDataInt32 _TaxCodeId { get; } = new ColumnDataInt32("TaxCodeId");
|
||||
public ColumnDataDecimal _AmountEst { get; } = new ColumnDataDecimal("AmountEst");
|
||||
public ColumnDataDecimal _AmountMax { get; } = new ColumnDataDecimal("AmountMax");
|
||||
public ColumnDataDecimal _AmountNet { get; } = new ColumnDataDecimal("AmountNet");
|
||||
public ColumnDataDecimal _AmountTax { get; } = new ColumnDataDecimal("AmountTax");
|
||||
public ColumnDataDecimal _AmountTot { get; } = new ColumnDataDecimal("AmountTot");
|
||||
public ColumnDataInt32Nullable _CurrencyId { get; } = new ColumnDataInt32Nullable("CurrencyId");
|
||||
public ColumnDataInt32Nullable _TaxCodeId { get; } = new ColumnDataInt32Nullable("TaxCodeId");
|
||||
public ColumnDataDecimalNullable _AmountEst { get; } = new ColumnDataDecimalNullable("AmountEst");
|
||||
public ColumnDataDecimalNullable _AmountMax { get; } = new ColumnDataDecimalNullable("AmountMax");
|
||||
public ColumnDataDecimalNullable _AmountNet { get; } = new ColumnDataDecimalNullable("AmountNet");
|
||||
public ColumnDataDecimalNullable _AmountTax { get; } = new ColumnDataDecimalNullable("AmountTax");
|
||||
public ColumnDataDecimalNullable _AmountTot { get; } = new ColumnDataDecimalNullable("AmountTot");
|
||||
public ColumnDataString _TimeEstChunks { get; } = new ColumnDataString("TimeEstChunks");
|
||||
public ColumnDataDecimal _TimeEst { get; } = new ColumnDataDecimal("TimeEst");
|
||||
public ColumnDataDecimalNullable _TimeEst { get; } = new ColumnDataDecimalNullable("TimeEst");
|
||||
public ColumnDataString _TimeActChunks { get; } = new ColumnDataString("TimeActChunks");
|
||||
public ColumnDataDecimal _TimeAct { get; } = new ColumnDataDecimal("TimeAct");
|
||||
public ColumnDataDecimal _TimeTot { get; } = new ColumnDataDecimal("TimeTot");
|
||||
public ColumnDataInt32 _LocationIdStock { get; } = new ColumnDataInt32("LocationIdStock");
|
||||
public ColumnDataDecimal _Weight { get; } = new ColumnDataDecimal("Weight");
|
||||
public ColumnDataInt32 _UomIdWeight { get; } = new ColumnDataInt32("UomIdWeight");
|
||||
public ColumnDataDecimalNullable _TimeAct { get; } = new ColumnDataDecimalNullable("TimeAct");
|
||||
public ColumnDataDecimalNullable _TimeTot { get; } = new ColumnDataDecimalNullable("TimeTot");
|
||||
public ColumnDataInt32Nullable _LocationIdStock { get; } = new ColumnDataInt32Nullable("LocationIdStock");
|
||||
public ColumnDataDecimalNullable _Weight { get; } = new ColumnDataDecimalNullable("Weight");
|
||||
public ColumnDataInt32Nullable _UomIdWeight { get; } = new ColumnDataInt32Nullable("UomIdWeight");
|
||||
public ColumnDataString _BoxCount { get; } = new ColumnDataString("BoxCount");
|
||||
public ColumnDataString _DeliveryStatusCode { get; } = new ColumnDataString("DeliveryStatusCode");
|
||||
public ColumnDataString _DeliveryTypeCode { get; } = new ColumnDataString("DeliveryTypeCode");
|
||||
@@ -75,22 +76,22 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public ColumnDataString _StockPickerCode { get; } = new ColumnDataString("StockPickerCode");
|
||||
public ColumnDataString _DeliveryRef { get; } = new ColumnDataString("DeliveryRef");
|
||||
public ColumnDataString _DeliveryComment { get; } = new ColumnDataString("DeliveryComment");
|
||||
public ColumnDataDecimal _DeliveryAmountNet { get; } = new ColumnDataDecimal("DeliveryAmountNet");
|
||||
public ColumnDataInt32 _TaxCodeIdDelivery { get; } = new ColumnDataInt32("TaxCodeIdDelivery");
|
||||
public ColumnDataDecimal _DeliveryAmountTax { get; } = new ColumnDataDecimal("DeliveryAmountTax");
|
||||
public ColumnDataDecimal _DeliveryAmountTot { get; } = new ColumnDataDecimal("DeliveryAmountTot");
|
||||
public ColumnDataDecimalNullable _DeliveryAmountNet { get; } = new ColumnDataDecimalNullable("DeliveryAmountNet");
|
||||
public ColumnDataInt32Nullable _TaxCodeIdDelivery { get; } = new ColumnDataInt32Nullable("TaxCodeIdDelivery");
|
||||
public ColumnDataDecimalNullable _DeliveryAmountTax { get; } = new ColumnDataDecimalNullable("DeliveryAmountTax");
|
||||
public ColumnDataDecimalNullable _DeliveryAmountTot { get; } = new ColumnDataDecimalNullable("DeliveryAmountTot");
|
||||
public ColumnDataString _DeliveryDepartment { get; } = new ColumnDataString("DeliveryDepartment");
|
||||
public ColumnDataString _DeliveryNominalCode { get; } = new ColumnDataString("DeliveryNominalCode");
|
||||
public ColumnDataDecimal _CostLabourRateHour { get; } = new ColumnDataDecimal("CostLabourRateHour");
|
||||
public ColumnDataDecimalNullable _CostLabourRateHour { get; } = new ColumnDataDecimalNullable("CostLabourRateHour");
|
||||
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
|
||||
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
|
||||
public ColumnDataInt16Nullable _Flags { get; } = new ColumnDataInt16Nullable("Flags");
|
||||
public ColumnDataString _StatusCat { get; } = new ColumnDataString("StatusCat");
|
||||
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
|
||||
public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn");
|
||||
public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy");
|
||||
public ColumnDataDateTimeNullable _CreateOn { get; } = new ColumnDataDateTimeNullable("CreateOn");
|
||||
public ColumnDataInt32Nullable _CreateBy { get; } = new ColumnDataInt32Nullable("CreateBy");
|
||||
public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost");
|
||||
public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn");
|
||||
public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy");
|
||||
public ColumnDataDateTimeNullable _UpdateOn { get; } = new ColumnDataDateTimeNullable("UpdateOn");
|
||||
public ColumnDataInt32Nullable _UpdateBy { get; } = new ColumnDataInt32Nullable("UpdateBy");
|
||||
public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost");
|
||||
}
|
||||
|
||||
@@ -179,6 +180,79 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
"Id",
|
||||
};
|
||||
protected static List<String> fieldsNullable { get; } = new List<String>()
|
||||
{
|
||||
"AffIdOwner",
|
||||
"Type",
|
||||
"Ref",
|
||||
"RefInt",
|
||||
"RefExt",
|
||||
"RaisedBy",
|
||||
"AffIdRaise",
|
||||
"AssocIdOffice",
|
||||
"ContactName",
|
||||
"Likelihood",
|
||||
"TransIdSource",
|
||||
"ReferCode",
|
||||
"ReferSource",
|
||||
"AffIdRefer",
|
||||
"AssocIdContract",
|
||||
"AssIdDeliver",
|
||||
"Raised",
|
||||
"Required",
|
||||
"InProgress",
|
||||
"DeliveredEst",
|
||||
"DeliveredAct",
|
||||
"Closed",
|
||||
"Department",
|
||||
"DescBrief",
|
||||
"DescIntro",
|
||||
"DescOutline",
|
||||
"DescDetail",
|
||||
"ResponseCode",
|
||||
"ContactAreaCode",
|
||||
"Postcode",
|
||||
"CurrencyId",
|
||||
"TaxCodeId",
|
||||
"AmountEst",
|
||||
"AmountMax",
|
||||
"AmountNet",
|
||||
"AmountTax",
|
||||
"AmountTot",
|
||||
"TimeEstChunks",
|
||||
"TimeEst",
|
||||
"TimeActChunks",
|
||||
"TimeAct",
|
||||
"TimeTot",
|
||||
"LocationIdStock",
|
||||
"Weight",
|
||||
"UomIdWeight",
|
||||
"BoxCount",
|
||||
"DeliveryStatusCode",
|
||||
"DeliveryTypeCode",
|
||||
"DeliveryMethodCode",
|
||||
"DeliveryCourierCode",
|
||||
"DeliveryBookInCode",
|
||||
"StockPickerCode",
|
||||
"DeliveryRef",
|
||||
"DeliveryComment",
|
||||
"DeliveryAmountNet",
|
||||
"TaxCodeIdDelivery",
|
||||
"DeliveryAmountTax",
|
||||
"DeliveryAmountTot",
|
||||
"DeliveryDepartment",
|
||||
"DeliveryNominalCode",
|
||||
"CostLabourRateHour",
|
||||
"Notes",
|
||||
"Flags",
|
||||
"StatusCat",
|
||||
"CreateOn",
|
||||
"CreateBy",
|
||||
"CreateHost",
|
||||
"UpdateOn",
|
||||
"UpdateBy",
|
||||
"UpdateHost",
|
||||
};
|
||||
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
|
||||
{
|
||||
"CreateOn",
|
||||
@@ -203,29 +277,29 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
// Columns.
|
||||
public ColumnsData Cols { get; } = new ColumnsData();
|
||||
public Int32 _Id { get { return Cols._Id.Value; } set { Cols._Id.Value = value; } }
|
||||
public Int32 _AffIdOwner { get { return Cols._AffIdOwner.Value; } set { Cols._AffIdOwner.Value = value; } }
|
||||
public Int32? _AffIdOwner { get { return Cols._AffIdOwner.Value; } set { Cols._AffIdOwner.Value = value; } }
|
||||
public Int32 _AssocId { get { return Cols._AssocId.Value; } set { Cols._AssocId.Value = value; } }
|
||||
public Int16 _Type { get { return Cols._Type.Value; } set { Cols._Type.Value = value; } }
|
||||
public Int16? _Type { get { return Cols._Type.Value; } set { Cols._Type.Value = value; } }
|
||||
public String _Ref { get { return Cols._Ref.Value; } set { Cols._Ref.Value = value; } }
|
||||
public Int32 _RefInt { get { return Cols._RefInt.Value; } set { Cols._RefInt.Value = value; } }
|
||||
public Int32? _RefInt { get { return Cols._RefInt.Value; } set { Cols._RefInt.Value = value; } }
|
||||
public String _RefExt { get { return Cols._RefExt.Value; } set { Cols._RefExt.Value = value; } }
|
||||
public String _RaisedBy { get { return Cols._RaisedBy.Value; } set { Cols._RaisedBy.Value = value; } }
|
||||
public Int32 _AffIdRaise { get { return Cols._AffIdRaise.Value; } set { Cols._AffIdRaise.Value = value; } }
|
||||
public Int32 _AssocIdOffice { get { return Cols._AssocIdOffice.Value; } set { Cols._AssocIdOffice.Value = value; } }
|
||||
public Int32? _AffIdRaise { get { return Cols._AffIdRaise.Value; } set { Cols._AffIdRaise.Value = value; } }
|
||||
public Int32? _AssocIdOffice { get { return Cols._AssocIdOffice.Value; } set { Cols._AssocIdOffice.Value = value; } }
|
||||
public String _ContactName { get { return Cols._ContactName.Value; } set { Cols._ContactName.Value = value; } }
|
||||
public String _Likelihood { get { return Cols._Likelihood.Value; } set { Cols._Likelihood.Value = value; } }
|
||||
public Int32 _TransIdSource { get { return Cols._TransIdSource.Value; } set { Cols._TransIdSource.Value = value; } }
|
||||
public Int32? _TransIdSource { get { return Cols._TransIdSource.Value; } set { Cols._TransIdSource.Value = value; } }
|
||||
public String _ReferCode { get { return Cols._ReferCode.Value; } set { Cols._ReferCode.Value = value; } }
|
||||
public String _ReferSource { get { return Cols._ReferSource.Value; } set { Cols._ReferSource.Value = value; } }
|
||||
public Int32 _AffIdRefer { get { return Cols._AffIdRefer.Value; } set { Cols._AffIdRefer.Value = value; } }
|
||||
public Int32 _AssocIdContract { get { return Cols._AssocIdContract.Value; } set { Cols._AssocIdContract.Value = value; } }
|
||||
public Int32 _AssIdDeliver { get { return Cols._AssIdDeliver.Value; } set { Cols._AssIdDeliver.Value = value; } }
|
||||
public DateTime _Raised { get { return Cols._Raised.Value; } set { Cols._Raised.Value = value; } }
|
||||
public DateTime _Required { get { return Cols._Required.Value; } set { Cols._Required.Value = value; } }
|
||||
public DateTime _InProgress { get { return Cols._InProgress.Value; } set { Cols._InProgress.Value = value; } }
|
||||
public DateTime _DeliveredEst { get { return Cols._DeliveredEst.Value; } set { Cols._DeliveredEst.Value = value; } }
|
||||
public DateTime _DeliveredAct { get { return Cols._DeliveredAct.Value; } set { Cols._DeliveredAct.Value = value; } }
|
||||
public DateTime _Closed { get { return Cols._Closed.Value; } set { Cols._Closed.Value = value; } }
|
||||
public Int32? _AffIdRefer { get { return Cols._AffIdRefer.Value; } set { Cols._AffIdRefer.Value = value; } }
|
||||
public Int32? _AssocIdContract { get { return Cols._AssocIdContract.Value; } set { Cols._AssocIdContract.Value = value; } }
|
||||
public Int32? _AssIdDeliver { get { return Cols._AssIdDeliver.Value; } set { Cols._AssIdDeliver.Value = value; } }
|
||||
public DateTime? _Raised { get { return Cols._Raised.Value; } set { Cols._Raised.Value = value; } }
|
||||
public DateTime? _Required { get { return Cols._Required.Value; } set { Cols._Required.Value = value; } }
|
||||
public DateTime? _InProgress { get { return Cols._InProgress.Value; } set { Cols._InProgress.Value = value; } }
|
||||
public DateTime? _DeliveredEst { get { return Cols._DeliveredEst.Value; } set { Cols._DeliveredEst.Value = value; } }
|
||||
public DateTime? _DeliveredAct { get { return Cols._DeliveredAct.Value; } set { Cols._DeliveredAct.Value = value; } }
|
||||
public DateTime? _Closed { get { return Cols._Closed.Value; } set { Cols._Closed.Value = value; } }
|
||||
public String _Department { get { return Cols._Department.Value; } set { Cols._Department.Value = value; } }
|
||||
public String _DescBrief { get { return Cols._DescBrief.Value; } set { Cols._DescBrief.Value = value; } }
|
||||
public String _DescIntro { get { return Cols._DescIntro.Value; } set { Cols._DescIntro.Value = value; } }
|
||||
@@ -234,21 +308,21 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public String _ResponseCode { get { return Cols._ResponseCode.Value; } set { Cols._ResponseCode.Value = value; } }
|
||||
public String _ContactAreaCode { get { return Cols._ContactAreaCode.Value; } set { Cols._ContactAreaCode.Value = value; } }
|
||||
public String _Postcode { get { return Cols._Postcode.Value; } set { Cols._Postcode.Value = value; } }
|
||||
public Int32 _CurrencyId { get { return Cols._CurrencyId.Value; } set { Cols._CurrencyId.Value = value; } }
|
||||
public Int32 _TaxCodeId { get { return Cols._TaxCodeId.Value; } set { Cols._TaxCodeId.Value = value; } }
|
||||
public Decimal _AmountEst { get { return Cols._AmountEst.Value; } set { Cols._AmountEst.Value = value; } }
|
||||
public Decimal _AmountMax { get { return Cols._AmountMax.Value; } set { Cols._AmountMax.Value = value; } }
|
||||
public Decimal _AmountNet { get { return Cols._AmountNet.Value; } set { Cols._AmountNet.Value = value; } }
|
||||
public Decimal _AmountTax { get { return Cols._AmountTax.Value; } set { Cols._AmountTax.Value = value; } }
|
||||
public Decimal _AmountTot { get { return Cols._AmountTot.Value; } set { Cols._AmountTot.Value = value; } }
|
||||
public Int32? _CurrencyId { get { return Cols._CurrencyId.Value; } set { Cols._CurrencyId.Value = value; } }
|
||||
public Int32? _TaxCodeId { get { return Cols._TaxCodeId.Value; } set { Cols._TaxCodeId.Value = value; } }
|
||||
public Decimal? _AmountEst { get { return Cols._AmountEst.Value; } set { Cols._AmountEst.Value = value; } }
|
||||
public Decimal? _AmountMax { get { return Cols._AmountMax.Value; } set { Cols._AmountMax.Value = value; } }
|
||||
public Decimal? _AmountNet { get { return Cols._AmountNet.Value; } set { Cols._AmountNet.Value = value; } }
|
||||
public Decimal? _AmountTax { get { return Cols._AmountTax.Value; } set { Cols._AmountTax.Value = value; } }
|
||||
public Decimal? _AmountTot { get { return Cols._AmountTot.Value; } set { Cols._AmountTot.Value = value; } }
|
||||
public String _TimeEstChunks { get { return Cols._TimeEstChunks.Value; } set { Cols._TimeEstChunks.Value = value; } }
|
||||
public Decimal _TimeEst { get { return Cols._TimeEst.Value; } set { Cols._TimeEst.Value = value; } }
|
||||
public Decimal? _TimeEst { get { return Cols._TimeEst.Value; } set { Cols._TimeEst.Value = value; } }
|
||||
public String _TimeActChunks { get { return Cols._TimeActChunks.Value; } set { Cols._TimeActChunks.Value = value; } }
|
||||
public Decimal _TimeAct { get { return Cols._TimeAct.Value; } set { Cols._TimeAct.Value = value; } }
|
||||
public Decimal _TimeTot { get { return Cols._TimeTot.Value; } set { Cols._TimeTot.Value = value; } }
|
||||
public Int32 _LocationIdStock { get { return Cols._LocationIdStock.Value; } set { Cols._LocationIdStock.Value = value; } }
|
||||
public Decimal _Weight { get { return Cols._Weight.Value; } set { Cols._Weight.Value = value; } }
|
||||
public Int32 _UomIdWeight { get { return Cols._UomIdWeight.Value; } set { Cols._UomIdWeight.Value = value; } }
|
||||
public Decimal? _TimeAct { get { return Cols._TimeAct.Value; } set { Cols._TimeAct.Value = value; } }
|
||||
public Decimal? _TimeTot { get { return Cols._TimeTot.Value; } set { Cols._TimeTot.Value = value; } }
|
||||
public Int32? _LocationIdStock { get { return Cols._LocationIdStock.Value; } set { Cols._LocationIdStock.Value = value; } }
|
||||
public Decimal? _Weight { get { return Cols._Weight.Value; } set { Cols._Weight.Value = value; } }
|
||||
public Int32? _UomIdWeight { get { return Cols._UomIdWeight.Value; } set { Cols._UomIdWeight.Value = value; } }
|
||||
public String _BoxCount { get { return Cols._BoxCount.Value; } set { Cols._BoxCount.Value = value; } }
|
||||
public String _DeliveryStatusCode { get { return Cols._DeliveryStatusCode.Value; } set { Cols._DeliveryStatusCode.Value = value; } }
|
||||
public String _DeliveryTypeCode { get { return Cols._DeliveryTypeCode.Value; } set { Cols._DeliveryTypeCode.Value = value; } }
|
||||
@@ -258,26 +332,27 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public String _StockPickerCode { get { return Cols._StockPickerCode.Value; } set { Cols._StockPickerCode.Value = value; } }
|
||||
public String _DeliveryRef { get { return Cols._DeliveryRef.Value; } set { Cols._DeliveryRef.Value = value; } }
|
||||
public String _DeliveryComment { get { return Cols._DeliveryComment.Value; } set { Cols._DeliveryComment.Value = value; } }
|
||||
public Decimal _DeliveryAmountNet { get { return Cols._DeliveryAmountNet.Value; } set { Cols._DeliveryAmountNet.Value = value; } }
|
||||
public Int32 _TaxCodeIdDelivery { get { return Cols._TaxCodeIdDelivery.Value; } set { Cols._TaxCodeIdDelivery.Value = value; } }
|
||||
public Decimal _DeliveryAmountTax { get { return Cols._DeliveryAmountTax.Value; } set { Cols._DeliveryAmountTax.Value = value; } }
|
||||
public Decimal _DeliveryAmountTot { get { return Cols._DeliveryAmountTot.Value; } set { Cols._DeliveryAmountTot.Value = value; } }
|
||||
public Decimal? _DeliveryAmountNet { get { return Cols._DeliveryAmountNet.Value; } set { Cols._DeliveryAmountNet.Value = value; } }
|
||||
public Int32? _TaxCodeIdDelivery { get { return Cols._TaxCodeIdDelivery.Value; } set { Cols._TaxCodeIdDelivery.Value = value; } }
|
||||
public Decimal? _DeliveryAmountTax { get { return Cols._DeliveryAmountTax.Value; } set { Cols._DeliveryAmountTax.Value = value; } }
|
||||
public Decimal? _DeliveryAmountTot { get { return Cols._DeliveryAmountTot.Value; } set { Cols._DeliveryAmountTot.Value = value; } }
|
||||
public String _DeliveryDepartment { get { return Cols._DeliveryDepartment.Value; } set { Cols._DeliveryDepartment.Value = value; } }
|
||||
public String _DeliveryNominalCode { get { return Cols._DeliveryNominalCode.Value; } set { Cols._DeliveryNominalCode.Value = value; } }
|
||||
public Decimal _CostLabourRateHour { get { return Cols._CostLabourRateHour.Value; } set { Cols._CostLabourRateHour.Value = value; } }
|
||||
public Decimal? _CostLabourRateHour { get { return Cols._CostLabourRateHour.Value; } set { Cols._CostLabourRateHour.Value = value; } }
|
||||
public String _Notes { get { return Cols._Notes.Value; } set { Cols._Notes.Value = value; } }
|
||||
public Int16 _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public Int16? _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public String _StatusCat { get { return Cols._StatusCat.Value; } set { Cols._StatusCat.Value = value; } }
|
||||
public String _Status { get { return Cols._Status.Value; } set { Cols._Status.Value = value; } }
|
||||
public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public DateTime? _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32? _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } }
|
||||
public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public DateTime? _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32? _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } }
|
||||
// Existing columns - confirmed on database if table exists.
|
||||
public List<String> ExistingColumnNames { get { return GetExistingColumnNames(Fields); } }
|
||||
public List<String> ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } }
|
||||
public List<String> UpdatableColumns { get { return ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Population.
|
||||
@@ -297,29 +372,29 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public override void PopulateFrom (DbDataReader dbDataReader)
|
||||
{
|
||||
_Id = GetFieldInt32(dbDataReader, "Id", _Id);
|
||||
_AffIdOwner = GetFieldInt32(dbDataReader, "AffIdOwner", _AffIdOwner);
|
||||
_AffIdOwner = GetFieldInt32Nullable(dbDataReader, "AffIdOwner", _AffIdOwner);
|
||||
_AssocId = GetFieldInt32(dbDataReader, "AssocId", _AssocId);
|
||||
_Type = GetFieldInt16(dbDataReader, "Type", _Type);
|
||||
_Type = GetFieldInt16Nullable(dbDataReader, "Type", _Type);
|
||||
_Ref = GetFieldString(dbDataReader, "Ref", _Ref);
|
||||
_RefInt = GetFieldInt32(dbDataReader, "RefInt", _RefInt);
|
||||
_RefInt = GetFieldInt32Nullable(dbDataReader, "RefInt", _RefInt);
|
||||
_RefExt = GetFieldString(dbDataReader, "RefExt", _RefExt);
|
||||
_RaisedBy = GetFieldString(dbDataReader, "RaisedBy", _RaisedBy);
|
||||
_AffIdRaise = GetFieldInt32(dbDataReader, "AffIdRaise", _AffIdRaise);
|
||||
_AssocIdOffice = GetFieldInt32(dbDataReader, "AssocIdOffice", _AssocIdOffice);
|
||||
_AffIdRaise = GetFieldInt32Nullable(dbDataReader, "AffIdRaise", _AffIdRaise);
|
||||
_AssocIdOffice = GetFieldInt32Nullable(dbDataReader, "AssocIdOffice", _AssocIdOffice);
|
||||
_ContactName = GetFieldString(dbDataReader, "ContactName", _ContactName);
|
||||
_Likelihood = GetFieldString(dbDataReader, "Likelihood", _Likelihood);
|
||||
_TransIdSource = GetFieldInt32(dbDataReader, "TransIdSource", _TransIdSource);
|
||||
_TransIdSource = GetFieldInt32Nullable(dbDataReader, "TransIdSource", _TransIdSource);
|
||||
_ReferCode = GetFieldString(dbDataReader, "ReferCode", _ReferCode);
|
||||
_ReferSource = GetFieldString(dbDataReader, "ReferSource", _ReferSource);
|
||||
_AffIdRefer = GetFieldInt32(dbDataReader, "AffIdRefer", _AffIdRefer);
|
||||
_AssocIdContract = GetFieldInt32(dbDataReader, "AssocIdContract", _AssocIdContract);
|
||||
_AssIdDeliver = GetFieldInt32(dbDataReader, "AssIdDeliver", _AssIdDeliver);
|
||||
_Raised = GetFieldDateTime(dbDataReader, "Raised", _Raised);
|
||||
_Required = GetFieldDateTime(dbDataReader, "Required", _Required);
|
||||
_InProgress = GetFieldDateTime(dbDataReader, "InProgress", _InProgress);
|
||||
_DeliveredEst = GetFieldDateTime(dbDataReader, "DeliveredEst", _DeliveredEst);
|
||||
_DeliveredAct = GetFieldDateTime(dbDataReader, "DeliveredAct", _DeliveredAct);
|
||||
_Closed = GetFieldDateTime(dbDataReader, "Closed", _Closed);
|
||||
_AffIdRefer = GetFieldInt32Nullable(dbDataReader, "AffIdRefer", _AffIdRefer);
|
||||
_AssocIdContract = GetFieldInt32Nullable(dbDataReader, "AssocIdContract", _AssocIdContract);
|
||||
_AssIdDeliver = GetFieldInt32Nullable(dbDataReader, "AssIdDeliver", _AssIdDeliver);
|
||||
_Raised = GetFieldDateTimeNullable(dbDataReader, "Raised", _Raised);
|
||||
_Required = GetFieldDateTimeNullable(dbDataReader, "Required", _Required);
|
||||
_InProgress = GetFieldDateTimeNullable(dbDataReader, "InProgress", _InProgress);
|
||||
_DeliveredEst = GetFieldDateTimeNullable(dbDataReader, "DeliveredEst", _DeliveredEst);
|
||||
_DeliveredAct = GetFieldDateTimeNullable(dbDataReader, "DeliveredAct", _DeliveredAct);
|
||||
_Closed = GetFieldDateTimeNullable(dbDataReader, "Closed", _Closed);
|
||||
_Department = GetFieldString(dbDataReader, "Department", _Department);
|
||||
_DescBrief = GetFieldString(dbDataReader, "DescBrief", _DescBrief);
|
||||
_DescIntro = GetFieldString(dbDataReader, "DescIntro", _DescIntro);
|
||||
@@ -328,21 +403,21 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
_ResponseCode = GetFieldString(dbDataReader, "ResponseCode", _ResponseCode);
|
||||
_ContactAreaCode = GetFieldString(dbDataReader, "ContactAreaCode", _ContactAreaCode);
|
||||
_Postcode = GetFieldString(dbDataReader, "Postcode", _Postcode);
|
||||
_CurrencyId = GetFieldInt32(dbDataReader, "CurrencyId", _CurrencyId);
|
||||
_TaxCodeId = GetFieldInt32(dbDataReader, "TaxCodeId", _TaxCodeId);
|
||||
_AmountEst = GetFieldDecimal(dbDataReader, "AmountEst", _AmountEst);
|
||||
_AmountMax = GetFieldDecimal(dbDataReader, "AmountMax", _AmountMax);
|
||||
_AmountNet = GetFieldDecimal(dbDataReader, "AmountNet", _AmountNet);
|
||||
_AmountTax = GetFieldDecimal(dbDataReader, "AmountTax", _AmountTax);
|
||||
_AmountTot = GetFieldDecimal(dbDataReader, "AmountTot", _AmountTot);
|
||||
_CurrencyId = GetFieldInt32Nullable(dbDataReader, "CurrencyId", _CurrencyId);
|
||||
_TaxCodeId = GetFieldInt32Nullable(dbDataReader, "TaxCodeId", _TaxCodeId);
|
||||
_AmountEst = GetFieldDecimalNullable(dbDataReader, "AmountEst", _AmountEst);
|
||||
_AmountMax = GetFieldDecimalNullable(dbDataReader, "AmountMax", _AmountMax);
|
||||
_AmountNet = GetFieldDecimalNullable(dbDataReader, "AmountNet", _AmountNet);
|
||||
_AmountTax = GetFieldDecimalNullable(dbDataReader, "AmountTax", _AmountTax);
|
||||
_AmountTot = GetFieldDecimalNullable(dbDataReader, "AmountTot", _AmountTot);
|
||||
_TimeEstChunks = GetFieldString(dbDataReader, "TimeEstChunks", _TimeEstChunks);
|
||||
_TimeEst = GetFieldDecimal(dbDataReader, "TimeEst", _TimeEst);
|
||||
_TimeEst = GetFieldDecimalNullable(dbDataReader, "TimeEst", _TimeEst);
|
||||
_TimeActChunks = GetFieldString(dbDataReader, "TimeActChunks", _TimeActChunks);
|
||||
_TimeAct = GetFieldDecimal(dbDataReader, "TimeAct", _TimeAct);
|
||||
_TimeTot = GetFieldDecimal(dbDataReader, "TimeTot", _TimeTot);
|
||||
_LocationIdStock = GetFieldInt32(dbDataReader, "LocationIdStock", _LocationIdStock);
|
||||
_Weight = GetFieldDecimal(dbDataReader, "Weight", _Weight);
|
||||
_UomIdWeight = GetFieldInt32(dbDataReader, "UomIdWeight", _UomIdWeight);
|
||||
_TimeAct = GetFieldDecimalNullable(dbDataReader, "TimeAct", _TimeAct);
|
||||
_TimeTot = GetFieldDecimalNullable(dbDataReader, "TimeTot", _TimeTot);
|
||||
_LocationIdStock = GetFieldInt32Nullable(dbDataReader, "LocationIdStock", _LocationIdStock);
|
||||
_Weight = GetFieldDecimalNullable(dbDataReader, "Weight", _Weight);
|
||||
_UomIdWeight = GetFieldInt32Nullable(dbDataReader, "UomIdWeight", _UomIdWeight);
|
||||
_BoxCount = GetFieldString(dbDataReader, "BoxCount", _BoxCount);
|
||||
_DeliveryStatusCode = GetFieldString(dbDataReader, "DeliveryStatusCode", _DeliveryStatusCode);
|
||||
_DeliveryTypeCode = GetFieldString(dbDataReader, "DeliveryTypeCode", _DeliveryTypeCode);
|
||||
@@ -352,22 +427,22 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
_StockPickerCode = GetFieldString(dbDataReader, "StockPickerCode", _StockPickerCode);
|
||||
_DeliveryRef = GetFieldString(dbDataReader, "DeliveryRef", _DeliveryRef);
|
||||
_DeliveryComment = GetFieldString(dbDataReader, "DeliveryComment", _DeliveryComment);
|
||||
_DeliveryAmountNet = GetFieldDecimal(dbDataReader, "DeliveryAmountNet", _DeliveryAmountNet);
|
||||
_TaxCodeIdDelivery = GetFieldInt32(dbDataReader, "TaxCodeIdDelivery", _TaxCodeIdDelivery);
|
||||
_DeliveryAmountTax = GetFieldDecimal(dbDataReader, "DeliveryAmountTax", _DeliveryAmountTax);
|
||||
_DeliveryAmountTot = GetFieldDecimal(dbDataReader, "DeliveryAmountTot", _DeliveryAmountTot);
|
||||
_DeliveryAmountNet = GetFieldDecimalNullable(dbDataReader, "DeliveryAmountNet", _DeliveryAmountNet);
|
||||
_TaxCodeIdDelivery = GetFieldInt32Nullable(dbDataReader, "TaxCodeIdDelivery", _TaxCodeIdDelivery);
|
||||
_DeliveryAmountTax = GetFieldDecimalNullable(dbDataReader, "DeliveryAmountTax", _DeliveryAmountTax);
|
||||
_DeliveryAmountTot = GetFieldDecimalNullable(dbDataReader, "DeliveryAmountTot", _DeliveryAmountTot);
|
||||
_DeliveryDepartment = GetFieldString(dbDataReader, "DeliveryDepartment", _DeliveryDepartment);
|
||||
_DeliveryNominalCode = GetFieldString(dbDataReader, "DeliveryNominalCode", _DeliveryNominalCode);
|
||||
_CostLabourRateHour = GetFieldDecimal(dbDataReader, "CostLabourRateHour", _CostLabourRateHour);
|
||||
_CostLabourRateHour = GetFieldDecimalNullable(dbDataReader, "CostLabourRateHour", _CostLabourRateHour);
|
||||
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
|
||||
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
|
||||
_Flags = GetFieldInt16Nullable(dbDataReader, "Flags", _Flags);
|
||||
_StatusCat = GetFieldString(dbDataReader, "StatusCat", _StatusCat);
|
||||
_Status = GetFieldString(dbDataReader, "Status", _Status);
|
||||
_CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateOn = GetFieldDateTimeNullable(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32Nullable(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost);
|
||||
_UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateOn = GetFieldDateTimeNullable(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32Nullable(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost);
|
||||
}
|
||||
|
||||
@@ -472,10 +547,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update command.
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand)
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand, List<String> columnsToUpdate = null)
|
||||
{
|
||||
// Columns to update.
|
||||
List<String> columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList();
|
||||
List<String> columnNames = (columnsToUpdate?.Any() ?? false ? columnsToUpdate : UpdatableColumns).Where(col => UpdatableColumns.ContainsCI(col)).ToList();
|
||||
if (!columnNames.Any())
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} No columns to update. [{GetType().Name}]");
|
||||
return false;
|
||||
}
|
||||
// Construct query.
|
||||
String query = "UPDATE " + TableNameFmt + " SET ";
|
||||
if (dbCommand is SqlCommand)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
@@ -9,7 +10,7 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 6-Jun-2024 17:06:27
|
||||
// Code generated by Sarand Database Utilities Wed 4-Dec-2024 12:38:21
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
@@ -20,27 +21,27 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public class ColumnsData
|
||||
{
|
||||
public ColumnDataInt32 _Id { get; } = new ColumnDataInt32("Id");
|
||||
public ColumnDataInt16 _Category { get; } = new ColumnDataInt16("Category");
|
||||
public ColumnDataInt16 _Type { get; } = new ColumnDataInt16("Type");
|
||||
public ColumnDataInt16 _UnitType { get; } = new ColumnDataInt16("UnitType");
|
||||
public ColumnDataInt16Nullable _Category { get; } = new ColumnDataInt16Nullable("Category");
|
||||
public ColumnDataInt16Nullable _Type { get; } = new ColumnDataInt16Nullable("Type");
|
||||
public ColumnDataInt16Nullable _UnitType { get; } = new ColumnDataInt16Nullable("UnitType");
|
||||
public ColumnDataString _Code { get; } = new ColumnDataString("Code");
|
||||
public ColumnDataString _Abbr { get; } = new ColumnDataString("Abbr");
|
||||
public ColumnDataString _Single { get; } = new ColumnDataString("Single");
|
||||
public ColumnDataString _Multiple { get; } = new ColumnDataString("Multiple");
|
||||
public ColumnDataDecimal _EquValue { get; } = new ColumnDataDecimal("EquValue");
|
||||
public ColumnDataInt32 _UomIdEqu { get; } = new ColumnDataInt32("UomIdEqu");
|
||||
public ColumnDataInt32 _EquAlgorythm { get; } = new ColumnDataInt32("EquAlgorythm");
|
||||
public ColumnDataInt32 _UomIdRef1 { get; } = new ColumnDataInt32("UomIdRef1");
|
||||
public ColumnDataInt32 _UomIdRef2 { get; } = new ColumnDataInt32("UomIdRef2");
|
||||
public ColumnDataInt32 _UomIdRef3 { get; } = new ColumnDataInt32("UomIdRef3");
|
||||
public ColumnDataDecimalNullable _EquValue { get; } = new ColumnDataDecimalNullable("EquValue");
|
||||
public ColumnDataInt32Nullable _UomIdEqu { get; } = new ColumnDataInt32Nullable("UomIdEqu");
|
||||
public ColumnDataInt32Nullable _EquAlgorythm { get; } = new ColumnDataInt32Nullable("EquAlgorythm");
|
||||
public ColumnDataInt32Nullable _UomIdRef1 { get; } = new ColumnDataInt32Nullable("UomIdRef1");
|
||||
public ColumnDataInt32Nullable _UomIdRef2 { get; } = new ColumnDataInt32Nullable("UomIdRef2");
|
||||
public ColumnDataInt32Nullable _UomIdRef3 { get; } = new ColumnDataInt32Nullable("UomIdRef3");
|
||||
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
|
||||
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
|
||||
public ColumnDataInt16Nullable _Flags { get; } = new ColumnDataInt16Nullable("Flags");
|
||||
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
|
||||
public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn");
|
||||
public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy");
|
||||
public ColumnDataDateTimeNullable _CreateOn { get; } = new ColumnDataDateTimeNullable("CreateOn");
|
||||
public ColumnDataInt32Nullable _CreateBy { get; } = new ColumnDataInt32Nullable("CreateBy");
|
||||
public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost");
|
||||
public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn");
|
||||
public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy");
|
||||
public ColumnDataDateTimeNullable _UpdateOn { get; } = new ColumnDataDateTimeNullable("UpdateOn");
|
||||
public ColumnDataInt32Nullable _UpdateBy { get; } = new ColumnDataInt32Nullable("UpdateBy");
|
||||
public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost");
|
||||
}
|
||||
|
||||
@@ -79,6 +80,30 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
{
|
||||
"Id",
|
||||
};
|
||||
protected static List<String> fieldsNullable { get; } = new List<String>()
|
||||
{
|
||||
"Category",
|
||||
"Type",
|
||||
"UnitType",
|
||||
"Abbr",
|
||||
"Single",
|
||||
"Multiple",
|
||||
"EquValue",
|
||||
"UomIdEqu",
|
||||
"EquAlgorythm",
|
||||
"UomIdRef1",
|
||||
"UomIdRef2",
|
||||
"UomIdRef3",
|
||||
"Notes",
|
||||
"Flags",
|
||||
"Status",
|
||||
"CreateOn",
|
||||
"CreateBy",
|
||||
"CreateHost",
|
||||
"UpdateOn",
|
||||
"UpdateBy",
|
||||
"UpdateHost",
|
||||
};
|
||||
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
|
||||
{
|
||||
"CreateOn",
|
||||
@@ -103,31 +128,32 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
// Columns.
|
||||
public ColumnsData Cols { get; } = new ColumnsData();
|
||||
public Int32 _Id { get { return Cols._Id.Value; } set { Cols._Id.Value = value; } }
|
||||
public Int16 _Category { get { return Cols._Category.Value; } set { Cols._Category.Value = value; } }
|
||||
public Int16 _Type { get { return Cols._Type.Value; } set { Cols._Type.Value = value; } }
|
||||
public Int16 _UnitType { get { return Cols._UnitType.Value; } set { Cols._UnitType.Value = value; } }
|
||||
public Int16? _Category { get { return Cols._Category.Value; } set { Cols._Category.Value = value; } }
|
||||
public Int16? _Type { get { return Cols._Type.Value; } set { Cols._Type.Value = value; } }
|
||||
public Int16? _UnitType { get { return Cols._UnitType.Value; } set { Cols._UnitType.Value = value; } }
|
||||
public String _Code { get { return Cols._Code.Value; } set { Cols._Code.Value = value; } }
|
||||
public String _Abbr { get { return Cols._Abbr.Value; } set { Cols._Abbr.Value = value; } }
|
||||
public String _Single { get { return Cols._Single.Value; } set { Cols._Single.Value = value; } }
|
||||
public String _Multiple { get { return Cols._Multiple.Value; } set { Cols._Multiple.Value = value; } }
|
||||
public Decimal _EquValue { get { return Cols._EquValue.Value; } set { Cols._EquValue.Value = value; } }
|
||||
public Int32 _UomIdEqu { get { return Cols._UomIdEqu.Value; } set { Cols._UomIdEqu.Value = value; } }
|
||||
public Int32 _EquAlgorythm { get { return Cols._EquAlgorythm.Value; } set { Cols._EquAlgorythm.Value = value; } }
|
||||
public Int32 _UomIdRef1 { get { return Cols._UomIdRef1.Value; } set { Cols._UomIdRef1.Value = value; } }
|
||||
public Int32 _UomIdRef2 { get { return Cols._UomIdRef2.Value; } set { Cols._UomIdRef2.Value = value; } }
|
||||
public Int32 _UomIdRef3 { get { return Cols._UomIdRef3.Value; } set { Cols._UomIdRef3.Value = value; } }
|
||||
public Decimal? _EquValue { get { return Cols._EquValue.Value; } set { Cols._EquValue.Value = value; } }
|
||||
public Int32? _UomIdEqu { get { return Cols._UomIdEqu.Value; } set { Cols._UomIdEqu.Value = value; } }
|
||||
public Int32? _EquAlgorythm { get { return Cols._EquAlgorythm.Value; } set { Cols._EquAlgorythm.Value = value; } }
|
||||
public Int32? _UomIdRef1 { get { return Cols._UomIdRef1.Value; } set { Cols._UomIdRef1.Value = value; } }
|
||||
public Int32? _UomIdRef2 { get { return Cols._UomIdRef2.Value; } set { Cols._UomIdRef2.Value = value; } }
|
||||
public Int32? _UomIdRef3 { get { return Cols._UomIdRef3.Value; } set { Cols._UomIdRef3.Value = value; } }
|
||||
public String _Notes { get { return Cols._Notes.Value; } set { Cols._Notes.Value = value; } }
|
||||
public Int16 _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public Int16? _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public String _Status { get { return Cols._Status.Value; } set { Cols._Status.Value = value; } }
|
||||
public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public DateTime? _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32? _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } }
|
||||
public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public DateTime? _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32? _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } }
|
||||
// Existing columns - confirmed on database if table exists.
|
||||
public List<String> ExistingColumnNames { get { return GetExistingColumnNames(Fields); } }
|
||||
public List<String> ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } }
|
||||
public List<String> UpdatableColumns { get { return ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Population.
|
||||
@@ -147,27 +173,27 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
public override void PopulateFrom (DbDataReader dbDataReader)
|
||||
{
|
||||
_Id = GetFieldInt32(dbDataReader, "Id", _Id);
|
||||
_Category = GetFieldInt16(dbDataReader, "Category", _Category);
|
||||
_Type = GetFieldInt16(dbDataReader, "Type", _Type);
|
||||
_UnitType = GetFieldInt16(dbDataReader, "UnitType", _UnitType);
|
||||
_Category = GetFieldInt16Nullable(dbDataReader, "Category", _Category);
|
||||
_Type = GetFieldInt16Nullable(dbDataReader, "Type", _Type);
|
||||
_UnitType = GetFieldInt16Nullable(dbDataReader, "UnitType", _UnitType);
|
||||
_Code = GetFieldString(dbDataReader, "Code", _Code);
|
||||
_Abbr = GetFieldString(dbDataReader, "Abbr", _Abbr);
|
||||
_Single = GetFieldString(dbDataReader, "Single", _Single);
|
||||
_Multiple = GetFieldString(dbDataReader, "Multiple", _Multiple);
|
||||
_EquValue = GetFieldDecimal(dbDataReader, "EquValue", _EquValue);
|
||||
_UomIdEqu = GetFieldInt32(dbDataReader, "UomIdEqu", _UomIdEqu);
|
||||
_EquAlgorythm = GetFieldInt32(dbDataReader, "EquAlgorythm", _EquAlgorythm);
|
||||
_UomIdRef1 = GetFieldInt32(dbDataReader, "UomIdRef1", _UomIdRef1);
|
||||
_UomIdRef2 = GetFieldInt32(dbDataReader, "UomIdRef2", _UomIdRef2);
|
||||
_UomIdRef3 = GetFieldInt32(dbDataReader, "UomIdRef3", _UomIdRef3);
|
||||
_EquValue = GetFieldDecimalNullable(dbDataReader, "EquValue", _EquValue);
|
||||
_UomIdEqu = GetFieldInt32Nullable(dbDataReader, "UomIdEqu", _UomIdEqu);
|
||||
_EquAlgorythm = GetFieldInt32Nullable(dbDataReader, "EquAlgorythm", _EquAlgorythm);
|
||||
_UomIdRef1 = GetFieldInt32Nullable(dbDataReader, "UomIdRef1", _UomIdRef1);
|
||||
_UomIdRef2 = GetFieldInt32Nullable(dbDataReader, "UomIdRef2", _UomIdRef2);
|
||||
_UomIdRef3 = GetFieldInt32Nullable(dbDataReader, "UomIdRef3", _UomIdRef3);
|
||||
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
|
||||
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
|
||||
_Flags = GetFieldInt16Nullable(dbDataReader, "Flags", _Flags);
|
||||
_Status = GetFieldString(dbDataReader, "Status", _Status);
|
||||
_CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateOn = GetFieldDateTimeNullable(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32Nullable(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost);
|
||||
_UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateOn = GetFieldDateTimeNullable(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32Nullable(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost);
|
||||
}
|
||||
|
||||
@@ -222,10 +248,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update command.
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand)
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand, List<String> columnsToUpdate = null)
|
||||
{
|
||||
// Columns to update.
|
||||
List<String> columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList();
|
||||
List<String> columnNames = (columnsToUpdate?.Any() ?? false ? columnsToUpdate : UpdatableColumns).Where(col => UpdatableColumns.ContainsCI(col)).ToList();
|
||||
if (!columnNames.Any())
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} No columns to update. [{GetType().Name}]");
|
||||
return false;
|
||||
}
|
||||
// Construct query.
|
||||
String query = "UPDATE " + TableNameFmt + " SET ";
|
||||
if (dbCommand is SqlCommand)
|
||||
|
||||
@@ -323,8 +323,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
address.ContactHandlerCode = dbAddress._ContactHandlerCode;
|
||||
address.DeliveryTypeCode = dbAddress._DeliveryTypeCode;
|
||||
address.DeliveryBookInCode = dbAddress._DeliveryBookInCode;
|
||||
address.LastVisitOn = dbAddress._LastVisitOn;
|
||||
address.NextVisitOn = dbAddress._NextVisitOn;
|
||||
address.LastVisitOn = dbAddress._LastVisitOn ?? default(DateTime);
|
||||
address.NextVisitOn = dbAddress._NextVisitOn ?? default(DateTime);
|
||||
// Common properties.
|
||||
address.Notes = dbAddress._Notes;
|
||||
address.Status = SacsSystem.GetStatusForCode(dbAddress._Status);
|
||||
|
||||
@@ -329,7 +329,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
affiliate.Email = dbAffiliate._Email;
|
||||
affiliate.Website = dbAffiliate._Website;
|
||||
// Ogranisation.
|
||||
affiliate.AffiliateIdParent = new SysId(dbAffiliate._AffIdParent);
|
||||
affiliate.AffiliateIdParent = new SysId(dbAffiliate._AffIdParent ?? 0);
|
||||
affiliate.Name = dbAffiliate._Name;
|
||||
affiliate.Abbr = dbAffiliate._Abbrev;
|
||||
affiliate.Nature = dbAffiliate._Nature;
|
||||
@@ -344,19 +344,19 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
affiliate.LastName = dbAffiliate._LastName;
|
||||
affiliate.Salutation = dbAffiliate._Salutation;
|
||||
affiliate.PhoneMobile = dbAffiliate._PhoneMobile;
|
||||
affiliate.BirthDay = dbAffiliate._BirthDay;
|
||||
affiliate.BirthMonth = dbAffiliate._BirthMonth;
|
||||
affiliate.BirthYear = dbAffiliate._BirthYear;
|
||||
affiliate.BirthDay = dbAffiliate._BirthDay ?? 0;
|
||||
affiliate.BirthMonth = dbAffiliate._BirthMonth ?? 0;
|
||||
affiliate.BirthYear = dbAffiliate._BirthYear ?? 0;
|
||||
affiliate.MaritalStatus = dbAffiliate._MaritalStatus;
|
||||
affiliate.Spouse = dbAffiliate._Spouse;
|
||||
affiliate.Children = dbAffiliate._Children;
|
||||
affiliate.Hometown = dbAffiliate._Hometown;
|
||||
affiliate.UserId = new SysId(dbAffiliate._UserId);
|
||||
affiliate.UserId = new SysId(dbAffiliate._UserId ?? 0);
|
||||
// Common properties.
|
||||
affiliate.Notes = dbAffiliate._Notes;
|
||||
affiliate.Status = SacsSystem.GetStatusForCode(dbAffiliate._Status);
|
||||
affiliate.SetCreateStamp(dbAffiliate._CreateOn, new SysId(dbAffiliate._CreateBy), dbAffiliate._CreateHost);
|
||||
affiliate.SetUpdateStamp(dbAffiliate._UpdateOn, new SysId(dbAffiliate._UpdateBy), dbAffiliate._UpdateHost);
|
||||
affiliate.SetCreateStamp(dbAffiliate._CreateOn, new SysId(dbAffiliate._CreateBy ?? 0), dbAffiliate._CreateHost);
|
||||
affiliate.SetUpdateStamp(dbAffiliate._UpdateOn ?? default(DateTime), new SysId(dbAffiliate._UpdateBy ?? 0), dbAffiliate._UpdateHost);
|
||||
affiliate.AcceptChanges();
|
||||
}
|
||||
|
||||
@@ -552,7 +552,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
String colAffiliate_Type = SbmDbDfn.GetColumnNameQual(SbmDbDfn.ColumnIdx.Affiliate_Type, aliasAffiliate);
|
||||
// Affiliate type - Individual.
|
||||
if (prm.AffiliateType == Sbm.AffiliateType.AnyOrganisation)
|
||||
filter.Add($"{colAffiliate_Type}<>{(int)Sbm.AffiliateType.Individual}");
|
||||
filter.Add($"{colAffiliate_Type} Not In ({(int)Sbm.AffiliateType.Individual}, {(int)Sbm.AffiliateType.ContactGroup})");
|
||||
// Affiliate type - ContactGroup.
|
||||
else if (prm.AffiliateType == Sbm.AffiliateType.AnyContact)
|
||||
filter.Add($"{colAffiliate_Type}<>{(int)Sbm.AffiliateType.ContactGroup}");
|
||||
|
||||
@@ -529,33 +529,33 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
association.ContactHandlerCode = dbAssociation._ContactHandlerCode;
|
||||
association.ContactMethodCode = dbAssociation._ContactMethodCode;
|
||||
association.ContactCallCycleCode = dbAssociation._ContactCallCycleCode;
|
||||
association.CallsPerYear = dbAssociation._CallsPerYear;
|
||||
association.LastCall = dbAssociation._LastCall;
|
||||
association.CommodityIdSalesDefault = new SysId(dbAssociation._CommodityIdSalesDefault);
|
||||
association.CallsPerYear = dbAssociation._CallsPerYear ?? 0;
|
||||
association.LastCall = dbAssociation._LastCall ?? default(DateTime);
|
||||
association.CommodityIdSalesDefault = new SysId(dbAssociation._CommodityIdSalesDefault ?? 0);
|
||||
association.OrderLeadTimeCode = dbAssociation._OrderLeadTimeCode;
|
||||
association.DeliveryTypeCode = dbAssociation._DeliveryTypeCode;
|
||||
association.DeliveryCourierCode = dbAssociation._DeliveryCourierCode;
|
||||
association.DeliveryMethodCode = dbAssociation._DeliveryMethodCode;
|
||||
association.DeliveryBookInCode = dbAssociation._DeliveryBookInCode;
|
||||
/*----------------------------------------*/
|
||||
association.AmountTransMax = dbAssociation._AmountTransMax;
|
||||
association.AnnualSalesTarget = dbAssociation._AnnualSalesTarget;
|
||||
association.CreditLimit = dbAssociation._CreditLimit;
|
||||
association.AccountBalance = dbAssociation._AccountBalance;
|
||||
association.DiscountType = (Sbm.DiscountType)dbAssociation._DiscountType;
|
||||
association.DiscountRate = dbAssociation._DiscountRate;
|
||||
association.PriceSetId = new SysId(dbAssociation._PriceSetId);
|
||||
association.TaxCodeId = new SysId(dbAssociation._TaxCodeId);
|
||||
association.PaymentTerms = dbAssociation._PaymentTerms;
|
||||
association.AmountTransMax = dbAssociation._AmountTransMax ?? 0;
|
||||
association.AnnualSalesTarget = dbAssociation._AnnualSalesTarget ?? 0;
|
||||
association.CreditLimit = dbAssociation._CreditLimit ?? 0;
|
||||
association.AccountBalance = dbAssociation._AccountBalance ?? 0;
|
||||
association.DiscountType = (Sbm.DiscountType)(dbAssociation._DiscountType ?? 0);
|
||||
association.DiscountRate = dbAssociation._DiscountRate ?? 0;
|
||||
association.PriceSetId = new SysId(dbAssociation._PriceSetId ?? 0);
|
||||
association.TaxCodeId = new SysId(dbAssociation._TaxCodeId ?? 0);
|
||||
association.PaymentTerms = dbAssociation._PaymentTerms ?? 0;
|
||||
association.InvoiceDesc = dbAssociation._InvoiceDesc;
|
||||
if (dbAssociation._Terminated > 0)
|
||||
association.Terminated = new DateTime(dbAssociation._Terminated >> 16, (dbAssociation._Terminated >> 8) & 0xFF, dbAssociation._Terminated & 0xFF);
|
||||
association.Terminated = new DateTime(dbAssociation._Terminated ?? 0 >> 16, (dbAssociation._Terminated ?? 0 >> 8) & 0xFF, dbAssociation._Terminated ?? 0 & 0xFF);
|
||||
else association.Terminated = DateTime.MinValue;
|
||||
// Common properties.
|
||||
association.Notes = dbAssociation._Notes;
|
||||
association.Status = SacsSystem.GetStatusForCode(dbAssociation._Status);
|
||||
association.SetCreateStamp(dbAssociation._CreateOn, new SysId(dbAssociation._CreateBy), dbAssociation._CreateHost);
|
||||
association.SetUpdateStamp(dbAssociation._UpdateOn, new SysId(dbAssociation._UpdateBy), dbAssociation._UpdateHost);
|
||||
association.SetCreateStamp(dbAssociation._CreateOn, new SysId(dbAssociation._CreateBy ?? 0), dbAssociation._CreateHost);
|
||||
association.SetUpdateStamp(dbAssociation._UpdateOn ?? default(DateTime), new SysId(dbAssociation._UpdateBy ?? 0), dbAssociation._UpdateHost);
|
||||
association.AcceptChanges();
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
@@ -1374,10 +1374,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
|
||||
// Group.
|
||||
String colAssociation_Group = SbmDbDfn.GetColumnNameQual(SbmDbDfn.ColumnIdx.Association_Group, aliasAssociation);
|
||||
if (!prm.GroupFull.IsEmpty())
|
||||
filter.Add(colAssociation_Group + "='" + DbQuery.FormatForCondition(prm.GroupFull) + "'");
|
||||
else if (!prm.GroupPartial.IsEmpty())
|
||||
filter.Add(DbQuery.FormatFn_Left(colAssociation_Group, prm.GroupPartial.Length) + " Like '%" + DbQuery.FormatForLike(prm.GroupPartial) + "%'");
|
||||
if (ColumnExists(SbmDbDfn.ColumnIdx.Association_Group))
|
||||
{
|
||||
if (!prm.GroupFull.IsEmpty())
|
||||
filter.Add(colAssociation_Group + "='" + DbQuery.FormatForCondition(prm.GroupFull) + "'");
|
||||
else if (!prm.GroupPartial.IsEmpty())
|
||||
filter.Add(DbQuery.FormatFn_Left(colAssociation_Group, prm.GroupPartial.Length) + " Like '%" + DbQuery.FormatForLike(prm.GroupPartial) + "%'");
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// Target Name.
|
||||
@@ -1492,7 +1495,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
// Association filters.
|
||||
List<String> searchValueFilter = new List<string>();
|
||||
searchValueFilter.Add(colAssociation_Code + " LIKE '%" + searchValue + "%'");
|
||||
searchValueFilter.Add(colAssociation_Group + " LIKE '%" + searchValue + "%'");
|
||||
if (ColumnExists(SbmDbDfn.ColumnIdx.Association_Group))
|
||||
searchValueFilter.Add(colAssociation_Group + " LIKE '%" + searchValue + "%'");
|
||||
|
||||
// Target affiliate.
|
||||
String aliasAffiliateTarget = StringUtil.OnBlank(prm.Alias_Affiliate_Target, aliasAssociation_Affiliate_Target);
|
||||
@@ -1564,13 +1568,16 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// Default Nominal Code.
|
||||
String defaultNominalCodeFull = DbQuery.FormatForCondition(StringUtil.EmptyOnNull(prm.DefaultNominalCodeFull));
|
||||
String defaultNominalCodePartial = DbQuery.FormatForCondition(StringUtil.EmptyOnNull(prm.DefaultNominalCodePartial));
|
||||
String colAssociation_DefaultNominalCode = SbmDbDfn.GetColumnNameQual(SbmDbDfn.ColumnIdx.Association_DefaultNominalCode, aliasAssociation);
|
||||
if (!defaultNominalCodeFull.IsEmpty())
|
||||
filter.Add(colAssociation_DefaultNominalCode + "='" + DbQuery.FormatForCondition(defaultNominalCodeFull) + "'");
|
||||
else if (!defaultNominalCodePartial.IsEmpty())
|
||||
filter.Add(DbQuery.FormatFn_Left(colAssociation_DefaultNominalCode, prm.DefaultNominalCodePartial.Length) + " Like '%" + DbQuery.FormatForLike(defaultNominalCodePartial) + "%'");
|
||||
if (ColumnExists(SbmDbDfn.ColumnIdx.Association_DefaultNominalCode))
|
||||
{
|
||||
String defaultNominalCodeFull = DbQuery.FormatForCondition(StringUtil.EmptyOnNull(prm.DefaultNominalCodeFull));
|
||||
String defaultNominalCodePartial = DbQuery.FormatForCondition(StringUtil.EmptyOnNull(prm.DefaultNominalCodePartial));
|
||||
String colAssociation_DefaultNominalCode = SbmDbDfn.GetColumnNameQual(SbmDbDfn.ColumnIdx.Association_DefaultNominalCode, aliasAssociation);
|
||||
if (!defaultNominalCodeFull.IsEmpty())
|
||||
filter.Add(colAssociation_DefaultNominalCode + "='" + DbQuery.FormatForCondition(defaultNominalCodeFull) + "'");
|
||||
else if (!defaultNominalCodePartial.IsEmpty())
|
||||
filter.Add(DbQuery.FormatFn_Left(colAssociation_DefaultNominalCode, prm.DefaultNominalCodePartial.Length) + " Like '%" + DbQuery.FormatForLike(defaultNominalCodePartial) + "%'");
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// Price Set.
|
||||
@@ -1993,11 +2000,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
if (columns.HasId((int)SbmAssociation.Column.DescDetail))
|
||||
query.Columns.Add(SbmDbDfn.GetColumnNameQual(SbmDbDfn.ColumnIdx.Association_DescDetail, aliasAssociation));
|
||||
// Accounting columns.
|
||||
if (columns.HasId((int)SbmAssociation.Column.DefaultNominalCode))
|
||||
if (columns.HasId((int)SbmAssociation.Column.DefaultNominalCode) && ColumnExists(SbmDbDfn.ColumnIdx.Association_DefaultNominalCode))
|
||||
query.Columns.Add(SbmDbDfn.GetColumnNameQual(SbmDbDfn.ColumnIdx.Association_DefaultNominalCode, aliasAssociation));
|
||||
if (columns.HasId((int)SbmAssociation.Column.AmountTransMax) && CanManageFinancials)
|
||||
query.Columns.Add(SbmDbDfn.GetColumnNameQual(SbmDbDfn.ColumnIdx.Association_AmountTransMax, aliasAssociation));
|
||||
if (columns.HasId((int)SbmAssociation.Column.AnnualSalesTarget) && CanManageFinancials)
|
||||
if (columns.HasId((int)SbmAssociation.Column.AnnualSalesTarget) && CanManageFinancials && ColumnExists(SbmDbDfn.ColumnIdx.Association_AnnualSalesTarget))
|
||||
query.Columns.Add(SbmDbDfn.GetColumnNameQual(SbmDbDfn.ColumnIdx.Association_AnnualSalesTarget, aliasAssociation));
|
||||
if (columns.HasId((int)SbmAssociation.Column.CreditLimit))
|
||||
query.Columns.Add(SbmDbDfn.GetColumnNameQual(SbmDbDfn.ColumnIdx.Association_CreditLimit, aliasAssociation));
|
||||
|
||||
@@ -225,14 +225,14 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
sysparam.Category = (Sbm.SysParamCategory)dbSysParam._Cat;
|
||||
sysparam.Name = dbSysParam._Name;
|
||||
sysparam.Value = dbSysParam._Value;
|
||||
sysparam.AffiliateIdOwner = new SysId(dbSysParam._AffIdOwner);
|
||||
sysparam.AffiliateIdTarget = new SysId(dbSysParam._AffIdTarget);
|
||||
sysparam.AssociationId = new SysId(dbSysParam._AssocId);
|
||||
sysparam.AffiliateIdOwner = new SysId(dbSysParam._AffIdOwner ?? 0);
|
||||
sysparam.AffiliateIdTarget = new SysId(dbSysParam._AffIdTarget ?? 0);
|
||||
sysparam.AssociationId = new SysId(dbSysParam._AssocId ?? 0);
|
||||
// Common properties.
|
||||
//sysparam.Notes = dbSysParam._Notes;
|
||||
sysparam.Status = SacsSystem.GetStatusForCode(dbSysParam._Status);
|
||||
sysparam.SetCreateStamp(dbSysParam._CreateOn, new SysId(dbSysParam._CreateBy), dbSysParam._CreateHost);
|
||||
sysparam.SetUpdateStamp(dbSysParam._UpdateOn, new SysId(dbSysParam._UpdateBy), dbSysParam._UpdateHost);
|
||||
sysparam.SetCreateStamp(dbSysParam._CreateOn ?? default(DateTime), new SysId(dbSysParam._CreateBy ?? 0), dbSysParam._CreateHost);
|
||||
sysparam.SetUpdateStamp(dbSysParam._UpdateOn ?? default(DateTime), new SysId(dbSysParam._UpdateBy ?? 0), dbSysParam._UpdateHost);
|
||||
sysparam.AcceptChanges();
|
||||
}
|
||||
|
||||
@@ -332,7 +332,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
String colSysParam_Id = SbmDbDfn.GetColumnNameQual(SbmDbDfn.ColumnIdx.SysParam_Id, aliasSysParam);
|
||||
if (prm.IdsIncluded.HasValidIds())
|
||||
filter.Add($"{colSysParam_Id} IN ({prm.IdsIncluded.Concat(",")})");
|
||||
if (prm.IdsExcluded.HasValidIds() )
|
||||
if (prm.IdsExcluded.HasValidIds())
|
||||
filter.Add($"{colSysParam_Id} NOT IN ({prm.IdsExcluded.Concat(",")})");
|
||||
|
||||
// Category.
|
||||
|
||||
@@ -231,7 +231,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
{
|
||||
//systemAccount.Id = new SysId(dbSystemAccount._Id);
|
||||
systemAccount.AffiliateIdOwner = new SysId(dbSystemAccount._AffIdOwner);
|
||||
systemAccount.SystemAccountType = (Sbm.SystemAccountType)dbSystemAccount._Type;
|
||||
systemAccount.SystemAccountType = (Sbm.SystemAccountType)(dbSystemAccount._Type ?? 0);
|
||||
systemAccount.InterfaceId = new SysId(dbSystemAccount._InterfaceId);
|
||||
systemAccount.AssociationId = new SysId(dbSystemAccount._AssocId);
|
||||
systemAccount.Code = dbSystemAccount._Code;
|
||||
@@ -240,8 +240,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
// Common properties.
|
||||
systemAccount.Notes = dbSystemAccount._Notes;
|
||||
systemAccount.Status = SacsSystem.GetStatusForCode(dbSystemAccount._Status);
|
||||
systemAccount.SetCreateStamp(dbSystemAccount._CreateOn, new SysId(dbSystemAccount._CreateBy), dbSystemAccount._CreateHost);
|
||||
systemAccount.SetUpdateStamp(dbSystemAccount._UpdateOn, new SysId(dbSystemAccount._UpdateBy), dbSystemAccount._UpdateHost);
|
||||
systemAccount.SetCreateStamp(dbSystemAccount._CreateOn ?? default(DateTime), new SysId(dbSystemAccount._CreateBy ?? 0), dbSystemAccount._CreateHost);
|
||||
systemAccount.SetUpdateStamp(dbSystemAccount._UpdateOn ?? default(DateTime), new SysId(dbSystemAccount._UpdateBy ?? 0), dbSystemAccount._UpdateHost);
|
||||
systemAccount.AcceptChanges();
|
||||
}
|
||||
|
||||
|
||||
@@ -223,8 +223,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
// Common properties.
|
||||
systemAccountUser.Notes = dbSystemAccountUser._Notes;
|
||||
systemAccountUser.Status = SacsSystem.GetStatusForCode(dbSystemAccountUser._Status);
|
||||
systemAccountUser.SetCreateStamp(dbSystemAccountUser._CreateOn, new SysId(dbSystemAccountUser._CreateBy), dbSystemAccountUser._CreateHost);
|
||||
systemAccountUser.SetUpdateStamp(dbSystemAccountUser._UpdateOn, new SysId(dbSystemAccountUser._UpdateBy), dbSystemAccountUser._UpdateHost);
|
||||
systemAccountUser.SetCreateStamp(dbSystemAccountUser._CreateOn ?? default(DateTime), new SysId(dbSystemAccountUser._CreateBy ?? 0), dbSystemAccountUser._CreateHost);
|
||||
systemAccountUser.SetUpdateStamp(dbSystemAccountUser._UpdateOn ?? default(DateTime), new SysId(dbSystemAccountUser._UpdateBy ?? 0), dbSystemAccountUser._UpdateHost);
|
||||
systemAccountUser.AcceptChanges();
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
private SbmSystemUser_Dbas CreateSystemUser(SystemUser_Db dbSystemUser)
|
||||
{
|
||||
ClearErrorState();
|
||||
SbmSystemUser_Dbas systemUser = new SbmSystemUser_Dbas(Internals, new SysId(dbSystemUser._Id), new SysId(dbSystemUser._AffIdOwner), new SysId(dbSystemUser._InterfaceId), new SysId(dbSystemUser._AffiliateId), (ushort)dbSystemUser._Flags);
|
||||
SbmSystemUser_Dbas systemUser = new SbmSystemUser_Dbas(Internals, new SysId(dbSystemUser._Id), new SysId(dbSystemUser._AffIdOwner), new SysId(dbSystemUser._InterfaceId ?? 0), new SysId(dbSystemUser._AffiliateId ?? 0), (ushort)dbSystemUser._Flags);
|
||||
PopulateFrom(dbSystemUser, systemUser);
|
||||
return systemUser;
|
||||
}
|
||||
@@ -225,15 +225,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
{
|
||||
systemUser.Id = new SysId(dbSystemUser._Id);
|
||||
systemUser.AffiliateIdOwner = new SysId(dbSystemUser._AffIdOwner);
|
||||
systemUser.InterfaceId = new SysId(dbSystemUser._InterfaceId);
|
||||
systemUser.AffiliateId = new SysId(dbSystemUser._AffiliateId);
|
||||
systemUser.InterfaceId = new SysId(dbSystemUser._InterfaceId ?? 0);
|
||||
systemUser.AffiliateId = new SysId(dbSystemUser._AffiliateId ?? 0);
|
||||
systemUser.Code = dbSystemUser._Code;
|
||||
systemUser.AuthCodeEnc = dbSystemUser._AuthCodeEnc;
|
||||
// Common properties.
|
||||
systemUser.Notes = dbSystemUser._Notes;
|
||||
systemUser.Status = SacsSystem.GetStatusForCode(dbSystemUser._Status);
|
||||
systemUser.SetCreateStamp(dbSystemUser._CreateOn, new SysId(dbSystemUser._CreateBy), dbSystemUser._CreateHost);
|
||||
systemUser.SetUpdateStamp(dbSystemUser._UpdateOn, new SysId(dbSystemUser._UpdateBy), dbSystemUser._UpdateHost);
|
||||
systemUser.SetCreateStamp(dbSystemUser._CreateOn ?? default(DateTime), new SysId(dbSystemUser._CreateBy ?? 0), dbSystemUser._CreateHost);
|
||||
systemUser.SetUpdateStamp(dbSystemUser._UpdateOn ?? default(DateTime), new SysId(dbSystemUser._UpdateBy ?? 0), dbSystemUser._UpdateHost);
|
||||
systemUser.AcceptChanges();
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ using Sarand.BusinessMgr.Net.Standard.Base.Mgr;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Dbas.Base;
|
||||
using System;
|
||||
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
{
|
||||
@@ -36,6 +37,17 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
protected SbmDbDataItem.SbmDatabaseInfo DbInfo { get; }
|
||||
public override bool SystemAccountDatabaseIsValid { get { return Database.TableExists(SbmDbDfn.GetTableName(SbmDbDfn.TableIdx.SystemAccount)); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Database utilities.
|
||||
public override bool ColumnExists(SbmDbDfn.ColumnIdx columnIdx)
|
||||
{
|
||||
SbmDbDfn.TableIdx tableIdx = SbmDbDfn.GetTableForColumn(columnIdx);
|
||||
String schemaName = SbmDbDfn.GetSchemaName(tableIdx, false);
|
||||
String tableName = SbmDbDfn.GetTableName(tableIdx, false);
|
||||
String columnName = SbmDbDfn.GetColumnName(columnIdx, false);
|
||||
return DbInfo.ColumnExists(schemaName, tableName, columnName);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
private SbmAsset_Dbas CreateAsset(SaAsset_Db dbAsset)
|
||||
{
|
||||
ClearErrorState();
|
||||
SbmAsset_Dbas asset = new SbmAsset_Dbas(Internals, new SysId(dbAsset._Id), new SysId(dbAsset._AssetCategoryId), (ushort)dbAsset._Flags);
|
||||
SbmAsset_Dbas asset = new SbmAsset_Dbas(Internals, new SysId(dbAsset._Id), new SysId(dbAsset._AssetCategoryId ?? 0), (ushort)dbAsset._Flags);
|
||||
PopulateFrom(dbAsset, asset);
|
||||
return asset;
|
||||
}
|
||||
@@ -257,44 +257,44 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
}
|
||||
private void PopulateFrom(SaAsset_Db dbAsset, SbmAsset asset)
|
||||
{
|
||||
asset.AssetCategoryId = new SysId(dbAsset._AssetCategoryId);
|
||||
asset.AssetCategoryId = new SysId(dbAsset._AssetCategoryId ?? 0);
|
||||
asset.SerialNumber = dbAsset._SerialNumber;
|
||||
asset.RefExt = dbAsset._RefExt;
|
||||
asset.DescBrief = dbAsset._DescBrief;
|
||||
asset.ItemId = new ItemId(dbAsset._ItemType, new SysId(dbAsset._ItemId));
|
||||
asset.PurchaseOn = dbAsset._PurchaseOn;
|
||||
asset.AssocIdSupplier = new SysId(dbAsset._AssocIdSupplier);
|
||||
asset.ItemId = new ItemId(dbAsset._ItemType ?? 0, new SysId(dbAsset._ItemId ?? 0));
|
||||
asset.PurchaseOn = dbAsset._PurchaseOn ?? default(DateTime);
|
||||
asset.AssocIdSupplier = new SysId(dbAsset._AssocIdSupplier ?? 0);
|
||||
asset.PurchaseInvoiceRef = dbAsset._PurchaseInvoiceRef;
|
||||
asset.PaymentTerms = dbAsset._PaymentTerms;
|
||||
asset.AmountPurchase = dbAsset._AmountPurchase;
|
||||
asset.TaxCodeIdPurchase = new SysId(dbAsset._TaxCodeIdPurchase);
|
||||
asset.AmountPurchaseGross = dbAsset._AmountPurchaseGross;
|
||||
asset.AmountSettlementGross = dbAsset._AmountSettlementGross;
|
||||
asset.AmountEnhancementGross = dbAsset._AmountEnhancementGross;
|
||||
asset.AssocIdCustomer = new SysId(dbAsset._AssocIdCustomer);
|
||||
asset.PaymentTerms = dbAsset._PaymentTerms ?? 0;
|
||||
asset.AmountPurchase = dbAsset._AmountPurchase ?? 0.0m;
|
||||
asset.TaxCodeIdPurchase = new SysId(dbAsset._TaxCodeIdPurchase ?? 0);
|
||||
asset.AmountPurchaseGross = dbAsset._AmountPurchaseGross ?? 0.0m;
|
||||
asset.AmountSettlementGross = dbAsset._AmountSettlementGross ?? 0.0m;
|
||||
asset.AmountEnhancementGross = dbAsset._AmountEnhancementGross ?? 0.0m;
|
||||
asset.AssocIdCustomer = new SysId(dbAsset._AssocIdCustomer ?? 0);
|
||||
asset.SellCategoryCode = dbAsset._SellCategoryCode;
|
||||
asset.AmountSell = dbAsset._AmountSell;
|
||||
asset.TaxCodeIdSell = new SysId(dbAsset._TaxCodeIdSell);
|
||||
asset.AmountSellGross = dbAsset._AmountSellGross;
|
||||
asset.TaxCodeIdProfit = new SysId(dbAsset._TaxCodeIdProfit);
|
||||
asset.SoldOn = dbAsset._SoldOn;
|
||||
asset.AmountSold = dbAsset._AmountSold;
|
||||
asset.AmountSoldGross = dbAsset._AmountSoldGross;
|
||||
asset.AmountSell = dbAsset._AmountSell ?? 0.0m;
|
||||
asset.TaxCodeIdSell = new SysId(dbAsset._TaxCodeIdSell ?? 0);
|
||||
asset.AmountSellGross = dbAsset._AmountSellGross ?? 0.0m;
|
||||
asset.TaxCodeIdProfit = new SysId(dbAsset._TaxCodeIdProfit ?? 0);
|
||||
asset.SoldOn = dbAsset._SoldOn ?? default(DateTime);
|
||||
asset.AmountSold = dbAsset._AmountSold ?? 0.0m;
|
||||
asset.AmountSoldGross = dbAsset._AmountSoldGross ?? 0.0m;
|
||||
asset.DisposeCode = dbAsset._DisposeCode;
|
||||
asset.DisposeOn = dbAsset._DisposeOn;
|
||||
asset.DueBackOn = dbAsset._DueBackOn;
|
||||
asset.AmountRentalCost = dbAsset._AmountRentalCost;
|
||||
asset.UomIdRentalCost = new SysId(dbAsset._UomIdRentalCost);
|
||||
asset.TaxCodeIdRentalCost = new SysId(dbAsset._TaxCodeIdRentalCost);
|
||||
asset.AmountRentalPrice = dbAsset._AmountRentalPrice;
|
||||
asset.UomIdRentalPrice = new SysId(dbAsset._UomIdRentalPrice);
|
||||
asset.TaxCodeIdRentalPrice = new SysId(dbAsset._TaxCodeIdRentalPrice);
|
||||
asset.ProcessIdNext = new SysId(dbAsset._ProcessIdNext);
|
||||
asset.DisposeOn = dbAsset._DisposeOn ?? default(DateTime);
|
||||
asset.DueBackOn = dbAsset._DueBackOn ?? default(DateTime);
|
||||
asset.AmountRentalCost = dbAsset._AmountRentalCost ?? 0.0m;
|
||||
asset.UomIdRentalCost = new SysId(dbAsset._UomIdRentalCost ?? 0);
|
||||
asset.TaxCodeIdRentalCost = new SysId(dbAsset._TaxCodeIdRentalCost ?? 0);
|
||||
asset.AmountRentalPrice = dbAsset._AmountRentalPrice ?? 0.0m;
|
||||
asset.UomIdRentalPrice = new SysId(dbAsset._UomIdRentalPrice ?? 0);
|
||||
asset.TaxCodeIdRentalPrice = new SysId(dbAsset._TaxCodeIdRentalPrice ?? 0);
|
||||
asset.ProcessIdNext = new SysId(dbAsset._ProcessIdNext ?? 0);
|
||||
// Common properties.
|
||||
asset.Notes = dbAsset._Notes;
|
||||
asset.Status = SacsSystem.GetStatusForCode(dbAsset._Status);
|
||||
asset.SetCreateStamp(dbAsset._CreateOn, new SysId(dbAsset._CreateBy), dbAsset._CreateHost);
|
||||
asset.SetUpdateStamp(dbAsset._UpdateOn, new SysId(dbAsset._UpdateBy), dbAsset._UpdateHost);
|
||||
asset.SetCreateStamp(dbAsset._CreateOn ?? default(DateTime), new SysId(dbAsset._CreateBy ?? 0), dbAsset._CreateHost);
|
||||
asset.SetUpdateStamp(dbAsset._UpdateOn ?? default(DateTime), new SysId(dbAsset._UpdateBy ?? 0), dbAsset._UpdateHost);
|
||||
asset.AcceptChanges();
|
||||
}
|
||||
|
||||
|
||||
@@ -310,23 +310,23 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
assetCategory.AffIdOwner = new SysId(dbAssetCategory._AffIdOwner);
|
||||
assetCategory.Code = dbAssetCategory._Code;
|
||||
assetCategory.DescBrief = dbAssetCategory._DescBrief;
|
||||
assetCategory.IncomeType = (Sbm.AssetIncomeType)dbAssetCategory._IncomeType;
|
||||
assetCategory.AssocIdSupplier = new SysId(dbAssetCategory._AssocIdSupplier);
|
||||
assetCategory.PaymentTerms = dbAssetCategory._PaymentTerms;
|
||||
assetCategory.TaxCodeIdPurchase = new SysId(dbAssetCategory._TaxCodeIdPurchase);
|
||||
assetCategory.AssocIdCustomer = new SysId(dbAssetCategory._AssocIdCustomer);
|
||||
assetCategory.TaxCodeIdSell = new SysId(dbAssetCategory._TaxCodeIdSell);
|
||||
assetCategory.TaxCodeIdProfit = new SysId(dbAssetCategory._TaxCodeIdProfit);
|
||||
assetCategory.IncomeType = (Sbm.AssetIncomeType)(dbAssetCategory._IncomeType ?? 0);
|
||||
assetCategory.AssocIdSupplier = new SysId(dbAssetCategory._AssocIdSupplier ?? 0);
|
||||
assetCategory.PaymentTerms = dbAssetCategory._PaymentTerms ?? 0;
|
||||
assetCategory.TaxCodeIdPurchase = new SysId(dbAssetCategory._TaxCodeIdPurchase ?? 0);
|
||||
assetCategory.AssocIdCustomer = new SysId(dbAssetCategory._AssocIdCustomer ?? 0);
|
||||
assetCategory.TaxCodeIdSell = new SysId(dbAssetCategory._TaxCodeIdSell ?? 0);
|
||||
assetCategory.TaxCodeIdProfit = new SysId(dbAssetCategory._TaxCodeIdProfit ?? 0);
|
||||
assetCategory.DisposeCode = dbAssetCategory._DisposeCode;
|
||||
assetCategory.UomIdRentalCost = new SysId(dbAssetCategory._UomIdRentalCost);
|
||||
assetCategory.TaxCodeIdRentalCost = new SysId(dbAssetCategory._TaxCodeIdRentalCost);
|
||||
assetCategory.UomIdRentalPrice = new SysId(dbAssetCategory._UomIdRentalPrice);
|
||||
assetCategory.TaxCodeIdRentalPrice = new SysId(dbAssetCategory._TaxCodeIdRentalPrice);
|
||||
assetCategory.UomIdRentalCost = new SysId(dbAssetCategory._UomIdRentalCost ?? 0);
|
||||
assetCategory.TaxCodeIdRentalCost = new SysId(dbAssetCategory._TaxCodeIdRentalCost ?? 0);
|
||||
assetCategory.UomIdRentalPrice = new SysId(dbAssetCategory._UomIdRentalPrice ?? 0);
|
||||
assetCategory.TaxCodeIdRentalPrice = new SysId(dbAssetCategory._TaxCodeIdRentalPrice ?? 0);
|
||||
// Common properties.
|
||||
assetCategory.Notes = dbAssetCategory._Notes;
|
||||
assetCategory.Status = SacsSystem.GetStatusForCode(dbAssetCategory._Status);
|
||||
assetCategory.SetCreateStamp(dbAssetCategory._CreateOn, new SysId(dbAssetCategory._CreateBy), dbAssetCategory._CreateHost);
|
||||
assetCategory.SetUpdateStamp(dbAssetCategory._UpdateOn, new SysId(dbAssetCategory._UpdateBy), dbAssetCategory._UpdateHost);
|
||||
assetCategory.SetCreateStamp(dbAssetCategory._CreateOn ?? default(DateTime), new SysId(dbAssetCategory._CreateBy ?? 0), dbAssetCategory._CreateHost);
|
||||
assetCategory.SetUpdateStamp(dbAssetCategory._UpdateOn ?? default(DateTime), new SysId(dbAssetCategory._UpdateBy ?? 0), dbAssetCategory._UpdateHost);
|
||||
assetCategory.AcceptChanges();
|
||||
}
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
private SbmAssetProcess_Dbas CreateAssetProcess(SaAssetProcess_Db dbAssetProcess)
|
||||
{
|
||||
ClearErrorState();
|
||||
SbmAssetProcess_Dbas assetProcess = new SbmAssetProcess_Dbas(Internals, new SysId(dbAssetProcess._Id), new SysId(dbAssetProcess._AssetId), new SysId(dbAssetProcess._ProcessId), (ushort)dbAssetProcess._Flags);
|
||||
SbmAssetProcess_Dbas assetProcess = new SbmAssetProcess_Dbas(Internals, new SysId(dbAssetProcess._Id), new SysId(dbAssetProcess._AssetId ?? 0), new SysId(dbAssetProcess._ProcessId ?? 0), (ushort)dbAssetProcess._Flags);
|
||||
PopulateFrom(dbAssetProcess, assetProcess);
|
||||
return assetProcess;
|
||||
}
|
||||
@@ -230,17 +230,17 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
private void PopulateFrom(SaAssetProcess_Db dbAssetProcess, SbmAssetProcess assetProcess)
|
||||
{
|
||||
//assetProcess.Id = new SysId(dbAssetProcess._Id);
|
||||
assetProcess.AssetId = new SysId(dbAssetProcess._AssetId);
|
||||
assetProcess.AssetId = new SysId(dbAssetProcess._AssetId ?? 0);
|
||||
assetProcess.Seq = dbAssetProcess._Seq.ToString();
|
||||
assetProcess.ProcessId = new SysId(dbAssetProcess._ProcessId);
|
||||
assetProcess.RequiredOn = dbAssetProcess._RequiredOn;
|
||||
assetProcess.ExpectedOn = dbAssetProcess._ExpectedOn;
|
||||
assetProcess.ProcessedOn = dbAssetProcess._ProcessedOn;
|
||||
assetProcess.ProcessId = new SysId(dbAssetProcess._ProcessId ?? 0);
|
||||
assetProcess.RequiredOn = dbAssetProcess._RequiredOn ?? default(DateTime);
|
||||
assetProcess.ExpectedOn = dbAssetProcess._ExpectedOn ?? default(DateTime);
|
||||
assetProcess.ProcessedOn = dbAssetProcess._ProcessedOn ?? default(DateTime);
|
||||
// Common properties.
|
||||
assetProcess.Notes = dbAssetProcess._Notes;
|
||||
assetProcess.Status = SacsSystem.GetStatusForCode(dbAssetProcess._Status);
|
||||
assetProcess.SetCreateStamp(dbAssetProcess._CreateOn, new SysId(dbAssetProcess._CreateBy), dbAssetProcess._CreateHost);
|
||||
assetProcess.SetUpdateStamp(dbAssetProcess._UpdateOn, new SysId(dbAssetProcess._UpdateBy), dbAssetProcess._UpdateHost);
|
||||
assetProcess.SetCreateStamp(dbAssetProcess._CreateOn ?? default(DateTime), new SysId(dbAssetProcess._CreateBy ?? 0), dbAssetProcess._CreateHost);
|
||||
assetProcess.SetUpdateStamp(dbAssetProcess._UpdateOn ?? default(DateTime), new SysId(dbAssetProcess._UpdateBy ?? 0), dbAssetProcess._UpdateHost);
|
||||
assetProcess.AcceptChanges();
|
||||
}
|
||||
|
||||
|
||||
@@ -249,38 +249,38 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
private void PopulateFrom(SaVehicle_Db dbVehicle, SbmVehicle vehicle)
|
||||
{
|
||||
//vehicle.Id = new SysId(dbVehicle._Id);
|
||||
vehicle.VehicleClassId = new SysId(dbVehicle._VehicleClassId);
|
||||
vehicle.VehicleClassId = new SysId(dbVehicle._VehicleClassId ?? 0);
|
||||
vehicle.RegNumber = dbVehicle._RegNumber;
|
||||
vehicle.Vin = dbVehicle._VIN;
|
||||
vehicle.CapCode = dbVehicle._CapCode;
|
||||
vehicle.KeyNumber = dbVehicle._KeyNumber;
|
||||
vehicle.KeyLocation = dbVehicle._KeyLocation;
|
||||
vehicle.EngineNumber = dbVehicle._EngineNumber;
|
||||
vehicle.EngineCapacity = dbVehicle._EngineCapacity;
|
||||
vehicle.Seats = dbVehicle._Seats;
|
||||
vehicle.Weight = dbVehicle._Weight;
|
||||
vehicle.ManufactureYear = dbVehicle._ManufactureYear;
|
||||
vehicle.BuildOn = dbVehicle._BuildOn;
|
||||
vehicle.FirstRegisterOn = dbVehicle._FirstRegisterOn;
|
||||
vehicle.RegisterOn = dbVehicle._RegisterOn;
|
||||
vehicle.EngineCapacity = dbVehicle._EngineCapacity ?? 0;
|
||||
vehicle.Seats = dbVehicle._Seats ?? 0;
|
||||
vehicle.Weight = dbVehicle._Weight ?? 0;
|
||||
vehicle.ManufactureYear = dbVehicle._ManufactureYear ?? 0;
|
||||
vehicle.BuildOn = dbVehicle._BuildOn ?? default(DateTime);
|
||||
vehicle.FirstRegisterOn = dbVehicle._FirstRegisterOn ?? default(DateTime);
|
||||
vehicle.RegisterOn = dbVehicle._RegisterOn ?? default(DateTime);
|
||||
vehicle.RegNumberPrev = dbVehicle._RegNumberPrev;
|
||||
vehicle.PurchaseOdo = dbVehicle._PurchaseOdo;
|
||||
vehicle.PurchaseOdo = dbVehicle._PurchaseOdo ?? 0;
|
||||
vehicle.TachoCode = dbVehicle._TachoCode;
|
||||
vehicle.TachoId = dbVehicle._TachoId;
|
||||
vehicle.LastServiceOdo = dbVehicle._LastServiceOdo;
|
||||
vehicle.LastServiceOn = dbVehicle._LastServiceOn;
|
||||
vehicle.NextServiceOdo = dbVehicle._NextServiceOdo;
|
||||
vehicle.NextServiceOn = dbVehicle._NextServiceOn;
|
||||
vehicle.MotOn = dbVehicle._MotOn;
|
||||
vehicle.LastServiceOdo = dbVehicle._LastServiceOdo ?? 0;
|
||||
vehicle.LastServiceOn = dbVehicle._LastServiceOn ?? default(DateTime);
|
||||
vehicle.NextServiceOdo = dbVehicle._NextServiceOdo ?? 0;
|
||||
vehicle.NextServiceOn = dbVehicle._NextServiceOn ?? default(DateTime);
|
||||
vehicle.MotOn = dbVehicle._MotOn ?? default(DateTime);
|
||||
vehicle.MotNo = dbVehicle._MotNo;
|
||||
vehicle.NextTaxOn = dbVehicle._NextTaxOn;
|
||||
vehicle.LatestOdo = dbVehicle._LatestOdo;
|
||||
vehicle.LatestOdoOn = dbVehicle._LatestOdoOn;
|
||||
vehicle.NextTaxOn = dbVehicle._NextTaxOn ?? default(DateTime);
|
||||
vehicle.LatestOdo = dbVehicle._LatestOdo ?? 0;
|
||||
vehicle.LatestOdoOn = dbVehicle._LatestOdoOn ?? default(DateTime);
|
||||
// Common properties.
|
||||
vehicle.Notes = dbVehicle._Notes;
|
||||
vehicle.Status = SacsSystem.GetStatusForCode(dbVehicle._Status);
|
||||
vehicle.SetCreateStamp(dbVehicle._CreateOn, new SysId(dbVehicle._CreateBy), dbVehicle._CreateHost);
|
||||
vehicle.SetUpdateStamp(dbVehicle._UpdateOn, new SysId(dbVehicle._UpdateBy), dbVehicle._UpdateHost);
|
||||
vehicle.SetCreateStamp(dbVehicle._CreateOn ?? default(DateTime), new SysId(dbVehicle._CreateBy ?? 0), dbVehicle._CreateHost);
|
||||
vehicle.SetUpdateStamp(dbVehicle._UpdateOn ?? default(DateTime), new SysId(dbVehicle._UpdateBy ?? 0), dbVehicle._UpdateHost);
|
||||
vehicle.AcceptChanges();
|
||||
}
|
||||
|
||||
|
||||
@@ -337,25 +337,25 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
vehicleClass.Model = dbVehicleClass._Model;
|
||||
vehicleClass.Derivative = dbVehicleClass._Derivative;
|
||||
vehicleClass.DescBrief = dbVehicleClass._DescBrief;
|
||||
vehicleClass.VehicleType = (Sbm.VehicleType)dbVehicleClass._VehicleType;
|
||||
vehicleClass.VehicleType = (Sbm.VehicleType)(dbVehicleClass._VehicleType ?? 0);
|
||||
vehicleClass.VehicleCategoryCode = dbVehicleClass._VehicleCategoryCode;
|
||||
vehicleClass.FuelType = (Sbm.VehicleFuelType)dbVehicleClass._FuelType;
|
||||
vehicleClass.OdometerUnits = (Sbm.VehicleOdometerUnits)dbVehicleClass._OdometerUnits;
|
||||
vehicleClass.Seats = dbVehicleClass._Seats;
|
||||
vehicleClass.Weight = dbVehicleClass._Weight;
|
||||
vehicleClass.FuelType = (Sbm.VehicleFuelType)(dbVehicleClass._FuelType ?? 0);
|
||||
vehicleClass.OdometerUnits = (Sbm.VehicleOdometerUnits)(dbVehicleClass._OdometerUnits ?? 0);
|
||||
vehicleClass.Seats = dbVehicleClass._Seats ?? 0;
|
||||
vehicleClass.Weight = dbVehicleClass._Weight ?? 0;
|
||||
vehicleClass.InsuranceCode = dbVehicleClass._InsuranceCode;
|
||||
vehicleClass.FirstServiceOdo = dbVehicleClass._FirstServiceOdo;
|
||||
vehicleClass.ServiceOdo = dbVehicleClass._ServiceOdo;
|
||||
vehicleClass.ServiceWeeks = dbVehicleClass._ServiceWeeks;
|
||||
vehicleClass.AmountRentalCost = dbVehicleClass._AmountRentalCost;
|
||||
vehicleClass.UomIdRentalCost = new SysId(dbVehicleClass._UomIdRentalCost);
|
||||
vehicleClass.AmountRentalPrice = dbVehicleClass._AmountRentalPrice;
|
||||
vehicleClass.UomIdRentalPrice = new SysId(dbVehicleClass._UomIdRentalPrice);
|
||||
vehicleClass.FirstServiceOdo = dbVehicleClass._FirstServiceOdo ?? 0;
|
||||
vehicleClass.ServiceOdo = dbVehicleClass._ServiceOdo ?? 0;
|
||||
vehicleClass.ServiceWeeks = dbVehicleClass._ServiceWeeks ?? 0;
|
||||
vehicleClass.AmountRentalCost = dbVehicleClass._AmountRentalCost ?? 0;
|
||||
vehicleClass.UomIdRentalCost = new SysId(dbVehicleClass._UomIdRentalCost ?? 0);
|
||||
vehicleClass.AmountRentalPrice = dbVehicleClass._AmountRentalPrice ?? 0;
|
||||
vehicleClass.UomIdRentalPrice = new SysId(dbVehicleClass._UomIdRentalPrice ?? 0);
|
||||
// Common properties.
|
||||
vehicleClass.Notes = dbVehicleClass._Notes;
|
||||
vehicleClass.Status = SacsSystem.GetStatusForCode(dbVehicleClass._Status);
|
||||
vehicleClass.SetCreateStamp(dbVehicleClass._CreateOn, new SysId(dbVehicleClass._CreateBy), dbVehicleClass._CreateHost);
|
||||
vehicleClass.SetUpdateStamp(dbVehicleClass._UpdateOn, new SysId(dbVehicleClass._UpdateBy), dbVehicleClass._UpdateHost);
|
||||
vehicleClass.SetCreateStamp(dbVehicleClass._CreateOn ?? default(DateTime), new SysId(dbVehicleClass._CreateBy ?? 0), dbVehicleClass._CreateHost);
|
||||
vehicleClass.SetUpdateStamp(dbVehicleClass._UpdateOn ?? default(DateTime), new SysId(dbVehicleClass._UpdateBy ?? 0), dbVehicleClass._UpdateHost);
|
||||
vehicleClass.AcceptChanges();
|
||||
}
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
private SbmVehicleEvent_Dbas CreateVehicleEvent(SaVehicleEvent_Db dbVehicleEvent)
|
||||
{
|
||||
ClearErrorState();
|
||||
SbmVehicleEvent_Dbas vehicleEvent = new SbmVehicleEvent_Dbas(Internals, new SysId(dbVehicleEvent._VehicleId), (Sbm.VehicleEventType)dbVehicleEvent._EventType, (ushort)dbVehicleEvent._Flags);
|
||||
SbmVehicleEvent_Dbas vehicleEvent = new SbmVehicleEvent_Dbas(Internals, new SysId(dbVehicleEvent._VehicleId ?? 0), (Sbm.VehicleEventType)dbVehicleEvent._EventType, (ushort)dbVehicleEvent._Flags);
|
||||
PopulateFrom(dbVehicleEvent, vehicleEvent);
|
||||
return vehicleEvent;
|
||||
}
|
||||
@@ -236,23 +236,23 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
private void PopulateFrom(SaVehicleEvent_Db dbVehicleEvent, SbmVehicleEvent vehicleEvent)
|
||||
{
|
||||
//vehicleEvent.Id = new SysId(dbVehicleEvent._Id);
|
||||
vehicleEvent.VehicleId = new SysId(dbVehicleEvent._VehicleId);
|
||||
vehicleEvent.VehicleEventType = (Sbm.VehicleEventType)dbVehicleEvent._EventType;
|
||||
vehicleEvent.StartOn = dbVehicleEvent._StartOn;
|
||||
vehicleEvent.FinishOn = dbVehicleEvent._FinishOn;
|
||||
vehicleEvent.Odometer = dbVehicleEvent._Odometer;
|
||||
vehicleEvent.VehicleId = new SysId(dbVehicleEvent._VehicleId ?? 0);
|
||||
vehicleEvent.VehicleEventType = (Sbm.VehicleEventType)(dbVehicleEvent._EventType ?? 0);
|
||||
vehicleEvent.StartOn = dbVehicleEvent._StartOn ?? default(DateTime);
|
||||
vehicleEvent.FinishOn = dbVehicleEvent._FinishOn ?? default(DateTime);
|
||||
vehicleEvent.Odometer = dbVehicleEvent._Odometer ?? 0;
|
||||
vehicleEvent.DescBrief = dbVehicleEvent._DescBrief;
|
||||
vehicleEvent.DescDetail = dbVehicleEvent._DescDetail;
|
||||
vehicleEvent.AmountNet = dbVehicleEvent._AmountNet;
|
||||
vehicleEvent.TaxCodeId = new SysId(dbVehicleEvent._TaxCodeId);
|
||||
vehicleEvent.TaxRate = dbVehicleEvent._TaxRate;
|
||||
vehicleEvent.AmountTax = dbVehicleEvent._AmountTax;
|
||||
vehicleEvent.AmountTot = dbVehicleEvent._AmountTot;
|
||||
vehicleEvent.AmountNet = dbVehicleEvent._AmountNet ?? 0.0m;
|
||||
vehicleEvent.TaxCodeId = new SysId(dbVehicleEvent._TaxCodeId ?? 0);
|
||||
vehicleEvent.TaxRate = dbVehicleEvent._TaxRate ?? 0.0m;
|
||||
vehicleEvent.AmountTax = dbVehicleEvent._AmountTax ?? 0.0m;
|
||||
vehicleEvent.AmountTot = dbVehicleEvent._AmountTot ?? 0.0m;
|
||||
// Common properties.
|
||||
vehicleEvent.Notes = dbVehicleEvent._Notes;
|
||||
vehicleEvent.Status = SacsSystem.GetStatusForCode(dbVehicleEvent._Status);
|
||||
vehicleEvent.SetCreateStamp(dbVehicleEvent._CreateOn, new SysId(dbVehicleEvent._CreateBy), dbVehicleEvent._CreateHost);
|
||||
vehicleEvent.SetUpdateStamp(dbVehicleEvent._UpdateOn, new SysId(dbVehicleEvent._UpdateBy), dbVehicleEvent._UpdateHost);
|
||||
vehicleEvent.SetCreateStamp(dbVehicleEvent._CreateOn ?? default(DateTime), new SysId(dbVehicleEvent._CreateBy ?? 0), dbVehicleEvent._CreateHost);
|
||||
vehicleEvent.SetUpdateStamp(dbVehicleEvent._UpdateOn ?? default(DateTime), new SysId(dbVehicleEvent._UpdateBy ?? 0), dbVehicleEvent._UpdateHost);
|
||||
vehicleEvent.AcceptChanges();
|
||||
}
|
||||
|
||||
|
||||
@@ -336,8 +336,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
// Common properties.
|
||||
vehicleFeature.Notes = dbVehicleFeature._Notes;
|
||||
vehicleFeature.Status = SacsSystem.GetStatusForCode(dbVehicleFeature._Status);
|
||||
vehicleFeature.SetCreateStamp(dbVehicleFeature._CreateOn, new SysId(dbVehicleFeature._CreateBy), dbVehicleFeature._CreateHost);
|
||||
vehicleFeature.SetUpdateStamp(dbVehicleFeature._UpdateOn, new SysId(dbVehicleFeature._UpdateBy), dbVehicleFeature._UpdateHost);
|
||||
vehicleFeature.SetCreateStamp(dbVehicleFeature._CreateOn ?? default(DateTime), new SysId(dbVehicleFeature._CreateBy ?? 0), dbVehicleFeature._CreateHost);
|
||||
vehicleFeature.SetUpdateStamp(dbVehicleFeature._UpdateOn ?? default(DateTime), new SysId(dbVehicleFeature._UpdateBy ?? 0), dbVehicleFeature._UpdateHost);
|
||||
vehicleFeature.AcceptChanges();
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ using Sarand.BusinessMgr.Net.Standard.Base.Mgr;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Dbas.Base;
|
||||
using System;
|
||||
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
{
|
||||
@@ -34,6 +35,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Utilities.
|
||||
|
||||
public override bool AssetDatabaseIsValid()
|
||||
{
|
||||
ClearErrorState();
|
||||
@@ -44,6 +46,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool ColumnExists(SbmDbDfn.ColumnIdx columnIdx)
|
||||
{
|
||||
SbmDbDfn.TableIdx tableIdx = SbmDbDfn.GetTableForColumn(columnIdx);
|
||||
String schemaName = SbmDbDfn.GetSchemaName(tableIdx, false);
|
||||
String tableName = SbmDbDfn.GetTableName(tableIdx, false);
|
||||
String columnName = SbmDbDfn.GetColumnName(columnIdx, false);
|
||||
return DbInfo.ColumnExists(schemaName, tableName, columnName);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
|
||||
@@ -834,7 +834,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
commodity.DescDetail = dbCommodity._DescDetail;
|
||||
commodity.DrawingNumber = dbCommodity._DrawingNo;
|
||||
commodity.DrawingIssue = dbCommodity._DrawingIssue;
|
||||
commodity.AssetCatId = new SysId(dbCommodity._AssetCatId);
|
||||
commodity.AssetCatId = new SysId(dbCommodity._AssetCatId ?? 0);
|
||||
commodity.ImagePath = dbCommodity._ImagePath;
|
||||
commodity.Category1 = dbCommodity._Category;
|
||||
commodity.Category2 = dbCommodity._Category2;
|
||||
@@ -842,16 +842,16 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
commodity.Location = dbCommodity._Location;
|
||||
commodity.Department = dbCommodity._Department;
|
||||
commodity.CatalogRef = dbCommodity._CatalogRef;
|
||||
commodity.Weight = dbCommodity._Weight;
|
||||
commodity.UomIdWeight = new SysId(dbCommodity._UomIdWeight);
|
||||
commodity.Length = dbCommodity._Length;
|
||||
commodity.UomIdLength = new SysId(dbCommodity._UomIdLength);
|
||||
commodity.Volume = dbCommodity._Volume;
|
||||
commodity.UomIdVolume = new SysId(dbCommodity._UomIdVolume);
|
||||
commodity.Density = dbCommodity._Density;
|
||||
commodity.UomIdDensity = new SysId(dbCommodity._UomIdDensity);
|
||||
commodity.BoxQuantity = dbCommodity._BoxQuantity;
|
||||
commodity.UomIdBox = new SysId(dbCommodity._UomIdBox);
|
||||
commodity.Weight = dbCommodity._Weight ?? 0.0m;
|
||||
commodity.UomIdWeight = new SysId(dbCommodity._UomIdWeight ?? 0);
|
||||
commodity.Length = dbCommodity._Length ?? 0.0m;
|
||||
commodity.UomIdLength = new SysId(dbCommodity._UomIdLength ?? 0);
|
||||
commodity.Volume = dbCommodity._Volume ?? 0.0m;
|
||||
commodity.UomIdVolume = new SysId(dbCommodity._UomIdVolume ?? 0);
|
||||
commodity.Density = dbCommodity._Density ?? 0;
|
||||
commodity.UomIdDensity = new SysId(dbCommodity._UomIdDensity ?? 0);
|
||||
commodity.BoxQuantity = dbCommodity._BoxQuantity ?? 0;
|
||||
commodity.UomIdBox = new SysId(dbCommodity._UomIdBox ?? 0);
|
||||
commodity.Dimensions = dbCommodity._Dimensions;
|
||||
commodity.SpecSummary = dbCommodity._SpecSummary;
|
||||
commodity.RangeCode = dbCommodity._RangeCode;
|
||||
@@ -866,54 +866,54 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
commodity.NominalCode = dbCommodity._NominalCode;
|
||||
commodity.NominalCodePurchase = dbCommodity._NominalCodePurchase;
|
||||
commodity.ICNTariffCode = dbCommodity._ICNTariffCode;
|
||||
commodity.TimeProd = dbCommodity._TimeProd;
|
||||
commodity.UomIdTimeProd = new SysId(dbCommodity._UomIdTimeProd);
|
||||
commodity.AssociationIdSupplier = new SysId(dbCommodity._AssIdSupplier);
|
||||
commodity.TimeProd = dbCommodity._TimeProd ?? 0.0m;
|
||||
commodity.UomIdTimeProd = new SysId(dbCommodity._UomIdTimeProd ?? 0);
|
||||
commodity.AssociationIdSupplier = new SysId(dbCommodity._AssIdSupplier ?? 0);
|
||||
commodity.SupplierRef = dbCommodity._SupplierRef;
|
||||
commodity.CostPrice = dbCommodity._CostPrice;
|
||||
commodity.CostPrice = dbCommodity._CostPrice ?? 0.0m;
|
||||
commodity.PlaceOfOrigin = dbCommodity._PlaceOfOrigin;
|
||||
commodity.MaterialCost = dbCommodity._MaterialCost;
|
||||
commodity.CurrencyIdMaterial = new SysId(dbCommodity._CurrencyIdMaterial);
|
||||
commodity.ExWorksCost = dbCommodity._ExWorksCost;
|
||||
commodity.CurrencyIdExWorks = new SysId(dbCommodity._CurrencyIdExWorks);
|
||||
commodity.ReorderLevel = dbCommodity._ReorderLevel;
|
||||
commodity.ReorderQty = dbCommodity._ReorderQty;
|
||||
commodity.QtyOnOrder = dbCommodity._QtyOnOrder;
|
||||
commodity.AssociationIdCustomer = new SysId(dbCommodity._AssIdCustomer);
|
||||
commodity.SalesPrice = dbCommodity._SalesPrice;
|
||||
commodity.RetailPrice = dbCommodity._RetailPrice;
|
||||
commodity.RetailPricePlanned = dbCommodity._RetailPricePlanned;
|
||||
commodity.UomIdSale = new SysId(dbCommodity._UomIdSale);
|
||||
commodity.CarriageCostIndicative = dbCommodity._CarriageCostIndicative;
|
||||
commodity.MinOrderQty = dbCommodity._MinOrderQty;
|
||||
commodity.PackQtySale = dbCommodity._PackQty;
|
||||
commodity.TaxCodeId = new SysId(dbCommodity._TaxCodeId);
|
||||
commodity.LastOrderDate = dbCommodity._LastOrderDate;
|
||||
commodity.LastOrderQty = dbCommodity._LastOrderQty;
|
||||
commodity.QtyInStock = dbCommodity._QtyInStock;
|
||||
commodity.QtyAllocated = dbCommodity._QtyAllocated;
|
||||
commodity.FreeStock = dbCommodity._FreeStock;
|
||||
commodity.StockTakeDate = dbCommodity._StockTakeDate;
|
||||
commodity.StockTakeQty = dbCommodity._StockTakeQty;
|
||||
commodity.CommodityIdSalesProj = new SysId(dbCommodity._CommodityIdSalesProj);
|
||||
commodity.SalesProjAnnual = dbCommodity._SalesProjAnnual;
|
||||
commodity.SalesProjMonth01 = dbCommodity._SalesProjMonth01;
|
||||
commodity.SalesProjMonth02 = dbCommodity._SalesProjMonth02;
|
||||
commodity.SalesProjMonth03 = dbCommodity._SalesProjMonth03;
|
||||
commodity.SalesProjMonth04 = dbCommodity._SalesProjMonth04;
|
||||
commodity.SalesProjMonth05 = dbCommodity._SalesProjMonth05;
|
||||
commodity.SalesProjMonth06 = dbCommodity._SalesProjMonth06;
|
||||
commodity.SalesProjMonth07 = dbCommodity._SalesProjMonth07;
|
||||
commodity.SalesProjMonth08 = dbCommodity._SalesProjMonth08;
|
||||
commodity.SalesProjMonth09 = dbCommodity._SalesProjMonth09;
|
||||
commodity.SalesProjMonth10 = dbCommodity._SalesProjMonth10;
|
||||
commodity.SalesProjMonth11 = dbCommodity._SalesProjMonth11;
|
||||
commodity.SalesProjMonth12 = dbCommodity._SalesProjMonth12;
|
||||
commodity.MaterialCost = dbCommodity._MaterialCost ?? 0.0m;
|
||||
commodity.CurrencyIdMaterial = new SysId(dbCommodity._CurrencyIdMaterial ?? 0);
|
||||
commodity.ExWorksCost = dbCommodity._ExWorksCost ?? 0.0m;
|
||||
commodity.CurrencyIdExWorks = new SysId(dbCommodity._CurrencyIdExWorks ?? 0);
|
||||
commodity.ReorderLevel = dbCommodity._ReorderLevel ?? 0.0m;
|
||||
commodity.ReorderQty = dbCommodity._ReorderQty ?? 0.0m;
|
||||
commodity.QtyOnOrder = dbCommodity._QtyOnOrder ?? 0.0m;
|
||||
commodity.AssociationIdCustomer = new SysId(dbCommodity._AssIdCustomer ?? 0);
|
||||
commodity.SalesPrice = dbCommodity._SalesPrice ?? 0.0m;
|
||||
commodity.RetailPrice = dbCommodity._RetailPrice ?? 0.0m;
|
||||
commodity.RetailPricePlanned = dbCommodity._RetailPricePlanned ?? 0.0m;
|
||||
commodity.UomIdSale = new SysId(dbCommodity._UomIdSale ?? 0);
|
||||
commodity.CarriageCostIndicative = dbCommodity._CarriageCostIndicative ?? 0.0m;
|
||||
commodity.MinOrderQty = dbCommodity._MinOrderQty ?? 0.0m;
|
||||
commodity.PackQtySale = dbCommodity._PackQty ?? 0.0m;
|
||||
commodity.TaxCodeId = new SysId(dbCommodity._TaxCodeId ?? 0);
|
||||
commodity.LastOrderDate = dbCommodity._LastOrderDate ?? default(DateTime);
|
||||
commodity.LastOrderQty = dbCommodity._LastOrderQty ?? 0.0m;
|
||||
commodity.QtyInStock = dbCommodity._QtyInStock ?? 0.0m;
|
||||
commodity.QtyAllocated = dbCommodity._QtyAllocated ?? 0.0m;
|
||||
commodity.FreeStock = dbCommodity._FreeStock ?? 0.0m;
|
||||
commodity.StockTakeDate = dbCommodity._StockTakeDate ?? default(DateTime);
|
||||
commodity.StockTakeQty = dbCommodity._StockTakeQty ?? 0.0m;
|
||||
commodity.CommodityIdSalesProj = new SysId(dbCommodity._CommodityIdSalesProj ?? 0);
|
||||
commodity.SalesProjAnnual = dbCommodity._SalesProjAnnual ?? 0.0m;
|
||||
commodity.SalesProjMonth01 = dbCommodity._SalesProjMonth01 ?? 0.0m;
|
||||
commodity.SalesProjMonth02 = dbCommodity._SalesProjMonth02 ?? 0.0m;
|
||||
commodity.SalesProjMonth03 = dbCommodity._SalesProjMonth03 ?? 0.0m;
|
||||
commodity.SalesProjMonth04 = dbCommodity._SalesProjMonth04 ?? 0.0m;
|
||||
commodity.SalesProjMonth05 = dbCommodity._SalesProjMonth05 ?? 0.0m;
|
||||
commodity.SalesProjMonth06 = dbCommodity._SalesProjMonth06 ?? 0.0m;
|
||||
commodity.SalesProjMonth07 = dbCommodity._SalesProjMonth07 ?? 0.0m;
|
||||
commodity.SalesProjMonth08 = dbCommodity._SalesProjMonth08 ?? 0.0m;
|
||||
commodity.SalesProjMonth09 = dbCommodity._SalesProjMonth09 ?? 0.0m;
|
||||
commodity.SalesProjMonth10 = dbCommodity._SalesProjMonth10 ?? 0.0m;
|
||||
commodity.SalesProjMonth11 = dbCommodity._SalesProjMonth11 ?? 0.0m;
|
||||
commodity.SalesProjMonth12 = dbCommodity._SalesProjMonth12 ?? 0.0m;
|
||||
// Common properties.
|
||||
commodity.Notes = dbCommodity._Notes;
|
||||
commodity.Status = SacsSystem.GetStatusForCode(dbCommodity._Status);
|
||||
commodity.SetCreateStamp(dbCommodity._CreateOn, new SysId(dbCommodity._CreateBy), dbCommodity._CreateHost);
|
||||
commodity.SetUpdateStamp(dbCommodity._UpdateOn, new SysId(dbCommodity._UpdateBy), dbCommodity._UpdateHost);
|
||||
commodity.SetCreateStamp(dbCommodity._CreateOn, new SysId(dbCommodity._CreateBy ?? 0), dbCommodity._CreateHost);
|
||||
commodity.SetUpdateStamp(dbCommodity._UpdateOn ?? default(DateTime), new SysId(dbCommodity._UpdateBy ?? 0), dbCommodity._UpdateHost);
|
||||
commodity.AcceptChanges();
|
||||
}
|
||||
|
||||
|
||||
@@ -344,8 +344,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
// Common properties.
|
||||
commodityCustomer.Notes = dbCommodityCustomer._Notes;
|
||||
commodityCustomer.Status = SacsSystem.GetStatusForCode(dbCommodityCustomer._Status);
|
||||
commodityCustomer.SetCreateStamp(dbCommodityCustomer._CreateOn, new SysId(dbCommodityCustomer._CreateBy), dbCommodityCustomer._CreateHost);
|
||||
commodityCustomer.SetUpdateStamp(dbCommodityCustomer._UpdateOn, new SysId(dbCommodityCustomer._UpdateBy), dbCommodityCustomer._UpdateHost);
|
||||
commodityCustomer.SetCreateStamp(dbCommodityCustomer._CreateOn, new SysId(dbCommodityCustomer._CreateBy ?? 0), dbCommodityCustomer._CreateHost);
|
||||
commodityCustomer.SetUpdateStamp(dbCommodityCustomer._UpdateOn ?? default(DateTime), new SysId(dbCommodityCustomer._UpdateBy ?? 0), dbCommodityCustomer._UpdateHost);
|
||||
commodityCustomer.AcceptChanges();
|
||||
}
|
||||
|
||||
|
||||
@@ -250,13 +250,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
commoditySupplier.CommodityId = new SysId(dbCommoditySupplier._CommodityId);
|
||||
commoditySupplier.AssocIdSupplier = new SysId(dbCommoditySupplier._AssocIdSupplier);
|
||||
commoditySupplier.ProductCode = dbCommoditySupplier._ProductCode;
|
||||
commoditySupplier.AmountCost = dbCommoditySupplier._AmountCost;
|
||||
commoditySupplier.CurrencyIdCost = new SysId(dbCommoditySupplier._CurrencyIdCost);
|
||||
commoditySupplier.AmountCost = dbCommoditySupplier._AmountCost ?? 0.0m;
|
||||
commoditySupplier.CurrencyIdCost = new SysId(dbCommoditySupplier._CurrencyIdCost ?? 0);
|
||||
// Common properties.
|
||||
commoditySupplier.Notes = dbCommoditySupplier._Notes;
|
||||
commoditySupplier.Status = SacsSystem.GetStatusForCode(dbCommoditySupplier._Status);
|
||||
commoditySupplier.SetCreateStamp(dbCommoditySupplier._CreateOn, new SysId(dbCommoditySupplier._CreateBy), dbCommoditySupplier._CreateHost);
|
||||
commoditySupplier.SetUpdateStamp(dbCommoditySupplier._UpdateOn, new SysId(dbCommoditySupplier._UpdateBy), dbCommoditySupplier._UpdateHost);
|
||||
commoditySupplier.SetCreateStamp(dbCommoditySupplier._CreateOn, new SysId(dbCommoditySupplier._CreateBy ?? 0), dbCommoditySupplier._CreateHost);
|
||||
commoditySupplier.SetUpdateStamp(dbCommoditySupplier._UpdateOn ?? default(DateTime), new SysId(dbCommoditySupplier._UpdateBy ?? 0), dbCommoditySupplier._UpdateHost);
|
||||
commoditySupplier.AcceptChanges();
|
||||
}
|
||||
|
||||
|
||||
@@ -227,19 +227,19 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
private void PopulateFrom(Container_Db dbContainer, SbmContainer container)
|
||||
{
|
||||
container.Id = new SysId(dbContainer._Id);
|
||||
container.ContainerCategory = (Sbm.ContainerCategory)dbContainer._Category;
|
||||
container.ContainerCategory = (Sbm.ContainerCategory)(dbContainer._Category??0);
|
||||
container.ContainerType = (Sbm.ContainerType)ContainerTypes.GetTypeForCode(dbContainer._Type);
|
||||
container.Reference = dbContainer._Reference;
|
||||
container.DescBrief = dbContainer._DescBrief;
|
||||
container.Expected = dbContainer._Expected;
|
||||
container.Expected = dbContainer._Expected ?? default(DateTime);
|
||||
container.TagId = dbContainer._TagId;
|
||||
container.AssIdSupplier = new SysId(dbContainer._AssIdSupplier);
|
||||
container.AssIdCustomer = new SysId(dbContainer._AssIdCustomer);
|
||||
container.AssIdSupplier = new SysId(dbContainer._AssIdSupplier ?? 0);
|
||||
container.AssIdCustomer = new SysId(dbContainer._AssIdCustomer ?? 0);
|
||||
// Common properties.
|
||||
container.Notes = dbContainer._Notes;
|
||||
container.Status = SacsSystem.GetStatusForCode(dbContainer._Status);
|
||||
container.SetCreateStamp(dbContainer._CreateOn, new SysId(dbContainer._CreateBy), dbContainer._CreateHost);
|
||||
container.SetUpdateStamp(dbContainer._UpdateOn, new SysId(dbContainer._UpdateBy), dbContainer._UpdateHost);
|
||||
container.SetUpdateStamp(dbContainer._UpdateOn ?? default(DateTime), new SysId(dbContainer._UpdateBy ?? 0), dbContainer._UpdateHost);
|
||||
container.AcceptChanges();
|
||||
}
|
||||
|
||||
|
||||
@@ -264,14 +264,14 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
containerItem.ItemType = (Sbm.ItemType)dbContainerItem._ItemType;
|
||||
containerItem.ItemId = new SysId(dbContainerItem._ItemId);
|
||||
containerItem.ItemSeq = dbContainerItem._ItemSeq;
|
||||
containerItem.ItemTypeSource = (Sbm.ItemType)dbContainerItem._ItemTypeSource;
|
||||
containerItem.ItemIdSource = new SysId(dbContainerItem._ItemIdSource);
|
||||
containerItem.ItemTypeSource = (Sbm.ItemType)(dbContainerItem._ItemTypeSource ?? 0);
|
||||
containerItem.ItemIdSource = new SysId(dbContainerItem._ItemIdSource ?? 0);
|
||||
containerItem.Quantity = dbContainerItem._Quantity;
|
||||
// Common properties.
|
||||
containerItem.Notes = dbContainerItem._Notes;
|
||||
containerItem.Status = SacsSystem.GetStatusForCode(dbContainerItem._Status);
|
||||
containerItem.SetCreateStamp(dbContainerItem._CreateOn, new SysId(dbContainerItem._CreateBy), dbContainerItem._CreateHost);
|
||||
containerItem.SetUpdateStamp(dbContainerItem._UpdateOn, new SysId(dbContainerItem._UpdateBy), dbContainerItem._UpdateHost);
|
||||
containerItem.SetUpdateStamp(dbContainerItem._UpdateOn ?? default(DateTime), new SysId(dbContainerItem._UpdateBy ?? 0), dbContainerItem._UpdateHost);
|
||||
containerItem.AcceptChanges();
|
||||
}
|
||||
|
||||
|
||||
@@ -575,12 +575,12 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
portfolioItem.Caption = dbPortfolioItem._Caption;
|
||||
portfolioItem.DescBrief = dbPortfolioItem._DescBrief;
|
||||
portfolioItem.DescDetail = dbPortfolioItem._DescDetail;
|
||||
portfolioItem.CommodityId = new SysId(dbPortfolioItem._CommodityId);
|
||||
portfolioItem.CommodityId = new SysId(dbPortfolioItem._CommodityId ?? 0);
|
||||
// Common properties.
|
||||
portfolioItem.Notes = dbPortfolioItem._Notes;
|
||||
portfolioItem.Status = SacsSystem.GetStatusForCode(dbPortfolioItem._Status);
|
||||
portfolioItem.SetCreateStamp(dbPortfolioItem._CreateOn, new SysId(dbPortfolioItem._CreateBy), dbPortfolioItem._CreateHost);
|
||||
portfolioItem.SetUpdateStamp(dbPortfolioItem._UpdateOn, new SysId(dbPortfolioItem._UpdateBy), dbPortfolioItem._UpdateHost);
|
||||
portfolioItem.SetCreateStamp(dbPortfolioItem._CreateOn ?? default(DateTime), new SysId(dbPortfolioItem._CreateBy ?? 0), dbPortfolioItem._CreateHost);
|
||||
portfolioItem.SetUpdateStamp(dbPortfolioItem._UpdateOn ?? default(DateTime), new SysId(dbPortfolioItem._UpdateBy ?? 0), dbPortfolioItem._UpdateHost);
|
||||
portfolioItem.AcceptChanges();
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
// Database properties.
|
||||
protected ISacsDatabase Database { get { return db; } }
|
||||
protected SbmDbDataItem.SbmDatabaseInfo DbInfo { get { return dbInfo; } }
|
||||
public String TableName_PortfolioItem { get { return SbmDbDfn.GetTableName(SbmDbDfn.TableIdx.ContainerItem); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Database utilities.
|
||||
|
||||
public override bool ContainerDatabaseIsValid
|
||||
{
|
||||
get
|
||||
@@ -48,7 +53,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
return true;
|
||||
}
|
||||
}
|
||||
public String TableName_PortfolioItem { get { return SbmDbDfn.GetTableName(SbmDbDfn.TableIdx.ContainerItem); } }
|
||||
|
||||
public override bool ColumnExists(SbmDbDfn.ColumnIdx columnIdx)
|
||||
{
|
||||
SbmDbDfn.TableIdx tableIdx = SbmDbDfn.GetTableForColumn(columnIdx);
|
||||
String schemaName = SbmDbDfn.GetSchemaName(tableIdx, false);
|
||||
String tableName = SbmDbDfn.GetTableName(tableIdx, false);
|
||||
String columnName = SbmDbDfn.GetColumnName(columnIdx, false);
|
||||
return DbInfo.ColumnExists(schemaName, tableName, columnName);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
|
||||
@@ -230,7 +230,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
{
|
||||
//itemBatch.Id = new SysId(dbItemBatch._Id);
|
||||
itemBatch.AffiliateIdOwner = new SysId(dbItemBatch._AffIdOwner);
|
||||
itemBatch.ItemBatchType = (Sbm.ItemBatchType)dbItemBatch._Type;
|
||||
itemBatch.ItemBatchType = (Sbm.ItemBatchType)(dbItemBatch._Type ?? 0);
|
||||
itemBatch.Ref = dbItemBatch._Ref;
|
||||
itemBatch.DescBrief = dbItemBatch._DescBrief;
|
||||
itemBatch.ProcessType = dbItemBatch._ProcessType;
|
||||
@@ -238,7 +238,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
itemBatch.Notes = dbItemBatch._Notes;
|
||||
itemBatch.Status = SacsSystem.GetStatusForCode(dbItemBatch._Status);
|
||||
itemBatch.SetCreateStamp(dbItemBatch._CreateOn, new SysId(dbItemBatch._CreateBy), dbItemBatch._CreateHost);
|
||||
itemBatch.SetUpdateStamp(dbItemBatch._UpdateOn, new SysId(dbItemBatch._UpdateBy), dbItemBatch._UpdateHost);
|
||||
itemBatch.SetUpdateStamp(dbItemBatch._UpdateOn ?? default(DateTime), new SysId(dbItemBatch._UpdateBy ?? 0), dbItemBatch._UpdateHost);
|
||||
itemBatch.AcceptChanges();
|
||||
}
|
||||
|
||||
|
||||
@@ -355,13 +355,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
itemLink.ItemTypeTo = (Sbm.ItemType)dbItemLink._ItemTypeTo;
|
||||
itemLink.ItemIdTo = new SysId(dbItemLink._ItemIdTo);
|
||||
itemLink.Seq = dbItemLink._Seq;
|
||||
itemLink.Completed = dbItemLink._Completed;
|
||||
itemLink.Completed = dbItemLink._Completed ?? default(DateTime);
|
||||
itemLink.DataContent = dbItemLink._DataContent;
|
||||
// Common properties.
|
||||
itemLink.Notes = dbItemLink._Notes;
|
||||
itemLink.Status = SacsSystem.GetStatusForCode(dbItemLink._Status);
|
||||
itemLink.SetCreateStamp(dbItemLink._CreateOn, new SysId(dbItemLink._CreateBy), dbItemLink._CreateHost);
|
||||
itemLink.SetUpdateStamp(dbItemLink._UpdateOn, new SysId(dbItemLink._UpdateBy), dbItemLink._UpdateHost);
|
||||
itemLink.SetCreateStamp(dbItemLink._CreateOn ?? default(DateTime), new SysId(dbItemLink._CreateBy ?? 0), dbItemLink._CreateHost);
|
||||
itemLink.SetUpdateStamp(dbItemLink._UpdateOn ?? default(DateTime), new SysId(dbItemLink._UpdateBy ?? 0), dbItemLink._UpdateHost);
|
||||
itemLink.AcceptChanges();
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ using Sarand.BusinessMgr.Net.Standard.Base.Mgr;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Dbas.Base;
|
||||
using System;
|
||||
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
{
|
||||
@@ -35,6 +36,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
//-------------------------------------------------------------------
|
||||
// Utilities.
|
||||
|
||||
public override bool ColumnExists(SbmDbDfn.ColumnIdx columnIdx)
|
||||
{
|
||||
SbmDbDfn.TableIdx tableIdx = SbmDbDfn.GetTableForColumn(columnIdx);
|
||||
String schemaName = SbmDbDfn.GetSchemaName(tableIdx, false);
|
||||
String tableName = SbmDbDfn.GetTableName(tableIdx, false);
|
||||
String columnName = SbmDbDfn.GetColumnName(columnIdx, false);
|
||||
return DbInfo.ColumnExists(schemaName, tableName, columnName);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
|
||||
@@ -223,17 +223,17 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
//price.PriceSetId = new SysId(dbPrice._PriceSetId);
|
||||
//price.CommodityId = new SysId(dbPrice._CommodityId);
|
||||
//price.PriceType = (Sbm.PriceType)dbPrice._Type;
|
||||
price.CalculationMethod = (Sbm.PriceCalcMethod)dbPrice._CalcMethod;
|
||||
price.CalculationValue = dbPrice._CalcValue;
|
||||
price.RounderMethod = (Sbm.PriceRounderMethod)dbPrice._RounderMethod;
|
||||
price.RounderDirection = (Sbm.PriceRounderDirection)dbPrice._RounderDirection;
|
||||
price.RounderMultipleOf = dbPrice._RounderMultipleOf;
|
||||
price.RounderAdjustment = dbPrice._RounderAdjustment;
|
||||
price.CalculationMethod = (Sbm.PriceCalcMethod)(dbPrice._CalcMethod ?? 0);
|
||||
price.CalculationValue = dbPrice._CalcValue ?? 0.0m;
|
||||
price.RounderMethod = (Sbm.PriceRounderMethod)(dbPrice._RounderMethod ?? 0);
|
||||
price.RounderDirection = (Sbm.PriceRounderDirection)(dbPrice._RounderDirection ?? 0);
|
||||
price.RounderMultipleOf = dbPrice._RounderMultipleOf ?? 0.0m;
|
||||
price.RounderAdjustment = dbPrice._RounderAdjustment ?? 0.0m;
|
||||
// Common properties.
|
||||
price.Notes = dbPrice._Notes;
|
||||
price.Status = SacsSystem.GetStatusForCode(dbPrice._Status);
|
||||
price.SetCreateStamp(dbPrice._CreateOn, new SysId(dbPrice._CreateBy), dbPrice._CreateHost);
|
||||
price.SetUpdateStamp(dbPrice._UpdateOn, new SysId(dbPrice._UpdateBy), dbPrice._UpdateHost);
|
||||
price.SetCreateStamp(dbPrice._CreateOn ?? default(DateTime), new SysId(dbPrice._CreateBy ?? 0), dbPrice._CreateHost);
|
||||
price.SetUpdateStamp(dbPrice._UpdateOn ?? default(DateTime), new SysId(dbPrice._UpdateBy ?? 0), dbPrice._UpdateHost);
|
||||
price.AcceptChanges();
|
||||
}
|
||||
|
||||
|
||||
@@ -225,14 +225,14 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
//priceSet.Id = new SysId(dbPriceSet._Id);
|
||||
//priceSet.AffiliateIdOwner = new SysId(dbPriceSet._AffIdOwner);
|
||||
//priceSet.Reference = dbPriceSet._Ref;
|
||||
priceSet.PriceType = (Sbm.PriceType)dbPriceSet._Type;
|
||||
priceSet.PriceType = (Sbm.PriceType)(dbPriceSet._Type??0);
|
||||
priceSet.Name = dbPriceSet._Name;
|
||||
priceSet.CurrencyId = new SysId(dbPriceSet._CurrencyId);
|
||||
priceSet.CurrencyId = new SysId(dbPriceSet._CurrencyId ?? 0);
|
||||
// Common properties.
|
||||
priceSet.Notes = dbPriceSet._Notes;
|
||||
priceSet.Status = SacsSystem.GetStatusForCode(dbPriceSet._Status);
|
||||
priceSet.SetCreateStamp(dbPriceSet._CreateOn, new SysId(dbPriceSet._CreateBy), dbPriceSet._CreateHost);
|
||||
priceSet.SetUpdateStamp(dbPriceSet._UpdateOn, new SysId(dbPriceSet._UpdateBy), dbPriceSet._UpdateHost);
|
||||
priceSet.SetCreateStamp(dbPriceSet._CreateOn ?? default(DateTime), new SysId(dbPriceSet._CreateBy ?? 0), dbPriceSet._CreateHost);
|
||||
priceSet.SetUpdateStamp(dbPriceSet._UpdateOn ?? default(DateTime), new SysId(dbPriceSet._UpdateBy ?? 0), dbPriceSet._UpdateHost);
|
||||
priceSet.AcceptChanges();
|
||||
}
|
||||
|
||||
|
||||
@@ -39,6 +39,17 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
protected String TableName_Price { get { return SbmDbDfn.GetTableName(SbmDbDfn.TableIdx.SaPriceSet); } }
|
||||
public override bool PriceDatabaseIsValid { get { return Database.TableExists(TableName_PriceSet) && Database.TableExists(TableName_Price); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Database utilities.
|
||||
public override bool ColumnExists(SbmDbDfn.ColumnIdx columnIdx)
|
||||
{
|
||||
SbmDbDfn.TableIdx tableIdx = SbmDbDfn.GetTableForColumn(columnIdx);
|
||||
String schemaName = SbmDbDfn.GetSchemaName(tableIdx, false);
|
||||
String tableName = SbmDbDfn.GetTableName(tableIdx, false);
|
||||
String columnName = SbmDbDfn.GetColumnName(columnIdx, false);
|
||||
return DbInfo.ColumnExists(schemaName, tableName, columnName);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
|
||||
@@ -133,7 +133,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
private SbmProcess_Dbas CreateProcess(Process_Db dbProcess)
|
||||
{
|
||||
ClearErrorState();
|
||||
SbmProcess_Dbas process = new SbmProcess_Dbas(Internals, new SysId(dbProcess._Id), new SysId(dbProcess._AffIdOwner), (Sbm.ProcessCategory)dbProcess._Category, (ushort)dbProcess._Flags);
|
||||
SbmProcess_Dbas process = new SbmProcess_Dbas(Internals, new SysId(dbProcess._Id), new SysId(dbProcess._AffIdOwner ?? 0), (Sbm.ProcessCategory)dbProcess._Category, (ushort)dbProcess._Flags);
|
||||
PopulateFrom(dbProcess, process);
|
||||
return process;
|
||||
}
|
||||
@@ -275,16 +275,16 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
private void PopulateFrom(Process_Db dbProcess, SbmProcess process)
|
||||
{
|
||||
//process.Id = new SysId(dbProcess._Id);
|
||||
process.ProcessCategory = (Sbm.ProcessCategory)dbProcess._Category;
|
||||
process.ProcessType = (Sbm.ProcessType)dbProcess._Type;
|
||||
process.Seq = dbProcess._Seq;
|
||||
process.ProcessCategory = (Sbm.ProcessCategory)(dbProcess._Category ?? 0);
|
||||
process.ProcessType = (Sbm.ProcessType)(dbProcess._Type ?? 0);
|
||||
process.Seq = dbProcess._Seq ?? 0;
|
||||
process.DescBrief = dbProcess._DescBrief;
|
||||
process.DescOutline = dbProcess._DescOutline;
|
||||
// Common properties.
|
||||
process.Notes = dbProcess._Notes;
|
||||
process.Status = SacsSystem.GetStatusForCode(dbProcess._Status);
|
||||
process.SetCreateStamp(dbProcess._CreateOn, new SysId(dbProcess._CreateBy), dbProcess._CreateHost);
|
||||
process.SetUpdateStamp(dbProcess._UpdateOn, new SysId(dbProcess._UpdateBy), dbProcess._UpdateHost);
|
||||
process.SetCreateStamp(dbProcess._CreateOn ?? default(DateTime), new SysId(dbProcess._CreateBy ?? 0), dbProcess._CreateHost);
|
||||
process.SetUpdateStamp(dbProcess._UpdateOn ?? default(DateTime), new SysId(dbProcess._UpdateBy ?? 0), dbProcess._UpdateHost);
|
||||
process.AcceptChanges();
|
||||
}
|
||||
|
||||
|
||||
@@ -47,6 +47,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
//-------------------------------------------------------------------
|
||||
// Utilities.
|
||||
|
||||
public override bool ColumnExists(SbmDbDfn.ColumnIdx columnIdx)
|
||||
{
|
||||
SbmDbDfn.TableIdx tableIdx = SbmDbDfn.GetTableForColumn(columnIdx);
|
||||
String schemaName = SbmDbDfn.GetSchemaName(tableIdx, false);
|
||||
String tableName = SbmDbDfn.GetTableName(tableIdx, false);
|
||||
String columnName = SbmDbDfn.GetColumnName(columnIdx, false);
|
||||
return DbInfo.ColumnExists(schemaName, tableName, columnName);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
|
||||
@@ -231,7 +231,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
location.Notes = dbLocation._Notes;
|
||||
location.Status = SacsSystem.GetStatusForCode(dbLocation._Status);
|
||||
location.SetCreateStamp(dbLocation._CreateOn, new SysId(dbLocation._CreateBy), dbLocation._CreateHost);
|
||||
location.SetUpdateStamp(dbLocation._UpdateOn, new SysId(dbLocation._UpdateBy), dbLocation._UpdateHost);
|
||||
location.SetUpdateStamp(dbLocation._UpdateOn ?? default(DateTime), new SysId(dbLocation._UpdateBy ?? 0), dbLocation._UpdateHost);
|
||||
location.AcceptChanges();
|
||||
}
|
||||
|
||||
|
||||
@@ -352,19 +352,19 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
movement.Id = new SysId(dbMovement._Id);
|
||||
movement.ItemType = (Sbm.ItemType)dbMovement._ItemType;
|
||||
movement.ItemId = new SysId(dbMovement._ItemId);
|
||||
movement.MovementType = (Sbm.MovementType)dbMovement._Type;
|
||||
movement.Movement = dbMovement._Movement;
|
||||
movement.LocationIdFrom = new SysId(dbMovement._LocationIdFrom);
|
||||
movement.LocationIdTo = new SysId(dbMovement._LocationIdTo);
|
||||
movement.MovementType = (Sbm.MovementType)(dbMovement._Type ?? 0);
|
||||
movement.Movement = dbMovement._Movement ?? default(DateTime);
|
||||
movement.LocationIdFrom = new SysId(dbMovement._LocationIdFrom ?? 0);
|
||||
movement.LocationIdTo = new SysId(dbMovement._LocationIdTo ?? 0);
|
||||
movement.Quantity = dbMovement._Quantity;
|
||||
movement.MovementIdSource = new SysId(dbMovement._MovementIdSource);
|
||||
movement.ItemTypeSource = (Sbm.ItemType)dbMovement._ItemTypeSource;
|
||||
movement.ItemIdSource = new SysId(dbMovement._ItemIdSource);
|
||||
movement.MovementIdSource = new SysId(dbMovement._MovementIdSource ?? 0);
|
||||
movement.ItemTypeSource = (Sbm.ItemType)(dbMovement._ItemTypeSource ?? 0);
|
||||
movement.ItemIdSource = new SysId(dbMovement._ItemIdSource ?? 0);
|
||||
// Common properties.
|
||||
movement.Notes = dbMovement._Notes;
|
||||
movement.Status = SacsSystem.GetStatusForCode(dbMovement._Status);
|
||||
movement.SetCreateStamp(dbMovement._CreateOn, new SysId(dbMovement._CreateBy), dbMovement._CreateHost);
|
||||
movement.SetUpdateStamp(dbMovement._UpdateOn, new SysId(dbMovement._UpdateBy), dbMovement._UpdateHost);
|
||||
movement.SetUpdateStamp(dbMovement._UpdateOn ?? default(DateTime), new SysId(dbMovement._UpdateBy ?? 0), dbMovement._UpdateHost);
|
||||
movement.AcceptChanges();
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ using Sarand.BusinessMgr.Net.Standard.Base.Mgr;
|
||||
using Sarand.BusinessMgr.Net.Standard.Dbas.Data;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Dbas.Base;
|
||||
using System;
|
||||
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
{
|
||||
@@ -42,6 +43,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool ColumnExists(SbmDbDfn.ColumnIdx columnIdx)
|
||||
{
|
||||
SbmDbDfn.TableIdx tableIdx = SbmDbDfn.GetTableForColumn(columnIdx);
|
||||
String schemaName = SbmDbDfn.GetSchemaName(tableIdx, false);
|
||||
String tableName = SbmDbDfn.GetTableName(tableIdx, false);
|
||||
String columnName = SbmDbDfn.GetColumnName(columnIdx, false);
|
||||
return DbInfo.ColumnExists(schemaName, tableName, columnName);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
|
||||
@@ -350,7 +350,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
private SbmConstituent_Dbas CreateConstituent(Constituent_Db dbConstituent)
|
||||
{
|
||||
ClearErrorState();
|
||||
SbmConstituent_Dbas constituent = new SbmConstituent_Dbas(Internals, new SysId(dbConstituent._Id), new SysId(dbConstituent._AffIdOwner), new SysId(dbConstituent._AssocId), (Sbm.ConstituentType)dbConstituent._Type, (ushort)dbConstituent._Flags);
|
||||
SbmConstituent_Dbas constituent = new SbmConstituent_Dbas(Internals, new SysId(dbConstituent._Id), new SysId(dbConstituent._AffIdOwner), new SysId(dbConstituent._AssocId ?? 0), (Sbm.ConstituentType)dbConstituent._Type, (ushort)dbConstituent._Flags);
|
||||
PopulateFrom(dbConstituent, constituent);
|
||||
return constituent;
|
||||
}
|
||||
@@ -521,43 +521,43 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
{
|
||||
//constituent.Id = new SysId(dbConstituent._Id);
|
||||
constituent.AffiliateIdOwner = new SysId(dbConstituent._AffIdOwner);
|
||||
constituent.AffiliateIdTarget = new SysId(dbConstituent._AffIdTarget);
|
||||
constituent.AssociationId = new SysId(dbConstituent._AssocId);
|
||||
constituent.TransactionId = new SysId(dbConstituent._TransId);
|
||||
constituent.RequirementId = new SysId(dbConstituent._ReqntId);
|
||||
constituent.ConstituentId = new SysId(dbConstituent._ConstId);
|
||||
constituent.AssetId = new SysId(dbConstituent._AssetId);
|
||||
constituent.ProcessId = new SysId(dbConstituent._ProcessId);
|
||||
constituent.AssociationIdContractor = new SysId(dbConstituent._AssocIdContractor);
|
||||
constituent.ConstituentType = (Sbm.ConstituentType)dbConstituent._Type;
|
||||
constituent.Seq = dbConstituent._Seq;
|
||||
constituent.Effective = dbConstituent._Effective;
|
||||
constituent.Required = dbConstituent._Required;
|
||||
constituent.Started = dbConstituent._Started;
|
||||
constituent.Completed = dbConstituent._Completed;
|
||||
constituent.AffiliateIdTarget = new SysId(dbConstituent._AffIdTarget ?? 0);
|
||||
constituent.AssociationId = new SysId(dbConstituent._AssocId ?? 0);
|
||||
constituent.TransactionId = new SysId(dbConstituent._TransId ?? 0);
|
||||
constituent.RequirementId = new SysId(dbConstituent._ReqntId ?? 0);
|
||||
constituent.ConstituentId = new SysId(dbConstituent._ConstId ?? 0);
|
||||
constituent.AssetId = new SysId(dbConstituent._AssetId ?? 0);
|
||||
constituent.ProcessId = new SysId(dbConstituent._ProcessId ?? 0);
|
||||
constituent.AssociationIdContractor = new SysId(dbConstituent._AssocIdContractor ?? 0);
|
||||
constituent.ConstituentType = (Sbm.ConstituentType)(dbConstituent._Type ?? 0);
|
||||
constituent.Seq = dbConstituent._Seq ?? 0;
|
||||
constituent.Effective = dbConstituent._Effective ?? default(DateTime);
|
||||
constituent.Required = dbConstituent._Required ?? default(DateTime);
|
||||
constituent.Started = dbConstituent._Started ?? default(DateTime);
|
||||
constituent.Completed = dbConstituent._Completed ?? default(DateTime);
|
||||
constituent.DescBrief = dbConstituent._DescBrief;
|
||||
constituent.DescOutline = dbConstituent._DescOutline;
|
||||
constituent.DescDetail = dbConstituent._DescDetail;
|
||||
constituent.TaskNumber = dbConstituent._TaskNumber.ToString();
|
||||
constituent.Priority = dbConstituent._Priority;
|
||||
constituent.Priority = dbConstituent._Priority ?? 0;
|
||||
constituent.Category = dbConstituent._Category;
|
||||
constituent.Reference = dbConstituent._Reference;
|
||||
constituent.Quantity = dbConstituent._Quantity;
|
||||
constituent.UomId = new SysId(dbConstituent._UomId);
|
||||
constituent.UnitCost = dbConstituent._UnitCost;
|
||||
constituent.AmountEst = dbConstituent._AmountEst;
|
||||
constituent.AmountNet = dbConstituent._AmountNet;
|
||||
constituent.TaxCodeId = new SysId(dbConstituent._TaxCodeId);
|
||||
constituent.TaxRate = dbConstituent._TaxRate;
|
||||
constituent.AmountTax = dbConstituent._AmountTax;
|
||||
constituent.AmountTot = dbConstituent._AmountTot;
|
||||
constituent.TaxRateRebate = dbConstituent._TaxRateRebate;
|
||||
constituent.AmountTaxRebate = dbConstituent._AmountTaxRebate;
|
||||
constituent.Quantity = dbConstituent._Quantity ?? 0.0m;
|
||||
constituent.UomId = new SysId(dbConstituent._UomId ?? 0);
|
||||
constituent.UnitCost = dbConstituent._UnitCost ?? 0.0m;
|
||||
constituent.AmountEst = dbConstituent._AmountEst ?? 0.0m;
|
||||
constituent.AmountNet = dbConstituent._AmountNet ?? 0.0m;
|
||||
constituent.TaxCodeId = new SysId(dbConstituent._TaxCodeId ?? 0);
|
||||
constituent.TaxRate = dbConstituent._TaxRate ?? 0.0m;
|
||||
constituent.AmountTax = dbConstituent._AmountTax ?? 0.0m;
|
||||
constituent.AmountTot = dbConstituent._AmountTot ?? 0.0m;
|
||||
constituent.TaxRateRebate = dbConstituent._TaxRateRebate ?? 0.0m;
|
||||
constituent.AmountTaxRebate = dbConstituent._AmountTaxRebate ?? 0.0m;
|
||||
// Common properties.
|
||||
constituent.Notes = dbConstituent._Notes;
|
||||
constituent.Status = SacsSystem.GetStatusForCode(dbConstituent._Status);
|
||||
constituent.SetCreateStamp(dbConstituent._CreateOn, new SysId(dbConstituent._CreateBy), dbConstituent._CreateHost);
|
||||
constituent.SetUpdateStamp(dbConstituent._UpdateOn, new SysId(dbConstituent._UpdateBy), dbConstituent._UpdateHost);
|
||||
constituent.SetCreateStamp(dbConstituent._CreateOn ?? default(DateTime), new SysId(dbConstituent._CreateBy ?? 0), dbConstituent._CreateHost);
|
||||
constituent.SetUpdateStamp(dbConstituent._UpdateOn ?? default(DateTime), new SysId(dbConstituent._UpdateBy ?? 0), dbConstituent._UpdateHost);
|
||||
constituent.AcceptChanges();
|
||||
}
|
||||
|
||||
|
||||
@@ -414,7 +414,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
private SbmRequirement_Dbas CreateRequirement(Requirement_Db dbRequirement)
|
||||
{
|
||||
ClearErrorState();
|
||||
SbmRequirement_Dbas requirement = new SbmRequirement_Dbas(Internals, new SysId(dbRequirement._Id), new SysId(dbRequirement._AffIdOwner), new SysId(dbRequirement._AssocId), new SysId(dbRequirement._TransId), (Sbm.RequirementType)dbRequirement._Type, (ushort)dbRequirement._Flags);
|
||||
SbmRequirement_Dbas requirement = new SbmRequirement_Dbas(Internals, new SysId(dbRequirement._Id), new SysId(dbRequirement._AffIdOwner), new SysId(dbRequirement._AssocId ?? 0), new SysId(dbRequirement._TransId ?? 0), (Sbm.RequirementType)dbRequirement._Type, (ushort)dbRequirement._Flags);
|
||||
PopulateFrom(dbRequirement, requirement);
|
||||
return requirement;
|
||||
}
|
||||
@@ -596,19 +596,19 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
{
|
||||
//requirement.Id = new SysId(dbRequirement._Id);
|
||||
requirement.AffiliateIdOwner = new SysId(dbRequirement._AffIdOwner);
|
||||
requirement.AssociationId = new SysId(dbRequirement._AssocId);
|
||||
requirement.TransactionId = new SysId(dbRequirement._TransId);
|
||||
requirement.RequirementType = (Sbm.RequirementType)dbRequirement._Type;
|
||||
requirement.Seq = dbRequirement._Seq;
|
||||
requirement.RequirementIdSource = new SysId(dbRequirement._ReqntIdSource);
|
||||
requirement.Required = dbRequirement._Required;
|
||||
requirement.Started = dbRequirement._Started;
|
||||
requirement.Completed = dbRequirement._Completed;
|
||||
requirement.AssociationId = new SysId(dbRequirement._AssocId ?? 0);
|
||||
requirement.TransactionId = new SysId(dbRequirement._TransId ?? 0);
|
||||
requirement.RequirementType = (Sbm.RequirementType)(dbRequirement._Type??0);
|
||||
requirement.Seq = dbRequirement._Seq ?? 0;
|
||||
requirement.RequirementIdSource = new SysId(dbRequirement._ReqntIdSource ?? 0);
|
||||
requirement.Required = dbRequirement._Required ?? default(DateTime);
|
||||
requirement.Started = dbRequirement._Started ?? default(DateTime);
|
||||
requirement.Completed = dbRequirement._Completed ?? default(DateTime);
|
||||
requirement.JobNumber = dbRequirement._JobNumber;
|
||||
requirement.AssociationIdSubContract = new SysId(dbRequirement._AssIdSubcontract);
|
||||
requirement.CommodityId = new SysId(dbRequirement._CommodityId);
|
||||
requirement.AssociationIdSubContract = new SysId(dbRequirement._AssIdSubcontract ?? 0);
|
||||
requirement.CommodityId = new SysId(dbRequirement._CommodityId ?? 0);
|
||||
requirement.ProductCode = dbRequirement._ProductCode;
|
||||
requirement.AssetId = new SysId(dbRequirement._AssetId);
|
||||
requirement.AssetId = new SysId(dbRequirement._AssetId ?? 0);
|
||||
requirement.DescBrief = dbRequirement._DescBrief;
|
||||
requirement.DescIntro = dbRequirement._DescIntro;
|
||||
requirement.DescOutline = dbRequirement._DescOutline;
|
||||
@@ -617,33 +617,31 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
requirement.NominalCode = dbRequirement._NominalCode;
|
||||
requirement.Quantity = (decimal)dbRequirement._Quantity;
|
||||
requirement.QuantityProd = (decimal)dbRequirement._QuantityProd;
|
||||
requirement.UomId = new SysId(dbRequirement._UomId);
|
||||
requirement.UomId = new SysId(dbRequirement._UomId ?? 0);
|
||||
requirement.MaterialSourceCode = dbRequirement._MaterialSourceCode;
|
||||
requirement.AmountNet = (decimal)dbRequirement._AmountNet;
|
||||
requirement.TaxCodeId = new SysId(dbRequirement._TaxCodeId);
|
||||
requirement.TaxCodeId = new SysId(dbRequirement._TaxCodeId ?? 0);
|
||||
requirement.TaxRate = (decimal)dbRequirement._TaxRate;
|
||||
requirement.AmountTax = (decimal)dbRequirement._AmountTax;
|
||||
requirement.AmountTot = (decimal)dbRequirement._AmountTot;
|
||||
/*requirement. TaxRateRebate = (decimal)dbRequirement._TaxRateRebate;
|
||||
requirement.AmountTaxRebate = (decimal)dbRequirement._AmountTaxRebate;*/
|
||||
requirement.TimeEst = (decimal)dbRequirement._TimeEst;
|
||||
requirement.TimeAct = (decimal)dbRequirement._TimeAct;
|
||||
requirement.TimeTot = (decimal)dbRequirement._TimeTot;
|
||||
requirement.LocationIdStock = new SysId(dbRequirement._LocationIdStock);
|
||||
requirement.CostLabourHours = dbRequirement._CostLabourHours;
|
||||
requirement.CostLabourRateHour = dbRequirement._CostLabourRateHour;
|
||||
requirement.CostLabour = dbRequirement._CostLabour;
|
||||
requirement.CostCommodity = dbRequirement._CostCommodity;
|
||||
requirement.CostPurchase = dbRequirement._CostPurchase;
|
||||
requirement.CostProcess = dbRequirement._CostProcess;
|
||||
requirement.CostAdditional = dbRequirement._CostAdditional;
|
||||
requirement.CostTotal = dbRequirement._CostTotal;
|
||||
requirement.CostCalculated = dbRequirement._CostCalculated;
|
||||
requirement.LocationIdStock = new SysId(dbRequirement._LocationIdStock ?? 0);
|
||||
requirement.CostLabourHours = dbRequirement._CostLabourHours ?? 0.0m;
|
||||
requirement.CostLabourRateHour = dbRequirement._CostLabourRateHour ?? 0.0m;
|
||||
requirement.CostLabour = dbRequirement._CostLabour ?? 0.0m;
|
||||
requirement.CostCommodity = dbRequirement._CostCommodity ?? 0.0m;
|
||||
requirement.CostPurchase = dbRequirement._CostPurchase ?? 0.0m;
|
||||
requirement.CostProcess = dbRequirement._CostProcess ?? 0.0m;
|
||||
requirement.CostAdditional = dbRequirement._CostAdditional ?? 0.0m;
|
||||
requirement.CostTotal = dbRequirement._CostTotal ?? 0.0m;
|
||||
requirement.CostCalculated = dbRequirement._CostCalculated ?? default(DateTime);
|
||||
// Common properties.
|
||||
requirement.Notes = dbRequirement._Notes;
|
||||
requirement.Status = SacsSystem.GetStatusForCode(dbRequirement._Status);
|
||||
requirement.SetCreateStamp(dbRequirement._CreateOn, new SysId(dbRequirement._CreateBy), dbRequirement._CreateHost);
|
||||
requirement.SetUpdateStamp(dbRequirement._UpdateOn, new SysId(dbRequirement._UpdateBy), dbRequirement._UpdateHost);
|
||||
requirement.SetCreateStamp(dbRequirement._CreateOn ?? default(DateTime), new SysId(dbRequirement._CreateBy ?? 0), dbRequirement._CreateHost);
|
||||
requirement.SetUpdateStamp(dbRequirement._UpdateOn ?? default(DateTime), new SysId(dbRequirement._UpdateBy ?? 0), dbRequirement._UpdateHost);
|
||||
requirement.AcceptChanges();
|
||||
}
|
||||
|
||||
|
||||
@@ -474,7 +474,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
private SbmTransaction_Dbas CreateTransaction(Transaction_Db dbTransaction)
|
||||
{
|
||||
ClearErrorState();
|
||||
SbmTransaction_Dbas transaction = new SbmTransaction_Dbas(Internals, new SysId(dbTransaction._Id), new SysId(dbTransaction._AffIdOwner), new SysId(dbTransaction._AssocId), (Sbm.TransactionType)dbTransaction._Type, (ushort)dbTransaction._Flags);
|
||||
SbmTransaction_Dbas transaction = new SbmTransaction_Dbas(Internals, new SysId(dbTransaction._Id), new SysId(dbTransaction._AffIdOwner ?? 0), new SysId(dbTransaction._AssocId), (Sbm.TransactionType)dbTransaction._Type, (ushort)dbTransaction._Flags);
|
||||
PopulateFrom(dbTransaction, transaction);
|
||||
return transaction;
|
||||
}
|
||||
@@ -699,29 +699,29 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
private void PopulateFrom(Transaction_Db dbTransaction, SbmTransaction transaction)
|
||||
{
|
||||
//transaction.Id = new SysId(dbTransaction._Id);
|
||||
transaction.AffiliateIdOwner = new SysId(dbTransaction._AffIdOwner);
|
||||
transaction.AffiliateIdOwner = new SysId(dbTransaction._AffIdOwner ?? 0);
|
||||
transaction.AssociationId = new SysId(dbTransaction._AssocId);
|
||||
transaction.TransactionType = (Sbm.TransactionType)dbTransaction._Type;
|
||||
transaction.TransactionType = (Sbm.TransactionType)(dbTransaction._Type ?? 0);
|
||||
transaction.Ref = dbTransaction._Ref;
|
||||
transaction.RefInt = dbTransaction._RefInt;
|
||||
transaction.RefInt = dbTransaction._RefInt ?? 0;
|
||||
transaction.RefExt = dbTransaction._RefExt;
|
||||
transaction.RaisedBy = dbTransaction._RaisedBy;
|
||||
transaction.AffiliateIdRaise = new SysId(dbTransaction._AffIdRaise);
|
||||
transaction.AssociationIdOffice = new SysId(dbTransaction._AssocIdOffice);
|
||||
transaction.AffiliateIdRaise = new SysId(dbTransaction._AffIdRaise ?? 0);
|
||||
transaction.AssociationIdOffice = new SysId(dbTransaction._AssocIdOffice ?? 0);
|
||||
transaction.ContactName = dbTransaction._ContactName;
|
||||
transaction.Likelihood = dbTransaction._Likelihood;
|
||||
transaction.TransactionIdSource = new SysId(dbTransaction._TransIdSource);
|
||||
transaction.TransactionIdSource = new SysId(dbTransaction._TransIdSource ?? 0);
|
||||
transaction.ReferCode = dbTransaction._ReferCode;
|
||||
transaction.ReferSource = dbTransaction._ReferSource;
|
||||
transaction.AffiliateIdRefer = new SysId(dbTransaction._AffIdRefer);
|
||||
transaction.AssociationIdContract = new SysId(dbTransaction._AssocIdContract);
|
||||
transaction.AssociationIdDelivery = new SysId(dbTransaction._AssIdDeliver);
|
||||
transaction.Raised = dbTransaction._Raised;
|
||||
transaction.Required = dbTransaction._Required;
|
||||
transaction.InProgress = dbTransaction._InProgress;
|
||||
transaction.DeliveredEst = dbTransaction._DeliveredEst;
|
||||
transaction.DeliveredAct = dbTransaction._DeliveredAct;
|
||||
transaction.Closed = dbTransaction._Closed;
|
||||
transaction.AffiliateIdRefer = new SysId(dbTransaction._AffIdRefer ?? 0);
|
||||
transaction.AssociationIdContract = new SysId(dbTransaction._AssocIdContract ?? 0);
|
||||
transaction.AssociationIdDelivery = new SysId(dbTransaction._AssIdDeliver ?? 0);
|
||||
transaction.Raised = dbTransaction._Raised ?? default(DateTime);
|
||||
transaction.Required = dbTransaction._Required ?? default(DateTime);
|
||||
transaction.InProgress = dbTransaction._InProgress ?? default(DateTime);
|
||||
transaction.DeliveredEst = dbTransaction._DeliveredEst ?? default(DateTime);
|
||||
transaction.DeliveredAct = dbTransaction._DeliveredAct ?? default(DateTime);
|
||||
transaction.Closed = dbTransaction._Closed ?? default(DateTime);
|
||||
transaction.Department = dbTransaction._Department;
|
||||
transaction.DescBrief = dbTransaction._DescBrief;
|
||||
transaction.DescIntro = dbTransaction._DescIntro;
|
||||
@@ -730,19 +730,19 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
transaction.ResponseCode = dbTransaction._ResponseCode;
|
||||
transaction.ContactAreaCode = dbTransaction._ContactAreaCode;
|
||||
transaction.Postcode = dbTransaction._Postcode;
|
||||
transaction.CurrencyId = new SysId(dbTransaction._CurrencyId);
|
||||
transaction.TaxCodeId = new SysId(dbTransaction._TaxCodeId);
|
||||
transaction.AmountEst = dbTransaction._AmountEst;
|
||||
transaction.AmountMax = dbTransaction._AmountMax;
|
||||
transaction.AmountNet = dbTransaction._AmountNet;
|
||||
transaction.AmountTax = dbTransaction._AmountTax;
|
||||
transaction.AmountTot = dbTransaction._AmountTot;
|
||||
transaction.TimeEst = dbTransaction._TimeEst;
|
||||
transaction.TimeAct = dbTransaction._TimeAct;
|
||||
transaction.TimeTot = dbTransaction._TimeTot;
|
||||
transaction.LocationIdStock = new SysId(dbTransaction._LocationIdStock);
|
||||
transaction.Weight = dbTransaction._Weight;
|
||||
transaction.UomIdWeight = new SysId(dbTransaction._UomIdWeight);
|
||||
transaction.CurrencyId = new SysId(dbTransaction._CurrencyId ?? 0);
|
||||
transaction.TaxCodeId = new SysId(dbTransaction._TaxCodeId ?? 0);
|
||||
transaction.AmountEst = dbTransaction._AmountEst ?? 0.0m;
|
||||
transaction.AmountMax = dbTransaction._AmountMax ?? 0.0m;
|
||||
transaction.AmountNet = dbTransaction._AmountNet ?? 0.0m;
|
||||
transaction.AmountTax = dbTransaction._AmountTax ?? 0.0m;
|
||||
transaction.AmountTot = dbTransaction._AmountTot ?? 0.0m;
|
||||
transaction.TimeEst = dbTransaction._TimeEst ?? 0.0m;
|
||||
transaction.TimeAct = dbTransaction._TimeAct ?? 0.0m;
|
||||
transaction.TimeTot = dbTransaction._TimeTot ?? 0.0m;
|
||||
transaction.LocationIdStock = new SysId(dbTransaction._LocationIdStock ?? 0);
|
||||
transaction.Weight = dbTransaction._Weight ?? 0.0m;
|
||||
transaction.UomIdWeight = new SysId(dbTransaction._UomIdWeight ?? 0);
|
||||
transaction.BoxCount = dbTransaction._BoxCount;
|
||||
transaction.DeliveryStatusCode = dbTransaction._DeliveryStatusCode;
|
||||
transaction.DeliveryTypeCode = dbTransaction._DeliveryTypeCode;
|
||||
@@ -752,17 +752,17 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
transaction.StockPickerCode = dbTransaction._StockPickerCode;
|
||||
transaction.DeliveryRef = dbTransaction._DeliveryRef;
|
||||
transaction.DeliveryComment = dbTransaction._DeliveryComment;
|
||||
transaction.DeliveryAmountNet = dbTransaction._DeliveryAmountNet;
|
||||
transaction.TaxCodeIdDelivery = new SysId(dbTransaction._TaxCodeIdDelivery);
|
||||
transaction.DeliveryAmountTax = dbTransaction._DeliveryAmountTax;
|
||||
transaction.DeliveryAmountTot = dbTransaction._DeliveryAmountTot;
|
||||
transaction.DeliveryAmountNet = dbTransaction._DeliveryAmountNet ?? 0.0m;
|
||||
transaction.TaxCodeIdDelivery = new SysId(dbTransaction._TaxCodeIdDelivery ?? 0);
|
||||
transaction.DeliveryAmountTax = dbTransaction._DeliveryAmountTax ?? 0.0m;
|
||||
transaction.DeliveryAmountTot = dbTransaction._DeliveryAmountTot ?? 0.0m;
|
||||
transaction.DeliveryDepartment = dbTransaction._DeliveryDepartment;
|
||||
transaction.DeliveryNominalCode = dbTransaction._DeliveryNominalCode;
|
||||
// Common properties.
|
||||
transaction.Notes = dbTransaction._Notes;
|
||||
transaction.Status = SacsSystem.GetStatusForCode(dbTransaction._Status);
|
||||
transaction.SetCreateStamp(dbTransaction._CreateOn, new SysId(dbTransaction._CreateBy), dbTransaction._CreateHost);
|
||||
transaction.SetUpdateStamp(dbTransaction._UpdateOn, new SysId(dbTransaction._UpdateBy), dbTransaction._UpdateHost);
|
||||
transaction.SetCreateStamp(dbTransaction._CreateOn ?? default(DateTime), new SysId(dbTransaction._CreateBy ?? 0), dbTransaction._CreateHost);
|
||||
transaction.SetUpdateStamp(dbTransaction._UpdateOn ?? default(DateTime), new SysId(dbTransaction._UpdateBy ?? 0), dbTransaction._UpdateHost);
|
||||
transaction.AcceptChanges();
|
||||
}
|
||||
|
||||
|
||||
@@ -51,6 +51,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
//-------------------------------------------------------------------
|
||||
// Utilities.
|
||||
|
||||
public override bool ColumnExists(SbmDbDfn.ColumnIdx columnIdx)
|
||||
{
|
||||
SbmDbDfn.TableIdx tableIdx = SbmDbDfn.GetTableForColumn(columnIdx);
|
||||
String schemaName = SbmDbDfn.GetSchemaName(tableIdx, false);
|
||||
String tableName = SbmDbDfn.GetTableName(tableIdx, false);
|
||||
String columnName = SbmDbDfn.GetColumnName(columnIdx, false);
|
||||
return DbInfo.ColumnExists(schemaName, tableName, columnName);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Retrieve the list of transactions types that reference the specified commodity code.
|
||||
public override List<Sbm.TransactionType> GetTransactionTypesForCommodity(SysId commodityId, SbmTransaction.StatusCat statusCat = SbmTransaction.StatusCat.NotCancelled)
|
||||
|
||||
Reference in New Issue
Block a user