예제 #1
0
        public static void SaveViewConfig(List <ViewConfig> viewlist)
        {
            string mapPath = FPFile.GetMapPath(WebConfig.WebPath + "config/view.config");

            FPXml.SaveXml(viewlist, mapPath);
            FPCache.Remove("FP_VIEWLIST");
        }
예제 #2
0
        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);
        }
예제 #3
0
        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");
        }
예제 #4
0
 public static void WriteXml <T>(T model) where T : new()
 {
     SendData(FPXml.ToXml(model));
 }
예제 #5
0
 public static void WriteXml <T>(List <T> list) where T : new()
 {
     SendData(FPXml.ToXml(list));
 }