private void _showDossier() { if (this.dgvAgenda.SelectedRows.Count > 0) { DossierMedicalForm f = new DossierMedicalForm(((Agenda)this.dgvAgenda.SelectedRows[0].Cells[0].Value).Animal); f.ShowDialog(); } }
/// <summary> /// Construit un Formulaire de creation ou de modification d'un animal /// </summary> /// <param name="animal"></param> public AnimalForm(Animal animal = null) { InitializeComponent(); this.cbbClient.DisplayMember = "NomClient"; this.cbbClient.DataSource = ClientController.Instance.Clients; this.cbbSexe.DisplayMember = "Sexe"; this.cbbSexe.DataSource = new string[]{ "M", "F", "H" }; this.cbbEspece.DisplayMember = "Nom"; this.cbbEspece.DataSource = RaceController.Instance.Races; if (null != animal) { this.txtCode.Text = animal.CodeAnimal.ToString(); this.txtNom.Text = animal.NomAnimal; this.txtCouleur.Text = animal.Couleur; this.txtTatouage.Text = animal.Tatouage; //TODO gerer le cas ou pas de tatouage this.cbbClient.SelectedItem = animal.Client; this.cbbClient.Enabled = false; this.cbbSexe.SelectedItem = animal.Sexe; this.cbbEspece.SelectedItem = animal.Race; this.btnValider.Click += (object sender, EventArgs e) => { _valider(animal); }; } else { this.btnValider.Click += (object sender, EventArgs e) => { _valider(); }; } this.btnAnnuler.Click += (object sender, EventArgs e) => { this.Close(); }; this.btnDossierMedical.Click += (object sender, EventArgs e) => { DossierMedicalForm form = new DossierMedicalForm(animal); form.Show(); }; }
/// <summary> /// Construit un Formulaire de creation ou de modification d'un animal /// </summary> /// <param name="animal"></param> public AnimalForm(Animal animal = null) { InitializeComponent(); this.cbbClient.DisplayMember = "NomClient"; this.cbbClient.DataSource = ClientController.Instance.Clients; this.cbbSexe.DisplayMember = "Sexe"; this.cbbSexe.DataSource = new string[] { "M", "F", "H" }; this.cbbEspece.DisplayMember = "Nom"; this.cbbEspece.DataSource = RaceController.Instance.Races; if (null != animal) { this.txtCode.Text = animal.CodeAnimal.ToString(); this.txtNom.Text = animal.NomAnimal; this.txtCouleur.Text = animal.Couleur; this.txtTatouage.Text = animal.Tatouage; //TODO gerer le cas ou pas de tatouage this.cbbClient.SelectedItem = animal.Client; this.cbbClient.Enabled = false; this.cbbSexe.SelectedItem = animal.Sexe; this.cbbEspece.SelectedItem = animal.Race; this.btnValider.Click += (object sender, EventArgs e) => { _valider(animal); }; } else { this.btnValider.Click += (object sender, EventArgs e) => { _valider(); }; } this.btnAnnuler.Click += (object sender, EventArgs e) => { this.Close(); }; this.btnDossierMedical.Click += (object sender, EventArgs e) => { DossierMedicalForm form = new DossierMedicalForm(animal); form.Show(); }; }