Exemplo n.º 1
0
 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();
     }
     oOperatingSystem = new OperatingSystems(intProfile, dsn);
     oServicePack     = new ServicePacks(intProfile, dsn);
     btnClose.Attributes.Add("onclick", "return HidePanel();");
     if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
     {
         intOS = Int32.Parse(Request.QueryString["id"]);
     }
     if (!IsPostBack)
     {
         Load(null);
         if (intOS > 0)
         {
             lblName.Text = oOperatingSystem.Get(intOS, "name");
         }
     }
 }
Exemplo n.º 2
0
        protected void ChangeOS()
        {
            int intOS = Int32.Parse(ddlOS.SelectedItem.Value);

            ddlRam.Items.Clear();
            ddlCPU.Items.Clear();
            ddlHardDrive.Items.Clear();

            if (intOS > 0)
            {
                bool boolXP   = (oOperatingSystems.Get(intOS, "code") == "XP");
                bool boolWin7 = (oOperatingSystems.Get(intOS, "code") == "7");

                ddlRam.Enabled        = true;
                ddlRam.DataTextField  = "name";
                ddlRam.DataValueField = "id";
                ddlRam.DataSource     = oVirtualRam.GetVMwares((boolXP ? 1 : 0), (boolWin7 ? 1 : 0), 1);
                ddlRam.DataBind();
                ddlRam.Items.Insert(0, new ListItem("-- SELECT --", "0"));
                ddlCPU.Enabled        = true;
                ddlCPU.DataTextField  = "name";
                ddlCPU.DataValueField = "id";
                ddlCPU.DataSource     = oVirtualCPU.GetVMwares((boolXP ? 1 : 0), (boolWin7 ? 1 : 0), 1);
                ddlCPU.DataBind();
                ddlCPU.Items.Insert(0, new ListItem("-- SELECT --", "0"));
                ddlHardDrive.Enabled        = true;
                ddlHardDrive.DataTextField  = "name";
                ddlHardDrive.DataValueField = "id";
                ddlHardDrive.DataSource     = oVirtualHDD.GetVMwares((boolXP ? 1 : 0), (boolWin7 ? 1 : 0), 1);
                ddlHardDrive.DataBind();
                ddlHardDrive.Items.Insert(0, new ListItem("-- SELECT --", "0"));
            }
            else
            {
                ddlRam.Enabled = false;
                ddlRam.Items.Insert(0, new ListItem("-- Select an Operating System --", "0"));
                ddlCPU.Enabled = false;
                ddlCPU.Items.Insert(0, new ListItem("-- Select an Operating System --", "0"));
                ddlHardDrive.Enabled = false;
                ddlHardDrive.Items.Insert(0, new ListItem("-- Select an Operating System --", "0"));
            }
        }
Exemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            oWorkstation     = new Workstations(intProfile, dsn);
            oServer          = new Servers(intProfile, dsn);
            oFunction        = new Functions(intProfile, dsn, intEnvironment);
            oUser            = new Users(intProfile, dsn);
            oVMWare          = new VMWare(intProfile, dsn);
            oAsset           = new Asset(intProfile, dsnAsset, dsn);
            oError           = new Errors(intProfile, dsn);
            oZeus            = new Zeus(intProfile, dsnZeus);
            oVariable        = new Variables(intEnvironment);
            oOperatingSystem = new OperatingSystems(intProfile, dsn);

            lblTitle.Text = "Provisioning Issue";
            string strUser = Request.ServerVariables["logon_user"];

            strUser = strUser.Substring(strUser.LastIndexOf("\\") + 1);
            intUser = oUser.GetId(strUser);

            if (intUser > 0)
            {
                if (Request.QueryString["fixed"] != null && Request.QueryString["fixed"] != "")
                {
                    Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "fixed", "<script type=\"text/javascript\">alert('The issue has been saved and the device is queued to continue.\\n\\nThis window will now be closed.');window.close();<" + "/" + "script>");
                }
                if (Request.QueryString["type"] != null && Request.QueryString["id"] != null)
                {
                    try
                    {
                        intID = Int32.Parse(oFunction.decryptQueryString(Request.QueryString["id"]));
                    }
                    catch
                    {
                        intID = 0;
                    }
                    if (intID > 0)
                    {
                        if (!IsPostBack)
                        {
                            bool boolVMware = false;
                            if (Request.QueryString["type"] == "s")
                            {
                                lblType.Text  = "Server";
                                lblLabel.Text = "Design ID:";
                                DataSet ds = oServer.GetErrors(intID);
                                foreach (DataRow dr in ds.Tables[0].Rows)
                                {
                                    if (dr["fixed"].ToString() == "")
                                    {
                                        lblName.Text  = dr["servername"].ToString();
                                        lblDate.Text  = dr["created"].ToString();
                                        lblIssue.Text = dr["reason"].ToString();

                                        int intServer = 0;
                                        if (dr["serverid"].ToString() != "")
                                        {
                                            intServer = Int32.Parse(dr["serverid"].ToString());
                                        }
                                        if (intServer > 0)
                                        {
                                            int intOS = 0;
                                            Int32.TryParse(oServer.Get(intServer, "osid"), out intOS);
                                            lblOS.Text    = oOperatingSystem.Get(intOS, "name");
                                            lblValue.Text = oServer.Get(intServer, "answerid");
                                        }

                                        int intAsset = 0;
                                        if (dr["assetid"].ToString() != "")
                                        {
                                            intAsset = Int32.Parse(dr["assetid"].ToString());
                                        }
                                        lblAsset.Text = intAsset.ToString();
                                        lblStep.Text  = dr["step"].ToString();

                                        if (intAsset != 0)
                                        {
                                            string strILO = oAsset.GetServerOrBlade(intAsset, "ilo");
                                            if (strILO != "")
                                            {
                                                panVMwareNo.Visible = true;
                                                lblConsole.Text     = "<a href=\"https://" + strILO + "\" target=\"_blank\">" + strILO + "</a>";
                                            }
                                            else
                                            {
                                                boolVMware = true;
                                            }
                                        }
                                    }
                                }

                                // Load Existing Errors
                                Tab oTab = new Tab("", 0, "divMenu1", true, false);
                                rptRelated.DataSource = oError.Gets(lblIssue.Text, intUser);
                                rptRelated.DataBind();
                                int intTab = 0;
                                foreach (RepeaterItem ri in rptRelated.Items)
                                {
                                    intTab++;
                                    oTab.AddTab("Solution # " + intTab.ToString(), "");
                                    ((Button)ri.FindControl("btnSelect")).Attributes.Add("onclick", "return confirm('Are you sure you want to select this solution as the fix?');");
                                    Label lblAttach = (Label)ri.FindControl("lblAttach");
                                    Panel panAttach = (Panel)ri.FindControl("panAttach");
                                    if (lblAttach.Text != "")
                                    {
                                        panAttach.Visible = true;
                                        string strAttach = lblAttach.Text;
                                        if (strAttach.Contains("\\") == true)
                                        {
                                            strAttach = strAttach.Substring(strAttach.LastIndexOf("\\") + 1);
                                        }
                                        lblAttach.Text = "<a href=\"" + lblAttach.Text + "\" target=\"_blank\">" + strAttach + "</a>";
                                    }
                                }
                                strMenuTab1    = oTab.GetTabs();
                                trNone.Visible = (rptRelated.Items.Count == 0);
                            }
                            else if (Request.QueryString["type"] == "w")
                            {
                                if (!IsPostBack)
                                {
                                    lblType.Text  = "Workstation";
                                    lblLabel.Text = "Request ID:";
                                    DataSet ds = oWorkstation.GetVirtualErrors(intID);
                                    foreach (DataRow dr in ds.Tables[0].Rows)
                                    {
                                        if (dr["fixed"].ToString() == "")
                                        {
                                            lblName.Text  = dr["workstationname"].ToString();
                                            lblDate.Text  = dr["created"].ToString();
                                            lblIssue.Text = dr["reason"].ToString();

                                            int intWorkstation = 0;
                                            if (dr["workstationid"].ToString() != "")
                                            {
                                                intWorkstation = Int32.Parse(dr["workstationid"].ToString());
                                            }
                                            if (intWorkstation > 0)
                                            {
                                                int intOS = 0;
                                                Int32.TryParse(oWorkstation.GetVirtual(intWorkstation, "osid"), out intOS);
                                                lblOS.Text    = oOperatingSystem.Get(intOS, "name");
                                                lblValue.Text = oWorkstation.GetVirtual(intWorkstation, "requestid");
                                            }

                                            int intAsset = 0;
                                            if (dr["assetid"].ToString() != "")
                                            {
                                                intAsset = Int32.Parse(dr["assetid"].ToString());
                                            }
                                            lblAsset.Text = intAsset.ToString();
                                            lblStep.Text  = dr["step"].ToString();

                                            boolVMware = true;
                                        }
                                    }

                                    // Load Existing Errors
                                    Tab oTab = new Tab("", 0, "divMenu1", true, false);
                                    rptRelated.DataSource = oError.Gets(lblError.Text, 0);
                                    rptRelated.DataBind();
                                    int intTab = 0;
                                    foreach (RepeaterItem ri in rptRelated.Items)
                                    {
                                        intTab++;
                                        oTab.AddTab("Solution # " + intTab.ToString(), "");
                                        ((Button)ri.FindControl("btnSelect")).Attributes.Add("onclick", "return confirm('Are you sure you want to select this solution as the fix?');");
                                        Label lblAttach = (Label)ri.FindControl("lblAttach");
                                        Panel panAttach = (Panel)ri.FindControl("panAttach");
                                        if (lblAttach.Text != "")
                                        {
                                            panAttach.Visible = true;
                                            string strAttach = lblAttach.Text;
                                            if (strAttach.Contains("\\") == true)
                                            {
                                                strAttach = strAttach.Substring(strAttach.LastIndexOf("\\") + 1);
                                            }
                                            lblAttach.Text = "<a href=\"" + lblAttach.Text + "\" target=\"_blank\">" + strAttach + "</a>";
                                        }
                                    }
                                    strMenuTab1    = oTab.GetTabs();
                                    trNone.Visible = (rptRelated.Items.Count == 0);
                                }
                            }

                            if (boolVMware == true)
                            {
                                panVMware.Visible = true;
                                DataSet dsGuest = oVMWare.GetGuest(lblName.Text);
                                if (dsGuest.Tables[0].Rows.Count > 0)
                                {
                                    DataRow drGuest      = dsGuest.Tables[0].Rows[0];
                                    int     intDatastore = Int32.Parse(drGuest["datastoreid"].ToString());
                                    lblDataStore.Text = oVMWare.GetDatastore(intDatastore, "name");
                                    int intHost    = Int32.Parse(drGuest["hostid"].ToString());
                                    int intCluster = Int32.Parse(oVMWare.GetHost(intHost, "clusterid"));
                                    lblCluster.Text = oVMWare.GetCluster(intCluster, "name");
                                    int intFolder = Int32.Parse(oVMWare.GetCluster(intCluster, "folderid"));
                                    lblFolder.Text = oVMWare.GetFolder(intFolder, "name");
                                    int intDataCenter = Int32.Parse(oVMWare.GetFolder(intFolder, "datacenterid"));
                                    lblDataCenter.Text = oVMWare.GetDatacenter(intDataCenter, "name");
                                    int intVirtualCenter = Int32.Parse(oVMWare.GetDatacenter(intDataCenter, "virtualcenterid"));
                                    lblVirtualCenter.Text = oVMWare.GetVirtualCenter(intVirtualCenter, "name");
                                }
                            }

                            if (lblName.Text == "")
                            {
                                lblError.Text = "This device is not experiencing any provisioning issues at the moment (" + intID.ToString() + ")";
                            }

                            // Load the case codes
                            ddlCode.DataTextField  = "name";
                            ddlCode.DataValueField = "id";
                            ddlCode.DataSource     = oError.GetTypeTypes(2, 1);
                            ddlCode.DataBind();
                            ddlCode.Items.Insert(0, new ListItem("-- SELECT --", "0"));
                        }
                    }
                    else
                    {
                        lblError.Text = "Could not find record";
                    }
                }
                else
                {
                    lblError.Text = "Invalid Parameter(s)";
                }
            }
            else
            {
                lblError.Text = "Could not find a user account for userID = " + strUser;
            }

            if (lblError.Text == "")
            {
                panIssue.Visible = true;
                btnFixed.Attributes.Add("onclick", "return ValidateText('" + txtIssue.ClientID + "','Please enter the issue') && ValidateText('" + txtResolution.ClientID + "','Please enter the resolution') && ValidateDropDown('" + ddlCode.ClientID + "','Please select a case code') && confirm('Are you sure you want to mark this error as fixed?') && ProcessButton(this);");
                radNew.Attributes.Add("onclick", "ShowHideDiv('" + divNew.ClientID + "','inline');ShowHideDiv('" + divExisting.ClientID + "','none');");
                radExisting.Attributes.Add("onclick", "ShowHideDiv('" + divNew.ClientID + "','none');ShowHideDiv('" + divExisting.ClientID + "','inline');");
            }
            else
            {
                panDenied.Visible = true;
                btnClose.Attributes.Add("onclick", "window.close();");
            }
        }
