Exemplo n.º 1
0
        private void CreateNewClaim()
        {
            ClaimMenu newItem = new ClaimMenu();

            Console.WriteLine("What type of claim do you want to make? Car, home, or theft?");
            newItem.TypeId = Console.ReadLine();

            Console.WriteLine("Give a brief description");
            newItem.Description = Console.ReadLine();

            Console.WriteLine("How much did it cost?");
            newItem.CostOfClaim = int.Parse(Console.ReadLine());

            Console.WriteLine("When did this happen?");
            newItem.DateOfAccident = int.Parse(Console.ReadLine());

            Console.WriteLine("How many days ago did you make the claim?");
            newItem.DateOfClaim = int.Parse(Console.ReadLine());

            int days = (newItem.DateOfClaim - newItem.DateOfAccident);

            if (days >= 0 && days <= 30)
            {
                newItem.IsValid = true;
            }
            _claimRepository.CreateNewClaim(newItem);
        }
 public void CreateNewClaim(ClaimMenu newMenuItem)
 {
     _menuItem.Add(newMenuItem);
 }