Esempio n. 1
0
        public void testStoreEmployee()
        {
            try {
                //week 3
                //IEmployeeSvc ics = factory.getEmployeeSvc();

                //week 4
                IEmployeeSvc ics = (IEmployeeSvc)factory.getService("IEmployeeSvc");

                // First let's store the Employee
                Assert.True(ics.storeEmployee(e));

                // Then let's read it back in
                e = ics.getEmployee(e.id);
                Assert.True(e.validate());

                // Update Employee
                e.lastName = "Smith";
                Assert.True(ics.storeEmployee(e));

                // Finally, let's cleanup the file that was created
                Assert.True(ics.deleteEmployee(e.id));
            }
            catch (Exception e) {
                Console.WriteLine("Exception in testStoreEmployee: " + e.Message + "\n" + e.StackTrace);
                Assert.Fail(e.Message + "\n" + e.StackTrace);
            }
        }
Esempio n. 2
0
        public EmployeeMgr(IEmployeeSvc repository)
        {
            this.repository = repository;

            this.employeeList = (ApplicationStore<IList<Employee>>)HttpContext.Current.Application["Employee"];
            this.groupManagerList = (ApplicationStore<IList<GroupManager>>)HttpContext.Current.Application["GroupManager"];
            this.directorList = (ApplicationStore<IList<Director>>)HttpContext.Current.Application["Director"];

            if (employeeList == null || groupManagerList == null || directorList == null ||
                !employeeList.isValid() || !groupManagerList.isValid() || !directorList.isValid())
                refresh();
        }
Esempio n. 3
0
 public EmployeeMgr(IEmployeeSvc repository)
 {
     this.repository = repository;
 }