コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile        = Int32.Parse(Request.Cookies["profileid"].Value);
            oPlatform         = new Platforms(intProfile, dsn);
            oType             = new Types(intProfile, dsn);
            oModelsProperties = new ModelsProperties(intProfile, dsn);
            oServiceRequest   = new ServiceRequests(intProfile, dsn);
            oForecast         = new Forecast(intProfile, dsn);
            oPage             = new Pages(intProfile, dsn);
            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);
            }
            int intPlatform = 0;

            if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
            {
                intPlatform = Int32.Parse(Request.QueryString["id"]);
            }
            if (intPlatform > 0)
            {
                intMax      = Int32.Parse(oPlatform.Get(intPlatform, "max_inventory1"));
                intMaxRAM   = Int32.Parse(oPlatform.Get(intPlatform, "max_inventory2"));
                intMaxSpace = Int32.Parse(oPlatform.Get(intPlatform, "max_inventory3"));
                if (!IsPostBack)
                {
                    LoadLists();
                    LoadFilters();
                    LoadGroups(intPlatform);
                }
                btnProjects.Attributes.Add("onclick", "return MakeWider(this, '" + lstProjects.ClientID + "');");
                btnProjectsClear.Attributes.Add("onclick", "return ClearList('" + lstProjects.ClientID + "');");
                btnClasses.Attributes.Add("onclick", "return MakeWider(this, '" + lstClasses.ClientID + "');");
                btnClassesClear.Attributes.Add("onclick", "return ClearList('" + lstClasses.ClientID + "');");
                btnConfidences.Attributes.Add("onclick", "return MakeWider(this, '" + lstConfidences.ClientID + "');");
                btnConfidencesClear.Attributes.Add("onclick", "return ClearList('" + lstConfidences.ClientID + "');");
                btnEnvironments.Attributes.Add("onclick", "return MakeWider(this, '" + lstEnvironments.ClientID + "');");
                btnEnvironmentsClear.Attributes.Add("onclick", "return ClearList('" + lstEnvironments.ClientID + "');");
                btnLocations.Attributes.Add("onclick", "return MakeWider(this, '" + lstLocations.ClientID + "');");
                btnLocationsClear.Attributes.Add("onclick", "return ClearList('" + lstLocations.ClientID + "');");
                lstClasses.Attributes.Add("onchange", "PopulateEnvironmentsList('" + lstClasses.ClientID + "','" + lstEnvironments.ClientID + "',0);");
                lstEnvironments.Attributes.Add("onchange", "UpdateListHidden('" + lstEnvironments.ClientID + "','" + hdnEnvironment.ClientID + "');");
                imgStart.Attributes.Add("onclick", "return ShowCalendar('" + txtStart.ClientID + "');");
                imgEnd.Attributes.Add("onclick", "return ShowCalendar('" + txtEnd.ClientID + "');");
            }
        }
コード例 #2
0
        private void LoadLists()
        {
            DataSet ds = oPlatform.GetAssets(1);

            ddlPlatform.DataValueField = "platformid";
            ddlPlatform.DataTextField  = "name";
            ddlPlatform.DataSource     = ds;
            ddlPlatform.DataBind();
            ddlPlatform.Items.Insert(0, new ListItem("-- SELECT --", "0"));
            int intPlatform = 0;

            if (Request.QueryString["pid"] != null && Request.QueryString["pid"] != "")
            {
                intPlatform = Int32.Parse(Request.QueryString["pid"]);
            }
            if (oPlatform.Get(intPlatform).Tables[0].Rows.Count > 0)
            {
                string strPath = oPlatform.Get(intPlatform, "asset_checkin_path");
                if (strPath != "")
                {
                    PHImport.Controls.Add((Control)LoadControl(strPath));
                }
                ddlPlatform.SelectedValue = intPlatform.ToString();
                panTypes.Visible          = true;
                ds = oType.Gets(intPlatform, 1);
                ddlTypes.DataValueField = "id";
                ddlTypes.DataTextField  = "name";
                ddlTypes.DataSource     = ds;
                ddlTypes.DataBind();
                ddlTypes.Items.Insert(0, new ListItem("-- SELECT --", "0"));
                int intType = 0;
                if (Request.QueryString["tid"] != null && Request.QueryString["tid"] != "")
                {
                    intType = Int32.Parse(Request.QueryString["tid"]);
                }
                if (oType.Get(intType).Tables[0].Rows.Count > 0)
                {
                    panPath.Visible        = true;
                    ddlTypes.SelectedValue = intType.ToString();
                    strPath = oType.Get(intType, "asset_checkin_path");
                    if (strPath != "")
                    {
                        PHControl.Controls.Add((Control)LoadControl(strPath));
                    }
                    else
                    {
                        panNoPath.Visible = true;
                    }
                }
            }
        }
コード例 #3
0
        private void LoadLists()
        {
            int intPlatform = 0;

            if (Request.QueryString["pid"] != null && Request.QueryString["pid"] != "")
            {
                intPlatform = Int32.Parse(Request.QueryString["pid"]);
            }
            if (oPlatform.Get(intPlatform).Tables[0].Rows.Count > 0)
            {
                int intType = 0;
                if (Request.QueryString["tid"] != null && Request.QueryString["tid"] != "")
                {
                    intType = Int32.Parse(Request.QueryString["tid"]);
                }
                if (oType.Get(intType).Tables[0].Rows.Count > 0)
                {
                    ddlModel.Items.Clear();
                    ddlModel.DataValueField = "id";
                    ddlModel.DataTextField  = "name";
                    ddlModel.DataSource     = oModelsProperties.GetTypes(1, intType, 1);
                    ddlModel.DataBind();
                    if (Request.QueryString["mid"] != null && Request.QueryString["mid"] != "")
                    {
                        ddlModel.SelectedValue = Request.QueryString["mid"];
                    }
                    ddlDepot.DataValueField = "id";
                    ddlDepot.DataTextField  = "name";
                    ddlDepot.DataSource     = oDepot.Gets(1);
                    ddlDepot.DataBind();
                }
            }
            ddlModel.Items.Insert(0, new ListItem("-- SELECT --", "0"));
            ddlDepot.Items.Insert(0, new ListItem("-- SELECT --", "0"));
        }
コード例 #4
0
        private void LoadLists()
        {
            DataSet ds = oPlatform.GetAssets(1);

            ddlPlatform.DataValueField = "platformid";
            ddlPlatform.DataTextField  = "name";
            ddlPlatform.DataSource     = ds;
            ddlPlatform.DataBind();
            ddlPlatform.Items.Insert(0, new ListItem("-- SELECT --", "0"));
            if (Request.QueryString["pid"] != null && Request.QueryString["pid"] != "")
            {
                intPlatform = Int32.Parse(Request.QueryString["pid"]);
            }
            if (oPlatform.Get(intPlatform).Tables[0].Rows.Count > 0)
            {
                ddlPlatform.SelectedValue = intPlatform.ToString();
                panTypes.Visible          = true;
                ds = oType.Gets(intPlatform, 1);
                ddlTypes.DataValueField = "id";
                ddlTypes.DataTextField  = "name";
                ddlTypes.DataSource     = ds;
                ddlTypes.DataBind();
                ddlTypes.Items.Insert(0, new ListItem("-- SELECT --", "0"));
                if (Request.QueryString["tid"] != null && Request.QueryString["tid"] != "")
                {
                    intType = Int32.Parse(Request.QueryString["tid"]);
                }
                if (oType.Get(intType).Tables[0].Rows.Count > 0)
                {
                    panPath.Visible        = true;
                    ddlTypes.SelectedValue = intType.ToString();
                }
            }
        }
