Ejemplo n.º 1
0
        /// <summary>
        /// 流派DicId
        /// </summary>
        /// <param name="ItemName"></param>
        /// <returns></returns>
        public string GetYogaTypeid(string ItemName)
        {
            string Info = "";

            string[] ids;
            if (!string.IsNullOrEmpty(ItemName))
            {
                ids = ItemName.Split(' ');
                using (YogaDicItemServiceClient YogaDicItemServiceClient = new YogaDicItemServiceClient())
                {
                    List <ViewYogaDicItem> list = new List <ViewYogaDicItem> ();
                    list = YogaDicItemServiceClient.GetDicId(63);

                    for (int i = 0; i < ids.Count(); i++)
                    {
                        for (int k = 0; k < list.Count(); k++)
                        {
                            if (ids[i] == list[k].ItemName)
                            {
                                Info += list[k].DicId + ",";
                            }
                        }
                    }
                }
            }

            return(Info);
        }
Ejemplo n.º 2
0
        public ActionResult Detail(int id)
        {
            ViewCenters center = new ViewCenters();

            center = client.GetCentersById(id);
            string country  = string.Empty;
            string province = string.Empty;
            string city     = string.Empty;
            string dis      = string.Empty;

            using (YogaDicItemServiceClient itemclient = new YogaDicItemServiceClient())
            {
                if (center.CountryID != 0)
                {
                    country = itemclient.GetYogaDicItemById(Convert.ToInt32(center.CountryID)).ItemName;
                }
                if (center.ProvinceID != 0)
                {
                    province = itemclient.GetYogaDicItemById(Convert.ToInt32(center.ProvinceID)).ItemName;
                }
                if (center.CityID != 0)
                {
                    city = "--" + itemclient.GetYogaDicItemById(Convert.ToInt32(center.CityID)).ItemName;
                }
                if (center.DistrictID != 0)
                {
                    dis = "--" + itemclient.GetYogaDicItemById(Convert.ToInt32(center.DistrictID)).ItemName;
                }
                ViewBag.country = country;
                ViewBag.addr    = province + city + dis;
            }

            return(View(center));
        }
Ejemplo n.º 3
0
        //添加活动导师
        public PartialViewResult _PartialAddClassTeacher()
        {
            List <SelectListItem> items = new List <SelectListItem>();

            items.Add(new SelectListItem()
            {
                Text = "男", Value = "男"
            });
            items.Add(new SelectListItem()
            {
                Text = "女", Value = "女", Selected = true
            });
            ViewData["Gender"] = items;
            items = new List <SelectListItem>();
            YogaDicItemServiceClient dicClient = new YogaDicItemServiceClient();

            items = (from dic in dicClient.GetSelectList(CommonInfo.NationID, true) select new SelectListItem()
            {
                Selected = false, Text = dic.ItemName, Value = dic.ItemName
            }).ToList();
            ViewData["Country"] = items;
            items = (from dic in dicClient.GetSelectList(CommonInfo.YogaSystemID, true) select new SelectListItem()
            {
                Selected = false, Text = dic.ItemName, Value = dic.ItemName
            }).ToList();
            ViewData["YogaSystem"] = items;
            return(PartialView());
        }
Ejemplo n.º 4
0
 public ActionResult EditDic(ViewYogaDicItem DM)
 {
     using (YogaDicItemServiceClient client = new YogaDicItemServiceClient())
     {
         client.Update(DM);
     }
     return(RedirectToAction("Index"));
 }
Ejemplo n.º 5
0
 public ActionResult EditItem(ViewYogaDicItem DIM)
 {
     using (YogaDicItemServiceClient client = new YogaDicItemServiceClient())
     {
         client.Update(DIM);
     }
     return(RedirectToAction("AllItem", new { id = DIM.DicId }));
 }
Ejemplo n.º 6
0
 public ActionResult AddDic(ViewYogaDicItem DM)
 {
     using (YogaDicItemServiceClient client = new YogaDicItemServiceClient())
     {
         DM.CreateTime = DateTime.Now;
         client.Add(DM);
     }
     ViewData["message"] = "添加成功!";
     return(RedirectToAction("Index"));
 }
