Exemplo n.º 1
0
        public ResponseResult GetWardWithDistrict(Guid?districtId)
        {
            var result = new ResponseResult();

            if (string.IsNullOrEmpty(districtId.ToString()))
            {
                result.IsSuccess = false;
                result.ErrorCode = Enumerations.ErrorCode.BADREQUEST;
                result.DevMsg    = Resources.ResourceMessage.Error_Input;
                result.UserMsg   = Resources.ResourceMessage.Error_NotExist;
            }
            else
            {
                var provinces = _wardRepository.GetWardWithDistrict(districtId);

                if (provinces != null)
                {
                    result.Data      = provinces;
                    result.IsSuccess = true;
                    result.ErrorCode = Enumerations.ErrorCode.NONE;
                }
                else
                {
                    result.IsSuccess = false;
                    result.ErrorCode = Enumerations.ErrorCode.NOCONTENT;
                    result.DevMsg    = Resources.ResourceMessage.NoContent;
                    result.UserMsg   = Resources.ResourceMessage.NoContent;
                }
            }
            return(result);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Lấy tất cả Xã/Phường phố có trong huyện
        /// </summary>
        /// <param name="entityId">Id của huyện</param>
        /// <returns>Tất cả Xã/Phường có trong huyện</returns>
        /// CreatedBy: Tuanhd(18/4/2021)
        public IEnumerable <Ward> GetWardWithDistrict(Guid entityId)
        {
            var entities = _wardRepository.GetWardWithDistrict(entityId);

            return(entities);
        }