USE [Prince]
GO
/****** Object:  UserDefinedFunction [Common].[SYS_MobileNoIsValid]    Script Date: 12/15/2025 16:34:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		ZAREI
-- Create date: 1399/07/01
-- Description:	کنترل شماره موبایل
-- =============================================
ALTER FUNCTION [Common].[SYS_MobileNoIsValid] 
(
	@MobileNo   Common._SMALL_
)
RETURNS Common._BOOLEAN_
AS
BEGIN
	RETURN CASE WHEN @MobileNo COLLATE Latin1_General_BIN NOT LIKE '%[^0-9]%' THEN 
	                 CASE WHEN LEN(@MobileNo) = 11 THEN 
	                           CASE WHEN SUBSTRING(@MobileNo , 1 ,2)='09' THEN 1 ELSE 0 END
	                      ELSE 0 
	                 END
	            ELSE 0 
	       END
END
