Ejemplo n.º 1
0
 private void FillCur()
 {
     //the first 6 fields are handled when the ScreenGroup is saved.
     ScreenCur.ScreenGroupOrder = PIn.PInt(textScreenGroupOrder.Text);
     ScreenCur.ScreenGroupNum   = ScreenGroupCur.ScreenGroupNum;
     if (radioUnknown.Checked)
     {
         ScreenCur.Gender = PatientGender.Unknown;
     }
     else if (radioM.Checked)
     {
         ScreenCur.Gender = PatientGender.Male;
     }
     else if (radioF.Checked)
     {
         ScreenCur.Gender = PatientGender.Female;
     }
     ScreenCur.Race             = (PatientRace)listRace.SelectedIndex;
     ScreenCur.GradeLevel       = (PatientGrade)comboGradeLevel.SelectedIndex;
     ScreenCur.Age              = PIn.PInt(textAge.Text);//"" is OK
     ScreenCur.Urgency          = (TreatmentUrgency)listUrgency.SelectedIndex;
     ScreenCur.HasCaries        = GetCheckState(checkHasCaries);
     ScreenCur.NeedsSealants    = GetCheckState(checkNeedsSealants);
     ScreenCur.CariesExperience = GetCheckState(checkCariesExperience);
     ScreenCur.EarlyChildCaries = GetCheckState(checkEarlyChildCaries);
     ScreenCur.ExistingSealants = GetCheckState(checkExistingSealants);
     ScreenCur.MissingAllTeeth  = GetCheckState(checkMissingAllTeeth);
     ScreenCur.Birthdate        = PIn.PDate(textBirthdate.Text);   //"" is OK
     ScreenCur.Comments         = textComments.Text;
 }
Ejemplo n.º 2
0
        private static List <PaySplit> RefreshAndFill(string command)
        {
            DataTable       table  = General.GetTable(command);
            List <PaySplit> retVal = new List <PaySplit>();
            PaySplit        split;

            for (int i = 0; i < table.Rows.Count; i++)
            {
                split          = new PaySplit();
                split.SplitNum = PIn.PInt(table.Rows[i][0].ToString());
                split.SplitAmt = PIn.PDouble(table.Rows[i][1].ToString());
                split.PatNum   = PIn.PInt(table.Rows[i][2].ToString());
                split.ProcDate = PIn.PDate(table.Rows[i][3].ToString());
                split.PayNum   = PIn.PInt(table.Rows[i][4].ToString());
                //List[i].IsDiscount  = PIn.PBool  (table.Rows[i][5].ToString());
                //List[i].DiscountType= PIn.PInt   (table.Rows[i][6].ToString());
                split.ProvNum    = PIn.PInt(table.Rows[i][7].ToString());
                split.PayPlanNum = PIn.PInt(table.Rows[i][8].ToString());
                split.DatePay    = PIn.PDate(table.Rows[i][9].ToString());
                split.ProcNum    = PIn.PInt(table.Rows[i][10].ToString());
                split.DateEntry  = PIn.PDate(table.Rows[i][11].ToString());
                retVal.Add(split);
            }
            return(retVal);
        }
        private void butTransfer_Click(object sender, EventArgs e)
        {
            if (gridBal.GetSelectedIndex() == -1)
            {
                MsgBox.Show(this, "Please select a row from the Family Balances grid first.");
                return;
            }
            if (comboProv.SelectedIndex == -1)
            {
                MsgBox.Show(this, "Please select a provider first.");
                return;
            }
            double amt = PIn.PDouble(tableBalances.Rows[gridBal.GetSelectedIndex()]["StartBal"].ToString());
            //From-----------------------------------------------------------------------------------
            PaySplit split = new PaySplit();

            split.PatNum   = PatNum;
            split.PayNum   = PaymentCur.PayNum;
            split.ProcDate = PIn.PDate(textDate.Text);         //this may be updated upon closing
            split.DatePay  = PIn.PDate(textDate.Text);         //this may be updated upon closing
            split.ProvNum  = PIn.PInt(tableBalances.Rows[gridBal.GetSelectedIndex()]["ProvNum"].ToString());
            split.SplitAmt = amt;
            SplitList.Add(split);
            //To-----------------------------------------------------------------------------------
            split          = new PaySplit();
            split.PatNum   = PatNum;
            split.PayNum   = PaymentCur.PayNum;
            split.ProcDate = PIn.PDate(textDate.Text);
            split.DatePay  = PIn.PDate(textDate.Text);
            split.ProvNum  = Providers.List[comboProv.SelectedIndex].ProvNum;
            split.SplitAmt = -amt;
            SplitList.Add(split);
            FillMain();
        }
