Exemplo n.º 1
0
 protected void LoadLists()
 {
     ddlScheduleResiliency.DataValueField = "id";
     ddlScheduleResiliency.DataTextField  = "name";
     ddlScheduleResiliency.DataSource     = oResiliency.Gets(1);
     ddlScheduleResiliency.DataBind();
     ddlScheduleResiliency.Items.Insert(0, new ListItem("-- SELECT --", "0"));
     ddlDomainResiliency.DataValueField = "id";
     ddlDomainResiliency.DataTextField  = "name";
     ddlDomainResiliency.DataSource     = oResiliency.Gets(1);
     ddlDomainResiliency.DataBind();
     ddlDomainResiliency.Items.Insert(0, new ListItem("-- SELECT --", "0"));
 }
Exemplo n.º 2
0
        private void LoopRepeater()
        {
            panView.Visible = true;
            DataSet  ds = oResiliency.Gets(0);
            DataView dv = ds.Tables[0].DefaultView;

            if (Request.QueryString["sort"] != null)
            {
                dv.Sort = Request.QueryString["sort"].ToString();
            }
            rptView.DataSource = dv;
            rptView.DataBind();
            foreach (RepeaterItem ri in rptView.Items)
            {
                ImageButton oDelete = (ImageButton)ri.FindControl("btnDelete");
                oDelete.Attributes.Add("onClick", "return confirm('Are you sure you want to delete this item?');");
                ImageButton oEnable = (ImageButton)ri.FindControl("btnEnable");
                if (oEnable.ImageUrl == "/admin/images/enabled.gif")
                {
                    oEnable.ToolTip = "Click to disable";
                    oEnable.Attributes.Add("onClick", "return confirm('Are you sure you want to disable this item?');");
                }
                else
                {
                    oEnable.ToolTip = "Click to enable";
                }
            }
        }
Exemplo n.º 3
0
        public void LoadLists()
        {
            Classes oClasses = new Classes(intProfile, dsn);

            ddlClass.DataValueField = "id";
            ddlClass.DataTextField  = "name";
            ddlClass.DataSource     = oClasses.Gets(1);
            ddlClass.DataBind();
            ddlClass.Items.Insert(0, new ListItem("-- SELECT --", "0"));
            int intAddress = 0;

            if (Request.QueryString["aid"] != null && Request.QueryString["aid"] != "")
            {
                intAddress = Int32.Parse(Request.QueryString["aid"]);
            }
            Locations oLocation = new Locations(intProfile, dsn);

            //ddlLocation.DataValueField = "id";
            //ddlLocation.DataTextField = "fullname";
            //if (intAddress == 0)
            //    ddlLocation.DataSource = oLocation.GetAddressCommon();
            //else
            //    ddlLocation.DataSource = oLocation.GetAddresss(1);
            //ddlLocation.DataBind();
            //ddlLocation.SelectedValue = intAddress.ToString();
            //if (intAddress == 0)
            //    ddlLocation.Items.Add(new ListItem("-- NOT LISTED --", "-1"));
            //ddlLocation.Items.Insert(0, new ListItem("-- SELECT --", "0"));
            //Rooms oRooms = new Rooms(intProfile, dsn);
            //ddlRoom.DataValueField = "id";
            //ddlRoom.DataTextField = "name";
            //ddlRoom.DataSource = oRooms.Gets(1);
            //ddlRoom.DataBind();
            //ddlRoom.Items.Insert(0, new ListItem("-- SELECT --", "0"));
            //Racks oRacks = new Racks(intProfile, dsn);
            //ddlRack.DataValueField = "id";
            //ddlRack.DataTextField = "name";
            //ddlRack.DataSource = oRacks.Gets(1);
            //ddlRack.DataBind();
            //ddlRack.Items.Insert(0, new ListItem("-- SELECT --", "0"));
            ddlBuildNetwork.DataValueField = "id";
            ddlBuildNetwork.DataTextField  = "name";
            ddlBuildNetwork.DataSource     = oSolaris.GetBuildNetworks(1);
            ddlBuildNetwork.DataBind();
            ddlBuildNetwork.Items.Insert(0, new ListItem("-- SELECT --", "0"));

            ddlResiliency.DataValueField = "id";
            ddlResiliency.DataTextField  = "name";
            ddlResiliency.DataSource     = oResiliency.Gets(1);
            ddlResiliency.DataBind();
            ddlResiliency.Items.Insert(0, new ListItem("-- SELECT --", "0"));

            ddlOperatingSystemGroup.DataValueField = "id";
            ddlOperatingSystemGroup.DataTextField  = "name";
            ddlOperatingSystemGroup.DataSource     = oOperatingSystem.GetGroups(1);
            ddlOperatingSystemGroup.DataBind();
            ddlOperatingSystemGroup.Items.Insert(0, new ListItem("-- SELECT --", "0"));
        }
Exemplo n.º 4
0
 private void LoadLists()
 {
     ddlClass.DataTextField  = "name";
     ddlClass.DataValueField = "id";
     ddlClass.DataSource     = oClass.Gets(1);
     ddlClass.DataBind();
     ddlClass.Items.Insert(0, new ListItem("-- SELECT --", "0"));
     ddlResiliency.DataValueField = "id";
     ddlResiliency.DataTextField  = "name";
     ddlResiliency.DataSource     = oResiliency.Gets(1);
     ddlResiliency.DataBind();
     ddlResiliency.Items.Insert(0, new ListItem("-- SELECT --", "0"));
 }
Exemplo n.º 5
0
        private void LoadFolders(int _parent)
        {
            DataSet ds = oVMWare.GetFolders(_parent, 0);

            ddlParent.DataTextField  = "name";
            ddlParent.DataValueField = "id";
            ddlParent.DataSource     = ds;
            ddlParent.DataBind();
            ddlParent.Items.Insert(0, new ListItem("-- NONE --", "0"));
            ddlResiliency.DataValueField = "id";
            ddlResiliency.DataTextField  = "name";
            ddlResiliency.DataSource     = oResiliency.Gets(1);
            ddlResiliency.DataBind();
            ddlResiliency.Items.Insert(0, new ListItem("-- SELECT --", "0"));
        }
Exemplo n.º 6
0
        protected void LoadLists(int _platformid)
        {
            //Model
            ddlModel.DataTextField  = "name";
            ddlModel.DataValueField = "id";
            ddlModel.DataSource     = oModelsProperties.GetPlatforms(1, _platformid, 1);
            ddlModel.DataBind();
            ddlModel.Items.Insert(0, new ListItem("-- SELECT --", "0"));

            //Class
            ddlClass.DataTextField  = "name";
            ddlClass.DataValueField = "id";
            ddlClass.DataSource     = oClass.Gets(1);
            ddlClass.DataBind();
            ddlClass.Items.Insert(0, new ListItem("-- SELECT --", "0"));

            //Enclosure
            ddlEnclosure.DataTextField  = "name";
            ddlEnclosure.DataValueField = "id";
            ddlEnclosure.DataSource     = oAsset.GetEnclosures((int)AssetStatus.InUse);
            ddlEnclosure.DataBind();
            ddlEnclosure.Items.Insert(0, new ListItem("*** UNKNOWN ***", "-1"));
            ddlEnclosure.Items.Insert(0, new ListItem("-- SELECT --", "0"));

            ddlResiliency.DataValueField = "id";
            ddlResiliency.DataTextField  = "name";
            ddlResiliency.DataSource     = oResiliency.Gets(1);
            ddlResiliency.DataBind();
            ddlResiliency.Items.Insert(0, new ListItem("*** UNKNOWN ***", "-1"));
            ddlResiliency.Items.Insert(0, new ListItem("-- SELECT --", "0"));

            ddlOperatingSystemGroup.DataValueField = "id";
            ddlOperatingSystemGroup.DataTextField  = "name";
            ddlOperatingSystemGroup.DataSource     = oOperatingSystem.GetGroups(1);
            ddlOperatingSystemGroup.DataBind();
            ddlOperatingSystemGroup.Items.Insert(0, new ListItem("*** UNKNOWN ***", "-1"));
            ddlOperatingSystemGroup.Items.Insert(0, new ListItem("-- SELECT --", "0"));

            DataSet dsSwitches = oAsset.GetSwitchsByRack(0, 1);

            ddlSwitch1.DataTextField  = ddlSwitch2.DataTextField = "name";
            ddlSwitch1.DataValueField = ddlSwitch2.DataValueField = "id";
            ddlSwitch1.DataSource     = ddlSwitch2.DataSource = dsSwitches;
            ddlSwitch1.DataBind();
            ddlSwitch2.DataBind();
            ddlSwitch1.Items.Insert(0, new ListItem("-- SELECT --", "0"));
            ddlSwitch2.Items.Insert(0, new ListItem("-- SELECT --", "0"));
        }
        private void LoadList()
        {
            //Class
            ddlClass.DataTextField  = "name";
            ddlClass.DataValueField = "id";
            ddlClass.DataSource     = oClass.Gets(1);
            ddlClass.DataBind();
            ddlClass.Items.Insert(0, new ListItem("-- SELECT --", "0"));

            //Enclosure
            ddlEnclosure.DataTextField  = "name";
            ddlEnclosure.DataValueField = "id";
            ddlEnclosure.DataSource     = oAsset.GetEnclosures((int)AssetStatus.InUse);
            ddlEnclosure.DataBind();
            ddlEnclosure.Items.Insert(0, new ListItem("-- SELECT --", "0"));

            //Build Network
            ddlBuildNetwork.DataValueField = "id";
            ddlBuildNetwork.DataTextField  = "name";
            ddlBuildNetwork.DataSource     = oSolaris.GetBuildNetworks(1);
            ddlBuildNetwork.DataBind();
            ddlBuildNetwork.Items.Insert(0, new ListItem("-- SELECT --", "0"));

            //Resiliency
            ddlResiliency.DataValueField = "id";
            ddlResiliency.DataTextField  = "name";
            ddlResiliency.DataSource     = oResiliency.Gets(1);
            ddlResiliency.DataBind();
            ddlResiliency.Items.Insert(0, new ListItem("-- SELECT --", "0"));

            //Operating System Group
            ddlOperatingSystemGroup.DataValueField = "id";
            ddlOperatingSystemGroup.DataTextField  = "name";
            ddlOperatingSystemGroup.DataSource     = oOperatingSystem.GetGroups(1);
            ddlOperatingSystemGroup.DataBind();
            ddlOperatingSystemGroup.Items.Insert(0, new ListItem("-- ANY --", "0"));
        }
