3.0.1.0 Portal Transactions.
This commit is contained in:
@@ -15,7 +15,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
|
|||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
public static class Version
|
public static class Version
|
||||||
{
|
{
|
||||||
private static String version { get; } = "3.0.0.7";
|
private static String version { get; } = "3.0.1.0";
|
||||||
// Retrieve version.
|
// Retrieve version.
|
||||||
public static String GetFullVersion() { return version; }
|
public static String GetFullVersion() { return version; }
|
||||||
public static String GetAppVersion()
|
public static String GetAppVersion()
|
||||||
@@ -37,6 +37,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
|
|||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// Version history.
|
// Version history.
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
|
// 3.0.1 19-Feb-25 Portal Transactions.
|
||||||
|
//-------------------------------------------------------------------
|
||||||
// 3.0.0 Jul-2021 Initial demo test version.
|
// 3.0.0 Jul-2021 Initial demo test version.
|
||||||
// 02-Feb-25 Initial live deployment.
|
// 02-Feb-25 Initial live deployment.
|
||||||
// 3.0.0.1 08-Feb-25 Demo repository registration.
|
// 3.0.0.1 08-Feb-25 Demo repository registration.
|
||||||
@@ -45,6 +47,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
|
|||||||
// 3.0.0.4 11-Feb-25 Portal Commodity Sales properties. Control Index population.
|
// 3.0.0.4 11-Feb-25 Portal Commodity Sales properties. Control Index population.
|
||||||
// 3.0.0.5 12-Feb-25 Portal Security forms tidy. Default Commodity type. Code Types and Codes.
|
// 3.0.0.5 12-Feb-25 Portal Security forms tidy. Default Commodity type. Code Types and Codes.
|
||||||
// 3.0.0.6 13-Feb-25 Main page layouts. Demo Account registration.
|
// 3.0.0.6 13-Feb-25 Main page layouts. Demo Account registration.
|
||||||
|
// 3.0.0.7 17-Feb-25 Demo Transaction population.
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
}
|
}
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|||||||
@@ -272,6 +272,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
|
|||||||
public List<TypeCodeDesc> AssetTypeCodes { get { return GetSystemCodes(Sbm.SystemCode.AssetType); } }
|
public List<TypeCodeDesc> AssetTypeCodes { get { return GetSystemCodes(Sbm.SystemCode.AssetType); } }
|
||||||
public List<TypeCodeDesc> VehicleTypeCodes { get { return GetSystemCodes(Sbm.SystemCode.VehicleType); } }
|
public List<TypeCodeDesc> VehicleTypeCodes { get { return GetSystemCodes(Sbm.SystemCode.VehicleType); } }
|
||||||
public List<TypeCodeDesc> TransactionTypeCodes { get { return GetSystemCodes(Sbm.SystemCode.TransactionType); } }
|
public List<TypeCodeDesc> TransactionTypeCodes { get { return GetSystemCodes(Sbm.SystemCode.TransactionType); } }
|
||||||
|
public List<TypeCodeDesc> RequirementTypeCodes { get { return GetSystemCodes(Sbm.SystemCode.RequirementType); } }
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// Code types.
|
// Code types.
|
||||||
|
|||||||
@@ -718,15 +718,16 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Bus
|
|||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// Requirement status.
|
// Requirement status.
|
||||||
private static readonly List<SaStatus> requirementStatuses = new List<SaStatus>()
|
private static readonly HashSet<SaStatus> validStatuses = new HashSet<SaStatus>()
|
||||||
{
|
{
|
||||||
SaStatus.Required,
|
SaStatus.Required,
|
||||||
SaStatus.InProgress,
|
SaStatus.InProgress,
|
||||||
SaStatus.Completed,
|
SaStatus.Completed,
|
||||||
SaStatus.Cancelled,
|
SaStatus.Cancelled,
|
||||||
|
SaStatus.Deleted,
|
||||||
};
|
};
|
||||||
public static SaStatus DefaultStatus { get { return SaStatus.Required; } }
|
public static SaStatus DefaultStatus { get { return SaStatus.Required; } }
|
||||||
public static List<SaStatus> RequirementStatuses { get { return new List<SaStatus>(requirementStatuses); } }
|
public static HashSet<SaStatus> ValidStatuses { get { return new HashSet<SaStatus>(validStatuses); } }
|
||||||
public static DataValue.TriStateType GetStatusTriState(SaStatus status)
|
public static DataValue.TriStateType GetStatusTriState(SaStatus status)
|
||||||
{
|
{
|
||||||
switch (status)
|
switch (status)
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr.Control
|
|||||||
{
|
{
|
||||||
// Item properties.
|
// Item properties.
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (data == null) return SetErrorState(Msg_ItemNotSpecified);
|
if (data == null) return SetErrorState(ErrorMessage.InvalidStatus);
|
||||||
|
|
||||||
// Name.
|
// Name.
|
||||||
if (errField.FirstName != SacsHierarchyItem.ValidValue.Ignore && !IsValidValue(data.FirstName, "first name", (long)SbmDbDfn_Control.GetColTextLen(SbmDbDfn_Control.ColumnIdx.AccountRegistration_FirstName)))
|
if (errField.FirstName != SacsHierarchyItem.ValidValue.Ignore && !IsValidValue(data.FirstName, "first name", (long)SbmDbDfn_Control.GetColTextLen(SbmDbDfn_Control.ColumnIdx.AccountRegistration_FirstName)))
|
||||||
@@ -177,7 +177,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr.Control
|
|||||||
public abstract bool UpdateAccountRegistration(SbmcAccountRegistration accountRegistration, DbUpdateInfo dbUpdateInfo);
|
public abstract bool UpdateAccountRegistration(SbmcAccountRegistration accountRegistration, DbUpdateInfo dbUpdateInfo);
|
||||||
public virtual bool AccountRegistrationCanBeDeleted(SbmcAccountRegistration accountRegistration)
|
public virtual bool AccountRegistrationCanBeDeleted(SbmcAccountRegistration accountRegistration)
|
||||||
{
|
{
|
||||||
if (accountRegistration == null) return SetErrorState(Msg_ItemNotSpecified);
|
if (accountRegistration == null) return SetErrorState(ErrorMessage.InvalidStatus);
|
||||||
//ClearErrorState();
|
//ClearErrorState();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr.Control
|
|||||||
{
|
{
|
||||||
// Item properties.
|
// Item properties.
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (data == null) return SetErrorState(Msg_ItemNotSpecified);
|
if (data == null) return SetErrorState(ErrorMessage.InvalidStatus);
|
||||||
|
|
||||||
// Name.
|
// Name.
|
||||||
if (errField.Title != SacsHierarchyItem.ValidValue.Ignore && !IsValidValue(data.Title, "title", (long)SbmDbDfn_Control.GetColTextLen(SbmDbDfn_Control.ColumnIdx.UserAccount_Title)))
|
if (errField.Title != SacsHierarchyItem.ValidValue.Ignore && !IsValidValue(data.Title, "title", (long)SbmDbDfn_Control.GetColTextLen(SbmDbDfn_Control.ColumnIdx.UserAccount_Title)))
|
||||||
@@ -146,7 +146,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr.Control
|
|||||||
public abstract bool UpdateUserAccount(SbmcUserAccount userAccount, DbUpdateInfo dbUpdateInfo);
|
public abstract bool UpdateUserAccount(SbmcUserAccount userAccount, DbUpdateInfo dbUpdateInfo);
|
||||||
public virtual bool UserAccountCanBeDeleted(SbmcUserAccount userAccount)
|
public virtual bool UserAccountCanBeDeleted(SbmcUserAccount userAccount)
|
||||||
{
|
{
|
||||||
if (userAccount == null) return SetErrorState(Msg_ItemNotSpecified);
|
if (userAccount == null) return SetErrorState(ErrorMessage.InvalidStatus);
|
||||||
//ClearErrorState();
|
//ClearErrorState();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr.Control
|
|||||||
{
|
{
|
||||||
// Item properties.
|
// Item properties.
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (data == null) return SetErrorState(Msg_ItemNotSpecified);
|
if (data == null) return SetErrorState(ErrorMessage.InvalidStatus);
|
||||||
|
|
||||||
// Contact.
|
// Contact.
|
||||||
|
|
||||||
@@ -115,7 +115,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr.Control
|
|||||||
public abstract bool UpdateOwner(SbmcOwner owner, DbUpdateInfo dbUpdateInfo);
|
public abstract bool UpdateOwner(SbmcOwner owner, DbUpdateInfo dbUpdateInfo);
|
||||||
public virtual bool OwnerCanBeDeleted(SbmcOwner owner)
|
public virtual bool OwnerCanBeDeleted(SbmcOwner owner)
|
||||||
{
|
{
|
||||||
if (owner == null) return SetErrorState(Msg_ItemNotSpecified);
|
if (owner == null) return SetErrorState(ErrorMessage.InvalidStatus);
|
||||||
//ClearErrorState();
|
//ClearErrorState();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr.Control
|
|||||||
{
|
{
|
||||||
// Item properties.
|
// Item properties.
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (data == null) return SetErrorState(Msg_ItemNotSpecified);
|
if (data == null) return SetErrorState(ErrorMessage.InvalidStatus);
|
||||||
|
|
||||||
// Owner.
|
// Owner.
|
||||||
if (!SysId.IsValid(data.OwnerId)) return SetErrorState("Owner must be specified");
|
if (!SysId.IsValid(data.OwnerId)) return SetErrorState("Owner must be specified");
|
||||||
@@ -143,7 +143,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr.Control
|
|||||||
public abstract bool UpdateRepository(SbmcRepository repository, DbUpdateInfo dbUpdateInfo);
|
public abstract bool UpdateRepository(SbmcRepository repository, DbUpdateInfo dbUpdateInfo);
|
||||||
public virtual bool RepositoryCanBeDeleted(SbmcRepository repository)
|
public virtual bool RepositoryCanBeDeleted(SbmcRepository repository)
|
||||||
{
|
{
|
||||||
if (repository == null) return SetErrorState(Msg_ItemNotSpecified);
|
if (repository == null) return SetErrorState(ErrorMessage.InvalidStatus);
|
||||||
//ClearErrorState();
|
//ClearErrorState();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr.Control
|
|||||||
{
|
{
|
||||||
// Item properties.
|
// Item properties.
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (data == null) return SetErrorState(Msg_ItemNotSpecified);
|
if (data == null) return SetErrorState(ErrorMessage.InvalidStatus);
|
||||||
|
|
||||||
// Item.
|
// Item.
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr.Control
|
|||||||
if (!ItemId.IsValid(data.ItemId))
|
if (!ItemId.IsValid(data.ItemId))
|
||||||
{
|
{
|
||||||
errField.Context = SacsHierarchyItem.ValidValue.Invalid;
|
errField.Context = SacsHierarchyItem.ValidValue.Invalid;
|
||||||
return SetErrorState(Msg_ItemIdNotSpecified);
|
return SetErrorState(ErrorMessage.ItemIdNotSpecified);
|
||||||
}
|
}
|
||||||
if (!SbmcItemParam.ValidItemTypes.Contains((SbmcHierarchyItem.ItemType)data.ItemId.Type))
|
if (!SbmcItemParam.ValidItemTypes.Contains((SbmcHierarchyItem.ItemType)data.ItemId.Type))
|
||||||
{
|
{
|
||||||
@@ -121,7 +121,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr.Control
|
|||||||
public abstract bool UpdateItemParam(SbmcItemParam itemParam, DbUpdateInfo dbUpdateInfo);
|
public abstract bool UpdateItemParam(SbmcItemParam itemParam, DbUpdateInfo dbUpdateInfo);
|
||||||
public virtual bool ItemParamCanBeDeleted(SbmcItemParam itemParam)
|
public virtual bool ItemParamCanBeDeleted(SbmcItemParam itemParam)
|
||||||
{
|
{
|
||||||
if (itemParam == null) return SetErrorState(Msg_ItemNotSpecified);
|
if (itemParam == null) return SetErrorState(ErrorMessage.InvalidStatus);
|
||||||
//ClearErrorState();
|
//ClearErrorState();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr
|
|||||||
if ((int)data.ItemType < 1)
|
if ((int)data.ItemType < 1)
|
||||||
{
|
{
|
||||||
errField.ItemType = SacsHierarchyItem.ValidValue.Invalid;
|
errField.ItemType = SacsHierarchyItem.ValidValue.Invalid;
|
||||||
return SetErrorState(Msg_ItemTypeNotSpecified);
|
return SetErrorState(ErrorMessage.ItemTypeNotSpecified);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (errField.ItemId != SacsHierarchyItem.ValidValue.Ignore)
|
if (errField.ItemId != SacsHierarchyItem.ValidValue.Ignore)
|
||||||
@@ -80,7 +80,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr
|
|||||||
if (!SysId.IsValid(data.ItemId))
|
if (!SysId.IsValid(data.ItemId))
|
||||||
{
|
{
|
||||||
errField.ItemId = SacsHierarchyItem.ValidValue.Invalid;
|
errField.ItemId = SacsHierarchyItem.ValidValue.Invalid;
|
||||||
return SetErrorState(Msg_ItemIdNotSpecified);
|
return SetErrorState(ErrorMessage.ItemIdNotSpecified);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (errField.AddressType != SacsHierarchyItem.ValidValue.Ignore)
|
if (errField.AddressType != SacsHierarchyItem.ValidValue.Ignore)
|
||||||
|
|||||||
@@ -210,7 +210,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr
|
|||||||
{
|
{
|
||||||
// Affiliate properties.
|
// Affiliate properties.
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (data == null) return SetErrorState(Msg_ItemNotSpecified);
|
if (data == null) return SetErrorState(ErrorMessage.InvalidStatus);
|
||||||
// Validate the type:
|
// Validate the type:
|
||||||
if (errField.Type != SacsHierarchyItem.ValidValue.Ignore && (short)data.AffiliateType < 1)
|
if (errField.Type != SacsHierarchyItem.ValidValue.Ignore && (short)data.AffiliateType < 1)
|
||||||
{
|
{
|
||||||
@@ -395,7 +395,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr
|
|||||||
public abstract bool UpdateAffiliate(SbmAffiliate affiliate, DbUpdateInfo dbUpdateInfo);
|
public abstract bool UpdateAffiliate(SbmAffiliate affiliate, DbUpdateInfo dbUpdateInfo);
|
||||||
public virtual bool AffiliateCanBeDeleted(SbmAffiliate affiliate)
|
public virtual bool AffiliateCanBeDeleted(SbmAffiliate affiliate)
|
||||||
{
|
{
|
||||||
if (affiliate == null) return SetErrorState(Msg_ItemNotSpecified);
|
if (affiliate == null) return SetErrorState(ErrorMessage.InvalidStatus);
|
||||||
if (AffiliateHasChildAffiliates(affiliate.Id)) return SetErrorState("item has child organisations");
|
if (AffiliateHasChildAffiliates(affiliate.Id)) return SetErrorState("item has child organisations");
|
||||||
if (AffiliateOwnerHasAssociations(affiliate.Id, Sbm.AssociationType.Any, false)) return SetErrorState("item own associations");
|
if (AffiliateOwnerHasAssociations(affiliate.Id, Sbm.AssociationType.Any, false)) return SetErrorState("item own associations");
|
||||||
if (AffiliateTargetHasAssociations(affiliate.Id, Sbm.AssociationType.Any, false)) return SetErrorState("item is the target of associations");
|
if (AffiliateTargetHasAssociations(affiliate.Id, Sbm.AssociationType.Any, false)) return SetErrorState("item is the target of associations");
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr
|
|||||||
if ((int)data.ItemType < 1)
|
if ((int)data.ItemType < 1)
|
||||||
{
|
{
|
||||||
errField.ItemType = SacsHierarchyItem.ValidValue.Invalid;
|
errField.ItemType = SacsHierarchyItem.ValidValue.Invalid;
|
||||||
return SetErrorState(Msg_ItemTypeNotSpecified);
|
return SetErrorState(ErrorMessage.ItemTypeNotSpecified);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!SysId.IsValid(data.ItemId))
|
if (!SysId.IsValid(data.ItemId))
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr
|
|||||||
if ((int)data.ItemBatchType < 1)
|
if ((int)data.ItemBatchType < 1)
|
||||||
{
|
{
|
||||||
errField.ItemBatchType = SacsHierarchyItem.ValidValue.Invalid;
|
errField.ItemBatchType = SacsHierarchyItem.ValidValue.Invalid;
|
||||||
return SetErrorState(Msg_ItemTypeNotSpecified);
|
return SetErrorState(ErrorMessage.ItemTypeNotSpecified);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (errField.Ref != SacsHierarchyItem.ValidValue.Ignore && !IsValidValue(data.Ref, "reference", (long)Internals.GetColTextLen(SbmDbDfn.ColumnIdx.ItemBatch_Ref), true))
|
if (errField.Ref != SacsHierarchyItem.ValidValue.Ignore && !IsValidValue(data.Ref, "reference", (long)Internals.GetColTextLen(SbmDbDfn.ColumnIdx.ItemBatch_Ref), true))
|
||||||
@@ -139,7 +139,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr
|
|||||||
public virtual bool ItemBatchCanBeDeleted(SbmItemBatch itemBatch)
|
public virtual bool ItemBatchCanBeDeleted(SbmItemBatch itemBatch)
|
||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (itemBatch == null) return SetErrorState(Msg_ItemNotSpecified);
|
if (itemBatch == null) return SetErrorState(ErrorMessage.InvalidStatus);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
public abstract bool DeleteItemBatch(SbmItemBatch itemBatch, DbUpdateInfo dbUpdateInfo);
|
public abstract bool DeleteItemBatch(SbmItemBatch itemBatch, DbUpdateInfo dbUpdateInfo);
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr
|
|||||||
if ((int)data.ItemLinkType < 1)
|
if ((int)data.ItemLinkType < 1)
|
||||||
{
|
{
|
||||||
errField.ItemLinkType = SacsHierarchyItem.ValidValue.Invalid;
|
errField.ItemLinkType = SacsHierarchyItem.ValidValue.Invalid;
|
||||||
return SetErrorState(Msg_ItemTypeNotSpecified);
|
return SetErrorState(ErrorMessage.ItemTypeNotSpecified);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (errField.ItemTypeFrom != SacsHierarchyItem.ValidValue.Ignore)
|
if (errField.ItemTypeFrom != SacsHierarchyItem.ValidValue.Ignore)
|
||||||
@@ -145,7 +145,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr
|
|||||||
public virtual bool ItemLinkCanBeDeleted(SbmItemLink itemLink)
|
public virtual bool ItemLinkCanBeDeleted(SbmItemLink itemLink)
|
||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (itemLink == null) return SetErrorState(Msg_ItemNotSpecified);
|
if (itemLink == null) return SetErrorState(ErrorMessage.InvalidStatus);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
public abstract bool DeleteItemLink(SbmItemLink itemLink, DbUpdateInfo dbUpdateInfo);
|
public abstract bool DeleteItemLink(SbmItemLink itemLink, DbUpdateInfo dbUpdateInfo);
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr
|
|||||||
{
|
{
|
||||||
// Price properties.
|
// Price properties.
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (data == null) return SetErrorState(Msg_ItemNotSpecified);
|
if (data == null) return SetErrorState(ErrorMessage.InvalidStatus);
|
||||||
// Price set.
|
// Price set.
|
||||||
if (errField.PriceSetId != SacsHierarchyItem.ValidValue.Ignore && !SysId.IsValid(data.PriceSetId))
|
if (errField.PriceSetId != SacsHierarchyItem.ValidValue.Ignore && !SysId.IsValid(data.PriceSetId))
|
||||||
{
|
{
|
||||||
@@ -115,7 +115,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr
|
|||||||
public virtual bool PriceCanBeDeleted(SbmPrice price)
|
public virtual bool PriceCanBeDeleted(SbmPrice price)
|
||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (price == null) return SetErrorState(Msg_ItemNotSpecified);
|
if (price == null) return SetErrorState(ErrorMessage.InvalidStatus);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
public abstract bool DeletePrice(SbmPrice price, DbUpdateInfo dbUpdateInfo);
|
public abstract bool DeletePrice(SbmPrice price, DbUpdateInfo dbUpdateInfo);
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr
|
|||||||
{
|
{
|
||||||
// PriceSet properties.
|
// PriceSet properties.
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (data == null) return SetErrorState(Msg_ItemNotSpecified);
|
if (data == null) return SetErrorState(ErrorMessage.InvalidStatus);
|
||||||
// Validate the type.
|
// Validate the type.
|
||||||
if (errField.PriceType != SacsHierarchyItem.ValidValue.Ignore)
|
if (errField.PriceType != SacsHierarchyItem.ValidValue.Ignore)
|
||||||
{
|
{
|
||||||
@@ -129,7 +129,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr
|
|||||||
public virtual bool PriceSetCanBeDeleted(SbmPriceSet priceSet)
|
public virtual bool PriceSetCanBeDeleted(SbmPriceSet priceSet)
|
||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (priceSet == null) return SetErrorState(Msg_ItemNotSpecified);
|
if (priceSet == null) return SetErrorState(ErrorMessage.InvalidStatus);
|
||||||
if (PriceMgr.PriceSetHasPrices(priceSet.Id)) return SetErrorState("item has prices");
|
if (PriceMgr.PriceSetHasPrices(priceSet.Id)) return SetErrorState("item has prices");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr
|
|||||||
errField.Status = SacsHierarchyItem.ValidValue.Invalid;
|
errField.Status = SacsHierarchyItem.ValidValue.Invalid;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!SbmRequirement.RequirementStatuses.Contains(data.Status))
|
if (!SbmRequirement.ValidStatuses.Contains(data.Status))
|
||||||
{
|
{
|
||||||
errField.Status = SacsHierarchyItem.ValidValue.Invalid;
|
errField.Status = SacsHierarchyItem.ValidValue.Invalid;
|
||||||
return SetErrorState(ErrorMessage.InvalidStatus);
|
return SetErrorState(ErrorMessage.InvalidStatus);
|
||||||
|
|||||||
@@ -353,15 +353,32 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr
|
|||||||
}
|
}
|
||||||
// Populate and validate dates.
|
// Populate and validate dates.
|
||||||
SbmTransaction.StatusCat transactionStatusCat = SbmTransaction.GetCategoryForStatus(data.Status);
|
SbmTransaction.StatusCat transactionStatusCat = SbmTransaction.GetCategoryForStatus(data.Status);
|
||||||
|
if (!DateUtil.IsValid(data.Raised))
|
||||||
|
data.Raised = DateTime.Today;
|
||||||
|
if (errField.Raised != SacsHierarchyItem.ValidValue.Ignore && data.Raised > DateTime.Today)
|
||||||
|
{
|
||||||
|
errField.Raised = SacsHierarchyItem.ValidValue.Invalid;
|
||||||
|
return SetErrorState(ErrorMessage.InvalidDate);
|
||||||
|
}
|
||||||
if (transactionStatusCat == SbmTransaction.StatusCat.Open || transactionStatusCat == SbmTransaction.StatusCat.Closed)
|
if (transactionStatusCat == SbmTransaction.StatusCat.Open || transactionStatusCat == SbmTransaction.StatusCat.Closed)
|
||||||
{
|
{
|
||||||
if (!DateUtil.IsValid(data.InProgress))
|
if (!DateUtil.IsValid(data.InProgress))
|
||||||
data.InProgress = DateTime.Today;
|
data.InProgress = DateTime.Today;
|
||||||
|
if (errField.InProgress != SacsHierarchyItem.ValidValue.Ignore && (data.InProgress > DateTime.Today || data.InProgress < data.Raised))
|
||||||
|
{
|
||||||
|
errField.InProgress = SacsHierarchyItem.ValidValue.Invalid;
|
||||||
|
return SetErrorState(ErrorMessage.InvalidDate);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (transactionStatusCat == SbmTransaction.StatusCat.Closed)
|
if (transactionStatusCat == SbmTransaction.StatusCat.Closed)
|
||||||
{
|
{
|
||||||
if (!DateUtil.IsValid(data.Closed))
|
if (!DateUtil.IsValid(data.Closed))
|
||||||
data.Closed = DateTime.Today;
|
data.Closed = DateTime.Today;
|
||||||
|
if (errField.Closed != SacsHierarchyItem.ValidValue.Ignore && (data.Closed > DateTime.Today || data.Closed < data.InProgress))
|
||||||
|
{
|
||||||
|
errField.Closed = SacsHierarchyItem.ValidValue.Invalid;
|
||||||
|
return SetErrorState(ErrorMessage.InvalidDate);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
if (count == 0) return null;
|
if (count == 0) return null;
|
||||||
if (count != 1)
|
if (count != 1)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_MultipleItemsFound);
|
SetErrorState(ErrorMessage.MultipleItemsFound);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
SbmcAccountRegistration accountRegistration = null;
|
SbmcAccountRegistration accountRegistration = null;
|
||||||
@@ -78,7 +78,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -100,7 +100,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!IsValidAccountRegistration(accountRegistration)) return false;
|
if (!IsValidAccountRegistration(accountRegistration)) return false;
|
||||||
if (SysId.IsValid(accountRegistration.Id)) return SetErrorState(ErrorMessage.ValiditemId);
|
if (SysId.IsValid(accountRegistration.Id)) return SetErrorState(ErrorMessage.ValidItemId);
|
||||||
using (var dbConnection = db.CreateConnection())
|
using (var dbConnection = db.CreateConnection())
|
||||||
using (var dbCommand = dbConnection.CreateCommand())
|
using (var dbCommand = dbConnection.CreateCommand())
|
||||||
{
|
{
|
||||||
@@ -506,7 +506,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
if (count == 0) return null;
|
if (count == 0) return null;
|
||||||
if (count != 1)
|
if (count != 1)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_MultipleItemsFound);
|
SetErrorState(ErrorMessage.MultipleItemsFound);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
SbmcUserAccount userAccount = null;
|
SbmcUserAccount userAccount = null;
|
||||||
@@ -77,7 +77,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -99,7 +99,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!IsValidUserAccount(userAccount)) return false;
|
if (!IsValidUserAccount(userAccount)) return false;
|
||||||
if (SysId.IsValid(userAccount.Id)) return SetErrorState(ErrorMessage.ValiditemId);
|
if (SysId.IsValid(userAccount.Id)) return SetErrorState(ErrorMessage.ValidItemId);
|
||||||
using (var dbConnection = db.CreateConnection())
|
using (var dbConnection = db.CreateConnection())
|
||||||
using (var dbCommand = dbConnection.CreateCommand())
|
using (var dbCommand = dbConnection.CreateCommand())
|
||||||
{
|
{
|
||||||
@@ -518,7 +518,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
if (count == 0) return null;
|
if (count == 0) return null;
|
||||||
if (count != 1)
|
if (count != 1)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_MultipleItemsFound);
|
SetErrorState(ErrorMessage.MultipleItemsFound);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
SbmcOwner owner = null;
|
SbmcOwner owner = null;
|
||||||
@@ -77,7 +77,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -99,7 +99,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!IsValidOwner(owner)) return false;
|
if (!IsValidOwner(owner)) return false;
|
||||||
if (SysId.IsValid(owner.Id)) return SetErrorState(ErrorMessage.ValiditemId);
|
if (SysId.IsValid(owner.Id)) return SetErrorState(ErrorMessage.ValidItemId);
|
||||||
using (var dbConnection = db.CreateConnection())
|
using (var dbConnection = db.CreateConnection())
|
||||||
using (var dbCommand = dbConnection.CreateCommand())
|
using (var dbCommand = dbConnection.CreateCommand())
|
||||||
{
|
{
|
||||||
@@ -459,7 +459,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
if (count == 0) return null;
|
if (count == 0) return null;
|
||||||
if (count != 1)
|
if (count != 1)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_MultipleItemsFound);
|
SetErrorState(ErrorMessage.MultipleItemsFound);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
SbmcRepository repository = null;
|
SbmcRepository repository = null;
|
||||||
@@ -77,7 +77,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -99,7 +99,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!IsValidRepository(repository)) return false;
|
if (!IsValidRepository(repository)) return false;
|
||||||
if (SysId.IsValid(repository.Id)) return SetErrorState(ErrorMessage.ValiditemId);
|
if (SysId.IsValid(repository.Id)) return SetErrorState(ErrorMessage.ValidItemId);
|
||||||
using (var dbConnection = db.CreateConnection())
|
using (var dbConnection = db.CreateConnection())
|
||||||
using (var dbCommand = dbConnection.CreateCommand())
|
using (var dbCommand = dbConnection.CreateCommand())
|
||||||
{
|
{
|
||||||
@@ -495,7 +495,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
if (count == 0) return null;
|
if (count == 0) return null;
|
||||||
if (count != 1)
|
if (count != 1)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_MultipleItemsFound);
|
SetErrorState(ErrorMessage.MultipleItemsFound);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
SbmcItemParam itemParam = null;
|
SbmcItemParam itemParam = null;
|
||||||
@@ -79,7 +79,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -101,7 +101,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!IsValidItemParam(itemParam)) return false;
|
if (!IsValidItemParam(itemParam)) return false;
|
||||||
if (SysId.IsValid(itemParam.Id)) return SetErrorState(ErrorMessage.ValiditemId);
|
if (SysId.IsValid(itemParam.Id)) return SetErrorState(ErrorMessage.ValidItemId);
|
||||||
using (var dbConnection = db.CreateConnection())
|
using (var dbConnection = db.CreateConnection())
|
||||||
using (var dbCommand = dbConnection.CreateCommand())
|
using (var dbCommand = dbConnection.CreateCommand())
|
||||||
{
|
{
|
||||||
@@ -488,7 +488,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
{
|
{
|
||||||
// Check that this is the only primary address for the item.
|
// Check that this is the only primary address for the item.
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (addressPrimary == null) return SetErrorState(Msg_ItemNotSpecified);
|
if (addressPrimary == null) return SetErrorState(ErrorMessage.InvalidStatus);
|
||||||
if (!SysId.IsValid(addressPrimary.Id)) return SetErrorState("invalid item id");
|
if (!SysId.IsValid(addressPrimary.Id)) return SetErrorState("invalid item id");
|
||||||
if (!addressPrimary.IsPrimary) return SetErrorState("address is not primary");
|
if (!addressPrimary.IsPrimary) return SetErrorState("address is not primary");
|
||||||
if (Database == null) return SetErrorState("database not available");
|
if (Database == null) return SetErrorState("database not available");
|
||||||
@@ -158,7 +158,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
if (count == 0) return null;
|
if (count == 0) return null;
|
||||||
if (count != 1)
|
if (count != 1)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_MultipleItemsFound);
|
SetErrorState(ErrorMessage.MultipleItemsFound);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
SbmAddress address = null;
|
SbmAddress address = null;
|
||||||
@@ -175,7 +175,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -197,7 +197,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!IsValidAddress(address)) return false;
|
if (!IsValidAddress(address)) return false;
|
||||||
if (SysId.IsValid(address.Id)) return SetErrorState(ErrorMessage.ValiditemId);
|
if (SysId.IsValid(address.Id)) return SetErrorState(ErrorMessage.ValidItemId);
|
||||||
using (var dbConnection = Database.CreateConnection())
|
using (var dbConnection = Database.CreateConnection())
|
||||||
using (var dbCommand = dbConnection.CreateCommand())
|
using (var dbCommand = dbConnection.CreateCommand())
|
||||||
{
|
{
|
||||||
@@ -750,7 +750,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
if (count == 0) return null;
|
if (count == 0) return null;
|
||||||
if (count != 1)
|
if (count != 1)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_MultipleItemsFound);
|
SetErrorState(ErrorMessage.MultipleItemsFound);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
SbmAffiliate affiliate = null;
|
SbmAffiliate affiliate = null;
|
||||||
@@ -198,7 +198,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -295,7 +295,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!IsValidAffiliate(affiliate)) return false;
|
if (!IsValidAffiliate(affiliate)) return false;
|
||||||
if (SysId.IsValid(affiliate.Id)) return SetErrorState(ErrorMessage.ValiditemId);
|
if (SysId.IsValid(affiliate.Id)) return SetErrorState(ErrorMessage.ValidItemId);
|
||||||
using (var dbConnection = Database.CreateConnection())
|
using (var dbConnection = Database.CreateConnection())
|
||||||
using (var dbCommand = dbConnection.CreateCommand())
|
using (var dbCommand = dbConnection.CreateCommand())
|
||||||
{
|
{
|
||||||
@@ -1048,7 +1048,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
if (count == 0) return null;
|
if (count == 0) return null;
|
||||||
if (count != 1)
|
if (count != 1)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_MultipleItemsFound);
|
SetErrorState(ErrorMessage.MultipleItemsFound);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
SbmAssociation association = null;
|
SbmAssociation association = null;
|
||||||
@@ -66,7 +66,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -148,7 +148,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!IsValidAssociation(association)) return false;
|
if (!IsValidAssociation(association)) return false;
|
||||||
if (SysId.IsValid(association.Id)) return SetErrorState(ErrorMessage.ValiditemId);
|
if (SysId.IsValid(association.Id)) return SetErrorState(ErrorMessage.ValidItemId);
|
||||||
using (var dbConnection = Database.CreateConnection())
|
using (var dbConnection = Database.CreateConnection())
|
||||||
using (var dbCommand = dbConnection.CreateCommand())
|
using (var dbCommand = dbConnection.CreateCommand())
|
||||||
{
|
{
|
||||||
@@ -1772,7 +1772,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
if (count == 0) return null;
|
if (count == 0) return null;
|
||||||
if (count != 1)
|
if (count != 1)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_MultipleItemsFound);
|
SetErrorState(ErrorMessage.MultipleItemsFound);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
SbmSysParam sysParam = null;
|
SbmSysParam sysParam = null;
|
||||||
@@ -77,7 +77,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -99,7 +99,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!IsValidSysParam(sysparam)) return false;
|
if (!IsValidSysParam(sysparam)) return false;
|
||||||
if (SysId.IsValid(sysparam.Id)) return SetErrorState(ErrorMessage.ValiditemId);
|
if (SysId.IsValid(sysparam.Id)) return SetErrorState(ErrorMessage.ValidItemId);
|
||||||
using (var dbConnection = Database.CreateConnection())
|
using (var dbConnection = Database.CreateConnection())
|
||||||
using (var dbCommand = dbConnection.CreateCommand())
|
using (var dbCommand = dbConnection.CreateCommand())
|
||||||
{
|
{
|
||||||
@@ -455,7 +455,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
if (count == 0) return null;
|
if (count == 0) return null;
|
||||||
if (count != 1)
|
if (count != 1)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_MultipleItemsFound);
|
SetErrorState(ErrorMessage.MultipleItemsFound);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
SbmSystemAccount systemAccount = null;
|
SbmSystemAccount systemAccount = null;
|
||||||
@@ -100,7 +100,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -122,7 +122,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!IsValidSystemAccount(systemAccount)) return false;
|
if (!IsValidSystemAccount(systemAccount)) return false;
|
||||||
if (SysId.IsValid(systemAccount.Id)) return SetErrorState(ErrorMessage.ValiditemId);
|
if (SysId.IsValid(systemAccount.Id)) return SetErrorState(ErrorMessage.ValidItemId);
|
||||||
using (var dbConnection = Database.CreateConnection())
|
using (var dbConnection = Database.CreateConnection())
|
||||||
using (var dbCommand = dbConnection.CreateCommand())
|
using (var dbCommand = dbConnection.CreateCommand())
|
||||||
{
|
{
|
||||||
@@ -504,7 +504,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
if (count == 0) return null;
|
if (count == 0) return null;
|
||||||
if (count != 1)
|
if (count != 1)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_MultipleItemsFound);
|
SetErrorState(ErrorMessage.MultipleItemsFound);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
SbmSystemAccountUser SystemAccountUser = null;
|
SbmSystemAccountUser SystemAccountUser = null;
|
||||||
@@ -77,7 +77,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -99,7 +99,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!IsValidSystemAccountUser(systemAccountUser)) return false;
|
if (!IsValidSystemAccountUser(systemAccountUser)) return false;
|
||||||
if (SysId.IsValid(systemAccountUser.Id)) return SetErrorState(ErrorMessage.ValiditemId);
|
if (SysId.IsValid(systemAccountUser.Id)) return SetErrorState(ErrorMessage.ValidItemId);
|
||||||
using (var dbConnection = Database.CreateConnection())
|
using (var dbConnection = Database.CreateConnection())
|
||||||
using (var dbCommand = dbConnection.CreateCommand())
|
using (var dbCommand = dbConnection.CreateCommand())
|
||||||
{
|
{
|
||||||
@@ -475,7 +475,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
if (count == 0) return null;
|
if (count == 0) return null;
|
||||||
if (count != 1)
|
if (count != 1)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_MultipleItemsFound);
|
SetErrorState(ErrorMessage.MultipleItemsFound);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
SbmSystemUser SystemUser = null;
|
SbmSystemUser SystemUser = null;
|
||||||
@@ -80,7 +80,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -102,7 +102,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!IsValidSystemUser(systemUser)) return false;
|
if (!IsValidSystemUser(systemUser)) return false;
|
||||||
if (SysId.IsValid(systemUser.Id)) return SetErrorState(ErrorMessage.ValiditemId);
|
if (SysId.IsValid(systemUser.Id)) return SetErrorState(ErrorMessage.ValidItemId);
|
||||||
using (var dbConnection = Database.CreateConnection())
|
using (var dbConnection = Database.CreateConnection())
|
||||||
using (var dbCommand = dbConnection.CreateCommand())
|
using (var dbCommand = dbConnection.CreateCommand())
|
||||||
{
|
{
|
||||||
@@ -485,7 +485,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -226,7 +226,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
if (count == 0) return null;
|
if (count == 0) return null;
|
||||||
if (count != 1)
|
if (count != 1)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_MultipleItemsFound);
|
SetErrorState(ErrorMessage.MultipleItemsFound);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
SbmAsset asset = null;
|
SbmAsset asset = null;
|
||||||
@@ -243,7 +243,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -284,7 +284,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!IsValidAsset(asset)) return false;
|
if (!IsValidAsset(asset)) return false;
|
||||||
if (SysId.IsValid(asset.Id)) return SetErrorState(ErrorMessage.ValiditemId);
|
if (SysId.IsValid(asset.Id)) return SetErrorState(ErrorMessage.ValidItemId);
|
||||||
using (var dbConnection = Database.CreateConnection())
|
using (var dbConnection = Database.CreateConnection())
|
||||||
using (var dbCommand = dbConnection.CreateCommand())
|
using (var dbCommand = dbConnection.CreateCommand())
|
||||||
{
|
{
|
||||||
@@ -798,7 +798,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
if (count == 0) return null;
|
if (count == 0) return null;
|
||||||
if (count != 1)
|
if (count != 1)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_MultipleItemsFound);
|
SetErrorState(ErrorMessage.MultipleItemsFound);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
SbmAssetCategory assetCategory = null;
|
SbmAssetCategory assetCategory = null;
|
||||||
@@ -129,7 +129,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -211,7 +211,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!IsValidAssetCategory(assetCategory)) return false;
|
if (!IsValidAssetCategory(assetCategory)) return false;
|
||||||
if (SysId.IsValid(assetCategory.Id)) return SetErrorState(ErrorMessage.ValiditemId);
|
if (SysId.IsValid(assetCategory.Id)) return SetErrorState(ErrorMessage.ValidItemId);
|
||||||
using (var dbConnection = Database.CreateConnection())
|
using (var dbConnection = Database.CreateConnection())
|
||||||
using (var dbCommand = dbConnection.CreateCommand())
|
using (var dbCommand = dbConnection.CreateCommand())
|
||||||
{
|
{
|
||||||
@@ -596,7 +596,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
if (count == 0) return null;
|
if (count == 0) return null;
|
||||||
if (count != 1)
|
if (count != 1)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_MultipleItemsFound);
|
SetErrorState(ErrorMessage.MultipleItemsFound);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
SbmAssetProcess assetProcess = null;
|
SbmAssetProcess assetProcess = null;
|
||||||
@@ -66,7 +66,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -107,7 +107,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!IsValidAssetProcess(assetProcess)) return false;
|
if (!IsValidAssetProcess(assetProcess)) return false;
|
||||||
if (SysId.IsValid(assetProcess.Id)) return SetErrorState(ErrorMessage.ValiditemId);
|
if (SysId.IsValid(assetProcess.Id)) return SetErrorState(ErrorMessage.ValidItemId);
|
||||||
using (var dbConnection = Database.CreateConnection())
|
using (var dbConnection = Database.CreateConnection())
|
||||||
using (var dbCommand = dbConnection.CreateCommand())
|
using (var dbCommand = dbConnection.CreateCommand())
|
||||||
{
|
{
|
||||||
@@ -428,7 +428,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -230,7 +230,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
if (count == 0) return null;
|
if (count == 0) return null;
|
||||||
if (count != 1)
|
if (count != 1)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_MultipleItemsFound);
|
SetErrorState(ErrorMessage.MultipleItemsFound);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
SbmVehicle vehicle = null;
|
SbmVehicle vehicle = null;
|
||||||
@@ -247,7 +247,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -285,7 +285,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!IsValidVehicle(vehicle)) return false;
|
if (!IsValidVehicle(vehicle)) return false;
|
||||||
if (SysId.IsValid(vehicle.Id)) return SetErrorState(ErrorMessage.ValiditemId);
|
if (SysId.IsValid(vehicle.Id)) return SetErrorState(ErrorMessage.ValidItemId);
|
||||||
using (var dbConnection = Database.CreateConnection())
|
using (var dbConnection = Database.CreateConnection())
|
||||||
using (var dbCommand = dbConnection.CreateCommand())
|
using (var dbCommand = dbConnection.CreateCommand())
|
||||||
{
|
{
|
||||||
@@ -827,7 +827,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
if (count == 0) return null;
|
if (count == 0) return null;
|
||||||
if (count != 1)
|
if (count != 1)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_MultipleItemsFound);
|
SetErrorState(ErrorMessage.MultipleItemsFound);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
SbmVehicleClass vehicleClass = null;
|
SbmVehicleClass vehicleClass = null;
|
||||||
@@ -209,7 +209,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -259,7 +259,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!IsValidVehicleClass(vehicleClass)) return false;
|
if (!IsValidVehicleClass(vehicleClass)) return false;
|
||||||
if (SysId.IsValid(vehicleClass.Id)) return SetErrorState(ErrorMessage.ValiditemId);
|
if (SysId.IsValid(vehicleClass.Id)) return SetErrorState(ErrorMessage.ValidItemId);
|
||||||
using (var dbConnection = Database.CreateConnection())
|
using (var dbConnection = Database.CreateConnection())
|
||||||
using (var dbCommand = dbConnection.CreateCommand())
|
using (var dbCommand = dbConnection.CreateCommand())
|
||||||
{
|
{
|
||||||
@@ -712,7 +712,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
if (count == 0) return null;
|
if (count == 0) return null;
|
||||||
if (count != 1)
|
if (count != 1)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_MultipleItemsFound);
|
SetErrorState(ErrorMessage.MultipleItemsFound);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
SbmVehicleEvent vehicleEvent = null;
|
SbmVehicleEvent vehicleEvent = null;
|
||||||
@@ -66,7 +66,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -107,7 +107,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!IsValidVehicleEvent(vehicleEvent)) return false;
|
if (!IsValidVehicleEvent(vehicleEvent)) return false;
|
||||||
if (SysId.IsValid(vehicleEvent.Id)) return SetErrorState(ErrorMessage.ValiditemId);
|
if (SysId.IsValid(vehicleEvent.Id)) return SetErrorState(ErrorMessage.ValidItemId);
|
||||||
using (var dbConnection = Database.CreateConnection())
|
using (var dbConnection = Database.CreateConnection())
|
||||||
using (var dbCommand = dbConnection.CreateCommand())
|
using (var dbCommand = dbConnection.CreateCommand())
|
||||||
{
|
{
|
||||||
@@ -499,7 +499,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
public override bool StoreVehicleFeature(SbmVehicleFeature.Data vehicleFeatureData, DbUpdateInfo dbUpdateInfo)
|
public override bool StoreVehicleFeature(SbmVehicleFeature.Data vehicleFeatureData, DbUpdateInfo dbUpdateInfo)
|
||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (Database == null) return SetErrorState(Msg_DatabaseNotAvailable);
|
if (Database == null) return SetErrorState(ErrorMessage.DatabaseNotAvailable);
|
||||||
if (!Database.TableExists(SbmDbDfn.GetTableName(SbmDbDfn.TableIdx.SaVehicleFeature))) return SetErrorState("vehicle features not supported");
|
if (!Database.TableExists(SbmDbDfn.GetTableName(SbmDbDfn.TableIdx.SaVehicleFeature))) return SetErrorState("vehicle features not supported");
|
||||||
if (vehicleFeatureData == null) SetErrorState("vehicle feature data not supplied");
|
if (vehicleFeatureData == null) SetErrorState("vehicle feature data not supplied");
|
||||||
|
|
||||||
@@ -143,7 +143,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
if (count == 0) return null;
|
if (count == 0) return null;
|
||||||
if (count != 1)
|
if (count != 1)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_MultipleItemsFound);
|
SetErrorState(ErrorMessage.MultipleItemsFound);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
SbmVehicleFeature vehicleFeature = null;
|
SbmVehicleFeature vehicleFeature = null;
|
||||||
@@ -160,7 +160,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -203,7 +203,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!IsValidVehicleFeature(vehicleFeature)) return false;
|
if (!IsValidVehicleFeature(vehicleFeature)) return false;
|
||||||
if (SysId.IsValid(vehicleFeature.Id)) return SetErrorState(ErrorMessage.ValiditemId);
|
if (SysId.IsValid(vehicleFeature.Id)) return SetErrorState(ErrorMessage.ValidItemId);
|
||||||
using (var dbConnection = Database.CreateConnection())
|
using (var dbConnection = Database.CreateConnection())
|
||||||
using (var dbCommand = dbConnection.CreateCommand())
|
using (var dbCommand = dbConnection.CreateCommand())
|
||||||
{
|
{
|
||||||
@@ -548,7 +548,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
public override bool UpdateReferencesToSalesTemplate(SbmCommodity commodity)
|
public override bool UpdateReferencesToSalesTemplate(SbmCommodity commodity)
|
||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (commodity == null) return SetErrorState(Msg_ItemNotSpecified);
|
if (commodity == null) return SetErrorState(ErrorMessage.InvalidStatus);
|
||||||
|
|
||||||
// Build update query to refresh all commodities that refer to this template.
|
// Build update query to refresh all commodities that refer to this template.
|
||||||
List<String> filters = new List<String>();
|
List<String> filters = new List<String>();
|
||||||
@@ -575,7 +575,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
if (count == 0) return null;
|
if (count == 0) return null;
|
||||||
if (count != 1)
|
if (count != 1)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_MultipleItemsFound);
|
SetErrorState(ErrorMessage.MultipleItemsFound);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
SbmCommodity commodity = null;
|
SbmCommodity commodity = null;
|
||||||
@@ -592,7 +592,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -628,7 +628,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!IsValidCommodity(commodity)) return false;
|
if (!IsValidCommodity(commodity)) return false;
|
||||||
if (SysId.IsValid(commodity.Id)) return SetErrorState(ErrorMessage.ValiditemId);
|
if (SysId.IsValid(commodity.Id)) return SetErrorState(ErrorMessage.ValidItemId);
|
||||||
using (var dbConnection = Database.CreateConnection())
|
using (var dbConnection = Database.CreateConnection())
|
||||||
using (var dbCommand = dbConnection.CreateCommand())
|
using (var dbCommand = dbConnection.CreateCommand())
|
||||||
{
|
{
|
||||||
@@ -2691,7 +2691,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
if (count == 0) return null;
|
if (count == 0) return null;
|
||||||
if (count != 1)
|
if (count != 1)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_MultipleItemsFound);
|
SetErrorState(ErrorMessage.MultipleItemsFound);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
SbmCommodityCustomer prmCommodityCustomer = null;
|
SbmCommodityCustomer prmCommodityCustomer = null;
|
||||||
@@ -176,7 +176,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -212,7 +212,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!IsValidCommodityCustomer(commodityCustomer)) return false;
|
if (!IsValidCommodityCustomer(commodityCustomer)) return false;
|
||||||
if (SysId.IsValid(commodityCustomer.Id)) return SetErrorState(ErrorMessage.ValiditemId);
|
if (SysId.IsValid(commodityCustomer.Id)) return SetErrorState(ErrorMessage.ValidItemId);
|
||||||
using (var dbConnection = Database.CreateConnection())
|
using (var dbConnection = Database.CreateConnection())
|
||||||
using (var dbCommand = dbConnection.CreateCommand())
|
using (var dbCommand = dbConnection.CreateCommand())
|
||||||
{
|
{
|
||||||
@@ -614,7 +614,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
if (count == 0) return null;
|
if (count == 0) return null;
|
||||||
if (count != 1)
|
if (count != 1)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_MultipleItemsFound);
|
SetErrorState(ErrorMessage.MultipleItemsFound);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
SbmCommoditySupplier commoditySupplier = null;
|
SbmCommoditySupplier commoditySupplier = null;
|
||||||
@@ -69,7 +69,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -127,7 +127,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!IsValidCommoditySupplier(commoditySupplier)) return false;
|
if (!IsValidCommoditySupplier(commoditySupplier)) return false;
|
||||||
if (SysId.IsValid(commoditySupplier.Id)) return SetErrorState(ErrorMessage.ValiditemId);
|
if (SysId.IsValid(commoditySupplier.Id)) return SetErrorState(ErrorMessage.ValidItemId);
|
||||||
using (var dbConnection = Database.CreateConnection())
|
using (var dbConnection = Database.CreateConnection())
|
||||||
using (var dbCommand = dbConnection.CreateCommand())
|
using (var dbCommand = dbConnection.CreateCommand())
|
||||||
{
|
{
|
||||||
@@ -515,7 +515,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
if (count == 0) return null;
|
if (count == 0) return null;
|
||||||
if (count != 1)
|
if (count != 1)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_MultipleItemsFound);
|
SetErrorState(ErrorMessage.MultipleItemsFound);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
SbmContainer container = null;
|
SbmContainer container = null;
|
||||||
@@ -108,7 +108,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -144,7 +144,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!IsValidContainer(container)) return false;
|
if (!IsValidContainer(container)) return false;
|
||||||
if (SysId.IsValid(container.Id)) return SetErrorState(ErrorMessage.ValiditemId);
|
if (SysId.IsValid(container.Id)) return SetErrorState(ErrorMessage.ValidItemId);
|
||||||
using (var dbConnection = Database.CreateConnection())
|
using (var dbConnection = Database.CreateConnection())
|
||||||
using (var dbCommand = dbConnection.CreateCommand())
|
using (var dbCommand = dbConnection.CreateCommand())
|
||||||
{
|
{
|
||||||
@@ -602,7 +602,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
if (count == 0) return null;
|
if (count == 0) return null;
|
||||||
if (count != 1)
|
if (count != 1)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_MultipleItemsFound);
|
SetErrorState(ErrorMessage.MultipleItemsFound);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
SbmContainerItem containerItem = null;
|
SbmContainerItem containerItem = null;
|
||||||
@@ -101,7 +101,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -137,7 +137,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!IsValidContainerItem(containerItem)) return false;
|
if (!IsValidContainerItem(containerItem)) return false;
|
||||||
if (SysId.IsValid(containerItem.Id)) return SetErrorState(ErrorMessage.ValiditemId);
|
if (SysId.IsValid(containerItem.Id)) return SetErrorState(ErrorMessage.ValidItemId);
|
||||||
using (var dbConnection = Database.CreateConnection())
|
using (var dbConnection = Database.CreateConnection())
|
||||||
using (var dbCommand = dbConnection.CreateCommand())
|
using (var dbCommand = dbConnection.CreateCommand())
|
||||||
{
|
{
|
||||||
@@ -684,7 +684,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -325,7 +325,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
if (count == 0) return null;
|
if (count == 0) return null;
|
||||||
if (count != 1)
|
if (count != 1)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_MultipleItemsFound);
|
SetErrorState(ErrorMessage.MultipleItemsFound);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
SbmPortfolioItem portfolioItem = null;
|
SbmPortfolioItem portfolioItem = null;
|
||||||
@@ -342,7 +342,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -364,7 +364,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!IsValidPortfolioItem(portfolioItem)) return false;
|
if (!IsValidPortfolioItem(portfolioItem)) return false;
|
||||||
if (SysId.IsValid(portfolioItem.Id)) return SetErrorState(ErrorMessage.ValiditemId);
|
if (SysId.IsValid(portfolioItem.Id)) return SetErrorState(ErrorMessage.ValidItemId);
|
||||||
using (var dbConnection = Database.CreateConnection())
|
using (var dbConnection = Database.CreateConnection())
|
||||||
using (var dbCommand = dbConnection.CreateCommand())
|
using (var dbCommand = dbConnection.CreateCommand())
|
||||||
{
|
{
|
||||||
@@ -984,7 +984,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
if (count == 0) return null;
|
if (count == 0) return null;
|
||||||
if (count != 1)
|
if (count != 1)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_MultipleItemsFound);
|
SetErrorState(ErrorMessage.MultipleItemsFound);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
SbmItemBatch itemBatch = null;
|
SbmItemBatch itemBatch = null;
|
||||||
@@ -63,7 +63,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -104,7 +104,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!IsValidItemBatch(itemBatch)) return false;
|
if (!IsValidItemBatch(itemBatch)) return false;
|
||||||
if (SysId.IsValid(itemBatch.Id)) return SetErrorState(ErrorMessage.ValiditemId);
|
if (SysId.IsValid(itemBatch.Id)) return SetErrorState(ErrorMessage.ValidItemId);
|
||||||
using (var dbConnection = Database.CreateConnection())
|
using (var dbConnection = Database.CreateConnection())
|
||||||
using (var dbCommand = dbConnection.CreateCommand())
|
using (var dbCommand = dbConnection.CreateCommand())
|
||||||
{
|
{
|
||||||
@@ -443,7 +443,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
if (count == 0) return null;
|
if (count == 0) return null;
|
||||||
if (count != 1)
|
if (count != 1)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_MultipleItemsFound);
|
SetErrorState(ErrorMessage.MultipleItemsFound);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
SbmItemLink itemLink = null;
|
SbmItemLink itemLink = null;
|
||||||
@@ -51,7 +51,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -108,7 +108,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!IsValidItemLink(itemLink)) return false;
|
if (!IsValidItemLink(itemLink)) return false;
|
||||||
if (SysId.IsValid(itemLink.Id)) return SetErrorState(ErrorMessage.ValiditemId);
|
if (SysId.IsValid(itemLink.Id)) return SetErrorState(ErrorMessage.ValidItemId);
|
||||||
using (var dbConnection = Database.CreateConnection())
|
using (var dbConnection = Database.CreateConnection())
|
||||||
using (var dbCommand = dbConnection.CreateCommand())
|
using (var dbCommand = dbConnection.CreateCommand())
|
||||||
{
|
{
|
||||||
@@ -567,7 +567,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
if (count == 0) return null;
|
if (count == 0) return null;
|
||||||
if (count != 1)
|
if (count != 1)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_MultipleItemsFound);
|
SetErrorState(ErrorMessage.MultipleItemsFound);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
SbmPrice price = null;
|
SbmPrice price = null;
|
||||||
@@ -63,7 +63,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -100,7 +100,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!IsValidPrice(price)) return false;
|
if (!IsValidPrice(price)) return false;
|
||||||
if (SysId.IsValid(price.Id)) return SetErrorState(ErrorMessage.ValiditemId);
|
if (SysId.IsValid(price.Id)) return SetErrorState(ErrorMessage.ValidItemId);
|
||||||
using (var dbConnection = Database.CreateConnection())
|
using (var dbConnection = Database.CreateConnection())
|
||||||
using (var dbCommand = dbConnection.CreateCommand())
|
using (var dbCommand = dbConnection.CreateCommand())
|
||||||
{
|
{
|
||||||
@@ -505,7 +505,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
if (count == 0) return null;
|
if (count == 0) return null;
|
||||||
if (count != 1)
|
if (count != 1)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_MultipleItemsFound);
|
SetErrorState(ErrorMessage.MultipleItemsFound);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
SbmPriceSet priceSet = null;
|
SbmPriceSet priceSet = null;
|
||||||
@@ -80,7 +80,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -117,7 +117,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!IsValidPriceSet(priceSet)) return false;
|
if (!IsValidPriceSet(priceSet)) return false;
|
||||||
if (SysId.IsValid(priceSet.Id)) return SetErrorState(ErrorMessage.ValiditemId);
|
if (SysId.IsValid(priceSet.Id)) return SetErrorState(ErrorMessage.ValidItemId);
|
||||||
using (var dbConnection = Database.CreateConnection())
|
using (var dbConnection = Database.CreateConnection())
|
||||||
using (var dbCommand = dbConnection.CreateCommand())
|
using (var dbCommand = dbConnection.CreateCommand())
|
||||||
{
|
{
|
||||||
@@ -477,7 +477,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
public override bool ClearProcessAssociatedData(SbmProcess process, DbUpdateInfo dbUpdateInfo)
|
public override bool ClearProcessAssociatedData(SbmProcess process, DbUpdateInfo dbUpdateInfo)
|
||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (process == null || !SysId.IsValid(process.Id)) return SetErrorState(Msg_ItemNotSpecified);
|
if (process == null || !SysId.IsValid(process.Id)) return SetErrorState(ErrorMessage.InvalidStatus);
|
||||||
// Clear Item data records.
|
// Clear Item data records.
|
||||||
if (!ItemDataConsole.ClearItemData(process.GetItemId(), dbUpdateInfo))
|
if (!ItemDataConsole.ClearItemData(process.GetItemId(), dbUpdateInfo))
|
||||||
SetErrorState(ItemDataConsole.ErrorStateMessage);
|
SetErrorState(ItemDataConsole.ErrorStateMessage);
|
||||||
@@ -222,7 +222,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
if (count == 0) return null;
|
if (count == 0) return null;
|
||||||
if (count != 1)
|
if (count != 1)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_MultipleItemsFound);
|
SetErrorState(ErrorMessage.MultipleItemsFound);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
SbmProcess prmProcess = null;
|
SbmProcess prmProcess = null;
|
||||||
@@ -239,7 +239,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -287,7 +287,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!IsValidProcess(process)) return false;
|
if (!IsValidProcess(process)) return false;
|
||||||
if (SysId.IsValid(process.Id)) return SetErrorState(ErrorMessage.ValiditemId);
|
if (SysId.IsValid(process.Id)) return SetErrorState(ErrorMessage.ValidItemId);
|
||||||
using (var dbConnection = Database.CreateConnection())
|
using (var dbConnection = Database.CreateConnection())
|
||||||
using (var dbCommand = dbConnection.CreateCommand())
|
using (var dbCommand = dbConnection.CreateCommand())
|
||||||
{
|
{
|
||||||
@@ -641,7 +641,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
if (count == 0) return null;
|
if (count == 0) return null;
|
||||||
if (count != 1)
|
if (count != 1)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_MultipleItemsFound);
|
SetErrorState(ErrorMessage.MultipleItemsFound);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
SbmLocation location = null;
|
SbmLocation location = null;
|
||||||
@@ -93,7 +93,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -129,7 +129,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!IsValidLocation(location)) return false;
|
if (!IsValidLocation(location)) return false;
|
||||||
if (SysId.IsValid(location.Id)) return SetErrorState(ErrorMessage.ValiditemId);
|
if (SysId.IsValid(location.Id)) return SetErrorState(ErrorMessage.ValidItemId);
|
||||||
using (var dbConnection = Database.CreateConnection())
|
using (var dbConnection = Database.CreateConnection())
|
||||||
using (var dbCommand = dbConnection.CreateCommand())
|
using (var dbCommand = dbConnection.CreateCommand())
|
||||||
{
|
{
|
||||||
@@ -498,7 +498,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
if (count == 0) return null;
|
if (count == 0) return null;
|
||||||
if (count != 1)
|
if (count != 1)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_MultipleItemsFound);
|
SetErrorState(ErrorMessage.MultipleItemsFound);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
SbmMovement movement = null;
|
SbmMovement movement = null;
|
||||||
@@ -156,7 +156,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -192,7 +192,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!IsValidMovement(movement)) return false;
|
if (!IsValidMovement(movement)) return false;
|
||||||
if (SysId.IsValid(movement.Id)) return SetErrorState(ErrorMessage.ValiditemId);
|
if (SysId.IsValid(movement.Id)) return SetErrorState(ErrorMessage.ValidItemId);
|
||||||
using (var dbConnection = Database.CreateConnection())
|
using (var dbConnection = Database.CreateConnection())
|
||||||
using (var dbCommand = dbConnection.CreateCommand())
|
using (var dbCommand = dbConnection.CreateCommand())
|
||||||
{
|
{
|
||||||
@@ -833,7 +833,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
if (count == 0) return null;
|
if (count == 0) return null;
|
||||||
if (count != 1)
|
if (count != 1)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_MultipleItemsFound);
|
SetErrorState(ErrorMessage.MultipleItemsFound);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
SbmStockLevel stockLevel = null;
|
SbmStockLevel stockLevel = null;
|
||||||
@@ -64,7 +64,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -100,7 +100,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!IsValidStockLevel(stockLevel)) return false;
|
if (!IsValidStockLevel(stockLevel)) return false;
|
||||||
if (SysId.IsValid(stockLevel.Id)) return SetErrorState(ErrorMessage.ValiditemId);
|
if (SysId.IsValid(stockLevel.Id)) return SetErrorState(ErrorMessage.ValidItemId);
|
||||||
using (var dbConnection = Database.CreateConnection())
|
using (var dbConnection = Database.CreateConnection())
|
||||||
using (var dbCommand = dbConnection.CreateCommand())
|
using (var dbCommand = dbConnection.CreateCommand())
|
||||||
{
|
{
|
||||||
@@ -564,7 +564,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -322,7 +322,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
if (count == 0) return null;
|
if (count == 0) return null;
|
||||||
if (count != 1)
|
if (count != 1)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_MultipleItemsFound);
|
SetErrorState(ErrorMessage.MultipleItemsFound);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
SbmConstituent prmituent = null;
|
SbmConstituent prmituent = null;
|
||||||
@@ -339,7 +339,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -380,7 +380,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!IsValidConstituent(constituent)) return false;
|
if (!IsValidConstituent(constituent)) return false;
|
||||||
if (SysId.IsValid(constituent.Id)) return SetErrorState(ErrorMessage.ValiditemId);
|
if (SysId.IsValid(constituent.Id)) return SetErrorState(ErrorMessage.ValidItemId);
|
||||||
using (var dbConnection = Database.CreateConnection())
|
using (var dbConnection = Database.CreateConnection())
|
||||||
using (var dbCommand = dbConnection.CreateCommand())
|
using (var dbCommand = dbConnection.CreateCommand())
|
||||||
{
|
{
|
||||||
@@ -963,7 +963,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
public override bool RequirementHasAssociatedRequirements(SysId requirementId)
|
public override bool RequirementHasAssociatedRequirements(SysId requirementId)
|
||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!SysId.IsValid(requirementId)) return SetErrorState(Msg_InvalidItemSpecified);
|
if (!SysId.IsValid(requirementId)) return SetErrorState(ErrorMessage.InvalidItemSpecified);
|
||||||
String filter = SbmDbDfn.GetColumnName(SbmDbDfn.ColumnIdx.Requirement_ReqntIdSource) + "=" + SysId.ToString(requirementId);
|
String filter = SbmDbDfn.GetColumnName(SbmDbDfn.ColumnIdx.Requirement_ReqntIdSource) + "=" + SysId.ToString(requirementId);
|
||||||
long rowCount = Database.GetRowCount(SbmDbDfn.GetTableName(SbmDbDfn.TableIdx.Requirement), filter);
|
long rowCount = Database.GetRowCount(SbmDbDfn.GetTableName(SbmDbDfn.TableIdx.Requirement), filter);
|
||||||
SetErrorState(Database.ErrorStateMessage);
|
SetErrorState(Database.ErrorStateMessage);
|
||||||
@@ -203,7 +203,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
public override bool ClearRequirementDependentData(SbmRequirement requirement, DbUpdateInfo dbUpdateInfo)
|
public override bool ClearRequirementDependentData(SbmRequirement requirement, DbUpdateInfo dbUpdateInfo)
|
||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (requirement == null || !SysId.IsValid(requirement.Id)) return SetErrorState(Msg_InvalidItemSpecified);
|
if (requirement == null || !SysId.IsValid(requirement.Id)) return SetErrorState(ErrorMessage.InvalidItemSpecified);
|
||||||
// Clear any references to this requirement from other requirements.
|
// Clear any references to this requirement from other requirements.
|
||||||
if (!HasErrorState())
|
if (!HasErrorState())
|
||||||
ClearRequirementAssociatedRequirements(requirement, dbUpdateInfo);
|
ClearRequirementAssociatedRequirements(requirement, dbUpdateInfo);
|
||||||
@@ -244,7 +244,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
{
|
{
|
||||||
// Clear ReqntIdSource for any requirements that reference this one.
|
// Clear ReqntIdSource for any requirements that reference this one.
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (requirement == null || !SysId.IsValid(requirement.Id)) return SetErrorState(Msg_InvalidItemSpecified);
|
if (requirement == null || !SysId.IsValid(requirement.Id)) return SetErrorState(ErrorMessage.InvalidItemSpecified);
|
||||||
String filter = $"{SbmDbDfn.GetColumnName(SbmDbDfn.ColumnIdx.Requirement_ReqntIdSource)}={SysId.ToLong(requirement.Id)}";
|
String filter = $"{SbmDbDfn.GetColumnName(SbmDbDfn.ColumnIdx.Requirement_ReqntIdSource)}={SysId.ToLong(requirement.Id)}";
|
||||||
List<StringPair> values = new List<StringPair>();
|
List<StringPair> values = new List<StringPair>();
|
||||||
SacsDatabase.AddValuePair(values, SbmDbDfn.GetColumnName(SbmDbDfn.ColumnIdx.Requirement_ReqntIdSource), "0", false);
|
SacsDatabase.AddValuePair(values, SbmDbDfn.GetColumnName(SbmDbDfn.ColumnIdx.Requirement_ReqntIdSource), "0", false);
|
||||||
@@ -258,7 +258,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
public override bool CalculateTotal(SbmRequirement requirement)
|
public override bool CalculateTotal(SbmRequirement requirement)
|
||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (requirement == null) return SetErrorState(Msg_ItemNotSpecified);
|
if (requirement == null) return SetErrorState(ErrorMessage.InvalidStatus);
|
||||||
int decimalsCurrency = 2;
|
int decimalsCurrency = 2;
|
||||||
|
|
||||||
// Calculate intermediate amounts.
|
// Calculate intermediate amounts.
|
||||||
@@ -472,7 +472,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
public override bool SetTaxCode(SbmRequirement requirement, DateTime effective)
|
public override bool SetTaxCode(SbmRequirement requirement, DateTime effective)
|
||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (requirement == null) return SetErrorState(Msg_ItemNotSpecified);
|
if (requirement == null) return SetErrorState(ErrorMessage.InvalidStatus);
|
||||||
if (!effective.IsValid()) return SetErrorState("invalid effective date specified");
|
if (!effective.IsValid()) return SetErrorState("invalid effective date specified");
|
||||||
|
|
||||||
// Locate the specified tax code in the list:
|
// Locate the specified tax code in the list:
|
||||||
@@ -518,7 +518,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
if (count == 0) return null;
|
if (count == 0) return null;
|
||||||
if (count != 1)
|
if (count != 1)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_MultipleItemsFound);
|
SetErrorState(ErrorMessage.MultipleItemsFound);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
SbmRequirement prmRequirement = null;
|
SbmRequirement prmRequirement = null;
|
||||||
@@ -535,7 +535,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -590,7 +590,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!IsValidRequirement(requirement)) return false;
|
if (!IsValidRequirement(requirement)) return false;
|
||||||
if (SysId.IsValid(requirement.Id)) return SetErrorState(ErrorMessage.ValiditemId);
|
if (SysId.IsValid(requirement.Id)) return SetErrorState(ErrorMessage.ValidItemId);
|
||||||
using (var dbConnection = Database.CreateConnection())
|
using (var dbConnection = Database.CreateConnection())
|
||||||
using (var dbCommand = dbConnection.CreateCommand())
|
using (var dbCommand = dbConnection.CreateCommand())
|
||||||
{
|
{
|
||||||
@@ -2322,7 +2322,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
public override bool RefreshTransactionTotals(SbmTransaction transaction, IEnumerable<SbmRequirement> requirements)
|
public override bool RefreshTransactionTotals(SbmTransaction transaction, IEnumerable<SbmRequirement> requirements)
|
||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (transaction == null) return SetErrorState(Msg_ItemNotSpecified);
|
if (transaction == null) return SetErrorState(ErrorMessage.InvalidStatus);
|
||||||
if (requirements == null) requirements = new List<SbmRequirement>();
|
if (requirements == null) requirements = new List<SbmRequirement>();
|
||||||
|
|
||||||
// Total weight.
|
// Total weight.
|
||||||
@@ -164,7 +164,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
String errorStatePrefix = "Failed to change transaction's association - ";
|
String errorStatePrefix = "Failed to change transaction's association - ";
|
||||||
|
|
||||||
// Database connection.
|
// Database connection.
|
||||||
if (!HasErrorState() && Database == null) SetErrorState(errorStatePrefix + Msg_DatabaseNotAvailable);
|
if (!HasErrorState() && Database == null) SetErrorState(errorStatePrefix + ErrorMessage.DatabaseNotAvailable);
|
||||||
|
|
||||||
// Validate the transaction.
|
// Validate the transaction.
|
||||||
if (!HasErrorState() && (transaction == null || !SysId.IsValid(transaction.Id)))
|
if (!HasErrorState() && (transaction == null || !SysId.IsValid(transaction.Id)))
|
||||||
|
|||||||
@@ -495,7 +495,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
if (count == 0) return null;
|
if (count == 0) return null;
|
||||||
if (count != 1)
|
if (count != 1)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_MultipleItemsFound);
|
SetErrorState(ErrorMessage.MultipleItemsFound);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
SbmTransaction prmTransaction = null;
|
SbmTransaction prmTransaction = null;
|
||||||
@@ -512,7 +512,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -586,7 +586,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!IsValidTransaction(transaction)) return false;
|
if (!IsValidTransaction(transaction)) return false;
|
||||||
if (SysId.IsValid(transaction.Id)) return SetErrorState(ErrorMessage.ValiditemId);
|
if (SysId.IsValid(transaction.Id)) return SetErrorState(ErrorMessage.ValidItemId);
|
||||||
if (StringUtil.IsBlank(transaction.Ref))
|
if (StringUtil.IsBlank(transaction.Ref))
|
||||||
{
|
{
|
||||||
if (!AssignTransactionReference(transaction))
|
if (!AssignTransactionReference(transaction))
|
||||||
@@ -685,7 +685,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!base.TransactionCanBeDeleted(transaction)) return false;
|
if (!base.TransactionCanBeDeleted(transaction)) return false;
|
||||||
|
|
||||||
if (transaction == null) return SetErrorState(Msg_ItemNotSpecified);
|
if (transaction == null) return SetErrorState(ErrorMessage.InvalidStatus);
|
||||||
|
|
||||||
// Associated transactions.
|
// Associated transactions.
|
||||||
if (TransactionIsReferencedByOtherTransactions(transaction.Id)) return SetErrorState("linked transactions are present");
|
if (TransactionIsReferencedByOtherTransactions(transaction.Id)) return SetErrorState("linked transactions are present");
|
||||||
@@ -1895,7 +1895,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
SetErrorState(Msg_DatabaseQueryException);
|
SetErrorState(ErrorMessage.DatabaseQueryException);
|
||||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -828,4 +828,13 @@
|
|||||||
<data name="label.raised.by" xml:space="preserve">
|
<data name="label.raised.by" xml:space="preserve">
|
||||||
<value>Raised by</value>
|
<value>Raised by</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="label.requirements" xml:space="preserve">
|
||||||
|
<value>Requirements</value>
|
||||||
|
</data>
|
||||||
|
<data name="label.requirement" xml:space="preserve">
|
||||||
|
<value>Requirement</value>
|
||||||
|
</data>
|
||||||
|
<data name="caption.item.requirements" xml:space="preserve">
|
||||||
|
<value>{0} Items</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
+34
-6
@@ -1,5 +1,4 @@
|
|||||||
using DocumentFormat.OpenXml.EMMA;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using Sarand.BusinessMgr.Net.Standard.Base.App;
|
using Sarand.BusinessMgr.Net.Standard.Base.App;
|
||||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus;
|
using Sarand.BusinessMgr.Net.Standard.Base.Bus;
|
||||||
using Sarand.BusinessMgr.Web.Portal.Components;
|
using Sarand.BusinessMgr.Web.Portal.Components;
|
||||||
@@ -13,6 +12,7 @@ using Sarand.Net.Standard.Base.Security;
|
|||||||
using Sarand.Net.Standard.Base.Utils;
|
using Sarand.Net.Standard.Base.Utils;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace Sarand.BusinessMgr.Web.Portal.Controllers.Transactions
|
namespace Sarand.BusinessMgr.Web.Portal.Controllers.Transactions
|
||||||
{
|
{
|
||||||
@@ -150,7 +150,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Transactions
|
|||||||
responseData.Data.TransactionTypes.Add(new AjaxResponse_Data.ItemCodeDesc(transactionType.Code, transactionType.Desc));
|
responseData.Data.TransactionTypes.Add(new AjaxResponse_Data.ItemCodeDesc(transactionType.Code, transactionType.Desc));
|
||||||
|
|
||||||
// Reference data - statuses.
|
// Reference data - statuses.
|
||||||
foreach (SaStatus status in SbmTransaction.ValidStatuses().FindAll(item => item != SaStatus.Deleted))
|
foreach (SaStatus status in SbmTransaction.ValidStatusesByType(model.GetFilterTransactionType()).Where(item => item != SaStatus.Deleted))
|
||||||
responseData.Data.Statuses.Add(new AjaxResponse_Data.ItemCodeDesc(SacsSystem.GetStatusCode(status), Localiser.GetStatusCaption(status)));
|
responseData.Data.Statuses.Add(new AjaxResponse_Data.ItemCodeDesc(SacsSystem.GetStatusCode(status), Localiser.GetStatusCaption(status)));
|
||||||
responseData.Data.DefaultStatusCode = SacsSystem.GetStatusCode(SbmTransaction.DefaultStatus);
|
responseData.Data.DefaultStatusCode = SacsSystem.GetStatusCode(SbmTransaction.DefaultStatus);
|
||||||
}
|
}
|
||||||
@@ -218,7 +218,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Transactions
|
|||||||
else prmTransaction.StatusCat = SbmTransaction.StatusCat.NotDeleted;
|
else prmTransaction.StatusCat = SbmTransaction.StatusCat.NotDeleted;
|
||||||
if (model.GetFilterTransactionType() <= 0)
|
if (model.GetFilterTransactionType() <= 0)
|
||||||
prmTransaction.SortColumns.Add(TransactionMgr.GetTransactionColumnDfn(SbmTransaction.Column.Type_Desc));
|
prmTransaction.SortColumns.Add(TransactionMgr.GetTransactionColumnDfn(SbmTransaction.Column.Type_Desc));
|
||||||
prmTransaction.SortColumns.Add(TransactionMgr.GetTransactionColumnDfn(SbmTransaction.Column.Ref));
|
prmTransaction.SortColumns.Add(TransactionMgr.GetTransactionColumnDfn(SbmTransaction.Column.RaisedOn).SetSortDescending());
|
||||||
model.Paging.ItemTotal = (ulong)TransactionMgr.GetTransactionCount(prmTransaction);
|
model.Paging.ItemTotal = (ulong)TransactionMgr.GetTransactionCount(prmTransaction);
|
||||||
model.PopulatePagingTo(prmTransaction.ResultsPaging);
|
model.PopulatePagingTo(prmTransaction.ResultsPaging);
|
||||||
|
|
||||||
@@ -407,6 +407,11 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Transactions
|
|||||||
return Json(responseData.SetGoHome(messageTitle, Localiser["msg.error.system"]));
|
return Json(responseData.SetGoHome(messageTitle, Localiser["msg.error.system"]));
|
||||||
}
|
}
|
||||||
transaction = TransactionMgr.CreateTransaction(associationId, model.GetTransactionType());
|
transaction = TransactionMgr.CreateTransaction(associationId, model.GetTransactionType());
|
||||||
|
if (transaction == null)
|
||||||
|
{
|
||||||
|
SaLogger.Warn($"{SysUtil.Fn} Failed to create Transaction. {TransactionMgr.ErrorStateMessage.TrimEnd('.')}.");
|
||||||
|
return Json(responseData.SetGoHome(messageTitle, Localiser["msg.error.system"]));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Populate item properties.
|
// Populate item properties.
|
||||||
@@ -416,11 +421,34 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Transactions
|
|||||||
transaction.RefExt = model.Transaction.ReferenceExt;
|
transaction.RefExt = model.Transaction.ReferenceExt;
|
||||||
if (model.Transaction.DescBrief != null)
|
if (model.Transaction.DescBrief != null)
|
||||||
transaction.DescBrief = model.Transaction.DescBrief;
|
transaction.DescBrief = model.Transaction.DescBrief;
|
||||||
|
if (model.Transaction.RaisedBy != null)
|
||||||
|
transaction.RaisedBy = model.Transaction.RaisedBy;
|
||||||
|
if (model.Transaction.ContactName != null)
|
||||||
|
transaction.ContactName = model.Transaction.ContactName;
|
||||||
|
|
||||||
|
// Status & dates.
|
||||||
|
if (model.Transaction.StatusCode != null)
|
||||||
|
transaction.Status = model.GetTransactionStatus();
|
||||||
|
// Raised date.
|
||||||
|
if (model.Transaction.Raised != null)
|
||||||
|
transaction.Raised = model.ParseDateFromForm(model.Transaction.Raised);
|
||||||
|
if (transaction.TransactionStatusCat == SbmTransaction.StatusCat.Pending)
|
||||||
|
transaction.InProgress = DateTime.MinValue;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// In Progress date.
|
||||||
|
if (model.Transaction.InProgress != null)
|
||||||
|
transaction.InProgress = model.ParseDateFromForm(model.Transaction.InProgress);
|
||||||
|
// Closed date.
|
||||||
|
if (transaction.TransactionStatusCat == SbmTransaction.StatusCat.Closed)
|
||||||
|
transaction.Closed = DateTime.MinValue;
|
||||||
|
else if (model.Transaction.Closed != null)
|
||||||
|
transaction.Closed = model.ParseDateFromForm(model.Transaction.Closed);
|
||||||
|
}
|
||||||
|
|
||||||
// Common properties.
|
// Common properties.
|
||||||
if (model.Transaction.Notes != null)
|
if (model.Transaction.Notes != null)
|
||||||
transaction.Notes = model.Transaction.Notes;
|
transaction.Notes = model.Transaction.Notes;
|
||||||
if (model.Transaction.StatusCode != null)
|
|
||||||
transaction.Status = model.GetTransactionStatus();
|
|
||||||
|
|
||||||
// Store item.
|
// Store item.
|
||||||
if (!SysId.IsValid(transaction.Id))
|
if (!SysId.IsValid(transaction.Id))
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ using System.Threading.Tasks;
|
|||||||
using Sarand.BusinessMgr.Web.Portal.Models.Transactions;
|
using Sarand.BusinessMgr.Web.Portal.Models.Transactions;
|
||||||
using Sarand.BusinessMgr.Web.Portal.Components;
|
using Sarand.BusinessMgr.Web.Portal.Components;
|
||||||
using Sarand.Net.Standard.Base.Core;
|
using Sarand.Net.Standard.Base.Core;
|
||||||
|
using System.Transactions;
|
||||||
|
|
||||||
namespace Sarand.BusinessMgr.Web.Portal.Controllers.Transactions
|
namespace Sarand.BusinessMgr.Web.Portal.Controllers.Transactions
|
||||||
{
|
{
|
||||||
@@ -55,7 +56,13 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Transactions
|
|||||||
// Transaction page.
|
// Transaction page.
|
||||||
Model_Transaction model = new Model_Transaction(Localiser);
|
Model_Transaction model = new Model_Transaction(Localiser);
|
||||||
RefreshModel(model);
|
RefreshModel(model);
|
||||||
model.Filter.TransactionType = transactionTypes.GetCodeForType(transactionType);
|
model.Filter.Type = transactionTypes.GetCodeForType(transactionType);
|
||||||
|
if (StringUtil.IsBlank(model.Filter.Type))
|
||||||
|
{
|
||||||
|
SaLogger.Warn($"{SysUtil.Fn} Transaction View invoked without Transaction Type specified.");
|
||||||
|
return RedirectToAction("", "");
|
||||||
|
}
|
||||||
|
model.Filter.StatusCat = Internals.GetSystemCodes(Sbm.SystemCode.TransactionStatusCat).GetCodeForType(SbmTransaction.StatusCat.Open);
|
||||||
model.Paging.PageNo = SessionData_Portal.Profile.Transaction.Filter.PageNo;
|
model.Paging.PageNo = SessionData_Portal.Profile.Transaction.Filter.PageNo;
|
||||||
model.Paging.PageLength = SessionData_Portal.Profile.Transaction.Filter.PageLength;
|
model.Paging.PageLength = SessionData_Portal.Profile.Transaction.Filter.PageLength;
|
||||||
model.PopulateListConfig();
|
model.PopulateListConfig();
|
||||||
|
|||||||
@@ -0,0 +1,520 @@
|
|||||||
|
using Sarand.BusinessMgr.Net.Standard.Base.App;
|
||||||
|
using Sarand.BusinessMgr.Net.Standard.Base.Bus;
|
||||||
|
using Sarand.Net.Standard.Base.Bus;
|
||||||
|
using Sarand.Net.Standard.Base.Utils;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Drawing;
|
||||||
|
|
||||||
|
namespace Sarand.BusinessMgr.Web.Portal.Models.Requirements
|
||||||
|
{
|
||||||
|
//=======================================================================
|
||||||
|
// Requirement model - Configuration.
|
||||||
|
//=======================================================================
|
||||||
|
partial class Model_Requirement
|
||||||
|
{
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
// Requirement fields.
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
|
||||||
|
/// <summary>Prefix for field names.</summary>
|
||||||
|
public const String FieldNamePrefix = "Reqnt";
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
/// <summary>Item fields.</summary>
|
||||||
|
public enum ItemField
|
||||||
|
{
|
||||||
|
// Identity.
|
||||||
|
Pos,
|
||||||
|
Id,
|
||||||
|
TransactionId,
|
||||||
|
AssociationName,
|
||||||
|
AssociationId,
|
||||||
|
Type,
|
||||||
|
Sequence,
|
||||||
|
JobNumber,
|
||||||
|
// Source requirement.
|
||||||
|
SourceReqntId,
|
||||||
|
SourceReqntTransRef,
|
||||||
|
SourceReqntTransRefExt,
|
||||||
|
SourceReqntJobNumber,
|
||||||
|
// Status dates.
|
||||||
|
Required, RequiredFmt,
|
||||||
|
Started, StartedFmt,
|
||||||
|
Completed, CompletedFmt,
|
||||||
|
// Details.
|
||||||
|
AssociationIdSubContract,
|
||||||
|
DescBrief,
|
||||||
|
DescIntro,
|
||||||
|
DescOutline,
|
||||||
|
DescDetail,
|
||||||
|
PromotionCode,
|
||||||
|
PromotionCaption,
|
||||||
|
NominalCode,
|
||||||
|
RandDIndicator,
|
||||||
|
// Commodity.
|
||||||
|
CommodityId,
|
||||||
|
ProductCode,
|
||||||
|
DrawingIssue,
|
||||||
|
AssetId,
|
||||||
|
Quantity,
|
||||||
|
QuantityProd,
|
||||||
|
UomId,
|
||||||
|
MaterialSourceCode,
|
||||||
|
LocationIdStock,
|
||||||
|
AllocationIndicator,
|
||||||
|
// Amounts.
|
||||||
|
AmountUnit,
|
||||||
|
AmountAct,
|
||||||
|
AmountDisc,
|
||||||
|
AmountNet,
|
||||||
|
TaxCodeId,
|
||||||
|
TaxRate,
|
||||||
|
AmountTax,
|
||||||
|
AmountTot,
|
||||||
|
TimeEst,
|
||||||
|
TimeAct,
|
||||||
|
TimeTot,
|
||||||
|
// Costs.
|
||||||
|
CostLabourHours,
|
||||||
|
CostLabourRateHour,
|
||||||
|
CostLabour,
|
||||||
|
CostCommodity,
|
||||||
|
CostPurchase,
|
||||||
|
CostProcess,
|
||||||
|
CostAdditional,
|
||||||
|
CostTotal,
|
||||||
|
CostCalculated,
|
||||||
|
CostPercentMargin,
|
||||||
|
// Common.
|
||||||
|
Notes,
|
||||||
|
Status,
|
||||||
|
OnHold,
|
||||||
|
CreatedOn,
|
||||||
|
UpdatedOn,
|
||||||
|
Actions,
|
||||||
|
//---------------------------------------------------------------
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Identifier used by form fields to show control specific messages generated by model validation etc.
|
||||||
|
/// <para>- Both page and model should use this method to consistently generate the field name.</para>
|
||||||
|
/// </summary>
|
||||||
|
public static String GetFieldName(ItemField field)
|
||||||
|
{
|
||||||
|
return $"{FieldNamePrefix}{field}";
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
|
||||||
|
// List configuration.
|
||||||
|
public class ListConfigData
|
||||||
|
{
|
||||||
|
// List caption.
|
||||||
|
public String Caption { get; set; }
|
||||||
|
// Actions.
|
||||||
|
public class ActionData
|
||||||
|
{
|
||||||
|
public class AllowData
|
||||||
|
{
|
||||||
|
public bool? Create { get; set; }
|
||||||
|
public bool? Update { get; set; }
|
||||||
|
}
|
||||||
|
public AllowData Allow { get; } = new AllowData();
|
||||||
|
}
|
||||||
|
public ActionData Action { get; } = new ActionData();
|
||||||
|
// List columns.
|
||||||
|
public class ColumnData
|
||||||
|
{
|
||||||
|
// Column name prefix.
|
||||||
|
public String Prefix { get; } = Model_Requirement.FieldNamePrefix;
|
||||||
|
// Hide column.
|
||||||
|
public HashSet<string> Hide { get; } = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase);
|
||||||
|
// Column labels.
|
||||||
|
public Dictionary<String, String> Label { get; } = new Dictionary<string, string>(StringComparer.InvariantCultureIgnoreCase);
|
||||||
|
}
|
||||||
|
public ColumnData Column { get; } = new ColumnData();
|
||||||
|
}
|
||||||
|
public ListConfigData ListConfig { get; private set; }
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
/// <summary>
|
||||||
|
/// Populate Requirement list configuration data in this model - only required on initial page construction.
|
||||||
|
/// </summary>
|
||||||
|
public void PopulateListConfig()
|
||||||
|
{
|
||||||
|
ListConfig = new ListConfigData();
|
||||||
|
PopulateListConfig(ListConfig);
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Populate Requirement list configuration data.
|
||||||
|
/// </summary>
|
||||||
|
public void PopulateListConfig(ListConfigData config)
|
||||||
|
{
|
||||||
|
// View properties.
|
||||||
|
ViewMode viewMode = GetFilterMode();
|
||||||
|
bool modeIsSearch = viewMode == ViewMode.Search;
|
||||||
|
bool modeIsMaintain = viewMode == ViewMode.Maintain;
|
||||||
|
bool modeIsProductionControl = viewMode == ViewMode.ProductionControl;
|
||||||
|
bool modeIsCommodityHistory_Maintain = viewMode == ViewMode.CommodityHistory_Maintain;
|
||||||
|
bool modeIsCommodityHistory_ReadOnly = viewMode == ViewMode.CommodityHistory_ReadOnly;
|
||||||
|
bool modeIsCommodityHistory = modeIsCommodityHistory_Maintain || modeIsCommodityHistory_ReadOnly;
|
||||||
|
bool modeIsAssetOrders_Maintain = viewMode == ViewMode.AssetOrders_Maintain;
|
||||||
|
bool modeIsAssetOrders_ReadOnly = viewMode == ViewMode.AssetOrders_ReadOnly;
|
||||||
|
bool modeIsAssetOrders = modeIsAssetOrders_Maintain || modeIsAssetOrders_ReadOnly;
|
||||||
|
|
||||||
|
// Transaction.
|
||||||
|
Sbm.TransactionType transactionType = GetFilterTransactionType();
|
||||||
|
SbmTransaction.StatusCat transactionStatusCat = GetFilterTransactionStatusCat();
|
||||||
|
bool isProject = transactionType == Sbm.TransactionType.Project;
|
||||||
|
bool isSales = SbmTransaction.IsSalesType(transactionType);
|
||||||
|
bool isSalesLead = transactionType == Sbm.TransactionType.SalesLead;
|
||||||
|
bool isSalesQuote = transactionType == Sbm.TransactionType.SalesQuote;
|
||||||
|
bool isSalesOrder = transactionType == Sbm.TransactionType.SalesOrder || transactionType == Sbm.TransactionType.ProformaSalesOrder;
|
||||||
|
bool isSalesPO = transactionType == Sbm.TransactionType.SalesPO;
|
||||||
|
bool isSalesDispatch = transactionType == Sbm.TransactionType.SalesDispatch;
|
||||||
|
bool isSalesInvoice = transactionType == Sbm.TransactionType.SalesInvoice || transactionType == Sbm.TransactionType.ProformaSalesInvoice;
|
||||||
|
bool isPurchase = SbmTransaction.IsPurchaseType(transactionType);
|
||||||
|
bool isPurchaseQuote = transactionType == Sbm.TransactionType.PurchaseQuote;
|
||||||
|
bool isPurchaseOrder = transactionType == Sbm.TransactionType.PurchaseOrder || transactionType == Sbm.TransactionType.ProformaPurchaseOrder;
|
||||||
|
bool isPurchaseSO = transactionType == Sbm.TransactionType.PurchaseSO;
|
||||||
|
bool isPurchaseDelivery = transactionType == Sbm.TransactionType.PurchaseDelivery;
|
||||||
|
bool isPurchaseInvoice = transactionType == Sbm.TransactionType.PurchaseInvoice || transactionType == Sbm.TransactionType.ProformaPurchaseInvoice;
|
||||||
|
|
||||||
|
// Requirement.
|
||||||
|
Sbm.RequirementType requirementType = GetFilterRequirementType();
|
||||||
|
SbmRequirement.StatusCat requirementStatusCat = GetFilterRequirementStatusCat();
|
||||||
|
|
||||||
|
// Options.
|
||||||
|
bool userCanCreateRequirements = SessionData_Portal.SecurityProfile.UserCanCreateItemType(Sbm.ItemType.Requirement);
|
||||||
|
bool userCanUpdateRequirements = SessionData_Portal.SecurityProfile.UserCanUpdateItemType(Sbm.ItemType.Requirement);
|
||||||
|
bool allowJobNumber = SessionConsole.AllowOption(Sbm.ConfigOption.SalesOrderItemJobNumber);
|
||||||
|
bool showDrawingIssue = SessionConsole.DisplayAttribute(SbmDbDfn.ColumnIdx.Commodity_DrawingIssue);
|
||||||
|
bool showAllocationInd = SessionConsole.GetOwnerOption_ShowColumn(Sbm.OrgOption_ShowColumn.OrderItem_AllocationInd);
|
||||||
|
SbmStockControlConfig stockControlConfig = Internals.StockControlConfig;
|
||||||
|
bool allowProductionControl = SessionConsole.AllowOption(Sbm.ConfigOption.ProductionControl);
|
||||||
|
bool allowTimeRecording = SessionConsole.AllowOption(Sbm.ConfigOption.TimeRecording);
|
||||||
|
bool allowCommodityPromotions = SessionConsole.AllowOption(Sbm.ConfigOption.CommodityPromotion);
|
||||||
|
bool allowJobCosting = SessionConsole.GetRequirementCostingConfig().AllowRequirementCosting(transactionType) && TransactionMgr.CostColumnsAreAvailable() && UserCanViewFinancials();
|
||||||
|
bool allowSalesOrderItemRandD = SessionConsole.AllowOption(Sbm.ConfigOption.SalesOrderItemRandD);
|
||||||
|
|
||||||
|
//---------------------------------------------------------------
|
||||||
|
// List Caption.
|
||||||
|
config.Caption = StringUtil.OnBlank(GetListCaptionByTransactionType(transactionType), Localiser["label.requirements"]);
|
||||||
|
|
||||||
|
//---------------------------------------------------------------
|
||||||
|
// Actions.
|
||||||
|
|
||||||
|
if (userCanCreateRequirements)
|
||||||
|
config.Action.Allow.Create = true;
|
||||||
|
if (userCanUpdateRequirements)
|
||||||
|
config.Action.Allow.Update = true;
|
||||||
|
|
||||||
|
//---------------------------------------------------------------
|
||||||
|
// Requirement list columns.
|
||||||
|
|
||||||
|
// Position.
|
||||||
|
|
||||||
|
// Id
|
||||||
|
if (!SbmSystem.DebugMode)
|
||||||
|
config.Column.Hide.Add($"{ItemField.Id}");
|
||||||
|
|
||||||
|
// Sequence - Maintain mode.
|
||||||
|
if (modeIsMaintain)
|
||||||
|
{
|
||||||
|
// Sequence column shown.
|
||||||
|
}
|
||||||
|
else config.Column.Hide.Add($"{ItemField.Sequence}");
|
||||||
|
|
||||||
|
// Job Number - Only Sales Orders and not Search/Production/Asset modes.
|
||||||
|
if (isSalesOrder && !modeIsSearch && !modeIsProductionControl && !modeIsAssetOrders && allowJobNumber)
|
||||||
|
{
|
||||||
|
// Job Number column shown.
|
||||||
|
}
|
||||||
|
else config.Column.Hide.Add($"{ItemField.JobNumber}");
|
||||||
|
|
||||||
|
//---------------------------------------------------------------
|
||||||
|
// Source Requirement references - Sales Dispatch/Invoice not in Search/Production/Asset modes.
|
||||||
|
if ((isSalesDispatch || isSalesInvoice) && !modeIsSearch && !modeIsProductionControl && !modeIsAssetOrders)
|
||||||
|
{
|
||||||
|
// Source requirement references shown.
|
||||||
|
if (!allowJobNumber)
|
||||||
|
config.Column.Hide.Add($"{ItemField.SourceReqntJobNumber}");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
config.Column.Hide.Add($"{ItemField.SourceReqntTransRef}");
|
||||||
|
config.Column.Hide.Add($"{ItemField.SourceReqntTransRefExt}");
|
||||||
|
config.Column.Hide.Add($"{ItemField.SourceReqntJobNumber}");
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------
|
||||||
|
// Product code - not in Commodity/Asset modes.
|
||||||
|
if (!modeIsCommodityHistory && !modeIsAssetOrders)
|
||||||
|
{
|
||||||
|
// Product Code is shown.
|
||||||
|
}
|
||||||
|
else config.Column.Hide.Add($"{ItemField.ProductCode}");
|
||||||
|
|
||||||
|
// Drawing Issue - not Assets modes.
|
||||||
|
if (showDrawingIssue && !modeIsAssetOrders)
|
||||||
|
{
|
||||||
|
// Drawing Issue is shown.
|
||||||
|
}
|
||||||
|
else config.Column.Hide.Add($"{ItemField.DrawingIssue}");
|
||||||
|
|
||||||
|
// Description - always shown.
|
||||||
|
|
||||||
|
// Required - Sales Quote/Order, Purchase Order.
|
||||||
|
if (isSalesQuote || isSalesOrder || isPurchaseOrder)
|
||||||
|
{
|
||||||
|
// Required is shown.
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
config.Column.Hide.Add($"{ItemField.Required}");
|
||||||
|
config.Column.Hide.Add($"{ItemField.RequiredFmt}");
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------
|
||||||
|
// Quantity - always shown.
|
||||||
|
|
||||||
|
// Production Quantity - Sales Quote/Order not in Assets mode.
|
||||||
|
if (allowProductionControl && (isSalesQuote || isSalesOrder) && !modeIsAssetOrders)
|
||||||
|
{
|
||||||
|
// Production Quantity is shown.
|
||||||
|
}
|
||||||
|
else config.Column.Hide.Add($"{ItemField.QuantityProd}");
|
||||||
|
|
||||||
|
// Allocation Indicator - Sales/Purchase Order not in Assets mode.
|
||||||
|
if (stockControlConfig.AllowStockControl() && showAllocationInd && (isSalesOrder || isPurchaseOrder) && transactionStatusCat != SbmTransaction.StatusCat.Pending && !modeIsAssetOrders)
|
||||||
|
{
|
||||||
|
// Allocation Indicator is shown.
|
||||||
|
}
|
||||||
|
else config.Column.Hide.Add($"{ItemField.AllocationIndicator}");
|
||||||
|
|
||||||
|
//---------------------------------------------------------------
|
||||||
|
// Financials.
|
||||||
|
|
||||||
|
// Unit Amount.
|
||||||
|
if (UserCanViewFinancials())
|
||||||
|
{
|
||||||
|
// Unit Amount is shown.
|
||||||
|
}
|
||||||
|
else config.Column.Hide.Add($"{ItemField.AmountUnit}");
|
||||||
|
|
||||||
|
// Net Amount - Maintain mode only.
|
||||||
|
if (UserCanViewFinancials() && modeIsMaintain)
|
||||||
|
{
|
||||||
|
// Unit Amount is shown.
|
||||||
|
}
|
||||||
|
else config.Column.Hide.Add($"{ItemField.AmountNet}");
|
||||||
|
|
||||||
|
// Tax Amount - Maintain mode only.
|
||||||
|
if (UserCanViewFinancials() && isSalesInvoice && modeIsMaintain)
|
||||||
|
{
|
||||||
|
// Tax Amount is shown.
|
||||||
|
}
|
||||||
|
else config.Column.Hide.Add($"{ItemField.AmountTax}");
|
||||||
|
|
||||||
|
// Total Amount - Maintain mode only.
|
||||||
|
if (UserCanViewFinancials() && !isSalesDispatch && !isPurchaseQuote && !isPurchaseOrder && modeIsMaintain)
|
||||||
|
{
|
||||||
|
// Total Amount is shown.
|
||||||
|
}
|
||||||
|
else config.Column.Hide.Add($"{ItemField.AmountTot}");
|
||||||
|
|
||||||
|
//---------------------------------------------------------------
|
||||||
|
|
||||||
|
// Research & Development Indicator.
|
||||||
|
if (isSalesOrder && allowSalesOrderItemRandD && modeIsMaintain)
|
||||||
|
{
|
||||||
|
// R&D Indicator is shown.
|
||||||
|
}
|
||||||
|
else config.Column.Hide.Add($"{ItemField.RandDIndicator}");
|
||||||
|
|
||||||
|
// Time columns.
|
||||||
|
|
||||||
|
// Estimated Time.
|
||||||
|
if ((isProject || isSalesQuote || isSalesOrder) && allowProductionControl && modeIsMaintain)
|
||||||
|
{
|
||||||
|
// Estimated Time is shown.
|
||||||
|
}
|
||||||
|
else config.Column.Hide.Add($"{ItemField.TimeEst}");
|
||||||
|
|
||||||
|
// Actual time.
|
||||||
|
if (isSalesOrder && allowProductionControl && modeIsMaintain)
|
||||||
|
{
|
||||||
|
// Actual Time is shown.
|
||||||
|
}
|
||||||
|
else config.Column.Hide.Add($"{ItemField.TimeAct}");
|
||||||
|
|
||||||
|
// Total time.
|
||||||
|
if ((isProject || isSalesOrder) && allowTimeRecording && modeIsMaintain)
|
||||||
|
{
|
||||||
|
// Total Time is shown.
|
||||||
|
}
|
||||||
|
else config.Column.Hide.Add($"{ItemField.TimeTot}");
|
||||||
|
|
||||||
|
// Job Costing.
|
||||||
|
if (allowJobCosting && modeIsMaintain)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
config.Column.Hide.Add($"{ItemField.CostTotal}");
|
||||||
|
config.Column.Hide.Add($"{ItemField.CostPercentMargin}");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Promotions.
|
||||||
|
if (allowCommodityPromotions && modeIsMaintain)
|
||||||
|
{
|
||||||
|
// Promotion is shown.
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
config.Column.Hide.Add($"{ItemField.PromotionCode}");
|
||||||
|
config.Column.Hide.Add($"{ItemField.PromotionCaption}");
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------
|
||||||
|
// Common.
|
||||||
|
|
||||||
|
// Status.
|
||||||
|
if (!isSalesDispatch && !isSalesInvoice && !isPurchaseInvoice && modeIsMaintain)
|
||||||
|
{
|
||||||
|
// Status is shown.
|
||||||
|
}
|
||||||
|
else config.Column.Hide.Add($"{ItemField.Status}");
|
||||||
|
|
||||||
|
// Actions.
|
||||||
|
if (modeIsMaintain)
|
||||||
|
{
|
||||||
|
// Actions are shown.
|
||||||
|
}
|
||||||
|
else config.Column.Hide.Add($"{ItemField.Actions}");
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
private String GetListCaptionByTransactionType(Sbm.TransactionType transactionType)
|
||||||
|
{
|
||||||
|
String transactionTypeCaption = GetTransactionTypeCaption(transactionType);
|
||||||
|
if (!StringUtil.IsBlank(transactionTypeCaption))
|
||||||
|
return Localiser.GetText("caption.item.requirements", new object[] { transactionTypeCaption });
|
||||||
|
return Localiser["label.requirements"];
|
||||||
|
}
|
||||||
|
private String GetTransactionTypeCaption(Sbm.TransactionType transactionType)
|
||||||
|
{
|
||||||
|
switch (transactionType)
|
||||||
|
{
|
||||||
|
case Sbm.TransactionType.Project: return Localiser["caption.projects"];
|
||||||
|
case Sbm.TransactionType.SalesLead: return Localiser["caption.sales.leads"];
|
||||||
|
case Sbm.TransactionType.SalesQuote: return Localiser["caption.sales.quotes"];
|
||||||
|
case Sbm.TransactionType.ProformaSalesOrder: return Localiser["caption.proforma.sales.orders"];
|
||||||
|
case Sbm.TransactionType.SalesPO: return Localiser["caption.sales.purchase.orders"];
|
||||||
|
case Sbm.TransactionType.SalesOrder: return Localiser["caption.sales.orders"];
|
||||||
|
case Sbm.TransactionType.SalesDispatch: return Localiser["caption.sales.dispatches"];
|
||||||
|
case Sbm.TransactionType.ProformaSalesInvoice: return Localiser["caption.proforma.sales.invoices"];
|
||||||
|
case Sbm.TransactionType.SalesInvoice: return Localiser["caption.sales.invoices"];
|
||||||
|
case Sbm.TransactionType.PurchaseQuote: return Localiser["caption.purchase.quotes"];
|
||||||
|
case Sbm.TransactionType.ProformaPurchaseOrder: return Localiser["caption.proforma.purchase.orders"];
|
||||||
|
case Sbm.TransactionType.PurchaseSO: return Localiser["caption.purchase.sales.orders"];
|
||||||
|
case Sbm.TransactionType.PurchaseOrder: return Localiser["caption.purchase.orders"];
|
||||||
|
case Sbm.TransactionType.PurchaseDelivery: return Localiser["caption.purchase.deliveries"];
|
||||||
|
case Sbm.TransactionType.ProformaPurchaseInvoice: return Localiser["caption.proforma.purchase.invoices"];
|
||||||
|
case Sbm.TransactionType.PurchaseInvoice: return Localiser["caption.purchase.invoices"];
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
// Item configuration.
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Contact item configuration.
|
||||||
|
public class ItemConfigData
|
||||||
|
{
|
||||||
|
// Item type.
|
||||||
|
public bool? IsOrganisation { get; set; }
|
||||||
|
public bool? IsIndividual { get; set; }
|
||||||
|
public bool? IsGroup { get; set; }
|
||||||
|
// Item fields.
|
||||||
|
public class FieldData
|
||||||
|
{
|
||||||
|
// Field name prefix.
|
||||||
|
public String Prefix { get; } = Model_Requirement.FieldNamePrefix;
|
||||||
|
// Hide field.
|
||||||
|
public HashSet<string> Hide { get; } = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase);
|
||||||
|
// Read-only field.
|
||||||
|
public HashSet<string> Readonly { get; } = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase);
|
||||||
|
// Field labels.
|
||||||
|
public Dictionary<String, String> Label { get; } = new Dictionary<string, string>(StringComparer.InvariantCultureIgnoreCase);
|
||||||
|
}
|
||||||
|
public FieldData Field { get; } = new FieldData();
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
/// <summary>
|
||||||
|
/// Populate item configuration for existing requirement.
|
||||||
|
/// </summary>
|
||||||
|
public void PopulateItemConfig(ItemConfigData config, SbmTransaction transaction, SbmRequirement requirement)
|
||||||
|
{
|
||||||
|
PopulateItemConfig(config, requirement.GetItemId(), transaction.TransactionType, requirement.RequirementType);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Populate item configuration for new or existing requirement.
|
||||||
|
/// </summary>
|
||||||
|
public void PopulateItemConfig(ItemConfigData config, ItemId requirementItemId, Sbm.TransactionType transactionType, Sbm.RequirementType requirementType)
|
||||||
|
{
|
||||||
|
// Item type.
|
||||||
|
bool isSales = SbmTransaction.IsSalesType(transactionType);
|
||||||
|
bool isPurchase = SbmTransaction.IsPurchaseType(transactionType);
|
||||||
|
|
||||||
|
// Configuration options.
|
||||||
|
bool importedFromAccounts = Internals.AccountsConsole.ItemIsImportedFromAccounts(requirementItemId);
|
||||||
|
bool managedByAccounts = Internals.AccountsConsole.IsItemTypeManagedByAccounts(Sbm.ItemType.Requirement);
|
||||||
|
bool showDrawingIssue = SessionConsole.DisplayAttribute(SbmDbDfn.ColumnIdx.Commodity_DrawingIssue);
|
||||||
|
bool showNotes = true;
|
||||||
|
|
||||||
|
//---------------------------------------------------------------
|
||||||
|
// Requirement.
|
||||||
|
|
||||||
|
// Id.
|
||||||
|
if (SbmSystem.DebugMode)
|
||||||
|
config.Field.Readonly.Add($"{ItemField.Id}");
|
||||||
|
else
|
||||||
|
config.Field.Hide.Add($"{ItemField.Id}");
|
||||||
|
|
||||||
|
// Job Number.
|
||||||
|
if (transactionType != Sbm.TransactionType.SalesOrder || !SessionConsole.AllowOption(Sbm.ConfigOption.SalesOrderItemJobNumber))
|
||||||
|
config.Field.Hide.Add($"{ItemField.JobNumber}");
|
||||||
|
|
||||||
|
// Narrative.
|
||||||
|
config.Field.Label.Add($"{ItemField.DescBrief}", SessionConsole.GetAttributeCaption(SbmDbDfn.ColumnIdx.Requirement_DescBrief, Localiser["label.narrative"]));
|
||||||
|
if (managedByAccounts)
|
||||||
|
config.Field.Readonly.Add($"{ItemField.DescBrief}");
|
||||||
|
|
||||||
|
//---------------------------------------------------------------
|
||||||
|
// Sales order.
|
||||||
|
|
||||||
|
//---------------------------------------------------------------
|
||||||
|
// Purchase order.
|
||||||
|
|
||||||
|
//---------------------------------------------------------------
|
||||||
|
// Common.
|
||||||
|
|
||||||
|
// Notes.
|
||||||
|
if (!showNotes)
|
||||||
|
config.Field.Hide.Add($"{ItemField.Notes}");
|
||||||
|
|
||||||
|
// Status.
|
||||||
|
// Read-only if transaction being superceded.
|
||||||
|
if (managedByAccounts)
|
||||||
|
config.Field.Readonly.Add($"{ItemField.Status}");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,235 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||||
|
using Sarand.BusinessMgr.Net.Core.Web.App;
|
||||||
|
using Sarand.BusinessMgr.Net.Standard.Base.App;
|
||||||
|
using Sarand.BusinessMgr.Net.Standard.Base.Bus;
|
||||||
|
using Sarand.BusinessMgr.Web.Portal.Components;
|
||||||
|
using Sarand.Net.Standard.Base.App;
|
||||||
|
using Sarand.Net.Standard.Base.Bus;
|
||||||
|
using Sarand.Net.Standard.Base.Core;
|
||||||
|
using Sarand.Net.Standard.Base.Utils;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
namespace Sarand.BusinessMgr.Web.Portal.Models.Requirements
|
||||||
|
{
|
||||||
|
//=======================================================================
|
||||||
|
// Requirement model.
|
||||||
|
//=======================================================================
|
||||||
|
/// <summary>
|
||||||
|
/// Requirement model - Filter, Form, validation and configuration.
|
||||||
|
/// </summary>
|
||||||
|
public partial class Model_Requirement : SbmModel_Portal
|
||||||
|
{
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
// Definitions.
|
||||||
|
public enum ViewMode
|
||||||
|
{
|
||||||
|
// 'Commit updates' modes - changes are immediately commited to the database.
|
||||||
|
Maintain,
|
||||||
|
ProductionControl,
|
||||||
|
CommodityHistory_Maintain,
|
||||||
|
AssetOrders_Maintain,
|
||||||
|
// 'No updates' modes - no changes are allowed.
|
||||||
|
CommodityHistory_ReadOnly,
|
||||||
|
AssetOrders_ReadOnly,
|
||||||
|
Search
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
// Construction.
|
||||||
|
public Model_Requirement(SbmLocaliser localiser) :
|
||||||
|
base(localiser)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
// Filter properties.
|
||||||
|
public class FilterData
|
||||||
|
{
|
||||||
|
public String Mode { get; set; }
|
||||||
|
public String TransactionType { get; set; }
|
||||||
|
public String Type { get; set; }
|
||||||
|
public String Search { get; set; }
|
||||||
|
public String TransactionStatusCat { get; set; }
|
||||||
|
public String StatusCat { get; set; }
|
||||||
|
}
|
||||||
|
public FilterData Filter { get; } = new FilterData();
|
||||||
|
public ViewMode GetFilterMode()
|
||||||
|
{
|
||||||
|
return EnumUtil.ParseEnum(Filter.Mode, ViewMode.Search);
|
||||||
|
}
|
||||||
|
public Sbm.TransactionType GetFilterTransactionType()
|
||||||
|
{
|
||||||
|
Sbm.TransactionType transactionType = (Sbm.TransactionType)Internals.TransactionTypeCodes.GetTypeForCode(Filter.Type);
|
||||||
|
if (transactionType == 0 && !StringUtil.IsBlank(Filter.Type) && StringUtil.IsNumeric(Filter.Type, true))
|
||||||
|
transactionType = (Sbm.TransactionType)StringUtil.ToInt(Filter.Type);
|
||||||
|
return transactionType;
|
||||||
|
}
|
||||||
|
public Sbm.RequirementType GetFilterRequirementType()
|
||||||
|
{
|
||||||
|
Sbm.RequirementType transactionType = (Sbm.RequirementType)Internals.RequirementTypeCodes.GetTypeForCode(Filter.Type);
|
||||||
|
if (transactionType == 0 && !StringUtil.IsBlank(Filter.Type) && StringUtil.IsNumeric(Filter.Type, true))
|
||||||
|
transactionType = (Sbm.RequirementType)StringUtil.ToInt(Filter.Type);
|
||||||
|
return transactionType;
|
||||||
|
}
|
||||||
|
public SbmTransaction.StatusCat GetFilterTransactionStatusCat()
|
||||||
|
{
|
||||||
|
return (SbmTransaction.StatusCat)Internals.GetSystemCodes(Sbm.SystemCode.TransactionStatusCat).GetTypeForCode(Filter.TransactionStatusCat);
|
||||||
|
}
|
||||||
|
public SbmRequirement.StatusCat GetFilterRequirementStatusCat()
|
||||||
|
{
|
||||||
|
return (SbmRequirement.StatusCat)Internals.GetSystemCodes(Sbm.SystemCode.RequirementStatusCat).GetTypeForCode(Filter.StatusCat);
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
// Requirement properties.
|
||||||
|
public class RequirementData
|
||||||
|
{
|
||||||
|
public String Exists { get; set; }
|
||||||
|
public String Id { get; set; }
|
||||||
|
public String TransactionId { get; set; }
|
||||||
|
public String RequirementIdSource { get; set; }
|
||||||
|
public String Type { get; set; }
|
||||||
|
public String Sequence { get; set; }
|
||||||
|
public String JobNumber { get; set; }
|
||||||
|
// Status dates.
|
||||||
|
public String Required { get; set; }
|
||||||
|
public String Started { get; set; }
|
||||||
|
public String Completed { get; set; }
|
||||||
|
// Details.
|
||||||
|
public String AssociationIdSubContract { get; set; }
|
||||||
|
public String DescBrief { get; set; }
|
||||||
|
public String DescIntro { get; set; }
|
||||||
|
public String DescOutline { get; set; }
|
||||||
|
public String DescDetail { get; set; }
|
||||||
|
public String PromotionCode { get; set; }
|
||||||
|
public String NominalCode { get; set; }
|
||||||
|
// Commodity.
|
||||||
|
public String CommodityId { get; set; }
|
||||||
|
public String ProductCode { get; set; }
|
||||||
|
public String AssetId { get; set; }
|
||||||
|
public String Quantity { get; set; }
|
||||||
|
public String QuantityProd { get; set; }
|
||||||
|
public String UomId { get; set; }
|
||||||
|
public String Weight { get; set; }
|
||||||
|
public String UomIdWeight { get; set; }
|
||||||
|
public String MaterialSourceCode { get; set; }
|
||||||
|
public String LocationIdStock { get; set; }
|
||||||
|
// Amounts.
|
||||||
|
public String AmountUnit { get; set; }
|
||||||
|
public String AmountAct { get; set; }
|
||||||
|
public String AmountDisc { get; set; }
|
||||||
|
public String AmountNet { get; set; }
|
||||||
|
public String TaxCodeId { get; set; }
|
||||||
|
public String TaxRate { get; set; }
|
||||||
|
public String AmountTax { get; set; }
|
||||||
|
public String AmountTot { get; set; }
|
||||||
|
// Common properties.
|
||||||
|
public String Notes { get; set; }
|
||||||
|
public String StatusCode { get; set; }
|
||||||
|
}
|
||||||
|
public RequirementData Requirement { get; } = new RequirementData();
|
||||||
|
public Sbm.RequirementType GetRequirementType()
|
||||||
|
{
|
||||||
|
return (Sbm.RequirementType)Internals.RequirementTypeCodes.GetTypeForCode(Requirement.Type);
|
||||||
|
}
|
||||||
|
public SaStatus GetRequirementStatus()
|
||||||
|
{
|
||||||
|
return SacsSystem.GetStatusForCode(Requirement.StatusCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
// Validation.
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
// Requirement validation.
|
||||||
|
public bool ValidateRequirementData(Sacs.Web.Components.SaController.AjaxResponse_Data responseData)
|
||||||
|
{
|
||||||
|
|
||||||
|
// Narrative.
|
||||||
|
if (Requirement.DescBrief != null)
|
||||||
|
{
|
||||||
|
String controlName = GetFieldName(ItemField.DescBrief);
|
||||||
|
responseData.SetControlValue(controlName, Requirement.DescBrief);
|
||||||
|
if (StringUtil.GetLength(Requirement.DescBrief) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Requirement_DescBrief))
|
||||||
|
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Requirement_DescBrief)]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Desc Intro.
|
||||||
|
if (Requirement.DescIntro != null)
|
||||||
|
{
|
||||||
|
String controlName = GetFieldName(ItemField.DescIntro);
|
||||||
|
responseData.SetControlValue(controlName, Requirement.DescIntro);
|
||||||
|
if (StringUtil.GetLength(Requirement.DescIntro) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Requirement_DescIntro))
|
||||||
|
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Requirement_DescIntro)]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Desc Outline.
|
||||||
|
if (Requirement.DescOutline != null)
|
||||||
|
{
|
||||||
|
String controlName = GetFieldName(ItemField.DescOutline);
|
||||||
|
responseData.SetControlValue(controlName, Requirement.DescOutline);
|
||||||
|
if (StringUtil.GetLength(Requirement.DescOutline) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Requirement_DescOutline))
|
||||||
|
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Requirement_DescOutline)]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Desc Detail.
|
||||||
|
if (Requirement.DescDetail != null)
|
||||||
|
{
|
||||||
|
String controlName = GetFieldName(ItemField.DescDetail);
|
||||||
|
responseData.SetControlValue(controlName, Requirement.DescDetail);
|
||||||
|
if (StringUtil.GetLength(Requirement.DescDetail) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Requirement_DescDetail))
|
||||||
|
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Requirement_DescDetail)]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Requirement status.
|
||||||
|
if (Requirement.StatusCode != null)
|
||||||
|
{
|
||||||
|
String controlName = GetFieldName(ItemField.Status);
|
||||||
|
if (Requirement.StatusCode.IsEmpty())
|
||||||
|
responseData.SetControlError(controlName, Localiser["msg.validation.mandatory.value"]);
|
||||||
|
else if (!SbmRequirement.ValidStatuses.Contains(GetRequirementStatus()))
|
||||||
|
responseData.SetControlError(controlName, Localiser["msg.validation.invalid.value"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Required.
|
||||||
|
if (Requirement.Required != null)
|
||||||
|
{
|
||||||
|
String controlName = GetFieldName(ItemField.Required);
|
||||||
|
if (!Requirement.Required.IsEmpty() && !DateUtil.IsValid(ParseDateFromForm(Requirement.Required)))
|
||||||
|
responseData.SetControlError(controlName, Localiser["msg.validation.invalid.value"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Status dates - Started.
|
||||||
|
if (Requirement.Started != null)
|
||||||
|
{
|
||||||
|
String controlName = GetFieldName(ItemField.Started);
|
||||||
|
if (!Requirement.Started.IsEmpty() && !DateUtil.IsValid(ParseDateFromForm(Requirement.Started)))
|
||||||
|
responseData.SetControlError(controlName, Localiser["msg.validation.invalid.value"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Status dates - Completed.
|
||||||
|
if (Requirement.Completed != null)
|
||||||
|
{
|
||||||
|
String controlName = GetFieldName(ItemField.Completed);
|
||||||
|
if (!Requirement.Completed.IsEmpty() && !DateUtil.IsValid(ParseDateFromForm(Requirement.Completed)))
|
||||||
|
responseData.SetControlError(controlName, Localiser["msg.validation.invalid.value"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Requirement Notes.
|
||||||
|
if (Requirement.Notes != null)
|
||||||
|
{
|
||||||
|
String controlName = GetFieldName(ItemField.Notes);
|
||||||
|
responseData.SetControlValue(controlName, Requirement.Notes);
|
||||||
|
if (!Requirement.Notes.IsEmpty() && StringUtil.GetLength(Requirement.Notes) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Requirement_Notes))
|
||||||
|
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Requirement_Notes)]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return !responseData.HasControlErrors();
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
}
|
||||||
@@ -233,7 +233,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Transactions
|
|||||||
|
|
||||||
//---------------------------------------------------------------
|
//---------------------------------------------------------------
|
||||||
// List Caption.
|
// List Caption.
|
||||||
config.Caption = StringUtil.OnBlank(GetListCaptionByTransactionType(transactionType),Localiser["label.transactions"]);
|
config.Caption = StringUtil.OnBlank(GetListCaptionByTransactionType(transactionType), Localiser["label.transactions"]);
|
||||||
|
|
||||||
//---------------------------------------------------------------
|
//---------------------------------------------------------------
|
||||||
// Actions.
|
// Actions.
|
||||||
@@ -343,7 +343,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Transactions
|
|||||||
}
|
}
|
||||||
|
|
||||||
// In Progress date.
|
// In Progress date.
|
||||||
if (!modeIsDeliveryPlanning && !isSalesLead && !isSalesDispatch && transactionStatusCat != SbmTransaction.StatusCat.Pending)
|
if (!modeIsDeliveryPlanning && !isSalesLead && !isSalesDispatch && transactionStatusCat == SbmTransaction.StatusCat.Open)
|
||||||
{
|
{
|
||||||
//config.Column.Label.Add($"{ItemField.InProgress}", Localiser["label.in.progress"]);
|
//config.Column.Label.Add($"{ItemField.InProgress}", Localiser["label.in.progress"]);
|
||||||
}
|
}
|
||||||
@@ -367,7 +367,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Transactions
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Closed date.
|
// Closed date.
|
||||||
if (modeIsDeliveryPlanning || transactionStatusCat != SbmTransaction.StatusCat.Open)
|
if (modeIsDeliveryPlanning || transactionStatusCat == SbmTransaction.StatusCat.Closed)
|
||||||
{
|
{
|
||||||
//config.Column.Label.Add($"{ItemField.Closed}", Localiser["label.closed"]);
|
//config.Column.Label.Add($"{ItemField.Closed}", Localiser["label.closed"]);
|
||||||
}
|
}
|
||||||
@@ -588,7 +588,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Transactions
|
|||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Populate item configuration for existing association.
|
/// Populate item configuration for existing transaction.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void PopulateItemConfig(ItemConfigData config, SbmTransaction transaction)
|
public void PopulateItemConfig(ItemConfigData config, SbmTransaction transaction)
|
||||||
{
|
{
|
||||||
@@ -596,7 +596,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Transactions
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Populate item configuration for new or existing association.
|
/// Populate item configuration for new or existing transaction.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void PopulateItemConfig(ItemConfigData config, ItemId transactionItemId, Sbm.TransactionType transactionType)
|
public void PopulateItemConfig(ItemConfigData config, ItemId transactionItemId, Sbm.TransactionType transactionType)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Transactions
|
|||||||
public class FilterData
|
public class FilterData
|
||||||
{
|
{
|
||||||
public String Mode { get; set; }
|
public String Mode { get; set; }
|
||||||
public String TransactionType { get; set; }
|
public String Type { get; set; }
|
||||||
public String Search { get; set; }
|
public String Search { get; set; }
|
||||||
public String StatusCat { get; set; }
|
public String StatusCat { get; set; }
|
||||||
}
|
}
|
||||||
@@ -51,9 +51,9 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Transactions
|
|||||||
}
|
}
|
||||||
public Sbm.TransactionType GetFilterTransactionType()
|
public Sbm.TransactionType GetFilterTransactionType()
|
||||||
{
|
{
|
||||||
Sbm.TransactionType transactionType = (Sbm.TransactionType)Internals.TransactionTypeCodes.GetTypeForCode(Filter.TransactionType);
|
Sbm.TransactionType transactionType = (Sbm.TransactionType)Internals.TransactionTypeCodes.GetTypeForCode(Filter.Type);
|
||||||
if (transactionType == 0 && !StringUtil.IsBlank(Filter.TransactionType) && StringUtil.IsNumeric(Filter.TransactionType, true))
|
if (transactionType == 0 && !StringUtil.IsBlank(Filter.Type) && StringUtil.IsNumeric(Filter.Type, true))
|
||||||
transactionType = (Sbm.TransactionType)StringUtil.ToInt(Filter.TransactionType);
|
transactionType = (Sbm.TransactionType)StringUtil.ToInt(Filter.Type);
|
||||||
return transactionType;
|
return transactionType;
|
||||||
}
|
}
|
||||||
public String GetFilterAssociationTypeCode()
|
public String GetFilterAssociationTypeCode()
|
||||||
@@ -66,7 +66,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Transactions
|
|||||||
}
|
}
|
||||||
public SbmTransaction.StatusCat GetFilterTransactionStatusCat()
|
public SbmTransaction.StatusCat GetFilterTransactionStatusCat()
|
||||||
{
|
{
|
||||||
return (SbmTransaction.StatusCat)StringUtil.ToInt(Filter.StatusCat);
|
return (SbmTransaction.StatusCat)Internals.GetSystemCodes(Sbm.SystemCode.TransactionStatusCat).GetTypeForCode(Filter.StatusCat);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Transaction Status Cats for filter dropdown.</summary>
|
/// <summary>Transaction Status Cats for filter dropdown.</summary>
|
||||||
@@ -100,10 +100,10 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Transactions
|
|||||||
public String Raised { get; set; }
|
public String Raised { get; set; }
|
||||||
public String Required { get; set; }
|
public String Required { get; set; }
|
||||||
public String InProgress { get; set; }
|
public String InProgress { get; set; }
|
||||||
|
public String Closed { get; set; }
|
||||||
// Delivery.
|
// Delivery.
|
||||||
public String DeliveredEst { get; set; }
|
public String DeliveredEst { get; set; }
|
||||||
public String DeliveredAct { get; set; }
|
public String DeliveredAct { get; set; }
|
||||||
public String Closed { get; set; }
|
|
||||||
public String Department { get; set; }
|
public String Department { get; set; }
|
||||||
public String DescBrief { get; set; }
|
public String DescBrief { get; set; }
|
||||||
public String DescIntro { get; set; }
|
public String DescIntro { get; set; }
|
||||||
@@ -168,7 +168,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Transactions
|
|||||||
Sbm.TransactionType transactionType = GetTransactionType();
|
Sbm.TransactionType transactionType = GetTransactionType();
|
||||||
if (Transaction.Type != null)
|
if (Transaction.Type != null)
|
||||||
{
|
{
|
||||||
String controlName = Model_Transaction.GetFieldName(Model_Transaction.ItemField.Type);
|
String controlName = GetFieldName(ItemField.Type);
|
||||||
if (Transaction.Type.IsEmpty() || GetTransactionType() <= 0)
|
if (Transaction.Type.IsEmpty() || GetTransactionType() <= 0)
|
||||||
responseData.SetControlError(controlName, Localiser["msg.validation.mandatory.value"]);
|
responseData.SetControlError(controlName, Localiser["msg.validation.mandatory.value"]);
|
||||||
else if (!SessionConsole.AllowTransactionType(transactionType))
|
else if (!SessionConsole.AllowTransactionType(transactionType))
|
||||||
@@ -178,7 +178,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Transactions
|
|||||||
// Association.
|
// Association.
|
||||||
if (Transaction.AssociationId != null)
|
if (Transaction.AssociationId != null)
|
||||||
{
|
{
|
||||||
String controlName = Model_Transaction.GetFieldName(Model_Transaction.ItemField.AssociationName);
|
String controlName = GetFieldName(ItemField.AssociationName);
|
||||||
SysId associationId = SysId.ToSysId(Transaction.AssociationId);
|
SysId associationId = SysId.ToSysId(Transaction.AssociationId);
|
||||||
if (!SysId.IsValid(associationId))
|
if (!SysId.IsValid(associationId))
|
||||||
responseData.SetControlError(controlName, Localiser["msg.validation.mandatory.value"]);
|
responseData.SetControlError(controlName, Localiser["msg.validation.mandatory.value"]);
|
||||||
@@ -187,7 +187,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Transactions
|
|||||||
// Reference.
|
// Reference.
|
||||||
if (Transaction.Reference != null)
|
if (Transaction.Reference != null)
|
||||||
{
|
{
|
||||||
String controlName = Model_Transaction.GetFieldName(Model_Transaction.ItemField.Reference);
|
String controlName = GetFieldName(ItemField.Reference);
|
||||||
responseData.SetControlValue(controlName, Transaction.Reference);
|
responseData.SetControlValue(controlName, Transaction.Reference);
|
||||||
if (StringUtil.GetLength(Transaction.Reference) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_Ref))
|
if (StringUtil.GetLength(Transaction.Reference) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_Ref))
|
||||||
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_Ref)]);
|
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_Ref)]);
|
||||||
@@ -196,7 +196,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Transactions
|
|||||||
// Ext Reference.
|
// Ext Reference.
|
||||||
if (Transaction.ReferenceExt != null)
|
if (Transaction.ReferenceExt != null)
|
||||||
{
|
{
|
||||||
String controlName = Model_Transaction.GetFieldName(Model_Transaction.ItemField.ReferenceExt);
|
String controlName = GetFieldName(ItemField.ReferenceExt);
|
||||||
responseData.SetControlValue(controlName, Transaction.ReferenceExt);
|
responseData.SetControlValue(controlName, Transaction.ReferenceExt);
|
||||||
if (StringUtil.GetLength(Transaction.ReferenceExt) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_RefExt))
|
if (StringUtil.GetLength(Transaction.ReferenceExt) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_RefExt))
|
||||||
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_RefExt)]);
|
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_RefExt)]);
|
||||||
@@ -205,7 +205,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Transactions
|
|||||||
// Narrative.
|
// Narrative.
|
||||||
if (Transaction.DescBrief != null)
|
if (Transaction.DescBrief != null)
|
||||||
{
|
{
|
||||||
String controlName = Model_Transaction.GetFieldName(Model_Transaction.ItemField.DescBrief);
|
String controlName = GetFieldName(ItemField.DescBrief);
|
||||||
responseData.SetControlValue(controlName, Transaction.DescBrief);
|
responseData.SetControlValue(controlName, Transaction.DescBrief);
|
||||||
if (StringUtil.GetLength(Transaction.DescBrief) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DescBrief))
|
if (StringUtil.GetLength(Transaction.DescBrief) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DescBrief))
|
||||||
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DescBrief)]);
|
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DescBrief)]);
|
||||||
@@ -214,7 +214,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Transactions
|
|||||||
// Contact Name.
|
// Contact Name.
|
||||||
if (Transaction.ContactName != null)
|
if (Transaction.ContactName != null)
|
||||||
{
|
{
|
||||||
String controlName = Model_Transaction.GetFieldName(Model_Transaction.ItemField.ContactName);
|
String controlName = GetFieldName(ItemField.ContactName);
|
||||||
responseData.SetControlValue(controlName, Transaction.ContactName);
|
responseData.SetControlValue(controlName, Transaction.ContactName);
|
||||||
if (StringUtil.GetLength(Transaction.ContactName) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_ContactName))
|
if (StringUtil.GetLength(Transaction.ContactName) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_ContactName))
|
||||||
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_ContactName)]);
|
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_ContactName)]);
|
||||||
@@ -223,7 +223,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Transactions
|
|||||||
// Likelihood.
|
// Likelihood.
|
||||||
if (Transaction.Likelihood != null)
|
if (Transaction.Likelihood != null)
|
||||||
{
|
{
|
||||||
String controlName = Model_Transaction.GetFieldName(Model_Transaction.ItemField.Likelihood);
|
String controlName = GetFieldName(ItemField.Likelihood);
|
||||||
responseData.SetControlValue(controlName, Transaction.Likelihood);
|
responseData.SetControlValue(controlName, Transaction.Likelihood);
|
||||||
if (StringUtil.GetLength(Transaction.Likelihood) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_Likelihood))
|
if (StringUtil.GetLength(Transaction.Likelihood) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_Likelihood))
|
||||||
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_Likelihood)]);
|
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_Likelihood)]);
|
||||||
@@ -232,7 +232,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Transactions
|
|||||||
// Referral code.
|
// Referral code.
|
||||||
if (Transaction.ReferCode != null)
|
if (Transaction.ReferCode != null)
|
||||||
{
|
{
|
||||||
String controlName = Model_Transaction.GetFieldName(Model_Transaction.ItemField.ReferCode);
|
String controlName = GetFieldName(ItemField.ReferCode);
|
||||||
responseData.SetControlValue(controlName, Transaction.ReferCode);
|
responseData.SetControlValue(controlName, Transaction.ReferCode);
|
||||||
if (StringUtil.GetLength(Transaction.ReferCode) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_ReferCode))
|
if (StringUtil.GetLength(Transaction.ReferCode) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_ReferCode))
|
||||||
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_ReferCode)]);
|
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_ReferCode)]);
|
||||||
@@ -241,7 +241,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Transactions
|
|||||||
// Refer source.
|
// Refer source.
|
||||||
if (Transaction.ReferSource != null)
|
if (Transaction.ReferSource != null)
|
||||||
{
|
{
|
||||||
String controlName = Model_Transaction.GetFieldName(Model_Transaction.ItemField.ReferSource);
|
String controlName = GetFieldName(ItemField.ReferSource);
|
||||||
responseData.SetControlValue(controlName, Transaction.ReferSource);
|
responseData.SetControlValue(controlName, Transaction.ReferSource);
|
||||||
if (StringUtil.GetLength(Transaction.ReferSource) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_ReferSource))
|
if (StringUtil.GetLength(Transaction.ReferSource) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_ReferSource))
|
||||||
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_ReferSource)]);
|
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_ReferSource)]);
|
||||||
@@ -250,7 +250,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Transactions
|
|||||||
// Department.
|
// Department.
|
||||||
if (Transaction.Department != null)
|
if (Transaction.Department != null)
|
||||||
{
|
{
|
||||||
String controlName = Model_Transaction.GetFieldName(Model_Transaction.ItemField.Department);
|
String controlName = GetFieldName(ItemField.Department);
|
||||||
responseData.SetControlValue(controlName, Transaction.Department);
|
responseData.SetControlValue(controlName, Transaction.Department);
|
||||||
if (StringUtil.GetLength(Transaction.Department) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_Department))
|
if (StringUtil.GetLength(Transaction.Department) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_Department))
|
||||||
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_Department)]);
|
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_Department)]);
|
||||||
@@ -259,7 +259,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Transactions
|
|||||||
// Desc Intro.
|
// Desc Intro.
|
||||||
if (Transaction.DescIntro != null)
|
if (Transaction.DescIntro != null)
|
||||||
{
|
{
|
||||||
String controlName = Model_Transaction.GetFieldName(Model_Transaction.ItemField.DescIntro);
|
String controlName = GetFieldName(ItemField.DescIntro);
|
||||||
responseData.SetControlValue(controlName, Transaction.DescIntro);
|
responseData.SetControlValue(controlName, Transaction.DescIntro);
|
||||||
if (StringUtil.GetLength(Transaction.DescIntro) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DescIntro))
|
if (StringUtil.GetLength(Transaction.DescIntro) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DescIntro))
|
||||||
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DescIntro)]);
|
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DescIntro)]);
|
||||||
@@ -268,7 +268,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Transactions
|
|||||||
// Desc Outline.
|
// Desc Outline.
|
||||||
if (Transaction.DescOutline != null)
|
if (Transaction.DescOutline != null)
|
||||||
{
|
{
|
||||||
String controlName = Model_Transaction.GetFieldName(Model_Transaction.ItemField.DescOutline);
|
String controlName = GetFieldName(ItemField.DescOutline);
|
||||||
responseData.SetControlValue(controlName, Transaction.DescOutline);
|
responseData.SetControlValue(controlName, Transaction.DescOutline);
|
||||||
if (StringUtil.GetLength(Transaction.DescOutline) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DescOutline))
|
if (StringUtil.GetLength(Transaction.DescOutline) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DescOutline))
|
||||||
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DescOutline)]);
|
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DescOutline)]);
|
||||||
@@ -277,7 +277,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Transactions
|
|||||||
// Desc Detail.
|
// Desc Detail.
|
||||||
if (Transaction.DescDetail != null)
|
if (Transaction.DescDetail != null)
|
||||||
{
|
{
|
||||||
String controlName = Model_Transaction.GetFieldName(Model_Transaction.ItemField.DescDetail);
|
String controlName = GetFieldName(ItemField.DescDetail);
|
||||||
responseData.SetControlValue(controlName, Transaction.DescDetail);
|
responseData.SetControlValue(controlName, Transaction.DescDetail);
|
||||||
if (StringUtil.GetLength(Transaction.DescDetail) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DescDetail))
|
if (StringUtil.GetLength(Transaction.DescDetail) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DescDetail))
|
||||||
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DescDetail)]);
|
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DescDetail)]);
|
||||||
@@ -286,7 +286,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Transactions
|
|||||||
// Contact Area code.
|
// Contact Area code.
|
||||||
if (Transaction.ContactAreaCode != null)
|
if (Transaction.ContactAreaCode != null)
|
||||||
{
|
{
|
||||||
String controlName = Model_Transaction.GetFieldName(Model_Transaction.ItemField.ContactAreaCode);
|
String controlName = GetFieldName(ItemField.ContactAreaCode);
|
||||||
responseData.SetControlValue(controlName, Transaction.ContactAreaCode);
|
responseData.SetControlValue(controlName, Transaction.ContactAreaCode);
|
||||||
if (StringUtil.GetLength(Transaction.ContactAreaCode) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_ContactAreaCode))
|
if (StringUtil.GetLength(Transaction.ContactAreaCode) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_ContactAreaCode))
|
||||||
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_ContactAreaCode)]);
|
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_ContactAreaCode)]);
|
||||||
@@ -295,7 +295,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Transactions
|
|||||||
// Response code.
|
// Response code.
|
||||||
if (Transaction.ResponseCode != null)
|
if (Transaction.ResponseCode != null)
|
||||||
{
|
{
|
||||||
String controlName = Model_Transaction.GetFieldName(Model_Transaction.ItemField.ResponseCode);
|
String controlName = GetFieldName(ItemField.ResponseCode);
|
||||||
responseData.SetControlValue(controlName, Transaction.ResponseCode);
|
responseData.SetControlValue(controlName, Transaction.ResponseCode);
|
||||||
if (StringUtil.GetLength(Transaction.ResponseCode) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_ResponseCode))
|
if (StringUtil.GetLength(Transaction.ResponseCode) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_ResponseCode))
|
||||||
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_ResponseCode)]);
|
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_ResponseCode)]);
|
||||||
@@ -304,7 +304,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Transactions
|
|||||||
// Box Count.
|
// Box Count.
|
||||||
if (Transaction.BoxCount != null)
|
if (Transaction.BoxCount != null)
|
||||||
{
|
{
|
||||||
String controlName = Model_Transaction.GetFieldName(Model_Transaction.ItemField.BoxCount);
|
String controlName = GetFieldName(ItemField.BoxCount);
|
||||||
responseData.SetControlValue(controlName, Transaction.BoxCount);
|
responseData.SetControlValue(controlName, Transaction.BoxCount);
|
||||||
if (StringUtil.GetLength(Transaction.BoxCount) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_BoxCount))
|
if (StringUtil.GetLength(Transaction.BoxCount) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_BoxCount))
|
||||||
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_BoxCount)]);
|
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_BoxCount)]);
|
||||||
@@ -313,7 +313,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Transactions
|
|||||||
// Delivery Status code.
|
// Delivery Status code.
|
||||||
if (Transaction.DeliveryStatusCode != null)
|
if (Transaction.DeliveryStatusCode != null)
|
||||||
{
|
{
|
||||||
String controlName = Model_Transaction.GetFieldName(Model_Transaction.ItemField.DeliveryStatus);
|
String controlName = GetFieldName(ItemField.DeliveryStatus);
|
||||||
responseData.SetControlValue(controlName, Transaction.DeliveryStatusCode);
|
responseData.SetControlValue(controlName, Transaction.DeliveryStatusCode);
|
||||||
if (StringUtil.GetLength(Transaction.DeliveryStatusCode) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DeliveryStatusCode))
|
if (StringUtil.GetLength(Transaction.DeliveryStatusCode) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DeliveryStatusCode))
|
||||||
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DeliveryStatusCode)]);
|
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DeliveryStatusCode)]);
|
||||||
@@ -322,7 +322,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Transactions
|
|||||||
// Delivery Type code.
|
// Delivery Type code.
|
||||||
if (Transaction.DeliveryTypeCode != null)
|
if (Transaction.DeliveryTypeCode != null)
|
||||||
{
|
{
|
||||||
String controlName = Model_Transaction.GetFieldName(Model_Transaction.ItemField.DeliveryType);
|
String controlName = GetFieldName(ItemField.DeliveryType);
|
||||||
responseData.SetControlValue(controlName, Transaction.DeliveryTypeCode);
|
responseData.SetControlValue(controlName, Transaction.DeliveryTypeCode);
|
||||||
if (StringUtil.GetLength(Transaction.DeliveryTypeCode) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DeliveryTypeCode))
|
if (StringUtil.GetLength(Transaction.DeliveryTypeCode) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DeliveryTypeCode))
|
||||||
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DeliveryTypeCode)]);
|
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DeliveryTypeCode)]);
|
||||||
@@ -331,7 +331,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Transactions
|
|||||||
// Delivery Method code.
|
// Delivery Method code.
|
||||||
if (Transaction.DeliveryMethodCode != null)
|
if (Transaction.DeliveryMethodCode != null)
|
||||||
{
|
{
|
||||||
String controlName = Model_Transaction.GetFieldName(Model_Transaction.ItemField.DeliveryMethod);
|
String controlName = GetFieldName(ItemField.DeliveryMethod);
|
||||||
responseData.SetControlValue(controlName, Transaction.DeliveryMethodCode);
|
responseData.SetControlValue(controlName, Transaction.DeliveryMethodCode);
|
||||||
if (StringUtil.GetLength(Transaction.DeliveryMethodCode) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DeliveryMethodCode))
|
if (StringUtil.GetLength(Transaction.DeliveryMethodCode) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DeliveryMethodCode))
|
||||||
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DeliveryMethodCode)]);
|
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DeliveryMethodCode)]);
|
||||||
@@ -340,7 +340,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Transactions
|
|||||||
// Delivery Courier code.
|
// Delivery Courier code.
|
||||||
if (Transaction.DeliveryCourierCode != null)
|
if (Transaction.DeliveryCourierCode != null)
|
||||||
{
|
{
|
||||||
String controlName = Model_Transaction.GetFieldName(Model_Transaction.ItemField.DeliveryCourier);
|
String controlName = GetFieldName(ItemField.DeliveryCourier);
|
||||||
responseData.SetControlValue(controlName, Transaction.DeliveryCourierCode);
|
responseData.SetControlValue(controlName, Transaction.DeliveryCourierCode);
|
||||||
if (StringUtil.GetLength(Transaction.DeliveryCourierCode) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DeliveryCourierCode))
|
if (StringUtil.GetLength(Transaction.DeliveryCourierCode) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DeliveryCourierCode))
|
||||||
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DeliveryCourierCode)]);
|
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DeliveryCourierCode)]);
|
||||||
@@ -349,7 +349,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Transactions
|
|||||||
// Delivery Book In code.
|
// Delivery Book In code.
|
||||||
if (Transaction.DeliveryBookInCode != null)
|
if (Transaction.DeliveryBookInCode != null)
|
||||||
{
|
{
|
||||||
String controlName = Model_Transaction.GetFieldName(Model_Transaction.ItemField.DeliveryBookIn);
|
String controlName = GetFieldName(ItemField.DeliveryBookIn);
|
||||||
responseData.SetControlValue(controlName, Transaction.DeliveryBookInCode);
|
responseData.SetControlValue(controlName, Transaction.DeliveryBookInCode);
|
||||||
if (StringUtil.GetLength(Transaction.DeliveryBookInCode) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DeliveryBookInCode))
|
if (StringUtil.GetLength(Transaction.DeliveryBookInCode) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DeliveryBookInCode))
|
||||||
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DeliveryBookInCode)]);
|
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DeliveryBookInCode)]);
|
||||||
@@ -358,7 +358,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Transactions
|
|||||||
// Stock Picker code.
|
// Stock Picker code.
|
||||||
if (Transaction.StockPickerCode != null)
|
if (Transaction.StockPickerCode != null)
|
||||||
{
|
{
|
||||||
String controlName = Model_Transaction.GetFieldName(Model_Transaction.ItemField.StockPicker);
|
String controlName = GetFieldName(ItemField.StockPicker);
|
||||||
responseData.SetControlValue(controlName, Transaction.StockPickerCode);
|
responseData.SetControlValue(controlName, Transaction.StockPickerCode);
|
||||||
if (StringUtil.GetLength(Transaction.StockPickerCode) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_StockPickerCode))
|
if (StringUtil.GetLength(Transaction.StockPickerCode) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_StockPickerCode))
|
||||||
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_StockPickerCode)]);
|
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_StockPickerCode)]);
|
||||||
@@ -367,7 +367,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Transactions
|
|||||||
// Delivery Ref.
|
// Delivery Ref.
|
||||||
if (Transaction.DeliveryRef != null)
|
if (Transaction.DeliveryRef != null)
|
||||||
{
|
{
|
||||||
String controlName = Model_Transaction.GetFieldName(Model_Transaction.ItemField.DeliveryRef);
|
String controlName = GetFieldName(ItemField.DeliveryRef);
|
||||||
responseData.SetControlValue(controlName, Transaction.DeliveryRef);
|
responseData.SetControlValue(controlName, Transaction.DeliveryRef);
|
||||||
if (StringUtil.GetLength(Transaction.DeliveryRef) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DeliveryRef))
|
if (StringUtil.GetLength(Transaction.DeliveryRef) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DeliveryRef))
|
||||||
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DeliveryRef)]);
|
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DeliveryRef)]);
|
||||||
@@ -376,7 +376,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Transactions
|
|||||||
// Delivery Comment.
|
// Delivery Comment.
|
||||||
if (Transaction.DeliveryComment != null)
|
if (Transaction.DeliveryComment != null)
|
||||||
{
|
{
|
||||||
String controlName = Model_Transaction.GetFieldName(Model_Transaction.ItemField.DeliveryComment);
|
String controlName = GetFieldName(ItemField.DeliveryComment);
|
||||||
responseData.SetControlValue(controlName, Transaction.DeliveryComment);
|
responseData.SetControlValue(controlName, Transaction.DeliveryComment);
|
||||||
if (StringUtil.GetLength(Transaction.DeliveryComment) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DeliveryComment))
|
if (StringUtil.GetLength(Transaction.DeliveryComment) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DeliveryComment))
|
||||||
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DeliveryComment)]);
|
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DeliveryComment)]);
|
||||||
@@ -385,7 +385,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Transactions
|
|||||||
// Delivery Department.
|
// Delivery Department.
|
||||||
if (Transaction.DeliveryDepartment != null)
|
if (Transaction.DeliveryDepartment != null)
|
||||||
{
|
{
|
||||||
String controlName = Model_Transaction.GetFieldName(Model_Transaction.ItemField.DeliveryDepartment);
|
String controlName = GetFieldName(ItemField.DeliveryDepartment);
|
||||||
responseData.SetControlValue(controlName, Transaction.DeliveryDepartment);
|
responseData.SetControlValue(controlName, Transaction.DeliveryDepartment);
|
||||||
if (StringUtil.GetLength(Transaction.DeliveryDepartment) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DeliveryDepartment))
|
if (StringUtil.GetLength(Transaction.DeliveryDepartment) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DeliveryDepartment))
|
||||||
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DeliveryDepartment)]);
|
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DeliveryDepartment)]);
|
||||||
@@ -394,30 +394,61 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Transactions
|
|||||||
// Delivery Nominal code.
|
// Delivery Nominal code.
|
||||||
if (Transaction.DeliveryNominalCode != null)
|
if (Transaction.DeliveryNominalCode != null)
|
||||||
{
|
{
|
||||||
String controlName = Model_Transaction.GetFieldName(Model_Transaction.ItemField.DeliveryNominalCode);
|
String controlName = GetFieldName(ItemField.DeliveryNominalCode);
|
||||||
responseData.SetControlValue(controlName, Transaction.DeliveryNominalCode);
|
responseData.SetControlValue(controlName, Transaction.DeliveryNominalCode);
|
||||||
if (StringUtil.GetLength(Transaction.DeliveryNominalCode) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DeliveryNominalCode))
|
if (StringUtil.GetLength(Transaction.DeliveryNominalCode) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DeliveryNominalCode))
|
||||||
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DeliveryNominalCode)]);
|
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DeliveryNominalCode)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Transaction Notes.
|
|
||||||
if (Transaction.Notes != null)
|
|
||||||
{
|
|
||||||
String controlName = Model_Transaction.GetFieldName(Model_Transaction.ItemField.Notes);
|
|
||||||
responseData.SetControlValue(controlName, Transaction.Notes);
|
|
||||||
if (!Transaction.Notes.IsEmpty() && StringUtil.GetLength(Transaction.Notes) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_Notes))
|
|
||||||
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_Notes)]);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Transaction status.
|
// Transaction status.
|
||||||
if (Transaction.StatusCode != null)
|
if (Transaction.StatusCode != null)
|
||||||
{
|
{
|
||||||
String controlName = Model_Transaction.GetFieldName(Model_Transaction.ItemField.Status);
|
String controlName = GetFieldName(ItemField.Status);
|
||||||
if (Transaction.StatusCode.IsEmpty())
|
if (Transaction.StatusCode.IsEmpty())
|
||||||
responseData.SetControlError(controlName, Localiser["msg.validation.mandatory.value"]);
|
responseData.SetControlError(controlName, Localiser["msg.validation.mandatory.value"]);
|
||||||
else if (!SbmTransaction.ValidStatusesByType(transactionType).Contains(GetTransactionStatus()))
|
else if (!SbmTransaction.ValidStatusesByType(transactionType).Contains(GetTransactionStatus()))
|
||||||
responseData.SetControlError(controlName, Localiser["msg.validation.invalid.value"]);
|
responseData.SetControlError(controlName, Localiser["msg.validation.invalid.value"]);
|
||||||
}
|
}
|
||||||
|
SbmTransaction.StatusCat transactionStatusCat = SbmTransaction.GetCategoryForStatus(GetTransactionStatus());
|
||||||
|
|
||||||
|
// Status dates - Raised.
|
||||||
|
if (Transaction.Raised != null)
|
||||||
|
{
|
||||||
|
String controlName = GetFieldName(ItemField.Raised);
|
||||||
|
if (Transaction.Raised.IsEmpty() || !DateUtil.IsValid(ParseDateFromForm(Transaction.Raised)))
|
||||||
|
responseData.SetControlError(controlName, Localiser["msg.validation.mandatory.value"]);
|
||||||
|
else if (ParseDateFromForm(Transaction.Raised) > DateTime.Today)
|
||||||
|
responseData.SetControlError(controlName, Localiser["msg.validation.invalid.value"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Status dates - In Progress.
|
||||||
|
if (Transaction.InProgress != null)
|
||||||
|
{
|
||||||
|
String controlName = GetFieldName(ItemField.InProgress);
|
||||||
|
if ((Transaction.InProgress.IsEmpty() || !DateUtil.IsValid(ParseDateFromForm(Transaction.InProgress))) && (transactionStatusCat == SbmTransaction.StatusCat.Open || transactionStatusCat == SbmTransaction.StatusCat.Closed))
|
||||||
|
responseData.SetControlError(controlName, Localiser["msg.validation.mandatory.value"]);
|
||||||
|
else if (ParseDateFromForm(Transaction.InProgress) > DateTime.Today)
|
||||||
|
responseData.SetControlError(controlName, Localiser["msg.validation.invalid.value"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Status dates - Closed.
|
||||||
|
if (Transaction.Closed != null)
|
||||||
|
{
|
||||||
|
String controlName = GetFieldName(ItemField.Closed);
|
||||||
|
if ((Transaction.Closed.IsEmpty() || !DateUtil.IsValid(ParseDateFromForm(Transaction.Closed))) && (transactionStatusCat == SbmTransaction.StatusCat.Closed))
|
||||||
|
responseData.SetControlError(controlName, Localiser["msg.validation.mandatory.value"]);
|
||||||
|
else if (ParseDateFromForm(Transaction.Closed) > DateTime.Today)
|
||||||
|
responseData.SetControlError(controlName, Localiser["msg.validation.invalid.value"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Transaction Notes.
|
||||||
|
if (Transaction.Notes != null)
|
||||||
|
{
|
||||||
|
String controlName = GetFieldName(ItemField.Notes);
|
||||||
|
responseData.SetControlValue(controlName, Transaction.Notes);
|
||||||
|
if (!Transaction.Notes.IsEmpty() && StringUtil.GetLength(Transaction.Notes) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_Notes))
|
||||||
|
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_Notes)]);
|
||||||
|
}
|
||||||
|
|
||||||
return !responseData.HasControlErrors();
|
return !responseData.HasControlErrors();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,4 +80,9 @@
|
|||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="Portal\Controllers\Requirements\" />
|
||||||
|
<Folder Include="Views\Requirement\" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
{
|
{
|
||||||
@Html.Hidden("Transaction.Id", "", new { @id = "", @class = "TransactionId sbm-input" })
|
@Html.Hidden("Transaction.Id", "", new { @id = "", @class = "TransactionId sbm-input" })
|
||||||
@Html.Hidden("Transaction.Exists", "", new { @id = "", @class = "TransactionExists sbm-input" })
|
@Html.Hidden("Transaction.Exists", "", new { @id = "", @class = "TransactionExists sbm-input" })
|
||||||
|
@Html.Hidden("Transaction.Type", "", new { @id = "", @class = "TransactionType sbm-input" })
|
||||||
<div class="spacer2"></div>
|
<div class="spacer2"></div>
|
||||||
|
|
||||||
@* Association *@
|
@* Association *@
|
||||||
@@ -218,9 +219,33 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
|
|
||||||
@* Raised by *@
|
@* Required *@
|
||||||
<div class="sbm-form-control @Model_Transaction.GetFieldName(Model_Transaction.ItemField.Closed)">
|
<div class="sbm-form-control @Model_Transaction.GetFieldName(Model_Transaction.ItemField.Required)">
|
||||||
<div class="row pl-3">
|
<div class="row pl-3">
|
||||||
|
<div class="col-sm-4">
|
||||||
|
<div class="sbm-label">
|
||||||
|
<label for="ifTransactionRequired"><span>@Localiser["label.required"]</span></label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm">
|
||||||
|
<div class="sbm-control row">
|
||||||
|
<div class="fixed">@Html.TextBox("Transaction.Required", "", new { @id = "ifTransactionRequired", @class = "TransactionRequired sbm-input sbm-calendar sbm-auto-val", @maxlen = 10 })</div>
|
||||||
|
<div class="col"><div class="pt-2 pl-2"><img src="~/img/action/delete16.png" class="ClearTransactionRequired sbm-action" alt="" title="" /></div></div>
|
||||||
|
</div>
|
||||||
|
<div class="sbm-message"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-6">
|
||||||
|
|
||||||
|
@* Closed *@
|
||||||
|
<div class="sbm-form-control @Model_Transaction.GetFieldName(Model_Transaction.ItemField.Closed)">
|
||||||
|
<div class="row">
|
||||||
<div class="col-sm-4">
|
<div class="col-sm-4">
|
||||||
<div class="sbm-label">
|
<div class="sbm-label">
|
||||||
<label for="ifTransactionClosed"><span>@Localiser["label.closed"]</span></label>
|
<label for="ifTransactionClosed"><span>@Localiser["label.closed"]</span></label>
|
||||||
@@ -235,6 +260,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="col-6">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
@if (ModelTransaction?.GetFilterTransactionType() > 0)
|
@if (ModelTransaction?.GetFilterTransactionType() > 0)
|
||||||
{
|
{
|
||||||
@Html.Hidden("Filter.TransactionType", ModelTransaction.Filter.TransactionType, new { @id = "", @class = "FilterTransactionType" })
|
@Html.Hidden("Filter.Type", ModelTransaction.Filter.Type, new { @id = "", @class = "FilterType sbm-input" })
|
||||||
<input type="hidden" class="FilterAssociationType" value="@ModelTransaction.GetFilterAssociationTypeCode()" />
|
<input type="hidden" class="FilterAssociationType" value="@ModelTransaction.GetFilterAssociationTypeCode()" />
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
@* Transaction Category *@
|
@* Transaction Category *@
|
||||||
<div class="col-4 col-sm-4 sbm-label text-left text-sm-right">@Localiser["label.type"]</div>
|
<div class="col-4 col-sm-4 sbm-label text-left text-sm-right">@Localiser["label.type"]</div>
|
||||||
<div class="col-7 col-sm-8">
|
<div class="col-7 col-sm-8">
|
||||||
@Html.DropDownList("Filter.TransactionType", Model.GetTransactionTypeCodesForFilterDropdown(), null, new { @id = "", @class = "FilterTransactionType sbm-select" })
|
@Html.DropDownList("Filter.Type", Model.GetTransactionTypeCodesForFilterDropdown(), null, new { @id = "", @class = "FilterType sbm-select" })
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
@@ -60,7 +60,7 @@
|
|||||||
@* Transaction Status *@
|
@* Transaction Status *@
|
||||||
<div class="col-4 col-sm-4 sbm-label text-left text-sm-right">@Localiser["label.status"]</div>
|
<div class="col-4 col-sm-4 sbm-label text-left text-sm-right">@Localiser["label.status"]</div>
|
||||||
<div class="col-7 col-sm-8">
|
<div class="col-7 col-sm-8">
|
||||||
@Html.DropDownList("Filter.TransactionStatusCat", ModelTransaction?.GetTransactionStatusCatsForFilterDropdown() ?? Model.GetEmptyListForSelect(), null, new { @id = "", @class = "FilterTransactionStatusCat sbm-select" })
|
@Html.DropDownList("Filter.StatusCat", ModelTransaction?.GetTransactionStatusCatsForFilterDropdown() ?? Model.GetEmptyListForSelect(), null, new { @id = "", @class = "FilterStatusCat sbm-select" })
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-4 row pb4">
|
<div class="col-sm-4 row pb4">
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
@* Transaction type *@
|
@* Transaction type *@
|
||||||
<div class="col-4 col-sm-4 sbm-label text-left text-sm-right">@Localiser["label.type"]</div>
|
<div class="col-4 col-sm-4 sbm-label text-left text-sm-right">@Localiser["label.type"]</div>
|
||||||
<div class="col-8 col-sm-8">
|
<div class="col-8 col-sm-8">
|
||||||
@Html.DropDownList("Filter.TransactionType", Model.GetTransactionTypeCodesForFilterDropdown(), Localiser["label.any"], new { @id = "", @class = "FilterTransactionType sbm-select" })
|
@Html.DropDownList("Filter.Type", Model.GetTransactionTypeCodesForFilterDropdown(), Localiser["label.any"], new { @id = "", @class = "FilterType sbm-select" })
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-4 row pb4">
|
<div class="col-sm-4 row pb4">
|
||||||
|
|||||||
@@ -484,7 +484,7 @@ table.sbm-item-list tbody td
|
|||||||
|
|
||||||
/* Item statuses */
|
/* Item statuses */
|
||||||
|
|
||||||
.sbm-status-awa, .sbm-status-req, .sbm-status-rai, .sbm-status-clo
|
.sbm-status-pre, .sbm-status-awa, .sbm-status-req, .sbm-status-rai, .sbm-status-clo
|
||||||
{
|
{
|
||||||
color: darkorange;
|
color: darkorange;
|
||||||
}
|
}
|
||||||
@@ -499,12 +499,12 @@ table.sbm-item-list tbody td
|
|||||||
color: darkred;
|
color: darkred;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sbm-status-inp, .sbm-status-exp, .sbm-status-inv, .sbm-status-suc, .sbm-status-act, .sbm-status-que, .sbm-status-log
|
.sbm-status-wip, .sbm-status-exp, .sbm-status-inv, .sbm-status-suc, .sbm-status-act, .sbm-status-que, .sbm-status-log
|
||||||
{
|
{
|
||||||
color: darkcyan;
|
color: darkcyan;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sbm-status-pre, .sbm-status-pro, .sbm-status-inp, .sbm-status-hld, .sbm-status-upd, .sbm-status-sup, .sbm-status-aut, .sbm-status-sub
|
.sbm-status-pro, sbm-status-hld, .sbm-status-upd, .sbm-status-sup, .sbm-status-aut, .sbm-status-sub
|
||||||
{
|
{
|
||||||
color: dodgerblue;
|
color: dodgerblue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -171,7 +171,7 @@
|
|||||||
|
|
||||||
.sbm-form .sbm-input.sbm-calendar
|
.sbm-form .sbm-input.sbm-calendar
|
||||||
{
|
{
|
||||||
max-width: 180px;
|
max-width: 120px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sbm-form .sbm-textarea, .sbm-form .sbm-select[multiple="multiple"]
|
.sbm-form .sbm-textarea, .sbm-form .sbm-select[multiple="multiple"]
|
||||||
|
|||||||
@@ -442,4 +442,9 @@ a:focus
|
|||||||
border: 1px solid var(--color-OldGold);
|
border: 1px solid var(--color-OldGold);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ui-datepicker-trigger
|
||||||
|
{
|
||||||
|
margin-left:4px;
|
||||||
|
}
|
||||||
|
|
||||||
/* The End */
|
/* The End */
|
||||||
|
|||||||
@@ -138,7 +138,7 @@
|
|||||||
}
|
}
|
||||||
sbm.initCalendars = function (sel, opt)
|
sbm.initCalendars = function (sel, opt)
|
||||||
{
|
{
|
||||||
return $(sel).datepicker(opt || {});
|
return $(sel).prop('autocomplete', false).datepicker(opt || {});
|
||||||
}
|
}
|
||||||
sbm.allowClearCalendar = function (sel)
|
sbm.allowClearCalendar = function (sel)
|
||||||
{
|
{
|
||||||
@@ -583,14 +583,15 @@
|
|||||||
$.datepicker.setDefaults({
|
$.datepicker.setDefaults({
|
||||||
showOn: 'both',
|
showOn: 'both',
|
||||||
buttonImageOnly: true,
|
buttonImageOnly: true,
|
||||||
buttonImage: '../img/action/calendar32.png',
|
buttonImage: '../img/action/calendar24.png',
|
||||||
buttonText: sbm.lbl.calendar,
|
buttonText: sbm.lbl.calendar,
|
||||||
dateFormat: sbm.form.calendarDateFormat,
|
dateFormat: sbm.form.calendarDateFormat,
|
||||||
changeMonth: true,
|
changeMonth: true,
|
||||||
changeYear: false,
|
changeYear: false,
|
||||||
yearRange: '-14:+01',
|
yearRange: '-30:+01',
|
||||||
firstDay: 1,
|
firstDay: 1,
|
||||||
//defaultDate: 0,
|
//defaultDate: 0,
|
||||||
|
beforeShow: function (i) { if ($(i).attr('readonly')) { return false; } },
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -127,15 +127,16 @@
|
|||||||
{
|
{
|
||||||
co.clearItem(env, cfg);
|
co.clearItem(env, cfg);
|
||||||
let $frm = env.$frm.item;
|
let $frm = env.$frm.item;
|
||||||
$frm.find('.TransactionType').val(env.data.transactionTypeDefault);
|
env.$ctrl.trnType.val(env.$frm.filter.find('.sbm-input.FilterType').val());
|
||||||
env.$ctrl.searchTgtAssoc.show();
|
env.$ctrl.searchTgtAssoc.show();
|
||||||
$frm.find('.TransactionStatus').val(env.data.defaultStatusCode);
|
env.$ctrl.trnStatus.val(env.data.defaultStatusCode).trigger('change');
|
||||||
|
env.$ctrl.trnRaised.datepicker('setDate', 'today');
|
||||||
co.openItemDlg(env, cfg, sbm.dlg.title.createTransaction);
|
co.openItemDlg(env, cfg, sbm.dlg.title.createTransaction);
|
||||||
}
|
}
|
||||||
co.clearItem = function (env, cfg)
|
co.clearItem = function (env, cfg)
|
||||||
{
|
{
|
||||||
sbm.clearItemForm(env.$frm.item);
|
sbm.clearItemForm(env.$frm.item);
|
||||||
sbm.populateSelectCodeDesc('#cbTransactionStatus', env.data.statuses);
|
sbm.populateSelectCodeDesc(env.$ctrl.trnStatus, env.data.statuses);
|
||||||
}
|
}
|
||||||
co.openItemDlg = function (env, cfg, title)
|
co.openItemDlg = function (env, cfg, title)
|
||||||
{
|
{
|
||||||
@@ -161,7 +162,7 @@
|
|||||||
}
|
}
|
||||||
co.onUpdateItem = function (env, response)
|
co.onUpdateItem = function (env, response)
|
||||||
{
|
{
|
||||||
sbm.debug('onUpdateItem', env, response);
|
//sbm.debug('onUpdateItem', env, response);
|
||||||
if (!response.success) return;
|
if (!response.success) return;
|
||||||
let cfg = response.config || {};
|
let cfg = response.config || {};
|
||||||
co.clearItem(env, cfg);
|
co.clearItem(env, cfg);
|
||||||
@@ -171,11 +172,10 @@
|
|||||||
let $ctrls = $frm.find('.sbm-input,.sbm-textarea,.sbm-select');
|
let $ctrls = $frm.find('.sbm-input,.sbm-textarea,.sbm-select');
|
||||||
$ctrls.filter('.TransactionId').val(item.id);
|
$ctrls.filter('.TransactionId').val(item.id);
|
||||||
$ctrls.filter('.TransactionExists').val(1);
|
$ctrls.filter('.TransactionExists').val(1);
|
||||||
sbm.debug(item.field.value.AssociationId);
|
|
||||||
$ctrls.filter('.TransactionAssociationId').val(item.field.value.AssociationId);
|
$ctrls.filter('.TransactionAssociationId').val(item.field.value.AssociationId);
|
||||||
env.$ctrl.searchTgtAssoc.hide();
|
env.$ctrl.searchTgtAssoc.hide();
|
||||||
sbm.selectOrAdd($ctrls.filter('.TransactionType'), item.typeCode, item.typeDesc);
|
sbm.selectOrAdd(env.$ctrl.trnStatus, item.statusCode, item.field.value.Status);
|
||||||
sbm.selectOrAdd($ctrls.filter('.TransactionStatus'), item.statusCode, item.field.value.Status);
|
env.$ctrl.trnStatus.trigger('change');
|
||||||
co.openItemDlg(env, cfg, sbm.dlg.title.updateTransaction);
|
co.openItemDlg(env, cfg, sbm.dlg.title.updateTransaction);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -187,11 +187,22 @@
|
|||||||
}
|
}
|
||||||
co.onSelectAssocTarget = function (env, item)
|
co.onSelectAssocTarget = function (env, item)
|
||||||
{
|
{
|
||||||
sbm.debug('onSelectAssocTarget', env, item);
|
//sbm.debug('onSelectAssocTarget', env, item);
|
||||||
env.$frm.item.find('.TransactionAssociationId').val(item.id);
|
env.$frm.item.find('.TransactionAssociationId').val(item.id);
|
||||||
env.$frm.item.find('.TransactionAssociation').val(item.name);
|
env.$frm.item.find('.TransactionAssociation').val(item.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
co.onChangeStatus = function (env)
|
||||||
|
{
|
||||||
|
let sta = env.$ctrl.trnStatus.val();
|
||||||
|
env.$ctrl.trnRaised.prop('readonly', sta != 'PRE');
|
||||||
|
env.$ctrl.trnInProgress.prop('readonly', sta != 'WIP');
|
||||||
|
if (sta == 'PRE') env.$ctrl.trnInProgress.val('')
|
||||||
|
env.$ctrl.trnRequired.prop('readonly', (sta != 'PRE' && sta != 'WIP'));
|
||||||
|
env.$ctrl.trnClosed.prop('readonly', sta == 'PRE' || sta == 'WIP');
|
||||||
|
if (sta == 'PRE' || sta == 'WIP') env.$ctrl.trnClosed.val('')
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
co.storeItem = function (env)
|
co.storeItem = function (env)
|
||||||
{
|
{
|
||||||
@@ -230,7 +241,7 @@
|
|||||||
//sbm.debug('selectTransaction', prm);
|
//sbm.debug('selectTransaction', prm);
|
||||||
let env = co.env.select;
|
let env = co.env.select;
|
||||||
env.prmSelect = prm;
|
env.prmSelect = prm;
|
||||||
env.$frm.filter.find('.FilterTransactionType').val('');
|
env.$frm.filter.find('.FilterType').val('');
|
||||||
env.$frm.filter.find('.FilterSearch').val(prm.search || '');
|
env.$frm.filter.find('.FilterSearch').val(prm.search || '');
|
||||||
env.$pnl.table.find('tbody tr').remove();
|
env.$pnl.table.find('tbody tr').remove();
|
||||||
sbm.openDialog(env.$dlg.select, 1000, 800);
|
sbm.openDialog(env.$dlg.select, 1000, 800);
|
||||||
@@ -282,17 +293,28 @@
|
|||||||
|
|
||||||
env.$frm.filter = $items.find('.frmTransactionFilter');
|
env.$frm.filter = $items.find('.frmTransactionFilter');
|
||||||
if (env.$frm.filter.length)
|
if (env.$frm.filter.length)
|
||||||
env.$frm.filter.on('input', '.FilterSearch', function () { co.refreshItems(env, 250); }).on('change', '.FilterTransactionType,.FilterTransactionStatusCat', function () { co.refreshItems(env, 50); });
|
env.$frm.filter.on('input', '.FilterSearch', function () { co.refreshItems(env, 250); }).on('change', '.sbm-select.FilterType,.sbm-select.FilterStatusCat', function () { co.refreshItems(env, 50); });
|
||||||
env.$frm.itemId = $items.find('#frmTransactionId');
|
env.$frm.itemId = $items.find('#frmTransactionId');
|
||||||
var opt = sbm.dlgOpts();
|
var opt = sbm.dlgOpts();
|
||||||
opt.dialogClass += " sbm-Transaction";
|
opt.dialogClass += " sbm-Transaction";
|
||||||
env.$dlg.item = $items.find('#dlgTransaction').dialog(opt);
|
env.$dlg.item = $items.find('#dlgTransaction').dialog(opt);
|
||||||
env.$frm.item = env.$dlg.item.find('#frmTransaction').on('input', '.sbm-input, .sbm-textarea', function () { sbm.clearControlError(this); }).on('change', '.sbm-select', function () { sbm.clearControlError(this); });
|
env.$frm.item = env.$dlg.item.find('#frmTransaction').on('input', '.sbm-input, .sbm-textarea', function () { sbm.clearControlError(this); }).on('change', '.sbm-select', function () { sbm.clearControlError(this); });
|
||||||
sbm.initCalendars(env.$dlg.item.find('.sbm-input.sbm-calendar'), {});
|
if (env.$frm.item.length)
|
||||||
|
{
|
||||||
env.$frm.item.on('blur', '.sbm-input.sbm-format-integer', function () { sbm.formatInteger($(this)); }).on('blur', '.sbm-input.sbm-format-currency', function () { sbm.formatCurrency($(this)); });
|
env.$frm.item.on('blur', '.sbm-input.sbm-format-integer', function () { sbm.formatInteger($(this)); }).on('blur', '.sbm-input.sbm-format-currency', function () { sbm.formatCurrency($(this)); });
|
||||||
|
env.$ctrl.trnType = env.$frm.item.find('.sbm-input.TransactionType');
|
||||||
env.$frm.item.find('.TransactionAssociation').on('dblclick', function () { co.selectAssocTarget(env); });
|
env.$frm.item.find('.TransactionAssociation').on('dblclick', function () { co.selectAssocTarget(env); });
|
||||||
env.$ctrl.searchTgtAssoc = env.$frm.item.find('.AssociationTargetSearch').on('click', function () { co.selectAssocTarget(env); });
|
env.$ctrl.searchTgtAssoc = env.$frm.item.find('.AssociationTargetSearch').on('click', function () { co.selectAssocTarget(env); });
|
||||||
|
env.$ctrl.trnStatus = env.$frm.item.find('.sbm-select.TransactionStatus');
|
||||||
|
if (env.$ctrl.trnStatus.length) env.$ctrl.trnStatus.on('change', function () { co.onChangeStatus(env); });
|
||||||
|
sbm.initCalendars(env.$frm.item.find('.sbm-input.sbm-calendar'), {});
|
||||||
|
env.$ctrl.trnRaised = env.$frm.item.find('.sbm-input.TransactionRaised');
|
||||||
|
env.$ctrl.trnInProgress = env.$frm.item.find('.sbm-input.TransactionInProgress');
|
||||||
|
env.$ctrl.trnRequired = env.$frm.item.find('.sbm-input.TransactionRequired');
|
||||||
|
env.$ctrl.clearRequired = env.$frm.item.find('.ClearTransactionRequired').on('click', function () { env.$ctrl.trnRequired.val(''); });
|
||||||
|
sbm.allowClearCalendar(env.$ctrl.trnRequired);
|
||||||
|
env.$ctrl.trnClosed = env.$frm.item.find('.sbm-input.TransactionClosed');
|
||||||
|
}
|
||||||
var opt = sbm.dlgOpts();
|
var opt = sbm.dlgOpts();
|
||||||
opt.dialogClass += " sbm-Transaction";
|
opt.dialogClass += " sbm-Transaction";
|
||||||
opt.buttons[sbm.lbl.ok] = function () { co.selectItem(env); };
|
opt.buttons[sbm.lbl.ok] = function () { co.selectItem(env); };
|
||||||
|
|||||||
Reference in New Issue
Block a user