예제 #1
0
        private void UpdateBrand()
        {
            _brandManager.GetList(_brandManager.GetAll().Data);
            bool flag2  = true;
            int  choice = 0;

            while (flag2)
            {
                Console.WriteLine("Please select the brand to delete: ");
                choice = Convert.ToInt32(Console.ReadLine());
                var list = _brandManager.GetAll().Data;
                if (!list.Any(x => x.ID == choice))
                {
                    Console.WriteLine(Messages.NotExist + "brand");
                }
                else
                {
                    flag2 = false;
                }
            }
            var brand = _brandManager.FindByID(choice).Data;

            Console.WriteLine("Name: ");
            brand.Name = Console.ReadLine();

            _brandManager.Update(brand);
            Console.WriteLine("Brand" + Messages.UpdateSingular);
        }