private bool uploadDllFileToBlob() { if (textBoxAppId.Text == string.Empty) { MessageBox.Show("App ID is nothing !!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } if (textBoxBlobContainer.Text == string.Empty) { MessageBox.Show("BLOB Container Name is nothing !!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } if (textBoxFileName.Text == string.Empty) { MessageBox.Show("DLL File Name is nothing !!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } if (textBoxUploadFilePath.Text == string.Empty) { MessageBox.Show("DLL File Local Path is nothing !!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } // Get App Master data var appMasterProcessor = new AppMasterProcessor(sqlConnectionString, encPassPhrase); var appMasterEntity = appMasterProcessor.GetAppMaster(textBoxAppId.Text); // Download DLL from BLOB string blobStorageConnString = "DefaultEndpointsProtocol=https;AccountName=" + appMasterEntity.StorageAccount + ";AccountKey=" + appMasterEntity.StorageKey; CloudStorageAccount storageAccount = CloudStorageAccount.Parse(blobStorageConnString); CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient(); CloudBlobContainer container = blobClient.GetContainerReference(textBoxBlobContainer.Text); CloudBlockBlob blockBlob = container.GetBlockBlobReference(textBoxFileName.Text); using (var fileStream = File.OpenRead(textBoxUploadFilePath.Text)) { blockBlob.UploadFromStream(fileStream); } return(true); }
private void updateButton_Click(object sender, EventArgs e) { if (!checkInputData()) { return; } try { AppMasterEntity appMasterEntity = getAppMasterEntity(); AppMasterProcessor appMasterProcessor = new AppMasterProcessor(sqlConnectionString, this.encPassPhrase); appMasterProcessor.updateAppMaster(appMasterEntity); MessageBox.Show("App Master updated successfully!", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex) { throw ex; } this.Close(); }