public static void DeleteGreenhouse(Greenhouse greenhouse)
 {
     using (DataContext context = GetContext())
     {
         context.Greenhouses.Attach(greenhouse);
         context.Greenhouses.DeleteOnSubmit(greenhouse);
         context.SubmitChanges();
     }
     // TODO: create logging project that will log events
     // new RecordDeletedEvent("greenhouse", greenhouse.ID, null).Raise();
 }
        public static void InsertGreenhouse(Greenhouse greenhouse)
        {
            // TODO: sanitize values
            greenhouse.Height = greenhouse.Height;
            greenhouse.Width = greenhouse.Width;
            greenhouse.Length = greenhouse.Length;

            using (DataContext context = GetContext())
            {
                context.Greenhouses.InsertOnSubmit(greenhouse);
                context.SubmitChanges();
            }
        }
        public static void UpdateGreenhouse(Greenhouse changedGreenhouse)
        {
            // TODO: sanitize values
            changedGreenhouse.Height = changedGreenhouse.Height;
            changedGreenhouse.Width = changedGreenhouse.Width;
            changedGreenhouse.Length = changedGreenhouse.Length;

            using (DataContext context = GetContext())
            {
                context.Greenhouses.Attach(changedGreenhouse, true);
                context.SubmitChanges();
            }
        }
		private void detach_Greenhouses(Greenhouse entity)
		{
			this.SendPropertyChanging();
			entity.Location = null;
		}