• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# PXCache类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中PXCache的典型用法代码示例。如果您正苦于以下问题:C# PXCache类的具体用法?C# PXCache怎么用?C# PXCache使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PXCache类属于命名空间,在下文中一共展示了PXCache类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: FieldVerifying

		public override void FieldVerifying(PXCache sender, PXFieldVerifyingEventArgs e)
		{
			if (object.Equals(DRScheduleDetail.EmptyComponentID, e.NewValue))
				return;

			base.FieldVerifying(sender, e);
		}
开发者ID:PavelMPD,项目名称:SimpleProjects,代码行数:7,代码来源:Attribute.cs


示例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);
	}
开发者ID:PavelMPD,项目名称:SimpleProjects,代码行数:8,代码来源:CS206020.aspx.cs


示例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;
		}
开发者ID:PavelMPD,项目名称:SimpleProjects,代码行数:9,代码来源:CurrencyInfo.cs


示例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);
		}
开发者ID:PavelMPD,项目名称:SimpleProjects,代码行数:9,代码来源:CurrencyInfo.cs


示例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;
		}
开发者ID:PavelMPD,项目名称:SimpleProjects,代码行数:9,代码来源:CurrencyInfo.cs


示例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);
		}
开发者ID:PavelMPD,项目名称:SimpleProjects,代码行数:9,代码来源:Attribute.cs


示例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);
		}
开发者ID:PavelMPD,项目名称:SimpleProjects,代码行数:9,代码来源:MyProfileMaint.cs


示例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);
				}
			}
		}
开发者ID:PavelMPD,项目名称:SimpleProjects,代码行数:50,代码来源:CurrencyInfo.cs


示例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;
		}
开发者ID:PavelMPD,项目名称:SimpleProjects,代码行数:14,代码来源:Attribute.cs


示例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;
				}
			}
		}
开发者ID:PavelMPD,项目名称:SimpleProjects,代码行数:46,代码来源:MassProcessPropertyValueAttribute.cs


示例11: Location_VBranchID_FieldDefaulting

		protected override void Location_VBranchID_FieldDefaulting(PXCache sender, PXFieldDefaultingEventArgs e)
		{
		}
开发者ID:PavelMPD,项目名称:SimpleProjects,代码行数:3,代码来源:VendorLocationMaint.cs


示例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));
			}
		}
开发者ID:PavelMPD,项目名称:SimpleProjects,代码行数:9,代码来源:VendorLocationMaint.cs


示例13: Location_CBranchID_FieldDefaulting

		protected virtual void Location_CBranchID_FieldDefaulting(PXCache sender, PXFieldDefaultingEventArgs e)
		{
			e.NewValue = null;
			e.Cancel = true;
		}
开发者ID:PavelMPD,项目名称:SimpleProjects,代码行数:5,代码来源:VendorLocationMaint.cs


示例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);
				}
			}
		}
开发者ID:PavelMPD,项目名称:SimpleProjects,代码行数:22,代码来源:VendorLocationMaint.cs


示例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;			
		}
开发者ID:PavelMPD,项目名称:SimpleProjects,代码行数:6,代码来源:VendorLocationMaint.cs


示例16: LocationAPPaymentInfo_RowUpdated

		protected virtual void LocationAPPaymentInfo_RowUpdated(PXCache sender, PXRowUpdatedEventArgs e)
		{
			LocationAPPaymentInfo record = (LocationAPPaymentInfo)e.Row;
            if (!sender.ObjectsEqual<LocationAPPaymentInfo.vCashAccountID, LocationAPPaymentInfo.vPaymentMethodID, LocationAPPaymentInfo.vPaymentLeadTime, LocationAPPaymentInfo.vPaymentByType, LocationAPPaymentInfo.vSeparateCheck, LocationAPPaymentInfo.isRemitAddressSameAsMain, LocationAPPaymentInfo.isRemitContactSameAsMain>(e.Row, e.OldRow))
			{
				Location mainloc = Location.Current;
				mainloc.VCashAccountID = record.VCashAccountID;
				mainloc.VPaymentMethodID = record.VPaymentMethodID;
				mainloc.VPaymentLeadTime = record.VPaymentLeadTime;
				mainloc.VPaymentByType = record.VPaymentByType;
				mainloc.VSeparateCheck = record.VSeparateCheck;
				mainloc.IsRemitAddressSameAsMain = record.IsRemitAddressSameAsMain;
				mainloc.VRemitAddressID = record.VRemitAddressID;
				mainloc.IsRemitContactSameAsMain = record.IsRemitContactSameAsMain;
				mainloc.VRemitContactID = record.VRemitContactID;

				if (Location.Cache.GetStatus(mainloc) == PXEntryStatus.Notchanged)
				{
					Location.Cache.SetStatus(mainloc, PXEntryStatus.Updated);
				}

				sender.Graph.Caches[typeof (Location)].IsDirty = true;
			}
		}        