コード例 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile        = Int32.Parse(Request.Cookies["profileid"].Value);
            oPlatform         = new Platforms(intProfile, dsn);
            oType             = new Types(intProfile, dsn);
            oModelsProperties = new ModelsProperties(intProfile, dsn);
            oServiceRequest   = new ServiceRequests(intProfile, dsn);
            oForecast         = new Forecast(intProfile, dsn);
            oPage             = new Pages(intProfile, dsn);
            oIM       = new InventoryManager(intProfile, dsn);
            oLocation = new Locations(intProfile, dsn);

            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["id"] != null && Request.QueryString["id"] != "")
            {
                intPlatform = Int32.Parse(Request.QueryString["id"]);
            }

            if (intPlatform > 0)
            {
                intMax = Int32.Parse(oPlatform.Get(intPlatform, "max_inventory1"));

                if (!IsPostBack)
                {
                    LoadLists();
                }
                else
                {
                    Page.ClientScript.RegisterStartupScript(typeof(Page), "loadCurrentTab", "<script type=\"text/javascript\">window.top.LoadCurrentTab();<" + "/" + "script>");
                }

                btnProjects.Attributes.Add("onclick", "return MakeWider(this, '" + lstProjects.ClientID + "');");
                btnProjectsClear.Attributes.Add("onclick", "return ClearList('" + lstProjects.ClientID + "');");
                btnClasses.Attributes.Add("onclick", "return MakeWider(this, '" + lstClasses.ClientID + "');");
                btnClassesClear.Attributes.Add("onclick", "return ClearList('" + lstClasses.ClientID + "');");
                btnConfidences.Attributes.Add("onclick", "return MakeWider(this, '" + lstConfidences.ClientID + "');");
                btnConfidencesClear.Attributes.Add("onclick", "return ClearList('" + lstConfidences.ClientID + "');");
                btnEnvironments.Attributes.Add("onclick", "return MakeWider(this, '" + lstEnvironments.ClientID + "');");
                btnEnvironmentsClear.Attributes.Add("onclick", "return ClearList('" + lstEnvironments.ClientID + "');");
                btnLocations.Attributes.Add("onclick", "return MakeWider(this, '" + lstLocations.ClientID + "');");
                btnLocationsClear.Attributes.Add("onclick", "return ClearList('" + lstLocations.ClientID + "');");
                lstClasses.Attributes.Add("onchange", "PopulateEnvironmentsList('" + lstClasses.ClientID + "','" + lstEnvironments.ClientID + "',0);");
                lstEnvironments.Attributes.Add("onchange", "UpdateListHidden('" + lstEnvironments.ClientID + "','" + hdnEnvironment.ClientID + "');");
                imgStart.Attributes.Add("onclick", "return ShowCalendar('" + txtStart.ClientID + "');");
                imgEnd.Attributes.Add("onclick", "return ShowCalendar('" + txtEnd.ClientID + "');");
            }
        }
コード例 #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile        = Int32.Parse(Request.Cookies["profileid"].Value);
            oPage             = new Pages(intProfile, dsn);
            oPlatform         = new Platforms(intProfile, dsn);
            oType             = new Types(intProfile, dsn);
            oModelsProperties = new ModelsProperties(intProfile, dsn);
            oAsset            = new Asset(intProfile, dsnAsset);
            oServiceRequest   = new ServiceRequests(intProfile, dsn);
            oForecast         = new Forecast(intProfile, dsn);
            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);
            }
            int intPlatform = 0;

            if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
            {
                intPlatform = Int32.Parse(Request.QueryString["id"]);
            }
            if (intPlatform > 0)
            {
                if (!IsPostBack)
                {
                    txtMax1.Text = oPlatform.Get(intPlatform, "max_inventory1");
                    txtMax2.Text = oPlatform.Get(intPlatform, "max_inventory2");
                }
            }
            btnMaximum.Attributes.Add("onclick", "return ValidateNumber0('" + txtMax1.ClientID + "','Please enter a valid number') " +
                                      " && ValidateNumber0('" + txtMax2.ClientID + "','Please enter a valid number')" +
                                      ";");
        }
コード例 #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile        = Int32.Parse(Request.Cookies["profileid"].Value);
            oPlatform         = new Platforms(intProfile, dsn);
            oType             = new Types(intProfile, dsn);
            oModelsProperties = new ModelsProperties(intProfile, dsn);
            oServiceRequest   = new ServiceRequests(intProfile, dsn);
            oForecast         = new Forecast(intProfile, dsn);
            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);
            }
            int intPlatform = 0;

            if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
            {
                intPlatform = Int32.Parse(Request.QueryString["id"]);
            }
            if (intPlatform > 0)
            {
                intMax = Int32.Parse(oPlatform.Get(intPlatform, "max_inventory1"));
                if (!IsPostBack)
                {
                    LoadFilters();
                    LoadGroups(intPlatform);
                }
            }
        }
コード例 #8
0
ファイル: action.ascx.cs プロジェクト: radtek/ClearView
        protected void Page_Load(object sender, EventArgs e)
        {
            StringBuilder sb = new StringBuilder();

            intProfile        = Int32.Parse(Request.Cookies["profileid"].Value);
            oPlatform         = new Platforms(intProfile, dsn);
            oType             = new Types(intProfile, dsn);
            oModelsProperties = new ModelsProperties(intProfile, dsn);
            oAsset            = new Asset(intProfile, dsnAsset);
            oServiceRequest   = new ServiceRequests(intProfile, dsn);
            oForecast         = new Forecast(intProfile, dsn);
            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);
            }
            int intPlatform = 0;

            if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
            {
                intPlatform = Int32.Parse(Request.QueryString["id"]);
            }
            if (intPlatform > 0)
            {
                intMax = Int32.Parse(oPlatform.Get(intPlatform, "max_inventory1"));
                if (!IsPostBack)
                {
                    DataSet   dsDemand = oForecast.GetAnswersModel(intPlatform);
                    DataTable dtDemand = dsDemand.Tables[0];
                    DataSet   dsTypes  = oType.Gets(intPlatform, 1);
                    foreach (DataRow drType in dsTypes.Tables[0].Rows)
                    {
                        int     intWarning  = Int32.Parse(drType["inventory_warning"].ToString());
                        int     intCritical = Int32.Parse(drType["inventory_critical"].ToString());
                        bool    boolOther   = false;
                        DataSet dsModels    = oModelsProperties.GetTypes(1, Int32.Parse(drType["id"].ToString()), 1);
                        foreach (DataRow drModel in dsModels.Tables[0].Rows)
                        {
                            int intBlade = Int32.Parse(drModel["blade"].ToString());
                            int intHost  = -1;
                            if (drModel["hostid"].ToString() != "")
                            {
                                intHost = Int32.Parse(drModel["hostid"].ToString());
                            }
                            int intModel = Int32.Parse(drModel["id"].ToString());
                            // Supply
                            DataSet dsModel   = oAsset.GetCount(intModel, (int)AssetStatus.Available);
                            int     intSupply = dsModel.Tables[0].Rows.Count;
                            // Demand
                            DataRow[] drModels  = dtDemand.Select("model = " + intModel.ToString());
                            int       intDemand = 0;
                            foreach (DataRow dr in drModels)
                            {
                                intDemand += Int32.Parse(dr["quantity"].ToString());
                                intDemand += Int32.Parse(dr["recovery_number"].ToString());
                            }
                            bool boolWarning  = (intDemand > 0 && (intDemand + intWarning) >= intSupply);
                            bool boolCritical = (intDemand > 0 && (intDemand + intCritical) >= intSupply);
                            if (boolWarning || boolCritical)
                            {
                                boolOther = !boolOther;
                                sb        = new StringBuilder(strSummary);

                                sb.Append("<tr");
                                sb.Append(boolOther ? " bgcolor=\"F6F6F6\"" : "");
                                sb.Append(" class=\"header\"><td nowrap><img src=\"/images/spacer.gif\" border=\"0\" width=\"10\" height=\"1\"/></td><td colspan=\"3\"><img src=\"/images/");
                                sb.Append(boolCritical ? "bigError.gif" : "bigAlert.gif");
                                sb.Append("\" border=\"0\" align=\"absmiddle\"/> ");
                                sb.Append(boolCritical ? "CRITICAL" : "WARNING");
                                sb.Append(": ");
                                sb.Append(drModel["name"].ToString());
                                sb.Append("</td></tr>");
                                sb.Append("<tr");
                                sb.Append(boolOther ? " bgcolor=\"F6F6F6\"" : "");
                                sb.Append("><td nowrap><img src=\"/images/spacer.gif\" border=\"0\" width=\"10\" height=\"1\"/></td><td nowrap>Supply:</td><td width=\"100%\">");
                                sb.Append(oServiceRequest.GetStatusBarFill(((double.Parse(intSupply.ToString()) / double.Parse(intMax.ToString())) * 100.00), "95", false, "#6699CC"));
                                sb.Append("</td><td nowrap>");
                                sb.Append(intSupply.ToString());
                                sb.Append("</td></tr>");
                                sb.Append("<tr");
                                sb.Append(boolOther ? " bgcolor=\"F6F6F6\"" : "");
                                sb.Append("><td nowrap><img src=\"/images/spacer.gif\" border=\"0\" width=\"10\" height=\"1\"/></td><td nowrap>Demand:</td><td width=\"100%\">");
                                sb.Append(oServiceRequest.GetStatusBarFill(((double.Parse(intDemand.ToString()) / double.Parse(intMax.ToString())) * 100.00), "95", false, "#CC3300"));
                                sb.Append("</td><td nowrap>");
                                sb.Append(intDemand.ToString());
                                sb.Append("</td></tr>");

                                strSummary = sb.ToString();
                            }
                        }
                    }

                    if (strSummary == "")
                    {
                        strSummary = "<tr><td class=\"header\"><img src=\"/images/bigCheck.gif\" border=\"0\" align=\"absmiddle\"/> No Action Required</td></tr>";
                    }
                }
            }
        }
