Пример #1
0
        public IActionResult DeleteChange(int changeId)
        {
            if (changeId != 0)
            {
                var change = _deptLogic.DeleteChagne(changeId);

                if (change != null)
                {
                    return(Ok(DtoTransfer.ConvertChangeToDto(change)));
                }

                return(NotFound());
            }

            return(BadRequest());
        }
Пример #2
0
        public IActionResult GetChanges(ChangeDto filter)
        {
            if (filter != null)
            {
                var changes    = _deptLogic.GetChanges(filter);
                var changeDtos = new List <ChangeDto>();

                if (changes != null && changes.Count > 0)
                {
                    changes.ToList().ForEach(c =>
                    {
                        changeDtos.Add(DtoTransfer.ConvertChangeToDto(c));
                    });

                    return(Ok(changes));
                }

                return(NotFound());
            }

            return(BadRequest());
        }