コード例 #1
0
 protected override void Validation()
 {
     theMail             = new WelcomeMail(_Content, _EnableAutoSend);
     theMail.TheMailType = MailType.GetById(_MailTypeId);
     if (_MailTypeId.Equals(MailType.WelcomeMail.Id))
     {
         theMail.VaildateTheContent();
     }
 }
コード例 #2
0
        public WelcomeMail GetLastestWelcomeMailByTypeID(int mailTypeId)
        {
            SqlCommand cmd = new SqlCommand();

            cmd.Parameters.Add(_MailType, SqlDbType.Int).Value = mailTypeId;
            using (SqlDataReader sdr = SqlHelper.ExecuteReader("GetLastestWelcomeMailByTypeID", cmd))
            {
                while (sdr.Read())
                {
                    bool        enableAutoSend = int.Parse(sdr[_DBEnableAutoSend].ToString()) > 0 ? true : false;
                    WelcomeMail theObj         = new WelcomeMail(sdr[_DBContent].ToString(), enableAutoSend);
                    theObj.Id          = int.Parse(sdr[_DBPKID].ToString());
                    theObj.TheMailType = MailType.GetById(mailTypeId);
                    return(theObj);
                }
                return(null);
            }
        }