Exemple #1
0
        public void Add(Part p, WorkOrder wo)
        {
            if (p == null)
            {
                throw(new InvalidPartException());
            }

            if (wo == null)
            {
                throw(new InvalidWorkOrderException());
            }

            if (p.Number == "")
            {
                throw(new UnassignedPartException());
            }

            if (wo.Number == "")
            {
                throw(new UnassignedWorkOrderException());
            }

            if (!vendor.Find(p))
            {
                throw(new PartNotFromVendorException());
            }

            parts.Add(p, wo);
            partsArray.Add(p);
        }
Exemple #2
0
        public void Add(Part p)
        {
            if (p == null)
            {
                throw(new InvalidPartException());
            }

            if (p.Number == "")
            {
                throw(new UnassignedPartException());
            }

            if (parts.Contains(p.Number))
            {
                throw(new DuplicatePartException());
            }

            parts.Add(p.Number, p);
            partsArray.Add(p);
        }