public EmailTemplatesEntity GetFormatEmailPDF(EmailTemplatesEntity template) { EmailTemplatesEntity format = new EmailTemplatesEntity(); string body = GetFileTemplatePDF(); format.Subject = template.Subject; format.Body = body.Replace("[body/]", template.Body); return format; }
public EmailTemplatesEntity GetFormatEmailNewsletter(string body, string product) { EmailTemplatesEntity format = new EmailTemplatesEntity(); string content = GetFileTemplateNewsletter(); format.Subject = ""; format.Body = content.Replace("[body/]", body).Replace("[product/]", product); return format; }
public EmailTemplatesEntity GetFormatEmail(string body) { EmailTemplatesEntity format = new EmailTemplatesEntity(); string content = GetFileTemplate(); format.Subject = ""; format.Body = content.Replace("[body/]", body); return format; }
public bool Delete(Guid Id) { bool toReturn = false; using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter()) { EmailTemplatesEntity _EmailTemplatesEntity = new EmailTemplatesEntity(Id); if (adapter.FetchEntity(_EmailTemplatesEntity)) { adapter.DeleteEntity(_EmailTemplatesEntity); toReturn = true; } } return toReturn; }
protected void btnAdd_Click(object sender, EventArgs e) { if (Page.IsValid) { EmailTemplatesEntity template = new EmailTemplatesEntity(); template.TemplateCode = txtTemplateCode.Text.Trim(); template.TemplateName = txtTemplateName.Text.Trim(); template.Subject = txtSubject.Text.Trim(); template.Body = txtBody.Value; template.CreatedBy = Util.CurrentUserName; template.CreatedDate = DateTime.Now; template.UpdatedBy = Util.CurrentUserName; template.UpdatedDate = DateTime.Now; EmailTemplatesManager.CreateInstant().Insert(template); Response.Redirect("/Admin/EmailTemplates/"); } }
public bool Update(Guid Id, string TemplateCode, string TemplateName, string Subject, string Body, string CreatedBy, DateTime CreatedDate, string UpdatedBy, DateTime UpdatedDate) { bool toReturn = false; using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter()) { EmailTemplatesEntity _EmailTemplatesEntity = new EmailTemplatesEntity(Id); if (adapter.FetchEntity(_EmailTemplatesEntity)) { _EmailTemplatesEntity.TemplateCode = TemplateCode; _EmailTemplatesEntity.TemplateName = TemplateName; _EmailTemplatesEntity.Subject = Subject; _EmailTemplatesEntity.Body = Body; _EmailTemplatesEntity.CreatedBy = CreatedBy; _EmailTemplatesEntity.CreatedDate = CreatedDate; _EmailTemplatesEntity.UpdatedBy = UpdatedBy; _EmailTemplatesEntity.UpdatedDate = UpdatedDate; adapter.SaveEntity(_EmailTemplatesEntity, true); toReturn = true; } } return toReturn; }
public bool Update(EmailTemplatesEntity _EmailTemplatesEntity, RelationPredicateBucket filter) { bool toReturn = false; using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter()) { adapter.UpdateEntitiesDirectly(_EmailTemplatesEntity, filter); toReturn = true; } return toReturn; }
public bool Update(EmailTemplatesEntity _EmailTemplatesEntity) { bool toReturn = false; using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter()) { RelationPredicateBucket filter = new RelationPredicateBucket(); IPredicateExpression _PredicateExpression = new PredicateExpression(); _PredicateExpression.Add(EmailTemplatesFields.Id == _EmailTemplatesEntity.Id); filter.PredicateExpression.Add(_PredicateExpression); adapter.UpdateEntitiesDirectly(_EmailTemplatesEntity, filter); toReturn = true; } return toReturn; }
public EmailTemplatesEntity SelectOne(Guid Id) { EmailTemplatesEntity toReturn = null; using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter()) { EmailTemplatesEntity _EmailTemplatesEntity = new EmailTemplatesEntity(Id); if (adapter.FetchEntity(_EmailTemplatesEntity)) { toReturn = _EmailTemplatesEntity; } } return toReturn; }
public EmailTemplatesEntity Insert(string TemplateCode, string TemplateName, string Subject, string Body, string CreatedBy, DateTime CreatedDate, string UpdatedBy, DateTime UpdatedDate) { EmailTemplatesEntity _EmailTemplatesEntity = new EmailTemplatesEntity(); using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter()) { _EmailTemplatesEntity.TemplateCode = TemplateCode; _EmailTemplatesEntity.TemplateName = TemplateName; _EmailTemplatesEntity.Subject = Subject; _EmailTemplatesEntity.Body = Body; _EmailTemplatesEntity.CreatedBy = CreatedBy; _EmailTemplatesEntity.CreatedDate = CreatedDate; _EmailTemplatesEntity.UpdatedBy = UpdatedBy; _EmailTemplatesEntity.UpdatedDate = UpdatedDate; adapter.SaveEntity(_EmailTemplatesEntity, true); } return _EmailTemplatesEntity; }
public EmailTemplatesEntity Insert(EmailTemplatesEntity _EmailTemplatesEntity) { using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter()) { adapter.SaveEntity(_EmailTemplatesEntity, true); } return _EmailTemplatesEntity; }