private void listFields_SelectedIndexChanged(object sender, EventArgs e) { groupRadio.Visible = false; groupRadioMisc.Visible = false; checkRequired.Visible = false; if (listFields.SelectedIndex == -1) { return; } if (AvailFields[listFields.SelectedIndex].FieldName == "misc") { groupRadioMisc.Visible = true; checkRequired.Visible = true; } else { radioButtonValues = SheetFieldsAvailable.GetRadio(AvailFields[listFields.SelectedIndex].FieldName); if (radioButtonValues.Count == 0) { return; } groupRadio.Visible = true; checkRequired.Visible = true; listRadio.Items.Clear(); for (int i = 0; i < radioButtonValues.Count; i++) { listRadio.Items.Add(radioButtonValues[i]); if (SheetFieldDefCur.RadioButtonValue == radioButtonValues[i]) { listRadio.SelectedIndex = i; } } } }
private void listFields_SelectedIndexChanged(object sender, EventArgs e) { labelMiscInstructions.Visible = false; labelReportableName.Visible = false; textReportableName.Visible = false; groupRadio.Visible = false; groupRadioMisc.Visible = false; labelRequired.Visible = false; checkRequired.Visible = false; labelMedical.Visible = false; listMedical.Visible = false; radioYes.Visible = false; radioNo.Visible = false; labelYesNo.Visible = false; if (listFields.SelectedIndex == -1) { return; } if (isMedHistSheet) { labelRequired.Visible = true; checkRequired.Visible = true; switch (AvailFields[listFields.SelectedIndex].FieldName) { case "allergy": labelMedical.Visible = true; listMedical.Visible = true; radioYes.Visible = true; radioNo.Visible = true; labelYesNo.Visible = true; labelMedical.Text = "Allergies"; FillListMedical(MedicalListType.allergy); break; case "problem": labelMedical.Visible = true; listMedical.Visible = true; radioYes.Visible = true; radioNo.Visible = true; labelYesNo.Visible = true; labelMedical.Text = "Problems"; FillListMedical(MedicalListType.problem); break; } } if (AvailFields[listFields.SelectedIndex].FieldName == "misc") { labelMiscInstructions.Visible = true; labelReportableName.Visible = true; textReportableName.Visible = true; textReportableName.Text = SheetFieldDefCur.ReportableName; //will either be "" or saved ReportableName. groupRadioMisc.Visible = true; labelRequired.Visible = true; checkRequired.Visible = true; } else { textReportableName.Text = ""; radioButtonValues = SheetFieldsAvailable.GetRadio(AvailFields[listFields.SelectedIndex].FieldName); if (radioButtonValues.Count == 0) { return; } groupRadio.Visible = true; labelRequired.Visible = true; checkRequired.Visible = true; listRadio.Items.Clear(); for (int i = 0; i < radioButtonValues.Count; i++) { listRadio.Items.Add(radioButtonValues[i]); if (SheetFieldDefCur.RadioButtonValue == radioButtonValues[i]) { listRadio.SelectedIndex = i; } } } }
private void listFields_SelectedIndexChanged(object sender, EventArgs e) { labelMiscInstructions.Visible = false; labelReportableName.Visible = false; textReportableName.Visible = false; groupRadio.Visible = false; groupRadioMisc.Visible = false; labelUiLabelMobileCheckBoxNonMisc.Visible = false; textUiLabelMobileCheckBoxNonMisc.Visible = false; labelRequired.Visible = false; checkRequired.Visible = false; labelMedical.Visible = false; listMedical.Visible = false; radioYes.Visible = false; radioNo.Visible = false; labelYesNo.Visible = false; butAddAllergy.Visible = false; butAddProblem.Visible = false; labelMobileCheckOverride.Visible = false; textMobileCheckOverride.Visible = false; labelMobileMedicalNameOverride.Visible = false; textMobileMedicalNameOverride.Visible = false; if (!_hasSelectedFieldName) { return; } if (_isMedHistSheet) { labelRequired.Visible = true; checkRequired.Visible = true; switch (_selectedFieldName) { case "allergy": labelMedical.Visible = true; listMedical.Visible = true; radioYes.Visible = true; radioNo.Visible = true; labelYesNo.Visible = true; labelMedical.Text = "Allergies"; FillListMedical(MedicalListType.allergy); butAddAllergy.Visible = true; //Only show mobile override option if field name is an allergy and the form it's on is mobile allowed sheet labelMobileCheckOverride.Visible = SheetDefs.IsMobileAllowed(_sheetDefCur.SheetType); textMobileCheckOverride.Visible = SheetDefs.IsMobileAllowed(_sheetDefCur.SheetType); labelMobileMedicalNameOverride.Visible = SheetDefs.IsMobileAllowed(_sheetDefCur.SheetType); textMobileMedicalNameOverride.Visible = SheetDefs.IsMobileAllowed(_sheetDefCur.SheetType); break; case "problem": labelMedical.Visible = true; listMedical.Visible = true; radioYes.Visible = true; radioNo.Visible = true; labelYesNo.Visible = true; labelMedical.Text = "Problems"; FillListMedical(MedicalListType.problem); butAddProblem.Location = butAddAllergy.Location; butAddProblem.Visible = true; //Only show mobile override option if field name is problem and the form it's on is mobile allowed sheet labelMobileCheckOverride.Visible = SheetDefs.IsMobileAllowed(_sheetDefCur.SheetType); textMobileCheckOverride.Visible = SheetDefs.IsMobileAllowed(_sheetDefCur.SheetType); labelMobileMedicalNameOverride.Visible = SheetDefs.IsMobileAllowed(_sheetDefCur.SheetType); textMobileMedicalNameOverride.Visible = SheetDefs.IsMobileAllowed(_sheetDefCur.SheetType); break; } } if (_selectedFieldName == "misc") { labelMiscInstructions.Visible = true; labelReportableName.Visible = true; textReportableName.Visible = true; textReportableName.Text = SheetFieldDefCur.ReportableName; //will either be "" or saved ReportableName. groupRadioMisc.Visible = true; labelRequired.Visible = true; checkRequired.Visible = true; } else if (_isMedHistSheet) { return; } else { textReportableName.Text = ""; radioButtonValues = SheetFieldsAvailable.GetRadio(_selectedFieldName); if (radioButtonValues.Count == 0) //Rare, currently only addressAndHmPhoneIsSameEntireFamily. { labelUiLabelMobileCheckBoxNonMisc.Visible = SheetDefs.IsMobileAllowed(_sheetDefCur.SheetType); textUiLabelMobileCheckBoxNonMisc.Visible = SheetDefs.IsMobileAllowed(_sheetDefCur.SheetType); return; } groupRadio.Visible = true; labelRequired.Visible = true; checkRequired.Visible = true; listRadio.Items.Clear(); for (int i = 0; i < radioButtonValues.Count; i++) { listRadio.Items.Add(radioButtonValues[i]); if (SheetFieldDefCur.RadioButtonValue == radioButtonValues[i]) { listRadio.SelectedIndex = i; } } //Set the mobile group caption. var sheetFieldGroup = _sheetDefCur.SheetFieldDefs.FirstOrDefault(x => x.FieldType == SheetFieldType.CheckBox && !string.IsNullOrEmpty(x.FieldName) && x.FieldName == _selectedFieldName); textUiLabelMobile.Text = sheetFieldGroup == null ? "" : sheetFieldGroup.UiLabelMobile; } }