Example #1
0
 public JsonNetResult GetModuleOptions()
 {
     try
     {
         return(JsonNet.JsonOKOptions(JtableUtil.GetOptions <Module>()));
     }
     catch (Exception ex)
     {
         return(JsonNet.JsonError(ex.Message + '\n' + ex.StackTrace));
     }
 }
Example #2
0
        public JsonNetResult GetRoleOptions()
        {
            try
            {
                var roles = repo.OrderBy(r => r.Name)
                            .Select(r => new JTableOption
                {
                    DisplayText = r.Name,
                    Value       = r.ID
                });

                if (roles.Count() > 0)
                {
                    return(JsonNet.JsonOKOptions(roles));
                }

                return(JsonNet.JsonNoOptions(StringFormatters.NotAvailable(Resources.Global.General_Roles.ToLower())));
            }
            catch (Exception ex)
            {
                return(JsonNet.JsonError(ex.Message + '\n' + ex.StackTrace));
            }
        }