コード例 #9
0
ファイル: asset_search.ascx.cs プロジェクト: radtek/ClearView
        private void LoadLists()
        {
            //Menu
            int intMenuTab = 0;

            if (Request.QueryString["menu_tab"] != null && Request.QueryString["menu_tab"] != "")
            {
                intMenuTab = Int32.Parse(Request.QueryString["menu_tab"]);
            }
            Tab oTab = new Tab(hdnType.ClientID, intMenuTab, "divMenu1", true, false);

            //End Menu

            ddlPlatform.DataValueField = "platformid";
            ddlPlatform.DataTextField  = "name";
            ddlPlatform.DataSource     = oPlatform.GetAssets(1);
            ddlPlatform.DataBind();
            ddlPlatform.Items.Insert(0, new ListItem("-- SELECT --", "0"));
            ddlPlatformDepot.DataValueField = "platformid";
            ddlPlatformDepot.DataTextField  = "name";
            ddlPlatformDepot.DataSource     = oPlatform.GetAssets(1);
            ddlPlatformDepot.DataBind();
            ddlPlatformDepot.Items.Insert(0, new ListItem("-- SELECT --", "0"));
            ddlPlatformClass.DataValueField = "platformid";
            ddlPlatformClass.DataTextField  = "name";
            ddlPlatformClass.DataSource     = oPlatform.GetAssets(1);
            ddlPlatformClass.DataBind();
            ddlPlatformClass.Items.Insert(0, new ListItem("-- SELECT --", "0"));
            int intPlatform = 0;

            if (Request.QueryString["pid"] != null && Request.QueryString["pid"] != "")
            {
                intPlatform = Int32.Parse(Request.QueryString["pid"]);
            }
            if (oPlatform.Get(intPlatform).Tables[0].Rows.Count > 0)
            {
                ddlPlatform.SelectedValue      = intPlatform.ToString();
                ddlPlatformDepot.SelectedValue = intPlatform.ToString();
                ddlPlatformClass.SelectedValue = intPlatform.ToString();
                // Types
                ddlTypes.DataValueField = "id";
                ddlTypes.DataTextField  = "name";
                ddlTypes.DataSource     = oType.Gets(intPlatform, 1);
                ddlTypes.DataBind();
                ddlTypes.Items.Insert(0, new ListItem("-- ALL --", "0"));
                // Classes
                ddlClass.DataValueField = "id";
                ddlClass.DataTextField  = "name";
                ddlClass.DataSource     = oClasses.Gets(1);
                ddlClass.DataBind();
                ddlClass.Items.Insert(0, new ListItem("-- SELECT --", "0"));
                int intClass = 0;
                if (Request.QueryString["cid"] != null && Request.QueryString["cid"] != "")
                {
                    intClass = Int32.Parse(Request.QueryString["cid"]);
                }
                if (oClasses.Get(intClass).Tables[0].Rows.Count > 0)
                {
                    ddlClass.SelectedValue        = intClass.ToString();
                    ddlEnvironment.DataValueField = "id";
                    ddlEnvironment.DataTextField  = "name";
                    ddlEnvironment.DataSource     = oClasses.GetEnvironment(intClass, 0);
                    ddlEnvironment.DataBind();
                    ddlEnvironment.Items.Insert(0, new ListItem("-- ALL --", "0"));
                }
                else
                {
                    ddlEnvironment.Items.Insert(0, new ListItem("-- SELECT --", "0"));
                    ddlEnvironment.Enabled = false;
                }
                // Depot
                ddlDepot.DataValueField = "id";
                ddlDepot.DataTextField  = "name";
                ddlDepot.DataSource     = oDepot.Gets(1);
                ddlDepot.DataBind();
                ddlDepot.Items.Insert(0, new ListItem("-- SELECT --", "0"));
                int intType = 0;
                if (Request.QueryString["tid"] != null && Request.QueryString["tid"] != "")
                {
                    intType = Int32.Parse(Request.QueryString["tid"]);
                }
                if (oType.Get(intType).Tables[0].Rows.Count > 0)
                {
                    ddlTypes.SelectedValue  = intType.ToString();
                    ddlModel.DataValueField = "id";
                    ddlModel.DataTextField  = "name";
                    ddlModel.DataSource     = oModel.Gets(intType, 1);
                    ddlModel.DataBind();
                    ddlModel.Items.Insert(0, new ListItem("-- ALL --", "0"));
                }
                else
                {
                    ddlModel.Items.Insert(0, new ListItem("-- ALL --", "0"));
                    ddlModel.Enabled = false;
                }
            }
            else
            {
                ddlTypes.Items.Insert(0, new ListItem("-- SELECT --", "0"));
                ddlTypes.Enabled = false;
                ddlModel.Items.Insert(0, new ListItem("-- SELECT --", "0"));
                ddlModel.Enabled = false;
                ddlDepot.Items.Insert(0, new ListItem("-- SELECT --", "0"));
                ddlDepot.Enabled = false;
                ddlClass.Items.Insert(0, new ListItem("-- SELECT --", "0"));
                ddlClass.Enabled = false;
                ddlEnvironment.Items.Insert(0, new ListItem("-- SELECT --", "0"));
                ddlEnvironment.Enabled = false;
            }

            //if (boolClass == false && boolType == false && boolDepot == false)
            //{
            //    boolName = true;
            //    hdnType.Value = "N";
            //strMenuTab1 += "<td><img src=\"/images/TabOnLeftCap.gif\"></td><td nowrap background=\"/images/TabOnBackground.gif\"><a href=\"javascript:void(0);\" onclick=\"ChangeTab(this,'divTab1','" + hdnType.ClientID + "','N',true);\" class=\"tabheader\">Search By Name / Serial / Asset</a></td><td><img src=\"/images/TabOnRightCap.gif\"></td>";
            //strMenuTab1 += "<td><img src=\"/images/TabOffLeftCap.gif\"></td><td nowrap background=\"/images/TabOffBackground.gif\"><a href=\"javascript:void(0);\" onclick=\"ChangeTab(this,'divTab2','" + hdnType.ClientID + "','C',true);\" class=\"tabheader\">Search By Class / Environment</a></td><td><img src=\"/images/TabOffRightCap.gif\"></td>";
            //strMenuTab1 += "<td><img src=\"/images/TabOffLeftCap.gif\"></td><td nowrap background=\"/images/TabOffBackground.gif\"><a href=\"javascript:void(0);\" onclick=\"ChangeTab(this,'divTab3','" + hdnType.ClientID + "','T',true);\" class=\"tabheader\">Search By Type / Model</a></td><td><img src=\"/images/TabOffRightCap.gif\"></td>";
            //strMenuTab1 += "<td><img src=\"/images/TabOffLeftCap.gif\"></td><td nowrap background=\"/images/TabOffBackground.gif\"><a href=\"javascript:void(0);\" onclick=\"ChangeTab(this,'divTab4','" + hdnType.ClientID + "','D',true);\" class=\"tabheader\">Search By Depot</a></td><td><img src=\"/images/TabOffRightCap.gif\"></td>";
            oTab.AddTab("Search By Name / Serial / Asset", "");
            oTab.AddTab("Search By Class / Environment", "");
            oTab.AddTab("Search By Type / Model", "");
            oTab.AddTab("Search By Depot", "");

            //}
            //else
            //{
            //    //strMenuTab1 += "<td><img src=\"/images/TabOffLeftCap.gif\"></td><td nowrap background=\"/images/TabOffBackground.gif\"><a href=\"javascript:void(0);\" onclick=\"ChangeTab(this,'divTab1','" + hdnType.ClientID + "','N',true);\" class=\"tabheader\">Search By Name / Serial / Asset</a></td><td><img src=\"/images/TabOffRightCap.gif\"></td>";
            //    oTab.AddTab("Search By Name / Serial / Asset", "");
            //    if (boolClass == true)
            //        //strMenuTab1 += "<td><img src=\"/images/TabOnLeftCap.gif\"></td><td nowrap background=\"/images/TabOnBackground.gif\"><a href=\"javascript:void(0);\" onclick=\"ChangeTab(this,'divTab2','" + hdnType.ClientID + "','C',true);\" class=\"tabheader\">Search By Class / Environment</a></td><td><img src=\"/images/TabOnRightCap.gif\"></td>";
            //        oTab.AddTab("Search By Class / Environment", "");
            //    else
            //        //strMenuTab1 += "<td><img src=\"/images/TabOffLeftCap.gif\"></td><td nowrap background=\"/images/TabOffBackground.gif\"><a href=\"javascript:void(0);\" onclick=\"ChangeTab(this,'divTab2','" + hdnType.ClientID + "','C',true);\" class=\"tabheader\">Search By Class / Environment</a></td><td><img src=\"/images/TabOffRightCap.gif\"></td>";
            //        oTab.AddTab("Search By Class / Environment", "");
            //    if (boolType == true)
            //        //strMenuTab1 += "<td><img src=\"/images/TabOnLeftCap.gif\"></td><td nowrap background=\"/images/TabOnBackground.gif\"><a href=\"javascript:void(0);\" onclick=\"ChangeTab(this,'divTab3','" + hdnType.ClientID + "','T',true);\" class=\"tabheader\">Search By Type / Model</a></td><td><img src=\"/images/TabOnRightCap.gif\"></td>";
            //        oTab.AddTab("Search By Type / Model", "");
            //    else
            //        //strMenuTab1 += "<td><img src=\"/images/TabOffLeftCap.gif\"></td><td nowrap background=\"/images/TabOffBackground.gif\"><a href=\"javascript:void(0);\" onclick=\"ChangeTab(this,'divTab3','" + hdnType.ClientID + "','T',true);\" class=\"tabheader\">Search By Type / Model</a></td><td><img src=\"/images/TabOffRightCap.gif\"></td>";
            //        oTab.AddTab("Search By Type / Model", "");
            //    if (boolDepot == true)
            //        //strMenuTab1 += "<td><img src=\"/images/TabOnLeftCap.gif\"></td><td nowrap background=\"/images/TabOnBackground.gif\"><a href=\"javascript:void(0);\" onclick=\"ChangeTab(this,'divTab4','" + hdnType.ClientID + "','D',true);\" class=\"tabheader\">Search By Depot</a></td><td><img src=\"/images/TabOnRightCap.gif\"></td>";
            //         oTab.AddTab("Search By Depot", "");
            //    else
            //        //strMenuTab1 += "<td><img src=\"/images/TabOffLeftCap.gif\"></td><td nowrap background=\"/images/TabOffBackground.gif\"><a href=\"javascript:void(0);\" onclick=\"ChangeTab(this,'divTab4','" + hdnType.ClientID + "','D',true);\" class=\"tabheader\">Search By Depot</a></td><td><img src=\"/images/TabOffRightCap.gif\"></td>";
            //        oTab.AddTab("Search By Depot", "");
            //}
            strMenuTab1 = oTab.GetTabs();
        }
