Пример #1
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     this.btnSave.Enabled = false;
     this.btnCancle.Enabled = false;
     if (string.IsNullOrEmpty(this.txtRegionName.Text.Trim()))
     {
         this.btnSave.Enabled = true;
         this.btnCancle.Enabled = true;
         MessageBox.ShowFailTip(this, "地区名称不能为空!");
     }
     else
     {
         Maticsoft.Model.Ms.Regions model = new Maticsoft.Model.Ms.Regions {
             AreaId = null
         };
         if (((this.Regions1.Province_iID == 0) && (this.Regions1.City_iID == 0)) && (this.Regions1.Area_iID == 0))
         {
             model.ParentId = null;
             model.Path = "0,";
             model.Depth = 1;
         }
         if (((this.Regions1.Province_iID != 0) && (this.Regions1.City_iID == 0)) && (this.Regions1.Area_iID == 0))
         {
             model.ParentId = new int?(this.Regions1.Province_iID);
             model.Path = "0," + this.Regions1.Province_iID;
             model.Depth = 2;
         }
         if (((this.Regions1.Province_iID != 0) && (this.Regions1.City_iID != 0)) && (this.Regions1.Area_iID == 0))
         {
             model.ParentId = new int?(this.Regions1.City_iID);
             model.Path = string.Concat(new object[] { "0,", this.Regions1.Province_iID, ",", this.Regions1.City_iID });
             model.Depth = 3;
         }
         if (((this.Regions1.Province_iID != 0) && (this.Regions1.City_iID != 0)) && (this.Regions1.Area_iID != 0))
         {
             MessageBox.ShowSuccessTip(this, "暂时支持添加到三级区域");
         }
         else
         {
             Maticsoft.BLL.Ms.Regions regions2 = new Maticsoft.BLL.Ms.Regions();
             model.RegionId = regions2.GetMaxId();
             model.RegionName = this.txtRegionName.Text;
             model.Spell = null;
             model.SpellShort = this.txtSpellShort.Text;
             model.DisplaySequence = Globals.SafeInt(this.txtDisplaySequence.Text, 1);
             if (0 < regions2.Add(model))
             {
                 this.btnSave.Enabled = false;
                 this.btnCancle.Enabled = false;
                 MessageBox.ShowSuccessTip(this, "保存成功!", "add.aspx");
             }
             else
             {
                 this.btnSave.Enabled = true;
                 this.btnCancle.Enabled = true;
                 MessageBox.ShowSuccessTip(this, "添加失败!");
             }
         }
     }
 }
Пример #2
0
 public PartialViewResult UserInfo(int uid = -1, string nickname = "")
 {
     int num;
     Maticsoft.BLL.Members.Users users = new Maticsoft.BLL.Members.Users();
     UsersExpModel userModel = new UsersExpModel();
     Maticsoft.BLL.Ms.Regions regions = new Maticsoft.BLL.Ms.Regions();
     Maticsoft.BLL.SNS.Star star = new Maticsoft.BLL.SNS.Star();
     if (!string.IsNullOrEmpty(nickname) && ((num = users.GetUserIdByNickName(nickname)) > 0))
     {
         uid = num;
     }
     ((dynamic) base.ViewBag).IsPost = uid == -1;
     ((dynamic) base.ViewBag).IsCurrentUser = false;
     uid = (uid > -1) ? uid : base.currentUser.UserID;
     if ((base.currentUser != null) && (uid == base.currentUser.UserID))
     {
         ((dynamic) base.ViewBag).IsCurrentUser = true;
     }
     userModel = this.GetUserModel(uid);
     string regionNameByRID = regions.GetRegionNameByRID(Globals.SafeInt(userModel.Address, 0));
     if (regionNameByRID.Contains("北京北京"))
     {
         regionNameByRID = regionNameByRID.Replace("北京北京", "北京");
     }
     else if (regionNameByRID.Contains("上海上海"))
     {
         regionNameByRID = regionNameByRID.Replace("上海上海", "上海");
     }
     else if (regionNameByRID.Contains("重庆重庆"))
     {
         regionNameByRID = regionNameByRID.Replace("重庆重庆", "重庆");
     }
     else if (regionNameByRID.Contains("天津天津"))
     {
         regionNameByRID = regionNameByRID.Replace("天津天津", "天津");
     }
     userModel.Address = string.IsNullOrEmpty(userModel.Address) ? "暂未设置" : regionNameByRID;
     ((dynamic) base.ViewBag).IsStar = star.IsStar(uid);
     ((dynamic) base.ViewBag).Level = new Maticsoft.BLL.SNS.GradeConfig().GetUserLevel(userModel.Points);
     return this.PartialView("_UserInfo", userModel);
 }
