/// <summary> /// 根据主键id,获取数据字典的展示字段 /// </summary> /// <param name="id">父亲节点的主键</param> /// <returns></returns> public static string GetMyTextsById(string id) { if (string.IsNullOrWhiteSpace(id)) { return string.Empty; } ISysFieldHander baseDDL = new SysFieldHander(); return baseDDL.GetMyTextsById(id); }
/// <summary> /// 根据父节点获取数据字典,绑定二级下拉框的时候使用 /// </summary> /// <param name="id"></param> /// <returns></returns> public ActionResult GetSysFieldByParent(string id, string parentid, string value) { if (string.IsNullOrWhiteSpace(value)) { return null; } ISysFieldHander baseDDL = new SysFieldHander(); return Json(new SelectList(baseDDL.GetSysFieldByParent(id, parentid, value), "MyTexts", "MyTexts"), JsonRequestBehavior.AllowGet); }
/// <summary> /// 获取字段,首选默认,Id做为value值 /// </summary> /// <returns></returns> public static SelectList GetSysFieldById(string table, string colum) { if (string.IsNullOrWhiteSpace(table) || string.IsNullOrWhiteSpace(colum)) { List<SelectList> sl = new List<SelectList>(); return new SelectList(sl); } ISysFieldHander baseDDL = new SysFieldHander(); return new SelectList(baseDDL.GetSysField(table, colum), "Id", "MyTexts"); }