Пример #1
0
        public IActionResult FindAll([FromBody] DTO.TranSearchObj dto)
        {
            TransactionDAO dao = new TransactionDAO(_context);
            List <AccessoryTransaction> list;

            if (dto.UsernameSearch.Equals(""))
            {
                if (dto.StatusSearch.Equals("All"))
                {
                    list = dao.FindAll();
                }
                else
                {
                    list = dao.FindAllByStatus(dto.StatusSearch);
                }
            }
            else
            {
                if (dto.StatusSearch.Equals("All"))
                {
                    list = dao.FindByUsername(dto.UsernameSearch);
                }
                else
                {
                    list = dao.FindByStatusAndUsername(dto.StatusSearch, dto.UsernameSearch);
                }
            }
            return(new JsonResult(list));
        }