//General functions private void UpdateFormEvent(object sender, EventArgs e) { Dictionary <ComboBox, string> comboBoxesList = UtilityQueries.ReturnDictionaryOfComboBoxes(this); PopulateFormComboBoxes(); comboBoxesList.ToList().ForEach(c => { c.Key.SelectedIndex = c.Key.FindStringExact(c.Value); }); }
private void Create_Case_Shown(object sender, EventArgs e) { UpdateDataBoundControls(); FormBorderStyle = FormBorderStyle.FixedSingle; if (formEditMode.ToLower() == "edit") { PopulateFormwithCase(NewCase); FormTitleHelper.SetFormFormattingByEditMode(formEditMode, this, NewCase.Matter); } else if (formEditMode.ToLower() == "view") { PopulateFormwithCase(NewCase); FormTitleHelper.SetFormFormattingByEditMode(formEditMode, this, NewCase.Matter); IEnumerable <TextBox> formTextBoxes = UtilityQueries.GetAllControlsOfTypeFromParent(this, typeof(TextBox)).AsEnumerable().Cast <TextBox>(); formTextBoxes.ForEach(t => { t.Enabled = false; t.BorderStyle = BorderStyle.None; }); } else { FormTitleHelper.SetFormFormattingByEditMode(formEditMode, this); } }