示例#1
0
        public bool AddClaimToDirecotry(ClaimsType item)
        {
            int startingCount = _claimsDirectory.Count;

            _claimsDirectory.Add(item);

            bool wasAdded = (_claimsDirectory.Count > startingCount);

            return(wasAdded);
        }
示例#2
0
        public void SeedContent()
        {
            /*ClaimID: 1
             * Type: Car
             * Description: Car Accident on 464.
             * Amount: $400.00
             * DateOfAccident: 4/25/18
             * DateOfClaim: 4/27/18
             * IsValid: True*/

            ClaimsType GeorgeParker = new ClaimsType(
                1,
                Claims.Car,
                "Car Accident on 464",
                400.00,
                "4/25/18",
                "4/27/18",
                "True");

            _claimsRepo.AddClaimToDirecotry(GeorgeParker);
        }
示例#3
0
        public void AddClaim()
        {
            Console.Clear();

            /*For #3, when a claims agent enters new data about a claim they
             * will be prompted for questions about it:
             *
             * Enter the claim id: 4
             * Enter the claim type: Car
             * Enter a claim description: Wreck on I-70.
             * Amount of Damage: $2000.00
             * Date Of Accident: 4/27/18
             * Date of Claim: 4/28/18
             * This claim is valid.*/


            Claims type;

            Console.WriteLine("Enter the claim ID:");
            int claimID = Int32.Parse(Console.ReadLine());

            Console.WriteLine("Enter the claim type:");
            string typeString = Console.ReadLine();

            switch (typeString)
            {
            case "car":
            case "Car":
            case "car ":
            case "Car ":
            case "CAR":
            case "CAR ":
                type = Claims.Car;
                break;

            case "Home":
            case "home":
            case "HOME":
            case "home ":
            case "Home ":
            case "HOME ":
                type = Claims.Home;
                break;

            case "Theft":
            case "theft":
            case "THEFT":
            case "Theft ":
            case "theft ":
            case "THEFT ":
                type = Claims.Theft;
                break;

            default:
                Console.WriteLine("please repeat...");
                type = Claims.Unknown;
                break;
            }
            Console.WriteLine("Enter a claim description:");
            string description = Console.ReadLine();

            Console.WriteLine("Amount of Damage:");
            int amount = Int32.Parse(Console.ReadLine());

            Console.WriteLine("Date Of Accident:");
            string dateOfAccident = Console.ReadLine();

            Console.WriteLine("Date of Claim:");
            string dateOfClaim = Console.ReadLine();

            Console.WriteLine("Is this claim valid:");
            string valid = Console.ReadLine();

            /*Menu newitem = new Menu(itemNumber, name, description, ingredents, price);
             *  bool itemWasAdded = _menuRepo.AddItemToDirecotry(newitem);
             *  if (itemWasAdded)
             *  {
             *      Console.WriteLine($"{name} was added to the menu.");
             *  }
             *  else
             *  {
             *      Console.WriteLine("Please try again.");
             *  }
             *  Console.WriteLine("Press any key to continue...");
             *  Console.ReadKey();*/
            ClaimsType newtype = new ClaimsType(
                claimID,
                type,
                description,
                amount,
                dateOfAccident,
                dateOfClaim,
                valid);
            bool itemWasAdded = _claimsRepo.AddClaimToDirecotry(newtype);

            if (itemWasAdded)
            {
                Console.WriteLine($"ClaimID:{claimID} was added to the menu.");
            }
            else
            {
                Console.WriteLine("Please try again.");
            }
            Console.WriteLine("Press any key to continue...");
            Console.ReadKey();
        }