Exemplo n.º 1
0
        public static ViewRoomBasic[] GetViewRoomBasicListByKeywords(int ProjectID, int RoomID, string Keywords, long startRowIndex, int pageSize, out long totalRows)
        {
            List <SqlParameter> parameters = new List <SqlParameter>();
            List <string>       conditions = new List <string>();

            conditions.Add("isnull([isParent],0)=0");
            if (ProjectID > 0)
            {
                conditions.Add("[AllParentID] like '%," + ProjectID + ",%'");
            }
            if (RoomID > 0)
            {
                conditions.Add("[RoomID]=@RoomID");
                parameters.Add(new SqlParameter("@RoomID", RoomID));
            }
            if (!string.IsNullOrEmpty(Keywords))
            {
                conditions.Add("([Name] like @Keywords or [RelationName] like @Keywords or [RelatePhoneNumber] like @Keywords)");
                parameters.Add(new SqlParameter("@Keywords", "%" + Keywords + "%"));
            }
            string fieldList = "[ViewRoomBasic].* ";
            string Statement = " from [ViewRoomBasic] where " + string.Join(" and ", conditions.ToArray());

            ViewRoomBasic[] list = new ViewRoomBasic[] { };
            list = GetList <ViewRoomBasic>(fieldList, Statement, parameters, "order by DefaultOrder asc", startRowIndex, pageSize, out totalRows).ToArray();
            return(list);
        }
Exemplo n.º 2
0
        public static ViewRoomBasic[] GetRoomBasicListByOpenID(string OpenID)
        {
            List <SqlParameter> parameters = new List <SqlParameter>();
            List <string>       conditions = new List <string>();

            conditions.Add("[isParent]=0");
            conditions.Add("([RoomID] in (select [ProjectID] from [WechatUser_Project] where [OpenID]=@OpenID) or [RoomID] in (select [RoomID] from [RoomRelation] where [GUID] in (select [GUID] from [RoomRelation] where [RoomID] in (select [ProjectID] from [WechatUser_Project] where [OpenID]=@OpenID))))");
            parameters.Add(new SqlParameter("@OpenID", OpenID));
            ViewRoomBasic[] list = new ViewRoomBasic[] { };
            list = GetList <ViewRoomBasic>("select * from [ViewRoomBasic] where  " + string.Join(" and ", conditions.ToArray()) + " order by [DefaultOrder] asc", parameters).ToArray();
            return(list);
        }
Exemplo n.º 3
0
        public static Ui.DataGrid GetViewRoomBasicGrid(List <int> ProjectIDList, List <int> RoomIDList, string Keywords, string orderBy, long startRowIndex, int pageSize, bool canexport = false)
        {
            long totalRows = 0;
            List <SqlParameter> parameters = new List <SqlParameter>();
            List <string>       conditions = new List <string>();

            conditions.Add("isnull([isParent],0)=0");
            if (!string.IsNullOrEmpty(Keywords))
            {
                conditions.Add("[Name] like @Keywords");
                parameters.Add(new SqlParameter("@Keywords", "%" + Keywords + "%"));
            }
            if (ProjectIDList.Count > 0)
            {
                List <string> cmdlist = new List <string>();
                foreach (var ProjectID in ProjectIDList)
                {
                    cmdlist.Add("[AllParentID] like '%," + ProjectID + ",%'");
                }
                conditions.Add("(" + string.Join(" or ", cmdlist.ToArray()) + ")");
            }
            if (RoomIDList.Count > 0)
            {
                conditions.Add("[RoomID] in (" + string.Join(",", RoomIDList.ToArray()) + ")");
            }
            if (string.IsNullOrEmpty(orderBy))
            {
                orderBy = " order by DefaultOrder asc";
            }
            string fieldList = "[ViewRoomBasic].* ";
            string Statement = " from ViewRoomBasic where " + string.Join(" and ", conditions.ToArray());

            ViewRoomBasic[] list = new ViewRoomBasic[] { };
            if (canexport)
            {
                list      = GetList <ViewRoomBasic>("select " + fieldList + Statement + " " + orderBy, parameters).ToArray();
                totalRows = list.Length;
            }
            else
            {
                list = GetList <ViewRoomBasic>(fieldList, Statement, parameters, orderBy, startRowIndex, pageSize, out totalRows).ToArray();
            }
            DataAccess.Ui.DataGrid dg = new Ui.DataGrid();
            dg.rows  = list;
            dg.total = totalRows;
            dg.page  = pageSize;
            return(dg);
        }
