当前位置: 首页>>代码示例>>C#>>正文


C# PXCache.GetValue方法代码示例

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


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

示例1: FieldUpdated

			public void FieldUpdated(PXCache sender, PXFieldUpdatedEventArgs e)
			{
				CurrencyInfo info = e.Row as CurrencyInfo;
				if (info != null)
				{
					//reset effective date to document date first
					info.SetDefaultEffDate(sender);
					try
					{
						info.defaultCuryRate(sender);
					}
					catch (PXSetPropertyException ex)
					{
						sender.RaiseExceptionHandling(_FieldName, e.Row, sender.GetValue(e.Row, _FieldOrdinal), ex);
					}
					info.CuryPrecision = null;
				}
			}
开发者ID:PavelMPD,项目名称:SimpleProjects,代码行数:18,代码来源:CurrencyInfo.cs

示例2: AddDiscount

		protected virtual void AddDiscount(PXCache sender, PXRowUpdatedEventArgs e)
		{
            AddDiscountDetails(sender, e);
            
            ARTran discount = (ARTran)Discount.Cache.CreateInstance();
			discount.LineType = SOLineType.Discount;
			discount.DrCr = (Document.Current.DrCr == "D") ? "C" : "D";
			discount.FreezeManualDisc = true;
			discount = (ARTran)Discount.Select() ?? (ARTran)Discount.Cache.Insert(discount);

			ARTran old_row = (ARTran)Discount.Cache.CreateCopy(discount);

			discount.CuryTranAmt = (decimal?)sender.GetValue<SOInvoice.curyDiscTot>(e.Row);
			discount.TaxCategoryID = null;
			discount.TranDesc = PXMessages.LocalizeNoPrefix(Messages.DocDiscDescr);
			
			DefaultDiscountAccountAndSubAccount(discount);

            if (discount.TaskID == null && !PM.ProjectDefaultAttribute.IsNonProject(this, discount.ProjectID))
            {
                PM.PMProject project = PXSelect<PM.PMProject, Where<PM.PMProject.contractID, Equal<Required<PM.PMProject.contractID>>>>.Select(this, discount.ProjectID);
                if (project != null && project.BaseType != "C")
                {
                    PM.PMAccountTask task = PXSelect<PM.PMAccountTask, Where<PM.PMAccountTask.accountID, Equal<Required<PM.PMAccountTask.accountID>>>>.Select(this, discount.AccountID);
                    if (task != null)
                    {
                        discount.TaskID = task.TaskID;
                    }
                    else
                    {
                        Account ac = PXSelect<Account, Where<Account.accountID, Equal<Required<Account.accountID>>>>.Select(this, discount.AccountID);
                        throw new PXException(string.Format(Messages.AccountMappingNotConfigured, project.ContractCD, ac.AccountCD));
                    }
                }
            }
			
			if (Discount.Cache.GetStatus(discount) == PXEntryStatus.Notchanged)
			{
				Discount.Cache.SetStatus(discount, PXEntryStatus.Updated);
			}

			discount.ManualDisc = true; //escape SOManualDiscMode.RowUpdated
			Discount.Cache.RaiseRowUpdated(discount, old_row);

			decimal auotDocDisc = GetAutoDocDiscount();
			if (auotDocDisc == discount.CuryTranAmt)
			{
				discount.ManualDisc = false;
			}
			
			if (discount.CuryTranAmt == 0)
			{
				Discount.Delete(discount);
			}
		}
开发者ID:PavelMPD,项目名称:SimpleProjects,代码行数:55,代码来源:SOInvoiceEntry.cs

示例3: SOInvoice_RowPersisting

		protected virtual void SOInvoice_RowPersisting(PXCache sender, PXRowPersistingEventArgs e)
		{
			if (e.Operation == PXDBOperation.Insert || e.Operation == PXDBOperation.Update)
			{
				SOInvoice doc = (SOInvoice)e.Row;

				if ((doc.DocType == ARDocType.CashSale || doc.DocType == ARDocType.CashReturn))
				{
                    if (String.IsNullOrEmpty(doc.PaymentMethodID) == true)
                    {
                        if (sender.RaiseExceptionHandling<SOInvoice.pMInstanceID>(e.Row, null, new PXSetPropertyException(ErrorMessages.FieldIsEmpty, typeof(SOInvoice.pMInstanceID).Name)))
                        {
                            throw new PXRowPersistingException(typeof(SOInvoice.pMInstanceID).Name, null, ErrorMessages.FieldIsEmpty, typeof(SOInvoice.pMInstanceID).Name);
                        }
                    }
                    else
                    {
                        
                        CA.PaymentMethod pm = PXSelect<CA.PaymentMethod, Where<CA.PaymentMethod.paymentMethodID, Equal<Required<CA.PaymentMethod.paymentMethodID>>>>.Select(this, doc.PaymentMethodID);
                        bool pmInstanceRequired = (pm.IsAccountNumberRequired == true);
                        if (pmInstanceRequired && doc.PMInstanceID == null)
                        {
                            if (sender.RaiseExceptionHandling<SOInvoice.pMInstanceID>(e.Row, null, new PXSetPropertyException(ErrorMessages.FieldIsEmpty, typeof(SOInvoice.pMInstanceID).Name)))
                            {
                                throw new PXRowPersistingException(typeof(SOInvoice.pMInstanceID).Name, null, ErrorMessages.FieldIsEmpty, typeof(SOInvoice.pMInstanceID).Name);
                            }
                        }
                    }
				}

				bool isCashSale = (doc.DocType == AR.ARDocType.CashSale) || (doc.DocType == AR.ARDocType.CashReturn);
                if (isCashSale && SODocument.GetValueExt<SOInvoice.cashAccountID>((SOInvoice)e.Row) == null)
				{
					if (sender.RaiseExceptionHandling<SOInvoice.cashAccountID>(e.Row, null, new PXSetPropertyException(ErrorMessages.FieldIsEmpty, typeof(SOInvoice.cashAccountID).Name)))
					{
						throw new PXRowPersistingException(typeof(SOInvoice.cashAccountID).Name, null, ErrorMessages.FieldIsEmpty, typeof(SOInvoice.cashAccountID).Name);
					}
				}

				object acctcd;

				if ((acctcd = SODocument.GetValueExt<SOInvoice.cashAccountID>((SOInvoice)e.Row)) != null && sender.GetValue<SOInvoice.cashAccountID>(e.Row) == null)
				{
					sender.RaiseExceptionHandling<SOInvoice.cashAccountID>(e.Row, null, null);
					sender.SetValueExt<SOInvoice.cashAccountID>(e.Row, acctcd is PXFieldState ? ((PXFieldState)acctcd).Value : acctcd);
				}

				//if (doc.PMInstanceID != null && string.IsNullOrEmpty(doc.ExtRefNbr))
				//{
				//    if (sender.RaiseExceptionHandling<SOInvoice.extRefNbr>(e.Row, null, new PXSetPropertyException(ErrorMessages.FieldIsEmpty, typeof(SOInvoice.extRefNbr).Name)))
				//    {
				//        throw new PXRowPersistingException(typeof(SOInvoice.extRefNbr).Name, null, ErrorMessages.FieldIsEmpty, typeof(SOInvoice.extRefNbr).Name);
				//    }
				//}
			}
		}
开发者ID:PavelMPD,项目名称:SimpleProjects,代码行数:56,代码来源:SOInvoiceEntry.cs


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