コード例 #1
0
ファイル: LiangController.cs プロジェクト: zhangvs/LiangLX
        /// <summary>
        /// 靓号主页
        /// </summary>
        /// <returns></returns>
        public ActionResult Index(string organizeId, string city)
        {
            //添加靓号浏览实体
            //organizeId = "2287f3ae-e6b6-4a91-9b0c-66fc87658eaf";
            if (!string.IsNullOrEmpty(organizeId))
            {
                var organize = organizebll.GetEntity(organizeId);
                var viplist  = vipbll.GetVipOrgList(organize.OrganizeId, organize.ParentId, organize.TopOrganizeId);
                if (viplist.Count == 0)
                {
                    return(Content("当前机构为非Vip机构或需要续费!"));
                }
                if (organize != null)
                {
                    ViewBag.FullName = organize.FullName;
                    ViewBag.Tel      = organize.OuterPhone;
                    ViewBag.Img1     = organize.Img1;
                    ViewBag.Img2     = organize.Img2;
                    ViewBag.Img3     = organize.Img3;
                    ViewBag.Img4     = organize.Img4;

                    ViewBag.city     = "";
                    ViewBag.cityName = "城市";
                    if (!string.IsNullOrEmpty(city))
                    {
                        AreaEntity base_Area = areaBLL.GetEntity(city);
                        if (base_Area != null)
                        {
                            ViewBag.city     = base_Area.AreaId;
                            ViewBag.cityName = base_Area.AreaName.Substring(0, 2) + "..";
                        }
                    }


                    ViewBag.organizeId    = organizeId;
                    ViewBag.TopOrganizeId = organize.TopOrganizeId;
                    if (organize.VipMark != null)
                    {
                        ViewBag.VipMark = organize.VipMark;
                    }
                    else
                    {
                        ViewBag.VipMark = 0;
                    }

                    if (organize.TopOrganizeId == "86c7e97d-b6fd-4a6e-9b94-1e751307be45")
                    {
                        ViewBag.SelectCity = "CityHeBei";//河北老葛
                    }
                    else if (organize.TopOrganizeId == "68490e33-851d-4b1d-99b9-d604d7a8f39d")
                    {
                        ViewBag.SelectCity = "CityJiNing";//济宁
                    }
                    else if (organize.TopOrganizeId == "ee957bd5-af60-41c5-aa01-1103cf695c71")
                    {
                        ViewBag.SelectCity = "CityShanXi";//山西
                    }
                    else
                    {
                        ViewBag.SelectCity = "City";
                    }

                    //添加浏览主页记录
                    //如果不是自己查看,访客才添加查看记录CurrentWxUser.OpenId
                    if (organize.ManagerId != CurrentWxUser.OpenId)
                    {
                        TelphoneLiangSeeEntity seeEntity = new TelphoneLiangSeeEntity()
                        {
                            OrganizeId    = organizeId,
                            IPAddress     = Net.Ip,
                            IPAddressName = IPLocation.GetLocation(Net.Ip),
                            OpenId        = CurrentWxUser.OpenId,
                            NickName      = CurrentWxUser.NickName,
                            Sex           = CurrentWxUser.Users.Sex,
                            HeadimgUrl    = CurrentWxUser.Users.HeadimgUrl,
                            Province      = CurrentWxUser.Users.Province,
                            City          = CurrentWxUser.Users.City,//微信城市
                            Country       = CurrentWxUser.Users.Country
                        };
                        telphoneliangseebll.SaveForm("", seeEntity);
                    }
                    else
                    {
                        //判断协议是否签写
                        if (organize.AgreementMark != 1)
                        {
                            return(RedirectToAction("Agreement", new { organizeId = organizeId }));
                        }
                    }

                    JObject queryJson = new JObject {
                        { "OrganizeIdH5", organizeId },
                        { "pid", organize.ParentId },
                        { "top", organize.TopOrganizeId },
                        { "city", city },
                        { "Grade", "0" },//精品推荐
                        { "Count", 10 }
                    };
                    ViewBag.list0 = tlbll.GetList(queryJson.ToString());

                    JObject queryJsonMS = new JObject {
                        { "OrganizeIdH5", organizeId },
                        { "pid", organize.ParentId },
                        { "top", organize.TopOrganizeId },
                        { "city", city },
                        { "ExistMark", 2 },//秒杀状态
                        { "Count", 10 }
                    };

                    ViewBag.listMS = tlbll.GetList(queryJsonMS.ToString());

                    return(View());
                }
                else
                {
                    return(Content("机构暂时未生效或不存在"));
                }
            }
            else
            {
                return(Content("链接不正确不或完整"));
            }
        }
コード例 #2
0
        public ActionResult GetFormJson(string keyValue)
        {
            var data = areaBLL.GetEntity(keyValue);

            return(Content(data.ToJson()));
        }
コード例 #3
0
        public async Task <IActionResult> GetFormJson(long id)
        {
            TData <AreaEntity> obj = await areaBLL.GetEntity(id);

            return(Json(obj));
        }