コード例 #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile        = Int32.Parse(Request.Cookies["profileid"].Value);
            oPage             = new Pages(intProfile, dsn);
            oPlatform         = new Platforms(intProfile, dsn);
            oType             = new Types(intProfile, dsn);
            oModelsProperties = new ModelsProperties(intProfile, dsn);
            oAsset            = new Asset(intProfile, dsnAsset);
            oServiceRequest   = new ServiceRequests(intProfile, dsn);
            oForecast         = new Forecast(intProfile, dsn);
            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);
            }
            int intPlatform = 0;

            if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
            {
                intPlatform = Int32.Parse(Request.QueryString["id"]);
            }
            if (intPlatform > 0)
            {
                if (!IsPostBack)
                {
                    txtMax1.Text = oPlatform.Get(intPlatform, "max_inventory1");
                    bool    boolOther2 = false;
                    DataSet dsTypes    = oType.Gets(intPlatform, 1);
                    foreach (DataRow drType in dsTypes.Tables[0].Rows)
                    {
                        boolOther2    = !boolOther2;
                        strThreshold += "<tr" + (boolOther2 ? " bgcolor=\"F6F6F6\"" : "") + " class=\"default\"><td nowrap class=\"bold\">" + drType["name"].ToString() + ":</td><td nowrap><input id=\"" + drType["id"].ToString() + "_warning\" name=\"" + drType["id"].ToString() + "_warning\" type=\"text\" class=\"default\" maxlength=\"5\" value=\"" + drType["inventory_warning"].ToString() + "\" style=\"width:50px\"/></td><td nowrap><input id=\"" + drType["id"].ToString() + "_critical\" name=\"" + drType["id"].ToString() + "_critical\" type=\"text\" class=\"default\" maxlength=\"5\" value=\"" + drType["inventory_critical"].ToString() + "\" style=\"width:50px\"/></td></tr>";

                        bool    boolPhysical = false;
                        bool    boolBlade    = false;
                        bool    boolOther    = false;
                        int     intOldHost   = -1;
                        DataSet dsModels     = oModelsProperties.GetTypes(1, Int32.Parse(drType["id"].ToString()), 1);
                        foreach (DataRow drModel in dsModels.Tables[0].Rows)
                        {
                            boolOther = !boolOther;
                            int intBlade = Int32.Parse(drModel["blade"].ToString());
                            int intHost  = -1;
                            if (drModel["hostid"].ToString() != "")
                            {
                                intHost = Int32.Parse(drModel["hostid"].ToString());
                            }
                            string strType  = "Unknown";
                            int    intModel = Int32.Parse(drModel["id"].ToString());
                            if (intBlade == 1)
                            {
                                strType = "Blade";
                                if (boolBlade == false)
                                {
                                    if (strModelThreshold != "")
                                    {
                                        strModelThreshold += "<tr><td colspan=\"4\"><span style=\"width:100%;border-bottom:1 dotted #999999;\"/></td></tr>";
                                    }
                                    strModelThreshold += "<tr><td nowrap colspan=\"3\" class=\"bold\">" + strType + "</td><td nowrap align=\"center\" class=\"bold\">Thresholds</td></tr>";
                                    boolBlade          = true;
                                }
                            }
                            else if (intHost == 0)
                            {
                                strType = "Physical";
                                if (boolPhysical == false)
                                {
                                    if (strModelThreshold != "")
                                    {
                                        strModelThreshold += "<tr><td colspan=\"4\"><p>&nbsp;</p><p>&nbsp;</p></td></tr>";
                                    }
                                    strModelThreshold += "<tr><td colspan=\"4\" class=\"header\">" + drType["name"].ToString() + "</td></tr>";
                                    strModelThreshold += "<tr><td nowrap colspan=\"3\" class=\"bold\">" + strType + "</td><td nowrap align=\"center\" class=\"bold\">Thresholds</td></tr>";
                                    boolPhysical       = true;
                                }
                            }
                            else if (intOldHost != intHost)
                            {
                                strType = drModel["host"].ToString();
                                if (intHost > 0)
                                {
                                    if (strModelThreshold != "")
                                    {
                                        strModelThreshold += "<tr><td colspan=\"4\"><span style=\"width:100%;border-bottom:1 dotted #999999;\"/></td></tr>";
                                    }
                                    strModelThreshold += "<tr><td nowrap colspan=\"3\" class=\"bold\">" + strType + "</td><td nowrap align=\"center\" class=\"bold\">Thresholds</td></tr>";
                                    intOldHost         = intHost;
                                }
                            }
                            strModelThreshold += "<tr" + (boolOther ? " bgcolor=\"F6F6F6\"" : "") + " class=\"default\"><td nowrap><img src=\"/images/spacer.gif\" border=\"0\" width=\"10\" height=\"1\"/></td><td nowrap><input type=\"button\" class=\"default\" value=\"Edit\" onclick=\"return OpenWindow('MODEL_THRESHOLDS','?mid=" + drModel["id"].ToString() + "');\" style=\"width:75px\"/></td><td nowrap width=\"100%\">" + drModel["name"].ToString() + ":</td><td nowrap align=\"center\">" + oModelsProperties.GetThresholds(intModel, 1).Tables[0].Rows.Count.ToString() + "</td></tr>";
                        }
                    }
                }
            }
            btnMaximum.Attributes.Add("onclick", "return ValidateNumber0('" + txtMax1.ClientID + "','Please enter a valid number');");
        }
