public DataControl(Data dtToShow) { InitializeComponent(); this.tbPass.Text = dtToShow.Pass; this.tbSite.Text = dtToShow.Site; this.tbUser.Text = dtToShow.User; }
public void UpdateOrAdd(Data DataToAddOrUpdate) { try { Data dtToRemove = this.AllData.Single(x => x.Site == DataToAddOrUpdate.Site && x.User == DataToAddOrUpdate.User); this.AllData.Remove(dtToRemove); } catch { } finally { this.AllData.Add(DataToAddOrUpdate); } }