private void FormAccountingLock_Load(object sender, EventArgs e) { if (PrefB.GetDate("AccountingLockDate").Year > 1880) { textDate.Text = PrefB.GetDate("AccountingLockDate").ToShortDateString(); } }
///<summary></summary> public void FormDocInfo_Load(object sender, System.EventArgs e) { //if (Docs.Cur.FileName.Equals(null)) listCategory.Items.Clear(); for (int i = 0; i < DefB.Short[(int)DefCat.ImageCats].Length; i++) { listCategory.Items.Add(DefB.Short[(int)DefCat.ImageCats][i].ItemName); if (DefB.Short[(int)DefCat.ImageCats][i].DefNum == DocCur.DocCategory) { listCategory.SelectedIndex = i; } } if (DocCur.DocCategory == 0) { listCategory.SelectedIndex = 0; } listType.Items.Clear(); listType.Items.AddRange(Enum.GetNames(typeof(ImageType))); listType.SelectedIndex = (int)DocCur.ImgType; textDate.Text = DocCur.DateCreated.ToString("d"); textDescript.Text = DocCur.Description; textFileName.Text = PrefB.GetString("DocPath") + PatCur.ImageFolder.Substring(0, 1) + @"\" + PatCur.ImageFolder + @"\" + DocCur.FileName; if (File.Exists(textFileName.Text)) { FileInfo fileInfo = new FileInfo(textFileName.Text); textSize.Text = fileInfo.Length.ToString("n0"); } textToothNumbers.Text = Tooth.FormatRangeForDisplay(DocCur.ToothNumbers); //textNote.Text=DocCur.Note; }
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></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); }
private void FormSecurity_Load(object sender, System.EventArgs e) { FillTreePermissionsInitial(); FillTreeUsers(); FillTreePerm(); checkTimecardSecurityEnabled.Checked = PrefB.GetBool("TimecardSecurityEnabled"); }
///<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 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 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; }
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")); }
private void butImport_Click(object sender, EventArgs e) { OpenFileDialog openDlg = new OpenFileDialog(); openDlg.InitialDirectory = PrefB.GetString("ExportPath"); if (openDlg.ShowDialog() != DialogResult.OK) { return; } int rowsInserted = 0; try { rowsInserted = ImportProcCodes(openDlg.FileName, true); } catch (ApplicationException ex) { MessageBox.Show(ex.Message); FillGrid(); return; } MessageBox.Show("Procedure codes inserted: " + rowsInserted); DataValid.SetInvalid(InvalidTypes.Defs); changed = true; FillCats(); FillGrid(); SecurityLogs.MakeLogEntry(Permissions.Setup, 0, "Imported Procedure Codes"); }
private void butExport_Click(object sender, System.EventArgs e) { if (listClaimForms.SelectedIndex == -1) { MessageBox.Show(Lan.g(this, "Please select an item first.")); return; } ClaimForm ClaimFormCur = ClaimForms.ListLong[listClaimForms.SelectedIndex]; SaveFileDialog saveDlg = new SaveFileDialog(); string filename = "ClaimForm" + ClaimFormCur.Description + ".xml"; saveDlg.InitialDirectory = PrefB.GetString("ExportPath"); saveDlg.FileName = filename; if (saveDlg.ShowDialog() != DialogResult.OK) { return; } //MessageBox.Show(saveDlg.FileName); XmlSerializer serializer = new XmlSerializer(typeof(ClaimForm)); TextWriter writer = new StreamWriter(saveDlg.FileName); serializer.Serialize(writer, ClaimFormCur); writer.Close(); MessageBox.Show("Exported"); }
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 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; } } }
///<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 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; } }
///<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); }
private void FormFinanceCharges_Load(object sender, System.EventArgs e) { if (PIn.PDate(PrefB.GetString("DateLastAging")) < DateTime.Today) { if (MsgBox.Show(this, true, "You must update aging first.")) //OK { FormAging FormA = new FormAging(); FormA.ShowDialog(); } else { DialogResult = DialogResult.Cancel; return; } } if (PIn.PDate(PrefB.GetString("FinanceChargeLastRun")).AddDays(25) > DateTime.Today) { MessageBox.Show(Lan.g(this, "You cannot run finance charges again this month.")); DialogResult = DialogResult.Cancel; return; } textAPR.MaxVal = 100; textAPR.MinVal = 0; FillList(); textAPR.Text = PrefB.GetString("FinanceChargeAPR"); textDate.Text = DateTime.Today.ToShortDateString(); }
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"); }
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; }
///<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"); } }
private void butEditPaths_Click(object sender, System.EventArgs e) { FormPath FormP = new FormPath(); FormP.ShowDialog(); mergePath = PrefB.GetString("LetterMergePath"); textPath.Text = mergePath; }
///<summary>Returns the most preferred fully qualified network path or null if no valid paths were found.</summary> public static string GetPreferredImagePath() { if (!PrefB.UsingAtoZfolder) { return(null); } return(GetPreferredImagePath(PrefB.GetString("DocPath"))); }
private void FormEmailSetup_Load(object sender, System.EventArgs e) { textSMTPserver.Text = ((Pref)PrefB.HList["EmailSMTPserver"]).ValueString; textUsername.Text = PrefB.GetString("EmailUsername"); textPassword.Text = PrefB.GetString("EmailPassword"); textPort.Text = PrefB.GetString("EmailPort"); textSender.Text = ((Pref)PrefB.HList["EmailSenderAddress"]).ValueString; }
///<summary>Called in two places. Once from RefreshLocalData, and also from FormBackups after a restore.</summary> public static bool CheckProgramVersion() { Version storedVersion = new Version(PrefB.GetString("ProgramVersion")); Version currentVersion = new Version(Application.ProductVersion); string database = ""; string command = ""; if (FormChooseDatabase.DBtype == DatabaseType.MySql) { command = "SELECT database()"; DataTable table = General.GetTable(command); database = PIn.PString(table.Rows[0][0].ToString()); } if (storedVersion < currentVersion) { UpdateString("ProgramVersion", currentVersion.ToString()); Prefs.Refresh(); } if (storedVersion > currentVersion) { if (File.Exists(PrefB.GetString("DocPath") + "Setup.exe")) { if (MessageBox.Show("You are attempting to run version " + currentVersion.ToString(3) + ",\r\n" + "But the database " + database + "\r\n" + "is already using version " + storedVersion.ToString(3) + ".\r\n" + "A newer version must have already been installed on at least one computer.\r\n" + "The setup program stored in your A to Z folder will now be launched.\r\n" + "Or, if you hit Cancel, then you will have the option to download again." , "", MessageBoxButtons.OKCancel) == DialogResult.Cancel) { if (MessageBox.Show("Download again?", "", MessageBoxButtons.OKCancel) == DialogResult.OK) { FormUpdate FormU = new FormUpdate(); FormU.ShowDialog(); } Application.Exit(); return(false); } try { Process.Start(PrefB.GetString("DocPath") + "Setup.exe"); } catch { MessageBox.Show("Could not launch Setup.exe"); } } else if (MessageBox.Show("A newer version has been installed on at least one computer, but Setup.exe could not be found in " + PrefB.GetString("DocPath") + ". Download again?", "", MessageBoxButtons.OKCancel) == DialogResult.OK) { FormUpdate FormU = new FormUpdate(); FormU.ShowDialog(); } Application.Exit(); //always exits, whether launch of setup worked or no return(false); } return(true); }
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; }
private void FillSearchOption() { checkUseSearch.Checked = PrefB.GetBool("PatientSelectUsesSearchButton"); if (checkUseSearch.Checked) { butSearch.Enabled = true; } else { butSearch.Enabled = false; } }
private void FormApptViews_Load(object sender, System.EventArgs e) { FillViewList(); if (PrefB.GetInt("AppointmentTimeIncrement") == 10) { radioTen.Checked = true; } else { radioFifteen.Checked = true; } }
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"); }
///<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; }