示例#1
0
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <returns></returns>
        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)
            {
                try
                {
                    CmbYear.Show();
                    CmbDay.Show();
                    CmbMonth.Show();
                    AddYear();
                    AddMonth();
                    AddWeek();
                    AddDay();
                    CmbYear.SelectedItem.Value  = DateTime.Now.Year.ToString();
                    CmbMonth.SelectedItem.Value = DateTime.Now.Month.ToString();
                    CmbDay.SelectedItem.Value   = DateTime.Now.Day.ToString();
                    CmbCountType.SelectedIndex  = 0;
                    //SelectRow("116.386522", "37.466293", "");
                    this.Department.DataSource = GetRedisData.GetData("t_cfg_department");
                    this.Department.DataBind();
                    cbodepart.SelectedIndex = 0;
                    //DataSet ds = bll.GetDepart();
                    //if (ds != null && ds.Tables[0].Rows.Count > 0)
                    //{
                    //    this.Department.DataSource = ds.Tables[0];
                    //    this.Department.DataBind();
                    //    cbodepart.SelectedIndex = 0;
                    //}
                    this.DataBind();
                    UserInfo userinfo = Session["Userinfo"] as UserInfo;
                    logManager.InsertLogRunning(userinfo.UserName, "访问:" + Request.QueryString["funcname"], userinfo.NowIp, "0");
                }
                catch
                { }
            }
        }
        /// <summary>
        /// 选择查询类型
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void CmbCountType_Select(object sender, DirectEventArgs e)
        {
            try
            {
                switch (CmbCountType.SelectedItem.Value)
                {
                case "3":
                    CmbYear.Show();
                    CmbDay.Hide();
                    CmbMonth.Hide();
                    CmbWeek.Hide();

                    break;

                case "2":
                    CmbYear.Show();
                    CmbDay.Hide();
                    CmbMonth.Hide();
                    //CmbWeek.Show();
                    //CmbWeek.SelectedIndex = 0;
                    break;

                case "1":
                    CmbYear.Show();
                    CmbMonth.Show();
                    CmbDay.Hide();
                    CmbWeek.Hide();
                    break;

                case "0":
                    CmbYear.Show();
                    CmbDay.Show();
                    CmbMonth.Show();
                    CmbWeek.Hide();

                    break;
                }
            }
            catch (Exception ex)
            {
                ILog.WriteErrorLog(ex);
                logManager.InsertLogError("PassCarFlowCount.aspx-CmbCountType_Select", ex.Message + ";" + ex.StackTrace, "CmbCountType_Select has an exception");
            }
        }
        /// <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)
            {
                try
                {
                    CmbYear.Show();
                    CmbDay.Show();
                    CmbMonth.Show();
                    AddYear();
                    AddMonth();
                    AddWeek();
                    AddDay();
                    CmbYear.SelectedItem.Value  = DateTime.Now.Year.ToString();
                    CmbMonth.SelectedItem.Value = DateTime.Now.Month.ToString();
                    CmbDay.SelectedItem.Value   = DateTime.Now.Day.ToString();
                    BuildTree(TreeStation.Root);
                    Session["flowcaption"]       = "流量统计";
                    Session["flowxlable"]        = "小时";
                    this.WebChartViewer1.Visible = false;
                    CmbCountType.SelectedIndex   = 0;
                    //ButPrint.Hidden = true;
                    ButExcel.Hidden = true;
                    //ButChart.Hidden = true;
                    UserInfo userinfo = Session["Userinfo"] as UserInfo;
                    logManager.InsertLogRunning(userinfo.UserName, "访问:用户登录", userinfo.NowIp, "0");
                }
                catch (Exception ex)
                {
                    logManager.InsertLogError("PassCarFlowCount.aspx-Page_Load", ex.Message + ";" + ex.StackTrace, "Page_Load has an exception");
                    ILog.WriteErrorLog(ex);
                }
                this.DataBind();
            }
        }
示例#4
0
        /// <summary>
        /// 分析类型触发事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <returns></returns>
        protected void CmbCountType_Select(object sender, DirectEventArgs e)
        {
            switch (CmbCountType.SelectedItem.Value)
            {
            case "3":    //年
                CmbYear.Show();
                CmbDay.Hide();
                CmbMonth.Hide();
                CmbWeek.Hide();

                break;

            case "2":    //周
                CmbYear.Hide();
                CmbDay.Hide();
                CmbMonth.Hide();
                CmbWeek.Show();
                //CmbWeek.SelectedIndex = 0;
                break;

            case "1":    //月
                CmbYear.Show();
                CmbMonth.Show();
                CmbDay.Hide();
                CmbWeek.Hide();
                break;

            case "0":    //日
                CmbYear.Show();
                CmbDay.Show();
                CmbMonth.Show();
                CmbWeek.Hide();

                break;
            }
        }