protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["groupId"] == null)
            {
                throw new Exception("参数错误");
            }

            if (!int.TryParse(Request.QueryString["groupId"].ToString(), out groupId))
            {
                throw new Exception("参数错误");
            }

            CY.UME.Core.Business.Group group = CY.UME.Core.Business.Group.Load(groupId);

            if (group == null)
            {
                group = new CY.UME.Core.Business.Group();
                group.Id = 3;
                throw new Exception("该群组不存在或已被删除");
            }

            if (group.UrlName.Length >= 1)
            {
                setgroupindivi.Visible = false;
            }
            TBXUrlName.Text = group.UrlName;

            if (!IsPostBack)
            {
                CY.UME.Core.Business.AccountGroup ag = new CY.UME.Core.Business.AccountGroup();
                IList<CY.UME.Core.Business.AccountGroup> agList = ag.GetAccountGroupByAccountIdOrGroupId(CurrentAccount.Id, groupId);
                if (agList.Count == 0 || agList[0].Role != 1)
                {
                    throw new Exception("您无权访问该页面");
                }

                headPicPath = group.HeadPicPath;
                groupSlogan.Value = group.Slogan;
                groupPlaCard.Value = group.PlaCard;

                HF_GroupId.Value = groupId.ToString();

                SetTitle(group.Name + "-群组管理");
            }

            base.CSSName = "ume2";
            SetTitle(group.Name + "-个性化设置");
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["groupId"] == null)
            {
                throw new Exception("参数错误");
            }

            if (!int.TryParse(Request.QueryString["groupId"].ToString(), out groupId))
            {
                throw new Exception("参数错误");
            }

            CY.UME.Core.Business.Group group = CY.UME.Core.Business.Group.Load(groupId);

            if (group == null)
            {
                throw new Exception("参数错误");
            }

            if (group.Type == 0)
            {
                IsClass = true;
            }

            gm_HiddenSiteUrl.Value = SiteUrl;
            gm_HiddenGroupId.Value = groupId.ToString();

            if (!IsPostBack)
            {
                CY.UME.Core.Business.AccountGroup ag = new CY.UME.Core.Business.AccountGroup();
                IList<CY.UME.Core.Business.AccountGroup> agList = ag.GetAccountGroupByAccountIdOrGroupId(CurrentAccount.Id, groupId);
                if (agList.Count == 0 || agList[0].Role != 1)
                {
                    throw new Exception("您无权访问该页面");
                }

                groupNavigation1.groupId = group.Id;

                ViewState["GroupId"] = groupId;

                BindData(group);

                SetTitle("群组管理-" + group.Name);
            }
        }
