示例#1
0
        /// <summary>
        /// 查询所有选中人员数据
        /// </summary>
        /// <param name="httpContext"></param>
        public void QuerySelectedNodes(HttpContext httpContext)
        {
            var hashtable = new Hashtable();
            var riskNoticeSignerDal = new RiskNoticeSignerDal();
            var riskNoticeRiDal = new RiskNoticeRIDal();
            var userGroupDal = new UserGroupDal();
            var id = httpContext.Request.Params["id"];
            try
            {
                var data = userGroupDal.QueryAll();
                var dataList = from da in data.AsEnumerable()
                               select new
                               {
                                   id = da.Field<string>("id"),
                                   name = da.Field<string>("name"),
                                   pid = da.Field<string>("pid")
                               };
                //这里要查询已经发送给的用户列表,显示在[发送面板]的[已选择用户]列表中。
                //如果审核人或签发人改变,那么前台要提示用户审核人或签发人已经修改,要先删除通知单重新添加
                var data3 = riskNoticeRiDal.QueryRiskNoticeRI();
                var dataList3 = from da3 in data3.AsEnumerable()
                                select new
                                    {
                                        openid = da3.Field<string>("t_weixin"),
                                        type = da3.Field<int?>("t_type")
                                    };

                var data2 = riskNoticeSignerDal.QueryRiskNoticeSignerByRnid(id);
                if (data2.Rows.Count <= 0)
                {
                    data2 = riskNoticeRiDal.QueryRiskNoticeRI();
                    var dataList2 = from da2 in data2.AsEnumerable()
                                    select new
                                    {
                                        openid = da2.Field<string>("t_weixin"),
                                        nickname = da2.Field<string>("t_name"),
                                        type = da2.Field<int?>("t_type"),
                                        sjh = da2.Field<string>("t_phonenum")
                                    };
                    hashtable["data3"] = true;
                    hashtable["data2"] = dataList2.ToList();
                }
                else
                {
                    var dataList2 = from da2 in data2.AsEnumerable()
                                    select new
                                    {
                                        openid = da2.Field<string>("t_weixin"),
                                        nickname = da2.Field<string>("t_name"),
                                        type = da2.Field<int?>("t_type"),
                                        sjh = da2.Field<string>("t_phonenum")
                                    };
                    var tmp = dataList3.Any(s => (dataList2.Any(k => k.openid == s.openid && k.type == 1 && s.type == 1)));
                    tmp &= dataList3.Any(s => (dataList2.Any(k => k.openid == s.openid && k.type == 2 && s.type == 2)));
                    hashtable["data3"] = tmp;
                    hashtable["data2"] = dataList2.ToList();
                }
                hashtable["data"] = dataList.ToList();
                hashtable["isSuccess"] = true;
                hashtable["jsMethod"] = "ajax_QuerySelectedNodes";
                var json = _jss.Serialize(hashtable);
                httpContext.Response.Write(json);
            }
            catch (Exception e)
            {
                Log.Debug("出错信息:" + e.Message);
            }
        }
示例#2
0
 /// <summary>
 /// 查询所有组数据
 /// </summary>
 /// <param name="httpContext"></param>
 public void QueryAllGroup(HttpContext httpContext)
 {
     var hashtable = new Hashtable();
     var userGroupDal = new UserGroupDal();
     var infoReleaseDal = new InfoReleaseDal();
     var id = httpContext.Request.Params["id"];
     try
     {
         var data = userGroupDal.QueryAll();
         var dataList = from da in data.AsEnumerable()
                        select new
                            {
                                id = da.Field<string>("id"),
                                name = da.Field<string>("name"),
                                pid = da.Field<string>("pid")
                            };
         var groupData = infoReleaseDal.QuerySendGroup(id);
         if (groupData.Rows.Count > 0 && groupData.Rows[0]["SendGroup"] != null && !string.IsNullOrEmpty(groupData.Rows[0]["SendGroup"].ToString().Trim()))
         {
             var groupDataList = from groupDa in groupData.AsEnumerable()
                                 select new
                                 {
                                     sendGroup = groupDa.Field<string>("SendGroup")
                                 };
             hashtable["sendGroup"] = groupDataList.ToList();
         }
         hashtable["data"] = dataList.ToList();
         hashtable["isSuccess"] = true;
         hashtable["jsMethod"] = "ajax_QueryAllGroup";
         var json = _jss.Serialize(hashtable);
         httpContext.Response.Write(json);
     }
     catch (Exception e)
     {
         Log.Debug("出错信息:" + e.Message);
     }
 }