示例#1
0
        public IEnumerable <lut_city> lut_city_Filter(lut_city filterObj)
        {
            var db = new HealthvaultContext();

            return(from c in db.lut_city
                   where (filterObj.Identifier > 0 && c.Identifier == filterObj.Identifier)
                   select c);
        }
示例#2
0
        public static lut_city ConvertParams(string Identifier)
        {
            lut_city NewObj = new lut_city();

            // Convert Identifier
            if (false == string.IsNullOrEmpty(Identifier))
            {
                short temp;
                if (false == short.TryParse(Identifier, out temp))
                {
                    throw new ArgumentOutOfRangeException("identifier");
                }
                else
                {
                    NewObj.Identifier = temp;
                }
            }
            return(NewObj);
        }
示例#3
0
        public IEnumerable <lut_city> GetCity(string Identifier)
        {
            try
            {
                CodesDAL codesDAL = new CodesDAL();

                if (string.IsNullOrEmpty(Identifier))
                {
                    return(codesDAL.lut_city_GetAll());
                }
                else
                {
                    lut_city FilterObj = lut_cityConverter.ConvertParams(Identifier);
                    return(codesDAL.lut_city_Filter(FilterObj));
                }
            }
            catch
            {
                throw;
            }
        }