Beispiel #1
0
        private bool ImportFromFile(string file)
        {
            ProjectModel model = JsonConvert.DeserializeObject <ProjectModel>(IOHelper.ReadFile(file, false));

            if (model != null)
            {
                //创建新的Id
                model.ID           = projects.GetCreateID();
                model.ProjectName += model.ID;
                if (group != null)
                {
                    model.GroupID = group.ID;
                }
                else
                {
                    model.GroupID = 0;
                }
                app.Add(model);
                return(projects.Add(model));
            }
            return(false);
        }