private void submit_Click(object sender, EventArgs e) { Models.TranDau x = new Models.TranDau(); x.doiA = (this.sl_DoiA.SelectedItem as Models.Doi).id_doi; x.doiB = (this.sl_DoiB.SelectedItem as Models.Doi).id_doi; x.insert(); this.LoadData(); }
private void data_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { DataGridViewRow row = data.CurrentRow; if (!row.IsNewRow) { Models.TranDau x = (Models.TranDau) this.data.CurrentRow.DataBoundItem; new VongDau(x.id_tran).Show(); } }
static public List <Models.TranDau> get() { List <Models.TranDau> list = new List <Models.TranDau>(); DataTable data = Models.TranDau.get(); foreach (DataRow item in data.Rows) { Models.TranDau row = new Models.TranDau(item); list.Add(row); } return(list); }