Beispiel #1
0
        public string GetAisle()
        {
            Random rand    = new Random();
            int    randNum = rand.Next(1, 25);
            string temp    = Manufactuer.ToUpper();

            temp = temp[0] + randNum.ToString();
            return(temp);
        }
Beispiel #2
0
        public ActionResult <Manufactuer> CreateWine(Manufactuer manufactuer)
        {
            Address address = _context.Addresses.Find(manufactuer.address.Id);

            if (address != null)
            {
                manufactuer.address = address;
            }

            _context.Manufactuers.Add(manufactuer);
            _context.SaveChanges();

            return(CreatedAtRoute(nameof(GetManufactuerById), new { Id = manufactuer.Id }, manufactuer));
        }
Beispiel #3
0
        public ActionResult UpdateManufactuer(int id, Manufactuer manufactuerUpdate)
        {
            var manufactuerUnupdate = _context.Manufactuers.FirstOrDefault(w => w.Id == id);

            if (manufactuerUnupdate != null)
            {
                manufactuerUnupdate.Name = manufactuerUpdate.Name;

                _context.SaveChanges();
                return(NoContent());
            }
            else
            {
                return(NotFound());
            }
        }