Ejemplo n.º 1
0
    protected void btnSubscription_Click(object sender, EventArgs e)
    {
        objDAEntities.Email = txtemail.Text.Trim();
        JaslokMailer objMailer = new JaslokMailer();

        objBusinessLogic.AddJaslokTimesSubscription(objDAEntities);
        List <Parameters> lstParameters = new List <Parameters>();

        lstParameters.Add(new Parameters {
            ShortCodeName = "email", ShortCodeValue = txtemail.Text.Trim()
        });

        DataSet ds = new DataSet();

        ds = (DataSet)objBusinessLogic.GetFormsEmailDetail((int)AppGlobal.JaslokEmailHandler.EmailFormJasloktimesSubscribe);

        string EmailToId = Convert.ToString(ds.Tables[0].Rows[0]["EmailToId"]);
        string EmailCCId = Convert.ToString(ds.Tables[0].Rows[0]["EmailCCId"]);

        objMailer.SendEmail("jasloktimes", lstParameters, EmailToId, EmailCCId);
        objMailer.SendEmail("jasloktimes_user", lstParameters, objDAEntities.Email, EmailCCId);

        string message = "You have subscribe Successfully!";

        //dialog.Visible = true;
        //Page.ClientScript.RegisterStartupScript(this.GetType(), "Popup", "ShowPopup('" + message + "');", true);
        ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('You have subscribe Successfully!!!');", true);
        txtemail.Text = "";



        //ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('You have subscribe Successfully!!!');", true);
    }