当前位置: 首页>>代码示例>>C#>>正文


C# DataLayer.EmailExists方法代码示例

本文整理汇总了C#中DataLayer.EmailExists方法的典型用法代码示例。如果您正苦于以下问题:C# DataLayer.EmailExists方法的具体用法?C# DataLayer.EmailExists怎么用?C# DataLayer.EmailExists使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataLayer的用法示例。


在下文中一共展示了DataLayer.EmailExists方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: btnSubmit_Click

    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        DataLayer dl = new DataLayer();
        if (dl.EmailExists(tbxEmail.Text))
        {
            string sPassword = dl.GetMemberBy_Email(tbxEmail.Text).Rows[0].ItemArray[1].ToString();

            SmtpMail.SmtpServer = "relay-hosting.secureserver.net";
            MailMessage mm;

            mm = new MailMessage();
            mm.BodyFormat = MailFormat.Html;
            mm.To = tbxEmail.Text;
            mm.From = "[email protected]";
            mm.Subject = "Your password for ReferralNetworX.com";
            mm.Body = "You requested to have your password sent to you. It is listed below.<br /><br />Username: " + tbxEmail.Text + "<br />Password: " + sPassword;

            SmtpMail.Send(mm);

            Session["resultColor"] = "#007700";
            Session["resultTitle"] = "Password Sent";
            Session["resultMessage"] = "Your password has been sent to your email.";
            Session["resultReturnURL"] = "Default.aspx";
            Response.Redirect("Result.aspx", true);
        }
        else
        {
            Session["resultColor"] = "#ff0000";
            Session["resultTitle"] = "Email Not Found";
            Session["resultMessage"] = "The email you provided was not found.";
            Session["resultReturnURL"] = "Default.aspx";
            Response.Redirect("Result.aspx", true);
        }
    }
开发者ID:chevex-archived,项目名称:ReferralNetworX,代码行数:34,代码来源:ForgotPassword.aspx.cs

示例2: btnSumbit_Click

 protected void btnSumbit_Click(object sender, EventArgs e)
 {
     DataLayer dl = new DataLayer();
     DataTable dtMember = dl.GetMemberBy_Email(User.Identity.Name);
     if (tbxPassword.Text == dtMember.Rows[0].ItemArray[1].ToString())
     {
         if (!dl.EmailExists(tbxEmail.Text))
         {
             string sPersonalAvatar = dtMember.Rows[0].ItemArray[3].ToString();
             string sBusinessLogo = dtMember.Rows[0].ItemArray[9].ToString();
             if (sPersonalAvatar != "no_avatar.gif")
             {
                 string sExt = sPersonalAvatar.Remove(0, sPersonalAvatar.LastIndexOf('.'));
                 string sNewPersonalAvatar = tbxEmail.Text + sExt;
                 if (File.Exists(MapPath("~/images/MemberAvatars/" + sNewPersonalAvatar)))
                     File.Delete(MapPath("~/images/MemberAvatars/" + sNewPersonalAvatar));
                 File.Move(MapPath("~/images/MemberAvatars/" + sPersonalAvatar), MapPath("~/images/MemberAvatars/" + sNewPersonalAvatar));
                 sPersonalAvatar = sNewPersonalAvatar;
             }
             if (sBusinessLogo != "no_logo.gif")
             {
                 string sExt = sBusinessLogo.Remove(0, sBusinessLogo.LastIndexOf('.'));
                 string sNewBusinessLogo = tbxEmail.Text + sExt;
                 if (File.Exists(MapPath("~/images/BusinessLogos/" + sNewBusinessLogo)))
                     File.Delete(MapPath("~/images/BusinessLogos/" + sNewBusinessLogo));
                 File.Move(MapPath("~/images/BusinessLogos/" + sBusinessLogo), MapPath("~/images/BusinessLogos/" + sNewBusinessLogo));
                 sBusinessLogo = sNewBusinessLogo;
             }
             FormsAuthentication.SignOut();
             dl.UpdateMemberEmail(User.Identity.Name, tbxEmail.Text, sPersonalAvatar, sBusinessLogo);
             FormsAuthentication.SetAuthCookie(tbxEmail.Text, false);
             Session["resultColor"] = "#007700";
             Session["resultTitle"] = "Email Changed";
             Session["resultMessage"] = "Your email has been updated.";
             Session["resultReturnURL"] = "Profile.aspx";
             Response.Redirect("Result.aspx", true);
         }
         else
         {
             Session["resultColor"] = "#ff0000";
             Session["resultTitle"] = "Email Exists";
             Session["resultMessage"] = "The email you provided is already in use.";
             Session["resultReturnURL"] = "ChangeEmail.aspx";
             Response.Redirect("Result.aspx", true);
         }
     }
     else
     {
         CustomValidator1.IsValid = false;
     }
 }
开发者ID:chevex-archived,项目名称:ReferralNetworX,代码行数:51,代码来源:ChangeEmail.aspx.cs

