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);
     }
 }
Esempio n. 2
0
 private void FormScheduleDay_Load(object sender, System.EventArgs e)
 {
     labelDate.Text = SchedCurDate.ToString("dddd") + " " + SchedCurDate.ToShortDateString();
     SchedList      = Schedules.RefreshDayEdit(SchedCurDate);     //only does this on startup
     //listProv
     for (int i = 0; i < Providers.List.Length; i++)
     {
         listProv.Items.Add(Providers.List[i].Abbr);
         //listProv.SetSelected(i,true);
     }
     for (int i = 0; i < Employees.ListShort.Length; i++)
     {
         listEmp.Items.Add(Employees.ListShort[i].FName);
         //listEmp.SetSelected(i,true);
     }
     FillGrid();
     for (int i = 0; i < Providers.List.Length; i++)
     {
         comboProv.Items.Add(Providers.List[i].Abbr);
         if (Providers.List[i].ProvNum == PrefB.GetInt("ScheduleProvUnassigned"))
         {
             comboProv.SelectedIndex = i;
         }
     }
 }
Esempio n. 3
0
        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();
        }
Esempio n. 4
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;
     }
 }
Esempio n. 5
0
 private static int GetProvBarIndex(DateTime time)
 {
     return((int)(((double)time.Hour * (double)60 / (double)PrefB.GetInt("AppointmentTimeIncrement")        //aptTimeIncr=minutesPerIncr
                   + (double)time.Minute / (double)PrefB.GetInt("AppointmentTimeIncrement"))
                  * (double)ContrApptSheet.Lh * ContrApptSheet.RowsPerIncr)
            / ContrApptSheet.Lh);           //rounds down
 }
 ///<summary>Used from SetLocation. Also used for Next apt and pinboard instead of SetLocation so that the location won't be altered.</summary>
 public void SetSize()
 {
     patternShowing = GetPatternShowing(DataRoww["Pattern"].ToString());
     //height is based on original 5 minute pattern. Might result in half-rows
     Height = DataRoww["Pattern"].ToString().Length *ContrApptSheet.Lh *ContrApptSheet.RowsPerIncr;
     //if(ContrApptSheet.TwoRowsPerIncrement){
     //	Height=Height*2;
     //}
     if (PrefB.GetInt("AppointmentTimeIncrement") == 10)
     {
         Height = Height / 2;
     }
     else             //15 minute increments
     {
         Height = Height / 3;
     }
     if (ThisIsPinBoard)
     {
         if (Height > ContrAppt.PinboardSize.Height - 4)
         {
             Height = ContrAppt.PinboardSize.Height - 4;
         }
         if (Width > ContrAppt.PinboardSize.Width - 4)
         {
             Width = ContrAppt.PinboardSize.Width - 4;
         }
     }
 }
        private void butOK_Click(object sender, System.EventArgs e)
        {
            RepeatCharge[] chargeList = RepeatCharges.Refresh(0);
            int            countAdded = 0;
            DateTime       possibleDate;
            Procedure      proc;

            for (int i = 0; i < chargeList.Length; i++)
            {
                if (chargeList[i].DateStart > DateTime.Today)              //not started yet
                {
                    continue;
                }
                //if(chargeList[i].DateStop.Year>1880//not blank
                //	&& chargeList[i].DateStop<DateTime.Today)//but already ended
                //{
                //	continue;
                //}
                //get a list dates of all completed procedures with this Code and patNum
                ArrayList ALdates = RepeatCharges.GetDates(ProcedureCodes.GetCodeNum(chargeList[i].ProcCode), chargeList[i].PatNum);
                possibleDate = chargeList[i].DateStart;
                //start looping through possible dates, beginning with the start date of the repeating charge
                while (possibleDate <= DateTime.Today)
                {
                    if (possibleDate < DateTime.Today.AddMonths(-3))
                    {
                        possibleDate = possibleDate.AddMonths(1);
                        continue;                        //don't go back more than three months
                    }
                    //check to see if the possible date is present in the list
                    if (ALdates.Contains(possibleDate))
                    {
                        possibleDate = possibleDate.AddMonths(1);
                        continue;
                    }
                    if (chargeList[i].DateStop.Year > 1880 &&              //not blank
                        chargeList[i].DateStop < possibleDate)                           //but already ended
                    {
                        break;
                    }
                    //otherwise, insert a procedure to db
                    proc             = new Procedure();
                    proc.CodeNum     = ProcedureCodes.GetCodeNum(chargeList[i].ProcCode);
                    proc.DateEntryC  = DateTime.Today;
                    proc.PatNum      = chargeList[i].PatNum;
                    proc.ProcDate    = possibleDate;
                    proc.ProcFee     = chargeList[i].ChargeAmt;
                    proc.ProcStatus  = ProcStat.C;
                    proc.ProvNum     = PrefB.GetInt("PracticeDefaultProv");
                    proc.MedicalCode = ProcedureCodes.GetProcCode(proc.CodeNum).MedicalCode;
                    proc.BaseUnits   = ProcedureCodes.GetProcCode(proc.CodeNum).BaseUnits;
                    Procedures.Insert(proc);                    //no recall synch needed because dental offices don't use this feature
                    countAdded++;
                    possibleDate = possibleDate.AddMonths(1);
                }
            }
            MessageBox.Show(countAdded.ToString() + " " + Lan.g(this, "procedures added."));
            DialogResult = DialogResult.OK;
        }
