Ejemplo n.º 1
0
        public string GetDepartmentsById(int Id)
        {
            DepartmentsDomain department = _departmentService.GetDepartmentById(Id);

            DepartmentsDTO departmentsDTO = DomainToDTOMapper(department);

            return(JsonConvert.SerializeObject(departmentsDTO));
        }
Ejemplo n.º 2
0
        DepartmentsDTO DomainToDTOMapper(DepartmentsDomain department)
        {
            var departmentDTO = new DepartmentsDTO();

            departmentDTO.DeptId          = department.DeptId;
            departmentDTO.DeptName        = department.DeptName;
            departmentDTO.DeptDescription = department.DeptDescription;
            departmentDTO.EmployeeCount   = department.EmployeeCount;
            departmentDTO.ShiftTime       = department.ShiftTime;

            return(departmentDTO);
        }
Ejemplo n.º 3
0
        List <DepartmentsDTO> DomainToDTOMapper(List <DepartmentsDomain> departmentsDomain)
        {
            var departmentsDTO = new List <DepartmentsDTO>();

            foreach (var department in departmentsDomain)
            {
                var departmentDTO = new DepartmentsDTO();
                departmentDTO.DeptId          = department.DeptId;
                departmentDTO.DeptName        = department.DeptName;
                departmentDTO.DeptDescription = department.DeptDescription;
                departmentDTO.EmployeeCount   = department.EmployeeCount;
                departmentDTO.ShiftTime       = department.ShiftTime;
                departmentsDTO.Add(departmentDTO);
            }
            return(departmentsDTO);
        }