コード例 #1
0
        private void FillProcedure()
        {
            if (PaySplitCur.ProcNum == 0)
            {
                textProcDate2.Text       = "";
                textProcProv.Text        = "";
                textProcTooth.Text       = "";
                textProcDescription.Text = "";
                ProcFee               = 0;
                textProcFee.Text      = "";
                ProcInsPaid           = 0;
                textProcInsPaid.Text  = "";
                ProcInsEst            = 0;
                textProcInsEst.Text   = "";
                ProcAdj               = 0;
                textProcAdj.Text      = "";
                ProcPrevPaid          = 0;
                textProcPrevPaid.Text = "";
                ProcPaidHere          = 0;
                textProcPaidHere.Text = "";
                labelProcRemain.Text  = "";
                //butAttach.Enabled=true;
                //butDetach.Enabled=false;
                //ComputeProcTotals();
                return;
            }
            Procedure ProcCur = Procedures.GetOneProc(PaySplitCur.ProcNum, false);

            ClaimProc[]  ClaimProcList  = ClaimProcs.Refresh(ProcCur.PatNum);
            Adjustment[] AdjustmentList = Adjustments.Refresh(ProcCur.PatNum);
            PaySplit[]   PaySplitList   = PaySplits.Refresh(ProcCur.PatNum);
            textProcDate.Text        = ProcCur.ProcDate.ToShortDateString();
            textProcDate2.Text       = ProcCur.ProcDate.ToShortDateString();
            textProcProv.Text        = Providers.GetAbbr(ProcCur.ProvNum);
            textProcTooth.Text       = Tooth.ToInternat(ProcCur.ToothNum);
            textProcDescription.Text = ProcedureCodes.GetProcCode(ProcCur.ADACode).Descript;
            ProcFee     = ProcCur.ProcFee;
            ProcInsPaid = -ClaimProcs.ProcInsPay(ClaimProcList, ProcCur.ProcNum);
            ProcInsEst  = -ClaimProcs.ProcEstNotReceived(ClaimProcList, ProcCur.ProcNum);
            ProcAdj     = Adjustments.GetTotForProc(ProcCur.ProcNum, AdjustmentList);
            //next line will still work even if IsNew
            ProcPrevPaid     = -PaySplits.GetTotForProc(ProcCur.ProcNum, PaySplitList, PaySplitCur.SplitNum);
            textProcFee.Text = ProcFee.ToString("F");
            if (ProcInsPaid == 0)
            {
                textProcInsPaid.Text = "";
            }
            else
            {
                textProcInsPaid.Text = ProcInsPaid.ToString("F");
            }
            if (ProcInsEst == 0)
            {
                textProcInsEst.Text = "";
            }
            else
            {
                textProcInsEst.Text = ProcInsEst.ToString("F");
            }
            if (ProcAdj == 0)
            {
                textProcAdj.Text = "";
            }
            else
            {
                textProcAdj.Text = ProcAdj.ToString("F");
            }
            if (ProcPrevPaid == 0)
            {
                textProcPrevPaid.Text = "";
            }
            else
            {
                textProcPrevPaid.Text = ProcPrevPaid.ToString("F");
            }
            ComputeProcTotals();
            //butAttach.Enabled=false;
            //butDetach.Enabled=true;
        }