Exemplo n.º 4
0
 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";
                             }
                         }
                     }
                 }
             }
         }
     }
 }
Exemplo n.º 5
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;
            }
        }
Exemplo n.º 6
0
        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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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();
            }
        }
Exemplo n.º 7
0
        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 + "&nbsp;&nbsp;&nbsp;&nbsp;(<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;
                        }
                    }
                }
            }
        }
Exemplo n.º 8
0
        private void LoadOS(int _osid)
        {
            ddlRam.Items.Clear();
            ddlCPU.Items.Clear();
            ddlHardDrive.Items.Clear();

            if (_osid > 0)
            {
                bool boolXP   = (oOperatingSystems.Get(_osid, "code") == "XP");
                bool boolWin7 = (oOperatingSystems.Get(_osid, "code") == "7");

                DataSet dsRam = oVirtualRam.GetVMwares((boolXP ? 1 : 0), (boolWin7 ? 1 : 0), 1);
                ddlRam.Enabled        = true;
                ddlRam.DataTextField  = "name";
                ddlRam.DataValueField = "id";
                ddlRam.DataSource     = dsRam;
                ddlRam.DataBind();
                ddlRam.Items.Insert(0, new ListItem("-- SELECT --", "0"));
                foreach (DataRow drRam in dsRam.Tables[0].Rows)
                {
                    if (drRam["default"].ToString() == "1")
                    {
                        foreach (ListItem li in ddlRam.Items)
                        {
                            if (li.Value == drRam["id"].ToString())
                            {
                                li.Selected = true;
                                break;
                            }
                        }
                        break;
                    }
                }
                DataSet dsCPU = oVirtualCPU.GetVMwares((boolXP ? 1 : 0), (boolWin7 ? 1 : 0), 1);
                ddlCPU.Enabled        = true;
                ddlCPU.DataTextField  = "name";
                ddlCPU.DataValueField = "id";
                ddlCPU.DataSource     = dsCPU;
                ddlCPU.DataBind();
                ddlCPU.Items.Insert(0, new ListItem("-- SELECT --", "0"));
                foreach (DataRow drCPU in dsCPU.Tables[0].Rows)
                {
                    if (drCPU["default"].ToString() == "1")
                    {
                        foreach (ListItem li in ddlCPU.Items)
                        {
                            if (li.Value == drCPU["id"].ToString())
                            {
                                li.Selected = true;
                                break;
                            }
                        }
                        break;
                    }
                }
                DataSet dsHardDrive = oVirtualHDD.GetVMwares((boolXP ? 1 : 0), (boolWin7 ? 1 : 0), 1);
                ddlHardDrive.Enabled        = true;
                ddlHardDrive.DataTextField  = "name";
                ddlHardDrive.DataValueField = "id";
                ddlHardDrive.DataSource     = dsHardDrive;
                ddlHardDrive.DataBind();
                ddlHardDrive.Items.Insert(0, new ListItem("-- SELECT --", "0"));
                foreach (DataRow drHardDrive in dsHardDrive.Tables[0].Rows)
                {
                    if (drHardDrive["default"].ToString() == "1")
                    {
                        foreach (ListItem li in ddlHardDrive.Items)
                        {
                            if (li.Value == drHardDrive["id"].ToString())
                            {
                                li.Selected = true;
                                break;
                            }
                        }
                        break;
                    }
                }
            }
            else
            {
                ddlRam.Enabled = false;
                ddlRam.Items.Insert(0, new ListItem("-- Select an Operating System --", "0"));
                ddlCPU.Enabled = false;
                ddlCPU.Items.Insert(0, new ListItem("-- Select an Operating System --", "0"));
                ddlHardDrive.Enabled = false;
                ddlHardDrive.Items.Insert(0, new ListItem("-- Select an Operating System --", "0"));
            }
        }
Exemplo n.º 9
0
        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);
                }
            }
        }
