Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
 public EmailTemplatesEntity GetFormatEmail(string body)
 {
     EmailTemplatesEntity format = new EmailTemplatesEntity();
     string content = GetFileTemplate();
     format.Subject = "";
     format.Body = content.Replace("[body/]", body);
     return format;
 }
Ejemplo n.º 4
0
 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;
 }
Ejemplo n.º 5
0
    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/");
        }
    }
Ejemplo n.º 6
0
        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;
        }
Ejemplo n.º 7
0
 public bool Update(EmailTemplatesEntity _EmailTemplatesEntity, RelationPredicateBucket filter)
 {
     bool toReturn = false;
     using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
     {
         adapter.UpdateEntitiesDirectly(_EmailTemplatesEntity, filter);
         toReturn = true;
     }
     return toReturn;
 }
Ejemplo n.º 8
0
        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;
        }
Ejemplo n.º 9
0
 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;
 }
Ejemplo n.º 10
0
        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;
        }
Ejemplo n.º 11
0
 public EmailTemplatesEntity Insert(EmailTemplatesEntity _EmailTemplatesEntity)
 {
     using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
     {
         adapter.SaveEntity(_EmailTemplatesEntity, true);
     }
     return _EmailTemplatesEntity;
 }