Exemplo n.º 4
0
        public static Ui.DataGrid GetMall_RoomOwnerBalanceDetailApplicationGridByKeywords(string Keywords, long startRowIndex, int pageSize, List <int> RoomIDList, List <int> ProjectIDList, DateTime StartTime, DateTime EndTime, int UserID = 0)
        {
            var room_list = ViewRoomBasic.GetRoomBasicListByKeywords(RoomIDList, ProjectIDList, Keywords, HavingOrder: true);

            if (room_list.Length == 0)
            {
                return(new Ui.DataGrid());
            }
            var order_analysis_list = Mall_OrderAnalysis.GetMall_OrderAnalysisList(StartTime, EndTime);
            var user_project_list   = Mall_UserProject.GetMall_UserProjectListHavingOrders();
            var balance_list        = Mall_RoomOwnerBalanceAnalysis.GetMall_RoomOwnerBalanceAnalysisList();
            List <Mall_RoomOwnerBalanceApplicationDetail> list = new List <Mall_RoomOwnerBalanceApplicationDetail>();

            foreach (var item in room_list)
            {
                var my_user_project_list = user_project_list.Where(p => p.ProjectID == item.RoomID).ToArray();
                if (my_user_project_list.Length == 0)
                {
                    continue;
                }
                var my_useridlist          = my_user_project_list.Select(p => p.UserID).ToArray();
                var my_order_analysis_list = order_analysis_list.Where(p => my_useridlist.Contains(p.UserID)).ToArray();
                if (my_order_analysis_list.Length == 0)
                {
                    continue;
                }
                var data = new Mall_RoomOwnerBalanceApplicationDetail();
                data.RoomID    = item.RoomID;
                data.FullName  = item.FullName;
                data.RoomName  = item.Name;
                data.TotalCost = my_order_analysis_list.Sum(p => p.TotalCost);
                var my_balance_list = balance_list.Where(p => p.ProjectID == item.RoomID).ToArray();
                data.TotalBalanceAmount = my_balance_list.Sum(p => p.TotalCost);
                if (data.TotalCost > 0)
                {
                    list.Add(data);
                }
            }
            var finallist = list.Skip(Convert.ToInt32(startRowIndex)).Take(pageSize).ToArray();

            DataAccess.Ui.DataGrid dg = new Ui.DataGrid();
            dg.rows  = finallist;
            dg.total = list.Count;
            dg.page  = pageSize;
            return(dg);
        }
Exemplo n.º 5
0
        public static ViewRoomBasic[] GetViewRoomBasicListByUserID(User user, bool IncludeRelation = true, string PhoneNumber = "")
        {
            var phone_list = RoomPhoneRelation.GetRoomPhoneRelationsByPhone(PhoneNumber, uid: user.FinalUserID);

            Mall_UserProject.Insert_UserProjectList(phone_list, user);
            List <SqlParameter> parameters = new List <SqlParameter>();
            List <string>       conditions = new List <string>();

            conditions.Add("[isParent]=0");
            List <string> cmdlist  = new List <string>();
            string        cmdwhere = " and [UserID]=@UserID and isnull([IsDisable],0)=0";

            cmdlist.Add("[RoomID] in (select [ProjectID] from [Mall_UserProject] where 1=1 " + cmdwhere + ")");
            if (IncludeRelation)
            {
                cmdlist.Add("[RoomID] in (select [RoomID] from [RoomRelation] where [GUID] in (select [GUID] from [RoomRelation] where [RoomID] in (select [ProjectID] from [Mall_UserProject] where 1=1 " + cmdwhere + ")))");
            }
            conditions.Add("(" + string.Join(" or ", cmdlist.ToArray()) + ")");
            parameters.Add(new SqlParameter("@UserID", user.FinalUserID));
            ViewRoomBasic[] list = new ViewRoomBasic[] { };
            list = GetList <ViewRoomBasic>("select * from [ViewRoomBasic] where  " + string.Join(" and ", conditions.ToArray()) + " order by [DefaultOrder] asc", parameters).ToArray();
            return(list);
        }
