public long insert(Long eventID,String ruleName,String ruleDesc,Boolean enabled){
  if (eventID == null || ruleName == null || ruleDesc == null || enabled == null) {
    throw new IllegalArgumentException("insert parameter null.");
  }
  SimpleDateFormat dateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  String insertTime=dateFormat.format(new Timestamp(System.currentTimeMillis()));
  ContentValues initialValues=new ContentValues();
  initialValues.put(KEY_EVENTID,eventID);
  initialValues.put(KEY_RULENAME,ruleName);
  initialValues.put(KEY_RULEDESC,ruleDesc);
  initialValues.put(KEY_ENABLED,enabled);
  initialValues.put(KEY_CREATED,insertTime);
  initialValues.put(KEY_UPDATED,insertTime);
  initialValues.put(KEY_NOTIFICATION,notification);
  return database.insert(DATABASE_TABLE,null,initialValues);
}

public long insert ( Long eventID , String ruleName , String ruleDesc , Boolean enabled ) { if ( eventID == null || ruleName == null || ruleDesc == null || enabled == null ) { throw new IllegalArgumentException ( "insert parameter null." ) ; } SimpleDateFormat dateFormat = new SimpleDateFormat ( "yyyy-MM-dd HH:mm:ss" ) ; String insertTime = dateFormat . format ( new Timestamp ( System . currentTimeMillis ( ) ) ) ; ContentValues initialValues = new ContentValues ( ) ; initialValues . put ( KEY_EVENTID , eventID ) ; initialValues . put ( KEY_RULENAME , ruleName ) ; initialValues . put ( KEY_RULEDESC , ruleDesc ) ; initialValues . put ( KEY_ENABLED , enabled ) ; initialValues . put ( KEY_CREATED , insertTime ) ; initialValues . put ( KEY_UPDATED , insertTime ) ; initialValues . put ( KEY_NOTIFICATION , notification ) ; return database . insert ( DATABASE_TABLE , null , initialValues ) ; }
insert a new rule record .
