Example #1
0
            // do i really need this one, or should I require a Parent in order to find related children
            //public List<RelatedNumberBLL> FindAllRelatedNumbersWithSpecificParentID(int id)
            //{
            //    List<RelatedNumberBLL> rv = new List<RelatedNumberBLL>();

            //    var dalnumbers = DataContext.SP_ReadRelatedNumbersHavingSpecificParentID(id);
            //    foreach (var n in dalnumbers)
            //    {
            //        rv.Add(new RelatedNumberBLL( n));
            //    }

            //    return rv;
            //}
            #endregion Read
            #region Update
            public void OptimisticUpdateOfRelatedNumber(RelatedNumberBLL OriginalValues, RelatedNumberBLL NewValues)
            {
                if (OriginalValues.ID != NewValues.ID)
                {
                    throw new Exception($"You may not change the ID of a RelatedNumber item during an Update.  The OriginalValues ID is {OriginalValues.ID} and the NewValues ID is {NewValues.ID}.  They must be the same.");
                }
                that.DataContext.RelatedNumbers.SP_OptimisticUpdateRelatedNumber(OriginalValues.ID,
                                                                                 OriginalValues.RelatedName, OriginalValues.RelatedLanguage, OriginalValues.ParentNumberID,
                                                                                 NewValues.RelatedName, NewValues.RelatedLanguage, NewValues.ParentNumberID);
            }
Example #2
0
            public RelatedNumberBLL InsertNewRelatedNumber(string relatedname, string relatedlanguage, int parentID)
            {
                int id = that.DataContext.RelatedNumbers.SP_CreateRelatedNumber(relatedname, relatedlanguage, parentID);
                RelatedNumberBLL rv = new RelatedNumberBLL();

                rv.ID              = id;
                rv.ParentNumberID  = parentID;
                rv.RelatedLanguage = relatedlanguage;
                rv.RelatedName     = relatedname;
                return(rv);
            }
Example #3
0
 public void LoadParentIntoRelatedNumber(RelatedNumberBLL n)
 {
     n._parentNumber = that.Numbers.FindNumber(n.ID);
 }
Example #4
0
 public void SafeDeleteOfNumber(RelatedNumberBLL NumberToDelete)
 {
     that.DataContext.RelatedNumbers.SP_SafeDeleteRelatedNumber(NumberToDelete.ID, NumberToDelete.RelatedName, NumberToDelete.RelatedLanguage, NumberToDelete.ParentNumberID);
 }
Example #5
0
 public void PessimisticUpdateOfRelatedNumber(RelatedNumberBLL NewValues)
 {
     that.DataContext.RelatedNumbers.SP_PessimisticUpdateRelatedNumber(NewValues.ID, NewValues.RelatedName, NewValues.RelatedLanguage, NewValues.ParentNumberID);
 }