Ejemplo n.º 7
0
        public ActionResult Index()
        {
            string myValue = Request.Form["checkVal"];

            using (YogaDicItemServiceClient client = new YogaDicItemServiceClient())
            {
                client.Delete(myValue);
            }
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 社区=2158
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public List <ViewYogaDicItem> listDicItem(int id)
        {
            List <ViewYogaDicItem> list = new List <ViewYogaDicItem> ();

            using (YogaDicItemServiceClient YogaDicItemServiceClient = new YogaDicItemServiceClient())
            {
                list = YogaDicItemServiceClient.GetDicId(id);
            }
            return(list);
        }
Ejemplo n.º 9
0
        /// <summary>
        /// 编辑字典项
        /// </summary>
        /// <returns></returns>
        public ActionResult EditItem(int id)
        {
            ViewYogaDicItem dic = new ViewYogaDicItem();

            using (YogaDicItemServiceClient client = new YogaDicItemServiceClient())
            {
                dic = client.GetYogaDicItemById(id);
            }
            return(View(dic));
        }
Ejemplo n.º 10
0
        /// <summary>
        /// 修改活动
        /// </summary>
        /// <param name="id">活动ID</param>
        /// <returns></returns>
        public ActionResult EditActivity(int id)
        {
            ViewClass          model  = new ViewClass();
            ClassServiceClient client = new ClassServiceClient();

            model = client.Get(id);

            ViewBag.Title = "编辑活动";
            ViewBag.Id    = id;
            YogaDicItemServiceClient dicClient = new YogaDicItemServiceClient();

            ViewData["YogaTopic"] = (from topic in (dicClient.Dics(d => d.DicId == CommonInfo.Topic))
                                     select new SelectListItem()
            {
                Text = topic.ItemName,
                Value = topic.ID.ToString(),
                Selected = model.TopicIds.Split(',').Contains(topic.ID.ToString())
            }).ToList();
            //逐层获取地理位置区域
            List <DistrictModel> DistrictModelList = client.GetDistrictModel(model.AreaID);

            ViewBag.DistrictModelList = Newtonsoft.Json.JsonConvert.SerializeObject(DistrictModelList);

            //获取活动关联的老师并拼成HTML展示在页面
            ClassTeacherServiceClient subClient         = new ClassTeacherServiceClient();
            List <ViewClassTeacher>   ClassTeacherModel = subClient.GetClass_Id(id);
            string html = "";

            if (ClassTeacherModel != null)
            {
                foreach (var item in ClassTeacherModel)
                {
                    html += "<li class=teacher id=teacher_" + item.Id + ""
                            + " teacherid=" + item.TeacherId + "><div class=teacher-info><div class=name><img src=" + item.Avatar + "> "
                            + item.Name + "<span>" + item.Gender + "</span> <span>"
                            + item.Country + "</span> <span>" + item.YogaSystem + "</span></div></div><div class=teacher-close>&nbsp;</div></li>";
                }
            }
            ViewData["html"] = new MvcHtmlString(html);
            string centerHtml = "";
            CentersServiceClient centerClient = new CentersServiceClient();

            if (!string.IsNullOrWhiteSpace(model.CenterID))
            {
                var centerList = centerClient.GetCentersListByClassCenterID(model.CenterID);
                foreach (var dataItem in centerList)
                {
                    centerHtml += "<li class=Center id=CenterID_" + dataItem.CenterId + " CenterID=" + dataItem.CenterId
                                  + "><div class=Center-info><div class=name><img src=" + dataItem.CenterPortraint + "/> " + dataItem.CenterName
                                  + " </div></div><div class=Center-close>&nbsp;</div></li>";
                }
            }
            ViewData["centerHtml"] = new MvcHtmlString(centerHtml);
            return(View(model));
        }
Ejemplo n.º 11
0
 /// <summary>
 /// 详情
 /// </summary>
 /// <param name="id"></param>
 /// <param name="iType">1 审核列表;0 管理列表</param>
 /// <returns></returns>
 public ActionResult Details(int id, int iType)
 {
     ViewBag.Name  = method.GetNickName(Convert.ToInt32(model.Uid));
     ViewBag.iType = iType;
     model         = client.GetById(id);
     using (YogaDicItemServiceClient YogaDicItemServiceClient = new YogaDicItemServiceClient())
     {
         ViewBag.ItemName = YogaDicItemServiceClient.GetById(model.iType.Value).ItemName;
     }
     return(View(model));  
 }
Ejemplo n.º 12
0
        /// <summary>
        /// 国籍DicId
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int GetDicId(string ItemName)
        {
            ViewYogaDicItem entity = new ViewYogaDicItem();

            using (YogaDicItemServiceClient YogaDicItemServiceClient = new YogaDicItemServiceClient())
            {
                entity = YogaDicItemServiceClient.GetDicId(103).Where(a => a.ItemName == ItemName).FirstOrDefault();
            }

            return(entity.DicId);
        }
Ejemplo n.º 13
0
        /// <summary>
        /// 首次加载关键字列表(根据父节点取子节点):2645
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public JsonResult GetKeyWord(int id)
        {
            List <ViewYogaDicItem> dic = new List <ViewYogaDicItem>();

            using (YogaDicItemServiceClient YogaDicItemServiceClient = new YogaDicItemServiceClient())
            {
                dic = YogaDicItemServiceClient.GetDicId(id).OrderBy(a => a.SortId).ToList();
            }

            return(Json(dic));
        }
Ejemplo n.º 14
0
        public ActionResult AllItem()
        {
            string myValue = Request.Form["checkVal"];
            string parid   = Request.Form["parid"];

            using (YogaDicItemServiceClient client = new YogaDicItemServiceClient())
            {
                client.Delete(myValue);
            }
            return(RedirectToAction("AllItem/" + parid));
        }
Ejemplo n.º 15
0
        public JsonResult GetArea(int id = 0, bool?forChild = null)
        {
            YogaDicItemServiceClient dicClient = new YogaDicItemServiceClient();
            List <ViewYogaDicItem>   list      = dicClient.GetSelectList(id == 0?CommonInfo.CountryZHID:id, forChild);
            List <SelectListItem>    items     = (from s in list select new SelectListItem()
            {
                Text = s.ItemName, Value = s.ID.ToString()
            }).ToList();

            return(Json(items, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 16
0
        public LearnController()
        {
            ViewBag.user  = user;
            client        = new tLearingServiceClient();
            dicclient     = new YogaDicItemServiceClient();
            interclient   = new InterestServiceClient();
            msgclient     = new tMessageServiceClient();
            clientUser    = new YogaUserServiceClient();
            userDetclient = new YogaUserDetailServiceClient();
            method        = new method();
            Signclient    = new tSignServiceClient();
            zanclient     = new tZanModelsServiceClient();

            #region 登录者的级别
            if (user.UserType == 0)
            {
                ViewYogaUserDetail temp = new ViewYogaUserDetail();
                temp = userDetclient.GetYogaUserDetailById(user.Uid);
                if (temp != null)
                {
                    ViewBag.level = temp.Ulevel;
                }
            }
            else//导师级别
            {
                ViewYogisModels vyogism = new ViewYogisModels();
                using (YogisModelsServiceClient mclient = new YogisModelsServiceClient())
                {
                    vyogism = mclient.GetYogisModelsById(user.Uid);
                    if (vyogism != null)
                    {
                        ViewBag.level = vyogism.YogisLevel;
                    }
                }
            }
            #endregion
            #region  站内信-信息数量

            int tinstatcount = 0;
            int follcount    = 0;
            int zancount     = 0;
            int msgcount     = 0;

            method.InstationInfo(user.Uid, out tinstatcount, out follcount, out zancount, out msgcount);

            ViewBag.tinstatcount = tinstatcount;
            ViewBag.follcount    = follcount;
            ViewBag.zancount     = zancount;
            ViewBag.msgcount     = msgcount;
            ViewBag.AllCount     = tinstatcount + follcount + zancount + msgcount;
            #endregion
        }
Ejemplo n.º 17
0
        public ActionResult Index()
        {
            YogaDicItemServiceClient dicClient = new YogaDicItemServiceClient();
            List <ViewYogaDicItem>   dics      = dicClient.GetSelectList(CommonInfo.Topic, true);

            ViewData["YogaTopic"] = (from topic in (dicClient.Dics(d => d.DicId == CommonInfo.Topic))
                                     select new SelectListItem()
            {
                Text = topic.ItemName,
                Value = topic.ID.ToString()
            }).ToList();
            return(View());
        }
Ejemplo n.º 18
0
        /// <summary>
        ///  查询导师
        /// </summary>
        /// <param name="text"></param>
        /// <param name="page"></param>
        /// <param name="size"></param>
        /// <returns></returns>
        public JsonResult GetYogis(string text, int page = 1, int size = 10)
        {
            YogisModelsServiceClient      client = new YogisModelsServiceClient();
            PageResult <ViewClassTeacher> pr     = new PageResult <ViewClassTeacher>();
            int records = 0;
            List <ViewYogisModels> yogis = client.GetYogisModelsList(text, 2, 0, "", page, size, out records);

            pr.Objects = (from y in yogis
                          select new ViewClassTeacher()
            {
                TeacherId = y.YID,
                Country = (y.Nationality == "" ? CommonInfo.CountryZHID.ToString() : y.Nationality),
                Name = (y.RealName ?? ""),
                Gender = (y.Gender == 0 ? "女" : "男"),
                YogaSystem = (string.IsNullOrEmpty(y.YogaTypeid) ? "0" : y.YogaTypeid),
                Info = y.GudWords,
                Avatar = y.DisplayImg
            }).ToList();
            pr.Code        = 0;
            pr.Index       = page;
            pr.PageSize    = size;
            pr.RecordCount = records;
            YogaDicItemServiceClient dicClient = new YogaDicItemServiceClient();

            foreach (ViewClassTeacher item in pr.Objects)
            {
                if (item.Country != null && item.Country != "0")
                {
                    item.Country = dicClient.GetById(int.Parse(item.Country)).ItemName;
                }
                else
                {
                    item.Country = "";
                }
                if (item.YogaSystem != "0")
                {
                    List <ViewYogaDicItem> systems = dicClient.GetSelectList(item.YogaSystem);
                    item.YogaSystem = "";
                    foreach (ViewYogaDicItem system in systems)
                    {
                        item.YogaSystem += system.ItemName + ",";
                    }
                    item.YogaSystem = item.YogaSystem.Replace(',', ' ');
                }
                else
                {
                    item.YogaSystem = "";
                }
            }
            return(Json(pr, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 19
0
        public YogaGuruController()
        {
            ViewBag.user = user;
            client       = new YogisModelsServiceClient();
            clientUser   = new YogaUserServiceClient();
            clientMsg    = new tMessageServiceClient();
            clientFoll   = new FollowServiceClient();
            clientDetail = new YogaUserDetailServiceClient();

            logClient = new tWriteLogServiceClient();
            clientPic = new YogaPictureServiceClient();
            dicclient = new YogaDicItemServiceClient();
            zanclient = new tZanModelsServiceClient();
            method    = new method();
            #region 登录者的级别
            if (user.UserType == 0)
            {
                ViewYogaUserDetail temp = new ViewYogaUserDetail();
                temp = clientDetail.GetYogaUserDetailById(user.Uid);
                if (temp != null)
                {
                    ViewBag.level = temp.Ulevel;
                }
            }
            else
            {
                ViewYogisModels vyogism = new ViewYogisModels();
                vyogism = client.GetYogisModelsById(user.Uid);
                if (vyogism != null)
                {
                    ViewBag.level = vyogism.YogisLevel;
                }
            }
            #endregion
            #region  站内信-信息数量

            int tinstatcount = 0;
            int follcount    = 0;
            int zancount     = 0;
            int msgcount     = 0;

            method.InstationInfo(user.Uid, out tinstatcount, out follcount, out zancount, out msgcount);

            ViewBag.tinstatcount = tinstatcount;
            ViewBag.follcount    = follcount;
            ViewBag.zancount     = zancount;
            ViewBag.msgcount     = msgcount;
            ViewBag.AllCount     = tinstatcount + follcount + zancount + msgcount;
            #endregion
        }
Ejemplo n.º 20
0
        /// <summary>
        /// 字典列表
        /// </summary>
        /// <returns></returns>
        public ActionResult Index(int page = 1, string where = "")
        {
            List <ViewYogaDicItem> list = new List <ViewYogaDicItem>();
            int count = 0;

            using (YogaDicItemServiceClient client = new YogaDicItemServiceClient())
            {
                list = client.GetYogaDicItemPageList(where, 0, page, 15, out count);
            }
            PagedList <ViewYogaDicItem> pagelist = new PagedList <ViewYogaDicItem>(list, page, 15, count);

            ViewBag.listDic = pagelist;
            return(View(pagelist));
        }
Ejemplo n.º 21
0
 public method()
 {
     client              = new ClassServiceClient();
     dicclient           = new YogaDicItemServiceClient();
     interclient         = new InterestServiceClient();
     msgclient           = new tMessageServiceClient();
     clientUser          = new YogaUserServiceClient();
     clientbanner        = new tBannerServiceClient();
     udclient            = new YogaUserDetailServiceClient();
     modelsclient        = new YogisModelsServiceClient();
     userloginInfoclient = new tUserLoginInfoServiceClient();
     tinstaclient        = new tInstationInfoServiceClient();
     followclient        = new FollowServiceClient();
     zanclient           = new tZanModelsServiceClient();
     messageclient       = new tMessageServiceClient();
     cenclient           = new IYogaKoo.Client.CentersServiceClient();
 }
Ejemplo n.º 22
0
        /// <summary>
        /// 地区
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public string GetItemName(int id)
        {
            ViewYogaDicItem list = new ViewYogaDicItem();

            using (YogaDicItemServiceClient client = new YogaDicItemServiceClient())
            {
                list = client.GetYogaDicItemById(id);
            }
            if (list != null)
            {
                return(list.ItemName);
            }
            else
            {
                return("");
            }
        }
Ejemplo n.º 23
0
 public ActionResult AddActivity()
 {
     if (user.Uid == 0 || user.Uid.IsNullOrEmpty())
     {
         return(Content("<script>if (confirm('你还没有登录,是否登录?')) { window.location='/Login/Login';  }</script>"));
     }
     else
     {
         YogaDicItemServiceClient dicClient = new YogaDicItemServiceClient();
         ViewData["YogaTopic"] = (from topic in (dicClient.Dics(d => d.DicId == CommonInfo.Topic))
                                  select new SelectListItem()
         {
             Text = topic.ItemName,
             Value = topic.ID.ToString()
         }).ToList();
         return(View());
     }
 }
Ejemplo n.º 24
0
        public MechanismController()
        {
            ViewBag.user     = user;
            clientUser       = new YogaUserServiceClient();
            dicclient        = new YogaDicItemServiceClient();
            clientmodel      = new YogisModelsServiceClient();
            clientuserdetail = new YogaUserDetailServiceClient();
            method           = new method();
            #region 登录者的级别
            if (user.UserType == 0)
            {
                ViewYogaUserDetail temp = new ViewYogaUserDetail();
                temp = clientuserdetail.GetYogaUserDetailById(user.Uid);
                if (temp != null)
                {
                    ViewBag.level = temp.Ulevel;
                }
            }
            else//导师级别
            {
                ViewYogisModels vyogism = new ViewYogisModels();
                vyogism = clientmodel.GetYogisModelsById(user.Uid);
                if (vyogism != null)
                {
                    ViewBag.level = vyogism.YogisLevel;
                }
            }
            #endregion
            #region  站内信-信息数量

            int tinstatcount = 0;
            int follcount    = 0;
            int zancount     = 0;
            int msgcount     = 0;

            method.InstationInfo(user.Uid, out tinstatcount, out follcount, out zancount, out msgcount);

            ViewBag.tinstatcount = tinstatcount;
            ViewBag.follcount    = follcount;
            ViewBag.zancount     = zancount;
            ViewBag.msgcount     = msgcount;
            ViewBag.AllCount     = tinstatcount + follcount + zancount + msgcount;
            #endregion
        }
Ejemplo n.º 25
0
        public ActionResult AddItem(ViewYogaDicItem DIM)
        {
            using (YogaDicItemServiceClient client = new YogaDicItemServiceClient())
            {
                DIM.CreateTime = DateTime.Now;
                client.Add(DIM);
            }
            ViewData["info"] = "添加成功!";
            string dif = Request.Form["hiddif"];

            if (dif.Equals("0"))
            {
                return(RedirectToAction("AllItem", new { id = DIM.DicId }));
            }
            else
            {
                return(RedirectToAction("AddItem", new { id = DIM.DicId }));
            }
        }
Ejemplo n.º 26
0
        public ActionResult AddActivity(int?id)
        {
            if (id == null)
            {
                ViewBag.Title = "添加活动";
            }
            else
            {
                ViewBag.Title = "编辑活动";
            }
            ViewBag.Id = id;
            YogaDicItemServiceClient dicClient = new YogaDicItemServiceClient();

            ViewData["YogaTopic"] = (from topic in (dicClient.Dics(d => d.DicId == CommonInfo.Topic))
                                     select new SelectListItem()
            {
                Text = topic.ItemName,
                Value = topic.ID.ToString()
            }).ToList();
            ViewBag.HtmlClassTeacher = TempData["HtmlClassTeacher"] == null ? "''" : TempData["HtmlClassTeacher"];
            return(View());
        }
Ejemplo n.º 27
0
        //
        // GET: /Manage/Centers/Edit/5

        public ActionResult Edit(int id)
        {
            ViewCenters center = new ViewCenters();

            center = client.GetCentersById(id);

            #region 流派
            if (!string.IsNullOrEmpty(center.YogaTypeid))
            {
                string[] YogaTypeidlist = center.YogaTypeid.Replace("|", "").Split(',');

                List <ViewYogaDicItem> listcenter2 = new List <ViewYogaDicItem>();
                using (YogaDicItemServiceClient YogaDicItemServiceClient = new YogaDicItemServiceClient())
                {
                    listcenter2 = YogaDicItemServiceClient.GetYogaDicItemList();
                    string strYogaTypeidValue = "";
                    foreach (var j in YogaTypeidlist)
                    {
                        if (!string.IsNullOrEmpty(j))
                        {
                            foreach (var itemDic in listcenter2)
                            {
                                if (j.ToString() == itemDic.ID.ToString())
                                {
                                    strYogaTypeidValue += itemDic.ItemName + ',';
                                }
                            }
                        }
                    }
                    ViewBag.YogaTypeidValue = strYogaTypeidValue;
                }
            }

            #endregion

            return(View(center));
        }
Ejemplo n.º 28
0
        /// <summary>
        /// 升级导师审核中页面
        /// </summary>
        /// <returns></returns>
        public ActionResult Audit()
        {
            #region 登录者的级别
            if (user.UserType == 0)
            {
            }
            else//导师级别
            {
                ViewYogisModels vyogism = new ViewYogisModels();
                vyogism = mclient.GetYogisModelsById(user.Uid);
                if (vyogism != null)
                {
                    ViewBag.level = vyogism.YogisLevel;
                }
            }
            #endregion
            int             id    = user.Uid;
            ViewYogisModels model = new ViewYogisModels();

            using (YogisModelsServiceClient client = new YogisModelsServiceClient())
            {
                model = client.GetYogisModelsById(id);
                if (model != null)
                {
                    #region
                    //昵称

                    using (YogaUserServiceClient YogaUserServiceClient = new YogaUserServiceClient())
                    {
                        ViewBag.NickName = YogaUserServiceClient.GetYogaUserById(model.UID).NickName ?? "";
                    }

                    #region 会馆
                    if (!string.IsNullOrEmpty(model.CenterID))
                    {
                        string[] cenlist = model.CenterID.Split(',');

                        List <ViewCenters> listcenter = new List <ViewCenters>();
                        using (CentersServiceClient CentersServiceClient = new CentersServiceClient())
                        {
                            listcenter = CentersServiceClient.GetCentersUid();

                            string strCentValue = "";
                            foreach (var i in cenlist)
                            {
                                foreach (var itemCenter in listcenter)
                                {
                                    if (i.ToString() == itemCenter.CenterId.ToString())
                                    {
                                        strCentValue += itemCenter.CenterName + ',';
                                    }
                                }
                            }
                            ViewBag.CentValue = strCentValue;
                        }
                    }
                    #endregion

                    #region 流派
                    if (!string.IsNullOrEmpty(model.YogaTypeid))
                    {
                        string[] YogaTypeidlist = model.YogaTypeid.Split(',');

                        List <ViewYogaDicItem> listcenter2 = new List <ViewYogaDicItem>();
                        using (YogaDicItemServiceClient YogaDicItemServiceClient = new YogaDicItemServiceClient())
                        {
                            listcenter2 = YogaDicItemServiceClient.GetYogaDicItemList();
                            string strYogaTypeidValue = "";
                            foreach (var j in YogaTypeidlist)
                            {
                                foreach (var itemDic in listcenter2)
                                {
                                    if (j.ToString() == itemDic.ID.ToString())
                                    {
                                        strYogaTypeidValue += itemDic.ItemName + ',';
                                    }
                                }
                            }
                            ViewBag.YogaTypeidValue = strYogaTypeidValue;
                        }
                    }
                    #endregion

                    #region 导师列表

                    if (!string.IsNullOrEmpty(model.TeachYogis))
                    {
                        string[]        TeachYogislist     = model.TeachYogis.Split(',');
                        ViewYogisModels model3             = new ViewYogisModels();
                        string          strTeachYogisValue = "";
                        foreach (var k in TeachYogislist)
                        {
                            model3 = client.GetById(Convert.ToInt32(k));
                            if (model3 != null)
                            {
                                strTeachYogisValue += model3.RealName + ',';
                            }
                        }
                        ViewBag.TeachYogisValue = strTeachYogisValue;
                    }
                    #endregion

                    //国籍
                    if (!string.IsNullOrEmpty(model.Nationality))
                    {
                        if (model.Nationality != "0")
                        {
                            using (YogaDicItemServiceClient YogaDicItemServiceClient = new YogaDicItemServiceClient())
                            {
                                ViewBag.Nationality = YogaDicItemServiceClient.GetYogaDicItemById(Convert.ToInt32(model.Nationality)).ItemName ?? "";
                            }
                        }
                    }


                    //国家

                    if (model.CountryID != null && model.CountryID != 0)
                    {
                        using (YogaDicItemServiceClient YogaDicItemServiceClient = new YogaDicItemServiceClient())
                        {
                            ViewBag.CountryID = YogaDicItemServiceClient.GetYogaDicItemById(model.CountryID.Value).ItemName ?? "";
                        }
                    }
                    else
                    {
                        ViewBag.CountryID = "";
                    }

                    //地址;  省 城市 城区
                    if (model.ProvinceID != null && model.ProvinceID != 0)
                    {
                        using (YogaDicItemServiceClient YogaDicItemServiceClient = new YogaDicItemServiceClient())
                        {
                            ViewBag.ProvinceID = YogaDicItemServiceClient.GetYogaDicItemById(model.ProvinceID.Value).ItemName ?? "";
                        }
                    }
                    else
                    {
                        ViewBag.ProvinceID = "";
                    }
                    if (model.CityID != null && model.CityID != 0)
                    {
                        using (YogaDicItemServiceClient YogaDicItemServiceClient = new YogaDicItemServiceClient())
                        {
                            ViewBag.CityID = YogaDicItemServiceClient.GetYogaDicItemById(model.CityID.Value).ItemName ?? "";
                        }
                    }
                    else
                    {
                        ViewBag.CityID = "";
                    }
                    if (model.DistrictID != null && model.DistrictID != 0)
                    {
                        using (YogaDicItemServiceClient YogaDicItemServiceClient = new YogaDicItemServiceClient())
                        {
                            ViewBag.DistrictID = YogaDicItemServiceClient.GetYogaDicItemById(model.DistrictID.Value).ItemName ?? "";
                        }
                    }
                    else
                    {
                        ViewBag.DistrictID = "";
                    }
                    ViewBag.Address = ViewBag.ProvinceID + "--" + ViewBag.CityID + "--" + ViewBag.DistrictID;
                    #endregion
                }
                else
                {
                    ViewBag.CentValue       = "";
                    ViewBag.YogaTypeidValue = "";
                    ViewBag.TeachYogisValue = "";
                }
            }
            YogiProfileServiceClient proClient = new YogiProfileServiceClient();
            ViewYogiProfile          pro       = proClient.GetYogiProfileById(id);
            if (pro != null)
            {
                ViewBag.pro = pro;
            }
            //using (YogaPictureServiceClient clientpic = new YogaPictureServiceClient())
            //{
            //    List<ViewYogaPicture> pic = clientpic.GetUidList(id);
            //    if (pic != null)
            //    {
            //        ViewBag.Pic = pic;
            //    }
            //}
            return(View(model));
        }
Ejemplo n.º 29
0
        public ActionResult ViewActivity(int id)
        {
            //, bool isOrder = false ViewBag.isOrder = isOrder;
            ViewBag.id = id;
            ClassServiceClient       client  = new ClassServiceClient();
            YogaDicItemServiceClient dclient = new YogaDicItemServiceClient();
            ViewClass model             = client.Get(id);
            List <ViewYogaDicItem> dics = dclient.GetSelectList(model.TopicIds);

            model.TopicIds = "";
            //主题
            foreach (var item in dics)
            {
                if (model.TopicIds == "")
                {
                    model.TopicIds = item.ItemName;
                }
                else
                {
                    model.TopicIds = model.TopicIds + " " + item.ItemName;
                }
            }
            //发起人头像
            model.Poster = client.GetAvatars(model.UserId.ToString())[0];

            //兴趣
            InterestServiceClient interestClient = new InterestServiceClient();

            ViewBag.IsInterest    = interestClient.Exists(id, user.Uid);
            ViewBag.InterestCount = interestClient.ClassInterests(id, 1, 10).RecordCount;

            ////老师粉丝
            //FollowServiceClient followClient = new FollowServiceClient();
            //int teacherFollowCount = 0;
            //foreach (var item in model.Teachers)
            //{
            //    followClient.GetFollowUidList(item.UserId, 1, 1, out teacherFollowCount);
            //    ViewData[item.UserId.ToString()] = teacherFollowCount;
            //}

            YogisModelsServiceClient ymClient = new YogisModelsServiceClient();
            //老师粉丝
            FollowServiceClient followClient = new FollowServiceClient();

            foreach (var item in model.Teachers)
            {
                //followClient.GetFollowUidList(item.UserId, 1, 1, out teacherFollowCount);
                //ViewData[item.UserId.ToString()] = teacherFollowCount;
                var ymModel = ymClient.GetById((int)item.TeacherId);
                int num     = followClient.GetFollowByCount(ymModel.UID);
                ViewData[item.UserId.ToString()] = num;
            }
            //发起人粉丝
            ViewBag.Sponsor = followClient.GetFollowByCount(model.UserId);

            //参加
            OrderServiceClient orderClient = new OrderServiceClient();
            // 只查询出有效的订单
            PageResult <ViewOrder> orders = orderClient.GetByClass(id, 1, 6000);

            //等待加入
            #region
            string uids      = "";
            int    joinCount = 0;
            foreach (ViewOrder item in orders.Objects)
            {
                if (uids == "")
                {
                    uids = item.UserId.ToString();
                }
                else
                {
                    uids += "," + item.UserId;
                }
                joinCount += item.Number;
            }
            ViewBag.JoinCount = joinCount;
            List <UserListItem> orderAvatars   = client.GetAvatars(uids == "" ? "0" : uids);
            List <UserListItem> allJoinAvatars = new List <UserListItem>();
            foreach (var item in orders.Objects)
            {
                foreach (var ui in orderAvatars)
                {
                    if (item.UserId == ui.ID)
                    {
                        for (int i = 0; i < item.Number; i++)
                        {
                            allJoinAvatars.Add(ui);
                        }
                    }
                }
            }
            ViewData["AllJoinAvatars"] = allJoinAvatars;
            #endregion

            return(View(model));
        }