Esempio n. 8
0
 ///<summary>Called from ContrAppt.comboView_SelectedIndexChanged and ContrAppt.RefreshVisops. So, whenever appt Module layout and when comboView is changed.</summary>
 public void ComputeColWidth(int totalWidth)
 {
     if (ApptViewItems.VisOps == null || ApptViewItems.VisProvs == null)
     {
         return;
     }
     try{
         if (RowsPerIncr == 0)
         {
             RowsPerIncr = 1;
         }
         ColCount = ApptViewItems.VisOps.Length;
         if (IsWeeklyView)
         {
             //ColCount=NumOfWeekDaysToDisplay;
             ProvCount = 0;
         }
         else
         {
             ProvCount = ApptViewItems.VisProvs.Length;
         }
         if (ColCount == 0)
         {
             ColWidth = 0;
         }
         else
         {
             if (IsWeeklyView)
             {
                 ColDayWidth = (totalWidth - TimeWidth * 2) / NumOfWeekDaysToDisplay;
                 ColAptWidth = (float)(ColDayWidth - 1) / (float)ColCount;
                 ColWidth    = (totalWidth - TimeWidth * 2 - ProvWidth * ProvCount) / ColCount;
             }
             else
             {
                 ColWidth = (totalWidth - TimeWidth * 2 - ProvWidth * ProvCount) / ColCount;
             }
         }
         MinPerIncr = PrefB.GetInt("AppointmentTimeIncrement");
         MinPerRow  = (float)MinPerIncr / (float)RowsPerIncr;
         RowsPerHr  = 60 / MinPerIncr * RowsPerIncr;
         //if(TwoRowsPerIncrement){
         //MinPerRow=MinPerRow/2;
         //RowsPerHr=RowsPerHr*2;
         //}
         Height = Lh * 24 * RowsPerHr;
         if (IsWeeklyView)
         {
             Width = TimeWidth * 2 + ColDayWidth * NumOfWeekDaysToDisplay;
         }
         else
         {
             Width = TimeWidth * 2 + ProvWidth * ProvCount + ColWidth * ColCount;
         }
     }
     catch {
         MessageBox.Show("error computing width");
     }
 }
Esempio n. 9
0
 private void FormScannerSetup_Load(object sender, System.EventArgs e)
 {
     //Prefs.Cur=(Pref)PrefB.HList["ScannerCompression"];
     //try{
     //trackQ.Value=Convert.ToInt32(Prefs.Cur.ValueString);
     //}
     //catch{}
     trackQ.Value = PrefB.GetInt("ScannerCompression");
     //textCropDelta.Text=
     //((Pref)PrefB.HList["CropDelta"]).ValueString;
 }
Esempio n. 10
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");
 }
Esempio n. 11
0
 private void FormApptViews_Load(object sender, System.EventArgs e)
 {
     FillViewList();
     if (PrefB.GetInt("AppointmentTimeIncrement") == 10)
     {
         radioTen.Checked = true;
     }
     else
     {
         radioFifteen.Checked = true;
     }
 }
