Sharepoint Webpart 自定义属性

2020-11-15 15:08

阅读:817

标签:style   blog   http   java   color   os   

 

  

soscw.com,搜素材
namespace Webpart.Staffing.ViewAll
{
    [ToolboxItemAttribute(false)]
    public partial class ViewAll : WebPart
    {
        public ViewAll()
        {
        }

        private string _listName;
        [Personalizable(true)]
        [WebBrowsable(true)]
        [Category("Customize")]
        [WebDisplayName("List Name")]
        public string ListName
        {
            set { _listName = value; }
            get { return _listName; }
        }

        private DataTable GetItems()
        {
            SPListItemCollection collJD = null;
            SPSecurity.RunWithElevatedPrivileges(delegate()
            {
                using (SPSite site = new SPSite(SPContext.Current.Web.Url))
                {
                    using (SPWeb web = site.OpenWeb())
                    {
                        SPList list = web.Lists.TryGetList(string.IsNullOrEmpty(_listName) ? HRConstant.listJDReferral : _listName);
                        SPQuery query = new SPQuery();
                        //query.Query=string.Format("{0}{1}{2}{3}",positionTitle,location,positionLevel,department);
                        query.Query = string.Format("Open");
                        query.ViewFields = "";
                        collJD = list.GetItems(query);
                    }

                }
            });
        }
    }
}    
soscw.com,搜素材

 

Sharepoint Webpart 自定义属性,搜素材,soscw.com

Sharepoint Webpart 自定义属性

标签:style   blog   http   java   color   os   

原文地址:http://www.cnblogs.com/batter152/p/3698632.html


评论


亲,登录后才可以留言!