Ejemplo n.º 4
0
        private void butRight_Click(object sender, System.EventArgs e)
        {
            if (errorProvider1.GetError(textDateFrom) != "" ||
                errorProvider1.GetError(textDateTo) != "")
            {
                MessageBox.Show(Lan.g(this, "Please fix data entry errors first."));
                return;
            }
            DateTime dateFrom = PIn.PDate(textDateFrom.Text);
            DateTime dateTo   = PIn.PDate(textDateTo.Text);

            textDateFrom.Text = dateFrom.AddMonths(-1).ToShortDateString();
            textDateTo.Text   = dateTo.AddMonths(-1).ToShortDateString();
            bool toLastDay = false;

            if (CultureInfo.CurrentCulture.Calendar.GetDaysInMonth(dateTo.Year, dateTo.Month) == dateTo.Day)
            {
                toLastDay = true;
            }
            textDateFrom.Text = dateFrom.AddMonths(1).ToString(Lan.g(this, "MM/dd"));
            textDateTo.Text   = dateTo.AddMonths(1).ToString(Lan.g(this, "MM/dd"));
            if (toLastDay)
            {
                dateTo          = PIn.PDate(textDateTo.Text);
                textDateTo.Text = new DateTime(dateTo.Year, dateTo.Month,
                                               CultureInfo.CurrentCulture.Calendar.GetDaysInMonth(dateTo.Year, dateTo.Month))
                                  .ToString(Lan.g(this, "MM/dd"));
            }
        }
Ejemplo n.º 5
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (textAmount.errorProvider1.GetError(textAmount) != "" ||
         textDatePay.errorProvider1.GetError(textDatePay) != "" ||
         textProcDate.errorProvider1.GetError(textProcDate) != ""
         )
     {
         MessageBox.Show(Lan.g(this, "Please fix data entry errors first."));
         return;
     }
     if (textAmount.Text == "")
     {
         MessageBox.Show(Lan.g(this, "Please enter an amount."));
         return;
     }
     PaySplitCur.DatePay  = PIn.PDate(textDatePay.Text);         //gets overwritten anyway
     PaySplitCur.ProcDate = PIn.PDate(textProcDate.Text);
     PaySplitCur.SplitAmt = PIn.PDouble(textAmount.Text);
     if (listProvider.SelectedIndex != -1)
     {
         PaySplitCur.ProvNum = Providers.List[listProvider.SelectedIndex].ProvNum;
     }
     //if(!checkPatOtherFam.Checked){
     //This is still needed because it might be zero:
     //	PaySplitCur.PatNum=FamCur.List[listPatient.SelectedIndex].PatNum;
     //}
     //PayPlanNum already handled
     //PaySplitCur.InsertOrUpdate(IsNew);
     DialogResult = DialogResult.OK;
 }
Ejemplo n.º 6
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (textDate.errorProvider1.GetError(textDate) != "" ||
         textPrincipal.errorProvider1.GetError(textPrincipal) != "" ||
         textInterest.errorProvider1.GetError(textInterest) != ""
         )
     {
         MessageBox.Show(Lan.g(this, "Please fix data entry errors first."));
         return;
     }
     if (textPrincipal.Text == "")
     {
         textPrincipal.Text = "0";
     }
     if (textInterest.Text == "")
     {
         textInterest.Text = "0";
     }
     //todo: test dates?  The day of the month should be the same as all others
     PayPlanChargeCur.ChargeDate = PIn.PDate(textDate.Text);
     PayPlanChargeCur.Principal  = PIn.PDouble(textPrincipal.Text);
     PayPlanChargeCur.Interest   = PIn.PDouble(textInterest.Text);
     PayPlanChargeCur.Note       = textNote.Text;
     try{
         PayPlanCharges.InsertOrUpdate(PayPlanChargeCur, IsNew);
     }
     catch (ApplicationException ex) {          //even though it doesn't currently throw any exceptions
         MessageBox.Show(ex.Message);
         return;
     }
     DialogResult = DialogResult.OK;
 }
Ejemplo n.º 7
0
        /*
         * ///<summary></summary>
         * public static Document[] GetAllWithPat(int patNum) {
         *      string command="SELECT * FROM document WHERE WithPat="+POut.PInt(patNum);
         *      return RefreshAndFill(command);
         * }*/

        public static Document Fill(DataRow document)
        {
            if (document == null)
            {
                return(null);
            }
            Document doc = new Document();

            doc.DocNum         = PIn.PInt(document[0].ToString());
            doc.Description    = PIn.PString(document[1].ToString());
            doc.DateCreated    = PIn.PDate(document[2].ToString());
            doc.DocCategory    = PIn.PInt(document[3].ToString());
            doc.WithPat        = PIn.PInt(document[4].ToString());
            doc.FileName       = PIn.PString(document[5].ToString());
            doc.ImgType        = (ImageType)PIn.PInt(document[6].ToString());
            doc.IsFlipped      = PIn.PBool(document[7].ToString());
            doc.DegreesRotated = PIn.PInt(document[8].ToString());
            doc.ToothNumbers   = PIn.PString(document[9].ToString());
            doc.Note           = PIn.PString(document[10].ToString());
            doc.SigIsTopaz     = PIn.PBool(document[11].ToString());
            doc.Signature      = PIn.PString(document[12].ToString());
            doc.CropX          = PIn.PInt(document[13].ToString());
            doc.CropY          = PIn.PInt(document[14].ToString());
            doc.CropW          = PIn.PInt(document[15].ToString());
            doc.CropH          = PIn.PInt(document[16].ToString());
            doc.WindowingMin   = PIn.PInt(document[17].ToString());
            doc.WindowingMax   = PIn.PInt(document[18].ToString());
            return(doc);
        }
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (textDate.errorProvider1.GetError(textDate) != "")
     {
         MsgBox.Show(this, "Please fix data entry errors first.");
         return;
     }
     if (listEligibilityCode.SelectedIndex == -1)
     {
         MsgBox.Show(this, "Eligibility Code must be selected.");
         return;
     }
     EligibilityCode = listEligibilityCode.SelectedIndex + 1;
     if (textDate.Text == "")
     {
         AsOfDate = DateTime.Today;
     }
     else
     {
         AsOfDate = PIn.PDate(textDate.Text);
     }
     if (AsOfDate.Year < 1980 || AsOfDate.Year > DateTime.Today.Year + 10)
     {
         MsgBox.Show(this, "Unreasonable date.");
         return;
     }
     DialogResult = DialogResult.OK;
 }
