Exemplo n.º 1
0
        private void Add(Insurance insurance)
        {
            Console.Write("Name of the insurance company: ");
            insurance.CompanyName = Console.ReadLine();
            Console.Write("Company's web address: ");
            insurance.WebAddress = Console.ReadLine();
            Console.Write("Name of the product line: ");
            insurance.ProductName = Console.ReadLine();
            Console.Write("The product line's ID: ");
            insurance.ProductID = Console.ReadLine();
            Console.Write("Payor ID: ");
            insurance.PayorID = Console.ReadLine();
            Console.Write("Plan name: ");
            insurance.PlanName = Console.ReadLine();
            Console.Write("Your member ID: ");
            insurance.MemberID = Console.ReadLine();
            Console.Write("Group number: ");
            insurance.GroupNumber = Console.ReadLine();
            Console.Write("Bin number: ");
            insurance.BinNumber = Console.ReadLine();
            Console.Write("Coverage effective date: ");
            insurance.EffectiveDate = Console.ReadLine();

            Console.Write("Coverage expiration date: ");
            string expDate = Console.ReadLine();

            if (expDate != null && expDate != String.Empty)
            {
                insurance.ExpirationDate = expDate;
            }

            PopulateAddressData(insurance.Address);
            PopulatePhoneData(insurance.phoneNumbers);

            string _option = null;

            do
            {
                Console.Write("Enter a type of coverage (e.g., Medical, Dental, Vision, Mental)(enter end for none or no more): ");
                _option = Console.ReadLine();

                if (_option != null && _option != String.Empty && !_option.Equals("end"))
                {
                    insurance.AddType(_option);
                }
            } while (_option != "end");

            InsuranceRepo repo = new InsuranceRepo();

            repo.Add(insurance);

            Console.WriteLine("\nAdded new insurance company.");
        }
Exemplo n.º 2
0
        private void Update()
        {
            int _count = List();

            if (_count > 0)
            {
                int       _option    = GetOption("Please enter your selection: ", _count);
                string    _id        = List(_option);
                Insurance _insurance = (Insurance)_ir.GetOne(_id);

                Display(_insurance);
                DisplayUpdateMenu();
                _option = GetOption("Please enter your selection: ", 14);

                switch (_option)
                {
                case 1:
                    Console.Write("Name of the insurance company: ");
                    _insurance.CompanyName = Console.ReadLine();
                    break;

                case 2:
                    PopulateAddressData(_insurance.Address);
                    break;

                case 3:
                    PopulatePhoneData(_insurance.phoneNumbers);
                    break;

                case 4:
                    Console.Write("Company's web address: ");
                    _insurance.WebAddress = Console.ReadLine();
                    break;

                case 5:
                    string _type = null;

                    do
                    {
                        Console.Write("Enter a type of coverage (e.g., Medical, Dental, Vision, Mental)(enter end for none or no more): ");
                        _type = Console.ReadLine();

                        if (_type != null && _type != String.Empty && !_type.Equals("end"))
                        {
                            _insurance.AddType(_type);
                        }
                    } while (_type != "end");

                    break;

                case 6:
                    Console.Write("Name of the product line: ");
                    _insurance.ProductName = Console.ReadLine();
                    break;

                case 7:
                    Console.Write("The product line's ID: ");
                    _insurance.ProductID = Console.ReadLine();
                    break;

                case 8:
                    Console.Write("Payor ID: ");
                    _insurance.PayorID = Console.ReadLine();
                    break;

                case 9:
                    Console.Write("Plan name: ");
                    _insurance.PlanName = Console.ReadLine();
                    break;

                case 10:
                    Console.Write("Your member ID: ");
                    _insurance.MemberID = Console.ReadLine();
                    break;

                case 11:
                    Console.Write("Group number: ");
                    _insurance.GroupNumber = Console.ReadLine();
                    break;

                case 12:
                    Console.Write("Bin number: ");
                    _insurance.BinNumber = Console.ReadLine();
                    break;

                case 13:
                    Console.Write("Coverage effective date: ");
                    _insurance.EffectiveDate = Console.ReadLine();
                    break;

                case 14:
                    Console.Write("Coverage expiration date: ");
                    string _expDate = Console.ReadLine();
                    if (_expDate != null && _expDate != String.Empty)
                    {
                        _insurance.CompanyName = _expDate;
                    }
                    break;
                }
            }
        }