///<summary></summary>
 public void PrintReport()
 {
     pd2            = new PrintDocument();
     pd2.PrintPage += new PrintPageEventHandler(this.pd2_PrintPage);
     pd2.DefaultPageSettings.Margins = new Margins(0, 0, 0, 0);
     pd2.OriginAtMargins             = true;
     if (!PrefB.GetBool("RxOrientVert"))
     {
         pd2.DefaultPageSettings.Landscape = true;
     }
                 #if DEBUG
     pd2.DefaultPageSettings.PaperSize   = new PaperSize("default", 850, 1100);
     pView.printPreviewControl2.Document = pd2;
     pView.ShowDialog();
                 #else
     if (!Printers.SetPrinter(pd2, PrintSituation.Rx))
     {
         return;
     }
     try{
         pd2.Print();
     }
     catch {
         MessageBox.Show(Lan.g(this, "Printer not available"));
     }
                 #endif
 }
 private void FormSecurity_Load(object sender, System.EventArgs e)
 {
     comboUsers.Items.Add(Lan.g(this, "All Users"));
     comboUsers.Items.Add(Lan.g(this, "Providers"));
     comboUsers.Items.Add(Lan.g(this, "Employees"));
     comboUsers.Items.Add(Lan.g(this, "Other"));
     comboUsers.SelectedIndex = 0;
     if (PrefB.GetBool("EasyHideDentalSchools"))
     {
         comboSchoolClass.Visible = false;
         labelSchoolClass.Visible = false;
     }
     else
     {
         comboSchoolClass.Items.Add(Lan.g(this, "All"));
         comboSchoolClass.SelectedIndex = 0;
         for (int i = 0; i < SchoolClasses.List.Length; i++)
         {
             comboSchoolClass.Items.Add(SchoolClasses.GetDescript(SchoolClasses.List[i]));
         }
     }
     FillTreePermissionsInitial();
     FillUsers();
     FillTreePerm();
     checkTimecardSecurityEnabled.Checked = PrefB.GetBool("TimecardSecurityEnabled");
 }
Exemple #3
0
 private void FormSecurity_Load(object sender, System.EventArgs e)
 {
     FillTreePermissionsInitial();
     FillTreeUsers();
     FillTreePerm();
     checkTimecardSecurityEnabled.Checked = PrefB.GetBool("TimecardSecurityEnabled");
 }
Exemple #4
0
 private void FormProviderSelect_Load(object sender, System.EventArgs e)
 {
     if (!Security.IsAuthorized(Permissions.SecurityAdmin, DateTime.MinValue, true))
     {
         groupCreateUsers.Enabled = false;
     }
     else
     {
         for (int i = 0; i < UserGroups.List.Length; i++)
         {
             comboUserGroup.Items.Add(UserGroups.List[i].Description);
         }
     }
     if (PrefB.GetBool("EasyHideDentalSchools"))
     {
         groupDentalSchools.Visible = false;
     }
     else
     {
         comboClass.Items.Add(Lan.g(this, "All"));
         comboClass.SelectedIndex = 0;
         for (int i = 0; i < SchoolClasses.List.Length; i++)
         {
             comboClass.Items.Add(SchoolClasses.GetDescript(SchoolClasses.List[i]));
         }
         butUp.Visible   = false;
         butDown.Visible = false;
     }
     FillGrid();
 }
        private void FormRecallList_Load(object sender, System.EventArgs e)
        {
            checkGroupFamilies.Checked = PrefB.GetBool("RecallGroupByFamily");
            int daysPast   = PrefB.GetInt("RecallDaysPast");
            int daysFuture = PrefB.GetInt("RecallDaysFuture");

            if (daysPast == -1)
            {
                textDateStart.Text = "";
            }
            else
            {
                textDateStart.Text = DateTime.Today.AddDays(-daysPast).ToShortDateString();
            }
            if (daysFuture == -1)
            {
                textDateEnd.Text = "";
            }
            else
            {
                textDateEnd.Text = DateTime.Today.AddDays(daysFuture).ToShortDateString();
            }
            //textPostcardMessage.Text=PrefB.GetString("RecallPostcardMessage");
            //textFamilyMessage.Text=PrefB.GetString("RecallPostcardFamMsg");
            comboStatus.Items.Clear();
            for (int i = 0; i < DefB.Short[(int)DefCat.RecallUnschedStatus].Length; i++)
            {
                comboStatus.Items.Add(DefB.Short[(int)DefCat.RecallUnschedStatus][i].ItemName);
            }
            FillMain();
        }
 private void FormRecallSetup_Load(object sender, System.EventArgs e)
 {
     textPatternAdult.Text      = PrefB.GetString("RecallPattern");
     textProcsAdult.Text        = ((Pref)PrefB.HList["RecallProcedures"]).ValueString;
     textPatternChild.Text      = PrefB.GetString("RecallPatternChild");
     textProcsChild.Text        = ((Pref)PrefB.HList["RecallProceduresChild"]).ValueString;
     textPatternPerio.Text      = PrefB.GetString("RecallPatternPerio");
     textProcsPerio.Text        = ((Pref)PrefB.HList["RecallProceduresPerio"]).ValueString;
     textPerioTriggerProcs.Text = ((Pref)PrefB.HList["RecallPerioTriggerProcs"]).ValueString;
     textBW.Text                     = ((Pref)PrefB.HList["RecallBW"]).ValueString;
     textFMXPanoProc.Text            = ((Pref)PrefB.HList["RecallFMXPanoProc"]).ValueString;
     checkDisableAutoFilms.Checked   = PrefB.GetBool("RecallDisableAutoFilms");
     checkDisablePerioAlt.Checked    = PrefB.GetBool("RecallDisablePerioAlt");
     textFMXPanoYrInterval.Text      = PrefB.GetInt("RecallFMXPanoYrInterval").ToString();
     checkGroupFamilies.Checked      = PrefB.GetBool("RecallGroupByFamily");
     textPostcardMessage.Text        = PrefB.GetString("RecallPostcardMessage");
     textPostcardFamMsg.Text         = PrefB.GetString("RecallPostcardFamMsg");
     textConfirmPostcardMessage.Text = PrefB.GetString("ConfirmPostcardMessage");
     textPostcardsPerSheet.Text      = PrefB.GetInt("RecallPostcardsPerSheet").ToString();
     checkReturnAdd.Checked          = PrefB.GetBool("RecallCardsShowReturnAdd");
     checkGroupFamilies.Checked      = PrefB.GetBool("RecallGroupByFamily");
     textDaysPast.Text               = PrefB.GetInt("RecallDaysPast").ToString();
     textDaysFuture.Text             = PrefB.GetInt("RecallDaysFuture").ToString();
     textRight.Text                  = PrefB.GetDouble("RecallAdjustRight").ToString();
     textDown.Text                   = PrefB.GetDouble("RecallAdjustDown").ToString();
     listProcs.Items.Clear();
     for (int i = 0; i < ProcedureCodes.RecallAL.Count; i++)
     {
         listProcs.Items.Add(((ProcedureCode)ProcedureCodes.RecallAL[i]).Descript);
     }
 }
 private void FormDepositSlip_Load(object sender, System.EventArgs e)
 {
     if (PrefB.GetBool("EasyNoClinics"))
     {
         comboClinic.Visible = false;
         labelClinic.Visible = false;
     }
     comboClinic.Items.Clear();
     comboClinic.Items.Add(Lan.g(this, "none"));
     comboClinic.SelectedIndex = 0;
     for (int i = 0; i < Clinics.List.Length; i++)
     {
         comboClinic.Items.Add(Clinics.List[i].Description);
     }
     monthCal1.SelectionStart = DateTime.Today;
     monthCal2.SelectionStart = DateTime.Today;
     //textDateFrom.Text=DateTime.Today.ToShortDateString();
     //textDateTo.Text=DateTime.Today.ToShortDateString();
     for (int i = 0; i < DefB.Short[(int)DefCat.PaymentTypes].Length; i++)
     {
         this.listPayType.Items.Add(DefB.Short[(int)DefCat.PaymentTypes][i].ItemName);
         listPayType.SetSelected(i, true);
     }
     checkBoxIns.Checked = true;
 }
        ///<summary></summary>
        public static double ComputeBal(ClaimProc[] List)
        {
            double retVal = 0;

            //double pat;
            for (int i = 0; i < List.Length; i++)
            {
                if (List[i].Status == ClaimProcStatus.Adjustment ||          //ins adjustments do not affect patient balance
                    List[i].Status == ClaimProcStatus.Preauth ||                  //preauthorizations do not affect patient balance
                    List[i].Status == ClaimProcStatus.Estimate ||                  //estimates do not affect patient balance
                    List[i].Status == ClaimProcStatus.CapEstimate                     //CapEstimates do not affect patient balance
                    )
                {
                    continue;
                }
                if (List[i].Status == ClaimProcStatus.Received ||
                    List[i].Status == ClaimProcStatus.Supplemental ||                  //because supplemental are always received
                    List[i].Status == ClaimProcStatus.CapClaim)                      //would only have a payamt if received
                {
                    retVal -= List[i].InsPayAmt;
                }
                else if (List[i].Status == ClaimProcStatus.NotReceived)
                {
                    if (!PrefB.GetBool("BalancesDontSubtractIns"))
                    {
                        retVal -= List[i].InsPayEst;                      //this typically happens
                    }
                }
                retVal -= List[i].WriteOff;
            }
            return(retVal);
        }