Ejemplo n.º 9
0
        ///<summary>Gets all PayPlanCharges for a guarantor or patient, ordered by date.</summary>
        public static PayPlanCharge[] Refresh(int patNum)
        {
            string command =
                "SELECT * FROM payplancharge "
                + "WHERE Guarantor='" + POut.PInt(patNum) + "' "
                + "OR PatNum='" + POut.PInt(patNum) + "' "
                + "ORDER BY ChargeDate";
            DataTable table = General.GetTable(command);

            PayPlanCharge[] List = new PayPlanCharge[table.Rows.Count];
            for (int i = 0; i < table.Rows.Count; i++)
            {
                List[i] = new PayPlanCharge();
                List[i].PayPlanChargeNum = PIn.PInt(table.Rows[i][0].ToString());
                List[i].PayPlanNum       = PIn.PInt(table.Rows[i][1].ToString());
                List[i].Guarantor        = PIn.PInt(table.Rows[i][2].ToString());
                List[i].PatNum           = PIn.PInt(table.Rows[i][3].ToString());
                List[i].ChargeDate       = PIn.PDate(table.Rows[i][4].ToString());
                List[i].Principal        = PIn.PDouble(table.Rows[i][5].ToString());
                List[i].Interest         = PIn.PDouble(table.Rows[i][6].ToString());
                List[i].Note             = PIn.PString(table.Rows[i][7].ToString());
                List[i].ProvNum          = PIn.PInt(table.Rows[i][8].ToString());
            }
            return(List);
        }
Ejemplo n.º 10
0
 private void FormFinanceCharges_Load(object sender, System.EventArgs e)
 {
     if (PIn.PDate(PrefB.GetString("DateLastAging")) < DateTime.Today)
     {
         if (MsgBox.Show(this, true, "You must update aging first."))              //OK
         {
             FormAging FormA = new FormAging();
             FormA.ShowDialog();
         }
         else
         {
             DialogResult = DialogResult.Cancel;
             return;
         }
     }
     if (PIn.PDate(PrefB.GetString("FinanceChargeLastRun")).AddDays(25) > DateTime.Today)
     {
         MessageBox.Show(Lan.g(this, "You cannot run finance charges again this month."));
         DialogResult = DialogResult.Cancel;
         return;
     }
     textAPR.MaxVal = 100;
     textAPR.MinVal = 0;
     FillList();
     textAPR.Text  = PrefB.GetString("FinanceChargeAPR");
     textDate.Text = DateTime.Today.ToShortDateString();
 }
Ejemplo n.º 11
0
        private static List <Schedule> RefreshAndFill(string command)
        {
            DataTable       table  = General.GetTableEx(command);
            List <Schedule> retVal = new List <Schedule>();
            //Schedule[] List=new Schedule[table.Rows.Count];
            Schedule sched;

            for (int i = 0; i < table.Rows.Count; i++)
            {
                sched              = new Schedule();
                sched.ScheduleNum  = PIn.PInt(table.Rows[i][0].ToString());
                sched.SchedDate    = PIn.PDate(table.Rows[i][1].ToString());
                sched.StartTime    = PIn.PDateT(table.Rows[i][2].ToString());
                sched.StopTime     = PIn.PDateT(table.Rows[i][3].ToString());
                sched.SchedType    = (ScheduleType)PIn.PInt(table.Rows[i][4].ToString());
                sched.ProvNum      = PIn.PInt(table.Rows[i][5].ToString());
                sched.BlockoutType = PIn.PInt(table.Rows[i][6].ToString());
                sched.Note         = PIn.PString(table.Rows[i][7].ToString());
                sched.Status       = (SchedStatus)PIn.PInt(table.Rows[i][8].ToString());
                sched.Op           = PIn.PInt(table.Rows[i][9].ToString());
                sched.EmployeeNum  = PIn.PInt(table.Rows[i][10].ToString());
                retVal.Add(sched);
            }
            return(retVal);
        }
