Пример #1
0
 public IList<EmailTemplate> DequeueEmail()
 {
     IList<EmailTemplate> list = new List<EmailTemplate>();
     MySqlParameter[] parameters = new MySqlParameter[0];
     DataSet set = DbHelperMySQL.RunProcedure("sp_Emails_Dequeue", parameters, "ds");
     if (set.Tables[0].Rows.Count > 0)
     {
         foreach (DataRow row in set.Tables[0].Rows)
         {
             EmailTemplate model = new EmailTemplate();
             this.LoadEntityData(ref model, row);
             list.Add(model);
         }
     }
     return list;
 }
Пример #2
0
 private void LoadEntityData(ref EmailTemplate model, DataRow dr)
 {
     if (dr["EmailId"].ToString() != "")
     {
         model.EmailID = int.Parse(dr["EmailId"].ToString());
     }
     if ((dr["EmailTo"] != null) && (dr["EmailTo"].ToString() != ""))
     {
         model.EmailTo = dr["EmailTo"].ToString();
     }
     if ((dr["EmailSubject"] != null) && (dr["EmailSubject"].ToString() != ""))
     {
         model.Subject = dr["EmailSubject"].ToString();
     }
     if ((dr["EmailBody"] != null) && (dr["EmailBody"].ToString() != ""))
     {
         model.Body = dr["EmailBody"].ToString();
     }
 }