protected void Page_Load(object sender, EventArgs e) { Response.Cookies["loginreferrer"].Value = "/admin/forecast/wizard_steps.aspx"; 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"); } oOnDemand = new OnDemand(intProfile, dsn); oType = new Types(intProfile, dsn); oPlatform = new Platforms(intProfile, dsn); if (!IsPostBack) { LoadPlatforms(); btnOrder.Attributes.Add("onclick", "return OpenWindow('SUPPORTORDER','" + hdnParent.ClientID + "','" + hdnOrder.ClientID + "&type=OD_W_STEPS" + "',false,400,400);"); btnDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this item?');"); btnCancel.Attributes.Add("onclick", "return Cancel();"); btnParent.Attributes.Add("onclick", "return OpenWindow('TYPEBROWSER','" + hdnParent.ClientID + "','&control=" + hdnParent.ClientID + "&controltext=" + lblParent.ClientID + "',false,400,600);"); btnPath.Attributes.Add("onclick", "return OpenWindow('FILEBROWSER','" + txtPath.ClientID + "','',false,400,600);"); } }
protected void Page_Load(object sender, EventArgs e) { Response.Cookies["loginreferrer"].Value = "/admin/errors_workstation.aspx"; 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"); } oWorkstation = new Workstations(intProfile, dsn); oUser = new Users(intProfile, dsn); oZeus = new Zeus(intProfile, dsnZeus); oAsset = new Asset(0, dsnAsset); oOnDemand = new OnDemand(intProfile, dsn); oError = new Errors(intProfile, dsn); oIncident = new Incident(intProfile, dsn); oFunction = new Functions(intProfile, dsn, intEnvironment); oVariable = new Variables(intEnvironment); if (Request.QueryString["id"] != null && Request.QueryString["id"] != "") { intID = Int32.Parse(Request.QueryString["id"]); if (!IsPostBack) { LoadList(); } LoadErrors(); } else if (!IsPostBack) { LoadWorkstations(); } }
protected void Page_Load(object sender, EventArgs e) { intProfile = Int32.Parse(Request.Cookies["profileid"].Value); oOnDemand = new OnDemand(intProfile, dsn); oForecast = new Forecast(intProfile, dsn); oClass = new Classes(intProfile, dsn); if (Request.QueryString["id"] != null && Request.QueryString["id"] != "") { intID = Int32.Parse(Request.QueryString["id"]); } if (Request.QueryString["sid"] != null && Request.QueryString["sid"] != "") { intStep = Int32.Parse(Request.QueryString["sid"]); } if (oForecast.GetAnswer(intID, "completed") == "" && Request.QueryString["view"] == null) { if (Request.QueryString["step"] != null && Request.QueryString["step"] != "") { panUpdate.Visible = true; } else { panNavigation.Visible = true; } } else { btnClose.Text = "Close"; } if (intID > 0) { DataSet ds = oForecast.GetAnswer(intID); if (ds.Tables[0].Rows.Count > 0) { int intClass = Int32.Parse(ds.Tables[0].Rows[0]["classid"].ToString()); if (oClass.IsProd(intClass) && oClass.Get(intClass, "pnc") == "0") { if (ds.Tables[0].Rows[0]["production"].ToString() != "") { txtDate.Text = DateTime.Parse(ds.Tables[0].Rows[0]["production"].ToString()).ToShortDateString(); } } else if (Request.QueryString["view"] == null) { oOnDemand.Next(intID, Int32.Parse(Request.QueryString["sid"])); Response.Redirect(Request.Path + "?id=" + intID.ToString() + "&save=true"); } else { panTest.Visible = true; } } } imgDate.Attributes.Add("onclick", "return ShowCalendar('" + txtDate.ClientID + "');"); btnNext.Attributes.Add("onclick", "return ValidateDate('" + txtDate.ClientID + "','Please enter a valid date')" + ";"); btnClose.Attributes.Add("onclick", "return window.close();"); }
private void LoadSecurity() { ModelsProperties oModelsProperties = new ModelsProperties(intProfile, dsn); Servers oServer = new Servers(intProfile, dsn); OnDemand oOnDemand = new OnDemand(0, dsn); int intAnswer = 0; int intModel = 0; DataSet dsSecurity = oOnDemandTasks.GetServerOther(intRequest, intService, intNumber); if (dsSecurity.Tables[0].Rows.Count > 0) { intAnswer = Int32.Parse(dsSecurity.Tables[0].Rows[0]["answerid"].ToString()); intModel = Int32.Parse(dsSecurity.Tables[0].Rows[0]["modelid"].ToString()); } //intAnswer = 2681; //intModel = 395; int intStep = (oModelsProperties.IsTypeVMware(intModel) ? 6 : 4); if (intAnswer > 0) { panSecurity.Visible = true; string strRequestResult = ""; // PRE (creation of groups) DataSet dsServers = oServer.GetAnswer(intAnswer); foreach (DataRow drServer in dsServers.Tables[0].Rows) { strRequestResult += "<tr>"; int intServer = Int32.Parse(drServer["id"].ToString()); strRequestResult += "<td valign=\"top\"><b>" + oServer.GetName(intServer, true) + ":</b></td>"; DataSet dsStep = oOnDemand.GetStepDoneServer(intServer, intStep); if (dsStep.Tables[0].Rows.Count > 0) { strRequestResult += "<td valign=\"top\">" + dsStep.Tables[0].Rows[0]["result"].ToString() + "</td>"; } strRequestResult += "</tr>"; } if (strRequestResult != "") { strRequestResult = "<table cellpadding=\"3\" cellspacing=\"2\" border=\"0\">" + strRequestResult + "</table>"; } lblSecurityPre.Text = strRequestResult; // POST (account generation and ties to groups) strRequestResult = ""; int intRequestAD = oForecast.GetRequestID(intAnswer, true); DataSet dsRequestResult = oRequest.GetResult(intRequestAD); foreach (DataRow drRequestResult in dsRequestResult.Tables[0].Rows) { strRequestResult += drRequestResult["result"].ToString(); } lblSecurityPost.Text = strRequestResult; } }
private IEnumerator AddOneCoroutine(int count) { var currentTime = new OnDemand<int>(() => DateTime.Now.Second); var currentTimePlusOne = OnDemand<int>.AddOne(currentTime); var currentTimePlusOneCorrect = OnDemand<int>.AddOneCorrect(currentTime); for (var i = 0; i < count; i++) { Debug.Log($"currentTime: {currentTime.Value}, currentTimePlusOneWrong: {currentTimePlusOne.Value}, " + $"currentTimePlusOneCorrect: {currentTimePlusOneCorrect.Value}"); yield return new WaitForSeconds(1); } }
protected void Page_Load(object sender, EventArgs e) { intProfile = Int32.Parse(Request.Cookies["profileid"].Value); Workstations oWorkstation = new Workstations(0, dsn); OnDemand oOnDemand = new OnDemand(0, dsn); Forecast oForecast = new Forecast(0, dsn); ModelsProperties oModelsProperties = new ModelsProperties(0, dsn); if (Request.QueryString["id"] != null && Request.QueryString["id"] != "") { Functions oFunction = new Functions(0, dsn, intEnvironment); int intWorkstation = Int32.Parse(oFunction.decryptQueryString(Request.QueryString["id"])); int intType = oModelsProperties.GetType(intModelVirtual); DataSet dsSteps = oOnDemand.GetSteps(intType, 1); DataSet ds = oWorkstation.GetVirtual(intWorkstation); if (ds.Tables[0].Rows.Count > 0) { int intAnswer = Int32.Parse(ds.Tables[0].Rows[0]["answerid"].ToString()); int intRemote = Int32.Parse(ds.Tables[0].Rows[0]["remoteid"].ToString()); int intCurrent = Int32.Parse(ds.Tables[0].Rows[0]["step"].ToString()); Workstations workstation = new Workstations(0, dsnRemote); DataSet dsResult = workstation.GetWorkstationVirtualRemoteStatus(intRemote); if (dsResult.Tables[0].Rows.Count > 0) { int intStep = Int32.Parse(dsResult.Tables[0].Rows[0]["step"].ToString()); int intID = Int32.Parse(dsResult.Tables[0].Rows[0]["id"].ToString()); if (intStep == 1) { oWorkstation.AssignHost(intWorkstation, dsnRemote, dsnAsset, intEnvironment, dsnZeus); Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "completed", "<script type=\"text/javascript\">window.onload = new Function(\"redirectWait();\");<" + "/" + "script>"); } else if (intCurrent < intStep) { oOnDemand.UpdateStepDoneWorkstation(intWorkstation, intCurrent, oOnDemand.GetStep(intStep, "done"), 0, false, false); oWorkstation.NextVirtualStep(intWorkstation); Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "completed", "<script type=\"text/javascript\">window.onload = new Function(\"redirect();\");<" + "/" + "script>"); } else if (intCurrent == dsSteps.Tables[0].Rows.Count) { oWorkstation.NextVirtualStep(intWorkstation); //SqlHelper.ExecuteNonQuery(dsnRemote, CommandType.Text, "UPDATE cv_virtual_workstations SET deleted = 1 WHERE id = " + intID.ToString() + " AND deleted = 0"); oForecast.UpdateAnswerCompleted(intAnswer); oWorkstation.UpdateVirtualCompleted(intWorkstation); Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "completed", "<script type=\"text/javascript\">window.onload = new Function(\"redirect();\");<" + "/" + "script>"); } } } Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "completed", "<script type=\"text/javascript\">window.onload = new Function(\"redirectWait();\");<" + "/" + "script>"); } }
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); oCSMConfig = new CSMConfig(intProfile, dsn); oRequest = new Requests(intProfile, dsn); if (Request.QueryString["aid"] != null && Request.QueryString["aid"] != "") { intAnswer = Int32.Parse(Request.QueryString["aid"]); } if (Request.QueryString["id"] != null && Request.QueryString["id"] != "") { intConfig = Int32.Parse(Request.QueryString["id"]); } int intServer = 0; int intDR = 0; if (intAnswer > 0) { DataSet ds = oForecast.GetAnswer(intAnswer); if (ds.Tables[0].Rows.Count > 0) { 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 (!IsPostBack) { panView.Visible = true; ds = oCSMConfig.Get(intConfig); if (ds.Tables[0].Rows.Count > 0) { txtName.Text = ds.Tables[0].Rows[0]["name"].ToString(); txtServers.Text = ds.Tables[0].Rows[0]["servers"].ToString(); txtDR.Text = ds.Tables[0].Rows[0]["dr"].ToString(); } } } } btnClose.Attributes.Add("onclick", "return window.close();"); btnDenied.Attributes.Add("onclick", "return window.close();"); btnSave.Attributes.Add("onclick", "return ValidateText('" + txtName.ClientID + "','Please enter a custom name for this cluster')" + " && ValidateNumber0('" + txtServers.ClientID + "','Please enter a valid number for the number of servers')" + " && ValidateNumberLess('" + txtServers.ClientID + "'," + intServer + ",'You cannot add any more than " + intServer + " servers')" + " && ValidateNumber('" + txtDR.ClientID + "','Please enter a valid number for the number of DR servers')" + " && ValidateNumberLess('" + txtDR.ClientID + "'," + intDR + ",'You cannot add any more than " + intDR + " DR servers')" + ";"); }
public void Begin() { datStart = DateTime.Now; arProcessing = new int[4] { 45, 47, 92, 124 }; // 92 = \, 124 = |, 47 = /, 45 = - strSSH = ""; oModel = new Models(0, dsn); oModelsProperties = new ModelsProperties(0, dsn); oServer = new Servers(0, dsn); oSetting = new Settings(0, dsn); oOnDemand = new OnDemand(0, dsn); oSolaris = new Solaris(0, dsn); oEventLog = new Log(0, dsn); oFunction = new Functions(0, dsn, intEnvironment); strTo = oFunction.GetGetEmailAlertsEmailIds("EMAILGRP_PROVISIONING_SUPPORT"); intModel = Int32.Parse(oServer.Get(intServer, "modelid")); if (intModel > 0) { strModel = oModelsProperties.Get(intModel, "name"); Int32.TryParse(oModelsProperties.Get(intModel, "modelid"), out intModelParent); if (intModelParent > 0) { Int32.TryParse(oModel.Get(intModelParent, "boot_groupid"), out intModelBootGroup); } } if (intModelBootGroup > 0) { string strUsername = oModel.GetBootGroup(intModelBootGroup, "username"); string strPassword = oModel.GetBootGroup(intModelBootGroup, "password"); strReturnToALOM = oModel.GetBootGroup(intModelBootGroup, "return_to_alom"); oEventLog.AddEvent(strName, strSerial, "Connecting to " + strILO + "... (U:" + strUsername + ", P:****)", LoggingType.Information); oSSHshell = new SshShell(strILO, strUsername, strPassword); oSSHshell.RemoveTerminalEmulationCharacters = true; oSSHshell.Connect(); oEventLog.AddEvent(strName, strSerial, "Connected to " + strILO + "...sending commands...", LoggingType.Information); ThreadStart oReadingDoneSSH = new ThreadStart(ReadingDoneSSH); Thread oJobReadingDoneSSH = new Thread(oReadingDoneSSH); oJobReadingDoneSSH.Start(); ReadingSSH(); } else { AddResult("The boot group of the model has not been configured ~ (ModelPropertyID = " + intModel.ToString() + ") (ModelID = " + intModelParent.ToString() + ") (ModelBootGroupID = " + intModelBootGroup.ToString() + ")"); } }
protected void Page_Load(object sender, EventArgs e) { string strResult = ""; Servers oServer = new Servers(0, dsn); OnDemand oOnDemand = new OnDemand(0, dsn); IPAddresses oIPAddresses = new IPAddresses(0, dsnIP, dsn); oVMWare = new VMWare(0, dsn); string strConnect = oVMWare.ConnectDEBUG("https://ohcleutl4001/sdk", 3, "Dalton"); if (strConnect == "") { VimService _service = oVMWare.GetService(); ServiceContent _sic = oVMWare.GetSic(); string strName = "txpv00001a"; ManagedObjectReference _vm_boot_order = oVMWare.GetVM(strName); OptionValue oValue = new OptionValue(); oValue.key = "bios.bootDeviceClasses"; // Set the PXE boot oValue.value = "allow:net"; // Remove the PXE boot oValue.value = ""; VirtualMachineConfigSpec _cs_boot_order = new VirtualMachineConfigSpec(); _cs_boot_order.extraConfig = new OptionValue[] { oValue }; ManagedObjectReference _task_boot_order = _service.ReconfigVM_Task(_vm_boot_order, _cs_boot_order); TaskInfo _inf_boot_order = (TaskInfo)oVMWare.getObjectProperty(_task_boot_order, "info"); while (_inf_boot_order.state == TaskInfoState.running) { _inf_boot_order = (TaskInfo)oVMWare.getObjectProperty(_task_boot_order, "info"); } if (_inf_boot_order.state == TaskInfoState.success) { strResult = "PXE Boot Forced"; } else { strResult = "PXE Boot NOT Forced"; } Response.Write(strResult); } else { Response.Write("LOGIN error"); } }
protected void btnBack_Click(Object Sender, EventArgs e) { oForecast.UpdateAnswerExecution(intID, ""); int intModel = oForecast.GetModel(intID); ModelsProperties oModelsProperties = new ModelsProperties(0, dsn); int intType = oModelsProperties.GetType(intModel); Types oType = new Types(0, dsn); string strExecute = oType.Get(intType, "forecast_execution_path"); OnDemand oOnDemand = new OnDemand(0, dsn); int intCount = 0; DataSet ds = oOnDemand.GetWizardStepsDoneBack(intID); foreach (DataRow dr in ds.Tables[0].Rows) { intCount++; if (intCount != ds.Tables[0].Rows.Count) { oOnDemand.DeleteWizardStepDone(intID, Int32.Parse(dr["step"].ToString())); } } Response.Redirect(strExecute + "?id=" + intID.ToString()); }
private void BackToDesign(int _stopper) { oForecast.UpdateAnswerExecution(intID, ""); int intModel = oForecast.GetModel(intID); ModelsProperties oModelsProperties = new ModelsProperties(0, dsn); int intType = oModelsProperties.GetType(intModel); Types oType = new Types(0, dsn); string strExecute = oType.Get(intType, "forecast_execution_path"); OnDemand oOnDemand = new OnDemand(0, dsn); int intCount = 0; DataSet ds = oOnDemand.GetWizardStepsDoneBack(intID); int intStop = ds.Tables[0].Rows.Count - _stopper; foreach (DataRow dr in ds.Tables[0].Rows) { intCount++; if (intCount < intStop) { oOnDemand.DeleteWizardStepDone(intID, Int32.Parse(dr["step"].ToString())); } } Response.Redirect(strExecute + "?id=" + intID.ToString()); }
/// <summary> /// Set the MongoDB logger options based on the key/value application configuration properties. /// </summary> /// <param name="configuration">Represents a set of key/value application configuration properties. See <see cref="IConfiguration"/>.</param> public override void ReadFromConfiguration(IConfiguration configuration) { var mongoConfiguration = configuration?.GetSection("XLogger:MongoDB"); if (mongoConfiguration == null) { throw new System.Exception("Could not load the adapter configuration properties. Make sure the application settings have the XLogger:MongoDB section."); } var logLevel = mongoConfiguration[nameof(LogLevel)]; if (!string.IsNullOrEmpty(logLevel)) { LogLevel = (LogLevel)int.Parse(logLevel); } OnDemand = bool.Parse(mongoConfiguration[nameof(OnDemand)] ?? OnDemand.ToString()); DatabaseUrl = mongoConfiguration[nameof(DatabaseUrl)] ?? DatabaseUrl; CollectionName = mongoConfiguration[nameof(CollectionName)] ?? CollectionName; Capped = bool.Parse(mongoConfiguration[nameof(Capped)] ?? Capped.ToString()); MaxSize = long.Parse(mongoConfiguration[nameof(MaxSize)] ?? MaxSize.ToString()); MaxDocuments = long.Parse(mongoConfiguration[nameof(MaxDocuments)] ?? MaxDocuments.ToString()); }
public void Begin() { oServer = new Servers(0, dsn); oAudit = new Audit(0, dsn); oLog = new Log(0, dsn); oOnDemand = new OnDemand(0, dsn); oOperatingSystem = new OperatingSystems(0, dsn); oIPAddresses = new IPAddresses(0, dsnIP, dsn); oVariable = new Variables(intEnvironment); oFunction = new Functions(0, dsn, intEnvironment); if (boolMultiThreaded == true) { // Run Audit Scripts in Multi-Threaded Fashion ThreadStart oThreadStart = new ThreadStart(RunAudits); Thread oThread = new Thread(oThreadStart); oThread.Start(); } else { // Run Audit Scripts in Single-Threaded Fashion RunAudits(); } }
protected void Page_Load(object sender, EventArgs e) { intProfile = Int32.Parse(Request.Cookies["profileid"].Value); oOnDemand = new OnDemand(intProfile, dsn); oForecast = new Forecast(intProfile, dsn); if (Request.QueryString["id"] != null && Request.QueryString["id"] != "") { intID = Int32.Parse(Request.QueryString["id"]); } Page.Title = "ClearView Provisioning Disclaimer | Design # " + intID.ToString(); if (intID > 0) { int intPlatform = Int32.Parse(oForecast.GetAnswer(intID, "platformid")); if (intPlatform == intPlatformWorkstation) { panWorkstation.Visible = true; } else { panServer.Visible = true; } } btnClose.Attributes.Add("onclick", "return window.close();"); }
protected void Page_Load(object sender, EventArgs e) { AuthenticateUser(); intProfile = Int32.Parse(Request.Cookies["profileid"].Value); oForecast = new Forecast(intProfile, dsn); oOnDemand = new OnDemand(intProfile, dsn); oPage = new Pages(intProfile, dsn); oModel = new Models(intProfile, dsn); oModelsProperties = new ModelsProperties(intProfile, dsn); oServiceRequest = new ServiceRequests(intProfile, dsn); oStorage = new Storage(intProfile, dsn); oService = new Services(intProfile, dsn); if (Request.QueryString["parent"] != null && Request.QueryString["parent"] != "") { intForecast = Int32.Parse(Request.QueryString["parent"]); } if (Request.QueryString["id"] != null && Request.QueryString["id"] != "") { intID = Int32.Parse(Request.QueryString["id"]); } if (Request.QueryString["saved"] != null) { Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "saved", "<script type=\"text/javascript\">alert('Forecast Equipment Saved');if(window.opener!=null)window.opener.navigate('" + oPage.GetFullLink(intForecastPage) + "?id=" + intForecast.ToString() + "');window.close();<" + "/" + "script>"); } int intType = 0; int intStep = 0; int intModel = 0; bool boolApproved = true; imgStep.ImageUrl = "/images/wizard.gif"; if (intID > 0) { DataSet ds = oForecast.GetAnswer(intID); if (ds.Tables[0].Rows.Count > 0) { int intRequest = Int32.Parse(ds.Tables[0].Rows[0]["serviceid"].ToString()); DataSet dsApproval = oService.GetSelected(intRequest); foreach (DataRow drApproval in dsApproval.Tables[0].Rows) { if (drApproval["approved"].ToString() == "0") { boolApproved = false; break; } } int intQuantity = Int32.Parse(ds.Tables[0].Rows[0]["quantity"].ToString()); lblForecastCount.Text = ds.Tables[0].Rows[0]["quantity"].ToString(); lblCurrentCount.Text = oForecast.TotalWorkstationCount(intID).ToString(); if (lblCurrentCount.Text != lblForecastCount.Text) { lblCurrentCount.CssClass = "biggerreddefault"; } intModel = oForecast.GetModel(intID); intModel = Int32.Parse(oModelsProperties.Get(intModel, "modelid")); intType = oModel.GetType(intModel); DataSet dsSteps = oOnDemand.GetWizardSteps(intType, 1); DataSet dsStepsDone = oOnDemand.GetWizardStepsDone(intID, intType); int intStepsTotal = dsSteps.Tables[0].Rows.Count; int intStepsNotDone = (intStepsTotal - dsStepsDone.Tables[0].Rows.Count); double dblProgress = double.Parse(intStepsNotDone.ToString()) / double.Parse(intStepsTotal.ToString()); dblProgress = dblProgress * 100.00; strProgress = oServiceRequest.GetStatusBarBlue(dblProgress, "90", true); if (Request.QueryString["step"] != null && Request.QueryString["step"] != "") { int _step = Int32.Parse(Request.QueryString["step"]); if (_step <= dsSteps.Tables[0].Rows.Count) { intStep = _step; } } else { if (dsStepsDone.Tables[0].Rows.Count > 0) { intStep = Int32.Parse(dsStepsDone.Tables[0].Rows[0]["id"].ToString()); } } } if (Request.QueryString["save"] != null) { Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "save", "<script type=\"text/javascript\">if(window.opener!=null)window.opener.navigate('" + oPage.GetFullLink(intForecastPage) + "?id=" + intForecast.ToString() + "');<" + "/" + "script>"); } if (boolApproved == false) { panPending.Visible = true; } else { DataSet dsStep = oOnDemand.GetWizardStep(intStep); if (dsStep.Tables[0].Rows.Count > 0) { lblTitle.Text = dsStep.Tables[0].Rows[0]["name"].ToString(); lblSubTitle.Text = dsStep.Tables[0].Rows[0]["subtitle"].ToString(); string strPath = dsStep.Tables[0].Rows[0]["path"].ToString(); if (strPath != "") { panStep.Visible = true; if (Request.QueryString["sid"] == null || Request.QueryString["sid"] == "") { Response.Redirect(Request.Path + "?id=" + intID + "&sid=" + intStep); } PHStep.Controls.Add((Control)LoadControl(strPath)); } } else { // START ON DEMAND Response.Redirect("/frame/ondemand/status.aspx?id=" + Request.QueryString["id"]); } } } }
protected void Page_Load(object sender, EventArgs e) { OnDemand oOnDemand = new OnDemand(0, dsn); Forecast oForecast = new Forecast(0, dsn); Workstations oWorkstation = new Workstations(0, dsn); Models oModel = new Models(0, dsn); Users oUser = new Users(0, dsn); ModelsProperties oModelsProperties = new ModelsProperties(0, dsn); Functions oFunction = new Functions(0, dsn, intEnvironment); Asset oAsset = new Asset(0, dsnAsset); Tokens oToken = new Tokens(0, dsn); string strOnLoad = ""; string strError = ""; if (Request.QueryString["id"] != null && Request.QueryString["id"] != "") { int intWorkstation = Int32.Parse(oFunction.decryptQueryString(Request.QueryString["id"])); DataSet ds = oWorkstation.GetVirtual(intWorkstation); if (ds.Tables[0].Rows.Count > 0) { int intAnswer = Int32.Parse(ds.Tables[0].Rows[0]["answerid"].ToString()); int intAsset = Int32.Parse(ds.Tables[0].Rows[0]["assetid"].ToString()); if (intAsset > 0 && oAsset.Get(intAsset, "name") != "") { strName = oAsset.Get(intAsset, "name"); } else { strName = "Device " + Request.QueryString["c"]; } int intModel = oForecast.GetModelAsset(intAnswer); if (intModel == 0) { intModel = oForecast.GetModel(intAnswer); } intModel = Int32.Parse(oModelsProperties.Get(intModel, "modelid")); int intType = oModel.GetType(intModel); int intCurrent = Int32.Parse(ds.Tables[0].Rows[0]["step"].ToString()); int intCurrentWithError = oWorkstation.GetVirtualStep(intWorkstation); strPreviewName = strName; DataSet dsSteps = oOnDemand.GetSteps(intType, 1); if (dsSteps.Tables[0].Rows.Count >= intCurrent) { int intNewStep = Int32.Parse(dsSteps.Tables[0].Rows[intCurrent - 1]["id"].ToString()); DataSet dsStep = oOnDemand.GetStep(intNewStep); if (dsStep.Tables[0].Rows.Count > 0) { string strPath = dsStep.Tables[0].Rows[0]["path"].ToString(); if (dsStep.Tables[0].Rows[0]["show_build"].ToString() == "1") { chkPreview.Disabled = false; if (!IsPostBack && Request.QueryString["preview"] != null) { intShowBuild = 1; chkPreview.Checked = true; // Token strPreviewToken = oToken.Add(strPreviewName, 50); } } else { chkPreview.Disabled = true; } if (strPath != "") { Control oControl = (Control)LoadControl(strPath); PH.Controls.Add(oControl); strOnLoad = "redirectWait();"; } else { strOnLoad = "redirectAJAX('" + intWorkstation.ToString() + "','" + intCurrentWithError.ToString() + "');"; } } } else { panDone.Visible = true; if (ds.Tables[0].Rows[0]["completed"].ToString() != "") { lblCompleted.Text = DateTime.Parse(ds.Tables[0].Rows[0]["completed"].ToString()).ToString(); } else { lblCompleted.Text = DateTime.Now.ToString(); } } int intStep = 0; StringBuilder sbStep = new StringBuilder(); bool boolError = false; foreach (DataRow drStep in dsSteps.Tables[0].Rows) { intStep++; string strClass = "cantclose"; if (drStep["type"].ToString() == "1") { strClass = "canclose"; } if (drStep["type"].ToString() == "-1") { strClass = "default"; } DataSet dsResult = oOnDemand.GetStepDoneWorkstation(intWorkstation, intStep); if (intStep < intCurrent) { string strImage = "<img src=\"/images/check.gif\" border=\"0\" align=\"absmiddle\">"; string strDone = ""; string strMessage = ""; if (dsResult.Tables[0].Rows.Count > 0) { foreach (DataRow drResult in dsResult.Tables[0].Rows) { strMessage += drResult["result"].ToString(); } if (dsResult.Tables[0].Rows[0]["finished"].ToString() != "") { strDone = " (" + DateTime.Parse(dsResult.Tables[0].Rows[0]["finished"].ToString()).ToString() + ")"; } } sbStep.Append("<tr><td>"); sbStep.Append(strImage); sbStep.Append("</td><td nowrap><a href=\"javascript:void(0);\" onclick=\"ShowHideResult('divResult_"); sbStep.Append(intAnswer.ToString()); sbStep.Append("_"); sbStep.Append(intStep.ToString()); sbStep.Append("');\">"); sbStep.Append(drStep["title"].ToString()); sbStep.Append("</a>"); sbStep.Append(strDone); sbStep.Append("</td></tr>"); sbStep.Append("<tr id=\"divResult_"); sbStep.Append(intAnswer.ToString()); sbStep.Append("_"); sbStep.Append(intStep.ToString()); sbStep.Append("\" style=\"display:none\"><td></td><td>"); sbStep.Append(strMessage == "" ? "No information" : strMessage); sbStep.Append("</td></tr>"); } else if (intStep == intCurrent) { strError = ""; if (dsResult.Tables[0].Rows.Count > 0) { if (dsResult.Tables[0].Rows[0]["error"].ToString() == "1") { boolError = true; sbStep.Append("<tr><td><img src=\"/images/error.gif\" border=\"0\" align=\"absmiddle\"></td><td class=\""); sbStep.Append(strClass); sbStep.Append("\" nowrap><a href=\"javascript:void(0);\" onclick=\"ShowHideResult('divResult_"); sbStep.Append(intAnswer.ToString()); sbStep.Append("_"); sbStep.Append(intStep.ToString()); sbStep.Append("');\">"); sbStep.Append(drStep["title"].ToString()); sbStep.Append("</a></td></tr>"); sbStep.Append("<tr id=\"divResult_"); sbStep.Append(intAnswer.ToString()); sbStep.Append("_"); sbStep.Append(intStep.ToString()); sbStep.Append("\" style=\"display:none\"><td></td><td>"); strError = dsResult.Tables[0].Rows[0]["result"].ToString(); if (strError.Contains("~") == true) { strError = strError.Substring(0, strError.IndexOf("~")); } sbStep.Append(strError); DataSet dsError = oWorkstation.GetVirtualError(intWorkstation, intStep); string incident = ""; int assigned = 0; if (dsError.Tables[0].Rows.Count > 0) { incident = dsError.Tables[0].Rows[0]["incident"].ToString(); Int32.TryParse(dsError.Tables[0].Rows[0]["assigned"].ToString(), out assigned); if (string.IsNullOrEmpty(incident) == false) { sbStep.Append("<br/><br/>Tracking # " + incident); bool IncidentFound = false; DataSet dsKey = oFunction.GetSetupValuesByKey("INCIDENTS"); if (dsKey.Tables[0].Rows.Count > 0) { string incidents = dsKey.Tables[0].Rows[0]["Value"].ToString(); StreamReader theReader = new StreamReader(incidents); string theContents = theReader.ReadToEnd(); string[] theLines = theContents.Split(new string[] { "\n" }, StringSplitOptions.RemoveEmptyEntries); foreach (string theLine in theLines) { if (theLine.Contains(incident)) { IncidentFound = true; string[] theFields = theLine.Split(new char[] { ',' }, StringSplitOptions.None); string person = theFields[5].Replace("\"", ""); if (String.IsNullOrEmpty(person) == false) { sbStep.Append("<br/>Assigned To: " + person); } string group = theFields[4].Replace("\"", ""); if (String.IsNullOrEmpty(group) == false) { sbStep.Append("<br/>Group: " + group); } break; } } } if (IncidentFound == false) { if (assigned > 0) { sbStep.Append("<br/>Assigned To: " + oUser.GetFullNameWithLanID(assigned)); } } } } if (strError != "") { sbStep.Append("<br/><br/><a class='build_error' href=\"javascript:void(0);\" onclick=\"OpenWindow('PROVISIONING_ERROR', '"); sbStep.Append(oFunction.encryptQueryString(dsResult.Tables[0].Rows[0]["result"].ToString())); sbStep.Append("');\"><img src='/images/plus.gif' border='0' align='absmiddle'/> For more information about this error, click here</a>"); } sbStep.Append("</td></tr>"); } } if (boolError == false) { if (drStep["interact_path"].ToString() == "") { sbStep.Append("<tr><td><img src=\"/images/green_arrow.gif\" border=\"0\" align=\"absmiddle\"></td><td class=\""); sbStep.Append(strClass); sbStep.Append("\" nowrap><b>"); sbStep.Append(drStep["title"].ToString()); sbStep.Append("</b></td></tr>"); } else { sbStep.Append("<tr><td><img src=\"/images/alert.gif\" border=\"0\" align=\"absmiddle\"></td><td class=\""); sbStep.Append(strClass); sbStep.Append("\" nowrap><b>"); sbStep.Append(drStep["title"].ToString()); sbStep.Append("</b></td></tr>"); sbStep.Append("<tr><td></td><td><input type=\"button\" onclick=\"OpenWindow('NEW_WINDOW','"); sbStep.Append(drStep["interact_path"].ToString()); sbStep.Append("?id="); sbStep.Append(intWorkstation.ToString()); sbStep.Append("');\" value=\"Click Here\" class=\"default\" style=\"width:100px\"></td></tr>"); } } } else if (intStep > intCurrent) { sbStep.Append("<tr><td></td><td class=\""); sbStep.Append(strClass); sbStep.Append("\">"); sbStep.Append(drStep["title"].ToString()); sbStep.Append("</td></tr>"); } } sbStep.Insert(0, "<p><table border=\"0\" cellpadding=\"4\" cellspacing=\"3\">"); sbStep.Append("</table></p>"); strResult += sbStep.ToString(); //DateTime datSubmitted = DateTime.Parse(ds.Tables[0].Rows[0]["created"].ToString()); //lblDate.Text = datSubmitted.ToString(); //Holidays oHoliday = new Holidays(0, dsn); //lblDelivered.Text = oHoliday.GetDays(10.00, datSubmitted).ToString(); } } else { Response.Write("Invalid Configuration - validate host configuration"); } if (strOnLoad != "") { Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "start_count", "<script type=\"text/javascript\">window.onload = new Function(\"" + strOnLoad + "\");" + (strError == "" ? "" : "LoadError('" + strError.Replace("'", "") + "');") + "<" + "/" + "script>"); } }
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); oRequest = new Requests(intProfile, dsn); oWorkstation = new Workstations(intProfile, dsn); oStorage = new Storage(intProfile, dsn); oModel = new Models(intProfile, dsn); oModelsProperties = new ModelsProperties(intProfile, dsn); oOperatingSystem = new OperatingSystems(intProfile, dsn); if (Request.QueryString["aid"] != null && Request.QueryString["aid"] != "") { intAnswer = Int32.Parse(Request.QueryString["aid"]); } if (Request.QueryString["num"] != null && Request.QueryString["num"] != "") { intNumber = Int32.Parse(Request.QueryString["num"]); } int intWorkstation = 0; if (intAnswer > 0) { DataSet ds = oForecast.GetAnswer(intAnswer); if (ds.Tables[0].Rows.Count > 0) { int intModel = oForecast.GetModel(intAnswer); intModel = Int32.Parse(oModelsProperties.Get(intModel, "modelid")); int _classid = Int32.Parse(ds.Tables[0].Rows[0]["classid"].ToString()); intQuantity = Int32.Parse(ds.Tables[0].Rows[0]["quantity"].ToString()); int _environmentid = Int32.Parse(ds.Tables[0].Rows[0]["environmentid"].ToString()); intOS = Int32.Parse(oForecast.GetWorkstation(intAnswer, "osid")); intRequest = oForecast.GetRequestID(intAnswer, true); if (!IsPostBack) { LoadLists(_classid, _environmentid); chkApply.Visible = (intQuantity > 1 && intNumber == 1); ds = oWorkstation.GetVirtual(intAnswer, intNumber); if (ds.Tables[0].Rows.Count > 0) { intWorkstation = Int32.Parse(ds.Tables[0].Rows[0]["id"].ToString()); lblId.Text = intWorkstation.ToString(); intOS = Int32.Parse(ds.Tables[0].Rows[0]["osid"].ToString()); } if (intOS > 0) { ddlOS.SelectedValue = intOS.ToString(); ddlServicePack.Enabled = true; ddlServicePack.DataValueField = "id"; ddlServicePack.DataTextField = "name"; ddlServicePack.DataSource = oOperatingSystem.GetServicePack(intOS); ddlServicePack.DataBind(); ddlServicePack.Items.Insert(0, new ListItem("-- SELECT --", "0")); chkComponents.DataValueField = "id"; chkComponents.DataTextField = "name"; chkComponents.DataSource = oWorkstation.GetComponentPermissionsOS(intOS); chkComponents.DataBind(); DataSet dsComponents = oWorkstation.GetComponentsSelected(intWorkstation); foreach (DataRow drComponent in dsComponents.Tables[0].Rows) { foreach (ListItem oItem in chkComponents.Items) { if (drComponent["componentid"].ToString() == oItem.Value) { oItem.Selected = true; break; } } } } if (ds.Tables[0].Rows.Count > 0) { ddlServicePack.SelectedValue = ds.Tables[0].Rows[0]["spid"].ToString(); hdnServicePack.Value = ds.Tables[0].Rows[0]["spid"].ToString(); ddlDomain.SelectedValue = ds.Tables[0].Rows[0]["domainid"].ToString(); } } btnClose.Attributes.Add("onclick", "return window.close();"); btnSaveConfig.Attributes.Add("onclick", "return ValidateDropDown('" + ddlServicePack.ClientID + "','Please select a service pack')" + " && ValidateDropDown('" + ddlDomain.ClientID + "','Please select a domain')" + ";"); ddlOS.Attributes.Add("onchange", "PopulateServicePacks('" + ddlOS.ClientID + "','" + ddlServicePack.ClientID + "');"); ddlServicePack.Attributes.Add("onchange", "UpdateDropDownHidden('" + ddlServicePack.ClientID + "','" + hdnServicePack.ClientID + "');"); } } }
protected void Page_Load(object sender, EventArgs e) { Page.Title = "ClearView Cluster Configuration"; AuthenticateUser(); intProfile = Int32.Parse(Request.Cookies["profileid"].Value); oOnDemand = new OnDemand(intProfile, dsn); oForecast = new Forecast(intProfile, dsn); oCluster = new Cluster(intProfile, dsn); oRequest = new Requests(intProfile, dsn); oModelsProperties = new ModelsProperties(intProfile, dsn); oClass = new Classes(intProfile, dsn); if (Request.QueryString["aid"] != null && Request.QueryString["aid"] != "") { intAnswer = Int32.Parse(Request.QueryString["aid"]); } if (Request.QueryString["id"] != null && Request.QueryString["id"] != "") { intCluster = Int32.Parse(Request.QueryString["id"]); } Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "refresh", "<script type=\"text/javascript\">RefreshOpeningWindow();<" + "/" + "script>"); int intServer = 0; int intDR = 0; int intHA = 0; if (intAnswer > 0) { Page.Title = "ClearView Cluster Configuration | Design # " + intAnswer.ToString(); DataSet ds = oForecast.GetAnswer(intAnswer); int intModel = oForecast.GetModel(intAnswer); int intType = oModelsProperties.GetType(intModel); if (oForecast.IsOSMidrange(intAnswer) == true) { boolMidrange = true; } if (ds.Tables[0].Rows.Count > 0) { 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); intHA = Int32.Parse(ds.Tables[0].Rows[0]["ha"].ToString()) - oForecast.TotalHACount(intAnswer, boolUseCSM); int intClass = Int32.Parse(ds.Tables[0].Rows[0]["classid"].ToString()); intRequest = oForecast.GetRequestID(intAnswer, true); if (!IsPostBack) { panView.Visible = true; btnQuorum.Visible = (boolMidrange == false); if (oClass.Get(intClass, "prod") != "1" || oForecast.GetAnswerPlatform(intAnswer, intUnder48Q, intUnder48A) == false) { txtDR.Text = "0"; txtDR.Enabled = false; } if (oClass.Get(intClass, "prod") != "1" || oForecast.IsHARoom(intAnswer) == false) { txtHA.Text = "0"; txtHA.Enabled = false; } ds = oCluster.Get(intCluster); if (ds.Tables[0].Rows.Count > 0) { Page.Title = "ClearView Cluster Configuration | Design # " + intAnswer.ToString() + " | Cluster # " + intCluster.ToString(); imgSave.Visible = false; txtName.Text = ds.Tables[0].Rows[0]["nickname"].ToString(); txtNodes.Text = ds.Tables[0].Rows[0]["nodes"].ToString(); intServer += Int32.Parse(txtNodes.Text); txtDR.Text = ds.Tables[0].Rows[0]["dr"].ToString(); intDR += Int32.Parse(txtDR.Text); txtHA.Text = ds.Tables[0].Rows[0]["ha"].ToString(); intHA += Int32.Parse(txtHA.Text); if (ds.Tables[0].Rows[0]["local_nodes"].ToString() == "1") { if (ds.Tables[0].Rows[0]["non_shared"].ToString() == "0") { imgNodes.Visible = true; } btnNodes.Attributes.Add("onclick", "return OpenWindow('ONDEMAND_SERVER','?aid=" + intAnswer + "&clusterid=" + intCluster + "&csmid=0&num=0');"); } else { btnNodes.Enabled = false; } if (ds.Tables[0].Rows[0]["non_shared"].ToString() == "1") { if (ds.Tables[0].Rows[0]["add_instance"].ToString() == "0") { imgStorage.Visible = true; } btnStorage.Attributes.Add("onclick", "return OpenWindow('ONDEMAND_STORAGE','?aid=" + intAnswer + "&clusterid=" + intCluster + "&csmid=0&num=0');"); } else { btnStorage.Enabled = false; } if (ds.Tables[0].Rows[0]["add_instance"].ToString() == "1") { if (ds.Tables[0].Rows[0]["quorum"].ToString() == "0") { imgAdd.Visible = true; } btnAdd.Attributes.Add("onclick", "return NewInstance('" + intAnswer.ToString() + "','" + intCluster.ToString() + "','');"); } else { btnAdd.Enabled = false; } if (boolMidrange == false && ds.Tables[0].Rows[0]["quorum"].ToString() == "1") { imgQuorum.Visible = true; btnQuorum.Attributes.Add("onclick", "return OpenWindow('ONDEMAND_CLUSTER_QUORUM','?aid=" + intAnswer + "&id=" + intCluster + "');"); } else { btnQuorum.Enabled = false; } rptInstances.DataSource = oCluster.GetInstances(intCluster); rptInstances.DataBind(); foreach (RepeaterItem ri in rptInstances.Items) { ((LinkButton)ri.FindControl("btnDelete")).Attributes.Add("onclick", "return confirm('Are you sure you want to delete this item?');"); } lblNone.Visible = (rptInstances.Items.Count == 0); //btnSave.Enabled = false; } else { imgSave.Visible = true; btnAdd.Enabled = false; btnQuorum.Enabled = false; btnNodes.Enabled = false; btnStorage.Enabled = false; panNote.Visible = true; lblNone.Visible = true; } } } } btnClose.Attributes.Add("onclick", "return window.close();"); btnDenied.Attributes.Add("onclick", "return window.close();"); btnSave.Attributes.Add("onclick", "return ValidateText('" + txtName.ClientID + "','Please enter a custom name for this cluster')" + " && ValidateNumber0('" + txtNodes.ClientID + "','Please enter a valid number for the number of nodes')" + " && ValidateNumberLess('" + txtNodes.ClientID + "'," + intServer + ",'You cannot add any more than " + intServer + " nodes')" + " && ValidateNumber('" + txtDR.ClientID + "','Please enter a valid number for the number of DR servers')" + " && ValidateNumberLess('" + txtDR.ClientID + "'," + intDR + ",'You cannot add any more than " + intDR + " DR servers')" + " && ValidateNumber('" + txtHA.ClientID + "','Please enter a valid number for the number of HA servers')" + " && ValidateNumberLess('" + txtHA.ClientID + "'," + intHA + ",'You cannot add any more than " + intHA + " HA servers')" + ";"); }
protected void Page_Load(object sender, EventArgs e) { intProfile = Int32.Parse(Request.Cookies["profileid"].Value); oProject = new Projects(intProfile, dsn); oFunction = new Functions(intProfile, dsn, intEnvironment); oUser = new Users(intProfile, dsn); oPage = new Pages(intProfile, dsn); oResourceRequest = new ResourceRequest(intProfile, dsn); oRequestItem = new RequestItems(intProfile, dsn); oRequest = new Requests(intProfile, dsn); oService = new Services(intProfile, dsn); oServiceRequest = new ServiceRequests(intProfile, dsn); oRequestField = new RequestFields(intProfile, dsn); oApplication = new Applications(intProfile, dsn); oServiceDetail = new ServiceDetails(intProfile, dsn); oDelegate = new Delegates(intProfile, dsn); oDocument = new Documents(intProfile, dsn); // For server Workstation Errors oServer = new Servers(intProfile, dsn); oWorkstation = new Workstations(intProfile, dsn); oZeus = new Zeus(intProfile, dsnZeus); oAsset = new Asset(0, dsnAsset); oOnDemand = new OnDemand(intProfile, dsn); oError = new Errors(intProfile, dsn); oVariable = new Variables(intEnvironment); if (Request.QueryString["applicationid"] != null && Request.QueryString["applicationid"] != "") { intApplication = Int32.Parse(Request.QueryString["applicationid"]); } if (Request.QueryString["pageid"] != null && Request.QueryString["pageid"] != "") { intPage = Int32.Parse(Request.QueryString["pageid"]); } if (Request.Cookies["application"] != null && Request.Cookies["application"].Value != "") { intApplication = Int32.Parse(Request.Cookies["application"].Value); } if (Request.QueryString["rrid"] != null && Request.QueryString["rrid"] != "") { // Start Workflow Change lblResourceWorkflow.Text = Request.QueryString["rrid"]; int intResourceWorkflow = Int32.Parse(Request.QueryString["rrid"]); int intResourceParent = oResourceRequest.GetWorkflowParent(intResourceWorkflow); ds = oResourceRequest.Get(intResourceParent); // End Workflow Change intRequest = Int32.Parse(ds.Tables[0].Rows[0]["requestid"].ToString()); lblRequestedBy.Text = oUser.GetFullName(oRequest.GetUser(intRequest)); lblRequestedOn.Text = DateTime.Parse(oResourceRequest.Get(intResourceParent, "created")).ToString(); lblDescription.Text = oRequest.Get(intRequest, "description"); if (lblDescription.Text == "") { lblDescription.Text = "<i>No information</i>"; } intItem = Int32.Parse(ds.Tables[0].Rows[0]["itemid"].ToString()); intNumber = Int32.Parse(ds.Tables[0].Rows[0]["number"].ToString()); // Start Workflow Change bool boolComplete = (oResourceRequest.GetWorkflow(intResourceWorkflow, "status") == "3"); int intUser = Int32.Parse(oResourceRequest.GetWorkflow(intResourceWorkflow, "userid")); txtCustom.Text = oResourceRequest.GetWorkflow(intResourceWorkflow, "name"); double dblAllocated = double.Parse(oResourceRequest.GetWorkflow(intResourceWorkflow, "allocated")); boolJoined = (oResourceRequest.GetWorkflow(intResourceWorkflow, "joined") == "1"); // End Workflow Change intService = Int32.Parse(ds.Tables[0].Rows[0]["serviceid"].ToString()); lblService.Text = oService.Get(intService, "name"); int intApp = oRequestItem.GetItemApplication(intItem); if (Request.QueryString["save"] != null && Request.QueryString["save"] != "") { Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "saved", "<script type=\"text/javascript\">alert('Information Saved Successfully');<" + "/" + "script>"); } if (Request.QueryString["status"] != null && Request.QueryString["status"] != "") { Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "statusd", "<script type=\"text/javascript\">alert('Status Updates has been Added');<" + "/" + "script>"); } if (!IsPostBack) { double dblUsed = oResourceRequest.GetWorkflowUsed(intResourceWorkflow); lblUpdated.Text = oResourceRequest.GetUpdated(intResourceParent); if (dblAllocated == dblUsed) { if (boolComplete == false) { oFunction.ConfigureToolButton(btnComplete, "/images/tool_complete"); btnComplete.Attributes.Add("onclick", "return confirm('Are you sure you want to mark this as completed and remove it from your workload?');"); } else { oFunction.ConfigureToolButton(btnComplete, "/images/tool_complete"); btnComplete.Attributes.Add("onclick", "alert('This task has already been marked COMPLETE. You can close this window.');return false;"); } } else { btnComplete.ImageUrl = "/images/tool_complete_dbl.gif"; btnComplete.Enabled = false; } bool boolSLABreached = false; if (oService.Get(intService, "sla") != "") { oFunction.ConfigureToolButton(btnSLA, "/images/tool_sla"); int intDays = oResourceRequest.GetSLA(intResourceParent); if (intDays > -99999) { if (intDays < 1) { btnSLA.Style["border"] = "solid 2px #FF0000"; } else if (intDays < 3) { btnSLA.Style["border"] = "solid 2px #FF9999"; } boolSLABreached = (intDays < 0); btnSLA.Attributes.Add("onclick", "return OpenWindow('RESOURCE_REQUEST_SLA','?rrid=" + intResourceParent.ToString() + "');"); } else { btnSLA.ImageUrl = "/images/tool_sla_dbl.gif"; btnSLA.Enabled = false; } } else { btnSLA.ImageUrl = "/images/tool_sla_dbl.gif"; btnSLA.Enabled = false; } oFunction.ConfigureToolButton(btnEmail, "/images/tool_email"); btnEmail.Attributes.Add("onclick", "return OpenWindow('RESOURCE_REQUEST_EMAIL','?rrid=" + intResourceWorkflow.ToString() + "&type=GENERIC');"); dblUsed = (dblUsed / dblAllocated) * 100; intProject = oRequest.GetProjectNumber(intRequest); hdnTab.Value = "D"; panWorkload.Visible = true; bool boolRed = LoadStatus(intResourceWorkflow); if (boolRed == false && boolSLABreached == true) { btnComplete.Attributes.Add("onclick", "alert('NOTE: Your Service Level Agreement (SLA) has been breached!\\n\\nYou must provide a RED STATUS update with an explanation of why your SLA was breached for this request.\\n\\nOnce a RED STATUS update has been provided, you will be able to complete this request.');return false;"); } LoadLists(); LoadInformation(intResourceWorkflow); chkDescription.Checked = (Request.QueryString["doc"] != null); //Change Control and Documents LoadChange(intResourceWorkflow); lblDocuments.Text = oDocument.GetDocuments_Service(intRequest, intService, oVariable.DocumentsFolder(), 1, (Request.QueryString["doc"] != null)); // GetDocuments(string _physical, int _projectid, int _requestid, int _userid, int _security, bool _show_description, bool _mine) //lblDocuments.Text = oDocument.GetDocuments(Request.PhysicalApplicationPath, 0, intRequest, 0, 1, (Request.QueryString["doc"] != null), false); btnDenied.Attributes.Add("onclick", "return CloseWindow();"); oFunction.ConfigureToolButton(btnSave, "/images/tool_save"); oFunction.ConfigureToolButton(btnPrint, "/images/tool_print"); btnPrint.Attributes.Add("onclick", "return PrintWindow();"); oFunction.ConfigureToolButton(btnClose, "/images/tool_close"); btnClose.Attributes.Add("onclick", "return ExitWindow();"); btnSave.Attributes.Add("onclick", "return ValidateStatus('" + ddlStatus.ClientID + "','" + txtComments.ClientID + "');"); btnChange.Attributes.Add("onclick", "return ValidateText('" + txtNumber.ClientID + "','Please enter a change control number')" + " && ValidateDate('" + txtDate.ClientID + "','Please enter a valid implementation date')" + " && ValidateTime('" + txtTime.ClientID + "','Please enter a valid implementation time')" + ";"); imgDate.Attributes.Add("onclick", "return ShowCalendar('" + txtDate.ClientID + "');"); // 6/1/2009 - Load ReadOnly View if ((oResourceRequest.CanUpdate(intProfile, intResourceWorkflow, false) == false) || boolComplete == true) { oFunction.ConfigureToolButtonRO(btnSave, btnComplete); pnlSolutions.Visible = false; btnNoSolution.Enabled = false; btnNewSolution.Enabled = false; } btnReturn.Visible = false; btnComplete.Visible = false; } } else { panDenied.Visible = true; } txtIncidentUser.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'300','195','" + divIncidentUser.ClientID + "','" + lstIncidentUser.ClientID + "','" + hdnIncidentUser.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);"); lstIncidentUser.Attributes.Add("ondblclick", "AJAXClickRow();"); }
protected void Page_Load(object sender, EventArgs e) { string strNetwork = "Desktop"; if (string.IsNullOrEmpty(Request.QueryString["n"]) == false) { strNetwork = Request.QueryString["n"]; } string strPortGroup = "dvPortGroupVLAN1000"; if (string.IsNullOrEmpty(Request.QueryString["g"]) == false) { strPortGroup = Request.QueryString["g"]; } Servers oServer = new Servers(0, dsn); OnDemand oOnDemand = new OnDemand(0, dsn); IPAddresses oIPAddresses = new IPAddresses(0, dsnIP, dsn); oVMWare = new VMWare(0, dsn); string strConnect = oVMWare.ConnectDEBUG("https://wssvt350a.pncbank.com/sdk", 999, "PNC-Pittsburgh"); if (strConnect == "") { VimService _service = oVMWare.GetService(); ServiceContent _sic = oVMWare.GetSic(); ManagedObjectReference datacenterRef = oVMWare.GetDataCenter(); ManagedObjectReference netFolderRef = (ManagedObjectReference)oVMWare.getObjectProperty(datacenterRef, "networkFolder"); ManagedObjectReference[] netList = (ManagedObjectReference[])oVMWare.getObjectProperty(netFolderRef, "childEntity"); ManagedObjectReference net = null; foreach (ManagedObjectReference network in netList) { if (((string)oVMWare.getObjectProperty(network, "name")) == strNetwork) { net = network; break; } } if (net != null) { ManagedObjectReference[] switchList = (ManagedObjectReference[])oVMWare.getObjectProperty(net, "childEntity"); foreach (ManagedObjectReference swit in switchList) { try { if (((string)oVMWare.getObjectProperty(swit, "name")) == strPortGroup) { DVPortgroupConfigInfo pgConfig = (DVPortgroupConfigInfo)oVMWare.getObjectProperty(swit, "config"); Response.Write("Num Ports = " + pgConfig.numPorts.ToString() + "<br/>"); ManagedObjectReference[] pgVM = (ManagedObjectReference[])oVMWare.getObjectProperty(swit, "vm"); Response.Write("Num Machines = " + pgVM.Length.ToString() + "<br/>"); int intAvailable = pgConfig.numPorts - pgVM.Length; Response.Write("Ports Available = " + intAvailable.ToString() + "<br/>"); break; } } catch { } } } // ManagedObjectReference[] oDatastores = oVMWare.GetDatastores("ohclexcv4004"); // foreach (ManagedObjectReference oDataStore in oDatastores) // { // DatastoreSummary oSummary = (DatastoreSummary)oVMWare.getObjectProperty(oDataStore, "summary"); // double oAvailable = double.Parse(oSummary.capacity.ToString()); // oAvailable = oAvailable / 1024.00; // oAvailable = oAvailable / 1024.00; // oAvailable = oAvailable / 1024.00; // double oFree = double.Parse(oSummary.freeSpace.ToString()); // oFree = oFree / 1024.00; // oFree = oFree / 1024.00; // oFree = oFree / 1024.00; // Response.Write(oSummary.name + " = " + oFree.ToString("F") + " GB / " + oAvailable.ToString("F") + " GB<br/>"); // } } else { Response.Write("LOGIN error"); } }
protected void Page_Load(object sender, EventArgs e) { intProfile = Int32.Parse(Request.Cookies["profileid"].Value); oOnDemand = new OnDemand(intProfile, dsn); oForecast = new Forecast(intProfile, dsn); oModel = new Models(intProfile, dsn); oModelsProperties = new ModelsProperties(intProfile, dsn); oWorkstation = new Workstations(intProfile, dsn); if (Request.QueryString["id"] != null && Request.QueryString["id"] != "") { intID = Int32.Parse(Request.QueryString["id"]); } if (Request.QueryString["sid"] != null && Request.QueryString["sid"] != "") { intStep = Int32.Parse(Request.QueryString["sid"]); } if (Request.QueryString["step"] != null && Request.QueryString["step"] != "") { panUpdate.Visible = true; } else { panNavigation.Visible = true; } if (intID > 0) { DataSet ds = oForecast.GetAnswer(intID); if (ds.Tables[0].Rows.Count > 0) { intRequest = oForecast.GetRequestID(intID, true); intTotalCount = Int32.Parse(ds.Tables[0].Rows[0]["quantity"].ToString()); intTotalDR = Int32.Parse(ds.Tables[0].Rows[0]["recovery_number"].ToString()); int intModel = oForecast.GetModel(intID); intModel = Int32.Parse(oModelsProperties.Get(intModel, "modelid")); intType = oModel.GetType(intModel); DataSet dsSteps = oOnDemand.GetWizardSteps(intType, 1); int intCount = Int32.Parse(oOnDemand.GetWizardStep(intStep, "step")); if (dsSteps.Tables[0].Rows.Count == intCount) { btnNext.Text = "Finish"; } if (intCount == 0 || intCount == 1) { btnBack.Enabled = false; } if (!IsPostBack) { LoadDevices(intModel); } if (boolConfigured == true) { panValid.Visible = true; } // else // panInvalid.Visible = true; } } btnClose.Attributes.Add("onclick", "return window.close();"); btnNext.Attributes.Add("onclick", "return ValidateBoolean(" + (boolConfigured ? "true" : "false") + ",'You cannot continue until you have configured all devices.\\n\\nClick OK to close this window. Then click [Edit] to configure each device.');"); btnUpdate.Attributes.Add("onclick", "return ValidateBoolean(" + (boolConfigured ? "true" : "false") + ",'You cannot continue until you have configured all devices.\\n\\nClick OK to close this window. Then click [Edit] to configure each device.');"); }
protected void Page_Load(object sender, EventArgs e) { AuthenticateUser(); intProfile = Int32.Parse(Request.Cookies["profileid"].Value); oForecast = new Forecast(intProfile, dsn); oOnDemand = new OnDemand(intProfile, dsn); oPage = new Pages(intProfile, dsn); oModel = new Models(intProfile, dsn); oModelsProperties = new ModelsProperties(intProfile, dsn); oServiceRequest = new ServiceRequests(intProfile, dsn); oStorage = new Storage(intProfile, dsn); oUser = new Users(intProfile, dsn); oFunction = new Functions(intProfile, dsn, intEnvironment); if (Request.QueryString["parent"] != null && Request.QueryString["parent"] != "") { intForecast = Int32.Parse(Request.QueryString["parent"]); } if (Request.QueryString["id"] != null && Request.QueryString["id"] != "") { intID = Int32.Parse(Request.QueryString["id"]); } if (oUser.GetApplicationUrl(intProfile, intForecastPage) == "") { panDenied.Visible = true; hypDesign.NavigateUrl = "/datapoint/service/design.aspx?id=" + oFunction.encryptQueryString(intID.ToString()); } else { panAllow.Visible = true; if (Request.QueryString["saved"] != null) { Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "saved", "<script type=\"text/javascript\">alert('Forecast Equipment Saved');if(window.opener!=null)window.opener.navigate('" + oPage.GetFullLink(intForecastPage) + "?id=" + intForecast.ToString() + "');window.close();<" + "/" + "script>"); } int intType = 0; int intStep = 0; int intModel = 0; bool boolOverrideReject = false; bool boolOverridePending = false; bool boolConfidence = false; if (intID > 0) { int _step = 0; DataSet ds = oForecast.GetAnswer(intID); if (ds.Tables[0].Rows.Count > 0) { int intQuantity = Int32.Parse(ds.Tables[0].Rows[0]["quantity"].ToString()); if (intConfidence100 == Int32.Parse(ds.Tables[0].Rows[0]["confidenceid"].ToString())) { boolConfidence = true; } if (Int32.Parse(ds.Tables[0].Rows[0]["override"].ToString()) == -10) { boolOverrideReject = true; } if (Int32.Parse(ds.Tables[0].Rows[0]["override"].ToString()) == -1) { boolOverridePending = true; } lblQuantity.Text = intQuantity.ToString(); intQuantity = intQuantity * 25; lblMinimum.Text = intQuantity.ToString(); lblForecastCount.Text = ds.Tables[0].Rows[0]["quantity"].ToString(); lblCurrentCount.Text = oForecast.TotalServerCount(intID, boolUseCSM).ToString(); if (lblCurrentCount.Text != lblForecastCount.Text) { lblCurrentCount.CssClass = "biggerreddefault"; } lblCurrentDR.Text = oForecast.TotalDRCount(intID, boolUseCSM).ToString(); lblForecastDR.Text = ds.Tables[0].Rows[0]["recovery_number"].ToString(); if (lblCurrentDR.Text != lblForecastDR.Text) { lblCurrentDR.CssClass = "biggerreddefault"; } lblCurrentHA.Text = oForecast.TotalHACount(intID, boolUseCSM).ToString(); lblForecastHA.Text = ds.Tables[0].Rows[0]["ha"].ToString(); if (lblCurrentHA.Text != lblForecastHA.Text) { lblCurrentHA.CssClass = "biggerreddefault"; } if (oForecast.IsStorage(intID) == true) { DataSet dsStorage = oForecast.GetStorage(intID); double dblHigh = double.Parse(dsStorage.Tables[0].Rows[0]["high_total"].ToString()); double dblStandard = double.Parse(dsStorage.Tables[0].Rows[0]["standard_total"].ToString()); double dblLow = double.Parse(dsStorage.Tables[0].Rows[0]["low_total"].ToString()); double dblHighQA = double.Parse(dsStorage.Tables[0].Rows[0]["high_qa"].ToString()); double dblStandardQA = double.Parse(dsStorage.Tables[0].Rows[0]["standard_qa"].ToString()); double dblLowQA = double.Parse(dsStorage.Tables[0].Rows[0]["low_qa"].ToString()); double dblHighTest = double.Parse(dsStorage.Tables[0].Rows[0]["high_test"].ToString()); double dblStandardTest = double.Parse(dsStorage.Tables[0].Rows[0]["standard_test"].ToString()); double dblLowTest = double.Parse(dsStorage.Tables[0].Rows[0]["low_test"].ToString()); double dblHighHA = double.Parse(dsStorage.Tables[0].Rows[0]["high_ha"].ToString()); double dblStandardHA = double.Parse(dsStorage.Tables[0].Rows[0]["standard_ha"].ToString()); double dblLowHA = double.Parse(dsStorage.Tables[0].Rows[0]["low_ha"].ToString()); //double dblHighRep = double.Parse(dsStorage.Tables[0].Rows[0]["high_replicated"].ToString()); //double dblStandardRep = double.Parse(dsStorage.Tables[0].Rows[0]["standard_replicated"].ToString()); //double dblLowRep = double.Parse(dsStorage.Tables[0].Rows[0]["low_replicated"].ToString()); //double dblTotal = dblHigh + dblStandard + dblLow + dblHighQA + dblStandardQA + dblLowQA + dblHighTest + dblStandardTest + dblLowTest + dblHighRep + dblStandardRep + dblLowRep + dblHighHA + dblStandardHA + dblLowHA; double dblTotal = dblHigh + dblStandard + dblLow + dblHighQA + dblStandardQA + dblLowQA + dblHighTest + dblStandardTest + dblLowTest + dblHighHA + dblStandardHA + dblLowHA; lblForecastStorage.Text = dblTotal.ToString() + " GB"; lblBladeStorage.Text = dblTotal.ToString(); lblForecastStorageHighP.Text = dblHigh.ToString() + " GB"; lblForecastStorageHighQ.Text = dblHighQA.ToString() + " GB"; lblForecastStorageHighT.Text = dblHighTest.ToString() + " GB"; lblForecastStorageHighH.Text = dblHighHA.ToString() + " GB"; lblForecastStorageStandardP.Text = dblStandard.ToString() + " GB"; lblForecastStorageStandardQ.Text = dblStandardQA.ToString() + " GB"; lblForecastStorageStandardT.Text = dblStandardTest.ToString() + " GB"; lblForecastStorageStandardH.Text = dblStandardHA.ToString() + " GB"; lblForecastStorageLowP.Text = dblLow.ToString() + " GB"; lblForecastStorageLowQ.Text = dblLowQA.ToString() + " GB"; lblForecastStorageLowT.Text = dblLowTest.ToString() + " GB"; lblForecastStorageLowH.Text = dblLowHA.ToString() + " GB"; dsStorage = oStorage.GetLuns(intID); dblHigh = 0.00; dblStandard = 0.00; dblLow = 0.00; dblHighQA = 0.00; dblStandardQA = 0.00; dblLowQA = 0.00; dblHighTest = 0.00; dblStandardTest = 0.00; dblLowTest = 0.00; dblTotal = 0.00; dblHighHA = 0.00; dblStandardHA = 0.00; dblLowHA = 0.00; double dblTotalQA = 0.00; double dblTotalTest = 0.00; foreach (DataRow drStorage in dsStorage.Tables[0].Rows) { double dblQuantity = 1.00; if (Int32.Parse(drStorage["clusterid"].ToString()) > 0 && Int32.Parse(drStorage["instanceid"].ToString()) == 0) { int intCluster = Int32.Parse(drStorage["clusterid"].ToString()); Cluster oCluster = new Cluster(intProfile, dsn); dblQuantity = double.Parse(oCluster.Get(intCluster, "nodes")); } if (drStorage["size"].ToString() != "") { if (drStorage["performance"].ToString() == "High") { dblHigh += (double.Parse(drStorage["size"].ToString()) * dblQuantity); if (drStorage["high_availability"].ToString() == "1") { dblHighHA += (double.Parse(drStorage["size"].ToString()) * dblQuantity); } } if (drStorage["performance"].ToString() == "Standard") { dblStandard += (double.Parse(drStorage["size"].ToString()) * dblQuantity); if (drStorage["high_availability"].ToString() == "1") { dblStandardHA += (double.Parse(drStorage["size"].ToString()) * dblQuantity); } } if (drStorage["performance"].ToString() == "Low") { dblLow += (double.Parse(drStorage["size"].ToString()) * dblQuantity); if (drStorage["high_availability"].ToString() == "1") { dblLowHA += (double.Parse(drStorage["size"].ToString()) * dblQuantity); } } dblTotal += (double.Parse(drStorage["size"].ToString()) * dblQuantity); if (drStorage["high_availability"].ToString() == "1") { dblTotal += (double.Parse(drStorage["size"].ToString()) * dblQuantity); } } if (drStorage["size_qa"].ToString() != "") { if (drStorage["performance"].ToString() == "High") { dblHighQA += (double.Parse(drStorage["size_qa"].ToString()) * dblQuantity); } if (drStorage["performance"].ToString() == "Standard") { dblStandardQA += (double.Parse(drStorage["size_qa"].ToString()) * dblQuantity); } if (drStorage["performance"].ToString() == "Low") { dblLowQA += (double.Parse(drStorage["size_qa"].ToString()) * dblQuantity); } dblTotalQA += (double.Parse(drStorage["size_qa"].ToString()) * dblQuantity); } if (drStorage["size_test"].ToString() != "") { if (drStorage["performance"].ToString() == "High") { dblHighTest += (double.Parse(drStorage["size_test"].ToString()) * dblQuantity); } if (drStorage["performance"].ToString() == "Standard") { dblStandardTest += (double.Parse(drStorage["size_test"].ToString()) * dblQuantity); } if (drStorage["performance"].ToString() == "Low") { dblLowTest += (double.Parse(drStorage["size_test"].ToString()) * dblQuantity); } dblTotalTest += (double.Parse(drStorage["size_test"].ToString()) * dblQuantity); } DataSet dsMount = oStorage.GetMountPoints(Int32.Parse(drStorage["id"].ToString())); foreach (DataRow drMount in dsMount.Tables[0].Rows) { if (drMount["size"].ToString() != "") { if (drMount["performance"].ToString() == "High") { dblHigh += (double.Parse(drMount["size"].ToString()) * dblQuantity); if (drMount["high_availability"].ToString() == "1") { dblHighHA += (double.Parse(drStorage["size"].ToString()) * dblQuantity); } } if (drMount["performance"].ToString() == "Standard") { dblStandard += (double.Parse(drMount["size"].ToString()) * dblQuantity); if (drMount["high_availability"].ToString() == "1") { dblStandardHA += (double.Parse(drStorage["size"].ToString()) * dblQuantity); } } if (drMount["performance"].ToString() == "Low") { dblLow += (double.Parse(drMount["size"].ToString()) * dblQuantity); if (drMount["high_availability"].ToString() == "1") { dblLowHA += (double.Parse(drStorage["size"].ToString()) * dblQuantity); } } dblTotal += (double.Parse(drMount["size"].ToString()) * dblQuantity); if (drMount["high_availability"].ToString() == "1") { dblTotal += (double.Parse(drStorage["size"].ToString()) * dblQuantity); } } if (drStorage["size_qa"].ToString() != "") { if (drMount["performance"].ToString() == "High") { dblHighQA += (double.Parse(drMount["size_qa"].ToString()) * dblQuantity); } if (drMount["performance"].ToString() == "Standard") { dblStandardQA += (double.Parse(drMount["size_qa"].ToString()) * dblQuantity); } if (drMount["performance"].ToString() == "Low") { dblLowQA += (double.Parse(drMount["size_qa"].ToString()) * dblQuantity); } dblTotalQA += (double.Parse(drMount["size_qa"].ToString()) * dblQuantity); } if (drMount["size_test"].ToString() != "") { if (drMount["performance"].ToString() == "High") { dblHighTest += (double.Parse(drMount["size_test"].ToString()) * dblQuantity); } if (drMount["performance"].ToString() == "Standard") { dblStandardTest += (double.Parse(drMount["size_test"].ToString()) * dblQuantity); } if (drMount["performance"].ToString() == "Low") { dblLowTest += (double.Parse(drMount["size_test"].ToString()) * dblQuantity); } dblTotalTest += (double.Parse(drMount["size_test"].ToString()) * dblQuantity); } } } double dblOverall = dblTotal + dblTotalQA + dblTotalTest; lblCurrentStorage.Text = dblOverall.ToString() + " GB"; lblCurrentStorageHighP.Text = dblHigh.ToString() + " GB"; lblCurrentStorageHighQ.Text = dblHighQA.ToString() + " GB"; lblCurrentStorageHighT.Text = dblHighTest.ToString() + " GB"; lblCurrentStorageHighH.Text = dblHighHA.ToString() + " GB"; lblCurrentStorageStandardP.Text = dblStandard.ToString() + " GB"; lblCurrentStorageStandardQ.Text = dblStandardQA.ToString() + " GB"; lblCurrentStorageStandardT.Text = dblStandardTest.ToString() + " GB"; lblCurrentStorageStandardH.Text = dblStandardHA.ToString() + " GB"; lblCurrentStorageLowP.Text = dblLow.ToString() + " GB"; lblCurrentStorageLowQ.Text = dblLowQA.ToString() + " GB"; lblCurrentStorageLowT.Text = dblLowTest.ToString() + " GB"; lblCurrentStorageLowH.Text = dblLowHA.ToString() + " GB"; if (lblCurrentStorage.Text != lblForecastStorage.Text) { lblCurrentStorage.CssClass = "biggerreddefault"; } } else { lblCurrentStorage.Text = "0 GB"; lblForecastStorage.Text = "0 GB"; } intModel = oForecast.GetModelAsset(intID); if (intModel == 0) { intModel = oForecast.GetModel(intID); } intModel = Int32.Parse(oModelsProperties.Get(intModel, "modelid")); intType = oModel.GetType(intModel); DataSet dsSteps = oOnDemand.GetWizardSteps(intType, 1); DataSet dsStepsDone = oOnDemand.GetWizardStepsDone(intID, intType); int intStepsTotal = dsSteps.Tables[0].Rows.Count; int intStepsNotDone = (intStepsTotal - dsStepsDone.Tables[0].Rows.Count); double dblProgress = double.Parse(intStepsNotDone.ToString()) / double.Parse(intStepsTotal.ToString()); dblProgress = dblProgress * 100.00; strProgress = oServiceRequest.GetStatusBarBlue(dblProgress, "90", true); if (Request.QueryString["step"] != null && Request.QueryString["step"] != "") { _step = Int32.Parse(Request.QueryString["step"]); if (_step <= dsSteps.Tables[0].Rows.Count) { intStep = _step; } } else if (Request.QueryString["view"] != null && Request.QueryString["sid"] != null && Request.QueryString["sid"] != "") { _step = Int32.Parse(Request.QueryString["sid"]); if (_step <= dsSteps.Tables[0].Rows.Count) { intStep = Int32.Parse(dsSteps.Tables[0].Rows[_step - 1]["id"].ToString()); } } else { if (dsStepsDone.Tables[0].Rows.Count > 0) { intStep = Int32.Parse(dsStepsDone.Tables[0].Rows[0]["id"].ToString()); } } if (oForecast.IsStorage(intID) == true) { btnDetails.Attributes.Add("onclick", "ShowHideDiv2('" + divDetails.ClientID + "');return false;"); } else { btnDetails.Enabled = false; } } if (Request.QueryString["save"] != null) { Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "save", "<script type=\"text/javascript\">if(window.opener!=null)window.opener.navigate('" + oPage.GetFullLink(intForecastPage) + "?id=" + intForecast.ToString() + "');<" + "/" + "script>"); } DataSet dsStep = oOnDemand.GetWizardStep(intStep); if (dsStep.Tables[0].Rows.Count > 0) { imgStep.ImageUrl = "/images/wizard.gif"; lblTitle.Text = dsStep.Tables[0].Rows[0]["name"].ToString(); lblSubTitle.Text = dsStep.Tables[0].Rows[0]["subtitle"].ToString(); if (boolConfidence == false) { panConfidence.Visible = true; } else if (boolOverridePending == true) { panOverridePending.Visible = true; } else if (boolOverrideReject == true) { panOverrideReject.Visible = true; } else { string strPath = dsStep.Tables[0].Rows[0]["path"].ToString(); bool boolSkip = false; bool boolShowCluster = (dsStep.Tables[0].Rows[0]["show_cluster"].ToString() == "1"); bool boolShowCSM = (dsStep.Tables[0].Rows[0]["show_csm"].ToString() == "1"); bool boolSkipCluster = (dsStep.Tables[0].Rows[0]["skip_cluster"].ToString() == "1"); bool boolSkipCSM = (dsStep.Tables[0].Rows[0]["skip_csm"].ToString() == "1"); if (oForecast.IsHACluster(intID) == true) { if (boolShowCluster == false) { boolSkip = true; } } else if (boolSkipCluster == true) { boolSkip = true; } if (oForecast.IsHACSM(intID) == true) { if (boolShowCSM == false) { boolSkip = true; } } else if (boolSkipCSM == true) { boolSkip = true; } if (boolSkip == true) { if (Request.QueryString["backward"] != null) { if (Request.QueryString["view"] != null) { _step--; Response.Redirect(Request.Path + "?id=" + intID.ToString() + "&sid=" + _step.ToString() + "&view=true"); } else { oOnDemand.Back(intID); Response.Redirect(Request.Path + "?id=" + intID.ToString() + "&backward=true"); } } else { if (Request.QueryString["view"] != null) { _step++; Response.Redirect(Request.Path + "?id=" + intID.ToString() + "&sid=" + _step.ToString() + "&view=true"); } else { oOnDemand.Next(intID, intStep); Response.Redirect(Request.Path + "?id=" + intID.ToString() + "&forward=true"); } } } if (strPath != "") { panStep.Visible = true; if (Request.QueryString["sid"] == null || Request.QueryString["sid"] == "") { Response.Redirect(Request.Path + "?id=" + intID + "&sid=" + intStep); } PHStep.Controls.Add((Control)LoadControl(strPath)); } } } else { // START ON DEMAND Response.Redirect("/frame/ondemand/status.aspx?id=" + Request.QueryString["id"]); } } } btnClose.Attributes.Add("onclick", "return window.close();"); }
protected void Page_Load(object sender, EventArgs e) { string strSSH = ""; string strILO = "10.249.237.148"; if (Request.QueryString["ilo"] != null) { strILO = "10.249.237.144"; } Variables oVariable = new Variables(intEnvironment); int intLogging = 0; byte[] byt; string str; Models oModel = new Models(0, dsn); ModelsProperties oModelsProperties = new ModelsProperties(0, dsn); Servers oServer = new Servers(0, dsn); Settings oSetting = new Settings(0, dsn); OnDemand oOnDemand = new OnDemand(0, dsn); Log oEventLog = new Log(0, dsn); SshShell oSSHshell = new SshShell(strILO, oVariable.SolarisUsername(), oVariable.SolarisPassword()); oSSHshell.RemoveTerminalEmulationCharacters = true; oSSHshell.Connect(); Response.Write("Connected to " + strILO + "...sending commands..." + "<br/>"); CombinedStream oSSHstream = (CombinedStream)(oSSHshell.GetStream()); int intStep = 1; if (Request.QueryString["none"] == null) { byt = new byte[100]; str = "" + strSSH_Carriage; byt = System.Text.ASCIIEncoding.ASCII.GetBytes(str); if (oSSHshell.Connected == true && oSSHshell.ShellOpened == true) { oSSHstream.Write(byt); } } int bt = 0; int intMinutePrevious = 0; bool boolProcessing = false; while (bt != -1 && oSSHshell.Connected == true && oSSHshell.ShellOpened == true) { bt = oSSHstream.ReadByte(); // Strip the processing cursor -\|/-\|/ from the output if (bt == 8) // 8 = backspace { // Check to see if previous characters were a processing character as well char chrSSH = strSSH[strSSH.Length - 1]; int intSymbol = (int)chrSSH; while (IsGarbageChar(intSymbol) == true) { if (intLogging > 1) { Response.Write("The symbol [" + chrSSH.ToString() + "] is a garbage character and must be removed" + "<br/>"); } strSSH = strSSH.Substring(0, strSSH.Length - 1); chrSSH = strSSH[strSSH.Length - 1]; intSymbol = (int)chrSSH; } // Set processing to true to exclude future characters boolProcessing = true; } if (boolProcessing == true && IsGarbageChar(bt) == false) { boolProcessing = false; } if (boolProcessing == false) { strSSH += (char)bt; } string strReadSSH = ""; string strWriteSSH = ""; switch (intStep) { case 1: strReadSSH = "-sc>"; strWriteSSH = "poweron"; break; case 2: strReadSSH = "-sc>"; strWriteSSH = "showpower"; break; case 3: strReadSSH = "-sc>"; break; } if (strReadSSH != "" && strSSH.EndsWith(strReadSSH) == true) { try { Response.Write("SSH output ends with [" + strReadSSH + "] : " + strSSH + "<br/>"); } catch { } if (intStep == 3) { break; } // Execute next command byt = new byte[100]; str = strWriteSSH + strSSH_Carriage; byt = System.Text.ASCIIEncoding.ASCII.GetBytes(str); if (oSSHshell.Connected == true && oSSHshell.ShellOpened == true) { try { Response.Write("Sending command [" + strWriteSSH + "] : " + strSSH + "<br/>"); } catch { } oSSHstream.Write(byt); } intStep++; } else { } } Response.Write(strSSH); oSSHstream.Close(); oSSHshell.Close(); }
protected void Page_Load(object sender, EventArgs e) { Page.Title = "ClearView Account Configuration"; AuthenticateUser(); intProfile = Int32.Parse(Request.Cookies["profileid"].Value); oUser = new Users(intProfile, dsn); oVariable = new Variables(intEnvironment); oForecast = new Forecast(intProfile, dsn); oServer = new Servers(intProfile, dsn); oOnDemand = new OnDemand(intProfile, dsn); oClass = new Classes(intProfile, dsn); if (Request.QueryString["duplicate"] != null && Request.QueryString["duplicate"] != "") { Page.ClientScript.RegisterStartupScript(typeof(Page), "duplicate", "<script type=\"text/javascript\">alert('The account " + Request.QueryString["duplicate"] + " already exists');<" + "/" + "script>"); } if (Request.QueryString["id"] != null && Request.QueryString["id"] != "") { intServer = Int32.Parse(Request.QueryString["id"]); Page.Title = "ClearView Account Configuration | Server # " + intServer.ToString(); DataSet ds = oServer.Get(intServer); if (ds.Tables[0].Rows.Count > 0) { intStep = Int32.Parse(ds.Tables[0].Rows[0]["step"].ToString()); intAnswer = Int32.Parse(ds.Tables[0].Rows[0]["answerid"].ToString()); int intClass = Int32.Parse(oForecast.GetAnswer(intAnswer, "classid")); intRequest = oForecast.GetRequestID(intAnswer, true); intDomain = Int32.Parse(ds.Tables[0].Rows[0]["domainid"].ToString()); Domains oDomain = new Domains(intProfile, dsn); bool boolProcess = true; if (oDomain.Get(intDomain, "account_setup") != "1") { if (oForecast.GetAnswer(intAnswer, "test") == "1") { intDomain = Int32.Parse(ds.Tables[0].Rows[0]["test_domainid"].ToString()); } else { boolProcess = false; } } if (boolProcess == false) { btnAdd.Enabled = false; } lblDomain.Text = oDomain.Get(intDomain, "name"); bool boolPNC = (oClass.Get(intClass, "pnc") == "1"); if (boolPNC == true) { panPNC.Visible = true; txtUser.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'300','195','" + divAJAX.ClientID + "','" + lstAJAX.ClientID + "','" + hdnUser.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2,null,'PNC');"); } else { txtUser.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'300','195','" + divAJAX.ClientID + "','" + lstAJAX.ClientID + "','" + hdnUser.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2,null,'NCB');"); panNCB.Visible = true; } Requests oRequest = new Requests(intProfile, dsn); //if (oRequest.GetUser(intRequest) == intProfile) //{ panPermit.Visible = true; lstAJAX.Attributes.Add("ondblclick", "AJAXClickRow();"); chkAdmin.Attributes.Add("onclick", "CheckAdmin(this);"); ds = oServer.GetAccounts(intServer); rptAccounts.DataSource = ds; rptAccounts.DataBind(); foreach (RepeaterItem ri in rptAccounts.Items) { LinkButton _delete = (LinkButton)ri.FindControl("btnDelete"); _delete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this account?');"); Label _local = (Label)ri.FindControl("lblLocal"); Label _domain = (Label)ri.FindControl("lblDomain"); string strPermissions = ""; Label _permissions = (Label)ri.FindControl("lblPermissions"); if (boolPNC == true) { char[] strAccountSplit = { ';' }; // Domain Groups string[] strAccountDomainArray = _domain.Text.Split(strAccountSplit); for (int jj = 0; jj < strAccountDomainArray.Length; jj++) { string strAccountDomain = strAccountDomainArray[jj].Trim(); if (strAccountDomain.Contains("_") == true) { strPermissions += strAccountDomain.Substring(0, strAccountDomain.IndexOf("_")); strAccountDomain = strAccountDomain.Substring(strAccountDomain.IndexOf("_") + 1); if (strAccountDomain == "1") { strPermissions += " (Remote Desktop)"; } } else { strPermissions += strAccountDomain; } strPermissions += "<br/>"; } // Local Groups string[] strAccountLocalArray = _local.Text.Split(strAccountSplit); for (int jj = 0; jj < strAccountLocalArray.Length; jj++) { string strAccountLocal = strAccountLocalArray[jj].Trim(); if (strAccountLocal.Contains("_") == true) { strPermissions += strAccountLocal.Substring(0, strAccountLocal.IndexOf("_")); strAccountLocal = strAccountLocal.Substring(strAccountLocal.IndexOf("_") + 1); if (strAccountLocal == "1") { strPermissions += " (Remote Desktop)"; } } else { strPermissions += strAccountLocal; } strPermissions += "<br/>"; } } else { Label _admin = (Label)ri.FindControl("lblAdmin"); string strPermission = _admin.Text; if (strPermission == "1") { strPermissions += "ADMINISTRATOR<br/>"; } strPermission = _local.Text; if (strPermission.Contains("GLCfsaRO_SysVol")) { strPermissions += "SYS_VOL (C:) - Read Only<br/>"; } else if (strPermission.Contains("GLCfsaRW_SysVol")) { strPermissions += "SYS_VOL (C:) - Read / Write<br/>"; } else if (strPermission.Contains("GLCfsaFC_SysVol")) { strPermissions += "SYS_VOL (C:) - Full Control<br/>"; } if (strPermission.Contains("GLCfsaRO_UtlVol")) { strPermissions += "UTL_VOL (E:) - Read Only<br/>"; } else if (strPermission.Contains("GLCfsaRW_UtlVol")) { strPermissions += "UTL_VOL (E:) - Read / Write<br/>"; } else if (strPermission.Contains("GLCfsaFC_UtlVol")) { strPermissions += "UTL_VOL (E:) - Full Control<br/>"; } if (strPermission.Contains("GLCfsaRO_AppVol")) { strPermissions += "APP_VOL (F:) - Read Only<br/>"; } else if (strPermission.Contains("GLCfsaRW_AppVol")) { strPermissions += "APP_VOL (F:) - Read / Write<br/>"; } else if (strPermission.Contains("GLCfsaFC_AppVol")) { strPermissions += "APP_VOL (F:) - Full Control<br/>"; } } if (strPermissions == "") { strPermissions = "-----"; } _permissions.Text = strPermissions; } if (rptAccounts.Items.Count == 0) { lblNone.Visible = true; btnSubmit.Attributes.Add("onclick", "alert('You must add at least one account or select the skip button');return false;"); } //} //else // panDenied.Visible = true; } } else { panDenied.Visible = true; } btnSkip.Attributes.Add("onclick", "return confirm('Are you sure you want to skip the account request process?');"); btnAdd.Attributes.Add("onclick", "return ValidateHidden('" + hdnUser.ClientID + "','" + txtUser.ClientID + "','Please enter a username, first name or last name');"); btnManager.Attributes.Add("onclick", "return OpenWindow('NEW_USER','');"); chkDeveloper.Attributes.Add("onclick", "SwapChecks(this,'" + chkPromoter.ClientID + "');"); chkPromoter.Attributes.Add("onclick", "SwapChecks(this,'" + chkDeveloper.ClientID + "');"); }
protected void Page_Load(object sender, EventArgs e) { Response.Cookies["loginreferrer"].Value = "/admin/forecast/steps.aspx"; 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"); } oOnDemand = new OnDemand(intProfile, dsn); oType = new Types(intProfile, dsn); oPlatform = new Platforms(intProfile, dsn); if (Request.QueryString["id"] == null) { if (Request.QueryString["parent"] == null) { LoadPlatforms(); } else { panAdd.Visible = true; int intParent = Int32.Parse(Request.QueryString["parent"]); hdnParent.Value = intParent.ToString(); lblParent.Text = oType.Get(intParent, "name"); } } else { panAdd.Visible = true; intID = Int32.Parse(Request.QueryString["id"]); if (!IsPostBack) { DataSet ds = oOnDemand.GetStep(intID); int intParent = Int32.Parse(ds.Tables[0].Rows[0]["typeid"].ToString()); hdnParent.Value = intParent.ToString(); lblParent.Text = oType.Get(intParent, "name"); txtName.Text = ds.Tables[0].Rows[0]["name"].ToString(); txtTitle.Text = ds.Tables[0].Rows[0]["title"].ToString(); txtPath.Text = ds.Tables[0].Rows[0]["path"].ToString(); txtScript.Text = ds.Tables[0].Rows[0]["script"].ToString(); txtScriptDone.Text = ds.Tables[0].Rows[0]["done"].ToString(); radZEUS.Checked = (ds.Tables[0].Rows[0]["zeus"].ToString() == "1"); radPower.Checked = (ds.Tables[0].Rows[0]["power"].ToString() == "1"); radAccounts.Checked = (ds.Tables[0].Rows[0]["accounts"].ToString() == "1"); radInstalls.Checked = (ds.Tables[0].Rows[0]["installs"].ToString() == "1"); radGroups.Checked = (ds.Tables[0].Rows[0]["groups"].ToString() == "1"); ddlType.SelectedValue = ds.Tables[0].Rows[0]["type"].ToString(); txtInteraction.Text = ds.Tables[0].Rows[0]["interact_path"].ToString(); chkResume.Checked = (ds.Tables[0].Rows[0]["resume_error"].ToString() == "1"); chkShowBuild.Checked = (ds.Tables[0].Rows[0]["show_build"].ToString() == "1"); chkEnabled.Checked = (ds.Tables[0].Rows[0]["enabled"].ToString() == "1"); } } btnOrder.Attributes.Add("onclick", "return OpenWindow('SUPPORTORDER','" + hdnParent.ClientID + "','" + hdnOrder.ClientID + "&type=OD_STEPS" + "',false,400,400);"); btnDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this item?');"); btnParent.Attributes.Add("onclick", "return OpenWindow('TYPEBROWSER','" + hdnParent.ClientID + "','&control=" + hdnParent.ClientID + "&controltext=" + lblParent.ClientID + "',false,400,600);"); btnPath.Attributes.Add("onclick", "return OpenWindow('FILEBROWSER','" + txtPath.ClientID + "','',false,400,600);"); btnInteraction.Attributes.Add("onclick", "return OpenWindow('FILEBROWSER','" + txtInteraction.ClientID + "','',false,400,600);"); }
protected void Page_Load(object sender, EventArgs e) { Page.Title = "ClearView Config Information"; intProfile = Int32.Parse(Request.Cookies["profileid"].Value); oOnDemand = new OnDemand(intProfile, dsn); oForecast = new Forecast(intProfile, dsn); oModel = new Models(intProfile, dsn); oModelsProperties = new ModelsProperties(intProfile, dsn); oCSMConfig = new CSMConfig(intProfile, dsn); if (Request.QueryString["id"] != null && Request.QueryString["id"] != "") { intID = Int32.Parse(Request.QueryString["id"]); } if (Request.QueryString["sid"] != null && Request.QueryString["sid"] != "") { intStep = Int32.Parse(Request.QueryString["sid"]); } if (Request.QueryString["step"] != null && Request.QueryString["step"] != "") { panUpdate.Visible = true; } else { panNavigation.Visible = true; } int intForecastCount = 0; int intForecastDRCount = 0; int intCurrentCount = 0; int intCurrentDRCount = 0; if (intID > 0) { Page.Title = "ClearView Config Information | Design # " + intID.ToString(); DataSet ds = oForecast.GetAnswer(intID); if (ds.Tables[0].Rows.Count > 0) { intRequest = oForecast.GetRequestID(intID, true); intForecastCount = Int32.Parse(ds.Tables[0].Rows[0]["quantity"].ToString()); intForecastDRCount = Int32.Parse(ds.Tables[0].Rows[0]["recovery_number"].ToString()); intCurrentCount = oForecast.TotalServerCount(intID, boolUseCSM); intCurrentDRCount = oForecast.TotalDRCount(intID, boolUseCSM); int intModel = oForecast.GetModel(intID); intModel = Int32.Parse(oModelsProperties.Get(intModel, "modelid")); intType = oModel.GetType(intModel); if (oForecast.IsOSMidrange(intID) == true) { boolMidrange = true; } DataSet dsSteps = oOnDemand.GetWizardSteps(intType, 1); int intCount = Int32.Parse(oOnDemand.GetWizardStep(intStep, "step")); if (dsSteps.Tables[0].Rows.Count == intCount) { btnNext.Text = "Finish"; } if (intCount == 0 || intCount == 1) { btnBack.Enabled = false; } if (!IsPostBack) { LoadClusters(); } } } btnClose.Attributes.Add("onclick", "return window.close();"); btnAdd.Attributes.Add("onclick", "return OpenCluster('" + intID.ToString() + "','');"); if (strAttributes == "") { if (intCurrentCount > 0) { panValid.Visible = true; } btnNext.Attributes.Add("onclick", "return ValidateEqual('" + intForecastCount + "','" + intCurrentCount + "','WARNING: Your Current Server Count does not equal your Forecasted Server Count.\\n\\nForecasted Server Count = " + intForecastCount + "\\nCurrent Server Count = " + intCurrentCount + "\\n\\nIf you choose to proceed, you will not be able to provision the remaining devices.\\n\\nAre you sure you want to continue?')" + ";"); btnUpdate.Attributes.Add("onclick", "return ValidateEqual('" + intForecastDRCount + "','" + intCurrentDRCount + "','WARNING: Your Current DR Count does not equal your Forecasted DR Count.\\n\\nForecasted DR Count = " + intForecastCount + "\\nCurrent DR Count = " + intCurrentCount + "\\n\\nIf you choose to proceed, you will not be able to provision the remaining devices.\\n\\nAre you sure you want to continue?')" + ";"); } else { btnNext.Attributes.Add("onclick", strAttributes); btnUpdate.Attributes.Add("onclick", strAttributes); } }
protected void Page_Load(object sender, EventArgs e) { Page.Title = "ClearView Account Configuration"; AuthenticateUser(); intProfile = Int32.Parse(Request.Cookies["profileid"].Value); oUser = new Users(intProfile, dsn); oVariable = new Variables(intEnvironment); oFunction = new Functions(0, dsn, intEnvironment); oForecast = new Forecast(intProfile, dsn); oWorkstation = new Workstations(intProfile, dsn); oOnDemand = new OnDemand(intProfile, dsn); if (Request.QueryString["id"] != null && Request.QueryString["id"] != "") { intWorkstation = Int32.Parse(Request.QueryString["id"]); Page.Title = "ClearView Account Configuration | Workstation # " + intWorkstation.ToString(); DataSet ds = oWorkstation.GetVirtual(intWorkstation); if (ds.Tables[0].Rows.Count > 0) { if (Request.QueryString["userid"] != null && Request.QueryString["userid"] != "") { int intUser = Int32.Parse(Request.QueryString["userid"]); trUpdate.Visible = true; lblXID.Text = oUser.GetFullName(intUser) + " (" + oUser.GetName(intUser) + ")"; btnAdd.Text = "Update"; btnCancel.Visible = true; } else { trNew.Visible = true; } intStep = Int32.Parse(ds.Tables[0].Rows[0]["step"].ToString()); intInternal = Int32.Parse(ds.Tables[0].Rows[0]["internal"].ToString()); intAnswer = Int32.Parse(ds.Tables[0].Rows[0]["answerid"].ToString()); int intNumber = Int32.Parse(ds.Tables[0].Rows[0]["number"].ToString()); DataSet dsAnswer = oForecast.GetAnswer(intAnswer); if (dsAnswer.Tables[0].Rows.Count > 0) { intQuantity = Int32.Parse(dsAnswer.Tables[0].Rows[0]["quantity"].ToString()); chkApply.Visible = (intQuantity > 1 && intNumber == 1); } intRequest = oForecast.GetRequestID(intAnswer, true); intDomain = Int32.Parse(ds.Tables[0].Rows[0]["domainid"].ToString()); Domains oDomain = new Domains(intProfile, dsn); int intClass = Int32.Parse(oForecast.GetAnswer(intAnswer, "classid")); Classes oClass = new Classes(intProfile, dsn); if (oForecast.GetAnswer(intAnswer, "test") == "1") { intDomain = Int32.Parse(ds.Tables[0].Rows[0]["test_domainid"].ToString()); } lblDomain.Text = oDomain.Get(intDomain, "name"); Requests oRequest = new Requests(intProfile, dsn); //if (oRequest.GetUser(intRequest) == intProfile) //{ panPermit.Visible = true; txtUser.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'300','195','" + divAJAX.ClientID + "','" + lstAJAX.ClientID + "','" + hdnUser.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);"); lstAJAX.Attributes.Add("ondblclick", "AJAXClickRow();"); chkAdmin.Attributes.Add("onclick", "CheckAdmin(this);"); ds = oWorkstation.GetAccountsVMware(intWorkstation); rptAccounts.DataSource = ds; rptAccounts.DataBind(); foreach (RepeaterItem ri in rptAccounts.Items) { LinkButton _delete = (LinkButton)ri.FindControl("btnDelete"); _delete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this account?');"); } if (rptAccounts.Items.Count == 0) { lblNone.Visible = true; btnSubmit.Attributes.Add("onclick", "alert('You must add at least one account or select the skip button');return false;"); } //if (oClass.IsProd(intClass)) panProduction.Visible = true; //else // panAdmin.Visible = true; } } else { btnAdd.Enabled = false; btnSubmit.Enabled = false; btnSkip.Enabled = false; } btnSkip.Enabled = false; //btnSkip.Attributes.Add("onclick", "return confirm('Are you sure you want to skip the account configuration process?');"); btnAdd.Attributes.Add("onclick", "return ValidateHidden('" + hdnUser.ClientID + "','" + txtUser.ClientID + "','Please enter a username, first name or last name');"); btnManager.Attributes.Add("onclick", "return OpenWindow('NEW_USER','');"); }
protected void Page_Load(object sender, EventArgs e) { //intProfile = Int32.Parse(Request.Cookies["profileid"].Value); intProfile = 0; oWorkstation = new Workstations(intProfile, dsn); oRemote = new Workstations(intProfile, dsnRemote); oUser = new Users(intProfile, dsn); oVariable = new Variables(intEnvironment); oOnDemand = new OnDemand(intProfile, dsn); oForecast = new Forecast(intProfile, dsn); oClass = new Classes(intProfile, dsn); string strUsers = ""; if (Request.QueryString["id"] != null && Request.QueryString["id"] != "") { int intWorkstation = Int32.Parse(Request.QueryString["id"]); DataSet ds = oWorkstation.GetVirtual(intWorkstation); if (ds.Tables[0].Rows.Count > 0) { intStep = Int32.Parse(ds.Tables[0].Rows[0]["step"].ToString()); intAnswer = Int32.Parse(ds.Tables[0].Rows[0]["answerid"].ToString()); intAsset = Int32.Parse(ds.Tables[0].Rows[0]["assetid"].ToString()); intRemote = Int32.Parse(ds.Tables[0].Rows[0]["remoteid"].ToString()); int intClass = Int32.Parse(oForecast.GetAnswer(intAnswer, "classid")); int intDomain = Int32.Parse(ds.Tables[0].Rows[0]["domainid"].ToString()); Domains oDomain = new Domains(intProfile, dsn); lblDomain.Text = oDomain.Get(intDomain, "name"); intDomain = Int32.Parse(oDomain.Get(intDomain, "environment")); int intName = Int32.Parse(ds.Tables[0].Rows[0]["nameid"].ToString()); lblWorkstation.Text = oWorkstation.GetName(intName); txtUser.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'300','195','" + divAJAX.ClientID + "','" + lstAJAX.ClientID + "','" + hdnUser.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);"); lstAJAX.Attributes.Add("ondblclick", "AJAXClickRow();"); DataSet dsAccounts = oWorkstation.GetAccountsVirtual(intAsset); rptAccounts.DataSource = dsAccounts; rptAccounts.DataBind(); foreach (RepeaterItem ri in rptAccounts.Items) { LinkButton _delete = (LinkButton)ri.FindControl("btnDelete"); _delete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this account?');"); } foreach (DataRow drAccount in dsAccounts.Tables[0].Rows) { strUsers += oUser.GetName(Int32.Parse(drAccount["userid"].ToString())) + ";"; } if (rptAccounts.Items.Count == 0) { lblNone.Visible = true; btnSubmit.Attributes.Add("onclick", "alert('You must add at least one account or select the skip button');return false;"); } if (oClass.IsProd(intClass)) { panProduction.Visible = true; } else { panAdmin.Visible = true; } } } else { btnAdd.Enabled = false; btnSubmit.Enabled = false; btnSkip.Enabled = false; } btnSkip.Enabled = false; //btnSkip.Attributes.Add("onclick", "return confirm('Are you sure you want to skip the account configuration process?');"); btnAdd.Attributes.Add("onclick", "return ValidateHidden('" + hdnUser.ClientID + "','" + txtUser.ClientID + "','Please enter a username, first name or last name') && EnsureAccenture('" + hdnUser.ClientID + "','" + strUsers + "');"); //btnAdd.Attributes.Add("onclick", "return ValidateHidden('" + hdnUser.ClientID + "','" + txtUser.ClientID + "','Please enter a username, first name or last name')" + (boolProduction == true ? " && EnsureAccenture('" + hdnUser.ClientID + "','" + strUsers + "')" : "") + ";"); btnManager.Attributes.Add("onclick", "return OpenWindow('NEW_USER','');"); }
public void RunWithArguments(Document doc, NameValueMap map) { // write diagnostics data LogInputData(doc, map); var pathName = doc.FullFileName; LogTrace("Processing " + pathName); string[] outputFileName = { "", "ResultSmall", "ResultLarge" }; try { var documentType = doc.DocumentType; var iRuns = 1; if (documentType == DocumentTypeEnum.kPartDocumentObject) { iRuns = 2; } for (int iRun = 1; iRun <= iRuns; iRun++) { // load processing parameters string paramsJson = GetParametersToChange(map, iRun); // update parameters in the doc // start HeartBeat around ChangeParameters, it could be a long operation using (new HeartBeat()) { ChangeParameters(doc, paramsJson); } var docDir = Path.GetDirectoryName(doc.FullFileName); if (documentType == DocumentTypeEnum.kPartDocumentObject) { PartDocument part = (PartDocument)doc; double mass = part.ComponentDefinition.MassProperties.Mass; string imageParamName = "ImageLight"; // check the mass of the document and download proper image if (mass > 300.0) { imageParamName = "ImageHeavy"; } // get Image from the OnDemand parameter OnDemand.HttpOperation(imageParamName, "", null, "", $"file://{outputFileName[iRun]}.png"); } // generate outputs if (documentType == DocumentTypeEnum.kPartDocumentObject) { var fileName = Path.Combine(docDir, $"{outputFileName[iRun]}.ipt"); // the name must be in sync with OutputIpt localName in Activity LogTrace("Saving " + fileName); // start HeartBeat around Save, it could be a long operation using (new HeartBeat()) { doc.SaveAs(fileName, false); } LogTrace("Saved as " + fileName); // save an image SaveImageFromPart(Path.Combine(docDir, $"{outputFileName[iRun]}.bmp"), doc as PartDocument); } else // Assembly. That's already validated in ChangeParameters { //Generate drawing document with assembly var idwPath = Path.ChangeExtension(Path.Combine(docDir, doc.DisplayName), "idw"); LogTrace($"Generate drawing document"); SaveAsIDW(idwPath, doc); // cannot ZIP opened assembly, so close it // start HeartBeat around Save, it could be a long operation using (new HeartBeat()) { doc.Save2(true); } doc.Close(true); LogTrace("Zipping up updated Assembly."); // assembly lives in own folder under WorkingDir. Get the WorkingDir var workingDir = Path.GetDirectoryName(docDir); var fileName = Path.Combine(workingDir, "Result.zip"); // the name must be in sync with OutputIam localName in Activity if (File.Exists(fileName)) { File.Delete(fileName); } // start HeartBeat around ZipFile, it could be a long operation using (new HeartBeat()) { ZipFile.CreateFromDirectory(Path.GetDirectoryName(pathName), fileName, CompressionLevel.Fastest, false); } LogTrace($"Saved as {fileName}"); } } } catch (Exception e) { LogError("Processing failed. " + e.ToString()); } }
protected void Page_Load(object sender, EventArgs e) { intProfile = Int32.Parse(Request.Cookies["profileid"].Value); RequestItems oRequestItem = new RequestItems(intProfile, dsn); RequestFields oRequestField = new RequestFields(intProfile, dsn); ServiceRequests oServiceRequest = new ServiceRequests(intProfile, dsn); Services oService = new Services(intProfile, dsn); oFunction = new Functions(intProfile, dsn, intEnvironment); oUser = new Users(intProfile, dsn); oRequest = new Requests(intProfile, dsn); int intRequest = Int32.Parse(Request.QueryString["rid"]); string strStatus = oServiceRequest.Get(intRequest, "checkout"); DataSet dsItems = oRequestItem.GetForms(intRequest); int intItem = 0; int intService = 0; int intNumber = 0; if (dsItems.Tables[0].Rows.Count > 0) { bool boolBreak = false; foreach (DataRow drItem in dsItems.Tables[0].Rows) { if (boolBreak == true) { break; } if (drItem["done"].ToString() == "0") { intItem = Int32.Parse(drItem["itemid"].ToString()); intService = Int32.Parse(drItem["serviceid"].ToString()); intNumber = Int32.Parse(drItem["number"].ToString()); boolBreak = true; } if (intItem > 0 && (strStatus == "1" || strStatus == "2")) { bool boolSuccess = true; //string strResult = oService.GetName(intService) + " Completed"; string strResult = ""; string strError = oService.GetName(intService) + " Error"; // ********* BEGIN PROCESSING ************** Servers oServer = new Servers(intProfile, dsn); OnDemand oOnDemand = new OnDemand(intProfile, dsn); Audit oAudit = new Audit(intProfile, dsn); ServerName oServerName = new ServerName(intProfile, dsn); ModelsProperties oModelsProperties = new ModelsProperties(intProfile, dsn); Asset oAsset = new Asset(intProfile, dsnAsset, dsn); DataSet dsRebuild = oServer.GetRebuild(intRequest, intService, intNumber); bool found = false; foreach (DataRow drRebuild in dsRebuild.Tables[0].Rows) { found = true; int intServer = Int32.Parse(drRebuild["serverid"].ToString()); string strName = oServer.GetName(intServer, true); int intModel = 0; int intRebuildStep = 0; // Load General Information int intAsset = 0; DataSet dsAssets = oServer.GetAssets(intServer); foreach (DataRow drAsset in dsAssets.Tables[0].Rows) { if (drAsset["latest"].ToString() == "1") { intAsset = Int32.Parse(drAsset["assetid"].ToString()); break; } } if (intAsset > 0) { // Asset Information intModel = Int32.Parse(oAsset.Get(intAsset, "modelid")); } if (oModelsProperties.IsTypeVMware(intModel) == false) { intRebuildStep = 6; } else { intRebuildStep = 7; } oServer.UpdateStep(intServer, intRebuildStep); // Redo step...delete current step and update the other step oOnDemand.UpdateStepDoneServerRedo(intServer, intRebuildStep); oServer.DeleteSwitchports(intServer); // Reconfigure switchports oServer.UpdateRebuilding(intServer, 1); // Delete Audits oAudit.DeleteServer(intServer, 0); oAudit.DeleteServer(intServer, 1); // Set installs back DataSet dsInstalls = oServerName.GetComponentDetailSelected(intServer, 0); foreach (DataRow drInstall in dsInstalls.Tables[0].Rows) { oServerName.UpdateComponentDetailSelected(intServer, Int32.Parse(drInstall["detailid"].ToString()), -2); } int intStepSkipStart = 0; int intStepSkipGoto = 0; oServer.UpdateStepSkip(intServer, intStepSkipStart, intStepSkipGoto); strResult += "<p>The server " + strName + " was successfully queued for rebuild</p>"; strError = ""; break; } if (found == false) { strError = "<p>There was a problem configuring the server for rebuild ~ Request not found.</p>"; } if (strResult == "") { boolSuccess = false; } // ******** END PROCESSING ************** if (oService.Get(intService, "automate") == "1" && boolSuccess == true) { strDone += "<table border=\"0\"><tr><td valign=\"top\"><img src=\"/images/ico_check.gif\" border=\"0\" align=\"absmiddle\"/></td><td valign=\"top\" class=\"biggerbold\">" + strResult + "</td></tr></table>"; } else { if (boolSuccess == false) { strDone += "<table border=\"0\"><tr><td valign=\"top\"><img src=\"/images/ico_error.gif\" border=\"0\" align=\"absmiddle\"/></td><td valign=\"top\" class=\"biggerbold\">" + strError + "</td></tr></table>"; } else { strDone += "<table border=\"0\"><tr><td valign=\"top\"><img src=\"/images/ico_check.gif\" border=\"0\" align=\"absmiddle\"/></td><td valign=\"top\" class=\"biggerbold\">" + oService.GetName(intService) + " Submitted</td></tr></table>"; } } oRequestItem.UpdateFormDone(intRequest, intItem, intNumber, 1, 1); } } } }