public FormHorseViewEdit(FormGrangerMain mainForm, Horse horse, GrangerContext context, HorseViewEditOpType optype, string herdID)
        {
            this.MainForm = mainForm;
            this.horse = horse;
            this.Context = context;
            this.HerdID = herdID;
            InitializeComponent();

            disableAllFields();

            List<string> list = new List<string>();
            list.AddRange(Context.Horses.Select(x => x.Name));
            list.AddRange(Context.Horses.Select(x => x.MotherName));
            list.AddRange(Context.Horses.Select(x => x.FatherName));
            string[] allHorseNamesInDatabase = list.Distinct().Where(x => x != null).ToArray();

            comboBoxFather.Items.AddRange(allHorseNamesInDatabase);
            comboBoxMother.Items.AddRange(allHorseNamesInDatabase);

            comboBoxColor.Items.AddRange(HorseColor.GetColorsEnumStrArray());
            comboBoxColor.Text = HorseColor.GetDefaultColorStr();
            comboBoxAge.Items.AddRange(HorseAge.GetColorsEnumStrArray());
            comboBoxAge.Text = HorseAge.GetDefaultAgeStr();

            this.OpMode = optype;
        }
 private void buttonEdit_Click(object sender, EventArgs e)
 {
     OpMode = HorseViewEditOpType.Edit;
     prepareFieldsForEdit();
 }