Пример #1
0
        /// <summary>
        /// Initializes a new instance of the EmployeeRepository class.
        /// </summary>
        /// <param name="context">Context to retrieve data from</param>
        public EmployeeRepository(IEmployeeContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            this.objectSet = context.Employees;
        }
Пример #2
0
        /// <summary>
        /// 启动时启动输入窗体
        /// </summary>
        /// <param name="e">startup 事件的参数</param>
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            if (this.useFakes)
            {
                this.context =  Generation.BuildFakeSession();
            }
            else
            {
                //注意: 如果 .\SQLEXPRESS 中没有 Microsoft SQL Server Express 实例,
                //      您将需要更新 App.config 中的“EmployeeEntities”连接字符串
                this.context = new EmployeeEntities();
            }

            IDepartmentRepository departmentRepository = new DepartmentRepository(this.context);
            IEmployeeRepository employeeRepository = new EmployeeRepository(this.context);
            IUnitOfWork unit = new UnitOfWork(this.context);

            MainViewModel main = new MainViewModel(unit, departmentRepository, employeeRepository);
            MainView window = new View.MainView { DataContext = main };
            window.Show();
        }
Пример #3
0
        /// <summary>
        /// Lauches the entry form on startup
        /// </summary>
        /// <param name="e">Arguments of the startup event</param>
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            if (this.useFakes)
            {
                this.context =  Generation.BuildFakeSession();
            }
            else
            {
                //NOTE: If there is not a Microsoft SQL Server Express instance available at .\SQLEXPRESS
                //      you will need to update the "EmployeeEntities" connection string in App.config
                this.context = new EmployeeEntities();
            }

            IDepartmentRepository departmentRepository = new DepartmentRepository(this.context);
            IEmployeeRepository employeeRepository = new EmployeeRepository(this.context);
            IUnitOfWork unit = new UnitOfWork(this.context);

            MainViewModel main = new MainViewModel(unit, departmentRepository, employeeRepository);
            MainView window = new View.MainView { DataContext = main };
            window.Show();
        }
 public CompensationRepository(ILogger <ICompensationRepository> logger, IEmployeeContext compensationContext)
 {
     _compensationContext = compensationContext;
     _logger = logger;
 }
Пример #5
0
 public TaskRepository(IEmployeeContext employeeContext)
 {
     _employeeContext = employeeContext;
 }
Пример #6
0
 public PositionRepository(IEmployeeContext context, IMapper mapper)
 {
     this._context = context as EmployeeContext;
     this._mapper  = mapper;
 }
        public void CreateContext()
        {
            IEmployeeContext context = InitialTest.SeedDatabaseFourEmployees();

            _iRepo = repo;
        }
Пример #8
0
 public EmployeeService(IEmployeeContext cntx, IMapper mapper)
 {
     _cntx   = cntx ?? throw new ArgumentNullException(nameof(cntx));
     _mapper = mapper ?? throw new ArgumentNullException(nameof(mapper));
 }
Пример #9
0
 public PersonRepository(IEmployeeContext context)
     : base(context)
 {
 }
        //public Repository()
        //{
        //    this.context = new EmployeeContext();
        //}

        public Repository(IEmployeeContext context)
        {
            this.context = context;
        }
Пример #11
0
 public EmployeeLogic(IEmployeeContext Context)
 {
     this.EmployeeContext = Context;
 }
Пример #12
0
 public IndexModel(IEmployeeContext employeeContext)
 {
     _employeeContext = employeeContext;
 }
Пример #13
0
 public DepartmentController(IEmployeeContext context)
 {
     this.db = context;
 }
Пример #14
0
 public DepartmentController()
 {
     this.db = new EmployeeContext();
 }
Пример #15
0
 public EmployeeLogic(IEmployeeContext context)
 {
     Repository = new EmployeeRepository(context);
 }
Пример #16
0
 public EmployeeRepository(IEmployeeContext employeeContext)
 {
     this.context = employeeContext;
 }
 public EmployeeRepository(IEmployeeContext context)
 {
     this.context = context;
 }
 public EmployeeRepository(IEmployeeContext context)
 {
     _context = context;
 }
Пример #19
0
 public EmployeeService(IEmployeeContext context)
 {
     _context = context ?? throw new ArgumentNullException(nameof(context));
 }
Пример #20
0
 public TeamRespository(IEmployeeContext context)
 {
     this.context = context;
 }
Пример #21
0
 public EmployeesController(IEmployeeContext context)
 {
     this.context = context;
 }
 public DepartmentRepository(IEmployeeContext context)
     : base(context)
 {
 }
 /// <summary>
 /// this is for testing purpose, we can remove this when we implement IOC framework like Unit framework
 /// </summary>
 internal EmployeeRepository(IEmployeeContext context)
 {
     _context = context;
 }
Пример #24
0
 public EmployeesController()
 {
     this.context = new EmployeeContext();
 }
Пример #25
0
 public EmployeeService(IEmployeeContext context)
 {
     this.context = context;
 }
Пример #26
0
 public IocIndexModel(IEmployeeContext employeeContext, IHttpContextAccessor httpContextAccessor)
 {
     _employeeContext = employeeContext;
     //必须引用Microsoft.Extensions.DependencyInjection,这种方法一般不推荐
     _reflectionDemo = httpContextAccessor.HttpContext.RequestServices.GetService <IReflectionDemo>();
 }
 public EmployeeRepository()
 {
     Empctx = new SQLConnect();
 }
Пример #28
0
 public PositionRepository(IEmployeeContext context)
 {
     this._context = context as EmployeeContext;
     this._mapper  = (IMapper)IoCHelper.GetResolveService(typeof(IMapper));
 }
 public EmployeesController(IEmployeeContext employeeContext)
 {
     _employeeContext = employeeContext;
 }
Пример #30
0
 public EmployeeReadOnlyRepository(IEmployeeContext context)
     : base(context)
 {
 }
Пример #31
0
 public PaycheckHandler(IPaycheckService paycheckService, IEmployeeContext employeeContext, IEmployeeValidator employeeValidator)
 {
     _paycheckService   = paycheckService;
     _employeeContext   = employeeContext;
     _employeeValidator = employeeValidator;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="employeeContext">The injected employee context</param>
 public EmployeeRepository(IEmployeeContext employeeContext)
 {
     _employeeContext = employeeContext ?? throw new ArgumentNullException(nameof(employeeContext));
 }
 public EmployeeViewModel(IEmployeeContext context)
 {
     this.context = context;
     Employees    = new ObservableCollection <Employee>();
 }
Пример #34
0
 public EmployeeAPIController(IEmployeeContext employeeContext)
 {
     this._employeeContext = employeeContext;
 }
Пример #35
0
 public EmployeeController(IEmployeeContext context, IPaycheckHandler handler)
 {
     _context = context;
     _handler = handler;
 }