private string SeeClickPhoto(T_UserClick Uclick, long id)
        {
            if (Uclick == null)
            {
                //如果没有添加一条用户点击信息
                T_UserClick tucs = new T_UserClick();
                tucs.UserInfoId     = LoginUser.ID;
                tucs.ThisClick      = 1;
                tucs.LoginClickTime = Convert.ToDateTime(MvcApplication.GetT_time().ToString("yyyy-MM-dd"));
                T_UserClickService.AddEntity(tucs);
            }
            else
            {
                DateTime logintime = Convert.ToDateTime(Uclick.LoginClickTime);
                if (logintime.ToString("yyyy-MM-dd") == MvcApplication.GetT_time().ToString("yyyy-MM-dd"))
                {
                    Uclick.ThisClick = Uclick.ThisClick + 1;
                    T_UserClickService.EditEntity(Uclick);
                }
                else if (logintime < MvcApplication.GetT_time())
                {
                    Uclick.ThisClick      = 1;
                    Uclick.LoginClickTime = Convert.ToDateTime(MvcApplication.GetT_time().ToString("yyyy-MM-dd"));
                    T_UserClickService.EditEntity(Uclick);
                }
            }
            T_SeeClickPhoto tsc = new T_SeeClickPhoto();

            tsc.UserID  = LoginUser.ID;
            tsc.T_FgjID = id;
            T_SeeClickPhotoService.AddEntity(tsc);
            Common.MemcacheHelper.SetClickMCH(LoginUser.ID.ToString());
            return("OK");
        }
        public ActionResult GetHref()
        {
            var CityID    = UserInfo_CityService.LoadEntities(x => x.UserInfo_ID == LoginUser.ID).FirstOrDefault();
            int pageIndex = Request["page"] != null?int.Parse(Request["page"]) : 1;

            int pageSize = Request["rows"] != null?int.Parse(Request["rows"]) : 35;

            bool Strb = Request["boot_mp"] != null?Convert.ToBoolean(Request["boot_mp"]) : false;

            if (Strb)
            {
                #region MyRegion
                var           totalCount = int.MaxValue;
                UserInfoParam Uxms       = new UserInfoParam();
                if (Request["XmsId"] != null)
                {
                    #region 小秘书搜索
                    int XmsID = Request["XmsId"] != null?Convert.ToInt32(Request["XmsId"]) : 0;

                    var xms = ScrherSAVEService.LoadEntities(x => x.ID == XmsID && x.DEL == 0).FirstOrDefault();
                    addsechmishu(xms);
                    Uxms.PageIndex  = pageIndex;
                    Uxms.PageSize   = pageSize;
                    Uxms.TotalCount = totalCount;
                    Uxms.ssve       = xms;
                    Uxms.C_id       = CityID.T_City_ID;

                    #endregion
                }
                else
                {
                    #region 正常搜索
                    Uxms.PageIndex  = pageIndex;
                    Uxms.PageSize   = pageSize;
                    Uxms.TotalCount = totalCount;
                    Uxms.Mon1       = Request["Mon1"] != null ? Request["Mon1"].Trim().Length > 0 ? int.Parse(Request["Mon1"]) : 0 : 0;
                    Uxms.Mon2       = Request["Mon2"] != null ? Request["Mon2"].Trim().Length > 0 ? int.Parse(Request["Mon2"]) : 999999 : 999999;
                    Uxms.Pm1        = Request["Pm1"] != null ? Request["Pm1"].Trim().Length > 0 ? int.Parse(Request["Pm1"]) : 0 : 0;
                    Uxms.Pm2        = Request["Pm2"] != null ? Request["Pm2"].Trim().Length > 0 ? int.Parse(Request["Pm2"]) : 99999999 : 99999999;
                    Uxms.quyu       = Request["SeQuyu"].ToString();
                    Uxms.C_id       = CityID.T_City_ID;
                    #endregion
                }

                var actioninfolist = T_FGJHtmlDataService.LoadSearchPM(Uxms);
                var UscrClick      = T_SeeClickPhotoService.LoadEntities(x => x.UserID == LoginUser.ID).DefaultIfEmpty();
                var temp           = from a in actioninfolist
                                     select new
                {
                    ID          = a.ID,
                    HLName      = a.HLName,
                    Image_str   = (a.Image_str.IndexOf("有") >= 0 ? "有" : "无"),
                    FbTime      = a.FbTime,
                    PersonName  = a.PersonName,
                    Address     = a.Address,
                    photo       = UscrClick.Where(x => x.T_FgjID == a.ID).FirstOrDefault() != null ? a.photo : string.Empty,
                    Laiyuan     = a.Laiyuan,
                    FwSumMoney  = a.FwSumMoney,
                    FwHuXing    = a.FwHuXing,
                    FwLoucheng  = a.FwLoucheng,
                    FwZhuangxiu = a.FwZhuangxiu,
                    FwChaoxiang = a.FwChaoxiang,
                    FwNianxian  = a.FwNianxian,
                    FwMianji    = a.FwMianji
                };
                return(Json(new { rows = temp, total = Uxms.TotalCount }, JsonRequestBehavior.AllowGet));

                #endregion
            }
            else
            {
                string Str        = Request["Str"];
                var    totalCount = int.MaxValue;
                //构建搜索条件
                UserInfoParam userInfoParam = new UserInfoParam()
                {
                    PageIndex  = pageIndex,
                    PageSize   = pageSize,
                    TotalCount = totalCount,
                    Str        = Str,
                    C_id       = CityID.T_City_ID
                };
                if (Request["Tval"] != null)
                {
                    #region MyRegion
                    string   str  = Request["Tval"];
                    string[] list = str.Split(',');
                    for (int i = 0; i < list.Length; i++)
                    {
                        string[] ti     = list[i].Split('>');
                        int      cc     = int.Parse(ti[0]);
                        var      this_i = T_ItemsService.LoadEntities(x => x.ID == cc).FirstOrDefault();
                        switch (this_i.Icons)
                        {
                        case 0:
                            userInfoParam.money = ti[1].Trim() == "0" ? null : this_i.StrID.ToString();
                            break;

                        case 1:
                            userInfoParam.Pingmu = ti[1].Trim() == "0" ? null : this_i.StrID.ToString();
                            break;

                        case 2:
                            userInfoParam.Tingshi = ti[1].Trim() == "0" ? null : this_i.StrID.ToString();
                            break;

                        case 3:
                            userInfoParam.Zhuanxiu = ti[1].Trim() == "0" ? null : ti[1].ToString().Trim() == "装修" ? null : ti[1];
                            break;
                        }
                    }
                    #endregion
                }
                var temp = GetJson(userInfoParam);

                return(Json(new { rows = temp, total = userInfoParam.TotalCount }, JsonRequestBehavior.AllowGet));
            }
        }
        public ActionResult SeePhoto()
        {
            long id = long.Parse(Request["strId"]);
            //检查用户点击中是否有该用户
            var Uclick = T_UserClickService.LoadEntities(x => x.UserInfoId == LoginUser.ID).FirstOrDefault();
            //检查是否点击过查看电话
            var SeeClick = T_SeeClickPhotoService.LoadEntities(x => x.UserID == LoginUser.ID && x.T_FgjID == id).FirstOrDefault();

            if (UserInfoService.GetMaxClick(LoginUser.ID) >= LoginUser.Click)
            {
                return(Content(Common.SerializerHelper.SerializeToString(new { msg = "此用户账户查看量已上限!" })));
            }
            if (SeeClick != null)
            {
                return(Content(Common.SerializerHelper.SerializeToString(new { msg = "用户查看过该条信息" })));
                //  Content("用户没有点击过该信息,数据库确有这条信息,数据库BUG");
            }
            else
            {
                #region MyRegion
                //是否开启与主号保存冲突
                var t_bool = T_BoolItemService.LoadEntities(x => x.ID == 1).FirstOrDefault();

                //检查当前要查询的信息是否被当前主号下其他小号保存
                if (Convert.ToBoolean(LoginUser.ThisMastr))
                {
                    if (t_bool != null)
                    {
                        if (t_bool.BOLL_)
                        {
                            string temp = GetSelectSmallSave(LoginUser.ID, id);
                            if (temp != "on")
                            {
                                return(Content(Common.SerializerHelper.SerializeToString(new { msg = "其他成员已保存该信息,保存人员为【" + temp + "】" })));
                            }
                        }
                    }
                    //当前点击是主号
                    SeeClickPhoto(Uclick, id);
                }
                else
                {
                    if (t_bool != null)
                    {
                        if (t_bool.BOLL_)
                        {
                            var mastr_save = T_SeeClickPhotoService.LoadEntities(x => x.UserID == LoginUser.MasterID && x.T_FgjID == id).FirstOrDefault();
                            if (mastr_save != null)
                            {
                                return(Content(Common.SerializerHelper.SerializeToString(new { msg = "该信息已被主号保存!其他人员不可保存!" })));
                            }
                        }
                    }
                    string temp = GetSelectSmallSave(LoginUser.MasterID, id);
                    if (temp != "on")
                    {
                        return(Content(Common.SerializerHelper.SerializeToString(new { msg = "其他成员已保存该信息,保存人员为【" + temp + "】" })));
                    }
                    else
                    {
                        string str = SeeClickPhoto(Uclick, id);
                        if (str != "OK")
                        {
                            return(Content(Common.SerializerHelper.SerializeToString(new { msg = str })));
                        }
                    }
                }
                #endregion
            }

            // return Content("ok," + (Uclick == null ? 1.ToString() : Uclick.ThisClick.ToString()));1
            //int retUclick = Uclick == null ? 1 :Convert.ToInt32( Uclick.ThisClick);
            return(Content(Common.SerializerHelper.SerializeToString(new { Uclick = UserInfoService.GetMaxClick(LoginUser.ID), msg = "ok", MtrId = LoginUser.MasterID })));
        }
        public object GetJson(UserInfoParam userInfoParam)
        {
            var actioninfolist = T_FGJHtmlDataService.LoadSearchFrist(userInfoParam, true, true);

            #region 基础信息进行查询
            if (!string.IsNullOrEmpty(userInfoParam.Zhuanxiu))
            {
                actioninfolist = actioninfolist.Where <T_FGJHtmlData>(u => u.FwZhuangxiu.Contains(userInfoParam.Zhuanxiu));
            }
            if (!string.IsNullOrEmpty(userInfoParam.Pingmu) && userInfoParam.Pingmu.Trim() != "0")
            {
                int thiid = int.Parse(userInfoParam.Pingmu);

                actioninfolist = actioninfolist.Where <T_FGJHtmlData>(u => u.MianjiID == thiid);
            }
            if (!string.IsNullOrEmpty(userInfoParam.money) && userInfoParam.money.Trim() != "0")
            {
                int thiid = int.Parse(userInfoParam.money);

                actioninfolist = actioninfolist.Where <T_FGJHtmlData>(u => u.SumMoneyID == thiid);
            }
            if (!string.IsNullOrEmpty(userInfoParam.Tingshi) && userInfoParam.Tingshi.Trim() != "0")
            {
                int thiid = int.Parse(userInfoParam.Tingshi);

                actioninfolist = actioninfolist.Where <T_FGJHtmlData>(u => u.HuXingID == thiid);
            }
            #endregion
            #region 根据详细信息进行查询
            //if (!string.IsNullOrEmpty(userInfoParam.Mon1.ToString()))
            //{
            //    int thiid = int.Parse(userInfoParam.Tingshi);

            //    actioninfolist = actioninfolist.Where<T_FGJHtmlData>(u => u.HuXingID == thiid);
            //}
            //if (!string.IsNullOrEmpty(userInfoParam.Mon2.ToString()))
            //{
            //    int thiid = int.Parse(userInfoParam.Tingshi);

            //    actioninfolist = actioninfolist.Where<T_FGJHtmlData>(u => u.HuXingID == thiid);
            //}
            //if (!string.IsNullOrEmpty(userInfoParam.Pm1.ToString()))
            //{
            //    int thiid = int.Parse(userInfoParam.Tingshi);

            //    actioninfolist = actioninfolist.Where<T_FGJHtmlData>(u => u.HuXingID == thiid);
            //}
            //if (!string.IsNullOrEmpty(userInfoParam.Pm.ToString()))
            //{
            //    int thiid = int.Parse(userInfoParam.Tingshi);

            //    actioninfolist = actioninfolist.Where<T_FGJHtmlData>(u => u.HuXingID == thiid);
            //}
            #endregion

            var UscrClick = T_SeeClickPhotoService.LoadEntities(x => x.UserID == LoginUser.ID).DefaultIfEmpty();
            var temp      = from a in actioninfolist
                            select new
            {
                ID          = a.ID,
                HLName      = a.HLName,
                Image_str   = (a.Image_str.IndexOf("有") >= 0 ? "有" : "无"),
                FbTime      = a.FbTime,
                PersonName  = a.PersonName,
                Address     = a.Address,
                photo       = UscrClick.Where(x => x.T_FgjID == a.ID).FirstOrDefault() != null ? a.photo : string.Empty,
                Laiyuan     = a.Laiyuan,
                FwSumMoney  = a.FwSumMoney,
                FwHuXing    = a.FwHuXing,
                FwLoucheng  = a.FwLoucheng,
                FwZhuangxiu = a.FwZhuangxiu,
                FwChaoxiang = a.FwChaoxiang,
                FwNianxian  = a.FwNianxian,
                FwMianji    = a.FwMianji
            };
            return(temp);
        }