Example #1
0
        public bool RemoveAssociatedPart(int partNo)
        {
            var part = AssociatedParts.FirstOrDefault(x => x.PartId == partNo);

            if (part != null)
            {
                AssociatedParts.Remove(part);
            }
            return(part != null);
        }
Example #2
0
        public bool RemoveAssociatedPart(int id)
        {
            var part = LookupAssociatedPart(id);

            if (part == null)
            {
                return(false);
            }
            return(AssociatedParts.Remove(part));
        }
Example #3
0
        public bool RemoveAssociatePart(int partId)
        {
            var partToRemove = AssociatedParts.Where(x => x.PartId == partId).FirstOrDefault();

            if (partToRemove == null)
            {
                return(false);
            }

            AssociatedParts.Remove(partToRemove);
            return(true);
        }
Example #4
0
        public bool removeAssociatedPart(int id)
        {
            var partToDelete = AssociatedParts.SingleOrDefault(x => x.PartID == id);

            if (partToDelete != null)
            {
                AssociatedParts.Remove(partToDelete);
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #5
0
        public static bool RemoveAssociatedPart(int partID)
        {
            Part part = LookupAssociatedPart(partID);

            if (part == null)
            {
                return(false);
            }
            else
            {
                AssociatedParts.Remove(part);
                return(true);
            }
        }
        public bool RemoveAssociatedPart(int partID)
        {
            bool success = false;

            foreach (Part part in AssociatedParts)
            {
                if (part.PartID == partID)
                {
                    AssociatedParts.Remove(part);
                    return(success = true);
                }
                else
                {
                    success = false;
                }
            }
            return(success);
        }