public bool DeleteBonds(Bond oldBond) { try { DataContext.Bond.DeleteOnSubmit(oldBond); DataContext.SubmitChanges(); return true; } catch (Exception) /*FIXME*/ { return false; } }
private void detach_Bond(Bond entity) { this.SendPropertyChanging(); entity.Coupon1 = null; }
private void attach_Bond(Bond entity) { this.SendPropertyChanging(); entity.Coupon1 = this; }
private void detach_Bond(Bond entity) { this.SendPropertyChanging(); entity.PriceHistory1 = null; }
partial void DeleteBond(Bond instance);
partial void UpdateBond(Bond instance);
partial void InsertBond(Bond instance);
public bool InsertBonds(Bond newBond) { try { DataContext.Bond.InsertOnSubmit(newBond); DataContext.SubmitChanges(); return true; } catch (Exception) /*FIXME*/ { return false; } }
public bool EditBonds(int oldId, Bond newBond) { try { Bond editableBond = DataContext.Bond.Single(c => c.Id == oldId); editableBond.Id = newBond.Id; editableBond.PriceHistory = newBond.PriceHistory; editableBond.Coupon = newBond.Coupon; DataContext.SubmitChanges(); return true; } catch (Exception) /*FIXME*/ { return false; } }