开发者ID:PavelMPD,项目名称:SimpleProjects,代码行数:24,代码来源:VendorLocationMaint.cs


示例17: LocationAPPaymentInfo_IsRemitContactSameAsMain_FieldUpdated

		protected virtual void LocationAPPaymentInfo_IsRemitContactSameAsMain_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e)
		{
			LocationAPPaymentInfo owner = (LocationAPPaymentInfo)e.Row;
			if (owner != null)
			{
				if (owner.IsRemitContactSameAsMain == true)
				{
					if (owner.VRemitContactID != owner.VDefContactID)
					{
						Contact contact = this.FindContact(owner.VRemitContactID);
						if (contact != null && contact.ContactID == owner.VRemitContactID)
						{
							this.RemitContact.Delete(contact);
						}
						owner.VRemitContactID = owner.VDefContactID;
						//if (this.Location.Cache.Locate(owner) != null)
						//  this.Location.Cache.Update(owner);
					}
				}

				if (owner.IsRemitContactSameAsMain == false)
				{
					if (owner.VRemitContactID != null)
					{
						if (owner.VRemitContactID == owner.VDefContactID)
						{
							Contact defContact = this.FindContact(owner.VDefContactID);
							Contact cont = PXCache<Contact>.CreateCopy(defContact);
							cont.ContactID = null;
							cont.BAccountID = owner.BAccountID;
							cont.ContactType = ContactTypesAttribute.BAccountProperty;
							cont = (Contact)this.RemitContact.Cache.Insert(cont);
							owner.VRemitContactID = cont.ContactID;
							//if (this.Location.Cache.Locate(owner) != null)
							//  this.Location.Cache.Update(owner);
						}
					}
				}
			}
		}
开发者ID:PavelMPD,项目名称:SimpleProjects,代码行数:40,代码来源:VendorLocationMaint.cs


示例18: LocationAPPaymentInfo_RowSelected

		protected virtual void LocationAPPaymentInfo_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
		{
            if (e.Row == null) return;

            LocationAPPaymentInfo row = (LocationAPPaymentInfo)e.Row;
			if (Location.Current != null)
			{
				bool enableEdit = object.Equals(Location.Current.LocationID, Location.Current.VPaymentInfoLocationID);
				bool hasPaymentMethod = (row!= null) && (String.IsNullOrEmpty(row.VPaymentMethodID) == false);
				PXUIFieldAttribute.SetEnabled(sender, e.Row, enableEdit);
				PXUIFieldAttribute.SetEnabled<LocationAPPaymentInfo.vCashAccountID>(sender, e.Row, enableEdit && hasPaymentMethod);
			}
		}
开发者ID:PavelMPD,项目名称:SimpleProjects,代码行数:13,代码来源:VendorLocationMaint.cs


示例19: LocationAPAccountSub_RowUpdated

		protected virtual void LocationAPAccountSub_RowUpdated(PXCache sender, PXRowUpdatedEventArgs e)
		{
			LocationAPAccountSub record = (LocationAPAccountSub)e.Row;

			if (!sender.ObjectsEqual<LocationAPAccountSub.vAPAccountID, LocationAPAccountSub.vAPSubID>(e.Row, e.OldRow))
			{
				Location mainloc = Location.Current;
				mainloc.VAPAccountID = record.VAPAccountID;
				mainloc.VAPSubID = record.VAPSubID;

				if (Location.Cache.GetStatus(mainloc) == PXEntryStatus.Notchanged)
				{
					Location.Cache.SetStatus(mainloc, PXEntryStatus.Updated);
				}
			}
		}
开发者ID:PavelMPD,项目名称:SimpleProjects,代码行数:16,代码来源:VendorLocationMaint.cs


示例20: PrepareInsert

		protected override bool PrepareInsert(PXCache sender, object row, PXAccumulatorCollection columns)
		{
			if (!base.PrepareInsert(sender, row, columns))
			{
				return false;
			}

			PMHistory hist = (PMHistory)row;

			columns.RestrictPast<PMHistory.periodID>(PXComp.GE, hist.PeriodID.Substring(0, 4) + "01");
			columns.RestrictFuture<PMHistory.periodID>(PXComp.LE, hist.PeriodID.Substring(0, 4) + "99");

			return true;
		}
开发者ID:PavelMPD,项目名称:SimpleProjects,代码行数:14,代码来源:PMHistory.cs



注:本文中的PXCache类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# PackExpansionType类代码示例发布时间:2022-05-24
下一篇:
C# PValue类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap