private void AddDataStores() { VMWare oVMWare = new VMWare(intProfile, dsn); DataSet ds = oAssetSharedEnvOrder.GetDataStoreSelection(Int32.Parse(hdnOrderId.Value)); foreach (DataRow dr in ds.Tables[0].Rows) { oVMWare.AddDatastore(Int32.Parse(dr["ClusterId"].ToString()), dr["Name"].ToString(), Int32.Parse(dr["Storage_Type"].ToString()), 0, Int32.Parse(dr["Replicated"].ToString()), 99999, 1, 0, 0, 0, 1); } }
protected void btnAdd_Click(Object Sender, EventArgs e) { int intMaximum = 0; if (Int32.TryParse(txtMaximum.Text, out intMaximum) == false) { intMaximum = 99999; } if (intID == 0) { oVMWare.AddDatastore(Int32.Parse(ddlParent.SelectedItem.Value), txtName.Text, Int32.Parse(ddlType.SelectedItem.Value), Int32.Parse(ddlOperatingSystemGroup.SelectedItem.Value), (chkReplicated.Checked ? 1 : 0), intMaximum, (chkServer.Checked ? 1 : 0), (chkPagefile.Checked ? 1 : 0), (chkOverridePermission.Checked ? 1 : 0), Int32.Parse(ddlPartner.SelectedItem.Value), (chkEnabled.Checked ? 1 : 0)); } else { oVMWare.UpdateDatastore(Int32.Parse(Request.Form[hdnId.UniqueID]), Int32.Parse(ddlParent.SelectedItem.Value), txtName.Text, Int32.Parse(ddlType.SelectedItem.Value), Int32.Parse(ddlOperatingSystemGroup.SelectedItem.Value), (chkReplicated.Checked ? 1 : 0), intMaximum, (chkServer.Checked ? 1 : 0), (chkPagefile.Checked ? 1 : 0), (chkOverridePermission.Checked ? 1 : 0), Int32.Parse(ddlPartner.SelectedItem.Value), (chkEnabled.Checked ? 1 : 0)); } Response.Redirect(Request.Path); }
protected void btnUpdateDS_Click(object sender, EventArgs e) { int intMaximum = 0; if (Int32.TryParse(txtDSMaximum.Text, out intMaximum) == false) { intMaximum = 99999; } int ds = 0; if (Int32.TryParse(Request.QueryString["ds"], out ds) == true) { oVMWare.UpdateDatastore(ds, Int32.Parse(lblDSParent.ToolTip), txtDSName.Text, Int32.Parse(ddlType.SelectedItem.Value), Int32.Parse(ddlOperatingSystemGroup.SelectedItem.Value), (chkReplicated.Checked ? 1 : 0), intMaximum, (chkServer.Checked ? 1 : 0), (chkPagefile.Checked ? 1 : 0), (chkOverridePermission.Checked ? 1 : 0), Int32.Parse(ddlPartner.SelectedItem.Value), (chkDSEnabled.Checked ? 1 : 0)); } else { oVMWare.AddDatastore(Int32.Parse(lblDSParent.ToolTip), txtDSName.Text, Int32.Parse(ddlType.SelectedItem.Value), Int32.Parse(ddlOperatingSystemGroup.SelectedItem.Value), (chkReplicated.Checked ? 1 : 0), intMaximum, (chkServer.Checked ? 1 : 0), (chkPagefile.Checked ? 1 : 0), (chkOverridePermission.Checked ? 1 : 0), Int32.Parse(ddlPartner.SelectedItem.Value), (chkDSEnabled.Checked ? 1 : 0)); } Response.Redirect(FormURL("")); }