Exemplo n.º 6
0
        public static Ui.DataGrid GetProjectDetailsGridByRoomID(int RoomID, bool loadIn, string Keywords, string orderBy, long startRowIndex, int pageSize)
        {
            long totalRows = 0;
            List <SqlParameter> parameters = new List <SqlParameter>();
            List <string>       conditions = new List <string>();

            conditions.Add("[RoomID]=@RoomID");
            parameters.Add(new SqlParameter("@RoomID", RoomID));
            string table    = string.Empty;
            string cmdwhere = string.Empty;

            if (!string.IsNullOrEmpty(Keywords))
            {
                cmdwhere += " and ([Name] like @Keywords or [PName] like @Keywords)";
                parameters.Add(new SqlParameter("@Keywords", "%" + Keywords + "%"));
            }
            if (loadIn)
            {
                table = @"(select * from [ViewRoomBasic] where [RoomID] in (select RoomID from [RoomRelation] where [GUID] in (select [GUID] from [RoomRelation] where " + string.Join(" and ", conditions.ToArray()) + ")) and [RoomID] in(select [ID] from [Project] where [isParent]=0) " + cmdwhere + ") [ViewProjectRelation]";
            }
            else
            {
                table = @"(select * from [ViewRoomBasic] where [RoomID] not in (select RoomID from [RoomRelation] where [GUID] in (select [GUID] from [RoomRelation] where " + string.Join(" and ", conditions.ToArray()) + ")) and [RoomID] in(select [ID] from [Project] where [isParent]=0)" + cmdwhere + ") [ViewProjectRelation]";
            }

            string fieldList = "[ViewProjectRelation].* ";
            string Statement = " from " + table;

            ViewRoomBasic[] list = new ViewRoomBasic[] { };
            list = GetList <ViewRoomBasic>(fieldList, Statement, parameters, orderBy, startRowIndex, pageSize, out totalRows).ToArray();
            DataAccess.Ui.DataGrid dg = new Ui.DataGrid();
            dg.rows  = list;
            dg.total = totalRows;
            dg.page  = pageSize;
            return(dg);
        }
