Beispiel #1
0
        private void AddHosts()
        {
            VMWare  oVMWare = new VMWare(intProfile, dsn);
            DataSet ds      = oAssetSharedEnvOrder.GetHostSelection(Int32.Parse(hdnOrderId.Value));

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                oVMWare.AddHost(Int32.Parse(dr["ClusterId"].ToString()),
                                dr["Name"].ToString(),
                                10000, 1);
            }
        }
Beispiel #2
0
        protected void btnAdd_Click(Object Sender, EventArgs e)
        {
            int intMaximum = 0;

            if (Int32.TryParse(txtMaximum.Text, out intMaximum) == false)
            {
                intMaximum = 99999;
            }
            if (Request.Form[hdnId.UniqueID] == "0")
            {
                oVMWare.AddHost(Int32.Parse(ddlParent.SelectedItem.Value), txtName.Text, intMaximum, (chkEnabled.Checked ? 1 : 0));
            }
            else
            {
                oVMWare.UpdateHost(Int32.Parse(Request.Form[hdnId.UniqueID]), Int32.Parse(ddlParent.SelectedItem.Value), txtName.Text, intMaximum, (chkEnabled.Checked ? 1 : 0));
            }
            Response.Redirect(Request.Path);
        }
Beispiel #3
0
        protected void btnUpdateH_Click(object sender, EventArgs e)
        {
            int intMaximum = 0;

            if (Int32.TryParse(txtCMaximum.Text, out intMaximum) == false)
            {
                intMaximum = 99999;
            }
            int h = 0;

            if (Int32.TryParse(Request.QueryString["h"], out h) == true)
            {
                oVMWare.UpdateHost(h, Int32.Parse(lblHParent.ToolTip), txtHName.Text, intMaximum, (chkHEnabled.Checked ? 1 : 0));
            }
            else
            {
                oVMWare.AddHost(Int32.Parse(lblHParent.ToolTip), txtHName.Text, intMaximum, (chkHEnabled.Checked ? 1 : 0));
            }
            Response.Redirect(FormURL(""));
        }