コード例 #1
0
ファイル: Accueil.cs プロジェクト: iLaziKx/SharPool
        private void metroGrid1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            var senderGrid = (DataGridView)sender;

            if (e.ColumnIndex == senderGrid.Columns[2].Index && e.RowIndex >= 0)
            {
                Affichage affichage = new Affichage(gridRecherche.Rows[e.RowIndex].Cells["idEntreprise"].Value.ToString());
                affichage.Show();
                this.Close();
            }
            else if (e.ColumnIndex == senderGrid.Columns[3].Index && e.RowIndex >= 0)
            {
                Modifier modifier = new Modifier(gridRecherche.Rows[e.RowIndex].Cells["idEntreprise"].Value.ToString());
                modifier.Show();
                this.Close();
            }
            else if (e.ColumnIndex == senderGrid.Columns[4].Index && e.RowIndex >= 0)
            {
                AjoutContrat ajoutContrat = new AjoutContrat(gridRecherche.Rows[e.RowIndex].Cells["idEntreprise"].Value.ToString());
                ajoutContrat.Show();
                this.Close();
            }
            else if (e.ColumnIndex == senderGrid.Columns[5].Index && e.RowIndex >= 0)
            {
                DialogResult result = MetroMessageBox.Show(this, "Voulez-vous vraiment supprimé?", "Confirmation", MessageBoxButtons.YesNo);
                if (result == DialogResult.Yes)
                {
                    AdoEntreprise.delete(Convert.ToInt16(gridRecherche.Rows[e.RowIndex].Cells["idEntreprise"].Value.ToString()));
                    refreshDTListeEntreprise();
                    refreshGrid(dtListeEntreprise);
                }
            }
        }
コード例 #2
0
        private void ajoutBtn_Click(object sender, EventArgs e)
        {
            Entreprise ent = new Entreprise(siretBox.Text, entBox.Text, adresseBox.Text, cpBox.Text, villeBox.Text, tbxCommentaire.Text, false);

            AdoEntreprise.create(ent, "App");
            Accueil accueil = new Accueil();

            accueil.Show();
            this.Close();
        }
コード例 #3
0
ファイル: Modifier.cs プロジェクト: iLaziKx/SharPool
        private void ValideBox_Click(object sender, EventArgs e)
        {
            Entreprise uneEntreprise = new Entreprise(Convert.ToInt32(idEntreprise), siretBox.Text, entBox.Text, adresseBox.Text, cpBox.Text, villeBox.Text, tbxCom.Text, false);

            AdoEntreprise.update(uneEntreprise);
            Accueil accueil = new Accueil();

            accueil.Show();
            this.Close();
        }
コード例 #4
0
        public string Test()
        {
            //  SERIALISATION

            List <Entreprise> LesEntreprises = new List <Entreprise>();

            LesEntreprises = AdoEntreprise.readAll();
            File.WriteAllText(@"C:\temp\Test.json", LesEntreprises.ToString());
            string json = JsonConvert.SerializeObject(LesEntreprises, Formatting.Indented);

            return(json);
        }
コード例 #5
0
ファイル: Affichage.cs プロジェクト: iLaziKx/SharPool
        public Affichage(string idEntreprise)
        {
            InitializeComponent();
            laEntreprise = AdoEntreprise.readOne(Convert.ToInt32(idEntreprise));

            siretLabel.Text   = laEntreprise.NumeroSiret;
            entLabel.Text     = laEntreprise.NomEntreprise;
            adresseLabel.Text = laEntreprise.Adresse;
            cpLabel.Text      = laEntreprise.CodePostal;
            villeLabel.Text   = laEntreprise.Ville;
            comLabel.Text     = laEntreprise.Commentaire;
        }
コード例 #6
0
ファイル: Modifier.cs プロジェクト: iLaziKx/SharPool
        public Modifier(string idEntreprise)
        {
            InitializeComponent();

            this.idEntreprise = Convert.ToInt32(idEntreprise);
            Entreprise laEntreprise;

            laEntreprise = AdoEntreprise.readOne(Convert.ToInt32(idEntreprise));

            siretBox.Text   = laEntreprise.NumeroSiret;
            entBox.Text     = laEntreprise.NomEntreprise;
            adresseBox.Text = laEntreprise.Adresse;
            cpBox.Text      = laEntreprise.CodePostal;
            villeBox.Text   = laEntreprise.Ville;
            tbxCom.Text     = laEntreprise.Commentaire;
        }
コード例 #7
0
ファイル: AjoutContrat.cs プロジェクト: iLaziKx/SharPool
 public AjoutContrat(string idEntreprise)
 {
     InitializeComponent();
     laEntreprise = AdoEntreprise.readOne(Convert.ToInt32(idEntreprise));
 }
コード例 #8
0
ファイル: Accueil.cs プロジェクト: iLaziKx/SharPool
 private void refreshDTListeEntreprise()
 {
     dtListeEntreprise = AdoEntreprise.dtReadAll();
 }