地铁二期项目正式开始

OptLogsController.cs 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. using Newtonsoft.Json;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Data;
  5. using System.Linq;
  6. using System.Web;
  7. using System.Web.Mvc;
  8. using YTSoft.BaseCallCenter.MVCWeb.Models;
  9. namespace YTSoft.BaseCallCenter.MVCWeb.Controllers
  10. {
  11. public class OptLogsController : Controller
  12. {
  13. //
  14. // GET: /OptLogs/
  15. /// <summary>
  16. /// 登录日志
  17. /// </summary>
  18. /// <returns></returns>
  19. public ActionResult LoginLogList()
  20. {
  21. WorkOrderMyModel model = new WorkOrderMyModel();
  22. return View(model);
  23. }
  24. /// <summary>
  25. /// 获取通话记录
  26. /// </summary>
  27. /// <param name="page">当前页码</param>
  28. /// <param name="limit">每页数据量</param>
  29. /// <param name="sqlWhere">查询条件</param>
  30. /// <returns></returns>
  31. [ActionName("LoginLogsData")]
  32. [HttpGet]
  33. public string LoginLogsData(DateTime? NowDateTime, int page, int limit, string userName, string dateParty)
  34. {
  35. //数据结果集
  36. ResponseData dataModel = new ResponseData();
  37. string sql = "";
  38. if (!string.IsNullOrEmpty(userName))
  39. {
  40. sql += " and F_LoginName like '%" + userName + "%'";
  41. }
  42. //查询按钮
  43. if (!string.IsNullOrEmpty(dateParty))
  44. {
  45. string startDate = dateParty.Substring(0, 19);
  46. string endDate = dateParty.Substring(21);
  47. sql += " and F_LoginDate>= '" + startDate + "'";
  48. sql += " and F_LoginDate<= '" + endDate + "'";
  49. }
  50. DataTable dt = new DataTable();
  51. int recordCount = 0;
  52. Model.PageData<Model.T_Call_CallRecords_All> pageModel = new Model.PageData<Model.T_Call_CallRecords_All>();
  53. dt = BLL.PagerBLL.GetListPager(
  54. "T_Sys_LoginLogs",
  55. "F_Id",
  56. "*,CONVERT(varchar,F_LoginDate, 120 ) as F_LoginDateNew",
  57. sql,
  58. "ORDER BY F_Id desc",
  59. limit,
  60. page,
  61. true,
  62. out recordCount);
  63. dataModel.code = 0;
  64. dataModel.count = recordCount;
  65. dataModel.data = dt;
  66. string json = JsonConvert.SerializeObject(dataModel);
  67. return json;
  68. }
  69. }
  70. }