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


C# DataLayer.GetMemberNameBy_Email方法代码示例

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


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

示例1: 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

示例2: btnSubmit_Click


//.........这里部分代码省略.........
                {
                    sComment = "Welcome to Referral NetworX! Your journey to building quality relationships and expanding your network has begun!<br /><br />- Walt";
                }

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

                mm = new MailMessage();
                mm.BodyFormat = MailFormat.Html;
                mm.To = tbxEmail.Text;
                mm.From = "[email protected]";
                mm.Subject = "Someone posted a comment on your profile!";
                mm.Body = "Walt 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>";
                SmtpMail.Send(mm);
            }

            //////////////////////////////////////////////////////////////

            mm = new MailMessage();
            mm.BodyFormat = MailFormat.Html;
            mm.To = "[email protected];[email protected]";
            mm.From = "[email protected]";
            mm.Subject = "Someone signed up on ReferralNetworX.com!";
            mm.Body = tbxName.Text + " signed up on ReferralNetworX.com.";
            mm.Body += "<br /><br /><a href=\"http://www.referralnetworx.com/profile.aspx?member=" + tbxEmail.Text + "\">Click to view</a>";
            SmtpMail.Send(mm);

            mm = new MailMessage();
            mm.BodyFormat = MailFormat.Html;
            mm.To = tbxEmail.Text;
            mm.From = "[email protected]";
            mm.Subject = "Welcome to ReferralNetworX.com!";
            mm.Body = "Welcome " + dl.GetMemberNameBy_Email(tbxEmail.Text) + ",<br /><br />";
            mm.Body += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;We are dedicated to helping you and your business succeed. I truly hope RNX helps you to grow to new heights and accomplish your goals. I am confident that you will provide a lot of value to the RNX community and that your knowledge will benefit everyone! Please <a href=\"http://www.referralnetworx.com/referralnetworx/Topic.aspx?topic=50\">visit our forums to say hi</a> to fellow members and get to know everyone. Also, be sure to log in and edit your profile. The more information you provide about yourself and your business, the more you will get noticed and more opportunities will be presented to you.<br /><br />Here is your username and temporary password:<br />Password - " + iPassword.ToString() + " (You can change this after logging in)<br />Username - " + tbxEmail.Text + "<br /><br />Alex Ford<br />Referral NetworX Administrator";
            SmtpMail.Send(mm);

            try
            {
                dl.DeleteNonMember(tbxEmail.Text);
            }
            catch { }

            Session["resultColor"] = "#007700";
            Session["resultTitle"] = "Member Added";
            Session["resultMessage"] = "Member Added Successfuly";
            Session["resultReturnURL"] = "ManageMembers.aspx";
            Response.Redirect("Result.aspx");
        }
        else
        {
            if (cbxDeleteMember.Checked)
            {
                DataLayer dl = new DataLayer();
                dl.DeleteMember(lbxMembers.SelectedValue);
                Session["resultColor"] = "#007700";
                Session["resultTitle"] = "Member Deleted";
                Session["resultMessage"] = "Member Deleted Successfuly";
                Session["resultReturnURL"] = "ManageMembers.aspx";
                Response.Redirect("Result.aspx");
            }
            else
            {
                DataLayer dl = new DataLayer();
                DataTable dt = dl.GetMemberBy_Email(lbxMembers.SelectedValue);
                string sTwitterFeedStyles = dt.Rows[0].ItemArray[32].ToString();
开发者ID:chevex-archived,项目名称:ReferralNetworX,代码行数:67,代码来源:ManageMembers.aspx.cs

示例3: SendEmails

    protected void SendEmails()
    {
        try
        {
            SmtpClient smtp = new SmtpClient("localhost");
            MailMessage mm;
            DataLayer dl = new DataLayer();
            DataTable dt = dl.GetAllMotivatorSubscribedMembers();
            DataTable dt2 = dl.GetAllMotivatorSubscribedNonMembers();
            DataTable dtMotivator = dl.GetLastUnSentDailyMotivator();
            int iDailyMotivatorID = Convert.ToInt32(dtMotivator.Rows[0].ItemArray[0]);
            dl.MarkDailyMotivatorSent(iDailyMotivatorID);
            dl.UpdateLastMotivatorDate(DateTime.Now);

            ArrayList alFail = new ArrayList();
            foreach (DataRow dr in dt.Rows)
            {
                try
                {
                    mm = new MailMessage();
                    mm.IsBodyHtml = true;
                    mm.To.Add(dr.ItemArray[1].ToString());
                    mm.From = new MailAddress("[email protected]");
                    mm.Subject = dtMotivator.Rows[0].ItemArray[3].ToString();
                    mm.Body = "<div style=\"width: 790px; background-color: #333333; padding: 5px; border: solid 1px #333333;\"><a href=\"http://www.ReferralNetworX.com\"><img style=\"height: 125px; border-width:0px;\" src=\"http://www.referralnetworx.com/MakeThumbnail.aspx?size=237&image=images/networking.jpg\" /><img style=\"border-width:0px;\" src=\"http://www.referralnetworx.com/images/banner.jpg\" /></a></div>";
                    mm.Body += "<div style=\"width: 770px; background-color: #ddeedd; padding: 15px; border: solid 1px #333333;\"><div style=\"font-size:35px;text-align:center;margin-bottom:10px;\">Daily Motivator</div>";
                    string sName = dl.GetMemberNameBy_Email(dr.ItemArray[1].ToString());
                    mm.Body += "Hello " + sName + ",<br /><br />";
                    string sYouTubeLink = dtMotivator.Rows[0].ItemArray[5].ToString();
                    if (sYouTubeLink != "No Video.")
                    {
                        mm.Body += "<h1 style=\"text-align:center;\"><a href=\"" + sYouTubeLink + "\">Click Here to Watch The Video Motivator</a></h1>";
                    }
                    mm.Body += dtMotivator.Rows[0].ItemArray[4].ToString();
                    mm.Body += "<h2 style=\"text-align:center;\"><a href=\"http://www.ReferralNetworX.com\">Visit ReferralNetworX.com!</a></h2>";
                    mm.Body += "</div>";
                    int iCount = 0;
                    bool bLoop = true;
                    while (bLoop)
                    {
                        try
                        {
                            smtp.Send(mm);
                            bLoop = false;
                        }
                        catch (Exception ex)
                        {
                            System.Threading.Thread.Sleep(1000);
                            iCount++;
                            if (iCount >= 3)
                            {
                                alFail.Add(dr.ItemArray[0].ToString() + " - FAILED ON SEND");
                                alFail.Add(ex.ToString());
                                bLoop = false;
                            }
                        }
                    }
                }
                catch (Exception ex2)
                {
                    alFail.Add(dr.ItemArray[0].ToString() + " - FAILED BEFORE SEND");
                    alFail.Add(ex2.ToString());
                }
            }
            foreach (DataRow dr in dt2.Rows)
            {
                try
                {
                    mm = new MailMessage();
                    mm.IsBodyHtml = true;
                    mm.To.Add(dr.ItemArray[1].ToString());
                    mm.From = new MailAddress("[email protected]");
                    mm.Subject = dtMotivator.Rows[0].ItemArray[3].ToString();
                    mm.Body = "<div style=\"width: 790px; background-color: #333333; padding: 5px; border: solid 1px #333333;\"><a href=\"http://www.ReferralNetworX.com\"><img style=\"height: 125px;border-width:0px;\" src=\"http://www.referralnetworx.com/MakeThumbnail.aspx?size=237&image=images/networking.png\" /><img style=\"border-width:0px;\" src=\"http://www.referralnetworx.com/images/banner.png\" /></a></div>";
                    mm.Body += "<div style=\"width: 770px; background-color: #ddeedd; padding: 15px; border: solid 1px #333333;\"><div style=\"font-size:35px;text-align:center;margin-bottom:10px;\">Daily Motivator</div>";
                    string sName = dl.GetNonMemberNameBy_Email(dr.ItemArray[1].ToString());
                    mm.Body += "Hello " + sName + ",<br /><br />";
                    string sYouTubeLink = dtMotivator.Rows[0].ItemArray[5].ToString();
                    if (sYouTubeLink != "No Video.")
                    {
                        mm.Body += "<h1 style=\"text-align:center;\"><a href=\"" + sYouTubeLink + "\">Click Here to Watch The Video Motivator</a></h1>";
                    }
                    mm.Body += dtMotivator.Rows[0].ItemArray[4].ToString();
                    mm.Body += "<h2 style=\"text-align:center;\"><a href=\"http://www.ReferralNetworX.com\">Visit ReferralNetworX.com!</a></h2>";
                    mm.Body += "</div>";
                    mm.Body += "<div style=\"font-size: 12px; border: solid 1px #333333; background-color: #ddeedd; padding: 5px; width: 790px;\">Click <a href=\"http://www.referralnetworx.com/Subscribe.aspx?e=" + dr.ItemArray[1].ToString() + "&type=dailymotivator\">here</a> to unsubscribe.</div>";
                    int iCount = 0;
                    bool bLoop = true;
                    while (bLoop)
                    {
                        try
                        {
                            smtp.Send(mm);
                            bLoop = false;
                        }
                        catch (Exception ex)
                        {
                            System.Threading.Thread.Sleep(1000);
                            iCount++;
                            if (iCount >= 3)
//.........这里部分代码省略.........
开发者ID:chevex-archived,项目名称:ReferralNetworX,代码行数:101,代码来源:ManageDailyMotivator.aspx.cs

示例4: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.UrlReferrer != null)
        {
            string sReferringAddress = Request.UrlReferrer.AbsoluteUri;
            if ((sReferringAddress.ToLower().Contains("encyclopediadramatica.com")) || (sReferringAddress.ToLower().Contains("anonym.to")) || (sReferringAddress.ToLower().Contains("antirefer.com")) || (sReferringAddress.ToLower().Contains("/?http")))
            {
                Response.Redirect(sReferringAddress, true);
            }
        }

        Page.Title += " | ReferralNetworX.com";

        DataLayer dl = new DataLayer();

        if (Request.QueryString["bg"] != null)
        {
            dynamicstyle.InnerHtml = "<style>body{background-image:url(\"" + Request.QueryString["bg"] + "\");}</style>";
        }
        else
        {
            if (Request.QueryString["color"] != null)
            {
                dynamicstyle.InnerHtml = "<style>body{background-color:" + Request.QueryString["color"] + "; background-image: none;}</style>";
            }
        }

        if (Page.User.Identity.IsAuthenticated)
        {
            loginpanel.Visible = false;
            memberpanel.Visible = true;
            membername.InnerHtml = "<a class=\"titlelink\" href=\"Profile.aspx\">" + dl.GetMemberNameBy_Email(Page.User.Identity.Name) + "</a>";
            if (dl.IsMemberAdmin(Page.User.Identity.Name))
            {
                adminpanel.Visible = true;
                divPostBlog.Visible = false;
                divPostArticle.Visible = false;
                archivespanel.Visible = true;
                directorypanel.Visible = true;
                nonmemberdirectorypanel.Visible = false;
                MemberToolsPanel.Visible = true;
            }
            else
            {
                adminpanel.Visible = false;
                archivespanel.Visible = true;
                directorypanel.Visible = true;
                nonmemberdirectorypanel.Visible = false;
                MemberToolsPanel.Visible = true;
                if (dl.CanMemberPostBlog(Page.User.Identity.Name))
                {
                    divPostBlog.Visible = true;
                }
                else
                {
                    divPostBlog.Visible = false;
                }

                if (dl.MemberArticleColumn(Page.User.Identity.Name) != "None")
                {
                    divPostArticle.Visible = true;
                }
                else
                {
                    divPostArticle.Visible = false;
                }
            }
        }
        else
        {
            adminpanel.Visible = false;
            memberpanel.Visible = false;
            loginpanel.Visible = true;
            archivespanel.Visible = false;
            directorypanel.Visible = false;
            nonmemberdirectorypanel.Visible = true;
            MemberToolsPanel.Visible = false;
        }

        if (!this.IsPostBack)
        {
            failfield.Visible = false;
        }

        if (Request.Cookies["ExcludeAnalytics"] != null)
        {
            analytics.Visible = false;
        }
        else
        {
            analytics.Visible = true;
        }
    }
开发者ID:chevex-archived,项目名称:ReferralNetworX,代码行数:93,代码来源:Template.master.cs


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