Esempio n. 12
0
        ///<summary></summary>
        private void butSend_Click(object sender, System.EventArgs e)
        {
            //this will not be available if already sent.
            if (textFromAddress.Text == "" ||
                textToAddress.Text == "")
            {
                MessageBox.Show("Addresses not allowed to be blank.");
                return;
            }
            if (((Pref)PrefB.HList["EmailSMTPserver"]).ValueString == "")
            {
                MsgBox.Show(this, "You need to enter an SMTP server name in e-mail setup before you can send e-mail.");
                return;
            }
            Cursor = Cursors.WaitCursor;
            SmtpClient client = new SmtpClient(PrefB.GetString("EmailSMTPserver"), PrefB.GetInt("EmailPort"));

            //The default credentials are not used by default, according to:
            //http://msdn2.microsoft.com/en-us/library/system.net.mail.smtpclient.usedefaultcredentials.aspx
            client.Credentials    = new NetworkCredential(PrefB.GetString("EmailUsername"), PrefB.GetString("EmailPassword"));
            client.DeliveryMethod = SmtpDeliveryMethod.Network;
            MailMessage message = new MailMessage();
            Attachment  attach;

            try{
                message.From = new MailAddress(textFromAddress.Text);
                message.To.Add(textToAddress.Text);                //this might fail
                message.Subject    = textSubject.Text;
                message.Body       = textBodyText.Text;
                message.IsBodyHtml = false;
                string attachPath = GetAttachPath();
                for (int i = 0; i < MessageCur.Attachments.Count; i++)
                {
                    attach = new Attachment(ODFileUtils.CombinePaths(attachPath, MessageCur.Attachments[i].ActualFileName));
                    //@"C:\OpenDentalData\EmailAttachments\1");
                    attach.Name = MessageCur.Attachments[i].DisplayedFileName;
                    //"canadian.gif";
                    message.Attachments.Add(attach);
                }
                client.Send(message);
            }
            catch (System.Exception ex) {
                Cursor = Cursors.Default;
                MessageBox.Show(ex.Message);
                return;
            }
            MsgBox.Show(this, "Sent");
            Cursor = Cursors.Default;
            //MessageCur.MsgDateTime=DateTime.Now;
            MessageCur.SentOrReceived = CommSentOrReceived.Sent;
            SaveMsg();
            DialogResult = DialogResult.OK;
        }
Esempio n. 13
0
        private void butPostcards_Click(object sender, System.EventArgs e)
        {
            if (gridMain.Rows.Count < 1)
            {
                MessageBox.Show(Lan.g(this, "There are no Patients in the Recall table.  Must have at least one to print."));
                return;
            }
            if (gridMain.SelectedIndices.Length == 0)
            {
                gridMain.SetSelected(true);
            }
            int[] PatNums;
            PatNums = new int[gridMain.SelectedIndices.Length];
            for (int i = 0; i < PatNums.Length; i++)
            {
                PatNums[i] = PIn.PInt(table.Rows[gridMain.SelectedIndices[i]]["PatNum"].ToString());
                //((RecallItem)gridMain.Rows[gridMain.SelectedIndices[i]].Tag).PatNum;
            }
            if (MsgBox.Show(this, true, "Make a commlog entry of 'postcard sent' for all of the selected patients?"))
            {
                for (int i = 0; i < PatNums.Length; i++)
                {
                    //make commlog entries for each patient
                    Commlogs.InsertForRecallPostcard(PatNums[i]);
                }
            }
            AddrTable       = Recalls.GetAddrTable(PatNums, checkGroupFamilies.Checked);
            pagesPrinted    = 0;
            patientsPrinted = 0;
            pd                             = new PrintDocument();
            pd.PrintPage                  += new PrintPageEventHandler(this.pdCards_PrintPage);
            pd.OriginAtMargins             = true;
            pd.DefaultPageSettings.Margins = new Margins(0, 0, 0, 0);
            if (PrefB.GetInt("RecallPostcardsPerSheet") == 1)
            {
                pd.DefaultPageSettings.PaperSize = new PaperSize("Postcard", 400, 600);
                pd.DefaultPageSettings.Landscape = true;
            }
            else if (PrefB.GetInt("RecallPostcardsPerSheet") == 3)
            {
                pd.DefaultPageSettings.PaperSize = new PaperSize("Postcard", 850, 1100);
            }
            else             //4
            {
                pd.DefaultPageSettings.PaperSize = new PaperSize("Postcard", 850, 1100);
                pd.DefaultPageSettings.Landscape = true;
            }
            int totalPages = (int)Math.Ceiling((double)AddrTable.Rows.Count / (double)PrefB.GetInt("RecallPostcardsPerSheet"));

            printPreview = new OpenDental.UI.PrintPreview(PrintSituation.Postcard, pd, totalPages);
            printPreview.ShowDialog();
        }
