private static void LoadData() { var rows = _tableAdapter.GetData(); foreach (var row in rows) { var ballot = new Ballot() { UserID = Convert.ToInt32(row["UserID"]), Code = Convert.ToString(row["Code"]) }; _dictionary.Add(ballot.UserID, ballot); } _isLoaded = true; }
public static void InsertData(Ballot ballot) { _tableAdapter.Insert(ballot.UserID, ballot.Code); _dictionary.Add(ballot.UserID, ballot); }