Exemplo n.º 10
0
 protected void Page_Load(object sender, EventArgs e)
 {
     oForecast = new Forecast(0, dsn);
     oServer   = new Servers(0, dsn);
     if (Request.QueryString["id"] != null)
     {
         int intID = Int32.Parse(Request.QueryString["id"]);
         if (oForecast.IsStorage(intID) == true)
         {
             DataSet dsStorage           = oForecast.GetStorage(intID);
             double  intHigh             = double.Parse(dsStorage.Tables[0].Rows[0]["high_total"].ToString());
             double  intStandard         = double.Parse(dsStorage.Tables[0].Rows[0]["standard_total"].ToString());
             double  intLow              = double.Parse(dsStorage.Tables[0].Rows[0]["low_total"].ToString());
             double  intHighTest         = double.Parse(dsStorage.Tables[0].Rows[0]["high_test"].ToString());
             double  intStandardTest     = double.Parse(dsStorage.Tables[0].Rows[0]["standard_test"].ToString());
             double  intLowTest          = double.Parse(dsStorage.Tables[0].Rows[0]["low_test"].ToString());
             double  dblTotal            = intHigh + intStandard + intLow + intHighTest + intStandardTest + intLowTest;
             int     TotalFileSystemData = Int32.Parse(dblTotal.ToString());
             lblTCDC.Text = TotalFileSystemData.ToString() + " GB";
         }
         int      intForecast = Int32.Parse(oForecast.GetAnswer(intID, "forecastid"));
         int      intRequest  = Int32.Parse(oForecast.Get(intForecast, "requestid"));
         Requests oRequest    = new Requests(0, dsn);
         int      intProject  = oRequest.GetProjectNumber(intRequest);
         Projects oProject    = new Projects(0, dsn);
         //rptApp.DataSource = SqlHelper.ExecuteDataset(dsn, CommandType.Text, "select top 1 * from cv_ondemand_answering");
         //rptApp.DataBind();
         lblAppNone.Visible = (rptApp.Items.Count == 0);
         lblPrjName.Text    = oProject.Get(intProject, "name");
         Users  oUser   = new Users(0, dsn);
         string strLead = oProject.Get(intProject, "lead");
         if (strLead != "")
         {
             lblPrjMgr.Text    = oUser.GetFullName(Int32.Parse(strLead));
             lblPhoneNum1.Text = oUser.Get(Int32.Parse(strLead), "phone");
         }
         string strRequester = oForecast.Get(intForecast, "userid");
         if (strRequester != "")
         {
             lblRequester.Text = oUser.GetFullName(Int32.Parse(strRequester));
             lblPhoneNum2.Text = oUser.Get(Int32.Parse(strRequester), "phone");
         }
         lblDate.Text = DateTime.Parse(oForecast.GetAnswer(intID, "implementation")).ToLongDateString();
         // Get data from servers table
         ServerName       oServerName      = new ServerName(0, dsn);
         IPAddresses      oIPAddress       = new IPAddresses(0, dsnIP, dsn);
         OperatingSystems oOperatingSystem = new OperatingSystems(0, dsn);
         ServicePacks     oServicePack     = new ServicePacks(0, dsn);
         DataSet          dsServer         = oServer.GetAnswer(intID);
         StringBuilder    sbHosts          = new StringBuilder(strHosts);
         foreach (DataRow drServer in dsServer.Tables[0].Rows)
         {
             int intServer = Int32.Parse(dsServer.Tables[0].Rows[0]["id"].ToString());
             sbHosts.Append("<tr>");
             sbHosts.Append("<td>");
             sbHosts.Append(oServer.GetName(intServer, boolUsePNCNaming));
             sbHosts.Append("</td>");
             sbHosts.Append("<td>");
             sbHosts.Append(oServer.GetIPs(intServer, 0, 1, 0, 0, dsnIP, "", ""));
             sbHosts.Append("</td>");
             sbHosts.Append("<td>");
             sbHosts.Append(oOperatingSystem.Get(Int32.Parse(dsServer.Tables[0].Rows[0]["osid"].ToString()), "name"));
             sbHosts.Append("</td>");
             sbHosts.Append("<td>");
             sbHosts.Append(oServicePack.Get(Int32.Parse(dsServer.Tables[0].Rows[0]["spid"].ToString()), "name"));
             sbHosts.Append("</td>");
             sbHosts.Append("</tr>");
         }
         strHosts                 = sbHosts.ToString();
         lblHostNone.Visible      = (strHosts == "");
         lblRecoveryLocation.Text = "Ops Center";
         // Get data from backup table
         DataSet dsBackup = oForecast.GetBackup(intID);
         if (dsBackup.Tables[0].Rows.Count > 0)
         {
             if (dsBackup.Tables[0].Rows[0]["daily"].ToString() == "1")
             {
                 lblBackupFreq.Text = "Daily";
             }
             else if (dsBackup.Tables[0].Rows[0]["weekly"].ToString() == "1")
             {
                 lblBackupFreq.Text = "Weekly";
             }
             else if (dsBackup.Tables[0].Rows[0]["monthly"].ToString() == "1")
             {
                 lblBackupFreq.Text = "Monthly";
             }
             if (dsBackup.Tables[0].Rows[0]["time"].ToString() == "1")
             {
                 lblCSB.Text = dsBackup.Tables[0].Rows[0]["time_hour"].ToString() + " " + dsBackup.Tables[0].Rows[0]["time_switch"].ToString();
             }
             else
             {
                 lblCSB.Text = "Don't Care";
             }
             lblAvgSize.Text = dsBackup.Tables[0].Rows[0]["average_one"].ToString() + " GB";
             lblPTD.Text     = dsBackup.Tables[0].Rows[0]["documentation"].ToString();
             if (lblPTD.Text == "")
             {
                 lblPTD.Text     = "Not Specified";
                 lblPTD.CssClass = "redbold";
             }
             if (dsBackup.Tables[0].Rows[0]["start_date"].ToString() != "")
             {
                 lblFirstBackupDate.Text = DateTime.Parse(dsBackup.Tables[0].Rows[0]["start_date"].ToString()).ToShortDateString();
             }
         }
         // Load Exclusions
         DataSet dsExclusions = oForecast.GetBackupExclusions(intID);
         foreach (DataRow drExclusion in dsExclusions.Tables[0].Rows)
         {
             strExclusions += "<tr><td>" + drExclusion["path"].ToString() + "</td></tr>";
         }
         if (strExclusions == "")
         {
             strExclusions = "<tr><td class=\"redbold\">No Exclusions</td></tr>";
         }
         // Load Requirements
         DataSet       dsRequirements = oForecast.GetBackupRetentions(intID);
         StringBuilder sbRequirements = new StringBuilder(strRequirements);
         foreach (DataRow drRequirement in dsRequirements.Tables[0].Rows)
         {
             sbRequirements.Append("<tr><td nowrap>Path:</td><td width=\"100%\">");
             sbRequirements.Append(drRequirement["path"].ToString());
             sbRequirements.Append("</td></tr>");
             sbRequirements.Append("<tr><td nowrap>First Archival:</td><td width=\"100%\">");
             sbRequirements.Append(DateTime.Parse(drRequirement["first"].ToString()).ToShortDateString());
             sbRequirements.Append("</td></tr>");
             sbRequirements.Append("<tr><td nowrap>Retention Period:</td><td width=\"100%\">");
             sbRequirements.Append(drRequirement["number"].ToString() == "0" ? "" : drRequirement["number"].ToString() + " ");
             sbRequirements.Append(drRequirement["type"].ToString());
             sbRequirements.Append("</td></tr>");
             sbRequirements.Append("<tr><td nowrap>Start Time:</td><td width=\"100%\">");
             sbRequirements.Append(drRequirement["hour"].ToString());
             sbRequirements.Append(" ");
             sbRequirements.Append(drRequirement["switch"].ToString());
             sbRequirements.Append("</td></tr>");
             sbRequirements.Append("<tr><td nowrap>Frequency:</td><td width=\"100%\">");
             sbRequirements.Append(drRequirement["occurence"].ToString());
             sbRequirements.Append(drRequirement["occurs"].ToString() == "" ? "" : " occurring on " + drRequirement["occurs"].ToString());
             sbRequirements.Append("</td></tr>");
             sbRequirements.Append("<tr><td colspan=\"2\">&nbsp;</td></tr>");
         }
         strRequirements    = sbRequirements.ToString();
         lblCCDU.Text       = "5 GB";
         lblPolicyExcl.Text = "No Exceptions";
     }
 }
