public PeriodType GetPeriodType(int PeriodTypeID)
        {
            var result = new PeriodType();

            var response = GetContext().PeriodTypes
                           .Where(c => c.PeriodTypeID == PeriodTypeID)
                           .FirstOrDefault();

            if (response == null)
            {
                return(null);
            }

            result.PeriodTypeID          = response.PeriodTypeID;
            result.PeriodTypeDescription = response.PeriodTypeDescription;

            return(result);
        }
        public PeriodType GetPeriodType(int PeriodTypeID)
        {
            var result = new PeriodType();

            using (var reader = GetContext().GetReader(@"
                    SELECT
                        *
                    FROM PeriodTypes
                    WHERE PeriodTypeID = {0}
                ", PeriodTypeID))
            {
                if (!reader.Read())
                {
                    return(null);
                }

                result.PeriodTypeID          = reader.GetInt32("PeriodTypeID");
                result.PeriodTypeDescription = reader.GetString("PeriodTypeDescription");
            }

            return(result);
        }
Exemplo n.º 3
0
        public PeriodType GetPeriodType(int PeriodTypeID)
        {
            var result = new PeriodType();

            using (var reader = GetContext().GetReader(@"
                    SELECT
                        *
                    FROM PeriodTypes
                    WHERE PeriodTypeID = {0}
                ", PeriodTypeID))
            {
                if(!reader.Read()) return null;

                result.PeriodTypeID = reader.GetInt32("PeriodTypeID");
                result.PeriodTypeDescription = reader.GetString("PeriodTypeDescription");
            }

            return result;
        }
Exemplo n.º 4
0
        public PeriodType GetPeriodType(int PeriodTypeID)
        {
            var result = new PeriodType();

            var response = GetContext().PeriodTypes
                .Where(c => c.PeriodTypeID == PeriodTypeID)
                .FirstOrDefault();
            if(response == null) return null;

            result.PeriodTypeID = response.PeriodTypeID;
            result.PeriodTypeDescription = response.PeriodTypeDescription;

            return result;
        }