Exemplo n.º 1
0
 private void cboRechercheCommChefSect_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (cboRechercheCommChefSect.Text != "")
     {
         comChefSect                    = (CommuneChefferieSecteur)cboRechercheCommChefSect.SelectedItem;
         lblIdComChefSect.Text          = comChefSect.Id.ToString();
         cboVilleTeritoire.Text         = Factory.Instance.GetVilleTeritoire(comChefSect.Id_VilleTeritoire).Designation;
         txtDesignationComChefSect.Text = Convert.ToString(comChefSect.Designation);
         txtSuperficieComChefSect.Text  = Convert.ToString(comChefSect.Superficie);
     }
 }
Exemplo n.º 2
0
        private void dgvComChefSect_SelectionChanged(object sender, EventArgs e)
        {
            try
            {
                if (dgvComChefSect.SelectedRows.Count > 0)
                {
                    btnModifierComChefSect.Enabled = true;
                    btnDeleteComChefSect.Enabled   = true;

                    comChefSect                    = (CommuneChefferieSecteur)dgvComChefSect.SelectedRows[0].DataBoundItem;
                    lblIdComChefSect.Text          = comChefSect.Id.ToString();
                    cboVilleTeritoire.Text         = Factory.Instance.GetVilleTeritoire(comChefSect.Id_VilleTeritoire).Designation;
                    txtDesignationComChefSect.Text = Convert.ToString(comChefSect.Designation);
                    txtSuperficieComChefSect.Text  = Convert.ToString(comChefSect.Superficie);
                }
            }
            catch (Exception) { MessageBox.Show("Erreur dans la zone d'affichage", "Erreur d'affichage"); }
        }