protected void btnLogin_Click(object sender, ImageClickEventArgs e) { // La connexion à la base de données SqlConnection cn = Class1.GetConnection(); // la requête sous forme de chaîne de caractères String txtReq = "Select * from t_user where login_user = '******' " + " and pwd = '" + this.txtPwd.Text + " '"; DataTable dt = Class1.Executer_Requete(txtReq, "maTable"); if (dt.Rows.Count == 0) { this.lblError.Text = "Veuillez vérifier vos paramètres de connexion"; this.lblError.Visible = true; } else { FormsAuthentication.SetAuthCookie("", false); Session["mat_user"] = dt.Rows[0][0]; Session["id_profil"] = dt.Rows[0]["id_profil"]; Session["NP"] = dt.Rows[0]["nom"] + " " + dt.Rows[0]["prenom"]; // Profil Utilisateur if (Convert.ToString(Session["id_profil"]) == "4") { Response.Redirect("user_lst_reclamations.aspx"); } // Profil Administrateur else if (Convert.ToString(Session["id_profil"]) == "1") { Response.Redirect("admin_affect.aspx"); } } }
void S_Source_rech() { string req = ""; if (this.CB_Etat.SelectedValue == "0") { if (this.CB_TypeRec.SelectedValue == "0") { req = "Select * from V_reclam order by date_maj desc"; } else { req = "Select * from V_reclam where id_type_probleme = " + this.CB_TypeRec.SelectedValue + " order by date_maj desc"; } } else { if (this.CB_TypeRec.SelectedValue == "0") { req = "Select * from V_reclam where id_etat = " + this.CB_Etat.SelectedValue + " order by date_maj desc"; } else { req = "Select * from V_reclam where id_type_probleme = " + this.CB_TypeRec.SelectedValue + " and id_etat = " + this.CB_Etat.SelectedValue + " order by date_maj desc"; } } DataTable dt; dt = Class1.Executer_Requete(req, "tab_reclams"); this.DGV1.DataSource = dt; this.DGV1.DataBind(); }
void Alimenter_Grid() { string req = "select * from V_RECLAM order by date_maj desc"; DataTable dt = Class1.Executer_Requete(req, "vrec"); this.DGV1.DataSource = dt; this.DGV1.DataBind(); }
void Alimenter_Grid() { string req = "select * from v_reclam"; DataTable dt = Class1.Executer_Requete(req, "v_rec"); this.DGV1.DataSource = dt; this.DGV1.DataBind(); }
//void Config_affichage() public void S_Source() { string req = "Select * from V_reclam order by date_maj desc"; DataTable dt; dt = Class1.Executer_Requete(req, "tab_reclams"); this.DGV1.DataSource = dt; this.DGV1.DataBind(); this.DGV1.Columns[1].Visible = false; }
void S_Source() { string req = "select * from v_reclam where id_reclam= " + Convert.ToInt32(Session["id_reclam"]); DataTable dt; dt = Class1.Executer_Requete(req, "t_rec"); string mat_user = Convert.ToString(dt.Rows[0]["mat_user"]); string titre = Convert.ToString(dt.Rows[0]["Titre"]); string desc = Convert.ToString(dt.Rows[0]["Description"]); this.lblmat.Text = mat_user; this.txtTitre.Text = titre; this.txtDesc.Text = desc; this.cbType.SelectedValue = Convert.ToString(dt.Rows[0]["id_type_probleme"]); }
void Filtre_Grid() { // Aucun choix if (cb_Etat.SelectedValue == "0") { Alimenter_Grid(); } else // Filtrer par etat { string req = "select * from v_reclam where id_etat = " + this.cb_Etat.SelectedValue; DataTable dt = Class1.Executer_Requete(req, "v_rec"); this.DGV1.DataSource = dt; this.DGV1.DataBind(); } }