Beispiel #1
0
        public int CheckManufacturerByName(string manufacturer)
        {
            var manufacturerID = _repo.GetManufacturerIdByName(manufacturer);

            // If the manufacturer doesn't exist we add him to the DB
            if (manufacturerID == 0)
            {
                Manufacturer manu = new Manufacturer()
                {
                    Name = manufacturer
                };

                manufacturerID = _repo.AddManufacturer(manu);
            }

            return(manufacturerID);
        }