示例#1
0
        //批量删除
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            ChkAdminLevel("plugin_forum_settings", DTEnums.ActionEnum.Delete.ToString()); //检查权限
            int sucCount   = 0;
            int errorCount = 0;

            BLL.Forum_Settings bll = new BLL.Forum_Settings();
            for (int i = 0; i < rptList.Items.Count; i++)
            {
                string   id = ((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_Settings"
                        + sucCount + "条,失败" + errorCount + "条"); //记录日志
            JscriptMsg("删除成功" + sucCount + "条,失败" + errorCount + "条!", "Settings_list.aspx");
        }
示例#2
0
        private bool DoEdit(string _id)
        {
            bool result = false;

            BLL.Forum_Settings   bll   = new BLL.Forum_Settings();
            Model.Forum_Settings model = bll.GetModel(_id);

            //编写编辑操作Begin
            model.VariableOld = model.Variable;
            model.Variable    = txtVariable.Text;
            model.Value       = txtValue.Text;
            model.Title       = txtTitle.Text;
            model.Group       = Convert.ToInt32(ddlGroup.SelectedValue);
            model.Description = txtDescription.Text;
            model.SortId      = Convert.ToInt32(txtSortId.Text);

            //编写编辑操作End

            if (bll.Update(model))
            {
                AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改管理员:" + model.Variable); //记录日志
                result = true;
            }

            return(result);
        }
示例#3
0
        private void RptBind(string _strWhere, string _orderby)
        {
            this.page = DTRequest.GetQueryInt("page", 1);

            BLL.Forum_Settings bll = new BLL.Forum_Settings();
            this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);
            this.rptList.DataBind();

            //绑定页码
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = "Settings_list.aspx";

            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
示例#4
0
        private void ShowInfo(string _id)
        {
            BLL.Forum_Settings   bll   = new BLL.Forum_Settings();
            Model.Forum_Settings model = bll.GetModel(_id);
            //编写赋值操作Begin

            txtVariable.Text       = model.Variable;
            txtValue.Text          = model.Value;
            txtTitle.Text          = model.Title;
            ddlGroup.SelectedValue = model.Group.ToString();
            txtDescription.Text    = model.Description;
            txtSortId.Text         = model.SortId.ToString();

            //编写赋值操作End
        }
示例#5
0
        //保存排序
        protected void btnSave_Click(object sender, EventArgs e)
        {
            ChkAdminLevel("plugin_forum_settings", DTEnums.ActionEnum.Delete.ToString()); //检查权限
            BLL.Forum_Settings bll     = new BLL.Forum_Settings();
            Repeater           rptList = new Repeater();

            rptList = this.rptList;
            for (int i = 0; i < rptList.Items.Count; i++)
            {
                string id = ((HiddenField)rptList.Items[i].FindControl("hidId")).Value;
                int    sortId;
                if (!int.TryParse(((TextBox)rptList.Items[i].FindControl("txtSortId")).Text.Trim(), out sortId))
                {
                    sortId = 99;
                }
                bll.UpdateField(id, "sortId=" + sortId.ToString());
            }
            AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "保存全属设置排序"); //记录日志
            JscriptMsg("保存排序成功!", "Settings_list.aspx");
        }
示例#6
0
        private bool DoAdd()
        {
            Model.Forum_Settings model = new Model.Forum_Settings();
            BLL.Forum_Settings   bll   = new BLL.Forum_Settings();
            //编写添加操作Begin
            model.Variable    = txtVariable.Text;
            model.Value       = txtValue.Text;
            model.Title       = txtTitle.Text;
            model.Group       = Convert.ToInt32(ddlGroup.SelectedValue);
            model.Description = txtDescription.Text;
            model.SortId      = Convert.ToInt32(txtSortId.Text);
            //编写添加操作End

            if (bll.Add(model))
            {
                AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加dt_Forum_Settings:"
                            + model.Variable); //记录日志
                return(true);
            }
            return(false);
        }