Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            lblError.Text = string.Empty;
            lblMsg.Text   = string.Empty;
            if (!IsPostBack)
            {
                CompanyDAL      newCompanyDal = new CompanyDAL();
                IList <Company> companies     = newCompanyDal.GetAllCompany();
                foreach (Company company in companies)
                {
                    ListItem item = new ListItem();
                    item.Text  = company.CompanyName;
                    item.Value = company.CompanyRegID.ToString();
                    ddlCompany.Items.Add(item);
                }

                TAFDAL newTAF = new TAFDAL();
                IList <TAFTemplate> templates = newTAF.GetAllTAFTemplates();
                foreach (TAFTemplate template in templates)
                {
                    ListItem item = new ListItem();
                    item.Text  = template.TemplateName;
                    item.Value = template.TemplateID.ToString();
                    ddlSelectTemplate.Items.Add(item);
                }
            }
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
            gvEmailSchedule.PageSize = PageSize;
            if (!IsPostBack)
            {
                CompanyDAL      newCompanyDal = new CompanyDAL();
                IList <Company> companies     = newCompanyDal.GetAllCompany();
                foreach (Company company in companies)
                {
                    ListItem item = new ListItem();
                    item.Text  = company.CompanyName.Substring(0, company.CompanyName.Length > 45?45:company.CompanyName.Length);
                    item.Value = company.CompanyRegID.ToString();
                    ddlSearchCompany.Items.Add(item);
                }

                TAFDAL newTAF = new TAFDAL();
                IList <TAFTemplate> templates = newTAF.GetAllTAFTemplates();
                foreach (TAFTemplate template in templates)
                {
                    ListItem item = new ListItem();
                    item.Text  = template.TemplateName;
                    item.Value = template.TemplateID.ToString();
                    ddlSearchTemplate.Items.Add(item);
                }
            }
        }
Пример #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (TemplateID > 0)
         {
             TAFDAL      newDal      = new TAFDAL();
             TAFTemplate newTemplate = newDal.GetTAFTemplateByID(TemplateID);
             PopulateTemplate(newTemplate);
         }
         else
         {
             populateImageDropDown();
         }
         TAFDAL newTAF = new TAFDAL();
         IList <TAFTemplate> templates = newTAF.GetAllTAFTemplates();
         foreach (TAFTemplate template in templates)
         {
             ListItem item = new ListItem();
             item.Text  = template.TemplateName;
             item.Value = template.TemplateID.ToString();
             ddlDuplicateTemplate.Items.Add(item);
         }
     }
 }
Пример #4
0
        private void DeleteTemplate(string ID)
        {
            int    templateID = int.Parse(ID);
            TAFDAL newDal     = new TAFDAL();

            newDal.DeleteTemplate(templateID);
            gvEmailTemplate.DataSource = newDal.GetAllTAFTemplates();
            gvEmailTemplate.DataBind();
        }
Пример #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         TAFDAL newDal = new TAFDAL();
         gvEmailTemplate.DataSource = newDal.GetAllTAFTemplates();
         gvEmailTemplate.DataBind();
     }
 }
Пример #6
0
        protected void SaveTemplate()
        {
            TAFTemplate emailTemplate = new TAFTemplate();

            emailTemplate.TemplateID    = TemplateID;
            emailTemplate.TemplateName  = txtTemplate.Text;
            emailTemplate.User          = GetLoggedUser();
            emailTemplate.FromEmail     = txtFromEmail.Text;
            emailTemplate.ReplyToEmail  = txtReplyTo.Text;
            emailTemplate.EmailSubject  = txtEmailSubject.Text;
            emailTemplate.EmailBody     = HTMLEditor1.Text;
            emailTemplate.TemplateImage = ddlImageSelector.SelectedItem.Text;
            TAFDAL newDal = new TAFDAL();

            newDal.SaveTemplate(emailTemplate);
            Response.Redirect("EmailTemplates.aspx");
        }
Пример #7
0
        protected void ddlSelectTemplate_SelectedIndexChanged(object sender, EventArgs e)
        {
            int templateID = 0;

            txtFromEmail.Text    = string.Empty;
            txtEmailSubject.Text = string.Empty;
            HTMLEditor1.Text     = string.Empty;
            int.TryParse(ddlSelectTemplate.SelectedValue, out templateID);
            if (templateID > 0)
            {
                TAFDAL      newTAF   = new TAFDAL();
                TAFTemplate template = newTAF.GetTAFTemplateByID(templateID);
                txtFromEmail.Text    = template.FromEmail;
                txtEmailSubject.Text = template.EmailSubject;
                HTMLEditor1.Text     = template.EmailBody;
            }
        }
Пример #8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         TAFDAL newTAF = new TAFDAL();
         IList <TAFTemplate> templates = newTAF.GetAllTAFTemplates();
         foreach (TAFTemplate template in templates)
         {
             ListItem item = new ListItem();
             item.Text  = template.TemplateName;
             item.Value = template.TemplateID.ToString();
             ddlSelectTemplate.Items.Add(item);
         }
         if (Session["Users"] != null)
         {
             txtUserIDs.Text  = Session["Users"].ToString();
             Session["Users"] = null;
         }
     }
 }
Пример #9
0
        protected void ddlDuplicateTemplate_SelectedIndexChanged(object sender, EventArgs e)
        {
            int templateID = 0;

            int.TryParse(ddlDuplicateTemplate.SelectedValue, out templateID);
            if (templateID > 0)
            {
                TAFDAL      newTAF   = new TAFDAL();
                TAFTemplate template = newTAF.GetTAFTemplateByID(templateID);
                txtFromEmail.Text    = template.FromEmail;
                txtReplyTo.Text      = template.ReplyToEmail;
                txtEmailSubject.Text = template.EmailSubject;
                HTMLEditor1.Text     = template.EmailBody;
            }
            else
            {
                txtFromEmail.Text    = "Happy Birthday <*****@*****.**>";
                txtReplyTo.Text      = "*****@*****.**";
                txtEmailSubject.Text = "Happy Birthday [Name]!";
                HTMLEditor1.Text     = "<img id='GiftCertGraphics' class='imgSelection' src='../Email/images/blank.PNG' alt='Please allow your browser to display the GiftCertificate image' /><p></p>";
            }
        }
Пример #10
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         TAFDAL newTAF = new TAFDAL();
         IList <TAFTemplate> templates = newTAF.GetAllTAFTemplates();
         foreach (TAFTemplate template in templates)
         {
             ListItem item = new ListItem();
             item.Text  = template.TemplateName;
             item.Value = template.TemplateID.ToString();
             ddlSelectTemplate.Items.Add(item);
         }
         if (System.DateTime.Now < System.DateTime.Today.AddHours(5))
         {
             txtSchedularStart.Text = System.DateTime.Today.AddHours(5).ToString();
         }
         else
         {
             txtSchedularStart.Text = System.DateTime.Today.AddDays(1).AddHours(5).ToString();
         }
     }
 }