using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class etwuser_addfeedback : System.Web.UI.Page
{
    public int userid = 0;
    public string msg = string.Empty;
    protected void Page_Load(object sender, EventArgs e)
    {
        HttpCookie GetCookie = Request.Cookies["cookEtwuser"];
        if (Request.Cookies["cookEtwuser"] == null)
        {
            Response.Redirect("../index.aspx");
        }
        DataSet ds1 = DbHelperSQL.Query("select userid from etw_user where username='" + GetCookie["username"].ToString() + "'");
        if (ds1.Tables[0].Rows.Count > 0)
        {
            userid = Convert.ToInt32(ds1.Tables[0].Rows[0]["userid"]);
            Fun.Funrecord(Request.Url.AbsoluteUri,Page.Request.UserHostAddress, userid.ToString());
        }
    }
    protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
    {
        if (aboutstxt.Text.Trim() != "")
        {
            etw.etw_suggest lead = new etw.etw_suggest();
            lead.userid = userid;
            lead.abouts = RadioButtonList1.SelectedItem.Text.Trim() + "：" + Fun.Encode(aboutstxt.Text.Trim());
            lead.suggest = Fun.Encode(suggesttxt.Text.Trim());
            lead.addtime = Fun.GetDateTime();
            lead.tel = Fun.Encode(tel.Text.Trim());
            lead.Add();
            Fun.JsAlerT("添加成功！", "feedback.aspx");
        }
        else
        {
            Label1.Text = "不能为空!";
        }
    }
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        aboutstxt.Text = "";
        suggesttxt.Text = "";
    }
}
