Esempio n. 1
0
 protected void btn_del_Click(object sender, EventArgs e)
 {
     if (lbl_del.Visible == false)
     {
         lbl_del.Visible  = true;
         lbl_del1.Visible = true;
     }
     else
     {
         lbl_del.Visible  = false;
         lbl_del1.Visible = false;
         localhost.Service my_Serv = new localhost.Service();
         my_Serv.ChangeUserStatus(Session["User"].ToString(), 0);
         DataSet ds = my_Serv.GetUserMess(Session["User"].ToString());
         for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
         {
             my_Serv.EditMessageStatus(ds.Tables[0].Rows[i][0].ToString(), ds.Tables[0].Rows[i][1].ToString(), 0);
         }
         Session["User"] = null;
         Session["Rank"] = null;
         ((LinkButton)this.Master.FindControl("SignIn")).Visible  = true;
         ((LinkButton)this.Master.FindControl("SignOut")).Visible = false;
         Response.Redirect("Home.aspx");
     }
 }
Esempio n. 2
0
 protected void gr1_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName.Equals("Select"))
     {
         if (index == -1)
         {
             index = int.Parse(e.CommandArgument.ToString());
         }
         else
         {
             ((Button)gr1.Rows[index].FindControl("btn_pass")).Visible = true;
             ((Label)gr1.Rows[index].FindControl("lbl_pass")).Visible  = false;
             index = int.Parse(e.CommandArgument.ToString());
         }
         ((Button)gr1.Rows[index].FindControl("btn_pass")).Visible = false;
         ((Label)gr1.Rows[index].FindControl("lbl_pass")).Visible  = true;
     }
     if (e.CommandName.Equals("App"))
     {
         appind = int.Parse(e.CommandArgument.ToString());
         localhost.Service s = new localhost.Service();
         s.ChangeUserStatus(gr1.Rows[appind].Cells[0].Text, 1);
         Show(y);
     }
     if (e.CommandName.Equals("Del"))
     {
         appind = int.Parse(e.CommandArgument.ToString());
         localhost.Service s = new localhost.Service();
         s.ChangeUserStatus(gr1.Rows[appind].Cells[0].Text, 0);
         DataSet ds = s.GetUserMess(gr1.Rows[appind].Cells[0].Text);
         for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
         {
             s.EditMessageStatus(ds.Tables[0].Rows[i][0].ToString(), ds.Tables[0].Rows[i][1].ToString(), 0);
         }
         Show(y);
     }
     if (e.CommandName.Equals("Ret"))
     {
         appind = int.Parse(e.CommandArgument.ToString());
         localhost.Service s = new localhost.Service();
         s.ChangeUserStatus(gr1.Rows[appind].Cells[0].Text, 1);
         Show(y);
     }
 }