/// <summary>
 /// 获取充电站
 /// </summary>
 /// <param name="context"></param>
 private void GetChargStation(HttpContext context)
 {
     try
     {
         int    page = 1, rows = 10, total = 0;
         string tmp = context.Request["page"].ToString();
         if (!string.IsNullOrEmpty(tmp))
         {
             page = int.Parse(tmp);
         }
         tmp = context.Request["rows"].ToString();
         if (!string.IsNullOrEmpty(tmp))
         {
             rows = int.Parse(tmp);
         }
         RequestHandling_BLL gdrBll = new RequestHandling_BLL();
         DataTable           dt     = gdrBll.GetChargStationQuery(page, rows, ref total);
         string strJson             = JSonHandle.ToJson(dt, total, "yyyy-MM-dd");
         context.Response.Write(strJson);
     }
     catch (Exception e)
     {
         Log.Error(e);
     }
 }
        /// <summary>
        ///获取死锁的充电桩数据
        /// </summary>
        /// <param name="context"></param>
        public void GetPileLockQuery(HttpContext context)
        {
            try
            {
                int    page = 1, rows = 10, total = 0;
                string tmp = context.Request["page"].ToString();
                if (!string.IsNullOrEmpty(tmp))
                {
                    page = int.Parse(tmp);
                }
                tmp = context.Request["rows"].ToString();
                if (!string.IsNullOrEmpty(tmp))
                {
                    rows = int.Parse(tmp);
                }

                string strUrl = CodeAnywhere.Util.Platframework.Current.ReadCfg("url", "http://wl715.mooo.com:90/PowerpileService/rpc/JsonRpcService.rpc");
                RequestHandling_BLL gdrBll = new RequestHandling_BLL();
                DataTable           dt     = gdrBll.GetPileLockQuery(page, rows, ref total, strUrl);
                string strJson             = JSonHandle.ToJson(dt, total, "yyyy-MM-dd");
                context.Response.Write(strJson);
            }
            catch (Exception e)
            {
                Log.Error(e);
            }
        }
Exemple #3
0
        /// <summary>
        /// 充电卡明细记录查询
        /// </summary>
        /// <param name="context"></param>
        private void GetListQuery(HttpContext context)
        {
            try
            {
                int    page = 1, rows = 10, total = 0;
                string tmp = context.Request["page"].ToString();
                if (!string.IsNullOrEmpty(tmp))
                {
                    page = int.Parse(tmp);
                }
                tmp = context.Request["rows"].ToString();
                if (!string.IsNullOrEmpty(tmp))
                {
                    rows = int.Parse(tmp);
                }

                string   cardno = context.Request["cardno"].ToString();
                DateTime sdt    = new DateTime();
                string   sj     = context.Request["sdt"] ?? "";
                if (sj.Length > 0)
                {
                    sdt = DateTime.Parse(sj);
                }
                DateTime edt = new DateTime();
                string   ej  = context.Request["edt"] ?? "";
                if (ej.Length > 0)
                {
                    edt = DateTime.Parse(ej).AddDays(1);
                }
                string zhanid = "";
                try {
                    zhanid = context.Request["zhanid"].ToString();
                }
                catch (Exception ex)
                {
                    zhanid = "";
                }
                RequestHandling_BLL gdrBll = new RequestHandling_BLL();
                DataTable           dt     = gdrBll.GetDataTableQuery(cardno, sdt, edt, zhanid, page, rows, ref total);

                //List<GatDataRecord> list = ConvertHelper<GatDataRecord>.ConvertToList(dt);
                //PageObject<GatDataRecord> pageO = new PageObject<GatDataRecord>();
                //pageO.total = list.Count;
                //pageO.rows = list;
                //var strJson = jss.Serialize(pageO);

                string strJson = JSonHandle.ToJson(dt, total, "yyyy-MM-dd HH:mm");


                context.Response.Write(strJson);
            }
            catch (Exception e)
            {
                Log.Error(e);
            }
        }
        /// <summary>
        ///获取遥测明细数据
        /// </summary>
        /// <param name="context"></param>
        public void GetPileTelemetryQuery(HttpContext context)
        {
            try
            {
                int    page = 1, rows = 10, total = 0;
                string tmp = context.Request["page"].ToString();
                if (!string.IsNullOrEmpty(tmp))
                {
                    page = int.Parse(tmp);
                }
                tmp = context.Request["rows"].ToString();
                if (!string.IsNullOrEmpty(tmp))
                {
                    rows = int.Parse(tmp);
                }
                string   pileno = context.Request["pileno"].ToString();
                DateTime sdt    = new DateTime();
                string   sj     = context.Request["sdt"] ?? "";
                if (sj.Length > 0)
                {
                    sdt = DateTime.Parse(sj);
                }
                DateTime edt = new DateTime();
                string   ej  = context.Request["edt"] ?? "";
                if (ej.Length > 0)
                {
                    edt = DateTime.Parse(ej);
                }
                string itemname            = context.Request["itemname"].ToString();
                string strUrl              = CodeAnywhere.Util.Platframework.Current.ReadCfg("url", "http://wl715.mooo.com:90/PowerpileService/rpc/JsonRpcService.rpc");
                RequestHandling_BLL gdrBll = new RequestHandling_BLL();
                DataTable           dt     = gdrBll.GetPileTelemetryQuery(pileno, sdt, edt, itemname, page, rows, ref total, strUrl);

                string strJson = JSonHandle.ToJson(dt, total, "yyyy-MM-dd HH:mm:ss");
                context.Response.Write(strJson);
            }
            catch (Exception e)
            {
                Log.Error(e);
            }
        }
        /// <summary>
        /// 充电卡数据汇总
        /// </summary>
        /// <param name="context"></param>
        private void GetListTotal(HttpContext context)
        {
            try
            {
                int    page = 1, rows = 10, total = 0;
                string tmp = context.Request["page"].ToString();
                if (!string.IsNullOrEmpty(tmp))
                {
                    page = int.Parse(tmp);
                }
                tmp = context.Request["rows"].ToString();
                if (!string.IsNullOrEmpty(tmp))
                {
                    rows = int.Parse(tmp);
                }

                string   zhanid = context.Request["zhanid"].ToString();
                DateTime sdt    = new DateTime();
                string   sj     = context.Request["sdt"] ?? "";
                if (sj.Length > 0)
                {
                    sdt = DateTime.Parse(sj);
                }
                DateTime edt = new DateTime();
                string   ej  = context.Request["edt"] ?? "";
                if (ej.Length > 0)
                {
                    edt = DateTime.Parse(ej).AddDays(1);
                }
                RequestHandling_BLL gdrBll = new RequestHandling_BLL();
                DataTable           dt     = gdrBll.GetDataTableTotal(zhanid, sdt, edt, page, rows, ref total);
                string strJson             = JSonHandle.ToJson(dt, total, "yyyy-MM-dd");
                context.Response.Write(strJson);
            }
            catch (Exception e)
            {
                Log.Error(e);
            }
        }