protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //ViewState["search"] = " 1=1"; //BindInfo(); //export(); if (null != Request.Cookies[Cookie.ComplanyId] && Request.Cookies[Cookie.ComplanyId] != null) { HttpCookie userid = Request.Cookies[Cookie.ComplanyId]; ViewState["userid"] = userid.Value; ViewState["search"] = " 1=1"; BindInfo(); } else { SystemTool.AlertShow_Refresh2(this, "login.aspx"); } } }
protected void lbtn_logout_Click(object sender, EventArgs e) { if (Request.Cookies[Cookie.ComplanyId] != null) { HttpCookie httpcookie = Request.Cookies[Cookie.ComplanyId]; httpcookie.Expires = DateTime.Now.AddDays(-1); Response.AppendCookie(httpcookie); if (Request.Cookies[Cookie.ComplanyId] != null) { HttpCookie hc3 = Request.Cookies[Cookie.ComplanyId]; hc3.Expires = DateTime.Now.AddDays(-1); hc3.Values.Clear(); Response.Cookies.Set(hc3); } SystemTool.AlertShow_Refresh2(this, "Login.aspx"); } else { SystemTool.AlertShow_Refresh2(this, "Login.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //ViewState["search"] = " 1=1"; //BindInfo(); //export(); if (null != Request.Cookies[Cookie.ComplanyId] && Request.Cookies[Cookie.ComplanyId] != null) { HttpCookie userid = Request.Cookies[Cookie.ComplanyId]; ViewState["userid"] = userid.Value; ViewState["search"] = " and 1=1"; //string sql = "select * from tiaojian_info"; //DataSet ds = DB.ExecuteSqlDataSet(sql, null); //if (ds.Tables[0].Rows.Count > 0) //{ // string caoqi = ds.Tables[0].Rows[0]["chaoqi"].ToString(); // string weidaohuo = ds.Tables[0].Rows[0]["weidaohuo"].ToString(); // double cq = Convert.ToDouble(caoqi); // double wdh = Convert.ToDouble(weidaohuo); // string dscq = DateTime.Now.AddDays(-cq).ToString("yyyy-MM-dd"); // string dswdh = DateTime.Now.AddDays(wdh).ToString("yyyy-MM-dd"); // datemin.Value = dscq; // datemax.Value = dswdh; // ViewState["search"] += " and b.yingdaoshijian >='" + dscq + "' "; // ViewState["search"] += " and b.yingdaoshijian <='" + dswdh + "' "; //} //BinDDL(); BindInfo(); } else { SystemTool.AlertShow_Refresh2(this, "login.aspx"); } } }