コード例 #11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile = Int32.Parse(Request.Cookies["profileid"].Value);
            oPage      = new Pages(intProfile, dsn);
            oPlatform  = new Platforms(intProfile, dsn);
            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);
            }
            lblTitle.Text = oPage.Get(intPage, "title");
            if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
            {
                intPlatform = Int32.Parse(Request.QueryString["id"]);
            }
            bool Access = false;
            // Load Platforms
            DataSet ds = oPlatform.GetInventorys(intProfile, 1);

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                if (intPlatform == Int32.Parse(dr["platformid"].ToString()))
                {
                    strPlatforms += "<td><img src=\"/images/arrow_red.gif\" border=\"0\" align=\"absmiddle\" /></td><td><a class=\"greentableheader\" onclick=\"LoadWait();\" href=\"" + oPage.GetFullLink(intPage) + "?id=" + dr["platformid"].ToString() + "\">" + dr["name"].ToString() + "</a></td>";
                    Access        = true;
                }
                else
                {
                    strPlatforms += "<td><img src=\"/images/arrow_green.gif\" border=\"0\" align=\"absmiddle\" /></td><td><a class=\"greentableheader\" onclick=\"LoadWait();\" href=\"" + oPage.GetFullLink(intPage) + "?id=" + dr["platformid"].ToString() + "\">" + dr["name"].ToString() + "</a></td>";
                }
            }
            strPlatforms = "<table cellpadding=\"3\" cellspacing=\"1\" border=\"0\">" + strPlatforms + "</table>";
            if (intPlatform == 0 || Access == false)
            {
                panSelect.Visible = true;
            }
            else
            {
                panShow.Visible = true;
                bool boolStart = false;
                strActionForm = oPlatform.Get(intPlatform, "action_form");
                if (strActionForm != "")
                {
                    if (Request.QueryString["div"] == "A" || (Request.QueryString["div"] == null && boolStart == false))
                    {
                        boolAction = true;
                        boolStart  = true;
                    }
                    PHAction.Controls.Add((Control)LoadControl(strActionForm));
                    if (boolAction == true)
                    {
                        strTabs += "<td><img src=\"/images/TabOnLeftCap.gif\"></td><td nowrap background=\"/images/TabOnBackground.gif\"><a id=\"aTab1\" href=\"javascript:void(0);\" onclick=\"ChangeTab(this,'divTab1',null,null,true);setTabvalue(1);\" class=\"tabheader\">Action Required</a></td><td><img src=\"/images/TabOnRightCap.gif\"></td>";
                    }
                    else
                    {
                        strTabs += "<td><img src=\"/images/TabOffLeftCap.gif\"></td><td nowrap background=\"/images/TabOffBackground.gif\"><a id=\"aTab1\" href=\"javascript:void(0);\" onclick=\"ChangeTab(this,'divTab1',null,null,true);setTabvalue(1);\" class=\"tabheader\">Action Required</a></td><td><img src=\"/images/TabOffRightCap.gif\"></td>";
                    }
                }
                strDemandForm = oPlatform.Get(intPlatform, "demand_form");
                if (strDemandForm != "")
                {
                    if (Request.QueryString["div"] == "D" || (Request.QueryString["div"] == null && boolStart == false))
                    {
                        boolDemand = true;
                        boolStart  = true;
                    }
                    PHDemand.Controls.Add((Control)LoadControl(strDemandForm));
                    if (boolDemand == true)
                    {
                        strTabs += "<td><img src=\"/images/TabOnLeftCap.gif\"></td><td nowrap background=\"/images/TabOnBackground.gif\"><a id=\"aTab2\" href=\"javascript:void(0);\" onclick=\"ChangeTab(this,'divTab2',null,null,true);setTabvalue(2);\" class=\"tabheader\">Demand</a></td><td><img src=\"/images/TabOnRightCap.gif\"></td>";
                    }
                    else
                    {
                        strTabs += "<td><img src=\"/images/TabOffLeftCap.gif\"></td><td nowrap background=\"/images/TabOffBackground.gif\"><a id=\"aTab2\" href=\"javascript:void(0);\" onclick=\"ChangeTab(this,'divTab2',null,null,true);setTabvalue(2);\" class=\"tabheader\">Demand</a></td><td><img src=\"/images/TabOffRightCap.gif\"></td>";
                    }
                }
                strSupplyForm = oPlatform.Get(intPlatform, "supply_form");
                if (strSupplyForm != "")
                {
                    if (Request.QueryString["div"] == "S" || (Request.QueryString["div"] == null && boolStart == false))
                    {
                        boolSupply = true;
                        boolStart  = true;
                    }
                    PHSupply.Controls.Add((Control)LoadControl(strSupplyForm));
                    if (boolSupply == true)
                    {
                        strTabs += "<td><img src=\"/images/TabOnLeftCap.gif\"></td><td nowrap background=\"/images/TabOnBackground.gif\"><a id=\"aTab3\" href=\"javascript:void(0);\" onclick=\"ChangeTab(this,'divTab3',null,null,true);setTabvalue(3);\" class=\"tabheader\">Supply</a></td><td><img src=\"/images/TabOnRightCap.gif\"></td>";
                    }
                    else
                    {
                        strTabs += "<td><img src=\"/images/TabOffLeftCap.gif\"></td><td nowrap background=\"/images/TabOffBackground.gif\"><a id=\"aTab3\" href=\"javascript:void(0);\" onclick=\"ChangeTab(this,'divTab3',null,null,true);setTabvalue(3);\" class=\"tabheader\">Supply</a></td><td><img src=\"/images/TabOffRightCap.gif\"></td>";
                    }
                }
                strOrderForm = oPlatform.Get(intPlatform, "order_form");
                if (strOrderForm != "")
                {
                    if (Request.QueryString["div"] == "O" || (Request.QueryString["div"] == null && boolStart == false))
                    {
                        boolOrder = true;
                        boolStart = true;
                    }
                    PHOrder.Controls.Add((Control)LoadControl(strOrderForm));
                    if (boolOrder == true)
                    {
                        strTabs += "<td><img src=\"/images/TabOnLeftCap.gif\"></td><td nowrap background=\"/images/TabOnBackground.gif\"><a id=\"aTab4\" href=\"javascript:void(0);\" onclick=\"ChangeTab(this,'divTab4',null,null,true); setTabvalue(4);\" class=\"tabheader\">New Order</a></td><td><img src=\"/images/TabOnRightCap.gif\"></td>";
                    }
                    else
                    {
                        strTabs += "<td><img src=\"/images/TabOffLeftCap.gif\"></td><td nowrap background=\"/images/TabOffBackground.gif\"><a id=\"aTab4\" href=\"javascript:void(0);\" onclick=\"ChangeTab(this,'divTab4',null,null,true); setTabvalue(4);\" class=\"tabheader\">New Order</a></td><td><img src=\"/images/TabOffRightCap.gif\"></td>";
                    }
                }

                strOrderViewForm = oPlatform.Get(intPlatform, "order_view_form");
                if (strOrderViewForm != "")
                {
                    if (Request.QueryString["div"] == "V" || (Request.QueryString["div"] == null && boolStart == false))
                    {
                        boolOrderView = true;
                        boolStart     = true;
                    }
                    PHOrderView.Controls.Add((Control)LoadControl(strOrderViewForm));
                    if (boolOrderView == true)
                    {
                        strTabs += "<td><img src=\"/images/TabOnLeftCap.gif\"></td><td nowrap background=\"/images/TabOnBackground.gif\"><a id=\"aTab5\" href=\"javascript:void(0);\" onclick=\"ChangeTab(this,'divTab5',null,null,true) ;setTabvalue(5);\" class=\"tabheader\">View Orders</a></td><td><img src=\"/images/TabOnRightCap.gif\"></td>";
                    }
                    else
                    {
                        strTabs += "<td><img src=\"/images/TabOffLeftCap.gif\"></td><td nowrap background=\"/images/TabOffBackground.gif\"><a id=\"aTab5\" href=\"javascript:void(0);\" onclick=\"ChangeTab(this,'divTab5',null,null,true);setTabvalue(5);\" class=\"tabheader\">View Orders</a></td><td><img src=\"/images/TabOffRightCap.gif\"></td>";
                    }
                }
                strAddForm = oPlatform.Get(intPlatform, "add_form");
                if (strAddForm != "")
                {
                    if (Request.QueryString["div"] == "N" || (Request.QueryString["div"] == null && boolStart == false))
                    {
                        boolAdd   = true;
                        boolStart = true;
                    }
                    PHAdd.Controls.Add((Control)LoadControl(strAddForm));
                    if (boolAdd == true)
                    {
                        strTabs += "<td><img src=\"/images/TabOnLeftCap.gif\"></td><td nowrap background=\"/images/TabOnBackground.gif\"><a href=\"javascript:void(0);\" onclick=\"ChangeTab(this,'divTab6',null,null,true);setTabvalue(6);\" class=\"tabheader\">Deploy</a></td><td><img src=\"/images/TabOnRightCap.gif\"></td>";
                    }
                    else
                    {
                        strTabs += "<td><img src=\"/images/TabOffLeftCap.gif\"></td><td nowrap background=\"/images/TabOffBackground.gif\"><a href=\"javascript:void(0);\" onclick=\"ChangeTab(this,'divTab6',null,null,true);setTabvalue(6);\" class=\"tabheader\">Deploy</a></td><td><img src=\"/images/TabOffRightCap.gif\"></td>";
                    }
                }
                strSettingsForm = oPlatform.Get(intPlatform, "settings_form");
                if (strSettingsForm != "")
                {
                    if (Request.QueryString["div"] == "T" || (Request.QueryString["div"] == null && boolStart == false))
                    {
                        boolSettings = true;
                        boolStart    = true;
                    }
                    PHSettings.Controls.Add((Control)LoadControl(strSettingsForm));
                    if (boolSettings == true)
                    {
                        strTabs += "<td><img src=\"/images/TabOnLeftCap.gif\"></td><td nowrap background=\"/images/TabOnBackground.gif\"><a href=\"javascript:void(0);\" onclick=\"ChangeTab(this,'divTab7',null,null,true);setTabvalue(7);\" class=\"tabheader\">Settings</a></td><td><img src=\"/images/TabOnRightCap.gif\"></td>";
                    }
                    else
                    {
                        strTabs += "<td><img src=\"/images/TabOffLeftCap.gif\"></td><td nowrap background=\"/images/TabOffBackground.gif\"><a href=\"javascript:void(0);\" onclick=\"ChangeTab(this,'divTab7',null,null,true);setTabvalue(7);\" class=\"tabheader\">Settings</a></td><td><img src=\"/images/TabOffRightCap.gif\"></td>";
                    }
                }
                strFormForm = oPlatform.Get(intPlatform, "forms_form");
                if (strFormForm != "")
                {
                    if (Request.QueryString["div"] == "F" || (Request.QueryString["div"] == null && boolStart == false))
                    {
                        boolForms = true;
                        boolStart = true;
                    }
                    PHForms.Controls.Add((Control)LoadControl(strFormForm));
                    if (boolForms == true)
                    {
                        strTabs += "<td><img src=\"/images/TabOnLeftCap.gif\"></td><td nowrap background=\"/images/TabOnBackground.gif\"><a href=\"javascript:void(0);\" onclick=\"ChangeTab(this,'divTab8',null,null,true);setTabvalue(8);\" class=\"tabheader\">Forms</a></td><td><img src=\"/images/TabOnRightCap.gif\"></td>";
                    }
                    else
                    {
                        strTabs += "<td><img src=\"/images/TabOffLeftCap.gif\"></td><td nowrap background=\"/images/TabOffBackground.gif\"><a href=\"javascript:void(0);\" onclick=\"ChangeTab(this,'divTab8',null,null,true);setTabvalue(8);\" class=\"tabheader\">Forms</a></td><td><img src=\"/images/TabOffRightCap.gif\"></td>";
                    }
                }
                strAlertForm = oPlatform.Get(intPlatform, "alert_form");
                if (strAlertForm != "")
                {
                    if (Request.QueryString["div"] == "X" || (Request.QueryString["div"] == null && boolStart == false))
                    {
                        boolAlert = true;
                        boolStart = true;
                    }
                    PHAlert.Controls.Add((Control)LoadControl(strAlertForm));
                    if (boolAlert == true)
                    {
                        strTabs += "<td><img src=\"/images/TabOnLeftCap.gif\"></td><td nowrap background=\"/images/TabOnBackground.gif\"><a href=\"javascript:void(0);\" onclick=\"ChangeTab(this,'divTab9',null,null,true);setTabvalue(9);\" class=\"tabheader\">Alerts</a></td><td><img src=\"/images/TabOnRightCap.gif\"></td>";
                    }
                    else
                    {
                        strTabs += "<td><img src=\"/images/TabOffLeftCap.gif\"></td><td nowrap background=\"/images/TabOffBackground.gif\"><a href=\"javascript:void(0);\" onclick=\"ChangeTab(this,'divTab9',null,null,true);setTabvalue(9);\" class=\"tabheader\">Alerts</a></td><td><img src=\"/images/TabOffRightCap.gif\"></td>";
                    }
                }
                if (Request.QueryString["div"] == "U" || (Request.QueryString["div"] == null && boolStart == false))
                {
                    boolSecurity = true;
                    boolStart    = true;
                }
                if (boolSecurity == true)
                {
                    strTabs += "<td><img src=\"/images/TabOnLeftCap.gif\"></td><td nowrap background=\"/images/TabOnBackground.gif\"><a href=\"javascript:void(0);\" onclick=\"ChangeTab(this,'divTab10',null,null,true);setTabvalue(10);\" class=\"tabheader\">Security</a></td><td><img src=\"/images/TabOnRightCap.gif\"></td>";
                }
                else
                {
                    strTabs += "<td><img src=\"/images/TabOffLeftCap.gif\"></td><td nowrap background=\"/images/TabOffBackground.gif\"><a href=\"javascript:void(0);\" onclick=\"ChangeTab(this,'divTab10',null,null,true);setTabvalue(10);\" class=\"tabheader\">Security</a></td><td><img src=\"/images/TabOffRightCap.gif\"></td>";
                }
                Variables oVariable = new Variables(intEnvironment);
                txtAdministrator.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'300','195','" + divAdministrator.ClientID + "','" + lstAdministrator.ClientID + "','" + hdnAdministrator.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);");
                lstAdministrator.Attributes.Add("ondblclick", "AJAXClickRow();");
                rptAdministrators.DataSource = oPlatform.GetUsers(intPlatform);
                rptAdministrators.DataBind();
                lblAdministrators.Visible = (rptAdministrators.Items.Count == 0);
                btnAdministrator.Attributes.Add("onclick", "return ValidateHidden0('" + hdnAdministrator.ClientID + "','" + txtAdministrator.ClientID + "','Please enter the LAN ID of the administrator') && ProcessButton(this) && LoadWait();");
            }
        }