Exemple #9
0
        ///<summary>This will eventually replace Misc.ClassesShared.ComputeBalance.  Returns true if a change was made.</summary>
        public static bool ComputeBalances(int patNum)
        {
            string command = "SELECT (SELECT EstBalance FROM patient WHERE PatNum=" + POut.PInt(patNum) + " GROUP BY PatNum) EstBalance, "
                             + "IFNULL((SELECT SUM(ProcFee) FROM procedurelog WHERE PatNum=" + POut.PInt(patNum) + " AND ProcStatus=2 GROUP BY PatNum),0)" //complete
                             + "+IFNULL((SELECT SUM(InsPayAmt) FROM claimproc WHERE PatNum=" + POut.PInt(patNum)
                             + " AND (Status=1 OR Status=4 OR Status=5) GROUP BY PatNum),0) "                                                              //received,supplemental,capclaim"
                             + "+IFNULL((SELECT SUM(AdjAmt) FROM adjustment WHERE PatNum=" + POut.PInt(patNum) + " GROUP BY PatNum),0) "
                             + "-IFNULL((SELECT SUM(SplitAmt) FROM paysplit WHERE PatNum=" + POut.PInt(patNum) + " GROUP BY PatNum),0) CalcBalance, "
                             + "IFNULL((SELECT SUM(InsPayEst) FROM claimproc WHERE PatNum=" + POut.PInt(patNum) + " GROUP BY PatNum),0) Estimate ";
            DataTable table   = General.GetTable(command);
            double    calcBal = PIn.PDouble(table.Rows[0]["CalcBalance"].ToString());

            if (!PrefB.GetBool("BalancesDontSubtractIns"))            //most common
            {
                calcBal -= PIn.PDouble(table.Rows[0]["Estimate"].ToString());
            }
            double estBal = PIn.PDouble(table.Rows[0]["EstBalance"].ToString());

            if (calcBal != estBal)
            {
                command = "UPDATE patient SET EstBalance='" + POut.PDouble(calcBal) + "' WHERE PatNum=" + POut.PInt(patNum);
                General.NonQ(command);
                return(true);
            }
            return(false);
        }
Exemple #10
0
 private void FormRxSetupPrinting_Load(object sender, EventArgs e)
 {
     if (PrefB.GetBool("RxOrientVert"))
     {
         radioVertical.Checked = true;
     }
     else
     {
         radioHorizontal.Checked = true;
     }
     textRight.Text = PrefB.GetDouble("RxAdjustRight").ToString();
     textDown.Text  = PrefB.GetDouble("RxAdjustDown").ToString();
     if (PrefB.GetInt("RxGeneric") == 0)
     {
         radioGeneric.Checked = true;
     }
     else if (PrefB.GetInt("RxGeneric") == 1)
     {
         radioNeither.Checked = true;
     }
     else
     {
         radioTwoSig.Checked = true;
     }
 }
        private void FormStatementOptions_Load(object sender, System.EventArgs e)
        {
            if (FromDate.Year < 1880)
            {
                textDateFrom.Text = "";
            }
            else
            {
                textDateFrom.Text = FromDate.ToShortDateString();
            }
            if (ToDate.Year > 2100)
            {
                textDateTo.Text = "";
            }
            else
            {
                textDateTo.Text = ToDate.ToShortDateString();
            }

            //default to last 45 days if dates are blank

            /*if (textDateTo.Text=="" && textDateFrom.Text==""){
             *      textDateFrom.Text=DateTime.Today.AddDays(-45).ToShortDateString();
             *      textDateTo.Text=DateTime.Today.ToShortDateString();
             * }*/

            checkSimpleStatement.Checked = (PrefB.GetBool("PrintSimpleStatements"));
        }
Exemple #12
0
 private void FillSearchOption()
 {
     checkUseSearch.Checked = PrefB.GetBool("PatientSelectUsesSearchButton");
     if (checkUseSearch.Checked)
     {
         butSearch.Enabled = true;
     }
     else
     {
         butSearch.Enabled = false;
     }
 }
Exemple #13
0
 private void FormMisc_Load(object sender, System.EventArgs e)
 {
     textTreatNote.Text = PrefB.GetString("TreatmentPlanNote");
     checkTreatPlanShowGraphics.Checked      = PrefB.GetBool("TreatPlanShowGraphics");
     checkTreatPlanShowCompleted.Checked     = PrefB.GetBool("TreatPlanShowCompleted");
     checkTreatPlanShowIns.Checked           = PrefB.GetBool("TreatPlanShowIns");
     checkStatementShowReturnAddress.Checked = PrefB.GetBool("StatementShowReturnAddress");
     checkShowCC.Checked = PrefB.GetBool("StatementShowCreditCard");
     if (PrefB.GetBool("StatementAccountsUseChartNumber"))
     {
         radioUseChartNumber.Checked = true;
     }
     else
     {
         radioUsePatNum.Checked = true;
     }
     if (PrefB.GetInt("StatementsCalcDueDate") != -1)
     {
         textStatementsCalcDueDate.Text = PrefB.GetInt("StatementsCalcDueDate").ToString();
     }
     checkBalancesDontSubtractIns.Checked = PrefB.GetBool("BalancesDontSubtractIns");
     if (PrefB.GetInt("ProcessSigsIntervalInSecs") == 0)
     {
         textSigInterval.Text = "";
     }
     else
     {
         textSigInterval.Text = PrefB.GetInt("ProcessSigsIntervalInSecs").ToString();
     }
     checkRandomPrimaryKeys.Checked = PrefB.GetBool("RandomPrimaryKeys");
     if (checkRandomPrimaryKeys.Checked)
     {
         //not allowed to uncheck it
         checkRandomPrimaryKeys.Enabled = false;
     }
     textMainWindowTitle.Text = PrefB.GetString("MainWindowTitle");
     if (PrefB.GetInt("ShowIDinTitleBar") == 0)
     {
         radioShowIDnone.Checked = true;
     }
     else if (PrefB.GetInt("ShowIDinTitleBar") == 1)
     {
         radioShowIDpatNum.Checked = true;
     }
     else if (PrefB.GetInt("ShowIDinTitleBar") == 2)
     {
         radioShowIDchartNum.Checked = true;
     }
     checkEclaimsSeparateTreatProv.Checked = PrefB.GetBool("EclaimsSeparateTreatProv");
     checkMedicalEclaimsEnabled.Checked    = PrefB.GetBool("MedicalEclaimsEnabled");
     checkITooth.Checked = PrefB.GetBool("UseInternationalToothNumbers");
     checkInsurancePlansShared.Checked = PrefB.GetBool("InsurancePlansShared");
 }
Exemple #14
0
 private void FormEasy_Load(object sender, System.EventArgs e)
 {
     checkCapitation.Checked    = ((Pref)PrefB.HList["EasyHideCapitation"]).ValueString == "1";
     checkMedicaid.Checked      = ((Pref)PrefB.HList["EasyHideMedicaid"]).ValueString == "1";
     checkPublicHealth.Checked  = ((Pref)PrefB.HList["EasyHidePublicHealth"]).ValueString == "1";
     checkDentalSchools.Checked = PrefB.GetBool("EasyHideDentalSchools");
     checkHospitals.Checked     = PrefB.GetBool("EasyHideHospitals");
     checkAdvancedIns.Checked   = ((Pref)PrefB.HList["EasyHideAdvancedIns"]).ValueString == "1";
     checkInsurance.Checked     = PrefB.GetBool("EasyHideInsurance");
     checkClinical.Checked      = ((Pref)PrefB.HList["EasyHideClinical"]).ValueString == "1";
     checkBasicModules.Checked  = ((Pref)PrefB.HList["EasyBasicModules"]).ValueString == "1";
     checkNoClinics.Checked     = PrefB.GetBool("EasyNoClinics");
     checkRepeatCharges.Checked = PrefB.GetBool("EasyHideRepeatCharges");
 }