示例3: lbtnLogin_Click

 protected void lbtnLogin_Click(object sender, EventArgs e)
 {
     string sEmail = tbxLoginEmail.Text;
     DataLayer dl = new DataLayer();
     if (dl.EmailExists(sEmail))
     {
         string sPassword = dl.GetMemberPasswordBy_Email(sEmail);
         string sName = dl.GetMemberNameBy_Email(sEmail);
         if (tbxLoginPassword.Text == sPassword)
         {
             FormsAuthentication.SetAuthCookie(sEmail, cbxRememberMe.Checked);
             if (sEmail.ToUpper() != "[email protected]")
             {
                 dl.UpdateLastLogin(sEmail);
             }
             loginpanel.Visible = false;
             memberpanel.Visible = true;
             archivespanel.Visible = true;
             directorypanel.Visible = true;
             nonmemberdirectorypanel.Visible = false;
             membername.InnerHtml = "<a class=\"titlelink\" href=\"Profile.aspx\">" + sName + "</a>";
             if (dl.IsMemberAdmin(sEmail))
             {
                 adminpanel.Visible = true;
             }
             Response.Redirect(Request.RawUrl);
         }
         else
         {
             failfield.Visible = true;
             failfield.InnerText = "Invalid email or password.";
         }
     }
     else
     {
         failfield.Visible = true;
         failfield.InnerText = "Invalid email or password.";
     }
 }
开发者ID:chevex-archived,项目名称:ReferralNetworX,代码行数:39,代码来源:Template.master.cs

示例4: btnSubmit_Click

    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        this.Validate("signup");
        if (Page.IsValid)
        {
            if (cbxAgree.Checked)
            {
                DataLayer dl = new DataLayer();
                if (!dl.EmailExists(tbxEmail.Text))
                {

                    //SmtpClient smtp = new SmtpClient("localhost");

                    //MailMessage mm;

                        dl.AddMember(tbxEmail.Text, tbxPassword.Text, tbxName.Text, "no_avatar.gif", "", "", "", "", "", "no_logo.gif", "", DateTime.Now, "", "", "", "", "", "", false, false, false, true, true, false, false, "", "", "Not Specified", 0, DateTime.Now, "Not Selected", "#77BB77,#ffffff,#DDFFDD,#444444,#1985b5,#77BB77,#ffffff,#ffffff,#000000,#0000EE,#CCDDCC", "None", "", "");

                        #region -= Add Comments to New Member Profile =-

                        int iPerson = rand.Next(2);
                        if (iPerson == 0)
                        {
                            int iComment = rand.Next(10);
                            string sComment = "";
                            if (iComment == 0)
                            {
                                sComment = "Welcome to the site! I hope you like what you find.<br /><br />- Alex";
                            }
                            else if (iComment == 1)
                            {
                                sComment = "Welcome to Referral NetworX! We are glad to have you as a member.<br /><br />- Alex";
                            }
                            else if (iComment == 2)
                            {
                                sComment = "I love seeing new faces! Welcome to the site.<br /><br />- Alex";
                            }
                            else if (iComment == 3)
                            {
                                sComment = "Welcome to the site! I look forward to networking with you.<br /><br />- Alex";
                            }
                            else if (iComment == 4)
                            {
                                sComment = "A new member! I am excited that you have joined us!<br /><br />- Alex";
                            }
                            else if (iComment == 5)
                            {
                                sComment = "Welcome to the site! We are excited to benefit from the knowledge you have to offer!<br /><br />- Alex";
                            }
                            else if (iComment == 6)
                            {
                                sComment = "We are excited to have you here! I am confident you will make a great addition to the RNX community!<br /><br />- Alex";
                            }
                            else if (iComment == 7)
                            {
                                sComment = "Glad you could join us! I look forward to networking with you.<br /><br />- Alex";
                            }
                            else if (iComment == 8)
                            {
                                sComment = "I am happy you decided to be a part of Referral NetworX! Here is your first thumbs up!<br /><br />- Alex";
                            }
                            else if (iComment == 9)
                            {
                                sComment = "Welcome to ReferralNetworX.com! Let me know if you need anything at all!<br /><br />- Alex";
                            }

                            dl.AddComment("[email protected]", DateTime.Now, sComment, "Member", true, -1, tbxEmail.Text);
                            dl.AddThumbsUp(tbxEmail.Text);

                            //mm = new MailMessage();
                            //mm.IsBodyHtml = true;
                            //mm.To.Add(tbxEmail.Text);
                            //mm.From = new MailAddress("[email protected]");
                            //mm.Subject = "Someone posted a comment on your profile!";
                            //mm.Body = "Alex Ford posted a comment on your profile.";
                            //mm.Body += "<br /><a href=\"http://www.referralnetworx.com/profile.aspx?member=" + tbxEmail.Text + "\">Click to view</a>";
                            //smtp.Send(mm);
                        }
                        else if (iPerson == 1)
                        {
                            int iComment = rand.Next(6);
                            string sComment = "";
                            if (iComment == 0)
                            {
                                sComment = "Hi and welcome to Referral NetworX! Our mission is your success!<br /><br />- Walt";
                            }
                            else if (iComment == 1)
                            {
                                sComment = "Welcome to Referral NetworX! I am really looking forward to networking with you. Here's to you continued success!<br /><br />- Walt";
                            }
                            else if (iComment == 2)
                            {
                                sComment = "Its great to have you as a member of Referral NetworX! We are here to help you with your continued success!<br /><br />- Walt";
                            }
                            else if (iComment == 3)
                            {
                                sComment = "Congratulations! You are now a member of Referral NetworX. Our mission is your success!<br /><br />- Walt";
                            }
                            else if (iComment == 4)
                            {
                                sComment = "Welcome! Referral NetworX is your beginning to expanding your personal network! Relationship, Relationship, Relationship!<br /><br />- Walt";
//.........这里部分代码省略.........
开发者ID:chevex-archived,项目名称:ReferralNetworX,代码行数:101,代码来源:SignUp.aspx.cs


注:本文中的DataLayer.EmailExists方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。