/// <summary>
        /// 加载数据
        /// </summary>
        /// <param name="strWhere">条件</param>
        void LoadData(string strWhere)
        {
            MSForumCommentDAL commDal = new MSForumCommentDAL();
            DataSet           ds      = commDal.GetCommentList(strWhere);
            DataView          dv      = ds.Tables[0].DefaultView;

            AspNetPager1.RecordCount = dv.Count;

            PagedDataSource pds = new PagedDataSource();

            pds.DataSource       = dv;
            pds.AllowPaging      = true;
            pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;
            pds.PageSize         = AspNetPager1.PageSize;
            Repeater1.DataSource = pds;
            Repeater1.DataBind();
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 删除评论
 /// </summary>
 void DelRepComment()
 {
     if (strtid != null && strtid != "")
     {
         MSForumCommentDAL commentDal = new MSForumCommentDAL();
         if (commentDal.UpdateCommentState(strtid))
         {
             Response.Write("{\"success\":true}");
         }
         else
         {
             Response.Write("{\"error\":true}");
         }
     }
     else
     {
         Response.Write("{\"error\":true}");
     }
 }
Ejemplo n.º 3
0
        void repcomment()
        {
            string       commentdesc = string.Empty;
            StreamReader rd          = new StreamReader(Server.MapPath("emotion/key.txt"));
            string       keyword     = rd.ReadLine();

            try
            {
                commentdesc = HttpContext.Current.Request.Form.Get("commentdesc").ToString();
            }
            catch (Exception)
            {
                commentdesc = "";
            }
            if (commentdesc.Trim() != null && commentdesc.Trim() != "")
            {
                commentdesc = JQDialog.FilterKeyWord(commentdesc, keyword);
                commentdesc = JQDialog.GetTextFromHTML(commentdesc);
                MSForumComment    commentModel = new MSForumComment();
                MSForumCommentDAL commentDal   = new MSForumCommentDAL();
                commentModel.ID     = Guid.NewGuid().ToString("N").ToUpper();
                commentModel.Ctext  = commentdesc;
                commentModel.Review = 1;
                commentModel.TID    = strTid;
                commentModel.UID    = strUid;
                commentModel.UpID   = strupid;
                commentModel.Cstate = 0;
                if (commentDal.AddComment(commentModel))
                {
                    errorscript =
                        JQDialog.alertOKMsgBox(3, "回复成功", "MyCommentList.aspx?fid=" + strfid, "error");
                }
                else
                {
                    errorscript = JQDialog.alertOKMsgBoxGoBack(3, "操作失败<br/>请核对后再操作!", true);
                }
            }
            else
            {
                errorscript = JQDialog.alertOKMsgBoxGoBack(3, "操作失败<br/>请重新再操作!", true);
            }
        }
Ejemplo n.º 4
0
        void pubcomment()
        {
            string commentdesc = string.Empty;

            try
            {
                commentdesc = HttpContext.Current.Request.Form.Get("commentdesc").ToString();
            }
            catch (Exception)
            {
                commentdesc = "";
            }
            if (commentdesc.Trim() != null && commentdesc.Trim() != "")
            {
                MSForumComment    commentModel = new MSForumComment();
                MSForumCommentDAL commentDal   = new MSForumCommentDAL();
                strcommid           = Guid.NewGuid().ToString("N").ToUpper();
                commentModel.ID     = strcommid;
                commentModel.Ctext  = commentdesc;
                commentModel.Review = 1;
                commentModel.TID    = strTid;
                commentModel.UID    = strUid;
                commentModel.UpID   = "";
                commentModel.Cstate = 0;
                SaveImages();
                if (commentDal.AddComment(commentModel))
                {
                    errorscript =
                        JQDialog.alertOKMsgBox(3, "评论成功", "CommentList.aspx?fid=" +
                                               strfid + "&tid=" + strTid, "succeed");
                }
                else
                {
                    errorscript = JQDialog.alertOKMsgBoxGoBack(3, "操作失败<br/>请核对后再操作!", true);
                }
            }
            else
            {
                errorscript = JQDialog.alertOKMsgBoxGoBack(3, "操作失败<br/>请重新再操作!", true);
            }
        }
        void showdetailinfo()
        {
            MSForumCommentDAL CommDal   = new MSForumCommentDAL();
            DataSet           ds        = CommDal.GetCommentDetail(strID);
            MSForumComment    CommModel = DataConvert.DataRowToModel <MSForumComment>(ds.Tables[0].Rows[0]);

            hd_content.Value = CommModel.Ctext;

            MSForumTopicAtlasDAL AtlasDal = new MSForumTopicAtlasDAL();
            DataSet atlasds = AtlasDal.GetMSFTAtlasList(" AND TID='comm" + strID + "' ");

            if (atlasds != null && atlasds.Tables.Count > 0 && atlasds.Tables[0].Rows.Count > 0)
            {
                topicaltaslist = ""; string atlasimg = "";
                for (int i = 0; i < atlasds.Tables[0].Rows.Count; i++)
                {
                    atlasimg        = atlasds.Tables[0].Rows[i]["ImgUrl"].ToString();
                    topicaltaslist += "<img src=\"../../Comment/" + atlasimg + "\" />";
                }
            }
        }
Ejemplo n.º 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (null != Common.Common.NoHtml(Request.QueryString["action"]))
            {
                strAction = Common.Common.NoHtml(Request.QueryString["action"]);
            }
            if (null != Common.Common.NoHtml(Request.QueryString["id"]))
            {
                strID = Common.Common.NoHtml(Request.QueryString["id"]);
            }

            MSForumCommentDAL dal = new MSForumCommentDAL();

            switch (strAction)
            {
            case "del":
                if (dal.UpdateCommentState(strID))
                {
                    strMessage = "操作成功!";
                }
                else
                {
                    strMessage = "操作失败!";
                }
                break;

            case "pass":
                if (dal.UpdateCommentReview(strID))
                {
                    strMessage = "操作成功!";
                }
                else
                {
                    strMessage = "操作失败!";
                }
                break;
            }
            Response.Write(strMessage);
            Response.End();
        }
