Esempio n. 1
0
        private void btn_delete_Click(object sender, EventArgs e)
        {
            DialogResult dialogR = MessageBox.Show("Êtes-vous sûr de vouloir supprimer " + _f.Name + " ?", "Supprimer Famille", MessageBoxButtons.YesNo);

            if (dialogR == DialogResult.Yes)
            {
                ServiceSynchro.ServiceSynchroClient ssc = new ServiceSynchro.ServiceSynchroClient();
                if (ssc.DelFamily(_f.Id, IdSynchro) == 1)
                {
                    MessageBox.Show("La famille a bien été supprimée");
                    FStockAdmin.combobox_families.Items.Clear();
                    ServiceSynchro.Family[] AllFamilies = ssc.GetFamilies(true);
                    foreach (ServiceSynchro.Family family in AllFamilies)
                    {
                        FStockAdmin.combobox_families.Items.Add(family);
                    }
                    FStockAdmin.dtgv_articles.DataSource = null;
                    FStockAdmin.combobox_families.Text   = "";
                    this.Close();
                }
                else
                {
                    MessageBox.Show("Une erreur est survenue");
                    this.Close();
                }
            }
            //else ? if (dialogR == DialogResult.Yes){}
        }