Esempio n. 14
0
        private void FormImagingSetup_Load(object sender, System.EventArgs e)
        {
            textDoc.Text  = PrefB.GetInt("ScannerCompression").ToString();
            slider.MinVal = PrefB.GetInt("ImageWindowingMin");
            slider.MaxVal = PrefB.GetInt("ImageWindowingMax");
            int exposureLevelVal = PrefB.GetInt("XRayExposureLevel");

            if (exposureLevelVal < (int)xRayExposureLevel.Minimum || exposureLevelVal > (int)xRayExposureLevel.Maximum)
            {
                exposureLevelVal = (int)xRayExposureLevel.Minimum;              //Play it safe with the default exposure.
            }
            xRayExposureLevel.Value = exposureLevelVal;
        }
Esempio n. 15
0
        ///<summary>Called from SetLocation to establish Y position of control.  Also called from ContrAppt.RefreshDay when determining provBar markings. Does not round to the nearest row.</summary>
        public int ConvertToY()
        {
            int retVal = (int)(((double)Info.MyApt.AptDateTime.Hour * (double)60
                                / (double)PrefB.GetInt("AppointmentTimeIncrement")
                                + (double)Info.MyApt.AptDateTime.Minute
                                / (double)PrefB.GetInt("AppointmentTimeIncrement")
                                ) * (double)ContrApptSheet.Lh * ContrApptSheet.RowsPerIncr);

            //if(ContrApptSheet.TwoRowsPerIncrement){
            //	retVal=retVal*2;
            //}
            return(retVal);           //(Info.MyApt.AptDateTime.Hour*6+)*ContrApptSheet.Lh;
        }
Esempio n. 16
0
 ///<summary>Checks the loaded prefs and accountingAutoPays to see if user has setup auto pay linking.  Returns true if so.</summary>
 public static bool PaymentsLinked()
 {
     if (AccountingAutoPays.AList.Count == 0)
     {
         return(false);
     }
     if (PrefB.GetInt("AccountingIncomeAccount") == 0)
     {
         return(false);
     }
     //might add a few more checks later.
     return(true);
 }
        private void FormTrojanCollectSetup_Load(object sender, EventArgs e)
        {
            textExportFolder.Text = PrefB.GetString("TrojanExpressCollectPath");
            int billtype = PrefB.GetInt("TrojanExpressCollectBillingType");

            for (int i = 0; i < DefB.Short[(int)DefCat.BillingTypes].Length; i++)
            {
                comboBillType.Items.Add(DefB.Short[(int)DefCat.BillingTypes][i].ItemName);
                if (DefB.Short[(int)DefCat.BillingTypes][i].DefNum == billtype)
                {
                    comboBillType.SelectedIndex = i;
                }
            }
        }
Esempio n. 18
0
 ///<summary>There are three different choices for getting the billing provider.  One of the three is to use the treating provider, so supply that as an argument.  It will return a valid provNum unless the supplied treatProv was invalid.</summary>
 public static int GetBillingProvNum(int treatProv)
 {
     if (PrefB.GetInt("InsBillingProv") == 0)           //default=0
     {
         return(PrefB.GetInt("PracticeDefaultProv"));
     }
     else if (PrefB.GetInt("InsBillingProv") == -1)           //treat=-1
     {
         return(treatProv);
     }
     else
     {
         return(PrefB.GetInt("InsBillingProv"));
     }
 }
Esempio n. 19
0
        ///<summary>Checks the loaded prefs to see if user has setup deposit linking.  Returns true if so.</summary>
        public static bool DepositsLinked()
        {
            string depAccounts = PrefB.GetString("AccountingDepositAccounts");

            if (depAccounts == "")
            {
                return(false);
            }
            if (PrefB.GetInt("AccountingIncomeAccount") == 0)
            {
                return(false);
            }
            //might add a few more checks later.
            return(true);
        }
