Пример #1
0
        public IEnumerable <VWEDT_COURIERMST> Get(VWEDT_COURIERMST vwedt_couriermst)
        {
            try
            {
                IQueryable <VWEDT_COURIERMST> query = unitOfWork.m_courier_mst_Repository.context.VWEDT_COURIERMST;

                if (vwedt_couriermst.TerminalCode != "")
                {
                    query = query.Where(p => p.TerminalCode == vwedt_couriermst.TerminalCode);
                }

                if (vwedt_couriermst.CourierCoName != "")
                {
                    query = query.Where(p => p.CourierCoName.Contains(vwedt_couriermst.CourierCoName));
                }

                if (vwedt_couriermst.CourierCoCode != "")
                {
                    query = query.Where(p => p.CourierCoCode.Contains(vwedt_couriermst.CourierCoCode));
                }

                if (vwedt_couriermst.CourierType != "")
                {
                    query = query.Where(p => p.CourierType == vwedt_couriermst.CourierType);
                }

                if (vwedt_couriermst.MemberTypeId != "")
                {
                    query = query.Where(p => p.MemberTypeId == vwedt_couriermst.MemberTypeId);
                }

                return(query);
            }
            catch (Exception e)
            {
                throw;
            }
        }
        public async Task <IActionResult> GetAllCouriers([FromQuery] VWEDT_COURIERMST vWEDT_COURIERMST)
        {
            var users = await _repository.courierMst.GetCourierDetails(vWEDT_COURIERMST);

            return(Ok(users));
        }