示例#1
0
 public bool Create_Part( int module, string part, 
     int panels_made)
 {
     Machine_part newpart = new Machine_part
     {
         Module = module,
         Part = part,
         Panels_made = panels_made
     };
     if (!ContainsPart(newpart))
     {
         Parts.Add(newpart);
         return true;
     }
     return false;
 }
示例#2
0
        private bool ContainsPart(Machine_part target)
        {
            int count = 0;

            for (int i = 0; i < Parts.Count; i++)
            {
                if (Parts[i].Part == target.Part && Parts[i].Module == target.Module)
                {
                    count++;
                }
            }
            if (count == 0)
            {
                return(false);
            }
            return(true);
        }
示例#3
0
        public bool Create_Part(int module, string part,
                                int panels_made)
        {
            Machine_part newpart = new Machine_part
            {
                Module      = module,
                Part        = part,
                Panels_made = panels_made
            };

            if (!ContainsPart(newpart))
            {
                Parts.Add(newpart);
                return(true);
            }
            return(false);
        }
示例#4
0
 private bool ContainsPart(Machine_part target)
 {
     int count = 0;
     for (int i = 0; i < Parts.Count; i++)
     {
         if (Parts[i].Part == target.Part  && Parts[i].Module == target.Module)
         {
             count++;
         }
     }
     if (count == 0)
     {
         return false;
     }
     return true;
 }