コード例 #12
0
 protected void Page_Load(object sender, EventArgs e)
 {
     intProfile = Int32.Parse(Request.Cookies["profileid"].Value);
     oPage      = new Pages(intProfile, dsn);
     oPlatform  = new Platforms(intProfile, dsn);
     oAsset     = new Asset(intProfile, dsnAsset);
     oVariable  = new Variables(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["import"] != null && Request.QueryString["import"] != "")
     {
         Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "imported", "<script type=\"text/javascript\">alert('Asset import has finished!\\n\\nAn email has been sent to you with the results of this import.');window.navigate('" + oPage.GetFullLink(intPage) + "?pid=" + Request.QueryString["pid"] + "');<" + "/" + "script>");
     }
     if (Request.QueryString["pid"] != null && Request.QueryString["pid"] != "")
     {
         btnTemplate.Attributes.Add("onclick", "return OpenWindow('ASSETIMPORT', '" + oPlatform.Get(Int32.Parse(Request.QueryString["pid"]), "asset_checkin_path_excel") + "');");
     }
     btnImport.Attributes.Add("onclick", "return ValidateText('" + oFile.ClientID + "','Please select a file to import');");
 }
コード例 #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile        = Int32.Parse(Request.Cookies["profileid"].Value);
            oPlatform         = new Platforms(intProfile, dsn);
            oType             = new Types(intProfile, dsn);
            oModelsProperties = new ModelsProperties(intProfile, dsn);
            oAsset            = new Asset(intProfile, dsnAsset);
            oServiceRequest   = new ServiceRequests(intProfile, dsn);
            oForecast         = new Forecast(intProfile, dsn);
            oHost             = new Host(intProfile, dsn);
            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);
            }
            int intPlatform = 0;

            if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
            {
                intPlatform = Int32.Parse(Request.QueryString["id"]);
            }
            if (intPlatform > 0)
            {
                intMax = Int32.Parse(oPlatform.Get(intPlatform, "max_inventory1"));
                if (!IsPostBack)
                {
                    DataSet dsTypes = oType.Gets(intPlatform, 1);
                    foreach (DataRow drType in dsTypes.Tables[0].Rows)
                    {
                        bool    boolPhysical = false;
                        bool    boolBlade    = false;
                        bool    boolOther    = false;
                        int     intOldHost   = -1;
                        DataSet dsModels     = oModelsProperties.GetTypes(1, Int32.Parse(drType["id"].ToString()), 1);
                        foreach (DataRow drModel in dsModels.Tables[0].Rows)
                        {
                            boolOther = !boolOther;
                            int intBlade = Int32.Parse(drModel["blade"].ToString());
                            int intHost  = -1;
                            if (drModel["hostid"].ToString() != "")
                            {
                                intHost = Int32.Parse(drModel["hostid"].ToString());
                            }
                            string strType = "Unknown";
                            if (intBlade == 1)
                            {
                                strType = "Blade";
                                if (boolBlade == false)
                                {
                                    if (strSupply != "")
                                    {
                                        strSupply += "<tr><td colspan=\"4\"><span style=\"width:100%;border-bottom:1 dotted #999999;\"/></td></tr>";
                                    }
                                    strSupply += "<tr><td colspan=\"4\" class=\"bold\">" + strType + "</td></tr>";
                                    boolBlade  = true;
                                }
                            }
                            else if (intHost == 0)
                            {
                                strType = "Physical";
                                if (boolPhysical == false)
                                {
                                    if (strSupply != "")
                                    {
                                        strSupply += "<tr><td colspan=\"4\"><p>&nbsp;</p><p>&nbsp;</p></td></tr>";
                                    }
                                    strSupply   += "<tr><td colspan=\"4\" class=\"header\">" + drType["name"].ToString() + "</td></tr>";
                                    strSupply   += "<tr><td colspan=\"4\" class=\"bold\">" + strType + "</td></tr>";
                                    boolPhysical = true;
                                }
                            }
                            else if (intOldHost != intHost)
                            {
                                strType = drModel["host"].ToString();
                                if (intHost > 0)
                                {
                                    if (strSupply != "")
                                    {
                                        strSupply += "<tr><td colspan=\"4\"><span style=\"width:100%;border-bottom:1 dotted #999999;\"/></td></tr>";
                                    }
                                    strSupply += "<tr><td colspan=\"4\" class=\"bold\">" + strType + "</td></tr>";
                                    intOldHost = intHost;
                                }
                            }
                            int intModel = Int32.Parse(drModel["id"].ToString());
                            // Supply
                            DataSet dsModel = oAsset.GetCount(intModel, (int)AssetStatus.Available);
                            if (intHost == 0)
                            {
                                int intSupply = dsModel.Tables[0].Rows.Count;
                                strSupply += "<tr" + (boolOther ? " bgcolor=\"F6F6F6\"" : "") + "><td nowrap><img src=\"/images/spacer.gif\" border=\"0\" width=\"10\" height=\"1\"/></td><td nowrap>" + (intSupply == 0 ? drModel["name"].ToString() : "<a href=\"javascript:void(0);\" onclick=\"OpenWindow('INVENTORY_SUPPLY','?model=" + drModel["id"].ToString() + "&status=1');\">" + drModel["name"].ToString() + "</a>") + ":</td><td width=\"100%\">" + oServiceRequest.GetStatusBarFill(((double.Parse(intSupply.ToString()) / double.Parse(intMax.ToString())) * 100.00), "95", false, "#6699CC") + "</td><td nowrap>" + intSupply.ToString() + "</td></tr>";
                            }
                            else
                            {
                                DataSet dsHosts      = oAsset.GetVMWareHosts(intHost);
                                double  dblRAM       = 0.0;
                                double  dblProcessor = 0.0;
                                double  dblDiskSpace = 0.0;
                                foreach (DataRow drHost in dsHosts.Tables[0].Rows)
                                {
                                    dblRAM       += double.Parse(drHost["ram"].ToString());
                                    dblProcessor += double.Parse(drHost["cpu_count"].ToString());
                                }
                                DataSet dsHostStorage = oAsset.GetVMWareHostsStorage(intHost);
                                foreach (DataRow drHostStorage in dsHostStorage.Tables[0].Rows)
                                {
                                    dblDiskSpace += double.Parse(drHostStorage["l_actual_size"].ToString());
                                    dblDiskSpace += double.Parse(drHostStorage["l_actual_size_qa"].ToString());
                                    dblDiskSpace += double.Parse(drHostStorage["l_actual_size_test"].ToString());
                                    dblDiskSpace += double.Parse(drHostStorage["m_actual_size"].ToString());
                                    dblDiskSpace += double.Parse(drHostStorage["m_actual_size_qa"].ToString());
                                    dblDiskSpace += double.Parse(drHostStorage["m_actual_size_test"].ToString());
                                }
                                strSupply += "<tr" + (boolOther ? " bgcolor=\"F6F6F6\"" : "") + " class=\"" + (dblRAM > 0.00 ? "greendefault" : (dblRAM < 0.00 ? "reddefault" : "default")) + "\"><td nowrap><img src=\"/images/spacer.gif\" border=\"0\" width=\"10\" height=\"1\"/></td><td nowrap>RAM:</td><td width=\"100%\">" + oServiceRequest.GetStatusBarFill(((dblRAM / double.Parse(intMax.ToString())) * 100.00), "95", false, "#CC3300") + "</td><td nowrap>" + dblRAM.ToString() + " GB</td></tr>";
                                strSupply += "<tr" + (boolOther ? " bgcolor=\"F6F6F6\"" : "") + " class=\"" + (dblProcessor > 0.00 ? "greendefault" : (dblProcessor < 0.00 ? "reddefault" : "default")) + "\"><td nowrap><img src=\"/images/spacer.gif\" border=\"0\" width=\"10\" height=\"1\"/></td><td nowrap>Processors:</td><td width=\"100%\">" + oServiceRequest.GetStatusBarFill(((dblProcessor / double.Parse(intMax.ToString())) * 100.00), "95", false, "#CC3300") + "</td><td nowrap>" + dblProcessor.ToString() + "</td></tr>";
                                strSupply += "<tr" + (boolOther ? " bgcolor=\"F6F6F6\"" : "") + " class=\"" + (dblDiskSpace > 0.00 ? "greendefault" : (dblDiskSpace < 0.00 ? "reddefault" : "default")) + "\"><td nowrap><img src=\"/images/spacer.gif\" border=\"0\" width=\"10\" height=\"1\"/></td><td nowrap>Disk Space:</td><td width=\"100%\">" + oServiceRequest.GetStatusBarFill(((dblDiskSpace / double.Parse(intMax.ToString())) * 100.00), "95", false, "#CC3300") + "</td><td nowrap>" + dblDiskSpace.ToString() + " GB</td></tr>";
                            }
                        }
                    }
                }
            }
        }
