示例#1
0
        protected override string btnOther_Click()
        {
            string where = " 1=1 ";
            //string where = string.Format(" MID = '{0}'   ", TModel.MID);
            //var txtCode = Request["txtCode"];
            //if (!string.IsNullOrEmpty(txtCode))
            //{
            //    where += string.Format(" and Code = '{0}'", txtCode);
            //}
            string mkey = "";

            string state = Request.Form["state"];

            if (!string.IsNullOrEmpty(state))
            {
                if (state == "FJ")
                {
                    where += " and TFromMID='" + TModel.MID + "' ";
                }
                else
                {
                    where += " and TToMID='" + TModel.MID + "' ";
                }
            }
            else
            {
                where += " and TFromMID='" + TModel.MID + "' ";
            }

            mkey = TModel.MID;
            //if (!string.IsNullOrEmpty(Request["begin_time"]))
            //{
            //    where += " and ChangeDate>'" + Request["begin_time"] + " 00:00:00' ";
            //}
            //if (!string.IsNullOrEmpty(Request["end_time"]))
            //{
            //    where += " and ChangeDate<'" + Request["end_time"] + " 23:59:59' ";
            //}

            List <Model.Task> listchange = BllModel.GetTaskEntityList(where, CurrentPage, ItemsPerPage, out totalCount);

            var list = listchange.Select(item => new
            {
                content = item.TContent,
                //type = item.TTypeStr,
                date = item.TDateTime.ToString()
            });

            return(jss.Serialize(new { Items = list, TotalCount = totalCount }));
        }
示例#2
0
        public override void ProcessRequest(HttpContext context)
        {
            base.ProcessRequest(context);
            string strWhere = "'1'='1'";
            string type     = "";
            string mkey     = "";

            if (!string.IsNullOrEmpty(context.Request["mKey"]))
            {
                mkey = context.Request["mKey"];
            }
            if (!BllModel.TModel.Role.Super)
            {
                mkey = BllModel.TModel.MID;
            }
            if (!string.IsNullOrEmpty(mkey))
            {
                strWhere += " and TFromMID = '" + mkey + "' ";
            }

            strWhere += " and TType = '008' ";

            int count;
            List <Model.Task> ListTask = BllModel.GetTaskEntityList(strWhere, pageIndex, pageSize, out count);

            StringBuilder sb = new StringBuilder();

            for (int i = 0; i < ListTask.Count; i++)
            {
                sb.Append(ListTask[i].ID + "~");
                sb.Append((i + 1) + (pageIndex - 1) * pageSize + "~");
                sb.Append(ListTask[i].TFromMID + "~");
                //sb.Append(ListTask[i].TToMID + "~");
                sb.Append(ListTask[i].TContent + "~");
                sb.Append(ListTask[i].TTypeStr + "~");
                sb.Append(ListTask[i].TDateTime.ToString("yyyy-MM-dd HH:mm"));
                sb.Append("≌");
            }
            var info = new { PageData = sb.ToString(), TotalCount = count };

            //var json = new { PageData = sb.ToString(), TotalCount = count };匿名类
            context.Response.Write(JavaScriptConvert.SerializeObject(info));
        }
示例#3
0
        public override void ProcessRequest(HttpContext context)
        {
            base.ProcessRequest(context);
            string strWhere = "'1'='1'"; string type = ""; string mkey = "";

            Model.Member memberModel = (TModel == null ? BllModel.TModel : TModel);
            if (!string.IsNullOrEmpty(context.Request["tState"]))
            {
                type = context.Request["tState"];
            }
            if (!string.IsNullOrEmpty(context.Request["mKey"]))
            {
                mkey = context.Request["mKey"];
            }
            if (!memberModel.Role.Super)
            {
                mkey = memberModel.MID;
            }

            if (type == "001")
            {
                strWhere += " and TType='001'";
                if (!string.IsNullOrEmpty(mkey))
                {
                    strWhere += " and TToMID='" + mkey + "'";
                }
            }
            else
            {
                if (type == "false")
                {
                    strWhere += " and IfRead='" + type + "'";
                    if (!string.IsNullOrEmpty(mkey))
                    {
                        strWhere += " and TToMID='" + mkey + "'";
                    }
                }
                else if (type == "to")
                {
                    if (!string.IsNullOrEmpty(mkey))
                    {
                        strWhere += " and TToMID='" + mkey + "'";
                    }
                }
                else if (type == "from")
                {
                    if (!string.IsNullOrEmpty(mkey))
                    {
                        strWhere += " and TFromMID='" + mkey + "'";
                    }
                }
                strWhere += " and TType<>'001'";
            }

            if (!string.IsNullOrEmpty(context.Request["nTitle"]))
            {
                strWhere += " and TContent like '%" + HttpUtility.UrlDecode(context.Request["nTitle"]) + "%'";
            }

            string AgencyCode = "";

            if (!string.IsNullOrEmpty(context.Request["typeList"]))
            {
                if (context.Request["typeList"].Contains("true"))
                {
                    AgencyCode = "TState='1'";
                }
                if (context.Request["typeList"].Contains("false"))
                {
                    if (AgencyCode != "")
                    {
                        AgencyCode = "";
                    }
                    else
                    {
                        AgencyCode = "TState='0'";
                    }
                }
            }
            if (AgencyCode != "")
            {
                strWhere += " and " + AgencyCode;
            }

            strWhere += " and ( replyid is null or replyid = 0 ) ";

            int count;
            List <Model.Task> ListTask = BllModel.GetTaskEntityList(strWhere, pageIndex, pageSize, out count);

            StringBuilder sb = new StringBuilder();

            for (int i = 0; i < ListTask.Count; i++)
            {
                Model.Task task = BllModel.GetReplyTask(ListTask[i].ID);
                sb.Append(ListTask[i].ID + "~");
                sb.Append((i + 1) + (pageIndex - 1) * pageSize + "~");
                sb.Append(ListTask[i].TFromMID + "~");
                sb.Append(ListTask[i].TToMID + "~");
                if (task == null)
                {
                    sb.Append(ListTask[i].TContent + "~");
                }
                else
                {
                    sb.Append(ListTask[i].TContent + "<br />回复:<br />" + task.TContent + "~");
                }
                sb.Append(ListTask[i].TTypeStr + "~");
                sb.Append(ListTask[i].TDateTime.ToString("yyyy-MM-dd HH:mm") + "~");
                sb.Append("<input type=\"button\" class=\"btn btn-success btn-sm\" value=\"查看\" onclick=\"callhtml('../Message/TaskView.aspx?id=" + ListTask[i].ID + "','邮件查看');\" />");
                if (task == null)
                {
                    sb.Append("<input type=\"button\" class=\"btn btn-success btn-sm\" value=\"回复\" onclick=\"callhtml('../Message/TaskReply.aspx?id=" + ListTask[i].ID + "','回复邮件');\" />");
                }
                sb.Append("≌");
            }
            var info = new { PageData = Traditionalized(sb), TotalCount = count };

            //var json = new { PageData = sb.ToString(), TotalCount = count };匿名类
            context.Response.Write(JavaScriptConvert.SerializeObject(info));
        }
