Bonjour , voila je suis débutant en C sharp et j'ai une application windows form à faire assez urgemment(je sais pas si ça se dit ) cependant je suis complètement perdu et j'ai grandement besoin d'aide .

l'idée est de faire une page de rapport de visite ou l'utilisateur pourra entrer des informations dans un formulaire puis valider ou annuler sa saisie
si validation alors on inscrit les données en base sinon on reset les champs

j'ai fait fait mon form et ma BDD sous SQL après niveau C# je suis un gros naz j'arrive à rien a part des petit scripts consoles en procédural bref ça on s'en fout un peut.

le Rap_visite.cs

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
 
 
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
 
namespace ppe1
{
    public partial class Rap_visite : Form
    {
 
        int currentRow;
 
        public Rap_visite()
        {
            InitializeComponent();
            currentRow = -1;
 
            DateRap.MinDate = DateTime.Now.AddDays(1);
        }
 
        public void dateTimePicker1_ValueChanged(object sender, EventArgs e)
        {
 
        }
 
 
        public void rap_num_TextChanged(object sender, EventArgs e)
        {
 
 
 
        }
 
 
        public void textBox2_TextChanged(object sender, EventArgs e)
        {
 
        }
 
        public void vis_matricule_TextChanged(object sender, EventArgs e)
        {
 
        }
 
        public void Med_off_SelectedIndexChanged(object sender, EventArgs e)
        {
 
        }
 
        private bool VerificationTout() //Retourne True quand tous les champs sont renseignés
        {
            bool resultat = false;
            int CompteControl = 0; //Incrémentation de 1 pour chaque control vérifié et validé
 
            //Vérification des TextBox
            if (NumRap.Text != "") //NumRap
                CompteControl++;
            if (NomViMe.Text != "") //NomViMe
                CompteControl++;
            if (MatViMe.Text != "") //MatViMe
                CompteControl++;
            if (Bilan.Text != "") //Bilan
                CompteControl++;
            if (NumPrat.Text != "") //NumPrat
                CompteControl++;
            if (Conf.Text != "") //Conf
                CompteControl++;
            if (LibMotif.Text != "") //LibMotif
                CompteControl++;
            if (QteMediOff.Text != "") //QteMediOff
                CompteControl++
 
 
            //Compte les contrôles validés
            if (CompteControl == 8)
                resultat = true;
 
            return resultat;
        }
 
        private void btn_validerBilan_Click(object sender, EventArgs e)
        {
            if (VerificationTout() == true)
            {
                MessageBox.Show("Attention vous devez renseigner les champs");
                this.Close();
            }
            else
            {
                this.Validate();
                MessageBox.Show("Rapport validé");
            }
 
            /*
            txt_bilan.Text = txt_bilan.Text.Trim();
            if (txt_bilan.Text != "" && (dgv_visite.Rows[currentRow].Cells[4].Value == null || txt_bilan.Text != dgv_visite.Rows[currentRow].Cells[4].Value.ToString()))
            {
                Donnees.setBilanVisite(txt_bilan.Text, (int)dgv_visite.Rows[currentRow].Cells[0].Value);
                dgv_visite.Rows[currentRow].Cells[4].Value = txt_bilan.Text;
                MessageBox.Show("Sauvegarde effectuée !", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            */
 
        }
 
        private void btn_annulerBilan_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Rapport annulé");
 
            // Reset des champs 
 
             DateVis.ResetText();
             DateRap.ResetText();
             NumRap.ResetText();
             NomViMe.ResetText();     
             MatViMe.ResetText();
             Bilan.ResetText();
             NumPrat.ResetText();
             NumPratRem.ResetText();
             Conf.ResetText();
             LibMotif.ResetText();
             CodeMotif.ResetText();
             LibMediOff.ResetText();
             QteMediOff.ResetText();   
         }
 
        private void LibMotif_SelectedIndexChanged(object sender, EventArgs e)
        {
 
        }
 
        private void Bilan_TextChanged(object sender, EventArgs e)
        {
 
        }
 
        private void NumPrat_TextChanged(object sender, EventArgs e)
        {
 
        }
 
        private void NumPratRem_TextChanged(object sender, EventArgs e)
        {
 
        }
 
        private void CodeMotif_TextChanged(object sender, EventArgs e)
        {
 
        }
    }
}



merci d'avance a ceux qui pourront m'aider