public void Singlefetch() { if (!Flag) { _collect.Clear(); if (PersonsList != null && PersonsList.Count != 0) { foreach (Person p in PersonsList) { _collect.Add(p); } Flag = true; NextRecordId = PersonsList[PersonsList.Count - 1].ID + 1; } else { NextRecordId = 1; } } }
private void onCommandadd() { PersonsCollection.Add(new Person( RandomHelper.RandomString(10, true), RandomHelper.RandomInt(1, 43), RandomHelper.RandomBool(), RandomHelper.RandomBool(), RandomHelper.RandomDate(new DateTime(1980, 1, 1), DateTime.Now), RandomHelper.RandomColor() )); }