Ejemplo n.º 1
0
 /// <summary>
 /// 创建图表
 /// </summary>
 /// <param name="datetime"></param>
 private void GetChartLine(string datetime)
 {
     try
     {
         string zs = "0";
         if (DateTime.Now.ToString("yyyy-MM-dd").Equals(datetime))
         {
             zs = GetRedisData.GetCount("PassCarCount:passcount");
         }
         else if (DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd").Equals(datetime))
         {
             zs = GetRedisData.GetCount("PassCarCount:passcount_last");
         }
         else
         {
             zs = dataCountInfo.GetPassCarCountDay(datetime);
         }
         int    MyCount = 99 / 10;
         string bfb     = MyCount.ToString() + ".9" + "%";
         string html    = "<ul  width=\"100%\">";
         html          = html + GetHtml("data1", GetLangStr("WebPassCarBarData1", "本市车辆"), zs, GetCount(datetime, "1"), bfb, "1", datetime);
         html          = html + GetHtml("data2", GetLangStr("WebPassCarBarData2", "本省车辆"), zs, GetCount(datetime, "2"), bfb, "2", datetime);
         html          = html + GetHtml("data3", GetLangStr("WebPassCarBarData3", "外省车辆"), zs, GetCount(datetime, "3"), bfb, "3", datetime);
         html          = html + GetHtml("data4", GetLangStr("WebPassCarBarData4", "黑名单"), zs, GetCount(datetime, "4"), bfb, "4", datetime);
         html          = html + GetHtml("data5", GetLangStr("WebPassCarBarData5", "初入车"), zs, GetCount(datetime, "5"), bfb, "5", datetime);
         html          = html + GetHtml("data6", GetLangStr("WebPassCarBarData6", "套牌车"), zs, GetCount(datetime, "6"), bfb, "6", datetime);
         html          = html + GetHtml("data7", GetLangStr("WebPassCarBarData7", "未年审"), zs, GetCount(datetime, "7"), bfb, "7", datetime);
         html          = html + GetHtml("data8", GetLangStr("WebPassCarBarData8", "黄标车"), zs, GetCount(datetime, "8"), bfb, "8", datetime);
         html          = html + "</ul>";
         divCount.Html = html;
     }
     catch (Exception ex)
     {
         ILog.WriteErrorLog(ex);
         logManager.InsertLogError("LoginWebPassCarBarDataaspx-GetChartLine", ex.Message + ";" + ex.StackTrace, "GetChartLine has an exception");
     }
 }
Ejemplo n.º 2
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('" + GetLangStr("CurrentDataCount13", "您没有登录或操作超时,请重新登录!") + "');window.top.location.href='" + StaticInfo.LoginPage + "'";
                System.Web.HttpContext.Current.Response.Write("<script type='text/javascript'>" + js + "</script>");
                return;
            }
            if (!X.IsAjaxRequest)
            {
                CountDay.Value = DateTime.Now.ToString("yyyy-MM-dd");

                lblDayCount.Text = GetRedisData.GetCount("PassCarCount:passcount");
                //dataCountInfo.GetPassCarCountDay(DateTime.Now.ToString("yyyy-MM-dd"));
                lblDayOnline.Text = GetRedisData.GetCount("PassCarCount:passcount_online");
                //dataCountInfo.GetOnlineCarCountDay(DateTime.Now.ToString("yyyy-MM-dd"));

                lblLastDay.Text = GetRedisData.GetCount("PassCarCount:passcount_last");
                //dataCountInfo.GetPassCarCountDay(DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd"));
                lblLastDayOnline.Text = GetRedisData.GetCount("PassCarCount:passcount_online_last");
                //dataCountInfo.GetOnlineCarCountDay(DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd"));

                int LastWeek = WeekOfYear(DateTime.Now) - 1;
                lblLastWeek.Text = GetRedisData.GetCount("PassCarCount:passcount_week");
                //dataCountInfo.GetPassCarCountWeek(LastWeek.ToString(), DateTime.Now.ToString("yyyy"));
                lblLastMonth.Text = GetRedisData.GetCount("PassCarCount:passcount_month");
                //dataCountInfo.GetPassCarCountMonth(DateTime.Now.ToString("yyyy-MM"));

                string date = DateTime.Now.ToString("yyyy-MM-dd");
                this.ResourceManager1.RegisterAfterClientInitScript("chooseDate('" + date + "')");
                this.DataBind();
                UserInfo userinfo = Session["Userinfo"] as UserInfo;
                logManager.InsertLogRunning(userinfo.UserName, GetLangStr("CurrentDataCount14", "访问:") + Request.QueryString["funcname"], userinfo.NowIp, "0");
            }
        }