Esempio n. 20
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (PrefB.GetInt("AppointmentTimeIncrement") == 15 &&
         radioTen.Checked)
     {
         Prefs.UpdateInt("AppointmentTimeIncrement", 10);
         DataValid.SetInvalid(InvalidTypes.Prefs);
     }
     if (PrefB.GetInt("AppointmentTimeIncrement") == 10 &&
         radioFifteen.Checked)
     {
         Prefs.UpdateInt("AppointmentTimeIncrement", 15);
         DataValid.SetInvalid(InvalidTypes.Prefs);
     }
     DialogResult = DialogResult.OK;
 }
Esempio n. 21
0
        ///<summary>Updates a pref of type int.  Returns true if a change was required, or false if no change needed.</summary>
        public static bool UpdateInt(string prefName, int newValue)
        {
            if (!PrefB.HList.ContainsKey(prefName))
            {
                MessageBox.Show(prefName + " is an invalid pref name.");
                return(false);
            }
            if (PrefB.GetInt(prefName) == newValue)
            {
                return(false);               //no change needed
            }
            string command = "UPDATE preference SET "
                             + "ValueString = '" + POut.PInt(newValue) + "' "
                             + "WHERE PrefName = '" + POut.PString(prefName) + "'";

            General.NonQ(command);
            return(true);
        }
Esempio n. 22
0
 private void butPostcards_Click(object sender, System.EventArgs e)
 {
     if (table.Rows.Count == 0)
     {
         MessageBox.Show(Lan.g(this, "There are no appointments in the list.  Must have at least one to print."));
         return;
     }
     if (grid.SelectedIndices.Length == 0)
     {
         for (int i = 0; i < table.Rows.Count; i++)
         {
             grid.SetSelected(i, true);
         }
     }
     int[] aptNums = new int[grid.SelectedIndices.Length];
     for (int i = 0; i < aptNums.Length; i++)
     {
         aptNums[i] = PIn.PInt(table.Rows[grid.SelectedIndices[i]]["AptNum"].ToString());
     }
     AddrTable       = Appointments.GetAddrTable(aptNums);
     pagesPrinted    = 0;
     patientsPrinted = 0;
     pd                             = new PrintDocument();
     pd.PrintPage                  += new PrintPageEventHandler(this.pdCards_PrintPage);
     pd.OriginAtMargins             = true;
     pd.DefaultPageSettings.Margins = new Margins(0, 0, 0, 0);
     if (PrefB.GetInt("RecallPostcardsPerSheet") == 1)
     {
         pd.DefaultPageSettings.PaperSize = new PaperSize("Postcard", 400, 600);
         pd.DefaultPageSettings.Landscape = true;
     }
     else if (PrefB.GetInt("RecallPostcardsPerSheet") == 3)
     {
         pd.DefaultPageSettings.PaperSize = new PaperSize("Postcard", 850, 1100);
     }
     else             //4
     {
         pd.DefaultPageSettings.PaperSize = new PaperSize("Postcard", 850, 1100);
         pd.DefaultPageSettings.Landscape = true;
     }
     printPreview = new OpenDental.UI.PrintPreview(PrintSituation.Postcard, pd,
                                                   (int)Math.Ceiling((double)AddrTable.Rows.Count / (double)PrefB.GetInt("RecallPostcardsPerSheet")));
     printPreview.ShowDialog();
 }
Esempio n. 23
0
        private void FormImagingSetup_Load(object sender, System.EventArgs e)
        {
            comboType.Items.Add("B");
            comboType.Items.Add("D");
            textDoc.Text        = PrefB.GetInt("ScannerCompression").ToString();
            slider.MinVal       = PrefB.GetInt("ImageWindowingMin");
            slider.MaxVal       = PrefB.GetInt("ImageWindowingMax");
            computerPrefs       = ComputerPrefs.GetForLocalComputer();
            upDownPort.Value    = computerPrefs.SensorPort;
            comboType.Text      = computerPrefs.SensorType;
            checkBinned.Checked = computerPrefs.SensorBinned;
            int exposureLevelVal = computerPrefs.SensorExposure;

            if (exposureLevelVal < (int)upDownExposure.Minimum || exposureLevelVal > (int)upDownExposure.Maximum)
            {
                exposureLevelVal = (int)upDownExposure.Minimum;              //Play it safe with the default exposure.
            }
            upDownExposure.Value = exposureLevelVal;
        }
