/// <summary> /// 创建指标 /// </summary> /// <param name="id">编号</param> /// <param name="script">脚本</param> /// <param name="xml">XML</param> /// <returns>指标</returns> public static CIndicator CreateIndicator(String id, String script, UIXml xml) { CIndicator indicator = xml.Native.CreateIndicator(); indicator.Name = id; CTable table = xml.Native.CreateTable(); indicator.DataSource = table; CFunctionBase.AddFunctions(indicator); CFunctionUI.AddFunctions(indicator, xml); CFunctionWin.AddFunctions(indicator); CFunctionAjax.AddFunctions(indicator); int index = STARTINDEX; String[] functions = FUNCTIONS.Split(new String[] { "," }, StringSplitOptions.RemoveEmptyEntries); int functionsSize = functions.Length; for (int i = 0; i < functionsSize; i++) { indicator.AddFunction(new CFunctionEx(indicator, index + i, functions[i], xml)); } indicator.Script = script; table.AddColumn(0); table.Set(0, 0, 0); indicator.OnCalculate(0); return(indicator); }
/// <summary> /// 加载XML /// </summary> /// <param name="xmlPath">XML路径</param> public override void Load(String xmlPath) { LoadFile(xmlPath, null); DataCenter.MainUI = this; ControlA control = Native.GetControls()[0]; control.BackColor = COLOR.CONTROL; CFunctionAjax.SetListener(control); m_foldMenu = FindControl("mainMenu") as FoldMenuA; List <UserAppsTable> type1List = new List <UserAppsTable>(); List <UserAppsTable> type2List = new List <UserAppsTable>(); List <UserAppsTable> type3List = new List <UserAppsTable>(); List <UserAppsTable> type4List = new List <UserAppsTable>(); type1List.Add(new UserAppsTable("UIM", "随机选拔")); type1List.Add(new UserAppsTable("AOA", "员工管理")); type1List.Add(new UserAppsTable("AA", "六维图")); type2List.Add(new UserAppsTable("AAM", "开发项目")); type1List.Add(new UserAppsTable("AI", "荣誉榜")); type3List.Add(new UserAppsTable("BAR", "日历事件")); type4List.Add(new UserAppsTable("CA", "上级指示")); type2List.Add(new UserAppsTable("CCM", "Git管理")); type2List.Add(new UserAppsTable("COI", "服务器管理")); type4List.Add(new UserAppsTable("GTM", "重要线索")); type1List.Add(new UserAppsTable("IAC", "个人信息")); type4List.Add(new UserAppsTable("LP", "重要意见")); type1List.Add(new UserAppsTable("OI", "重点关注")); type2List.Add(new UserAppsTable("PH", "远程服务")); type2List.Add(new UserAppsTable("RI", "代码统计")); type1List.Add(new UserAppsTable("UA", "水平级别")); type3List.Add(new UserAppsTable("BS", "股票买卖")); type1List.Add(new UserAppsTable("RP", "考一考")); type3List.Add(new UserAppsTable("BC", "名片")); type3List.Add(new UserAppsTable("OW", "门诊记录")); GetApps(type1List, type2List, type3List, type4List); RegisterEvents(control); }