Esempio n. 3
0
        /// <summary>
        /// 获取群组成员
        /// </summary>
        private string GetGroupMemberInfo(CY.UME.Core.Business.Group group)
        {
            #region validate
            if (group == null)
            {
                return "[]";
            }
            #endregion

            try
            {
                CY.UME.Core.Business.AccountGroup ae = new CY.UME.Core.Business.AccountGroup();
                IList<CY.UME.Core.Business.AccountGroup> aList = ae.GetAccountGroupByAccountIdOrGroupId(0, group.Id);

                StringBuilder sb = new StringBuilder();
                CY.UME.Core.Business.AccountExtend accountExtendTemp;

                sb.Append("[");
                foreach (CY.UME.Core.Business.AccountGroup ag in aList)
                {
                    accountExtendTemp = CY.UME.Core.Business.AccountExtend.Load(ag.AccountId);
                    sb.Append("{");
                    sb.Append("\"Id\":\"" + ag.AccountId + "\"");
                    sb.Append(",\"Name\":\"" + ag.Name + "\"");
                    sb.Append(",\"Phone\":\"" + (accountExtendTemp == null ? "" : accountExtendTemp.Telephone) + "\"");
                    sb.Append("},");
                }

                if (aList.Count > 0)
                {
                    sb.Remove(sb.Length - 1, 1);
                }
                sb.Append("]");

                return sb.ToString();
            }
            catch
            {
                return "[]";
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                long Id = 0;
                CurrentAccount = CY.UME.Core.Global.GetCurrentAccount();
                if (CurrentAccount == null)
                {
                    Response.Redirect("../Login.aspx");
                    return;
                }
                //this.hiduserid.Value = currentacc.Id.ToString();

                uaccountex = CY.UME.Core.Business.AccountExtend.Load(Id);
                CY.UME.Core.Business.Account currentacc = CY.UME.Core.Business.Account.Load(Id);

                if (uaccountex != null && !uaccountex.IsNew)
                {
                    IList<CY.UME.Core.Business.Friendship> fslist = CY.UME.Core.Business.Friendship.GetAccountRequestList(currentacc);
                    IList<CY.UME.Core.Business.AccountExtend> sameinterlist = CY.UME.Core.Business.AccountExtend.GetInterFrendsByAccountExtend(uaccountex);
                    IList<CY.UME.Core.Business.AccountExtend> classmatelist = CY.UME.Core.Business.AccountExtend.GetClassMateByAccountExtend(uaccountex);
                    groups = CY.UME.Core.Business.Group.GetCommendGroup(uaccountex);

                    if (sameinterlist != null && sameinterlist.Count != 0)
                    {
                        if (fslist != null && fslist.Count != 0)
                        {
                            for (int i = 0; i < sameinterlist.Count; i++)
                            {
                                for (int j = 0; j < fslist.Count; j++)
                                {
                                    if (sameinterlist[i].Id == fslist[j].FriendId)
                                    {
                                        sameinterlist.Remove(sameinterlist[i]);
                                        i = i - 1;
                                        break;
                                    }
                                }
                            }
                        }
                        sameinterlist = sameinterlist.Take(6).ToList();
                        for (int i = 0; i < sameinterlist.Count; i++)
                        {
                            CY.UME.Core.Business.Account acc = CY.UME.Core.Business.Account.Load(sameinterlist[i].Id);
                            if (acc != null && !acc.IsNew)
                            {
                                sameinter.Add(acc);
                            }
                        }
                    }
                    if (classmatelist != null && classmatelist.Count != 0)
                    {
                        if (fslist != null && fslist.Count != 0)
                        {
                            for (int i = 0; i < classmatelist.Count; i++)
                            {
                                for (int j = 0; j < fslist.Count; j++)
                                {
                                    if (classmatelist[i].Id == fslist[j].FriendId)
                                    {
                                        classmatelist.Remove(classmatelist[i]);
                                        i = i - 1;
                                        break;
                                    }
                                }
                            }
                        }
                        classmatelist = classmatelist.Take(6).ToList();
                        for (int j = 0; j < classmatelist.Count; j++)
                        {
                            CY.UME.Core.Business.Account acc = CY.UME.Core.Business.Account.Load(classmatelist[j].Id);
                            if (acc != null && !acc.IsNew)
                            {
                                classmate.Add(acc);
                            }
                        }
                    }
                    if (groups != null && groups.Count != 0)
                    {
                        CY.UME.Core.Business.AccountGroup accgroup = new CY.UME.Core.Business.AccountGroup();
                        IList<CY.UME.Core.Business.AccountGroup> accgrouplist = accgroup.GetAccountGroupByAccountIdOrGroupId(Id, 0);
                        if (accgrouplist != null && accgrouplist.Count != 0)
                        {
                            for (int i = 0; i < groups.Count; i++)
                            {
                                for (int j = 0; j < accgrouplist.Count; j++)
                                {
                                    if (groups[i].Id == accgrouplist[j].GroupId)
                                    {
                                        groups.Remove(groups[i]);
                                        i = i - 1;
                                        break;
                                    }
                                }
                            }
                        }
                        groups = groups.Take(6).ToList();
                    }
                }
            }
            catch
            {
                return;
            }
        }