示例#1
0
        //get the state info from the given tc value
        public static StateInfo GetStateInfoFromTC(int tc)
        {
            var states = QuoteModel.States();

            var state = states.Where(s => s.TC == tc).FirstOrDefault();

            if (null != state)
            {
                return(new StateInfo()
                {
                    Code = state.Value, Name = state.Text, TC = state.TC, Value = state.TCValue
                });
            }
            else
            {
                return(null);
            }
        }
示例#2
0
        //get the state info from the given state code
        private StateInfo GetStateInfoFromCode(string stateCode)
        {
            var states = QuoteModel.States();

            var state = states.Where(s => s.Value == stateCode).FirstOrDefault();

            if (null != state)
            {
                return(new StateInfo()
                {
                    Code = state.Value, Name = state.Text, TC = state.TC, Value = state.TCValue
                });
            }
            else
            {
                return(null);
            }
        }