private void FormClinicEdit_Load(object sender, System.EventArgs e) { textDescription.Text = ClinicCur.Description; string phone = ClinicCur.Phone; if (phone != null && phone.Length == 10 && Application.CurrentCulture.Name == "en-US") { textPhone.Text = "(" + phone.Substring(0, 3) + ")" + phone.Substring(3, 3) + "-" + phone.Substring(6); } else { textPhone.Text = phone; } string fax = ClinicCur.Fax; if (fax != null && fax.Length == 10 && Application.CurrentCulture.Name == "en-US") { textFax.Text = "(" + fax.Substring(0, 3) + ")" + fax.Substring(3, 3) + "-" + fax.Substring(6); } else { textFax.Text = fax; } textAddress.Text = ClinicCur.Address; textAddress2.Text = ClinicCur.Address2; textCity.Text = ClinicCur.City; textState.Text = ClinicCur.State; textZip.Text = ClinicCur.Zip; textBankNumber.Text = ClinicCur.BankNumber; comboPlaceService.Items.Clear(); comboPlaceService.Items.AddRange(Enum.GetNames(typeof(PlaceOfService))); comboPlaceService.SelectedIndex = (int)ClinicCur.DefaultPlaceService; for (int i = 0; i < ProviderC.ListShort.Count; i++) { comboInsBillingProv.Items.Add(ProviderC.ListShort[i].GetLongDesc()); } if (ClinicCur.InsBillingProv == 0) { radioInsBillingProvDefault.Checked = true; //default=0 } else if (ClinicCur.InsBillingProv == -1) { radioInsBillingProvTreat.Checked = true; //treat=-1 } else { radioInsBillingProvSpecific.Checked = true; //specific=any number >0. Foreign key to ProvNum comboInsBillingProv.SelectedIndex = Providers.GetIndex(ClinicCur.InsBillingProv); } EmailAddress emailAddress = EmailAddresses.GetOne(ClinicCur.EmailAddressNum); if (emailAddress != null) { textEmail.Text = emailAddress.EmailUsername; } }
private void FormWebMailMessageEdit_Load(object sender, EventArgs e) { _webMailMode = WebMailMode.View; if (_emailMessage == null) { _webMailMode = WebMailMode.Compose; } string error = ""; if (_patCur == null) { error += "Cannot send Web Mail to an invalid patient. "; } else { _listPatsForPHI = Patients.GetPatientsForPhi(_patCur.PatNum); if (_listPatsForPHI.Count == 0) //Every patient should have at least one guarantor. { error += "Patient family not setup properly. Make sure guarantor is valid. "; } } //Webmail notification email address. One notification email per database (not clinic specific). _emailAddressSender = EmailAddresses.GetOne(PrefC.GetLong(PrefName.EmailNotifyAddressNum)); if (_emailAddressSender == null || _emailAddressSender.EmailAddressNum == 0 || _emailAddressSender.EmailUsername == "") { //No valid "Notify" email setup for this practice yet. error += "Invalid Web Mail Notify email. Configure a Web Mail Notify email address in E-mail Setup. "; } List <Userod> listUsers = Userods.GetUsersWithProviders(); if (listUsers.Count < 1) { error += "Cannot send Web Mail until there is at least one User associated to a Provider. "; } if (error != "") { MsgBox.Show(this, error); DialogResult = DialogResult.Abort; return; } if (_emailMessage != null) { _patRegarding = Patients.GetLim(_emailMessage.PatNumSubj); } if (Security.CurUser != null) { _provUserCur = Providers.GetProv(Security.CurUser.ProvNum); } List <long> listProvNums = listUsers.Select(x => x.ProvNum).Distinct().ToList(); _listProviders = Providers.GetProvsByProvNums(listProvNums); FillFields(); }
private void butEmail_Click(object sender, EventArgs e) { FormEmailAddresses FormEA = new FormEmailAddresses(); FormEA.IsSelectionMode = true; FormEA.ShowDialog(); if (FormEA.DialogResult != DialogResult.OK) { return; } ClinicCur.EmailAddressNum = FormEA.EmailAddressNum; textEmail.Text = EmailAddresses.GetOne(FormEA.EmailAddressNum).EmailUsername; }