private void button1_Click(object sender, EventArgs e) { DataClasses1DataContext dc = new DataClasses1DataContext(connection); BankProduct bankProduct = new BankProduct(); bankProduct.Name = textBox5.Text; dc.BankProducts.InsertOnSubmit(bankProduct); dc.SubmitChanges(); }
private void button3_Click(object sender, EventArgs e) { DataClasses1DataContext dc = new DataClasses1DataContext(connection); BankProduct bankProduct = dc.BankProducts.FirstOrDefault(bp => bp.Name.Equals(listBox2.SelectedValue)); dc.BankProducts.DeleteOnSubmit(bankProduct); dc.SubmitChanges(); }
partial void DeleteBankProduct(BankProduct instance);
partial void UpdateBankProduct(BankProduct instance);
partial void InsertBankProduct(BankProduct instance);
private void detach_BankProducts(BankProduct entity) { this.SendPropertyChanging(); entity.Account = null; }