Ejemplo n.º 1
0
        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()));
        }