Exemple #15
0
        /*private void butDelete_Click(object sender, System.EventArgs e) {
         *      if(IsNew){
         *              DialogResult=DialogResult.Cancel;
         *              return;
         *      }
         *      try{
         *              UserCur.Delete();
         *      }
         *      catch(Exception ex){
         *              MessageBox.Show(ex.Message);
         *              return;
         *      }
         *      DialogResult=DialogResult.OK;
         * }*/

        private void butOK_Click(object sender, System.EventArgs e)
        {
            if (textUserName.Text == "")
            {
                MsgBox.Show(this, "Please enter a username.");
                return;
            }
            if (listEmployee.SelectedIndex > 0 && listProv.SelectedIndex > 0)
            {
                MsgBox.Show(this, "Cannot set an employee and a provider for the same user.");
                return;
            }
            UserCur.IsHidden     = checkIsHidden.Checked;
            UserCur.UserName     = textUserName.Text;
            UserCur.UserGroupNum = UserGroups.List[listUserGroup.SelectedIndex].UserGroupNum;
            if (listEmployee.SelectedIndex == 0)
            {
                UserCur.EmployeeNum = 0;
            }
            else
            {
                UserCur.EmployeeNum = Employees.ListShort[listEmployee.SelectedIndex - 1].EmployeeNum;
            }
            if (listProv.SelectedIndex == 0)
            {
                UserCur.ProvNum = 0;
            }
            else
            {
                UserCur.ProvNum = Providers.List[listProv.SelectedIndex - 1].ProvNum;
            }
            if (PrefB.GetBool("EasyNoClinics") || listClinic.SelectedIndex == 0)
            {
                UserCur.ClinicNum = 0;
            }
            else
            {
                UserCur.ClinicNum = Clinics.List[listClinic.SelectedIndex - 1].ClinicNum;
            }
            try{
                Userods.InsertOrUpdate(IsNew, UserCur);
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message);
                return;
            }
            DialogResult = DialogResult.OK;
        }
Exemple #16
0
 private void FormClaimPayEdit_Load(object sender, System.EventArgs e)
 {
     if (IsNew)
     {
         //ClaimPaymentCur=new ClaimPayment();
         //ClaimPayments.InsertCur();//assigns a ClaimPaymentNum for use below
         checkShowUn.Checked = true;
     }
     if (PrefB.GetBool("EasyNoClinics"))
     {
         comboClinic.Visible = false;
         labelClinic.Visible = false;
     }
     comboClinic.Items.Clear();
     comboClinic.Items.Add(Lan.g(this, "none"));
     comboClinic.SelectedIndex = 0;
     for (int i = 0; i < Clinics.List.Length; i++)
     {
         comboClinic.Items.Add(Clinics.List[i].Description);
         if (Clinics.List[i].ClinicNum == ClaimPaymentCur.ClinicNum)
         {
             comboClinic.SelectedIndex = i + 1;
         }
     }
     //if(ClaimPaymentCur.CheckDate.Year < 1880){
     //	textDate.Text=DateTime.Today.ToShortDateString();
     //}
     //else
     textDate.Text = ClaimPaymentCur.CheckDate.ToShortDateString();
     //textAmount is handled in FillTable
     textCheckNum.Text    = ClaimPaymentCur.CheckNum;
     textBankBranch.Text  = ClaimPaymentCur.BankBranch;
     textCarrierName.Text = ClaimPaymentCur.CarrierName;
     textNote.Text        = ClaimPaymentCur.Note;
     FillTable();
     if (IsNew)
     {
         tb2.SetSelected(true);
         splitTot = 0;
         for (int i = 0; i < tb2.SelectedIndices.Length; i++)
         {
             splitTot += splits[tb2.SelectedIndices[i]].InsPayAmt;                  //Claims.ListQueue
         }
         textAmount.Text = splitTot.ToString("F");
     }
 }
Exemple #17
0
        ///<summary>Returns true if a change was required, or false if no change needed.</summary>
        public static bool UpdateBool(string prefName, bool newValue)
        {
            if (!PrefB.HList.ContainsKey(prefName))
            {
                MessageBox.Show(prefName + " is an invalid pref name.");
                return(false);
            }
            if (PrefB.GetBool(prefName) == newValue)
            {
                return(false);               //no change needed
            }
            string command = "UPDATE preference SET "
                             + "ValueString = '" + POut.PBool(newValue) + "' "
                             + "WHERE PrefName = '" + POut.PString(prefName) + "'";

            General.NonQ(command);
            return(true);
        }
 private void FormOperatoryEdit_Load(object sender, System.EventArgs e)
 {
     textOpName.Text       = OpCur.OpName;
     textAbbrev.Text       = OpCur.Abbrev;
     checkIsHidden.Checked = OpCur.IsHidden;
     if (PrefB.GetBool("EasyNoClinics"))
     {
         labelClinic.Visible = false;
         comboClinic.Visible = false;
     }
     comboClinic.Items.Add(Lan.g(this, "none"));
     comboClinic.SelectedIndex = 0;
     for (int i = 0; i < Clinics.List.Length; i++)
     {
         comboClinic.Items.Add(Clinics.List[i].Description);
         if (Clinics.List[i].ClinicNum == OpCur.ClinicNum)
         {
             comboClinic.SelectedIndex = i + 1;
         }
     }
     comboProvDentist.Items.Add(Lan.g(this, "none"));
     comboProvDentist.SelectedIndex = 0;
     for (int i = 0; i < Providers.List.Length; i++)
     {
         comboProvDentist.Items.Add(Providers.List[i].Abbr);
         if (Providers.List[i].ProvNum == OpCur.ProvDentist)
         {
             comboProvDentist.SelectedIndex = i + 1;
         }
     }
     comboProvHygienist.Items.Add(Lan.g(this, "none"));
     comboProvHygienist.SelectedIndex = 0;
     for (int i = 0; i < Providers.List.Length; i++)
     {
         comboProvHygienist.Items.Add(Providers.List[i].Abbr);
         if (Providers.List[i].ProvNum == OpCur.ProvHygienist)
         {
             comboProvHygienist.SelectedIndex = i + 1;
         }
     }
     checkIsHygiene.Checked = OpCur.IsHygiene;
 }
Exemple #19
0
        private void FormAging_Load(object sender, System.EventArgs e)
        {
            DateTime dateLastAging = PIn.PDate(PrefB.GetString("DateLastAging"));

            if (dateLastAging.Year < 1880)
            {
                textDateLast.Text = "";
            }
            else
            {
                textDateLast.Text = dateLastAging.ToShortDateString();
            }
            if (PrefB.GetBool("AgingCalculatedMonthlyInsteadOfDaily"))
            {
                textDateCalc.Text = dateLastAging.ToShortDateString();
            }
            else
            {
                textDateCalc.Text = DateTime.Today.ToShortDateString();
            }
        }
Exemple #20
0
 private void FormPath_Load(object sender, System.EventArgs e)
 {
     textDocPath.Text         = PrefB.GetString("DocPath");
     textExportPath.Text      = PrefB.GetString("ExportPath");
     textLetterMergePath.Text = PrefB.GetString("LetterMergePath");
     if (PrefB.GetBool("AtoZfolderNotRequired"))
     {
         optDisableFolders.Checked = true;
     }
     else if (ImageStore.ImageStoreTypeName == typeof(SqlStore).FullName)
     {
         optUseDatabase.Checked = true;
     }
     else
     {
         optUseFolder.Checked = true;
     }
     // The opt***_checked event will enable/disable the appropriate UI elements.
     checkMultiplePaths.Checked = (textDocPath.Text.LastIndexOf(';') != -1);             //Also set the "multiple paths" checkbox at
     //startup based on the current image folder list
     //format. No need to store this info in the db.
 }