Exemplo n.º 7
0
        public static Ui.DataGrid GetRoomBasicListByKeywords(List <int> RoomIDList, List <int> ProjectIDList, string RoomOwner, string OwnerPhone, string Keywords, List <string> SearchAreas, string orderBy, long startRowIndex, int pageSize, string OpenID, int ConnectStatus, bool canexport = false, int CompanyID = 0)
        {
            long totalRows = 0;
            List <SqlParameter> parameters = new List <SqlParameter>();
            List <string>       conditions = new List <string>();

            conditions.Add("isnull([isParent],0)=0");
            if (CompanyID > 0)
            {
                conditions.Add("exists(select 1 from Project where [CompanyID]=@CompanyID and [ID]=ViewRoomBasic.RoomID)");
                parameters.Add(new SqlParameter("@CompanyID", CompanyID));
            }
            if (!string.IsNullOrEmpty(OpenID))
            {
                if (ConnectStatus > int.MinValue)
                {
                    if (ConnectStatus == 1)
                    {
                        conditions.Add("[RoomID] in (select [ProjectID] from [WechatUser_Project] where OpenID=@OpenID)");
                        parameters.Add(new SqlParameter("@OpenID", OpenID));
                    }
                    else if (ConnectStatus == 0)
                    {
                        conditions.Add("[RoomID] not in (select [ProjectID] from [WechatUser_Project] where OpenID=@OpenID)");
                        parameters.Add(new SqlParameter("@OpenID", OpenID));
                    }
                }
            }
            #region 关键字查询
            string cmd = string.Empty;

            if (!string.IsNullOrEmpty(Keywords))
            {
                cmd += "  and  (" + GetSearchConditions(SearchAreas, Keywords) + ")";
            }
            #endregion
            if (ProjectIDList.Count > 0)
            {
                List <string> cmdlist = new List <string>();
                foreach (var ProjectID in ProjectIDList)
                {
                    cmdlist.Add("([AllParentID] like '%," + ProjectID + ",%' or [RoomID] =" + ProjectID + ")");
                }
                conditions.Add("(" + string.Join(" or ", cmdlist.ToArray()) + ")");
            }
            if (RoomIDList.Count > 0)
            {
                List <string> cmdlist = ViewRoomFeeHistory.GetRoomIDListConditions(RoomIDList, IncludeRelation: false);
                conditions.Add("(" + string.Join(" or ", cmdlist.ToArray()) + ")");
            }
            if (!string.IsNullOrEmpty(RoomOwner))
            {
                conditions.Add("[RoomOwner]=@RoomOwner");
                parameters.Add(new SqlParameter("@RoomOwner", RoomOwner));
            }
            if (!string.IsNullOrEmpty(OwnerPhone))
            {
                conditions.Add("[OwnerPhone]=@OwnerPhone");
                parameters.Add(new SqlParameter("@OwnerPhone", OwnerPhone));
            }
            string          fieldList = "[ViewRoomBasic].*";
            string          Statement = " from [ViewRoomBasic] where  " + string.Join(" and ", conditions.ToArray()) + cmd;
            ViewRoomBasic[] list      = new ViewRoomBasic[] { };
            var             phoneList = new RoomPhoneRelation[] { };
            int             MinRoomID = 0;
            int             MaxRoomID = 0;
            if (canexport)
            {
                list = GetList <ViewRoomBasic>("select " + fieldList + Statement + " " + orderBy, parameters).ToArray();
            }
            else
            {
                list = GetList <ViewRoomBasic>(fieldList, Statement, parameters, orderBy, startRowIndex, pageSize, out totalRows).ToArray();
            }
            DataAccess.Ui.DataGrid dg = new Ui.DataGrid();
            if (list.Length == 0)
            {
                dg.rows  = list;
                dg.total = 0;
                dg.page  = pageSize;
                return(dg);
            }
            MinRoomID = list.Min(p => p.RoomID);
            MaxRoomID = list.Max(p => p.RoomID);
            phoneList = RoomPhoneRelation.GetRoomPhoneRelationListByMinMaxRoomID(MinRoomID, MaxRoomID);
            var fieldlist = Foresight.DataAccess.DefineField.GetDefineFieldsByTable_Name(Utility.EnumModel.DefineFieldTableName.RoomBasic.ToString()).Where(p => p.IsShown).ToArray();

            var contentlist = Foresight.DataAccess.RoomBasicField.GetRoomBasicFieldsByRoomIDList(MinRoomID, MaxRoomID);
            var results     = list.Select(p =>
            {
                var dic = p.ToJsonObject(ignoreDBColumn: false);
                dic["RoomOwner1Name"]  = string.Empty;
                dic["RoomOwner1Phone"] = string.Empty;
                dic["RoomOwner2Name"]  = string.Empty;
                dic["RoomOwner2Phone"] = string.Empty;
                dic["Rent1Name"]       = string.Empty;
                dic["Rent1Phone"]      = string.Empty;
                if (phoneList.Length > 0)
                {
                    var myPhoneList1 = phoneList.Where(q => q.RoomID == p.RoomID && q.RelationType.Equals("homefamily")).OrderByDescending(q => q.IsDefault).ThenBy(q => q.ID).ToArray();
                    var myPhoneList2 = phoneList.Where(q => q.RoomID == p.RoomID && q.RelationType.Equals("rentfamily")).OrderByDescending(q => q.IsDefault).ThenBy(q => q.ID).ToArray();
                    int count        = 0;
                    foreach (var item in myPhoneList1)
                    {
                        count++;
                        dic["RoomOwner" + count.ToString() + "Name"]  = item.RelationName;
                        dic["RoomOwner" + count.ToString() + "Phone"] = item.RelatePhoneNumber;
                    }
                    count = 0;
                    foreach (var item in myPhoneList2)
                    {
                        count++;
                        dic["Rent" + count.ToString() + "Name"]  = item.RelationName;
                        dic["Rent" + count.ToString() + "Phone"] = item.RelatePhoneNumber;
                    }
                }

                foreach (var item in fieldlist)
                {
                    var contentmodel    = contentlist.FirstOrDefault(q => q.FieldID == item.ID && q.RoomID == p.RoomID);
                    dic[item.FieldName] = contentmodel == null ? "" : contentmodel.FieldContent;
                }
                return(dic);
            }).ToList();
            dg.rows  = results;
            dg.total = totalRows;
            dg.page  = pageSize;
            return(dg);
        }
