Пример #1
0
 public void Initialize()
 {
     _mockery = new Mockery();
     _view = _mockery.NewMock<IEmployeeView>();
     _service = _mockery.NewMock<IEmployeeService>();
     _model = new EmployeeModel();
     _presenter = new EmployeePresenter(_view, _model, _service);
 }
    public void Save(this IEmployeeView view)
    {
        var employee = new EmployeeModel
        {
            Name = view.Bla     // some UI element property on IEmployeedView interface
        };

        employee.Save();
    }
Пример #3
0
 public EmployeePresenter(IEmployeeView view, 
     EmployeeModel model,
     IEmployeeService service)
 {
     _view = view;
     _service = service;
     _model = model;
     _model.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(Model_PropertyChanged);
 }
Пример #4
0
        public EmployeePresenter(IEmployeeView empview, IEmpBL empmodel)
        {
            model = empmodel;
            view  = empview;

            view.EventEmployeeAddView  += view_EmployeeAdd;
            view.EventEmployeeShowView += view_EventEmployeeShowView;

            model.EventEmployeeAddModel += model_EmployeeAdd;
        }
Пример #5
0
        public AccountLogOnController(
            IAccountLogOnView accountLogOnView,
            IHomeView homeView,
            IEmployeeView employeeView,
            IUserRegisterView userRegisterView,
            IUserService userService)
        {
            _accountLogOnView = accountLogOnView;
            _userService      = userService;
            _homeView         = homeView;
            _userRegisterView = userRegisterView;

            accountLogOnView.SetController(this);

            EmployeeController employeeController = new EmployeeController(employeeView);

            homeView.SetController(this, employeeController);
            userRegisterView.SetController(this);
        }
Пример #6
0
        public EmployeeOperations(IEmployeeView view, DataAccessEmployee employeeData)
        {
            this.view         = view;
            this.employeeData = employeeData;

            var employee = employeeData.RetrieveEmployee();

            this.view.LoadEmployee(employee);


            view.Add += () =>
            {
                var            e  = view.AddEmployee();
                UserOperations bl = new UserOperations();
                employeeData.AddEmployee(e);
            };

            view.Delete += () =>
            {
                var            e  = view.DeleteEmployee();
                UserOperations bl = new UserOperations();
                employeeData.DeleteEmployee(e);
            };

            view.Ret += () =>
            {
                var empList = employeeData.RetrieveEmployee();
                this.view.LoadEmployee(empList);
            };

            view.Updatee += () =>
            {
                var            e  = view.UpdateEmployee();
                UserOperations bl = new UserOperations();
                employeeData.UpdateEmployee(e);
            };
        }
Пример #7
0
 public EmployeePresenter(IEmployeeView view)
 {
     this.View = view;
     this.Repository = new EmployeeRepository();
     this.View.DepartmentSelected += OnDepartmentSelected;
 }
 public EmployeePresenter(IEmployeeView view)
 {
     _view = view;
     _bus  = new EmployeeBUS();
     //_searchEngine = new SearchEngine<Employee>();
 }
Пример #9
0
 public EmployeePresenter(IEmployeeView view)
 {
     this.View       = view;
     this.Repository = new EmployeeRepository();
     this.View.DepartmentSelected += OnDepartmentSelected;
 }
Пример #10
0
 public EmployeePresenter(IEmployeeView view, IEmployeePresentationLogic presentationLogic)
 {
     this.view = view;
     this.presentationLogic = presentationLogic;
 }
 public EmployeeController(IEmployee emp, IEmployeeView empView)
 {
     this.empModel = emp;
     this.empView  = empView;
 }
 public EmployeeController(
     IEmployeeView employeeView)
 {
     _employeeView = employeeView;
     employeeView.SetController(this);
 }
Пример #13
0
 public EmployeePresenter(IEmployeeView view)
 {
     _view = view;
 }
Пример #14
0
 public EmployeeController(IEmployeeView view, IEmployeeRepository repository)
 {
     this.repository            = repository;
     this.view                  = view;
     this.view.OnEmployeeSaved += new Action <IEmployee>(view_OnEmployeeSaved);
 }
 /// <summary>
 /// Конструктор.
 /// </summary>
 /// <param name="View">Форма для вывода.</param>
 /// <param name="CurrentEmployee">Сотрудник.</param>
 public EmployeePresenter(IEmployeeView View, DataRow CurrentEmployee)
 {
     this.view       = View;
     currentEmployee = CurrentEmployee;
 }
        private static void ShowInterface(IRoomView roomView, IReservationView reservationView, IEmployeeView employeeView)
        {
            Console.WriteLine("Main menu");
            Console.WriteLine("1. Room management");
            Console.WriteLine("2. Reservation management");
            Console.WriteLine("3. Employee management");
            var choice = Console.ReadLine();

            switch (choice)
            {
            case "1":
                roomView.ShowMenu();
                break;

            case "2":
                reservationView.ShowMenu();
                break;

            case "3":
                employeeView.ShowMenu();
                break;

            case "20":
                return;

            default:
                break;
            }
            ShowInterface(roomView, reservationView, employeeView);
        }