Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
 private void detach_TableBDetails(TableBDetail entity)
 {
     this.SendPropertyChanging();
     entity.TableWriter = null;
 }
Ejemplo n.º 3
0
 private void attach_TableBDetails(TableBDetail entity)
 {
     this.SendPropertyChanging();
     entity.TableBook = this;
 }
Ejemplo n.º 4
0
 partial void DeleteTableBDetail(TableBDetail instance);
Ejemplo n.º 5
0
 partial void UpdateTableBDetail(TableBDetail instance);
Ejemplo n.º 6
0
 partial void InsertTableBDetail(TableBDetail instance);