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


C# DataLayer.UpdateMemberEmail方法代码示例

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


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

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

示例2: btnSubmit_Click


//.........这里部分代码省略.........
            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();
                string sPersonalAvatar = dt.Rows[0].ItemArray[3].ToString();
                string sMemberAvatar = dt.Rows[0].ItemArray[3].ToString();
                string sPhone = dt.Rows[0].ItemArray[4].ToString();
                string sInterests = dt.Rows[0].ItemArray[5].ToString();
                string sWebsite = dt.Rows[0].ItemArray[6].ToString();
                string sPersonalBio = dt.Rows[0].ItemArray[7].ToString();
                string sBusinessLogo = dt.Rows[0].ItemArray[9].ToString();
                string sBusinessBio = dt.Rows[0].ItemArray[10].ToString();
                string sAIM = dt.Rows[0].ItemArray[13].ToString();
                string sMSN = dt.Rows[0].ItemArray[14].ToString();
                string sYahoo = dt.Rows[0].ItemArray[15].ToString();
                string sGoogleTalk = dt.Rows[0].ItemArray[16].ToString();
                string sLocation = dt.Rows[0].ItemArray[17].ToString();
                string sSignature = dt.Rows[0].ItemArray[18].ToString();
                bool bShowEmail = Convert.ToBoolean(dt.Rows[0].ItemArray[24]);
                bool bUpdateTwitter = Convert.ToBoolean(dt.Rows[0].ItemArray[25]);
                string sTwitterUsername = dt.Rows[0].ItemArray[26].ToString();
                string sTwitterPassword = dt.Rows[0].ItemArray[27].ToString();
                string sGender = dt.Rows[0].ItemArray[28].ToString();
                DateTime dtBirthday = Convert.ToDateTime(dt.Rows[0].ItemArray[30]);
                string sBusinessCategory = dt.Rows[0].ItemArray[31].ToString();

                dl.UpdateMember(lbxMembers.SelectedValue, tbxName.Text, sPersonalAvatar, sPhone, sInterests, sWebsite, sPersonalBio, tbxBusinessName.Text, sBusinessLogo, sBusinessBio, sAIM, sMSN, sYahoo, sGoogleTalk, sLocation, sSignature, cbxAdmin.Checked, cbxModerator.Checked, cbxCanPostBlog.Checked, cbxMemberNewsletter.Checked, cbxDailyMotivator.Checked, bShowEmail, bUpdateTwitter, sTwitterUsername, sTwitterPassword, sGender, dtBirthday, sBusinessCategory, sTwitterFeedStyles, ddlArticleColumn.SelectedValue);
                if (lbxMembers.SelectedValue.ToUpper() != tbxEmail.Text.ToUpper())
                {
                    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;
                    }
                    dl.UpdateMemberEmail(lbxMembers.SelectedValue, tbxEmail.Text, sPersonalAvatar, sBusinessLogo);
                    if (User.Identity.Name.ToUpper() == lbxMembers.SelectedValue.ToUpper())
                    {
                        FormsAuthentication.SignOut();
                        FormsAuthentication.SetAuthCookie(tbxEmail.Text, false);
                    }
                }
                Session["resultColor"] = "#007700";
                Session["resultTitle"] = "Member Updated";
                Session["resultMessage"] = "Member Updated Successfuly ";
                Session["resultReturnURL"] = "ManageMembers.aspx";
                Response.Redirect("Result.aspx");
            }
        }
    }
开发者ID:chevex-archived,项目名称:ReferralNetworX,代码行数:101,代码来源:ManageMembers.aspx.cs


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