コード例 #14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            StringBuilder sb = new StringBuilder();

            intProfile        = Int32.Parse(Request.Cookies["profileid"].Value);
            oPlatform         = new Platforms(intProfile, dsn);
            oType             = new Types(intProfile, dsn);
            oModelsProperties = new ModelsProperties(intProfile, dsn);
            oAsset            = new Asset(intProfile, dsnAsset);
            oServiceRequest   = new ServiceRequests(intProfile, dsn);
            oForecast         = new Forecast(intProfile, dsn);
            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);
            }
            int intPlatform = 0;

            if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
            {
                intPlatform = Int32.Parse(Request.QueryString["id"]);
            }
            if (intPlatform > 0)
            {
                intMax = Int32.Parse(oPlatform.Get(intPlatform, "max_inventory1"));
                if (!IsPostBack)
                {
                    DataSet dsTypes = oType.Gets(intPlatform, 1);
                    foreach (DataRow drType in dsTypes.Tables[0].Rows)
                    {
                        bool    boolPhysical = false;
                        bool    boolBlade    = false;
                        bool    boolOther    = false;
                        int     intOldHost   = -1;
                        DataSet dsModels     = oModelsProperties.GetTypes(1, Int32.Parse(drType["id"].ToString()), 1);
                        foreach (DataRow drModel in dsModels.Tables[0].Rows)
                        {
                            boolOther = !boolOther;
                            int intBlade = Int32.Parse(drModel["blade"].ToString());
                            int intHost  = -1;
                            if (drModel["hostid"].ToString() != "")
                            {
                                intHost = Int32.Parse(drModel["hostid"].ToString());
                            }
                            string strType = "Unknown";
                            if (intBlade == 1)
                            {
                                strType = "Blade";
                                if (boolBlade == false)
                                {
                                    if (sb.ToString() != "")
                                    {
                                        sb.Append("<tr><td colspan=\"4\"><span style=\"width:100%;border-bottom:1 dotted #999999;\"/></td></tr>");
                                    }
                                    sb.Append("<tr><td colspan=\"4\" class=\"bold\">");
                                    sb.Append(strType);
                                    sb.Append("</td></tr>");
                                    boolBlade = true;
                                }
                            }
                            else if (intHost == 0)
                            {
                                strType = "Physical";
                                if (boolPhysical == false)
                                {
                                    if (sb.ToString() != "")
                                    {
                                        sb.Append("<tr><td colspan=\"4\"><p>&nbsp;</p><p>&nbsp;</p></td></tr>");
                                    }
                                    sb.Append("<tr><td colspan=\"4\" class=\"header\">");
                                    sb.Append(drType["name"].ToString());
                                    sb.Append("</td></tr>");
                                    sb.Append("<tr><td colspan=\"4\" class=\"bold\">");
                                    sb.Append(strType);
                                    sb.Append("</td></tr>");
                                    boolPhysical = true;
                                }
                            }
                            else if (intOldHost != intHost)
                            {
                                strType = drModel["host"].ToString();
                                if (intHost > 0)
                                {
                                    if (sb.ToString() != "")
                                    {
                                        sb.Append("<tr><td colspan=\"4\"><span style=\"width:100%;border-bottom:1 dotted #999999;\"/></td></tr>");
                                    }
                                    sb.Append("<tr><td colspan=\"4\" class=\"bold\">");
                                    sb.Append(strType);
                                    sb.Append("</td></tr>");
                                    intOldHost = intHost;
                                }
                            }
                            int intModel = Int32.Parse(drModel["id"].ToString());
                            // Supply
                            DataSet dsModel   = oAsset.GetCount(intModel, (int)AssetStatus.Available);
                            int     intSupply = dsModel.Tables[0].Rows.Count;
                            sb.Append("<tr");
                            sb.Append(boolOther ? " bgcolor=\"F6F6F6\"" : "");
                            sb.Append("><td nowrap><img src=\"/images/spacer.gif\" border=\"0\" width=\"10\" height=\"1\"/></td><td nowrap>");
                            sb.Append(intSupply == 0 ? drModel["name"].ToString() : "<a href=\"javascript:void(0);\" onclick=\"OpenWindow('INVENTORY_SUPPLY','?model=" + drModel["id"].ToString() + "&status=1');\">" + drModel["name"].ToString() + "</a>");
                            sb.Append(":</td><td width=\"100%\">");
                            sb.Append(oServiceRequest.GetStatusBarFill(((double.Parse(intSupply.ToString()) / double.Parse(intMax.ToString())) * 100.00), "95", false, "#6699CC"));
                            sb.Append("</td><td nowrap>");
                            sb.Append(intSupply.ToString());
                            sb.Append("</td></tr>");
                        }
                    }
                }
            }

            strSupply = sb.ToString();
        }
