Example #1
0
        public string Export(int ContentPropertyID, int SiteID, string UserID)
        {
            using (var _c = db)
            {
                Can(SiteID, UserID, _c);
                List <ContentBindingList> _CP = null;
                if (ContentPropertyID == 0)
                {
                    _CP = Get(SiteID, UserID);
                }
                else
                {
                    var _M = _c.ContentProperties.Where(m => m.ContentPropertyID == ContentPropertyID).ToList();
                    _CP = GetOrder(_M, _M[0].ContentPropertyParentID)[0].Items.ToList();
                }
                ExportFillFile(_CP);
                var _URL = SiteID + (ContentPropertyID == 0 ? "" : "/" + ContentPropertyID) + "/PROPERTIES.json";

                var blob = new Utils.FileUtil().GetBlob("export", _URL);
                using (Stream blobStream = blob.OpenWrite())
                {
                    using (StreamWriter writer = new StreamWriter(blobStream))
                    {
                        string _JSON = JsonConvert.SerializeObject(_CP);
                        writer.Write(_JSON);
                    }
                }
                return(StorageUrl + "/export/" + _URL);
            }
        }
Example #2
0
        public string Export(int SiteID)
        {
            var _URL = SiteID + "/SITE.json";
            var blob = new Utils.FileUtil().GetBlob("export", _URL);

            using (Stream blobStream = blob.OpenWrite())
            {
                using (StreamWriter writer = new StreamWriter(blobStream))
                {
                    string _JSON = JsonConvert.SerializeObject(ExportObject(SiteID));
                    writer.Write(_JSON);
                }
            }
            return(StorageUrl + "/export/" + _URL);
        }
Example #3
0
        public string Export(int ContentPropertyID, int SiteID, string UserID)
        {
            using (var _c = db)
            {
                Can(SiteID, UserID, _c);
                List<ContentBindingList> _CP = null;
                if (ContentPropertyID == 0)
                {
                    _CP = Get(SiteID, UserID);
                }
                else
                {
                    var _M = _c.ContentProperties.Where(m => m.ContentPropertyID == ContentPropertyID).ToList();
                    _CP = GetOrder(_M, _M[0].ContentPropertyParentID)[0].Items.ToList();
                }
                ExportFillFile(_CP);
                var _URL = SiteID + (ContentPropertyID == 0 ? "" : "/" + ContentPropertyID) + "/PROPERTIES.json";

                var blob = new Utils.FileUtil().GetBlob("export", _URL);
                using (Stream blobStream = blob.OpenWrite())
                {
                    using (StreamWriter writer = new StreamWriter(blobStream))
                    {
                        string _JSON = JsonConvert.SerializeObject(_CP);
                        writer.Write(_JSON);
                    }
                }
                return StorageUrl + "/export/" + _URL;
            }
        }
Example #4
0
 public string Export(int SiteID)
 {
     var _URL = SiteID + "/SITE.json";
     var blob = new Utils.FileUtil().GetBlob("export", _URL);
     using (Stream blobStream = blob.OpenWrite())
     {
         using (StreamWriter writer = new StreamWriter(blobStream))
         {
             string _JSON = JsonConvert.SerializeObject(ExportObject(SiteID));
             writer.Write(_JSON);
         }
     }
     return StorageUrl + "/export/" + _URL;
 }