public ActionResult GetFormJson(string keyValue, string starttime) { DateTime now = DateTime.Now; if (!string.IsNullOrEmpty(starttime)) { now = starttime.ToDate(); } var list = new DataStatisticsForm(); var item = userApp.GetForm(keyValue); var baocan = reportApp.GetCurrentTime(item.F_Id, now, 1); list.baocan = "0"; if (baocan != null) { list.baocan = "1"; } var attl = attlApp.GetCurrentTime(item.F_AttCard, now, true); list.shangban = "0"; if (attl != null) { list.shangban = "1"; } var attl2 = attlApp.GetCurrentTime(item.F_AttCard, now, false); list.xiaban = "0"; if (attl2 != null) { list.xiaban = "1"; } var pos = posApp.GetCurrentTime(item.F_PosCard, now, 0); list.zaocan = "0"; if (pos != null) { list.zaocan = "1"; } var pos1 = posApp.GetCurrentTime(item.F_PosCard, now, 1); list.wucan = "0"; if (pos1 != null) { list.wucan = "1"; } var pos2 = posApp.GetCurrentTime(item.F_PosCard, now, 2); list.wancan = "0"; if (pos2 != null) { list.wancan = "1"; } return(Content(list.ToJson())); }
public ActionResult GetGridDataStatisticsJson(Pagination pagination, string keyword, string starttime) { DateTime now = DateTime.Now; if (!string.IsNullOrEmpty(starttime)) { now = starttime.ToDate(); } var lists = new List <DataStatisticsForm>(); foreach (var item in userApp.GetList(pagination, keyword)) { var list = new DataStatisticsForm(); list.F_DepartmentId = item.F_DepartmentId; list.F_Id = item.F_Id; list.name = item.F_RealName; var baocan = reportApp.GetCurrentTime(item.F_Id, now, 1); list.baocan = "未报"; if (baocan != null) { list.baocan = "已报"; } var attl = attlApp.GetCurrentTime(item.F_AttCard, now, true); list.shangban = "×"; if (attl != null) { list.shangban = "√"; } var attl2 = attlApp.GetCurrentTime(item.F_AttCard, now, false); list.xiaban = "×"; if (attl2 != null) { list.xiaban = "√"; } var pos = posApp.GetCurrentTime(item.F_PosCard, now, 0); list.zaocan = "×"; if (pos != null) { list.zaocan = "√"; } var pos1 = posApp.GetCurrentTime(item.F_PosCard, now, 1); list.wucan = "×"; if (pos1 != null) { list.wucan = "√"; } var pos2 = posApp.GetCurrentTime(item.F_PosCard, now, 2); list.wancan = "×"; if (pos2 != null) { list.wancan = "√"; } int bu = 0; int kou = 0; PosT(now, item.F_PosCard, item.F_AttCard, item.F_Id, out bu, out kou); list.yujibuzhu = (bu * 15).ToString(); list.cishu = (kou).ToString(); lists.Add(list); } var data = new { rows = lists, total = pagination.total, page = pagination.page, records = pagination.records }; return(Content(data.ToJson())); }