Exemplo n.º 8
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);
            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);
            oResiliency       = new Resiliency(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;
                    lblError.Text    = "Name Already Exists";
                }
                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 | Enclosure (" + strHeader + ")";
                        lblHeaderSub.Text = "Provides all the information about an enclosure...";
                        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("Location Information", "");
                        oTab.AddTab("Virtual Connect IPs", "");
                        oTab.AddTab("Resource Dependencies", "");
                        oTab.AddTab("Provisioning History", "");
                        oTab.AddTab("Blades", "");
                        //oTab.AddTab("Network Adapter Configuration", "");
                        strMenuTab1 = oTab.GetTabs();
                        if (oUser.IsAdmin(intProfile) == true || oDataPoint.GetFieldPermission(intProfile, "SERVER_ADMIN") == true)
                        {
                            panOldLocationInfo.Visible = true;
                        }

                        if (!IsPostBack)
                        {
                            //DataSet dsAssets = oServer.GetAsset(intAsset);
                            //foreach (DataRow drAsset in dsAssets.Tables[0].Rows)
                            //{
                            //    if (drAsset["latest"].ToString() == "1")
                            //    {
                            //        intAsset = Int32.Parse(drAsset["assetid"].ToString());
                            //        intAssetClass = Int32.Parse(drAsset["classid"].ToString());
                            //        intAssetEnv = Int32.Parse(drAsset["environmentid"].ToString());
                            //        break;
                            //    }
                            //}

                            // Asset Information
                            oDataPoint.LoadTextBox(txtPlatformSerial, intProfile, null, "", lblPlatformSerial, fldPlatformSerial, "ENCLOSURE_SERIAL", strSerial, "", false, true);
                            oDataPoint.LoadTextBox(txtPlatformAsset, intProfile, null, "", lblPlatformAsset, fldPlatformAsset, "ENCLOSURE_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);
                            int intPlatform    = oType.GetPlatform(intType);
                            oDataPoint.LoadDropDown(ddlPlatform, intProfile, null, "", lblPlatform, fldPlatform, "ENCLOSURE_PLATFORM", "name", "platformid", oPlatform.Gets(1), intPlatform, false, false, true);
                            oDataPoint.LoadDropDown(ddlPlatformType, intProfile, null, "", lblPlatformType, fldPlatformType, "ENCLOSURE_TYPE", "name", "id", oType.Gets(intPlatform, 1), intType, false, false, true);
                            oDataPoint.LoadDropDown(ddlPlatformModel, intProfile, null, "", lblPlatformModel, fldPlatformModel, "ENCLOSURE_MODEL", "name", "id", oModel.Gets(intType, 1), intModelParent, false, false, true);
                            oDataPoint.LoadDropDown(ddlPlatformModelProperty, intProfile, null, "", lblPlatformModelProperty, fldPlatformModelProperty, "ENCLOSURE_MODEL_PROP", "name", "id", oModelsProperties.GetModels(0, intModelParent, 1), intModel, false, false, true);

                            // Get Asset
                            DataSet dsAsset = oAsset.GetEnclosure(intAsset);
                            if (dsAsset.Tables[0].Rows.Count > 0)
                            {
                                oDataPoint.LoadTextBox(txtName, intProfile, null, "", lblName, fldName, "ENCLOSURE_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();
                                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, "ENCLOSURE_CLASS", "name", "id", oClass.Gets(1), intClass, false, false, true);
                                oDataPoint.LoadDropDown(ddlPlatformEnvironment, intProfile, null, "", lblPlatformEnvironment, fldPlatformEnvironment, "ENCLOSURE_ENVIRONMENT", "name", "id", oClass.GetEnvironment(intClass, 0), intEnv, false, false, true);
                                oDataPoint.LoadTextBox(txtPlatformVLAN, intProfile, null, "", lblPlatformVLAN, fldPlatformVLAN, "ENCLOSURE_VLAN", dsAsset.Tables[0].Rows[0]["vlan"].ToString(), "", false, true);
                                if (dsAsset.Tables[0].Rows[0]["oa_ip"].ToString() != "")
                                {
                                    oDataPoint.LoadTextBox(txtPlatformOA, intProfile, btnOA, "https://" + dsAsset.Tables[0].Rows[0]["oa_ip"].ToString(), lblPlatformOA, fldPlatformOA, "ENCLOSURE_OA", dsAsset.Tables[0].Rows[0]["oa_ip"].ToString(), "", false, true);
                                }
                                else
                                {
                                    oDataPoint.LoadTextBox(txtPlatformOA, intProfile, null, "", lblPlatformOA, fldPlatformOA, "ENCLOSURE_OA", dsAsset.Tables[0].Rows[0]["oa_ip"].ToString(), "", false, true);
                                }
                                int intResiliency = 0;
                                Int32.TryParse(dsAsset.Tables[0].Rows[0]["resiliencyid"].ToString(), out intResiliency);
                                oDataPoint.LoadDropDown(ddlPlatformResiliency, intProfile, null, "", lblPlatformResiliency, fldPlatformResiliency, "ENCLOSURE_RESILIENCY", "name", "id", oResiliency.Gets(1), intResiliency, false, false, true);

                                lblOldlocation.Text = dsAsset.Tables[0].Rows[0]["OldLocation"].ToString();
                                lblOldRoom.Text     = dsAsset.Tables[0].Rows[0]["OldRoom"].ToString();
                                lblOldRack.Text     = dsAsset.Tables[0].Rows[0]["OldRack"].ToString();

                                txtLocation.Text     = dsAsset.Tables[0].Rows[0]["Location"].ToString();
                                txtRoom.Text         = dsAsset.Tables[0].Rows[0]["Room"].ToString();
                                txtZone.Text         = dsAsset.Tables[0].Rows[0]["Zone"].ToString();
                                txtRack.Text         = dsAsset.Tables[0].Rows[0]["Rack"].ToString();
                                txtRackPosition.Text = dsAsset.Tables[0].Rows[0]["Rackposition"].ToString();
                                oDataPoint.LoadTextBox(txtRackPosition, intProfile, null, "", lblRackPositionValue, fldLocation, "CHANGE_LOCATION", dsAsset.Tables[0].Rows[0]["rackposition"].ToString(), "", false, true);
                                hdnRackId.Value = dsAsset.Tables[0].Rows[0]["NewRackId"].ToString();

                                oDataPoint.LoadButton(btnSelectLocation, intProfile, fldLocation, "CHANGE_LOCATION",
                                                      "return LoadLocationRoomRack('" + "rack" + "','" + hdnRackId.ClientID + "', '" + txtLocation.ClientID + "','" + txtRoom.ClientID + "','" + txtZone.ClientID + "','" + txtRack.ClientID + "');");


                                //DR Counterpart
                                int    intDR = oAsset.GetDR(intAsset);
                                string strDR = oAsset.Get(intDR, "serial");
                                if (intDR > 0)
                                {
                                    oDataPoint.LoadTextBox(txtPlatformDRCounterPart, intProfile, btnPlatformDRCounterPart, "/datapoint/asset/datapoint_asset_search.aspx?t=serial&q=" + oFunction.encryptQueryString(strDR) + "&id=" + oFunction.encryptQueryString(intDR.ToString()), lblPlatformDRCounterPart, fldPlatformDRCounterPart, "BLADE_DR", strDR, "", true, false);
                                }
                                else
                                {
                                    oDataPoint.LoadTextBox(txtPlatformDRCounterPart, intProfile, null, "", lblPlatformDRCounterPart, fldPlatformDRCounterPart, "BLADE_DR", "", "", true, false);
                                }

                                ddlStatus.SelectedValue = dsAsset.Tables[0].Rows[0]["status"].ToString();
                                ddlStatus.Enabled       = (intAssetAttribute == (int)AssetAttribute.Ok);
                                panStatus.Visible       = (ddlStatus.Enabled == false);
                            }
                            else
                            {
                                Response.Redirect("/datapoint/asset/enclosure_deploy.aspx?t=serial&q=" + oFunction.encryptQueryString(strSerial) + "&id=" + oFunction.encryptQueryString(intAsset.ToString()) + "&r=0");
                            }

                            // Resource Dependencies
                            AssetOrder      oAssetOrder     = new AssetOrder(0, dsn, dsnAsset, intEnvironment);
                            Services        oService        = new Services(0, dsn);
                            ServiceRequests oServiceRequest = new ServiceRequests(0, dsn);
                            rptServiceRequests.DataSource = oAssetOrder.GetByAsset(intAsset, false);
                            rptServiceRequests.DataBind();
                            trServiceRequests.Visible = (rptServiceRequests.Items.Count == 0);
                            foreach (RepeaterItem ri in rptServiceRequests.Items)
                            {
                                Label lblServiceID = (Label)ri.FindControl("lblServiceID");
                                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);
                                    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 = oAsset.GetProvisioningHistory(oDataPoint.AssetHistorySelect(intAsset));
                            rptHistory.DataBind();
                            lblHistory.Visible = (rptHistory.Items.Count == 0);
                            oDataPoint.LoadPanel(panProvisioning, intProfile, fldProvisioning, "ENCLOSURE_STATUS");

                            // Virtual Connects
                            rptVirtualConnect.DataSource = oAsset.GetEnclosureVCs(intAsset, 1);
                            rptVirtualConnect.DataBind();
                            lblVirtualConnect.Visible = (rptVirtualConnect.Items.Count == 0);
                            oDataPoint.LoadButton(btnVC, intProfile, fldVC, "ENCLOSURE_VC", "return OpenWindow('ASSET_DEPLOY_VCs','" + intAsset.ToString() + "');");

                            if (Request.QueryString["highlight"] != null && Request.QueryString["highlight"] != "")
                            {
                                intHighlight = Int32.Parse(Request.QueryString["highlight"]);
                            }
                            // Blades
                            rptBlades.DataSource = oAsset.GetEnclosureBlades(intAsset);
                            rptBlades.DataBind();
                            lblBlades.Visible = (rptBlades.Items.Count == 0);

                            // Redeploy
                            oDataPoint.LoadButton(btnRedeploy, intProfile, fldRedeploy, "ENCLOSURE_REDEPLOY");
                            if (rptBlades.Items.Count == 0)
                            {
                                btnRedeploy.Attributes.Add("onclick", "return confirm('Are you sure you want to redeploy this enclosure?') && confirm('WARNING! Redeploying an asset means that ALL the information regarding this asset will be erased.\\n\\nAre you sure you want to redeploy this enclosure?');");
                            }
                            else
                            {
                                btnRedeploy.Attributes.Add("onclick", "return confirm('Are you sure you want to redeploy this enclosure?\\n\\WARNING: The blades associated with this enclosure have not been redployed!\\nIt is STRONGLY recommended that you redeploy the blades first to avoid corrupting the asset database.\\n\\nAre you sure you want to continue?');");
                            }
                            oDataPoint.LoadButton(btnRedeployBlades, intProfile, fldRedeployBlades, "ENCLOSURE_REDEPLOY_BLADES");
                            if (rptBlades.Items.Count == 0)
                            {
                                btnRedeployBlades.Attributes.Add("onclick", "alert('All blades have already been redeployed');return false;;");
                            }
                            else
                            {
                                btnRedeployBlades.Attributes.Add("onclick", "return confirm('Are you sure you want to redeploy ALL the blades in this enclosure?') && confirm('WARNING! Redeploying an asset means that ALL the information regarding this asset will be erased.\\n\\nAre you sure you want to redeploy ALL the blades in this enclosure?');");
                            }
                        }
                    }
                    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?multiple=true&t=" + Request.QueryString["t"] + "&q=" + Request.QueryString["q"]);
                    }
                }
                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;");
                btnSave.Attributes.Add("onclick", oDataPoint.LoadValidation());
                btnSaveClose.Attributes.Add("onclick", oDataPoint.LoadValidation());
                ddlPlatformClass.Attributes.Add("onchange", "PopulateEnvironments('" + ddlPlatformClass.ClientID + "','" + ddlPlatformEnvironment.ClientID + "',0);");
                ddlPlatformEnvironment.Attributes.Add("onchange", "UpdateDropDownHidden('" + ddlPlatformEnvironment.ClientID + "','" + hdnEnvironment.ClientID + "');");
                //ddlLocationState.Attributes.Add("onchange", "LoadLocationCity('" + ddlLocationCity.ClientID + "');LoadLocationAddress('" + ddlLocationAddress.ClientID + "');PopulateCitys('" + ddlLocationState.ClientID + "','" + ddlLocationCity.ClientID + "');ResetDropDownHidden('" + hdnAddress.ClientID + "');");
                //ddlLocationCity.Attributes.Add("onchange", "LoadLocationAddress('" + ddlLocationAddress.ClientID + "');PopulateAddresss('" + ddlLocationCity.ClientID + "','" + ddlLocationAddress.ClientID + "');ResetDropDownHidden('" + hdnAddress.ClientID + "');");
                //ddlLocationAddress.Attributes.Add("onchange", "UpdateDropDownHidden('" + ddlLocationAddress.ClientID + "','" + hdnAddress.ClientID + "');");
            }
            else
            {
                panDenied.Visible = true;
            }
        }
