protected void CBS_ddl_ListVolumes_SelectChange(object sender, EventArgs e) { Stopwatch TimeClock = new Stopwatch(); TimeClock.Start(); string region = CBS_ddl_Region.SelectedItem.ToString(); try { bindListNetworksSessionDDL(BlockStorage.CBS_m_ListVolumes(region), "DisplayName", "Id", CBSListVolumesSession()); CBS_lbl_Info.Text = CBS_m_GetVolumeinfo(BlockStorage.CBS_m_ListVolumes(region)); bindListSnapShotsDDL(BlockStorage.CBS_m_ListSnapShots(region), "DisplayName", "Id"); bindListVolumeTypeDDL(BlockStorage.CBS_m_ListVolumesType(region), "Name"); TimeClock.Stop(); CBS_lbl_TimeClock.Text = TimeClock.Elapsed.ToString(); } catch (Exception ex) { CBS_m_MsgCatchException(ex.ToString()); } }
protected void CBS_ddl_Region_SelectChange(object sender, EventArgs e) { Stopwatch TimeClock = new Stopwatch(); TimeClock.Start(); string region = CBS_ddl_Region.SelectedItem.ToString(); try { StringBuilder listVolumesSB = new StringBuilder(); var listVolumes = BlockStorage.CBS_m_ListVolumes(region); bindListNetworksDDL(listVolumes, "DisplayName", "Id"); foreach (var volume in listVolumes) { listVolumesSB.Append(volume.Status); } CBS_lbl_VolumeStatus.Text = "Volume Status : " + listVolumesSB.ToString(); StringBuilder listSnapshotsSB = new StringBuilder(); var listSnapshots = BlockStorage.CBS_m_ListSnapShots(region); bindListSnapShotsDDL(listSnapshots, "DisplayName", "Id"); foreach (var snapshot in listSnapshots) { listSnapshotsSB.Append(snapshot.Status); } CBS_lbl_SnapshotStatus.Text = "Snapshot Status : " + listSnapshotsSB.ToString(); CBS_lbl_Info.Text = CBS_m_GetVolumeinfo(BlockStorage.CBS_m_ListVolumes(region)); bindListVolumeTypeDDL(BlockStorage.CBS_m_ListVolumesType(region), "Name"); TimeClock.Stop(); CBS_lbl_TimeClock.Text = TimeClock.Elapsed.ToString(); } catch (Exception ex) { CBS_m_MsgCatchException(ex.ToString()); } }
protected void CBS_btn_DeleteVolume_OnClick(object sender, EventArgs e) { Stopwatch TimeClock = new Stopwatch(); TimeClock.Start(); string region = CBS_ddl_Region.SelectedItem.ToString(); string CBSDeleteVolumeID = CBS_ddl_ListVolumes.SelectedValue; try { BlockStorage.CBS_m_DeleteVolume(CBSDeleteVolumeID, region); BlockStorage.CBS_m_ListVolumes(region); BlockStorage.CBS_m_ListVolumesType(region); CBS_m_MsgDeleteVolumeSuccess(); TimeClock.Stop(); CBS_lbl_TimeClock.Text = TimeClock.Elapsed.ToString(); } catch (Exception ex) { CBS_m_MsgCatchException(ex.ToString()); } }
protected void Page_Load(object sender, EventArgs e) { Stopwatch TimeClock = new Stopwatch(); TimeClock.Start(); string region = CBS_ddl_Region.SelectedItem.ToString(); HttpContext.Current.Session["CBSListVolumes"] = HttpUtility.HtmlEncode(CBS_ddl_ListVolumes.SelectedItem); HttpContext.Current.Session["CBSListSnapshots"] = CBS_ddl_ListSnapShots.Text; Page.GetPostBackEventReference(CBS_btn_CreateVolume); try { if (Page.IsPostBack) { } else { if (string.IsNullOrEmpty((string)(Session["CloudIdentityUserName"])) & string.IsNullOrEmpty((string)(Session["CloudIdentityApiKey"]))) { CBS_lbl_Error.Text = "Before continuing please login and enter Cloud Username and API Key."; } else if (string.IsNullOrEmpty((string)(Session["CloudIdentityUserName"]))) { CBS_lbl_Error.Text = "Before continuing please login and please enter Cloud Username."; } else if (string.IsNullOrEmpty((string)(Session["CloudIdentityApiKey"]))) { CBS_lbl_Error.Text = "Before continuing please login and please enter API Key."; } else { StringBuilder listVolumesSB = new StringBuilder(); var listVolumes = BlockStorage.CBS_m_ListVolumes(region); bindListNetworksDDL(listVolumes, "DisplayName", "Id"); foreach (var volume in listVolumes) { listVolumesSB.Append(volume.Status); } CBS_lbl_VolumeStatus.Text = "Volume Status : " + listVolumesSB.ToString(); StringBuilder listSnapshotsSB = new StringBuilder(); var listSnapshots = BlockStorage.CBS_m_ListSnapShots(region); bindListSnapShotsDDL(listSnapshots, "DisplayName", "Id"); foreach (var snapshot in listSnapshots) { listSnapshotsSB.Append(snapshot); } CBS_lbl_SnapshotStatus.Text = "Snapshot Status : " + listSnapshotsSB.ToString(); CBS_lbl_Info.Text = CBS_m_GetVolumeinfo(BlockStorage.CBS_m_ListVolumes(region)); bindListVolumeTypeDDL(BlockStorage.CBS_m_ListVolumesType(region), "Name"); TimeClock.Stop(); CBS_lbl_TimeClock.Text = TimeClock.Elapsed.ToString(); } } } catch (Exception ex) { CBS_m_MsgCatchException(ex.ToString()); } }