Ejemplo n.º 12
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (Screens.List.Length == 0)
     {
         if (MessageBox.Show("Since you have no items in the list, the screener and location information cannot be saved. Continue?", "", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
         {
             return;
         }
     }
     ScreenGroupCur.SGDate      = PIn.PDate(textScreenDate.Text);
     ScreenGroupCur.Description = textDescription.Text;
     ScreenGroupCur.ProvName    = textProvName.Text;
     ScreenGroupCur.ProvNum     = comboProv.SelectedIndex + 1;    //this works for -1 also.
     if (comboCounty.SelectedIndex == -1)
     {
         ScreenGroupCur.County = "";
     }
     else
     {
         ScreenGroupCur.County = comboCounty.SelectedItem.ToString();
     }
     if (comboGradeSchool.SelectedIndex == -1)
     {
         ScreenGroupCur.GradeSchool = "";
     }
     else
     {
         ScreenGroupCur.GradeSchool = comboGradeSchool.SelectedItem.ToString();
     }
     ScreenGroupCur.PlaceService = (PlaceOfService)comboPlaceService.SelectedIndex;
     ScreenGroups.Update(ScreenGroupCur);
     Screens.UpdateForGroup(ScreenGroupCur);
     DialogResult = DialogResult.OK;
 }
Ejemplo n.º 13
0
        private void gridMain_CellDoubleClick(object sender, ODGridClickEventArgs e)
        {
            int acctNum = PIn.PInt(table.Rows[gridMain.GetSelectedIndex()]["AccountNum"].ToString());

            if (acctNum == 0)
            {
                MsgBox.Show(this, "This account is generated automatically, and there is currently no way to view the detail.  It is the sum of all income minus all expenses for all previous years.");
                return;
            }
            DateTime asofDate;

            if (textDate.errorProvider1.GetError(textDate) != "")            //error
            {
                asofDate = DateTime.Today;
            }
            else
            {
                asofDate = PIn.PDate(textDate.Text);
            }
            Account     acct  = Accounts.GetAccount(acctNum);
            FormJournal FormJ = new FormJournal(acct);

            FormJ.InitialAsOfDate = asofDate;
            FormJ.ShowDialog();
            FillGrid();
            for (int i = 0; i < table.Rows.Count; i++)
            {
                if (table.Rows[i]["AccountNum"].ToString() == acctNum.ToString())
                {
                    gridMain.SetSelected(i, true);
                }
            }
        }
Ejemplo n.º 14
0
        private void butCopyWeek_Click(object sender, EventArgs e)
        {
            if (textDateFrom.errorProvider1.GetError(textDateFrom) != "" ||
                textDateTo.errorProvider1.GetError(textDateTo) != "")
            {
                MsgBox.Show(this, "Please fix errors first.");
                return;
            }
            if (gridMain.SelectedCell.X == -1)
            {
                MsgBox.Show(this, "Please select a date first.");
                return;
            }
            int startI = 1;

            if (checkWeekend.Checked)
            {
                startI = 0;
            }
            DateCopyStart = Schedules.GetDateCal(PIn.PDate(textDateFrom.Text), gridMain.SelectedCell.Y, startI);
            if (checkWeekend.Checked)
            {
                DateCopyEnd = DateCopyStart.AddDays(6);
            }
            else
            {
                DateCopyEnd = DateCopyStart.AddDays(4);
            }
            textClipboard.Text = DateCopyStart.ToShortDateString() + "-" + DateCopyEnd.ToShortDateString();
        }
Ejemplo n.º 15
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (textChargeAmt.errorProvider1.GetError(textChargeAmt) != "" ||
         textDateStart.errorProvider1.GetError(textDateStart) != "" ||
         textDateStop.errorProvider1.GetError(textDateStop) != ""
         )
     {
         MsgBox.Show(this, "Please fix data entry errors first.");
         return;
     }
     if (textDateStart.Text == "")
     {
         MsgBox.Show(this, "Start date cannot be left blank.");
         return;
     }
     if (PIn.PDate(textDateStart.Text) < DateTime.Today.AddMonths(-1))
     {
         MsgBox.Show(this, "Start date cannot be more than a month in the past.  But you can still enter previous charges manually in the account.");
         return;
     }
     RepeatCur.ADACode   = textADACode.Text;
     RepeatCur.ChargeAmt = PIn.PDouble(textChargeAmt.Text);
     RepeatCur.DateStart = PIn.PDate(textDateStart.Text);
     RepeatCur.DateStop  = PIn.PDate(textDateStop.Text);
     RepeatCur.Note      = textNote.Text;
     if (IsNew)
     {
         RepeatCharges.Insert(RepeatCur);
     }
     else
     {
         RepeatCharges.Update(RepeatCur);
     }
     DialogResult = DialogResult.OK;
 }
Ejemplo n.º 16
0
 private bool SaveCur()
 {
     if (textDateTask.errorProvider1.GetError(textDateTask) != ""
         )
     {
         MessageBox.Show(Lan.g(this, "Please fix data entry errors first."));
         return(false);
     }
     Cur.TaskStatus    = checkTaskStatus.Checked;
     Cur.DateTimeEntry = PIn.PDateT(textDateTimeEntry.Text);
     Cur.Descript      = textDescript.Text;
     Cur.DateTask      = PIn.PDate(textDateTask.Text);
     Cur.DateType      = (TaskDateType)listDateType.SelectedIndex;
     if (!checkFromNum.Checked)            //user unchecked the box. Never allowed to check if initially unchecked
     {
         Cur.FromNum = 0;
     }
     //ObjectType already handled
     //Cur.KeyNum already handled
     try{
         Tasks.InsertOrUpdate(Cur, IsNew);
     }
     catch (Exception ex) {
         MessageBox.Show(ex.Message);
         return(false);
     }
     return(true);
 }
