Ejemplo n.º 1
0
        public ActionResult getDailyPetitionList(string date)
        {
            User user = TheApp.currentUser;

            if (user == null)
            {
                return(Redirect("/Home/Login"));
            }
            int pagesize         = int.Parse(Request["rows"]);
            int pagenum          = int.Parse(Request["page"]);
            PetitionCondition pc = new PetitionCondition();

            if (string.IsNullOrEmpty(date))
            {
                throw new ApplicationException("date is empty");
            }
            pc.Daily = Convert.ToDateTime(date).Date;
            int         count;
            PetitionDao dao  = new PetitionDao();
            var         list = dao.getList(pc, pagenum, pagesize, out count);

            dao.Dispose();
            JsonData data = new JsonData();

            data.rows  = list;
            data.total = count;
            return(Json(data));
        }
Ejemplo n.º 2
0
        public ActionResult Statistics(PetitionCondition condition)
        {
            if (condition == null)
            {
                condition = new PetitionCondition();
            }
            if (condition.StartTime == null && condition.EndTime == null)
            {
                condition.Daily = DateTime.Now.Date;
            }
            PetitionDao dao = new PetitionDao();
            int         total_Qi, total_Ren;
            var         list = dao.getStatistics(out total_Qi, out total_Ren, condition);

            dao.Dispose();
            string dateString;

            if (condition.StartTime == null && condition.EndTime == null)
            {
                dateString = DateTime.Now.ToString("MM月dd日");
            }
            else
            {
                var startTime = condition.StartTime == null ? " " : condition.StartTime.Value.ToString("MM月dd日");
                var endTime   = condition.EndTime == null ? " " : condition.EndTime.Value.ToString("MM月dd日");
                dateString = startTime + "-" + endTime;
            }
            ViewBag.DateString = dateString;
            ViewBag.Total_Qi   = total_Qi;
            ViewBag.Total_Ren  = total_Ren;
            return(View(list));
        }
Ejemplo n.º 3
0
        public ActionResult getList(PetitionCondition condition)
        {
            if (condition == null)
            {
                condition = new PetitionCondition();
            }
            int         pagesize = int.Parse(Request["rows"]);
            int         pagenum  = int.Parse(Request["page"]);
            PetitionDao dao      = new PetitionDao();
            int         count;
            var         list = dao.getList(condition, pagenum, pagesize, out count);

            dao.Dispose();
            JsonData data = new JsonData();

            data.rows  = list;
            data.total = count;
            return(Json(data));
        }