Пример #1
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     string str = this.txtTypeName.Text.Trim();
     if (str.Length == 0)
     {
         MessageBox.ShowServerBusyTip(this, "类型名称不能为空!");
     }
     else if (str.Length > 50)
     {
         MessageBox.ShowServerBusyTip(this, "类型名称不能大于50个字符!");
     }
     else
     {
         string str2 = this.txtRemark.Text.Trim();
         if (str2.Length > 100)
         {
             MessageBox.ShowServerBusyTip(this, "备注不能大于100个字符!");
         }
         else
         {
             Maticsoft.Model.SNS.TagType model = new Maticsoft.Model.SNS.TagType {
                 TypeName = str,
                 Remark = str2,
                 Status = new int?(Globals.SafeInt(this.radlStatus.SelectedValue, 0)),
                 Cid = new int?(Globals.SafeInt(this.dropCid.SelectedValue, 0))
             };
             Maticsoft.BLL.SNS.TagType type2 = new Maticsoft.BLL.SNS.TagType();
             if (type2.Add(model) > 0)
             {
                 LogHelp.AddUserLog(base.CurrentUser.UserName, base.CurrentUser.UserType, "添加标签类型成功", this);
                 MessageBox.ShowSuccessTip(this, Site.TooltipSaveOK, "List.aspx");
             }
             else
             {
                 LogHelp.AddUserLog(base.CurrentUser.UserName, base.CurrentUser.UserType, "添加标签类型失败", this);
                 MessageBox.ShowFailTip(this, Site.TooltipSaveError);
             }
         }
     }
 }
Пример #2
0
 public ActionResult Tags()
 {
     ((dynamic) base.ViewBag).Title = "个人标签设置";
     if (base.currentUser == null)
     {
         return new EmptyResult();
     }
     Maticsoft.BLL.SNS.Tags tags = new Maticsoft.BLL.SNS.Tags();
     TagType type = new TagType();
     List<Maticsoft.Model.SNS.Tags> modelList = tags.GetModelList("TypeId=" + type.GetTagsTypeId("用户标签"));
     UsersExpModel usersModel = this.bllUE.GetUsersModel(base.CurrentUser.UserID);
     ((dynamic) base.ViewBag).UserTags = usersModel.Remark;
     return base.View(modelList);
 }