private void checkPatientPortalPayEnabled_Click(object sender, EventArgs e) { if (checkPatientPortalPayEnabled.Checked) { long clinicNum = 0; if (PrefC.HasClinicsEnabled) { clinicNum = _listUserClinicNums[comboClinic.SelectedIndex]; } OpenDentBusiness.WebTypes.Shared.XWeb.WebPaymentProperties xwebProperties = new OpenDentBusiness.WebTypes.Shared.XWeb.WebPaymentProperties(); try { ProgramProperties.GetXWebCreds(clinicNum, out xwebProperties); } catch (Exception ex) { ex.DoNothing(); } string msg = "Online payments is already enabled for XWeb and must be disabled in order to use PayConnect online payments. " + "Would you like to disable XWeb online payments?"; if (xwebProperties != null && xwebProperties.IsPaymentsAllowed && MessageBox.Show(msg, "", MessageBoxButtons.OKCancel) == DialogResult.Cancel) { checkPatientPortalPayEnabled.Checked = false; return; } //User wants to disable XWeb online payments and use PayConnect online payments ProgramProperty ppOnlinePaymentEnabled = ProgramProperties.GetWhere(x => x.ProgramNum == Programs.GetCur(ProgramName.Xcharge).ProgramNum && x.ClinicNum == clinicNum && x.PropertyDesc == "IsOnlinePaymentsEnabled") .FirstOrDefault(); if (ppOnlinePaymentEnabled == null) { return; //Should never happen since we successfully found it in the GetXWebCreds method. } _listXWebWebPayProgProps.Add(ppOnlinePaymentEnabled); } }
private void FormTsiHistory_Load(object sender, EventArgs e) { SetFilterControlsAndAction(() => FillGrid(), datePicker, checkShowPatNums); #region Fill Clinics _listClinics = new List <Clinic>(); if (PrefC.HasClinicsEnabled) { _listClinics.AddRange( Clinics.GetForUserod(Security.CurUser, true).OrderBy(x => x.ClinicNum != 0).ThenBy(x => x.ItemOrder) ); } else //clinics disabled { _listClinics.Add(Clinics.GetPracticeAsClinicZero(Lan.g(this, "Unassigned"))); } #endregion Fill Clinics #region Fill Client IDs comboBoxMultiClientIDs.Items.Add(Lan.g(this, "All")); comboBoxMultiClientIDs.SetSelected(0, true); _listClientIDs = new List <string>(); long progNum = Programs.GetProgramNum(ProgramName.Transworld); if (progNum > 0) { _listClientIDs = ProgramProperties.GetWhere(x => x.ProgramNum == progNum && x.PropertyDesc.In("ClientIdAccelerator", "ClientIdCollection")) .Select(x => x.PropertyValue).Distinct().ToList(); } _listClientIDs.ForEach(x => comboBoxMultiClientIDs.Items.Add(x)); #endregion Fill Client IDs #region Fill Trans Types _listTransTypes = Enum.GetValues(typeof(TsiTransType)).OfType <TsiTransType>().ToList(); comboBoxMultiTransTypes.Items.Add(Lan.g(this, "All")); comboBoxMultiTransTypes.SetSelected(0, true); _listTransTypes.ForEach(x => comboBoxMultiTransTypes.Items.Add(x.GetDescription())); #endregion Fill Trans Types #region Fill Account Statuses _listAcctStatuses = new[] { "Active", "Suspended", "Inactive" }.ToList(); comboBoxMultiAcctStatuses.Items.Add(Lan.g(this, "All")); comboBoxMultiAcctStatuses.SetSelected(0, true); _listAcctStatuses.ForEach(x => comboBoxMultiAcctStatuses.Items.Add(x)); #endregion Fill Account Statuses #region Get Selected Family PatNums _listSelectedFamPatNums = new List <long>(); if (FormOpenDental.CurPatNum > 0) { Family fam = Patients.GetFamily(FormOpenDental.CurPatNum); textPatient.Text = fam.GetNameInFamLF(FormOpenDental.CurPatNum); _listSelectedFamPatNums = fam.ListPats.Select(x => x.PatNum).ToList(); } #endregion Get Selected Family PatNums #region Get All TsiTransLogs _listTsiTransLogsAll = TsiTransLogs.GetAll(); #endregion Get All TsiTransLogs #region Add ClientIDs No Longer In Use List <string> listLogClientIDs = _listTsiTransLogsAll.Select(x => x.ClientId).Distinct().Where(x => !_listClientIDs.Contains(x)).ToList(); foreach (string clientIDCur in listLogClientIDs) { _listClientIDs.Add(clientIDCur); comboBoxMultiClientIDs.Items.Add(clientIDCur + " (no longer used)"); } #endregion Add ClientIDs No Longer In Use _dictPatLims = Patients.GetLimForPats(_listTsiTransLogsAll.Select(x => x.PatNum).Distinct().ToList() /*,true*/).ToDictionary(x => x.PatNum); datePicker.SetDateTimeFrom(DateTime.Today.AddDays(-1)); //Set start to yesterday datePicker.SetDateTimeTo(DateTime.Today); //Set stop date to today to limit the number of messages that load immediately _selectedLog = null; FillGrid(); }