Ejemplo n.º 1
0
        public void LoadRestriction(IRestrictionService restrictionService)
        {
            IEnumerable <RestrictionView> restricts = restrictionService.GetAllRestrictions().Restrictions;

            restrictions.Clear();
            foreach (RestrictionView restrict in restricts)
            {
                if (!restrictions.ContainsKey(restrict.RestrictionName))
                {
                    restrictions.Add(restrict.RestrictionName, restrict.RequirePermission);
                }
            }
        }
Ejemplo n.º 2
0
        public JsonResult GetAllRows()
        {
            IEnumerable <RestrictionFlatViewModel> restrictions;

            restrictions = _restrictionService.GetAllRestrictions().Restrictions.ConvertToRestrictionFlatViewModels();
            DataTableViewModel data = new DataTableViewModel();

            data.draw            = "1";
            data.recordsTotal    = restrictions.ToList().Count.ToString();
            data.recordsFiltered = restrictions.ToList().Count.ToString();

            data.data = restrictions.ToList <object>();

            return(Json(data, JsonRequestBehavior.AllowGet));
        }