示例#1
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        myad.clsregister        obj    = new myad.clsregister();
        myad.clsregistrationprp objprp = new myad.clsregistrationprp();
        objprp.email     = txtemail.Text;
        objprp.f_name    = txtf_name.Text;
        objprp.l_name    = txtl_name.Text;
        objprp.address   = txtaddress.Text;
        objprp.password  = txtpassword.Text;
        objprp.contact   = countrycod.Text + "-" + contact.Text;
        objprp.verified  = "Unverified";
        objprp.join_date = DateTime.Now;
        getguid();
        objprp.guid = id;


        try
        {
            obj.save_rec(objprp);
            SendMail(txtemail.Text);
            txtemail.Text   = string.Empty;
            txtf_name.Text  = string.Empty;
            txtl_name.Text  = string.Empty;
            txtaddress.Text = string.Empty;
            contact.Text    = string.Empty;
            id             = "";
            Label1.Visible = true;
            Label1.Text    = "A verification link has been sent to your email.";
        }
        catch (Exception exp)
        {
            //Label2.Visible = true;
            //Label2.Text = "Email Id already registered.";
        }
    }
示例#2
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        myad.clsregister        obj    = new myad.clsregister();
        myad.clsregistrationprp objprp = new myad.clsregistrationprp();
        objprp.email     = txtemail.Text;
        objprp.f_name    = txtf_name.Text;
        objprp.l_name    = txtl_name.Text;
        objprp.address   = txtaddress.Text;
        objprp.password  = txtpassword.Text;
        objprp.contact   = countrycod.Text + "-" + contact.Text;
        objprp.verified  = "Unverified";
        objprp.join_date = DateTime.Now;
        getguid();
        objprp.guid = guid;


        try
        {
            obj.save_rec(objprp);
            try
            {
                CreateMail();
                txtemail.Text   = String.Empty;
                txtf_name.Text  = String.Empty;
                txtl_name.Text  = String.Empty;
                txtaddress.Text = String.Empty;
                contact.Text    = String.Empty;
                guid            = String.Empty;
                success.Visible = true;
                success.Text    = "A verification link has been sent to your email.";
            }
            catch (System.Net.Mail.SmtpException ob)
            {
                error.Visible = true;
                error.Text    = "Network Error!!Check your connectivity!";
                Debug.Write("exp parul " + ob);
            }
        }
        catch (Exception exp)
        {
            error.Visible = true;
            error.Text    = "Email Id already registered.";
        }
    }