Exemple #1
0
 public DepartmentService(IUnitOfWork unitOfWork, IDepartmentRepository departmentRepository)
 {
     _unitOfWork = unitOfWork;
     _departmentRepository = departmentRepository;
     _bioStarDbContext = new BioStarDbContext();
     _applicationDbContext = new ApplicationDbContext();
 }
 public ProfileController(IRoleRepository roleRepository, IEmployeeRepository employeeRepository, IDepartmentRepository departmentRepository, ISeatingFloorRespository seatingFloorRespository)
 {
     this.roleRepository = roleRepository;
     this.employeeRepository = employeeRepository;
     this.departmentRepository = departmentRepository;
     this.seatingFloorRespository = seatingFloorRespository;
 }
        public DepartmentModule(IDepartmentRepository deptRepo)
            : base("dept")
        {
            Get["/"] = parm =>
            {

                return View["index"];
            };
            Get["/departments"] = parm =>
            {
                return View["Departments"];
            };
            Post["/create"] = parm =>
            {
                var request = this.Bind<SchoolDto>();
                try
                {
                    if (validate(request))
                    {
                        deptRepo.Save(request);
                        return View["Departments"];
                    }
                    return View["validationerror", _validation];
                }
                catch (Exception ex)
                {
                    _validation = "An error occurred: " + ex;
                    return View["validationerror", _validation];
                }

            };
        }
 public CourseController(ICourseRepository courseRepository, IDepartmentRepository departmentRepository,
     IMapper mapper)
 {
     _courseRepository = courseRepository;
     _departmentRepository = departmentRepository;
     _mapper = mapper;
 }
Exemple #5
0
 public Bll()
 {
     _departmentRepository = new DepartmentRepository();
     _doctorRepository = new DoctorRepository();
     _patientRepository = new PatientRepository();
     _ticketRepository = new TicketRepository();
     _rangeRepository = new RangeRepository();
 }
 public CsvResourceAllocationBridge(IResourceAllocationRepository resourceAllocationRepository, IProjectRepository projectRepository, IResourceRepository resourceRepository, ITeamRepository teamRepository, IDepartmentRepository departmentRepository)
 {
     ResourceAllocationRepository = resourceAllocationRepository;
     ProjectRepository = projectRepository;
     ResourceRepository = resourceRepository;
     TeamRepository = teamRepository;
     DepartmentRepository = departmentRepository;
 }
 public InstructorController(IInstructorRepository instructorRepository,
     ICourseRepository courseRepository, IDepartmentRepository departmentRepository, IMapper mapper)
 {
     _instructorRepository = instructorRepository;
     _courseRepository = courseRepository;
     _departmentRepository = departmentRepository;
     _mapper = mapper;
 }
 public CategoryController(ICategoryRepository categoryRepository, IDepartmentRepository departmentRepository,
                           ICycleRepository cycleRepository, IUnitRepository unitRepository)
 {
     this.categoryRepository = categoryRepository;
     this.departmentRepository = departmentRepository;
     this.cycleRepository = cycleRepository;
     this.unitRepository = unitRepository;
 }
		public EmployeeController(IEmployeeRepository employeeRepository, IDepartmentRepository departmentRepository, IUnitOfWork unitOfWork,
			IDisposableCollection disposables)
			: base(disposables)
		{
			_employeeRepository = employeeRepository;
			_departmentRepository = departmentRepository;
			_unitOfWork = unitOfWork;
		}
