private void btnCreate_Click(object sender, EventArgs e) { TableBDetail detail = new TableBDetail(); detail.WriterID = DBHelper.getWriterId(cbWriter.Text); detail.BookID = DBHelper.getBookId(cbBook.Text); db.TableBDetails.InsertOnSubmit(detail); try { db.SubmitChanges(); } catch (Exception ex) { MessageBox.Show(ex.Message); db.TableBDetails.DeleteOnSubmit(detail); } loadData(); }
private void detach_TableBDetails(TableBDetail entity) { this.SendPropertyChanging(); entity.TableWriter = null; }
private void attach_TableBDetails(TableBDetail entity) { this.SendPropertyChanging(); entity.TableBook = this; }
partial void DeleteTableBDetail(TableBDetail instance);
partial void UpdateTableBDetail(TableBDetail instance);
partial void InsertTableBDetail(TableBDetail instance);