Ejemplo n.º 17
0
        ///<summary>Gets all recalls for the supplied patients, usually a family or single pat.  Result might have a length of zero.</summary>
        public static Recall[] GetList(int[] patNums)
        {
            string wherePats = "";

            for (int i = 0; i < patNums.Length; i++)
            {
                if (i != 0)
                {
                    wherePats += " OR ";
                }
                wherePats += "PatNum=" + patNums[i].ToString();
            }
            string command =
                "SELECT * from recall "
                + "WHERE " + wherePats;
            DataTable table = General.GetTable(command);

            Recall[] List = new Recall[table.Rows.Count];
            for (int i = 0; i < List.Length; i++)
            {
                List[i]                = new Recall();
                List[i].RecallNum      = PIn.PInt(table.Rows[i][0].ToString());
                List[i].PatNum         = PIn.PInt(table.Rows[i][1].ToString());
                List[i].DateDueCalc    = PIn.PDate(table.Rows[i][2].ToString());
                List[i].DateDue        = PIn.PDate(table.Rows[i][3].ToString());
                List[i].DatePrevious   = PIn.PDate(table.Rows[i][4].ToString());
                List[i].RecallInterval = new Interval(PIn.PInt(table.Rows[i][5].ToString()));
                List[i].RecallStatus   = PIn.PInt(table.Rows[i][6].ToString());
                List[i].Note           = PIn.PString(table.Rows[i][7].ToString());
                List[i].IsDisabled     = PIn.PBool(table.Rows[i][8].ToString());
            }
            return(List);
        }
Ejemplo n.º 18
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (textDateCalc.errorProvider1.GetError(textDateCalc) != ""
         )
     {
         MsgBox.Show(this, "Please fix data entry errors first.");
         return;
     }
     if (!MsgBox.Show(this, true, "Click OK to update aging."))
     {
         return;
     }
     Cursor = Cursors.WaitCursor;
     Patients.ResetAging();
     int[] allGuarantors = Ledgers.GetAllGuarantors();
     for (int i = 0; i < allGuarantors.Length; i++)
     {
         Ledgers.ComputeAging(allGuarantors[i], PIn.PDate(textDateCalc.Text));
         Patients.UpdateAging(allGuarantors[i], Ledgers.Bal[0], Ledgers.Bal[1], Ledgers.Bal[2]
                              , Ledgers.Bal[3], Ledgers.InsEst, Ledgers.BalTotal);
     }
     if (Prefs.UpdateString("DateLastAging", POut.PDate(DateTime.Today, false)))
     {
         DataValid.SetInvalid(InvalidTypes.Prefs);
     }
     Cursor = Cursors.Default;
     MsgBox.Show(this, "Aging Complete");
     DialogResult = DialogResult.OK;
 }
Ejemplo n.º 19
0
        private void butAdj_Click(object sender, EventArgs e)
        {
            if (!Security.IsAuthorized(Permissions.TimecardsEditAll))
            {
                return;
            }
            TimeAdjust adjust = new TimeAdjust();

            adjust.EmployeeNum = EmployeeCur.EmployeeNum;
            DateTime dateStop = PIn.PDate(textDateStop.Text);

            if (DateTime.Today <= dateStop && DateTime.Today >= PIn.PDate(textDateStart.Text))
            {
                adjust.TimeEntry = DateTime.Now;
            }
            else
            {
                adjust.TimeEntry = new DateTime(dateStop.Year, dateStop.Month, dateStop.Day,
                                                DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second);
            }
            FormTimeAdjustEdit FormT = new FormTimeAdjustEdit(adjust);

            FormT.IsNew = true;
            FormT.ShowDialog();
            if (FormT.DialogResult == DialogResult.Cancel)
            {
                return;
            }
            FillMain(true);
        }
Ejemplo n.º 20
0
        ///<summary>Gets a list of all RepeatCharges for a given patient.  Supply 0 to get a list for all patients.</summary>
        public static RepeatCharge[] Refresh(int patNum)
        {
            string command = "SELECT * FROM repeatcharge";

            if (patNum != 0)
            {
                command += " WHERE PatNum = " + POut.PInt(patNum);
            }
            command += " ORDER BY DateStart";
            DataTable table = General.GetTable(command);

            RepeatCharge[] List = new RepeatCharge[table.Rows.Count];
            for (int i = 0; i < table.Rows.Count; i++)
            {
                List[i] = new RepeatCharge();
                List[i].RepeatChargeNum = PIn.PInt(table.Rows[i][0].ToString());
                List[i].PatNum          = PIn.PInt(table.Rows[i][1].ToString());
                List[i].ProcCode        = PIn.PString(table.Rows[i][2].ToString());
                List[i].ChargeAmt       = PIn.PDouble(table.Rows[i][3].ToString());
                List[i].DateStart       = PIn.PDate(table.Rows[i][4].ToString());
                List[i].DateStop        = PIn.PDate(table.Rows[i][5].ToString());
                List[i].Note            = PIn.PString(table.Rows[i][6].ToString());
            }
            return(List);
        }