Exemplo n.º 8
0
        public static Ui.DataGrid GetRoomBasicListByKeywords(List <int> RoomIDList, List <int> ProjectIDList, string RoomOwner, string OwnerPhone, string Keywords, List <string> SearchAreas, string orderBy, long startRowIndex, int pageSize, string OpenID, int ConnectStatus, bool canexport = false)
        {
            long totalRows = 0;
            List <SqlParameter> parameters = new List <SqlParameter>();
            List <string>       conditions = new List <string>();

            conditions.Add("isnull([isParent],0)=0");
            if (!string.IsNullOrEmpty(OpenID))
            {
                if (ConnectStatus > int.MinValue)
                {
                    if (ConnectStatus == 1)
                    {
                        conditions.Add("[RoomID] in (select [ProjectID] from [WechatUser_Project] where OpenID=@OpenID)");
                        parameters.Add(new SqlParameter("@OpenID", OpenID));
                    }
                    else if (ConnectStatus == 0)
                    {
                        conditions.Add("[RoomID] not in (select [ProjectID] from [WechatUser_Project] where OpenID=@OpenID)");
                        parameters.Add(new SqlParameter("@OpenID", OpenID));
                    }
                }
            }
            #region 关键字查询
            string cmd = string.Empty;

            if (!string.IsNullOrEmpty(Keywords))
            {
                cmd += "  and  (" + GetSearchConditions(SearchAreas, Keywords) + ")";
            }
            #endregion
            if (ProjectIDList.Count > 0)
            {
                List <string> cmdlist = new List <string>();
                foreach (var ProjectID in ProjectIDList)
                {
                    cmdlist.Add("([AllParentID] like '%," + ProjectID + ",%' or [RoomID] =" + ProjectID + ")");
                }
                conditions.Add("(" + string.Join(" or ", cmdlist.ToArray()) + ")");
            }
            if (RoomIDList.Count > 0)
            {
                List <string> cmdlist = ViewRoomFeeHistory.GetRoomIDListConditions(RoomIDList, IncludeRelation: false);
                conditions.Add("(" + string.Join(" or ", cmdlist.ToArray()) + ")");
            }
            if (!string.IsNullOrEmpty(RoomOwner))
            {
                conditions.Add("[RoomOwner]=@RoomOwner");
                parameters.Add(new SqlParameter("@RoomOwner", RoomOwner));
            }
            if (!string.IsNullOrEmpty(OwnerPhone))
            {
                conditions.Add("[OwnerPhone]=@OwnerPhone");
                parameters.Add(new SqlParameter("@OwnerPhone", OwnerPhone));
            }
            string          fieldList = "[ViewRoomBasic].*";
            string          Statement = " from [ViewRoomBasic] where  " + string.Join(" and ", conditions.ToArray()) + cmd;
            ViewRoomBasic[] list      = new ViewRoomBasic[] { };
            var             phoneList = new RoomPhoneRelation[] { };
            int             MinRoomID = 0;
            int             MaxRoomID = 0;
            if (canexport)
            {
                list = GetList <ViewRoomBasic>("select " + fieldList + Statement + " " + orderBy, parameters).ToArray();
                if (list.Length > 0)
                {
                    MinRoomID = list.Min(p => p.RoomID);
                    MaxRoomID = list.Max(p => p.RoomID);
                }
                phoneList = RoomPhoneRelation.GetRoomPhoneRelationListByMinMaxRoomID(MinRoomID, MaxRoomID);
            }
            else
            {
                list = GetList <ViewRoomBasic>(fieldList, Statement, parameters, orderBy, startRowIndex, pageSize, out totalRows).ToArray();
                if (list.Length > 0)
                {
                    MinRoomID = list.Min(p => p.RoomID);
                    MaxRoomID = list.Max(p => p.RoomID);
                }
            }
            DataAccess.Ui.DataGrid dg = new Ui.DataGrid();
            var fieldlist             = Foresight.DataAccess.DefineField.GetDefineFieldsByTable_Name(Utility.EnumModel.DefineFieldTableName.RoomBasic.ToString()).Where(p => p.IsShown).ToArray();

            var contentlist = Foresight.DataAccess.RoomBasicField.GetRoomBasicFieldsByRoomIDList(MinRoomID, MaxRoomID);

            var results = list.Select(p =>
            {
                var dic = p.ToJsonObject(ignoreDBColumn: false);
                if (phoneList.Length > 0)
                {
                    var myPhoneList = phoneList.Where(q => q.RoomID == p.RoomID).OrderByDescending(q => q.IsDefault).ThenBy(q => q.ID).ToArray();
                    if (myPhoneList.Length > 0)
                    {
                        var strList = myPhoneList.Where(q => !string.IsNullOrEmpty(q.RelationName)).Select(q => q.RelationName).ToArray();
                        if (strList.Length > 0)
                        {
                            dic["RelationName"] = string.Join(",", strList);
                        }
                        strList = myPhoneList.Where(q => !string.IsNullOrEmpty(q.RelationTypeDesc)).Select(q => q.RelationTypeDesc).ToArray();
                        if (strList.Length > 0)
                        {
                            dic["RelationTypeDesc"] = string.Join(",", strList);
                        }
                        strList = myPhoneList.Where(q => !string.IsNullOrEmpty(q.RelatePhoneNumber)).Select(q => q.RelatePhoneNumber).ToArray();
                        if (strList.Length > 0)
                        {
                            dic["RelatePhoneNumber"] = string.Join(",", strList);
                        }
                        strList = myPhoneList.Where(q => !string.IsNullOrEmpty(q.IDCardTypeDesc)).Select(q => q.IDCardTypeDesc).ToArray();
                        if (strList.Length > 0)
                        {
                            dic["IDCardTypeDesc"] = string.Join(",", strList);
                        }
                        strList = myPhoneList.Where(q => !string.IsNullOrEmpty(q.RelationIDCard)).Select(q => q.RelationIDCard).ToArray();
                        if (strList.Length > 0)
                        {
                            dic["RelationIDCard"] = string.Join(",", strList);
                        }
                        strList = myPhoneList.Where(q => !string.IsNullOrEmpty(q.BirthdayDesc)).Select(q => q.BirthdayDesc).ToArray();
                        if (strList.Length > 0)
                        {
                            dic["Birthday"] = string.Join(",", strList);
                        }
                        strList = myPhoneList.Where(q => !string.IsNullOrEmpty(q.EmailAddress)).Select(q => q.EmailAddress).ToArray();
                        if (strList.Length > 0)
                        {
                            dic["EmailAddress"] = string.Join(",", strList);
                        }
                        strList = myPhoneList.Where(q => !string.IsNullOrEmpty(q.HomeAddress)).Select(q => q.HomeAddress).ToArray();
                        if (strList.Length > 0)
                        {
                            dic["HomeAddress"] = string.Join(",", strList);
                        }
                        strList = myPhoneList.Where(q => !string.IsNullOrEmpty(q.OfficeAddress)).Select(q => q.OfficeAddress).ToArray();
                        if (strList.Length > 0)
                        {
                            dic["OfficeAddress"] = string.Join(",", strList);
                        }
                        strList = myPhoneList.Where(q => !string.IsNullOrEmpty(q.BankAccountName)).Select(q => q.BankAccountName).ToArray();
                        if (strList.Length > 0)
                        {
                            dic["BankAccountName"] = string.Join(",", strList);
                        }
                        strList = myPhoneList.Where(q => !string.IsNullOrEmpty(q.BankAccountNo)).Select(q => q.BankAccountNo).ToArray();
                        if (strList.Length > 0)
                        {
                            dic["BankAccountNo"] = string.Join(",", strList);
                        }
                        strList = myPhoneList.Where(q => !string.IsNullOrEmpty(q.CustomOne)).Select(q => q.CustomOne).ToArray();
                        if (strList.Length > 0)
                        {
                            dic["RelateCustomOne"] = string.Join(",", strList);
                        }
                        strList = myPhoneList.Where(q => !string.IsNullOrEmpty(q.CustomTwo)).Select(q => q.CustomTwo).ToArray();
                        if (strList.Length > 0)
                        {
                            dic["RelateCustomTwo"] = string.Join(",", strList);
                        }
                        strList = myPhoneList.Where(q => !string.IsNullOrEmpty(q.CustomThree)).Select(q => q.CustomThree).ToArray();
                        if (strList.Length > 0)
                        {
                            dic["RelateCustomThree"] = string.Join(",", strList);
                        }
                        strList = myPhoneList.Where(q => !string.IsNullOrEmpty(q.CustomFour)).Select(q => q.CustomFour).ToArray();
                        if (strList.Length > 0)
                        {
                            dic["RelateCustomFour"] = string.Join(",", strList);
                        }
                        strList = myPhoneList.Where(q => !string.IsNullOrEmpty(q.Interesting)).Select(q => q.Interesting).ToArray();
                        if (strList.Length > 0)
                        {
                            dic["Interesting"] = string.Join(",", strList);
                        }
                        strList = myPhoneList.Where(q => !string.IsNullOrEmpty(q.ConsumeMore)).Select(q => q.ConsumeMore).ToArray();
                        if (strList.Length > 0)
                        {
                            dic["ConsumeMore"] = string.Join(",", strList);
                        }
                        strList = myPhoneList.Where(q => !string.IsNullOrEmpty(q.BelongTeam)).Select(q => q.BelongTeam).ToArray();
                        if (strList.Length > 0)
                        {
                            dic["BelongTeam"] = string.Join(",", strList);
                        }
                        strList = myPhoneList.Where(q => !string.IsNullOrEmpty(q.OneCardNumber)).Select(q => q.OneCardNumber).ToArray();
                        if (strList.Length > 0)
                        {
                            dic["OneCardNumber"] = string.Join(",", strList);
                        }
                        strList = myPhoneList.Where(q => !string.IsNullOrEmpty(q.ChargeForMan)).Select(q => q.ChargeForMan).ToArray();
                        if (strList.Length > 0)
                        {
                            dic["ChargeForMan"] = string.Join(",", strList);
                        }
                        strList = myPhoneList.Where(q => !string.IsNullOrEmpty(q.IsDefaultDesc)).Select(q => q.IsDefaultDesc).ToArray();
                        if (strList.Length > 0)
                        {
                            dic["IsDefaultDesc"] = string.Join(",", strList);
                        }
                        strList = myPhoneList.Where(q => !string.IsNullOrEmpty(q.IsChargeFeeDesc)).Select(q => q.IsChargeFeeDesc).ToArray();
                        if (strList.Length > 0)
                        {
                            dic["IsChargeFeeDesc"] = string.Join(",", strList);
                        }
                        strList = myPhoneList.Where(q => !string.IsNullOrEmpty(q.RelationPropertyDesc)).Select(q => q.RelationPropertyDesc).ToArray();
                        if (strList.Length > 0)
                        {
                            dic["RelationPropertyDesc"] = string.Join(",", strList);
                        }
                        strList = myPhoneList.Where(q => !string.IsNullOrEmpty(q.CompanyName)).Select(q => q.CompanyName).ToArray();
                        if (strList.Length > 0)
                        {
                            dic["CompanyName"] = string.Join(",", strList);
                        }
                        strList = myPhoneList.Where(q => !string.IsNullOrEmpty(q.IsChargeManDesc)).Select(q => q.IsChargeManDesc).ToArray();
                        if (strList.Length > 0)
                        {
                            dic["IsChargeManDesc"] = string.Join(",", strList);
                        }
                        strList = myPhoneList.Where(q => !string.IsNullOrEmpty(q.Remark)).Select(q => q.Remark).ToArray();
                        if (strList.Length > 0)
                        {
                            dic["RoomPhoneRelationRemark"] = string.Join(",", strList);
                        }
                    }
                }

                foreach (var item in fieldlist)
                {
                    var contentmodel    = contentlist.FirstOrDefault(q => q.FieldID == item.ID && q.RoomID == p.RoomID);
                    dic[item.FieldName] = contentmodel == null ? "" : contentmodel.FieldContent;
                }
                return(dic);
            }).ToList();
            dg.rows  = results;
            dg.total = totalRows;
            dg.page  = pageSize;
            return(dg);
        }