Пример #1
0
        public IActionResult EmployeeDetail(int id)
        {
            var request = _service.GetEmployeeDetail(id);

            AngularEmployeeModel obj = new AngularEmployeeModel();

            obj.CopyData(request);


            return(Ok(obj));
        }
Пример #2
0
        public IActionResult GetAllEmployees()
        {
            var allEmployees = _service.GetAllEmployees();
            List <AngularEmployeeModel> objList = new List <AngularEmployeeModel>();

            foreach (var employee in allEmployees)
            {
                AngularEmployeeModel obj = new AngularEmployeeModel();
                obj.CopyData(employee);

                objList.Add(obj);
            }

            return(Ok(objList));
        }
Пример #3
0
        public IActionResult EmployeeByDept([FromRoute] string id)
        {
            var context      = new SRMContext();
            int deptId       = context.Department.FirstOrDefault(s => s.Name.Equals(id)).Id;
            var allEmployees = _service.GetEmployeeByDept(deptId);

            List <AngularEmployeeModel> objList = new List <AngularEmployeeModel>();

            foreach (var employee in allEmployees)
            {
                AngularEmployeeModel obj = new AngularEmployeeModel();
                obj.CopyData(employee);

                objList.Add(obj);
            }

            return(Ok(objList));
        }