Exemplo n.º 11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            AuthenticateUser();
            if (Request.Cookies["profileid"] != null && Request.Cookies["profileid"].Value != "")
            {
                intProfile = Int32.Parse(Request.Cookies["profileid"].Value);
            }
            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);
            }
            oDataPoint        = new DataPoint(intProfile, dsn);
            oUser             = new Users(intProfile, dsn);
            oServer           = new Servers(intProfile, dsn);
            oAsset            = new Asset(intProfile, dsnAsset);
            oWorkstation      = new Workstations(intProfile, dsn);
            oForecast         = new Forecast(intProfile, dsn);
            oPlatform         = new Platforms(intProfile, dsn);
            oType             = new Types(intProfile, dsn);
            oModel            = new Models(intProfile, dsn);
            oModelsProperties = new ModelsProperties(intProfile, dsn);
            oIPAddresses      = new IPAddresses(intProfile, dsnIP, dsn);
            oFunction         = new Functions(intProfile, dsn, intEnvironment);
            oOperatingSystem  = new OperatingSystems(intProfile, dsn);
            oServicePack      = new ServicePacks(intProfile, dsn);
            oClass            = new Classes(intProfile, dsn);
            oEnvironment      = new Environments(intProfile, dsn);
            oDomain           = new Domains(intProfile, dsn);
            oVirtualHDD       = new VirtualHDD(intProfile, dsn);
            oVirtualRam       = new VirtualRam(intProfile, dsn);
            oZeus             = new Zeus(intProfile, dsnZeus);
            oLog             = new Log(intProfile, dsn);
            oService         = new Services(intProfile, dsn);
            oServiceRequest  = new ServiceRequests(intProfile, dsn);
            oResourceRequest = new ResourceRequest(intProfile, dsn);

            if (oUser.IsAdmin(intProfile) == true || (oDataPoint.GetPagePermission(intApplication, "ASSET") == true || intDataPointAvailableAsset == 1))
            {
                panAllow.Visible = true;
                if (Request.QueryString["save"] != null)
                {
                    panSave.Visible = true;
                }
                if (Request.QueryString["error"] != null)
                {
                    panError.Visible = true;
                    //      -100: More than one device name
                    //       -10: No device names
                    //        -5: Improper Name Format
                    //        -1: ServerID = 0
                    if (Request.QueryString["error"] == "-100")
                    {
                        lblError.Text = "More than one name";
                    }
                    else if (Request.QueryString["error"] == "-10")
                    {
                        lblError.Text = "User Cancelled Prompt";
                    }
                    else if (Request.QueryString["error"] == "-5")
                    {
                        lblError.Text = "Name is in Incorrect Format";
                    }
                    else if (Request.QueryString["error"] == "-1")
                    {
                        lblError.Text = "DeviceID = 0";
                    }
                    else
                    {
                        lblError.Text = "Generic Error";
                    }
                }
                Int32.TryParse(oFunction.decryptQueryString(Request.QueryString["id"]), out intID);
                if (Request.QueryString["close"] != null)
                {
                    Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "close", "<script type=\"text/javascript\">window.close();<" + "/" + "script>");
                }
                else if (intID > 0)
                {
                    DataSet ds = oDataPoint.GetAsset(intID);
                    if (ds.Tables[0].Rows.Count == 1)
                    {
                        // Load General Information
                        intAsset        = Int32.Parse(ds.Tables[0].Rows[0]["id"].ToString());
                        lblAssetID.Text = "#" + intAsset.ToString();
                        string strSerial = ds.Tables[0].Rows[0]["serial"].ToString();
                        string strAsset  = ds.Tables[0].Rows[0]["asset"].ToString();

                        string strHeader = (strSerial.Length > 15 ? strSerial.Substring(0, 15) + "..." : strSerial);
                        lblHeader.Text    = "&quot;" + strHeader.ToUpper() + "&quot;";
                        Master.Page.Title = "DataPoint | VMware Workstation (" + strHeader + ")";
                        lblHeaderSub.Text = "Provides all the information about a VMware Workstation...";
                        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("Asset Information", "");
                        oTab.AddTab("Guest Information", "");
                        oTab.AddTab("Account Information", "");
                        oTab.AddTab("Resource Dependencies", "");
                        oTab.AddTab("Provisioning Information", "");
                        if (oUser.IsAdmin(intProfile) == true || oDataPoint.GetFieldPermission(intProfile, "SERVER_ADMIN") == true)
                        {
                            oTab.AddTab("Administration", "");
                            panAdministration.Visible = true;
                        }
                        strMenuTab1 = oTab.GetTabs();

                        if (!IsPostBack)
                        {
                            // Asset Information
                            oDataPoint.LoadTextBox(txtPlatformSerial, intProfile, null, "", lblPlatformSerial, fldPlatformSerial, "WORKSTATION_VMWARE_SERIAL", strSerial, "", false, true);
                            oDataPoint.LoadTextBox(txtPlatformAsset, intProfile, null, "", lblPlatformAsset, fldPlatformAsset, "WORKSTATION_VMWARE_ASSET", strAsset, "", false, true);

                            int intAssetAttribute = Int32.Parse(oAsset.Get(intAsset, "asset_attribute"));
                            oDataPoint.LoadDropDown(ddlAssetAttribute, intProfile, null, "", lblAssetAttribute, fldAssetAttribute, "ASSET_ATTRIBUTE", "Name", "AttributeId", oAsset.getAssetAttributes(null, "", 1), intAssetAttribute, true, false, false);
                            oDataPoint.LoadTextBox(txtAssetAttributeComment, intProfile, null, "", lblAssetAttributeComment, fldAssetAttributeComment, "ASSET_ATTRIBUTE_COMMENT", oAsset.getAssetAttributesComments(intAsset), "", false, true);
                            ddlAssetAttribute.Attributes.Add("onclick", "return SetControlsForAssetAttributes()");

                            ddlPlatform.Attributes.Add("onchange", "PopulatePlatformTypes('" + ddlPlatform.ClientID + "','" + ddlPlatformType.ClientID + "','" + ddlPlatformModel.ClientID + "','" + ddlPlatformModelProperty.ClientID + "');ResetDropDownHidden('" + hdnModel.ClientID + "');");
                            ddlPlatformType.Attributes.Add("onchange", "PopulatePlatformModels('" + ddlPlatformType.ClientID + "','" + ddlPlatformModel.ClientID + "','" + ddlPlatformModelProperty.ClientID + "');ResetDropDownHidden('" + hdnModel.ClientID + "');");
                            ddlPlatformModel.Attributes.Add("onchange", "PopulatePlatformModelProperties('" + ddlPlatformModel.ClientID + "','" + ddlPlatformModelProperty.ClientID + "');ResetDropDownHidden('" + hdnModel.ClientID + "');");
                            ddlPlatformModelProperty.Attributes.Add("onchange", "UpdateDropDownHidden('" + ddlPlatformModelProperty.ClientID + "','" + hdnModel.ClientID + "');");
                            int intModel = Int32.Parse(oAsset.Get(intAsset, "modelid"));

                            hdnModel.Value = intModel.ToString();
                            int    intModelParent = Int32.Parse(oModelsProperties.Get(intModel, "modelid"));
                            int    intType        = oModel.GetType(intModelParent);
                            string strExecute     = oType.Get(intType, "forecast_execution_path");
                            if (strExecute != "")
                            {
                                DataSet dsVirtual = oWorkstation.GetVirtualAsset(intAsset);
                                if (dsVirtual.Tables[0].Rows.Count > 0)
                                {
                                    btnExecute.Attributes.Add("onclick", "return OpenWindow('FORECAST_EXECUTE','" + strExecute + "?id=" + dsVirtual.Tables[0].Rows[0]["answerid"].ToString() + "');");
                                }
                                else
                                {
                                    btnExecute.Enabled = false;
                                }
                            }
                            else
                            {
                                btnExecute.Enabled = false;
                            }
                            int intPlatform = oType.GetPlatform(intType);
                            oDataPoint.LoadDropDown(ddlPlatform, intProfile, null, "", lblPlatform, fldPlatform, "WORKSTATION_VMWARE_PLATFORM", "name", "platformid", oPlatform.Gets(1), intPlatform, false, false, true);
                            oDataPoint.LoadDropDown(ddlPlatformType, intProfile, null, "", lblPlatformType, fldPlatformType, "WORKSTATION_VMWARE_TYPE", "name", "id", oType.Gets(intPlatform, 1), intType, false, false, true);
                            oDataPoint.LoadDropDown(ddlPlatformModel, intProfile, null, "", lblPlatformModel, fldPlatformModel, "WORKSTATION_VMWARE_MODEL", "name", "id", oModel.Gets(intType, 1), intModelParent, false, false, true);
                            oDataPoint.LoadDropDown(ddlPlatformModelProperty, intProfile, null, "", lblPlatformModelProperty, fldPlatformModelProperty, "WORKSTATION_VMWARE_MODEL_PROP", "name", "id", oModelsProperties.GetModels(0, intModelParent, 1), intModel, false, false, true);

                            // Get Asset
                            int     intWorkstation = 0;
                            DataSet dsAsset        = oWorkstation.GetVirtualAsset(intAsset);
                            if (dsAsset.Tables[0].Rows.Count > 0)
                            {
                                intWorkstation      = Int32.Parse(dsAsset.Tables[0].Rows[0]["id"].ToString());
                                lblWorkstation.Text = intWorkstation.ToString();
                                txtStep.Text        = dsAsset.Tables[0].Rows[0]["step"].ToString();
                                oDataPoint.LoadTextBoxDeviceName(txtName, btnName, null, true, hdnPNC, intProfile, null, "", lblName, fldName, "WORKSTATION_VMWARE_NAME", dsAsset.Tables[0].Rows[0]["name"].ToString(), "", false, false);
                                if (txtName.Text != "")
                                {
                                    lblHeader.Text += "&nbsp;&nbsp;&nbsp;[" + txtName.Text + "]";
                                }
                                lblStatus.Text = dsAsset.Tables[0].Rows[0]["statusname"].ToString();
                                // Administrative Functions
                                if (Request.QueryString["admin"] != null)
                                {
                                    if (Request.QueryString["result"] != null)
                                    {
                                        strAdministration = "<tr><td>" + oFunction.decryptQueryString(Request.QueryString["result"]) + "</td></tr>";
                                    }
                                    if (Request.QueryString["output"] != null)
                                    {
                                        DataSet dsOutput = oWorkstation.GetVirtualOutput(intWorkstation);
                                        foreach (DataRow drOutput in dsOutput.Tables[0].Rows)
                                        {
                                            strAdministration += "<tr><td><a href=\"javascript:void(0);\" onclick=\"ShowHideDiv2('div" + drOutput["id"].ToString() + "');\">" + drOutput["type"].ToString() + "</a></td></tr>";
                                            strAdministration += "<tr id=\"div" + drOutput["id"].ToString() + "\" style=\"display:none\"><td>" + oFunction.FormatText(drOutput["output"].ToString()) + "</td></tr>";
                                        }
                                        if (lblStatus.Text != "")
                                        {
                                            strAdministration += "<tr><td>" + oLog.GetEvents(oLog.GetEventsByName(txtName.Text.ToUpper(), (int)LoggingType.Error), intEnvironment) + "</td></tr>";
                                        }
                                    }
                                }
                                int intClass = Int32.Parse(dsAsset.Tables[0].Rows[0]["classid"].ToString());
                                int intEnv   = Int32.Parse(dsAsset.Tables[0].Rows[0]["environmentid"].ToString());
                                hdnEnvironment.Value = intEnv.ToString();
                                oDataPoint.LoadDropDown(ddlPlatformClass, intProfile, null, "", lblPlatformClass, fldPlatformClass, "WORKSTATION_VMWARE_CLASS", "name", "id", oClass.GetWorkstationVMwares(1), intClass, false, false, true);
                                oDataPoint.LoadDropDown(ddlPlatformEnvironment, intProfile, null, "", lblPlatformEnvironment, fldPlatformEnvironment, "WORKSTATION_VMWARE_ENVIRONMENT", "name", "id", oClass.GetEnvironment(intClass, 0), intEnv, false, false, true);
                                ddlStatus.SelectedValue = dsAsset.Tables[0].Rows[0]["status"].ToString();
                                ddlStatus.Enabled       = (intAssetAttribute == (int)AssetAttribute.Ok);
                                panStatus.Visible       = (ddlStatus.Enabled == false);

                                int  intOS    = Int32.Parse(dsAsset.Tables[0].Rows[0]["osid"].ToString());
                                bool boolXP   = (oOperatingSystem.Get(intOS, "code") == "XP");
                                bool boolWin7 = (oOperatingSystem.Get(intOS, "code") == "7");
                                oDataPoint.LoadDropDown(ddlPlatformOS, intProfile, null, "", lblPlatformOS, fldPlatformOS, "WORKSTATION_VMWARE_OS", "name", "id", oOperatingSystem.Gets(1, 1), intOS, false, false, true);
                                oDataPoint.LoadDropDown(ddlPlatformServicePack, intProfile, null, "", lblPlatformServicePack, fldPlatformServicePack, "WORKSTATION_VMWARE_SP", "name", "id", oOperatingSystem.GetServicePack(intOS), Int32.Parse(dsAsset.Tables[0].Rows[0]["spid"].ToString()), false, false, true);
                                oDataPoint.LoadDropDown(ddlPlatformDomain, intProfile, null, "", lblPlatformDomain, fldPlatformDomain, "WORKSTATION_VMWARE_DOMAIN", "name", "id", oDomain.Gets(1), Int32.Parse(dsAsset.Tables[0].Rows[0]["domainid"].ToString()), false, false, true);
                                oDataPoint.LoadDropDown(ddlPlatformHDD, intProfile, null, "", lblPlatformHDD, fldPlatformHDD, "WORKSTATION_VMWARE_HDD", "name", "id", oVirtualHDD.GetVMwares((boolXP ? 1 : 0), (boolWin7 ? 1 : 0), 1), Int32.Parse(dsAsset.Tables[0].Rows[0]["hddid"].ToString()), false, false, true);
                                oDataPoint.LoadDropDown(ddlPlatformRam, intProfile, null, "", lblPlatformRam, fldPlatformRam, "WORKSTATION_VMWARE_RAM", "name", "id", oVirtualRam.GetVMwares((boolXP ? 1 : 0), (boolWin7 ? 1 : 0), 1), Int32.Parse(dsAsset.Tables[0].Rows[0]["ramid"].ToString()), false, false, true);
                            }
                            else
                            {
                                Response.Redirect("/datapoint/asset/datapoint_asset_search.aspx");
                            }

                            // Get Host
                            oDataPoint.LoadTextBox(txtHostName, intProfile, btnHostName, "/datapoint/asset/server.aspx?t=name&q=" + oFunction.encryptQueryString(dsAsset.Tables[0].Rows[0]["hostname"].ToString()), lblHostName, fldHostName, "WORKSTATION_VMWARE_HOST", dsAsset.Tables[0].Rows[0]["hostname"].ToString(), "", false, false);
                            if (Request.Cookies["virtual_guest"] != null && Request.Cookies["virtual_guest"].Value != "")
                            {
                                string strHost = "";
                                string strFind = txtName.Text;
                                //strFind = "ohcleapp103d";
                                DateTime datStart = DateTime.Parse(Request.Cookies["virtual_guest"].Value);
                                Response.Cookies["virtual_guest"].Value = "";
                                VMWare         oVMWare    = new VMWare(intProfile, dsn);
                                string         strConnect = oVMWare.Connect(strFind);
                                VimService     _service   = oVMWare.GetService();
                                ServiceContent _sic       = oVMWare.GetSic();
                                try
                                {
                                    ManagedObjectReference oVM         = oVMWare.GetVM(strFind);
                                    ManagedObjectReference oParent     = (ManagedObjectReference)oVMWare.getObjectProperty(oVM, "parent");
                                    ManagedObjectReference oDataCenter = (ManagedObjectReference)oVMWare.getObjectProperty(oParent, "parent");
                                    string    strDataCenter            = (string)oVMWare.getObjectProperty(oDataCenter, "name");
                                    GuestInfo ginfo = (GuestInfo)oVMWare.getObjectProperty(oVM, "guest");
                                    lblGuestState.Text = ginfo.guestState;
                                    GuestNicInfo[] nInfo = ginfo.net;
                                    foreach (GuestNicInfo nic in nInfo)
                                    {
                                        string[] strIPAddresses = nic.ipAddress;
                                        foreach (string strIPAddress in strIPAddresses)
                                        {
                                            if (lblIPAddress.Text != "")
                                            {
                                                lblIPAddress.Text += ", ";
                                            }
                                            lblIPAddress.Text += strIPAddress;
                                        }
                                        if (lblMACAddress.Text != "")
                                        {
                                            lblMACAddress.Text += ", ";
                                        }
                                        lblMACAddress.Text += nic.macAddress;
                                        if (lblNetwork.Text != "")
                                        {
                                            lblNetwork.Text += ", ";
                                        }
                                        lblNetwork.Text += nic.network;
                                    }
                                    // HDD
                                    GuestDiskInfo[] oVMDisks = ginfo.disk;
                                    foreach (GuestDiskInfo oDisk in oVMDisks)
                                    {
                                        if (lblHDD.Text != "")
                                        {
                                            lblHDD.Text += "<br/>";
                                        }
                                        double dblCapacity = double.Parse(oDisk.capacity.ToString());
                                        dblCapacity = dblCapacity / 1024.00;
                                        dblCapacity = dblCapacity / 1024.00;
                                        dblCapacity = dblCapacity / 1024.00;
                                        double dblAvailable = double.Parse(oDisk.freeSpace.ToString());
                                        dblAvailable = dblAvailable / 1024.00;
                                        dblAvailable = dblAvailable / 1024.00;
                                        dblAvailable = dblAvailable / 1024.00;
                                        lblHDD.Text += oDisk.diskPath + "&nbsp;&nbsp;" + dblCapacity.ToString("F") + " GB (" + dblAvailable.ToString("F") + " GB available)";
                                    }
                                    // Status
                                    VirtualMachineSummary oVMSummary = (VirtualMachineSummary)oVMWare.getObjectProperty(oVM, "summary");
                                    ManagedEntityStatus   oVMStatus  = oVMSummary.overallStatus;

                                    //lblOverallStatus.Text = (string)oVMStatus;
                                    lblOverallStatus.Text = Enum.GetName(typeof(ManagedEntityStatus), (ManagedEntityStatus)oVMStatus);
                                    // RAM & CPUs & Host
                                    VirtualMachineConfigSummary oVMConfig = oVMSummary.config;
                                    lblRAM.Text  = oVMConfig.memorySizeMB.ToString();
                                    lblCPUs.Text = oVMConfig.numCpu.ToString();
                                    VirtualMachineRuntimeInfo oVMRuntime = oVMSummary.runtime;
                                    ManagedObjectReference    oVMHost    = oVMRuntime.host;
                                    strHost = (string)oVMWare.getObjectProperty(oVMHost, "name");
                                    if (strHost.IndexOf(".") > -1)
                                    {
                                        strHost = strHost.Substring(0, strHost.IndexOf("."));
                                    }
                                    lblVirtualCenter.Text = oVMWare.VirtualCenter();
                                    lblDataCenter.Text    = oVMWare.DataCenter();
                                }
                                catch { }
                                finally
                                {
                                    if (_service != null)
                                    {
                                        _service.Abort();
                                        if (_service.Container != null)
                                        {
                                            _service.Container.Dispose();
                                        }
                                        try
                                        {
                                            _service.Logout(_sic.sessionManager);
                                        }
                                        catch { }
                                        _service.Dispose();
                                        _service = null;
                                        _sic     = null;
                                    }
                                }

                                if (strHost != "")
                                {
                                    panGuestYes.Visible = true;
                                    oDataPoint.LoadTextBox(txtHostName, intProfile, btnHostName, "/datapoint/asset/server.aspx?t=name&q=" + oFunction.encryptQueryString(strHost), lblHostName, fldHostName, "WORKSTATION_VMWARE_HOST", strHost, "", false, false);
                                }
                                else
                                {
                                    panGuestNo.Visible = true;
                                }
                                TimeSpan oSpan = DateTime.Now.Subtract(datStart);
                                btnGuestQuery.Enabled = false;
                                btnGuestQuery.Text    = "Query Time: " + oSpan.TotalSeconds.ToString("0") + " seconds...";
                            }
                            oDataPoint.LoadPanel(panGuestQuery, intProfile, fldHostQuery, "WORKSTATION_VMWARE_HOST_QUERY");

                            // Account Information
                            DataSet dsAccounts = oWorkstation.GetAccountsVMware(intWorkstation);
                            rptAccounts.DataSource = dsAccounts;
                            rptAccounts.DataBind();
                            lblNone.Visible = (rptAccounts.Items.Count == 0);

                            // Resource Dependencies
                            rptServiceRequests.DataSource = ds.Tables[1];
                            rptServiceRequests.DataBind();
                            trServiceRequests.Visible = (rptServiceRequests.Items.Count == 0);
                            foreach (RepeaterItem ri in rptServiceRequests.Items)
                            {
                                Label lblRequestID = (Label)ri.FindControl("lblRequestID");
                                Label lblServiceID = (Label)ri.FindControl("lblServiceID");
                                Label lblNumber    = (Label)ri.FindControl("lblNumber");
                                int   intService   = Int32.Parse(lblServiceID.Text);
                                Label lblDetails   = (Label)ri.FindControl("lblDetails");
                                Label lblProgress  = (Label)ri.FindControl("lblProgress");

                                if (lblProgress.Text == "")
                                {
                                    lblProgress.Text = "<i>Unavailable</i>";
                                }
                                else
                                {
                                    int intResource = Int32.Parse(lblProgress.Text);
                                    //lblProgress.Text = oResourceRequest.GetStatus(Int32.Parse(lblRequestID.Text), Int32.Parse(lblServiceID.Text), Int32.Parse(lblNumber.Text), true, true, dsnServiceEditor, dsnAsset, intServiceDecommission);
                                    lblProgress.Text = oResourceRequest.GetStatus(null, null, Int32.Parse(lblRequestID.Text), Int32.Parse(lblServiceID.Text), null, Int32.Parse(lblNumber.Text), true, dsnServiceEditor)[0].status;

                                    /*
                                     * double dblAllocated = 0.00;
                                     * double dblUsed = 0.00;
                                     * int intStatus = 0;
                                     * bool boolAssigned = false;
                                     * DataSet dsResource = oDataPoint.GetServiceRequestResource(intResource);
                                     * if (dsResource.Tables[0].Rows.Count > 0)
                                     *  Int32.TryParse(dsResource.Tables[0].Rows[0]["status"].ToString(), out intStatus);
                                     * foreach (DataRow drResource in dsResource.Tables[1].Rows)
                                     * {
                                     *  boolAssigned = true;
                                     *  dblAllocated += double.Parse(drResource["allocated"].ToString());
                                     *  dblUsed += double.Parse(drResource["used"].ToString());
                                     *  intStatus = Int32.Parse(drResource["status"].ToString());
                                     * }
                                     * if (intStatus == (int)ResourceRequestStatus.Closed)
                                     *  lblProgress.Text = oServiceRequest.GetStatusBar(100.00, "100", "12", true);
                                     * else if (intStatus == (int)ResourceRequestStatus.Cancelled)
                                     *  lblProgress.Text = "Cancelled";
                                     * else if (boolAssigned == false)
                                     * {
                                     *  string strManager = "";
                                     *  DataSet dsManager = oService.GetUser(intService, 1);  // Managers
                                     *  foreach (DataRow drManager in dsManager.Tables[0].Rows)
                                     *  {
                                     *      if (strManager != "")
                                     *          strManager += "\\n";
                                     *      int intManager = Int32.Parse(drManager["userid"].ToString());
                                     *      strManager += " - " + oUser.GetFullName(intManager) + " [" + oUser.GetName(intManager) + "]";
                                     *  }
                                     *  lblProgress.Text = "<a href=\"javascript:void(0);\" class=\"lookup\" onclick=\"alert('This request is pending assignment by the following...\\n\\n" + strManager + "');\">Pending Assignment</a>";
                                     * }
                                     * else if (dblAllocated > 0.00)
                                     *  lblProgress.Text = oServiceRequest.GetStatusBar((dblUsed / dblAllocated) * 100.00, "100", "12", true);
                                     * else
                                     *  lblProgress.Text = "<i>N / A</i>";
                                     */
                                    lblDetails.Text = "<a href=\"javascript:void(0);\" class=\"lookup\" onclick=\"OpenNewWindowMenu('/datapoint/service/resource.aspx?id=" + oFunction.encryptQueryString(intResource.ToString()) + "', '800', '600');\">" + lblDetails.Text + "</a>";
                                }
                            }

                            // Provioning History
                            rptHistory.DataSource = SqlHelper.ExecuteDataset(dsnAsset, CommandType.Text, oDataPoint.AssetHistorySelect(intAsset));
                            rptHistory.DataBind();
                            lblHistory.Visible = (rptHistory.Items.Count == 0);
                            oDataPoint.LoadPanel(panProvisioning, intProfile, fldProvisioning, "WORKSTATION_VMWARE_STATUS");
                        }
                    }
                    else
                    {
                        if (Request.QueryString["t"] != null && Request.QueryString["q"] != null)
                        {
                            Response.Redirect("/datapoint/asset/datapoint_asset_search.aspx?t=" + Request.QueryString["t"] + "&q=" + Request.QueryString["q"] + "&r=0");
                        }
                        else
                        {
                            Response.Redirect("/datapoint/asset/datapoint_asset_search.aspx");
                        }
                    }
                }
                else if (Request.QueryString["q"] != null && Request.QueryString["q"] != "")
                {
                    string  strQuery = oFunction.decryptQueryString(Request.QueryString["q"]);
                    DataSet ds       = oDataPoint.GetAssetName(strQuery, intID, 0, "", "", 0);
                    if (ds.Tables[0].Rows.Count == 1)
                    {
                        intAsset = Int32.Parse(ds.Tables[0].Rows[0]["assetid"].ToString());
                        Response.Redirect(Request.Path + "?t=" + Request.QueryString["t"] + "&q=" + Request.QueryString["q"] + "&id=" + oFunction.encryptQueryString(intAsset.ToString()));
                    }
                }
                else
                {
                    Response.Redirect("/datapoint/asset/datapoint_asset_search.aspx");
                }
                btnClose.Attributes.Add("onclick", "window.close();return false;");
                btnPrint.Attributes.Add("onclick", "window.print();return false;");
                btnName.Attributes.Add("onclick", "return OpenWindow('DEVICE_NAME','?assetid=" + intAsset.ToString() + "');");
                btnSave.Attributes.Add("onclick", oDataPoint.LoadValidation("ProcessControlButton()"));
                btnSaveClose.Attributes.Add("onclick", oDataPoint.LoadValidation("ProcessControlButton()"));
                ddlPlatformClass.Attributes.Add("onchange", "PopulateEnvironments('" + ddlPlatformClass.ClientID + "','" + ddlPlatformEnvironment.ClientID + "',0);");
                ddlPlatformEnvironment.Attributes.Add("onchange", "UpdateDropDownHidden('" + ddlPlatformEnvironment.ClientID + "','" + hdnEnvironment.ClientID + "');");
                btnGuestQuery.Attributes.Add("onclick", "ProcessButton(this,'Querying... please be patient...','225') && ProcessControlButton();");
                btnOutput.Attributes.Add("onclick", "return ProcessButton(this) && ProcessControlButton();");
            }
            else
            {
                panDenied.Visible = true;
            }
        }
