Exemplo n.º 1
0
        /// <summary>
        /// Returns the uploaded document url
        /// </summary>
        /// <param name="siteURL">The site URL.</param>
        /// <param name="listName">Name of the list.</param>
        /// <param name="CAMLQuery">The CAML query.</param>
        /// <returns>string.</returns>
        public string GetUploadedDocumentUrl(string siteURL, string listName, string CAMLQuery)
        {
            objCommonDAL = new CommonDAL();
            string strObjectInnerHtml = string.Empty;
            string[] strDetail = objCommonDAL.GetUploadedDocumentUrl(siteURL, listName, CAMLQuery);

            string strDocUrl = strDetail[0];
            string strType = strDetail[1];

            if (!string.IsNullOrEmpty(strDocUrl) && !string.IsNullOrEmpty(strType))
            {
                if (string.Equals(strType, "pdf"))
                {
                    strDocUrl = strDocUrl + "#toolbar=0";
                    strType = "application/pdf";
                }

                if (string.Equals(strType, "bmp") || string.Equals(strType, "gif") || string.Equals(strType, "png"))
                {
                    strType = "image/" + strType;
                }

                if (string.Equals(strType, "jpg") || string.Equals(strType, "jpeg") || string.Equals(strType, "jpe"))
                {
                    strType = "image/jpeg";
                }

                if (string.Equals(strType, "tif"))
                {
                    strType = "image/tiff";
                }

                if (string.Equals(strType, "wmf"))
                {
                    strType = "application/x-msmetafile";
                }
                if (string.Equals(strType, "eps") || string.Equals(strType, "ai"))
                {
                    strType = "application/postscript";
                }
                if (string.Equals(strType, "svg"))
                {
                    strType = "image/svg+xml";
                }

                strObjectInnerHtml = "<object autostart=\"false\" data=\"" + strDocUrl + "\" type=\"" + strType + "\" width=\"100%\" height=\"100%\"></object>";
            }

            return strObjectInnerHtml;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Gets the printed document URL.
        /// </summary>
        /// <param name="siteURL">The site URL.</param>
        /// <param name="listName">Name of the list.</param>
        /// <param name="CAMLQuery">The CAML query.</param>
        /// <returns>string[]</returns>
        public string[] GetPrintedDocumentUrl(string siteURL, string listName, string CAMLQuery)
        {
            objCommonDAL = new CommonDAL();
            string[] strDetail = objCommonDAL.GetUploadedDocumentUrl(siteURL, listName, CAMLQuery);

            return strDetail;
        }