using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using ZXDT.CallCenter.MVCWeb.Models;
namespace ZXDT.CallCenter.MVCWeb.Controllers
{
public class OptLogsController : Controller
{
//
// GET: /OptLogs/
///
/// 登录日志
///
///
public ActionResult LoginLogList()
{
WorkOrderMyModel model = new WorkOrderMyModel();
return View(model);
}
///
/// 获取通话记录
///
/// 当前页码
/// 每页数据量
/// 查询条件
///
[ActionName("LoginLogsData")]
[HttpGet]
public string LoginLogsData(DateTime? NowDateTime, int page, int limit, string userName, string dateParty)
{
//数据结果集
ResponseData dataModel = new ResponseData();
string sql = "";
if (!string.IsNullOrEmpty(userName))
{
sql += " and F_LoginName like '%" + userName + "%'";
}
//查询按钮
if (!string.IsNullOrEmpty(dateParty))
{
string startDate = dateParty.Substring(0, 19);
string endDate = dateParty.Substring(21);
sql += " and F_LoginDate>= '" + startDate + "'";
sql += " and F_LoginDate<= '" + endDate + "'";
}
DataTable dt = new DataTable();
int recordCount = 0;
Model.PageData pageModel = new Model.PageData();
dt = BLL.PagerBLL.GetListPager(
"T_Sys_LoginLogs",
"F_Id",
"*,CONVERT(varchar,F_LoginDate, 120 ) as F_LoginDateNew",
sql,
"ORDER BY F_Id desc",
limit,
page,
true,
out recordCount);
dataModel.code = 0;
dataModel.count = recordCount;
dataModel.data = dt;
string json = JsonConvert.SerializeObject(dataModel);
return json;
}
}
}