namespace Client.GPCS { public class GPCS_Candidat { private CL_CAM oCAM; private message oMsg = new message(); private Candidat oCandidat = new Candidat(); public void NouveauCandidat(Candidat aCandidat) //Processus d'ajout de candidat. { this.oCandidat = aCandidat; this.oMsg.OCandidat = this.oCandidat; this.oMsg.Message = "CANDIDAT_nouveau"; this.oCAM = new CL_CAM(this.oMsg); this.oCAM.redirection(); } } }
Mappage de la requete ajout candidat INSERT INTO JeuxConcours.dbo.candidat (nom_can, prenom_can) VALUES ('john','doe')
Candidat oCandidat = new Candidat(); GPCS_Candidat oGPCS_candidat = new GPCS_Candidat(); private void Participer_Click(object sender, EventArgs e) // Recupere les infos des textbox et les enregistre dans la table { if (this.nomcand.Text != "" && this.prenomcan.Text != "") { this.oCandidat.Nom = this.nomcand.Text; this.oCandidat.Prenom = this.prenomcan.Text; this.oGPCS_candidat.NouveauCandidat(this.oCandidat); MessageBox.Show("Votre participation à été enregistrée, vous allez recevoir un e-mail de confirmation.", "Merci d'avoir joué", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Un ou plusieurs champs de sont pas complet, merci de tous les renseigner.", "Information incomplette", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
public class GPCS_Candidat { private CL_CAM oCAM; private message oMsg = new message(); private Candidat oCandidat = new Candidat(); private Candidat aCandidat = new Candidat(); public void NouveauCandidat(Candidat aCandidat) //Processus d'ajout de candidat { this.oCandidat = this.aCandidat; this.oMsg.OCandidat = this.oCandidat; this.oMsg.Message = "CANDIDAT_nouveau"; this.oCAM = new CL_CAM(this.oMsg); this.oCAM.redirection(); } }
private message oMsg = new message(); private CtrlWFCandidatNouveau oCtrlWFCandidatNouveau; public CL_CAM(message aMsg) // Gestion des messages { this.oMsg = aMsg; } public message redirection() // Redirection { if (this.oMsg.Message == "CANDIDAT_nouveau") { this.oCtrlWFCandidatNouveau = new CtrlWFCandidatNouveau(this.oMsg); this.oCtrlWFCandidatNouveau.execute(); return this.oMsg; } else { return null; } }
private Candidat oCandidat = new Candidat(); private message oMsg = new message(); private MappageCandidat oMap = new MappageCandidat(); private CL_CAD oCAD = new CL_CAD(); public CtrlWFCandidatNouveau(message aMessage) //Gestion des messages { this.oCandidat = aMessage.OCandidat; } public void execute() //Ajoute le nom et le prénom à la table candidat { oCAD.m_ActionRows(oMap.ajout_candidat(this.oCandidat.Nom, this.oCandidat.Prenom)); }
private String rqSQL = null; public String ajout_candidat(String nom_can, String prenom_can) // Requête d'ajout Nom + Prenom a la table candidat { this.rqSQL = "INSERT INTO JeuxConcours.dbo.candidat (nom_can, prenom_can) VALUES ('" + nom_can + "','" + prenom_can + "')"; Console.Out.WriteLine("Mappage de la requete ajout candidat " + this.rqSQL); return this.rqSQL; }
public class message { private Candidat oCandidat; private String msg; public Candidat OCandidat //Candidat { get { return oCandidat; } set { oCandidat = value; } } public String Message //Message { get { return msg; } set { msg = value; } } }
public class Candidat { public String nom; public String prenom; public Candidat() { } public String Nom //Nom { get { return nom; } set { nom = value; } } public String Prenom // Prenom { get { return prenom; } set { prenom = value; } } }
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question