Exemplo n.º 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            StringBuilder sb = new StringBuilder();

            intProfile = Int32.Parse(Request.Cookies["profileid"].Value);
            if (Request.QueryString["applicationid"] != null && Request.QueryString["applicationid"] != "")
            {
                intApplication = Int32.Parse(Request.QueryString["applicationid"]);
            }
            if (Request.QueryString["pageid"] != null && Request.QueryString["pageid"] != "")
            {
                intPage = Int32.Parse(Request.QueryString["pageid"]);
            }
            if (Request.Cookies["application"] != null && Request.Cookies["application"].Value != "")
            {
                intApplication = Int32.Parse(Request.Cookies["application"].Value);
            }

            oPage             = new Pages(intProfile, dsn);
            oVMWare           = new VMWare(intProfile, dsn);
            oResiliency       = new Resiliency(intProfile, dsn);
            oOperatingSystems = new OperatingSystems(intProfile, dsn);

            if (!IsPostBack)
            {
                if (String.IsNullOrEmpty(Request.QueryString["v"]) == false)
                {
                    int     v   = Int32.Parse(Request.QueryString["v"]);
                    DataSet rec = oVMWare.GetVlan(v);
                    if (rec.Tables[0].Rows.Count > 0)
                    {
                        lblVParent.ToolTip  = rec.Tables[0].Rows[0]["clusterid"].ToString();
                        lblVParent.Text     = oVMWare.GetCluster(Int32.Parse(lblVParent.ToolTip), "name");
                        txtVName.Text       = rec.Tables[0].Rows[0]["name"].ToString();
                        chkVEnabled.Checked = (rec.Tables[0].Rows[0]["enabled"].ToString() == "1");
                        btnUpdateV.Text     = "Update";
                    }
                    else if (String.IsNullOrEmpty(Request.QueryString["c"]) == false)
                    {
                        lblVParent.ToolTip = Request.QueryString["c"];
                        lblVParent.Text    = oVMWare.GetCluster(Int32.Parse(lblVParent.ToolTip), "name");
                    }
                    panVLAN.Visible = true;
                }
                else if (String.IsNullOrEmpty(Request.QueryString["ds"]) == false)
                {
                    ddlOperatingSystemGroup.DataTextField  = "name";
                    ddlOperatingSystemGroup.DataValueField = "id";
                    ddlOperatingSystemGroup.DataSource     = oOperatingSystems.GetGroups(1);
                    ddlOperatingSystemGroup.DataBind();
                    ddlOperatingSystemGroup.Items.Insert(0, new ListItem("-- ALL OS's --", "0"));

                    ddlPartner.DataTextField  = "name";
                    ddlPartner.DataValueField = "id";

                    int c = 0;
                    if (String.IsNullOrEmpty(Request.QueryString["c"]) == false)
                    {
                        Int32.TryParse(Request.QueryString["c"], out c);
                        ddlPartner.DataSource = oVMWare.GetDatastores(c, 1);
                        ddlPartner.DataBind();
                        ddlPartner.Items.Insert(0, new ListItem("-- NONE --", "0"));
                    }

                    int     ds  = Int32.Parse(Request.QueryString["ds"]);
                    DataSet rec = oVMWare.GetDatastore(ds);
                    if (rec.Tables[0].Rows.Count > 0)
                    {
                        c = Int32.Parse(rec.Tables[0].Rows[0]["clusterid"].ToString());
                        ddlPartner.DataSource = oVMWare.GetDatastores(c, 1);
                        ddlPartner.DataBind();
                        ddlPartner.Items.Insert(0, new ListItem("-- NONE --", "0"));

                        txtDSName.Text        = rec.Tables[0].Rows[0]["name"].ToString();
                        ddlType.SelectedValue = rec.Tables[0].Rows[0]["storage_type"].ToString();
                        ddlOperatingSystemGroup.SelectedValue = rec.Tables[0].Rows[0]["osgroupid"].ToString();
                        chkReplicated.Checked         = (rec.Tables[0].Rows[0]["replicated"].ToString() == "1");
                        txtDSMaximum.Text             = rec.Tables[0].Rows[0]["maximum"].ToString();
                        chkServer.Checked             = (rec.Tables[0].Rows[0]["server"].ToString() == "1");
                        chkPagefile.Checked           = (rec.Tables[0].Rows[0]["pagefile"].ToString() == "1");
                        chkOverridePermission.Checked = (rec.Tables[0].Rows[0]["override_permission"].ToString() == "1");
                        ddlPartner.SelectedValue      = rec.Tables[0].Rows[0]["partner"].ToString();
                        chkDSEnabled.Checked          = (rec.Tables[0].Rows[0]["enabled"].ToString() == "1");
                        btnUpdateDS.Text = "Update";
                    }

                    lblDSParent.ToolTip  = c.ToString();
                    lblDSParent.Text     = oVMWare.GetCluster(c, "name");
                    panDatastore.Visible = true;
                }
                else if (String.IsNullOrEmpty(Request.QueryString["h"]) == false)
                {
                    int     h   = Int32.Parse(Request.QueryString["h"]);
                    DataSet rec = oVMWare.GetHost(h);
                    if (rec.Tables[0].Rows.Count > 0)
                    {
                        lblHParent.ToolTip  = rec.Tables[0].Rows[0]["clusterid"].ToString();
                        lblHParent.Text     = oVMWare.GetCluster(Int32.Parse(lblHParent.ToolTip), "name");
                        txtHName.Text       = rec.Tables[0].Rows[0]["name"].ToString();
                        txtHMaximum.Text    = rec.Tables[0].Rows[0]["maximum"].ToString();
                        chkHEnabled.Checked = (rec.Tables[0].Rows[0]["enabled"].ToString() == "1");
                        btnUpdateH.Text     = "Update";
                    }
                    else if (String.IsNullOrEmpty(Request.QueryString["c"]) == false)
                    {
                        lblHParent.ToolTip = Request.QueryString["c"];
                        lblHParent.Text    = oVMWare.GetCluster(Int32.Parse(lblHParent.ToolTip), "name");
                    }
                    panHost.Visible = true;
                }
                else if (String.IsNullOrEmpty(Request.QueryString["c"]) == false)
                {
                    ddlResiliency.DataTextField  = "name";
                    ddlResiliency.DataValueField = "id";
                    ddlResiliency.DataSource     = oResiliency.Gets(1);
                    ddlResiliency.DataBind();

                    int     c   = Int32.Parse(Request.QueryString["c"]);
                    DataSet rec = oVMWare.GetCluster(c);
                    if (rec.Tables[0].Rows.Count > 0)
                    {
                        lblCParent.ToolTip            = rec.Tables[0].Rows[0]["folderid"].ToString();
                        lblCParent.Text               = oVMWare.GetFolder(Int32.Parse(lblCParent.ToolTip), "name");
                        txtCName.Text                 = rec.Tables[0].Rows[0]["name"].ToString();
                        ddlVersion.SelectedValue      = rec.Tables[0].Rows[0]["version"].ToString();
                        ddlAntiAffinity.SelectedValue = rec.Tables[0].Rows[0]["anti_affinity"].ToString();
                        txtCMaximum.Text              = rec.Tables[0].Rows[0]["maximum"].ToString();
                        txtResourcePool.Text          = rec.Tables[0].Rows[0]["resource_pool"].ToString();
                        txtDatastoreNotify.Text       = rec.Tables[0].Rows[0]["datastores_notify"].ToString();
                        txtDatastoreLeft.Text         = rec.Tables[0].Rows[0]["datastores_left"].ToString();
                        txtDatastoreSize.Text         = rec.Tables[0].Rows[0]["datastores_size"].ToString();
                        chkFull.Checked               = (rec.Tables[0].Rows[0]["at_max"].ToString() == "1");
                        chkAPoff.Checked              = (rec.Tables[0].Rows[0]["auto_provision_off"].ToString() == "1");
                        chkAPoffDR.Checked            = (rec.Tables[0].Rows[0]["auto_provision_dr_off"].ToString() == "1");
                        chkDell.Checked               = (rec.Tables[0].Rows[0]["dell"].ToString() == "1");
                        ddlResiliency.SelectedValue   = rec.Tables[0].Rows[0]["resiliencyid"].ToString();
                        chkOracle.Checked             = (rec.Tables[0].Rows[0]["can_oracle"].ToString() == "1");
                        chkOracleCluster.Checked      = (rec.Tables[0].Rows[0]["can_oracle_cluster"].ToString() == "1");
                        chkSQL.Checked                = (rec.Tables[0].Rows[0]["can_sql"].ToString() == "1");
                        chkSQLCluster.Checked         = (rec.Tables[0].Rows[0]["can_sql_cluster"].ToString() == "1");
                        chkCluster.Checked            = (rec.Tables[0].Rows[0]["can_cluster"].ToString() == "1");
                        chkCEnabled.Checked           = (rec.Tables[0].Rows[0]["enabled"].ToString() == "1");

                        txtFailures.Text       = rec.Tables[0].Rows[0]["input_failures"].ToString();
                        txtCPUUtilization.Text = rec.Tables[0].Rows[0]["input_cpu_utilization"].ToString();
                        txtRAMUtilization.Text = rec.Tables[0].Rows[0]["input_ram_utilization"].ToString();
                        txtMaxRAM.Text         = rec.Tables[0].Rows[0]["input_max_ram"].ToString();
                        txtAvgUtilization.Text = rec.Tables[0].Rows[0]["input_avg_utilization"].ToString();
                        txtLunSize.Text        = rec.Tables[0].Rows[0]["input_lun_size"].ToString();
                        txtLunUtilization.Text = rec.Tables[0].Rows[0]["input_lun_utilization"].ToString();
                        txtVMsPerLun.Text      = rec.Tables[0].Rows[0]["input_vms_per_lun"].ToString();
                        txtTimeLUN.Text        = rec.Tables[0].Rows[0]["input_time_lun"].ToString();
                        txtTimeCluster.Text    = rec.Tables[0].Rows[0]["input_time_cluster"].ToString();
                        txtMaxVMsServer.Text   = rec.Tables[0].Rows[0]["input_max_vms_server"].ToString();
                        txtMaxVMsLUN.Text      = rec.Tables[0].Rows[0]["input_max_vms_lun"].ToString();

                        btnUpdateC.Text = "Update";

                        rptHosts.DataSource = oVMWare.GetHosts(c, 0);
                        rptHosts.DataBind();
                        rptDatastores.DataSource = oVMWare.GetDatastores(c, 0);
                        rptDatastores.DataBind();
                        rptVLANs.DataSource = oVMWare.GetVlans(c, 0);
                        rptVLANs.DataBind();

                        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("Hosts", "");
                        oTab.AddTab("Datastores", "");
                        oTab.AddTab("VLANs", "");
                        strMenuTab1 = oTab.GetTabs();
                    }
                    else if (String.IsNullOrEmpty(Request.QueryString["f"]) == false)
                    {
                        lblCParent.ToolTip = Request.QueryString["f"];
                        lblCParent.Text    = oVMWare.GetFolder(Int32.Parse(lblCParent.ToolTip), "name");
                    }
                    panCluster.Visible = true;
                }
                else if (String.IsNullOrEmpty(Request.QueryString["f"]) == false)
                {
                    int     f   = Int32.Parse(Request.QueryString["f"]);
                    DataSet rec = oVMWare.GetFolder(f);
                    if (rec.Tables[0].Rows.Count > 0)
                    {
                        lblFParent.ToolTip    = rec.Tables[0].Rows[0]["datacenterid"].ToString();
                        lblFParent.Text       = oVMWare.GetDatacenter(Int32.Parse(lblFParent.ToolTip), "name");
                        txtFName.Text         = rec.Tables[0].Rows[0]["name"].ToString();
                        txtFNotification.Text = rec.Tables[0].Rows[0]["notification"].ToString();
                        chkFEnabled.Checked   = (rec.Tables[0].Rows[0]["enabled"].ToString() == "1");
                        btnUpdateF.Text       = "Update";

                        rptClusters.DataSource = oVMWare.GetClusters(f, 0);
                        rptClusters.DataBind();
                    }
                    else if (String.IsNullOrEmpty(Request.QueryString["dc"]) == false)
                    {
                        lblFParent.ToolTip = Request.QueryString["dc"];
                        lblFParent.Text    = oVMWare.GetDatacenter(Int32.Parse(lblFParent.ToolTip), "name");
                    }
                    panFolder.Visible = true;
                }
                else if (String.IsNullOrEmpty(Request.QueryString["dc"]) == false)
                {
                    ddlDCParent.DataTextField  = "name";
                    ddlDCParent.DataValueField = "id";
                    ddlDCParent.DataSource     = oVMWare.GetVirtualCenters(1);
                    ddlDCParent.DataBind();

                    int     dc  = Int32.Parse(Request.QueryString["dc"]);
                    DataSet rec = oVMWare.GetDatacenter(dc);
                    if (rec.Tables[0].Rows.Count > 0)
                    {
                        ddlDCParent.SelectedValue      = rec.Tables[0].Rows[0]["virtualcenterid"].ToString();
                        txtDCName.Text                 = rec.Tables[0].Rows[0]["name"].ToString();
                        txtDCBuildFolder.Text          = rec.Tables[0].Rows[0]["build_folder"].ToString();
                        txtDCDesktopNetwork.Text       = rec.Tables[0].Rows[0]["desktop_network"].ToString();
                        txtDCWorkstationDecomVLAN.Text = rec.Tables[0].Rows[0]["workstation_decom_vlan"].ToString();
                        chkDCEnabled.Checked           = (rec.Tables[0].Rows[0]["enabled"].ToString() == "1");
                        btnUpdateDC.Text               = "Update";

                        rptFolders.DataSource = oVMWare.GetFolders(dc, 0);
                        rptFolders.DataBind();
                    }
                    else if (String.IsNullOrEmpty(Request.QueryString["vc"]) == false)
                    {
                        ddlDCParent.SelectedValue = Request.QueryString["vc"];
                    }
                    panDC.Visible = true;
                }
                else if (String.IsNullOrEmpty(Request.QueryString["vc"]) == false)
                {
                    int     vc  = Int32.Parse(Request.QueryString["vc"]);
                    DataSet rec = oVMWare.GetVirtualCenter(vc);
                    if (rec.Tables[0].Rows.Count > 0)
                    {
                        txtName.Text = rec.Tables[0].Rows[0]["name"].ToString();
                        txtUrl.Text  = rec.Tables[0].Rows[0]["url"].ToString();
                        ddlEnvironment.SelectedValue = rec.Tables[0].Rows[0]["environment"].ToString();
                        chkEnabled.Checked           = (rec.Tables[0].Rows[0]["enabled"].ToString() == "1");
                        btnUpdateVC.Text             = "Update";

                        rptDCs.DataSource = oVMWare.GetDatacenters(vc, 0);
                        rptDCs.DataBind();
                    }
                    panVC.Visible = true;
                }
                else
                {
                    panVCs.Visible    = true;
                    rptVCs.DataSource = oVMWare.GetVirtualCenters(0);
                    rptVCs.DataBind();
                }
            }
        }
