Example #1
0
        public OptResult GetTasks()
        {
            var tasks = _rep.GetList(null);

            OptResult rst = OptResult.Build(ResultCode.Success, "",
                                            new
            {
                tasks = tasks
            });

            return(rst);
        }
Example #2
0
        public OptResult IsNew()
        {
            OptResult      rst;
            PredicateGroup pg = new PredicateGroup
            {
                Operator   = GroupOperator.And,
                Predicates = new List <IPredicate>()
                {
                    Predicates.Field <InfoModel>(i => i.state, Operator.Eq, "已发布"),
                    Predicates.Field <InfoModel>(i => i.read_state, Operator.Eq, "未读"),
                }
            };
            var newInfo = _infoRep.GetList(pg).Select(i => i.id);

            var newTask = _taskRep.GetList(Predicates.Field <TaskModel>(t => t.complete_state, Operator.Eq, new string[] { "已领未完成", "未领" })).Select(t => t.id);

            rst = OptResult.Build(ResultCode.Success, "", new
            {
                info = newInfo,
                task = newTask
            });

            return(rst);
        }