Esempio n. 24
0
        ///<summary></summary>
        private void FillList()
        {
            ClaimForms.Refresh();
            listClaimForms.Items.Clear();
            string description;

            for (int i = 0; i < ClaimForms.ListLong.Length; i++)
            {
                description = ClaimForms.ListLong[i].Description;
                if (ClaimForms.ListLong[i].IsHidden)
                {
                    description += " (hidden)";
                }
                if (ClaimForms.ListLong[i].ClaimFormNum == PrefB.GetInt("DefaultClaimForm"))
                {
                    description += " (default)";
                }
                listClaimForms.Items.Add(description);
            }
        }
Esempio n. 25
0
        private void butPostcards_Click(object sender, EventArgs e)
        {
            if (errorProvider1.GetError(textDateFrom) != "" ||
                errorProvider1.GetError(textDateTo) != "")
            {
                MsgBox.Show(this, "Please fix data entry errors first.");
                return;
            }
            DateTime dateFrom = PIn.PDate(textDateFrom.Text);
            DateTime dateTo   = PIn.PDate(textDateTo.Text);

            if (dateTo < dateFrom)
            {
                MsgBox.Show(this, "To date cannot be before From date.");
                return;
            }
            BirthdayTable   = Patients.GetBirthdayList(dateFrom, dateTo);
            pagesPrinted    = 0;
            patientsPrinted = 0;
            pd                             = new PrintDocument();
            pd.PrintPage                  += new PrintPageEventHandler(this.pdCards_PrintPage);
            pd.OriginAtMargins             = true;
            pd.DefaultPageSettings.Margins = new Margins(0, 0, 0, 0);
            if (PrefB.GetInt("RecallPostcardsPerSheet") == 1)
            {
                pd.DefaultPageSettings.PaperSize = new PaperSize("Postcard", 400, 600);
                pd.DefaultPageSettings.Landscape = true;
            }
            else if (PrefB.GetInt("RecallPostcardsPerSheet") == 3)
            {
                pd.DefaultPageSettings.PaperSize = new PaperSize("Postcard", 850, 1100);
            }
            else              //4
            {
                pd.DefaultPageSettings.PaperSize = new PaperSize("Postcard", 850, 1100);
                pd.DefaultPageSettings.Landscape = true;
            }
            printPreview = new OpenDental.UI.PrintPreview(PrintSituation.Postcard, pd,
                                                          (int)Math.Ceiling((double)BirthdayTable.Rows.Count / (double)PrefB.GetInt("RecallPostcardsPerSheet")));
            printPreview.ShowDialog();
        }
Esempio n. 26
0
 private void FillList()
 {
     adjType      = PrefB.GetInt("FinanceChargeAdjustmentType");
     ALPosIndices = new ArrayList();
     listAdjType.Items.Clear();
     for (int i = 0; i < DefB.Short[(int)DefCat.AdjTypes].Length; i++)
     {
         if (DefB.Short[(int)DefCat.AdjTypes][i].ItemValue == "+")
         {
             ALPosIndices.Add(i);
             listAdjType.Items.Add(DefB.Short[(int)DefCat.AdjTypes][i].ItemName);
             if (DefB.Short[(int)DefCat.AdjTypes][i].DefNum == adjType)
             {
                 listAdjType.SelectedIndex = ALPosIndices.Count - 1;
             }
         }
     }
     if (listAdjType.SelectedIndex == -1)
     {
         listAdjType.SelectedIndex = 0;
     }
 }
