예제 #1
0
        protected void AddGroup_OnClick(object sender, EventArgs e)
        {
            bool check = false;

            if (LblGroupName.Text.Trim().Length == 0)
            {
                ShowAlert("提示", "用户名不能为空");

                check = true;
            }
            if(CurrentAccount==null)
            {
                ShowAlert("提示","用户登录超时失败,请重新登录");

                check = true;
            }

            CY.UME.Core.Business.Group group = new CY.UME.Core.Business.Group();

            if (group.CheckGroupNameIsExist(LblGroupName.Text.Trim()))
            {
                Page.ClientScript.RegisterClientScriptBlock(GetType(), "", "<script>cy.ume.ui.window({title: '提示', content: '该群组已经存在'});</script>");

                check = true;
            }

            if (check)
            {
                BindData();

                return;
            }

            group.AddPermission = 1;
            group.CreatorId = CurrentAccount.Id;
            group.DateCreated = DateTime.Now;
            group.IsRecommended = 0;
            group.Level = 0;
            group.MaxMemberNum = 300;
            group.MemberNum = 0;
            group.Name = LblGroupName.Text.Trim();
            group.PlaCard = String.Empty;
            group.Type = int.Parse(DDLGroupType.SelectedValue);
            group.ViewPermission = 1;
            group.IsChecked = true;

            group.Save();

            Page.ClientScript.RegisterClientScriptBlock(GetType(), "", "<script>cy.ume.ui.window({title: '提示', content: '新建群组成功'});window.location.href='Group.aspx?groupId=" + group.Id.ToString() + "'</script>");
        }
예제 #2
0
        private void BindData()
        {
            CY.UME.Core.Business.Group group = new CY.UME.Core.Business.Group();
            CY.UME.Core.PagingInfo pageInfo = new CY.UME.Core.PagingInfo();

            pageInfo.CurrentPage = 1;
            pageInfo.PageSize = 12;
            bool isClass = false;

            myGroupList = group.GetGroupsByAccountIdAndPages(CurrentAccount, pageInfo, isClass);

            groupNavigation1.IsShowAddGroupBtn = false;
            groupNavigation1.IsShowAddTopicBtn = false;
            groupNavigation1.IsShowAddImgBtn = false;
            groupNavigation1.IsShowNav = false;
        }