Exemple #1
0
        public JsonResult GetList()
        {
            int              start          = Convert.ToInt32(Request["start"]);
            int              length         = Convert.ToInt32(Request["length"]);
            string           sortColumnName = Request["columns[" + Request["order[0][column]"] + "][name]"];
            string           sortDirection  = Request["order[0][dir]"];
            int              totalRow       = 0;
            List <Team.Team> teamList       = _teamAppService.GetTeamList(start, length, sortColumnName, sortDirection, Request["columns[0][search][value]"],
                                                                          Request["columns[1][search][value]"], Request["columns[2][search][value]"], out totalRow);

            return(Json(new { data = teamList, draw = Request["draw"], recordsTotal = totalRow, recordsFiltered = totalRow }, JsonRequestBehavior.AllowGet));
        }
Exemple #2
0
        public ActionResult GetUserSetting()
        {
            UserSetting.UserSetting us = _usService.GetUserSettingList().Where(p => p.UserId == Common.CommonHelper.CurrentUser).FirstOrDefault();
            int teamId = 0;

            if (us != null)
            {
                teamId = us.TeamId;
                Team.Team team = _teamService.GetTeamList().Where(t => t.Id == teamId).FirstOrDefault();
                if (team != null)
                {
                    us.TeamName = team.TeamName;
                    return(Json(new { success = true, TeamName = team.TeamName, TeamId = team.Id }, JsonRequestBehavior.AllowGet));
                }
            }
            return(Json(new { success = true, TeamName = "", TeamId = 0 }, JsonRequestBehavior.AllowGet));
        }
Exemple #3
0
        public ActionResult GetTeamList(string searchTerm, int pageSize, int pageNum)
        {
            var itemList = _teamService.GetTeamList().Where(x => string.IsNullOrEmpty(searchTerm) || x.TeamName.Contains(searchTerm)).ToList();
            var result   = new
            {
                Total   = itemList.Count(),
                Results = itemList.Skip((pageNum - 1) * pageSize).Take(pageSize)
            };

            return(new JsonResult
            {
                Data = result,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }