示例#1
0
        public JsonResult GetJsonFromEnum(string enumName, string enumNamespace = "", string assemblyName = "")
        {
            var dic     = Helpers.EnumToDictionary(enumName, enumNamespace, assemblyName);
            var options = JTableOptionModel.GetModelList(dic);

            return(Json(new { Result = "OK", Options = options }, JsonRequestBehavior.AllowGet));
        }
示例#2
0
        public JsonResult GetDocumentTypes()
        {
            using (var context = base.Context)
            {
                var docTypes = context.DocumentTypes.ToList();
                var result   = new Dictionary <string, object>(docTypes.Count);
                foreach (var doc in docTypes)
                {
                    result.Add(doc.Name, doc.ID);
                }

                return(Json(new { Result = "OK", Options = JTableOptionModel.GetModelList(result) }, JsonRequestBehavior.AllowGet));
            }
        }