예제 #1
0
        //[CheckSession]
        public virtual ActionResult AccessGroup()
        {
            var model = new AccessGroupListModel();

            model.Active = _comm.GetActiveList();
            return(View(model));
        }
예제 #2
0
        //[CheckSession]
        public virtual ActionResult GroupList(DataSourceRequest command, AccessGroupListModel model)
        {
            //if (string.IsNullOrEmpty(model.GroupName) && string.IsNullOrEmpty(model.Description))
            {
                var GroupItems = _AccessGroupService.GetAllAccessGroups();
                var gridModel  = new DataSourceResult
                {
                    Data = GroupItems.Select(x => new AccessGroupModel
                    {
                        GroupName   = x.Name,
                        IsActive_ID = _comm.GetIntByBool(x.Active),
                        Group_ID    = x.Id,
                        IsActive    = _comm.GetLiteralByBool(x.Active),
                        Description = x.Description
                    }),
                    Total = GroupItems.Count()
                };

                return(Json(gridModel));
            }
            //else
            //{
            //    var UserItems = _AccessGroupService.SearchAccessGroups(model.GroupName, model.Description);
            //    var gridModel = new DataSourceResult
            //    {
            //        Data = UserItems.Select(x => new AccessGroupModel
            //        {
            //            GroupName = x.GroupName,
            //            Description = x.Description,
            //            Group_ID = x.Group_ID,
            //            LastUpdateUser_ID = x.LastUpdateUser_ID,
            //            IsActive_ID = x.Active,
            //            IsActive = x.Active == 1 ? "فعال" : "غیرفعال"
            //        }),
            //        Total = UserItems.Count()
            //    };

            //    return Json(gridModel);
            //}
        }