private void FormReportsMore_Load(object sender,EventArgs e) { Plugins.HookAddCode(this,"FormReportsMore.FormReportsMore_Load_beginning"); butPW.Visible=Programs.IsEnabled(ProgramName.PracticeWebReports); //hiding feature for 13.3 //butPatList.Visible=PrefC.GetBool(PrefName.ShowFeatureEhr); butPatExport.Visible=PrefC.GetBool(PrefName.ShowFeatureEhr); FillLists(); if(ProgramProperties.IsAdvertisingDisabled(ProgramName.Podium)) { groupPatientReviews.Visible=false; } if(ProgramProperties.IsAdvertisingDisabled(ProgramName.DentalIntel) && ProgramProperties.IsAdvertisingDisabled(ProgramName.PracticeByNumbers)) { groupBusiness.Visible=false; } else if(ProgramProperties.IsAdvertisingDisabled(ProgramName.DentalIntel) || (!Programs.GetCur(ProgramName.DentalIntel).Enabled && Programs.GetCur(ProgramName.PracticeByNumbers).Enabled)) { //Don't show the marketing button if: //1. HQ wants to hide the button //2. The office wants to hide the button //3. The office is using PBN but not DentalIntel pictureDentalIntel.Visible=false; } else if(ProgramProperties.IsAdvertisingDisabled(ProgramName.PracticeByNumbers) || (!Programs.GetCur(ProgramName.PracticeByNumbers).Enabled && Programs.GetCur(ProgramName.DentalIntel).Enabled)) { //Don't show the marketing button if: //1. HQ wants to hide the button //2. The office wants to hide the button //3. The office is using DentalIntel but not PBN picturePracticeByNumbers.Visible=false; } }
private void butExtra_Click(object sender, EventArgs e) { Cursor = Cursors.WaitCursor; string programNum = ProgramProperties.GetPropVal(Programs.GetCur(ProgramName.Xcharge).ProgramNum, "PaymentType"); ReportSimpleGrid report = new ReportSimpleGrid(); report.Query = "SELECT payment.PatNum, LName, FName, payment.DateEntry,payment.PayDate, payment.PayNote,payment.PayAmt " + "FROM patient INNER JOIN payment ON payment.PatNum=patient.PatNum " + "LEFT JOIN (SELECT TransactionDateTime,ClerkID,BatchNum,ItemNum,PatNum,CCType,CreditCardNum,Expiration,Result,Amount FROM xchargetransaction " + "WHERE DATE(TransactionDateTime) BETWEEN " + POut.Date(date1.SelectionStart) + " AND " + POut.Date(date2.SelectionStart) + @") AS X " + "ON X.PatNum=payment.PatNum AND DATE(X.TransactionDateTime)=payment.DateEntry AND X.Amount=payment.PayAmt " + "WHERE PayType=" + programNum + " AND DateEntry BETWEEN " + POut.Date(date1.SelectionStart) + " AND " + POut.Date(date2.SelectionStart) + " " + "AND X.TransactionDateTime IS NULL " + "ORDER BY PayDate ASC, patient.LName"; FormQuery FormQuery2 = new FormQuery(report); FormQuery2.IsReport = true; FormQuery2.SubmitReportQuery(); report.Title = "Payments From " + date1.SelectionStart.ToShortDateString() + " To " + date2.SelectionStart.ToShortDateString(); report.SubTitle.Add("No Matching X-Charge Transactions for these Payments"); report.SetColumn(this, 0, "PatNum", 50); report.SetColumn(this, 1, "LName", 100); report.SetColumn(this, 2, "FName", 100); report.SetColumn(this, 3, "DateEntry", 100); report.SetColumn(this, 4, "PayDate", 100); report.SetColumn(this, 5, "PayNote", 150); report.SetColumn(this, 6, "PayAmt", 70, HorizontalAlignment.Right); Cursor = Cursors.Default; FormQuery2.ShowDialog(); }
private void butClose_Click(object sender, EventArgs e) { if (!textSubInterval.IsValid) { MsgBox.Show(this, "Please fix data entry errors first."); return; } if (comboPayType.SelectedIndex < 0) { MsgBox.Show(this, "Please select a payment type."); return; } Program prog = Programs.GetCur(ProgramName.FHIR); prog.Enabled = checkEnabled.Checked; Programs.Update(prog); ProgramProperty progProp = ProgramProperties.GetPropByDesc("SubscriptionProcessingFrequency", ProgramProperties.GetForProgram(prog.ProgramNum)); ProgramProperties.UpdateProgramPropertyWithValue(progProp, textSubInterval.Text); DataValid.SetInvalid(InvalidType.Programs); if (Prefs.UpdateLong(PrefName.ApiPaymentType, comboPayType.GetSelectedDefNum())) { DataValid.SetInvalid(InvalidType.Prefs); } Close(); }
private void FormAbout_Load(object sender, System.EventArgs e) { string softwareName = PrefC.GetString(PrefName.SoftwareName); if (Programs.GetCur(ProgramName.BencoPracticeManagement).Enabled) { pictureOpenDental.Image = Properties.Resources.bencoLogo; } if (softwareName != "Open Dental Software" && !Programs.GetCur(ProgramName.BencoPracticeManagement).Enabled) { pictureOpenDental.Visible = false; } labelVersion.Text = Lan.g(this, "Version:") + " " + Application.ProductVersion; UpdateHistory updateHistory = UpdateHistories.GetForVersion(Application.ProductVersion); if (updateHistory != null) { labelVersion.Text += " " + Lan.g(this, "Since:") + " " + updateHistory.DateTimeUpdated.ToShortDateString(); } //keeps the trailing year up to date labelCopyright.Text = softwareName + " " + Lan.g(this, "Copyright 2003-") + DateTime.Now.ToString("yyyy") + ", Jordan S. Sparks, D.M.D."; labelMySQLCopyright.Text = Lan.g(this, "MySQL - Copyright 1995-") + DateTime.Now.ToString("yyyy") + Lan.g(this, ", www.mysql.com"); //Database Server---------------------------------------------------------- List <string> serviceList = Computers.GetServiceInfo(); labelName.Text += serviceList[2].ToString(); //MiscData.GetODServer();//server name labelService.Text += serviceList[0].ToString(); //service name labelMySqlVersion.Text += serviceList[3].ToString(); //service version labelServComment.Text += serviceList[1].ToString(); //service comment labelMachineName.Text += Environment.MachineName.ToUpper(); //current client or remote application machine name }
private void FormPayConnectSetup_Load(object sender, EventArgs e) { _progCur = Programs.GetCur(ProgramName.PayConnect); if (_progCur == null) { MsgBox.Show(this, "The PayConnect entry is missing from the database."); //should never happen return; } checkEnabled.Checked = _progCur.Enabled; if (!PrefC.HasClinicsEnabled) //clinics are not enabled, use ClinicNum 0 to indicate 'Headquarters' or practice level program properties { checkEnabled.Text = Lan.g(this, "Enabled"); groupPaySettings.Text = Lan.g(this, "Payment Settings"); comboClinic.Visible = false; labelClinic.Visible = false; labelClinicEnable.Visible = false; _listUserClinicNums = new List <long>() { 0 }; //if clinics are disabled, programproperty.ClinicNum will be set to 0 } else //Using clinics { groupPaySettings.Text = Lan.g(this, "Clinic Payment Settings"); _listUserClinicNums = new List <long>(); comboClinic.Items.Clear(); //if PayConnect is enabled and the user is restricted to a clinic, don't allow the user to disable for all clinics if (Security.CurUser.ClinicIsRestricted) { if (checkEnabled.Checked) { checkEnabled.Enabled = false; } } else { comboClinic.Items.Add(Lan.g(this, "Headquarters")); //this way both lists have the same number of items in it and if 'Headquarters' is selected the programproperty.ClinicNum will be set to 0 _listUserClinicNums.Add(0); comboClinic.SelectedIndex = 0; } List <Clinic> listClinics = Clinics.GetForUserod(Security.CurUser); for (int i = 0; i < listClinics.Count; i++) { comboClinic.Items.Add(listClinics[i].Abbr); _listUserClinicNums.Add(listClinics[i].ClinicNum); if (Clinics.ClinicNum == listClinics[i].ClinicNum) { comboClinic.SelectedIndex = i; if (!Security.CurUser.ClinicIsRestricted) { comboClinic.SelectedIndex++; //increment the SelectedIndex to account for 'Headquarters' in the list at position 0 if the user is not restricted. } } } _indexClinicRevert = comboClinic.SelectedIndex; } _listProgProps = ProgramProperties.GetForProgram(_progCur.ProgramNum); FillFields(); }
private void FormDoseSpotPropertyEdit_Load(object sender, EventArgs e) { textClinicAbbr.Text = _clinicCur.Abbr; textClinicID.Text = ClinicIdVal; textClinicKey.Text = ClinicKeyVal; if (ClinicIdVal.Trim() != "" && ClinicKeyVal.Trim() != "") //The clinic has values for the clinicId/clinicKey, so they are effectively registered. { butRegisterClinic.Enabled = false; } if (_clinicCur.ClinicNum == 0) //Clinics disabled or is HQ. { menuItemSetup.Enabled = false; //There is no clinic record to edit. } Program programErx = Programs.GetCur(ProgramName.eRx); ProgramProperty ppClinicID = ListProperties .FirstOrDefault(x => x.ClinicNum != _clinicCur.ClinicNum && x.PropertyDesc == Erx.PropertyDescs.ClinicID && x.PropertyValue != ""); ProgramProperty ppClinicKey = null; if (ppClinicID != null) { ppClinicKey = ListProperties .FirstOrDefault(x => x.ClinicNum == ppClinicID.ClinicNum && x.PropertyDesc == Erx.PropertyDescs.ClinicKey && x.PropertyValue != ""); } if (ppClinicID == null || string.IsNullOrWhiteSpace(ppClinicID.PropertyValue) || ppClinicKey == null || string.IsNullOrWhiteSpace(ppClinicKey.PropertyValue)) { //No clinicID/clinicKey found. This would be the first clinic to register //Allow the first clinic to register the ability to modify the clinicID/clinicKey textboxes. textClinicID.ReadOnly = false; textClinicKey.ReadOnly = false; butRegisterClinic.Enabled = false; butClear.Enabled = false; } }
private void FormXchargeTrans_Load(object sender, EventArgs e) { CashBackAmount = 0; textCashBackAmt.Text = CashBackAmount.ToString("F2"); listTransType.Items.Clear(); listTransType.Items.Add("Purchase"); listTransType.Items.Add("Return"); listTransType.Items.Add("Debit Purchase"); listTransType.Items.Add("Debit Return"); listTransType.Items.Add("Force"); listTransType.Items.Add("Pre-Authorization"); listTransType.Items.Add("Adjustment"); listTransType.Items.Add("Void"); listTransType.SelectedIndex = 0; checkSaveToken.Checked = PrefC.GetBool(PrefName.StoreCCtokens); Program prog = Programs.GetCur(ProgramName.Xcharge); if (prog == null) { return; } checkSignature.Checked = PromptSignature; checkPrintReceipt.Checked = PrintReceipt; if (PIn.Bool(ProgramProperties.GetPropVal(prog.ProgramNum, ProgramProperties.PropertyDescs.XCharge.XChargePreventSavingNewCC, ClinicNum))) { checkSaveToken.Checked = false; checkSaveToken.Enabled = false; } }
private void butMissing_Click(object sender, EventArgs e) { Cursor = Cursors.WaitCursor; string programNum = ProgramProperties.GetPropVal(Programs.GetCur(ProgramName.Xcharge).ProgramNum, "PaymentType"); ReportSimpleGrid report = new ReportSimpleGrid(); report.Query = "SELECT TransactionDateTime,ClerkID,BatchNum,ItemNum,xchargetransaction.PatNum,CCType,CreditCardNum,Expiration,Result,Amount " + " FROM xchargetransaction LEFT JOIN (" + " SELECT patient.PatNum,LName,FName,DateEntry,PayDate,PayAmt,PayNote" + " FROM patient INNER JOIN payment ON payment.PatNum=patient.PatNum" + " WHERE PayType=" + programNum + " AND DateEntry BETWEEN " + POut.Date(date1.SelectionStart) + " AND " + POut.Date(date2.SelectionStart) + " ) AS P ON xchargetransaction.PatNum=P.PatNum AND DATE(xchargetransaction.TransactionDateTime)=P.DateEntry AND xchargetransaction.Amount=P.PayAmt " + " WHERE DATE(TransactionDateTime) BETWEEN " + POut.Date(date1.SelectionStart) + " AND " + POut.Date(date2.SelectionStart) + " AND P.PatNum IS NULL;"; FormQuery FormQuery2 = new FormQuery(report); FormQuery2.IsReport = true; FormQuery2.SubmitReportQuery(); report.Title = "XCharge Transactions From " + date1.SelectionStart.ToShortDateString() + " To " + date2.SelectionStart.ToShortDateString(); report.SubTitle.Add("No Matching Transaction Found in Open Dental"); report.SetColumn(this, 0, "Transaction Date/Time", 170); report.SetColumn(this, 1, "Clerk ID", 80); report.SetColumn(this, 2, "Batch#", 50); report.SetColumn(this, 3, "Item#", 50); report.SetColumn(this, 4, "PatNum", 50); report.SetColumn(this, 5, "CC Type", 55); report.SetColumn(this, 6, "Credit Card Num", 140); report.SetColumn(this, 7, "Exp", 50); report.SetColumn(this, 8, "Result", 50); report.SetColumn(this, 9, "Amount", 60, HorizontalAlignment.Right); Cursor = Cursors.Default; FormQuery2.ShowDialog(); }
private void butPayments_Click(object sender, EventArgs e) { Cursor = Cursors.WaitCursor; string programNum = ProgramProperties.GetPropVal(Programs.GetCur(ProgramName.Xcharge).ProgramNum, "PaymentType"); ReportSimpleGrid report = new ReportSimpleGrid(); report.Query = "SET @pos=0; " + "SELECT @pos:=@pos+1 as 'Count', patient.PatNum, LName, FName, DateEntry,PayDate, PayNote,PayAmt " + "FROM patient INNER JOIN payment ON payment.PatNum=patient.PatNum " + "WHERE PayType=" + programNum + " AND DateEntry BETWEEN " + POut.Date(date1.SelectionStart) + " AND " + POut.Date(date2.SelectionStart) + "ORDER BY PayDate ASC, patient.LName"; FormQuery FormQuery2 = new FormQuery(report); FormQuery2.IsReport = true; FormQuery2.SubmitReportQuery(); report.Title = "Payments From " + date1.SelectionStart.ToShortDateString() + " To " + date2.SelectionStart.ToShortDateString(); report.SubTitle.Add(PrefC.GetString(PrefName.PracticeTitle)); report.SetColumn(this, 0, "Count", 50); report.SetColumn(this, 1, "PatNum", 50); report.SetColumn(this, 2, "LName", 100); report.SetColumn(this, 3, "FName", 100); report.SetColumn(this, 4, "DateEntry", 100); report.SetColumn(this, 5, "PayDate", 100); report.SetColumn(this, 6, "PayNote", 150); report.SetColumn(this, 7, "PayAmt", 70, HorizontalAlignment.Right); Cursor = Cursors.Default; FormQuery2.ShowDialog(); }
private void FormPaySimple_Load(object sender, EventArgs e) { _progCur = Programs.GetCur(ProgramName.PaySimple); if (_progCur == null) { MsgBox.Show(this, "PaySimple does not exist in the database."); DialogResult = DialogResult.Cancel; return; } if (_patCur == null || _patCur.PatNum == 0) //Prepaid card { radioAuthorization.Enabled = false; checkOneTimePayment.Checked = true; checkOneTimePayment.Enabled = false; tabControl.TabPages.Remove(tabACH); } else { checkOneTimePayment.Checked = !PrefC.GetBool(PrefName.StoreCCtokens); checkOneTimePaymentACH.Checked = !PrefC.GetBool(PrefName.StoreCCtokens); textZipCode.Text = _patCur.Zip; textNameOnCard.Text = _patCur.GetNameFL(); if (_creditCardCur != null) { FillFieldsFromCard(); } } if (_isAddingCard) { radioAuthorization.Checked = true; _trantype = PaySimple.TransType.AUTH; groupTransType.Enabled = false; labelAmount.Visible = false; textAmount.Visible = false; labelAmountACH.Visible = false; textAmountACH.Visible = false; checkOneTimePayment.Checked = false; checkOneTimePayment.Enabled = false; checkOneTimePaymentACH.Checked = false; checkOneTimePaymentACH.Enabled = false; } if (_creditCardCur == null || _creditCardCur.CCSource != CreditCardSource.PaySimpleACH) { textCardNumber.Select(); } else { tabControl.SelectedTab = tabACH; textRoutingNumber.Select(); } if (PIn.Bool(ProgramProperties.GetPropVal(_progCur.ProgramNum, PaySimple.PropertyDescs.PaySimplePreventSavingNewCC, _clinicNum))) { textCardNumber.ReadOnly = true; textRoutingNumber.ReadOnly = true; textCheckSaveNumber.ReadOnly = true; textBankName.ReadOnly = true; } }
private void FormRecurringCharges_Load(object sender, EventArgs e) { nowDateTime = MiscData.GetNowDateTime(); prog = Programs.GetCur(ProgramName.Xcharge); labelCharged.Text = Lan.g(this, "Charged=") + "0"; labelFailed.Text = Lan.g(this, "Failed=") + "0"; FillGrid(); gridMain.SetSelected(true); labelSelected.Text = Lan.g(this, "Selected=") + gridMain.SelectedIndices.Length.ToString(); }
private void FormDoseSpotAssignUserId_Load(object sender, EventArgs e) { _programErx = Programs.GetCur(ProgramName.eRx); _listUsersInComboBox = GetListDoseSpotUsers(true, _providerErxCur.NationalProviderID); if (_listUsersInComboBox.Count == 0) //empty list, populate with all users { _listUsersInComboBox = GetListDoseSpotUsers(false); } FillComboBox(); textUserId.Text = _providerErxCur.UserId; //UserID passed from Alert }
/// <summary>Only creates the Benco splash if Benco is enabled and a splash does not exist</summary> private void CreateBencoSplash() { try { if (DataConnection.HasDatabaseConnection && Programs.GetCur(ProgramName.BencoPracticeManagement).Enabled && !File.Exists(Directory.GetCurrentDirectory() + @"\Splash.jpg")) { Properties.Resources.splashBenco.Save(Directory.GetCurrentDirectory() + @"\Splash.jpg"); } } catch (Exception ex) { ex.DoNothing(); } }
private void FillGrid() { Pharmacies.RefreshCache(); _listPharmacies = Pharmacies.GetDeepCopy(); gridMain.BeginUpdate(); gridMain.Columns.Clear(); ODGridColumn col = new ODGridColumn(Lan.g("TablePharmacies", "Store Name"), 130); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TablePharmacies", "Phone"), 90); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TablePharmacies", "Fax"), 90); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TablePharmacies", "Address"), 120); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TablePharmacies", "City"), 90); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TablePharmacies", "Note"), 100); gridMain.Columns.Add(col); gridMain.Rows.Clear(); ODGridRow row; string txt; for (int i = 0; i < _listPharmacies.Count; i++) { row = new ODGridRow(); row.Cells.Add(_listPharmacies[i].StoreName); row.Cells.Add(_listPharmacies[i].Phone); if (Programs.GetCur(ProgramName.DentalTekSmartOfficePhone).Enabled) { row.Cells[row.Cells.Count - 1].ColorText = Color.Blue; row.Cells[row.Cells.Count - 1].Underline = YN.Yes; } row.Cells.Add(_listPharmacies[i].Fax); txt = _listPharmacies[i].Address; if (_listPharmacies[i].Address2 != "") { txt += "\r\n" + _listPharmacies[i].Address2; } row.Cells.Add(txt); row.Cells.Add(_listPharmacies[i].City); row.Cells.Add(_listPharmacies[i].Note); gridMain.Rows.Add(row); } gridMain.EndUpdate(); }
private void FormInsTemplates_Load(object sender, System.EventArgs e) { Program prog = Programs.GetCur("Trojan"); if (prog != null && prog.Enabled) { trojan = true; } else { labelTrojanID.Visible = false; textTrojanID.Visible = false; } textEmployer.Text = empText; textCarrier.Text = carrierText; FillGrid(); }
private void FormXchargeTokenTool_Load(object sender, EventArgs e) { Program prog = Programs.GetCur(ProgramName.Xcharge); if (prog == null || !prog.Enabled) { MsgBox.Show(this, "X-Charge program link is not set up."); DialogResult = DialogResult.Cancel; return; } string path = Programs.GetProgramPath(prog); if (!File.Exists(path)) { MsgBox.Show(this, "X-Charge path is not valid."); DialogResult = DialogResult.Cancel; return; } //In order for X-Charge to be enabled, the enabled flag must be set and there must be a valid Username, Password, and PaymentType //If clinics are enabled, the Username, Password, and PaymentType fields are allowed to be blank/invalid for any clinic not using X-Charge //Therefore, we will validate the credentials and payment type using FormOpenDental.ClinicNum string paymentType = ProgramProperties.GetPropVal(prog.ProgramNum, "PaymentType", Clinics.ClinicNum); List <Def> _listPayTypeDefs = Defs.GetDefsForCategory(DefCat.PaymentTypes, true).FindAll(x => x.DefNum.ToString() == paymentType); //should be a list of 0 or 1 _xUsername = ProgramProperties.GetPropVal(prog.ProgramNum, "Username", Clinics.ClinicNum); _xPassword = ProgramProperties.GetPropVal(prog.ProgramNum, "Password", Clinics.ClinicNum); if (string.IsNullOrEmpty(_xUsername) || string.IsNullOrEmpty(_xPassword) || _listPayTypeDefs.Count < 1) { MsgBox.Show(this, "X-Charge username, password, or payment type for this clinic is invalid."); DialogResult = DialogResult.Cancel; return; } _listCreditCards = CreditCards.GetCardsWithTokenBySource( new List <CreditCardSource> { CreditCardSource.XServer, CreditCardSource.XServerPayConnect }); textTotal.Text = _listCreditCards.Count.ToString(); textVerified.Text = "0"; textInvalid.Text = "0"; if (_listCreditCards.Count == 0) { MsgBox.Show(this, "There are no credit cards with stored X-Charge tokens in the database."); return; } }
private void FillGrid() { Cursor = Cursors.WaitCursor; gridUserProperties.BeginUpdate(); gridUserProperties.ListGridColumns.Clear(); GridColumn col = new GridColumn(Lan.g("TableUserPrefProperties", "Clinic"), 120); gridUserProperties.ListGridColumns.Add(col); col = new GridColumn(Lan.g("TableUserPrefProperties", "DoseSpot User ID"), 120, true); gridUserProperties.ListGridColumns.Add(col); gridUserProperties.ListGridRows.Clear(); GridRow row; UserOdPref userPrefDefault = _listUserPref.Find(x => x.ClinicNum == 0); //Doesn't exist in Db, create one if (userPrefDefault == null) { userPrefDefault = UserOdPrefs.GetByCompositeKey(_userCur.UserNum, Programs.GetCur(ProgramName.eRx).ProgramNum, UserOdFkeyType.Program, 0); //Doesn't exist in db, add to list to be synced later _listUserPref.Add(userPrefDefault); } row = new GridRow(); row.Cells.Add("Default"); row.Cells.Add(userPrefDefault.ValueString); row.Tag = userPrefDefault; gridUserProperties.ListGridRows.Add(row); foreach (Clinic clinicCur in Clinics.GetForUserod(Security.CurUser)) { row = new GridRow(); UserOdPref userPrefCur = _listUserPref.Find(x => x.ClinicNum == clinicCur.ClinicNum); //wasn't in list, check Db and create a new one if needed if (userPrefCur == null) { userPrefCur = UserOdPrefs.GetByCompositeKey(_userCur.UserNum, Programs.GetCur(ProgramName.eRx).ProgramNum, UserOdFkeyType.Program, clinicCur.ClinicNum); //Doesn't exist in db, add to list to be synced later _listUserPref.Add(userPrefCur); } row.Cells.Add(clinicCur.Abbr); row.Cells.Add(userPrefCur.ValueString); row.Tag = userPrefCur; gridUserProperties.ListGridRows.Add(row); } gridUserProperties.EndUpdate(); Cursor = Cursors.Default; }
private void FormTrojanCollectSetup_Load(object sender, EventArgs e) { if (ODBuild.IsWeb()) { MsgBox.Show(this, "This program is not available in web mode."); Close(); return; } _progCur = Programs.GetCur(ProgramName.TrojanExpressCollect); textExportFolder.Text = ProgramProperties.GetPropVal(_progCur.ProgramNum, "FolderPath"); long billtype = PIn.Long(ProgramProperties.GetPropVal(_progCur.ProgramNum, "BillingType")); _listBillingTypeDefs = Defs.GetDefsForCategory(DefCat.BillingTypes, true); comboBillType.Items.AddRange(_listBillingTypeDefs.Select(x => x.ItemName).ToArray()); comboBillType.SelectedIndex = Math.Max(_listBillingTypeDefs.FindIndex(x => x.DefNum == billtype), 0); textPassword.Text = ProgramProperties.GetPropVal(_progCur.ProgramNum, "Password"); checkEnabled.Checked = _progCur.Enabled; }
private void FormUserSetting_Load(object sender, EventArgs e) { _progOryx = Programs.GetCur(ProgramName.Oryx); _userNamePref = UserOdPrefs.GetByUserFkeyAndFkeyType(Security.CurUser.UserNum, _progOryx.ProgramNum, UserOdFkeyType.ProgramUserName) .FirstOrDefault(); _passwordPref = UserOdPrefs.GetByUserFkeyAndFkeyType(Security.CurUser.UserNum, _progOryx.ProgramNum, UserOdFkeyType.ProgramPassword) .FirstOrDefault(); if (_userNamePref != null) { textUsername.Text = _userNamePref.ValueString; } if (_passwordPref != null) { string passwordPlain; CDT.Class1.Decrypt(_passwordPref.ValueString, out passwordPlain); textPassword.Text = passwordPlain; } }
private void FormFHIRSetup_Load(object sender, EventArgs e) { Program prog = Programs.GetCur(ProgramName.FHIR); checkEnabled.Checked = prog.Enabled; textSubInterval.Text = ProgramProperties.GetPropVal(prog.ProgramNum, "SubscriptionProcessingFrequency"); Cursor = Cursors.WaitCursor; _listApiKeysHQ = GetApiKeys(); Cursor = Cursors.Default; if (_listApiKeysHQ == null) { DialogResult = DialogResult.Cancel; //We have already shown them an error message. return; } _listApiKeysLocal = _listApiKeysHQ.Select(x => x.Copy()).ToList(); FillGrid(); FillPermissions(); }
private void butOK_Click(object sender, EventArgs e) { if (comboClinics.SelectedIndex == -1) { MsgBox.Show(this, "Please select a clinic."); return; } _clinicErxCur.ClinicNum = comboClinics.GetSelected <Clinic>().ClinicNum; Program progErx = Programs.GetCur(ProgramName.eRx); ProgramProperty ppClinicID = _listClinicIDs.FirstOrDefault(x => x.ClinicNum == _clinicErxCur.ClinicNum); if (ppClinicID == null) { ppClinicID = new ProgramProperty(); ppClinicID.ProgramNum = progErx.ProgramNum; ppClinicID.ClinicNum = _clinicErxCur.ClinicNum; ppClinicID.PropertyDesc = Erx.PropertyDescs.ClinicID; ppClinicID.PropertyValue = _clinicErxCur.ClinicId; ProgramProperties.Insert(ppClinicID); } else { ppClinicID.PropertyValue = _clinicErxCur.ClinicId; ProgramProperties.Update(ppClinicID); } ProgramProperty ppClinicKey = _listClinicKeys.FirstOrDefault(x => x.ClinicNum == _clinicErxCur.ClinicNum); if (ppClinicKey == null) { ppClinicKey = new ProgramProperty(); ppClinicKey.ProgramNum = progErx.ProgramNum; ppClinicKey.ClinicNum = _clinicErxCur.ClinicNum; ppClinicKey.PropertyDesc = Erx.PropertyDescs.ClinicKey; ppClinicKey.PropertyValue = _clinicErxCur.ClinicKey; ProgramProperties.Insert(ppClinicKey); } else { ppClinicKey.PropertyValue = _clinicErxCur.ClinicKey; ProgramProperties.Update(ppClinicKey); } DataValid.SetInvalid(InvalidType.Programs); DialogResult = DialogResult.OK; }
private void FormXchargeSetup_Load(object sender, EventArgs e) { prog = Programs.GetCur("Xcharge"); if (prog == null) { return; } checkEnabled.Checked = prog.Enabled; textPath.Text = prog.Path; prop = (ProgramProperty)ProgramProperties.GetForProgram(prog.ProgramNum)[0]; for (int i = 0; i < DefB.Short[(int)DefCat.PaymentTypes].Length; i++) { comboPaymentType.Items.Add(DefB.Short[(int)DefCat.PaymentTypes][i].ItemName); if (DefB.Short[(int)DefCat.PaymentTypes][i].DefNum.ToString() == prop.PropertyValue) { comboPaymentType.SelectedIndex = i; } } }
private void butRegisterClinic_Click(object sender, EventArgs e) { Cursor = Cursors.WaitCursor; try { Program programErx = Programs.GetCur(ProgramName.eRx); ProgramProperty ppClinicID = ListProperties .FirstOrDefault(x => x.ClinicNum != _clinicCur.ClinicNum && x.PropertyDesc == Erx.PropertyDescs.ClinicID && x.PropertyValue != ""); ProgramProperty ppClinicKey = null; if (ppClinicID != null) { ppClinicKey = ListProperties .FirstOrDefault(x => x.ClinicNum == ppClinicID.ClinicNum && x.PropertyDesc == Erx.PropertyDescs.ClinicKey && x.PropertyValue != ""); } if (ppClinicID == null || string.IsNullOrWhiteSpace(ppClinicID.PropertyValue) || ppClinicKey == null || string.IsNullOrWhiteSpace(ppClinicKey.PropertyValue)) { //Should never happen since we disable this button if we can't find a valid clinicID/clinicKey combo ahead of time throw new ODException("No registered clinics found. " + "There must be at least one registered clinic before adding additional clinics."); } string clinicID = ""; string clinicKey = ""; DoseSpot.RegisterClinic(_clinicCur.ClinicNum, ppClinicID.PropertyValue, ppClinicKey.PropertyValue , DoseSpot.GetUserID(Security.CurUser, _clinicCur.ClinicNum), out clinicID, out clinicKey); textClinicID.Text = clinicID; textClinicKey.Text = clinicKey; } catch (ODException ex) { MsgBox.Show(this, ex.Message); return; } catch (Exception ex) { MessageBox.Show(Lan.g(this, "Error: ") + ex.Message); return; } finally { Cursor = Cursors.Default; } MsgBox.Show(this, "This clinic has successfully been registered with DoseSpot.\r\n" + "If patients in this clinic can be shared with other clinics, contact DoseSpot to link this clinic before using."); }
private void FormXchargeSetup_Load(object sender, EventArgs e) { prog = Programs.GetCur(ProgramName.Xcharge); if (prog == null) { return; } checkEnabled.Checked = prog.Enabled; textPath.Text = prog.Path; textUser.Text = ProgramProperties.GetPropVal(prog.ProgramNum, "Username"); textPassword.Text = ProgramProperties.GetPropVal(prog.ProgramNum, "Password"); string paymentType = ProgramProperties.GetPropVal(prog.ProgramNum, "PaymentType"); for (int i = 0; i < DefC.Short[(int)DefCat.PaymentTypes].Length; i++) { comboPaymentType.Items.Add(DefC.Short[(int)DefCat.PaymentTypes][i].ItemName); if (DefC.Short[(int)DefCat.PaymentTypes][i].DefNum.ToString() == paymentType) { comboPaymentType.SelectedIndex = i; } } }
private void FormFHIRSetup_Load(object sender, EventArgs e) { Program prog = Programs.GetCur(ProgramName.FHIR); checkEnabled.Checked = prog.Enabled; textSubInterval.Text = ProgramProperties.GetPropVal(prog.ProgramNum, "SubscriptionProcessingFrequency"); comboPayType.Items.AddDefs(Defs.GetDefsForCategory(DefCat.PaymentTypes, true)); comboPayType.SetSelectedDefNum(PrefC.GetLong(PrefName.ApiPaymentType)); //Let the load finish before we call HQ this.BeginInvoke(() => { Cursor = Cursors.WaitCursor; Application.DoEvents(); _listApiKeys = GetApiKeys(); Cursor = Cursors.Default; if (_listApiKeys == null) { DialogResult = DialogResult.Cancel; //We have already shown them an error message. return; } FillGrid(); }); }
private void FormXchargeTokenTool_Load(object sender, EventArgs e) { CardList = CreditCards.GetCreditCardsWithTokens(); textTotal.Text = CardList.Count.ToString(); textVerified.Text = "0"; textInvalid.Text = "0"; Program prog = Programs.GetCur(ProgramName.Xcharge); string path = Programs.GetProgramPath(prog); if (prog == null || !prog.Enabled) { MsgBox.Show(this, "X-Charge entry is not set up."); //should never happen butCheck.Visible = false; return; } if (!File.Exists(path)) { MsgBox.Show(this, "X-Charge path is not valid."); butCheck.Visible = false; return; } }
private void FormInsTemplates_Load(object sender, System.EventArgs e) { if (!IsSelectMode) { butCancel.Text = Lan.g(this, "Close"); butOK.Visible = false; } Program prog = Programs.GetCur(ProgramName.Trojan); if (prog != null && prog.Enabled) { trojan = true; } else { labelTrojanID.Visible = false; textTrojanID.Visible = false; } textEmployer.Text = empText; textCarrier.Text = carrierText; FillGrid(); }
private void butClose_Click(object sender, EventArgs e) { if (textSubInterval.errorProvider1.GetError(textSubInterval) != "") { MsgBox.Show(this, "Please fix data entry errors first."); return; } bool changed = false; foreach (APIKey apiKeyHQ in _listApiKeysHQ) { APIKey apiKeyLocal = _listApiKeysLocal.FirstOrDefault(x => x.Key == apiKeyHQ.Key); if (apiKeyLocal == null || //A new key was generated but then Cancel was clicked on FormFHIRAPIKeyEdit. apiKeyLocal.DeveloperName != apiKeyHQ.DeveloperName || apiKeyLocal.DeveloperEmail != apiKeyHQ.DeveloperEmail || apiKeyLocal.DeveloperPhone != apiKeyHQ.DeveloperPhone || apiKeyLocal.ListPermissions.Any(x => !apiKeyHQ.ListPermissions.Contains(x)) || apiKeyHQ.ListPermissions.Any(x => !apiKeyLocal.ListPermissions.Contains(x))) { changed = true; break; } } if (changed && !UpdateKeysForOffice(_listApiKeysLocal)) { return; } Program prog = Programs.GetCur(ProgramName.FHIR); prog.Enabled = checkEnabled.Checked; Programs.Update(prog); ProgramProperty progProp = ProgramProperties.GetPropByDesc("SubscriptionProcessingFrequency", ProgramProperties.GetForProgram(prog.ProgramNum)); ProgramProperties.UpdateProgramPropertyWithValue(progProp, textSubInterval.Text); DataValid.SetInvalid(InvalidType.Programs); Close(); }
private void FormPaySimple_Load(object sender, EventArgs e) { _progCur = Programs.GetCur(ProgramName.PaySimple); if (_progCur == null) { MsgBox.Show(this, "PaySimple does not exist in the database."); DialogResult = DialogResult.Cancel; return; } if (_patCur == null || _patCur.PatNum == 0) //Prepaid card { radioAuthorization.Enabled = false; checkOneTimePayment.Checked = true; checkOneTimePayment.Enabled = false; } else { checkOneTimePayment.Checked = !PrefC.GetBool(PrefName.StoreCCtokens); textZipCode.Text = _patCur.Zip; textNameOnCard.Text = _patCur.GetNameFL(); if (_creditCardCur != null) { FillFieldsFromCard(); } } if (_isAddingCard) { radioAuthorization.Checked = true; _trantype = PaySimple.TransType.AUTH; groupTransType.Enabled = false; labelAmount.Visible = false; textAmount.Visible = false; checkOneTimePayment.Checked = false; checkOneTimePayment.Enabled = false; } textCardNumber.Select(); }
private void FormXchargeSetup_Load(object sender, EventArgs e) { prog = Programs.GetCur(ProgramName.PayConnect); if (prog == null) { return; } checkEnabled.Checked = prog.Enabled; List <ProgramProperty> props = ProgramProperties.GetListForProgram(prog.ProgramNum); for (int i = 0; i < props.Count; i++) { if (props[i].PropertyDesc == "Username") { propUsername = props[i]; } else if (props[i].PropertyDesc == "Password") { propPassword = props[i]; } else if (props[i].PropertyDesc == "PaymentType") { propPayType = props[i]; } } textUsername.Text = propUsername.PropertyValue; textPassword.Text = propPassword.PropertyValue; for (int i = 0; i < DefC.Short[(int)DefCat.PaymentTypes].Length; i++) { comboPaymentType.Items.Add(DefC.Short[(int)DefCat.PaymentTypes][i].ItemName); if (DefC.Short[(int)DefCat.PaymentTypes][i].DefNum.ToString() == propPayType.PropertyValue) { comboPaymentType.SelectedIndex = i; } } }