protected void Page_Load(object sender, EventArgs e)
        {
            string chaine1 = Request.QueryString.Get("id");
            int    id      = Int32.Parse(chaine1);
            string chaine2 = Request.QueryString.Get("tx");
            string chaine3 = Request.QueryString.Get("idem");
            int    idem    = Int32.Parse(chaine3);
            int    idcr    = Int32.Parse(Session["id"].ToString());

            if (chaine2 == "0")
            {
                CRUD.DAL.UpdateA(id);



                CRUD.Message m1 = new CRUD.Message(idem, idcr, id, "votre demande a été accepte ", "Acceptation ");
                CRUD.DAL.ajoutermessageRep(m1);
                Response.Redirect("Home.aspx");
            }
            else
            {
                CRUD.DAL.UpdateR(id);
                CRUD.Message m1 = new CRUD.Message(idem, idcr, id, "votre demande a été refusé ", "Refuse ");
                CRUD.DAL.ajoutermessageRep(m1);
                Response.Redirect("Home.aspx");
            }
        }
Example #2
0
        protected void Send_Click(object sender, EventArgs e)
        {
            int    i      = 0;
            string chaine = Request.QueryString.Get("id");
            string ch     = Session["id"].ToString();
            int    ch2    = Int32.Parse(Request.QueryString.Get("mg"));

            if (Int32.Parse(chaine) == 0)
            {
                int          iddestinateur = CRUD.DAL.getidmgcourantn(inpoutTo2.Text);
                CRUD.Message m             = new CRUD.Message(Int32.Parse(ch), iddestinateur, 0, inputBody.Text, typetr.Text);
                i = CRUD.DAL.ajoutermessage(m);
            }
            else
            {
                if (ch2 == 0)
                {
                    CRUD.Message m1 = new CRUD.Message(Int32.Parse(ch), Int32.Parse(chaine), 0, inputBody.Text, typetr.Text);
                    i = CRUD.DAL.ajoutermessage(m1);
                }
                else
                {
                    CRUD.Message m1 = new CRUD.Message(Int32.Parse(ch), Int32.Parse(chaine), ch2, inputBody.Text, typetr.Text);
                    i = CRUD.DAL.ajoutermessageRep(m1);
                }
            }


            if (i == 1)
            {
                mg.Visible = true;
            }
            else
            {
                err.Visible = true;
            }
        }