public static void SaveViewConfig(List <ViewConfig> viewlist) { string mapPath = FPFile.GetMapPath(WebConfig.WebPath + "config/view.config"); FPXml.SaveXml(viewlist, mapPath); FPCache.Remove("FP_VIEWLIST"); }
public static List <ViewConfig> GetViewList() { object obj = FPCache.Get("FP_VIEWLIST"); List <ViewConfig> list = new List <ViewConfig>(); if (obj != null) { list = (obj as List <ViewConfig>); } else { string mapPath = FPFile.GetMapPath(WebConfig.WebPath + "config/view.config"); list = FPXml.LoadList <ViewConfig>(mapPath); FPCache.Insert("FP_VIEWLIST", list, mapPath); } return(list); }
public static void SaveViewConfig(ViewConfig viewconfig) { bool flag = false; List <ViewConfig> viewList = GetViewList(); for (int i = 0; i < viewList.Count; i++) { if (viewList[i].path.ToLower() == viewconfig.path.ToLower()) { viewList[i].include = viewconfig.include; flag = true; } } if (!flag) { viewList.Add(viewconfig); } string mapPath = FPFile.GetMapPath(WebConfig.WebPath + "config/view.config"); FPXml.SaveXml(viewList, mapPath); FPCache.Remove("FP_VIEWLIST"); }
public static void WriteXml <T>(T model) where T : new() { SendData(FPXml.ToXml(model)); }
public static void WriteXml <T>(List <T> list) where T : new() { SendData(FPXml.ToXml(list)); }