Exemple #10
0
 public void TestInit() {
     var context = Helper.GetEfContext();
     _employee = Employee.GetEmployee();
     _employeeRepository = new EmployeeRepository( context );
     _department = Department.GetDepartment();
     _departmentRepository = new DepartmentRepository( context );
     _context = _departmentRepository.GetUnitOfWork();
 }
 public CsvStatusEtlBridge(IStatusReportRepository statusReportRepository, IProjectRepository projectRepository, ITopicRepository topicRepository, IResourceRepository resourceRepository, ITeamRepository teamRepository, IDepartmentRepository departmentRepository)
 {
     StatusReportRepository = statusReportRepository;
     ProjectRepository = projectRepository;
     TopicRepository = topicRepository;
     ResourceRepository = resourceRepository;
     TeamRepository = teamRepository;
     DepartmentRepository = departmentRepository;
 }
        public DepartmentController(IDepartmentRepository repository, string catalog, LoginView view)
        {
            this._LoginId = view.LoginId.ToLong();
            this._UserId = view.UserId.ToInt();
            this._OfficeId = view.OfficeId.ToInt();
            this._Catalog = catalog;

            this.DepartmentRepository = repository;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="EmployeeViewModel" /> class.
        /// </summary>
        /// <param name="employee">The employee.</param>
        /// <param name="messageMediator">The message mediator.</param>
        /// <param name="departmentRepository">The department repository.</param>
        /// <exception cref="ArgumentNullException">The <paramref name="employee" /> is <c>null</c>.</exception>
        /// <exception cref="ArgumentNullException">The <paramref name="messageMediator" /> is <c>null</c>.</exception>
        /// <exception cref="ArgumentNullException">The <paramref name="departmentRepository" /> is <c>null</c>.</exception>
        public EmployeeViewModel(IEmployee employee, IMessageMediator messageMediator, IDepartmentRepository departmentRepository)
            : base(messageMediator)
        {
            Argument.IsNotNull(() => employee);
            Argument.IsNotNull(() => messageMediator);

            Employee = employee;

            AvailableDepartments = new FastObservableCollection<IDepartment>(departmentRepository.GetAllDepartments());
        }
 public EmployeeService(IDepartmentEmployeeRepository departmentEmployeeRepository,
     IDepartmentRepository departmentRepository, IEmployeeRepository employeeRepository,
     ISalaryRepository salaryRepository, ITitleRepository titleRepository)
 {
     this.departmentEmployeeRepository = departmentEmployeeRepository;
     this.departmentRepository = departmentRepository;
     this.employeeRepository = employeeRepository;
     this.salaryRepository = salaryRepository;
     this.titleRepository = titleRepository;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="DepartmentsViewModel"/> class. 
        /// </summary>
        public DepartmentsViewModel(IMessageMediator messageMediator, IDepartmentRepository departmentRepository, IUIVisualizerService uiVisualizerService)
            : base(messageMediator)
        {
            _uiVisualizerService = uiVisualizerService;

            Departments = new FastObservableCollection<IDepartment>(departmentRepository.GetAllDepartments());
            if (Departments.Count > 0)
            {
                SelectedDepartment = Departments[0];
            }

            Select = new Command(OnSelectExecute);
        }
        public DepartmentController()
        {
            this._LoginId = AppUsers.GetCurrent().View.LoginId.ToLong();
            this._UserId = AppUsers.GetCurrent().View.UserId.ToInt();
            this._OfficeId = AppUsers.GetCurrent().View.OfficeId.ToInt();
            this._Catalog = AppUsers.GetCurrentUserDB();

            this.DepartmentRepository = new MixERP.Net.Schemas.Office.Data.Department
            {
                _Catalog = this._Catalog,
                _LoginId = this._LoginId,
                _UserId = this._UserId
            };
        }
Exemple #17
0
 public void TestTransaction_DifferentContext_AllFail() {
     _departmentRepository = new DepartmentRepository( Helper.GetEfContext() );
     try {
         using ( TransactionScope scope = new TransactionScope() ) {
             _employeeRepository.Add( _employee );
             throw new Exception();
             _departmentRepository.Add( _department );
             scope.Complete();
         }
     }
     catch {
         _employeeRepository = Ioc.Create<IEmployeeRepository>();
         Assert.IsNull( _employeeRepository.Find( _employee.Id ) );
     }
 }
Exemple #18
0
 public void TestTransaction_PartialSuccess() {
     try {
         _context.Start();
         _employeeRepository.Add( _employee );
         _departmentRepository.Add( _department );
         _context.Commit();
         throw new Exception();
         _employeeRepository2.Add( _employee2 );
     }
     catch {
         _employeeRepository = Ioc.Create<IEmployeeRepository>();
         _departmentRepository = Ioc.Create<IDepartmentRepository>();
         Assert.IsNotNull( _employeeRepository.Find( _employee.Id ) );
         Assert.IsNotNull( _departmentRepository.Find( _department.Id ) );
     }
 }
        public EmployeeManager(
            IUnitOfWork unitOfWork,
            IEmployeeRepository employeeRepository,
            IDepartmentRepository departmentRepository)
        {
            Guard.ArgumentNotNull(() => unitOfWork);
            Guard.ArgumentNotNull(() => employeeRepository);
            Guard.ArgumentNotNull(() => departmentRepository);

            this.employeeRepository = employeeRepository;
            this.departmentRepository = departmentRepository;

            this.unitOfWork = unitOfWork;
            this.unitOfWork.RegisterContext(employeeRepository.Context);
            this.unitOfWork.RegisterContext(departmentRepository.Context); // BUG: They both share the same context; no need to register 2x
        }
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        /// <param name="unitOfWork">UnitOfWork for co-ordinating changes</param>
        /// <param name="departmentRepository">Repository for querying department data</param>
        /// <param name="employeeRepository">Repository for querying employee data</param>
        public MainViewModel(IUnitOfWork unitOfWork, IDepartmentRepository departmentRepository, IEmployeeRepository employeeRepository)
        {
            if (unitOfWork == null)
            {
                throw new ArgumentNullException("unitOfWork");
            }

            if (departmentRepository == null)
            {
                throw new ArgumentNullException("departmentRepository");
            }

            if (employeeRepository == null)
            {
                throw new ArgumentNullException("employeeRepository");
            }

            this.unitOfWork = unitOfWork;

            // Build data structures to populate areas of the application surface
            ObservableCollection<EmployeeViewModel> allEmployees = new ObservableCollection<EmployeeViewModel>();
            ObservableCollection<DepartmentViewModel> allDepartments = new ObservableCollection<DepartmentViewModel>();

            foreach (var dep in departmentRepository.GetAllDepartments())
            {
                allDepartments.Add(new DepartmentViewModel(dep));
            }

            foreach (var emp in employeeRepository.GetAllEmployees())
            {
                allEmployees.Add(new EmployeeViewModel(emp, allEmployees, allDepartments, this.unitOfWork));
            }

            this.DepartmentWorkspace = new DepartmentWorkspaceViewModel(allDepartments, unitOfWork);
            this.EmployeeWorkspace = new EmployeeWorkspaceViewModel(allEmployees, allDepartments, unitOfWork);

            // Build non-interactive list of long serving employees
            List<BasicEmployeeViewModel> longServingEmployees = new List<BasicEmployeeViewModel>();
            foreach (var emp in employeeRepository.GetLongestServingEmployees(5))
            {
                longServingEmployees.Add(new BasicEmployeeViewModel(emp));
            }

            this.LongServingEmployees = longServingEmployees;

            this.SaveCommand = new DelegateCommand((o) => this.Save());
        }
Exemple #21
0
        /// <summary>
        /// 初始化 MainViewModel 类的新实例。
        /// </summary>
        /// <param name="unitOfWork">用于协调更改的 UnitOfWork</param>
        /// <param name="departmentRepository">用于查询部门数据的存储库</param>
        /// <param name="employeeRepository">用于查询雇员数据的存储库</param>
        public MainViewModel(IUnitOfWork unitOfWork, IDepartmentRepository departmentRepository, IEmployeeRepository employeeRepository)
        {
            if (unitOfWork == null)
            {
                throw new ArgumentNullException("unitOfWork");
            }

            if (departmentRepository == null)
            {
                throw new ArgumentNullException("departmentRepository");
            }

            if (employeeRepository == null)
            {
                throw new ArgumentNullException("employeeRepository");
            }

            this.unitOfWork = unitOfWork;

            // 生成数据结构以填充应用程序图面的区域
            ObservableCollection<EmployeeViewModel> allEmployees = new ObservableCollection<EmployeeViewModel>();
            ObservableCollection<DepartmentViewModel> allDepartments = new ObservableCollection<DepartmentViewModel>();

            foreach (var dep in departmentRepository.GetAllDepartments())
            {
                allDepartments.Add(new DepartmentViewModel(dep));
            }

            foreach (var emp in employeeRepository.GetAllEmployees())
            {
                allEmployees.Add(new EmployeeViewModel(emp, allEmployees, allDepartments, this.unitOfWork));
            }

            this.DepartmentWorkspace = new DepartmentWorkspaceViewModel(allDepartments, unitOfWork);
            this.EmployeeWorkspace = new EmployeeWorkspaceViewModel(allEmployees, allDepartments, unitOfWork);

            // 生成在职时间较长的雇员的非交互列表
            List<BasicEmployeeViewModel> longServingEmployees = new List<BasicEmployeeViewModel>();
            foreach (var emp in employeeRepository.GetLongestServingEmployees(5))
            {
                longServingEmployees.Add(new BasicEmployeeViewModel(emp));
            }

            this.LongServingEmployees = longServingEmployees;

            this.SaveCommand = new DelegateCommand((o) => this.Save());
        }
Exemple #22
0
        public void Test_2() {
            //查找部门
            _repository = Ioc.Create<IDepartmentRepository>();
            _department = _repository.Find( _department.Id );

            //复制部门
            Department department = _department.Copy();

            //修改部门
            _department.Name = "A";
            _repository.Save();

            //修改第一个部门并提交
            _repository = Ioc.Create<IDepartmentRepository>();
            var dbEntity = _repository.Find( department.Id );
            dbEntity.Name = "B";
            dbEntity.Version = department.Version;
            _repository.Save();
        }
Exemple #23
0
        public void Test() {
            //查找部门
            _repository = Ioc.Create<IDepartmentRepository>();
            _department = _repository.Find( _department.Id );

            //复制部门
            Department department = _department.Copy();
            Department department2 = _department.Copy();

            //修改第一个部门并提交
            _repository = Ioc.Create<IDepartmentRepository>();
            department.Name = "A";
            _repository.Update( department );

            //修改第2个部门并提交
            _repository = Ioc.Create<IDepartmentRepository>();
            department2.Name = "B";
            _repository.Update( department2 );
        }
Exemple #24
0
 public DepartmentController(IDepartmentRepository repo, IMapper mapper)
 {
     _repo   = repo;
     _mapper = mapper;
 }
Exemple #25
0
 public DeleteModel(IDepartmentRepository repository)
 {
     _repository = repository;
 }
Exemple #26
0
 /// <summary>
 /// Department Constructor
 /// </summary>
 public DepartmentService(IDepartmentRepository xRepository, ICompanyRepository crRepository, IOperationRepository operationRepository)
 {
     departmentRepository     = xRepository;
     companyRepository        = crRepository;
     this.operationRepository = operationRepository;
 }
 public DepartmentController(IDepartmentRepository departmentRepository)
 {
     _departmentRepository=departmentRepository;
 }
 public DepartmentService(IDepartmentRepository DepartmentRepository, IAppLogger <DepartmentService> logger)
 {
     _DepartmentRepository = DepartmentRepository ?? throw new ArgumentNullException(nameof(DepartmentRepository));
     _logger = logger ?? throw new ArgumentNullException(nameof(logger));
 }
Exemple #29
0
 public DepartmentsController(IDepartmentRepository <Department> deptRepo)
 {
     departmentRepository = deptRepo;
 }
Exemple #30
0
 public DepartmentsController(IDepartmentRepository departmentRepository)
 {
     _departmentRepository = departmentRepository;
 }
Exemple #31
0
 public DepartmentAPIController()
 {
     this.DepartmentRepository = new DepartmentRepository(new zgphrmEntities());
 }
Exemple #32
0
 public DepartmentController(IDepartmentRepository departmentRepository, IUnitOfWork uow)
 {
     _departmentRepository = departmentRepository;
     _uow = uow;
 }
Exemple #33
0
 public DepartmentController()
 {
     repository = new DepartmentRepository();
 }
 public ApiDepartmentRequestModelValidator(IDepartmentRepository departmentRepository)
     : base(departmentRepository)
 {
 }
 public GetDepartmentsHandler(IMediator mediator, IDepartmentRepository departmentrepository)
 {
     Mediator             = mediator;
     DepartmentRepository = departmentrepository;
 }
 public TimesheetEntryController(ITimesheetEntryRepository timesheetEntryRepository, ITimesheetEntryMapper mapper, UserManager <User> userManager, IProjectRepository projectRepository, IUserRepository userRepository, IDepartmentRepository departmentRepository)
 {
     _timesheetEntryRepository = timesheetEntryRepository;
     _projectRepository        = projectRepository;
     _userRepository           = userRepository;
     _departmentRepository     = departmentRepository;
     _mapper      = mapper;
     _userManager = userManager;
 }
Exemple #37
0
 public UpdateEmployeeHandler(IMediator mediator, IEmployeeRepository employeerepository, IPositionRepository positionrepository, IDepartmentRepository departmentrepository, IVacationTypeRepository vacationtyperepository, UserManager <ApplicationUser> usermanager, RoleManager <ApplicationRole> rolemanager)
 {
     Mediator               = mediator;
     EmployeeRepository     = employeerepository;
     PositionRepository     = positionrepository;
     DepartmentRepository   = departmentrepository;
     VacationTypeRepository = vacationtyperepository;
     UserManager            = usermanager;
     RoleManager            = rolemanager;
 }
 public DetailsModel(IDepartmentRepository repository)
 {
     _repository = repository;
 }
Exemple #39
0
 public DepartmentManager(IDepartmentRepository departmentRepository, IMappingFactory <Department, DepartmentModel, DepartmentModel> departmentMapper, IPermissionManager permissionManager)
 {
     _departmentRepository = departmentRepository;
     _departmentMapper     = departmentMapper;
     _permissionManager    = permissionManager;
 }
 public CreateModel(IDepartmentRepository departmentRepository, IInstructorRepository instructorRepository, IMapper mapper)
 {
     _departmentRepository = departmentRepository;
     _instructorRepository = instructorRepository;
     _mapper = mapper;
 }
Exemple #41
0
 public SummaryRepository(IDepartmentRepository departmentRepository)
 {
     this.departmentRepository = departmentRepository;
 }
 public DepartmentController(IMapper mapper, IDepartmentRepository departmentRepository)
 {
     _mapper = mapper;
     _departmentRepository = departmentRepository;
 }
Exemple #43
0
 public DepartmentService(IContext context, IDepartmentRepository repository)
     : base(context, repository)
 {
     _repository = repository;
     _context    = context;
 }
 public DepartmentViewComponent(IMapper mapper,
                                IDepartmentRepository departmentRepository)
 {
     _mapper = mapper;
     _departmentRepository = departmentRepository;
 }
Exemple #45
0
 public DepartmentService(IDepartmentRepository departmentRepository) : base(departmentRepository)
 {
     _departmentRepository = departmentRepository;
 }
Exemple #46
0
 public DepartmentController(IDepartmentRepository departmentRepository)
 {
     this.departmentRepository = departmentRepository;
 }
Exemple #47
0
 public MeetingRepository(MeetingContext dbContext, IRoomRepository roomRepository, IDepartmentRepository departmentRepository, IUserRepository userRepository, IMailService mailService) : base(dbContext)
 {
     _roomRepository       = roomRepository;
     _departmentRepository = departmentRepository;
     _userRepository       = userRepository;
     _mailService          = mailService;
 }
Exemple #48
0
 public DepartmentsController(IDepartmentRepository departmentRepository, DatabaseContext context) : base(departmentRepository, context)
 {
     _departmentRepository = departmentRepository;
     _context = context;
 }
 public CompanyManagementService(IDepartmentRepository departmentRepository,ICompanyRepository companyRepository)
 {
     _departmentRepository = departmentRepository;
     _companyRepository = companyRepository;
 }
 public DepartmentsDataLoader()
     : base(new DataLoaderOptions <AllDataloaderParam>())
 {
     _repository = new DepartmentRepository();
 }
 public PayrollController(IDepartmentRepository repository)
 {
     _repository = repository;
 }
 public DepartmentController(IDepartmentRepository repository)
 {
     this.repository = repository;
 }
 public DepartmentService(IDepartmentRepository departmentRepository)
 {
     _departmentRepository = departmentRepository;
 }
Exemple #54
0
 public DepartmentBLL()
 {
     this.departmentRepository = new DepartmentRepository();
 }
 public void SetUp()
 {
     _repository = new DepartmentRepository();
 }
Exemple #56
0
 public EmpT2Controller(Database1Context db, IEmployeeRepository emp, IDepartmentRepository dep)
 {
     DB             = db;
     empRepo        = emp;
     departmentRepo = dep;
 }
Exemple #57
0
 public OtherController(ILogger <OtherController> logger, IDepartmentAppService departmentAppService, IBarcodeAppService barcodeAppService, ISerialNumberAppService serialNumberAppService, ILetterAppService letterAppService, IDepartmentRepository departmentRepository)
 {
     _logger = logger;
     _departmentAppService   = departmentAppService;
     _barcodeAppService      = barcodeAppService;
     _serialNumberAppService = serialNumberAppService;
     _letterAppService       = letterAppService;
     _departmentRepository   = departmentRepository;
 }
Exemple #58
0
 public StatisticsController(ApplicationDbContext dbContext, ITimesheetEntryRepository timesheetEntryRepository, ITimesheetEntryMapper mapper, UserManager <User> userManager, IProjectRepository projectRepository, IUserRepository userRepository, IDepartmentRepository departmentRepository)
 {
     _dbContext = dbContext;
     _timesheetEntryRepository = timesheetEntryRepository;
     _projectRepository        = projectRepository;
     _userRepository           = userRepository;
     _departmentRepository     = departmentRepository;
     _mapper      = mapper;
     _userManager = userManager;
 }
Exemple #59
0
 public DepartmentService(IDepartmentRepository departmentRepository, IUnitOfWork unitOfWork)
 {
     this.departmentRepository = departmentRepository;
     this.unitOfWork = unitOfWork;
 }
 public ApiMutation(IDepartmentRepository departmentRepository, IEmployeeRepository employeeRepository)
 {
     DepartmentMutation(departmentRepository);
     EmployeeMutation(employeeRepository);
 }