"景先生毕设|www.jxszl.com

C# AllocationType类代码示例

2023-12-29 17:03编辑: www.jxszl.com景先生毕设
本文整理汇总了C#中AllocationType类的典型用法代码示例。如果您正苦于以下问题:C#AllocationType类的具体用法?C#AllocationType怎么用?C#AllocationType使用的例子?这里精选的类代码示例或许可以为您提供帮助。 示例1:AddAllocation /// ///Addallocationstothecurrenttransaction /// /// ///3-characterFIDcodeidentifyingyourmerchantactivity.TheseareassignedbyInternalControl. /// /// ///1-characterchartcodeoftheaccounttowhichyouwanttoallocatethecredittransaction. /// /// ///7-characteraccountnumbertowhichyouwanttoallocatethecredittransaction. /// ///Optional ///Optional /// ///Usedbygifttransactionstodirectthegeneratedgiftdocumenttoaparticularperson. ///Ifthisvalueisnotpassed(orisnotvalid)thenthegiftdocumentwillbegenerated ///totheinboxofthepersonsetupasthedefaultontheserver. ///ThisvalueshouldbetheUCDLoginIDofthedesiredrecipientinuppercase. /// /// ///Theamountorpercenttoallocatetothisallocation /// /// ///Thetypeofallocation--eitherpercentor$amount /// publicvoidAddAllocation(stringfid,stringchart,stringaccount,stringsubAccount,stringproject,stringgiftNotificationId,doubleallocationValue,AllocationTypeallocationType) { varallocation=newallocRequestTransactionAllocation { fid=fid, chart=chart, account=account, subAccount=subAccount, project=project, giftNotificationId=giftNotificationId }; switch(allocationType) { caseAllocationType.Amount: allocation.amount=allocationValue; allocation.amountSpecified=true; break; caseAllocationType.Percent: allocation.percent=allocationValue; allocation.percentSpecified=true; break; default: thrownewArgumentOutOfRangeException("allocationType"); } //Nowwehaveanallocation,addittotheallocationcollection Allocations.Add(allocation); }
原文链接:http://www.jxszl.com/biancheng/C/556515.html