protected void GVW_Annonces_RowCommand(object sender, GridViewCommandEventArgs e) { if (e == null) { return; } if (e.CommandName == "publier") { int id = Convert.ToInt32(e.CommandArgument); if (DataMapping.Update_Publish("o", id)) { RefreshGrid_Annonce(); RefreshGrid_Presentation(); } } else if (e.CommandName == "depublier") { int id = Convert.ToInt32(e.CommandArgument); if (DataMapping.Update_Publish("n", id)) { RefreshGrid_Annonce(); RefreshGrid_Presentation(); } } else if (e.CommandName == "supprimer") { int id = Convert.ToInt32(e.CommandArgument); if (DataMapping.Delete_Content(id, UserInfo.UserID) > 0) { RefreshGrid_Annonce(); RefreshGrid_Presentation(); } } }
protected void BT_Annuler_Click(object sender, EventArgs e) { if (Session["Insert"] == "o") { if (Session["id_contenu"] != null) { //Le user a voulu créer une annonce mais le user n'a pas validé donc, il faut la supprimer int idcontenu = 0; int.TryParse(Session["id_contenu"].ToString(), out idcontenu); if (idcontenu > 0) { if (DataMapping.Delete_Content(idcontenu, UserInfo.UserID) > 0) { Session["Insert"] = null; Session["id_contenu"] = null; Session[HF_Logo.Value] = null; Session[HL_Url.Text] = null; Session["publie"] = null; //retour à l'espace pro Response.Redirect(Globals.NavigateURL(ProTabId)); } } } } else { Session["Insert"] = null; Session["id_contenu"] = null; Session[HF_Logo.Value] = null; Session[HL_Url.Text] = null; Session["publie"] = null; //retour à l'annonce Response.Redirect(Functions.UrlAddParam(Globals.NavigateURL(Annoncetabid), "id_contenu", "" + id_contenu)); } }