3.0.0.3 Control Repository Schema & Logs.
This commit is contained in:
@@ -40,7 +40,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Get Association.
|
||||
// Get Item.
|
||||
public override SbmAssociation GetAssociation(SbmAssociation.Params prm)
|
||||
{
|
||||
return GetAssociation(GetAssociationQueryFilter(prm).Concat(" AND ", "(", ")"));
|
||||
@@ -77,6 +77,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Item properties.
|
||||
public override SysId GetAssociationAffIdTarget(SysId associationId)
|
||||
{
|
||||
ClearErrorState();
|
||||
@@ -127,7 +128,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Validate Association.
|
||||
// Validate Item.
|
||||
public override bool IsValidAssociationData(SbmAssociation.Data data, SbmAssociation.ErrField errField)
|
||||
{
|
||||
ClearErrorState();
|
||||
@@ -145,7 +146,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Insert Association.
|
||||
// Insert Item.
|
||||
public override bool InsertAssociation(SbmAssociation association, DbUpdateInfo dbUpdateInfo)
|
||||
{
|
||||
ClearErrorState();
|
||||
@@ -175,7 +176,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update Association.
|
||||
// Update Item.
|
||||
public override bool UpdateAssociation(SbmAssociation association, DbUpdateInfo dbUpdateInfo)
|
||||
{
|
||||
ClearErrorState();
|
||||
@@ -213,7 +214,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Delete Association.
|
||||
// Delete Item.
|
||||
public override bool AssociationCanBeDeleted(SbmAssociation association)
|
||||
{
|
||||
ClearErrorState();
|
||||
@@ -511,7 +512,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Column definitions.
|
||||
// Item Column definitions.
|
||||
private static readonly String aliasAssociation = "aAssoc";
|
||||
// Association Owner contact.
|
||||
private static string aliasAssociation_Affiliate_Owner = "Asn_AffOwn";
|
||||
@@ -556,7 +557,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
col.MaxLength = (int)Internals.GetColTextLen(dbCol);
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
// Getting prmAssociation column definition.
|
||||
// Item column definition.
|
||||
public override ColumnDfn GetAssociationColumnDfn(SbmAssociation.Column column, string caption = "", int width = 0)
|
||||
{
|
||||
ColumnDfn columnDfn = new ColumnDfn((int)column, caption, width);
|
||||
@@ -1120,10 +1121,21 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
public override List<string> GetAssociationQueryFilter(SbmAssociation.Params prm)
|
||||
{
|
||||
List<String> filter = new List<String>();
|
||||
String colAssociation_Id = SbmDbDfn.GetColumnNameQual(SbmDbDfn.ColumnIdx.Association_Id, aliasAssociation);
|
||||
String colAssociation_AffIdOwner = SbmDbDfn.GetColumnNameQual(SbmDbDfn.ColumnIdx.Association_AffIdOwner, aliasAssociation);
|
||||
String colAssociation_AffIdTarget = SbmDbDfn.GetColumnNameQual(SbmDbDfn.ColumnIdx.Association_AffIdTarget, aliasAssociation);
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// Demo application restrictions - when user logged in.
|
||||
if (SysId.IsValid(UserContext.UserAffiliateId) && SessionConsole.HideOtherUserContacts())
|
||||
{
|
||||
// Exclude Individual contacts with User Id other than the logged in user.
|
||||
// NB Keep logic in line with corresponding Affiliate method (SbmAccountMgr_Dbas.GetAffiliateQueryFilter).
|
||||
filter.Add($"{colAssociation_AffIdTarget} Not In (Select Id From {SbmDbDfn.GetTableName(SbmDbDfn.TableIdx.Affiliate)} Where Id!={UserContext.UserAffiliateId} And Type={(int)Sbm.AffiliateType.Individual} And UserId>0)");
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// Association Id.
|
||||
String colAssociation_Id = SbmDbDfn.GetColumnNameQual(SbmDbDfn.ColumnIdx.Association_Id, aliasAssociation);
|
||||
if (prm.IdsIncluded.HasValidIds())
|
||||
filter.Add($"{colAssociation_Id} IN ({prm.IdsIncluded.Concat(",")})");
|
||||
if (prm.IdsExcluded.HasValidIds())
|
||||
@@ -1138,12 +1150,10 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// Owner affiliate.
|
||||
String colAssociation_AffIdOwner = SbmDbDfn.GetColumnNameQual(SbmDbDfn.ColumnIdx.Association_AffIdOwner, aliasAssociation);
|
||||
if (SysId.IsValid(prm.AffiliateIdOwner))
|
||||
filter.Add($"{colAssociation_AffIdOwner}={prm.AffiliateIdOwner}");
|
||||
|
||||
// Target Affiliate.
|
||||
String colAssociation_AffIdTarget = SbmDbDfn.GetColumnNameQual(SbmDbDfn.ColumnIdx.Association_AffIdTarget, aliasAssociation);
|
||||
if (SysId.IsValid(prm.AffiliateIdTarget))
|
||||
filter.Add($"{colAssociation_AffIdTarget}={prm.AffiliateIdTarget}");
|
||||
|
||||
@@ -1151,7 +1161,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
// Contact Group.
|
||||
if (SysId.IsValid(prm.AffiliateIdContactGroup))
|
||||
{
|
||||
//Association must also be a member of this contact group.
|
||||
// Association must also be a member of this contact group.
|
||||
String aliasAssocContactGroup = "aAssConGrp";
|
||||
DbQuery queryAssocContactGroup = new DbQuery(Database.DbmsType);
|
||||
queryAssocContactGroup.Tables.Add(SbmDbDfn.GetTableName(SbmDbDfn.TableIdx.Association), aliasAssocContactGroup);
|
||||
|
||||
Reference in New Issue
Block a user