Ejemplo n.º 21
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (textDateStart.errorProvider1.GetError(textDateStart) != "" ||
         textDateStop.errorProvider1.GetError(textDateStop) != "" ||
         textDatePaycheck.errorProvider1.GetError(textDatePaycheck) != "")
     {
         MsgBox.Show(this, "Please fix data entry errors first.");
         return;
     }
     if (textDateStart.Text == "" || textDateStop.Text == "")
     {
         MsgBox.Show(this, "Start and end dates are required.");
         return;
     }
     PayPeriodCur.DateStart    = PIn.PDate(textDateStart.Text);
     PayPeriodCur.DateStop     = PIn.PDate(textDateStop.Text);
     PayPeriodCur.DatePaycheck = PIn.PDate(textDatePaycheck.Text);
     if (IsNew)
     {
         PayPeriods.Insert(PayPeriodCur);
     }
     else
     {
         PayPeriods.Update(PayPeriodCur);
     }
     DialogResult = DialogResult.OK;
 }
        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();
        }
Ejemplo n.º 23
0
        ///<summary>Will frequently return null when no canadianClaim saved yet.</summary>
        public static CanadianClaim GetForClaim(int claimNum)
        {
            string    command = "SELECT * FROM canadianclaim WHERE ClaimNum=" + POut.PInt(claimNum);
            DataTable table   = General.GetTable(command);

            if (table.Rows.Count == 0)
            {
                return(null);
            }
            CanadianClaim retVal = new CanadianClaim();

            retVal.ClaimNum            = claimNum;
            retVal.MaterialsForwarded  = PIn.PString(table.Rows[0][1].ToString());
            retVal.ReferralProviderNum = PIn.PString(table.Rows[0][2].ToString());
            retVal.ReferralReason      = PIn.PInt(table.Rows[0][3].ToString());
            //retVal.CardSequenceNumber =PIn.PInt   (table.Rows[0][4].ToString());
            retVal.SecondaryCoverage  = PIn.PString(table.Rows[0][4].ToString());
            retVal.IsInitialLower     = PIn.PString(table.Rows[0][5].ToString());
            retVal.DateInitialLower   = PIn.PDate(table.Rows[0][6].ToString());
            retVal.MandProsthMaterial = PIn.PInt(table.Rows[0][7].ToString());
            retVal.IsInitialUpper     = PIn.PString(table.Rows[0][8].ToString());
            retVal.DateInitialUpper   = PIn.PDate(table.Rows[0][9].ToString());
            retVal.MaxProsthMaterial  = PIn.PInt(table.Rows[0][10].ToString());
            retVal.EligibilityCode    = PIn.PInt(table.Rows[0][11].ToString());
            retVal.SchoolName         = PIn.PString(table.Rows[0][12].ToString());
            retVal.PayeeCode          = PIn.PInt(table.Rows[0][13].ToString());
            return(retVal);
        }
Ejemplo n.º 24
0
 ///<summary>Surround with try-catch.</summary>
 private void SaveData()
 {
     if (textOrder.errorProvider1.GetError(textOrder) != "" ||
         textRefDate.errorProvider1.GetError(textRefDate) != "")
     {
         throw new ApplicationException(Lan.g(this, "Please fix data entry errors first."));
     }
     if (radioFrom.Checked)
     {
         RefAttachCur.IsFrom = true;
     }
     else
     {
         RefAttachCur.IsFrom = false;
     }
     RefAttachCur.RefDate     = PIn.PDate(textRefDate.Text);
     RefAttachCur.ItemOrder   = PIn.PInt(textOrder.Text);
     RefAttachCur.RefToStatus = (ReferralToStatus)comboRefToStatus.SelectedIndex;
     RefAttachCur.Note        = textNote.Text;
     if (IsNew)
     {
         RefAttaches.Insert(RefAttachCur);
     }
     else
     {
         RefAttaches.Update(RefAttachCur);
     }
 }
Ejemplo n.º 25
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (textDateTL.errorProvider1.GetError(textDateTL) != ""
         )
     {
         MessageBox.Show(Lan.g(this, "Please fix data entry errors first."));
         return;
     }
     Cur.Descript = textDescript.Text;
     Cur.DateTL   = PIn.PDate(textDateTL.Text);
     Cur.DateType = (TaskDateType)listDateType.SelectedIndex;
     if (!checkFromNum.Checked)            //user unchecked the box
     {
         Cur.FromNum = 0;
     }
     Cur.ObjectType = (TaskObjectType)listObjectType.SelectedIndex;
     try{
         TaskLists.InsertOrUpdate(Cur, IsNew);
     }
     catch (Exception ex) {
         MessageBox.Show(ex.Message);
         return;
     }
     DialogResult = DialogResult.OK;
 }
