protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.QueryString["Name"] != null) { String no_user = Request.QueryString["user_id"]; } if (Request.QueryString["usuario"] != null) { String rol = Request.QueryString["id_rol"]; } } DAOcomenta men = new DAOcomenta(); EDcomenta usuario = new EDcomenta(); int index = int.Parse(Session["id_herramienta"].ToString()); DataTable table = men.extrae_comentario(index); Int64 he = Int64.Parse(this.Session["id_herramienta"].ToString()); DAOHerramienta puntos = new DAOHerramienta(); lb_puntos.Text = he.ToString(); }
protected void comentar_Click(object sender, EventArgs e) { if (int.Parse(Session["id_rol"].ToString()) == 1) { EDcomenta com = new EDcomenta(); DAOcomenta men = new DAOcomenta(); int val = int.Parse(Session["id_herramienta"].ToString()); com.Textarea = tarea.InnerText; com.User = int.Parse(Session["user_id"].ToString()); com.Herramienta = val; men.insertarComentario(com); Response.Redirect("muestra_win.aspx"); } }
protected void respuesta_Click(object sender, EventArgs e) { EDcomenta com = new EDcomenta(); DAOcomenta men = new DAOcomenta(); com.User_resp = int.Parse(Session["user_id"].ToString()); int val = 0; do { foreach (GridViewRow row in gridcomentarios.Rows) { TextBox txtresp = ((TextBox)gridcomentarios.Rows[row.RowIndex].FindControl("resp")); Label idcomen = ((Label)gridcomentarios.Rows[row.RowIndex].FindControl("Label1")); idcomen.Text = idcomen.Text; Session["idcomen"] = idcomen; string valor = txtresp.Text; com.Valor = int.Parse(idcomen.Text); com.Respuesta = valor; if (valor != "") { val = 1; men.insertarRespuesta(com); Response.Redirect("muestra_win.aspx"); } } } while (val < 0); }