private void butAdd_Click(object sender, EventArgs e)
        {
            PaySplit PaySplitCur = new PaySplit();

            PaySplitCur.PayNum   = PaymentCur.PayNum;
            PaySplitCur.DatePay  = PIn.PDate(textDate.Text);         //this may be updated upon closing
            PaySplitCur.ProcDate = PIn.PDate(textDate.Text);         //this may be updated upon closing
            if (gridBal.GetSelectedIndex() == -1)
            {
                PaySplitCur.ProvNum = Patients.GetProvNum(PatCur);
            }
            else
            {
                PaySplitCur.ProvNum  = PIn.PInt(tableBalances.Rows[gridBal.GetSelectedIndex()]["ProvNum"].ToString());
                PaySplitCur.SplitAmt = -PIn.PDouble(tableBalances.Rows[gridBal.GetSelectedIndex()]["StartBal"].ToString());
            }
            PaySplitCur.PatNum = PatCur.PatNum;
            FormPaySplitEdit FormPS = new FormPaySplitEdit(FamCur);

            FormPS.PaySplitCur = PaySplitCur;
            FormPS.IsNew       = true;
            double total = 0;

            for (int i = 0; i < SplitList.Count; i++)
            {
                total += SplitList[i].SplitAmt;
            }
            FormPS.Remain = PaymentCur.PayAmt - total;
            if (FormPS.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            SplitList.Add(PaySplitCur);
            FillMain();
        }
        /*private void butAdd_Click(object sender,EventArgs e) {
         *      FormProvIncTransAdd FormP=new FormProvIncTransAdd();
         *      FormP.FamCur=FamCur;
         *      FormP.PayNum=PaymentCur.PayNum;
         *      FormP.PatNum=PatCur.PatNum;
         *      FormP.ShowDialog();
         *      if(FormP.DialogResult!=DialogResult.OK){
         *              return;
         *      }
         *      SplitList.AddRange(FormP.SplitList);
         *      FillMain();
         * }*/

        private void gridMain_CellDoubleClick(object sender, ODGridClickEventArgs e)
        {
            FormPaySplitEdit FormPS = new FormPaySplitEdit(FamCur);

            FormPS.PaySplitCur = SplitList[e.Row];
            double total = 0;

            for (int i = 0; i < SplitList.Count; i++)
            {
                total += SplitList[i].SplitAmt;
            }
            FormPS.Remain = 0 - total + SplitList[e.Row].SplitAmt;
            FormPS.ShowDialog();
            if (FormPS.PaySplitCur == null)           //user deleted
            {
                SplitList.RemoveAt(e.Row);
            }
            FillMain();
        }
Esempio n. 3
0
 private void butAdd_Click(object sender,System.EventArgs e)
 {
     PaySplit PaySplitCur=new PaySplit();
     PaySplitCur.PayNum=PaymentCur.PayNum;
     PaySplitCur.DatePay=PIn.Date(textDate.Text);//this may be updated upon closing
     PaySplitCur.ProcDate=PIn.Date(textDate.Text);//this may be updated upon closing
     PaySplitCur.ProvNum=Patients.GetProvNum(PatCur);
     PaySplitCur.PatNum=PatCur.PatNum;
     PaySplitCur.ClinicNum=PaymentCur.ClinicNum;
     FormPaySplitEdit FormPS=new FormPaySplitEdit(FamCur);
     FormPS.PaySplitCur=PaySplitCur;
     FormPS.IsNew=true;
     FormPS.Remain=PaymentCur.PayAmt-PIn.Double(textTotal.Text);
     if(FormPS.ShowDialog()!=DialogResult.OK) {
         return;
     }
     SplitList.Add(PaySplitCur);
     FillMain();
 }
Esempio n. 4
0
 private void gridMain_CellDoubleClick(object sender,ODGridClickEventArgs e)
 {
     FormPaySplitEdit FormPS=new FormPaySplitEdit(FamCur);
     FormPS.PaySplitCur=SplitList[e.Row];
     FormPS.Remain=PaymentCur.PayAmt-PIn.Double(textTotal.Text)+SplitList[e.Row].SplitAmt;
     FormPS.ShowDialog();
     if(FormPS.PaySplitCur==null) {//user deleted
         SplitList.RemoveAt(e.Row);
     }
     //if(FormPS.ShowDialog()==DialogResult.OK){
     FillMain();
     //}
 }
Esempio n. 5
0
		///<summary>Creates a manual paysplit.</summary>
		private void butAdd_Click(object sender,EventArgs e) {
			PaySplit paySplit=new PaySplit();
			paySplit.SplitAmt=0;
			paySplit.DateEntry=DateTime.Today;
			paySplit.DatePay=DateTime.Today;
			paySplit.PayNum=PaymentCur.PayNum;
			FormPaySplitEdit FormPSE=new FormPaySplitEdit(FamCur);
			FormPSE.PaySplitCur=paySplit;
			if(FormPSE.ShowDialog()==DialogResult.OK) {
				UpdateForManualSplit(paySplit);
			}
		}
Esempio n. 6
0
		///<summary>Allows editing of an individual double clicked paysplit entry.</summary>
		private void gridSplits_CellDoubleClick(object sender,ODGridClickEventArgs e) {
			PaySplit paySplitOld=(PaySplit)gridSplits.Rows[e.Row].Tag;
			PaySplit paySplit=paySplitOld.Copy();
			FormPaySplitEdit FormPSE=new FormPaySplitEdit(FamCur);
			FormPSE.PaySplitCur=paySplit;
			if(FormPSE.ShowDialog()==DialogResult.OK) {//paySplit contains all the info we want.  
				double splitDiff=paySplit.SplitAmt-paySplitOld.SplitAmt;
				//Delete paysplit from paysplit grid, credit the charge it's associated to.  Paysplit may be re-associated with a different charge and we wouldn't know, so we need to do this.
				DeleteSelected();
				if(FormPSE.PaySplitCur==null) {//Deleted the paysplit, just return here.
					FillGridSplits();
					return;
				}
				UpdateForManualSplit(paySplit);
			}
		}