Пример #1
0
        public void AddManufacturingPlant()
        {
            using (var database = new CompanyEntities())
            {
                var manufacturingplant = new ManufacturingPlant();
                Console.WriteLine("Enter name of manufacturing plant:" + manufacturingplant.PlantName);
                manufacturingplant.PlantName = Console.ReadLine();

                var mp = database.ManufacturingPlants.SingleOrDefault(t => t.PlantName == manufacturingplant.PlantName);
                if (mp == null)
                {
                    database.ManufacturingPlants.Add(manufacturingplant);
                    database.SaveChanges();
                    Console.WriteLine("Manufacturing Plant added to the list");
                }

                else
                {
                    Console.WriteLine("There is already such plant in the list");
                    throw new DuplicateWaitObjectException("There is already such plant in the list");
                }
            }
        }
Пример #2
0
 public void SetAssemblyPlant(ManufacturingPlant ap)
 {
     manufacturingPlant = ap;
 }