protected void btnLoad1_Click(Object Sender, EventArgs e) { string strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=f:\\Mnemonic.xls;Extended Properties=Excel 8.0;"; OleDbDataAdapter myCommand = new OleDbDataAdapter("SELECT * FROM [Mnemonic$]", strConn); DataSet ds = new DataSet(); myCommand.Fill(ds, "ExcelInfo"); foreach (DataRow dr in ds.Tables[0].Rows) { if (dr[0].ToString().Trim() == "") { break; } string strCode = dr[0].ToString().Trim(); string strName = dr[1].ToString().Trim(); DataSet dsImport = oMnemonic.Get(strName, strCode); if (dsImport.Tables[0].Rows.Count == 0) { oMnemonic.Add(strName, strCode, "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", 1); intCount++; } else { intDuplicate++; } } Response.Write("Done = " + intCount.ToString() + "<br/>"); Response.Write("Duplicate = " + intDuplicate.ToString() + "<br/>"); }
protected void Page_Load(object sender, EventArgs e) { Mnemonic oMnemonic = new Mnemonic(0, dsn); if (Request.QueryString["u"] != null && Request.QueryString["u"] == "GET") { XmlDocument oDoc = new XmlDocument(); oDoc.Load(Request.InputStream); int intMnemonic = Int32.Parse(Server.UrlDecode(oDoc.ChildNodes[0].ChildNodes[0].InnerText)); string strField = Server.UrlDecode(oDoc.ChildNodes[0].ChildNodes[1].InnerText); Response.ContentType = "text/xml"; Response.Write("<values><value>" + oMnemonic.Get(intMnemonic, strField) + "</value></values>"); Response.End(); } }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["u"] != null && Request.QueryString["u"] == "GET") { XmlDocument oDoc = new XmlDocument(); oDoc.Load(Request.InputStream); Mnemonic oMnemonic = new Mnemonic(0, dsn); DataSet ds = oMnemonic.Get(Server.UrlDecode(oDoc.FirstChild.InnerXml)); Response.ContentType = "application/xml"; Response.Write("<values>"); foreach (DataRow dr in ds.Tables[0].Rows) { Response.Write("<value>" + dr["id"].ToString() + "</value><text><![CDATA[" + dr["factory_code"].ToString() + " - " + dr["name"].ToString() + "]]></text>"); } Response.Write("</values>"); Response.End(); } }
protected void btnSubmit_Click(Object Sender, EventArgs e) { int intID = -100; string strError = ""; string strPrefixError = ""; bool boolNCB = (Request.QueryString["type"] == "NCB"); bool boolPNC = (Request.QueryString["type"] == "PNC"); string strFieldCode = ""; string strFieldSpecific = ""; if (boolNCB == true) { strFieldCode = "code"; } else if (boolPNC == true) { strFieldCode = "factory_code"; strFieldSpecific = "factory_code_specific"; } string strComponentCode = ""; string strComponentSpecific = ""; if (Request.Form["hdnComponents"] != null) { string strComponents = Request.Form["hdnComponents"]; if (strComponents != "") { while (strComponents != "") { int intDetail = Int32.Parse(strComponents.Substring(0, strComponents.IndexOf("&"))); if (intDetail > 0) { int intComponent = 0; if (Int32.TryParse(oServerName.GetComponentDetail(intDetail, "componentid"), out intComponent) == true) { string strCode = oServerName.GetComponent(intComponent, strFieldCode); if (strPrefixError != "") { strPrefixError += "\\n"; } strPrefixError += " - " + oServerName.GetComponent(intComponent, "name"); if (strCode.Trim() != "") { if (strFieldSpecific != "") { strComponentSpecific = oServerName.GetComponent(intComponent, strFieldSpecific).Trim(); } strComponentCode = strCode.Trim(); break; } } } strComponents = strComponents.Substring(strComponents.IndexOf("&") + 1); } } } if (ddlApplication.SelectedIndex > 0) { strPrefixError = " - " + ddlApplication.SelectedItem.Text; } int intServerType = 0; if (ddlApplication.SelectedIndex > 0) { intServerType = Int32.Parse(ddlApplication.SelectedItem.Value); } string strPrefix = ""; if (intServerType > 0) { if (strFieldCode != "") { strPrefix = oServerName.GetApplication(intServerType, strFieldCode).Trim(); } if (strFieldSpecific != "") { strComponentSpecific = oServerName.GetApplication(intServerType, strFieldSpecific).Trim(); } } else { strPrefix = strComponentCode; } strPrefix = strPrefix.ToUpper().Trim(); if (strPrefix == "") { strError = "The following component(s) or server type have not been configured for server naming...\\n\\n" + strPrefixError; } else { int intOS = Int32.Parse(ddlOS.SelectedItem.Value); if (boolNCB == true) { if (oOperatingSystems.IsMidrange(intOS) == true) { strPrefix = "X" + strPrefix.Substring(0, 2); } switch (ddlCluster.SelectedItem.Value) { case "1": // NSQ = Node of a Cluster if (strPrefix.StartsWith("X") == true) { strPrefix = "XN" + strPrefix[1].ToString(); } else { strPrefix = "N" + strPrefix.Substring(0, 2); } break; case "2": // CLU = Cluster Name strPrefix = "CLU"; break; case "3": // CSQ = Cluster Instance Name if (strPrefix.StartsWith("X") == true) { strPrefix = "XC" + strPrefix[1].ToString(); } else { strPrefix = "C" + strPrefix.Substring(0, 2); } break; } intID = oServerName.Add(Int32.Parse(ddlClass.SelectedItem.Value), Int32.Parse(ddlEnvironment.SelectedItem.Value), Int32.Parse(Request.Form[hdnParent.UniqueID]), strPrefix, intProfile, txtName.Text, 1, dsnServiceEditor); } else if (boolPNC == true) { string strOS = oOperatingSystems.Get(intOS, "factory_code"); if (strOS == "") { strError = "The selected OPERATING SYSTEM has not been configured for server naming..."; } else { int intAddress = Int32.Parse(Request.QueryString["aid"]); string strLocation = oLocation.GetAddress(intAddress, "factory_code"); if (strOS == "") { strError = "The selected LOCATION has not been configured for server naming..."; } else { int intMnemonic = Int32.Parse(Request.Form[hdnMnemonic.UniqueID]); string strMnemonic = oMnemonic.Get(intMnemonic, "factory_code"); if (strOS == "") { strError = "The selected MNEMONIC has not been configured for server naming..."; } else { int intClass = Int32.Parse(Request.QueryString["cid"]); int intEnv = Int32.Parse(Request.QueryString["eid"]); string strEnvironment = oClass.Get(intClass, "factory_code"); if (strOS == "") { strError = "The selected CLASS has not been configured for server naming..."; } else { // Get Server Function string strFunction = strComponentCode; if (strOS == "") { strError = "The selected FUNCTION has not been configured for server naming..."; } else { // Get Specifics string strSpecific = strComponentSpecific; switch (ddlCluster.SelectedItem.Value) { case "1": // NSQ = Node of a Cluster strSpecific = "Z"; break; case "2": // CLU = Cluster Name strSpecific = ""; break; case "3": // CSQ = Cluster Instance Name strSpecific = ""; break; } intID = oServerName.AddFactory(strOS, strLocation, strMnemonic, strEnvironment, intClass, intEnv, strFunction, strSpecific, intProfile, txtName.Text, dsnServiceEditor); } } } } } } } Redirect(intID, strError); }
protected void Page_Load(object sender, EventArgs e) { Int32.TryParse(Request.Cookies["profileid"].Value, out intProfile); oServer = new Servers(intProfile, dsn); oServerName = new ServerName(intProfile, dsn); oWorkstation = new Workstations(intProfile, dsn); oAsset = new Asset(intProfile, dsnAsset, dsn); Int32.TryParse(Request.QueryString["assetid"], out intAsset); bool boolMessage = false; if (Request.QueryString["changed"] != null) { boolMessage = true; Page.ClientScript.RegisterStartupScript(typeof(Page), "changed", "<script type=\"text/javascript\">alert('Device Name Changed Successfully!');RefreshOpeningWindow();window.close();<" + "/" + "script>"); } if (Request.QueryString["cleared"] != null) { boolMessage = true; Page.ClientScript.RegisterStartupScript(typeof(Page), "cleared", "<script type=\"text/javascript\">alert('Device Name Cleared Successfully!');RefreshOpeningWindow();window.close();<" + "/" + "script>"); } if (Request.QueryString["error"] != null) { boolMessage = true; Page.ClientScript.RegisterStartupScript(typeof(Page), "bad", "<script type=\"text/javascript\">alert('There was a problem changing the device name...\\n\\n" + Request.QueryString["error"] + "');<" + "/" + "script>"); } if (Int32.TryParse(oAsset.GetStatus(intAsset, "status"), out intStatus) == true) { if (!IsPostBack) { string strAdditional = ""; if (intAsset > 0 && Int32.TryParse(oAsset.GetStatus(intAsset, "status"), out intStatus) == true) { if (Request.QueryString["clear"] != null) { if (Request.QueryString["clear"] == "Clear") { radClear.SelectedValue = "Clear"; if (intStatus == (int)AssetStatus.InUse) { lblError.Text = "Can not clear the name of an asset while its Status is "In Use"."; } panClear.Visible = true; panID.Visible = true; } if (Request.QueryString["clear"] == "Change") { radClear.SelectedValue = "Change"; panChange.Visible = true; panID.Visible = true; } } DataSet dsWorkstations = oWorkstation.GetVirtualAsset(intAsset); if (dsWorkstations.Tables[0].Rows.Count == 1) { radClear.Items[0].Enabled = false; radClear.Items[0].Text += " - cannot clear device name for workstations"; ddlType.SelectedValue = "-1"; int intWorkstation = 0; int intName = 0; if (Int32.TryParse(dsWorkstations.Tables[0].Rows[0]["id"].ToString(), out intWorkstation) == true) { lblID.Text = intWorkstation.ToString(); if (Int32.TryParse(oWorkstation.GetVirtual(intWorkstation, "nameid"), out intName) == true) { lblNameID.Text = intName.ToString(); lblName.Text = oWorkstation.GetName(intName); lblNew.Text = lblName.Text; panWorkstation.Visible = true; DataSet dsWorkstation = oWorkstation.GetNameId(intName); if (dsWorkstation.Tables[0].Rows.Count == 1) { DataRow drWorkstation = dsWorkstation.Tables[0].Rows[0]; #region WORKSTATION NAMING // Environment ddlWorkstationEnvironment.Attributes.Add("onchange", "UpdateNamingDDL(this,'" + lblWorkstationEnvironment.ClientID + "','WORKSTATION');"); lblWorkstationEnvironment.Text = drWorkstation["environment"].ToString(); ddlWorkstationEnvironment.SelectedValue = lblWorkstationEnvironment.Text; // Code ddlWorkstationCode.Attributes.Add("onchange", "UpdateNamingDDL(this,'" + lblWorkstationCode.ClientID + "','WORKSTATION');"); lblWorkstationCode.Text = drWorkstation["code"].ToString(); ddlWorkstationCode.SelectedValue = lblWorkstationCode.Text; //Sequence txtWorkstationSequence.Attributes.Add("onblur", "UpdateNamingText(this,'" + lblWorkstationSequence.ClientID + "','WORKSTATION');"); lblWorkstationSequence.Text = drWorkstation["prefix1"].ToString() + drWorkstation["prefix2"].ToString() + drWorkstation["prefix3"].ToString() + drWorkstation["prefix4"].ToString() + drWorkstation["prefix5"].ToString() + drWorkstation["prefix6"].ToString(); txtWorkstationSequence.Text = lblWorkstationSequence.Text; panButtons.Visible = (Request.QueryString["clear"] != null); lblNew.Text = lblWorkstationEnvironment.Text + lblWorkstationCode.Text + lblWorkstationIdentifier.Text + lblWorkstationSequence.Text; strAdditional += "ValidateTextLength('" + txtWorkstationSequence.ClientID + "', 'Please enter a valid sequence\\n\\n - Must be exactly 6 characters in length', 6) && "; #endregion } } else { lblError.Text = "Invalid Workstation Name Record(" + oWorkstation.GetVirtual(intWorkstation, "nameid") + ")"; } } else { lblError.Text = "Invalid Workstation Record(" + dsWorkstations.Tables[0].Rows[0]["id"].ToString() + ")"; } } else { DataSet dsServers = oServer.GetAssetsAsset(intAsset); if (dsServers.Tables[0].Rows.Count == 1) { int intServer = 0; int intName = 0; if (Int32.TryParse(dsServers.Tables[0].Rows[0]["serverid"].ToString(), out intServer) == true) { lblID.Text = intServer.ToString(); if (Int32.TryParse(oServer.Get(intServer, "nameid"), out intName) == true) { lblNameID.Text = intName.ToString(); lblName.Text = oServer.GetName(intServer, true); if (oServer.Get(intServer, "pnc") == "1") { ddlType.SelectedValue = "1"; panPNC.Visible = true; DataSet dsPNC = oServerName.GetFactory(intName); if (dsPNC.Tables[0].Rows.Count == 1 || intName == 0) { //Operating System OperatingSystems oOperatingSystem = new OperatingSystems(intProfile, dsn); DataSet dsOS = oOperatingSystem.Gets(0, 1); DataView dvOS = dsOS.Tables[0].DefaultView; dvOS.RowFilter = "factory_code <> '' AND factory_code IS NOT NULL"; ddlPNCOS.DataTextField = "name"; ddlPNCOS.DataValueField = "factory_code"; ddlPNCOS.DataSource = dvOS; ddlPNCOS.DataBind(); ddlPNCOS.Attributes.Add("onchange", "UpdateNamingDDL(this,'" + lblPNCOS.ClientID + "','PNC');"); //Location Locations oLocation = new Locations(intProfile, dsn); DataSet dsLocation = oLocation.GetAddresss(1); DataView dvLocation = dsLocation.Tables[0].DefaultView; dvLocation.RowFilter = "factory_code <> 'X' AND factory_code <> '' AND factory_code IS NOT NULL"; ddlPNCLocation.DataTextField = "commonname"; ddlPNCLocation.DataValueField = "factory_code"; ddlPNCLocation.DataSource = dvLocation; ddlPNCLocation.DataBind(); ddlPNCLocation.Items.Add(new ListItem("Other", "X")); ddlPNCLocation.Attributes.Add("onchange", "UpdateNamingDDL(this,'" + lblPNCLocation.ClientID + "','PNC');"); //Mnemonic Variables oVariable = new Variables(intEnvironment); Mnemonic oMnemonic = new Mnemonic(intProfile, dsn); txtPNCMnemonic.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'350','150','" + divPNCMnemonic.ClientID + "','" + lstPNCMnemonic.ClientID + "','" + hdnPNCMnemonic.ClientID + "','" + oVariable.URL() + "/frame/ajax/ajax_mnemonics.aspx',2);"); lstPNCMnemonic.Attributes.Add("ondblclick", "AJAXClickRow();"); hdnPNCMnemonic.Attributes.Add("onpropertychange", "UpdateNamingMnemonic('" + hdnPNCMnemonic.ClientID + "','" + txtPNCMnemonic.ClientID + "','" + lblPNCMnemonic.ClientID + "','PNC');"); //Environment Classes oClass = new Classes(intProfile, dsn); DataSet dsClass = oClass.Gets(1); DataView dvClass = dsClass.Tables[0].DefaultView; dvClass.RowFilter = "factory_code <> '' AND factory_code IS NOT NULL"; ddlPNCEnvironment.DataTextField = "name"; ddlPNCEnvironment.DataValueField = "factory_code"; ddlPNCEnvironment.DataSource = dvClass; ddlPNCEnvironment.DataBind(); ddlPNCEnvironment.Attributes.Add("onchange", "UpdateNamingDDL(this,'" + lblPNCEnvironment.ClientID + "','PNC');"); //Sequence txtPNCSequence.Attributes.Add("onblur", "UpdateNamingText(this,'" + lblPNCSequence.ClientID + "','PNC');"); //Function ddlPNCFunction.Attributes.Add("onchange", "UpdateNamingDDL(this,'" + lblPNCFunction.ClientID + "','PNC');"); //Specific ddlPNCSpecific.Attributes.Add("onchange", "UpdateNamingDDL(this,'" + lblPNCSpecific.ClientID + "','PNC');"); #region PNC NAMING if (intName > 0) { DataRow drPNC = dsPNC.Tables[0].Rows[0]; //Operating System lblPNCOS.Text = drPNC["os"].ToString(); ddlPNCOS.SelectedValue = lblPNCOS.Text; //Location lblPNCLocation.Text = drPNC["location"].ToString(); ddlPNCLocation.SelectedValue = lblPNCLocation.Text; //Mnemonic lblPNCMnemonic.Text = drPNC["mnemonic"].ToString(); DataSet dsMnemonic = oMnemonic.Get(lblPNCMnemonic.Text + " - "); int intMnemonic = Int32.Parse(dsMnemonic.Tables[0].Rows[0]["id"].ToString()); hdnPNCMnemonic.Value = intMnemonic.ToString(); txtPNCMnemonic.Text = lblPNCMnemonic.Text + " - " + oMnemonic.Get(intMnemonic, "name"); //Environment lblPNCEnvironment.Text = drPNC["environment"].ToString(); ddlPNCEnvironment.SelectedValue = lblPNCEnvironment.Text; //Sequence lblPNCSequence.Text = drPNC["name1"].ToString() + drPNC["name2"].ToString(); txtPNCSequence.Text = lblPNCSequence.Text; //Function lblPNCFunction.Text = drPNC["func"].ToString(); ddlPNCFunction.SelectedValue = lblPNCFunction.Text; //Specific lblPNCSpecific.Text = drPNC["specific"].ToString(); ddlPNCSpecific.SelectedValue = lblPNCSpecific.Text; } else { //Operating System ddlPNCOS.Items.Insert(0, new ListItem("-- SELECT --", "0")); strAdditional += "ValidateDropDown('" + ddlPNCOS.ClientID + "','Please select an Operating System') && "; //Location ddlPNCLocation.Items.Insert(0, new ListItem("-- SELECT --", "0")); strAdditional += "ValidateDropDown('" + ddlPNCLocation.ClientID + "','Please select a Location') && "; //Mnemonic strAdditional += "ValidateHidden0('" + hdnPNCMnemonic.ClientID + "','" + txtPNCMnemonic.ClientID + "','Please enter the mnemonic') && "; //Environment ddlPNCEnvironment.Items.Insert(0, new ListItem("-- SELECT --", "0")); strAdditional += "ValidateDropDown('" + ddlPNCEnvironment.ClientID + "','Please select an Environment') && "; //Sequence - Done down below //Function ddlPNCFunction.Items.Insert(0, new ListItem("-- SELECT --", "0")); strAdditional += "ValidateDropDown('" + ddlPNCFunction.ClientID + "','Please select a Function') && "; //Specific ddlPNCSpecific.Items.Insert(0, new ListItem("-- SELECT --", "0")); strAdditional += "ValidateDropDown('" + ddlPNCSpecific.ClientID + "','Please select an Option') && "; } panButtons.Visible = (Request.QueryString["clear"] != null); lblNew.Text = lblPNCOS.Text + lblPNCLocation.Text + lblPNCMnemonic.Text + lblPNCEnvironment.Text + lblPNCSequence.Text + lblPNCFunction.Text + lblPNCSpecific.Text; strAdditional += "ValidateTextLength('" + txtPNCSequence.ClientID + "', 'Please enter a valid sequence\\n\\n - Must be exactly 2 characters in length', 2) && "; #endregion } else { lblError.Text = "PNC Names (" + dsPNC.Tables[0].Rows.Count.ToString() + ")"; } } else { ddlType.SelectedValue = "0"; panNCB.Visible = true; DataSet dsNCB = oServerName.Get(intName); if (dsNCB.Tables[0].Rows.Count == 1 || intName == 0) { //State txtNCBState.Attributes.Add("onblur", "UpdateNamingText(this,'" + lblNCBState.ClientID + "','NCB');"); //City txtNCBCity.Attributes.Add("onblur", "UpdateNamingText(this,'" + lblNCBCity.ClientID + "','NCB');"); //Function DataSet dsFunction = oServerName.GetFunctions(); DataView dvFunction = dsFunction.Tables[0].DefaultView; dvFunction.RowFilter = "code <> '' AND code IS NOT NULL"; ddlNCBFunction.DataTextField = "name"; ddlNCBFunction.DataValueField = "code"; ddlNCBFunction.DataSource = dvFunction; ddlNCBFunction.DataBind(); ddlNCBFunction.Attributes.Add("onchange", "UpdateNamingDDL(this,'" + lblNCBFunction.ClientID + "','NCB');"); //SiteCode ddlNCBSiteCode.Attributes.Add("onchange", "UpdateNamingDDL(this,'" + lblNCBSiteCode.ClientID + "','NCB');"); //Sequence txtNCBSequence.Attributes.Add("onblur", "UpdateNamingText(this,'" + lblNCBSequence.ClientID + "','NCB');"); #region NCB NAMING if (intName > 0) { DataRow drNCB = dsNCB.Tables[0].Rows[0]; string strPrefix = drNCB["prefix1"].ToString(); string strPrefix1 = strPrefix.Substring(0, 2); string strPrefix2 = strPrefix.Substring(2, 3); //State lblNCBState.Text = strPrefix1; txtNCBState.Text = lblNCBState.Text; //City lblNCBCity.Text = strPrefix2; txtNCBCity.Text = lblNCBCity.Text; //Function lblNCBFunction.Text = drNCB["prefix2"].ToString(); ddlNCBFunction.SelectedValue = lblNCBFunction.Text; //SiteCode lblNCBSiteCode.Text = drNCB["sitecode"].ToString(); ddlNCBSiteCode.SelectedValue = lblNCBSiteCode.Text; //Sequence lblNCBSequence.Text = drNCB["name1"].ToString() + drNCB["name2"].ToString(); txtNCBSequence.Text = lblNCBSequence.Text; } else { //State - Done down below //City - Done down below //Function ddlNCBFunction.Items.Insert(0, new ListItem("-- SELECT --", "0")); strAdditional += "ValidateDropDown('" + ddlNCBFunction.ClientID + "','Please select a Function') && "; //SiteCode ddlNCBSiteCode.Items.Insert(0, new ListItem("-- SELECT --", "0")); strAdditional += "ValidateDropDown('" + ddlNCBSiteCode.ClientID + "','Please select a Site Code') && "; //Sequence - Done down below } panButtons.Visible = (Request.QueryString["clear"] != null); lblNew.Text = lblNCBState.Text + lblNCBCity.Text + lblNCBFunction.Text + lblNCBSiteCode.Text + lblNCBSequence.Text; strAdditional += "ValidateTextLength('" + txtNCBState.ClientID + "', 'Please enter a valid state\\n\\n - Must be exactly 2 characters in length', 2) && "; strAdditional += "ValidateTextLength('" + txtNCBCity.ClientID + "', 'Please enter a valid city\\n\\n - Must be exactly 3 characters in length', 3) && "; strAdditional += "ValidateTextLength('" + txtNCBSequence.ClientID + "', 'Please enter a valid sequence\\n\\n - Must be exactly 2 characters in length', 2) && "; #endregion } else { lblError.Text = "NCB Names (" + dsNCB.Tables[0].Rows.Count.ToString() + ")"; } } } else { lblError.Text = "Invalid Server Name Record(" + oServer.Get(intServer, "nameid") + ")"; } } else { lblError.Text = "Invalid Server Record(" + dsServers.Tables[0].Rows[0]["serverid"].ToString() + ")"; } } else { if (dsWorkstations.Tables[0].Rows.Count > 1) { lblError.Text = "Workstations (" + dsWorkstations.Tables[0].Rows.Count.ToString() + ")"; } else if (dsServers.Tables[0].Rows.Count > 1) { lblError.Text = "Servers (" + dsServers.Tables[0].Rows.Count.ToString() + ")"; } else { radClear.Items[1].Enabled = false; panButtons.Visible = (Request.QueryString["clear"] != null); //lblError.Text = "Asset Not Found"; } } } if (lblName.Text == "") { lblName.Text = "---"; } else { lblNew.CssClass = (lblNew.Text == lblName.Text ? "header" : "redheader"); } if (panChange.Visible == true) { btnSubmit.Attributes.Add("onclick", "return " + strAdditional + " IsOKtoChange() && confirm('WARNING: This will permanently change the device name and release the previous name for re-use (if applicable)!\\n\\nAre you sure you want to continue?') && ProcessButton(this,'Changing...','100');"); } if (panClear.Visible == true) { btnSubmit.Attributes.Add("onclick", "return confirm('WARNING: This will permanently clear the device name and release it for re-use (if applicable)!\\n\\nAre you sure you want to continue?') && ProcessButton(this,'Clearing...','100');"); } btnReset.Attributes.Add("onclick", "return IsOKtoReset(this);"); btnAlreadyChange.Attributes.Add("onclick", "return confirm('LAST CHANCE! This will permanently change the device name and release the previous name for re-use (if applicable)!\\n\\nAre you sure you want to continue?') && ProcessButton(this,'Changing...','100');"); } else { lblError.Text = "Either the asset or the status of the asset could not be identified"; } } } else { lblError.Text = "Either the asset or the status of the asset could not be identified"; } if (lblError.Text != "" && boolMessage == false) { panError.Visible = true; panClear.Visible = false; btnSubmit.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) { Response.Cookies["loginreferrer"].Value = "/admin/mnemonics.aspx"; Response.Cookies["loginreferrer"].Expires = DateTime.Now.AddDays(30); if (Request.Cookies["adminid"] != null && Request.Cookies["adminid"].Value != "") { intProfile = Int32.Parse(Request.Cookies["adminid"].Value); } else { Response.Redirect("/admin/login.aspx"); } oMnemonic = new Mnemonic(intProfile, dsn); bool boolView = false; if (Request.QueryString["import"] != null) { panImport.Visible = true; int intImport = Int32.Parse(Request.QueryString["import"]); if (intImport > 0) { btnImport.Enabled = false; txtImport.Text = oMnemonic.GetImport(intImport, "results"); } rptImport.DataSource = oMnemonic.GetImports(); rptImport.DataBind(); } else if (Request.QueryString["id"] == null) { if (!IsPostBack) { if (Request.QueryString["parent"] == null) { boolView = true; } else { panAdd.Visible = true; } } } else { intID = Int32.Parse(Request.QueryString["id"]); if (!IsPostBack) { panAdd.Visible = true; DataSet ds = oMnemonic.Get(intID); if (ds.Tables[0].Rows.Count > 0) { DataRow dr = ds.Tables[0].Rows[0]; txtName.Text = dr["name"].ToString(); txtFactoryCode.Text = dr["factory_code"].ToString(); Status.Text = dr["Status"].ToString(); ResRating.Text = dr["ResRating"].ToString(); DRRating.Text = dr["DRRating"].ToString(); Infrastructure.Text = dr["Infrastructure"].ToString(); CriticalityFactor.Text = dr["CriticalityFactor"].ToString(); Platform.Text = dr["Platform"].ToString(); CICS.Text = dr["CICS"].ToString(); PagerLevel.Text = dr["PagerLevel"].ToString(); ATLName.Text = dr["ATLName"].ToString(); PMName.Text = dr["PMName"].ToString(); FMName.Text = dr["FMName"].ToString(); DMName.Text = dr["DMName"].ToString(); CIO.Text = dr["CIO"].ToString(); AppOwner.Text = dr["AppOwner"].ToString(); AppLOBName.Text = dr["AppLOBName"].ToString(); Segment1.Text = dr["Segment1"].ToString(); RiskManager.Text = dr["RiskManager"].ToString(); BRContact.Text = dr["BRContact"].ToString(); AppRating.Text = dr["AppRating"].ToString(); Source.Text = dr["Source"].ToString(); OriginalApp.Text = dr["OriginalApp"].ToString(); chkEnabled.Checked = (dr["enabled"].ToString() == "1"); } else { boolView = true; } } } if (boolView == true) { panView.Visible = true; LoopRepeater(); } btnDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this item?');"); btnImport.Attributes.Add("onclick", "return confirm('WARNING: This import will modify production data and CANNOT be undone!\\n\\nAre you sure you want to continue?')&& ProcessButton(this) && WaitDDL('" + divWait.ClientID + "');;"); }
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); } } }
protected void Page_Load(object sender, EventArgs e) { intProfile = Int32.Parse(Request.Cookies["profileid"].Value); oPage = new Pages(intProfile, dsn); oUser = new Users(intProfile, dsn); oServer = new Servers(intProfile, dsn); oTSM = new TSM(intProfile, dsn); oMnemonic = new Mnemonic(intProfile, dsn); oLocation = new Locations(intProfile, dsn); oResiliency = new Resiliency(intProfile, dsn); oFunctions = new Functions(intProfile, dsn, intEnvironment); if (Request.QueryString["applicationid"] != null && Request.QueryString["applicationid"] != "") { intApplication = Int32.Parse(Request.QueryString["applicationid"]); } if (Request.QueryString["pageid"] != null && Request.QueryString["pageid"] != "") { intPage = Int32.Parse(Request.QueryString["pageid"]); } if (Request.Cookies["application"] != null && Request.Cookies["application"].Value != "") { intApplication = Int32.Parse(Request.Cookies["application"].Value); } if (Request.QueryString["saved"] != null) { lblMessage.Text = oFunctions.BuildBox("/images/ico_check.gif", "Information Saved", "Your change has been saved successfully!", "box_green header"); } if (Request.QueryString["deleted"] != null) { lblMessage.Text = oFunctions.BuildBox("/images/ico_check.gif", "Record Deleted", "The record has been deleted successfully!", "box_green header"); } if (Request.QueryString["server"] != null && Request.QueryString["server"] != "") { intServer = Int32.Parse(Request.QueryString["server"]); lblCrumbs.Text += "<a href=\"" + oPage.GetFullLink(intPage) + FormURL("") + "\">Back to Home</a>"; if (Request.QueryString["mnemonic"] != null && Request.QueryString["mnemonic"] != "") { panMnemonic.Visible = true; Int32.TryParse(Request.QueryString["mnemonic"], out intMnemonic); if (!IsPostBack) { DataSet ds = oTSM.GetMnemonic(intMnemonic); if (ds.Tables[0].Rows.Count > 0) { int intMnemonicID = Int32.Parse(ds.Tables[0].Rows[0]["mnemonicid"].ToString()); hdnMnemonic.Value = intMnemonicID.ToString(); txtMnemonic.Text = oMnemonic.Get(intMnemonicID, "factory_code") + " - " + oMnemonic.Get(intMnemonicID, "name"); chkMnemonicEnabled.Checked = (ds.Tables[0].Rows[0]["enabled"].ToString() == "1"); btnMnemonicUpdate.Visible = true; btnMnemonicUpdate.Attributes.Add("onclick", "return ValidateHidden0('" + hdnMnemonic.ClientID + "','" + txtMnemonic.ClientID + "','Please enter a mnemonic\\n\\n(Start typing and a list will be presented...)')" + " && ProcessButton(this)" + ";"); btnMnemonicDelete.Visible = true; btnMnemonicDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this item') && ProcessButton(this);"); } else { btnMnemonicAdd.Visible = true; btnMnemonicAdd.Attributes.Add("onclick", "return ValidateHidden0('" + hdnMnemonic.ClientID + "','" + txtMnemonic.ClientID + "','Please enter a mnemonic\\n\\n(Start typing and a list will be presented...)')" + " && ProcessButton(this)" + ";"); } btnMnemonicCancel.Attributes.Add("onclick", "return ProcessButton(this);"); } } else if (Request.QueryString["domain"] != null && Request.QueryString["domain"] != "") { intDomain = Int32.Parse(Request.QueryString["domain"]); lblCrumbs.Text += strSpacer + "<a href=\"" + oPage.GetFullLink(intPage) + FormURL("server=" + intServer.ToString()) + "\">" + oTSM.Get(intServer, "name") + "</a>"; if (Request.QueryString["schedule"] != null && Request.QueryString["schedule"] != "") { intSchedule = Int32.Parse(Request.QueryString["schedule"]); lblCrumbs.Text += strSpacer + "<a href=\"" + oPage.GetFullLink(intPage) + FormURL("server=" + intServer.ToString() + "&domain=" + intDomain.ToString()) + "\">" + oTSM.GetDomain(intDomain, "name") + "</a>"; panSchedule.Visible = true; if (!IsPostBack) { DataSet ds = oTSM.GetSchedule(intSchedule); if (ds.Tables[0].Rows.Count > 0) { lblCrumbs.Text += strSpacer + oTSM.GetSchedule(intSchedule, "name"); txtScheduleName.Text = ds.Tables[0].Rows[0]["name"].ToString(); chkScheduleEngineering.Checked = (ds.Tables[0].Rows[0]["engineering"].ToString() == "1"); chkScheduleTest.Checked = (ds.Tables[0].Rows[0]["test"].ToString() == "1"); chkScheduleQA.Checked = (ds.Tables[0].Rows[0]["qa"].ToString() == "1"); chkScheduleProduction.Checked = (ds.Tables[0].Rows[0]["prod"].ToString() == "1"); chkScheduleWindows.Checked = (ds.Tables[0].Rows[0]["windows"].ToString() == "1"); chkScheduleUnix.Checked = (ds.Tables[0].Rows[0]["unix"].ToString() == "1"); chkScheduleDaily.Checked = (ds.Tables[0].Rows[0]["daily"].ToString() == "1"); chkScheduleWeekly.Checked = (ds.Tables[0].Rows[0]["weekly"].ToString() == "1"); if (chkScheduleWeekly.Checked == true) { divScheduleWeekly.Style["display"] = "inline"; } ddlScheduleResiliency.SelectedValue = ds.Tables[0].Rows[0]["resiliencyid"].ToString(); chkScheduleWeeklySunday.Checked = (ds.Tables[0].Rows[0]["sunday"].ToString() == "1"); chkScheduleWeeklyMonday.Checked = (ds.Tables[0].Rows[0]["monday"].ToString() == "1"); chkScheduleWeeklyTuesday.Checked = (ds.Tables[0].Rows[0]["tuesday"].ToString() == "1"); chkScheduleWeeklyWednesday.Checked = (ds.Tables[0].Rows[0]["wednesday"].ToString() == "1"); chkScheduleWeeklyThursday.Checked = (ds.Tables[0].Rows[0]["thursday"].ToString() == "1"); chkScheduleWeeklyFriday.Checked = (ds.Tables[0].Rows[0]["friday"].ToString() == "1"); chkScheduleWeeklySaturday.Checked = (ds.Tables[0].Rows[0]["saturday"].ToString() == "1"); chkScheduleMonthly.Checked = (ds.Tables[0].Rows[0]["monthly"].ToString() == "1"); chk1200AM.Checked = (ds.Tables[0].Rows[0]["AM1200"].ToString() == "1"); chk1230AM.Checked = (ds.Tables[0].Rows[0]["AM1230"].ToString() == "1"); chk100AM.Checked = (ds.Tables[0].Rows[0]["AM100"].ToString() == "1"); chk130AM.Checked = (ds.Tables[0].Rows[0]["AM130"].ToString() == "1"); chk200AM.Checked = (ds.Tables[0].Rows[0]["AM200"].ToString() == "1"); chk230AM.Checked = (ds.Tables[0].Rows[0]["AM230"].ToString() == "1"); chk300AM.Checked = (ds.Tables[0].Rows[0]["AM300"].ToString() == "1"); chk330AM.Checked = (ds.Tables[0].Rows[0]["AM330"].ToString() == "1"); chk400AM.Checked = (ds.Tables[0].Rows[0]["AM400"].ToString() == "1"); chk430AM.Checked = (ds.Tables[0].Rows[0]["AM430"].ToString() == "1"); chk500AM.Checked = (ds.Tables[0].Rows[0]["AM500"].ToString() == "1"); chk530AM.Checked = (ds.Tables[0].Rows[0]["AM530"].ToString() == "1"); chk600AM.Checked = (ds.Tables[0].Rows[0]["AM600"].ToString() == "1"); chk630AM.Checked = (ds.Tables[0].Rows[0]["AM630"].ToString() == "1"); chk700AM.Checked = (ds.Tables[0].Rows[0]["AM700"].ToString() == "1"); chk730AM.Checked = (ds.Tables[0].Rows[0]["AM730"].ToString() == "1"); chk800AM.Checked = (ds.Tables[0].Rows[0]["AM800"].ToString() == "1"); chk830AM.Checked = (ds.Tables[0].Rows[0]["AM830"].ToString() == "1"); chk900AM.Checked = (ds.Tables[0].Rows[0]["AM900"].ToString() == "1"); chk930AM.Checked = (ds.Tables[0].Rows[0]["AM930"].ToString() == "1"); chk1000AM.Checked = (ds.Tables[0].Rows[0]["AM1000"].ToString() == "1"); chk1030AM.Checked = (ds.Tables[0].Rows[0]["AM1030"].ToString() == "1"); chk1100AM.Checked = (ds.Tables[0].Rows[0]["AM1100"].ToString() == "1"); chk1130AM.Checked = (ds.Tables[0].Rows[0]["AM1130"].ToString() == "1"); chk1200PM.Checked = (ds.Tables[0].Rows[0]["PM1200"].ToString() == "1"); chk1230PM.Checked = (ds.Tables[0].Rows[0]["PM1230"].ToString() == "1"); chk100PM.Checked = (ds.Tables[0].Rows[0]["PM100"].ToString() == "1"); chk130PM.Checked = (ds.Tables[0].Rows[0]["PM130"].ToString() == "1"); chk200PM.Checked = (ds.Tables[0].Rows[0]["PM200"].ToString() == "1"); chk230PM.Checked = (ds.Tables[0].Rows[0]["PM230"].ToString() == "1"); chk300PM.Checked = (ds.Tables[0].Rows[0]["PM300"].ToString() == "1"); chk330PM.Checked = (ds.Tables[0].Rows[0]["PM330"].ToString() == "1"); chk400PM.Checked = (ds.Tables[0].Rows[0]["PM400"].ToString() == "1"); chk430PM.Checked = (ds.Tables[0].Rows[0]["PM430"].ToString() == "1"); chk500PM.Checked = (ds.Tables[0].Rows[0]["PM500"].ToString() == "1"); chk530PM.Checked = (ds.Tables[0].Rows[0]["PM530"].ToString() == "1"); chk600PM.Checked = (ds.Tables[0].Rows[0]["PM600"].ToString() == "1"); chk630PM.Checked = (ds.Tables[0].Rows[0]["PM630"].ToString() == "1"); chk700PM.Checked = (ds.Tables[0].Rows[0]["PM700"].ToString() == "1"); chk730PM.Checked = (ds.Tables[0].Rows[0]["PM730"].ToString() == "1"); chk800PM.Checked = (ds.Tables[0].Rows[0]["PM800"].ToString() == "1"); chk830PM.Checked = (ds.Tables[0].Rows[0]["PM830"].ToString() == "1"); chk900PM.Checked = (ds.Tables[0].Rows[0]["PM900"].ToString() == "1"); chk930PM.Checked = (ds.Tables[0].Rows[0]["PM930"].ToString() == "1"); chk1000PM.Checked = (ds.Tables[0].Rows[0]["PM1000"].ToString() == "1"); chk1030PM.Checked = (ds.Tables[0].Rows[0]["PM1030"].ToString() == "1"); chk1100PM.Checked = (ds.Tables[0].Rows[0]["PM1100"].ToString() == "1"); chk1130PM.Checked = (ds.Tables[0].Rows[0]["PM1130"].ToString() == "1"); chkScheduleEnabled.Checked = (ds.Tables[0].Rows[0]["enabled"].ToString() == "1"); btnScheduleUpdate.Visible = true; btnScheduleUpdate.Attributes.Add("onclick", "return ValidateText('" + txtScheduleName.ClientID + "','Please enter a name for this schedule')" + " && ProcessButton(this)" + ";"); btnScheduleDelete.Visible = true; btnScheduleDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this schedule')" + " && ProcessButton(this)" + ";"); } else { btnScheduleAdd.Visible = true; btnScheduleAdd.Attributes.Add("onclick", "return ValidateText('" + txtScheduleName.ClientID + "','Please enter a name for this schedule')" + " && ProcessButton(this)" + ";"); } btnScheduleCancel.Attributes.Add("onclick", "return ProcessButton(this);"); chkScheduleWeekly.Attributes.Add("onclick", "ShowHideDiv2('" + divScheduleWeekly.ClientID + "');"); } } else { panDomain.Visible = true; DataSet dsSchedules = oTSM.GetSchedules(intDomain, 0); DataView dvSchedules = dsSchedules.Tables[0].DefaultView; if (Request.QueryString["sort"] != null) { dvSchedules.Sort = Request.QueryString["sort"]; } else { dvSchedules.Sort = "name"; } rptSchedules.DataSource = dvSchedules; rptSchedules.DataBind(); lblSchedules.Visible = (rptSchedules.Items.Count == 0); if (!IsPostBack) { LoadLists(); DataSet ds = oTSM.GetDomain(intDomain); if (ds.Tables[0].Rows.Count > 0) { lblCrumbs.Text += strSpacer + oTSM.GetDomain(intDomain, "name"); txtDomainName.Text = ds.Tables[0].Rows[0]["name"].ToString(); chkDomainEngineering.Checked = (ds.Tables[0].Rows[0]["engineering"].ToString() == "1"); chkDomainTest.Checked = (ds.Tables[0].Rows[0]["test"].ToString() == "1"); chkDomainQA.Checked = (ds.Tables[0].Rows[0]["qa"].ToString() == "1"); chkDomainProduction.Checked = (ds.Tables[0].Rows[0]["prod"].ToString() == "1"); chkDomainWindows.Checked = (ds.Tables[0].Rows[0]["windows"].ToString() == "1"); chkDomainUnix.Checked = (ds.Tables[0].Rows[0]["unix"].ToString() == "1"); ddlDomainResiliency.SelectedValue = ds.Tables[0].Rows[0]["resiliencyid"].ToString(); chkDomainEnabled.Checked = (ds.Tables[0].Rows[0]["enabled"].ToString() == "1"); btnDomainUpdate.Visible = true; btnDomainUpdate.Attributes.Add("onclick", "return ValidateText('" + txtDomainName.ClientID + "','Please enter a name for this domain')" + " && ValidateDropDown('" + ddlDomainResiliency.ClientID + "','Please select a Resiliency')" + " && ProcessButton(this)" + ";"); btnDomainDelete.Visible = true; btnDomainDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this domain')" + " && ProcessButton(this)" + ";"); } else { btnDomainAdd.Visible = true; btnDomainAdd.Attributes.Add("onclick", "return ValidateText('" + txtDomainName.ClientID + "','Please enter a name for this domain')" + " && ValidateDropDown('" + ddlDomainResiliency.ClientID + "','Please select a Resiliency')" + " && ProcessButton(this)" + ";"); btnAddSchedule.Enabled = false; } btnDomainCancel.Attributes.Add("onclick", "return ProcessButton(this);"); } } } else { panServer.Visible = true; DataSet dsDomains = oTSM.GetDomains(intServer, 0); DataView dvDomains = dsDomains.Tables[0].DefaultView; if (Request.QueryString["sort"] != null) { dvDomains.Sort = Request.QueryString["sort"]; } else { dvDomains.Sort = "name"; } rptDomains.DataSource = dvDomains; rptDomains.DataBind(); lblDomains.Visible = (rptDomains.Items.Count == 0); // Mnemonics rptMnemonics.DataSource = oTSM.GetMnemonics(intServer, 0); rptMnemonics.DataBind(); lblMnemonics.Visible = (rptMnemonics.Items.Count == 0); if (!IsPostBack) { int intLocation = Int32.Parse(ConfigurationManager.AppSettings["OPSLocationID"]); DataSet ds = oTSM.Get(intServer); if (ds.Tables[0].Rows.Count > 0) { lblCrumbs.Text += strSpacer + oTSM.Get(intServer, "name"); txtServerName.Text = ds.Tables[0].Rows[0]["name"].ToString(); txtServerPort.Text = ds.Tables[0].Rows[0]["port"].ToString(); Int32.TryParse(ds.Tables[0].Rows[0]["addressid"].ToString(), out intLocation); txtServerPath.Text = ds.Tables[0].Rows[0]["path"].ToString(); if (txtServerPath.Text != "") { hypServerPath.NavigateUrl = txtServerPath.Text; } else { hypServerPath.Enabled = false; } chkServerEnabled.Checked = (ds.Tables[0].Rows[0]["enabled"].ToString() == "1"); btnServerUpdate.Visible = true; btnServerUpdate.Attributes.Add("onclick", "return ValidateText('" + txtServerName.ClientID + "','Please enter a name for this server')" + " && ValidateNumber0('" + txtServerPort.ClientID + "','Please enter a port number')" + " && ProcessButton(this)" + ";"); btnServerDelete.Visible = true; btnServerDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this server')" + " && ProcessButton(this)" + ";"); } else { btnServerAdd.Visible = true; btnServerAdd.Attributes.Add("onclick", "return ValidateText('" + txtServerName.ClientID + "','Please enter a name for this server')" + " && ValidateNumber0('" + txtServerPort.ClientID + "','Please enter a port number')" + " && ProcessButton(this)" + ";"); btnAddDomain.Enabled = false; btnAddMnemonic.Enabled = false; } btnServerCancel.Attributes.Add("onclick", "return ProcessButton(this);"); strLocation = oLocation.LoadDDL("ddlState", "ddlCity", "ddlAddress", hdnLocation.ClientID, intLocation, true, "ddlCommon"); hdnLocation.Value = intLocation.ToString(); } int intMenuTab = 0; if (Request.QueryString["menu_tab"] != null && Request.QueryString["menu_tab"] != "") { intMenuTab = Int32.Parse(Request.QueryString["menu_tab"]); } Tab oTab = new Tab(hdnTab.ClientID, intMenuTab, "divMenu1", true, false); oTab.AddTab("Domains", ""); oTab.AddTab("Associated Mnemonics", ""); strMenuTab1 = oTab.GetTabs(); } } else { panServers.Visible = true; DataSet dsTSM = oTSM.Gets(1, 0, 0); DataView dvTSM = dsTSM.Tables[0].DefaultView; if (Request.QueryString["sort"] != null) { dvTSM.Sort = Request.QueryString["sort"]; } else { dvTSM.Sort = "name"; } rptServers.DataSource = dvTSM; rptServers.DataBind(); lblServers.Visible = (rptServers.Items.Count == 0); } Variables oVariable = new Variables(intEnvironment); txtMnemonic.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'500','195','" + divMnemonic.ClientID + "','" + lstMnemonic.ClientID + "','" + hdnMnemonic.ClientID + "','" + oVariable.URL() + "/frame/ajax/ajax_mnemonics.aspx',2);"); lstMnemonic.Attributes.Add("ondblclick", "AJAXClickRow();"); btnAddDomain.Attributes.Add("onclick", "return ProcessButton(this);"); btnAddSchedule.Attributes.Add("onclick", "return ProcessButton(this);"); btnAddServer.Attributes.Add("onclick", "return ProcessButton(this);"); }
protected void Page_Load(object sender, EventArgs e) { Page.Title = "ClearView Application Information"; intProfile = Int32.Parse(Request.Cookies["profileid"].Value); oOnDemand = new OnDemand(intProfile, dsn); oForecast = new Forecast(intProfile, dsn); oModel = new Models(intProfile, dsn); oModelsProperties = new ModelsProperties(intProfile, dsn); oUser = new Users(intProfile, dsn); oVariable = new Variables(intEnvironment); oClass = new Classes(intProfile, dsn); oMnemonic = new Mnemonic(intProfile, dsn); oCostCenter = new CostCenter(intProfile, dsn); if (Request.QueryString["id"] != null && Request.QueryString["id"] != "") { intID = Int32.Parse(Request.QueryString["id"]); } if (Request.QueryString["sid"] != null && Request.QueryString["sid"] != "") { intStep = Int32.Parse(Request.QueryString["sid"]); } if (oForecast.GetAnswer(intID, "completed") == "" && Request.QueryString["view"] == null) { if (Request.QueryString["step"] != null && Request.QueryString["step"] != "") { panUpdate.Visible = true; } else { panNavigation.Visible = true; } } else { btnClose.Text = "Close"; } string strPNC = ""; int intClass = 0; if (intID > 0) { Page.Title = "ClearView Application Information | Design # " + intID.ToString(); DataSet ds = oForecast.GetAnswer(intID); if (ds.Tables[0].Rows.Count > 0) { intRequest = oForecast.GetRequestID(intID, true); txtName.Text = ds.Tables[0].Rows[0]["appname"].ToString(); intClass = Int32.Parse(ds.Tables[0].Rows[0]["classid"].ToString()); if (oClass.Get(intClass, "pnc") == "1") { boolPNC = true; } if (boolPNC == true) { panMnemonic.Visible = true; strPNC = " && ValidateHidden0('" + hdnMnemonic.ClientID + "','" + txtMnemonic.ClientID + "','Please enter the mnemonic of this design\\n\\n(Start typing and a list will be presented...)')"; int intMnemonic = Int32.Parse(ds.Tables[0].Rows[0]["mnemonicid"].ToString()); if (intMnemonic > 0) { txtMnemonic.Text = oMnemonic.Get(intMnemonic, "factory_code") + " - " + oMnemonic.Get(intMnemonic, "name"); } hdnMnemonic.Value = intMnemonic.ToString(); int intCostCenter = 0; if (boolUseCostCenter == true) { panCostCenter.Visible = true; strPNC = " && ValidateHidden0('" + hdnCostCenter.ClientID + "','" + txtCostCenter.ClientID + "','Please enter the cost center of this design\\n\\n(Start typing and a list will be presented...)')"; if (Int32.TryParse(ds.Tables[0].Rows[0]["costcenterid"].ToString(), out intCostCenter) == true) { txtCostCenter.Text = oCostCenter.GetName(intCostCenter); } } hdnCostCenter.Value = intCostCenter.ToString(); } else { panCode.Visible = true; strPNC = " && ValidateText('" + txtCode.ClientID + "','Please enter an application code')"; txtCode.Text = ds.Tables[0].Rows[0]["appcode"].ToString(); } int intDR = Int32.Parse(ds.Tables[0].Rows[0]["dr_criticality"].ToString()); if (intDR == 1) { radHigh.Checked = true; } if (intDR == 2) { radLow.Checked = true; } int intOwner = Int32.Parse(ds.Tables[0].Rows[0]["appcontact"].ToString()); int intPrimary = Int32.Parse(ds.Tables[0].Rows[0]["admin1"].ToString()); int intSecondary = Int32.Parse(ds.Tables[0].Rows[0]["admin2"].ToString()); int intAppOwner = Int32.Parse(ds.Tables[0].Rows[0]["appowner"].ToString()); int intEngineer = Int32.Parse(ds.Tables[0].Rows[0]["networkengineer"].ToString()); if (intOwner > 0) { txtOwner.Text = oUser.GetFullName(intOwner) + " (" + oUser.GetName(intOwner) + ")"; } if (intPrimary > 0) { txtPrimary.Text = oUser.GetFullName(intPrimary) + " (" + oUser.GetName(intPrimary) + ")"; } if (intSecondary > 0) { txtSecondary.Text = oUser.GetFullName(intSecondary) + " (" + oUser.GetName(intSecondary) + ")"; } if (intAppOwner > 0) { txtAppOwner.Text = oUser.GetFullName(intAppOwner) + " (" + oUser.GetName(intAppOwner) + ")"; } if (intEngineer > 0) { txtEngineer.Text = oUser.GetFullName(intEngineer) + " (" + oUser.GetName(intEngineer) + ")"; } hdnOwner.Value = intOwner.ToString(); hdnPrimary.Value = intPrimary.ToString(); hdnSecondary.Value = intSecondary.ToString(); hdnAppOwner.Value = intAppOwner.ToString(); hdnEngineer.Value = intEngineer.ToString(); int intModel = oForecast.GetModel(intID); intModel = Int32.Parse(oModelsProperties.Get(intModel, "modelid")); intType = oModel.GetType(intModel); DataSet dsSteps = oOnDemand.GetWizardSteps(intType, 1); int intCount = Int32.Parse(oOnDemand.GetWizardStep(intStep, "step")); if (dsSteps.Tables[0].Rows.Count == intCount) { btnNext.Text = "Finish"; } if (intCount == 0 || intCount == 1) { btnBack.Enabled = false; } } } txtOwner.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'300','195','" + divOwner.ClientID + "','" + lstOwner.ClientID + "','" + hdnOwner.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);"); lstOwner.Attributes.Add("ondblclick", "AJAXClickRow();"); txtPrimary.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'300','195','" + divPrimary.ClientID + "','" + lstPrimary.ClientID + "','" + hdnPrimary.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);"); lstPrimary.Attributes.Add("ondblclick", "AJAXClickRow();"); txtSecondary.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'300','195','" + divSecondary.ClientID + "','" + lstSecondary.ClientID + "','" + hdnSecondary.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);"); lstSecondary.Attributes.Add("ondblclick", "AJAXClickRow();"); txtAppOwner.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'300','195','" + divAppOwner.ClientID + "','" + lstAppOwner.ClientID + "','" + hdnAppOwner.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);"); lstAppOwner.Attributes.Add("ondblclick", "AJAXClickRow();"); txtEngineer.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'300','195','" + divEngineer.ClientID + "','" + lstEngineer.ClientID + "','" + hdnEngineer.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);"); lstEngineer.Attributes.Add("ondblclick", "AJAXClickRow();"); txtMnemonic.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'500','195','" + divMnemonic.ClientID + "','" + lstMnemonic.ClientID + "','" + hdnMnemonic.ClientID + "','" + oVariable.URL() + "/frame/ajax/ajax_mnemonics.aspx',2);"); lstMnemonic.Attributes.Add("ondblclick", "AJAXClickRow();"); txtCostCenter.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'200','195','" + divCostCenter.ClientID + "','" + lstCostCenter.ClientID + "','" + hdnCostCenter.ClientID + "','" + oVariable.URL() + "/frame/ajax/ajax_cost_centers.aspx',5);"); lstCostCenter.Attributes.Add("ondblclick", "AJAXClickRow();"); btnClose.Attributes.Add("onclick", "return window.close();"); string strEngineer = ""; if (oForecast.IsHACSM(intID) == true) { panEngineer.Visible = true; strEngineer = " && ValidateHidden0('" + hdnEngineer.ClientID + "','" + txtEngineer.ClientID + "','Please enter the LAN ID of your network engineer')"; } string strAppOwner = ""; if (boolPNC == true) { panAppOwner.Visible = true; strAppOwner = " && ValidateHidden0('" + hdnAppOwner.ClientID + "','" + txtAppOwner.ClientID + "','Please enter the LAN ID of your application owner')"; } if (oClass.IsProd(intClass)) { panDR.Visible = true; btnNext.Attributes.Add("onclick", "return ValidateText('" + txtName.ClientID + "','Please enter an application name')" + strPNC + " && ValidateRadioButtons('" + radHigh.ClientID + "','" + radLow.ClientID + "','Please select the disaster recovery criticality')" + " && ValidateHidden0('" + hdnOwner.ClientID + "','" + txtOwner.ClientID + "','Please enter the LAN ID of your Departmental Manager')" + " && ValidateHidden0('" + hdnPrimary.ClientID + "','" + txtPrimary.ClientID + "','Please enter the LAN ID of your Application Technical Lead')" + //" && ValidateHidden0('" + hdnSecondary.ClientID + "','" + txtSecondary.ClientID + "','Please enter the LAN ID of your secondary administrator')" + strAppOwner + strEngineer + ";"); btnUpdate.Attributes.Add("onclick", "return ValidateText('" + txtName.ClientID + "','Please enter an application name')" + strPNC + " && ValidateRadioButtons('" + radHigh.ClientID + "','" + radLow.ClientID + "','Please select the disaster recovery criticality')" + " && ValidateHidden0('" + hdnOwner.ClientID + "','" + txtOwner.ClientID + "','Please enter the LAN ID of your Departmental Manager')" + " && ValidateHidden0('" + hdnPrimary.ClientID + "','" + txtPrimary.ClientID + "','Please enter the LAN ID of your Application Technical Lead')" + //" && ValidateHidden0('" + hdnSecondary.ClientID + "','" + txtSecondary.ClientID + "','Please enter the LAN ID of your secondary administrator')" + strAppOwner + strEngineer + ";"); } else { btnNext.Attributes.Add("onclick", "return ValidateText('" + txtName.ClientID + "','Please enter an application name')" + strPNC + " && ValidateHidden0('" + hdnOwner.ClientID + "','" + txtOwner.ClientID + "','Please enter the LAN ID of your Departmental Manager')" + " && ValidateHidden0('" + hdnPrimary.ClientID + "','" + txtPrimary.ClientID + "','Please enter the LAN ID of your Application Technical Lead')" + //" && ValidateHidden0('" + hdnSecondary.ClientID + "','" + txtSecondary.ClientID + "','Please enter the LAN ID of your secondary administrator')" + strAppOwner + strEngineer + ";"); btnUpdate.Attributes.Add("onclick", "return ValidateText('" + txtName.ClientID + "','Please enter an application name')" + strPNC + " && ValidateHidden0('" + hdnOwner.ClientID + "','" + txtOwner.ClientID + "','Please enter the LAN ID of your Departmental Manager')" + " && ValidateHidden0('" + hdnPrimary.ClientID + "','" + txtPrimary.ClientID + "','Please enter the LAN ID of your Application Technical Lead')" + //" && ValidateHidden0('" + hdnSecondary.ClientID + "','" + txtSecondary.ClientID + "','Please enter the LAN ID of your secondary administrator')" + strAppOwner + strEngineer + ";"); } btnManager.Attributes.Add("onclick", "return OpenWindow('NEW_USER','');"); }