Exemplo n.º 10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile = Int32.Parse(Request.Cookies["profileid"].Value);
            oPage = new Pages(intProfile, dsn);
            oUser = new Users(intProfile, dsn);
            oServer = new Servers(intProfile, dsn);
            oAvamar = new Avamar(intProfile, dsn);
            oLocation = new Locations(intProfile, dsn);
            oClass = new Classes(intProfile, dsn);
            oResiliency = new Resiliency(intProfile, dsn);
            oOperatingSystem = new OperatingSystems(intProfile, dsn);
            oServerName = new ServerName(intProfile, dsn);
            oFunctions = new Functions(intProfile, dsn, intEnvironment);
            if (Request.QueryString["applicationid"] != null && Request.QueryString["applicationid"] != "")
                intApplication = Int32.Parse(Request.QueryString["applicationid"]);
            if (Request.QueryString["pageid"] != null && Request.QueryString["pageid"] != "")
                intPage = Int32.Parse(Request.QueryString["pageid"]);
            if (Request.Cookies["application"] != null && Request.Cookies["application"].Value != "")
                intApplication = Int32.Parse(Request.Cookies["application"].Value);
            if (Request.QueryString["saved"] != null)
                lblMessage.Text = oFunctions.BuildBox("/images/ico_check.gif", "Information Saved", "Your change has been saved successfully!", "box_green header");
            if (Request.QueryString["deleted"] != null)
                lblMessage.Text = oFunctions.BuildBox("/images/ico_check.gif", "Record Deleted", "The record has been deleted successfully!", "box_green header");
            int intMenuTab = 0;
            if (Request.QueryString["menu_tab"] != null && Request.QueryString["menu_tab"] != "")
                intMenuTab = Int32.Parse(Request.QueryString["menu_tab"]);
            int intAddressID = 0;
            if (Request.QueryString["grid"] != null && Request.QueryString["grid"] != "")
            {
                intGrid = Int32.Parse(Request.QueryString["grid"]);
                lblCrumbs.Text += "<a href=\"" + oPage.GetFullLink(intPage) + FormURL("") + "\">Back to Home</a>";
                if (Request.QueryString["domain"] != null && Request.QueryString["domain"] != "")
                {
                    intDomain = Int32.Parse(Request.QueryString["domain"]);
                    lblCrumbs.Text += strSpacer + "<a href=\"" + oPage.GetFullLink(intPage) + FormURL("grid=" + intGrid.ToString()) + "\">" + oAvamar.GetGrid(intGrid, "name") + "</a>";
                    panDomain.Visible = true;
                    if (!IsPostBack)
                    {
                        chkDomainResiliency.DataValueField = "id";
                        chkDomainResiliency.DataTextField = "name";
                        chkDomainResiliency.DataSource = oResiliency.Gets(1);
                        chkDomainResiliency.DataBind();

                        chkDomainApplication.DataValueField = "id";
                        chkDomainApplication.DataTextField = "name";
                        chkDomainApplication.DataSource = oServerName.GetComponents(1);
                        chkDomainApplication.DataBind();

                        ddlDomainParent.DataValueField = "id";
                        ddlDomainParent.DataTextField = "FQDN";
                        ddlDomainParent.DataSource = oAvamar.GetDomainsGrid(intGrid, 0, 1);
                        ddlDomainParent.DataBind();
                        

                        DataSet ds = oAvamar.GetDomain(intDomain);
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            txtDomainName.Text = ds.Tables[0].Rows[0]["name"].ToString();
                            if (ds.Tables[0].Rows[0]["root"].ToString() == "1")
                            {
                                txtDomainName.Enabled = false;
                                txtDomainName.Text = "/ (ROOT)";
                                ddlDomainParent.Enabled = false;
                                btnDomainUpdate.Attributes.Add("onclick", "return ProcessButton(this) && LoadWait();");
                            }
                            else
                            {
                                foreach (ListItem domain in ddlDomainParent.Items)
                                {
                                    if (domain.Value == ds.Tables[0].Rows[0]["id"].ToString())
                                    {
                                        ddlDomainParent.Items.Remove(domain);
                                        break;
                                    }
                                }
                                btnDomainUpdate.Attributes.Add("onclick", "return ValidateText('" + txtDomainName.ClientID + "','Please enter a name for this domain')" +
                                " && ProcessButton(this) && LoadWait()" +
                                    ";");
                            }
                            lblCrumbs.Text += strSpacer + txtDomainName.Text;
                            ddlDomainParent.SelectedValue = ds.Tables[0].Rows[0]["domainid"].ToString();
                            chkDomainCatchAll.Checked = (ds.Tables[0].Rows[0]["catchall"].ToString() == "1");
                            chkDomainEnabled.Checked = (ds.Tables[0].Rows[0]["enabled"].ToString() == "1");
                            btnDomainUpdate.Visible = true;
                            btnDomainDelete.Visible = true;
                            btnDomainDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this domain')" +
                                " && ProcessButton(this) && LoadWait()" +
                                ";");

                            // Resiliencies
                            DataSet dsResiliencies = oAvamar.GetDomainResiliencys(intDomain);
                            foreach (DataRow drResiliency in dsResiliencies.Tables[0].Rows)
                            {
                                foreach (ListItem item in chkDomainResiliency.Items)
                                {
                                    if (drResiliency["resiliencyid"].ToString() == item.Value)
                                    {
                                        item.Selected = true;
                                        break;
                                    }
                                }
                            }
                            // Applications
                            DataSet dsApplications = oAvamar.GetDomainApplications(intDomain);
                            foreach (DataRow drApplication in dsApplications.Tables[0].Rows)
                            {
                                foreach (ListItem item in chkDomainApplication.Items)
                                {
                                    if (drApplication["applicationid"].ToString() == item.Value)
                                    {
                                        item.Selected = true;
                                        break;
                                    }
                                }
                            }
                        }
                        else
                        {
                            btnDomainAdd.Visible = true;
                            btnDomainAdd.Attributes.Add("onclick", "return ValidateText('" + txtDomainName.ClientID + "','Please enter a name for this domain')" +
                            " && ProcessButton(this) && LoadWait()" +
                                ";");
                        }
                        btnDomainCancel.Attributes.Add("onclick", "return ProcessButton(this) && LoadWait();");
                    }
                }
                else if (String.IsNullOrEmpty(Request.QueryString["group"]) == false)
                {
                    intGroup = Int32.Parse(Request.QueryString["group"]);
                    lblCrumbs.Text += strSpacer + "<a href=\"" + oPage.GetFullLink(intPage) + FormURL("grid=" + intGrid.ToString()) + "\">" + oAvamar.GetGrid(intGrid, "name") + "</a>";
                    panGroup.Visible = true;
                    if (!IsPostBack)
                    {
                        ddlGroupDomain.DataValueField = "id";
                        ddlGroupDomain.DataTextField = "FQDN";
                        ddlGroupDomain.DataSource = oAvamar.GetDomainsGrid(intGrid, 1, 1);
                        ddlGroupDomain.DataBind();

                        chkGroupOS.DataValueField = "id";
                        chkGroupOS.DataTextField = "name";
                        chkGroupOS.DataSource = oOperatingSystem.GetStandard(0);
                        chkGroupOS.DataBind();

                        DataSet ds = oAvamar.GetGroup(intGroup);
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            txtGroupName.Text = ds.Tables[0].Rows[0]["name"].ToString();
                            lblCrumbs.Text += strSpacer + txtGroupName.Text;
                            chkGroupDaily.Checked = (ds.Tables[0].Rows[0]["daily"].ToString() == "1");
                            chkGroupWeekly.Checked = (ds.Tables[0].Rows[0]["weekly"].ToString() == "1");
                            if (chkGroupWeekly.Checked == true)
                                divGroupWeekly.Style["display"] = "inline";
                            chkGroupWeeklySunday.Checked = (ds.Tables[0].Rows[0]["sunday"].ToString() == "1");
                            chkGroupWeeklyMonday.Checked = (ds.Tables[0].Rows[0]["monday"].ToString() == "1");
                            chkGroupWeeklyTuesday.Checked = (ds.Tables[0].Rows[0]["tuesday"].ToString() == "1");
                            chkGroupWeeklyWednesday.Checked = (ds.Tables[0].Rows[0]["wednesday"].ToString() == "1");
                            chkGroupWeeklyThursday.Checked = (ds.Tables[0].Rows[0]["thursday"].ToString() == "1");
                            chkGroupWeeklyFriday.Checked = (ds.Tables[0].Rows[0]["friday"].ToString() == "1");
                            chkGroupWeeklySaturday.Checked = (ds.Tables[0].Rows[0]["saturday"].ToString() == "1");
                            chkGroupMonthly.Checked = (ds.Tables[0].Rows[0]["monthly"].ToString() == "1");
                            if (chkGroupMonthly.Checked == true)
                                divGroupMonthly.Style["display"] = "inline";
                            ddlGroupMonthly.SelectedValue = ds.Tables[0].Rows[0]["day"].ToString();
                            chk1200AM.Checked = (ds.Tables[0].Rows[0]["AM1200"].ToString() == "1");
                            chk100AM.Checked = (ds.Tables[0].Rows[0]["AM100"].ToString() == "1");
                            chk200AM.Checked = (ds.Tables[0].Rows[0]["AM200"].ToString() == "1");
                            chk300AM.Checked = (ds.Tables[0].Rows[0]["AM300"].ToString() == "1");
                            chk400AM.Checked = (ds.Tables[0].Rows[0]["AM400"].ToString() == "1");
                            chk500AM.Checked = (ds.Tables[0].Rows[0]["AM500"].ToString() == "1");
                            chk600AM.Checked = (ds.Tables[0].Rows[0]["AM600"].ToString() == "1");
                            chk700AM.Checked = (ds.Tables[0].Rows[0]["AM700"].ToString() == "1");
                            chk800AM.Checked = (ds.Tables[0].Rows[0]["AM800"].ToString() == "1");
                            chk900AM.Checked = (ds.Tables[0].Rows[0]["AM900"].ToString() == "1");
                            chk1000AM.Checked = (ds.Tables[0].Rows[0]["AM1000"].ToString() == "1");
                            chk1100AM.Checked = (ds.Tables[0].Rows[0]["AM1100"].ToString() == "1");
                            chk1200PM.Checked = (ds.Tables[0].Rows[0]["PM1200"].ToString() == "1");
                            chk100PM.Checked = (ds.Tables[0].Rows[0]["PM100"].ToString() == "1");
                            chk200PM.Checked = (ds.Tables[0].Rows[0]["PM200"].ToString() == "1");
                            chk300PM.Checked = (ds.Tables[0].Rows[0]["PM300"].ToString() == "1");
                            chk400PM.Checked = (ds.Tables[0].Rows[0]["PM400"].ToString() == "1");
                            chk500PM.Checked = (ds.Tables[0].Rows[0]["PM500"].ToString() == "1");
                            chk600PM.Checked = (ds.Tables[0].Rows[0]["PM600"].ToString() == "1");
                            chk700PM.Checked = (ds.Tables[0].Rows[0]["PM700"].ToString() == "1");
                            chk800PM.Checked = (ds.Tables[0].Rows[0]["PM800"].ToString() == "1");
                            chk900PM.Checked = (ds.Tables[0].Rows[0]["PM900"].ToString() == "1");
                            chk1000PM.Checked = (ds.Tables[0].Rows[0]["PM1000"].ToString() == "1");
                            chk1100PM.Checked = (ds.Tables[0].Rows[0]["PM1100"].ToString() == "1");
                            txtGroupThreshold.Text = ds.Tables[0].Rows[0]["threshold"].ToString();
                            txtGroupMaximum.Text = ds.Tables[0].Rows[0]["maximum"].ToString();
                            chkGroupClustering.Checked = (ds.Tables[0].Rows[0]["clustering"].ToString() == "1");
                            chkGroupEnabled.Checked = (ds.Tables[0].Rows[0]["enabled"].ToString() == "1");
                            btnGroupUpdate.Visible = true;
                            btnGroupUpdate.Attributes.Add("onclick", "return ValidateText('" + txtGroupName.ClientID + "','Please enter a name for this group')" +
                            " && ProcessButton(this) && LoadWait()" +
                                ";");
                            btnGroupDelete.Visible = true;
                            btnGroupDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this group')" +
                                " && ProcessButton(this) && LoadWait()" +
                                ";");

                            // Operating Systems
                            DataSet dsOperatingSystems = oAvamar.GetGroupOperatingSystems(intGroup);
                            foreach (DataRow drOperatingSystem in dsOperatingSystems.Tables[0].Rows)
                            {
                                foreach (ListItem item in chkGroupOS.Items)
                                {
                                    if (drOperatingSystem["osid"].ToString() == item.Value)
                                    {
                                        item.Selected = true;
                                        break;
                                    }
                                }
                            }
                        }
                        else
                        {
                            btnGroupAdd.Visible = true;
                            btnGroupAdd.Attributes.Add("onclick", "return ValidateText('" + txtGroupName.ClientID + "','Please enter a name for this group')" +
                            " && ProcessButton(this) && LoadWait()" +
                                ";");
                        }
                        btnGroupCancel.Attributes.Add("onclick", "return ProcessButton(this) && LoadWait();");
                        chkGroupDaily.Attributes.Add("onclick", "ShowHideDiv('" + divGroupWeekly.ClientID + "','none');ShowHideDiv('" + divGroupMonthly.ClientID + "','none');");
                        chkGroupWeekly.Attributes.Add("onclick", "ShowHideDiv('" + divGroupWeekly.ClientID + "','inline');ShowHideDiv('" + divGroupMonthly.ClientID + "','none');");
                        chkGroupMonthly.Attributes.Add("onclick", "ShowHideDiv('" + divGroupWeekly.ClientID + "','none');ShowHideDiv('" + divGroupMonthly.ClientID + "','inline');");
                    }
                }
                else if (String.IsNullOrEmpty(Request.QueryString["location"]) == false)
                {
                    intLocation = Int32.Parse(Request.QueryString["location"]);
                    lblCrumbs.Text += strSpacer + "<a href=\"" + oPage.GetFullLink(intPage) + FormURL("grid=" + intGrid.ToString()) + "\">" + oAvamar.GetGrid(intGrid, "name") + "</a>";
                    panLocation.Visible = true;
                    if (!IsPostBack)
                    {
                        DataSet ds = oAvamar.GetLocation(intLocation);
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            intAddressID = Int32.Parse(ds.Tables[0].Rows[0]["addressid"].ToString());
                            lblCrumbs.Text += strSpacer + oLocation.GetFull(intAddressID);
                            chkLocationEnabled.Checked = (ds.Tables[0].Rows[0]["enabled"].ToString() == "1");
                            btnLocationUpdate.Visible = true;
                            btnLocationUpdate.Attributes.Add("onclick", "return ValidateHidden0('" + hdnLocation.ClientID + "','ddlCommonLocation','Please select a location')" +
                            " && ProcessButton(this) && LoadWait()" +
                                ";");
                            btnLocationDelete.Visible = true;
                            btnLocationDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this location')" +
                                " && ProcessButton(this) && LoadWait()" +
                                ";");
                        }
                        else
                        {
                            btnLocationAdd.Visible = true;
                            btnLocationAdd.Attributes.Add("onclick", "return ValidateHidden0('" + hdnLocation.ClientID + "','ddlCommonLocation','Please select a location')" +
                            " && ProcessButton(this) && LoadWait()" +
                                ";");
                        }
                        btnLocationCancel.Attributes.Add("onclick", "return ProcessButton(this) && LoadWait();");
                        strLocation = oLocation.LoadDDL("ddlStateLocation", "ddlCityLocation", "ddlAddressLocation", hdnLocation.ClientID, intAddressID, true, "ddlCommonLocation");
                    }
                }
                else if (String.IsNullOrEmpty(Request.QueryString["environment"]) == false)
                {
                    intEnv = Int32.Parse(Request.QueryString["environment"]);
                    lblCrumbs.Text += strSpacer + "<a href=\"" + oPage.GetFullLink(intPage) + FormURL("grid=" + intGrid.ToString()) + "\">" + oAvamar.GetGrid(intGrid, "name") + "</a>";
                    panEnvironment.Visible = true;
                    if (!IsPostBack)
                    {
                        ddlClass.DataTextField = "name";
                        ddlClass.DataValueField = "id";
                        ddlClass.DataSource = oClass.GetForecasts(1);
                        ddlClass.DataBind();
                        ddlClass.Items.Insert(0, new ListItem("-- SELECT --", "0"));

                        DataSet ds = oAvamar.GetEnvironment(intEnv);
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            int intClassID = Int32.Parse(ds.Tables[0].Rows[0]["classid"].ToString());
                            try
                            {
                                ddlClass.SelectedValue = intClassID.ToString();
                            }
                            catch { }
                            if (ddlClass.SelectedIndex == 0)
                            {
                                // Class is not available, add it.
                                ddlClass.Items.Add(new ListItem(oClass.Get(intClassID, "name") + " *", intClassID.ToString()));
                                ddlClass.SelectedValue = intClassID.ToString();
                            }
                            int intEnvironmentID = Int32.Parse(ds.Tables[0].Rows[0]["environmentid"].ToString());
                            hdnEnvironment.Value = intEnvironmentID.ToString();
                            ddlEnvironment.DataTextField = "name";
                            ddlEnvironment.DataValueField = "id";
                            ddlEnvironment.DataSource = oClass.GetEnvironment(intClassID, 1);
                            ddlEnvironment.DataBind();
                            ddlEnvironment.Items.Insert(0, new ListItem("-- SELECT --", "0"));
                            ddlEnvironment.Enabled = true;
                            ddlEnvironment.SelectedValue = intEnvironmentID.ToString();
                            chkEnvironmentEnabled.Checked = (ds.Tables[0].Rows[0]["enabled"].ToString() == "1");
                            btnEnvironmentUpdate.Visible = true;
                            btnEnvironmentUpdate.Attributes.Add("onclick", "return ValidateDropDown('" + ddlClass.ClientID + "','Please select a class')" +
                            " && ValidateHidden0('" + hdnEnvironment.ClientID + "','" + ddlEnvironment.ClientID + "','Please select an environment')" +
                            " && ProcessButton(this) && LoadWait()" +
                                ";");
                            btnEnvironmentDelete.Visible = true;
                            btnEnvironmentDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this location')" +
                                " && ProcessButton(this) && LoadWait()" +
                                ";");
                        }
                        else
                        {
                            btnEnvironmentAdd.Visible = true;
                            btnEnvironmentAdd.Attributes.Add("onclick", "return ValidateDropDown('" + ddlClass.ClientID + "','Please select a class')" +
                            " && ValidateHidden0('" + hdnEnvironment.ClientID + "','" + ddlEnvironment.ClientID + "','Please select an environment')" +
                            " && ProcessButton(this) && LoadWait()" +
                                ";");
                        }
                        btnEnvironmentCancel.Attributes.Add("onclick", "return ProcessButton(this) && LoadWait();");
                        ddlClass.Attributes.Add("onchange", "PopulateEnvironments('" + ddlClass.ClientID + "','" + ddlEnvironment.ClientID + "',1);");
                        ddlEnvironment.Attributes.Add("onchange", "UpdateDropDownHidden('" + ddlEnvironment.ClientID + "','" + hdnEnvironment.ClientID + "');");
                    }
                }
                else
                {
                    panGrid.Visible = true;
                    if (!IsPostBack)
                    {
                        //Menus
                        oTab = new Tab(hdnType.ClientID, intMenuTab, "divMenu1", true, false);
                        oTab.AddTab("Domains", "");
                        DataSet dsDomains = oAvamar.GetDomainsGrid(intGrid, 0, 0);
                        DataView dvDomains = dsDomains.Tables[0].DefaultView;
                        if (Request.QueryString["sort"] != null)
                            dvDomains.Sort = Request.QueryString["sort"];
                        else
                            dvDomains.Sort = "name";
                        rptDomains.DataSource = dvDomains;
                        rptDomains.DataBind();
                        lblDomains.Visible = (rptDomains.Items.Count == 0);

                        oTab.AddTab("Groups", "");
                        DataSet dsGroups = oAvamar.GetGroupsGrid(intGrid, 0);
                        DataView dvGroups = dsGroups.Tables[0].DefaultView;
                        if (Request.QueryString["sort"] != null)
                            dvGroups.Sort = Request.QueryString["sort"];
                        else
                            dvGroups.Sort = "name";
                        rptGroups.DataSource = dvGroups;
                        rptGroups.DataBind();
                        lblGroups.Visible = (rptGroups.Items.Count == 0);

                        oTab.AddTab("Locations", "");
                        DataSet dsLocations = oAvamar.GetLocations(intGrid, 0);
                        DataView dvLocations = dsLocations.Tables[0].DefaultView;
                        if (Request.QueryString["sort"] != null)
                            dvLocations.Sort = Request.QueryString["sort"];
                        else
                            dvLocations.Sort = "addressid";
                        rptLocations.DataSource = dvLocations;
                        rptLocations.DataBind();
                        lblLocations.Visible = (rptLocations.Items.Count == 0);

                        oTab.AddTab("Environments", "");
                        DataSet dsEnvironments = oAvamar.GetEnvironments(intGrid, 0);
                        DataView dvEnvironments = dsEnvironments.Tables[0].DefaultView;
                        if (Request.QueryString["sort"] != null)
                            dvEnvironments.Sort = Request.QueryString["sort"];
                        else
                            dvEnvironments.Sort = "classid";
                        rptEnvironments.DataSource = dvEnvironments;
                        rptEnvironments.DataBind();
                        lblEnvironments.Visible = (rptEnvironments.Items.Count == 0);

                        strMenuTab1 = oTab.GetTabs();

                        DataSet ds = oAvamar.GetGrid(intGrid);
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            txtGridName.Text = ds.Tables[0].Rows[0]["name"].ToString();
                            lblCrumbs.Text += strSpacer + txtGridName.Text;
                            txtGridThreshold.Text = ds.Tables[0].Rows[0]["threshold"].ToString();
                            txtGridMaximum.Text = ds.Tables[0].Rows[0]["maximum"].ToString();
                            chkGridEnabled.Checked = (ds.Tables[0].Rows[0]["enabled"].ToString() == "1");
                            btnGridUpdate.Visible = true;
                            btnGridUpdate.Attributes.Add("onclick", "return ValidateText('" + txtGridName.ClientID + "','Please enter a name for this grid')" +
                                " && ProcessButton(this) && LoadWait()" +
                                ";");
                            btnGridDelete.Visible = true;
                            btnGridDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this server')" +
                                " && ProcessButton(this) && LoadWait()" +
                                ";");
                        }
                        else
                        {
                            btnGridAdd.Visible = true;
                            btnGridAdd.Attributes.Add("onclick", "return ValidateText('" + txtGridName.ClientID + "','Please enter a name for this grid')" +
                                " && ProcessButton(this) && LoadWait()" +
                                ";");
                            btnAddDomain.Enabled = false;
                            btnAddLocation.Enabled = false;
                            btnAddEnvironment.Enabled = false;
                            btnAddGroup.Enabled = false;
                        }
                        btnGridCancel.Attributes.Add("onclick", "return ProcessButton(this) && LoadWait();");
                        strLocation = oLocation.LoadDDL("ddlStateServer", "ddlCityServer", "ddlAddressServer", hdnLocation.ClientID, intAddressID, true, "ddlCommonServer");
                    }
                }
            }
            else
            {
                panGrids.Visible = true;
                DataSet dsGrids = oAvamar.GetGrids(0);
                DataView dvGrids = dsGrids.Tables[0].DefaultView;
                if (Request.QueryString["sort"] != null)
                    dvGrids.Sort = Request.QueryString["sort"];
                else
                    dvGrids.Sort = "name";
                rptGrids.DataSource = dvGrids;
                rptGrids.DataBind();
                lblGrids.Visible = (rptGrids.Items.Count == 0);
            }
            hdnLocation.Value = intAddressID.ToString();
            btnAddDomain.Attributes.Add("onclick", "return ProcessButton(this) && LoadWait();");
            btnAddLocation.Attributes.Add("onclick", "return ProcessButton(this) && LoadWait();");
            btnAddEnvironment.Attributes.Add("onclick", "return ProcessButton(this) && LoadWait();");
            btnAddGroup.Attributes.Add("onclick", "return ProcessButton(this) && LoadWait();");
            btnAddGrid.Attributes.Add("onclick", "return ProcessButton(this) && LoadWait();");
        }
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);
            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);
            oResiliency       = new Resiliency(intProfile, dsn);

            oSolaris    = new Solaris(intProfile, dsn);
            oStatusList = new StatusLevels(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;
                }
                if (Request.QueryString["close"] != null)
                {
                    Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "close", "<script type=\"text/javascript\">window.close();<" + "/" + "script>");
                }
                else if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
                {
                    string  strID = oFunction.decryptQueryString(Request.QueryString["id"]);
                    DataSet ds    = oDataPoint.GetAsset(Int32.Parse(strID));
                    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 | Physical Deploy (" + strHeader + ")";
                        lblHeaderSub.Text = "Complete the following information to deploy a physical server...";
                        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("Location Information", "");
                        oTab.AddTab("World Wide Port Names", "");
                        oTab.AddTab("Resource Dependencies", "");
                        oTab.AddTab("Provisioning History", "");
                        strMenuTab1 = oTab.GetTabs();

                        if (oUser.IsAdmin(intProfile) == true || oDataPoint.GetFieldPermission(intProfile, "SERVER_ADMIN") == true)
                        {
                            panOldLocationInfo.Visible = true;
                        }

                        if (!IsPostBack)
                        {
                            LoadList();

                            // Asset Information
                            oDataPoint.LoadTextBox(txtPlatformSerial, intProfile, null, "", lblPlatformSerial, fldPlatformSerial, "PHYSICAL_SERIAL", strSerial, "", false, true);
                            oDataPoint.LoadTextBox(txtPlatformAsset, intProfile, null, "", lblPlatformAsset, fldPlatformAsset, "PHYSICAL_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"));
                            int intParent = Int32.Parse(oModelsProperties.Get(intModel, "modelid"));
                            if (oDataPoint.GetDeployModel(intProfile, intParent) == false && oUser.IsAdmin(intProfile) == false)
                            {
                                panAllow.Visible  = false;
                                panDenied.Visible = true;
                            }

                            hdnModel.Value = intModel.ToString();
                            int intModelParent = Int32.Parse(oModelsProperties.Get(intModel, "modelid"));
                            int intType        = oModel.GetType(intModelParent);
                            int intPlatform    = oType.GetPlatform(intType);
                            oDataPoint.LoadDropDown(ddlPlatform, intProfile, null, "", lblPlatform, fldPlatform, "PHYSICAL_PLATFORM", "name", "platformid", oPlatform.Gets(1), intPlatform, false, false, true);
                            oDataPoint.LoadDropDown(ddlPlatformType, intProfile, null, "", lblPlatformType, fldPlatformType, "PHYSICAL_TYPE", "name", "id", oType.Gets(intPlatform, 1), intType, false, false, true);
                            oDataPoint.LoadDropDown(ddlPlatformModel, intProfile, null, "", lblPlatformModel, fldPlatformModel, "PHYSICAL_MODEL", "name", "id", oModel.Gets(intType, 1), intModelParent, false, false, true);
                            oDataPoint.LoadDropDown(ddlPlatformModelProperty, intProfile, null, "", lblPlatformModelProperty, fldPlatformModelProperty, "PHYSICAL_MODEL_PROP", "name", "id", oModelsProperties.GetModels(0, intModelParent, 1), intModel, false, false, true);

                            // Get Asset
                            DataSet dsAsset = oAsset.GetServerOrBlade(intAsset);
                            if (dsAsset.Tables[0].Rows.Count > 0)
                            {
                                Response.Redirect("/datapoint/asset/physical.aspx?t=serial&q=" + oFunction.encryptQueryString(strSerial) + "&id=" + oFunction.encryptQueryString(intAsset.ToString()) + "&r=0");
                            }

                            oDataPoint.LoadDropDown(ddlPlatformClass, intProfile, null, "", lblPlatformClass, fldPlatformClass, "PHYSICAL_CLASS", "name", "id", oClass.Gets(1), 0, false, false, true);
                            oDataPoint.LoadDropDown(ddlPlatformEnvironment, intProfile, null, "", lblPlatformEnvironment, fldPlatformEnvironment, "PHYSICAL_ENVIRONMENT", "name", "id", oClass.GetEnvironment(0, 0), 0, false, false, true);
                            oDataPoint.LoadTextBox(txtPlatformILO, intProfile, null, "", lblPlatformILO, fldPlatformILO, "PHYSICAL_ILO", "", "", false, true);
                            oDataPoint.LoadTextBox(txtPlatformDummy, intProfile, null, "", lblPlatformDummy, fldPlatformDummy, "PHYSICAL_DUMMY", "", "", false, true);
                            oDataPoint.LoadTextBox(txtPlatformMAC, intProfile, null, "", lblPlatformMAC, fldPlatformMAC, "PHYSICAL_MAC", "", "", false, true);
                            oDataPoint.LoadTextBox(txtPlatformVLAN, intProfile, null, "", lblPlatformVLAN, fldPlatformVLAN, "PHYSICAL_VLAN", "", "", false, true);
                            oDataPoint.LoadDropDown(ddlPlatformBuildNetwork, intProfile, null, "", lblPlatformBuildNetwork, fldPlatformBuildNetwork, "PHYSICAL_BUILD_NETWORK", "name", "id", oSolaris.GetBuildNetworks(1), 0, false, false, false);
                            oDataPoint.LoadDropDown(ddlPlatformResiliency, intProfile, null, "", lblPlatformResiliency, fldPlatformResiliency, "PHYSICAL_RESILIENCY", "name", "id", oResiliency.Gets(1), 0, false, false, true);
                            oDataPoint.LoadDropDown(ddlPlatformOperatingSystemGroup, intProfile, null, "", lblPlatformOperatingSystemGroup, fldPlatformOperatingSystemGroup, "PHYSICAL_OS_GROUP", "name", "id", oOperatingSystem.GetGroups(1), 0, false, false, false);

                            if (dsAsset.Tables[0].Rows.Count > 0)
                            {
                                lblOldlocation.Text = dsAsset.Tables[0].Rows[0]["OldLocation"].ToString();
                                lblOldRoom.Text     = dsAsset.Tables[0].Rows[0]["OldRoom"].ToString();
                                lblOldRack.Text     = dsAsset.Tables[0].Rows[0]["OldRack"].ToString();

                                txtLocation.Text     = dsAsset.Tables[0].Rows[0]["Location"].ToString();
                                txtRoom.Text         = dsAsset.Tables[0].Rows[0]["Room"].ToString();
                                txtZone.Text         = dsAsset.Tables[0].Rows[0]["Zone"].ToString();
                                txtRack.Text         = dsAsset.Tables[0].Rows[0]["Rack"].ToString();
                                txtRackPosition.Text = dsAsset.Tables[0].Rows[0]["Rackposition"].ToString();
                                oDataPoint.LoadTextBox(txtRackPosition, intProfile, null, "", lblRackPositionValue, fldLocation, "CHANGE_LOCATION", dsAsset.Tables[0].Rows[0]["rackposition"].ToString(), "", false, true);
                                hdnRackId.Value = dsAsset.Tables[0].Rows[0]["RackId"].ToString();
                            }
                            oDataPoint.LoadButton(btnSelectLocation, intProfile, fldLocation, "CHANGE_LOCATION",
                                                  "return LoadLocationRoomRack('" + "rack" + "','" + hdnRackId.ClientID + "', '" + txtLocation.ClientID + "','" + txtRoom.ClientID + "','" + txtZone.ClientID + "','" + txtRack.ClientID + "');");

                            ddlPlatformStatus.SelectedValue = oAsset.GetStatus(intAsset, "status");

                            // Resource Dependencies
                            AssetOrder      oAssetOrder     = new AssetOrder(0, dsn, dsnAsset, intEnvironment);
                            Services        oService        = new Services(0, dsn);
                            ServiceRequests oServiceRequest = new ServiceRequests(0, dsn);
                            rptServiceRequests.DataSource = oAssetOrder.GetByAsset(intAsset, false);
                            rptServiceRequests.DataBind();
                            trServiceRequests.Visible = (rptServiceRequests.Items.Count == 0);
                            foreach (RepeaterItem ri in rptServiceRequests.Items)
                            {
                                Label lblServiceID = (Label)ri.FindControl("lblServiceID");
                                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);
                                    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 = oAsset.GetProvisioningHistory(intAsset);
                            rptHistory.DataBind();
                            lblHistory.Visible = (rptHistory.Items.Count == 0);

                            // WWW
                            rptWWW.DataSource = oAsset.GetHBA(intAsset);
                            rptWWW.DataBind();
                            lblWWW.Visible = (rptWWW.Items.Count == 0);
                            oDataPoint.LoadButton(btnWWW, intProfile, fldWWW, "PHYSICAL_WWW", "return OpenWindow('ASSET_DEPLOY_HBAs','" + intAsset.ToString() + "');");
                        }
                    }
                    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
                {
                    Response.Redirect("/datapoint/asset/datapoint_asset_search.aspx");
                }
                btnClose.Attributes.Add("onclick", "window.close();return false;");
                btnPrint.Attributes.Add("onclick", "window.print();return false;");
                btnDeploy.Attributes.Add("onclick", oDataPoint.LoadValidation());
                ddlPlatformClass.Attributes.Add("onchange", "PopulateEnvironments('" + ddlPlatformClass.ClientID + "','" + ddlPlatformEnvironment.ClientID + "',0);");
                ddlPlatformEnvironment.Attributes.Add("onchange", "UpdateDropDownHidden('" + ddlPlatformEnvironment.ClientID + "','" + hdnEnvironment.ClientID + "');");
            }
            else
            {
                panDenied.Visible = true;
            }
        }