Ejemplo n.º 7
0
        void getTemplate()
        {
            #region --------------帖子详细--------------------------
            MSForumTopic    TopicModel = new MSForumTopic();
            MSForumTopicDAL TopicDel   = new MSForumTopicDAL();
            DataSet         TopicDs    = TopicDel.GetTopicDetail(strtid);
            if (null != TopicDs && TopicDs.Tables.Count > 0 && TopicDs.Tables[0].Rows.Count > 0)
            {
                TopicModel = DataConvert.DataRowToModel <MSForumTopic>(TopicDs.Tables[0].Rows[0]);
            }
            #endregion
            #region -----------帖子图集----------------
            List <MSForumTopicAtlas> atlasModelList = new List <MSForumTopicAtlas>();
            MSForumTopicAtlasDAL     atlasDal       = new MSForumTopicAtlasDAL();
            DataSet altasDs = atlasDal.GetMSFTAtlasList(" and tid='" + strtid + "'");
            if (altasDs != null && altasDs.Tables.Count > 0 && altasDs.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow row in altasDs.Tables[0].Rows)
                {
                    MSForumTopicAtlas atlasModel = DataConvert.DataRowToModel <MSForumTopicAtlas>(row);
                    atlasModelList.Add(atlasModel);
                }
            }
            #endregion
            #region ---------点赞或喜欢------------
            MSForumTopicLoveDAL lovelikeDal = new MSForumTopicLoveDAL();
            string likecount = lovelikeDal.GetLoveOrLikeCount(strtid, "tlike").ToString();
            string lovecount = lovelikeDal.GetLoveOrLikeCount(strtid, "tlove").ToString();
            #endregion
            #region ---------评论列表以及图集信息------------
            List <CommentListGetSet> commentModelList = new List <CommentListGetSet>();
            MSForumCommentDAL        commentDal       = new MSForumCommentDAL();
            DataSet commentDs = commentDal.GetCommentList(" and a.tid='" + strtid + "' ");
            List <MSForumTopicAtlas> commatlasModelList = new List <MSForumTopicAtlas>();
            int commentcount = 0;
            if (commentDs != null && commentDs.Tables.Count > 0 && commentDs.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow row in commentDs.Tables[0].Rows)
                {
                    CommentListGetSet commentModel = DataConvert.DataRowToModel <CommentListGetSet>(row);
                    string            cmmid        = commentModel.ID;
                    if (commentModel.NickName == null || commentModel.NickName == "")
                    {
                        commentModel.NickName = "游客";
                    }
                    #region ------------评论图集-----------------------
                    DataSet commaltasDs = atlasDal.GetMSFTAtlasList(" and tid='comm" + cmmid + "'");
                    if (commaltasDs != null && commaltasDs.Tables.Count > 0 && commaltasDs.Tables[0].Rows.Count > 0)
                    {
                        foreach (DataRow commrow in commaltasDs.Tables[0].Rows)
                        {
                            MSForumTopicAtlas atlasModel = DataConvert.DataRowToModel <MSForumTopicAtlas>(commrow);
                            commatlasModelList.Add(atlasModel);
                        }
                    }
                    #endregion

                    commentModelList.Add(commentModel);
                }
            }
            try
            {
                commentcount = commentDs.Tables[0].Rows.Count;
            }
            catch (Exception)
            {
                commentcount = 0;
            }
            #endregion
            string text = System.IO.File.ReadAllText(Server.MapPath("HtmlPage/commentlist.html"));
            JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();
            JinianNet.JNTemplate.Template        t       = new JinianNet.JNTemplate.Template(context, text);
            context.TempData["topicdetail"]      = TopicModel;
            context.TempData["altaslist"]        = atlasModelList;
            context.TempData["commentlist"]      = commentModelList;
            context.TempData["commentatlaslist"] = commatlasModelList;
            context.TempData["commentcount"]     = commentcount;
            context.TempData["errorscript"]      = errorscript;
            context.TempData["likecount"]        = likecount;
            context.TempData["lovecount"]        = lovecount;
            context.TempData["fid"]    = strfid;
            context.TempData["uid"]    = strUid;
            context.TempData["footer"] = "奥琦微商易";
            t.Render(Response.Output);
        }
