コード例 #1
0
        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;
        }
コード例 #2
0
 public static void InsertData(Ballot ballot)
 {
     _tableAdapter.Insert(ballot.UserID, ballot.Code);
     _dictionary.Add(ballot.UserID, ballot);
 }