public bool DeletePortfolios(Portfolio oldPortfolio)
 {
     try
     {
         DataContext.Portfolio.DeleteOnSubmit(oldPortfolio);
         DataContext.SubmitChanges();
         return true;
     }
     catch (Exception) /*FIXME*/
     {
         return false;
     }
 }
		private void detach_Portfolio(Portfolio entity)
		{
			this.SendPropertyChanging();
			entity.Stock1 = null;
		}
		private void attach_Portfolio(Portfolio entity)
		{
			this.SendPropertyChanging();
			entity.Stock1 = this;
		}
 partial void DeletePortfolio(Portfolio instance);
 partial void UpdatePortfolio(Portfolio instance);
 partial void InsertPortfolio(Portfolio instance);
 public bool InsertPortfolios(Portfolio newPortfolio)
 {
     try
     {
         DataContext.Portfolio.InsertOnSubmit(newPortfolio);
         DataContext.SubmitChanges();
         return true;
     }
     catch (Exception) /*FIXME*/
     {
         return false;
     }
 }
 public bool EditPortfolios(int oldId, Portfolio newPortfolio)
 {
     try
     {
         Portfolio editablePortfolio = DataContext.Portfolio.Single(c => c.Id == oldId);
         editablePortfolio.Id = newPortfolio.Id;
         editablePortfolio.Name = newPortfolio.Name;
         editablePortfolio.Time = newPortfolio.Time;
         editablePortfolio.Bond = newPortfolio.Bond;
         editablePortfolio.BondQuantity = newPortfolio.BondQuantity;
         editablePortfolio.Stock = newPortfolio.Stock;
         editablePortfolio.StockQuantity = newPortfolio.StockQuantity;
         DataContext.SubmitChanges();
         return true;
     }
     catch (Exception) /*FIXME*/
     {
         return false;
     }
 }