public void Add(SsDTP ssDTP) { if (list.Exists(item => item == ssDTP)) return; list.Add(ssDTP); }
private void btnAdd_Click(object sender, EventArgs e) { SsDTPList ssDTPs = SsDTPList.getInstance(); SsDTP ssDTP = new SsDTP(); SsDTP_AddEdit aessDTP = new SsDTP_AddEdit(ssDTP); if (aessDTP.ShowDialog() == System.Windows.Forms.DialogResult.OK) { ssDTPs.Add(ssDTP); loadData(); } }
protected override void loadFromSql() { DataTable dt = _provider.Select("ssDTP"); clearList(); foreach (DataRow row in dt.Rows) { SsDTP ssDTP = new SsDTP(row); Add(ssDTP); } }