Ejemplo n.º 8
0
 void getTemplate()
 {
     #region -----------获取客户信息---------
     MSCustomers    CustomerModel = new MSCustomers();
     MSCustomersDAL CustomerDal   = new MSCustomersDAL();
     DataSet        CustomerDs;
     if (strUid != null && strUid != "")
     {
         CustomerDs = CustomerDal.GetCustomerDetail(strUid);
         if (null != CustomerDs && CustomerDs.Tables.Count > 0 && CustomerDs.Tables[0].Rows.Count > 0)
         {
             CustomerModel = DataConvert.DataRowToModel <MSCustomers>(CustomerDs.Tables[0].Rows[0]);
             if (CustomerModel.NickName == null || CustomerModel.NickName == "" ||
                 CustomerModel.NickName.ToLower() == "null")
             {
                 CustomerModel.NickName = "游客";
             }
         }
     }
     #endregion
     #region ----------获取帖子列表----------------
     MSForumTopicDAL       topicDal       = new MSForumTopicDAL();
     List <TopicModelList> topicModellist = new List <TopicModelList>();
     int     topicCount  = 0;
     DataSet topiclistds = topicDal.GetMSForumTopicList(" and a.[UID]='" + strUid + "' ", 0);
     if (topiclistds != null && topiclistds.Tables.Count > 0 && topiclistds.Tables[0].Rows.Count > 0)
     {
         topicCount = topiclistds.Tables[0].Rows.Count;
         foreach (DataRow row in topiclistds.Tables[0].Rows)
         {
             TopicModelList topicmodel = DataConvert.DataRowToModel <TopicModelList>(row);
             if (topicmodel.NickName == null || topicmodel.NickName == "" || topicmodel.NickName.Length < 1)
             {
                 topicmodel.NickName = "游客";
             }
             if (topicmodel.HeadImg == null || topicmodel.HeadImg == "")
             {
                 topicmodel.HeadImg = "images/2.png";
             }
             string msg = topicmodel.TopicDesc;
             msg = JQDialog.GetTextFromHTML(msg);
             if (msg.Length > 250)
             {
                 msg = msg.ToString().Substring(0, 100) + "...";
             }
             topicmodel.TopicDesc = msg;
             topicModellist.Add(topicmodel);
         }
     }
     #endregion
     #region --------------获取喜欢 总数------------------
     int likecount = 0;
     MSForumTopicLoveDAL likeDal = new MSForumTopicLoveDAL();
     try
     {
         likecount = likeDal.GetLoveOrLikeCountByUID(strUid, "tlike");
     }
     catch (Exception)
     {
         likecount = 0;
     }
     #endregion
     #region ------------获取消息总数---------------
     int msgcount = 0;
     MSForumCommentDAL commentDal = new MSForumCommentDAL();
     try
     {
         msgcount = commentDal.GetCommentCountByUID(strUid);
     }
     catch (Exception)
     {
         msgcount = 0;
     }
     #endregion
     string text = System.IO.File.ReadAllText(Server.MapPath("HtmlPage/othertopiclist.html"));
     JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();
     JinianNet.JNTemplate.Template        t       = new JinianNet.JNTemplate.Template(context, text);
     context.TempData["mytopiclist"] = topicModellist;
     context.TempData["topiccount"]  = topicCount;
     context.TempData["customer"]    = CustomerModel;
     context.TempData["fid"]         = strfid;
     context.TempData["likecount"]   = likecount;
     context.TempData["msgcount"]    = msgcount;
     context.TempData["errorscript"] = errorscript;
     context.TempData["uid"]         = strUid;
     context.TempData["myuid"]       = strMyUid;
     context.TempData["footer"]      = "奥琦微商易";
     t.Render(Response.Output);
 }
