12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using LeaRun.Data;
- using System.Data;
- using Newtonsoft.Json;
- using LeaRun.Util.WebControl;
- using LeaRun.Util;
- namespace LeaRun.Application.Web.Areas.NBManage.Controllers
- {
- public class NBCommandHisController : Controller
- {
- SqlHelper helper = new SqlHelper("NBDB");
- //
- // GET: /NBManage/NBCommandHis/
- public ActionResult Index(string id, string cmdType)
- {
- ViewBag.id = id;
- ViewBag.cmdType = cmdType;
- return View();
- }
- public ActionResult GetCmdHis(string id, string cmdType, Pagination pagination)
- {
- string selSql = "select * from dbo.RMRS_SendCmdRecord where MeterId = " + id + " and CmdType = " + cmdType ;
- var watch = CommonHelper.TimerStart();
- //DataTable dtResult = helper.ExecuteDataTable(selSql, CommandType.Text, null);
- int total = pagination.records;
- DataTable dtResult = helper.ExecuteDataTable(selSql, "RecvTime", false, pagination.rows, pagination.page, out total, null);
- pagination.records = total;
-
- var JsonData = new
- {
- rows = dtResult,
- total = pagination.total,
- page = pagination.page,
- records = pagination.records,
- costtime = CommonHelper.TimerEnd(watch)
- };
- return Content(JsonData.ToJson());
- }
- }
- }
|