private void users(HttpContext context) { System.Data.DataTable dt = new BLL.Forum_UserExtended().GetPostList(" F.UserId in(" + user_ids.Replace("'", "") + ")").Tables[0]; JsonHelper.WriteJson(context, dt); }
//提交 protected void btnSubmit_Click(object sender, EventArgs e) { ChkAdminLevel("plugin_forum_userextended", DTEnums.ActionEnum.Delete.ToString()); //检查权限 BLL.Forum_UserExtended bll = new BLL.Forum_UserExtended(); model = new BLL.Forum_UserExtended().GetModel(this.id); string ids = "0"; for (int i = 0; i < rptList.Items.Count; i++) { int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value); CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId"); if (cb.Checked) { ids += "," + id.ToString(); } } model.Medal = ids; bll.Update(model); AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改管理员:" + model.Nickname); //记录日志 JscriptMsg("修改信息成功!", hfTurl.Value); }
//批量删除 protected void btnDelete_Click(object sender, EventArgs e) { ChkAdminLevel("plugin_forum_userextended", DTEnums.ActionEnum.Delete.ToString()); //检查权限 int sucCount = 0; int errorCount = 0; BLL.Forum_UserExtended bll = new BLL.Forum_UserExtended(); for (int i = 0; i < rptList.Items.Count; i++) { int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value); CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId"); if (cb.Checked) { if (bll.Delete(id)) { sucCount += 1; } else { errorCount += 1; } } } AddAdminLog(DTEnums.ActionEnum.Delete.ToString(), "删除dt_Forum_UserExtended" + sucCount + "条,失败" + errorCount + "条"); //记录日志 JscriptMsg("删除成功" + sucCount + "条,失败" + errorCount + "条!", Utils.CombUrlTxt("user_extended_list.aspx", "keywords={0}", this.keywords)); }
private void RptBind(string _strWhere, string _orderby) { this.page = DTRequest.GetQueryInt("page", 1); txtKeywords.Text = this.keywords; BLL.Forum_UserExtended bll = new BLL.Forum_UserExtended(); this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount); this.rptList.DataBind(); //绑定页码 txtPageNum.Text = this.pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("user_extended_list.aspx", "keywords={0}&page={1}", this.keywords, "__id__"); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
private void ShowInfo(int _id) { BLL.Forum_UserExtended bll = new BLL.Forum_UserExtended(); Model.Forum_UserExtended model = bll.GetModel(_id); modelUser = new DTcms.BLL.users().GetModel(model.UserId); //编写赋值操作Begin //txtUserId.Text = model.UserId; //txtQQ.Text = model.QQ; //txtMSN.Text = model.MSN; rblGender.SelectedValue = model.Gender.ToString(); //txtBirthday.Text = model.Birthday; //txtBio.Text = model.Bio; //txtAddress.Text = model.Address; //txtSite.Text = model.Site; //txtSignature.Text = model.Signature; txtNickname.Text = model.Nickname; //txtLastPostDateTime.Text = model.LastPostDateTime; ddlGroupId.SelectedValue = model.GroupId.ToString(); //txtLastActivity.Text = model.LastActivity; //txtTopicCount.Text = model.TopicCount; //txtPostCount.Text = model.PostCount; //txtPostDigestCount.Text = model.PostDigestCount; //txtMedal.Text = model.Medal; //txtOnlineTime.Text = model.OnlineTime; //txtOnlineUpdateTime.Text = model.OnlineUpdateTime; //txtVerify.Text = model.Verify; //txtHometown.Text = model.Hometown; //txtNonlocal.Text = model.Nonlocal; //txtSpecialty.Text = model.Specialty; txtCredit.Text = model.Credit.ToString(); if (!string.IsNullOrEmpty(model.Medal)) { List <Model.Forum_Medal> modelList = new BLL.Forum_Medal().GetModelList(" id in (" + model.Medal + ") "); medalHtml = ""; foreach (Model.Forum_Medal item in modelList) { medalHtml += "<img <img src='" + item.Image + "' style=' max-width:100px; margin:8px 8px 0px 0px;vertical-align: top;' />"; } } //编写赋值操作End }
protected void btnSubmit_Click(object sender, EventArgs e) { ChkAdminLevel("plugin_forum_moderator", DTEnums.ActionEnum.Add.ToString()); //检查权限 Model.Forum_Moderator model = new Model.Forum_Moderator(); BLL.Forum_Moderator bll = new BLL.Forum_Moderator(); DTcms.Model.users modelUser = new DTcms.BLL.users().GetModel(txtUsername.Text.Replace("'", "")); if (modelUser != null) { Model.Forum_UserExtended modelExtended = new BLL.Forum_UserExtended().GetModel(modelUser.id); if (modelExtended != null) { //编写添加操作Begin model.BoardId = this.board_id; model.GroupId = Convert.ToInt32(ddlGroupId.SelectedValue); model.UserId = modelUser.id; model.Username = modelUser.user_name; model.Nickname = modelUser.nick_name; //编写添加操作End bll.Add(model); modelExtended.GroupId = Convert.ToInt32(ddlGroupId.SelectedValue); new BLL.Forum_UserExtended().Update(modelExtended); JscriptMsg("添加信息成功!", Utils.CombUrlTxt("moderator_list.aspx", "board_id={0}", this.board_id.ToString())); } else { JscriptMsg("该会员未从DTcms中同步!", ""); return; } } else { JscriptMsg("会员不存在!", ""); return; } }
private bool DoEdit(int _id) { bool result = false; BLL.Forum_UserExtended bll = new BLL.Forum_UserExtended(); Model.Forum_UserExtended model = bll.GetModel(_id); //编写编辑操作Begin //model.UserId = txtUserId.Text; //model.QQ = txtQQ.Text; //model.MSN = txtMSN.Text; model.Gender = Convert.ToInt32(rblGender.SelectedValue); //model.Birthday = txtBirthday.Text; //model.Bio = txtBio.Text; //model.Address = txtAddress.Text; //model.Site = txtSite.Text; //model.Signature = txtSignature.Text; //model.Nickname = txtNickname.Text; //model.LastPostDateTime = txtLastPostDateTime.Text; model.GroupId = Convert.ToInt32(ddlGroupId.SelectedValue); //model.LastActivity = txtLastActivity.Text; //model.TopicCount = txtTopicCount.Text; //model.PostCount = txtPostCount.Text; //model.PostDigestCount = txtPostDigestCount.Text; //model.Medal = txtMedal.Text; //model.OnlineTime = txtOnlineTime.Text; //model.OnlineUpdateTime = txtOnlineUpdateTime.Text; //model.Verify = txtVerify.Text; //model.Hometown = txtHometown.Text; //model.Nonlocal = txtNonlocal.Text; //model.Specialty = txtSpecialty.Text; model.Credit = Convert.ToInt32(txtCredit.Text); //编写编辑操作End if (bll.Update(model)) { AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改管理员:" + model.Nickname); //记录日志 result = true; } return(result); }
private bool DoAdd() { Model.Forum_UserExtended model = new Model.Forum_UserExtended(); BLL.Forum_UserExtended bll = new BLL.Forum_UserExtended(); //编写添加操作Begin //model.UserId = txtUserId.Text; //model.QQ = txtQQ.Text; //model.MSN = txtMSN.Text; //model.Gender = txtGender.Text; //model.Birthday = txtBirthday.Text; //model.Bio = txtBio.Text; //model.Address = txtAddress.Text; //model.Site = txtSite.Text; //model.Signature = txtSignature.Text; //model.Nickname = txtNickname.Text; //model.LastPostDateTime = txtLastPostDateTime.Text; //model.GroupId = txtGroupId.Text; //model.LastActivity = txtLastActivity.Text; //model.TopicCount = txtTopicCount.Text; //model.PostCount = txtPostCount.Text; //model.PostDigestCount = txtPostDigestCount.Text; //model.Medal = txtMedal.Text; //model.OnlineTime = txtOnlineTime.Text; //model.OnlineUpdateTime = txtOnlineUpdateTime.Text; //model.Verify = txtVerify.Text; //model.Hometown = txtHometown.Text; //model.Nonlocal = txtNonlocal.Text; //model.Specialty = txtSpecialty.Text; //model.Credit = txtCredit.Text; //编写添加操作End if (bll.Add(model)) { AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加dt_Forum_UserExtended:" + model.Nickname); //记录日志 return(true); } return(false); }
private void user_credit_convert(HttpContext context) { //检查系统是否启用兑换金币功能 if (DTcms.Web.Plugin.Forum.Global.RateExchange == 0) { context.Response.Write("{\"status\":0, \"msg\":\"对不起,网站未开启兑换金币功能!\"}"); return; } if (modelUser == null) { context.Response.Write("{\"status\":0, \"msg\":\"对不起,用户尚未登录或已超时!\"}"); return; } int credit = DTRequest.GetFormInt("txtCredit"); string password = DTRequest.GetFormString("txtPassword"); if (modelUser.Credit < DTcms.Web.Plugin.Forum.Global.RateExchange) { context.Response.Write("{\"status\":0, \"msg\":\"对不起,您论坛金币不足!\"}"); return; } if (modelUser.Credit < DTcms.Web.Plugin.Forum.Global.RateExchange) { context.Response.Write("{\"status\":0, \"msg\":\"对不起,最小兑换金币为" + DTcms.Web.Plugin.Forum.Global.RateExchange + "币!\"}"); return; } if (credit > modelUser.Credit) { context.Response.Write("{\"status\":0, \"msg\":\"对不起,您输入的兑换的额度大于账户上的论坛余额!\"}"); return; } if (password == "") { context.Response.Write("{\"status\":0, \"msg\":\"对不起,请输入您账户的密码!\"}"); return; } DTcms.Model.users model = new DTcms.BLL.users().GetModel(modelUser.UserId); //验证密码 if (DESEncrypt.Encrypt(password, model.salt) != model.password) { context.Response.Write("{\"status\":0, \"msg\":\"对不起,您输入的密码不正确!\"}"); return; } BLL.Forum_UserExtended bllUser = new BLL.Forum_UserExtended(); bllUser.UpdateField(modelUser.UserId, " Credit=Credit-" + credit + " "); //计算兑换后的积分值 int convertPoint = (int)(Convert.ToDecimal(credit) / DTcms.Web.Plugin.Forum.Global.RateExchange); //增加积分 int pointNewId = new DTcms.BLL.user_point_log().Add(model.id, model.user_name, convertPoint, "用户兑换论坛金币", true); //重新计算组 HttpContext.Current.Session["SESSION_USER_EXTENDED"] = bllUser.SetGroupId(modelUser); context.Response.Write("{\"status\":1, \"msg\":\"恭喜您,积分兑换成功!\"}"); return; }