protected void btnforget_Click(object sender, EventArgs e)
    {
        using (PhotoProcessingDataContext dataDB = new PhotoProcessingDataContext())
        {
            var counter = from a in dataDB.Photo_CustomerRegistrationDetails where a.Email == txtEmail.Text select a;

            if (counter.Count()==1)
            {
                var getval = counter.FirstOrDefault();
                EncryptedQueryString args = new EncryptedQueryString();
                args["arg1"] = txtEmail.Text;
                string url = string.Format("http://*****:*****@gmail.com");
                msg.To.Add(txtEmail.Text);
                msg.Subject = "Activation Mail From icons";
                StringBuilder sb = new StringBuilder();
                sb.Append("<table><tr><td colspan='2'>Hi,&nbsp;" +getval.Full_Name + "</td></tr><tr><td colspan='2'></td></tr><tr><td colspan='2'>Thank you for registering with us! .</td></tr><tr><td colspan='2'></td></tr><tr><td colspan='2'>Click on the link below to activate your account:</td></tr><tr><td colspan='2'></td></tr><tr><td>Login URL :</td><td>" + url + "</td></tr><tr><td colspan='2'></td></tr><tr><td colspan='2'>Click is not possible means&nbsp;<a href=" + url + ">click here</a></td></tr><tr><td colspan='2'></td></tr><tr><td>Account Detail:</td></tr><tr><td colspan='2'></td></tr><tr><td colspan='2'><table><tr><td>   Email:</td><td>" + txtEmail.Text + "</td></tr></table></td></tr><tr><td colspan='2'></td></tr><tr><td colspan='2'>Thank you,</td></tr><tr><td colspan='2'>Edit My Photos</td></tr><tr><td colspan='2'>www.i-constech.com</td></tr></table>");
                msg.Body = sb.ToString();
                msg.IsBodyHtml = true;
                msg.Priority = MailPriority.High;
                MailSender ms = new MailSender();
                ms.SendMailUsingGmail(msg);
                lbResponse.ForeColor = System.Drawing.ColorTranslator.FromHtml("#006600");
                lbResponse.Text = "Password Link sent to your Mail Id!";
            }
            else
            {
                lbResponse.ForeColor = System.Drawing.ColorTranslator.FromHtml("#CC0000");
                lbResponse.Text = "Invalid Email Id!";
            }
        }
    }
 protected void btnRegister_Click(object sender, EventArgs e)
 {
     lbResponse.Text = string.Empty;
     //System.Threading.Thread.Sleep(100000000);
     if (cbterms.Checked)
     {
         int a = 0;
         if (cbsubscription.Checked)
         {
             a = 1;
         }
         using (PhotoProcessingDataContext dataDB = new PhotoProcessingDataContext())
         {
             string path = "~/Images/Profile/default_person.jpg";
             var counter = from b in dataDB.Photo_CustomerRegistrationDetails where b.Email == txtEmail.Text select b;
             if (counter.Count() == 0)
             {
                 Photo_CustomerRegistrationDetailBL obj = new Photo_CustomerRegistrationDetailBL(0, txtEmail.Text, txtPassword.Text, 0, path, txtFullName.Text, 1, 0, a, a, DateTime.Now, DateTime.MaxValue, DateTime.MaxValue, 0, 0);
                 if (obj.Insert())
                 {
                     EncryptedQueryString args = new EncryptedQueryString();
                     args["arg1"] = txtEmail.Text;
                     string url = string.Format("http://*****:*****@gmail.com");
                     msg.To.Add(txtEmail.Text);
                     msg.Subject = "Activation Mail From icons";
                     StringBuilder sb = new StringBuilder();
                     sb.Append("<table><tr><td colspan='2'>Hi,&nbsp;" + txtFullName.Text + "</td></tr><tr><td colspan='2'></td></tr><tr><td colspan='2'>Thank you for registering with us! .</td></tr><tr><td colspan='2'></td></tr><tr><td colspan='2'>Click on the link below to activate your account:</td></tr><tr><td colspan='2'></td></tr><tr><td>Login URL :</td><td>" + url + "</td></tr><tr><td colspan='2'></td></tr><tr><td colspan='2'>Click is not possible means&nbsp;<a href=" + url + ">click here</a></td></tr><tr><td colspan='2'></td></tr><tr><td>Account Detail:</td></tr><tr><td colspan='2'></td></tr><tr><td colspan='2'><table><tr><td>   Email:</td><td>" + txtEmail.Text + "</td></tr><tr><td>Password:</td><td>" + txtPassword.Text + "</td></tr></table></td></tr><tr><td colspan='2'></td></tr><tr><td colspan='2'>Thank you,</td></tr><tr><td colspan='2'>Edit My Photos</td></tr><tr><td colspan='2'>www.i-constech.com</td></tr></table>");
                     msg.Body = sb.ToString();
                     msg.IsBodyHtml = true;
                     msg.Priority = MailPriority.High;
                     MailSender ms = new MailSender();
                     ms.SendMailUsingGmail(msg);
                     lbResponse.Text = "Validation mail send to your Id. Please, Check to activate your account...!";
                     emptyfield();
                 }
             }
             else
             {
                 lbResponse.ForeColor = System.Drawing.ColorTranslator.FromHtml("#ff6230");
                 lbResponse.Text = "Email Id Already exist!";
             }
         }
     }
     else
     {
         lbResponse.ForeColor = System.Drawing.ColorTranslator.FromHtml("#ff6230");
         lbResponse.Text = "Check the terms & conditions";
     }
 }
 protected void btnReset_Click(object sender, EventArgs e)
 {
     using (PhotoProcessingDataContext dataDB = new PhotoProcessingDataContext())
     {
         var counter = from a in dataDB.Photo_CustomerRegistrationDetails where a.Email == login_id select a;
         var update = counter.FirstOrDefault();
         Photo_Change_Password_logBL obj = new Photo_Change_Password_logBL(txtNewpassword.Text, update.Password, DateTime.Now, update.Customer_id);
         obj.Insert();
         update.Password = txtNewpassword.Text;
         dataDB.SubmitChanges();
         lbResponse.Text = "Reset Successfully!";
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         using (PhotoProcessingDataContext dataDB = new PhotoProcessingDataContext())
         {
             var emailsub = (from a in dataDB.Photo_CustomerRegistrationDetails where a.Email == Session["email"] select a).FirstOrDefault();
             if (emailsub.ActivationStatus_Mail == 1)
             {
                 cbEmailPrefer.Checked = true;
             }
             else
             {
                 cbEmailPrefer.Checked = false;
             }
         }
     }
 }
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
         string Path = "";
         using (PhotoProcessingDataContext dataDB = new PhotoProcessingDataContext())
         {
             var UpdateRegDetail = (from a in dataDB.Photo_CustomerRegistrationDetails where a.Email == Session["email"] select a).FirstOrDefault();
             if (fuProfileImage.HasFile)
            {
                 if (Request.ContentLength < 2097152)
                 {
                     string filename = fuProfileImage.FileName;


                     string[] a = filename.Split('.');
                     if (a[1] == "gif" || a[1] == "png" || a[1] == "jpg")
                     {
                         Path = "~/Images/Profile/" + UpdateRegDetail.Customer_id + fuProfileImage.FileName;
                         fuProfileImage.SaveAs(Server.MapPath(Path));
                         UpdateRegDetail.Profile_Image = Path;
                     }
                     else
                     {
                         lbResponse.Text = "Invalid Format!";
                     }

                 }
                 else
                 {
                     lbResponse.Text = "File size should be less then 2mb!";

                 }
            }
             UpdateRegDetail.Mobile = Convert.ToInt64(txtMobile.Text);
             UpdateRegDetail.DOB = Convert.ToDateTime(txtDOB.Text);
             UpdateRegDetail.Country = 1;
             UpdateRegDetail.Email_Subs = 0;

             if (cbEmailPrefer.Checked)
             {
                 UpdateRegDetail.Email_Subs = 1;
             }
             dataDB.SubmitChanges();
         }
    }
