protected void Page_Load(object sender, EventArgs e) { oConsistencyGroup = new ConsistencyGroups(0, dsn); if (!IsPostBack) { ddlName.DataValueField = "id"; ddlName.DataTextField = "name"; ddlName.DataSource = oConsistencyGroup.Gets(1); ddlName.DataBind(); ddlName.Items.Insert(0, new ListItem("-- SELECT --", "0")); btnSubmit.Attributes.Add("onclick", "return ValidateDropDown('" + ddlName.ClientID + "','Please select a consistency group name');"); } }
protected void Page_Load(object sender, EventArgs e) { Response.Cookies["loginreferrer"].Value = Request.Path; Response.Cookies["loginreferrer"].Expires = DateTime.Now.AddDays(30); if (Request.Cookies["adminid"] != null && Request.Cookies["adminid"].Value != "") { intProfile = Int32.Parse(Request.Cookies["adminid"].Value); } else { Response.Redirect("/admin/login.aspx"); } oConsistencyGroups = new ConsistencyGroups(intProfile, dsn); if (!IsPostBack) { LoadLists(); } if (Request.QueryString["id"] == null) { if (Request.QueryString["add"] == null) { LoopRepeater(); } else { panAdd.Visible = true; btnDelete.Enabled = false; } } else { panAdd.Visible = true; intID = Int32.Parse(Request.QueryString["id"]); if (intID > 0 && !IsPostBack) { DataSet ds = oConsistencyGroups.Get(intID); hdnId.Value = intID.ToString(); txtName.Text = ds.Tables[0].Rows[0]["name"].ToString(); chkEnabled.Checked = (ds.Tables[0].Rows[0]["enabled"].ToString() == "1"); btnAdd.Text = "Update"; } } // Modify "/javascript/global.js" btnWindow.Attributes.Add("onclick", "return OpenWindow('RESILIENCY_LOCATIONS','" + hdnId.ClientID + "','',false,'500',500);"); // Modify "/admin/frame/frame_support_order.aspx" with the "&type=xxx" value. btnOrder.Attributes.Add("onclick", "return OpenWindow('SUPPORTORDER','" + hdnId.ClientID + "','" + hdnOrder.ClientID + "&type=MAINTENANCE_WINDOW" + "',false,400,400);"); btnDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this item?');"); }
protected void Page_Load(object sender, EventArgs e) { oConsistencyGroup = new ConsistencyGroups(0, dsn); txtName.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + btnSubmit.ClientID + "').click();return false;}} else {return true}; "); btnSubmit.Attributes.Add("onclick", "return ValidateText('" + txtName.ClientID + "','Please enter a valid name');"); }
protected void Page_Load(object sender, EventArgs e) { AuthenticateUser(); intProfile = Int32.Parse(Request.Cookies["profileid"].Value); oOnDemand = new OnDemand(intProfile, dsn); oForecast = new Forecast(intProfile, dsn); oClass = new Classes(intProfile, dsn); oCSMConfig = new CSMConfig(intProfile, dsn); oRequest = new Requests(intProfile, dsn); oServer = new Servers(intProfile, dsn); oStorage = new Storage(intProfile, dsn); oModel = new Models(intProfile, dsn); oModelsProperties = new ModelsProperties(intProfile, dsn); oVMWare = new VMWare(intProfile, dsn); oConsistencyGroup = new ConsistencyGroups(intProfile, dsn); oServerName = new ServerName(intProfile, dsn); oUser = new Users(intProfile, dsn); oOperatingSystem = new OperatingSystems(intProfile, dsn); if (Request.QueryString["aid"] != null && Request.QueryString["aid"] != "") { intAnswer = Int32.Parse(Request.QueryString["aid"]); } if (Request.QueryString["clusterid"] != null && Request.QueryString["clusterid"] != "") { intCluster = Int32.Parse(Request.QueryString["clusterid"]); } if (Request.QueryString["csmid"] != null && Request.QueryString["csmid"] != "") { intConfig = Int32.Parse(Request.QueryString["csmid"]); } if (Request.QueryString["num"] != null && Request.QueryString["num"] != "") { intNumber = Int32.Parse(Request.QueryString["num"]); } int intMenuTab = 0; if (Request.QueryString["menu_tab"] != null && Request.QueryString["menu_tab"] != "") { intMenuTab = Int32.Parse(Request.QueryString["menu_tab"]); } if (Request.QueryString["refresh"] != null) { Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "refresh", "<script type=\"text/javascript\">RefreshOpeningWindow();<" + "/" + "script>"); } if (Request.QueryString["save"] != null) { Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "save", "<script type=\"text/javascript\">RefreshOpeningWindow();window.close();<" + "/" + "script>"); } else if (Request.QueryString["required"] != null) { if (Request.QueryString["dba"] != null) { Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "dba", "<script type=\"text/javascript\">RefreshOpeningWindow();alert('Please enter a database administrator');<" + "/" + "script>"); intMenuTab = 1; } } int intServer = 0; int intDR = 0; if (intAnswer > 0) { Page.Title = "ClearView Configure Device | Design # " + intAnswer.ToString(); DataSet ds = oForecast.GetAnswer(intAnswer); if (ds.Tables[0].Rows.Count > 0) { Tab oTab = new Tab("", intMenuTab, "divMenu1", true, false); oTab.AddTab("1.) General Information", ""); oTab.AddTab("2.) Software Components", ""); strMenuTab1 = oTab.GetTabs(); int intModel = oForecast.GetModel(intAnswer); int intType = oModelsProperties.GetType(intModel); int intDRForecast = Int32.Parse(oForecast.TotalDRCount(intAnswer, boolUseCSM).ToString()); int intDRCurrent = Int32.Parse(ds.Tables[0].Rows[0]["recovery_number"].ToString()); int intHAForecast = Int32.Parse(oForecast.TotalHACount(intAnswer, boolUseCSM).ToString()); int intHACurrent = Int32.Parse(ds.Tables[0].Rows[0]["ha"].ToString()); bool boolHADisabled = (oModelsProperties.IsHighAvailability(intModel) == false); bool boolHA = oForecast.IsHARoom(intAnswer); int _classid = Int32.Parse(ds.Tables[0].Rows[0]["classid"].ToString()); if (oClass.Get(_classid, "prod") == "1") { if (oModelsProperties.IsStorageDE_FDriveMustBeOnSAN(intModel) == true) { radDRNo.Checked = false; radDRYes.Checked = true; radDRNo.Enabled = false; radDRYes.Enabled = false; divDR1.Style["display"] = "inline"; divDR2.Style["display"] = "inline"; } if (ds.Tables[0].Rows[0]["test"].ToString() == "1") { panTest.Visible = true; } } if (boolHA == false) { radHANo.Checked = true; radHAYes.Checked = false; radHANo.Enabled = false; radHAYes.Enabled = false; } if (intCluster > 0) { panCluster.Visible = false; radHANo.Checked = true; radHAYes.Checked = false; radHANo.Enabled = false; radHAYes.Enabled = false; radDRNo.Checked = true; radDRYes.Checked = false; radDRNo.Enabled = false; radDRYes.Enabled = false; divDR1.Style["display"] = "none"; divDR2.Style["display"] = "none"; } int _environmentid = Int32.Parse(ds.Tables[0].Rows[0]["environmentid"].ToString()); intServer = Int32.Parse(ds.Tables[0].Rows[0]["quantity"].ToString()) - oForecast.TotalServerCount(intAnswer, boolUseCSM); intDR = Int32.Parse(ds.Tables[0].Rows[0]["recovery_number"].ToString()) - oForecast.TotalDRCount(intAnswer, boolUseCSM); intRequest = oForecast.GetRequestID(intAnswer, true); if (ds.Tables[0].Rows[0]["applicationid"].ToString() == "0") { panInfrastructure.Visible = true; } if (!IsPostBack) { LoadLists(_classid, _environmentid); int intDBA = 0; ds = oServer.Get(intAnswer, intConfig, intCluster, intNumber); if (ds.Tables[0].Rows.Count > 0) { panComponents.Visible = true; frmComponents.Attributes.Add("src", "/frame/ondemand/config_server_components.aspx" + Request.Url.Query); intServer = Int32.Parse(ds.Tables[0].Rows[0]["id"].ToString()); Page.Title = "ClearView Configure Device | Server # " + intServer.ToString(); if (ds.Tables[0].Rows[0]["step"].ToString() != "0") { btnSaveConfig.Visible = false; } lblId.Text = intServer.ToString(); Int32.TryParse(ds.Tables[0].Rows[0]["osid"].ToString(), out intOS); if (intOS > 0 && ddlOS.SelectedValue == "0") { ddlOS.SelectedValue = intOS.ToString(); } int intSP = 0; Int32.TryParse(ds.Tables[0].Rows[0]["spid"].ToString(), out intSP); ddlServicePack.SelectedValue = intSP.ToString(); ddlMaintenance.SelectedValue = intSP.ToString(); ddlTemplate.SelectedValue = ds.Tables[0].Rows[0]["templateid"].ToString(); ddlDomain.SelectedValue = ds.Tables[0].Rows[0]["domainid"].ToString(); ddlTestDomain.SelectedValue = ds.Tables[0].Rows[0]["test_domainid"].ToString(); intDBA = Int32.Parse(ds.Tables[0].Rows[0]["dba"].ToString()); if (ds.Tables[0].Rows[0]["infrastructure"].ToString() == "1") { radInfrastructureYes.Checked = true; } else { radInfrastructureNo.Checked = true; } if (ds.Tables[0].Rows[0]["ha"].ToString() == "1") { radHAYes.Checked = true; } else { radHANo.Checked = true; } if (ds.Tables[0].Rows[0]["dr"].ToString() == "1") { radDRYes.Checked = true; divDR1.Style["display"] = "inline"; if (ds.Tables[0].Rows[0]["dr_exist"].ToString() == "1") { radExistYes.Checked = true; divExist.Style["display"] = "inline"; txtRecovery.Text = ds.Tables[0].Rows[0]["dr_name"].ToString(); } else { radExistNo.Checked = true; } divDR2.Style["display"] = "inline"; if (ds.Tables[0].Rows[0]["dr_consistency"].ToString() == "1") { radConsistencyYes.Checked = true; divConsistency1.Style["display"] = "inline"; divConsistency2.Style["display"] = "inline"; int intConsistency = Int32.Parse(ds.Tables[0].Rows[0]["dr_consistencyid"].ToString()); hdnConsistencyGroup.Value = intConsistency.ToString(); txtConsistencyGroup.Text = oConsistencyGroup.Get(intConsistency, "name"); } else { radConsistencyNo.Checked = true; } } else { radDRNo.Checked = true; } // Check selected items DataSet dsSelected = oServerName.GetComponentDetailSelected(intServer, 1); foreach (DataRow drSelected in dsSelected.Tables[0].Rows) { if (drSelected["sql"].ToString() == "1" || drSelected["dbase"].ToString() == "1") { divDBA.Style["display"] = "inline"; if (intDBA > 0) { txtUser.Text = oUser.GetFullName(intDBA) + " (" + oUser.GetName(intDBA) + ")"; hdnUser.Value = intDBA.ToString(); } } } } else { panComponentsNo.Visible = true; } } if (intDRCurrent < intDRForecast || (intDRCurrent == intDRForecast && radDRYes.Checked == false)) { radDRNo.Checked = true; radDRYes.Checked = false; radDRNo.Enabled = false; radDRYes.Enabled = false; divDR1.Style["display"] = "none"; divDR2.Style["display"] = "none"; } if (intHACurrent < intHAForecast || (intHACurrent == intHAForecast && radHAYes.Checked == false)) { radHANo.Checked = true; radHAYes.Checked = false; radHANo.Enabled = false; radHAYes.Enabled = false; } btnClose.Attributes.Add("onclick", "return window.close();"); if (oModelsProperties.IsConfigServicePack(intModel) == true || oOperatingSystem.IsWindows(intOS) == true || oOperatingSystem.IsWindows2008(intOS) == true) { panSP.Visible = true; } if (oModelsProperties.IsConfigVMWareTemplate(intModel) == true) { panTemplate.Visible = true; } if (oModelsProperties.IsConfigMaintenanceLevel(intModel) == true) { panMaintenance.Visible = true; } string strInfrastructure = ""; if (panInfrastructure.Visible == true) { strInfrastructure = " && ValidateRadioButtons('" + radInfrastructureYes.ClientID + "','" + radInfrastructureNo.ClientID + "','Please choose if this server is an infrastructure server')"; } string strTemplate = ""; if (panTemplate.Visible == true) { strTemplate = " && ValidateDropDown('" + ddlTemplate.ClientID + "','Please select a template')"; } string strSP = ""; if (panSP.Visible == true) { strSP = " && ValidateDropDown('" + ddlServicePack.ClientID + "','Please select a service pack')"; } if (panMaintenance.Visible == true) { strSP = " && ValidateDropDown('" + ddlMaintenance.ClientID + "','Please select a maintenance level')"; } string strHA = ""; string strDR = ""; if (panCluster.Visible == true) { strHA = " && ValidateRadioButtons('" + radHAYes.ClientID + "','" + radHANo.ClientID + "','Please choose if this server has an HA counterpart')"; strDR = " && EnsureDR('" + radDRYes.ClientID + "','" + radDRNo.ClientID + "','" + radExistYes.ClientID + "','" + radExistNo.ClientID + "','" + txtRecovery.ClientID + "','" + radConsistencyYes.ClientID + "','" + radConsistencyNo.ClientID + "','" + hdnConsistencyGroup.ClientID + "')"; } btnSaveConfig.Attributes.Add("onclick", "return ValidateDropDown('" + ddlDomain.ClientID + "','Please select a domain')" + " && ValidateHiddenDisabled('" + hdnUser.ClientID + "','" + txtUser.ClientID + "','Please enter a username, first name or last name')" + strSP + strTemplate + " && ValidateDropDown('" + ddlTestDomain.ClientID + "','Please select a domain')" + strInfrastructure + strHA + strDR + ";"); } } else { btnSaveConfig.Enabled = false; } radDRYes.Attributes.Add("onclick", "ShowHideDiv('" + divDR1.ClientID + "','inline');ShowHideDiv('" + divDR2.ClientID + "','inline');ShowHideDivCheck('" + divExist.ClientID + "',document.getElementById('" + radExistYes.ClientID + "'));ShowHideDivCheck('" + divConsistency1.ClientID + "',document.getElementById('" + radConsistencyYes.ClientID + "'));ShowHideDivCheck('" + divConsistency2.ClientID + "',document.getElementById('" + radConsistencyYes.ClientID + "'));"); radDRNo.Attributes.Add("onclick", "ShowHideDiv('" + divDR1.ClientID + "','none');ShowHideDiv('" + divDR2.ClientID + "','none');ShowHideDiv('" + divExist.ClientID + "','none');ShowHideDiv('" + divConsistency1.ClientID + "','none');ShowHideDiv('" + divConsistency2.ClientID + "','none');"); radExistYes.Attributes.Add("onclick", "ShowHideDiv('" + divExist.ClientID + "','inline');"); radExistNo.Attributes.Add("onclick", "ShowHideDiv('" + divExist.ClientID + "','none');"); radConsistencyYes.Attributes.Add("onclick", "ShowHideDiv('" + divConsistency1.ClientID + "','inline');ShowHideDiv('" + divConsistency2.ClientID + "','inline');"); radConsistencyNo.Attributes.Add("onclick", "ShowHideDiv('" + divConsistency1.ClientID + "','none');ShowHideDiv('" + divConsistency2.ClientID + "','none');"); btnConsistencyServer.Attributes.Add("onclick", "return ShowConsistency('CONSISTENCY_SERVER','?id=0','" + txtConsistencyGroup.ClientID + "','" + hdnConsistencyGroup.ClientID + "');"); btnConsistencyName.Attributes.Add("onclick", "return ShowConsistency('CONSISTENCY_SELECT','?id=0','" + txtConsistencyGroup.ClientID + "','" + hdnConsistencyGroup.ClientID + "');"); btnConsistencyNew.Attributes.Add("onclick", "return ShowConsistency('CONSISTENCY_NEW','?id=0','" + txtConsistencyGroup.ClientID + "','" + hdnConsistencyGroup.ClientID + "');"); Variables oVariable = new Variables(intEnvironment); txtUser.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'250','195','" + divAJAX.ClientID + "','" + lstAJAX.ClientID + "','" + hdnUser.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);"); lstAJAX.Attributes.Add("ondblclick", "AJAXClickRow();"); }
private bool LoadInformation(int _request_workflow) { if (intProject > 0) { lblName.Text = oProject.Get(intProject, "name"); lblNumber.Text = oProject.Get(intProject, "number"); lblType.Text = "Project"; } else { lblName.Text = oResourceRequest.GetWorkflow(_request_workflow, "name"); lblNumber.Text = "CVT" + intRequest.ToString(); lblType.Text = "Task"; } bool boolDone = false; DataSet ds = oOnDemandTasks.GetServerStorage(intRequest, intItem, intNumber); if (ds.Tables[0].Rows.Count > 0) { int intAnswer = Int32.Parse(ds.Tables[0].Rows[0]["answerid"].ToString()); Forecast oForecast = new Forecast(intProfile, dsn); if (oForecast.GetAnswer(intAnswer, "forecastid") != "") { int intForecast = Int32.Parse(oForecast.GetAnswer(intAnswer, "forecastid")); if (oForecast.Get(intForecast, "requestid") != "") { ModelsProperties oModelsProperties = new ModelsProperties(intProfile, dsn); int intModel = oForecast.GetModelAsset(intAnswer); if (intModel == 0) { intModel = oForecast.GetModel(intAnswer); } //btnView.Attributes.Add("onclick", "return OpenWindow('FORECAST_EQUIPMENT','?id=" + intAnswer.ToString() + "');"); btnView.Attributes.Add("onclick", "OpenNewWindow('/datapoint/service/design.aspx?t=design&q=" + oFunction.encryptQueryString(intAnswer.ToString()) + "',800,600);return false;"); btnView.ToolTip = intAnswer.ToString(); lblView.Text = oOnDemandTasks.GetBody(intAnswer, intImplementorDistributed, intImplementorMidrange); chk1.Checked = (ds.Tables[0].Rows[0]["chk1"].ToString() == "1"); lblAnswer.Text = ds.Tables[0].Rows[0]["answerid"].ToString(); lblProd.Text = ds.Tables[0].Rows[0]["prod"].ToString(); bool _prod = (lblProd.Text == "1"); lblModel.Text = ds.Tables[0].Rows[0]["modelid"].ToString(); boolDone = (chk1.Checked); img1.ImageUrl = (boolDone ? "/images/check.gif" : "/images/green_arrow.gif"); Servers oServer = new Servers(intProfile, dsn); Organizations oOrganization = new Organizations(0, dsn); ServerName oServerName = new ServerName(0, dsn); Asset oAsset = new Asset(0, dsnAsset); IPAddresses oIPAddresses = new IPAddresses(0, dsnIP, dsn); ConsistencyGroups oConsistencyGroups = new ConsistencyGroups(0, dsn); Environments oEnvironment = new Environments(0, dsn); OperatingSystems oOperatingSystem = new OperatingSystems(0, dsn); Classes oClass = new Classes(0, dsn); string strName = ""; lbl1.Text = oStorage.GetBody(intRequest, intItem, intNumber, dsnAsset, dsnIP, intEnvironment, true); if (lbl1.Text == "") { lbl1.Text = "Design Not Found"; } } else { panDeleted.Visible = true; } } else { panDeleted.Visible = true; } } if (Request.QueryString["div"] != null) { switch (Request.QueryString["div"]) { case "E": boolExecution = true; hdnTab.Value = "E"; break; case "S": boolStatus = true; hdnTab.Value = "S"; break; } } if (boolDetails == false && boolExecution == false && boolStatus == false) { boolDetails = true; } return(boolDone); }