예제 #1
0
        public int SaveProjectInfo(ProjectInfo pro)
        {
            try {
                if (IsProjectExist(pro.ProjectName))
                {
                    return(-1);//表存在
                }
                CreateProjectInfoFile(pro);
                Dictionary <string, Object> mydata = new Dictionary <string, object>();
                mydata.Add("ProjectName", pro.ProjectName);
                mydata.Add("GUIDSTR", pro.GUID.ToString());
                mydata.Add("ProductName", pro.ProductName);
                mydata.Add("ProductGN", pro.ProductGN);

                mydata.Add("ProductUse", pro.ProductUse);
                mydata.Add("ExperTime", pro.ExperTime);
                mydata.Add("ExperAddress", pro.ExperAddress);
                mydata.Add("ProjectPath", pro.ProjectPath);

                if (AccessHelper.AppendData2Access(mydata, ProjectInfoDBName))
                {
                    return(0);
                }
                else
                {
                    return(-2);
                }
                return(0);
            }
            catch {
                return(-2);
            }
            //return XMLHelpers.InsertaNode("ProjectConfig.xml", "ProjectInfo", "ProjectName", ProjectName, "GUID", guid.ToString());
        }
예제 #2
0
        public int AddProjectInfo(ProjectInfo pro)
        {
            try
            {
                if (IsProjectExist(pro.ProjectName))
                {
                    return(-1);//表存在
                }
                //CreateProjectInfoFile(pro);
                Dictionary <string, Object> mydata = new Dictionary <string, object>();
                mydata.Add("ProjectName", pro.ProjectName);
                mydata.Add("GUIDSTR", pro.GUID.ToString());
                mydata.Add("ProductName", pro.ProductName);
                mydata.Add("ProductGN", pro.ProductGN);

                mydata.Add("ProductUse", pro.ProductUse);
                mydata.Add("ExperTime", pro.ExperTime);
                mydata.Add("ExperAddress", pro.ExperAddress);
                mydata.Add("ProjectPath", pro.ProjectPath);

                if (AccessHelper.AppendData2Access(mydata, ProjectInfoDBName))
                {
                    return(0);
                }
                else
                {
                    return(-2);
                }
                return(0);
            }
            catch
            {
                return(-2);
            }
        }