コード例 #1
0
        private string createList(int page)
        {
            System.Text.StringBuilder sb = new System.Text.StringBuilder("");

            sb.Append("<table class=\"table table-border table-bordered table-hover table-bg\" id=\"tablelist\">");
            sb.Append("<thead>");
            sb.Append("<tr class=\"text-c\">");
            sb.Append("<th width=\"5%\" align='center'><input type=\"checkbox\" class=\"check-box\" id=\"chekall\" /></th>");
            sb.Append("<th width=\"5%\">序号</th>");
            sb.Append("<th width='20%'>标题</th>");
            sb.Append("<th width='40%'>内容</th>");
            sb.Append("<th width='10%'>发送人</th>");
            sb.Append("<th width='10%'>发送日期</th>");
            sb.Append("<th width='10%'>状态</th>");
            sb.Append("</tr>");
            sb.Append("</thead>");

            int r = 1;

            sb.Append("<tbody>");
            Business.Order.BusinessWorkOrderMsg bc = new project.Business.Order.BusinessWorkOrderMsg();
            foreach (Entity.Order.EntityWorkOrderMsg it in bc.GetWorkOrderMsgQuery(user.Entity.AccID, string.Empty, default(DateTime), default(DateTime), user.Entity.UserNo, null, string.Empty, false, page, pageSize))
            {
                if (it.IsRead)
                {
                    sb.Append("<tr class=\"text-c\">");
                    sb.Append("<td align='center'><input type=\"checkbox\" class=\"check-box\" id=\"" + it.InnerEntityOID + "\" name=\"chk_list\" /></td>");
                    sb.Append("<td align='center'>" + r.ToString() + "</td>");
                    sb.Append("<td><a href=\"javascript:void();\" onclick=\"view('" + it.InnerEntityOID + "')\">" + lenCHEN(it.Subject, 30) + "</a></td>");
                    sb.Append("<td><a href=\"javascript:void();\" onclick=\"view('" + it.InnerEntityOID + "')\">" + lenCHEN(it.Context, 50) + "</a></td>");
                    sb.Append("<td>" + it.SenderName + "</td>");
                    sb.Append("<td>" + it.SendDate.ToString("MM:dd HH:mm") + "</td>");
                    sb.Append("<td class=\"td-status\"><span class=\"label label-success radius\">已读</span></td>");
                    sb.Append("</tr>");
                }
                else
                {
                    sb.Append("<tr class=\"text-c\">");
                    sb.Append("<td align='center'><input type=\"checkbox\" class=\"check-box\" id=\"" + it.InnerEntityOID + "\" name=\"chk_list\" /></td>");
                    sb.Append("<td align='center'><b>" + r.ToString() + "</b></td>");
                    sb.Append("<td><b><a href=\"javascript:void();\" onclick=\"view('" + it.InnerEntityOID + "')\">" + lenCHEN(it.Subject, 30) + "</a></b></td>");
                    sb.Append("<td><b><a href=\"javascript:void();\" onclick=\"view('" + it.InnerEntityOID + "')\">" + lenCHEN(it.Context, 50) + "</a></b></td>");
                    sb.Append("<td><b>" + it.SenderName + "</b></td>");
                    sb.Append("<td><b>" + it.SendDate.ToString("MM:dd HH:mm") + "</b></td>");
                    sb.Append("<td class=\"td-status\"><span class=\"label radius\">未读</span></td>");
                    sb.Append("</tr>");
                }
                r++;
            }
            sb.Append("</tbody>");
            sb.Append("</table>");

            sb.Append(Paginat(bc.GetWorkOrderMsgCount(user.Entity.AccID, string.Empty, default(DateTime), default(DateTime), user.Entity.UserNo, null, string.Empty, false), pageSize, page, 7));
            return(sb.ToString());
        }
コード例 #2
0
        private string viewaction(JsonArrayParse jp)
        {
            JsonObjectCollection collection = new JsonObjectCollection();
            string flag = "1";

            Business.Order.BusinessWorkOrderMsg bc = new project.Business.Order.BusinessWorkOrderMsg();
            bc.load(jp.getValue("id"), user.Entity.AccID);
            collection.Add(new JsonStringValue("MsgType", bc.Entity.MsgTypeName));
            collection.Add(new JsonStringValue("Subject", bc.Entity.Subject));
            collection.Add(new JsonStringValue("Context", bc.Entity.Context));
            collection.Add(new JsonStringValue("SendDate", bc.Entity.SendDate.ToString("yyyy-MM-dd HH:ss")));
            collection.Add(new JsonStringValue("Sender", bc.Entity.SenderName));
            bc.Entity.IsRead   = true;
            bc.Entity.ReadDate = GetDate();
            bc.Save();

            collection.Add(new JsonStringValue("type", "view"));
            collection.Add(new JsonStringValue("flag", flag));
            collection.Add(new JsonStringValue("liststr", createList(int.Parse(jp.getValue("page")))));

            return(collection.ToString());
        }