protected void Page_Load(object sender, EventArgs e) { if (Request.Cookies["adminid"] != null && Request.Cookies["adminid"].Value != "") { intProfile = Int32.Parse(Request.Cookies["adminid"].Value); } else { Reload(); } oModel = new Models(intProfile, dsn); oClass = new Classes(intProfile, dsn); oEnvironment = new Environments(intProfile, dsn); if (Request.QueryString["save"] != null && Request.QueryString["save"] != "") { Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "save", "<script type=\"text/javascript\">alert('Record Added Successfully');<" + "/" + "script>"); } if (Request.QueryString["delete"] != null && Request.QueryString["delete"] != "") { Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "delete", "<script type=\"text/javascript\">alert('Record Deleted Successfully');<" + "/" + "script>"); } if (Request.QueryString["modelid"] != null && Request.QueryString["modelid"] != "") { intModel = Int32.Parse(Request.QueryString["modelid"]); } if (Request.QueryString["classid"] != null && Request.QueryString["classid"] != "") { intClass = Int32.Parse(Request.QueryString["classid"]); } if (Request.QueryString["environmentid"] != null && Request.QueryString["environmentid"] != "") { intEnv = Int32.Parse(Request.QueryString["environmentid"]); } if (intModel > 0 && intClass > 0 && intEnv > 0) { DataSet ds = oModel.GetReservation(intModel, intClass, intEnv); if (ds.Tables[0].Rows.Count > 0) { intParent = Int32.Parse(ds.Tables[0].Rows[0]["id"].ToString()); } if (!IsPostBack) { lblName.Text = oModel.Get(intModel, "name"); lblClass.Text = oClass.Get(intClass, "name"); lblEnvironment.Text = oEnvironment.Get(intEnv, "name"); LoadLists(); } btnClose.Attributes.Add("onclick", "return HidePanel();"); btnRemove.Attributes.Add("onclick", "return confirm('Are you sure you want to remove this item?');"); ddlClass.Attributes.Add("onchange", "PopulateEnvironments('" + ddlClass.ClientID + "','" + ddlEnvironment.ClientID + "',0);"); ddlEnvironment.Attributes.Add("onchange", "UpdateDropDownHidden('" + ddlEnvironment.ClientID + "','" + hdnEnvironment.ClientID + "');"); } }
private void LoadLists() { Classes oClass = new Classes(intProfile, dsn); ddlClass.DataValueField = "id"; ddlClass.DataTextField = "name"; ddlClass.DataSource = oClass.Gets(1); ddlClass.DataBind(); ddlClass.Items.Insert(0, new ListItem("-- SELECT --", "0")); int intClass = 0; if (Request.QueryString["cid"] != null && Request.QueryString["cid"] != "") { intClass = Int32.Parse(Request.QueryString["cid"]); } if (oClass.Get(intClass).Tables[0].Rows.Count > 0) { ddlClass.SelectedValue = intClass.ToString(); ddlEnvironment.Enabled = true; Environments oEnvironment = new Environments(intProfile, dsn); ddlEnvironment.DataValueField = "id"; ddlEnvironment.DataTextField = "name"; ddlEnvironment.DataSource = oClass.GetEnvironment(intClass, 1); ddlEnvironment.DataBind(); ddlEnvironment.Items.Insert(0, new ListItem("-- SELECT --", "0")); int intEnvironment = 0; if (Request.QueryString["eid"] != null && Request.QueryString["eid"] != "") { intEnvironment = Int32.Parse(Request.QueryString["eid"]); } if (oEnvironment.Get(intEnvironment).Tables[0].Rows.Count > 0) { ddlEnvironment.SelectedValue = intEnvironment.ToString(); } } else { ddlEnvironment.Enabled = false; ddlEnvironment.Items.Insert(0, new ListItem("-- Please select a Class --", "0")); } }
private void LoadDetails() { StringBuilder sb = new StringBuilder(strDetails); DataSet ds = oCustomized.GetStorage3rd(intRequest, intItem, intNumber); if (ds.Tables[0].Rows.Count > 0) { int intUser = oRequest.GetUser(intRequest); sb.Append("<tr><td colspan=\"2\">Name of Requestor:</td></tr>"); sb.Append("<tr><td><img src=\"/images/spacer.gif\" border=\"0\" width=\"30\" height=\"1\" /></td><td width=\"100%\">"); sb.Append(oUser.GetFullName(intUser)); sb.Append(" ("); sb.Append(oUser.GetName(intUser)); sb.Append(")"); sb.Append("</td></tr>"); sb.Append("<tr><td colspan=\"2\">Statement of Work:</td></tr>"); sb.Append("<tr><td><img src=\"/images/spacer.gif\" border=\"0\" width=\"30\" height=\"1\" /></td><td width=\"100%\">"); sb.Append(ds.Tables[0].Rows[0]["description"].ToString()); sb.Append("</td></tr>"); sb.Append("<tr><td colspan=\"2\">Server Name:</td></tr>"); sb.Append("<tr><td><img src=\"/images/spacer.gif\" border=\"0\" width=\"30\" height=\"1\" /></td><td width=\"100%\">"); sb.Append(ds.Tables[0].Rows[0]["servername"].ToString()); sb.Append("</td></tr>"); sb.Append("<tr><td colspan=\"2\">Is this device already SAN Connected:</td></tr>"); sb.Append("<tr><td><img src=\"/images/spacer.gif\" border=\"0\" width=\"30\" height=\"1\" /></td><td width=\"100%\">"); sb.Append(ds.Tables[0].Rows[0]["currently"].ToString()); sb.Append("</td></tr>"); sb.Append("<tr><td colspan=\"2\">What type of device is this:</td></tr>"); sb.Append("<tr><td><img src=\"/images/spacer.gif\" border=\"0\" width=\"30\" height=\"1\" /></td><td width=\"100%\">"); sb.Append(ds.Tables[0].Rows[0]["type"].ToString()); sb.Append("</td></tr>"); sb.Append("<tr><td colspan=\"2\">What class is this device in:</td></tr>"); sb.Append("<tr><td><img src=\"/images/spacer.gif\" border=\"0\" width=\"30\" height=\"1\" /></td><td width=\"100%\">"); sb.Append(oClass.Get(Int32.Parse(ds.Tables[0].Rows[0]["classid"].ToString()), "name")); sb.Append("</td></tr>"); sb.Append("<tr><td colspan=\"2\">What environment is this device in:</td></tr>"); sb.Append("<tr><td><img src=\"/images/spacer.gif\" border=\"0\" width=\"30\" height=\"1\" /></td><td width=\"100%\">"); sb.Append(oEnvironment.Get(Int32.Parse(ds.Tables[0].Rows[0]["environmentid"].ToString()), "name")); sb.Append("</td></tr>"); sb.Append("<tr><td colspan=\"2\">What location is this device in:</td></tr>"); sb.Append("<tr><td><img src=\"/images/spacer.gif\" border=\"0\" width=\"30\" height=\"1\" /></td><td width=\"100%\">"); sb.Append(oLocation.GetFull(Int32.Parse(ds.Tables[0].Rows[0]["addressid"].ToString()))); sb.Append("</td></tr>"); sb.Append("<tr><td colspan=\"2\">What fabric is the device on:</td></tr>"); sb.Append("<tr><td><img src=\"/images/spacer.gif\" border=\"0\" width=\"30\" height=\"1\" /></td><td width=\"100%\">"); sb.Append(ds.Tables[0].Rows[0]["fabric"].ToString()); sb.Append("</td></tr>"); sb.Append("<tr><td colspan=\"2\">Is this device being replicated:</td></tr>"); sb.Append("<tr><td><img src=\"/images/spacer.gif\" border=\"0\" width=\"30\" height=\"1\" /></td><td width=\"100%\">"); sb.Append(ds.Tables[0].Rows[0]["replicated"].ToString()); sb.Append("</td></tr>"); sb.Append("<tr><td colspan=\"2\">Please select a type of storage:</td></tr>"); sb.Append("<tr><td><img src=\"/images/spacer.gif\" border=\"0\" width=\"30\" height=\"1\" /></td><td width=\"100%\">"); sb.Append(ds.Tables[0].Rows[0]["shared"].ToString()); sb.Append("</td></tr>"); sb.Append("<tr><td colspan=\"2\">Do you want to expand a LUN or add an additional LUN:</td></tr>"); sb.Append("<tr><td><img src=\"/images/spacer.gif\" border=\"0\" width=\"30\" height=\"1\" /></td><td width=\"100%\">"); sb.Append(ds.Tables[0].Rows[0]["expand"].ToString()); sb.Append("</td></tr>"); sb.Append("<tr><td colspan=\"2\">Additional Total Capacity Needed (in GB):</td></tr>"); sb.Append("<tr><td><img src=\"/images/spacer.gif\" border=\"0\" width=\"30\" height=\"1\" /></td><td width=\"100%\">"); sb.Append(double.Parse(ds.Tables[0].Rows[0]["amount"].ToString()).ToString("F")); sb.Append("</td></tr>"); char[] strSplit = { ',' }; string[] strLUNs = ds.Tables[0].Rows[0]["luns"].ToString().Split(strSplit); string strLUN = ""; for (int ii = 0; ii < strLUNs.Length; ii++) { if (strLUNs[ii].Trim() != "") { strLUN += strLUNs[ii].Trim() + "<br/>"; } } sb.Append("<tr><td colspan=\"2\">Please enter the LUN drive and UID, followed by the amount of storage you want to have added to that LUN (additional capacity only) (in GB):</td></tr>"); sb.Append("<tr><td><img src=\"/images/spacer.gif\" border=\"0\" width=\"30\" height=\"1\" /></td><td width=\"100%\">"); sb.Append(strLUN); sb.Append("</td></tr>"); sb.Append("<tr><td colspan=\"2\">Enter the World Wide Port names:</td></tr>"); sb.Append("<tr><td><img src=\"/images/spacer.gif\" border=\"0\" width=\"30\" height=\"1\" /></td><td width=\"100%\">"); sb.Append(ds.Tables[0].Rows[0]["www"].ToString()); sb.Append("</td></tr>"); sb.Append("<tr><td colspan=\"2\">UID:</td></tr>"); sb.Append("<tr><td><img src=\"/images/spacer.gif\" border=\"0\" width=\"30\" height=\"1\" /></td><td width=\"100%\">"); sb.Append(ds.Tables[0].Rows[0]["uid"].ToString()); sb.Append("</td></tr>"); sb.Append("<tr><td colspan=\"2\">Select the Storage Performance Tier:</td></tr>"); sb.Append("<tr><td><img src=\"/images/spacer.gif\" border=\"0\" width=\"30\" height=\"1\" /></td><td width=\"100%\">"); sb.Append(ds.Tables[0].Rows[0]["performance"].ToString()); sb.Append("</td></tr>"); sb.Append("<tr><td colspan=\"2\">Clustered NODE Server Names:</td></tr>"); sb.Append("<tr><td><img src=\"/images/spacer.gif\" border=\"0\" width=\"30\" height=\"1\" /></td><td width=\"100%\">"); sb.Append(ds.Tables[0].Rows[0]["node"].ToString()); sb.Append("</td></tr>"); sb.Append("<tr><td colspan=\"2\">Enclosure Name (if blade):</td></tr>"); sb.Append("<tr><td><img src=\"/images/spacer.gif\" border=\"0\" width=\"30\" height=\"1\" /></td><td width=\"100%\">"); sb.Append(ds.Tables[0].Rows[0]["encname"].ToString()); sb.Append("</td></tr>"); sb.Append("<tr><td colspan=\"2\">Enclosure Slot (if blade):</td></tr>"); sb.Append("<tr><td><img src=\"/images/spacer.gif\" border=\"0\" width=\"30\" height=\"1\" /></td><td width=\"100%\">"); sb.Append(ds.Tables[0].Rows[0]["encslot"].ToString()); sb.Append("</td></tr>"); sb.Append("<tr><td colspan=\"2\">Server name of DR device (if replicated):</td></tr>"); sb.Append("<tr><td><img src=\"/images/spacer.gif\" border=\"0\" width=\"30\" height=\"1\" /></td><td width=\"100%\">"); sb.Append(ds.Tables[0].Rows[0]["repservername"].ToString()); sb.Append("</td></tr>"); sb.Append("<tr><td colspan=\"2\">World Wide Port names of the DR device (if replicated):</td></tr>"); sb.Append("<tr><td><img src=\"/images/spacer.gif\" border=\"0\" width=\"30\" height=\"1\" /></td><td width=\"100%\">"); sb.Append(ds.Tables[0].Rows[0]["repwww"].ToString()); sb.Append("</td></tr>"); sb.Append("<tr><td colspan=\"2\">Enclosure Name (if blade and replicated):</td></tr>"); sb.Append("<tr><td><img src=\"/images/spacer.gif\" border=\"0\" width=\"30\" height=\"1\" /></td><td width=\"100%\">"); sb.Append(ds.Tables[0].Rows[0]["repencname"].ToString()); sb.Append("</td></tr>"); sb.Append("<tr><td colspan=\"2\">Enclosure Slot (if blade and replicated):</td></tr>"); sb.Append("<tr><td><img src=\"/images/spacer.gif\" border=\"0\" width=\"30\" height=\"1\" /></td><td width=\"100%\">"); sb.Append(ds.Tables[0].Rows[0]["repencslot"].ToString()); sb.Append("</td></tr>"); txtAmount.Text = double.Parse(ds.Tables[0].Rows[0]["allocated"].ToString()).ToString("F"); lblMidrange.Text = ds.Tables[0].Rows[0]["midrange"].ToString(); } if (sb.ToString() != "") { sb.Insert(0, "<table width=\"100%\" border=\"0\" cellSpacing=\"2\" cellPadding=\"4\" class=\"default\">"); sb.Append("</table>"); } strDetails = sb.ToString(); }
protected void Page_Load(object sender, EventArgs e) { AuthenticateUser(); intProfile = Int32.Parse(Request.Cookies["profileid"].Value); oAsset = new Asset(intProfile, dsnAsset); oModelsProperties = new ModelsProperties(intProfile, dsn); oLocation = new Locations(intProfile, dsn); oClass = new Classes(intProfile, dsn); oEnvironment = new Environments(intProfile, dsn); if (Request.QueryString["model"] != null && Request.QueryString["model"] != "" && Request.QueryString["status"] != null && Request.QueryString["status"] != "") { StringBuilder sb = new StringBuilder(strResults); intModel = Int32.Parse(Request.QueryString["model"]); intStatus = Int32.Parse(Request.QueryString["status"]); lblModel.Text = oModelsProperties.Get(intModel, "name"); DataSet ds = oAsset.GetServerOrBlades(intModel, intStatus); int intLocation = 0; int intClass = 0; int intEnv = 0; int intCount = 0; bool boolOther = false; foreach (DataRow dr in ds.Tables[0].Rows) { if (intLocation > 0 && intClass > 0 && intEnv > 0) { if (intLocation != Int32.Parse(dr["addressid"].ToString()) || intClass != Int32.Parse(dr["classid"].ToString()) || intEnv != Int32.Parse(dr["environmentid"].ToString())) { boolOther = !boolOther; sb.Append("<tr"); sb.Append(boolOther ? " bgcolor=\"F6F6F6\"" : ""); sb.Append("><td>"); sb.Append(oClass.Get(intClass, "name")); sb.Append("</td><td>"); sb.Append(oEnvironment.Get(intEnv, "name")); sb.Append("</td><td>"); sb.Append(oLocation.GetFull(intLocation)); sb.Append("</td><td align=\"right\">"); sb.Append(intCount.ToString()); sb.Append("</td></tr>"); intCount = 0; } } intCount++; intLocation = Int32.Parse(dr["addressid"].ToString()); intClass = Int32.Parse(dr["classid"].ToString()); intEnv = Int32.Parse(dr["environmentid"].ToString()); } boolOther = !boolOther; if (intLocation > 0 && intClass > 0 && intEnv > 0) { sb.Append("<tr"); sb.Append(boolOther ? " bgcolor=\"F6F6F6\"" : ""); sb.Append("><td>"); sb.Append(oClass.Get(intClass, "name")); sb.Append("</td><td>"); sb.Append(oEnvironment.Get(intEnv, "name")); sb.Append("</td><td>"); sb.Append(oLocation.GetFull(intLocation)); sb.Append("</td><td align=\"right\">"); sb.Append(intCount.ToString()); sb.Append("</td></tr>"); } strResults = sb.ToString(); } }
private void LoadSearch(int _search) { lblTitle.Text = "Search Results"; ds = oAsset.GetSearch(_search); if (ds.Tables[0].Rows.Count > 0) { panResult.Visible = true; lblSearch.Text = _search.ToString(); string strSort = ""; if (Request.QueryString["sort"] != null && Request.QueryString["sort"] != "") { strSort = "&sort=" + Request.QueryString["sort"]; } btnPrint.Attributes.Add("onclick", "return OpenWindow('NEW_WINDOW','/frame/print_asset_search.aspx?sid=" + _search.ToString() + strSort + "');"); if (ds.Tables[0].Rows[0]["userid"].ToString() == intProfile.ToString()) { string strSearch = ds.Tables[0].Rows[0]["type"].ToString(); switch (strSearch) { case "1": if (ds.Tables[0].Rows[0]["name"].ToString().Trim() != "") { lblResults.Text = "Device Name LIKE "" + ds.Tables[0].Rows[0]["name"].ToString().Trim() + """; } if (ds.Tables[0].Rows[0]["serial"].ToString().Trim() != "") { if (lblResults.Text != "") { lblResults.Text += " AND "; } lblResults.Text = "Serial Number LIKE "" + ds.Tables[0].Rows[0]["serial"].ToString().Trim() + """; } if (ds.Tables[0].Rows[0]["asset"].ToString().Trim() != "") { if (lblResults.Text != "") { lblResults.Text += " AND "; } lblResults.Text = "Asset Tag LIKE "" + ds.Tables[0].Rows[0]["asset"].ToString().Trim() + """; } break; case "2": if (ds.Tables[0].Rows[0]["classid"].ToString().Trim() != "0") { lblResults.Text = "Class = "" + oClasses.Get(Int32.Parse(ds.Tables[0].Rows[0]["classid"].ToString().Trim()), "name") + """; } if (ds.Tables[0].Rows[0]["environmentid"].ToString().Trim() != "0") { if (lblResults.Text != "") { lblResults.Text += " AND "; } lblResults.Text += "Environment = "" + oEnvironment.Get(Int32.Parse(ds.Tables[0].Rows[0]["environmentid"].ToString().Trim()), "name") + """; } break; case "3": string strPlatform = ds.Tables[0].Rows[0]["platformid"].ToString().Trim(); if (strPlatform != "" && strPlatform != "0") { lblResults.Text = "Platform = "" + oPlatform.GetName(Int32.Parse(strPlatform)) + """; } string strType = ds.Tables[0].Rows[0]["typeid"].ToString().Trim(); if (strType != "" && strType != "0") { if (lblResults.Text != "") { lblResults.Text += " AND "; } lblResults.Text += "Asset Type = "" + oType.Get(Int32.Parse(strType), "name") + """; } string strModel = ds.Tables[0].Rows[0]["modelid"].ToString().Trim(); if (strModel != "" && strModel != "0") { if (lblResults.Text != "") { lblResults.Text += " AND "; } lblResults.Text += "Model = "" + oModel.Get(Int32.Parse(strModel), "name") + """; } break; case "4": string strDepot = ds.Tables[0].Rows[0]["depotid"].ToString().Trim(); if (strDepot != "" && strDepot != "0") { if (lblResults.Text != "") { lblResults.Text += " AND "; } lblResults.Text += "Depot = "" + oDepot.Get(Int32.Parse(strDepot), "name") + """; } break; } ds = oAsset.GetSearchResults(_search); lblPage.Text = "1"; lblSort.Text = ""; if (Request.QueryString["page"] != null && Request.QueryString["page"] != "") { lblPage.Text = Request.QueryString["page"]; } if (Request.QueryString["sort"] != null && Request.QueryString["sort"] != "") { lblSort.Text = Request.QueryString["sort"]; } lblTopPaging.Text = ""; LoadPaging(Int32.Parse(lblPage.Text), lblSort.Text); } else { panDenied.Visible = true; } } else { panDenied.Visible = true; } }
protected void Page_Load(object sender, EventArgs e) { intProfile = Int32.Parse(Request.Cookies["profileid"].Value); oForecast = new Forecast(intProfile, dsn); oServerName = new ServerName(intProfile, dsn); oServer = new Servers(intProfile, dsn); oPage = new Pages(intProfile, dsn); oOperatingSystem = new OperatingSystems(intProfile, dsn); if (Request.QueryString["pageid"] != null && Request.QueryString["pageid"] != "") { intPage = Int32.Parse(Request.QueryString["pageid"]); } if (Request.QueryString["action"] != null && Request.QueryString["action"] != "") { panFinish.Visible = true; } else { if (Request.QueryString["applicationid"] != null && Request.QueryString["applicationid"] != "") { intApplication = Int32.Parse(Request.QueryString["applicationid"]); } if (Request.Cookies["application"] != null && Request.Cookies["application"].Value != "") { intApplication = Int32.Parse(Request.Cookies["application"].Value); } if (Request.QueryString["id"] != null && Request.QueryString["id"] != "") { intAnswer = Int32.Parse(Request.QueryString["id"]); } if (!IsPostBack) { if (intAnswer > 0) { DataSet ds = oForecast.GetAnswer(intAnswer); if (ds.Tables[0].Rows.Count > 0) { Projects oProject = new Projects(intProfile, dsn); Requests oRequest = new Requests(intProfile, dsn); Organizations oOrganization = new Organizations(intProfile, dsn); Segment oSegment = new Segment(intProfile, dsn); Platforms oPlatform = new Platforms(intProfile, dsn); ModelsProperties oModelsProperties = new ModelsProperties(intProfile, dsn); Confidence oConfidence = new Confidence(intProfile, dsn); Classes oClass = new Classes(intProfile, dsn); Environments oEnvironment = new Environments(intProfile, dsn); Locations oLocation = new Locations(intProfile, dsn); Users oUser = new Users(intProfile, dsn); lblID.Text = intAnswer.ToString(); int intForecast = Int32.Parse(ds.Tables[0].Rows[0]["forecastid"].ToString()); int intRequest = Int32.Parse(oForecast.Get(intForecast, "requestid")); int intProject = oRequest.GetProjectNumber(intRequest); lblName.Text = oProject.Get(intProject, "name"); lblNumber.Text = oProject.Get(intProject, "number"); lblPortfolio.Text = oOrganization.GetName(Int32.Parse(oProject.Get(intProject, "organization"))); lblSegment.Text = oSegment.GetName(Int32.Parse(oProject.Get(intProject, "segmentid"))); lblPlatform.Text = oPlatform.GetName(Int32.Parse(ds.Tables[0].Rows[0]["platformid"].ToString())); lblNickname.Text = ds.Tables[0].Rows[0]["name"].ToString(); int intModel = Int32.Parse(ds.Tables[0].Rows[0]["modelid"].ToString()); if (intModel == 0) { intModel = oForecast.GetModelAsset(intAnswer); } if (intModel == 0) { intModel = oForecast.GetModel(intAnswer); } lblModel.Text = oModelsProperties.Get(intModel, "name"); lblCommitment.Text = DateTime.Parse(ds.Tables[0].Rows[0]["implementation"].ToString()).ToLongDateString(); lblQuantity.Text = ds.Tables[0].Rows[0]["quantity"].ToString(); lblConfidence.Text = oConfidence.Get(Int32.Parse(ds.Tables[0].Rows[0]["confidenceid"].ToString()), "name"); int intClass = Int32.Parse(ds.Tables[0].Rows[0]["classid"].ToString()); lblClass.Text = oClass.Get(intClass, "name"); if (oClass.IsProd(intClass)) { panTest.Visible = true; lblTest.Text = (ds.Tables[0].Rows[0]["test"].ToString() == "1" ? "Yes" : "No"); } lblEnvironment.Text = oEnvironment.Get(Int32.Parse(ds.Tables[0].Rows[0]["environmentid"].ToString()), "name"); lblLocation.Text = oLocation.GetFull(Int32.Parse(ds.Tables[0].Rows[0]["addressid"].ToString())); lblIP.Text = ds.Tables[0].Rows[0]["workstation"].ToString(); lblDesignedBy.Text = oUser.GetFullName(Int32.Parse(ds.Tables[0].Rows[0]["userid"].ToString())); lblRequestor.Text = ds.Tables[0].Rows[0]["userid"].ToString(); lblDesignedOn.Text = DateTime.Parse(ds.Tables[0].Rows[0]["created"].ToString()).ToString(); lblUpdated.Text = DateTime.Parse(ds.Tables[0].Rows[0]["modified"].ToString()).ToString(); panShow.Visible = true; btnSave.Enabled = true; // Load Components rptApproval.DataSource = oServerName.GetComponentDetailUserApprovalsByUser(intProfile, intAnswer, 0); rptApproval.DataBind(); foreach (RepeaterItem ri in rptApproval.Items) { int intServer = Int32.Parse(((Label)ri.FindControl("lblServer")).Text); int intDetail = Int32.Parse(((Label)ri.FindControl("lblDetail")).Text); RadioButton radApprove = (RadioButton)ri.FindControl("radApprove"); RadioButton radDeny = (RadioButton)ri.FindControl("radDeny"); HtmlTableRow trLicense = (HtmlTableRow)ri.FindControl("trLicense"); HtmlTableRow trComments = (HtmlTableRow)ri.FindControl("trComments"); TextBox txtLicense = (TextBox)ri.FindControl("txtLicense"); TextBox txtComments = (TextBox)ri.FindControl("txtComments"); Label lblOS = (Label)ri.FindControl("lblOS"); int intOS = 0; Int32.TryParse(oServer.Get(intServer, "osid"), out intOS); lblOS.Text = oOperatingSystem.Get(intOS, "name"); radApprove.Attributes.Add("onclick", "ShowHideDiv('" + trLicense.ClientID + "','inline');ShowHideDiv('" + trComments.ClientID + "','inline');"); radDeny.Attributes.Add("onclick", "ShowHideDiv('" + trLicense.ClientID + "','none');ShowHideDiv('" + trComments.ClientID + "','inline');"); DataSet dsResult = oServerName.GetComponentDetailUserApprovals(intServer, intDetail); if (dsResult.Tables[0].Rows.Count > 0) { // Load previous information DataRow drResult = dsResult.Tables[0].Rows[0]; if (drResult["approved"].ToString() == "1") { radApprove.Checked = true; txtLicense.Text = drResult["license"].ToString(); trLicense.Style["display"] = "inline"; txtComments.Text = drResult["comments"].ToString(); trComments.Style["display"] = "inline"; } if (drResult["approved"].ToString() == "0") { radDeny.Checked = true; txtComments.Text = drResult["comments"].ToString(); trComments.Style["display"] = "inline"; } } } } } } } }
private void LoadSearch(int _search) { Asset oAsset = new Asset(intProfile, dsnAsset); Classes oClasses = new Classes(intProfile, dsn); Environments oEnvironment = new Environments(intProfile, dsn); Platforms oPlatform = new Platforms(intProfile, dsn); Types oType = new Types(intProfile, dsn); Models oModel = new Models(intProfile, dsn); Depot oDepot = new Depot(intProfile, dsn); DataSet ds = oAsset.GetSearch(_search); if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["userid"].ToString() == intProfile.ToString()) { string strSearch = ds.Tables[0].Rows[0]["type"].ToString(); switch (strSearch) { case "N": if (ds.Tables[0].Rows[0]["name"].ToString().Trim() != "") { lblResults.Text = "Device Name LIKE "" + ds.Tables[0].Rows[0]["name"].ToString().Trim() + """; } if (ds.Tables[0].Rows[0]["serial"].ToString().Trim() != "") { if (lblResults.Text != "") { lblResults.Text += " AND "; } lblResults.Text = "Serial Number LIKE "" + ds.Tables[0].Rows[0]["serial"].ToString().Trim() + """; } if (ds.Tables[0].Rows[0]["asset"].ToString().Trim() != "") { if (lblResults.Text != "") { lblResults.Text += " AND "; } lblResults.Text = "Asset Tag LIKE "" + ds.Tables[0].Rows[0]["asset"].ToString().Trim() + """; } break; case "C": if (ds.Tables[0].Rows[0]["classid"].ToString().Trim() != "0") { lblResults.Text = "Class = "" + oClasses.Get(Int32.Parse(ds.Tables[0].Rows[0]["classid"].ToString().Trim()), "name") + """; } if (ds.Tables[0].Rows[0]["environmentid"].ToString().Trim() != "0") { if (lblResults.Text != "") { lblResults.Text += " AND "; } lblResults.Text += "Environment = "" + oEnvironment.Get(Int32.Parse(ds.Tables[0].Rows[0]["environmentid"].ToString().Trim()), "name") + """; } break; case "T": string strPlatform = ds.Tables[0].Rows[0]["platformid"].ToString().Trim(); if (strPlatform != "" && strPlatform != "0") { lblResults.Text = "Platform = "" + oPlatform.GetName(Int32.Parse(strPlatform)) + """; } string strType = ds.Tables[0].Rows[0]["typeid"].ToString().Trim(); if (strType != "" && strType != "0") { if (lblResults.Text != "") { lblResults.Text += " AND "; } lblResults.Text += "Asset Type = "" + oType.Get(Int32.Parse(strType), "name") + """; } string strModel = ds.Tables[0].Rows[0]["modelid"].ToString().Trim(); if (strModel != "" && strModel != "0") { if (lblResults.Text != "") { lblResults.Text += " AND "; } lblResults.Text += "Model = "" + oModel.Get(Int32.Parse(strModel), "name") + """; } break; case "D": string strDepot = ds.Tables[0].Rows[0]["depotid"].ToString().Trim(); if (strDepot != "" && strDepot != "0") { if (lblResults.Text != "") { lblResults.Text += " AND "; } lblResults.Text += "Depot = "" + oDepot.Get(Int32.Parse(strDepot), "name") + """; } break; } ds = oAsset.GetSearchResults(_search); DataView dv = ds.Tables[0].DefaultView; if (Request.QueryString["sort"] != null) { dv.Sort = Request.QueryString["sort"]; } rptView.DataSource = dv; rptView.DataBind(); lblNone.Visible = (rptView.Items.Count == 0); } } }
private void LoadLists() { ddlLocation.Enabled = true; ddlLocation.DataValueField = "id"; ddlLocation.DataTextField = "name"; ddlLocation.DataSource = oLocation.GetAddressCommon(); ddlLocation.DataBind(); ddlLocation.Items.Add(new ListItem("-- NOT LISTED --", "-1")); ddlLocation.Items.Insert(0, new ListItem("-- SELECT --", "0")); int intAddress = 0; if (Request.QueryString["aid"] != null && Request.QueryString["aid"] != "") { intAddress = Int32.Parse(Request.QueryString["aid"]); } if (oLocation.GetAddress(intAddress).Tables[0].Rows.Count > 0) { ddlLocation.SelectedValue = intAddress.ToString(); hdnParent.Value = intAddress.ToString(); if (ddlLocation.SelectedItem.Value == "0") { ddlLocation.SelectedValue = "-1"; panLocation.Visible = true; txtParent.Text = oLocation.GetFull(intAddress); } ddlOS.Enabled = true; ddlOS.DataValueField = "id"; ddlOS.DataTextField = "name"; ddlOS.DataSource = oOperatingSystems.Gets(0, 1); ddlOS.DataBind(); ddlOS.Items.Insert(0, new ListItem("-- SELECT --", "0")); int intOS = 0; if (Request.QueryString["osid"] != null && Request.QueryString["osid"] != "") { intOS = Int32.Parse(Request.QueryString["osid"]); } if (oOperatingSystems.Get(intOS).Tables[0].Rows.Count > 0) { ddlOS.SelectedValue = intOS.ToString(); ddlSP.Enabled = true; ddlSP.DataValueField = "id"; ddlSP.DataTextField = "name"; ddlSP.DataSource = oOperatingSystems.GetServicePack(intOS); ddlSP.DataBind(); ddlSP.Items.Insert(0, new ListItem("-- SELECT --", "0")); int intSP = 0; if (Request.QueryString["spid"] != null && Request.QueryString["spid"] != "") { intSP = Int32.Parse(Request.QueryString["spid"]); } if (oServicePacks.Get(intSP).Tables[0].Rows.Count > 0) { ddlSP.SelectedValue = intSP.ToString(); ddlClass.Enabled = true; ddlClass.DataValueField = "id"; ddlClass.DataTextField = "name"; ddlClass.DataSource = oServerName.GetCodeClasses(intAddress); ddlClass.DataBind(); lblConfig.Visible = (ddlClass.Items.Count == 0); ddlClass.Items.Insert(0, new ListItem("-- SELECT --", "0")); int intClass = 0; if (Request.QueryString["cid"] != null && Request.QueryString["cid"] != "") { intClass = Int32.Parse(Request.QueryString["cid"]); } if (oClass.Get(intClass).Tables[0].Rows.Count > 0) { ddlClass.SelectedValue = intClass.ToString(); ddlEnvironment.Enabled = true; Environments oEnvironment = new Environments(intProfile, dsn); ddlEnvironment.DataValueField = "id"; ddlEnvironment.DataTextField = "name"; ddlEnvironment.DataSource = oServerName.GetCodeEnvironments(intAddress, intClass); ddlEnvironment.DataBind(); lblConfig.Visible = (lblConfig.Visible || ddlEnvironment.Items.Count == 0); ddlEnvironment.Items.Insert(0, new ListItem("-- SELECT --", "0")); int intEnv = 0; if (Request.QueryString["eid"] != null && Request.QueryString["eid"] != "") { intEnv = Int32.Parse(Request.QueryString["eid"]); } if (oEnvironment.Get(intEnv).Tables[0].Rows.Count > 0) { ddlEnvironment.SelectedValue = intEnv.ToString(); // Load Models trModels.Visible = true; LoadTypes(oTreeModels); int intModel = 0; if (Request.QueryString["mid"] != null && Request.QueryString["mid"] != "") { intModel = Int32.Parse(Request.QueryString["mid"]); } if (oModelsProperties.Get(intModel).Tables[0].Rows.Count > 0) { lblModel.Text = oModelsProperties.Get(intModel, "name"); ExpandTreeview(oTreeModels, intModel.ToString(), true); // Load Applications ddlApplication.DataValueField = "id"; ddlApplication.DataTextField = "name"; ddlApplication.DataSource = oServerName.GetApplicationPermissionsOS(intOS); ddlApplication.DataBind(); ddlApplication.Items.Insert(0, new ListItem("-- NONE --", "0")); // Load Components panComponents.Visible = true; frmComponents.Attributes.Add("src", "/frame/ondemand/config_server_components.aspx?cid=" + intClass.ToString() + "&eid=" + intEnv.ToString() + "&mid=" + intModel.ToString() + "&osid=" + intOS.ToString() + "&spid=" + intSP.ToString()); // Load Clustering ddlCluster.Items.Add(new ListItem("-- SELECT --", "0")); ddlCluster.Items.Add(new ListItem("Node of a Cluster (Example: NSQ)", "1")); if (oOperatingSystems.Get(intOS, "cluster_name") == "1") { ddlCluster.Items.Add(new ListItem("Cluster Name (Example: CLU)", "2")); } ddlCluster.Items.Add(new ListItem("Cluster Instance Name (Example: CSQ)", "3")); ddlCluster.Items.Add(new ListItem("None of the Above", "4")); btnSubmit.Enabled = true; } else { lblModel.Text = "<i>Please select a Model</i>"; ddlApplication.Enabled = false; ddlApplication.Items.Insert(0, new ListItem("-- Please select a Model --", "0")); ddlCluster.Enabled = false; ddlCluster.Items.Insert(0, new ListItem("-- Please select a Model --", "0")); } } else { lblModel.Text = "<i>Please select an Environment</i>"; ddlApplication.Enabled = false; ddlApplication.Items.Insert(0, new ListItem("-- Please select an Environment --", "0")); ddlCluster.Enabled = false; ddlCluster.Items.Insert(0, new ListItem("-- Please select an Environment --", "0")); } } else { ddlEnvironment.Enabled = false; ddlEnvironment.Items.Insert(0, new ListItem("-- Please select a Class --", "0")); lblModel.Text = "<i>Please select a Class</i>"; ddlApplication.Enabled = false; ddlApplication.Items.Insert(0, new ListItem("-- Please select a Class --", "0")); ddlCluster.Enabled = false; ddlCluster.Items.Insert(0, new ListItem("-- Please select a Class --", "0")); txtName.Enabled = false; } } else { ddlClass.Enabled = false; ddlClass.Items.Insert(0, new ListItem("-- Please select a Service Pack --", "0")); ddlEnvironment.Enabled = false; ddlEnvironment.Items.Insert(0, new ListItem("-- Please select a Service Pack --", "0")); lblModel.Text = "<i>Please select a Service Pack</i>"; ddlApplication.Enabled = false; ddlApplication.Items.Insert(0, new ListItem("-- Please select a Service Pack --", "0")); ddlCluster.Enabled = false; ddlCluster.Items.Insert(0, new ListItem("-- Please select a Service Pack --", "0")); txtName.Enabled = false; } } else { ddlSP.Enabled = false; ddlSP.Items.Insert(0, new ListItem("-- Please select an Operating System --", "0")); ddlClass.Enabled = false; ddlClass.Items.Insert(0, new ListItem("-- Please select an Operating System --", "0")); ddlEnvironment.Enabled = false; ddlEnvironment.Items.Insert(0, new ListItem("-- Please select an Operating System --", "0")); lblModel.Text = "<i>Please select an Operating System</i>"; ddlApplication.Enabled = false; ddlApplication.Items.Insert(0, new ListItem("-- Please select an Operating System --", "0")); ddlCluster.Enabled = false; ddlCluster.Items.Insert(0, new ListItem("-- Please select an Operating System --", "0")); txtName.Enabled = false; } } else { ddlLocation.SelectedValue = intAddress.ToString(); if (intAddress == -1) { panLocation.Visible = true; hdnParent.Value = "0"; } ddlOS.Enabled = false; ddlOS.Items.Insert(0, new ListItem("-- Please select a Location --", "0")); ddlSP.Enabled = false; ddlSP.Items.Insert(0, new ListItem("-- Please select a Location --", "0")); ddlClass.Enabled = false; ddlClass.Items.Insert(0, new ListItem("-- Please select a Location --", "0")); ddlEnvironment.Enabled = false; ddlEnvironment.Items.Insert(0, new ListItem("-- Please select a Location --", "0")); lblModel.Text = "<i>Please select a Location</i>"; ddlApplication.Enabled = false; ddlApplication.Items.Insert(0, new ListItem("-- Please select a Location --", "0")); ddlCluster.Enabled = false; ddlCluster.Items.Insert(0, new ListItem("-- Please select a Location --", "0")); txtName.Enabled = false; } }
protected void Page_Load(object sender, EventArgs e) { intProfile = Int32.Parse(Request.Cookies["profileid"].Value); oDesign = new Design(intProfile, dsn); oPage = new Pages(intProfile, dsn); oMnemonic = new Mnemonic(intProfile, dsn); oCostCenter = new CostCenter(intProfile, dsn); oClass = new Classes(intProfile, dsn); oEnvironment = new Environments(intProfile, dsn); oLocation = new Locations(intProfile, dsn); oOperatingSystem = new OperatingSystems(intProfile, dsn); oHoliday = new Holidays(intProfile, dsn); oModelsProperties = new ModelsProperties(intProfile, dsn); oUser = new Users(intProfile, dsn); oFunction = new Functions(intProfile, dsn, intEnvironment); oForecast = new Forecast(intProfile, dsn); oRequest = new Requests(intProfile, dsn); oProject = new Projects(intProfile, dsn); //if (Request.QueryString["id"] != null && Request.QueryString["id"] != "") //intID = Int32.Parse(Request.QueryString["id"]); if (!IsPostBack) { DataSet dsSummary = oDesign.Get(this.DesignId); if (dsSummary.Tables[0].Rows.Count > 0) { int intModel = oDesign.GetModelProperty(this.DesignId); lblSummarySolution.Text = oModelsProperties.Get(intModel, "name"); DataRow drSummary = dsSummary.Tables[0].Rows[0]; bool boolWeb = (drSummary["web"].ToString() == "1"); bool boolSQL = oDesign.IsSQL(this.DesignId); bool boolOracle = oDesign.IsOracle(this.DesignId); bool boolOtherDB = (drSummary["other_db"].ToString() == "1"); DataSet dsSubmitted = oDesign.GetSubmitted(this.DesignId); if (dsSubmitted.Tables[0].Rows.Count > 0) { trSubmitted.Visible = true; int intUser = Int32.Parse(dsSubmitted.Tables[0].Rows[0]["userid"].ToString()); lblSummarySubmittedBy.Text = oUser.GetFullName(intUser) + " (" + oUser.GetName(intUser) + ")"; lblSummarySubmittedOn.Text = dsSubmitted.Tables[0].Rows[0]["created"].ToString(); if (dsSubmitted.Tables[0].Rows[0]["comments"].ToString() != "") { trException1.Visible = true; trException2.Visible = true; trException3.Visible = true; lblException.Text = oFunction.FormatText(dsSubmitted.Tables[0].Rows[0]["comments"].ToString()); lblExceptionID.Text = dsSubmitted.Tables[0].Rows[0]["exceptionID"].ToString(); } } // Project int intForecast = 0; int intRequest = 0; int intProject = 0; Int32.TryParse(drSummary["forecastid"].ToString(), out intForecast); if (intForecast > 0) { Int32.TryParse(oForecast.Get(intForecast, "requestid"), out intRequest); if (intRequest > 0) { intProject = oRequest.GetProjectNumber(intRequest); if (intProject > 0) { lblSummaryProjectName.Text = oProject.Get(intProject, "name"); string strNumber = oProject.Get(intProject, "number"); lblSummaryProjectNumber.Text = strNumber; // Check to see if Demo DataSet dsDemo = oFunction.GetSetupValuesByKey("DEMO_PROJECT"); foreach (DataRow drDemo in dsDemo.Tables[0].Rows) { if (strNumber == drDemo["Value"].ToString()) { boolDemo = true; break; } } } } } // Mnemonic int intMnemonic = 0; Int32.TryParse(drSummary["mnemonicid"].ToString(), out intMnemonic); if (intMnemonic > 0) { lblSummaryMnemonic.Text = oMnemonic.Get(intMnemonic, "factory_code") + " - " + oMnemonic.Get(intMnemonic, "name"); } // Class + Environment + Location int intClass = 0; int intEnv = 0; int intAddress = 0; Int32.TryParse(drSummary["classid"].ToString(), out intClass); if (intClass > 0) { lblSummaryLocation.Text = oClass.Get(intClass, "name") + ", "; Int32.TryParse(drSummary["environmentid"].ToString(), out intEnv); if (intEnv > 0) { lblSummaryLocation.Text += oEnvironment.Get(intEnv, "name"); Int32.TryParse(drSummary["addressid"].ToString(), out intAddress); if (intAddress > 0) { lblSummaryLocation.Text += " at <a href=\"javascript:void(0);\" onclick=\"ShowHideDiv2('divLocation');\">" + oLocation.GetFull(intAddress) + " <img src=\"/images/help.gif\" border=\"0\" align=\"absmiddle\"/></a>"; } else { bool boolProd = oClass.IsProd(intClass); bool boolQA = oClass.IsQA(intClass); bool boolTest = oClass.IsTestDev(intClass); bool boolDR = oClass.IsDR(intClass); DataSet dsLocations = oLocation.GetAddressClass((boolDR ? 1 : 0), (boolProd ? 1 : 0), (boolQA ? 1 : 0), (boolTest ? 1 : 0)); if (dsLocations.Tables[0].Rows.Count > 0) { StringBuilder strLocation = new StringBuilder(); int intLocationCount = 0; foreach (DataRow drLocation in dsLocations.Tables[0].Rows) { intLocationCount++; if (intLocationCount > 1) { if (intLocationCount > 2) { strLocation.Insert(0, ", "); } else { strLocation.Insert(0, " or "); } } if (drLocation["commonname"].ToString() != "") { strLocation.Insert(0, drLocation["commonname"].ToString()); } else { strLocation.Insert(0, oLocation.GetFull(Int32.Parse(drLocation["id"].ToString()))); } } lblSummaryLocation.Text += " at <a href=\"javascript:void(0);\" onclick=\"ShowHideDiv2('divLocation');\">" + strLocation.ToString() + " <img src=\"/images/help.gif\" border=\"0\" align=\"absmiddle\"/></a>"; } } } } // Server Type if (oDesign.IsDatabase(this.DesignId) == false) { if (boolWeb) { lblSummaryServerType.Text = "Web"; } else { lblSummaryServerType.Text = "Application"; } } else { lblSummaryServerType.Text = "Database"; if (boolSQL || boolOracle || boolOtherDB) { string strDatabase = ""; if (boolSQL == true) { strDatabase = "SQL"; } if (boolOracle == true) { strDatabase = "Oracle"; } if (boolOtherDB == true) { strDatabase = "Other"; } lblSummaryServerType.Text += " (" + strDatabase + ")"; } if (boolWeb) { lblSummaryServerType.Text += " + Web"; } } // Quantity int intQuantity = 0; Int32.TryParse(drSummary["quantity"].ToString(), out intQuantity); if (intQuantity > 0) { lblSummaryQuantity.Text = intQuantity.ToString(); } // OS int intOS = 0; Int32.TryParse(drSummary["osid"].ToString(), out intOS); if (intOS > 0) { lblSummaryOS.Text = oOperatingSystem.Get(intOS, "name"); } // SIZE string strSize = drSummary["cores"].ToString() + " CPU(s), " + drSummary["ram"].ToString() + " GB(s) RAM"; lblSummarySize.Text = strSize; // STORAGE if (drSummary["storage"].ToString() == "1") { if (drSummary["persistent"].ToString() == "1") { int intPersistent = oDesign.GetStorageTotal(this.DesignId); if (intPersistent > 0) { lblSummaryStorage.Text = "Persistent, " + intPersistent.ToString() + " GB(s)"; } } else if (drSummary["persistent"].ToString() == "0") { int intNonPersistent = 0; Int32.TryParse(drSummary["non_persistent"].ToString(), out intNonPersistent); if (intNonPersistent > 0) { lblSummaryStorage.Text = "Non-Persistent, " + intNonPersistent.ToString() + " GB(s)"; } } else { int intStorage = oDesign.GetStorageTotal(this.DesignId); if (intStorage > 0) { lblSummaryStorage.Text = intStorage.ToString() + " GB(s)"; } } } else if (drSummary["storage"].ToString() == "0") { lblSummaryStorage.Text = "No"; } // HA if (drSummary["ha"].ToString() == "1") { if (oModelsProperties.IsSUNVirtual(intModel) == true) { lblSummaryHA.Text = "Sun Virtual Environment (SVE)"; } else if (drSummary["ha_clustering"].ToString() == "1") { lblSummaryHA.Text = "Clustered"; if (drSummary["active_passive"].ToString() == "1") { lblSummaryHA.Text += " (Active / Passive)"; } else if (drSummary["active_passive"].ToString() == "2") { lblSummaryHA.Text += " (Active / Active)"; } } else if (drSummary["ha_load_balancing"].ToString() == "1") { lblSummaryHA.Text = "Load Balancing"; } } else if (drSummary["ha"].ToString() == "0") { lblSummaryHA.Text = "No"; } else { lblSummaryHA.Text = "<i>N / A</i>"; } // SPECIAL if (oModelsProperties.IsVMwareVirtual(intModel)) { lblSummaryBootType.Text = "Virtual Hard Disk (VHD)"; } else if (oModelsProperties.IsStorageDB_BootLocal(intModel)) { lblSummaryBootType.Text = "Local Disk"; } else { lblSummaryBootType.Text = "SAN Disk"; } // DATE DateTime datDate = DateTime.Now; if (DateTime.TryParse(drSummary["commitment"].ToString(), out datDate) == true) { lblSummaryDate.Text = datDate.ToShortDateString(); // Target completion date = 2 weeks later than commitment DateTime datTarget = oHoliday.GetDays(dblSLA, datDate); string strTarget = datTarget.ToShortDateString(); if (strTarget != "") { lblSummaryTarget.Text = strTarget + " (<a href=\"javascript:void(0);\" onclick=\"alert('" + strTarget + " is " + dblSLA.ToString() + " business days from your build date (" + lblSummaryDate.Text + ").\\n\\nBusiness days exclude weekends and holidays.');\">How is this calculated?</a>)"; } } // CONFIDENCE lblSummaryConfidence.Text = drSummary["confidence"].ToString(); //if (oDesign.IsOther(this.DesignId, 1, 0, 0) == true) // btnUnlock.Visible = true; btnUnlock.Attributes.Add("onclick", "return OpenWindow('DESIGN_UNLOCK','" + this.DesignId.ToString() + "')"); /* * if (drSummary["answerid"].ToString() == "") * lblSummaryAnswerID.Text = "N / A"; * else * lblSummaryAnswerID.Text = "<a href=\"javascript:void(0);\" onclick=\"OpenNewWindow('/datapoint/service/design.aspx?t=design&q=" + oFunction.encryptQueryString(drSummary["answerid"].ToString()) + "',800,600);\">" + drSummary["answerid"].ToString() + "</a>"; */ if (this.ExceptionServiceFolder > 0) { this.ExceptionRadio.Visible = false; } if (this.ExceptionServiceFolder > 0 && oDesign.IsOther(this.DesignId, 0, 0, 1)) { this.ExceptionServiceFolderPanel.Visible = true; this.CompleteRadio.Enabled = false; } else { string strValidation = oDesign.GetValid(this.DesignId); if (strValidation != "") { // Invalid Design if (this.InvalidPanel != null) { this.InvalidPanel.Style["display"] = "inline"; } // Hide the Rejection screen (if shown) if (this.RejectPanel != null) { this.RejectPanel.Style["display"] = "none"; } if (this.Demo == false && this.CompleteRadio != null) { this.CompleteRadio.Text += " <i>(Incomplete)</i>"; this.CompleteRadio.Enabled = false; } if (this.ValidationLabel != null) { string[] strValidations = strValidation.Split(new char[] { ',' }); foreach (string strError in strValidations) { if (strError.Trim() != "") { if (this.ValidationLabel.Text != "") { this.ValidationLabel.Text += "<br/>"; } this.ValidationLabel.Text += " - " + strError.Trim(); } } } } else { btnUnlock.Visible = false; // Valid Design if (this.RejectPanel == null || this.RejectPanel.Style["display"] != "inline") { if (oDesign.IsOther(this.DesignId, 0, 0, 1) == true) { if (this.ExceptionPanel != null) { this.ExceptionPanel.Style["display"] = "inline"; } } else if (this.ValidPanel != null) { this.ValidPanel.Style["display"] = "inline"; } } // Check confidence and Date string strCanExecute = oDesign.CanExecute(this.DesignId); if (this.Demo == true) { if (strCanExecute != "") { this.InvalidPanel.Style["display"] = "inline"; } if (this.ValidationLabel != null) { this.ValidationLabel.Text = " - " + strCanExecute; } } else if (this.CompleteRadio != null) { if (strCanExecute != "") { this.CompleteRadio.Text += " <i>(" + strCanExecute + ")</i>"; } if (this.CompleteRadio.Text.Contains("<i>")) { this.CompleteRadio.Enabled = false; this.CompleteRadio.Checked = false; } } } if (this.Demo == true && InvalidPanel.Style["display"] == "inline") { ValidPanel.Style["display"] = "none"; CompleteRadio.Enabled = false; ScheduleRadio.Enabled = false; } } } } }
protected void Page_Load(object sender, EventArgs e) { Servers oServer = new Servers(0, dsn); VMWare oVMWare = new VMWare(0, dsn); Forecast oForecast = new Forecast(0, dsn); Environments oEnvironment = new Environments(0, dsn); OperatingSystems oOperatingSystem = new OperatingSystems(0, dsn); Classes oClass = new Classes(0, dsn); Requests oRequest = new Requests(0, dsn); Projects oProject = new Projects(0, dsn); ServerName oServerName = new ServerName(0, dsn); Locations oLocations = new Locations(0, dsn); ModelsProperties oModelsProperties = new ModelsProperties(0, dsn); ServicePacks oServicePacks = new ServicePacks(0, dsn); Users oUser = new Users(0, dsn); Organizations oOrganization = new Organizations(0, dsn); IPAddresses oIPAddresses = new IPAddresses(0, dsnIP, dsn); ResourceRequest oResourceRequest = new ResourceRequest(0, dsn); Domains oDomains = new Domains(0, dsn); oVariables = new Variables(intEnvironment); if (Request.QueryString["id"] != null && Request.QueryString["id"] != "") { StringBuilder sbTable = new StringBuilder(strTable); int intServer = Int32.Parse(Request.QueryString["id"]); DataSet ds = oServer.Get(intServer); if (ds.Tables[0].Rows.Count > 0) { int intAnswer = Int32.Parse(ds.Tables[0].Rows[0]["answerid"].ToString()); int intName = Int32.Parse(ds.Tables[0].Rows[0]["nameid"].ToString()); string strName = oServer.GetName(intServer, boolUsePNCNaming); int intForecast = Int32.Parse(oForecast.GetAnswer(intAnswer, "forecastid")); int intRequest = Int32.Parse(oForecast.Get(intForecast, "requestid")); int intProject = oRequest.GetProjectNumber(intRequest); int intClass = Int32.Parse(oForecast.GetAnswer(intAnswer, "classid")); int intEnv = Int32.Parse(oForecast.GetAnswer(intAnswer, "environmentid")); int intModel = Int32.Parse(ds.Tables[0].Rows[0]["modelid"].ToString()); string _save_location = oVariables.UploadsFolder() + "SC\\"; string strFileName = "SC_" + intServer.ToString() + "_" + oProject.Get(intProject, "number") + ".HTM"; if (Directory.Exists(_save_location) == false) { Directory.CreateDirectory(_save_location); } string strFile = _save_location + strFileName; StreamWriter fp = File.CreateText(strFile); string strDefault = "<table cellpadding=\"2\" cellspacing=\"2\" border=\"0\" class=\"default\">"; StringBuilder sbLeft1 = new StringBuilder(); string strLead = oProject.Get(intProject, "lead"); int intLead = 0; if (strLead != "") { intLead = Int32.Parse(strLead); } sbLeft1.Append("<fieldset>"); sbLeft1.Append("<legend><b>Who is this for?</b></legend>"); sbLeft1.Append(strDefault); sbLeft1.Append("<tr>"); sbLeft1.Append("<td>Client XID:</td>"); sbLeft1.Append("<td>"); sbLeft1.Append(GetBox(intLead > 0 ? oUser.GetName(intLead) : "***ERROR**", 200)); sbLeft1.Append("</td>"); sbLeft1.Append("</tr>"); sbLeft1.Append("<tr>"); sbLeft1.Append("<td>Client Name:</td>"); sbLeft1.Append("<td>"); sbLeft1.Append(GetBox(intLead > 0 ? oUser.GetFullName(intLead) : "***ERROR**", 200)); sbLeft1.Append("</td>"); sbLeft1.Append("</tr>"); sbLeft1.Append("<tr>"); sbLeft1.Append("<td>Client Phone No.:</td>"); sbLeft1.Append("<td>"); sbLeft1.Append(GetBox(intLead > 0 ? oUser.Get(intLead, "phone") : "***ERROR**", 200)); sbLeft1.Append("</td>"); sbLeft1.Append("</tr>"); sbLeft1.Append("<tr>"); sbLeft1.Append("<td>Client Department:</td>"); sbLeft1.Append("<td>"); sbLeft1.Append(GetBox("", 200)); sbLeft1.Append("</td>"); sbLeft1.Append("</tr>"); sbLeft1.Append("<tr>"); sbLeft1.Append("<td>Client Fax:</td>"); sbLeft1.Append("<td>"); sbLeft1.Append(GetBox("", 200)); sbLeft1.Append("</td>"); sbLeft1.Append("</tr>"); sbLeft1.Append("<tr>"); sbLeft1.Append("<td>Client Cost Center:</td>"); sbLeft1.Append("<td>"); sbLeft1.Append(GetBox("", 200)); sbLeft1.Append("</td>"); sbLeft1.Append("</tr>"); sbLeft1.Append("</table>"); sbLeft1.Append("</fieldset>"); StringBuilder sbRight1 = new StringBuilder(); string strIE = oProject.Get(intProject, "engineer"); int intIE = 0; if (strIE != "") { intIE = Int32.Parse(strIE); } sbRight1.Append("<fieldset>"); sbRight1.Append("<legend><b>Requestor Information</b></legend>"); sbRight1.Append(strDefault); sbRight1.Append("<tr>"); sbRight1.Append("<td>Requested By Name:</td>"); sbRight1.Append("<td>"); sbRight1.Append(GetBox(intIE > 0 ? oUser.GetFullName(intIE) : "***ERROR**", 200)); sbRight1.Append("</td>"); sbRight1.Append("</tr>"); sbRight1.Append("<tr>"); sbRight1.Append("<td>Requested By Phone No.:</td>"); sbRight1.Append("<td>"); sbRight1.Append(GetBox(intIE > 0 ? oUser.Get(intIE, "phone") : "***ERROR**", 200)); sbRight1.Append("</td>"); sbRight1.Append("</tr>"); sbRight1.Append("<tr>"); sbRight1.Append("<td>Requested By Email:</td>"); sbRight1.Append("<td>"); sbRight1.Append(GetBox(intIE > 0 ? oUser.GetEmail(oUser.GetName(intIE), intEnvironment) : "***ERROR**", 200)); sbRight1.Append("</td>"); sbRight1.Append("</tr>"); sbRight1.Append("</table>"); sbRight1.Append("</fieldset>"); sbRight1.Append("<fieldset>"); sbRight1.Append("<legend><b>Location Information:</b></legend>"); sbRight1.Append(strDefault); sbRight1.Append("<tr>"); sbRight1.Append("<td>Location:</td>"); sbRight1.Append("<td>"); sbRight1.Append(GetBox("", 200)); sbRight1.Append("</td>"); sbRight1.Append("</tr>"); sbRight1.Append("<tr>"); sbRight1.Append("<td>Location Full Name:</td>"); sbRight1.Append("<td>"); sbRight1.Append(GetBox("", 200)); sbRight1.Append("</td>"); sbRight1.Append("</tr>"); sbRight1.Append("</table>"); sbRight1.Append("</fieldset>"); StringBuilder sbCenter1 = new StringBuilder(); sbCenter1.Append("<fieldset>"); sbCenter1.Append("<legend><b>Brief Desc:</b></legend>"); sbCenter1.Append(strDefault); sbCenter1.Append("<tr>"); sbCenter1.Append("<td>"); sbCenter1.Append(GetBox(oForecast.GetAnswer(intAnswer, "name") + " (" + strName + ")", 600)); sbCenter1.Append("</td>"); sbCenter1.Append("</tr>"); sbCenter1.Append("</table>"); sbCenter1.Append("</fieldset>"); StringBuilder sbLeft2 = new StringBuilder(); sbLeft2.Append("<fieldset>"); sbLeft2.Append("<legend><b>Project Information:</b></legend>"); sbLeft2.Append(strDefault); sbLeft2.Append("<tr>"); sbLeft2.Append("<td>Project ID:</td>"); sbLeft2.Append("<td>"); sbLeft2.Append(GetBox(oProject.Get(intProject, "number"), 200)); sbLeft2.Append("</td>"); sbLeft2.Append("<td>Project Manager XID:</td>"); sbLeft2.Append("<td>"); sbLeft2.Append(GetBox(intLead > 0 ? oUser.GetName(intLead) : "***ERROR**", 200)); sbLeft2.Append("</td>"); sbLeft2.Append("</tr>"); sbLeft2.Append("<tr>"); sbLeft2.Append("<td>Project Name:</td>"); sbLeft2.Append("<td>"); sbLeft2.Append(GetBox(oProject.Get(intProject, "name"), 200)); sbLeft2.Append("</td>"); sbLeft2.Append("<td>Project Manager Name:</td>"); sbLeft2.Append("<td>"); sbLeft2.Append(GetBox(intLead > 0 ? oUser.GetFullName(intLead) : "***ERROR**", 200)); sbLeft2.Append("</td>"); sbLeft2.Append("</tr>"); sbLeft2.Append("<tr>"); sbLeft2.Append("<td>Project Budgeted:</td>"); sbLeft2.Append("<td>"); sbLeft2.Append(GetBox(oProject.Get(intProject, "bd"), 200)); sbLeft2.Append("</td>"); sbLeft2.Append("<td>Project Manager Phone:</td>"); sbLeft2.Append("<td>"); sbLeft2.Append(GetBox(intLead > 0 ? oUser.Get(intLead, "phone") : "***ERROR**", 200)); sbLeft2.Append("</td>"); sbLeft2.Append("</tr>"); sbLeft2.Append("<tr>"); sbLeft2.Append("<td>Project Cost Ctr:</td>"); sbLeft2.Append("<td>"); sbLeft2.Append(GetBox("", 200)); sbLeft2.Append("</td>"); sbLeft2.Append("<td>Project Manager Email:</td>"); sbLeft2.Append("<td>"); sbLeft2.Append(GetBox(intLead > 0 ? oUser.GetEmail(oUser.GetName(intLead), intEnvironment) : "***ERROR**", 200)); sbLeft2.Append("</td>"); sbLeft2.Append("</tr>"); sbLeft2.Append("</table>"); sbLeft2.Append("</fieldset>"); OnDemandTasks oOnDemandTasks = new OnDemandTasks(0, dsn); int intImplementor = 0; DataSet dsTasks = oOnDemandTasks.GetPending(intAnswer); if (dsTasks.Tables[0].Rows.Count > 0) { intImplementor = Int32.Parse(dsTasks.Tables[0].Rows[0]["resourceid"].ToString()); intImplementor = Int32.Parse(oResourceRequest.GetWorkflow(intImplementor, "userid")); } else { intImplementor = -999; } sbTable = new StringBuilder("<table cellpadding=\"2\" cellspacing=\"2\" border=\"0\" class=\"default\">"); sbTable.Append("<tr>"); sbTable.Append("<td colspan=\"2\"><b>NOTE:</b> ASSIGN THIS REQUEST TO: "); sbTable.Append(intImplementor > 0 || intImplementor == -999 ? oUser.GetFullName(intImplementor) + " (" + oUser.GetName(intImplementor) + ")" : "***ERROR**"); sbTable.Append("</td>"); sbTable.Append("</tr>"); sbTable.Append("<tr>"); sbTable.Append("<td>"); sbTable.Append(sbLeft1.ToString()); sbTable.Append("</td>"); sbTable.Append("<td>"); sbTable.Append(sbRight1.ToString()); sbTable.Append("</td>"); sbTable.Append("</tr>"); sbTable.Append("<tr>"); sbTable.Append("<td colspan=\"2\">"); sbTable.Append(sbCenter1.ToString()); sbTable.Append("</td>"); sbTable.Append("</tr>"); sbTable.Append("<tr>"); sbTable.Append("<td colspan=\"2\">"); sbTable.Append(sbLeft2.ToString()); sbTable.Append("</td>"); sbTable.Append("</tr>"); sbTable.Append("<tr>"); sbTable.Append("<td colspan=\"2\"><p> </p></td>"); sbTable.Append("</tr>"); bool boolVirtual = false; if (boolVirtual == true) { sbTable.Append("<tr>"); sbTable.Append("<td colspan=\"2\" class=\"header\">REQUISITION VIRTUAL SERVER GUEST</td>"); sbTable.Append("</tr>"); sbTable.Append("<tr>"); sbTable.Append("<td>Requested Server Completion Date:</td>"); sbTable.Append("<td>"); sbTable.Append(GetBox(oForecast.GetAnswer(intAnswer, "implementation"), 300)); sbTable.Append("</td>"); sbTable.Append("</tr>"); sbTable.Append("<tr>"); sbTable.Append("<td>Server Hardware Specifications:</td>"); sbTable.Append("<td>"); sbTable.Append(GetBox("VIRTUAL SERVER GUEST VMWARE", 300)); sbTable.Append("</td>"); sbTable.Append("</tr>"); sbTable.Append("<tr>"); sbTable.Append("<td>Server Operating System:</td>"); sbTable.Append("<td>"); sbTable.Append(GetBox(oOperatingSystem.Get(Int32.Parse(ds.Tables[0].Rows[0]["osid"].ToString()), "name").ToUpper() + " (" + oServicePacks.Get(Int32.Parse(ds.Tables[0].Rows[0]["spid"].ToString()), "name").ToUpper() + ")", 300)); sbTable.Append("</td>"); sbTable.Append("</tr>"); sbTable.Append("<tr>"); sbTable.Append("<td>Environment:</td>"); sbTable.Append("<td>"); sbTable.Append(GetBox(oEnvironment.Get(Int32.Parse(oForecast.GetAnswer(intAnswer, "environmentid")), "name").ToUpper(), 300)); sbTable.Append("</td>"); sbTable.Append("</tr>"); sbTable.Append("<tr>"); sbTable.Append("<td>Destination Class:</td>"); sbTable.Append("<td>"); sbTable.Append(GetBox(oClass.Get(Int32.Parse(oForecast.GetAnswer(intAnswer, "classid")), "name").ToUpper(), 300)); sbTable.Append("</td>"); sbTable.Append("</tr>"); sbTable.Append("<tr><td colspan=\"2\"><p> </p></td></tr>"); sbTable.Append("<tr>"); sbTable.Append("<td>Destination Domain:</td>"); sbTable.Append("<td>"); sbTable.Append(GetBox(oDomains.Get(Int32.Parse(ds.Tables[0].Rows[0]["domainid"].ToString()), "name").ToUpper(), 300)); sbTable.Append("</td>"); sbTable.Append("</tr>"); sbTable.Append("<tr>"); sbTable.Append("<td>Backup Method:</td>"); sbTable.Append("<td>"); sbTable.Append(GetBox("TSM", 300)); sbTable.Append("</td>"); sbTable.Append("</tr>"); string strHost = "***ERROR***"; DataSet dsGuest = oVMWare.GetGuest(strName); if (dsGuest.Tables[0].Rows.Count > 0) { strHost = oVMWare.GetHost(Int32.Parse(dsGuest.Tables[0].Rows[0]["hostid"].ToString()), "name").ToUpper(); } sbTable.Append("<tr>"); sbTable.Append("<td>Host Server Name:</td>"); sbTable.Append("<td>"); sbTable.Append(GetBox(strHost, 300)); sbTable.Append("</td>"); sbTable.Append("</tr>"); sbTable.Append("<tr><td colspan=\"2\"><p> </p></td></tr>"); sbTable.Append("<tr>"); sbTable.Append("<td bgcolor=\"#CCCCCC\" style=\"border:2px outset #FFFFFF\">Network Protocols</td>"); sbTable.Append("<td bgcolor=\"#CCCCCC\" style=\"border:2px outset #FFFFFF\">Server Software - click in box below to add</td>"); sbTable.Append("</tr>"); bool boolSQL = false; bool boolIIS = false; DataSet dsComp = oServerName.GetComponentDetailSelected(intServer, 1); foreach (DataRow drComp in dsComp.Tables[0].Rows) { if (drComp["code"].ToString() == "IIS") { boolIIS = true; } if (drComp["code"].ToString() == "SQL") { boolSQL = true; } } sbTable.Append("<tr>"); sbTable.Append("<td>"); sbTable.Append(GetBox("TCP/IP", 250)); sbTable.Append("</td>"); sbTable.Append("<td>"); sbTable.Append(GetBox((boolSQL ? "SQL" : ""), 350)); sbTable.Append("</td>"); sbTable.Append("</tr>"); sbTable.Append("<tr>"); sbTable.Append("<td>"); sbTable.Append(GetBox("", 250)); sbTable.Append("</td>"); sbTable.Append("<td>"); sbTable.Append(GetBox((boolIIS ? "IIS" : ""), 350)); sbTable.Append("</td>"); sbTable.Append("</tr>"); sbTable.Append("<tr><td colspan=\"2\"><p> </p></td></tr>"); sbTable.Append("<tr>"); sbTable.Append("<td>Attached to SAN?:</td>"); sbTable.Append("<td>"); sbTable.Append(GetBox("NO", 150)); sbTable.Append("</td>"); sbTable.Append("</tr>"); sbTable.Append("<tr>"); sbTable.Append("<td>Server is Clustered:</td>"); sbTable.Append("<td>"); sbTable.Append(GetBox("NO", 150)); sbTable.Append("</td>"); sbTable.Append("</tr>"); sbTable.Append("<tr>"); sbTable.Append("<td>Server Load Balanced:</td>"); sbTable.Append("<td>"); sbTable.Append(GetBox("NO", 150)); sbTable.Append("</td>"); sbTable.Append("</tr>"); sbTable.Append("<tr>"); sbTable.Append("<td>Maximum Allowable Downtime:</td>"); sbTable.Append("<td>"); sbTable.Append(GetBox("Not Applicable", 150) + "</td>"); sbTable.Append("</tr>"); sbTable.Append("<tr>"); sbTable.Append("<td colspan=\"2\"><input type=\"checkbox\" class=\"default\"/> Hardware Refresh</td>"); sbTable.Append("</tr>"); sbTable.Append("<tr><td colspan=\"2\"><p> </p></td></tr>"); sbTable.Append("<tr>"); sbTable.Append("<td colspan=\"2\">Intended Use Description:</td>"); sbTable.Append("</tr>"); sbTable.Append("<tr>"); sbTable.Append("<td colspan=\"2\">"); sbTable.Append(GetBox("", 500)); sbTable.Append("</td>"); sbTable.Append("</tr>"); } else { sbTable.Append("<tr>"); sbTable.Append("<td colspan=\"2\" class=\"header\">REQUISITION SERVER</td>"); sbTable.Append("</tr>"); sbTable.Append("<tr>"); sbTable.Append("<td>Requested Server Completion Date:</td>"); sbTable.Append("<td>"); sbTable.Append(GetBox(oForecast.GetAnswer(intAnswer, "implementation"), 300)); sbTable.Append("</td>"); sbTable.Append("</tr>"); sbTable.Append("<tr>"); sbTable.Append("<td>Server Hardware Specifications:</td>"); sbTable.Append("<td>"); sbTable.Append(GetBox(oModelsProperties.Get(intModel, "name"), 300)); sbTable.Append("</td>"); sbTable.Append("</tr>"); sbTable.Append("<tr>"); sbTable.Append("<td colspan=\"2\"><input type=\"checkbox\" class=\"default\" checked/> User re-deployable hardware if applicable</td>"); sbTable.Append("</tr>"); sbTable.Append("<tr>"); sbTable.Append("<td>PO:</td>"); sbTable.Append("<td>"); sbTable.Append(GetBox("", 300)); sbTable.Append("</td>"); sbTable.Append("</tr>"); sbTable.Append("<tr>"); sbTable.Append("<td>Server Operating System:</td>"); sbTable.Append("<td>"); sbTable.Append(GetBox(oOperatingSystem.Get(Int32.Parse(ds.Tables[0].Rows[0]["osid"].ToString()), "name").ToUpper() + " (" + oServicePacks.Get(Int32.Parse(ds.Tables[0].Rows[0]["spid"].ToString()), "name").ToUpper() + ")", 300)); sbTable.Append("</td>"); sbTable.Append("</tr>"); sbTable.Append("<tr>"); sbTable.Append("<td>Environment:</td>"); sbTable.Append("<td>"); sbTable.Append(GetBox(oEnvironment.Get(Int32.Parse(oForecast.GetAnswer(intAnswer, "environmentid")), "name").ToUpper(), 300)); sbTable.Append("</td>"); sbTable.Append("</tr>"); sbTable.Append("<tr>"); sbTable.Append("<td>Destination Class:</td>"); sbTable.Append("<td>"); sbTable.Append(GetBox(oClass.Get(Int32.Parse(oForecast.GetAnswer(intAnswer, "classid")), "name").ToUpper(), 300)); sbTable.Append("</td>"); sbTable.Append("</tr>"); sbTable.Append("<tr><td colspan=\"2\"><p> </p></td></tr>"); sbTable.Append("<tr>"); sbTable.Append("<td>Destination Domain:</td>"); sbTable.Append("<td>"); sbTable.Append(GetBox(oDomains.Get(Int32.Parse(ds.Tables[0].Rows[0]["domainid"].ToString()), "name").ToUpper(), 300)); sbTable.Append("</td>"); sbTable.Append("</tr>"); sbTable.Append("<tr>"); sbTable.Append("<td>Server Location:</td>"); sbTable.Append("<td>"); sbTable.Append(GetBox(oLocations.GetFull(Int32.Parse(oForecast.GetAnswer(intAnswer, "addressid"))).ToUpper(), 300)); sbTable.Append("</td>"); sbTable.Append("</tr>"); sbTable.Append("<tr>"); sbTable.Append("<td>Backup Method:</td>"); sbTable.Append("<td>"); sbTable.Append(GetBox("TSM", 300)); sbTable.Append("</td>"); sbTable.Append("</tr>"); sbTable.Append("<tr><td colspan=\"2\"><p> </p></td></tr>"); sbTable.Append("<tr>"); sbTable.Append("<td bgcolor=\"#CCCCCC\" style=\"border:2px outset #FFFFFF\">Network Protocols</td>"); sbTable.Append("<td bgcolor=\"#CCCCCC\" style=\"border:2px outset #FFFFFF\">Server Software - click in box below to add</td>"); sbTable.Append("</tr>"); bool boolSQL = false; bool boolIIS = false; DataSet dsComp = oServerName.GetComponentDetailSelected(intServer, 1); foreach (DataRow drComp in dsComp.Tables[0].Rows) { if (drComp["code"].ToString() == "IIS") { boolIIS = true; } if (drComp["code"].ToString() == "SQL") { boolSQL = true; } } sbTable.Append("<tr>"); sbTable.Append("<td>"); sbTable.Append(GetBox("TCP/IP", 250)); sbTable.Append("</td>"); sbTable.Append("<td>"); sbTable.Append(GetBox((boolSQL ? "SQL" : ""), 350)); sbTable.Append("</td>"); sbTable.Append("</tr>"); sbTable.Append("<tr>"); sbTable.Append("<td>"); sbTable.Append(GetBox("", 250)); sbTable.Append("</td>"); sbTable.Append("<td>"); sbTable.Append(GetBox((boolIIS ? "IIS" : ""), 350)); sbTable.Append("</td>"); sbTable.Append("</tr>"); sbTable.Append("<tr><td colspan=\"2\"><p> </p></td></tr>"); sbTable.Append("<tr>"); sbTable.Append("<td>Attached to SAN?:</td>"); sbTable.Append("<td>"); sbTable.Append(GetBox("NO", 150)); sbTable.Append("</td>"); sbTable.Append("</tr>"); sbTable.Append("<tr>"); sbTable.Append("<td>Server is Clustered:</td>"); sbTable.Append("<td>"); sbTable.Append(GetBox("NO", 150)); sbTable.Append("</td>"); sbTable.Append("</tr>"); sbTable.Append("<tr>"); sbTable.Append("<td>Server Load Balanced:</td>"); sbTable.Append("<td>"); sbTable.Append(GetBox("NO", 150)); sbTable.Append("</td>"); sbTable.Append("</tr>"); sbTable.Append("<tr>"); sbTable.Append("<td>Maximum Allowable Downtime:</td>"); sbTable.Append("<td>"); sbTable.Append(GetBox("Not Applicable", 150)); sbTable.Append("</td>"); sbTable.Append("</tr>"); sbTable.Append("<tr>"); sbTable.Append("<td colspan=\"2\"><input type=\"checkbox\" class=\"default\"/> Hardware Refresh</td>"); sbTable.Append("</tr>"); sbTable.Append("<tr><td colspan=\"2\"><p> </p></td></tr>"); sbTable.Append("<tr>"); sbTable.Append("<td colspan=\"2\">Intended Use Description:</td>"); sbTable.Append("</tr>"); sbTable.Append("<tr>"); sbTable.Append("<td colspan=\"2\">"); sbTable.Append(GetBox("", 500)); sbTable.Append("</td>"); sbTable.Append("</tr>"); } sbTable.Append("</table>"); fp.WriteLine("<html>"); fp.WriteLine("<head>"); fp.WriteLine("<title>ClearView | Service Center Request Form</title>"); fp.WriteLine("<style type=\"text/css\">"); fp.WriteLine(".default {font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 10px;}"); fp.WriteLine(".header {font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 16px;font-style: italic;font-weight: bold;}"); fp.WriteLine("</style>"); fp.WriteLine("<body leftmargin=\"0\" topmargin=\"0\">"); fp.WriteLine(sbTable.ToString()); fp.WriteLine("</body>"); fp.WriteLine("</html>"); fp.Close(); } strTable = sbTable.ToString(); } }
protected void Page_Load(object sender, EventArgs e) { intProfile = Int32.Parse(Request.Cookies["profileid"].Value); oForecast = new Forecast(intProfile, dsn); oPage = new Pages(intProfile, dsn); if (Request.QueryString["pageid"] != null && Request.QueryString["pageid"] != "") { intPage = Int32.Parse(Request.QueryString["pageid"]); } if (Request.QueryString["action"] != null && Request.QueryString["action"] != "") { panFinish.Visible = true; } else { if (Request.QueryString["applicationid"] != null && Request.QueryString["applicationid"] != "") { intApplication = Int32.Parse(Request.QueryString["applicationid"]); } if (Request.Cookies["application"] != null && Request.Cookies["application"].Value != "") { intApplication = Int32.Parse(Request.Cookies["application"].Value); } if (Request.QueryString["id"] != null && Request.QueryString["id"] != "") { intAnswer = Int32.Parse(Request.QueryString["id"]); } if (!IsPostBack) { if (intAnswer > 0) { DataSet ds = oForecast.GetAnswer(intAnswer); if (ds.Tables[0].Rows.Count > 0) { Projects oProject = new Projects(intProfile, dsn); Requests oRequest = new Requests(intProfile, dsn); Organizations oOrganization = new Organizations(intProfile, dsn); Segment oSegment = new Segment(intProfile, dsn); Platforms oPlatform = new Platforms(intProfile, dsn); ModelsProperties oModelsProperties = new ModelsProperties(intProfile, dsn); Confidence oConfidence = new Confidence(intProfile, dsn); Classes oClass = new Classes(intProfile, dsn); Environments oEnvironment = new Environments(intProfile, dsn); Locations oLocation = new Locations(intProfile, dsn); Users oUser = new Users(intProfile, dsn); lblID.Text = intAnswer.ToString(); int intForecast = Int32.Parse(ds.Tables[0].Rows[0]["forecastid"].ToString()); int intRequest = Int32.Parse(oForecast.Get(intForecast, "requestid")); int intProject = oRequest.GetProjectNumber(intRequest); lblName.Text = oProject.Get(intProject, "name"); lblNumber.Text = oProject.Get(intProject, "number"); lblPortfolio.Text = oOrganization.GetName(Int32.Parse(oProject.Get(intProject, "organization"))); lblSegment.Text = oSegment.GetName(Int32.Parse(oProject.Get(intProject, "segmentid"))); lblPlatform.Text = oPlatform.GetName(Int32.Parse(ds.Tables[0].Rows[0]["platformid"].ToString())); lblNickname.Text = ds.Tables[0].Rows[0]["name"].ToString(); lblModel.Text = oModelsProperties.Get(Int32.Parse(ds.Tables[0].Rows[0]["modelid"].ToString()), "name"); lblCommitment.Text = DateTime.Parse(ds.Tables[0].Rows[0]["implementation"].ToString()).ToLongDateString(); lblQuantity.Text = ds.Tables[0].Rows[0]["quantity"].ToString(); lblConfidence.Text = oConfidence.Get(Int32.Parse(ds.Tables[0].Rows[0]["confidenceid"].ToString()), "name"); int intClass = Int32.Parse(ds.Tables[0].Rows[0]["classid"].ToString()); lblClass.Text = oClass.Get(intClass, "name"); if (oClass.IsProd(intClass)) { panTest.Visible = true; lblTest.Text = (ds.Tables[0].Rows[0]["test"].ToString() == "1" ? "Yes" : "No"); } lblEnvironment.Text = oEnvironment.Get(Int32.Parse(ds.Tables[0].Rows[0]["environmentid"].ToString()), "name"); lblLocation.Text = oLocation.GetFull(Int32.Parse(ds.Tables[0].Rows[0]["addressid"].ToString())); lblIP.Text = ds.Tables[0].Rows[0]["workstation"].ToString(); lblDesignedBy.Text = oUser.GetFullName(Int32.Parse(ds.Tables[0].Rows[0]["userid"].ToString())); lblDesignedOn.Text = DateTime.Parse(ds.Tables[0].Rows[0]["created"].ToString()).ToString(); lblUpdated.Text = DateTime.Parse(ds.Tables[0].Rows[0]["modified"].ToString()).ToString(); panShow.Visible = true; btnApprove.Enabled = true; btnDeny.Enabled = true; } } } } btnApprove.Attributes.Add("onclick", "return confirm('Are you sure you want to APPROVE this request?');"); btnDeny.Attributes.Add("onclick", "return ValidateText('" + txtComments.ClientID + "','Please enter a reason for the rejection of this request') && confirm('Are you sure you want to DENY this request?');"); }
protected void Page_Load(object sender, EventArgs e) { intProfile = Int32.Parse(Request.Cookies["profileid"].Value); oDesign = new Design(intProfile, dsn); oUser = new Users(intProfile, dsn); oModelsProperties = new ModelsProperties(intProfile, dsn); oFunction = new Functions(intProfile, dsn, intEnvironment); if (Request.QueryString["id"] != null) { Int32.TryParse(Request.QueryString["id"], out intID); } if (intID > 0) { lblID.Text = intID.ToString(); DataSet dsSummary = oDesign.Get(intID); if (dsSummary.Tables[0].Rows.Count > 0) { DataRow drSummary = dsSummary.Tables[0].Rows[0]; Mnemonic oMnemonic = new Mnemonic(intProfile, dsn); CostCenter oCostCenter = new CostCenter(intProfile, dsn); OperatingSystems oOperatingSystem = new OperatingSystems(intProfile, dsn); Classes oClass = new Classes(intProfile, dsn); Environments oEnvironment = new Environments(intProfile, dsn); Locations oLocation = new Locations(intProfile, dsn); bool boolWeb = (drSummary["web"].ToString() == "1"); bool boolSQL = oDesign.IsSQL(intID); bool boolOracle = oDesign.IsOracle(intID); bool boolOtherDB = (drSummary["other_db"].ToString() == "1"); boolWindows = oDesign.IsWindows(intID); DataSet dsSubmitted = oDesign.GetSubmitted(intID); if (dsSubmitted.Tables[0].Rows.Count > 0) { int intUser = Int32.Parse(dsSubmitted.Tables[0].Rows[0]["userid"].ToString()); lblRequestedBy.Text = oUser.GetFullName(intUser) + " (" + oUser.GetName(intUser) + ")"; lblRequestedOn.Text = dsSubmitted.Tables[0].Rows[0]["created"].ToString(); if (dsSubmitted.Tables[0].Rows[0]["comments"].ToString() != "") { trException1.Visible = true; trException2.Visible = true; lblException.Text = dsSubmitted.Tables[0].Rows[0]["comments"].ToString(); } } else { lblRequestedBy.Text = oUser.GetFullName(intProfile) + " (" + oUser.GetName(intProfile) + ")"; lblRequestedOn.Text = dsSummary.Tables[0].Rows[0]["modified"].ToString(); } // Mnemonic int intMnemonic = 0; Int32.TryParse(drSummary["mnemonicid"].ToString(), out intMnemonic); if (intMnemonic > 0) { lblMnemonic.Text = oMnemonic.Get(intMnemonic, "factory_code") + " - " + oMnemonic.Get(intMnemonic, "name"); string strMnemonicCode = oMnemonic.Get(intMnemonic, "factory_code"); string strMnemonicStatus = oMnemonic.GetFeed(strMnemonicCode, MnemonicFeed.Status); if (strMnemonicStatus == "") { strMnemonicStatus = oMnemonic.Get(intMnemonic, "status"); } lblMnemonicStatus.Text = strMnemonicStatus; string strMnemonicRTO = oMnemonic.GetFeed(strMnemonicCode, MnemonicFeed.ResRating); if (strMnemonicRTO == "") { strMnemonicRTO = oMnemonic.Get(intMnemonic, "ResRating"); } lblMnemonicRTO.Text = strMnemonicRTO; } // Server Type if (oDesign.IsDatabase(intID) == false) { if (boolWeb) { lblServerType.Text = "Web"; } else { lblServerType.Text = "Application"; } } else { lblServerType.Text = "Database"; if (boolSQL || boolOracle || boolOtherDB) { string strDatabase = ""; if (boolSQL == true) { strDatabase = "SQL"; } if (boolOracle == true) { strDatabase = "Oracle"; } if (boolOtherDB == true) { strDatabase = "Other"; } lblServerType.Text += " (" + strDatabase + ")"; } if (boolWeb) { lblServerType.Text += " + Web"; } } // OS int intOS = 0; Int32.TryParse(drSummary["osid"].ToString(), out intOS); if (intOS > 0) { lblOS.Text = oOperatingSystem.Get(intOS, "name"); } // SIZE string strSize = drSummary["cores"].ToString() + " CPU(s), " + drSummary["ram"].ToString() + " GB(s) RAM"; lblSize.Text = strSize; // MAINFRAME if (drSummary["mainframe"].ToString() == "1") { lblMainframe.Text = "Yes"; } else if (drSummary["mainframe"].ToString() == "0") { lblMainframe.Text = "No"; } // SPECIAL lblSpecial.Text = drSummary["special"].ToString(); if (lblSpecial.Text == "") { lblSpecial.Text = "None"; } // HA if (drSummary["ha"].ToString() == "1") { if (drSummary["ha_clustering"].ToString() == "1") { lblHA.Text = "Clustering"; if (drSummary["active_passive"].ToString() == "1") { lblHA.Text += " (Active / Passive)"; } else if (drSummary["active_passive"].ToString() == "2") { lblHA.Text += " (Active / Active)"; } lblHA.Text += "<br/>" + drSummary["instances"].ToString() + " Instances"; //lblHA.Text += ", " + drSummary["nodes"].ToString() + " Nodes"; } else if (drSummary["ha_load_balancing"].ToString() == "1") { lblHA.Text = "Load Balancing"; if (drSummary["middleware"].ToString() == "1") { lblHA.Text += " (Middleware)"; } else if (boolWeb == true) { if (drSummary["application"].ToString() == "1") { lblHA.Text += " (Web + App)"; } else { lblHA.Text += " (Web)"; } } else { lblHA.Text += " (App)"; } } } else if (drSummary["ha"].ToString() == "0") { lblHA.Text = "No"; } // SOFTWARE if (drSummary["ndm"].ToString() == "1") { lblSoftware.Text += "ConnectDirect"; } if (drSummary["ca7"].ToString() == "1") { lblSoftware.Text += (lblSoftware.Text != "" ? "<br/>" : "") + "CA7"; } if (lblSoftware.Text == "") { lblSoftware.Text = "None"; } // Middlware DataSet dsSoftware = oDesign.GetSoftwareComponents(intID); foreach (DataRow drSoftware in dsSoftware.Tables[0].Rows) { // Loop through select components int intComponentID = Int32.Parse(drSoftware["componentid"].ToString()); int intResponse = Int32.Parse(drSoftware["responseid"].ToString()); lblMiddleware.Text += (lblMiddleware.Text != "" ? "<br/>" : "") + oDesign.GetResponse(intResponse, "response"); } if (lblMiddleware.Text == "") { lblMiddleware.Text = "None"; } // Legacy Design ID if (drSummary["answerid"].ToString() == "") { lblAnswerID.Text = "N / A"; } else { lblAnswerID.Text = "<a href=\"javascript:void(0);\" onclick=\"OpenNewWindow('/datapoint/service/design.aspx?t=design&q=" + oFunction.encryptQueryString(drSummary["answerid"].ToString()) + "',800,600);\">" + drSummary["answerid"].ToString() + "</a>"; } // Quantity int intQuantity = 0; Int32.TryParse(drSummary["quantity"].ToString(), out intQuantity); if (intQuantity > 0) { lblQuantity.Text = intQuantity.ToString(); } if (oDesign.IsProd(intID) == true && oDesign.IsUnder48(intID, true) == true) { lblQuantity.Text += " ( + " + intQuantity.ToString() + " for DR)"; } // DATE DateTime datDate = DateTime.Now; if (DateTime.TryParse(drSummary["commitment"].ToString(), out datDate) == true) { lblDate.Text = datDate.ToShortDateString(); } // CONFIDENCE lblConfidence.Text = drSummary["confidence"].ToString(); // LOCATION int intClass = 0; int intEnv = 0; int intAddress = 0; Int32.TryParse(drSummary["classid"].ToString(), out intClass); if (intClass > 0) { lblLocation.Text = oClass.Get(intClass, "name") + ", "; Int32.TryParse(drSummary["environmentid"].ToString(), out intEnv); if (intEnv > 0) { lblLocation.Text += oEnvironment.Get(intEnv, "name"); Int32.TryParse(drSummary["addressid"].ToString(), out intAddress); if (intAddress > 0) { lblLocation.Text += " at " + oLocation.GetFull(intAddress); } else { lblLocation.Text += " at <a href=\"javascript:void(0);\" onclick=\"alert('The datacenter will be either the Cleveland Data Center or the Summit Data Center.\\n\\nThis will be decided during execution. It is based on the available inventory at that time.');\">Cleveland or Summit Data Center</a>"; } } } // SOLUTION int intModel = oDesign.GetModelProperty(intID); lblSolution.Text = oModelsProperties.Get(intModel, "name"); // Server Boot Type if (oModelsProperties.IsVMwareVirtual(intModel)) { lblServerBootType.Text = "Virtual Hard Disk (VHD)"; } else if (oModelsProperties.IsStorageDB_BootLocal(intModel)) { lblServerBootType.Text = "Local Disk"; } else { lblServerBootType.Text = "SAN Disk"; } // ACCOUNTS rptAccounts.DataSource = oDesign.GetAccounts(intID); rptAccounts.DataBind(); foreach (RepeaterItem ri in rptAccounts.Items) { Label _permissions = (Label)ri.FindControl("lblPermissions"); switch (_permissions.Text) { case "0": _permissions.Text = "-----"; break; case "D": _permissions.Text = "Developer"; break; case "P": _permissions.Text = "Promoter"; break; case "S": _permissions.Text = "AppSupport"; break; case "U": _permissions.Text = "AppUsers"; break; } if (_permissions.ToolTip == "1") { _permissions.Text += " (R/D)"; } } lblNone.Visible = (rptAccounts.Items.Count == 0); // STORAGE if (drSummary["storage"].ToString() == "1") { if (drSummary["persistent"].ToString() == "1") { panStorage.Visible = true; int intPersistent = oDesign.GetStorageTotal(intID); if (intPersistent > 0) { lblStorage.Text = "Persistent, " + intPersistent.ToString() + " GB(s)"; } } else if (drSummary["persistent"].ToString() == "0") { int intNonPersistent = 0; Int32.TryParse(drSummary["non_persistent"].ToString(), out intNonPersistent); if (intNonPersistent > 0) { lblStorage.Text = "Non-Persistent, " + intNonPersistent.ToString() + " GB(s)"; } } else { panStorage.Visible = true; int intStorage = oDesign.GetStorageTotal(intID); if (intStorage > 0) { lblStorage.Text = intStorage.ToString() + " GB(s)"; } } } else if (drSummary["storage"].ToString() == "0") { lblStorage.Text = "No"; } // STORAGE LUNs rptStorage.DataSource = oDesign.GetStorageDrives(intID); rptStorage.DataBind(); foreach (RepeaterItem ri in rptStorage.Items) { CheckBox _shared = (CheckBox)ri.FindControl("chkStorageSize"); _shared.Checked = (_shared.Text == "1"); _shared.Text = ""; } if (boolWindows) { trStorageApp.Visible = true; DataSet dsApp = oDesign.GetStorageDrive(intID, -1000); if (dsApp.Tables[0].Rows.Count > 0) { int intTemp = 0; if (Int32.TryParse(dsApp.Tables[0].Rows[0]["size"].ToString(), out intTemp) == true) { txtStorageSizeE.Text = intTemp.ToString(); } } } if (oDesign.IsProd(intID) == true || oDesign.IsQA(intID) == true) { // BACKUP panBackup.Visible = true; lblFrequency.Text = (drSummary["backup_frequency"].ToString() == "D" ? "Daily" : (drSummary["backup_frequency"].ToString() == "W" ? "Weekly" : (drSummary["backup_frequency"].ToString() == "M" ? "Monthly" : "N / A"))); strBackup = new StringBuilder(); DataSet dsBackup = oDesign.GetBackup(intID); if (dsBackup.Tables[0].Rows.Count > 0) { DataRow drBackup = dsBackup.Tables[0].Rows[0]; for (int ii = 0; ii < 7; ii++) { strBackup.Append("<tr>"); strBackup.Append("<td>"); string strCheck = ""; if (ii == 0) { strBackup.Append("Sunday"); strCheck = drBackup["sun"].ToString(); } else if (ii == 1) { strBackup.Append("Monday"); strCheck = drBackup["mon"].ToString(); } else if (ii == 2) { strBackup.Append("Tuesday"); strCheck = drBackup["tue"].ToString(); } else if (ii == 3) { strBackup.Append("Wednesday"); strCheck = drBackup["wed"].ToString(); } else if (ii == 4) { strBackup.Append("Thursday"); strCheck = drBackup["thu"].ToString(); } else if (ii == 5) { strBackup.Append("Friday"); strCheck = drBackup["fri"].ToString(); } else { strBackup.Append("Saturday"); strCheck = drBackup["sat"].ToString(); } strBackup.Append("</td>"); for (int jj = 0; jj < 24; jj++) { strBackup.Append("<td>"); if (strCheck[jj] == '1') { strBackup.Append("<b>B</b>"); } else { strBackup.Append("-"); } strBackup.Append("</td>"); } strBackup.Append("</tr>"); } } // BACKUP EXCLUSIONS panExclusions.Visible = true; rptExclusions.DataSource = oDesign.GetExclusions(intID); rptExclusions.DataBind(); lblExclusion.Visible = (rptExclusions.Items.Count == 0); // MAINTENANCE WINDOW panMaintenance.Visible = true; strMaintenance = new StringBuilder(); DataSet dsMaintenance = oDesign.GetMaintenance(intID); if (dsMaintenance.Tables[0].Rows.Count > 0) { DataRow drMaintenance = dsMaintenance.Tables[0].Rows[0]; for (int ii = 0; ii < 7; ii++) { strMaintenance.Append("<tr>"); strMaintenance.Append("<td>"); string strCheck = ""; if (ii == 0) { strMaintenance.Append("Sunday"); strCheck = drMaintenance["sun"].ToString(); } else if (ii == 1) { strMaintenance.Append("Monday"); strCheck = drMaintenance["mon"].ToString(); } else if (ii == 2) { strMaintenance.Append("Tuesday"); strCheck = drMaintenance["tue"].ToString(); } else if (ii == 3) { strMaintenance.Append("Wednesday"); strCheck = drMaintenance["wed"].ToString(); } else if (ii == 4) { strMaintenance.Append("Thursday"); strCheck = drMaintenance["thu"].ToString(); } else if (ii == 5) { strMaintenance.Append("Friday"); strCheck = drMaintenance["fri"].ToString(); } else { strMaintenance.Append("Saturday"); strCheck = drMaintenance["sat"].ToString(); } strMaintenance.Append("</td>"); for (int jj = 0; jj < 24; jj++) { strMaintenance.Append("<td>"); if (strCheck[jj] == '1') { strMaintenance.Append("<b>M</b>"); } else { strMaintenance.Append("-"); } strMaintenance.Append("</td>"); } strMaintenance.Append("</tr>"); } } } else { lblHA.Text = "N / A"; lblMainframe.Text = "N / A"; } // APPROVALS rptWorkflow.DataSource = oDesign.LoadWorkflow(intID); rptWorkflow.DataBind(); lblWorkflow.Visible = (rptWorkflow.Items.Count == 0); } } }
private void LoadServer() { string strName = oFunction.decryptQueryString(Request.QueryString["n"]); txtName.Text = strName; bool boolFound = false; bool boolAlready = false; DataSet dsRecom = oAsset.GetDecommissionRecommission(strName); foreach (DataRow drRecom in dsRecom.Tables[0].Rows) { if (drRecom["name"].ToString().ToUpper().Trim() == strName.ToUpper().Trim()) { DateTime datDecom = DateTime.Now; boolAlready = true; lblAlreadySerial.Text = drRecom["serial"].ToString(); lblAlreadySerialDR.Text = drRecom["serialdr"].ToString(); lblAlreadyBy.Text = drRecom["username"].ToString(); lblAlreadyOn.Text = drRecom["created"].ToString(); lblAlreadyReason.Text = drRecom["reason"].ToString(); lblAlreadyPower.Text = drRecom["decom"].ToString(); if (drRecom["running"].ToString() == "-1") { lblAlreadyStatus.Text = "Manual Intervention Required"; } else if (drRecom["running"].ToString() == "-2") { boolAlready = false; lblAlreadyStatus.Text = "Cancelled"; } else if (drRecom["running"].ToString() == "2") { lblAlreadyStatus.Text = "In Progress"; } else if (drRecom["running"].ToString() == "3") { lblAlreadyStatus.Text = "Completed"; } else if (drRecom["running"].ToString() == "1") { lblAlreadyStatus.Text = "Running..."; } else if (drRecom["running"].ToString() == "0") { if (drRecom["recommissioned"].ToString() != "") { boolAlready = false; lblAlreadyStatus.Text = "Recommissioned on " + drRecom["recommissioned"].ToString(); } else if (drRecom["destroyed"].ToString() != "") { lblAlreadyStatus.Text = "Powered off on " + drRecom["turnedoff"].ToString(); lblAlreadyStatus.Text += "<br/>Finished on " + drRecom["destroyed"].ToString(); } else if (drRecom["destroy"].ToString() != "") { lblAlreadyStatus.Text = "Powered off on " + drRecom["turnedoff"].ToString(); lblAlreadyStatus.Text += "<br/>Will be finished on " + drRecom["destroy"].ToString(); } else if (drRecom["turnedoff"].ToString() != "") { lblAlreadyStatus.Text = "Powered off on " + drRecom["turnedoff"].ToString(); } else { lblAlreadyStatus.Text = "Will be powered off on " + drRecom["decom"].ToString(); } } else { lblAlreadyStatus.Text = "Status Unavailable"; } } } if (boolAlready == false) { DataSet ds = oServer.GetDecommission(strName); if (ds.Tables[0].Rows.Count == 1) { boolFound = true; bool boolPermit = false; int intServer = Int32.Parse(ds.Tables[0].Rows[0]["id"].ToString()); int intRequest = Int32.Parse(Request.QueryString["rid"]); int intProject = oRequest.GetProjectNumber(intRequest); Projects oProject = new Projects(intProfile, dsn); bool boolDemo = false; string strNumber = oProject.Get(intProject, "number"); // Check to see if Demo DataSet dsDemo = oFunction.GetSetupValuesByKey("DEMO_PROJECT"); foreach (DataRow drDemo in dsDemo.Tables[0].Rows) { if (strNumber == drDemo["Value"].ToString()) { boolDemo = true; break; } } if (boolDemo == false && (String.IsNullOrEmpty(oServer.Get(intServer, "build_ready")) == true || oServer.Get(intServer, "rebuilding") == "1")) { panBuilding.Visible = true; btnNext.Enabled = false; } else { int intAnswer = 0; if (ds.Tables[0].Rows[0]["answerid"].ToString() != "") { intAnswer = Int32.Parse(ds.Tables[0].Rows[0]["answerid"].ToString()); } int intUser = 0; if (ds.Tables[0].Rows[0]["userid"].ToString() != "") { intUser = Int32.Parse(ds.Tables[0].Rows[0]["userid"].ToString()); } int intOwner = 0; int intPrimary = 0; int intSecondary = 0; int intRequestor = 0; string strAgree = ""; if (intAnswer > 0) { if (oForecast.GetAnswer(intAnswer, "appcontact") != "") { intOwner = Int32.Parse(oForecast.GetAnswer(intAnswer, "appcontact")); } if (oForecast.GetAnswer(intAnswer, "admin1") != "") { intPrimary = Int32.Parse(oForecast.GetAnswer(intAnswer, "admin1")); } if (oForecast.GetAnswer(intAnswer, "admin2") != "") { intSecondary = Int32.Parse(oForecast.GetAnswer(intAnswer, "admin2")); } if (oForecast.GetAnswer(intAnswer, "userid") != "") { intRequestor = Int32.Parse(oForecast.GetAnswer(intAnswer, "userid")); } if (intProfile == intOwner || intProfile == intPrimary || intProfile == intSecondary || intProfile == intRequestor) { boolPermit = true; } if (intOwner > 0) { strAgree += " - " + oUser.GetFullName(intOwner) + " (" + oUser.GetName(intOwner) + ")\\n"; } if (intPrimary > 0) { strAgree += " - " + oUser.GetFullName(intPrimary) + " (" + oUser.GetName(intPrimary) + ")\\n"; } if (intSecondary > 0) { strAgree += " - " + oUser.GetFullName(intSecondary) + " (" + oUser.GetName(intSecondary) + ")\\n"; } if (intRequestor > 0) { strAgree += " - " + oUser.GetFullName(intRequestor) + " (" + oUser.GetName(intRequestor) + ")\\n"; } } if (oApplication.Get(intApplication, "decom") == "1" || oUser.IsAdmin(intProfile) || intProfile == intUser) { boolPermit = true; } if (boolPermit == true) { chkAgree.Attributes.Add("onclick", "ShowAgreeAlert(this,\"" + strAgree + "\");"); int intAsset = 0; int intAssetDR = 0; DataSet dsAsset = oServer.GetAssets(intServer); foreach (DataRow drAsset in dsAsset.Tables[0].Rows) { if (drAsset["latest"].ToString() == "1") { intAsset = Int32.Parse(drAsset["assetid"].ToString()); } if (drAsset["dr"].ToString() == "1") { intAssetDR = Int32.Parse(drAsset["assetid"].ToString()); } } if (intAsset > 0) { panFound.Visible = true; panDetail.Visible = true; int intClass = 0; int intEnv = 0; int intAddress = 0; try { intClass = Int32.Parse(oAsset.GetServerOrBlade(intAsset, "classid")); intEnv = Int32.Parse(oAsset.GetServerOrBlade(intAsset, "environmentid")); intAddress = Int32.Parse(oAsset.GetServerOrBlade(intAsset, "addressid")); } catch { DataSet dsCatch = oServer.GetAsset(intAsset); if (dsCatch.Tables[0].Rows.Count > 0) { intClass = Int32.Parse(dsCatch.Tables[0].Rows[0]["classid"].ToString()); intEnv = Int32.Parse(dsCatch.Tables[0].Rows[0]["environmentid"].ToString()); intAddress = Int32.Parse(dsCatch.Tables[0].Rows[0]["addressid"].ToString()); } } if (intClass == 0 && intAnswer > 0) { Int32.TryParse(oForecast.GetAnswer(intAnswer, "classid"), out intClass); } if (intEnv == 0 && intAnswer > 0) { Int32.TryParse(oForecast.GetAnswer(intAnswer, "environmentid"), out intEnv); } if (intAddress == 0 && intAnswer > 0) { Int32.TryParse(oForecast.GetAnswer(intAnswer, "addressid"), out intAddress); } int intModel = 0; if (oAsset.Get(intAsset, "modelid") != "") { intModel = Int32.Parse(oAsset.Get(intAsset, "modelid")); } lblModel.Text = oModelsProperties.Get(intModel, "name"); lblModel.ToolTip = "ModelID: " + intModel.ToString(); lblSerial.Text = oAsset.Get(intAsset, "serial"); lblSerial.ToolTip = "AssetID: " + intAsset.ToString(); if (intAssetDR > 0) { panDR.Visible = true; lblSerialDR.Text = oAsset.Get(intAssetDR, "serial"); lblSerialDR.ToolTip = "AssetID: " + intAssetDR.ToString(); } lblClass.Text = oClass.Get(intClass, "name"); lblClass.ToolTip = intClass.ToString(); lblEnvironment.Text = oEnvironment.Get(intEnv, "name"); lblAddress.Text = oLocation.GetFull(intAddress); panValid.Visible = true; lblId.Text = intServer.ToString(); btnNext.Attributes.Add("onclick", "return ValidateCheck('" + chkAgree.ClientID + "','Please check the box stating that you agree to the disclaimer notice')" + " && ValidateDate('" + txtDate.ClientID + "','Please enter a valid date')" + " && ValidateDateToday('" + txtDate.ClientID + "','The date must occur after today')" + GetClass(intServer, intClass, intEnv) + " && ValidateText('" + txtReason.ClientID + "','Please enter a reason')" + " && ValidateRadioButtons('" + radRetrieveYes.ClientID + "','" + radRetrieveNo.ClientID + "','Please select whether or not special hardware should be retrieved')" + " && (document.getElementById('" + radRetrieveYes.ClientID + "').checked == false || (document.getElementById('" + radRetrieveYes.ClientID + "').checked == true && ValidateText('" + txtRetrieve.ClientID + "','Please provide a description')))" + " && (document.getElementById('" + radRetrieveYes.ClientID + "').checked == false || (document.getElementById('" + radRetrieveYes.ClientID + "').checked == true && ValidateText('" + txtRetrieveAddress.ClientID + "','Please provide an address')))" + " && (document.getElementById('" + radRetrieveYes.ClientID + "').checked == false || (document.getElementById('" + radRetrieveYes.ClientID + "').checked == true && ValidateText('" + txtRetrieveLocator.ClientID + "','Please provide a locator')))" + " && ProcessButton(this)" + ";"); } else { boolFound = false; } } else { panInvalid.Visible = true; if (intUser > 0) { strContacts += "<tr><td>Server Owner:</td><td>" + oUser.GetFullName(intUser) + " (" + oUser.GetName(intUser) + ")" + "</td></tr>"; } if (intOwner > 0) { strContacts += "<tr><td>Departmental Manager:</td><td>" + oUser.GetFullName(intOwner) + " (" + oUser.GetName(intOwner) + ")" + "</td></tr>"; } if (intPrimary > 0) { strContacts += "<tr><td>Application Technical Lead:</td><td>" + oUser.GetFullName(intPrimary) + " (" + oUser.GetName(intPrimary) + ")" + "</td></tr>"; } if (intSecondary > 0) { strContacts += "<tr><td>Administrative Contact:</td><td>" + oUser.GetFullName(intSecondary) + " (" + oUser.GetName(intSecondary) + ")" + "</td></tr>"; } if (intRequestor > 0) { strContacts += "<tr><td>Design Initiated By:</td><td>" + oUser.GetFullName(intRequestor) + " (" + oUser.GetName(intRequestor) + ")" + "</td></tr>"; } DataSet dsDecoms = oApplication.GetDecoms(); if (dsDecoms.Tables[0].Rows.Count > 0) { strContacts += "<tr><td colspan=\"2\">Alternatively, you can contact a resource from one of the following departments:</td></tr>"; foreach (DataRow drDecom in dsDecoms.Tables[0].Rows) { strContacts += "<tr><td></td><td>" + drDecom["name"].ToString() + "</td></tr>"; } } btnNext.Enabled = false; } } } else if (ds.Tables[0].Rows.Count > 1) { boolFound = true; panMore.Visible = true; btnNext.Enabled = false; } if (boolFound == false) { panNotFound.Visible = true; lblName.Text = strName; if (Request.QueryString["yn"] != null) { if (Request.QueryString["yn"] == "y") { panConfirm.Visible = true; radYes.Checked = true; LoadLists(); int intClass = 0; if (Request.QueryString["cid"] != null && Request.QueryString["cid"] != "") { intClass = Int32.Parse(Request.QueryString["cid"]); } if (oClass.Get(intClass).Tables[0].Rows.Count > 0) { panClass.Visible = true; ddlClass.SelectedValue = intClass.ToString(); ddlEnvironment.Enabled = true; Environments oEnvironment = new Environments(intProfile, dsn); ddlEnvironment.DataValueField = "id"; ddlEnvironment.DataTextField = "name"; ddlEnvironment.DataSource = oClass.GetEnvironment(intClass, 0); ddlEnvironment.DataBind(); ddlEnvironment.Items.Insert(0, new ListItem("-- SELECT --", "0")); int intEnv = 0; if (Request.QueryString["eid"] != null && Request.QueryString["eid"] != "") { intEnv = Int32.Parse(Request.QueryString["eid"]); } if (oEnvironment.Get(intEnv).Tables[0].Rows.Count > 0) { panEnvironment.Visible = true; panDetail.Visible = true; ddlEnvironment.SelectedValue = intEnv.ToString(); lblId.Text = "0"; btnNext.Attributes.Add("onclick", "return ValidateDropDown('" + ddlPlatform.ClientID + "','Please select a platform')" + " && ValidateDropDown('" + ddlPlatformType.ClientID + "','Please select a type')" + " && ValidateDropDown('" + ddlPlatformModel.ClientID + "','Please select a model')" + " && ValidateDropDown('" + ddlPlatformModelProperty.ClientID + "','Please select a model property')" + " && ValidateText('" + txtSerial.ClientID + "','Please enter a serial number')" + " && ValidateHidden0('" + hdnLocation.ClientID + "','ddlState','Please select a location')" + " && ValidateCheck('" + chkAgree.ClientID + "','Please check the box stating that you agree to the disclaimer notice')" + " && ValidateDate('" + txtDate.ClientID + "','Please enter a valid date')" + " && ValidateDateToday('" + txtDate.ClientID + "','The date must occur after today')" + GetClass(0, intClass, intEnv) + " && ValidateText('" + txtReason.ClientID + "','Please enter a reason')" + " && ValidateRadioButtons('" + radRetrieveYes.ClientID + "','" + radRetrieveNo.ClientID + "','Please select whether or not special hardware should be retrieved')" + " && (document.getElementById('" + radRetrieveYes.ClientID + "').checked == false || (document.getElementById('" + radRetrieveYes.ClientID + "').checked == true && ValidateText('" + txtRetrieve.ClientID + "','Please provide a description')))" + " && (document.getElementById('" + radRetrieveYes.ClientID + "').checked == false || (document.getElementById('" + radRetrieveYes.ClientID + "').checked == true && ValidateText('" + txtRetrieveAddress.ClientID + "','Please provide an address')))" + " && (document.getElementById('" + radRetrieveYes.ClientID + "').checked == false || (document.getElementById('" + radRetrieveYes.ClientID + "').checked == true && ValidateText('" + txtRetrieveLocator.ClientID + "','Please provide a locator')))" + " && ProcessButton(this)" + ";"); } else { btnNext.Enabled = false; } } else { btnNext.Enabled = false; } } } else { btnNext.Enabled = false; } } } else { panAlready.Visible = true; btnNext.Enabled = false; } }