本文整理汇总了C#中PXCache.SetValueExt方法的典型用法代码示例。如果您正苦于以下问题:C# PXCache.SetValueExt方法的具体用法?C# PXCache.SetValueExt怎么用?C# PXCache.SetValueExt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PXCache
的用法示例。
在下文中一共展示了PXCache.SetValueExt方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ARInvoice_RowUpdated
protected override void ARInvoice_RowUpdated(PXCache sender, PXRowUpdatedEventArgs e)
{
ARSetup.Current.RequireControlTotal = (((ARInvoice)e.Row).DocType == ARDocType.CashSale || ((ARInvoice)e.Row).DocType == ARDocType.CashReturn) ? true : ARSetup.Current.RequireControlTotal;
base.ARInvoice_RowUpdated(sender, e);
ARInvoice doc = e.Row as ARInvoice;
if ((doc.DocType == ARDocType.CashSale || doc.DocType == ARDocType.CashReturn) && doc.Released != true)
{
if (sender.ObjectsEqual<ARInvoice.curyDocBal, ARInvoice.curyOrigDiscAmt>(e.Row, e.OldRow) == false && doc.CuryDocBal - doc.CuryOrigDiscAmt != doc.CuryOrigDocAmt)
{
if (doc.CuryDocBal != null && doc.CuryOrigDiscAmt != null && doc.CuryDocBal != 0)
sender.SetValueExt<ARInvoice.curyOrigDocAmt>(doc, doc.CuryDocBal - doc.CuryOrigDiscAmt);
else
sender.SetValueExt<ARInvoice.curyOrigDocAmt>(doc, 0m);
}
else if (sender.ObjectsEqual<ARInvoice.curyOrigDocAmt>(e.Row, e.OldRow) == false)
{
if (doc.CuryDocBal != null && doc.CuryOrigDocAmt != null && doc.CuryDocBal != 0)
sender.SetValueExt<ARInvoice.curyOrigDiscAmt>(doc, doc.CuryDocBal - doc.CuryOrigDocAmt);
else
sender.SetValueExt<ARInvoice.curyOrigDiscAmt>(doc, 0m);
}
}
if ((doc.DocType == ARDocType.CashSale || doc.DocType == ARDocType.CashReturn) && doc.Released != true && doc.Hold != true)
{
if (doc.CuryDocBal < doc.CuryOrigDocAmt)
{
sender.RaiseExceptionHandling<ARInvoice.curyOrigDocAmt>(doc, doc.CuryOrigDocAmt, new PXSetPropertyException(AR.Messages.CashSaleOutOfBalance));
}
else
{
sender.RaiseExceptionHandling<ARInvoice.curyOrigDocAmt>(doc, doc.CuryOrigDocAmt, null);
}
}
if (!sender.ObjectsEqual<ARInvoice.customerID, ARInvoice.docDate, ARInvoice.finPeriodID, ARInvoice.curyTaxTotal, ARInvoice.curyOrigDocAmt, ARInvoice.docDesc, ARInvoice.curyOrigDiscAmt>(e.Row, e.OldRow))
{
SODocument.Current = (SOInvoice)SODocument.Select() ?? (SOInvoice)SODocument.Cache.Insert();
SODocument.Current.CustomerID = ((ARInvoice)e.Row).CustomerID;
if ((((ARInvoice)e.Row).DocType == ARDocType.CashSale
|| ((ARInvoice)e.Row).DocType == ARDocType.CashReturn
|| ((ARInvoice)e.Row).DocType == ARDocType.Invoice) && !sender.ObjectsEqual<ARInvoice.customerID>(e.Row, e.OldRow))
{
SODocument.Cache.SetDefaultExt<SOInvoice.paymentMethodID>(SODocument.Current);
SODocument.Cache.SetDefaultExt<SOInvoice.pMInstanceID>(SODocument.Current);
}
SODocument.Current.AdjDate = ((ARInvoice)e.Row).DocDate;
SODocument.Current.AdjFinPeriodID = ((ARInvoice)e.Row).FinPeriodID;
SODocument.Current.AdjTranPeriodID = ((ARInvoice)e.Row).TranPeriodID;
SODocument.Current.CuryTaxTotal = ((ARInvoice)e.Row).CuryTaxTotal;
SODocument.Current.TaxTotal = ((ARInvoice)e.Row).TaxTotal;
SODocument.Current.CuryPaymentAmt = ((ARInvoice)e.Row).CuryOrigDocAmt - ((ARInvoice)e.Row).CuryOrigDiscAmt - SODocument.Current.CuryPaymentTotal;
SODocument.Current.DocDesc = ((ARInvoice)e.Row).DocDesc;
SODocument.Current.PaymentProjectID = PM.ProjectDefaultAttribute.NonProject(this);
if (SODocument.Cache.GetStatus(SODocument.Current) == PXEntryStatus.Notchanged)
{
SODocument.Cache.SetStatus(SODocument.Current, PXEntryStatus.Updated);
}
}
}
示例2: 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);
// }
//}
}
}
示例3: ARTran_Qty_FieldUpdated
protected override void ARTran_Qty_FieldUpdated(PXCache sender, PXFieldUpdatedEventArgs e)
{
base.ARTran_Qty_FieldUpdated(sender, e);
ARTran row = e.Row as ARTran;
if (row != null)
{
sender.SetDefaultExt<ARTran.tranDate>(row);
sender.SetValueExt<ARTran.manualDisc>(row, false);
if (row != null && row.InventoryID != null && row.UOM != null && row.IsFree != true)
{
string customerPriceClass = ARPriceClass.EmptyPriceClass;
Location c = location.Select();
if (c != null && !string.IsNullOrEmpty(c.CPriceClassID))
customerPriceClass = c.CPriceClassID;
DateTime date = Document.Current.DocDate.Value;
if (row.TranType == ARDocType.CreditMemo && row.OrigInvoiceDate != null)
{
date = row.OrigInvoiceDate.Value;
}
decimal? price = ARSalesPriceMaint.CalculateSalesPrice(sender, customerPriceClass, row.CustomerID, row.InventoryID, currencyinfo.Select(), row.UOM, row.Qty, date, row.CuryUnitPrice);
if (price != null)
sender.SetValueExt<ARTran.curyUnitPrice>(e.Row, price);
}
}
}
示例4: SOInvoice_PMInstanceID_FieldUpdated
protected virtual void SOInvoice_PMInstanceID_FieldUpdated(PXCache sender, PXFieldUpdatedEventArgs e)
{
//sender.SetDefaultExt<SOInvoice.paymentMethodID>(e.Row);
sender.SetDefaultExt<SOInvoice.cashAccountID>(e.Row);
sender.SetDefaultExt<SOInvoice.isCCCaptureFailed>(e.Row);
sender.SetValueExt<SOInvoice.refTranExtNbr>(e.Row, null);
}