public static void AddProjectToDB(string aStorage, string aPlaceName, string aProjectName, string aPathToProject, string aLocalPath) { using (ProjectsDB _db = new ProjectsDB()) { _db.ExecuteNonQuery("INSERT INTO PROJECTS VALUES(" + "`" + aStorage + "`," + "`" + aPlaceName + "`," + "`" + aProjectName + "`," + "`" + aPathToProject + "`," + "`" + aLocalPath + "`, ``, ``, 0, 0)"); } }
/// <summary> /// Get Storage name and Process and Site if map is in cloud storage /// </summary> /// <returns> /// true: map is in cloud storage; get refs /// false: otherwise /// </returns> public static void GetMapData(string mapGuid, ref string aStorage, ref string aProcess, ref string aSite, ref string aPath, ref string aPlaceName, ref string aProjectName, ref string aProjectPath) { using (MapsDB _db = new MapsDB()) { DataTable _dt = _db.ExecuteQuery("select * from MAPS where MAPGUID=`" + mapGuid + "`"); if (_dt.Rows.Count != 0) { aStorage = _dt.Rows[0]["STORAGE"].ToString(); aPath = _dt.Rows[0]["PATHTOPLACE"].ToString(); aPlaceName = _dt.Rows[0]["PLACENAME"].ToString(); aProjectName = _dt.Rows[0]["PROJECTNAME"].ToString(); } } if (aProjectName != "") { using (ProjectsDB _db = new ProjectsDB()) { DataTable _dt = _db.ExecuteQuery("select * from PROJECTS where PROJECTNAME=`" + aProjectName + "`"); aProjectPath = _dt.Rows[0]["PROJECTPATH"].ToString(); } } if (aStorage == "ND") { return; } using (StoragesDB _db = new StoragesDB()) { DataTable _dt = _db.ExecuteQuery("select * from STORAGES where STORAGENAME=`" + aStorage + "`"); if (_dt.Rows.Count != 0) { aProcess = _dt.Rows[0]["PROCESS"].ToString(); aSite = _dt.Rows[0]["SITE"].ToString(); } } }