Exemplo n.º 1
0
 public bool Insert(EmailTemplate emailtemplate)
 {
     int autonumber = 0;
     EmailTemplateDAC emailtemplateComponent = new EmailTemplateDAC();
     bool endedSuccessfuly = emailtemplateComponent.InsertNewEmailTemplate( ref autonumber,  emailtemplate.SiteId,  emailtemplate.Title,  emailtemplate.TemplateContent);
     if(endedSuccessfuly)
     {
         emailtemplate.EmailTemplateId = autonumber;
     }
     return endedSuccessfuly;
 }
Exemplo n.º 2
0
 public EmailTemplate GetByID(int _emailTemplateId)
 {
     EmailTemplateDAC _emailTemplateComponent = new EmailTemplateDAC();
      IDataReader reader = _emailTemplateComponent.GetByIDEmailTemplate(_emailTemplateId);
      EmailTemplate _emailTemplate = null;
      while(reader.Read())
      {
          _emailTemplate = new EmailTemplate();
          if(reader["EmailTemplateId"] != DBNull.Value)
              _emailTemplate.EmailTemplateId = Convert.ToInt32(reader["EmailTemplateId"]);
          if(reader["SiteId"] != DBNull.Value)
              _emailTemplate.SiteId = Convert.ToInt32(reader["SiteId"]);
          if(reader["Title"] != DBNull.Value)
              _emailTemplate.Title = Convert.ToString(reader["Title"]);
          if(reader["TemplateContent"] != DBNull.Value)
              _emailTemplate.TemplateContent = Convert.ToString(reader["TemplateContent"]);
      _emailTemplate.NewRecord = false;             }             reader.Close();
      return _emailTemplate;
 }
Exemplo n.º 3
0
 public List<EmailTemplate> GetAll()
 {
     EmailTemplateDAC _emailTemplateComponent = new EmailTemplateDAC();
      IDataReader reader =  _emailTemplateComponent.GetAllEmailTemplate().CreateDataReader();
      List<EmailTemplate> _emailTemplateList = new List<EmailTemplate>();
      while(reader.Read())
      {
      if(_emailTemplateList == null)
          _emailTemplateList = new List<EmailTemplate>();
          EmailTemplate _emailTemplate = new EmailTemplate();
          if(reader["EmailTemplateId"] != DBNull.Value)
              _emailTemplate.EmailTemplateId = Convert.ToInt32(reader["EmailTemplateId"]);
          if(reader["SiteId"] != DBNull.Value)
              _emailTemplate.SiteId = Convert.ToInt32(reader["SiteId"]);
          if(reader["Title"] != DBNull.Value)
              _emailTemplate.Title = Convert.ToString(reader["Title"]);
          if(reader["TemplateContent"] != DBNull.Value)
              _emailTemplate.TemplateContent = Convert.ToString(reader["TemplateContent"]);
      _emailTemplate.NewRecord = false;
      _emailTemplateList.Add(_emailTemplate);
      }             reader.Close();
      return _emailTemplateList;
 }
Exemplo n.º 4
0
        public bool Insert( int SiteId,  string Title,  string TemplateContent)
        {
            EmailTemplateDAC emailtemplateComponent = new EmailTemplateDAC();
            int EmailTemplateId = 0;

            return emailtemplateComponent.InsertNewEmailTemplate( ref EmailTemplateId,  SiteId,  Title,  TemplateContent);
        }
Exemplo n.º 5
0
 public void Delete(int Original_EmailTemplateId)
 {
     EmailTemplateDAC emailtemplateComponent = new EmailTemplateDAC();
     emailtemplateComponent.DeleteEmailTemplate(Original_EmailTemplateId);
 }
Exemplo n.º 6
0
 public int UpdateDataset(System.Data.DataSet dataset)
 {
     EmailTemplateDAC emailtemplatecomponent = new EmailTemplateDAC();
     return emailtemplatecomponent.UpdateDataset(dataset);
 }
Exemplo n.º 7
0
 public bool Update( int SiteId,  string Title,  string TemplateContent,  int Original_EmailTemplateId)
 {
     EmailTemplateDAC emailtemplateComponent = new EmailTemplateDAC();
     return emailtemplateComponent.UpdateEmailTemplate( SiteId,  Title,  TemplateContent,  Original_EmailTemplateId);
 }
Exemplo n.º 8
0
 public bool Update(EmailTemplate emailtemplate ,int old_emailTemplateId)
 {
     EmailTemplateDAC emailtemplateComponent = new EmailTemplateDAC();
     return emailtemplateComponent.UpdateEmailTemplate( emailtemplate.SiteId,  emailtemplate.Title,  emailtemplate.TemplateContent,  old_emailTemplateId);
 }