Пример #1
0
        //搜索小秘书  新增数据
        public ActionResult addseach(ScrherSAVE ssave)
        {
            ssave.addUserID = LoginUser.ID;
            ssave.DEL       = 0;
            if (ssave.ID > 0)
            {
                //修改
                ssave.Edittime = MvcApplication.GetT_time();

                bool bl = ScrherSAVEService.EditEntity(ssave);
                if (bl)
                {
                    addsechmishu(ssave);
                }
                return(Json("okedit", JsonRequestBehavior.AllowGet));
            }
            else
            {
                //新增
                ssave.Addtime = MvcApplication.GetT_time();
                ssave         = ScrherSAVEService.AddEntity(ssave);
                addsechmishu(ssave);
                return(Json("ok", JsonRequestBehavior.AllowGet));
            }
        }
Пример #2
0
        //搜索小秘书  load
        public ActionResult Getsech()
        {
            int pageIndex = Request["page"] != null?int.Parse(Request["page"]) : 1;

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

            var          TotalCount = 0;
            var          mp         = ScrherSAVEService.LoadPageEntities(pageIndex, pageSize, out TotalCount, y => y.DEL == 0 && y.addUserID == LoginUser.ID, x => x.Addtime, false);
            var          titem      = T_ItemsService.LoadEntities(x => x.Icons == 2);
            List <seach> lss        = new List <seach>();

            foreach (var a in mp)
            {
                seach seh = new seach();
                seh.ID        = a.ID;
                seh.Addtime   = a.Addtime;
                seh.CName     = a.CName;
                seh.Srtmm     = a.Srtmm;
                seh.Stpmm     = a.Stpmm;
                seh.Stpmoney  = a.Stpmoney;
                seh.Strmoney  = a.Strmoney;
                seh.Quyu      = a.Quyu;
                seh.HxID      = a.HxID;
                seh.Zhuangxiu = a.Zhuangxiu;
                seh.hxstr     = a.HxID == null ? "" : titem.Where(m => m.StrID == a.HxID).FirstOrDefault().Str;
                seh.maxcount  = GetSeachdata(a.ID, pageIndex, pageSize);
                lss.Add(seh);
            }
            lss = lss.OrderByDescending(x => x.Addtime).ToList();
            return(Json(new { rows = lss, total = TotalCount }, JsonRequestBehavior.AllowGet));
        }
Пример #3
0
        public ActionResult deleteseach()
        {
            var strId   = Convert.ToInt64(Request["strId"]);
            var Deltemp = ScrherSAVEService.LoadEntities(x => x.ID == strId).FirstOrDefault();

            if (ScrherSAVEService.DeleteEntity(Deltemp))
            {
                return(Json("ok", JsonRequestBehavior.AllowGet));
            }
            return(Json("no", JsonRequestBehavior.AllowGet));
        }
Пример #4
0
        public int GetSeachdata(long XmsID, int pageIndex, int pageSize)
        {
            var           CityID     = UserInfo_CityService.LoadEntities(x => x.UserInfo_ID == LoginUser.ID).FirstOrDefault();
            var           totalCount = 0;
            UserInfoParam Uxms       = new UserInfoParam();
            var           xms        = ScrherSAVEService.LoadEntities(x => x.ID == XmsID && x.DEL == 0).FirstOrDefault();

            Uxms.PageIndex  = pageIndex;
            Uxms.PageSize   = pageSize;
            Uxms.TotalCount = totalCount;
            Uxms.ssve       = xms;
            Uxms.C_id       = CityID.T_City_ID;

            T_FGJHtmlDataService.LoadSearchPM(Uxms);
            return(Uxms.TotalCount);
        }
Пример #5
0
        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));
            }
        }