Example #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();
            }
        }
 protected void ButResetClick(object sender, DirectEventArgs e)
 {
     CmbDeviceType.Reset();
     TxtDeviceName.Reset();
     this.ResourceManager1.RegisterAfterClientInitScript("clearTime();");
     CmbSBXH.Reset();
 }
 /// <summary>
 /// 重置事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void ButResetClick(object sender, DirectEventArgs e)
 {
     try
     {
         this.ResourceManager1.RegisterAfterClientInitScript("clearTime();");
         CmbDeviceType.Reset();
         TxtDeviceName.Reset();
         CmbSBXH.Reset();
     }
     catch (Exception ex)
     {
         ILog.WriteErrorLog(ex);
         logManager.InsertLogError("ServerManager.aspx-ButResetClick", ex.Message + ";" + ex.StackTrace, "ButResetClick has an exception");
     }
 }
 public void SelectDevice()
 {
     try
     {
         string    type = Cob_SBLX.SelectedItem.Value;//CmbDeviceType.SelectedItem.Value;
         DataTable da   = deviceManager.GetServerTypeMode("device_type_id='" + type + "'");
         CmbSBXH.Reset();
         Cob_SBXH.Reset();
         this.StoreSBXH.DataSource = da;
         this.StoreSBXH.DataBind();
     }
     catch (Exception ex)
     {
         ILog.WriteErrorLog(ex);
         logManager.InsertLogError("ServerManager.aspx-SelectDevice", ex.Message + ";" + ex.StackTrace, "SelectDevice has an exception");
     }
 }