Example #1
0
 private void FormCreditCardEdit_Load(object sender, EventArgs e)
 {
     CreditCardOld = CreditCardCur.Clone();
     FillData();
     if (IsXCharge)             //Get recurring payment plan information if using X-Charge.
     {
         List <PayPlanCharge> chargeList = PayPlanCharges.Refresh(PatCur.PatNum);
         PayPlanList = PayPlans.GetValidPlansNoIns(PatCur.PatNum);
         comboPaymentPlans.Items.Add("None");
         comboPaymentPlans.SelectedIndex = 0;
         for (int i = 0; i < PayPlanList.Count; i++)
         {
             comboPaymentPlans.Items.Add(PayPlans.GetTotalPrinc(PayPlanList[i].PayPlanNum, chargeList).ToString("F")
                                         + "  " + Patients.GetPat(PayPlanList[i].PatNum).GetNameFL());
             if (PayPlanList[i].PayPlanNum == CreditCardCur.PayPlanNum)
             {
                 comboPaymentPlans.SelectedIndex = i + 1;
             }
         }
     }
     else              //This will hide the recurring section and change the window size.
     {
         groupRecurringCharges.Visible = false;
         this.ClientSize = new System.Drawing.Size(this.ClientSize.Width, this.ClientSize.Height - 215);
     }
 }
Example #2
0
        ///<summary>Refreshes the list for the specified guarantor, and then determines if there are any valid plans with that patient as the guarantor.  If more than one valid payment plan, displays list to select from.  If any valid plans, then it returns that plan, else returns null.</summary>
        public static PayPlan GetValidPlan(int guarNum, bool isIns)
        {
            PayPlan[] PlanListAll = Refresh(guarNum, 0);
            PayPlan[] PayPlanList = GetListOneType(PlanListAll, isIns);
            if (PayPlanList.Length == 0)
            {
                return(null);
            }
            if (PayPlanList.Length == 1)           //if there is only one valid payplan
            {
                return(PayPlanList[0].Copy());
            }
            PayPlanCharge[] ChargeList = PayPlanCharges.Refresh(guarNum);
            //enhancement needed to weed out payment plans that are all paid off
            //more than one valid PayPlan
            FormPayPlanSelect FormPPS = new FormPayPlanSelect(PayPlanList, ChargeList);

            FormPPS.ShowDialog();
            if (FormPPS.DialogResult == DialogResult.OK)
            {
                return(PayPlanList[FormPPS.IndexSelected].Copy());
            }
            else
            {
                return(null);
            }
        }
Example #3
0
 private void checkPayPlan_Click(object sender, System.EventArgs e)
 {
     if (checkPayPlan.Checked)
     {
         if (checkPatOtherFam.Checked)                //prevents a bug.
         {
             checkPayPlan.Checked = false;
             return;
         }
         PayPlan[] planListAll = PayPlans.Refresh(FamCur.List[listPatient.SelectedIndex].PatNum, 0);
         PayPlan[] payPlanList = PayPlans.GetListOneType(planListAll, false);
         if (payPlanList.Length == 0)              //no valid plans
         {
             MsgBox.Show(this, "The selected patient is not the guarantor for any payment plans.");
             checkPayPlan.Checked = false;
             return;
         }
         if (payPlanList.Length == 1)               //if there is only one valid payplan
         {
             PaySplitCur.PayPlanNum = payPlanList[0].PayPlanNum;
             return;
         }
         //more than one valid PayPlan
         PayPlanCharge[]   chargeList = PayPlanCharges.Refresh(FamCur.List[listPatient.SelectedIndex].PatNum);
         FormPayPlanSelect FormPPS    = new FormPayPlanSelect(payPlanList, chargeList);
         //FormPPS.ValidPlans=payPlanList;
         FormPPS.ShowDialog();
         if (FormPPS.DialogResult == DialogResult.Cancel)
         {
             checkPayPlan.Checked = false;
             return;
         }
         PaySplitCur.PayPlanNum = payPlanList[FormPPS.IndexSelected].PayPlanNum;
     }
     else             //payPlan unchecked
     {
         PaySplitCur.PayPlanNum = 0;
     }
 }