Esempio n. 27
0
        ///<summary>This converts the dbPattern in 5 minute interval into the pattern that will be viewed based on RowsPerIncrement and AppointmentTimeIncrement.  So it will always depend on the current view.Therefore, it should only be used for visual display purposes rather than within the FormAptEdit. If height of appointment allows a half row, then this includes an increment for that half row.</summary>
        public static string GetPatternShowing(string dbPattern)
        {
            StringBuilder strBTime = new StringBuilder();

            for (int i = 0; i < dbPattern.Length; i++)
            {
                //strBTime.Append(dbPattern.Substring(i,1));
                for (int j = 0; j < ContrApptSheet.RowsPerIncr; j++)
                {
                    strBTime.Append(dbPattern.Substring(i, 1));
                }
                //if(ContrApptSheet.TwoRowsPerIncrement){
                //	strBTime.Append(dbPattern.Substring(i,1));
                //}
                i++;                //skip
                if (PrefB.GetInt("AppointmentTimeIncrement") == 15)
                {
                    i++;                    //skip another
                }
            }
            return(strBTime.ToString());
        }
Esempio n. 28
0
 ///<summary>Called from ContrAppt.comboView_SelectedIndexChanged and ContrAppt.RefreshVisops. So, whenever appt Module layout and when comboView is changed.</summary>
 public void ComputeColWidth(int totalWidth)
 {
     if (ApptViewItems.VisOps == null || ApptViewItems.VisProvs == null)
     {
         return;
     }
     try{
         if (RowsPerIncr == 0)
         {
             RowsPerIncr = 1;
         }
         ColCount  = ApptViewItems.VisOps.Length;
         ProvCount = ApptViewItems.VisProvs.Length;
         if (ColCount == 0)
         {
             ColWidth = 0;
         }
         else
         {
             ColWidth = (totalWidth - TimeWidth * 2 - ProvWidth * ProvCount) / ColCount;
         }
         MinPerIncr = PrefB.GetInt("AppointmentTimeIncrement");
         MinPerRow  = (float)MinPerIncr / (float)RowsPerIncr;
         RowsPerHr  = 60 / MinPerIncr * RowsPerIncr;
         //if(TwoRowsPerIncrement){
         //MinPerRow=MinPerRow/2;
         //RowsPerHr=RowsPerHr*2;
         //}
         Height = Lh * 24 * RowsPerHr;
         //if(TwoRowsPerIncrement){
         //	Height=Height*2;
         //}
         Width = TimeWidth * 2 + ProvWidth * ProvCount + ColWidth * ColCount;
     }
     catch {
         MessageBox.Show("error computing width");
     }
 }
        private void FormAccountingSetup_Load(object sender, EventArgs e)
        {
            string depStr = PrefB.GetString("AccountingDepositAccounts");

            string[] depStrArray = depStr.Split(new char[] { ',' });
            depAL = new ArrayList();
            for (int i = 0; i < depStrArray.Length; i++)
            {
                if (depStrArray[i] == "")
                {
                    continue;
                }
                depAL.Add(PIn.PInt(depStrArray[i]));
            }
            FillDepList();
            PickedDepAccountNum = PrefB.GetInt("AccountingIncomeAccount");
            textAccountInc.Text = Accounts.GetDescript(PickedDepAccountNum);
            //pay----------------------------------------------------------
            payAL = AccountingAutoPays.AList;          //Count might be 0
            FillPayGrid();
            PickedPayAccountNum     = PrefB.GetInt("AccountingCashIncomeAccount");
            textAccountCashInc.Text = Accounts.GetDescript(PickedPayAccountNum);
        }
Esempio n. 30
0
        public Document ImportCapturedImage(Bitmap image, short rotationAngle, int mountItemNum, int docCategory)
        {
            string   fileExtention = ".bmp";          //The file extention to save the greyscale image as.
            Document doc           = new Document();

            doc.MountItemNum   = mountItemNum;
            doc.DegreesRotated = rotationAngle;
            doc.ImgType        = ImageType.Radiograph;
            doc.FileName       = fileExtention;
            doc.DateCreated    = DateTime.Today;
            doc.PatNum         = Patient.PatNum;
            doc.DocCategory    = docCategory;
            doc.WindowingMin   = PrefB.GetInt("ImageWindowingMin");
            doc.WindowingMax   = PrefB.GetInt("ImageWindowingMax");
            Documents.Insert(doc, Patient);            //creates filename and saves to db
            try {
                SaveDocument(doc, image, ImageFormat.Bmp);
            }
            catch {
                Documents.Delete(doc);
                throw;
            }
            return(doc);
        }