예제 #1
0
        public string BindHtml(int MessageID, int MessageMemID, string MessageContent)
        {
            StringBuilder sbHtml = new StringBuilder();

            Chain.Model.Message mdMessage = this.bllMessage.GetModel(MessageID);
            if (mdMessage.MessageIsReply == 1)
            {
                sbHtml.AppendFormat("<a href=\"javascript:void();\" onclick=\"DelMsg('{0}','{1}')\"><img src=\"../images/Gift/del.png\" alt=\"删除\" title=\"删除\" /></a>", MessageID, MessageMemID);
            }
            else
            {
                sbHtml.AppendFormat("<a href=\"javascript:void();\" onclick=\"ReplyMsg('{0}','{1}')\"><img src=\"../images/Gift/Reply.png\" alt=\"回复\" title=\"回复\" /></a>", MessageContent, MessageID);
            }
            return(sbHtml.ToString());
        }
예제 #2
0
        public List <Chain.Model.Message> DataTableToList(DataTable dt)
        {
            List <Chain.Model.Message> modelList = new List <Chain.Model.Message>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                for (int i = 0; i < rowsCount; i++)
                {
                    Chain.Model.Message model = new Chain.Model.Message();
                    if (dt.Rows[i]["MessageID"] != null && dt.Rows[i]["MessageID"].ToString() != "")
                    {
                        model.MessageID = int.Parse(dt.Rows[i]["MessageID"].ToString());
                    }
                    if (dt.Rows[i]["MessageMemID"] != null && dt.Rows[i]["MessageMemID"].ToString() != "")
                    {
                        model.MessageMemID = int.Parse(dt.Rows[i]["MessageMemID"].ToString());
                    }
                    if (dt.Rows[i]["MessageContent"] != null && dt.Rows[i]["MessageContent"].ToString() != "")
                    {
                        model.MessageContent = dt.Rows[i]["MessageContent"].ToString();
                    }
                    if (dt.Rows[i]["MessageTime"] != null && dt.Rows[i]["MessageTime"].ToString() != "")
                    {
                        model.MessageTime = DateTime.Parse(dt.Rows[i]["MessageTime"].ToString());
                    }
                    if (dt.Rows[i]["MessageIsReply"] != null && dt.Rows[i]["MessageIsReply"].ToString() != "")
                    {
                        model.MessageIsReply = int.Parse(dt.Rows[i]["MessageIsReply"].ToString());
                    }
                    if (dt.Rows[i]["MessageReplyContent"] != null && dt.Rows[i]["MessageReplyContent"].ToString() != "")
                    {
                        model.MessageReplyContent = dt.Rows[i]["MessageReplyContent"].ToString();
                    }
                    if (dt.Rows[i]["MessageReplyTime"] != null && dt.Rows[i]["MessageReplyTime"].ToString() != "")
                    {
                        model.MessageReplyTime = DateTime.Parse(dt.Rows[i]["MessageReplyTime"].ToString());
                    }
                    if (dt.Rows[i]["MessageReplyUserID"] != null && dt.Rows[i]["MessageReplyUserID"].ToString() != "")
                    {
                        model.MessageReplyUserID = int.Parse(dt.Rows[i]["MessageReplyUserID"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
예제 #3
0
 public int Add(Chain.Model.Message model)
 {
     return(this.dal.Add(model));
 }
예제 #4
0
 public bool Update(Chain.Model.Message model)
 {
     return(this.dal.Update(model));
 }
예제 #5
0
 public bool Reply(Chain.Model.Message modelMessage)
 {
     return(this.dal.Reply(modelMessage));
 }