本文整理汇总了C#中PXCache类的典型用法代码示例。如果您正苦于以下问题:C# PXCache类的具体用法?C# PXCache怎么用?C# PXCache使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PXCache类属于命名空间,在下文中一共展示了PXCache类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FieldVerifying
public override void FieldVerifying(PXCache sender, PXFieldVerifyingEventArgs e)
{
if (object.Equals(DRScheduleDetail.EmptyComponentID, e.NewValue))
return;
base.FieldVerifying(sender, e);
}
示例2: Page_ColumnSet_RowSelected
void Page_ColumnSet_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
{
var gridHeader = sp1.FindControl("gridHeader") as PXGrid;
var gridColumn = sp1.FindControl("gridColumn") as PXGrid;
CreateColumns(ds.GetSchema("Headers"), gridHeader);
CreateColumns(ds.GetSchema("Properties"), gridColumn);
}
示例3: SetDefaultEffDate
private void SetDefaultEffDate(PXCache cache)
{
object newValue;
if (cache.RaiseFieldDefaulting<CurrencyInfo.curyEffDate>(this, out newValue))
{
cache.RaiseFieldUpdating<CurrencyInfo.curyEffDate>(this, ref newValue);
}
this.CuryEffDate = (DateTime?)newValue;
}
示例4: getCuryRate
private CurrencyRate getCuryRate(PXCache cache)
{
return PXSelectReadonly<CurrencyRate,
Where<CurrencyRate.toCuryID, Equal<Required<CurrencyInfo.baseCuryID>>,
And<CurrencyRate.fromCuryID, Equal<Required<CurrencyInfo.curyID>>,
And<CurrencyRate.curyRateType, Equal<Required<CurrencyInfo.curyRateTypeID>>,
And<CurrencyRate.curyEffDate, LessEqual<Required<CurrencyInfo.curyEffDate>>>>>>,
OrderBy<Desc<CurrencyRate.curyEffDate>>>.SelectWindowed(cache.Graph, 0, 1, BaseCuryID, CuryID, CuryRateTypeID, CuryEffDate);
}
示例5: getCMSetup
private CMSetup getCMSetup(PXCache cache)
{
CMSetup CMSetup = (CMSetup)cache.Graph.Caches[typeof(CMSetup)].Current;
if (CMSetup == null)
{
CMSetup = PXSelectReadonly<CMSetup>.Select(cache.Graph);
}
return CMSetup;
}
示例6: SubstituteKeyFieldUpdating
public override void SubstituteKeyFieldUpdating(PXCache sender, PXFieldUpdatingEventArgs e)
{
if (object.Equals(EmptyComponentCD, e.NewValue))
{
e.NewValue = DRScheduleDetail.EmptyComponentID;
}
else
base.SubstituteKeyFieldUpdating(sender, e);
}
示例7: Users_RowSelected
protected void Users_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
{
Users user = (Users)e.Row;
if (user == null) return;
bool isNotFromAD = user.Source != PXUsersSourceListAttribute.ActiveDirectory;
PXDefaultAttribute.SetPersistingCheck<Users.password>(sender, user, isNotFromAD ? PXPersistingCheck.Null : PXPersistingCheck.Nothing);
PXDefaultAttribute.SetPersistingCheck<Users.email>(sender, user, isNotFromAD ? PXPersistingCheck.Null : PXPersistingCheck.Nothing);
}
示例8: defaultCuryRate
private void defaultCuryRate(PXCache cache, bool ForceDefault)
{
CurrencyRate rate = getCuryRate(cache);
if (rate != null)
{
DateTime? UserCuryEffDate = CuryEffDate;
CuryEffDate = rate.CuryEffDate;
CuryRate = Math.Round((decimal)rate.CuryRate, 8);
CuryMultDiv = rate.CuryMultDiv;
RecipRate = Math.Round((decimal)rate.RateReciprocal, 8);
if (rate.CuryEffDate < UserCuryEffDate)
{
CurrencyRateType ratetype = (CurrencyRateType)PXSelectorAttribute.Select<CurrencyInfo.curyRateTypeID>(cache, this);
if (ratetype != null && ratetype.RateEffDays > 0 && ((TimeSpan)(UserCuryEffDate - rate.CuryEffDate)).Days > ratetype.RateEffDays)
{
throw new PXRateIsNotDefinedForThisDateException(rate.CuryRateType, rate.FromCuryID, rate.ToCuryID, (DateTime)UserCuryEffDate);
}
}
}
else if (ForceDefault)
{
if (object.Equals(this._CuryID, this._BaseCuryID))
{
bool dirty = cache.IsDirty;
CurrencyInfo dflt = new CurrencyInfo();
cache.SetDefaultExt<CurrencyInfo.curyRate>(dflt);
cache.SetDefaultExt<CurrencyInfo.curyMultDiv>(dflt);
cache.SetDefaultExt<CurrencyInfo.recipRate>(dflt);
CuryRate = Math.Round((decimal)dflt.CuryRate, 8);
CuryMultDiv = dflt.CuryMultDiv;
RecipRate = Math.Round((decimal)dflt.RecipRate, 8);
cache.IsDirty = dirty;
}
else if (this._CuryRateTypeID == null || this._CuryEffDate == null)
{
this.CuryRate = null;
this.RecipRate = null;
this.CuryMultDiv = "M";
}
else
{
this.CuryRate = null;
this.RecipRate = null;
this.CuryMultDiv = "M";
throw new PXSetPropertyException(Messages.RateNotFound, PXErrorLevel.Warning);
}
}
}
示例9: PrepareInsert
protected override bool PrepareInsert(PXCache sender, object row, PXAccumulatorCollection columns)
{
if (!base.PrepareInsert(sender, row, columns))
{
return false;
}
DRExpenseProjectionAccum item = (DRExpenseProjectionAccum)row;
columns.Update<DRExpenseProjectionAccum.pTDProjected>(item.PTDProjected, PXDataFieldAssign.AssignBehavior.Summarize);
columns.Update<DRExpenseProjectionAccum.pTDRecognized>(item.PTDRecognized, PXDataFieldAssign.AssignBehavior.Summarize);
columns.Update<DRExpenseProjectionAccum.pTDRecognizedSamePeriod>(item.PTDRecognizedSamePeriod, PXDataFieldAssign.AssignBehavior.Summarize);
return true;
}
示例10: RowUpdated
private void RowUpdated(PXCache sender, PXRowUpdatedEventArgs e)
{
var val = (PropertyValue)e.Row;
var oldValue = (PropertyValue)e.OldRow;
if (Equals(val.Value, oldValue.Value)) return;
var itemsCache = View.Cache;
foreach (PropertyValue item in sender.Cached.
Cast<PropertyValue>().
Where(_ => _.Order > val.Order).
OrderBy(_ => _.Order))
{
if (string.IsNullOrWhiteSpace(item.Name)) continue;
var propertyInfo = itemsCache.GetType().GetProperty(item.Name);
if (propertyInfo == null) continue;
var verifier = Attribute.GetCustomAttribute(propertyInfo, PropertyMarkAttribute) as PXMassProcessFieldAttribute;
if (verifier == null || verifier.SearchCommand == null) continue;
var searchCommand = (BqlCommand)Activator.CreateInstance(verifier.SearchCommand);
var verifingParams = new List<object>();
var itemOrder = item.Order;
foreach(IBqlParameter param in searchCommand.GetParameters())
{
var refType = param.GetReferencedType();
if (refType == null) continue;
var propVal = sender.Cached.Cast<PropertyValue>().FirstOrDefault(_ => _.Order < itemOrder && Equals(refType.Name, _.Name));
verifingParams.Add(propVal.With(_ => _.Value));
}
int startRow = 0;
int totalRows = 0;
var searchResult = new PXView(Graph, true, searchCommand).
Select(null, verifingParams.ToArray(),
new object[] { item.Value },
new string[] { ((IBqlSearch)searchCommand).GetField().Name },
new bool[] { false },
null, ref startRow, 1, ref totalRows);
if (searchResult == null || searchResult.Count == 0)
{
item.Value = null;
}
}
}
示例11: Location_VBranchID_FieldDefaulting
protected override void Location_VBranchID_FieldDefaulting(PXCache sender, PXFieldDefaultingEventArgs e)
{
}
示例12: LocationAPAccountSub_RowSelected
protected virtual void LocationAPAccountSub_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
{
if (e.Row == null) return;
if (Location.Current != null)
{
PXUIFieldAttribute.SetEnabled(sender, e.Row, object.Equals(Location.Current.LocationID, Location.Current.VAPAccountLocationID));
}
}
示例13: Location_CBranchID_FieldDefaulting
protected virtual void Location_CBranchID_FieldDefaulting(PXCache sender, PXFieldDefaultingEventArgs e)
{
e.NewValue = null;
e.Cancel = true;
}
示例14: Address_RowSelected
protected override void Address_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
{
Address row = e.Row as Address;
if (row != null)
{
BAccount acct = BAccountUtility.FindAccount(this, row.BAccountID);
bool isSameAsMain = false;
if (acct != null)
{
isSameAsMain = (row.AddressID == acct.DefAddressID);
}
if (!isSameAsMain && Location.Current != null && APPaymentInfoLocation.Current != null && object.Equals(APPaymentInfoLocation.Current.VRemitAddressID, row.AddressID))
{
PXUIFieldAttribute.SetEnabled(sender, e.Row, object.Equals(Location.Current.LocationID, Location.Current.VPaymentInfoLocationID));
}
else
{
base.Address_RowSelected(sender, e);
}
}
}
示例15: LocationAPPaymentInfo_VCashAccountID_FieldDefaulting
protected virtual void LocationAPPaymentInfo_VCashAccountID_FieldDefaulting(PXCache sender, PXFieldDefaultingEventArgs e)
{
//LocationAPPaymentInfo row = (LocationAPPaymentInfo)e.Row;
e.NewValue = null;
e.Cancel = true;
}