Exemple #1
0
        /// <summary>
        /// Download File
        /// </summary>
        /// <param name="url">URL</param>
        /// <param name="applicationName">application Name</param>
        /// <returns>Byte Array</returns>
        public byte[] DownloadFile(string url, string applicationName)
        {
            BELDataAccessLayer helper = new BELDataAccessLayer();
            ////string siteURL = helper.GetSiteURL(applicationName);
            ////context = helper.CreateClientContext(siteURL);
            ClientContext contexts = null;
            string        siteURL  = helper.GetSiteURL(SiteURLs.ITEMCODECREATIONSITEURL);

            if (!string.IsNullOrEmpty(siteURL))
            {
                contexts = BELDataAccessLayer.Instance.CreateClientContextforattachment(siteURL);
            }

            return(helper.GetFileBytesByUrl(contexts, url));
        }
 protected BusinessLayerBase()
 {
     try
     {
         BELDataAccessLayer helper  = new BELDataAccessLayer();
         string             siteURL = helper.GetSiteURL(SiteURLs.DCRDCNSITEURL);
         if (!string.IsNullOrEmpty(siteURL))
         {
             context = helper.CreateClientContext(siteURL);
             web     = helper.CreateWeb(context);
         }
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
     }
 }
        private CommonBusinessLayer()
        {
            BELDataAccessLayer helper  = new BELDataAccessLayer();
            string             siteURL = helper.GetSiteURL(SiteURLs.DCRDCNSITEURL);

            if (!string.IsNullOrEmpty(siteURL))
            {
                if (this.context == null)
                {
                    this.context = BELDataAccessLayer.Instance.CreateClientContext(siteURL);
                }
                if (this.web == null)
                {
                    this.web = BELDataAccessLayer.Instance.CreateWeb(this.context);
                }
            }
        }