Exemplo n.º 12
0
        protected void btnRegister_Click(object sender, EventArgs e)
        {
            RefreshForm();
            ulErrors.Controls.Clear();
            bool Valid = true;

            Valid = AddError(txtName, "Enter a server name", Valid, ValidationRestriction.Basic, Validation.Required, ulErrors, panError);
            Valid = AddError(ddlBackup, "Select the backup software", Valid, ulErrors, panError);
            Valid = AddError(txtIPServer, "Enter a valid server IP address", Valid, ValidationRestriction.IPAddress, Validation.Optional, ulErrors, panError);
            Valid = AddError(txtIPServerVLAN, txtIPServer, "Enter the VLAN of the server IP address", Valid, ValidationRestriction.Numeric, ulErrors, panError);
            Valid = AddError(txtIPServerMask, txtIPServer, "Enter the subnet mask of the server IP address", Valid, ValidationRestriction.IPAddress, ulErrors, panError);
            Valid = AddError(txtIPServerGateway, txtIPServer, "Enter the gateway of the server IP address", Valid, ValidationRestriction.IPAddress, ulErrors, panError);
            Valid = AddError(txtIPBackup, "Enter a valid bakup IP address", Valid, ValidationRestriction.IPAddress, Validation.Optional, ulErrors, panError);
            Valid = AddError(txtIPBackupVLAN, txtIPBackup, "Enter the VLAN of the backup IP address", Valid, ValidationRestriction.Numeric, ulErrors, panError);
            Valid = AddError(txtIPBackupMask, txtIPBackup, "Enter the subnet mask of the backup IP address", Valid, ValidationRestriction.IPAddress, ulErrors, panError);
            Valid = AddError(txtIPBackupGateway, txtIPBackup, "Enter the gateway of the backup IP address", Valid, ValidationRestriction.IPAddress, ulErrors, panError);
            Valid = AddError(ddlOS, "Select the operating system", Valid, ulErrors, panError);

            if (boolOSWindows || boolOSLinux)
            {
                Valid = AddError(ddlMDT, "Select the build location", Valid, ulErrors, panError);
            }
            if (boolOSWindows)
            {
                Valid = AddError(ddlDomainWindows, "Select the domain", Valid, ulErrors, panError);
            }
            if (boolOSLinux)
            {
                Valid = AddError(ddlDomainLinux, "Select the domain", Valid, ulErrors, panError);
            }
            if (boolOSWindows || boolOSLinux || boolOSSolaris)
            {
                Valid = AddError(new RadioButton[] { radVirtualYes, radVirtualNo }, "Choose if this is a virtual machine", Valid, ulErrors, panError);
            }
            if (boolTypeVirtual)
            {
                if (boolOSWindows || boolOSLinux)
                {
                    Valid = AddError(txtMac, "Enter the MAC address of the server", Valid, ValidationRestriction.MACAddress, Validation.Required, ulErrors, panError);
                }
            }
            if (boolTypePhysical)
            {
                Valid = AddError(txtSerial, "Enter the serial number", Valid, ValidationRestriction.Basic, Validation.Required, ulErrors, panError);
                Valid = AddError(txtMacPrimary, "Enter the primary MAC address of the server", Valid, ValidationRestriction.MACAddress, Validation.Required, ulErrors, panError);
                if (boolOSSolaris)
                {
                    Valid = AddError(ddlBuildType, "Select the build type", Valid, ulErrors, panError);
                    Valid = AddError(ddlDomainSolaris, "Select the domain", Valid, ulErrors, panError);
                    Valid = AddError(ddlSource, "Select the source", Valid, ulErrors, panError);
                    Valid = AddError(new RadioButton[] { radBootLocal, radBootSan }, "Select the boot type", Valid, ulErrors, panError);
                    Valid = AddError(new RadioButton[] { radEcomYes, radEcomNo }, "Choose if this is going into the E-commerce environment", Valid, ulErrors, panError);
                    Valid = AddError(ddlBuildNetwork, "Select the build network", Valid, ulErrors, panError);
                    Valid = AddError(ddlCGI, "Select the CGI script location", Valid, ulErrors, panError);
                    Valid = AddError(ddlInterface1, "Select interface # 1", Valid, ulErrors, panError);
                    Valid = AddError(txtMPIP1, "Enter a valid MP IP address # 1", Valid, ValidationRestriction.IPAddress, Validation.Required, ulErrors, panError);
                    Valid = AddError(txtMPIP1VLAN, txtMPIP1, "Enter the VLAN of MP IP address # 1", Valid, ValidationRestriction.Numeric, ulErrors, panError);
                    Valid = AddError(ddlInterface2, "Select interface # 2", Valid, ulErrors, panError);
                    Valid = AddError(txtMPIP2, "Enter a valid MP IP address # 2", Valid, ValidationRestriction.IPAddress, Validation.Required, ulErrors, panError);
                    Valid = AddError(txtMPIP2VLAN, txtMPIP2, "Enter the VLAN of MP IP address # 2", Valid, ValidationRestriction.Numeric, ulErrors, panError);
                }
            }


            if (Valid)
            {
                string strName            = txtName.Text.Trim();
                string strBackup          = ddlBackup.SelectedValue;
                string strSerial          = txtSerial.Text.Trim();
                string strAsset           = txtAsset.Text.Trim();
                int    intOS              = ParseInt(ddlOS.SelectedItem.Value);
                string strIP              = txtIPServer.Text.Trim();
                string strIPVlan          = txtIPServerVLAN.Text.Trim();
                string strIPMask          = txtIPServerMask.Text.Trim();
                string strIPGateway       = txtIPServerGateway.Text.Trim();
                string strIPBackup        = txtIPBackup.Text.Trim();
                string strIPBackupVlan    = txtIPBackupVLAN.Text.Trim();
                string strIPBackupMask    = txtIPBackupMask.Text.Trim();
                string strIPBackupGateway = txtIPBackupGateway.Text.Trim();

                string strArrayConfig = "PNCBASIC30";
                if (radVirtualYes.Checked)
                {
                    strArrayConfig = "BASIC";
                }

                string strMAC1 = txtMacPrimary.Text;
                string strMAC2 = txtMacSecondary.Text;
                if (boolTypeVirtual)
                {
                    strMAC1 = txtMac.Text;
                    strMAC2 = "";
                }

                string strError = "";
                try
                {
                    bool boolMDT = false;
                    if (boolOSWindows)
                    {
                        strError = oZeus.AddBuild(intID, intID, intID, strSerial, strAsset, strName, strArrayConfig, oOperatingSystem.Get(intOS, "zeus_os"), oOperatingSystem.Get(intOS, "zeus_os_version"), 0, oOperatingSystem.Get(intOS, "zeus_build_type"), ddlDomainWindows.SelectedItem.Value, intEnvironment, "SERVER", 0, strMAC1, strMAC2, strIP, strIPVlan, strIPMask, strIPGateway, strIPBackup, strIPBackupVlan, strIPBackupMask, strIPBackupGateway, "", "", "", "", ddlMDT.SelectedItem.Value, "", 1);
                        if (strError == "")
                        {
                            // Add Applications
                            foreach (ListItem li in chkComponentsWindows.Items)
                            {
                                if (li.Selected)
                                {
                                    oZeus.AddApp(strSerial, li.Value, "");
                                }
                            }
                            boolMDT = true;
                        }
                    }
                    else if (boolOSLinux)
                    {
                        strError = oZeus.AddBuild(intID, intID, intID, strSerial, strAsset, strName, strArrayConfig, oOperatingSystem.Get(intOS, "name"), "", 0, "", ddlDomainLinux.SelectedItem.Value, intEnvironment, "SERVER", 0, strMAC1, strMAC2, strIP, strIPVlan, strIPMask, strIPGateway, strIPBackup, strIPBackupVlan, strIPBackupMask, strIPBackupGateway, "", "", "", "", ddlMDT.SelectedItem.Value, "", 1);
                        if (strError == "")
                        {
                            // Add Applications
                            foreach (ListItem li in chkComponentsLinux.Items)
                            {
                                if (li.Selected)
                                {
                                    oZeus.AddApp(strSerial, li.Value, "");
                                }
                            }
                            boolMDT = true;
                        }
                    }
                    else if (boolOSSolaris)
                    {
                        string strZeusBuildTypeSolaris = ddlBuildType.SelectedItem.Value;
                        string strSolarisDomain        = ddlDomainSolaris.SelectedItem.Value;
                        string strSolarisBuildFlags    = (radBootLocal.Checked ? "P,T,D" : "P");
                        if (radEcomYes.Checked)
                        {
                            strSolarisBuildFlags += ",E";
                        }
                        string strSource              = ddlSource.SelectedItem.Value;
                        string strSolarisMAC          = oFunction.FormatMAC(strMAC1, ":");
                        string strJumpstartCGI        = ddlCGI.SelectedItem.Value;
                        string strSolarisBuildNetwork = ddlBuildNetwork.SelectedItem.Value;
                        string strJumpstartBuildType  = "dhcp";

                        strError = oZeus.AddBuild(intID, intID, intID, strSerial, strAsset, strName.ToLower(), strArrayConfig, oOperatingSystem.Get(intOS, "zeus_os"), oOperatingSystem.Get(intOS, "zeus_os_version"), 0, strZeusBuildTypeSolaris, strSolarisDomain, intEnvironment, strSource, 0, strSolarisMAC, "", strIP, strIPVlan, strIPMask, strIPGateway, strIPBackup, strIPBackupVlan, strIPBackupMask, strIPBackupGateway, ddlInterface1.SelectedItem.Value, txtMPIP1.Text, ddlInterface2.SelectedItem.Value, txtMPIP2.Text, strSolarisBuildFlags, oVariable.SolarisFlags(strJumpstartCGI, strSolarisBuildNetwork, strJumpstartBuildType, false), 1);

                        if (strError == "")
                        {
                            // Register
                            string strJumpstartURL = "http://" + strJumpstartCGI + "/cgi-bin/jumpstart.cgi?1010,MACADDR=" + strSolarisMAC + ",create_host_info";
                            oLog.AddEvent(intID, strName, strSerial, "Beginning HOST.INFO registration on jumpstart URL = " + strJumpstartURL, LoggingType.Information);
                            if (RunCGI(strJumpstartURL) == true)
                            {
                                oLog.AddEvent(intID, strName, strSerial, "Success!! HOST.INFO registration on jumpstart URL = " + strJumpstartURL, LoggingType.Information);
                            }
                            else
                            {
                                strError = "CREATE_HOST_INFO registration ~ Jumpstart URL = " + strJumpstartURL + " failed.";
                                oLog.AddEvent(intID, strName, strSerial, "Failure!! HOST.INFO registration on jumpstart URL = " + strJumpstartURL, LoggingType.Error);
                            }
                            strJumpstartURL = "http://" + strJumpstartCGI + "/cgi-bin/jumpstart.cgi?1010,MACADDR=" + strSolarisMAC + ",add_client";
                            oLog.AddEvent(intID, strName, strSerial, "Beginning Client Configuration on jumpstart URL = " + strJumpstartURL, LoggingType.Information);
                            if (RunCGI(strJumpstartURL) == true)
                            {
                                oLog.AddEvent(intID, strName, strSerial, "Success!! Client Configuration on jumpstart URL = " + strJumpstartURL, LoggingType.Information);
                            }
                            else
                            {
                                strError = "ADD_CLIENT registration ~ Jumpstart URL = " + strJumpstartURL + " failed.";
                                oLog.AddEvent(intID, strName, strSerial, "Failure!! Client Configuration on jumpstart URL = " + strJumpstartURL, LoggingType.Error);
                            }
                        }
                    }
                    else if (boolOSAIX)
                    {
                        strError = "AIX is unavailable at this time.";
                    }
                    else
                    {
                        // Other
                        strError = "The selected operating system is unavailable at this time.";
                    }

                    if (boolMDT)
                    {
                        // Register MDT
                        string strRDPMDTWebService = ddlMDT.SelectedItem.Value;
                        System.Net.NetworkCredential oCredentials = new System.Net.NetworkCredential(oVariable.ADUser(), oVariable.ADPassword(), oVariable.Domain());
                        BuildSubmit oMDT = new BuildSubmit();
                        oMDT.Credentials = oCredentials;
                        oMDT.Url         = strRDPMDTWebService;
                        string strMDTMAC1 = oFunction.FormatMAC(strMAC1, ":");
                        oLog.AddEvent(intID, strName, strSerial, "Running ForceCleanup MDT on " + strRDPMDTWebService + " (" + strName + ", " + strMDTMAC1 + ", " + "ServerShare" + ")", LoggingType.Information);
                        oMDT.ForceCleanup(strName, strMDTMAC1, "ServerShare");
                        string strMDTMAC2 = "";
                        if (strMAC2 != "")
                        {
                            strMDTMAC2 = oFunction.FormatMAC(strMAC2, ":");
                            oLog.AddEvent(intID, strName, strSerial, "Waiting 60 seconds for Active Directory to Sychronize...", LoggingType.Debug);
                            Thread.Sleep(60000); // Wait 60 seconds
                            oLog.AddEvent(intID, strName, strSerial, "Running ForceCleanup MDT on " + strRDPMDTWebService + " (" + strName + ", " + strMDTMAC2 + ", " + "ServerShare" + ")", LoggingType.Information);
                            oMDT.ForceCleanup(strName, strMDTMAC2, "ServerShare");
                        }
                        string[] strExtendedMDT1  = new string[] { "PNCBACKUPSOFTWARE:" + strBackup, "IISInstall:" + (chkIIS.Checked ? "YES" : "NO"), "HWConfig:" + (radBootLocal.Checked ? "DellLD" : "DEFAULT"), "ESMInstall:" + (chkESM.Checked ? "YES" : "NO") + ", ClearViewInstall:YES", "Teamed2:" + strMDTMAC2, "HIDSInstall:" + (chkHIDS.Checked ? "YES" : "NO") };
                        string   strExtendedMDTs1 = "";
                        foreach (string extendedMDT in strExtendedMDT1)
                        {
                            if (strExtendedMDTs1 != "")
                            {
                                strExtendedMDTs1 += ", ";
                            }
                            strExtendedMDTs1 += extendedMDT;
                        }
                        string strBootEnvironment = oOperatingSystem.Get(intOS, "boot_environment");
                        string strTaskSequence    = oOperatingSystem.Get(intOS, "task_sequence");
                        string strDomain          = ddlDomainWindows.SelectedItem.Value;
                        oLog.AddEvent(intID, strName, strSerial, "Registering MDT on " + strRDPMDTWebService + ", automatedBuild2 (" + strName + ", " + strMDTMAC1 + ", " + strBootEnvironment + ", " + "provision" + ", " + strDomain + ", " + strTaskSequence + ", " + "ServerShare" + ", ExtendedValues=" + strExtendedMDTs1 + ")", LoggingType.Information);
                        oMDT.automatedBuild2(strName, strMDTMAC1, strBootEnvironment, "provision", strDomain, strTaskSequence, "ServerShare", strExtendedMDT1);
                        if (strMDTMAC2 != "")
                        {
                            string[] strExtendedMDT2  = new string[] { "PNCBACKUPSOFTWARE:" + strBackup, "IISInstall:" + (chkIIS.Checked ? "YES" : "NO"), "HWConfig:" + (radBootLocal.Checked ? "DellLD" : "DEFAULT"), "ESMInstall:" + (chkESM.Checked ? "YES" : "NO") + ", ClearViewInstall:YES", "Teamed2:" + strMDTMAC1, "HIDSInstall:" + (chkHIDS.Checked ? "YES" : "NO") };
                            string   strExtendedMDTs2 = "";
                            foreach (string extendedMDT in strExtendedMDT2)
                            {
                                if (strExtendedMDTs2 != "")
                                {
                                    strExtendedMDTs2 += ", ";
                                }
                                strExtendedMDTs2 += extendedMDT;
                            }
                            oLog.AddEvent(intID, strName, strSerial, "Waiting 60 seconds for Active Directory to Sychronize...", LoggingType.Debug);
                            Thread.Sleep(60000); // Wait 60 seconds
                            oLog.AddEvent(intID, strName, strSerial, "Registering MDT on " + strRDPMDTWebService + ", automatedBuild2 (" + strName + ", " + strMDTMAC2 + ", " + strBootEnvironment + ", " + "provision" + ", " + strDomain + ", " + strTaskSequence + ", " + "ServerShare" + ", ExtendedValues=" + strExtendedMDTs2 + ")", LoggingType.Information);
                            oMDT.automatedBuild2(strName, strMDTMAC1, strBootEnvironment, "provision", strDomain, strTaskSequence, "ServerShare", strExtendedMDT2);
                        }
                        oLog.AddEvent(intID, strName, strSerial, "MDT has been configured", LoggingType.Information);
                    }
                }
                catch (Exception ex)
                {
                    strError = ex.Message;
                }


                if (strError == "")
                {
                    panSuccess.Visible = true;
                    litName.Text       = txtName.Text.ToUpper();
                }
                else
                {
                    AddError(strError, ulErrors2, panError2);
                }
            }
            // ArrayConfig
            //      PNCBASIC30      = Windows / Linux Blade, All Solaris
            //      BASIC           = VMware
            //      SANCONNECTEDF   = Rackmount (not just BFS?)
        }