コード例 #1
0
        private void IssueQuery()
        {
            XmlDocument docTeam = new XmlDocument();

            //docTeam.LoadXml(WorkEngineAPI.GetTeam("<GetTeam><Columns>Title,Username</Columns></GetTeam>"));
            //docTeam.LoadXml(WorkEngineAPI.GetTeam("<Filter Column='Title' Value='" + searchVal + "'/>"));
            docTeam.LoadXml(WorkEngineAPI.GetTeam("<GetTeam><Columns>Title,Email</Columns></GetTeam>", SPContext.Current.Web));
            xml = docTeam.OuterXml;
        }
コード例 #2
0
        public override Microsoft.SharePoint.WebControls.PickerEntity ValidateEntity(Microsoft.SharePoint.WebControls.PickerEntity entity)
        {
            try
            {
                if (isWEEditor)
                {
                    if (SPContext.Current.List == null || SPContext.Current.List.Title != "Resources")
                    {
                        this.ValidateResolvedEntity = false;
                        entity = base.ValidateEntity(entity);

                        XmlDocument docTeam = new XmlDocument();
                        docTeam.LoadXml(WorkEngineAPI.GetTeam("<Filter Column='SharePointAccount' Value='" + entity.DisplayText + "'/>", SPContext.Current.Web));
                        if (docTeam.FirstChild.SelectSingleNode("//Team/Member") == null)
                        {
                            entity.IsResolved = false;
                        }
                        else
                        {
                            if (entity.EntityData["PrincipalType"].ToString().ToLower() == "sharepointgroup")
                            {
                                if (docTeam.FirstChild.SelectSingleNode("//Team/Member").Attributes["SharePointAccount"].Value.ToLower() != entity.EntityData["AccountName"].ToString().ToLower())
                                {
                                    entity.IsResolved = false;
                                }
                                else
                                {
                                    entity.IsResolved = true;
                                }
                            }
                            else
                            {
                                if (docTeam.FirstChild.SelectSingleNode("//Team/Member").Attributes["Username"].Value.ToLower() != entity.EntityData["AccountName"].ToString().ToLower())
                                {
                                    entity.IsResolved = false;
                                }
                            }
                        }
                    }
                    else
                    {
                        entity = base.ValidateEntity(entity);
                    }
                }
                else
                {
                    entity = base.ValidateEntity(entity);
                }
            }
            catch { }
            return(entity);
        }
コード例 #3
0
        protected override int IssueQuery(string search, string groupName, int pageIndex, int pageSize)
        {
            dtUsers = new DataTable();
            dtUsers.Columns.Add("ID");
            dtUsers.Columns.Add("SPAccountInfo");
            dtUsers.Columns.Add("Username");
            dtUsers.Columns.Add("PrincipalType");
            dtUsers.Columns.Add("SharePointAccount");
            dtUsers.Columns.Add("Title");

            if (!dtUsers.Columns.Contains(mColumnList.SelectedValue))
            {
                dtUsers.Columns.Add(mColumnList.SelectedValue);
            }

            ArrayList columnNames        = ((TableResultControl)this.mDialogControl.ResultControl).ColumnNames;
            ArrayList columnDisplayNames = ((TableResultControl)this.mDialogControl.ResultControl).ColumnDisplayNames;
            ArrayList columnWidths       = ((TableResultControl)this.mDialogControl.ResultControl).ColumnWidths;

            columnDisplayNames.Clear();
            columnNames.Clear();
            columnWidths.Clear();

            columnDisplayNames.Add("Resource Name");
            columnNames.Add("Title");
            columnWidths.Add("180px");

            //columnDisplayNames.Add(mColumnList.SelectedItem.Text);
            //columnNames.Add(mColumnList.SelectedValue);
            //columnWidths.Add("180px");

            XmlDocument docTeam = new XmlDocument();

            docTeam.LoadXml(WorkEngineAPI.GetTeam("<Filter Column='" + groupName + "' Value='" + search.Replace("'", "''") + "' WebId='" + CurrentWeb.ToString() + "'/>", SPContext.Current.Web));

            foreach (XmlNode ndTeam in docTeam.FirstChild.SelectNodes("//Team/Member"))
            {
                ArrayList item = new ArrayList();

                foreach (DataColumn dc in dtUsers.Columns)
                {
                    XmlAttribute attr = ndTeam.Attributes[dc.ColumnName];
                    if (attr != null)
                    {
                        item.Add(attr.Value);
                    }
                    else
                    {
                        item.Add("");
                    }
                }

                dtUsers.Rows.Add(item.ToArray());
            }

            PickerDialog.Results = dtUsers;
            PickerDialog.ResultControl.PageSize = dtUsers.Rows.Count;



            return(dtUsers.Rows.Count);
        }