Ejemplo n.º 9
0
 public void getTemplate()
 {
     #region -----------获取客户信息---------
     MSCustomers    CustomerModel = new MSCustomers();
     MSCustomersDAL CustomerDal   = new MSCustomersDAL();
     DataSet        CustomerDs;
     if (strUid != null && strUid != "")
     {
         CustomerDs = CustomerDal.GetCustomerDetail(strUid);
         if (null != CustomerDs && CustomerDs.Tables.Count > 0 && CustomerDs.Tables[0].Rows.Count > 0)
         {
             CustomerModel = DataConvert.DataRowToModel <MSCustomers>(CustomerDs.Tables[0].Rows[0]);
             if (CustomerModel.NickName == null || CustomerModel.NickName == "" ||
                 CustomerModel.NickName.ToLower() == "null")
             {
                 CustomerModel.NickName = "游客";
             }
         }
     }
     #endregion
     #region ---------评论列表以及信息回复------------
     List <CommentListGetSet> commentModelList = new List <CommentListGetSet>();
     MSForumCommentDAL        commentDal       = new MSForumCommentDAL();
     DataSet commentDs = commentDal.GetCommentList(" and a.[uid]='" + strUid + "' ");
     DataSet repcommentds;
     List <CommentListGetSet> repcommentModelList = new List <CommentListGetSet>();
     int commentcount = 0;
     if (commentDs != null && commentDs.Tables.Count > 0 && commentDs.Tables[0].Rows.Count > 0)
     {
         foreach (DataRow row in commentDs.Tables[0].Rows)
         {
             CommentListGetSet commentModel = DataConvert.DataRowToModel <CommentListGetSet>(row);
             if (commentModel.NickName == null || commentModel.NickName == "")
             {
                 commentModel.NickName = "游客";
             }
             #region ----------------获取回复信息-----------------------
             string repid = commentModel.ID;
             repcommentds = commentDal.GetRepCommentList(" and a.[uid]='" + strUid + "' and a.UpID='" + repid + "' ");
             if (repcommentds != null && repcommentds.Tables.Count > 0 && repcommentds.Tables[0].Rows.Count > 0)
             {
                 foreach (DataRow reprow in repcommentds.Tables[0].Rows)
                 {
                     CommentListGetSet repcommentModel = DataConvert.DataRowToModel <CommentListGetSet>(reprow);
                     if (repcommentModel.NickName == null || repcommentModel.NickName == "")
                     {
                         repcommentModel.NickName = "游客";
                     }
                     repcommentModelList.Add(repcommentModel);
                 }
             }
             #endregion
             commentModelList.Add(commentModel);
         }
     }
     try
     {
         commentcount = commentDs.Tables[0].Rows.Count;
     }
     catch (Exception)
     {
         commentcount = 0;
     }
     #endregion
     #region --------------获取喜欢 总数------------------
     int likecount = 0;
     MSForumTopicLoveDAL likeDal = new MSForumTopicLoveDAL();
     try
     {
         likecount = likeDal.GetLoveOrLikeCountByUID(strUid, "tlike");
     }
     catch (Exception)
     {
         likecount = 0;
     }
     #endregion
     #region ------------获取消息总数---------------
     int msgcount = 0;
     try
     {
         msgcount = commentDal.GetCommentCountByUID(strUid);
     }
     catch (Exception)
     {
         msgcount = 0;
     }
     #endregion
     #region ---------帖子总数-------------
     int             topiccount = 0;
     MSForumTopicDAL topicdal   = new MSForumTopicDAL();
     try
     {
         topiccount = topicdal.GetTopicCountByUID(strUid);
     }
     catch (Exception)
     {
         topiccount = 0;
     }
     #endregion
     string text = System.IO.File.ReadAllText(Server.MapPath("HtmlPage/Mycommentlist.html"));
     JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();
     JinianNet.JNTemplate.Template        t       = new JinianNet.JNTemplate.Template(context, text);
     context.TempData["customer"]       = CustomerModel;
     context.TempData["commentlist"]    = commentModelList;
     context.TempData["repcommentlist"] = repcommentModelList;
     context.TempData["fid"]            = strfid;
     context.TempData["likecount"]      = likecount;
     context.TempData["msgcount"]       = msgcount;
     context.TempData["topiccount"]     = topiccount;
     context.TempData["errorscript"]    = errorscript;
     context.TempData["uid"]            = strUid;
     context.TempData["footer"]         = "奥琦微商易";
     t.Render(Response.Output);
 }