//
        // GET: /Tasks/
        public IEnumerable<object> GetNewMessages(Pagination pagination, string language,
            string typeId, ReadStatus? readStates)
        {
            if (pagination == null)
            {
                pagination = new Pagination(10, 0);
            }

            NewsType type = _messageDaoFactory.NewsTypeDao.Get(typeId);

            IList<PersonalMessage> result =
                _messageDaoFactory.PersonalMessageDao.GetLastMessageForEachUser(
                    OrnamentContext.MemberShip.CurrentUser(),
                    pagination.CurrentPage, pagination.PageSize);

            var r = new List<object>();
            foreach (PersonalMessage msg in result)
            {
                r.Add(new
                {
                    msg.Content,
                    relative = msg.Publisher
                });
            }
            return result;
        }
        public ActionResult Index(Pagination pagination)
        {
            if (pagination == null)
                pagination = new Pagination(40, 0);
            NewsType type = _factory.NewsTypeDao.GetAll().FirstOrDefault();
            IList<News> news;
            if (type != null)
            {
                int total;
                news = _factory.NewsDao.GetNews(pagination.CurrentPage, pagination.PageSize, type, out total);
                pagination.TotalRows = total;
            }
            else
            {
                news = new List<News>();
            }

            ViewData["nav"] = pagination;
            ViewData["newsType"] = type;
            ViewData["types"] = _factory.NewsTypeDao.GetAll();
            return View(news);
        }
        public IEnumerable<object> MyTask(Pagination pagination, string language)
        {
            //if (pagination == null)
            //{
            //    pagination = new Pagination(10, 0);
            //}
            //int totalPage;
            //IList<NotifyMessage> result = _messageDaoFactory.MessageDao.GetNewNotifyMessages(pagination.CurrentPage,
            //                                                                  pagination.PageSize,out totalPage);

            //var r = new List<object>();
            //foreach (var msg in result)
            //{
            //    var content = msg.Show(language);
            //    r.Add(new
            //        {
            //            Subject = content.Subject,
            //            Content = content.Value,
            //            CreateTime=msg.CreateTime
            //        });
            //}
            return null;
        }
 public ActionResult Index(Pagination pagination)
 {
     ViewData["Nav"] = pagination;
     int total;
     IList<NotifyMessageTemplate> result = _daoFactory.MessageTemplateDao.GetAll(pagination.CurrentPage,
         pagination.PageSize, out total);
     pagination.TotalRows = total;
     return View(result);
 }
 public ActionResult Index(Pagination pagination)
 {
     IUserGroupDao dao = _factory.CreateUserGroupDao();
     int total;
     IList<UserGroup> result = dao.FindAll(pagination.CurrentPage, pagination.PageSize, out total);
     pagination.TotalRows = total;
     ViewData["Nav"] = pagination;
     return View(result);
 }
        public ActionResult List(Pagination pagination)
        {
            var result = from role in _roleDao.Find(pagination.PageSize, pagination.CurrentPage)
                select new
                {
                    role.Id,
                    role.Name,
                    role.Remarks
                };

            int count = _roleDao.Count();
            return Json(new
            {
                totalRecords = count,
                data = result
            }, JsonRequestBehavior.AllowGet);
        }
 public ActionResult Index(Pagination pagination)
 {
     return View();
 }