public int AddParam(string name, string parentName, int size, SQLDB sqlDB) { int parentParamId; if (parentName != "") parentParamId = sqlDB.getParamId(parentName); else parentParamId = 0; if (parentParamId == -1) return -1; //ะฝะตัั Parent param. else { int paramId; Object thisLock = new Object(); lock (thisLock) { paramId = sqlDB.AddParam(name, parentParamId, size); } return paramId; } }