コード例 #1
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));
        }
コード例 #2
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));
        }