public async Task <ActionResult <EmployeeDto> > Get(int id)
        {
            try
            {
                var employee = await _businessLogic.Get(id);

                return(Ok(employee));
            }
            catch (Exception e)
            {
                return(NoContent());//todo return internal server error
            }
        }
Ejemplo n.º 2
0
        private bool FilterByResponsible(Contracts @event, string responsibleFilter)
        {
            if (String.IsNullOrEmpty(responsibleFilter))
            {
                return(true);
            }
            if (@event.Responsible == 0)
            {
                return(false);
            }
            var responsible = _employeeBusinessLogic.Get(@event.Responsible);

            if (responsible.Name.Contains(responsibleFilter))
            {
                return(true);
            }
            return(false);
        }
Ejemplo n.º 3
0
        public string Resolve(Contracts source, ContractsView destination, string destMember, ResolutionContext context)
        {
            var responsible = _employeeBusinessLogic.Get(source.Responsible);

            return(responsible.Name);
        }
Ejemplo n.º 4
0
        public ActionResult Edit(int id)
        {
            var employee = _employeeBusinessLogic.Get(id);

            return(View(_mapper.Map <EmployeeView>(employee)));
        }