Exemple #1
0
        /// <summary>
        /// 初始化页面
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            string username = Request.QueryString["username"];

            if (!userLogin.CheckLogin(username))
            {
                string js = "alert('您没有登录或操作超时,请重新登录!');window.top.location.href='" + StaticInfo.LoginPage + "'";
                System.Web.HttpContext.Current.Response.Write("<script type='text/javascript'>" + js + "</script>");
                return;
            }
            if (!X.IsAjaxRequest)
            {
                if (Session["Devices"] != null)
                {
                    List <string> list = (List <string>)Session["Devices"];
                    device_id          = list[7];
                    TxtDeviceName.Text = list[1];
                    ComboBox1.SetValue(list[3]);
                    ComboBox2.SetValue(list[4]);
                    CmbDeviceType.SetValue(list[5]);
                    endtime   = end.InnerText = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                    starttime = start.InnerText = DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd HH:mm:ss");
                    DataTable da = deviceManager.GetDeviceTypeMode("device_type_id='" + list[5] + "'");
                    this.StoreSDeviceMode.DataSource = da;
                    this.StoreSDeviceMode.DataBind();
                    CmbSBXH.SetValue(list[6]);
                }

                StoreDataBind();
            }
        }