Exemple #1
0
        public PaymentAdviceView ConvertPaymentAdvice(PaymentAdvice input)
        {
            PaymentAdviceView output = new PaymentAdviceView();

            output.ClassFees = new ArrayList();

            foreach (ClassFee objCF in input.ClassFees.Values)
            {
                ClassFeeView newCF =
                    ConvertClassFee(objCF);

                output.ClassFees.Add(newCF);
            }

            output.Id = input.Id;
            output.IdLockHolder = input.IdLockHolder;
            output.IdPaymentAdviceList  = input.IdPaymentAdviceList;
            output.IsExcluded = (input.IsExcluded==1);
            output.IsFrozen = (input.IsFrozen==1);
            output.IsLocked = input.IsLocked;

            if (input.IdLockHolder != null)
            {
                output.LockHolderName = input.GetLockHolder().UserName;
            }

            output.OtherFees = new ArrayList();

            foreach (OtherFee objOF in input.OtherFees.Values)
            {
                OtherFeeView newOF =
                    ConvertOtherFee(objOF);

                output.OtherFees.Add(newOF);
            }

            output.Student =
                ConvertStudent(input.GetAssociatedStudent());

            return output;
        }
        public void UpdatePaymentAdvice(PaymentAdviceView obj)
        {
            //SECURITY CHECK HERE

            if (_CurrentPaymentAdvice == null)
                throw new ApasInvaidOperationException(
                    "Invalid Operation: Select a payment advice before updating its properties");

            CurrentPaymentAdvice.IsExcluded = obj.IsExcluded ? 1 : 0;
            CurrentPaymentAdvice.IsFrozen = obj.IsFrozen ? 1 : 0;

            CurrentPaymentAdvice.LastAction = "Edit PaymentAdvice";
            CurrentPaymentAdvice.LastModifiedBy =
                ApasAccessControlManager.GetCurrentInstance().LogonUser.Id;
            CurrentPaymentAdvice.LastModifiedTime = DateTime.Now;
            CurrentPaymentAdvice.Save();
        }
 public PaymentAdviceView UpdatePaymentAdvice(PaymentAdviceView obj, string lockKey)
 {
     PaymentAdviceManager pMgr = new PaymentAdviceManager(obj.Id, lockKey);
         pMgr.UpdatePaymentAdvice(obj);
         return pMgr.GetCurrentPaymentAdvice();
 }