예제 #1
0
        /// <summary>
        /// Constructor to create "new" OtherFee
        /// </summary>
        /// <param name="parentPA">Parent PaymentAdvice</param>
        /// <param name="type">Type of otherfee</param>
        public OtherFee(PaymentAdvice parentPA, OtherFeeType type)
        {
            if (parentPA == null)
                throw new ApasInvaidOperationException(
                    "Invalid Operation: Unable to create a OtherFee. "+
                    "Parent Paymentadivce cannot be null.");

            if(type==null)
                throw new ApasInvaidOperationException(
                    "Invalid Operation: Unable to create a OtherFee. "+
                    "OtherFeeType cannot be null");

            OtherFeeType = type;

            Amount = 0;
            PayableFee = 0;
            PrivateRemark = null;
            PublicRemark = null;
            PaymentAdviceText = null;
            IsRecurring = 0;
            IsExcluded = 0;
            IsPaid = 0;

            FeeDeviations = new Dictionary<int, FeeDeviationPayableFee>();

            parentPA.AddOtherFee(this);
        }
예제 #2
0
        public void AddOtherFee(long typeId)
        {
            if (CurrentPaymentAdvice == null)
                throw new ApasInvaidOperationException(
                    "Invalid Operation: No payment advice is selected.");

            //SECURITY CHECK HERE. Lock check here
            OtherFeeType objOFT = new OtherFeeType(typeId);
            OtherFee objOF = new OtherFee(CurrentPaymentAdvice, objOFT);

            objOF.Save();

            //log
            CurrentPaymentAdvice.LastAction = "Add OtherFee";
            CurrentPaymentAdvice.LastModifiedBy =
                ApasAccessControlManager.GetCurrentInstance().LogonUser.Id;
            CurrentPaymentAdvice.LastModifiedTime = DateTime.Now;

            CurrentPaymentAdvice.Save();
        }
예제 #3
0
        public void AddOtherFee(string typeName)
        {
            if (CurrentPaymentAdvice == null)
                throw new ApasInvaidOperationException(
                    "Invalid Operation: No payment advice is selected.");

            //SECURITY CHECK HERE. Lock check here

            OtherFeeType objOFT;

            IList<OtherFeeType> sList =
                OtherFeeType.FindByName(typeName);

            if (sList.Count == 0)
            {
                //not exists yet. create.
                objOFT = new OtherFeeType(typeName);
                objOFT.Save();
            }
            else
            {
                objOFT = sList[0];
            }

            OtherFee objOF = new OtherFee(CurrentPaymentAdvice, objOFT);

            objOF.Save();

            //log
            CurrentPaymentAdvice.LastAction = "Add OtherFee";
            CurrentPaymentAdvice.LastModifiedBy =
                ApasAccessControlManager.GetCurrentInstance().LogonUser.Id;
            CurrentPaymentAdvice.LastModifiedTime = DateTime.Now;

            CurrentPaymentAdvice.Save();
        }