示例#1
0
        public T Resolve <T>()
        {
            if (typeof(T) == typeof(EmployeesPresenter))
            {
                object presenter = new EmployeesPresenter(new MockEmployeesView()
                                                          , new MockEmployeesController());

                return((T)presenter);
            }
            else if (typeof(T) == typeof(IEmployeesDetailsPresenter))
            {
                object presenter = new MockEmployeesDetailsPresenter();
                return((T)presenter);
            }
            else if (typeof(T) == typeof(IProjectsListPresenter))
            {
                object presenter = new MockProjectsListPresenter();

                return((T)presenter);
            }
            else if (typeof(T) == typeof(EmployeesListPresenter))
            {
                object presenter = new EmployeesListPresenter(new MockEmployeesListView(), new MockEmployeesService());

                return((T)presenter);
            }

            return(default(T));
        }
示例#2
0
        public void CanInitPresenter()
        {
            EmployeesPresenter presenter = CreatePresenter();

            Assert.IsNotNull(presenter);
            Assert.AreEqual <IEmployeesView>(view, presenter.View);
        }
 public FrmXtraSalaryVoucher()
 {
     InitializeComponent();
     salaryVouchersPresenter = new SalaryVouchersPresenter(this);
     employeesPresenter      = new EmployeesPresenter(this);
     _lockPresenter          = new LockPresenter(this);
 }
 public FrmA02LDTLRETAIL()
 {
     InitializeComponent();
     dateTimeRangeV1.DateRangePeriodMode = DateRangeMode.Month;
     dateTimeRangeV1.InitSelectedIndex   = GlobalVariable.DateRangeSelectedIndex;
     _salaryVouchersPresenter            = new SalaryVouchersPresenter(this);
     _employeesPresenter = new EmployeesPresenter(this);
 }
 public FrmXtraSalaryPostedVoucher()
 {
     InitializeComponent();
     salaryVouchersPresenter = new SalaryVouchersPresenter(this);
     employeesPresenter      = new EmployeesPresenter(this);
     _lockPresenter          = new LockPresenter(this);
     _dbOptionHelper         = new GlobalVariable();
 }
示例#6
0
        public void ShouldAddEmployeesListViewToView()
        {
            Assert.IsFalse(view.SetHeaderCalled);

            EmployeesPresenter presenter = CreatePresenter();

            Assert.IsTrue(view.SetHeaderCalled);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="FrmXtraCompanyProfileDetail"/> class.
 /// </summary>
 public FrmXtraCompanyProfileDetail()
 {
     InitializeComponent();
     employeesBindingSource     = new BindingSource();
     CommonVariable             = new GlobalVariable();
     _companyProfilePresenter   = new CompanyProfilePresenter(this);
     _employeesPresenter        = new EmployeesPresenter(this);
     _employeeLeasingsPresenter = new EmployeeLeasingsPresenter(this);
 }
示例#8
0
        public void RaiseEmployeeSelectedShouldCallController()
        {
            EmployeesPresenter presenter = CreatePresenter();

            Assert.IsFalse(controller.ShowEmployeeDetailsCalled);

            ((MockEmployeesListView)listPresenter.View).RaiseEmployeeSelected(null);

            Assert.IsTrue(controller.ShowEmployeeDetailsCalled);
        }
示例#9
0
        public void RaiseEmployeeSelectedShouldCallController()
        {
            // Todo: Find out how to test this
            EmployeesPresenter presenter = CreatePresenter();

            Assert.IsFalse(controller.ShowEmployeeDetailsCalled);

            presenter.View.Model.SelectedEmployee = new BusinessEntities.Employee(1);

            Assert.IsTrue(controller.ShowEmployeeDetailsCalled);
        }
示例#10
0
        public FrmS33H()
        {
            InitializeComponent();

            dateTimeRangeV1.DateRangePeriodMode = DateRangeMode.Reduce;
            dateTimeRangeV1.InitSelectedIndex   = GlobalVariable.DateRangeSelectedIndex;

            _dbOptionHelper             = new GlobalVariable();
            CurrencyAccounting          = _dbOptionHelper.CurrencyAccounting;
            _accountsPresenter          = new AccountsPresenter(this);
            _banksPresenter             = new BanksPresenter(this);
            _vendorsPresenter           = new VendorsPresenter(this);
            _fixedAssetsPresenter       = new FixedAssetsPresenter(this);
            _vendorsPresenter           = new VendorsPresenter(this);
            _employeesPresenter         = new EmployeesPresenter(this);
            _accountingObjectsPresenter = new AccountingObjectsPresenter(this);
            _accountsPresenter          = new AccountsPresenter(this);
            _budgetSourcesPresenter     = new BudgetSourcesPresenter(this);
            _budgetItemsPresenter       = new BudgetItemsPresenter(this);
            _voucherTypesPresenter      = new VoucherTypesPresenter(this);
            _projectsPresenter          = new ProjectsPresenter(this);
            _inventoryItemsPresenter    = new InventoryItemsPresenter(this);
            _departmentsPresenter       = new DepartmentsPresenter(this);
        }
 public EmployeesForm()
 {
     InitializeComponent();
     presenter = new EmployeesPresenter(this, new EmployeeRepository());
     presenter.LoadEmployees();
 }
 private EmployeesPresenter CreatePresenter()
 {
     EmployeesPresenter presenter = new EmployeesPresenter(view, controller);
     return presenter;
 }
示例#13
0
        private EmployeesPresenter CreatePresenter()
        {
            EmployeesPresenter presenter = new EmployeesPresenter(view, controller);

            return(presenter);
        }
示例#14
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UserControlEmployeeList"/> class.
 /// </summary>
 public UserControlEmployeeList()
 {
     InitializeComponent();
     _employeesPresenter = new EmployeesPresenter(this);
 }