/// <summary> /// Permet de passer en mode édition /// </summary> /// <param name="animal"></param> private void EditMode(BO.Animaux animal) { mode = DialogAnimalMode.ANIMAL; animalEdited = animal; this.textBoxCode.Text = animalEdited.CodeAnimal.ToString(); this.textBoxColor.Text = animalEdited.Couleur; this.textBoxName.Text = animalEdited.NomAnimal; this.textBoxTatoo.Text = animalEdited.Tatouage; this.comboBoxSexe.SelectedIndex = ((List <Char>) this.comboBoxSexe.DataSource).IndexOf(animalEdited.Sexe, 0); this.comboBoxEspece.SelectedIndex = ((List <String>) this.comboBoxEspece.DataSource).IndexOf(animalEdited.Espece, 0); this.comboBoxRace.SelectedIndex = ((List <String>) this.comboBoxRace.DataSource).IndexOf(animalEdited.Race, 0); }
/// <summary> /// Permet de passer en mode création /// </summary> private void CreateMode(BO.Clients client = null) { animalEdited = null; if (client != null) { clientEdited = clientsList.Find(x => x.CodeClient == client.CodeClient); if (clientEdited == null) { this.Close(); MessageBox.Show(GUI.Lang.DIALOG_ANIMAL_CLIENT_ERROR, GUI.Lang.FORM_DEFAULT_ERROR_TITLE, MessageBoxButtons.OK, MessageBoxIcon.Error); } this.comboBoxCustomer.SelectedItem = clientEdited; mode = DialogAnimalMode.CLIENT; this.comboBoxCustomer.Enabled = false; } this.buttonMedicalFolder.Enabled = false; //Mode création pas de bouton de liaison }