Ejemplo n.º 1
0
        //
        // Select by ID
        public static FAQ GetById(int Id)
        {
            FAQ p = new FAQ();

            DataProvider.ExecuteCmd(GetConnection, "dbo.Faqs_SelectById"
               , inputParamMapper: delegate (SqlParameterCollection paramCollection)

               { paramCollection.AddWithValue("@Id", Id); }

               , map: delegate (IDataReader reader, short set)
               {

                    p = mapFaq(reader);
               }
               );

            return p;
        }
Ejemplo n.º 2
0
        private static FAQ mapFaq(IDataReader reader)
        {
            FAQ p = new FAQ();
            int startingIndex = 0; //startingOrdinal

            p.Id = reader.GetSafeInt32(startingIndex++);
            p.SortOrder = reader.GetSafeInt32(startingIndex++);
            p.Question = reader.GetSafeString(startingIndex++);
            p.Answer = reader.GetSafeString(startingIndex++);
            p.Category = reader.GetSafeInt32(startingIndex++);
            p.DateAdded = reader.GetSafeDateTime(startingIndex++);
            p.DateModified = reader.GetSafeDateTime(startingIndex++);
            p.LanguageCode = reader.GetSafeString(startingIndex++);
            p.userId = reader.GetSafeString(startingIndex++);
            return p;
        }