예제 #1
0
        public LmsParameter GetLmsParameter(ZscoreType zscoreType, SprocSearchParams searchParams)
        {
            var sprocExists = _zscoreSprocConcurrentDict.TryGetValue(zscoreType, out string sprocName);

            return(sprocExists? GetLmsParameterFromSproc(sprocName, BuildSprocSearchDict(searchParams, zscoreType))
                : null);
        }
예제 #2
0
        private Dictionary <string, object> BuildSprocSearchDict(SprocSearchParams searchParams, ZscoreType zscoreType)
        {
            switch (zscoreType)
            {
            case ZscoreType.WeightForAge:
            case ZscoreType.Bmiz:
            case ZscoreType.HeightForAge:
                return(new Dictionary <string, object>
                {
                    { "@DateOfBirth", searchParams.DateOfBirth },
                    { "@Sex", searchParams.Sex }
                });

            case ZscoreType.WeightForHeight:
                return(new Dictionary <string, object>
                {
                    { "@Height", searchParams.Height },
                    { "@Sex", searchParams.Sex }
                });

            default:
                throw new ArgumentOutOfRangeException(nameof(zscoreType), zscoreType, null);
            }
        }