示例#6
0
    protected void btnLogin_Click(object sender, EventArgs e)
    {
        
        using (PhotoProcessingDataContext dataDB = new PhotoProcessingDataContext())
        {
            var counter = from a in dataDB.Photo_CustomerRegistrationDetails where a.Email == txtEmail.Text && a.Password == txtPassword.Text select a;
            if (counter.Count() == 1)
            {
                var checkAcivation = counter.FirstOrDefault();
                if (checkAcivation.ActivationStatus_Mail==1)
                {
                    //ContentPlaceHolder ph = (ContentPlaceHolder)Page.Master.FindControl("ContentPlaceHolder1");
                    
                    //FormView fv = (FormView)ph.FindControl("form1");
                    //UpdatePanel up = (UpdatePanel)fv.FindControl("UpdatePanel1");
                    //LinkButton lbtnLoginfind = (LinkButton)up.FindControl("lbtnLogin");
                    //LinkButton lbtnLogoutfind = (LinkButton)up.FindControl("lbtnLogout");
                    //lbtnLogoutfind.Visible = true;
                    //lbtnLoginfind.Visible = false;
                   

                    Session["username"] = checkAcivation.Full_Name;
                    Session["email"]=checkAcivation.Email;
                    var lastlogin = (from a in dataDB.Photo_CustomerRegistrationDetails where a.Customer_id == checkAcivation.Customer_id select a).FirstOrDefault();
                    lastlogin.Last_Login = DateTime.Now;
                    dataDB.SubmitChanges();
                    Response.Redirect("Home.aspx");
                   

                }
                else
                {
                    lbResponse.ForeColor = System.Drawing.ColorTranslator.FromHtml("#006600");
                    lbResponse.Text = "We had sent mail to your Email Id Verify it..!";
                }
            }
            else
            {
                lbResponse.Text = "Invalid Login!";
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            try
            {
                string login_id = string.Empty;
                EncryptedQueryString args = new EncryptedQueryString(Request.QueryString["args"]);
                foreach (var arg in args)
                {
                    Label label = new Label();
                    label.Text = String.Format("{0}={1}", arg.Key, HttpUtility.HtmlEncode(arg.Value));
                    login_id = label.Text;
                }
                if (login_id == "")
                {
                    throw new Exception("Invalid User!");
                }
                string[] b = login_id.Split('=');
                login_id = b[1];
                using (PhotoProcessingDataContext dataDB = new PhotoProcessingDataContext())
                {
                    var account = (from a in dataDB.Photo_CustomerRegistrationDetails where a.Email == login_id select a).FirstOrDefault();
                    account.ActivationStatus_Mail = 1;
                    dataDB.SubmitChanges();
                    lbResponse.Text = "Your Account activated successfully!";
                }
            }
            catch (Exception ex)
            {
                lbResponse.ForeColor = System.Drawing.ColorTranslator.FromHtml("#CC0000");
                lbResponse.Text = ex.Message;

            }

        }
    }