コード例 #15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile        = Int32.Parse(Request.Cookies["profileid"].Value);
            oPlatform         = new Platforms(intProfile, dsn);
            oType             = new Types(intProfile, dsn);
            oModelsProperties = new ModelsProperties(intProfile, dsn);
            oServiceRequest   = new ServiceRequests(intProfile, dsn);
            oDesign           = new Design(intProfile, dsn);
            oPage             = new Pages(intProfile, dsn);
            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);
            }
            int intPlatform = 0;

            if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
            {
                intPlatform = Int32.Parse(Request.QueryString["id"]);
            }
            if (intPlatform > 0)
            {
                intMax = Int32.Parse(oPlatform.Get(intPlatform, "max_inventory1"));
                if (!IsPostBack)
                {
                    dsDemand = oDesign.GetForecast();
                    if (Request.QueryString["projectid"] != null && Request.QueryString["projectid"] != "")
                    {
                    }
                    else
                    {
                        DateTime _today = DateTime.Today;
                        if (Request.QueryString["change"] != null && Request.QueryString["change"] != "")
                        {
                            _today = DateTime.Parse(Request.QueryString["change"]);
                        }
                        panCalendar.Visible = true;
                        LoadLists();
                        LoadFilters();
                        calThis.VisibleDate    = _today;
                        calThis.SelectedDate   = _today;
                        ddlYear.SelectedValue  = _today.Year.ToString();
                        ddlMonth.SelectedValue = _today.Month.ToString();
                    }
                }
                btnProjects.Attributes.Add("onclick", "return MakeWider(this, '" + lstProjects.ClientID + "');");
                btnProjectsClear.Attributes.Add("onclick", "return ClearList('" + lstProjects.ClientID + "');");
                btnClasses.Attributes.Add("onclick", "return MakeWider(this, '" + lstClasses.ClientID + "');");
                btnClassesClear.Attributes.Add("onclick", "return ClearList('" + lstClasses.ClientID + "');");
                btnConfidences.Attributes.Add("onclick", "return MakeWider(this, '" + lstConfidences.ClientID + "');");
                btnConfidencesClear.Attributes.Add("onclick", "return ClearList('" + lstConfidences.ClientID + "');");
                btnEnvironments.Attributes.Add("onclick", "return MakeWider(this, '" + lstEnvironments.ClientID + "');");
                btnEnvironmentsClear.Attributes.Add("onclick", "return ClearList('" + lstEnvironments.ClientID + "');");
                btnLocations.Attributes.Add("onclick", "return MakeWider(this, '" + lstLocations.ClientID + "');");
                btnLocationsClear.Attributes.Add("onclick", "return ClearList('" + lstLocations.ClientID + "');");
                lstClasses.Attributes.Add("onchange", "PopulateEnvironmentsList('" + lstClasses.ClientID + "','" + lstEnvironments.ClientID + "',0);");
                lstEnvironments.Attributes.Add("onchange", "UpdateListHidden('" + lstEnvironments.ClientID + "','" + hdnEnvironment.ClientID + "');");
                imgStart.Attributes.Add("onclick", "return ShowCalendar('" + txtStart.ClientID + "');");
                imgEnd.Attributes.Add("onclick", "return ShowCalendar('" + txtEnd.ClientID + "');");
            }
        }