Exemple #21
0
 private void FormProvEdit_Load(object sender, System.EventArgs e)
 {
     //if(IsNew){
     //	Providers.Cur.SigOnFile=true;
     //	Providers.InsertCur();
     //one field handled from previous form
     //}
     if (PrefB.GetBool("EasyHideDentalSchools"))
     {
         labelSchoolClass.Visible = false;
         comboSchoolClass.Visible = false;
     }
     textAbbr.Text   = ProvCur.Abbr;
     textLName.Text  = ProvCur.LName;
     textFName.Text  = ProvCur.FName;
     textMI.Text     = ProvCur.MI;
     textSuffix.Text = ProvCur.Suffix;
     textSSN.Text    = ProvCur.SSN;
     if (ProvCur.UsingTIN)
     {
         radioTIN.Checked = true;
     }
     else
     {
         radioSSN.Checked = true;
     }
     textStateLicense.Text = ProvCur.StateLicense;
     textDEANum.Text       = ProvCur.DEANum;
     //textBlueCrossID.Text=ProvCur.BlueCrossID;
     textMedicaidID.Text        = ProvCur.MedicaidID;
     textNationalProvID.Text    = ProvCur.NationalProvID;
     textCanadianOfficeNum.Text = ProvCur.CanadianOfficeNum;
     checkIsSecondary.Checked   = ProvCur.IsSecondary;
     checkSigOnFile.Checked     = ProvCur.SigOnFile;
     checkIsHidden.Checked      = ProvCur.IsHidden;
     butColor.BackColor         = ProvCur.ProvColor;
     butOutlineColor.BackColor  = ProvCur.OutlineColor;
     comboSchoolClass.Items.Add(Lan.g(this, "none"));
     comboSchoolClass.SelectedIndex = 0;
     for (int i = 0; i < SchoolClasses.List.Length; i++)
     {
         comboSchoolClass.Items.Add(SchoolClasses.List[i].GradYear.ToString() + "-" + SchoolClasses.List[i].Descript);
         if (SchoolClasses.List[i].SchoolClassNum == ProvCur.SchoolClassNum)
         {
             comboSchoolClass.SelectedIndex = i + 1;
         }
     }
     for (int i = 0; i < DefB.Short[(int)DefCat.FeeSchedNames].Length; i++)
     {
         this.listFeeSched.Items.Add(DefB.Short[(int)DefCat.FeeSchedNames][i].ItemName);
         if (DefB.Short[(int)DefCat.FeeSchedNames][i].DefNum == ProvCur.FeeSched)
         {
             listFeeSched.SelectedIndex = i;
         }
     }
     if (listFeeSched.SelectedIndex < 0)
     {
         listFeeSched.SelectedIndex = 0;
     }
     listSpecialty.Items.Clear();
     for (int i = 0; i < Enum.GetNames(typeof(DentalSpecialty)).Length; i++)
     {
         listSpecialty.Items.Add(Lan.g("enumDentalSpecialty", Enum.GetNames(typeof(DentalSpecialty))[i]));
     }
     listSpecialty.SelectedIndex = (int)ProvCur.Specialty;
     FillProvIdent();
 }
        ///<summary>Draws all the blockouts for the entire period.</summary>
        private void DrawBlockouts(Graphics g)
        {
            Schedule[] schedForType;
            schedForType = Schedules.GetForType(SchedListPeriod, ScheduleType.Blockout, 0);
            SolidBrush blockBrush;
            Pen        blockOutlinePen = new Pen(Color.Black, 1);
            Pen        penOutline;
            Font       blockFont = new Font("Arial", 8);
            string     blockText;
            RectangleF rect;

            //g.TextRenderingHint=TextRenderingHint.SingleBitPerPixelGridFit;//to make printing clearer
            for (int i = 0; i < schedForType.Length; i++)
            {
                blockBrush = new SolidBrush(DefB.GetColor(DefCat.BlockoutTypes, schedForType[i].BlockoutType));
                penOutline = new Pen(DefB.GetColor(DefCat.BlockoutTypes, schedForType[i].BlockoutType), 2);
                blockText  = DefB.GetName(DefCat.BlockoutTypes, schedForType[i].BlockoutType) + "\r\n" + schedForType[i].Note;
                if (IsWeeklyView)
                {
                    if (schedForType[i].Op == 0)                   //all ops
                    {
                        rect = new RectangleF(
                            TimeWidth + 1 + ((int)schedForType[i].SchedDate.DayOfWeek - 1) * ColDayWidth
                            , schedForType[i].StartTime.Hour * Lh * RowsPerHr                       //6
                            + schedForType[i].StartTime.Minute * Lh / MinPerRow                     //10
                            , ColDayWidth - 1
                            , (schedForType[i].StopTime - schedForType[i].StartTime).Hours * Lh * RowsPerHr
                            + (schedForType[i].StopTime - schedForType[i].StartTime).Minutes * Lh / MinPerRow);
                    }
                    else                      //just one op
                    {
                        if (ApptViewItems.GetIndexOp(schedForType[i].Op) == -1)
                        {
                            continue;                            //don't display if op not visible
                        }
                        rect = new RectangleF(
                            TimeWidth + 1 + ((int)schedForType[i].SchedDate.DayOfWeek - 1) * ColDayWidth
                            + ColAptWidth * ApptViewItems.GetIndexOp(schedForType[i].Op) + 1
                            , schedForType[i].StartTime.Hour * Lh * RowsPerHr
                            + schedForType[i].StartTime.Minute * Lh / MinPerRow
                            , ColAptWidth - 1
                            , (schedForType[i].StopTime - schedForType[i].StartTime).Hours * Lh * RowsPerHr
                            + (schedForType[i].StopTime - schedForType[i].StartTime).Minutes * Lh / MinPerRow);
                    }
                }
                else
                {
                    if (schedForType[i].Op == 0)                  //all ops
                    {
                        rect = new RectangleF(
                            TimeWidth + ProvWidth * ProvCount + 1
                            , schedForType[i].StartTime.Hour * Lh * RowsPerHr                       //6
                            + schedForType[i].StartTime.Minute * Lh / MinPerRow                     //10
                            , ColWidth * ColCount - 1
                            , (schedForType[i].StopTime - schedForType[i].StartTime).Hours * Lh * RowsPerHr
                            + (schedForType[i].StopTime - schedForType[i].StartTime).Minutes * Lh / MinPerRow);
                    }
                    else                     //just one op
                    {
                        if (ApptViewItems.GetIndexOp(schedForType[i].Op) == -1)
                        {
                            continue;                            //don't display if op not visible
                        }
                        rect = new RectangleF(
                            TimeWidth + ProvWidth * ProvCount
                            + ColWidth * ApptViewItems.GetIndexOp(schedForType[i].Op) + 1
                            , schedForType[i].StartTime.Hour * Lh * RowsPerHr
                            + schedForType[i].StartTime.Minute * Lh / MinPerRow
                            , ColWidth - 1
                            , (schedForType[i].StopTime - schedForType[i].StartTime).Hours * Lh * RowsPerHr
                            + (schedForType[i].StopTime - schedForType[i].StartTime).Minutes * Lh / MinPerRow);
                    }
                }
                //paint either solid block or outline
                if (PrefB.GetBool("SolidBlockouts"))
                {
                    g.FillRectangle(blockBrush, rect);
                    g.DrawLine(blockOutlinePen, rect.X, rect.Y + 1, rect.Right - 1, rect.Y + 1);
                }
                else
                {
                    g.DrawRectangle(penOutline, rect.X + 1, rect.Y + 2, rect.Width - 2, rect.Height - 3);
                }
                g.DrawString(blockText, blockFont, new SolidBrush(DefB.Short[(int)DefCat.AppointmentColors][5].ItemColor), rect);
            }
        }
        private void FormBillingOptions_Load(object sender, System.EventArgs e)
        {
            if (PIn.PDate(PrefB.GetString("DateLastAging")) < DateTime.Today)
            {
                if (MessageBox.Show(Lan.g(this, "Update aging first?"), "", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    FormAging FormA = new FormAging();
                    FormA.ShowDialog();
                }
            }
            for (int i = 0; i < DefB.Short[(int)DefCat.BillingTypes].Length; i++)
            {
                listBillType.Items.Add(DefB.Short[(int)DefCat.BillingTypes][i].ItemName);
            }
            textLastStatement.Text      = DateTime.Today.AddMonths(-1).ToShortDateString();
            checkIncludeChanged.Checked = PrefB.GetBool("BillingIncludeChanged");
            string[] selectedBillTypes = ((Pref)PrefB.HList["BillingSelectBillingTypes"]).ValueString.Split(',');
            for (int i = 0; i < selectedBillTypes.Length; i++)
            {
                try{
                    int order = DefB.GetOrder(DefCat.BillingTypes, Convert.ToInt32(selectedBillTypes[i]));
                    if (order != -1)
                    {
                        listBillType.SetSelected(order, true);
                    }
                }
                catch {}
            }
            if (listBillType.SelectedIndices.Count == 0)
            {
                listBillType.SelectedIndex = 0;
            }
            switch (((Pref)PrefB.HList["BillingAgeOfAccount"]).ValueString)
            {
            default:
                radioAny.Checked = true;
                break;

            case "30":
                radio30.Checked = true;
                break;

            case "60":
                radio60.Checked = true;
                break;

            case "90":
                radio90.Checked = true;
                break;
            }
            if (((Pref)PrefB.HList["BillingExcludeBadAddresses"]).ValueString == "1")
            {
                checkBadAddress.Checked = true;
            }
            if (((Pref)PrefB.HList["BillingExcludeInactive"]).ValueString == "1")
            {
                checkExcludeInactive.Checked = true;
            }
            if (((Pref)PrefB.HList["BillingExcludeNegative"]).ValueString == "1")
            {
                checkExcludeNegative.Checked = true;
            }
            textExcludeLessThan.Text = ((Pref)PrefB.HList["BillingExcludeLessThan"]).ValueString;
            //blank is allowed
            FillDunning();
        }
Exemple #24
0
 private void FormPrinterSetup_Load(object sender, System.EventArgs e)
 {
     checkSimple.Checked = PrefB.GetBool("EasyHidePrinters");
     SetSimple();
     SetControls(this);
 }
        /*private void butToday_Click(object sender, System.EventArgs e) {
         *      textDateFrom.Text=DateTime.Today.ToShortDateString();
         *      textDateTo.Text=DateTime.Today.ToShortDateString();
         * }
         *
         * private void butLeft_Click(object sender, System.EventArgs e) {
         *      if(  textDateFrom.errorProvider1.GetError(textDateFrom)!=""
         || textDateTo.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.AddDays(-1).ToShortDateString();
         ||     textDateTo.Text=dateTo.AddDays(-1).ToShortDateString();
         ||}
         ||
         ||private void butRight_Click(object sender, System.EventArgs e) {
         ||     if(  textDateFrom.errorProvider1.GetError(textDateFrom)!=""
         || textDateTo.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.AddDays(1).ToShortDateString();
         ||     textDateTo.Text=dateTo.AddDays(1).ToShortDateString();
         ||}*/

        private void butOK_Click(object sender, System.EventArgs e)
        {
/*
 * SELECT PayDate,CONCAT(patient.LName,',',patient.FName,' ',patient.MiddleI),CheckNum,BankBranch,PayAmt
 * FROM payment,patient
 * WHERE payment.PatNum=patient.PatNum
 * GROUP BY PayDate
 * UNION
 * SELECT CheckDate,insplan.Carrier,CheckNum,BankBranch,CheckAmt
 * FROM claimproc,claimpayment,insplan
 * WHERE claimproc.ClaimPaymentNum=claimpayment.ClaimPaymentNum && claimproc.PlanNum=insplan.PlanNum
 * GROUP BY CheckDate
 * ORDER BY PayDate
 */

/*
 * SELECT PayDate,CONCAT(patient.LName,', ',patient.FName,' ',
 * patient.MiddleI) AS plfname,'                          ',PayType,
 * PayNum,CheckNum,BankBranch,PayAmt
 * FROM payment,patient WHERE
 * payment.PatNum = patient.PatNum AND (
 * PayType = '69'
 * ) AND PayDate = '2005-01-10'
 * UNION SELECT CheckDate,CONCAT(patient.LName,', ',patient.FName,' ',
 * patient.MiddleI) AS plfname,CarrierName,'Ins',
 * claimpayment.ClaimPaymentNum,
 * CheckNum,BankBranch,CheckAmt
 * FROM claimpayment,claimproc,insplan,carrier,patient
 * WHERE claimproc.ClaimPaymentNum = claimpayment.ClaimPaymentNum
 * AND claimproc.PlanNum = insplan.PlanNum
 * AND claimproc.PatNum=patient.PatNum
 * AND insplan.CarrierNum = carrier.CarrierNum
 * AND (claimproc.status = '1' OR claimproc.status = '4')
 * AND CheckDate = '2005-01-10'
 * ORDER BY PayDate, plfname
 */
            if (listPayType.SelectedIndices.Count == 0 &&
                !checkBoxIns.Checked)
            {
                MessageBox.Show("Must either select a payment type and/or include insurance checks.");
                return;
            }
            Queries.CurReport = new ReportOld();
            string cmd = "";

            //if(checkBoxIns.Checked){
            cmd = "SELECT PayDate,CONCAT(CONCAT(CONCAT(CONCAT(patient.LName,', '),patient.FName),' '),"
                  + "patient.MiddleI) AS plfname,'                          ',PayType,"
                  + "PayNum,CheckNum,BankBranch,PayAmt "
                  + "FROM payment,patient WHERE ";             //added plfname,paynum spk 4/14/04
            if (listPayType.SelectedIndices.Count == 0)
            {
                cmd += "1=0 ";              //none
            }
            else
            {
                cmd += "payment.PatNum = patient.PatNum AND (";
                for (int i = 0; i < listPayType.SelectedIndices.Count; i++)
                {
                    if (i > 0)
                    {
                        cmd += " OR ";
                    }
                    cmd += "PayType = '"
                           + DefB.Short[(int)DefCat.PaymentTypes][listPayType.SelectedIndices[i]].DefNum + "'";
                }
                cmd +=
                    ") AND PayDate >= " + POut.PDate(monthCal1.SelectionStart) + " "
                    + "AND PayDate <= " + POut.PDate(monthCal2.SelectionStart) + " ";
                if (!PrefB.GetBool("EasyNoClinics"))
                {
                    if (comboClinic.SelectedIndex == 0)
                    {
                        cmd += "AND payment.ClinicNum=0 ";
                    }
                    else
                    {
                        cmd += "AND payment.ClinicNum="
                               + POut.PInt(Clinics.List[comboClinic.SelectedIndex - 1].ClinicNum) + " ";
                    }
                }
            }
            if (checkBoxIns.Checked)
            {
                cmd += "UNION SELECT CheckDate,CONCAT(CONCAT(CONCAT(CONCAT(patient.LName,', '),patient.FName),' '),"
                       + "patient.MiddleI) AS plfname,CarrierName,'Ins',"
                       + "claimpayment.ClaimPaymentNum,"
                       + "CheckNum,BankBranch,CheckAmt "                //spk added claimpaymentnum
                       //+"claimpayment.ClaimPaymentNum "
                       + "FROM claimpayment,claimproc,insplan,carrier,patient "
                       + "WHERE claimproc.ClaimPaymentNum = claimpayment.ClaimPaymentNum "
                       + "AND claimproc.PlanNum = insplan.PlanNum "
                       + "AND claimproc.PatNum=patient.PatNum "
                       + "AND insplan.CarrierNum = carrier.CarrierNum "
                       + "AND (claimproc.status = '1' OR claimproc.status = '4') "
                       + "AND CheckDate >= " + POut.PDate(monthCal1.SelectionStart) + " "
                       + "AND CheckDate <= " + POut.PDate(monthCal2.SelectionStart) + " ";            //added plfname,spk 4/30/04
                if (!PrefB.GetBool("EasyNoClinics"))
                {
                    if (comboClinic.SelectedIndex == 0)
                    {
                        cmd += "AND claimpayment.ClinicNum=0 ";
                    }
                    else
                    {
                        cmd += "AND claimpayment.ClinicNum="
                               + POut.PInt(Clinics.List[comboClinic.SelectedIndex - 1].ClinicNum) + " ";
                    }
                }
                cmd += "GROUP BY claimpayment.ClaimPaymentNum ";
                //MessageBox.Show(Queries.CurReport.Query);
            }
            //cmd+="ORDER BY PayDate, plfname";//FIXME:UNION-ORDER-BY
            cmd += "ORDER BY 1, 2";
            Queries.CurReport.Query = cmd;
            FormQuery2          = new FormQuery();
            FormQuery2.IsReport = true;
            FormQuery2.SubmitReportQuery();
            Queries.CurReport.Title    = "Deposit Slip";
            Queries.CurReport.SubTitle = new string[3];
            if (!PrefB.GetBool("EasyNoClinics"))
            {
                Queries.CurReport.SubTitle = new string[4];
                if (comboClinic.SelectedIndex == 0)
                {
                    Queries.CurReport.SubTitle[3] = Lan.g(this, "Clinic") + ": none";
                }
                else
                {
                    Queries.CurReport.SubTitle[3] = Lan.g(this, "Clinic") + ": "
                                                    + Clinics.List[comboClinic.SelectedIndex - 1].Description;
                }
            }
            Queries.CurReport.SubTitle[0] = ((Pref)PrefB.HList["PracticeTitle"]).ValueString;
            Queries.CurReport.SubTitle[1] = monthCal1.SelectionStart.ToShortDateString() + " - "
                                            + monthCal2.SelectionStart.ToShortDateString();
            if (listPayType.SelectedIndices.Count > 0)
            {
                Queries.CurReport.SubTitle[2] = "Payment Type(s): ";
                for (int i = 0; i < listPayType.SelectedIndices.Count; i++)
                {
                    if (i > 0)
                    {
                        Queries.CurReport.SubTitle[2] += ", ";
                    }
                    Queries.CurReport.SubTitle[2]
                        += DefB.Short[(int)DefCat.PaymentTypes][listPayType.SelectedIndices[i]].ItemName;
                }
                if (checkBoxIns.Checked)
                {
                    Queries.CurReport.SubTitle[2] += " Insurance Claim Checks";
                }
            }
            else
            {
                if (checkBoxIns.Checked)
                {
                    Queries.CurReport.SubTitle[2] = "Payment Type: Insurance Claim Checks";
                }
            }
            Queries.CurReport.ColPos        = new int[9];
            Queries.CurReport.ColCaption    = new string[8];
            Queries.CurReport.ColAlign      = new HorizontalAlignment[8];
            Queries.CurReport.ColPos[0]     = 20;
            Queries.CurReport.ColPos[1]     = 100;
            Queries.CurReport.ColPos[2]     = 210;
            Queries.CurReport.ColPos[3]     = 320;
            Queries.CurReport.ColPos[4]     = 420;
            Queries.CurReport.ColPos[5]     = 480;
            Queries.CurReport.ColPos[6]     = 590;
            Queries.CurReport.ColPos[7]     = 680;
            Queries.CurReport.ColPos[8]     = 760;
            Queries.CurReport.ColCaption[0] = "Date";
            Queries.CurReport.ColCaption[1] = "Patient";
            Queries.CurReport.ColCaption[2] = "Carrier";
            Queries.CurReport.ColCaption[3] = "Type";
            //this column can be eliminated when the new reporting framework is complete:
            Queries.CurReport.ColCaption[4] = "Pay #";
            Queries.CurReport.ColCaption[5] = "Check Number";
            Queries.CurReport.ColCaption[6] = "Bank-Branch";
            Queries.CurReport.ColCaption[7] = "Amount";
            //Queries.CurReport.ColAlign[4]=HorizontalAlignment.Right;
            Queries.CurReport.ColAlign[7] = HorizontalAlignment.Right;
            if (PrefB.GetBool("EasyNoClinics") || comboClinic.SelectedIndex == 0)
            {
                Queries.CurReport.Summary    = new string[3];
                Queries.CurReport.Summary[0] = "For Deposit to Account of " + ((Pref)PrefB.HList["PracticeTitle"]).ValueString;
                Queries.CurReport.Summary[2] = "Account number: " + ((Pref)PrefB.HList["PracticeBankNumber"]).ValueString;
            }
            else
            {
                Queries.CurReport.Summary    = new string[3];
                Queries.CurReport.Summary[0] = "For Deposit to Account of " + Clinics.List[comboClinic.SelectedIndex - 1].Description;
                Queries.CurReport.Summary[2] = "Account number: " + Clinics.List[comboClinic.SelectedIndex - 1].BankNumber;
            }
            FormQuery2.ShowDialog();

            DialogResult = DialogResult.OK;
        }
Exemple #26
0
        private void butOK_Click(object sender, System.EventArgs e)
        {
            string compName = SystemInformation.ComputerName;

            if (checkSimple.Checked && !PrefB.GetBool("EasyHidePrinters"))
            {
                //if user clicked the simple option
                if (!MsgBox.Show(this, true, "Warning! You have selected the easy view option.  This will clear all printing preferences for all computers.  Are you sure you wish to continue?"))
                {
                    return;
                }
                Printers.ClearAll();
                Printers.Refresh();
                string printerName = "";
                if (comboDefault.SelectedIndex == 0)
                {
                    printerName = "";
                }
                else
                {
                    printerName = PrinterSettings.InstalledPrinters[comboDefault.SelectedIndex - 1];
                }
                Printers.PutForSit(PrintSituation.Default, compName, printerName, true);
            }
            else
            {
                for (int i = 0; i < Enum.GetValues(typeof(PrintSituation)).Length; i++)
                {
                    //loop through each printSituation
                    string printerName = "";
                    bool   isChecked   = false;
                    //PrintSituation sit=PrintSituation.Default;
                    //first: main Default, since not in panel Simple
                    if (i == 0)          //printSituation.Default
                    {
                        if (comboDefault.SelectedIndex == 0)
                        {
                            printerName = "";
                        }
                        else
                        {
                            printerName = PrinterSettings.InstalledPrinters[comboDefault.SelectedIndex - 1];
                        }
                    }
                    foreach (Control control in panelSimple.Controls)
                    {
                        if (control.GetType() != typeof(ComboBox) &&          //skip anything but comboBoxes and CheckBoxes
                            control.GetType() != typeof(CheckBox))
                        {
                            continue;
                        }
                        //so only two controls out of all will be used in each Enum loop
                        if (GetSit(control) != (PrintSituation)i)
                        {
                            continue;
                        }
                        if (control.GetType() == typeof(ComboBox))
                        {
                            if (((ComboBox)control).SelectedIndex == 0)
                            {
                                printerName = "";
                            }
                            else
                            {
                                printerName = PrinterSettings.InstalledPrinters[((ComboBox)control).SelectedIndex - 1];
                            }
                        }
                        else                 //checkBox
                        {
                            isChecked = ((CheckBox)control).Checked;
                        }
                    }
                    Printers.PutForSit((PrintSituation)i, compName, printerName, isChecked);
                }
            }
            DataValid.SetInvalid(InvalidTypes.Computers);
            if (checkSimple.Checked != PrefB.GetBool("EasyHidePrinters"))
            {
                Prefs.UpdateBool("EasyHidePrinters", checkSimple.Checked);
                DataValid.SetInvalid(InvalidTypes.Prefs);
            }
            DialogResult = DialogResult.OK;
        }
        ///<summary>raised for each page to be printed.</summary>
        private void pdCards_PrintPage(object sender, PrintPageEventArgs ev)
        {
            int      totalPages = (int)Math.Ceiling((double)AddrTable.Rows.Count / (double)PrefB.GetInt("RecallPostcardsPerSheet"));
            Graphics g          = ev.Graphics;
            int      yAdj       = (int)(PrefB.GetDouble("RecallAdjustDown") * 100);
            int      xAdj       = (int)(PrefB.GetDouble("RecallAdjustRight") * 100);
            float    yPos       = 0 + yAdj;//these refer to the upper left origin of each postcard
            float    xPos       = 0 + xAdj;
            string   str;

            while (yPos < ev.PageBounds.Height - 100 && patientsPrinted < AddrTable.Rows.Count)
            {
                //Return Address--------------------------------------------------------------------------
                if (PrefB.GetBool("RecallCardsShowReturnAdd"))
                {
                    str = PrefB.GetString("PracticeTitle") + "\r\n";
                    g.DrawString(str, new Font(FontFamily.GenericSansSerif, 9, FontStyle.Bold), Brushes.Black, xPos + 45, yPos + 60);
                    str = PrefB.GetString("PracticeAddress") + "\r\n";
                    if (PrefB.GetString("PracticeAddress2") != "")
                    {
                        str += PrefB.GetString("PracticeAddress2") + "\r\n";
                    }
                    str += PrefB.GetString("PracticeCity") + ",  " + PrefB.GetString("PracticeST") + "  " + PrefB.GetString("PracticeZip") + "\r\n";
                    string phone = PrefB.GetString("PracticePhone");
                    if (CultureInfo.CurrentCulture.Name == "en-US" && phone.Length == 10)
                    {
                        str += "(" + phone.Substring(0, 3) + ")" + phone.Substring(3, 3) + "-" + phone.Substring(6);
                    }
                    else                     //any other phone format
                    {
                        str += phone;
                    }
                    g.DrawString(str, new Font(FontFamily.GenericSansSerif, 8), Brushes.Black, xPos + 45, yPos + 75);
                }
                //Body text-------------------------------------------------------------------------------
                if (checkGroupFamilies.Checked && AddrTable.Rows[patientsPrinted]["FamList"].ToString() != "")                //print family card
                {
                    str = PrefB.GetString("RecallPostcardFamMsg").Replace
                          //textFamilyMessage.Text.Replace
                              ("?FamilyList", AddrTable.Rows[patientsPrinted]["FamList"].ToString());
                }
                else                 //print single card
                {
                    str = PrefB.GetString("RecallPostcardMessage").Replace
                          //textPostcardMessage.Text.Replace
                              ("?DueDate", PIn.PDate(AddrTable.Rows[patientsPrinted]["DateDue"].ToString()).ToShortDateString());
                }
                g.DrawString(str, new Font(FontFamily.GenericSansSerif, 10), Brushes.Black, new RectangleF(xPos + 45, yPos + 180, 250, 190));
                //Patient's Address-----------------------------------------------------------------------
                if (checkGroupFamilies.Checked &&
                    AddrTable.Rows[patientsPrinted]["FamList"].ToString() != "")                     //print family card
                {
                    str = AddrTable.Rows[patientsPrinted]["LName"].ToString() + " " + Lan.g(this, "Household") + "\r\n";
                }
                else                 //print single card
                {
                    str = AddrTable.Rows[patientsPrinted]["FName"].ToString() + " "
                          + AddrTable.Rows[patientsPrinted]["MiddleI"].ToString() + " "
                          + AddrTable.Rows[patientsPrinted]["LName"].ToString() + "\r\n";
                }
                str += AddrTable.Rows[patientsPrinted]["Address"].ToString() + "\r\n";
                if (AddrTable.Rows[patientsPrinted]["Address2"].ToString() != "")
                {
                    str += AddrTable.Rows[patientsPrinted]["Address2"].ToString() + "\r\n";
                }
                str += AddrTable.Rows[patientsPrinted]["City"].ToString() + ", "
                       + AddrTable.Rows[patientsPrinted]["State"].ToString() + "   "
                       + AddrTable.Rows[patientsPrinted]["Zip"].ToString() + "\r\n";
                g.DrawString(str, new Font(FontFamily.GenericSansSerif, 11), Brushes.Black, xPos + 320, yPos + 240);
                if (PrefB.GetInt("RecallPostcardsPerSheet") == 1)
                {
                    yPos += 400;
                }
                else if (PrefB.GetInt("RecallPostcardsPerSheet") == 3)
                {
                    yPos += 366;
                }
                else                 //4
                {
                    xPos += 550;
                    if (xPos > 1000)
                    {
                        xPos  = 0 + xAdj;
                        yPos += 425;
                    }
                }
                patientsPrinted++;
            }            //while
            pagesPrinted++;
            if (pagesPrinted == totalPages)
            {
                ev.HasMorePages = false;
                pagesPrinted    = 0;
                patientsPrinted = 0;
            }
            else
            {
                ev.HasMorePages = true;
            }
        }
        private void pd2_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
        {
            Graphics   g             = e.Graphics;
            Pen        penDashBorder = new Pen(Color.Black, (float)(.125));
            SolidBrush brush         = new SolidBrush(Color.Black);

            penDashBorder.DashStyle = DashStyle.Dot;
            int      x;
            int      y;
            int      xAdj = (int)(PrefB.GetDouble("RxAdjustRight") * 100);
            int      yAdj = (int)(PrefB.GetDouble("RxAdjustDown") * 100);
            string   text;
            Font     font     = new Font(FontFamily.GenericSansSerif, 8);
            Font     fontRX   = new Font(FontFamily.GenericSerif, 24);
            Font     fontBold = new Font(FontFamily.GenericSansSerif, 8, FontStyle.Bold);
            int      fontH    = (int)font.GetHeight(g) + 3;
            Provider prov     = Providers.GetProv(RxPatCur.ProvNum);

            if (PrefB.GetBool("RxOrientVert"))
            {
                g.DrawLine(penDashBorder, 0 + xAdj, 0 + yAdj, 425 + xAdj, 0 + yAdj);
                g.DrawLine(penDashBorder, 0 + xAdj, 0 + yAdj, 0 + xAdj, 550 + yAdj);
                g.DrawLine(penDashBorder, 425 + xAdj, 0 + yAdj, 425 + xAdj, 550 + yAdj);
                g.DrawLine(penDashBorder, 0 + xAdj, 550 + yAdj, 425 + xAdj, 550 + yAdj);
            }
            else             //horizontal
            {
                g.DrawLine(penDashBorder, 0 + xAdj, 0 + yAdj, 550 + xAdj, 0 + yAdj);
                g.DrawLine(penDashBorder, 0 + xAdj, 0 + yAdj, 0 + xAdj, 425 + yAdj);
                g.DrawLine(penDashBorder, 550 + xAdj, 0 + yAdj, 550 + xAdj, 425 + yAdj);
                g.DrawLine(penDashBorder, 0 + xAdj, 425 + yAdj, 550 + xAdj, 425 + yAdj);
            }
            //Dr--------------------------------------------------------------------------------------------------
            //Left Side
            x    = 50 + xAdj;
            y    = 37 + yAdj;
            text = prov.FName + " " + prov.MI + " " + prov.LName + ", " + prov.Suffix;
            g.DrawString(text, fontBold, brush, x, y);
            y   += fontH;
            text = PrefB.GetString("PracticeAddress");
            g.DrawString(text, font, brush, x, y);
            y   += fontH;
            text = PrefB.GetString("PracticeAddress2");
            if (text != "")
            {
                g.DrawString(text, font, brush, x, y);
                y += fontH;
            }
            text = PrefB.GetString("PracticeCity") + ", " + PrefB.GetString("PracticeST") + " " + PrefB.GetString("PracticeZip");
            g.DrawString(text, font, brush, x, y);
            y = 100 + yAdj;
            if (PrefB.GetBool("RxOrientVert"))
            {
                g.DrawLine(Pens.Black, 25 + xAdj, y, 400 + xAdj, y);
            }
            else
            {
                g.DrawLine(Pens.Black, 25 + xAdj, y, 525 + xAdj, y);
            }
            //Right Side
            x    = 280 + xAdj;
            y    = 38 + yAdj;
            text = PrefB.GetString("PracticePhone");
            if (text.Length == 10)
            {
                text = "(" + text.Substring(0, 3) + ")" + text.Substring(3, 3) + "-" + text.Substring(6);
            }
            g.DrawString(text, font, brush, x, y);
            y   += fontH;
            text = RxPatCur.RxDate.ToShortDateString();
            g.DrawString(text, font, brush, x, y);
            y   += fontH;
            text = Lan.g(this, "DEA#: ") + prov.DEANum;
            g.DrawString(text, font, brush, x, y);
            //Patient---------------------------------------------------------------------------------------------------
            //Upper Left
            x    = 90 + xAdj;
            y    = 105 + yAdj;
            text = PatCur.GetNameFL();
            g.DrawString(text, fontBold, brush, x, y);
            y   += fontH;
            text = Lan.g(this, "DOB: ") + PatCur.Birthdate.ToShortDateString();
            g.DrawString(text, fontBold, brush, x, y);
            y   += fontH;
            text = PatCur.HmPhone;
            g.DrawString(text, font, brush, x, y);
            y += fontH;
            //x=280+xAdj;
            //y=120+yAdj;
            text = PatCur.Address;
            g.DrawString(text, font, brush, x, y);
            y   += fontH;
            text = PatCur.Address2;
            if (text != "")
            {
                g.DrawString(text, font, brush, x, y);
                y += fontH;
            }
            text = PatCur.City + ", " + PatCur.State + " " + PatCur.Zip;
            g.DrawString(text, font, brush, x, y);
            y += fontH;
            //RX-----------------------------------------------------------------------------------------------------
            y = 190 + yAdj;
            x = 40 + xAdj;
            g.DrawString(Lan.g(this, "Rx"), fontRX, brush, x, y);
            y = 205 + yAdj;
            x = 90 + xAdj;
            g.DrawString(RxPatCur.Drug, fontBold, brush, x, y);
            y += (int)(fontH * 1.5);
            g.DrawString(Lan.g(this, "Disp:") + "  " + RxPatCur.Disp, font, brush, x, y);
            y += (int)(fontH * 1.5);
            g.DrawString(Lan.g(this, "Sig:") + "  " + RxPatCur.Sig, font, brush, new RectangleF(x, y, 325, fontH * 2));
            y += (int)(fontH * 2.5);
            g.DrawString(Lan.g(this, "Refills:") + "  " + RxPatCur.Refills, font, brush, x, y);
            //Generic Subst----------------------------------------------------------------------------------------------
            if (PrefB.GetInt("RxGeneric") == 2)          //two signature lines
            {
                text = Lan.g(this, "Generic Substitution Permitted");
                if (PrefB.GetBool("RxOrientVert"))
                {
                    y = 380 + yAdj;
                    g.DrawLine(Pens.Black, 90 + xAdj, y, 325 + xAdj, y);
                    x = 207 + xAdj - (int)(g.MeasureString(text, font).Width / 2);
                }
                else
                {
                    y = 360 + yAdj;
                    g.DrawLine(Pens.Black, 50 + xAdj, y, 260 + xAdj, y);
                    x = 145 + xAdj - (int)(g.MeasureString(text, font).Width / 2);
                }
                y += 4;
                g.DrawString(text, font, brush, x, y);
            }
            else             //check boxes
            {
                x = 50 + xAdj;
                y = 343 + yAdj;
                g.DrawRectangle(Pens.Black, x, y, 12, 12);
                x   += 17;
                text = Lan.g(this, "Dispense as Written");
                g.DrawString(text, font, brush, x, y);
                x -= 17;
                y += 25;
                g.DrawRectangle(Pens.Black, x, y, 12, 12);
                if (PrefB.GetInt("RxGeneric") == 0)              //generic checked
                {
                    g.DrawLine(Pens.Black, x, y, x + 12, y + 12);
                    g.DrawLine(Pens.Black, x + 12, y, x, y + 12);
                }
                x   += 17;
                text = Lan.g(this, "Generic Substitution Permitted");
                g.DrawString(text, font, brush, x, y);
            }
            //Signature Line--------------------------------------------------------------------------------------------
            if (PrefB.GetInt("RxGeneric") == 2)          //two signature lines
            {
                text = Lan.g(this, "Dispense as Written");
            }
            else
            {
                text = Lan.g(this, "Signature of Prescriber");
            }
            if (PrefB.GetBool("RxOrientVert"))
            {
                y = 460 + yAdj;
                g.DrawLine(Pens.Black, 90 + xAdj, y, 325 + xAdj, y);
                x = 207 + xAdj - (int)(g.MeasureString(text, font).Width / 2);
            }
            else
            {
                y = 360 + yAdj;
                g.DrawLine(Pens.Black, 300 + xAdj, y, 530 + xAdj, y);
                x = 412 + xAdj - (int)(g.MeasureString(text, font).Width / 2);
            }
            y += 4;
            g.DrawString(text, font, brush, x, y);
            g.Dispose();
        }
        ///<summary>raised for each page to be printed.</summary>
        private void pdCards_PrintPage(object sender, PrintPageEventArgs ev)
        {
            int      totalPages = (int)Math.Ceiling((double)BirthdayTable.Rows.Count / (double)PrefB.GetInt("RecallPostcardsPerSheet"));
            Graphics g          = ev.Graphics;
            float    yPos       = 0; //these refer to the upper left origin of each postcard
            float    xPos       = 0;
            string   str;
            int      age;
            DateTime birthdate;

            while (yPos < ev.PageBounds.Height - 100 && patientsPrinted < BirthdayTable.Rows.Count)
            {
                //Return Address--------------------------------------------------------------------------
                if (PrefB.GetBool("RecallCardsShowReturnAdd"))
                {
                    str = PrefB.GetString("PracticeTitle") + "\r\n";
                    g.DrawString(str, new Font(FontFamily.GenericSansSerif, 9, FontStyle.Bold), Brushes.Black, xPos + 45, yPos + 60);
                    str = PrefB.GetString("PracticeAddress") + "\r\n";
                    if (PrefB.GetString("PracticeAddress2") != "")
                    {
                        str += PrefB.GetString("PracticeAddress2") + "\r\n";
                    }
                    str += PrefB.GetString("PracticeCity") + ",  " + PrefB.GetString("PracticeST") + "  " + PrefB.GetString("PracticeZip") + "\r\n";
                    string phone = PrefB.GetString("PracticePhone");
                    if (CultureInfo.CurrentCulture.Name == "en-US" && phone.Length == 10)
                    {
                        str += "(" + phone.Substring(0, 3) + ")" + phone.Substring(3, 3) + "-" + phone.Substring(6);
                    }
                    else                      //any other phone format
                    {
                        str += phone;
                    }
                    g.DrawString(str, new Font(FontFamily.GenericSansSerif, 8), Brushes.Black, xPos + 45, yPos + 75);
                }
                //Body text-------------------------------------------------------------------------------
                str = textPostcardMsg.Text;
                if (BirthdayTable.Rows[patientsPrinted]["Preferred"].ToString() != "")
                {
                    str = str.Replace("?FName", BirthdayTable.Rows[patientsPrinted]["Preferred"].ToString());
                }
                else
                {
                    str = str.Replace("?FName", BirthdayTable.Rows[patientsPrinted]["FName"].ToString());
                }
                birthdate = PIn.PDate(BirthdayTable.Rows[patientsPrinted]["Birthdate"].ToString());
                //age=Shared.DateToAge(birthdate,PIn.PDate(textDateTo.Text).AddDays(1));//age on the day after the range
                age = PIn.PInt(BirthdayTable.Rows[patientsPrinted]["Age"].ToString());
                str = str.Replace("?AgeOrdinal", Shared.NumberToOrdinal(age));
                str = str.Replace("?Age", age.ToString());
                g.DrawString(str, new Font(FontFamily.GenericSansSerif, 10), Brushes.Black, new RectangleF(xPos + 45, yPos + 180, 250, 190));
                //Patient's Address-----------------------------------------------------------------------
                str = BirthdayTable.Rows[patientsPrinted]["FName"].ToString() + " "
                      //+BirthdayTable.Rows[patientsPrinted]["MiddleI"].ToString()+" "
                      + BirthdayTable.Rows[patientsPrinted]["LName"].ToString() + "\r\n"
                      + BirthdayTable.Rows[patientsPrinted]["Address"].ToString() + "\r\n";
                if (BirthdayTable.Rows[patientsPrinted]["Address2"].ToString() != "")
                {
                    str += BirthdayTable.Rows[patientsPrinted]["Address2"].ToString() + "\r\n";
                }
                str += BirthdayTable.Rows[patientsPrinted]["City"].ToString() + ", "
                       + BirthdayTable.Rows[patientsPrinted]["State"].ToString() + "   "
                       + BirthdayTable.Rows[patientsPrinted]["Zip"].ToString() + "\r\n";
                g.DrawString(str, new Font(FontFamily.GenericSansSerif, 11), Brushes.Black, xPos + 320, yPos + 240);
                if (PrefB.GetInt("RecallPostcardsPerSheet") == 1)
                {
                    yPos += 400;
                }
                else if (PrefB.GetInt("RecallPostcardsPerSheet") == 3)
                {
                    yPos += 366;
                }
                else                  //4
                {
                    xPos += 550;
                    if (xPos > 1000)
                    {
                        xPos  = 0;
                        yPos += 425;
                    }
                }
                patientsPrinted++;
            }            //while
            pagesPrinted++;
            if (pagesPrinted == totalPages)
            {
                ev.HasMorePages = false;
                pagesPrinted    = 0;
                patientsPrinted = 0;
            }
            else
            {
                ev.HasMorePages = true;
            }
        }
Exemple #30
0
 private void FormDepositEdit_Load(object sender, System.EventArgs e)
 {
     if (IsNew)
     {
         if (!Security.IsAuthorized(Permissions.DepositSlips, DateTime.Today))
         {
             //we will check the date again when saving
             DialogResult = DialogResult.Cancel;
             return;
         }
     }
     else
     {
         //We enforce security here based on date displayed, not date entered
         if (!Security.IsAuthorized(Permissions.DepositSlips, DepositCur.DateDeposit))
         {
             butOK.Enabled     = false;
             butDelete.Enabled = false;
         }
     }
     if (IsNew)
     {
         textDateStart.Text = PIn.PDate(PrefB.GetString("DateDepositsStarted")).ToShortDateString();
         if (PrefB.GetBool("EasyNoClinics"))
         {
             comboClinic.Visible = false;
             labelClinic.Visible = false;
         }
         comboClinic.Items.Clear();
         comboClinic.Items.Add(Lan.g(this, "all"));
         comboClinic.SelectedIndex = 0;
         for (int i = 0; i < Clinics.List.Length; i++)
         {
             comboClinic.Items.Add(Clinics.List[i].Description);
         }
         for (int i = 0; i < DefB.Short[(int)DefCat.PaymentTypes].Length; i++)
         {
             listPayType.Items.Add(DefB.Short[(int)DefCat.PaymentTypes][i].ItemName);
             listPayType.SetSelected(i, true);
         }
         textDepositAccount.Visible = false;              //this is never visible for new. It's a description if already attached.
         if (Accounts.DepositsLinked())
         {
             DepositAccounts = Accounts.GetDepositAccounts();
             for (int i = 0; i < DepositAccounts.Length; i++)
             {
                 comboDepositAccount.Items.Add(Accounts.GetDescript(DepositAccounts[i]));
             }
             comboDepositAccount.SelectedIndex = 0;
         }
         else
         {
             labelDepositAccount.Visible = false;
             comboDepositAccount.Visible = false;
         }
     }
     else
     {
         groupSelect.Visible   = false;
         gridIns.SelectionMode = GridSelectionMode.None;
         gridPat.SelectionMode = GridSelectionMode.None;
         //we never again let user change the deposit linking again from here.
         //They need to detach it from within the transaction
         //Might be enhanced later to allow, but that's very complex.
         Transaction trans = Transactions.GetAttachedToDeposit(DepositCur.DepositNum);
         if (trans == null)
         {
             labelDepositAccount.Visible = false;
             comboDepositAccount.Visible = false;
             textDepositAccount.Visible  = false;
         }
         else
         {
             comboDepositAccount.Enabled = false;
             labelDepositAccount.Text    = Lan.g(this, "Deposited into Account");
             ArrayList jeAL = JournalEntries.GetForTrans(trans.TransactionNum);
             for (int i = 0; i < jeAL.Count; i++)
             {
                 if (Accounts.GetAccount(((JournalEntry)jeAL[i]).AccountNum).AcctType == AccountType.Asset)
                 {
                     comboDepositAccount.Items.Add(Accounts.GetDescript(((JournalEntry)jeAL[i]).AccountNum));
                     comboDepositAccount.SelectedIndex = 0;
                     textDepositAccount.Text           = ((JournalEntry)jeAL[i]).DateDisplayed.ToShortDateString()
                                                         + " " + ((JournalEntry)jeAL[i]).DebitAmt.ToString("c");
                     break;
                 }
             }
         }
     }
     textDate.Text            = DepositCur.DateDeposit.ToShortDateString();
     textAmount.Text          = DepositCur.Amount.ToString("F");
     textBankAccountInfo.Text = DepositCur.BankAccountInfo;
     FillGrids();
     if (IsNew)
     {
         gridPat.SetSelected(true);
         gridIns.SetSelected(true);
     }
     ComputeAmt();
 }