示例#4
0
        public override void ProcessRequest(HttpContext context)
        {
            base.ProcessRequest(context);
            string strWhere = "'1'='1'"; string type = ""; string mkey = "";

            Model.Member memberModel = (TModel == null ? BllModel.TModel : TModel);
            if (!string.IsNullOrEmpty(context.Request["tState"]))
            {
                type = context.Request["tState"];
            }
            if (!string.IsNullOrEmpty(context.Request["mKey"]))
            {
                mkey = context.Request["mKey"];
            }
            if (!memberModel.Role.Super)
            {
                mkey = memberModel.MID;
            }

            if (type == "001")
            {
                strWhere += " and TType='001'";
                if (!string.IsNullOrEmpty(mkey))
                {
                    strWhere += " and TToMID='" + mkey + "'";
                }
            }
            else
            {
                if (type == "false")
                {
                    strWhere += " and IfRead='" + type + "'";
                    if (!string.IsNullOrEmpty(mkey))
                    {
                        strWhere += " and TToMID='" + mkey + "'";
                    }
                }
                else if (type == "to")
                {
                    if (!string.IsNullOrEmpty(mkey))
                    {
                        strWhere += " and TToMID='" + mkey + "'";
                    }
                }
                else if (type == "from")
                {
                    if (!string.IsNullOrEmpty(mkey))
                    {
                        strWhere += " and TFromMID='" + mkey + "'";
                    }
                }
                strWhere += " and TType<>'001' and TType<>'008' ";
            }

            if (!string.IsNullOrEmpty(context.Request["nTitle"]))
            {
                strWhere += " and TContent like '%" + HttpUtility.UrlDecode(context.Request["nTitle"]) + "%'";
            }

            string AgencyCode = "";

            if (!string.IsNullOrEmpty(context.Request["typeList"]))
            {
                if (context.Request["typeList"].Contains("true"))
                {
                    AgencyCode = "TState='1'";
                }
                if (context.Request["typeList"].Contains("false"))
                {
                    if (AgencyCode != "")
                    {
                        AgencyCode = "";
                    }
                    else
                    {
                        AgencyCode = "TState='0'";
                    }
                }
            }
            if (AgencyCode != "")
            {
                strWhere += " and " + AgencyCode;
            }

            int count;
            List <Model.Task> ListTask = BllModel.GetTaskEntityList(strWhere, pageIndex, pageSize, out count);

            StringBuilder sb = new StringBuilder();

            for (int i = 0; i < ListTask.Count; i++)
            {
                sb.Append(ListTask[i].ID + "~");
                sb.Append((i + 1) + (pageIndex - 1) * pageSize + "~");
                sb.Append(ListTask[i].TFromMID + "~");
                sb.Append(ListTask[i].TToMID + "~");
                sb.Append(ListTask[i].TContent + "~");
                sb.Append(ListTask[i].TTypeStr + "~");
                sb.Append(ListTask[i].TDateTime.ToString("yyyy-MM-dd HH:mm"));
                sb.Append("≌");
            }
            var info = new { PageData = Traditionalized(sb), TotalCount = count };

            //var json = new { PageData = sb.ToString(), TotalCount = count };匿名类
            context.Response.Write(JavaScriptConvert.SerializeObject(info));
        }