Exemplo n.º 12
0
        private void LoadList()
        {
            string strBind = "";

            if (lblType.Text == "PLAT")
            {
                ds = oPlatform.Gets(1);
                lstOrder.DataValueField = "platformid";
            }
            if (lblType.Text == "ORG")
            {
                ds = oOrganization.Gets(1);
                lstOrder.DataValueField = "organizationid";
            }
            if (lblType.Text == "COST")
            {
                ds = oCost.Gets(1);
                lstOrder.DataValueField = "costid";
            }
            if (lblType.Text == "AT")
            {
                ds = oUserAt.Gets(1);
                lstOrder.DataValueField = "atid";
            }
            if (lblType.Text == "ITEMS")
            {
                ds = oRequestItem.GetItems(Int32.Parse(lblId.Text), 0, 1);
                lstOrder.DataValueField = "itemid";
            }
            if (lblType.Text == "SERVICEDETAIL")
            {
                ds = oServiceDetail.Gets(Int32.Parse(lblId.Text), 1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "SERVICES")
            {
                int intFolder = Int32.Parse(oService.GetFolders(Int32.Parse(lblId.Text), "folderid"));
                ds = oService.Gets(intFolder, 1, 1, 1, 0);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "SERVICE_FOLDERS")
            {
                ds = oService.GetFolders(Int32.Parse(lblId.Text), 1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "REPORTS")
            {
                ds = oReport.Gets(Int32.Parse(lblId.Text), 1);
                lstOrder.DataValueField = "reportid";
                strBind = "title";
            }
            if (lblType.Text == "A_SITE")
            {
                ds = oSites.Gets(1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "A_TYPE")
            {
                ds = oType.Gets(Int32.Parse(lblId.Text), 1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "A_MODEL")
            {
                ds = oModel.Gets(Int32.Parse(lblId.Text), 1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "A_LOCATION_S")
            {
                ds = oDepot.Gets(1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "A_SHELF")
            {
                ds = oShelf.Gets(1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "A_RACK")
            {
                ds = oRacks.Gets(1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "CLASS")
            {
                ds = oClasses.Gets(1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "A_ROOM")
            {
                ds = oRooms.Gets(1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "A_FLOOR")
            {
                ds = oFloor.Gets(1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "ENVIRONMENT")
            {
                ds = oEnvironment.Gets(1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "S_CODE")
            {
                ds = oSolution.GetCodes(1);
                lstOrder.DataValueField = "id";
                strBind = "code";
            }
            if (lblType.Text == "F_QUESTION")
            {
                ds = oForecast.GetQuestions(1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "F_RESPONSE")
            {
                ds = oForecast.GetResponses(Int32.Parse(lblId.Text), 1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "F_LINE_ITEMS")
            {
                ds = oForecast.GetLineItems(1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "CONFIDENCE")
            {
                ds = oConfidence.Gets(1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "LOCATION_S")
            {
                ds = oLocation.GetStates(1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "F_STEPS")
            {
                ds = oForecast.GetSteps(Int32.Parse(lblId.Text), 1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "F_STEPS_ADD")
            {
                ds = oForecast.GetStepAdditionals(1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "FIELD")
            {
                ds = oField.Gets(Int32.Parse(lblId.Text), 1);
                lstOrder.DataValueField = "id";
                strBind = "fieldname";
            }
            if (lblType.Text == "DOMAIN_CONTROLLER")
            {
                ds = oDomainController.Gets(1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "DOMAIN")
            {
                ds = oDomain.Gets(1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "SERVERNAME_A")
            {
                ds = oServerName.GetApplications(1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "SERVERNAME_SUBA")
            {
                ds = oServerName.GetSubApplications(Int32.Parse(lblId.Text), 1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "SERVERNAME_C")
            {
                ds = oServerName.GetComponents(1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "WORKSTATION_C")
            {
                ds = oWorkstation.GetComponents(1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "OPERATING_SYSTEM")
            {
                ds = oOperatingSystems.Gets(1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "OD_W_STEPS")
            {
                ds = oOnDemand.GetWizardSteps(Int32.Parse(lblId.Text), 1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "OD_STEPS")
            {
                ds = oOnDemand.GetSteps(Int32.Parse(lblId.Text), 1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "SERVICE_PACK")
            {
                ds = oServicePack.Gets(1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "COMPONENT_SCRIPTS")
            {
                ds = oServerName.GetComponentDetailScripts(Int32.Parse(lblId.Text), 1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "HOST")
            {
                ds = oHost.Gets(1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "VIRTUAL_HDD")
            {
                ds = oVirtualHDD.Gets(1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "VIRTUAL_RAM")
            {
                ds = oVirtualRam.Gets(1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "RESTART")
            {
                ds = oRestart.Gets(1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "SEGMENT")
            {
                ds = oSegment.Gets(1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "DOMAIN_SUFFIX")
            {
                ds = oDomain.GetSuffixs(Int32.Parse(lblId.Text), 1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "DOMAIN_ADMIN_GROUP")
            {
                ds = oDomain.GetAdminGroups(Int32.Parse(lblId.Text), 1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "SERVICE_EDITOR_FIELDS")
            {
                ds = oServiceEditor.GetFields(1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "PROJECT_REQUEST_QUESTION")
            {
                ds = oProjectRequest.GetQuestions(1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "PROJECT_REQUEST_RESPONSE")
            {
                ds = oProjectRequest.GetResponses(Int32.Parse(lblId.Text), 1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "PROJECT_REQUEST_CLASS")
            {
                ds = oProjectRequest.GetClasses(1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "VMWARE_TEMPLATE")
            {
                ds = oVMWare.GetTemplates(1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "ORDER_REPORT_DATASOURCE")
            {
                ds = oReport.GetDataSources(1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "ORDER_REPORT_CHARTS")
            {
                ds = oReport.GetCharts(1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "PLATFORM_FORM")
            {
                ds = oPlatform.GetForms(Int32.Parse(lblId.Text), 1);
                lstOrder.DataValueField = "id";
            }
            //if (lblType.Text == "NEW")
            //{
            //    ds = oNew.Gets(1);
            //    lstOrder.DataValueField = "id";
            //    strBind = "title";
            //}
            if (lblType.Text == "WHATSNEW")
            {
                ds = oWhatsNew.Gets(1);
                lstOrder.DataValueField = "id";
                strBind = "title";
            }
            //if (lblType.Text == "RECOVERY_LOCATIONS")
            //{
            //    ds = oRecoveryLocations.Gets(1);
            //    lstOrder.DataValueField = "id";
            //}
            if (lblType.Text == "MAINTENANCE_WINDOW")
            {
                ds = oMaintenanceWindow.Gets(1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "TSM")
            {
                ds = oTSM.Gets(1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "TSM_DOMAINS")
            {
                ds = oTSM.GetDomains(Int32.Parse(lblId.Text), 1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "TSM_SCHEDULES")
            {
                ds = oTSM.GetSchedules(Int32.Parse(lblId.Text), 1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "DNS")
            {
                ds = oDNS.Gets(1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "SOLARIS_BUILD_NETWORKS")
            {
                ds = oSolaris.GetBuildNetworks(1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "SOLARIS_BUILD_TYPES")
            {
                ds = oSolaris.GetBuildTypes(1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "SOLARIS_INTERFACES")
            {
                ds = oSolaris.GetInterfaces(1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "ZEUS_ARRAY_CONFIGS")
            {
                ds = oZeus.GetArrayConfigs(1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "ZEUS_BUILD_TYPES")
            {
                ds = oZeus.GetBuildTypes(1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "ERROR_TYPES")
            {
                ds = oError.GetTypes(1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "ERROR_TYPES_TYPES")
            {
                ds = oError.GetTypeTypes(Int32.Parse(lblId.Text), 1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "D_PHASES")
            {
                ds      = oDesign.GetPhases(1);
                strBind = "title";
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "D_QUESTIONS")
            {
                ds      = oDesign.GetQuestions(Int32.Parse(lblId.Text), 1);
                strBind = "summary";
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "D_RESPONSES")
            {
                ds      = oDesign.GetResponses(Int32.Parse(lblId.Text), 0, 1);
                strBind = "admin";
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "D_MODELS")
            {
                ds = oDesign.GetModels(1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "RESILIENCY")
            {
                ds = oResiliency.Gets(1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "ENHANCEMENT_MODULES")
            {
                ds = oEnhancement.GetModules(1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "OPERATING_SYSTEM_GROUPS")
            {
                ds = oOperatingSystems.GetGroups(1);
                lstOrder.DataValueField = "id";
            }
            if (lblType.Text == "DESIGN_APPROVE_CONDITION")
            {
                ds = oDesign.GetApprovalConditionals(1);
                lstOrder.DataValueField = "id";
            }



            if (strBind == "")
            {
                strBind = "name";
            }
            lstOrder.DataTextField = strBind;
            lstOrder.DataSource    = ds;
            lstOrder.DataBind();
        }