示例#1
0
    public void Display_Add()
    {
        m_cGroup = this.m_refCommunityGroupApi.GetCommunityGroupByID(this.m_iID);

        Packages.EktronCoreJS.Register(this);
        JavaScript.Create(this.m_refContentApi.ApplicationPath + "java/plugins/inputLabel/ektron.inputLabel.js").Register(this);

        ltr_search.Text = "<br/>&#160;" + GetMessage("lbl select users") + ":<br/>";
        ltr_search.Text += "&#160;" + "<input type=text size=25 id=\"txtSearch\" name=\"txtSearch\" value=\"" + m_strKeyWords + "\" onkeydown=\"CheckForReturn(event)\">";
        ltr_search.Text += "&#160;";
        ltr_search.Text += "<select id=\"searchlist\" name=\"searchlist\">";
        ltr_search.Text += "<option value=\"-1\" " + IsSelected("-1") + ">" + GetMessage("display name label") + "</option>";
        ltr_search.Text += "<option value=\"last_name\"" + IsSelected("last_name") + ">" + GetMessage("lbl last name") + "</option>";
        ltr_search.Text += "<option value=\"first_name\"" + IsSelected("first_name") + ">" + GetMessage("lbl first name") + "</option>";
        ltr_search.Text += "<option value=\"user_name\"" + IsSelected("user_name") + ">" + GetMessage("generic username") + "</option>";
        // ltr_search.Text &= "<option value=""all"" " & IsSelected("all") & ">" & GetMessage("generic all") & "</option>"
        ltr_search.Text += "</select>";
        ltr_search.Text += "&#160;";
        ltr_search.Text += "<input type=button value=\"Search\" id=\"btnSearch\" name=\"btnSearch\" onclick=\"searchuser();\" title=\"Search Users\">";

        if (Page.IsPostBack)
        {
            SiteAPI m_refSiteApi = new SiteAPI();
            setting_data = m_refSiteApi.GetSiteVariables(m_refSiteApi.UserId);

            CommunityGroupObjectRequest request = new CommunityGroupObjectRequest();
            request.CurrentPage = m_intCurrentPage;
            request.PageSize = System.Convert.ToInt32(m_PageSize > 0 ? m_PageSize : 0);
            request.GroupId = this.m_iID;
            request.SearchText = m_strKeyWords;
            switch (m_strSelectedItem)
            {
                case "last_name":
                    request.SearchField = "last_name";
                    break;
                case "first_name":
                    request.SearchField = "first_name";
                    break;
                case "user_name":
                    request.SearchField = "user_name";
                    break;
                default: // "-1"
                    request.SearchField = "display_name";
                    break;
            }
            request.ObjectId = this.m_refContentApi.UserId;
            request.ObjectType = Ektron.Cms.Common.EkEnumeration.TaxonomyItemType.User;
            request.ObjectStatus = Ektron.Cms.Common.EkEnumeration.DirectoryItemStatus.All;
            m_aUsers = this.m_refCommunityGroupApi.GetAllUnassignedCommunityGroupUsers(ref request);
            if ((m_aUsers != null) && m_aUsers.Length > 0)
            {
                m_bAllowAdd = true;
            }
            m_intTotalPages = request.TotalPages;
            Populate_ViewCommunityMembersGrid(m_aUsers);
        }
        else
        {
            PageSettings(); // to suppress the paging stuff
        }
    }
示例#2
0
    protected override void Page_Load(object sender, System.EventArgs e)
    {
        base.Page_Load(sender, e);
        if (Request.Form["txtSearch"] != "")
        {
            m_strKeyWords = Request.Form["txtSearch"];
        }
        this.groupID.Value = m_iID.ToString();
        m_PageSize = this.m_refContentApi.RequestInformationRef.PagingSize;
        try
        {
            if (CheckAccess() == false)
            {
                throw (new Exception(this.GetMessage("err communitymembers no access")));
            }
            switch (this.m_sPageAction)
            {
                case "adduser":
                    if (Page.IsPostBack)
                    {
                        CollectSearchText();
                        if (Request.Form["isDeleted"] != "")
                        {
                            Process_Add();
                        }
                        else if (Request.Form["isSearchPostData"] != "")
                        {
                            this.isSearchPostData.Value = "";
                            Display_Add();
                        }
                    }
                    else
                    {
                        Display_Add();
                    }
                    break;
                case "pending":
                    if (Page.IsPostBack && Request.Form["isDeleted"] != "")
                    {
                        Process_Pending();
                        Display_PendingView();
                        this.isDeleted.Value = "";
                    }
                    else if (Page.IsPostBack && Request.Form["isSearchPostData"] != "")
                    {
                        CollectSearchText();
                        Display_PendingView();
                    }
                    else if (!Page.IsPostBack)
                    {
                        Display_PendingView();
                    }
                    break;
                default: // "viewall"
                    if (Page.IsPostBack && Request.Form["isDeleted"] != "")
                    {
                        Process_Remove();
                        Display_View();
                        this.isDeleted.Value = "";
                    }
                    else if (Page.IsPostBack && Request.Form["isSearchPostData"] != "")
                    {
                        CollectSearchText();
                        CurrentPage.Text = "1";
                        Display_View();
                        this.isSearchPostData.Value = "";
                    }
                    else if (!Page.IsPostBack)
                    {
                        Display_View();
                    }
                    break;
            }
            BuildJS();

            if (Page.IsPostBack)
            {
                SiteAPI m_refSiteApi = new SiteAPI();
                setting_data = m_refSiteApi.GetSiteVariables(m_refSiteApi.UserId);

                CommunityGroupObjectRequest request = new CommunityGroupObjectRequest();
                request.CurrentPage = m_intCurrentPage;
                request.PageSize = System.Convert.ToInt32(m_PageSize > 0 ? m_PageSize : 0);
                request.GroupId = this.m_iID;
                request.SearchText = m_strKeyWords == null ? "" : m_strKeyWords;
                switch (m_strSelectedItem)
                {
                    case "last_name":
                        request.SearchField = "last_name";
                        break;
                    case "first_name":
                        request.SearchField = "first_name";
                        break;
                    case "user_name":
                        request.SearchField = "user_name";
                        break;
                    default: // "-1"
                        request.SearchField = "display_name";
                        break;
                }
                request.ObjectId = this.m_refContentApi.UserId;
                request.ObjectType = Ektron.Cms.Common.EkEnumeration.TaxonomyItemType.User;
                request.ObjectStatus = Ektron.Cms.Common.EkEnumeration.DirectoryItemStatus.All;
                m_aUsers = this.m_refCommunityGroupApi.GetAllUnassignedCommunityGroupUsers(ref request);
                if ((m_aUsers != null) && m_aUsers.Length > 0)
                {
                    m_bAllowAdd = true;
                }
            }
            SetLabels();
            RegisterResources();
        }
        catch (Exception ex)
        {
            Utilities.ShowError(ex.Message + ex.StackTrace);
        }
    }