private void LoadWorkstations() { panAll.Visible = true; TreeNode oNodeServer = new TreeNode(); oNodeServer.Text = "Workstation Errors"; oNodeServer.ToolTip = "Workstation Errors"; oNodeServer.ImageUrl = "/images/folder.gif"; oNodeServer.SelectAction = TreeNodeSelectAction.Expand; oTreeview.Nodes.Add(oNodeServer); DataSet ds = oWorkstation.GetVirtualErrors(); foreach (DataRow dr in ds.Tables[0].Rows) { LoadErrors(Int32.Parse(dr["workstationid"].ToString()), oNodeServer); } oTreeview.ExpandDepth = 2; oTreeview.Attributes.Add("oncontextmenu", "return false;"); }
protected void btnStep_Click(Object Sender, EventArgs e) { string strError = ""; int intWorkstation = Int32.Parse(lblWorkstation.Text); if (chkStep.Checked == true) { int intAsset2 = 0; int intStep = 0; DataSet ds = oWorkstation.GetVirtualErrors(intWorkstation); foreach (DataRow dr in ds.Tables[0].Rows) { if (dr["assetid"].ToString() != "") { intAsset2 = Int32.Parse(dr["assetid"].ToString()); } if (dr["fixed"].ToString() == "") { intStep = Int32.Parse(dr["step"].ToString()); } } if (intWorkstation > 0) { oWorkstation.UpdateVirtualError(intWorkstation, intStep, 0, 0); if (intAsset2 > 0) { string strSerial = oAsset.Get(intAsset2, "serial"); oZeus.UpdateResults(strSerial); } else { strError = "Warning: Invalid AssetID"; } } else { strError = "Error: Invalid WorkstationID"; } } if (chkStepVMWare.Checked == true) { VMWare oVMWare = new VMWare(0, dsn); int intWorkstationName = 0; Int32.TryParse(oWorkstation.GetVirtual(intWorkstation, "nameid"), out intWorkstationName); oVMWare.DeleteGuest(oWorkstation.GetName(intWorkstationName)); } oWorkstation.UpdateVirtualStep(intWorkstation, Int32.Parse(txtStep.Text)); Response.Redirect(Request.Path + "?q=" + Request.QueryString["q"] + "&id=" + oFunction.encryptQueryString(intAsset.ToString()) + "&admin=true&menu_tab=6&result=" + oFunction.encryptQueryString((strError == "" ? "Success" : strError))); }
protected void Page_Load(object sender, EventArgs e) { oWorkstation = new Workstations(intProfile, dsn); oServer = new Servers(intProfile, dsn); oFunction = new Functions(intProfile, dsn, intEnvironment); oUser = new Users(intProfile, dsn); oVMWare = new VMWare(intProfile, dsn); oAsset = new Asset(intProfile, dsnAsset, dsn); oError = new Errors(intProfile, dsn); oZeus = new Zeus(intProfile, dsnZeus); oVariable = new Variables(intEnvironment); oOperatingSystem = new OperatingSystems(intProfile, dsn); lblTitle.Text = "Provisioning Issue"; string strUser = Request.ServerVariables["logon_user"]; strUser = strUser.Substring(strUser.LastIndexOf("\\") + 1); intUser = oUser.GetId(strUser); if (intUser > 0) { if (Request.QueryString["fixed"] != null && Request.QueryString["fixed"] != "") { Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "fixed", "<script type=\"text/javascript\">alert('The issue has been saved and the device is queued to continue.\\n\\nThis window will now be closed.');window.close();<" + "/" + "script>"); } if (Request.QueryString["type"] != null && Request.QueryString["id"] != null) { try { intID = Int32.Parse(oFunction.decryptQueryString(Request.QueryString["id"])); } catch { intID = 0; } if (intID > 0) { if (!IsPostBack) { bool boolVMware = false; if (Request.QueryString["type"] == "s") { lblType.Text = "Server"; lblLabel.Text = "Design ID:"; DataSet ds = oServer.GetErrors(intID); foreach (DataRow dr in ds.Tables[0].Rows) { if (dr["fixed"].ToString() == "") { lblName.Text = dr["servername"].ToString(); lblDate.Text = dr["created"].ToString(); lblIssue.Text = dr["reason"].ToString(); int intServer = 0; if (dr["serverid"].ToString() != "") { intServer = Int32.Parse(dr["serverid"].ToString()); } if (intServer > 0) { int intOS = 0; Int32.TryParse(oServer.Get(intServer, "osid"), out intOS); lblOS.Text = oOperatingSystem.Get(intOS, "name"); lblValue.Text = oServer.Get(intServer, "answerid"); } int intAsset = 0; if (dr["assetid"].ToString() != "") { intAsset = Int32.Parse(dr["assetid"].ToString()); } lblAsset.Text = intAsset.ToString(); lblStep.Text = dr["step"].ToString(); if (intAsset != 0) { string strILO = oAsset.GetServerOrBlade(intAsset, "ilo"); if (strILO != "") { panVMwareNo.Visible = true; lblConsole.Text = "<a href=\"https://" + strILO + "\" target=\"_blank\">" + strILO + "</a>"; } else { boolVMware = true; } } } } // Load Existing Errors Tab oTab = new Tab("", 0, "divMenu1", true, false); rptRelated.DataSource = oError.Gets(lblIssue.Text, intUser); rptRelated.DataBind(); int intTab = 0; foreach (RepeaterItem ri in rptRelated.Items) { intTab++; oTab.AddTab("Solution # " + intTab.ToString(), ""); ((Button)ri.FindControl("btnSelect")).Attributes.Add("onclick", "return confirm('Are you sure you want to select this solution as the fix?');"); Label lblAttach = (Label)ri.FindControl("lblAttach"); Panel panAttach = (Panel)ri.FindControl("panAttach"); if (lblAttach.Text != "") { panAttach.Visible = true; string strAttach = lblAttach.Text; if (strAttach.Contains("\\") == true) { strAttach = strAttach.Substring(strAttach.LastIndexOf("\\") + 1); } lblAttach.Text = "<a href=\"" + lblAttach.Text + "\" target=\"_blank\">" + strAttach + "</a>"; } } strMenuTab1 = oTab.GetTabs(); trNone.Visible = (rptRelated.Items.Count == 0); } else if (Request.QueryString["type"] == "w") { if (!IsPostBack) { lblType.Text = "Workstation"; lblLabel.Text = "Request ID:"; DataSet ds = oWorkstation.GetVirtualErrors(intID); foreach (DataRow dr in ds.Tables[0].Rows) { if (dr["fixed"].ToString() == "") { lblName.Text = dr["workstationname"].ToString(); lblDate.Text = dr["created"].ToString(); lblIssue.Text = dr["reason"].ToString(); int intWorkstation = 0; if (dr["workstationid"].ToString() != "") { intWorkstation = Int32.Parse(dr["workstationid"].ToString()); } if (intWorkstation > 0) { int intOS = 0; Int32.TryParse(oWorkstation.GetVirtual(intWorkstation, "osid"), out intOS); lblOS.Text = oOperatingSystem.Get(intOS, "name"); lblValue.Text = oWorkstation.GetVirtual(intWorkstation, "requestid"); } int intAsset = 0; if (dr["assetid"].ToString() != "") { intAsset = Int32.Parse(dr["assetid"].ToString()); } lblAsset.Text = intAsset.ToString(); lblStep.Text = dr["step"].ToString(); boolVMware = true; } } // Load Existing Errors Tab oTab = new Tab("", 0, "divMenu1", true, false); rptRelated.DataSource = oError.Gets(lblError.Text, 0); rptRelated.DataBind(); int intTab = 0; foreach (RepeaterItem ri in rptRelated.Items) { intTab++; oTab.AddTab("Solution # " + intTab.ToString(), ""); ((Button)ri.FindControl("btnSelect")).Attributes.Add("onclick", "return confirm('Are you sure you want to select this solution as the fix?');"); Label lblAttach = (Label)ri.FindControl("lblAttach"); Panel panAttach = (Panel)ri.FindControl("panAttach"); if (lblAttach.Text != "") { panAttach.Visible = true; string strAttach = lblAttach.Text; if (strAttach.Contains("\\") == true) { strAttach = strAttach.Substring(strAttach.LastIndexOf("\\") + 1); } lblAttach.Text = "<a href=\"" + lblAttach.Text + "\" target=\"_blank\">" + strAttach + "</a>"; } } strMenuTab1 = oTab.GetTabs(); trNone.Visible = (rptRelated.Items.Count == 0); } } if (boolVMware == true) { panVMware.Visible = true; DataSet dsGuest = oVMWare.GetGuest(lblName.Text); if (dsGuest.Tables[0].Rows.Count > 0) { DataRow drGuest = dsGuest.Tables[0].Rows[0]; int intDatastore = Int32.Parse(drGuest["datastoreid"].ToString()); lblDataStore.Text = oVMWare.GetDatastore(intDatastore, "name"); int intHost = Int32.Parse(drGuest["hostid"].ToString()); int intCluster = Int32.Parse(oVMWare.GetHost(intHost, "clusterid")); lblCluster.Text = oVMWare.GetCluster(intCluster, "name"); int intFolder = Int32.Parse(oVMWare.GetCluster(intCluster, "folderid")); lblFolder.Text = oVMWare.GetFolder(intFolder, "name"); int intDataCenter = Int32.Parse(oVMWare.GetFolder(intFolder, "datacenterid")); lblDataCenter.Text = oVMWare.GetDatacenter(intDataCenter, "name"); int intVirtualCenter = Int32.Parse(oVMWare.GetDatacenter(intDataCenter, "virtualcenterid")); lblVirtualCenter.Text = oVMWare.GetVirtualCenter(intVirtualCenter, "name"); } } if (lblName.Text == "") { lblError.Text = "This device is not experiencing any provisioning issues at the moment (" + intID.ToString() + ")"; } // Load the case codes ddlCode.DataTextField = "name"; ddlCode.DataValueField = "id"; ddlCode.DataSource = oError.GetTypeTypes(2, 1); ddlCode.DataBind(); ddlCode.Items.Insert(0, new ListItem("-- SELECT --", "0")); } } else { lblError.Text = "Could not find record"; } } else { lblError.Text = "Invalid Parameter(s)"; } } else { lblError.Text = "Could not find a user account for userID = " + strUser; } if (lblError.Text == "") { panIssue.Visible = true; btnFixed.Attributes.Add("onclick", "return ValidateText('" + txtIssue.ClientID + "','Please enter the issue') && ValidateText('" + txtResolution.ClientID + "','Please enter the resolution') && ValidateDropDown('" + ddlCode.ClientID + "','Please select a case code') && confirm('Are you sure you want to mark this error as fixed?') && ProcessButton(this);"); radNew.Attributes.Add("onclick", "ShowHideDiv('" + divNew.ClientID + "','inline');ShowHideDiv('" + divExisting.ClientID + "','none');"); radExisting.Attributes.Add("onclick", "ShowHideDiv('" + divNew.ClientID + "','none');ShowHideDiv('" + divExisting.ClientID + "','inline');"); } else { panDenied.Visible = true; btnClose.Attributes.Add("onclick", "window.close();"); } }
private void ServiceTick() { try { // Cleanup ZEUS table Zeus oZeus = new Zeus(0, dsnZeus); oZeus.DeleteResults(); AD oAD = new AD(0, dsn, intEnvironment); Functions oFunction = new Functions(0, dsn, intEnvironment); Variables oVariable = new Variables(intEnvironment); Log oLog = new Log(0, dsn); // Check Servers for Zeus Servers oServer = new Servers(0, dsn); ServerName oServerName = new ServerName(0, dsn); DataSet ds = SqlHelper.ExecuteDataset(dsn, CommandType.Text, "SELECT * FROM cv_servers WHERE dhcp = '0' AND deleted = 0 OR dhcp = 'SUCCESS' AND deleted = 0"); foreach (DataRow dr in ds.Tables[0].Rows) { int intServer = Int32.Parse(dr["id"].ToString()); DataSet dsZeus = SqlHelper.ExecuteDataset(dsnZeus, CommandType.Text, "SELECT * FROM cv_zeus_builds WHERE serverid = " + intServer.ToString() + " AND dhcp IS NOT NULL AND deleted = 0"); if (dsZeus.Tables[0].Rows.Count > 0) { DataRow drZeus = dsZeus.Tables[0].Rows[0]; oLog.AddEvent(drZeus["name"].ToString(), drZeus["serial"].ToString(), "The DHCP address " + drZeus["dhcp"].ToString() + " was found in the BUILD table", LoggingType.Information); SqlHelper.ExecuteNonQuery(dsn, CommandType.Text, "UPDATE cv_servers SET dhcp = '" + drZeus["dhcp"].ToString() + "', modified = getdate() WHERE id = " + intServer.ToString()); object o = SqlHelper.ExecuteScalar(dsn, CommandType.Text, "SELECT dhcp FROM cv_servers WHERE id = " + intServer.ToString()); if (o != null && o.ToString() != "" && o.ToString() != "0" && o.ToString() != "SUCCESS") { SqlHelper.ExecuteNonQuery(dsnZeus, CommandType.Text, "UPDATE cv_zeus_builds SET deleted = 1, modified = getdate() WHERE id = " + drZeus["id"].ToString()); SqlHelper.ExecuteNonQuery(dsnZeus, CommandType.Text, "UPDATE cv_zeus_builds SET deleted = 10, modified = getdate() WHERE deleted = 0 AND serial = '" + drZeus["serial"].ToString() + "'"); oLog.AddEvent(drZeus["name"].ToString(), drZeus["serial"].ToString(), "The DHCP address was updated and the BUILD record was deleted", LoggingType.Information); } // Check for Errors DataSet dsError = oServer.GetErrors(intServer); foreach (DataRow drError in dsError.Tables[0].Rows) { if (drError["fixed"].ToString() == "") { oServer.UpdateError(intServer, Int32.Parse(drError["step"].ToString()), 0, 0, true, ""); oLog.AddEvent(drZeus["name"].ToString(), drZeus["serial"].ToString(), "The error has been cleared and the build is now ready to continue", LoggingType.Information); } } } } // Check VMware workstations for Zeus Workstations oWorkstation = new Workstations(0, dsn); ds = SqlHelper.ExecuteDataset(dsn, CommandType.Text, "SELECT * FROM cv_workstation_virtual WHERE dhcp = '0' AND vmware = 1 AND deleted = 0 OR dhcp = 'SUCCESS' AND vmware = 1 AND deleted = 0"); foreach (DataRow dr in ds.Tables[0].Rows) { int intWorkstation = Int32.Parse(dr["id"].ToString()); DataSet dsZeus = SqlHelper.ExecuteDataset(dsnZeus, CommandType.Text, "SELECT * FROM cv_zeus_builds WHERE vmware_workstationid = " + intWorkstation.ToString() + " AND dhcp IS NOT NULL AND deleted = 0"); if (dsZeus.Tables[0].Rows.Count > 0) { DataRow drZeus = dsZeus.Tables[0].Rows[0]; oLog.AddEvent(drZeus["name"].ToString(), drZeus["serial"].ToString(), "The DHCP address " + drZeus["dhcp"].ToString() + " was found in the BUILD table", LoggingType.Information); SqlHelper.ExecuteNonQuery(dsn, CommandType.Text, "UPDATE cv_workstation_virtual SET dhcp = '" + drZeus["dhcp"].ToString() + "', modified = getdate() WHERE id = " + intWorkstation.ToString()); object o = SqlHelper.ExecuteScalar(dsn, CommandType.Text, "SELECT dhcp FROM cv_workstation_virtual WHERE id = " + intWorkstation.ToString()); if (o != null && o.ToString() != "" && o.ToString() != "0" && o.ToString() != "SUCCESS") { SqlHelper.ExecuteNonQuery(dsnZeus, CommandType.Text, "UPDATE cv_zeus_builds SET deleted = 1, modified = getdate() WHERE id = " + drZeus["id"].ToString()); oLog.AddEvent(drZeus["name"].ToString(), drZeus["serial"].ToString(), "The DHCP address was updated and the BUILD record was deleted", LoggingType.Information); } // Check for Errors DataSet dsError = oWorkstation.GetVirtualErrors(intWorkstation); foreach (DataRow drError in dsError.Tables[0].Rows) { if (drError["fixed"].ToString() == "") { oWorkstation.UpdateVirtualError(intWorkstation, Int32.Parse(drError["step"].ToString()), 0, 0); oLog.AddEvent(drZeus["name"].ToString(), drZeus["serial"].ToString(), "The error has been cleared and the build is now ready to continue", LoggingType.Information); } } } } /* * // Check Virtual Workstations for Zeus * Workstations oWorkstation = new Workstations(0, dsn); * Forecast oForecast = new Forecast(0, dsn); * Classes oClass = new Classes(0, dsn); * Workstations oRemote = new Workstations(0, dsnRemote); * ds = SqlHelper.ExecuteDataset(dsn, CommandType.Text, "SELECT * FROM cv_workstation_virtual WHERE dhcp = '0' AND vmware = 0 AND deleted = 0 OR dhcp = 'SUCCESS' AND vmware = 0 AND deleted = 0"); * foreach (DataRow dr in ds.Tables[0].Rows) * { * int intWorkstation = Int32.Parse(dr["id"].ToString()); * int intRemote = Int32.Parse(dr["remoteid"].ToString()); * DataSet dsZeus = SqlHelper.ExecuteDataset(dsnZeus, CommandType.Text, "SELECT * FROM cv_zeus_builds WHERE workstationid = " + intWorkstation.ToString() + " AND dhcp IS NOT NULL AND deleted = 0"); * if (dsZeus.Tables[0].Rows.Count > 0) * { * SqlHelper.ExecuteNonQuery(dsn, CommandType.Text, "UPDATE cv_workstation_virtual SET dhcp = '" + dsZeus.Tables[0].Rows[0]["dhcp"].ToString() + "', modified = getdate() WHERE id = " + intWorkstation.ToString()); * oRemote.NextRemoteVirtual(intRemote); * object o = SqlHelper.ExecuteScalar(dsn, CommandType.Text, "SELECT dhcp FROM cv_workstation_virtual WHERE id = " + intWorkstation.ToString()); * if (o != null && o.ToString() != "" && o.ToString() != "0" && o.ToString() != "SUCCESS") * SqlHelper.ExecuteNonQuery(dsnZeus, CommandType.Text, "UPDATE cv_zeus_builds SET deleted = 1, modified = getdate() WHERE id = " + dsZeus.Tables[0].Rows[0]["id"].ToString()); * } * else if (dr["dhcp"].ToString() == "0") * { * DateTime datModified = DateTime.Parse(dr["modified"].ToString()); * DateTime _now = DateTime.Now; * TimeSpan oSpan = _now.Subtract(datModified); * if (oSpan.Hours > 6) * { * string strWorkstation = oWorkstation.GetName(Int32.Parse(dr["nameid"].ToString())); * Ping oPing = new Ping(); * string strStatus = ""; * try * { * PingReply oReply = oPing.Send(strWorkstation); * strStatus = oReply.Status.ToString().ToUpper(); * if (strStatus == "SUCCESS") * strStatus = Convert.ToString(oReply.Address); * else * strStatus = ""; * } * catch { } * if (strStatus != "") * { * if (intLogging > 0) * oLog.WriteEntry(String.Format("PING SUCCESS: " + strWorkstation), EventLogEntryType.Information); * dsZeus = SqlHelper.ExecuteDataset(dsnZeus, CommandType.Text, "SELECT * FROM cv_zeus_builds WHERE name = '" + strWorkstation + "' AND dhcp IS NULL AND deleted = 0"); * if (dsZeus.Tables[0].Rows.Count > 0) * SqlHelper.ExecuteNonQuery(dsnZeus, CommandType.Text, "UPDATE cv_zeus_builds SET dhcp = '" + strStatus + "', modified = getdate() WHERE id = " + dsZeus.Tables[0].Rows[0]["id"].ToString()); * } * else if (intLogging > 0) * oLog.WriteEntry(String.Format("PING UNSUCCESSFUL: " + strWorkstation), EventLogEntryType.Warning); * } * } * } * // Sync Workstations * ds = SqlHelper.ExecuteDataset(dsn, CommandType.Text, "SELECT * FROM cv_workstation_virtual WHERE deleted = 0 AND vmware = 0 AND completed IS NULL"); * foreach (DataRow dr in ds.Tables[0].Rows) * { * int intWorkstation = Int32.Parse(dr["id"].ToString()); * int intRemote = Int32.Parse(dr["remoteid"].ToString()); * object o = SqlHelper.ExecuteScalar(dsnRemote, CommandType.Text, "SELECT step FROM cv_virtual_workstations WHERE id = " + intRemote.ToString()); * if (o != null && o.ToString() != "") * SqlHelper.ExecuteDataset(dsn, CommandType.Text, "UPDATE cv_workstation_virtual SET step = " + o.ToString() + " WHERE id = " + intWorkstation.ToString()); * } * // Check Workstations for Installed Applications * ds = SqlHelper.ExecuteDataset(dsn, CommandType.Text, "SELECT * FROM cv_workstation_virtual WHERE step = " + intWorkstationInstallStep.ToString() + " AND vmware = 0 AND deleted = 0"); * foreach (DataRow dr in ds.Tables[0].Rows) * { * int intWorkstation = Int32.Parse(dr["id"].ToString()); * int intRemote = Int32.Parse(dr["remoteid"].ToString()); * string strName = oWorkstation.GetName(Int32.Parse(dr["nameid"].ToString())); * OnDemand oOnDemand = new OnDemand(0, dsn); * DataSet dsComponents = oWorkstation.GetComponentsSelected(intWorkstation); * if (dsComponents.Tables[0].Rows.Count == 0) * oOnDemand.UpdateStepDoneWorkstation(intWorkstation, intWorkstationInstallStep, "No components to install", 0, false, false); * else * { * foreach (DataRow drComponent in dsComponents.Tables[0].Rows) * { * int intComponent = Int32.Parse(drComponent["componentid"].ToString()); * if (drComponent["user_group"].ToString() != "") * { * oAD.JoinGroup(strName, drComponent["user_group"].ToString()); * strEMailIdsBCC = oFunction.GetGetEmailAlertsEmailIds("EMAILGRP_DEVELOPER_ALERT"); * oFunction.SendEmail("Virtual Workstation Component Installation", drComponent["notifications"].ToString(), "", strEMailIdsBCC, "Virtual Workstation Component Installation", "<p><b>This message is to inform you that the following component(s) were configured for workstation " + strName + "</b></p><p> - " + drComponent["name"].ToString() + "</p>", true, false); * oOnDemand.UpdateStepDoneWorkstation(intWorkstation, intWorkstationInstallStep, "Successfully installed " + drComponent["name"].ToString() + "<br/>", 0, true, false); * } * else * oOnDemand.UpdateStepDoneWorkstation(intWorkstation, intWorkstationInstallStep, "Unable to install " + drComponent["name"].ToString() + " (currently only configured for user group installations)<br/>", 0, true, false); * oWorkstation.UpdateComponents(intWorkstation, intComponent, 2); * } * } * oRemote.NextRemoteVirtual(intRemote); * } * if (intProd == 1) * { * // Check Workstations for completion * Users oUser = new Users(0, dsn); * ds = SqlHelper.ExecuteDataset(dsnRemote, CommandType.Text, "SELECT * FROM cv_virtual_workstations WHERE completed IS NOT NULL AND deleted = 0"); * foreach (DataRow dr in ds.Tables[0].Rows) * { * int intAnswer = Int32.Parse(dr["answerid"].ToString()); * string strName = dr["name"].ToString(); * string strHost = dr["hostname"].ToString(); * string strEmail = ""; * string strCC = ""; * DataSet dsNotify = SqlHelper.ExecuteDataset(dsnRemote, CommandType.Text, "SELECT * FROM cv_virtual_workstations_notify WHERE name = '" + strName + "'"); * foreach (DataRow drNotify in dsNotify.Tables[0].Rows) * strEmail += drNotify["xid"].ToString() + ";"; * string strAccounts = ""; * DataSet dsUsers = SqlHelper.ExecuteDataset(dsnRemote, CommandType.Text, "SELECT * FROM cv_virtual_workstations_accounts WHERE name = '" + strName + "'"); * foreach (DataRow drUser in dsUsers.Tables[0].Rows) * { * if (drUser["admin"].ToString() == "1") * strAccounts += oUser.GetFullName(drUser["xid"].ToString()) + " (Administrator)<br/>"; * else if (drUser["remote"].ToString() == "1") * strAccounts += oUser.GetFullName(drUser["xid"].ToString()) + " (Remote Access)<br/>"; * } * int intClass = Int32.Parse(oForecast.GetAnswer(intAnswer, "classid")); * if (oClass.IsProd(intClass)) * strCC = oVariable.NotifyWorkstationProd(); * if (intLogging > 0) * oLog.WriteEntry(String.Format("Attempting to send email for " + strName), EventLogEntryType.Information); * if (strAccounts == "") * strAccounts = "Accounts were not requested at this time. To obtain access to this workstation, please fill out a LAN Access Form"; * string strKnowledge = "http://knova.ntl-city.com/selfservice/documentLink.do?externalID=KN10319"; * if (strKnowledge != "") * { * strEMailIdsBCC = oFunction.GetGetEmailAlertsEmailIds("EMAILGRP_PROVISIONING_ALERT,EMAILGRP_WORKSTATION"); * oFunction.SendEmail("Virtual Workstation Notification: " + strName, strEmail, strCC, strEMailIdsBCC, "Virtual Workstation Notification: " + strName, "<p><b>This message is to inform you that the workstation " + strName + " has been auto-provisioned successfully!</b><p><p>This workstation was created on host <b>" + strHost + "</b>.</p><p>As requested, the following users have been granted rights to this workstation:<br/>" + strAccounts + "</p><p>If you are having problems connecting to your virtual workstation, <a href=\"" + strKnowledge + "\" target=\"_blank\"/>please click here</a> to view a helpful knowledge base article published by the support team.</p><p><b>NOTE:</b> This is automated email sent from the ClearView Auto-Provisioning tool. Please do not respond to this message.</p><p>If you would like to learn more about this process, <a href=\"" + oVariable.URL() + "/info.htm\" target=\"_blank\"/>please click here</a>.</p>", true, false); * } * else * { * strEMailIdsBCC = oFunction.GetGetEmailAlertsEmailIds("EMAILGRP_PROVISIONING_ALERT"); * oFunction.SendEmail("Virtual Workstation Notification: " + strName, strEmail, strCC, strEMailIdsBCC, "Virtual Workstation Notification: " + strName, "<p><b>This message is to inform you that the workstation " + strName + " has been auto-provisioned successfully!</b><p><p>This workstation was created on host <b>" + strHost + "</b>.</p><p>As requested, the following users have been granted rights to this workstation:<br/>" + strAccounts + "</p><p><b>NOTE:</b> This is automated email sent from the ClearView Auto-Provisioning tool. Please do not respond to this message.</p><p>If you would like to learn more about this process, <a href=\"" + oVariable.URL() + "/info.htm\" target=\"_blank\"/>please click here</a>.</p>", true, false); * } * if (intLogging > 0) * oLog.WriteEntry(String.Format("Deleting remote workstation ID " + dr["id"].ToString()), EventLogEntryType.Information); * SqlHelper.ExecuteNonQuery(dsnRemote, CommandType.Text, "UPDATE cv_virtual_workstations SET deleted = 1 WHERE id = " + dr["id"].ToString() + " AND deleted = 0"); * } * } */ } catch (Exception ex) { string strError = "Zeus Service: " + "(Error Message: " + ex.Message + ") ~ (Source: " + ex.Source + ") (Stack Trace: " + ex.StackTrace + ") [" + System.Environment.UserName + "]"; oLog.WriteEntry(strError, EventLogEntryType.Error); SystemError(strError); oLog.WriteEntry(String.Format(ex.Message), EventLogEntryType.Error); } }