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
| using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAL;
using BEL;
using System.Data;
using System.Data.SqlClient;
namespace BAL
{
public class Operations
{
public Dbconnection db = new Dbconnection();
public Informations info = new Informations();
// ici nous declarons les requete et db operation dont on a besoin pour l'application
public int insertUsers (Informations info)
{
//throw new NotImplementedException();
SqlCommand cmd =new SqlCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "insert into users VALUES ('" + info.nom + "','" + info.prenom + "','" + info.login + "','" + info.mdp + "','" + info.profil + "','" + info.datecreat + "','" + info.sexe + "')";
return db.ExeNonQuery(cmd);
}
public DataTable login(Informations info)
{
//throw new NotImplementedException();
SqlCommand cmd = new SqlCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "select * from users where login_users='"+info.login+"' and mdp_users='"+info.mdp+"'";
return db.ExeReader(cmd);
}
public int insertprofil(Informations info)
{
SqlCommand cmd = new SqlCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "insert into profil(libprofil) VALUES ('" + info.libprofil + "')";
return db.ExeNonQuery(cmd);
}
public int insertmod(Informations info)
{
SqlCommand cmd = new SqlCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "insert into mod(nommod,nomcompletmod,contactmod) VALUES ('" + info.nommod + "','" + info.nomcompletmod + "','" + info.contactmod + "')";
return db.ExeNonQuery(cmd);
}
public int insertclient(Informations info)
{
SqlCommand cmd = new SqlCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "insert into client(nomclient,nomcomplet,contact) VALUES ('" + info.nomclient + "','" + info.nomcomplet + "','" + info.contact+ "')";
return db.ExeNonQuery(cmd);
}
public int insertbanque(Informations info)
{
SqlCommand cmd = new SqlCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "insert into banque(codebanque,libanque,comptebanque,creepar) VALUES ('" + info.codebanque + "','" + info.libanque + "','" + info.comptebanque + "','" + info.creepar + "')";
return db.ExeNonQuery(cmd);
}
public int insertprojet(Informations info)
{
SqlCommand cmd = new SqlCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "insert into projet (titre_projet,lieu_projet,pays_projet,client_projet,mod_projet,perso_projet,nbperso_projet,adresse_projet,mont_projet,finance_projet,nbhomme_projet,datdemar_projet1,datdemar_projet2,datachev1_projet1,datachev2_projet1,datachev1_projet2,datachev2_projet2,mtetude_projet,mtsuivi_projet,mtetmdec_projet,consasso_projet,nbhcons_projet,respons_projet,descrip_projet,desserv_projet,creepar) VALUES ('" + info.titre_projet + "','" + info.lieu_projet + "','" + info.pays_projet + "','" + info.client_projet + "','" + info.mod_projet + "','" + info.perso_projet + "','" + info.nbperso_projet + "','" + info.adresse_projet + "','" + info.mont_projet + "','" + info.finance_projet + "','" + info.nbhomme_projet + "','" + Convert.ToDateTime(info.datdemar_projet1) + "','" + Convert.ToDateTime(info.datdemar_projet2) + "','" + Convert.ToDateTime(info.datachev1_projet1) + "','" + Convert.ToDateTime(info.datachev2_projet1) + "','" + Convert.ToDateTime(info.datachev1_projet2) + "','" + Convert.ToDateTime(info.datachev2_projet2) + "','" + info.mtetude_projet + "','" + info.mtsuivi_projet + "','" + info.mtetmdec_projet + "','" + info.consasso_projet + "','" + info.nbhcons_projet + "','" + info.respons_projet + "','" + info.descrip_projet + "','" + info.desserv_projet + "','" + info.creepar + "')";
return db.ExeNonQuery(cmd);
}
}
} |
Partager