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_fenxi : System.Web.UI.Page
{
    public int userid = 0;
    public string lid = 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"]);
        }
        databind();
    }
    public void databind()
    {
        DataSet ds = DbHelperSQL.Query("select * from etw_web where usernameid=" + userid + "");
        if (ds.Tables[0].Rows.Count > 0)
        {
            Repeater1.DataSource = ds.Tables[0].DefaultView;
            Repeater1.DataBind();
        }
        int i=0;
        if (ds.Tables[0].Rows.Count > 0)
        {
            DropDownList1.DataSource = ds.Tables[0].DefaultView;
            DropDownList1.DataTextField = "website";
            DropDownList1.DataValueField = "jsqid";
            string d = ds.Tables[0].Rows[i]["langId"].ToString();
            if (ds.Tables[0].Rows[i]["langId"].ToString() == "18")
            {
                lid = "1";
            }
            else
            {
                lid = "0";
            }
            DropDownList1.DataBind();
            i++;
        }
        TextBox1.Text = DateTime.Now.ToString("yyyy-MM-dd");
        TextBox2.Text = DateTime.Now.ToString("yyyy-MM-dd");
    }

 
        
 
}