Ejemplo n.º 26
0
 private bool SaveRx()
 {
     if (textDate.errorProvider1.GetError(textDate) != ""
         //|| textAmount.errorProvider1.GetError(textAmount)!=""
         )
     {
         MessageBox.Show(Lan.g(this, "Please fix data entry errors first."));
         return(false);
     }
     if (listProv.SelectedIndex != -1)
     {
         RxPatCur.ProvNum = Providers.List[listProv.SelectedIndex].ProvNum;
     }
     RxPatCur.RxDate  = PIn.PDate(textDate.Text);
     RxPatCur.Drug    = textDrug.Text;
     RxPatCur.Sig     = textSig.Text;
     RxPatCur.Disp    = textDisp.Text;
     RxPatCur.Refills = textRefills.Text;
     RxPatCur.Notes   = textNotes.Text;
     if (IsNew)
     {
         RxPats.Insert(RxPatCur);
         //SecurityLogs.MakeLogEntry("Prescription Create",RxPats.cmd.CommandText,user);
     }
     else
     {
         RxPats.Update(RxPatCur);
         //SecurityLogs.MakeLogEntry("Prescription Edit",RxPats.cmd.CommandText,user);
     }
     return(true);
 }
Ejemplo n.º 27
0
        private void butOK_Click(object sender, System.EventArgs e)
        {
            if (textDate.errorProvider1.GetError(textDate) != "" ||
                textAPR.errorProvider1.GetError(textAPR) != "")
            {
                MessageBox.Show(Lan.g(this, "Please fix data entry errors first."));
                return;
            }

            if (PIn.PInt(textAPR.Text) < 2)
            {
                if (MessageBox.Show(Lan.g(this, "The APR is much lower than normal. Do you wish to proceed?"), "", MessageBoxButtons.OKCancel) != DialogResult.OK)
                {
                    return;
                }
            }
            //Patients.ResetAging();
            //Ledgers.UpdateFinanceCharges(PIn.PDate(textDate.Text));
            PatAging[] AgingList = Patients.GetAgingList();
            double     OverallBalance;

            for (int i = 0; i < AgingList.Length; i++)
            {
                OverallBalance = 0;              //this WILL NOT be the same as the patient's total balance
                if (radio30.Checked)
                {
                    OverallBalance = AgingList[i].Bal_31_60 + AgingList[i].Bal_61_90 + AgingList[i].BalOver90;
                }
                if (radio60.Checked)
                {
                    OverallBalance = AgingList[i].Bal_61_90 + AgingList[i].BalOver90;
                }
                if (radio90.Checked)
                {
                    OverallBalance = AgingList[i].BalOver90;
                }
                if (OverallBalance > 0)
                {
                    Adjustment AdjustmentCur = new Adjustment();
                    AdjustmentCur.PatNum = AgingList[i].PatNum;
                    //AdjustmentCur.DateEntry=PIn.PDate(textDate.Text);//automatically handled
                    AdjustmentCur.AdjDate  = PIn.PDate(textDate.Text);
                    AdjustmentCur.ProcDate = PIn.PDate(textDate.Text);
                    AdjustmentCur.AdjType  = DefB.Short[(int)DefCat.AdjTypes]
                                             [(int)ALPosIndices[listAdjType.SelectedIndex]].DefNum;
                    AdjustmentCur.AdjNote = "Finance Charge";
                    AdjustmentCur.AdjAmt  = Math.Round(((PIn.PDouble(textAPR.Text) * .01 / 12) * OverallBalance), 2);
                    AdjustmentCur.ProvNum = AgingList[i].PriProv;
                    Adjustments.InsertOrUpdate(AdjustmentCur, true);
                }
            }
            Prefs.UpdateString("FinanceChargeAPR", textAPR.Text);
            Prefs.UpdateInt("FinanceChargeAdjustmentType",
                            DefB.Short[(int)DefCat.AdjTypes][(int)ALPosIndices[listAdjType.SelectedIndex]].DefNum);
            Prefs.UpdateString("FinanceChargeLastRun", POut.PDate(DateTime.Today, false));
            DataValid.SetInvalid(InvalidTypes.Prefs);
            MessageBox.Show(Lan.g(this, "Finance Charges Added."));
            DialogResult = DialogResult.OK;
        }
Ejemplo n.º 28
0
        private void butOK_Click(object sender, System.EventArgs e)
        {
            if (textDate.errorProvider1.GetError(textDate) != ""
                )
            {
                MessageBox.Show(Lan.g(this, "Please fix data entry errors first."));
                return;
            }
            if (tb2.SelectedIndices.Length == 0)
            {
                MessageBox.Show(Lan.g(this, "At least one item must be selected, or use the delete button."));
                return;
            }
            if (comboClinic.SelectedIndex == 0)
            {
                ClaimPaymentCur.ClinicNum = 0;
            }
            else
            {
                ClaimPaymentCur.ClinicNum = Clinics.List[comboClinic.SelectedIndex - 1].ClinicNum;
            }
            ClaimPaymentCur.CheckAmt    = PIn.PDouble(textAmount.Text);
            ClaimPaymentCur.CheckDate   = PIn.PDate(textDate.Text);
            ClaimPaymentCur.CheckNum    = textCheckNum.Text;
            ClaimPaymentCur.BankBranch  = textBankBranch.Text;
            ClaimPaymentCur.CarrierName = textCarrierName.Text;
            ClaimPaymentCur.Note        = textNote.Text;
            try{
                ClaimPayments.Update(ClaimPaymentCur);                //error thrown if trying to change amount and already attached to a deposit.
            }
            catch (ApplicationException ex) {
                MessageBox.Show(ex.Message);
                return;
            }
            //this could be optimized to only save changes.
            //Would require a starting AL to compare to.
            //But this isn't bad, since changes all saved at the very end
            ArrayList ALselected = new ArrayList();

            for (int i = 0; i < tb2.SelectedIndices.Length; i++)
            {
                ALselected.Add(tb2.SelectedIndices[i]);
            }
            for (int i = 0; i < splits.Length; i++)
            {
                if (ALselected.Contains(i))                //row is selected
                {
                    ClaimProcs.SetForClaim(splits[i].ClaimNum, ClaimPaymentCur.ClaimPaymentNum,
                                           ClaimPaymentCur.CheckDate, true);
                }
                else                 //row not selected
                {
                    ClaimProcs.SetForClaim(splits[i].ClaimNum, ClaimPaymentCur.ClaimPaymentNum,
                                           ClaimPaymentCur.CheckDate, false);
                }
            }
            DialogResult = DialogResult.OK;
        }
