Пример #1
0
        ///<summary>Will delete all PayPlanCharges associated to the passed-in procNum from the database.  Does nothing if the procNum = 0.</summary>
        public static void DeleteForProc(long procNum)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetVoid(MethodBase.GetCurrentMethod(), procNum);
                return;
            }
            if (procNum == 0)
            {
                return;
            }
            List <PayPlan> listPayPlans = PayPlans.GetAllForCharges(GetFromProc(procNum));
            string         command      = "DELETE FROM payplancharge WHERE ProcNum=" + POut.Long(procNum);

            Db.NonQ(command);
            PayPlans.UpdateTreatmentCompletedAmt(listPayPlans);
        }
Пример #2
0
        ///<summary>Takes a procNum and updates all of the dates of the payment plan charge credits associated to it.
        ///If a completed procedure is passed in, it will update all of the payment plan charges associated to it to the ProcDate.
        ///If a non-complete procedure is passed in, it will update the charges associated to MaxValue.
        ///Does nothing if there are no charges attached to the passed-in procedure.</summary>
        public static void UpdateAttachedPayPlanCharges(Procedure proc)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetVoid(MethodBase.GetCurrentMethod(), proc);
                return;
            }
            List <PayPlanCharge> listCharges = GetFromProc(proc.ProcNum);

            foreach (PayPlanCharge chargeCur in listCharges)
            {
                chargeCur.ChargeDate = DateTime.MaxValue;
                if (proc.ProcStatus == ProcStat.C)
                {
                    chargeCur.ChargeDate = proc.ProcDate;
                }
                Update(chargeCur);                 //one update statement for each payplancharge.
            }
            List <PayPlan> listPayPlans = PayPlans.GetAllForCharges(listCharges);

            PayPlans.UpdateTreatmentCompletedAmt(listPayPlans);
        }