Esempio n. 1
0
        // GET: Expenses
        public ActionResult Index()
        {
            Client client = new AdminRepository().GetClientById(GetCurrentUserContext().ClientId);
            IEnumerable<Employee> employees = _employeeRepo.GetEmployeesForClient(GetCurrentUserContext().ClientId);

            AnnualExpenseSummary expenseSummary = new AnnualExpenseSummary(client, employees);

            return View(expenseSummary);
        }
        public void TestSetup()
        {
            List<Employee> employees = new List<Employee>
            {
                new Employee
                {
                    Id = 1,
                    ClientId = 1,
                    FirstName = "Mary",
                    LastName = "Smith",
                    Dependents = new List<Dependent>
                    {
                        new Dependent {Id = 1, EmployeeId = 1, ClientId = 1, FirstName = "John", LastName = "Smith", IsSpouse = true},
                        new Dependent {Id = 2, EmployeeId = 1, ClientId = 1, FirstName = "Anna", LastName = "Smith"},
                        new Dependent {Id = 3, EmployeeId = 1, ClientId = 1, FirstName = "Jenny", LastName = "Smith"},
                        new Dependent {Id = 1, EmployeeId = 1, ClientId = 1, FirstName = "Jimmy", LastName = "Smith"}
                    }
                },
                new Employee
                {
                    Id = 2,
                    ClientId = 1,
                    FirstName = "Ashley",
                    LastName = "Johnson",
                    Dependents = new List<Dependent>()
                },
                new Employee
                {
                    Id = 3,
                    ClientId = 1,
                    FirstName = "Jo",
                    LastName = "Snuffy",
                    Dependents = new List<Dependent>
                    {
                        new Dependent {Id = 1, EmployeeId = 3, ClientId = 1, FirstName = "Mark", LastName = "Mitchem", IsSpouse = true}
                    }
                }
            };

            _annualExpenseSummary = new AnnualExpenseSummary(new Client{Id = 1},  employees);
        }