Ejemplo n.º 29
0
        private void butDelete_Click(object sender, EventArgs e)
        {
            if (textDateFrom.errorProvider1.GetError(textDateFrom) != "" ||
                textDateTo.errorProvider1.GetError(textDateTo) != "")
            {
                MsgBox.Show(this, "Please fix errors first.");
                return;
            }
            if (gridMain.SelectedCell.X == -1)
            {
                MsgBox.Show(this, "Please select a date first.");
                return;
            }
            if (ProvsChanged)
            {
                MsgBox.Show(this, "Provider or Employee selection has been changed.  Please refresh first.");
                return;
            }
            if (!MsgBox.Show(this, true, "Delete all displayed entries for the entire selected week?"))
            {
                return;
            }
            int startI = 1;

            if (checkWeekend.Checked)
            {
                startI = 0;
            }
            DateTime dateSelectedStart = Schedules.GetDateCal(PIn.PDate(textDateFrom.Text), gridMain.SelectedCell.Y, startI);
            DateTime dateSelectedEnd;

            if (checkWeekend.Checked)
            {
                dateSelectedEnd = dateSelectedStart.AddDays(6);
            }
            else
            {
                dateSelectedEnd = dateSelectedStart.AddDays(4);
            }
            List <int> provNums = new List <int>();

            for (int i = 0; i < listProv.SelectedIndices.Count; i++)
            {
                provNums.Add(Providers.List[listProv.SelectedIndices[i]].ProvNum);
            }
            List <int> empNums = new List <int>();

            for (int i = 0; i < listEmp.SelectedIndices.Count; i++)
            {
                empNums.Add(Employees.ListShort[listEmp.SelectedIndices[i]].EmployeeNum);
            }
            Schedules.Clear(dateSelectedStart, dateSelectedEnd, provNums.ToArray(), empNums.ToArray(), checkPractice.Checked);
            FillGrid();
            changed = true;
        }
Ejemplo n.º 30
0
        private void FillMain()
        {
            DateTime dateFrom = PIn.PDate(textDateFrom.Text);
            DateTime dateTo   = PIn.PDate(textDateTo.Text);

            table = Appointments.GetConfirmList(dateFrom, dateTo);
            int scrollVal = grid.ScrollValue;

            grid.BeginUpdate();
            grid.Columns.Clear();
            ODGridColumn col = new ODGridColumn(Lan.g("TableConfirmList", "Date Time"), 70);

            grid.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableConfirmList", "Patient"), 80);
            grid.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableConfirmList", "Age"), 30);
            grid.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableConfirmList", "Contact"), 150);
            grid.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableConfirmList", "Addr/Ph Note"), 100);
            grid.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableConfirmList", "Status"), 80);        //confirmed
            grid.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableConfirmList", "Procs"), 110);
            grid.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableConfirmList", "Medical"), 80);
            grid.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableConfirmList", "Appt Note"), 204);
            grid.Columns.Add(col);
            grid.Rows.Clear();
            ODGridRow  row;
            ODGridCell cell;

            for (int i = 0; i < table.Rows.Count; i++)
            {
                row = new ODGridRow();
                //aptDateTime=PIn.PDateT(table.Rows[i][4].ToString());
                row.Cells.Add(table.Rows[i]["aptDateTime"].ToString());
                //aptDateTime.ToShortDateString()+"\r\n"+aptDateTime.ToShortTimeString());
                row.Cells.Add(table.Rows[i]["patientName"].ToString());
                row.Cells.Add(table.Rows[i]["age"].ToString());
                row.Cells.Add(table.Rows[i]["contactMethod"].ToString());
                row.Cells.Add(table.Rows[i]["AddrNote"].ToString());
                row.Cells.Add(table.Rows[i]["confirmed"].ToString());
                row.Cells.Add(table.Rows[i]["ProcDescript"].ToString());
                cell           = new ODGridCell(table.Rows[i]["medNotes"].ToString());
                cell.ColorText = Color.Red;
                row.Cells.Add(cell);
                row.Cells.Add(table.Rows[i]["Note"].ToString());
                grid.Rows.Add(row);
            }
            grid.EndUpdate();
            grid.ScrollValue = scrollVal;
        }