示例#1
0
        //提交
        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);
        }
        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);
        }