Пример #3
0
 public PartialViewResult SelfRight()
 {
     new UsersExp();
     new UsersExpModel();
     Maticsoft.BLL.SNS.Groups groups = new Maticsoft.BLL.SNS.Groups();
     Maticsoft.BLL.SNS.UserAlbums albums = new Maticsoft.BLL.SNS.UserAlbums();
     Maticsoft.ViewModel.SNS.SelfRight model = new Maticsoft.ViewModel.SNS.SelfRight {
         MyGroups = groups.GetUserJoinGroup(base.currentUser.UserID, 9)
     };
     Maticsoft.BLL.Ms.Regions regions = new Maticsoft.BLL.Ms.Regions();
     new Maticsoft.BLL.SNS.Star();
     model.UserInfo = this.GetUserModel(base.currentUser.UserID);
     string regionNameByRID = regions.GetRegionNameByRID(Globals.SafeInt(model.UserInfo.Address, 0));
     if (regionNameByRID.Contains("北京北京"))
     {
         regionNameByRID = regionNameByRID.Replace("北京北京", "北京");
     }
     else if (regionNameByRID.Contains("上海上海"))
     {
         regionNameByRID = regionNameByRID.Replace("上海上海", "上海");
     }
     else if (regionNameByRID.Contains("重庆重庆"))
     {
         regionNameByRID = regionNameByRID.Replace("重庆重庆", "重庆");
     }
     else if (regionNameByRID.Contains("天津天津"))
     {
         regionNameByRID = regionNameByRID.Replace("天津天津", "天津");
     }
     model.UserInfo.Address = string.IsNullOrEmpty(model.UserInfo.Address) ? "暂未设置" : regionNameByRID;
     new Maticsoft.BLL.SNS.AlbumType();
     model.MyAlbum = albums.GetListByUserId(base.currentUser.UserID, base.UserAlbumDetailType);
     return this.PartialView("_SelfRight", model);
 }
Пример #4
0
 public ActionResult Province()
 {
     List<Maticsoft.Model.Ms.Regions> provinceList = new Maticsoft.BLL.Ms.Regions().GetProvinceList();
     return this.PartialView("_Province", provinceList);
 }
Пример #5
0
 public ActionResult AjaxUserInfo(int? UserID, string NickName)
 {
     Maticsoft.BLL.Members.Users users = new Maticsoft.BLL.Members.Users();
     UsersExp exp = new UsersExp();
     UsersExpModel usersModel = new UsersExpModel();
     if (!string.IsNullOrEmpty(NickName))
     {
         int userIdByNickName = users.GetUserIdByNickName(NickName);
         if (userIdByNickName <= 0)
         {
             return base.View("_AjaxUserInfo", usersModel);
         }
         UserID = new int?(userIdByNickName);
     }
     if (UserID.HasValue)
     {
         usersModel = exp.GetUsersModel(UserID.Value);
         string regionNameByRID = new Maticsoft.BLL.Ms.Regions().GetRegionNameByRID(Globals.SafeInt(usersModel.Address, 0));
         if (regionNameByRID.Contains("北京北京"))
         {
             regionNameByRID = regionNameByRID.Replace("北京北京", "北京");
         }
         else if (regionNameByRID.Contains("上海上海"))
         {
             regionNameByRID = regionNameByRID.Replace("上海上海", "上海");
         }
         else if (regionNameByRID.Contains("重庆重庆"))
         {
             regionNameByRID = regionNameByRID.Replace("重庆重庆", "重庆");
         }
         else if (regionNameByRID.Contains("天津天津"))
         {
             regionNameByRID = regionNameByRID.Replace("天津天津", "天津");
         }
         usersModel.Address = string.IsNullOrEmpty(usersModel.Address) ? "暂未设置" : regionNameByRID;
     }
     Maticsoft.BLL.SNS.UserShip ship = new Maticsoft.BLL.SNS.UserShip();
     if (base.currentUser != null)
     {
         if (base.currentUser.UserID == UserID.Value)
         {
             ((dynamic) base.ViewBag).IsSelf = true;
         }
         else if (ship.Exists(base.currentUser.UserID, UserID.Value))
         {
             ((dynamic) base.ViewBag).IsFellow = true;
         }
     }
     return base.View("_AjaxUserInfo", usersModel);
 }
Пример #6
0
 public string GetRegionNameByRID(int RID)
 {
     Maticsoft.BLL.Ms.Regions regions = new Maticsoft.BLL.Ms.Regions();
     return regions.GetRegionNameByRID(RID);
 }