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

            BLL.Forum_Attachment bll = new BLL.Forum_Attachment();
            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_Attachment"
                        + sucCount + "条,失败" + errorCount + "条"); //记录日志
            JscriptMsg("删除成功" + sucCount + "条,失败" + errorCount + "条!", Utils.CombUrlTxt("Forum_Attachment_list.aspx", "keywords={0}", this.keywords));
        }
Exemple #2
0
        private bool DoAdd()
        {
            Model.Forum_Attachment model = new Model.Forum_Attachment();
            BLL.Forum_Attachment   bll   = new BLL.Forum_Attachment();
            //编写添加操作Begin
            //model.Id = txtId.Text;
            //model.UserId = txtUserId.Text;
            //model.BoardId = txtBoardId.Text;
            //model.TopicId = txtTopicId.Text;
            //model.PostId = txtPostId.Text;
            //model.UploadDatetime = txtUploadDatetime.Text;
            //model.Name = txtName.Text;
            //model.FileName = txtFileName.Text;
            //model.Description = txtDescription.Text;
            //model.FileType = txtFileType.Text;
            //model.FileSize = txtFileSize.Text;
            //model.IsImage = txtIsImage.Text;
            //model.Thumb = txtThumb.Text;
            //model.Download = txtDownload.Text;
            //model.Cost = txtCost.Text;
            //model.CostType = txtCostType.Text;
            //编写添加操作End

            if (bll.Add(model) > 0)
            {
                AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加dt_Forum_Attachment:"
                            + model.Name); //记录日志
                return(true);
            }
            return(false);
        }
Exemple #3
0
        private void ShowInfo(int _id)
        {
            BLL.Forum_Attachment   bll   = new BLL.Forum_Attachment();
            Model.Forum_Attachment model = bll.GetModel(_id);
            //编写赋值操作Begin

            //txtId.Text = model.Id;
            //txtUserId.Text = model.UserId;
            //txtBoardId.Text = model.BoardId;
            //txtTopicId.Text = model.TopicId;
            //txtPostId.Text = model.PostId;
            //txtUploadDatetime.Text = model.UploadDatetime;
            //txtName.Text = model.Name;
            //txtFileName.Text = model.FileName;
            //txtDescription.Text = model.Description;
            //txtFileType.Text = model.FileType;
            //txtFileSize.Text = model.FileSize;
            //txtIsImage.Text = model.IsImage;
            //txtThumb.Text = model.Thumb;
            //txtDownload.Text = model.Download;
            //txtCost.Text = model.Cost;
            //txtCostType.Text = model.CostType;

            //编写赋值操作End
        }
Exemple #4
0
        private bool DoEdit(int _id)
        {
            bool result = false;

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

            //编写编辑操作Begin
            //model.Id = txtId.Text;
            //model.UserId = txtUserId.Text;
            //model.BoardId = txtBoardId.Text;
            //model.TopicId = txtTopicId.Text;
            //model.PostId = txtPostId.Text;
            //model.UploadDatetime = txtUploadDatetime.Text;
            //model.Name = txtName.Text;
            //model.FileName = txtFileName.Text;
            //model.Description = txtDescription.Text;
            //model.FileType = txtFileType.Text;
            //model.FileSize = txtFileSize.Text;
            //model.IsImage = txtIsImage.Text;
            //model.Thumb = txtThumb.Text;
            //model.Download = txtDownload.Text;
            //model.Cost = txtCost.Text;
            //model.CostType = txtCostType.Text;
            //编写编辑操作End

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

            return(result);
        }
        private void RptBind(string _strWhere, string _orderby)
        {
            this.page        = DTRequest.GetQueryInt("page", 1);
            txtKeywords.Text = this.keywords;
            BLL.Forum_Attachment bll = new BLL.Forum_Attachment();
            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("Forum_Attachment_list.aspx", "keywords={0}&page={1}", this.keywords, "__id__");

            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
Exemple #6
0
        private void editor(HttpContext context)
        {
            string _v = verify_code(context, vc);

            if (_v != "success")
            {
                JsonHelper.WriteJson(context, new
                {
                    error       = 1,
                    description = _v
                });
            }

            if (string.IsNullOrEmpty(message))
            {
                JsonHelper.WriteJson(context, new
                {
                    error       = 1,
                    description = "内容不写你打算做什么呢!"
                });
            }

            if (!BLL.Forum_BoardPermission.CheckPermission(board_id + "|" + modelUser.GroupId, "UpdateMyselfReply"))
            {
                JsonHelper.WriteJson(context, new
                {
                    error       = 1,
                    description = "您当前还没有权限哦!"
                });
            }

            message = FilterWord(message);

            Model.Forum_Topic modelTopic = new BLL.Forum_Topic().GetModel(topic_id);

            foreach (string item in context.Request.Form.AllKeys)
            {
                if (item.ToLower().IndexOf("attachment_description_") != -1)
                {
                    string strDescription = context.Request.Form[item].ToString();

                    string _id = item.ToLower().Replace("attachment_description_", "").Replace("'", "");

                    new BLL.Forum_Attachment().UpdateField("Id=" + _id, " Description='" + strDescription + "' ");
                }
            }


            //上传图片的张数
            int attachment_count = new BLL.Forum_Attachment().GetCount(" [BoardId]=" + board_id + " and [UserId]=" + modelUser.UserId + " and  [PostId]=" + post_id + " ");

            Model.Forum_Post modelPost = new BLL.Forum_Post(modelTopic.PostSubTable).GetModel(post_id);

            modelPost.Signature = signature;
            modelPost.Url       = autoUrl;
            modelPost.Message   = message;

            modelPost.Attachment = attachment_count;

            new BLL.Forum_Post(modelTopic.PostSubTable).Update(modelPost);

            JsonHelper.WriteJson(context, new
            {
                tid  = modelTopic.Id,
                turl = turl
            });
        }