protected void Page_Load(object sender, EventArgs e) { WebUtility.AdminLoginAuth(); if (!bll_admin.RuleAuth("论坛_论坛明星")) { WebUtility.ShowError(WebUtility.ERROR101); } userState = bll_forumUserState.GetModel(Request.QueryString["pkid"]); if (userState == null || !userState.ForumStar) { userState = new ForumUserStateModel(); } if (userState.ForumStar) { InfoPanel.Visible = true; EditPanel.Visible = false; } if (!Page.IsPostBack) { BindInfo(); } }
protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e) { ForumUserStateModel forumUserState = (ForumUserStateModel)e.Item.DataItem; MemberModel member = (MemberModel)forumUserState.Cache1; ((HtmlGenericControl)e.Item.FindControl("Eval_Pic")).InnerHtml = "<img src=\"" + member.Pic + "\" />"; ((HtmlTableCell)e.Item.FindControl("Eval_Member")).InnerHtml = "<u>用户名:</u>" + member.Username + "<br /><u>真实姓名:</u>" + member.Realname + "<br /><u>昵称:</u>" + member.Nickname; }
protected void SubmitButton_Click(object sender, EventArgs e) { if (Page.IsValid) { if (!StringHelper.IsNumber(Sort.Value)) { WebUtility.ShowAlertMessage("自定义排序应使用数字填写!", null); } userState.ForumStarSort = Convert.ToInt32(Sort.Value); if (userState.Pkid > 0) { bll_forumUserState.Update(userState); WebUtility.ShowAlertMessage("保存成功!", "starManage.aspx" + param); } else { //增加 MemberModel member = bll_member.GetModelByUsername(Username.Value); if (member == null) { WebUtility.ShowAlertMessage("没有找到指定会员!", null); } userState = bll_forumUserState.GetModelByUserId(member.Pkid); if (userState == null) { userState = new ForumUserStateModel(); userState.UserId = member.Pkid; } userState.ForumStar = true; bll_forumUserState.Update(userState); WebUtility.ShowAlertMessage("新增成功!", Request.RawUrl); } } }