Exemplo n.º 1
0
        private void OnCrashesRemove(Crash CrashInstance)
        {
            Buggs_Crash BuggCrash = Buggs_Crashes.FirstOrDefault(BuggCrashInstance => BuggCrashInstance.BuggId == Id && BuggCrashInstance.CrashId == CrashInstance.Id);

            Buggs_Crashes.Remove(BuggCrash);
            SendPropertyChanged(null);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Associate a crash with a Bugg.
        /// </summary>
        /// <param name="Bugg">The Bugg to add the crash reference to.</param>
        /// <param name="CurrentCrash">The crash to add to the Bugg.</param>
        /// <returns>true if a new relationship was added, false otherwise.</returns>
        public bool LinkCrashToBugg(Bugg Bugg, Crash CurrentCrash)
        {
            try
            {
                // Make sure we don't already have this relationship
                if (Context.Buggs_Crashes.Where(BuggInstance => BuggInstance.CrashId == CurrentCrash.Id && BuggInstance.BuggId == Bugg.Id).Count() < 1)
                {
                    // We don't so create the relationship
                    Buggs_Crash NewBugg = new Buggs_Crash();
                    NewBugg.CrashId = CurrentCrash.Id;
                    NewBugg.BuggId  = Bugg.Id;
                    Context.Buggs_Crashes.InsertOnSubmit(NewBugg);
                    return(true);
                }
            }
            catch (Exception Ex)
            {
                Debug.WriteLine("Exception in LinkCrashToBugg: " + Ex.ToString());
            }

            return(false);
        }
Exemplo n.º 3
0
		private void detach_Buggs_Crashes(Buggs_Crash entity)
		{
			this.SendPropertyChanging();
			entity.Bugg = null;
		}
Exemplo n.º 4
0
		private void attach_Buggs_Crashes(Buggs_Crash entity)
		{
			this.SendPropertyChanging();
			entity.Bugg = this;
		}
Exemplo n.º 5
0
 partial void DeleteBuggs_Crash(Buggs_Crash instance);
Exemplo n.º 6
0
 partial void UpdateBuggs_Crash(Buggs_Crash instance);
Exemplo n.º 7
0
 partial void InsertBuggs_Crash(Buggs_Crash instance);
Exemplo n.º 8
0
        /// <summary>
        /// Associate a crash with a Bugg.
        /// </summary>
        /// <param name="Bugg">The Bugg to add the crash reference to.</param>
        /// <param name="CurrentCrash">The crash to add to the Bugg.</param>
        /// <returns>true if a new relationship was added, false otherwise.</returns>
        public bool LinkCrashToBugg( Bugg Bugg, Crash CurrentCrash )
        {
            try
            {
                // Make sure we don't already have this relationship
                if( BuggsDataContext.Buggs_Crashes.Where( BuggInstance => BuggInstance.CrashId == CurrentCrash.Id && BuggInstance.BuggId == Bugg.Id ).Count() < 1 )
                {
                    // We don't so create the relationship
                    Buggs_Crash NewBugg = new Buggs_Crash();
                    NewBugg.CrashId = CurrentCrash.Id;
                    NewBugg.BuggId = Bugg.Id;
                    BuggsDataContext.Buggs_Crashes.InsertOnSubmit( NewBugg );
                    return true;
                }
            }
            catch( Exception Ex )
            {
                Debug.WriteLine( "Exception in LinkCrashToBugg: " + Ex.ToString() );
            }

            return false;
        }