public void DeleteSurvey(string surveyId) { BlobManager BlobManagerObj = new BlobManager("snpdiscovery"); // Create a file in your local MyDocuments folder to upload to a blob. string localPath = "questionnaire"; var storage = GetSurveys(); if (storage.Remove(surveyId)) { BlobManagerObj.DeleteBlob(localPath, surveyId); } session.SetString("SurveyStorage", JsonConvert.SerializeObject(storage)); }
public void ChangeName(string id, string name) //name is new id { // Container Name - picture BlobManager BlobManagerObj = new BlobManager("snpdiscovery"); // Create a file in your local MyDocuments folder to upload to a blob. string localPath = "questionnaire"; string sourceFile = System.IO.Path.Combine(localPath, name); string uploadStatus = ""; var storage = GetSurveys(); storage[name] = storage[id]; //adding new entry uploadStatus = BlobManagerObj.UploadTextToBlob(sourceFile, storage[id]); if (!string.IsNullOrWhiteSpace(uploadStatus) & uploadStatus.Contains(name)) { storage.Remove(id); BlobManagerObj.DeleteBlob(localPath, id); } session.SetString("SurveyStorage", JsonConvert.SerializeObject(storage)); }