Example #1
0
        public Laborer GetByIdNumber(long idNumber)
        {
            var laborer = _laborerService.GetLaborerByIdNumber(idNumber.ToString());

            if (laborer != null)
            {
                return(laborer.ToModel());
            }
            else
            {
                throw new Exception();
            }
        }
Example #2
0
        public IActionResult Get()
        {
            var laborer = _laborerService.GetLaborerByIdNumber(CurrentUser.IdNumber);

            if (laborer != null)
            {
                var laborerJson = laborer.ToDto();
                return(Json(laborerJson));
            }
            else
            {
                return(new NotFoundResult());
            }
        }