public void DelUser(string name, string path) { users.Delete(name); if (userdict.ContainsKey(name)) { userdict[name].DeleteAll(); userdict.Remove(name); } else { DBDataController DBC = new DBDataController(name, dbPath); DBC.DeleteAll(); } }
//增加到dict中 public DB_ERROR AddUser(string name, string path) { if (userdict.ContainsKey(name)) { return(DB_ERROR.DB_USER_TABLE_EXISTS); } DBDataController DBC = new DBDataController(name, path); DB_ERROR DBE = DBC.GetLastError(); if (DBE == DB_ERROR.DB_OK) { userdict.Add(name, DBC); return(DB_ERROR.DB_OK); } else { DBC.DeleteAll(); return(DBE); } }
//增加到dict中 public DB_ERROR AddUser(string name, string path) { if (userdict.ContainsKey(name)) return DB_ERROR.DB_USER_TABLE_EXISTS; DBDataController DBC = new DBDataController(name, path); DB_ERROR DBE = DBC.GetLastError(); if (DBE == DB_ERROR.DB_OK) { userdict.Add(name, DBC); return DB_ERROR.DB_OK; } else { DBC.DeleteAll(); return DBE; } }