Ejemplo n.º 1
0
        /// <summary>
        /// 获取指定文件夹里面的所有文件集合(来自接口查询)
        /// </summary>
        /// <param name="setting">配置信息</param>
        /// <param name="ListName">文档库名称</param>
        /// <param name="iFolderId">文件夹编号</param>
        /// <returns></returns>
        public List <SPWcfDocument> GetFolderDocumentsByDB(SPSetting setting, string ListName, int iFolderId)
        {
            SharePointHelper     docHelper = new SPDocumentWcfService.SharePointHelper(setting.SPUserId, setting.SPUserPwd, setting.SPUserDomain, setting.SPSite, setting.SPWeb, setting.ActionUser);
            SPCostDocuments      docs      = docHelper.GetFolderDocuments(ListName, iFolderId);
            List <SPWcfDocument> wcfDocs   = new List <SPWcfDocument>();

            foreach (SPCostDocument doc in docs)
            {
                SPWcfDocument wcfDoc = SPDocToWcfDoc(doc);
                wcfDocs.Add(wcfDoc);
            }
            return(wcfDocs);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 创建文件夹
        /// </summary>
        /// <param name="setting">配置信息</param>
        /// <param name="strListName">文档库</param>
        /// <param name="strFolderName">文件夹名称</param>
        /// <param name="dtCreated">日期</param>
        /// <returns></returns>
        public SPWcfFolder CreateSPFolder(SPSetting setting, string strListName, string strFolderName, DateTime dtCreated)
        {
            SharePointHelper docHelper = new SPDocumentWcfService.SharePointHelper(setting.SPUserId, setting.SPUserPwd, setting.SPUserDomain, setting.SPSite, setting.SPWeb, setting.ActionUser);
            SPCostFolder     folder    = docHelper.CreateSPFolder(strListName, strFolderName, dtCreated);
            SPWcfFolder      wFolder   = new SPDocumentWcfService.SPWcfFolder()
            {
                ID          = folder.ID,
                FileRef     = folder.FileRef,
                FileLeafRef = folder.FileLeafRef,
                FileFullRef = folder.FileFullRef,
                ListName    = folder.ListName,
                ParentUrl   = folder.ParentUrl,
                UniqueId    = folder.UniqueId
            };

            return(wFolder);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 更新列表库指定列表项字段内容
        /// </summary>
        /// <param name="setting">配置信息</param>
        /// <param name="strListName">列表库名称</param>
        /// <param name="iItemId">更改数据的编号</param>
        /// <param name="updateValue">需要更改的内容</param>
        public void UpdateSPListItem(SPSetting setting, string strListName, int iItemId, Dictionary <string, string> updateValue)
        {
            SharePointHelper docHelper = new SPDocumentWcfService.SharePointHelper(setting.SPUserId, setting.SPUserPwd, setting.SPUserDomain, setting.SPSite, setting.SPWeb, setting.ActionUser);

            docHelper.UpdateSPListItem(strListName, 1, updateValue);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 获取指定列表或文档库的信息
        /// </summary>
        /// <param name="setting">配置信息</param>
        /// <param name="ListName">列表库名称</param>
        /// <returns></returns>
        public SPList GetSPListInfo(SPSetting setting, string ListName)
        {
            SharePointHelper docHelper = new SPDocumentWcfService.SharePointHelper(setting.SPUserId, setting.SPUserPwd, setting.SPUserDomain, setting.SPSite, setting.SPWeb, setting.ActionUser);

            return(docHelper.GetListInfo(ListName));
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 删除指定文件夹里面的图片文件
        /// </summary>
        /// <param name="setting">配置信息</param>
        /// <param name="ListName">图片库名称</param>
        /// <param name="ImageFileName">图片文件名</param>
        /// <param name="iFolderId">文件夹编号</param>
        /// <returns></returns>
        public bool DeleteImageFile(SPSetting setting, string ListName, string ImageFileName, int iFolderId)
        {
            SharePointHelper docHelper = new SPDocumentWcfService.SharePointHelper(setting.SPUserId, setting.SPUserPwd, setting.SPUserDomain, setting.SPSite, setting.SPWeb, setting.ActionUser);

            return(docHelper.DeleteImageFile(ListName, ImageFileName, iFolderId));
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 按查询条件和排序规则查询图片库图片集合
        /// </summary>
        /// <param name="setting">配置信息</param>
        /// <param name="strListName">图片库名称</param>
        /// <param name="SearchList">查询条件</param>
        /// <param name="OrderList">排序条件</param>
        /// <returns></returns>
        public SPImages GetImageFilesBySearchOrder(SPSetting setting, string strListName, SPListSearchs SearchList, Dictionary <string, SPListOrderByEnum> OrderList)
        {
            SharePointHelper docHelper = new SPDocumentWcfService.SharePointHelper(setting.SPUserId, setting.SPUserPwd, setting.SPUserDomain, setting.SPSite, setting.SPWeb, setting.ActionUser);

            return(docHelper.GetImageFiles(strListName, SearchList, OrderList));
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 获取图片库里面的指定图片
        /// </summary>
        /// <param name="setting">配置信息</param>
        /// <param name="strFileName">图片名称</param>
        /// <param name="strListName">图片库名称</param>
        /// <param name="iFolderId">存放文件夹编号</param>
        /// <returns></returns>
        public SPImage GetImageFolderFile(SPSetting setting, string strFileName, string strListName, int iFolderId)
        {
            SharePointHelper docHelper = new SPDocumentWcfService.SharePointHelper(setting.SPUserId, setting.SPUserPwd, setting.SPUserDomain, setting.SPSite, setting.SPWeb, setting.ActionUser);

            return(docHelper.GetImageFolderFile(strFileName, strListName, iFolderId));
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 上传图片到指定的文件夹里面
        /// </summary>
        /// <param name="setting">配置信息</param>
        /// <param name="strFileName">图片名称</param>
        /// <param name="fileData">图片内容</param>
        /// <param name="ListName">图片库名称</param>
        /// <param name="FolderId">文件夹编号</param>
        /// <param name="IsUpload">图片上传是否成功</param>
        /// <returns></returns>
        public string UploadImageFileById(SPSetting setting, string strFileName, byte[] fileData, string ListName, int FolderId, out bool IsUpload)
        {
            SharePointHelper docHelper = new SPDocumentWcfService.SharePointHelper(setting.SPUserId, setting.SPUserPwd, setting.SPUserDomain, setting.SPSite, setting.SPWeb, setting.ActionUser);

            return(docHelper.UploadImageFile(strFileName, fileData, ListName, FolderId, out IsUpload));
        }
Ejemplo n.º 9
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="setting">配置信息</param>
        /// <param name="strListName">图片库名称</param>
        /// <param name="iFolderId">文件夹编号</param>
        /// <param name="strNewFolderName">文件夹新名称</param>
        /// <returns></returns>
        public bool UpdateImageFolderName(SPSetting setting, string strListName, int iFolderId, string strNewFolderName)
        {
            SharePointHelper docHelper = new SPDocumentWcfService.SharePointHelper(setting.SPUserId, setting.SPUserPwd, setting.SPUserDomain, setting.SPSite, setting.SPWeb, setting.ActionUser);

            return(docHelper.UpdateImageFolderName(strListName, iFolderId, strNewFolderName));
        }