本文整理汇总了C#中DataLayer.UpdateMember方法的典型用法代码示例。如果您正苦于以下问题:C# DataLayer.UpdateMember方法的具体用法?C# DataLayer.UpdateMember怎么用?C# DataLayer.UpdateMember使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataLayer
的用法示例。
在下文中一共展示了DataLayer.UpdateMember方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnSubmit_Click
protected void btnSubmit_Click(object sender, EventArgs e)
{
DataLayer dl = new DataLayer();
DataTable dt = dl.GetMemberBy_Email(sEmail);
string sTwitterFeedStyles = dt.Rows[0].ItemArray[32].ToString();
string sTwitterPassword = dt.Rows[0].ItemArray[27].ToString();
bool bUpdateTwitter = Convert.ToBoolean(dt.Rows[0].ItemArray[25]);
string sPersonalAvatar = dt.Rows[0].ItemArray[3].ToString();
if (fuPersonalAvatar.HasFile)
{
string sExt = fuPersonalAvatar.FileName.Remove(0, fuPersonalAvatar.FileName.LastIndexOf('.'));
fuPersonalAvatar.SaveAs(MapPath("~/images/MemberAvatars/" + lblEmail.Text + sExt));
sPersonalAvatar = lblEmail.Text + sExt;
}
string sBusinessLogo = dt.Rows[0].ItemArray[9].ToString();
if (fuBusinessLogo.HasFile)
{
string sExt = fuBusinessLogo.FileName.Remove(0, fuBusinessLogo.FileName.LastIndexOf('.'));
fuBusinessLogo.SaveAs(MapPath("~/images/BusinessLogos/" + lblEmail.Text + sExt));
sBusinessLogo = lblEmail.Text + sExt;
}
bool bAdmin = Convert.ToBoolean(dt.Rows[0].ItemArray[19]);
bool bModerator = Convert.ToBoolean(dt.Rows[0].ItemArray[20]);
bool bCanPostBlog = Convert.ToBoolean(dt.Rows[0].ItemArray[21]);
string sArticleCategory = dt.Rows[0].ItemArray[34].ToString();
dl.UpdateMember(sEmail, tbxName.Text, sPersonalAvatar, tbxPhone.Text, tbxInterests.Text.Replace("\n", "<br />").Replace("\r", ""), tbxWebsite.Text, tbxPersonalBio.Text.Replace("\n", "<br />").Replace("\r", ""), tbxBusinessName.Text, sBusinessLogo, tbxBusinessBio.Text.Replace("\n", "<br />").Replace("\r", ""), tbxAIM.Text, tbxMSN.Text, tbxYahoo.Text, tbxGoogleTalk.Text, tbxLocation.Text, tbxSignature.Text.Replace("\n", "<br />").Replace("\r", ""), bAdmin, bModerator, bCanPostBlog, cbxMemberNewsletter.Checked, cbxDailyMotivator.Checked, cbxShowEmail.Checked, bUpdateTwitter, tbxTwitterUsername.Text.Replace("@", ""), sTwitterPassword, ddlGender.SelectedValue, calBirthday.SelectedDate, ddlBusinessCategory.SelectedValue, sTwitterFeedStyles, sArticleCategory);
Session["resultColor"] = "#007700";
Session["resultTitle"] = "Profile Updated";
Session["resultMessage"] = "You Profile Has Been Updated Successfuly";
Session["resultReturnURL"] = "Profile.aspx?member=" + sEmail;
Response.Redirect("Result.aspx");
}
示例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 += " 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");
}
}
}