Example #1
0
 internal static void MapList(IRecord record, List<SpamKeyword> list)
 {
     SpamKeyword m = new SpamKeyword();
     m.Id = record.GetInt32OrDefault(0, 0);
     m.Keyword = record.GetStringOrEmpty(1);
     m.Status = record.GetInt32OrDefault(2, 0);
     m.AddUserID = record.GetInt32OrDefault(3, 0);
     m.AddDate = record.GetDateTime(4);
     list.Add(m);
 }
Example #2
0
        internal static int SetSpamKeyword(SpamKeyword keyword)
        {
            if (keyword == null) return -1;

            SafeProcedure.ExecuteNonQuery(
             Database.GetDatabase(D4DDefine.DBInstanceName),
             "dbo.SpamKeywords_Set",
             delegate(IParameterSet parameters)
             {
                 parameters.AddWithValue("@Id", keyword.Id);
                 parameters.AddWithValue("@Keyword", keyword.Keyword);
                 parameters.AddWithValue("@Status", keyword.Status);
                 parameters.AddWithValue("@AddUserId", keyword.AddUserID);
                 parameters.AddWithValue("@RetVal", DBNull.Value, ParameterDirectionWrap.ReturnValue);

             },
             delegate(IParameterSet outputParameters)
             {
                 keyword.Id = Convert.ToInt32(outputParameters.GetValue("@RetVal"));
             });

            return keyword.Id;
        }
Example #3
0
 public int SetSpamKeyword(SpamKeyword keyword)
 {
     return SpamKeywordDao.SetSpamKeyword(keyword);
 }