public SaveEmployeeCostCommand(IMessageBroker broker, IEmployeeCostService costService)
        {
            Text = () => LanguageData.General_Save;

            this.broker      = broker;
            this.costService = costService;
        }
        public EmployeeCostEntryViewModel(
            IMessageBroker messageBroker, 
            IEmployeeCostService costService,
            IEmployeeService employeeService,
            SaveEmployeeCostCommand saveCostCommand,
            CancelCommand cancelCommand, ShowEmployeeCostCommand showListCommand
            )
        {
            this.messageBroker = messageBroker;
            this.costService = costService;
            this.employeeService = employeeService;
            ActualSaveCommand = saveCostCommand;

            CancelCommand = cancelCommand;
            ShowCostListCommand = showListCommand;
            InitializeCommands();
            NavigationCommands = new List<CommandBase>{SaveCommand,CancelCommand};
            CancelCommand.Action = broker => showListCommand.Execute(null);

            PropertiesToValidate = new List<string>()
            {
                "Date",
                "Total",
                "Details"
            };

            Employees = new ObservableCollection<Employee>(employeeService.GetAll());

            SubscribeMessages();
        }
        public EmployeeCostEntryViewModel(
            IMessageBroker messageBroker,
            IEmployeeCostService costService,
            IEmployeeService employeeService,
            SaveEmployeeCostCommand saveCostCommand,
            CancelCommand cancelCommand, ShowEmployeeCostCommand showListCommand
            )
        {
            this.messageBroker   = messageBroker;
            this.costService     = costService;
            this.employeeService = employeeService;
            ActualSaveCommand    = saveCostCommand;

            CancelCommand       = cancelCommand;
            ShowCostListCommand = showListCommand;
            InitializeCommands();
            NavigationCommands = new List <CommandBase> {
                SaveCommand, CancelCommand
            };
            CancelCommand.Action = broker => showListCommand.Execute(null);

            PropertiesToValidate = new List <string>()
            {
                "Date",
                "Total",
                "Details"
            };

            Employees = new ObservableCollection <Employee>(employeeService.GetAll());

            SubscribeMessages();
        }
Ejemplo n.º 4
0
 public AddEmployeeCostToBudgetJob(
     IBudgetRepository budgetRepository,
     IEmployeeCostService employeeCostService)
 {
     _budgetRepository    = budgetRepository;
     _employeeCostService = employeeCostService;
 }
        public DeleteEmployeeCostCommand(IMessageBroker messageBroker, IEmployeeCostService costService)
        {
            Text = () => LanguageData.General_Delete;

            this.broker      = messageBroker;
            this.costService = costService;
        }
        public SaveEmployeeCostCommand(IMessageBroker broker, IEmployeeCostService costService)
        {
            Text = () => LanguageData.General_Save;

            this.broker = broker;
            this.costService = costService;
        }
        public DeleteEmployeeCostCommand(IMessageBroker messageBroker, IEmployeeCostService costService)
        {
            Text = () => LanguageData.General_Delete;

            this.broker = messageBroker;
            this.costService = costService;
        }
Ejemplo n.º 8
0
        public async Task AddEmployeesCost(
            EmployeeIdentity employeeIdentity,
            Participation participation,
            IEmployeeCostService employeeCostService)
        {
            var employeeCost = new EmployeeCost
            {
                EmployeeCode  = employeeIdentity.EmployeeCode,
                Participation = participation,
                Cost          = await employeeCostService.GetEmployeeCostAsync(employeeIdentity.EmployeeCode)
            };

            _employeeCosts.Add(employeeCost);

            AddDomainEvent(new BudgetEmployeeCostDefinedEvent(Id, employeeCost));
        }
        public EmployeeCostListViewModel(IMessageBroker broker, IClientContext clientContext, IEmployeeCostService costService,
            NewEmployeeCostCommand newCommand, EditEmployeeCostCommand editCommand, DeleteEmployeeCostCommand deleteCommand,
            RefreshCommand refreshCommand)
        {
            this.broker = broker;
            this.costService = costService;
            pageSize = clientContext.PageSize;

            NewCommand = newCommand;
            EditCommand = editCommand;
            DeleteCommand = deleteCommand;
            RefreshCommand = refreshCommand;
            RefreshCommand.MessageName = CommonMessages.RefreshEmployeeCostList;
            NavigationCommands = new List<CommandBase>{NewCommand,  DeleteCommand, RefreshCommand};

            SubscribeMessages();
        }
        public EmployeeCostListViewModel(IMessageBroker broker, IClientContext clientContext, IEmployeeCostService costService,
                                         NewEmployeeCostCommand newCommand, EditEmployeeCostCommand editCommand, DeleteEmployeeCostCommand deleteCommand,
                                         RefreshCommand refreshCommand)
        {
            this.broker      = broker;
            this.costService = costService;
            pageSize         = clientContext.PageSize;

            NewCommand                 = newCommand;
            EditCommand                = editCommand;
            DeleteCommand              = deleteCommand;
            RefreshCommand             = refreshCommand;
            RefreshCommand.MessageName = CommonMessages.RefreshEmployeeCostList;
            NavigationCommands         = new List <CommandBase> {
                NewCommand, DeleteCommand, RefreshCommand
            };

            SubscribeMessages();
        }
 public EmployeeCostController(IEmployeeCostService service)
 {
     this.service = service;
 }
 public EmployeeCostController(IEmployeeCostService service)
 {
     this.service = service;
 }
 public EmployeeCostServiceTests()
 {
     factory = DatabaseTestInitializer.GetConnectionFactory();
     service = new EmployeeCostService(factory);
 }
 public EmployeeCostServiceTests()
 {
     factory = DatabaseTestInitializer.GetConnectionFactory();
     service = new EmployeeCostService(factory);
 }