Esempio n. 1
0
        private void LoadTab(int tab)
        {
            Tab oTab = new Tab("", tab, "divMenu1", true, false);

            oTab.AddTab("Details", "");
            oTab.AddTab("History", "");
            strMenuTab1 = oTab.GetTabs();
        }
        private void LoadSolutions()
        {
            Tab oTab = new Tab("", 0, "divMenu1", true, false);

            rptRelated.DataSource = oError.Gets(lblSolution.Text, 0);
            rptRelated.DataBind();
            int intTab = 0;

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

            btnSave.Attributes.Add("onclick", "return ProcessButton(this);");
            btnFix.Attributes.Add("onclick", "return ValidateText('" + txtProblem.ClientID + "','Please enter the problem') && ValidateText('" + txtResolution.ClientID + "','Please enter the resolution') && ValidateDropDown('" + ddlType.ClientID + "','Please select a case code') && confirm('Are you sure you want to mark this error as fixed?') && ProcessButton(this);");
            btnSolution.Attributes.Add("onclick", "ShowHideDiv('" + trSolution.ClientID + "','inline');return false;");
            btnNone.Attributes.Add("onclick", "return confirm('Are you sure you do not want to associate this error with any solution?');");
        }
Esempio n. 3
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);
            oFunction  = new Functions(intProfile, dsn, intEnvironment);

            if (oUser.IsAdmin(intProfile) == true || (oDataPoint.GetPagePermission(intApplication, "PEOPLE") == true || intDataPointAvailablePeople == 1))
            {
                if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
                {
                    intUserId = Int32.Parse(oFunction.decryptQueryString(Request.QueryString["id"]));
                    LoadData();
                }
                pnlAllow.Visible  = true;
                lblHeaderSub.Text = "Provides all the information about a resource...";
                //Tabs
                int intMenuTab = 0;

                Tab oTab = new Tab(hdnTab.ClientID, intMenuTab, "divMenu1", true, false);

                oTab.AddTab("Resource Information", "");
                oTab.AddTab("Service(s) Progression", "");
                oTab.AddTab("Resource(s) Involvement", "");
                oTab.AddTab("Personnel Asset", "");
                oTab.AddTab("Documents", "");
                oTab.AddTab("Raves", "");
                oTab.AddTab("Education and Certificates", "");
                oTab.AddTab("Blog", "");
                oTab.AddTab("Contact Information", "");

                strMenuTab1 = oTab.GetTabs();
            }
            else
            {
                pnlDenied.Visible = true;
            }
        }
Esempio n. 4
0
    private Task AddTab(Tab tabset)
    {
        var text = $"Tab {tabset.Items.Count() + 1}";

        tabset.AddTab(new Dictionary <string, object?>
        {
            [nameof(TabItem.Text)]         = text,
            [nameof(TabItem.IsActive)]     = true,
            [nameof(TabItem.ChildContent)] = new RenderFragment(builder =>
            {
                var index = 0;
                builder.OpenElement(index++, "div");
                builder.AddContent(index++, Localizer["BackAddTabText", text]);
                builder.CloseElement();
            })
        });
        return(Task.CompletedTask);
    }
        private void LoadIncidents()
        {
            Tab oTabIncidents = new Tab("", 0, "divMenu2", true, false);

            rptIncidents.DataSource = oIncident.Gets(lblIncident.Text);
            rptIncidents.DataBind();
            int intTabIncident = 0;

            foreach (RepeaterItem ri in rptIncidents.Items)
            {
                intTabIncident++;
                oTabIncidents.AddTab("Incident # " + intTabIncident.ToString(), "");
                ((Button)ri.FindControl("btnIncident")).Attributes.Add("onclick", "return confirm('Are you sure you want to select this incident to route?');");
            }
            strMenuTab2         = oTabIncidents.GetTabs();
            trIncidents.Visible = (rptIncidents.Items.Count == 0);

            btnIncident.Attributes.Add("onclick", "ShowHideDiv2('" + trIncident.ClientID + "');return false;");
        }
Esempio n. 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.Cookies["adminid"] != null && Request.Cookies["adminid"].Value != "")
            {
                intProfile = Int32.Parse(Request.Cookies["adminid"].Value);
            }
            else
            {
                Response.Redirect("/admin/login.aspx");
            }
            if (Request.QueryString["referrer"] != null && Request.QueryString["referrer"] != "")
            {
                strRedirect = Request.QueryString["referrer"];
            }
            else if (Request.Cookies["loginreferrer"] != null && Request.Cookies["loginreferrer"].Value != "")
            {
                strRedirect = Request.Cookies["loginreferrer"].Value;
            }
            Enhancements oEnhancement = new Enhancements(0, dsn);
            DataSet      ds           = oEnhancement.GetVersions(1);

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                if (dr["compiled"].ToString() != "")
                {
                    strPush += "<tr><td>" + dr["name"].ToString() + "</td><td>" + DateTime.Parse(dr["compiled"].ToString()).ToShortDateString() + "</td><td class=\"approved\">Success</td></tr>";
                }
            }
            Tab oTab = new Tab("", 0, "divMenu1", false, true);

            oTab.AddTab("Functions", "");
            oTab.AddTab("VMware", "");
            oTab.AddTab("General", "");
            oTab.AddTab("Asset", "");
            oTab.AddTab("Proj / Req", "");
            oTab.AddTab("Design", "");
            oTab.AddTab("Forecast", "");
            strMenuTab1 = oTab.GetTabs();
        }
Esempio n. 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            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);
            oServiceRequest  = new ServiceRequests(intProfile, dsn);
            oResourceRequest = new ResourceRequest(intProfile, dsn);
            oRequestItem     = new RequestItems(intProfile, dsn);
            oRequest         = new Requests(intProfile, dsn);
            oPage            = new Pages(intProfile, dsn);
            oService         = new Services(intProfile, dsn);
            oUser            = new Users(intProfile, dsn);
            oFunction        = new Functions(intProfile, dsn, intEnvironment);
            if (oUser.IsAdmin(intProfile) == true || (oDataPoint.GetPagePermission(intApplication, "SERVICE") == true || intDataPointAvailableService == 1))
            {
                panAllow.Visible = true;
                if (Request.QueryString["save"] != null)
                {
                    panSave.Visible = true;
                }
                if (Request.QueryString["cancel"] != null)
                {
                    panCancel.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"]);
                    intRequest = Int32.Parse(strID);
                    DataSet ds = oDataPoint.GetServiceRequest(intRequest);
                    if (ds.Tables[0].Rows.Count == 1)
                    {
                        // Load General Information
                        lblRequestID.Text = "#" + intRequest.ToString();
                        string strHeader = "CVT" + intRequest.ToString();
                        lblHeader.Text    = "&quot;" + strHeader + "&quot;";
                        Master.Page.Title = "DataPoint | Request (" + strHeader + ")";
                        lblHeaderSub.Text = "Provides all the information about a request...";
                        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("Request Information", "");
                        panDeleted.Visible = (ds.Tables[0].Rows[0]["deleted"].ToString() == "1");

                        if (!IsPostBack)
                        {
                            // General Information
                            int intRequestor = Int32.Parse(ds.Tables[0].Rows[0]["userid"].ToString());
                            oDataPoint.LoadDropDownAJAX(txtRequestBy, hdnRequestBy, divRequestBy, lstRequestBy, intEnvironment, intProfile, null, "", lblRequestBy, fldRequestBy, "REQUEST_BY", intRequestor, (intRequestor > 0 ? oUser.GetFullName(intRequestor) + " (" + oUser.GetName(intRequestor) + ")" : ""), "/frame/users.aspx", "", false, true);
                            oDataPoint.LoadTextBox(txtRequestOn, intProfile, null, "", lblRequestOn, fldRequestOn, "REQUEST_ON", ds.Tables[0].Rows[0]["created"].ToString(), "", false, true);
                            //oDataPoint.LoadTextBoxDate(txtRequestOn, imgRequestOn, intProfile, null, "", lblRequestOn, fldRequestOn, "REQUEST_ON", DateTime.Parse(ds.Tables[0].Rows[0]["created"].ToString()).ToShortDateString(), "", false, true);
                            oDataPoint.LoadTextBox(txtProjectNumber, intProfile, btnProjectName, "/datapoint/project/project.aspx?t=number&q=" + oFunction.encryptQueryString(ds.Tables[0].Rows[0]["project_number"].ToString()) + "&id=" + oFunction.encryptQueryString(ds.Tables[0].Rows[0]["projectid"].ToString()), lblProjectNumber, fldProjectNumber, "PROJECT_NUMBER", ds.Tables[0].Rows[0]["project_number"].ToString(), "", false, false);
                            oDataPoint.LoadTextBox(txtProjectName, intProfile, null, "", lblProjectName, fldProjectName, "PROJECT_NAME", ds.Tables[0].Rows[0]["project_name"].ToString(), "", false, false);
                            int intCheckout = 100;
                            if (ds.Tables[0].Rows[0]["checkout"].ToString() != "")
                            {
                                intCheckout = Int32.Parse(ds.Tables[0].Rows[0]["checkout"].ToString());
                            }
                            oDataPoint.LoadDropDown(ddlStatus, intProfile, null, "", lblStatus, fldStatus, "REQUEST_STATUS", "name", "id", SqlHelper.ExecuteDataset(dsn, CommandType.Text, "SELECT -2 AS id, 'Service Browser' AS name UNION ALL SELECT -1 AS id, 'Cart Summary' AS name UNION ALL SELECT 0 AS id, 'Completing Forms' AS name UNION ALL SELECT 1 AS id, 'Submitted' AS name UNION ALL SELECT 100 AS id, 'N / A   (no service request)' AS name"), intCheckout, true, false, true);
                            string strViewRequest = oPage.GetFullLink(intViewRequest);
                            if (strViewRequest != "")
                            {
                                lnkView.Attributes.Add("onclick", "return OpenNewWindowMenu('" + strViewRequest + "?rid=" + intRequest.ToString() + "', '800', '600');");
                            }
                            else
                            {
                                lnkView.Enabled = false;
                            }


                            // Service Request(s)
                            oTab.AddTab("Service Request(s)", "");
                            if (ds.Tables[1].Rows.Count > 0)
                            {
                                if (ds.Tables[2].Rows.Count > 0)
                                {
                                    ds.Relations.Add("relationship", ds.Tables[1].Columns["formid"], ds.Tables[2].Columns["formid"]);
                                }
                                rptServiceRequests.DataSource = ds.Tables[1];
                                rptServiceRequests.DataBind();
                                LoadRepeater(rptServiceRequests, strViewRequest);
                            }
                            lblServiceRequests.Visible = (rptServiceRequests.Items.Count == 0);

                            // Request Results
                            oTab.AddTab("Request Results", "");
                            DataSet dsResults = oRequest.GetResult(intRequest);
                            if (dsResults.Tables[0].Rows.Count > 0)
                            {
                                rptResults.DataSource = dsResults;
                                rptResults.DataBind();
                            }
                            lblResults.Visible = (rptResults.Items.Count == 0);

                            strMenuTab1 = oTab.GetTabs();
                        }
                    }
                    else
                    {
                        if (Request.QueryString["t"] != null && Request.QueryString["q"] != null)
                        {
                            Response.Redirect("/datapoint/service/datapoint_service_search.aspx?t=" + Request.QueryString["t"] + "&q=" + Request.QueryString["q"] + "&r=0");
                        }
                        else
                        {
                            Response.Redirect("/datapoint/service/datapoint_service_search.aspx");
                        }
                    }
                }
                else if (Request.QueryString["q"] != null && Request.QueryString["q"] != "")
                {
                    string  strQuery = oFunction.decryptQueryString(Request.QueryString["q"]);
                    DataSet ds       = oDataPoint.GetServiceRequest(strQuery);
                    if (ds.Tables[0].Rows.Count == 1)
                    {
                        intRequest = Int32.Parse(ds.Tables[0].Rows[0]["requestid"].ToString());
                        Response.Redirect(Request.Path + "?t=" + Request.QueryString["t"] + "&q=" + Request.QueryString["q"] + "&id=" + oFunction.encryptQueryString(intRequest.ToString()));
                    }
                }
                else
                {
                    Response.Redirect("/datapoint/service/datapoint_service_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());
            }
            else
            {
                panDenied.Visible = true;
            }
        }
Esempio n. 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Cookies["loginreferrer"].Value   = Request.Path;
            Response.Cookies["loginreferrer"].Expires = DateTime.Now.AddDays(30);
            if (Request.Cookies["adminid"] != null && Request.Cookies["adminid"].Value != "")
            {
                intProfile = Int32.Parse(Request.Cookies["adminid"].Value);
            }
            else
            {
                Response.Redirect("/admin/login.aspx");
            }
            oDesign   = new Design(intProfile, dsn);
            oFunction = new Functions(intProfile, dsn, intEnvironment);

            int intMenuTab = 0;

            if (Request.QueryString["menu_tab"] != null && Request.QueryString["menu_tab"] != "")
            {
                intMenuTab = Int32.Parse(Request.QueryString["menu_tab"]);
            }

            if (Request.QueryString["id"] == null)
            {
                if (Request.QueryString["add"] == null)
                {
                    LoopRepeater();
                }
                else
                {
                    if (!IsPostBack)
                    {
                        LoadLists();
                    }
                    panAdd.Visible    = true;
                    btnDelete.Enabled = false;
                }
            }
            else
            {
                if (!IsPostBack)
                {
                    LoadLists();
                }
                panAdd.Visible = true;
                intCondition   = Int32.Parse(Request.QueryString["id"]);
            }

            if (Request.QueryString["set"] != null)
            {
                intSet = Int32.Parse(Request.QueryString["set"]);
                if (intSet > 0)
                {
                    intMenuTab = 2;
                    if (!IsPostBack)
                    {
                        DataSet ds = oDesign.GetApprovalConditionalSet(intSet);
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            intCondition = Int32.Parse(ds.Tables[0].Rows[0]["approvalid"].ToString());
                            ddlFieldSet.SelectedValue = ds.Tables[0].Rows[0]["field"].ToString();
                            if (ds.Tables[0].Rows[0]["is_eq"].ToString() == "1")
                            {
                                ddlOperator.SelectedValue = "eq";
                            }
                            else if (ds.Tables[0].Rows[0]["is_neq"].ToString() == "1")
                            {
                                ddlOperator.SelectedValue = "neq";
                            }
                            else if (ds.Tables[0].Rows[0]["is_lt"].ToString() == "1")
                            {
                                ddlOperator.SelectedValue = "lt";
                            }
                            else if (ds.Tables[0].Rows[0]["is_lte"].ToString() == "1")
                            {
                                ddlOperator.SelectedValue = "lte";
                            }
                            else if (ds.Tables[0].Rows[0]["is_gt"].ToString() == "1")
                            {
                                ddlOperator.SelectedValue = "gt";
                            }
                            else if (ds.Tables[0].Rows[0]["is_gte"].ToString() == "1")
                            {
                                ddlOperator.SelectedValue = "gte";
                            }
                            else if (ds.Tables[0].Rows[0]["is_in"].ToString() == "1")
                            {
                                ddlOperator.SelectedValue = "in";
                            }
                            else if (ds.Tables[0].Rows[0]["is_nin"].ToString() == "1")
                            {
                                ddlOperator.SelectedValue = "nin";
                            }
                            else if (ds.Tables[0].Rows[0]["is_ends"].ToString() == "1")
                            {
                                ddlOperator.SelectedValue = "ends";
                            }
                            else if (ds.Tables[0].Rows[0]["is_starts"].ToString() == "1")
                            {
                                ddlOperator.SelectedValue = "starts";
                            }
                            txtValue.Text = ds.Tables[0].Rows[0]["value"].ToString();
                            if (ds.Tables[0].Rows[0]["dt_int"].ToString() == "1")
                            {
                                radTypeInt.Checked = true;
                            }
                            else if (ds.Tables[0].Rows[0]["dt_date"].ToString() == "1")
                            {
                                radTypeDateTime.Checked = true;
                            }
                            else
                            {
                                radTypeString.Checked = true;
                            }
                            txtOr.Text        = ds.Tables[0].Rows[0]["or_group"].ToString();
                            btnDelete.Visible = true;
                            btnCancel.Visible = true;
                            btnSetAdd.Text    = "Update";
                        }
                    }
                }
            }

            Tab oTab = new Tab(hdnTab.ClientID, intMenuTab, "divMenu1", true, false);

            oTab.AddTab("Details", "");

            if (intCondition > 0 && !IsPostBack)
            {
                DataSet ds = oDesign.GetApprovalConditional(intCondition);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    oTab.AddTab("Condition Sets", "");
                    rptSets.DataSource = oDesign.GetApprovalConditionalSets(intCondition);
                    rptSets.DataBind();

                    hdnId.Value  = intCondition.ToString();
                    txtName.Text = litName.Text = ds.Tables[0].Rows[0]["name"].ToString();
                    if (String.IsNullOrEmpty(ds.Tables[0].Rows[0]["approve_by_field"].ToString()) == false)
                    {
                        ddlField.Enabled        = true;
                        ddlField.SelectedValue  = ds.Tables[0].Rows[0]["approve_by_field"].ToString();
                        radApproveField.Checked = true;
                    }
                    else
                    {
                        int intGroup = 0;
                        if (Int32.TryParse(ds.Tables[0].Rows[0]["approve_by_group"].ToString(), out intGroup) && intGroup > 0)
                        {
                            ddlGroup.Enabled        = true;
                            ddlGroup.SelectedValue  = intGroup.ToString();
                            radApproveGroup.Checked = true;
                        }
                        else
                        {
                            radApproveRequestor.Checked = (ds.Tables[0].Rows[0]["approve_by_requestor"].ToString() == "1");
                            radApproveAppOwner.Checked  = (ds.Tables[0].Rows[0]["approve_by_app_owner"].ToString() == "1");
                            radApproveATL.Checked       = (ds.Tables[0].Rows[0]["approve_by_atl"].ToString() == "1");
                            radApproveASM.Checked       = (ds.Tables[0].Rows[0]["approve_by_asm"].ToString() == "1");
                            radApproveSD.Checked        = (ds.Tables[0].Rows[0]["approve_by_sd"].ToString() == "1");
                            radApproveDM.Checked        = (ds.Tables[0].Rows[0]["approve_by_dm"].ToString() == "1");
                            radApproveCIO.Checked       = (ds.Tables[0].Rows[0]["approve_by_cio"].ToString() == "1");
                        }
                    }
                    chkEnabled.Checked = (ds.Tables[0].Rows[0]["enabled"].ToString() == "1");
                }
            }

            strMenuTab1 = oTab.GetTabs();
            btnOrder.Attributes.Add("onclick", "return OpenWindow('SUPPORTORDER','" + hdnId.ClientID + "','" + hdnOrder.ClientID + "&type=DESIGN_APPROVE_CONDITION" + "',false,400,400);");
            btnDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this item?');");
        }
Esempio 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();
                }
            }
        }
Esempio n. 10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile      = Int32.Parse(Request.Cookies["profileid"].Value);
            oPage           = new Pages(intProfile, dsn);
            oRequestItem    = new RequestItems(intProfile, dsn);
            oRequest        = new Requests(intProfile, dsn);
            oRequestField   = new RequestFields(intProfile, dsn);
            oApplication    = new Applications(intProfile, dsn);
            oAccountRequest = new AccountRequest(intProfile, dsn);
            oUser           = new Users(intProfile, dsn);
            oDomain         = new Domains(intProfile, dsn);
            oFunction       = new Functions(intProfile, dsn, intEnvironment);

            //Menus
            int intMenuTab = 0;

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

            //Tab oTab = new Tab(hdnType.ClientID, intMenuTab, "divMenu1", true, false);

            oTab.AddTab("Account Properties", "");
            oTab.AddTab("Group Memberships", "");
            strMenuTab1 = oTab.GetTabs();

            //End Menus

            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["rid"] != "" && Request.QueryString["rid"] != null)
            {
                LoadValues();
                int    intItem        = Int32.Parse(lblItem.Text);
                int    intApp         = oRequestItem.GetItemApplication(intItem);
                string strDeliverable = oApplication.Get(intApp, "deliverables_doc");
                if (strDeliverable != "")
                {
                    panDeliverable.Visible = true;
                    btnDeliverable.Attributes.Add("onclick", "return OpenWindow('NEW_WINDOW','" + strDeliverable + "');");
                }
                if (!IsPostBack)
                {
                    ddlDomain.DataValueField = "id";
                    ddlDomain.DataTextField  = "name";
                    ddlDomain.DataSource     = oDomain.GetsAccountMaintenance(0, 1);
                    ddlDomain.DataBind();
                    ddlDomain.Items.Insert(0, new ListItem("-- SELECT --", "0"));
                }
                if (Request.QueryString["u"] != null && Request.QueryString["u"] != "" && Request.QueryString["d"] != null && Request.QueryString["d"] != "")
                {
                    if (!IsPostBack)
                    {
                        LoadObjects();
                    }
                    btnNext.Attributes.Add("onclick", "return ValidateText('" + txtFirst.ClientID + "','Please enter a first name')" +
                                           " && ValidateText('" + txtLast.ClientID + "','Please enter a last name')" +
                                           " && ValidateText('" + txtPassword1.ClientID + "','Please enter the password')" +
                                           " && ValidateText('" + txtPassword2.ClientID + "','Please enter the password')" +
                                           " && ValidatePasswords('" + txtPassword1.ClientID + "','" + txtPassword2.ClientID + "','Passwords do not match.\\n\\nPlease retype the passwords')" +
                                           " && ValidatePassword('" + txtPassword1.ClientID + "','Your password does not meet the following conditions\\n\\n- Must be at least 6 characters long\\n- Must contain at least one number')" +
                                           ";");
                }
                else
                {
                    btnNext.Enabled = false;
                }
                btnContinue.Attributes.Add("onclick", "return ValidateText('" + txtID.ClientID + "','Please enter a user ID')" +
                                           " && ValidateDropDown('" + ddlDomain.ClientID + "','Please select a domain')" +
                                           ";");
            }
            btnCancel1.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this service request?');");
        }
        private void LoadWorkstationErrors()
        {
            panError.Visible = true;
            DataSet ds = oWorkstation.GetVirtualErrorsByRequest(intRequest, intNumber);

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                int intAsset = 0;
                if (dr["assetid"].ToString() != "")
                {
                    intAsset = Int32.Parse(dr["assetid"].ToString());
                }

                lblAsset.Text = intAsset.ToString();
                lblStep.Text  = dr["step"].ToString();
                lblError.Text = dr["reason"].ToString();

                if (dr["fixed"].ToString() != "")
                {
                    strError += "<tr class=\"deletedRow\">";
                    strError += "<td></td>";
                }
                else
                {
                    strError += "<tr>";
                    strError += "<td></td>";
                }
                strError += "<td>" + dr["workstationname"].ToString() + "</td>";
                strError += "<td>" + dr["reason"].ToString() + "</td>";
                strError += "<td>" + oUser.GetFullName(dr["xid"].ToString()) + "</td>";
                strError += "<td>" + dr["name"].ToString() + "</td>";
                strError += "<td>" + DateTime.Parse(dr["created"].ToString()).ToString() + "</td>";
                strError += "</tr>";
            }
            strError = "<table cellpadding=\"3\" cellspacing=\"2\" width=\"100%\" border=\"0\" style=\"border:solid 1px #CCCCCC\"><tr bgcolor=\"#EEEEEE\"><td><b></b></td><td><b>Workstation Name</b></td><td><b>Reason</b></td><td><b>Requestor</b></td><td><b>Nickname</b></td><td><b>Created</b></td></tr>" + strError + "</table>";
            //strError = "";
            Tab oTab = new Tab("", 0, "divMenu1", true, false);

            rptRelated.DataSource = oError.Gets(lblError.Text, 0);
            rptRelated.DataBind();
            int intTab = 0;

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

            btnApplyNewSolution.Attributes.Add("onclick", "return ValidateText('" + txtProblem.ClientID + "','Please enter the problem') && ValidateText('" + txtResolution.ClientID + "','Please enter the resolution') && ValidateDropDown('" + ddlCauseCode.ClientID + "','Please select a cause code') && confirm('Are you sure you want to mark this error as fixed?') && ProcessButton(this);");
            btnNewSolution.Attributes.Add("onclick", "ShowHideDiv('" + trSolution.ClientID + "','inline');return false;");
            btnNoSolution.Attributes.Add("onclick", "return confirm('Are you sure you do not want to associate this error with any solution?');");
        }
Esempio n. 12
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;
            }
        }
Esempio n. 13
0
        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();
        }
Esempio n. 14
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);
            oResourceRequest = new ResourceRequest(intProfile, dsn);
            oRequest         = new Requests(intProfile, dsn);
            oService         = new Services(intProfile, dsn);
            oServiceDetail   = new ServiceDetails(intProfile, dsn);
            oServiceRequest  = new ServiceRequests(intProfile, dsn);
            oApplication     = new Applications(intProfile, dsn);
            oRequestItem     = new RequestItems(intProfile, dsn);
            oFunction        = new Functions(intProfile, dsn, intEnvironment);
            oStatusLevel     = new StatusLevels();
            oProjectNumber   = new ProjectNumber(intProfile, dsn);
            oPage            = new Pages(intProfile, dsn);
            oLog             = new Log(intProfile, dsn);
            if (oUser.IsAdmin(intProfile) == true || (oDataPoint.GetPagePermission(intApplication, "SERVICE") == true || intDataPointAvailableService == 1))
            {
                panAllow.Visible = true;
                if (Request.QueryString["save"] != null)
                {
                    panSave.Visible = true;
                }
                if (Request.QueryString["clear"] != null)
                {
                    panClear.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"]);
                    intResource = Int32.Parse(strID);
                    DataSet ds = oDataPoint.GetServiceRequestResource(intResource);
                    if (ds.Tables[0].Rows.Count == 1)
                    {
                        // Load General Information

                        //string strHeader = intResource.ToString();
                        string strHeader = ds.Tables[0].Rows[0]["requestid"].ToString()
                                           + "-" + (ds.Tables[0].Rows[0]["ServiceId"] != DBNull.Value?ds.Tables[0].Rows[0]["ServiceId"].ToString():"0")
                                           + "-" + (ds.Tables[0].Rows[0]["number"] != DBNull.Value ? ds.Tables[0].Rows[0]["number"].ToString() : "0");

                        lblRequestID.Text    = strHeader;
                        lblRequestID.ToolTip = "Resource Request :" + intResource.ToString();

                        lblHeader.Text    = "&quot;" + strHeader + "&quot;";
                        Master.Page.Title = "DataPoint | Request (" + strHeader + ")";
                        lblHeaderSub.Text = "Provides all the information about a resource request...";
                        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("Submitted Information", "");
                        oTab.AddTab("Workflow / History", "");
                        oTab.AddTab("Resource(s) Involvement", "");
                        if (oUser.IsAdmin(intProfile) == true)
                        {
                            trAdmin.Visible = true;
                            Variables oVariable = new Variables(intEnvironment);
                            txtUser.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'300','195','" + divUser.ClientID + "','" + lstUser.ClientID + "','" + hdnUser.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);");
                            lstUser.Attributes.Add("ondblclick", "AJAXClickRow();");
                            oTab.AddTab("Resource Detail", "");
                            divDetail.Visible = true;
                        }

                        if (!IsPostBack)
                        {
                            strOriginal = oResourceRequest.GetSummary(intResource, 0, intEnvironment, dsnServiceEditor, dsnAsset, dsnIP);

                            bool boolDeleted = (ds.Tables[0].Rows[0]["deleted"].ToString() != "0");
                            panDeleted.Visible = boolDeleted;
                            int intRequest   = Int32.Parse(ds.Tables[0].Rows[0]["requestid"].ToString());
                            int intRequestor = oRequest.GetUser(intRequest);
                            strRequestor = "<a href=\"javascript:void(0);\" class=\"lookup\" onclick=\"OpenWindow('PROFILE','?userid=" + intRequestor.ToString() + "');\">" + oUser.GetFullName(intRequestor) + " [" + oUser.GetName(intRequestor) + "]</a>";
                            int intItem    = Int32.Parse(ds.Tables[0].Rows[0]["itemid"].ToString());
                            int intApp     = oRequestItem.GetItemApplication(intItem);
                            int intService = Int32.Parse(ds.Tables[0].Rows[0]["serviceid"].ToString());
                            int intNumber  = Int32.Parse(ds.Tables[0].Rows[0]["number"].ToString());
                            // General Information
                            oDataPoint.LoadTextBox(txtRequest, intProfile, null, "/datapoint/service/request.aspx?t=id&q=" + oFunction.encryptQueryString("CVT" + intRequest.ToString()) + "&id=" + oFunction.encryptQueryString(intRequest.ToString()), lblRequest, fldRequest, "RESOURCE_REQUEST", "CVT" + ds.Tables[0].Rows[0]["requestid"].ToString(), "", true, false);
                            oDataPoint.LoadTextBox(txtCreated, intProfile, null, "", lblCreated, fldCreated, "RESOURCE_CREATED", ds.Tables[0].Rows[0]["created"].ToString(), "", true, false);
                            oDataPoint.LoadTextBox(txtDepartment, intProfile, null, "", lblDepartment, fldDepartment, "RESOURCE_DEPARTMENT", ds.Tables[0].Rows[0]["department"].ToString(), "", true, false);
                            oDataPoint.LoadTextBox(txtService, intProfile, null, "", lblService, fldService, "RESOURCE_SERVICE", oService.GetName(intService), "", true, false);
                            string  strOwner = "";
                            DataSet dsOwner  = oService.GetUser(intService, -1); // Service Owners
                            foreach (DataRow drOwner in dsOwner.Tables[0].Rows)
                            {
                                if (strOwner != "")
                                {
                                    strOwner += ", ";
                                }
                                int intOwner = Int32.Parse(drOwner["userid"].ToString());
                                strOwner += "<span class=\"required\">*</span> <a href=\"javascript:void(0);\" class=\"lookup\" onclick=\"OpenWindow('PROFILE','?userid=" + intOwner.ToString() + "');\">" + oUser.GetFullName(intOwner) + " [" + oUser.GetName(intOwner) + "]</a>";
                            }
                            //strOwner = "<b>" + strOwner + "</b>";
                            DataSet dsManager = oService.GetUser(intService, 1);  // Managers
                            foreach (DataRow drManager in dsManager.Tables[0].Rows)
                            {
                                if (strOwner != "")
                                {
                                    strOwner += ", ";
                                }
                                int intManager = Int32.Parse(drManager["userid"].ToString());
                                strOwner += "<a href=\"javascript:void(0);\" class=\"lookup\" onclick=\"OpenWindow('PROFILE','?userid=" + intManager.ToString() + "');\">" + oUser.GetFullName(intManager) + " [" + oUser.GetName(intManager) + "]</a>";
                            }
                            oDataPoint.LoadTextBox(txtOwner, intProfile, null, "", lblOwner, fldOwner, "RESOURCE_OWNER", strOwner, "", true, false);
                            oDataPoint.LoadTextBox(txtName, intProfile, null, "", lblName, fldName, "RESOURCE_NAME", ds.Tables[0].Rows[0]["name"].ToString(), "", false, true);
                            oDataPoint.LoadTextBox(txtDevices, intProfile, null, "", lblDevices, fldDevices, "RESOURCE_DEVICES", ds.Tables[0].Rows[0]["devices"].ToString(), "", false, true);
                            oDataPoint.LoadTextBox(txtAllocated, intProfile, null, "", lblAllocated, fldAllocated, "RESOURCE_ALLOCATED", ds.Tables[0].Rows[0]["allocated"].ToString(), "", false, true);
                            if (txtDevices.Visible == true && oService.Get(intService, "disable_hours") != "1")
                            {
                                txtAllocated.Enabled = false;
                                txtAllocated.ToolTip = intService.ToString();
                                panDynamic.Visible   = true;
                            }
                            int intAccepted = Int32.Parse(ds.Tables[0].Rows[0]["accepted"].ToString());
                            oDataPoint.LoadDropDown(ddlAccepted, intProfile, null, "", lblAccepted, fldAccepted, "REQUEST_ACCEPTED", "name", "id", SqlHelper.ExecuteDataset(dsn, CommandType.Text, "SELECT -1 AS id, 'No' AS name UNION ALL SELECT 0 AS id, 'Pending' AS name UNION ALL SELECT 1 AS id, 'Yes' AS name"), intAccepted, false, false, true);
                            oDataPoint.LoadDropDown(ddlStatus, intProfile, null, "", lblStatus, fldStatus, "REQUEST_STATUS", "name", "id", SqlHelper.ExecuteDataset(dsn, CommandType.Text, oStatusLevel.List()), Int32.Parse(ds.Tables[0].Rows[0]["status"].ToString()), false, false, true);
                            oDataPoint.LoadTextBox(txtReason, intProfile, null, "", lblReason, fldReason, "RESOURCE_REASON", ds.Tables[0].Rows[0]["reason"].ToString(), "", false, false);
                            int intAssigned = Int32.Parse(ds.Tables[0].Rows[0]["assignedby"].ToString());
                            oDataPoint.LoadDropDownAJAX(txtAssignedBy, hdnAssignedBy, divAssignedBy, lstAssignedBy, intEnvironment, intProfile, null, "", lblAssignedBy, fldAssignedBy, "RESOURCE_ASSIGNED", intAssigned, (intAssigned > 0 ? oUser.GetFullName(intAssigned) + " (" + oUser.GetName(intAssigned) + ")" : ""), "/frame/users.aspx", "", false, false);
                            oDataPoint.LoadTextBox(txtAssignedOn, intProfile, null, "", lblAssignedOn, fldAssignedOn, "RESOURCE_ASSIGNED", ds.Tables[0].Rows[0]["assigned"].ToString(), "", true, false);
                            btnAssign.Visible = oUser.IsAdmin(intProfile);
                            btnAssign.Enabled = (intAssigned > 0);

                            ucWorkflow.RequestID = intRequest;
                            ucWorkflow.ServiceID = intService;
                            ucWorkflow.Number    = intNumber;

                            ucResourceInvolvement.ResourceRequestId = intResource;
                            //if (ds.Tables[1].Rows.Count > 0)
                            //{
                            //    // Resource Assignment(s)
                            //    if (ds.Tables[2].Rows.Count > 0)
                            //        ds.Relations.Add("relationship", ds.Tables[1].Columns["id"], ds.Tables[2].Columns["id"]);
                            //    rptAssignments.DataSource = ds.Tables[1];
                            //    rptAssignments.DataBind();
                            //    foreach (RepeaterItem ri in rptAssignments.Items)
                            //    {
                            //        Label lblStatusR = (Label)ri.FindControl("lblStatusR");
                            //        int intStatus = Int32.Parse(lblStatusR.Text);
                            //        lblStatusR.Text = oStatusLevel.HTML(intStatus);
                            //        Label lblProgress = (Label)ri.FindControl("lblProgress");
                            //        double dblProgress = double.Parse(lblProgress.Text);
                            //        if (intStatus == 3)
                            //            dblProgress = 100.00;
                            //        if (intStatus < 1 || intStatus > 2)
                            //            lblProgress.Text = "---";
                            //        else
                            //        {
                            //            try
                            //            {
                            //                lblProgress.Text = oServiceRequest.GetStatusBar(dblProgress, "100", "12", true);
                            //            }
                            //            catch
                            //            {
                            //                lblProgress.Text = oServiceRequest.GetStatusBar(0.00, "100", "12", true);
                            //            }
                            //        }

                            //        Panel panDelete = (Panel)ri.FindControl("panDelete");
                            //        if (panDelete.ToolTip == "1")
                            //            panDelete.Visible = true;
                            //        else
                            //        {
                            //            Panel panEdit = (Panel)ri.FindControl("panEdit");
                            //            panEdit.Visible = true;
                            //            Button btnLogin = (Button)ri.FindControl("btnLogin");
                            //            btnLogin.Attributes.Add("onclick", "return OpenNewWindowMenu('/frame/resource_request.aspx?rrid=" + btnLogin.CommandArgument + "', '800', '600');");
                            //            Button btnEdit = (Button)ri.FindControl("btnEdit");
                            //            if (oUser.IsAdmin(intProfile) || oService.IsManager(intService, intProfile))
                            //                btnEdit.Attributes.Add("onclick", "return OpenNewWindowMenu('/datapoint/service/manager.aspx?id=" + btnEdit.CommandArgument + "', '800', '600');");
                            //            else
                            //                btnEdit.Enabled = false;
                            //            LinkButton btnMore = (LinkButton)ri.FindControl("btnMore");
                            //            btnMore.Attributes.Add("onclick", "ShowHideDiv2('div_" + btnMore.CommandArgument + "');return false;");
                            //            if (ds.Tables[2].Rows.Count > 0)
                            //                btnMore.Visible = true;
                            //        }
                            //    }
                            //}
                            //lblAssignments.Visible = (rptAssignments.Items.Count == 0);


                            // This should be the last tab to load
                            DataSet dsResults = oRequest.GetResult(intRequest, intItem, intNumber);
                            if (dsResults.Tables[0].Rows.Count > 0)
                            {
                                // Request Results
                                oTab.AddTab("Request Results", "");
                                divResults.Visible    = true;
                                rptResults.DataSource = dsResults;
                                rptResults.DataBind();
                            }
                            lblResults.Visible = (rptResults.Items.Count == 0);

                            strMenuTab1 = oTab.GetTabs();
                        }
                    }
                    else
                    {
                        Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "close", "<script type=\"text/javascript\">window.close();<" + "/" + "script>");
                    }
                }
                else
                {
                    Response.Redirect("/datapoint/service/datapoint_service_search.aspx");
                }
                btnAssign.Attributes.Add("onclick", "return confirm('Are you sure you want to put this request back in queue for assignment?');");
                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());
            }
            else
            {
                panDenied.Visible = true;
            }
        }
        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();");
        }
Esempio n. 16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Cookies["loginreferrer"].Value   = "/admin/sve_clusters.aspx";
            Response.Cookies["loginreferrer"].Expires = DateTime.Now.AddDays(30);
            if (Request.Cookies["adminid"] != null && Request.Cookies["adminid"].Value != "")
            {
                intProfile = Int32.Parse(Request.Cookies["adminid"].Value);
            }
            else
            {
                Response.Redirect("/admin/login.aspx");
            }
            oSolaris     = new Solaris(intProfile, dsn);
            oClass       = new Classes(intProfile, dsn);
            oIPAddresses = new IPAddresses(intProfile, dsnIP, dsn);
            oServer      = new Servers(intProfile, dsn);
            oLocation    = new Locations(intProfile, dsn);
            oResiliency  = new Resiliency(intProfile, dsn);
            if (!IsPostBack)
            {
                LoadLists();
            }

            if (Request.QueryString["id"] == null)
            {
                if (Request.QueryString["add"] == null)
                {
                    LoopRepeater();
                }
                else
                {
                    panAdd.Visible = true;
                }
            }
            else
            {
                if (Request.QueryString["save"] != null)
                {
                    panSave.Visible = true;
                }
                panAdd.Visible = true;
                intID          = Int32.Parse(Request.QueryString["id"]);
                if (intID > 0)
                {
                    if (!IsPostBack)
                    {
                        DataSet ds = oSolaris.GetSVECluster(intID);
                        txtName.Text        = ds.Tables[0].Rows[0]["name"].ToString();
                        chkDatabase.Checked = (ds.Tables[0].Rows[0]["db"].ToString() == "1");
                        int intClass = 0;
                        if (Int32.TryParse(ds.Tables[0].Rows[0]["classid"].ToString(), out intClass) == true)
                        {
                            ddlClass.SelectedValue = intClass.ToString();
                        }
                        ddlResiliency.SelectedValue = ds.Tables[0].Rows[0]["resiliencyid"].ToString();
                        chkAvailable.Checked        = (ds.Tables[0].Rows[0]["available"].ToString() == "1");
                        chkNetworks.Checked         = (ds.Tables[0].Rows[0]["networks"].ToString() == "1");
                        txtComments.Text            = ds.Tables[0].Rows[0]["comments"].ToString();
                        chkStorage.Checked          = (ds.Tables[0].Rows[0]["storage_allocated"].ToString() == "1");
                        chkTrunking.Checked         = (ds.Tables[0].Rows[0]["trunking"].ToString() == "1");
                        chkEnabled.Checked          = (ds.Tables[0].Rows[0]["enabled"].ToString() == "1");
                        btnAdd.Text = "Update";

                        // Load Networks
                        if (chkNetworks.Checked == false)
                        {
                            strNetworks = "<p><img src=\"/images/bigAlert.gif\" border=\"0\" align=\"absmiddle\"/> <b>This section is only available if the <i>SPECIFY NETWORK RANGES(S)</i> flag is checked</b></p>";
                        }
                        else
                        {
                            LoadClasses(oTreeNetworks, intClass);
                            oTreeNetworks.Attributes.Add("onclick", "OnCheckBoxCheckChanged(event)");
                        }
                        LoadLocations();
                        // Load Hosts
                        rptHosts.DataSource = oServer.GetSVEClusters(intID);
                        rptHosts.DataBind();
                    }
                }
                else
                {
                    btnDelete.Enabled = false;
                }
            }

            if (panAdd.Visible == true)
            {
                int intMenuTab = 0;
                if (Request.QueryString["menu_tab"] != null && Request.QueryString["menu_tab"] != "")
                {
                    intMenuTab = Int32.Parse(Request.QueryString["menu_tab"]);
                }
                Tab oTab = new Tab("", intMenuTab, "divMenu1", true, false);
                oTab.AddTab("Details", "");
                oTab.AddTab("Network Ranges", "");
                oTab.AddTab("Locations", "");
                oTab.AddTab("Current Hosts", "");
                strMenuTab1 = oTab.GetTabs();
            }

            btnDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this item?');");
            strLocation = oLocation.LoadDDL("ddlState", "ddlCity", "ddlAddress", hdnLocation.ClientID, 0, true, "ddlCommon");
        }
Esempio n. 17
0
        private void LoadInformation(int _request)
        {
            lblView.Text = oEnhancement.GetBody(intID, intEnvironment);
            if (intProject > 0)
            {
                lblName.Text   = oProject.Get(intProject, "name");
                lblNumber.Text = oProject.Get(intProject, "number");
                lblType.Text   = "Project";
            }
            else
            {
                lblName.Text   = oResourceRequest.GetWorkflow(_request, "name");
                lblNumber.Text = "CVT" + intRequest.ToString();
                lblType.Text   = "Task";
            }
            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("Enhancement Details", "");
            oTab.AddTab("Execution", "");


            int     intStep = 1;
            DataSet dsSteps = oEnhancement.GetSteps(intID, 0, 0);

            if (dsSteps.Tables[0].Rows.Count > 0)
            {
                intStep = Int32.Parse(dsSteps.Tables[0].Rows[0]["step"].ToString());
            }

            intStep = LoadStep(1, intStep, img1, null, tr1, tr1Done, lbl1, dsSteps);
            intStep = LoadStep(2, intStep, img2, tr2Wait, tr2, tr2Done, lbl2, dsSteps);
            intStep = LoadStep(3, intStep, img3, tr3Wait, tr3, tr3Done, lbl3, dsSteps);
            intStep = LoadStep(4, intStep, img4, tr4Wait, tr4, tr4Done, lbl4, dsSteps);
            intStep = LoadStep(5, intStep, img5, tr5Wait, tr5, tr5Done, lbl5, dsSteps);
            intStep = LoadStep(6, intStep, img6, tr6Wait, tr6, tr6Done, lbl6, dsSteps);

            DataSet dsDocuments = oEnhancement.GetDocuments(intID);

            // Step # 1
            switch (intStep)
            {
            case 1:
                btnSave.Attributes.Add("onclick", "return (document.getElementById('" + chk1.ClientID + "').checked == true)" +
                                       " || (document.getElementById('" + chk1.ClientID + "').checked == false" +
                                       " && ValidateText('" + filFunctional.ClientID + "','Select a functional requirement document')" +
                                       " && ValidateNumber0('" + txtDays.ClientID + "','Enter a valid number for the estimated date range')" +
                                       " && ValidateRadioList('" + radEstimate.ClientID + "','Make a selection for your estimated release date')" +
                                       ") && ProcessControlButton() && LoadWait()" +
                                       ";");
                break;

            case 2:
                rptApprovers.DataSource = oEnhancement.GetApprovalResults(intID, intStep);
                rptApprovers.DataBind();
                lblApprovers.Visible = (rptApprovers.Items.Count == 0);
                btnApprovalGroup.Attributes.Add("onclick", "return OpenWindow('ENHANCEMENT_APPROVAL_GROUPS','?enhancementid=" + intID.ToString() + "&step=" + intStep.ToString() + "');");
                break;

            case 3:
                if (dsDocuments.Tables[0].Rows.Count > 0)
                {
                    lblEstimate.Text = dsDocuments.Tables[0].Rows[0]["release"].ToString();
                }
                ;
                radEstimateYes.Attributes.Add("onclick", "ShowHideDiv('" + divEstimate.ClientID + "','none');");
                radEstimateNo.Attributes.Add("onclick", "ShowHideDiv('" + divEstimate.ClientID + "','inline');");
                btnSave.Attributes.Add("onclick", "return ValidateRadioButtons('" + radEstimateYes.ClientID + "','" + radEstimateNo.ClientID + "','Select whether or not the estimated release date is OK')" +
                                       " && (document.getElementById('" + radEstimateYes.ClientID + "').checked == true || (document.getElementById('" + radEstimateNo.ClientID + "').checked == true && ValidateRadioList('" + radRelease.ClientID + "','Make a selection for your estimated release date')))" +
                                       " && ProcessControlButton() && LoadWait()" +
                                       ";");
                break;
            }

            strMessages = oEnhancement.GetMessages(intID, false, "#E1FFE1");
            oTab.AddTab("Message Thread (" + oEnhancement.GetMessages(intID).Tables[0].Rows.Count.ToString() + ")", "");

            rptDocuments.DataSource = dsDocuments;
            rptDocuments.DataBind();
            lblDocuments.Visible = (rptDocuments.Items.Count == 0);
            foreach (RepeaterItem ri in rptDocuments.Items)
            {
                LinkButton _delete = (LinkButton)ri.FindControl("btnDeleteDocument");
                _delete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this document?');");
            }
            oTab.AddTab("Functional Requirements Documentation (" + rptDocuments.Items.Count.ToString() + ")", "");
            oTab.AddTab("Log (" + oEnhancement.LoadLog(intID, rptLog, lblLog) + ")", "");
            oTab.AddTab("Release Notes", "");
            strMenuTab1 = oTab.GetTabs();
        }
Esempio n. 18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile        = Int32.Parse(Request.Cookies["profileid"].Value);
            oForecast         = new Forecast(intProfile, dsn);
            oPlatform         = new Platforms(intProfile, dsn);
            oModelsProperties = new ModelsProperties(intProfile, dsn);
            oLocation         = new Locations(intProfile, dsn);
            oClass            = new Classes(intProfile, dsn);


            //Menus
            int intMenuTab = 0;

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

            //Tab oTab = new Tab(hdnType.ClientID, intMenuTab, "divMenu1", true, false);
            oTab.AddTab("Backup Inclusions", "");
            oTab.AddTab("Backup Exclusions", "");
            oTab.AddTab("Archive Requirements", "");
            oTab.AddTab("Additional Configuration", "");
            strMenuTab1 = oTab.GetTabs();
            //End Menus

            if (Request.QueryString["parent"] != null && Request.QueryString["parent"] != "")
            {
                intForecast = Int32.Parse(Request.QueryString["parent"]);
            }
            if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
            {
                intID = Int32.Parse(Request.QueryString["id"]);
            }
            if (Request.QueryString["step"] != null && Request.QueryString["step"] != "")
            {
                panUpdate.Visible = true;
            }
            else
            {
                panNavigation.Visible = true;
            }
            if (!IsPostBack)
            {
                LoadList();
            }
            if (intID > 0)
            {
                DataSet ds = oForecast.GetAnswer(intID);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    int intClass   = Int32.Parse(ds.Tables[0].Rows[0]["classid"].ToString());
                    int intAddress = Int32.Parse(ds.Tables[0].Rows[0]["addressid"].ToString());

                    bool boolHundred   = false;
                    int  intConfidence = Int32.Parse(ds.Tables[0].Rows[0]["confidenceid"].ToString());
                    if (intConfidence > 0)
                    {
                        Confidence oConfidence   = new Confidence(intProfile, dsn);
                        string     strConfidence = oConfidence.Get(intConfidence, "name");
                        if (strConfidence.Contains("100%") == true)
                        {
                            boolHundred = true;
                        }
                    }
                    if (boolHundred == true)
                    {
                        panUpdate.Visible     = false;
                        panNavigation.Visible = false;
                        btnHundred.Visible    = true;
                    }
                    int intPlatform = Int32.Parse(ds.Tables[0].Rows[0]["platformid"].ToString());
                    int intStep     = Int32.Parse(ds.Tables[0].Rows[0]["step"].ToString());
                    intForecast = Int32.Parse(ds.Tables[0].Rows[0]["forecastid"].ToString());
                    DataSet dsSteps = oForecast.GetSteps(intPlatform, 1);
                    if (dsSteps.Tables[0].Rows.Count == intStep)
                    {
                        btnNext.Text = "Finish";
                    }
                    if (intStep == 0 || intStep == 1)
                    {
                        btnBack.Enabled = false;
                    }
                    int intModel = oForecast.GetModel(intID);
                    if (intModel > 0)
                    {
                        panContinue.Visible = true;
                        Types oType   = new Types(intProfile, dsn);
                        int   intType = oModelsProperties.GetType(intModel);
                        if (oType.GetPlatform(intType) == intSharedPlatform)
                        {
                            panShared.Visible        = true;
                            rptRetention2.DataSource = oForecast.GetBackupRetentions(intID);
                            rptRetention2.DataBind();
                            foreach (RepeaterItem ri in rptRetention2.Items)
                            {
                                ((LinkButton)ri.FindControl("btnDeleteRetention")).Attributes.Add("onclick", "return confirm('Are you sure you want to delete this retention requirement?');");
                            }
                            lblNoneRetention2.Visible = (rptRetention2.Items.Count == 0);
                            btnAddRetention2.Attributes.Add("onclick", "return OpenWindow('BACKUP_RETENTION','?id=" + intID.ToString() + "');");
                        }
                        else
                        {
                            panNonShared.Visible = true;
                            bool boolProduction = oClass.IsProd(Int32.Parse(ds.Tables[0].Rows[0]["classid"].ToString()));
                            bool boolNone       = (ds.Tables[0].Rows[0]["backup"].ToString() == "-2");
                            if (boolProduction == true)
                            {
                                if (boolNone == true)
                                {
                                    divYes.Style["display"] = "inline";
                                }
                                //if (oLocation.GetAddress(intAddress, "common") == "1")
                                //{
                                //    // Only Data Centers require backups
                                //    radNo.Enabled = false;
                                //    radNo.ToolTip = "All production bound servers in a data center require a backup";
                                //}
                            }
                            if (!IsPostBack)
                            {
                                if (Request.QueryString["child"] != null)
                                {
                                    radYes.Checked          = true;
                                    divYes.Style["display"] = "inline";
                                    if (Request.QueryString["daily"] != null)
                                    {
                                        chkDaily.Checked = true;
                                    }
                                    if (Request.QueryString["weekly"] != null)
                                    {
                                        chkWeekly.Checked          = true;
                                        divWeekly.Style["display"] = "inline";
                                        ddlWeekly.Enabled          = true;
                                        ddlWeekly.SelectedIndex    = Int32.Parse(Request.QueryString["week"]);
                                    }
                                    if (Request.QueryString["monthly"] != null)
                                    {
                                        chkMonthly.Checked = true;
                                    }
                                    ddlTimeHour.Enabled         = true;
                                    ddlTimeHour.SelectedIndex   = Int32.Parse(Request.QueryString["hour"]);
                                    ddlTimeSwitch.Enabled       = true;
                                    ddlTimeSwitch.SelectedIndex = Int32.Parse(Request.QueryString["switch"]);
                                    txtDate.Text = Request.QueryString["date"];
                                    ddlLocation.SelectedIndex = Int32.Parse(Request.QueryString["location"]);
                                }
                                else if (ds.Tables[0].Rows[0]["backup"].ToString() == "1")
                                {
                                    radYes.Checked = true;
                                    ds             = oForecast.GetBackup(intID);
                                    if (ds.Tables[0].Rows.Count > 0)
                                    {
                                        divYes.Style["display"] = "inline";
                                        if (ds.Tables[0].Rows[0]["daily"].ToString() == "1")
                                        {
                                            chkDaily.Checked = true;
                                        }
                                        if (ds.Tables[0].Rows[0]["weekly"].ToString() == "1")
                                        {
                                            chkWeekly.Checked          = true;
                                            divWeekly.Style["display"] = "inline";
                                            if (ds.Tables[0].Rows[0]["weekly_day"].ToString() != "None")
                                            {
                                                ddlWeekly.Enabled       = true;
                                                ddlWeekly.SelectedValue = ds.Tables[0].Rows[0]["weekly_day"].ToString();
                                            }
                                        }
                                        if (ds.Tables[0].Rows[0]["monthly"].ToString() == "1")
                                        {
                                            chkMonthly.Checked = true;
                                            //divMonthly.Style["display"] = "inline";
                                            //if (ds.Tables[0].Rows[0]["monthly_day"].ToString() != "None")
                                            //{
                                            //    ddlMonthlyDay.Enabled = true;
                                            //    ddlMonthlyDays.Enabled = true;
                                            //    ddlMonthlyDay.SelectedValue = ds.Tables[0].Rows[0]["monthly_day"].ToString();
                                            //    ddlMonthlyDays.SelectedValue = ds.Tables[0].Rows[0]["monthly_days"].ToString();
                                            //}
                                        }
                                        if (ds.Tables[0].Rows[0]["time"].ToString() == "1")
                                        {
                                            ddlTimeHour.Enabled         = true;
                                            ddlTimeSwitch.Enabled       = true;
                                            ddlTimeHour.SelectedValue   = ds.Tables[0].Rows[0]["time_hour"].ToString();
                                            ddlTimeSwitch.SelectedValue = ds.Tables[0].Rows[0]["time_switch"].ToString();
                                        }
                                        txtDate.Text = ds.Tables[0].Rows[0]["start_date"].ToString();
                                        ddlLocation.SelectedValue  = ds.Tables[0].Rows[0]["recoveryid"].ToString();
                                        txtCFPercent.Text          = ds.Tables[0].Rows[0]["cf_percent"].ToString();
                                        txtCFCompression.Text      = ds.Tables[0].Rows[0]["cf_compression"].ToString();
                                        ddlCFAverage.SelectedValue = ds.Tables[0].Rows[0]["cf_average"].ToString();
                                        txtCFBackup.Text           = ds.Tables[0].Rows[0]["cf_backup"].ToString();
                                        txtCFArchive.Text          = ds.Tables[0].Rows[0]["cf_archive"].ToString();
                                        txtCFWindow.Text           = ds.Tables[0].Rows[0]["cf_window"].ToString();
                                        txtCFSets.Text             = ds.Tables[0].Rows[0]["cf_sets"].ToString();
                                        ddlCDType.SelectedValue    = ds.Tables[0].Rows[0]["cd_type"].ToString();
                                        txtCDPercent.Text          = ds.Tables[0].Rows[0]["cd_percent"].ToString();
                                        txtCDCompression.Text      = ds.Tables[0].Rows[0]["cd_compression"].ToString();
                                        txtCDVersions.Text         = ds.Tables[0].Rows[0]["cd_versions"].ToString();
                                        txtCDWindow.Text           = ds.Tables[0].Rows[0]["cd_window"].ToString();
                                        txtCDGrowth.Text           = ds.Tables[0].Rows[0]["cd_growth"].ToString();
                                    }
                                }
                                else if (ds.Tables[0].Rows[0]["backup"].ToString() == "-1")
                                {
                                    radLater.Checked = true;
                                }
                                else if (ds.Tables[0].Rows[0]["backup"].ToString() == "0")
                                {
                                    radNo.Checked = true;
                                }
                                else if (boolProduction == true && boolNone == true)
                                {
                                    radYes.Checked = true;
                                }

                                rptExclusions.DataSource = oForecast.GetBackupExclusions(intID);
                                rptExclusions.DataBind();

                                foreach (RepeaterItem ri in rptExclusions.Items)
                                {
                                    ((LinkButton)ri.FindControl("btnDeleteExclusion")).Attributes.Add("onclick", "return confirm('Are you sure you want to delete this exclusion?');");
                                }
                                lblNoneExclusions.Visible = (rptExclusions.Items.Count == 0);

                                // Vijay code - start
                                rptInclusions.DataSource = oForecast.GetBackupInclusions(intID);
                                rptInclusions.DataBind();

                                foreach (RepeaterItem ri in rptInclusions.Items)
                                {
                                    ((LinkButton)ri.FindControl("btnDeleteInclusion")).Attributes.Add("onclick", "return confirm('Are you sure you want to delete this inclusion?');");
                                }
                                lblNoneInclusions.Visible = (rptInclusions.Items.Count == 0);
                                // Vijay code - end

                                rptRetention.DataSource = oForecast.GetBackupRetentions(intID);
                                rptRetention.DataBind();
                                foreach (RepeaterItem ri in rptRetention.Items)
                                {
                                    ((LinkButton)ri.FindControl("btnDeleteRetention")).Attributes.Add("onclick", "return confirm('Are you sure you want to delete this archive requirement?');");
                                }
                                lblNoneRetention.Visible = (rptRetention.Items.Count == 0);
                            }
                            if (boolProduction == true)
                            {
                                radNo.Attributes.Add("onclick", "ShowHideDiv('" + divNo.ClientID + "','inline');ShowHideDiv('" + divYes.ClientID + "','none');");
                            }
                            else
                            {
                                radNo.Attributes.Add("onclick", "ShowHideDiv('" + divYes.ClientID + "','none');");
                            }
                            radLater.Attributes.Add("onclick", "ShowHideDiv('" + divYes.ClientID + "','none');ShowHideDiv('" + divNo.ClientID + "','none');");
                            radYes.Attributes.Add("onclick", "ShowHideDiv('" + divYes.ClientID + "','inline');ShowHideDiv('" + divNo.ClientID + "','none');");

                            // Vijay code - start
                            chkDaily.Attributes.Add("onclick", "ForeBackCheck(this);");
                            chkWeekly.Attributes.Add("onclick", "ForeBackCheck(this);");
                            chkMonthly.Attributes.Add("onclick", "ForeBackCheck(this);");
                            // Vijay code - end

                            btnNext.Attributes.Add("onclick", "return EnsureBackup('" + radYes.ClientID + "','" + chkDaily.ClientID + "','" + chkWeekly.ClientID + "','" + ddlWeekly.ClientID + "','" + chkMonthly.ClientID + "','" + ddlMonthlyDay.ClientID + "','" + ddlMonthlyDays.ClientID + "','" + ddlTimeHour.ClientID + "','" + ddlTimeSwitch.ClientID + "','" + txtDate.ClientID + "','" + ddlLocation.ClientID + "');");
                            btnUpdate.Attributes.Add("onclick", "return EnsureBackup('" + radYes.ClientID + "','" + chkDaily.ClientID + "','" + chkWeekly.ClientID + "','" + ddlWeekly.ClientID + "','" + chkMonthly.ClientID + "','" + ddlMonthlyDay.ClientID + "','" + ddlMonthlyDays.ClientID + "','" + ddlTimeHour.ClientID + "','" + ddlTimeSwitch.ClientID + "','" + txtDate.ClientID + "','" + ddlLocation.ClientID + "');");
                            btnClose.Attributes.Add("onclick", "return window.close();");
                            btnAddExclusion.Attributes.Add("onclick", "return OpenWindow('BACKUP_EXCLUSION','?id=" + intID.ToString() + "');");
                            btnAddInclusion.Attributes.Add("onclick", "return OpenWindow('BACKUP_INCLUSION','?id=" + intID.ToString() + "');");
                            btnAddRetention.Attributes.Add("onclick", "return OpenWindow('BACKUP_RETENTION','?id=" + intID.ToString() + "');");
                            imgDate.Attributes.Add("onclick", "return ShowCalendar('" + txtDate.ClientID + "');");
                        }
                    }
                    else
                    {
                        panStop.Visible = true;
                    }
                }
            }
        }
Esempio n. 19
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);
            oCluster         = new Cluster(intProfile, dsn);
            oUser            = new Users(intProfile, dsn);
            oServer          = new Servers(intProfile, dsn);
            oAsset           = new Asset(intProfile, dsnAsset, dsn);
            oForecast        = new Forecast(intProfile, dsn);
            oFunction        = new Functions(intProfile, dsn, intEnvironment);
            oOperatingSystem = new OperatingSystems(intProfile, dsn);
            oDomain          = new Domains(intProfile, dsn);
            oServerName      = new ServerName(intProfile, dsn);
            oLog             = new Log(intProfile, dsn);
            if (oUser.IsAdmin(intProfile) == true || (oDataPoint.GetPagePermission(intApplication, "ASSET") == true || intDataPointAvailableAsset == 1))
            {
                panAllow.Visible = true;
                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 = oCluster.Get(intID);
                    if (ds.Tables[0].Rows.Count == 1)
                    {
                        // Load General Information
                        lblClusterID.Text = "#" + intID.ToString();
                        string strName     = ds.Tables[0].Rows[0]["name"].ToString();
                        string strNickName = ds.Tables[0].Rows[0]["nickname"].ToString();

                        string strHeader = (strName != "" ? strName : strNickName);
                        lblHeader.Text    = "&quot;" + strHeader.ToUpper() + "&quot;";
                        Master.Page.Title = "DataPoint | Cluster (" + strHeader + ")";
                        lblHeaderSub.Text = "Provides all the information about a cluster...";
                        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("Cluster Information", "");
                        oTab.AddTab("Software Components", "");
                        oTab.AddTab("Instances", "");
                        oTab.AddTab("Nodes", "");
                        if (oUser.IsAdmin(intProfile) == true || oDataPoint.GetFieldPermission(intProfile, "SERVER_ADMIN") == true)
                        {
                            oTab.AddTab("Administration", "");
                            panAdministration.Visible = true;
                        }
                        strMenuTab1 = oTab.GetTabs();

                        if (!IsPostBack)
                        {
                            //LoadList();

                            // Cluster Information
                            oDataPoint.LoadTextBox(txtName, intProfile, null, "", lblName, fldName, "CLUSTER_NAME", strName, "", false, true);
                            oDataPoint.LoadTextBox(txtNickName, intProfile, null, "", lblNickName, fldNickName, "CLUSTER_NICKNAME", strNickName, "", false, true);
                            oDataPoint.LoadTextBox(txtCount, intProfile, null, "", lblCount, fldCount, "CLUSTER_NODES", ds.Tables[0].Rows[0]["nodes"].ToString(), "", false, true);
                            oDataPoint.LoadTextBox(txtDR, intProfile, null, "", lblDR, fldDR, "CLUSTER_NODES_DR", ds.Tables[0].Rows[0]["dr"].ToString(), "", false, true);
                            oDataPoint.LoadTextBox(txtHA, intProfile, null, "", lblHA, fldHA, "CLUSTER_NODES_HA", ds.Tables[0].Rows[0]["ha"].ToString(), "", false, true);
                            oDataPoint.LoadTextBox(txtServiceAccount, intProfile, null, "", lblServiceAccount, fldServiceAccount, "CLUSTER_SERVICE_ACCOUNT", ds.Tables[0].Rows[0]["service_account"].ToString(), "", false, false);
                            oDataPoint.LoadTextBox(txtVirtualName, intProfile, null, "", lblVirtualName, fldVirtualName, "CLUSTER_VIRTUAL_NAME", ds.Tables[0].Rows[0]["virtual_name"].ToString(), "", false, false);
                            oDataPoint.LoadTextBox(txtPlatformIP, intProfile, null, "", lblPlatformIP, fldPlatformIP, "CLUSTER_IP", ds.Tables[0].Rows[0]["ip"].ToString(), "", false, false);

                            DataSet dsServer = oServer.GetClusters(intID);
                            if (dsServer.Tables[0].Rows.Count > 0)
                            {
                                int     intServer = Int32.Parse(dsServer.Tables[0].Rows[0]["id"].ToString());
                                int     intAnswer = Int32.Parse(dsServer.Tables[0].Rows[0]["answerid"].ToString());
                                int     intClass  = 0;
                                int     intEnv    = 0;
                                DataSet dsAnswer  = oForecast.GetAnswer(intAnswer);
                                if (dsAnswer.Tables[0].Rows.Count > 0)
                                {
                                    intClass = Int32.Parse(dsAnswer.Tables[0].Rows[0]["classid"].ToString());
                                    intEnv   = Int32.Parse(dsAnswer.Tables[0].Rows[0]["environmentid"].ToString());
                                }
                                int intOS     = Int32.Parse(dsServer.Tables[0].Rows[0]["osid"].ToString());
                                int intSP     = Int32.Parse(dsServer.Tables[0].Rows[0]["spid"].ToString());
                                int intDomain = Int32.Parse(dsServer.Tables[0].Rows[0]["domainid"].ToString());
                                oDataPoint.LoadDropDown(ddlPlatformOS, intProfile, null, "", lblPlatformOS, fldPlatformOS, "SERVER_OS", "name", "id", oOperatingSystem.Gets(0, 1), intOS, false, false, true);
                                oDataPoint.LoadDropDown(ddlPlatformServicePack, intProfile, null, "", lblPlatformServicePack, fldPlatformServicePack, "SERVER_SP", "name", "id", oOperatingSystem.GetServicePack(intOS), intSP, false, false, true);
                                oDataPoint.LoadDropDown(ddlPlatformDomain, intProfile, null, "", lblPlatformDomain, fldPlatformDomain, "SERVER_DOMAIN", "name", "id", oDomain.GetClassEnvironment(intClass, intEnv), intDomain, false, false, true);

                                // Components
                                oDataPoint.LoadPanel(panComponents, intProfile, fldComponents, "SERVER_COMPONENTS");
                                if (panComponents.Visible == true)
                                {
                                    frmComponents.Attributes.Add("src", "/frame/ondemand/config_server_components.aspx?aid=" + intAnswer.ToString() + "&clusterid=" + intID.ToString());
                                }
                                else
                                {
                                    DataSet dsSelected = oServerName.GetComponentDetailSelected(intServer, 1);
                                    foreach (DataRow drSelected in dsSelected.Tables[0].Rows)
                                    {
                                        int intDetail = Int32.Parse(drSelected["detailid"].ToString());
                                        strComponents += oServerName.GetComponentDetailName(intDetail) + "<br/>";
                                    }
                                }
                            }

                            // Instances
                            rptInstances.DataSource = oCluster.GetInstances(intID);
                            rptInstances.DataBind();
                            lblInstances.Visible = (rptInstances.Items.Count == 0);

                            // Nodes
                            rptNodes.DataSource = dsServer;
                            rptNodes.DataBind();
                            lblNodes.Visible = (rptNodes.Items.Count == 0);

                            // Administrative Functions
                            if (Request.QueryString["admin"] != null)
                            {
                                if (Request.QueryString["output"] != null)
                                {
                                    strAdministration = "<tr><td>" + oLog.GetEvents(oLog.GetEventsByName(strName, (chkDebug.Checked ? (int)LoggingType.Debug : (int)LoggingType.Error)), intEnvironment) + "</td></tr>";
                                }
                            }
                        }
                    }
                    else
                    {
                        panDenied.Visible = true;
                    }
                }
                else
                {
                    panDenied.Visible = true;
                }
                btnClose.Attributes.Add("onclick", "window.close();return false;");
                btnPrint.Attributes.Add("onclick", "window.print();return false;");
                btnOutput.Attributes.Add("onclick", "return ProcessButton(this) && ProcessControlButton();");
            }
            else
            {
                panDenied.Visible = true;
            }
        }
Esempio n. 20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Cookies["loginreferrer"].Value   = Request.Path;
            Response.Cookies["loginreferrer"].Expires = DateTime.Now.AddDays(30);
            if (Request.Cookies["adminid"] != null && Request.Cookies["adminid"].Value != "")
            {
                intProfile = Int32.Parse(Request.Cookies["adminid"].Value);
            }
            else
            {
                Response.Redirect("/admin/login.aspx");
            }
            oDesign           = new Design(intProfile, dsn);
            oModelsProperties = new ModelsProperties(intProfile, dsn);
            oLocation         = new Locations(intProfile, dsn);
            oClass            = new Classes(intProfile, dsn);
            oEnvironment      = new Environments(intProfile, dsn);
            if (!IsPostBack)
            {
                LoadList();
            }
            if (Request.QueryString["id"] == null)
            {
                LoopRepeater();
            }
            else
            {
                panAdd.Visible = true;
                intID          = Int32.Parse(Request.QueryString["id"]);
                if (intID > 0)
                {
                    if (!IsPostBack)
                    {
                        DataSet ds = oDesign.GetModel(intID);
                        hdnId.Value        = intID.ToString();
                        txtName.Text       = ds.Tables[0].Rows[0]["name"].ToString();
                        ddlModel.Text      = ds.Tables[0].Rows[0]["modelid"].ToString();
                        lblName.Text       = txtName.Text;
                        txtCores.Text      = ds.Tables[0].Rows[0]["cores"].ToString();
                        txtRAM.Text        = ds.Tables[0].Rows[0]["ram"].ToString();
                        chkEnabled.Checked = (ds.Tables[0].Rows[0]["enabled"].ToString() == "1");
                        btnAdd.Text        = "Save";
                        btnAddBack.Text    = "Save & Return";

                        // Load Phase Restrictions
                        LoadAddresses(oTreeInventory);
                    }
                }
                else
                {
                    if (!IsPostBack)
                    {
                        txtCores.Text = "0";
                        txtRAM.Text   = "0";
                    }
                    strDisabled       = "<p><img src=\"/images/bigAlert.gif\" border=\"0\" align=\"absmiddle\"/> <b>This section is only available when updating an existing item</b></p>";
                    btnOrder.Enabled  = false;
                    btnDelete.Enabled = false;
                }
            }
            if (panAdd.Visible == true)
            {
                int intMenuTab = 0;
                if (Request.QueryString["menu_tab"] != null && Request.QueryString["menu_tab"] != "")
                {
                    intMenuTab = Int32.Parse(Request.QueryString["menu_tab"]);
                }
                Tab oTab = new Tab("", intMenuTab, "divMenu1", true, false);
                oTab.AddTab("Properties", "");
                oTab.AddTab("Out of Inventory", "");
                strMenuTab1 = oTab.GetTabs();
            }
            btnOrder.Attributes.Add("onclick", "return OpenWindow('SUPPORTORDER','" + hdnId.ClientID + "','" + hdnOrder.ClientID + "&type=D_MODELS" + "',false,400,400);");
            btnDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this item?');");
        }
        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);
            oCustomized = new Customized(intProfile, dsn);
            oVariable   = new Variables(intEnvironment);
            oFunction   = new Functions(0, dsn, intEnvironment);
            string strNavigation = "";

            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);
            }

            //Menus
            int intMenuTab = 0;

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

            oTab.AddTab("&quot;" + oUser.GetFullName(intProfile) + "&quot; Documents", "");
            oTab.AddTab("Documents Shared by Other Users", "");
            strMenuTab1 = oTab.GetTabs();
            //End Menus

            lblTitle.Text = oPage.Get(intPage, "title");
            strRedirect   = oPage.GetFullLink(intPage);

            if (lblCurrent.Text == "")
            {
                lblCurrent.Text = oVariable.DocumentsFolder() + "user\\" + intProfile.ToString();
                if (!Directory.Exists(lblCurrent.Text))
                {
                    DirectoryInfo drinfo = new DirectoryInfo(lblCurrent.Text);
                    drinfo.Create();
                    drinfo.LastAccessTime = DateTime.Now;
                    drinfo.LastWriteTime  = DateTime.Now;
                }
            }
            strHome      = lblCurrent.Text;
            strDirectory = strHome;

            if (strFolder == string.Empty)
            {
                strFolder = "\\";
            }

            if (!Page.IsPostBack)
            {
                if (Request.QueryString["folder"] != null && Request.QueryString["folder"] != "")
                {
                    string strFolderTemp = Request.QueryString["folder"];

                    if (!strFolderTemp.StartsWith("\\"))
                    {
                        strFolderTemp = "\\" + strFolderTemp;
                    }

                    if (Directory.Exists(strHome + strFolderTemp) == true)
                    {
                        strFolder    = strFolderTemp;
                        strDirectory = strHome + strFolderTemp;
                    }
                }

                dir_info = new DirectoryInfo(strDirectory);

                if (dir_info.Parent.Parent.Name != "documents")
                {
                    string strNav = strFolder;
                    while (strNav != "")
                    {
                        strNavigation = " / <a class=\"breadcrumb\" href=\"" + strRedirect + "?folder=" + Server.UrlEncode(strNav) + "\">" + strNav.Substring(strNav.LastIndexOf("\\") + 1) + "</a>" + strNavigation;
                        strNav        = strNav.Substring(0, strNav.LastIndexOf("\\"));
                    }
                    strRedirect = oPage.GetFullLink(intPage) + "?folder=" + strFolder.Substring(0, strFolder.LastIndexOf("\\"));
                    strFolder   = "<a href=\"" + strRedirect + "\">" + strFolder.Substring(0, strFolder.LastIndexOf("\\")) + "</a>" + strFolder.Substring(strFolder.LastIndexOf("\\"));
                }
                DataSet  ds = oCustomized.GetDocumentRepositoryUser(intProfile, intApplication, strDirectory);
                DataView dv = ds.Tables[0].DefaultView;
                if (Request.QueryString["sort"] != null && Request.QueryString["sort"] != "")
                {
                    if (Request.QueryString["sort"].ToLower().Contains("desc"))
                    {
                        dv.Sort = "type desc," + Request.QueryString["sort"];
                    }
                    else
                    {
                        dv.Sort = "type," + Request.QueryString["sort"];
                    }
                }
                else
                {
                    dv.Sort = "type desc";
                }

                rptDocs.DataSource = dv;
                rptDocs.DataBind();
                lblNoDocs.Visible = rptDocs.Items.Count == 0;

                DataSet dsOthers = oCustomized.GetDocumentRepositorySharesByUser(intProfile);
                dsOthers.Relations.Add("relationship", dsOthers.Tables[0].Columns["userid"], dsOthers.Tables[1].Columns["ownerid"], false);
                DataView dvOthers = dsOthers.Tables[0].DefaultView;
                rptOthers.DataSource = dvOthers;
                rptOthers.DataBind();
                lblNoShares.Visible = rptOthers.Items.Count == 0;

                foreach (RepeaterItem ri in rptDocs.Items)
                {
                    LinkButton btnName    = (LinkButton)ri.FindControl("btnName");
                    Label      lblType    = (Label)ri.FindControl("lblType");
                    Label      lblDeleted = (Label)ri.FindControl("lblDeleted");
                    Label      lblId      = (Label)ri.FindControl("lblId");
                    Label      lblSize    = (Label)ri.FindControl("lblSize");

                    ImageButton imgDelete = (ImageButton)ri.FindControl("imgDelete");
                    ImageButton imgRename = (ImageButton)ri.FindControl("imgRename");
                    ImageButton imgShare  = (ImageButton)ri.FindControl("imgShare");
                    imgRename.Attributes.Add("onclick", "return OpenWindow('DOCUMENT_REPOSITORY_RENAME','?id=" + lblId.Text + "');");
                    imgShare.Attributes.Add("onclick", "return OpenWindow('DOCUMENT_REPOSITORY_SHARE','?id=" + imgShare.CommandArgument + "');");
                    imgDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this " + (lblType.Text.ToLower() != "folder" ? "File" : lblType.Text) + " ?');");

                    if (!FileExists(btnName.CommandArgument, lblType.Text))
                    {
                        btnName.Text      = btnName.Text + " (Not Found)";
                        btnName.Enabled   = false;
                        imgRename.Visible = false;
                        imgShare.Visible  = false;
                    }
                    else
                    {
                        if (lblType.Text.ToLower() != "folder")
                        {
                            btnName.Text = "<a href=\"" + oVariable.URL() + "/frame/document_repository_permissions.aspx?docid=" + oFunction.encryptQueryString(lblId.Text) + "\" target=\"_blank\">" + btnName.Text + "</a>";
                            //btnName.Text = "<a href=\"" + btnName.CommandArgument + "\" target=\"_blank\">" + btnName.Text + "</a>";
                            int     intSize = Int32.Parse(lblSize.Text);
                            decimal decSize = intSize / 1024;
                            if (decSize > 1024)
                            {
                                lblSize.Text = (Decimal.Round((decSize / 1024), 1)).ToString() + " MB";
                            }
                            else
                            {
                                lblSize.Text = (Decimal.Round(decSize, 0)).ToString() + " KB";
                            }
                        }
                        else
                        {
                            imgShare.Visible = false;
                        }
                    }
                }

                foreach (RepeaterItem riOther in rptOthers.Items)
                {
                    Repeater rptShared = (Repeater)riOther.FindControl("rptShared");
                    foreach (RepeaterItem ri in rptShared.Items)
                    {
                        LinkButton btnName    = (LinkButton)ri.FindControl("btnName");
                        Label      lblType    = (Label)ri.FindControl("lblType");
                        Label      lblId      = (Label)ri.FindControl("lblId");
                        Label      lblOwnerId = (Label)ri.FindControl("lblOwnerId");
                        Label      lblDeleted = (Label)ri.FindControl("lblDeleted");
                        Label      lblSize    = (Label)ri.FindControl("lblSize");

                        if (!FileExists(btnName.CommandArgument, lblType.Text))
                        {
                            btnName.Text    = btnName.Text + " (Not Found)";
                            btnName.Enabled = false;
                        }
                        else
                        {
                            if (lblType.Text.ToLower() != "folder")
                            {
                                btnName.Text = "<a href=\"" + oVariable.URL() + "/frame/document_repository_permissions.aspx?docid=" + oFunction.encryptQueryString(lblId.Text) + "\" target=\"_blank\">" + btnName.Text + "</a>";
                                int     intSize = Int32.Parse(lblSize.Text);
                                decimal decSize = intSize / 1024;
                                if (decSize > 1024)
                                {
                                    lblSize.Text = (Decimal.Round((decSize / 1024), 1)).ToString() + " MB";
                                }
                                else
                                {
                                    lblSize.Text = (Decimal.Round(decSize, 0)).ToString() + " KB";
                                }
                            }
                        }
                    }
                }

                lblTitle.Text  = oPage.Get(intPage, "title");
                lblFolder.Text = strFolder != "" ? "<a class=\"breadcrumb\" href=\"" + oPage.GetFullLink(intPage) + "\">Home</a>" + strNavigation : "<a class=\"breadcrumb\" href=\"" + oPage.GetFullLink(intPage) + "\">Home</a>";
                hdnDir.Value   = dir_info.FullName;
                btnCreate.Attributes.Add("onclick", "return ValidateText('" + txtDirectory.ClientID + "','Please enter a name for the new directory') && ValidateDirName('" + txtDirectory.ClientID + "') && ProcessButton(this);");
                btnUpload.Attributes.Add("onclick", "return ProcessButton(this);");
                txtDirectory.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + btnCreate.ClientID + "').click();return false;}} else {return true}; ");
            }
        }
Esempio n. 22
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Cookies["loginreferrer"].Value   = "/admin/audit_script_sets.aspx";
            Response.Cookies["loginreferrer"].Expires = DateTime.Now.AddDays(30);
            if (Request.Cookies["adminid"] != null && Request.Cookies["adminid"].Value != "")
            {
                intProfile = Int32.Parse(Request.Cookies["adminid"].Value);
            }
            else
            {
                Response.Redirect("/admin/login.aspx");
            }

            oAudit            = new Audit(intProfile, dsn);
            oClass            = new Classes(intProfile, dsn);
            oEnvironment      = new Environments(intProfile, dsn);
            oType             = new Types(intProfile, dsn);
            oModel            = new Models(intProfile, dsn);
            oModelsProperties = new ModelsProperties(intProfile, dsn);
            oOperatingSystem  = new OperatingSystems(intProfile, dsn);
            oServicePack      = new ServicePacks(intProfile, dsn);
            oLocation         = new Locations(intProfile, dsn);

            if (!IsPostBack)
            {
                LoadLists();
            }

            if (Request.QueryString["id"] == null)
            {
                LoopRepeater();
            }
            else
            {
                intID = Int32.Parse(Request.QueryString["id"]);
                if (intID == 0)
                {
                    panAdd.Visible    = true;
                    btnDelete.Enabled = false;
                    strDisabled       = "<p><img src=\"/images/bigAlert.gif\" border=\"0\" align=\"absmiddle\"/> <b>This section is only available when updating an existing item</b></p>";
                }
                else
                {
                    if (Request.QueryString["save"] != null)
                    {
                        panSave.Visible = true;
                    }
                    panAdd.Visible = true;
                    if (!IsPostBack)
                    {
                        DataSet ds = oAudit.GetScriptSet(intID);
                        txtName.Text       = ds.Tables[0].Rows[0]["name"].ToString();
                        chkModels.Checked  = (ds.Tables[0].Rows[0]["models"].ToString() == "1");
                        chkSAN.Checked     = (ds.Tables[0].Rows[0]["san"].ToString() == "1");
                        chkCluster.Checked = (ds.Tables[0].Rows[0]["cluster"].ToString() == "1");
                        chkMIS.Checked     = (ds.Tables[0].Rows[0]["mis"].ToString() == "1");
                        chkEnabled.Checked = (ds.Tables[0].Rows[0]["enabled"].ToString() == "1");
                        btnAdd.Text        = "Update";

                        LoadClasses(oTreeClassEnvironment);
                        oTreeClassEnvironment.Attributes.Add("onclick", "OnCheckBoxCheckChanged(event)");
                        if (chkModels.Checked == false)
                        {
                            strModels = "<p><img src=\"/images/bigAlert.gif\" border=\"0\" align=\"absmiddle\"/> <b>This section is only available if the <i>SPECIFY INDIVIDUAL MODEL(S)</i> flag is checked</b></p>";
                        }
                        else
                        {
                            LoadTypes(oTreeModels);
                            oTreeModels.Attributes.Add("onclick", "OnCheckBoxCheckChanged(event)");
                        }
                        LoadOperatingSystems(oTreeOperatingSystemServicePack);
                        LoadLocations();
                        panSteps.Visible = true;
                        frmSteps.Attributes.Add("src", "/admin/audit_script_set_details.aspx?parent=" + intID.ToString());
                    }
                }
            }

            if (panAdd.Visible == true)
            {
                int intMenuTab = 0;
                if (Request.QueryString["menu_tab"] != null && Request.QueryString["menu_tab"] != "")
                {
                    intMenuTab = Int32.Parse(Request.QueryString["menu_tab"]);
                }
                Tab oTab = new Tab("", intMenuTab, "divMenu1", true, false);
                oTab.AddTab("Details", "");
                oTab.AddTab("Class / Environments", "");
                oTab.AddTab("Models", "");
                oTab.AddTab("Operating Systems / Service Packs", "");
                oTab.AddTab("Locations", "");
                oTab.AddTab("Scripts", "");
                strMenuTab1 = oTab.GetTabs();
            }

            btnDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this item?');");
            strLocation = oLocation.LoadDDL("ddlState", "ddlCity", "ddlAddress", hdnLocation.ClientID, 0, true, "ddlCommon");
            btnLocation.Attributes.Add("onclick", "return EnsureHidden('" + hdnLocation.ClientID + "','ddlState','Please select a location')" +
                                       ";");
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Cookies["loginreferrer"].Value   = "/admin/servername_components_details.aspx";
            Response.Cookies["loginreferrer"].Expires = DateTime.Now.AddDays(30);
            if (Request.Cookies["adminid"] != null && Request.Cookies["adminid"].Value != "")
            {
                intProfile = Int32.Parse(Request.Cookies["adminid"].Value);
            }
            else
            {
                Response.Redirect("/admin/login.aspx");
            }

            oServerName       = new ServerName(intProfile, dsn);
            oClass            = new Classes(intProfile, dsn);
            oEnvironment      = new Environments(intProfile, dsn);
            oType             = new Types(intProfile, dsn);
            oModel            = new Models(intProfile, dsn);
            oModelsProperties = new ModelsProperties(intProfile, dsn);
            oOperatingSystem  = new OperatingSystems(intProfile, dsn);
            oServicePack      = new ServicePacks(intProfile, dsn);
            oUser             = new Users(intProfile, dsn);
            oZeus             = new Zeus(intProfile, dsn);
            oAudit            = new Audit(intProfile, dsn);
            oIPAddresses      = new IPAddresses(intProfile, dsnIP, dsn);

            if (!IsPostBack)
            {
                LoadLists();
            }

            if (Request.QueryString["id"] == null)
            {
                if (Request.QueryString["parent"] == null)
                {
                    LoadComponents(oTreeDetails, false, false);
                }
                else
                {
                    panAdd.Visible          = true;
                    ddlParent.SelectedValue = Request.QueryString["parent"];
                    btnDelete.Enabled       = false;
                    strDisabled             = "<p><img src=\"/images/bigAlert.gif\" border=\"0\" align=\"absmiddle\"/> <b>This section is only available when updating an existing item</b></p>";
                    btnUser.Enabled         = false;
                }
            }
            else
            {
                if (Request.QueryString["save"] != null)
                {
                    panSave.Visible = true;
                }
                panAdd.Visible = true;
                intID          = Int32.Parse(Request.QueryString["id"]);
                if (!IsPostBack)
                {
                    DataSet ds = oServerName.GetComponentDetail(intID);
                    ddlParent.SelectedValue          = ds.Tables[0].Rows[0]["componentid"].ToString();
                    txtName.Text                     = ds.Tables[0].Rows[0]["name"].ToString();
                    ddlZEUSArrayConfig.SelectedValue = ds.Tables[0].Rows[0]["zeus_array_config_id"].ToString();
                    ddlZEUSBuildType.SelectedValue   = ds.Tables[0].Rows[0]["zeus_build_type_id"].ToString();
                    chkApproval.Checked              = (ds.Tables[0].Rows[0]["approval"].ToString() == "1");
                    chkModels.Checked                = (ds.Tables[0].Rows[0]["models"].ToString() == "1");
                    chkNetworks.Checked              = (ds.Tables[0].Rows[0]["networks"].ToString() == "1");
                    chkInstall.Checked               = (ds.Tables[0].Rows[0]["install"].ToString() == "1");
                    chkMount.Checked                 = (ds.Tables[0].Rows[0]["mount"].ToString() == "1");
                    txtNetworkPath.Text              = ds.Tables[0].Rows[0]["network_path"].ToString();
                    txtInstallPath.Text              = ds.Tables[0].Rows[0]["install_path"].ToString();
                    txtAD.Text = ds.Tables[0].Rows[0]["ad_move_location"].ToString();
                    ddlScript.SelectedValue      = ds.Tables[0].Rows[0]["scriptid"].ToString();
                    ddlEnvironment.SelectedValue = ds.Tables[0].Rows[0]["environment"].ToString();
                    chkEnabled.Checked           = (ds.Tables[0].Rows[0]["enabled"].ToString() == "1");
                    btnAdd.Text = "Update";

                    LoadClasses(oTreeClassEnvironment, false);
                    oTreeClassEnvironment.Attributes.Add("onclick", "OnCheckBoxCheckChanged(event)");
                    if (chkModels.Checked == false)
                    {
                        strModels = "<p><img src=\"/images/bigAlert.gif\" border=\"0\" align=\"absmiddle\"/> <b>This section is only available if the <i>SPECIFY INDIVIDUAL MODEL(S)</i> flag is checked</b></p>";
                    }
                    else
                    {
                        LoadTypes(oTreeModels);
                        oTreeModels.Attributes.Add("onclick", "OnCheckBoxCheckChanged(event)");
                    }
                    LoadOperatingSystems(oTreeOperatingSystemServicePack);
                    if (chkApproval.Checked == false)
                    {
                        btnUser.Enabled = false;
                        strApprovals    = "<p><img src=\"/images/bigAlert.gif\" border=\"0\" align=\"absmiddle\"/> <b>This section is only available if the <i>REQUIRES APPROVAL</i> flag is checked</b></p>";
                    }
                    else
                    {
                        LoadUsers();
                    }
                    LoadComponents(oTreeInclude, true, false);
                    oTreeInclude.Attributes.Add("onclick", "OnCheckBoxCheckChanged(event)");
                    LoadComponents(oTreeExclude, false, true);
                    oTreeExclude.Attributes.Add("onclick", "OnCheckBoxCheckChanged(event)");
                    LoadApplications(oTreeIncludeApp, true);
                    LoadApplications(oTreeExcludeApp, false);
                    if (chkNetworks.Checked == false)
                    {
                        strNetworks = "<p><img src=\"/images/bigAlert.gif\" border=\"0\" align=\"absmiddle\"/> <b>This section is only available if the <i>SPECIFY NETWORK RANGES(S)</i> flag is checked</b></p>";
                    }
                    else
                    {
                        LoadClasses(oTreeNetworks, true);
                        oTreeNetworks.Attributes.Add("onclick", "OnCheckBoxCheckChanged(event)");
                    }
                    panScripts.Visible = true;
                    frmScripts.Attributes.Add("src", "/admin/servername_components_scripts.aspx?detailid=" + intID.ToString());
                }
            }

            if (panAdd.Visible == true)
            {
                int intMenuTab = 0;
                if (Request.QueryString["menu_tab"] != null && Request.QueryString["menu_tab"] != "")
                {
                    intMenuTab = Int32.Parse(Request.QueryString["menu_tab"]);
                }
                Tab oTab = new Tab("", intMenuTab, "divMenu1", true, false);
                oTab.AddTab("Details", "");
                oTab.AddTab("Class / Environments", "");
                oTab.AddTab("Models", "");
                oTab.AddTab("Approvers", "");
                oTab.AddTab("Operating Systems / Service Packs", "");
                oTab.AddTab("Associated Components", "");
                int intMenuTabComp = 0;
                if (Request.QueryString["menu_tab_comp"] != null && Request.QueryString["menu_tab_comp"] != "")
                {
                    intMenuTabComp = Int32.Parse(Request.QueryString["menu_tab_comp"]);
                }
                Tab oTabComp = new Tab("", intMenuTabComp, "divMenuComp1", true, false);
                oTabComp.AddTab("Inclusions", "");
                oTabComp.AddTab("Exclusions", "");
                strMenuTabComp = oTabComp.GetTabs();
                oTab.AddTab("Associated Applications", "");
                int intMenuTabApp = 0;
                if (Request.QueryString["menu_tab_app"] != null && Request.QueryString["menu_tab_app"] != "")
                {
                    intMenuTabApp = Int32.Parse(Request.QueryString["menu_tab_app"]);
                }
                Tab oTabApp = new Tab("", intMenuTabApp, "divMenuApp1", true, false);
                oTabApp.AddTab("Inclusions", "");
                oTabApp.AddTab("Exclusions", "");
                strMenuTabApp = oTabApp.GetTabs();
                oTab.AddTab("Network Ranges", "");
                oTab.AddTab("Scripts", "");
                strMenuTab1 = oTab.GetTabs();
            }

            btnDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this item?');");
            Variables oVariable = new Variables(intEnvironment);

            txtUser.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'300','195','" + divUser.ClientID + "','" + lstUser.ClientID + "','" + hdnUser.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);");
            lstUser.Attributes.Add("ondblclick", "AJAXClickRow();");
            btnUser.Attributes.Add("onclick", "return EnsureHidden('" + hdnUser.ClientID + "','" + txtUser.ClientID + "','Please enter the LAN ID of the user')" +
                                   ";");
            btnArrayConfig.Attributes.Add("onclick", "return OpenWindow('SUPPORTORDER','" + hdnArrayConfigId.ClientID + "','" + hdnArrayConfigOrder.ClientID + "&type=ZEUS_ARRAY_CONFIGS" + "',false,400,400);");
            btnBuildType.Attributes.Add("onclick", "return OpenWindow('SUPPORTORDER','" + hdnBuildTypeId.ClientID + "','" + hdnBuildTypeOrder.ClientID + "&type=ZEUS_BUILD_TYPES" + "',false,400,400);");
        }
Esempio n. 24
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile       = Int32.Parse(Request.Cookies["profileid"].Value);
            oTabs            = new Tabs(intProfile, dsn);
            oResourceRequest = new ResourceRequest(intProfile, dsn);
            oRequestItem     = new RequestItems(intProfile, dsn);
            oService         = new Services(intProfile, dsn);
            int intMenuTab = 0;

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

            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["pid"] != null && Request.QueryString["pid"] != "")
            {
                int     intProject = Int32.Parse(Request.QueryString["pid"]);
                DataSet ds         = oResourceRequest.GetProjectUser(intProject, intProfile);
                int     intItem    = -1;
                bool    boolTasks  = false;
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    if (intItem != Int32.Parse(dr["itemid"].ToString()))
                    {
                        if (intItem > -1)
                        {
                            boolTasks = true;
                        }
                        intItem = Int32.Parse(dr["itemid"].ToString());
                        int intService = Int32.Parse(dr["serviceid"].ToString());
                        if (boolTasks == false)
                        {
                            boolTasks = (oService.Get(intService, "tasks") == "1");
                        }
                        if (boolTasks == true)
                        {
                            break;
                        }
                    }
                }
                ds = oTabs.GetRequestItemsTabs(intItem);
                int intCount = 0;

                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    intCount++;
                    HtmlGenericControl oDiv = new HtmlGenericControl("DIV");
                    if (intCount == 1)
                    {
                        oDiv.Style["display"] = "inline";
                        //oDiv.ID = "divTab" + intCount.ToString();
                        oDiv.Controls.Add((Control)LoadControl(dr["path"].ToString()));
                        PHDiv.Controls.Add(oDiv);
                        oTab.AddTab(dr["tabname"].ToString(), "");
                        //strTab += "<td><img src=\"/images/TabOnLeftCap.gif\"></td><td nowrap background=\"/images/TabOnBackground.gif\"><a href=\"javascript:void(0);\" onclick=\"ChangeTab(this,'" + oDiv.ClientID + "',null,null,false);\" class=\"tabheader\">" + dr["tabname"].ToString() + "</a></td><td><img src=\"/images/TabOnRightCap.gif\"></td>";
                    }
                    else
                    {
                        oDiv.Style["display"] = "none";
                        //oDiv.ID = "divTab" + intCount.ToString();
                        oDiv.Controls.Add((Control)LoadControl(dr["path"].ToString()));
                        PHDiv.Controls.Add(oDiv);
                        oTab.AddTab(dr["tabname"].ToString(), "");
                        //strTab += "<td><img src=\"/images/TabOffLeftCap.gif\"></td><td nowrap background=\"/images/TabOffBackground.gif\"><a href=\"javascript:void(0);\" onclick=\"ChangeTab(this,'" + oDiv.ClientID + "',null,null,false);\" class=\"tabheader\">" + dr["tabname"].ToString() + "</a></td><td><img src=\"/images/TabOffRightCap.gif\"></td>";
                    }
                }
                strTabs = oTab.GetTabs();
                //if (strTab != "")
                //    strTabs += "<tr>" + strTab + "<td width=\"100%\" background=\"/images/TabEmptyBackground.gif\">&nbsp;</td></tr>";
                //if (strTabs == "")
                //    strTabs += "<tr><td class=\"header\"><img src=\"/images/bigAlert.gif\" border=\"0\" align=\"absmiddle\"/> The workload manager tabs have not been configured for this department. Please contact your ClearView administrator for additional information.</td></tr>";
                //strTabs = "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">" + strTabs + "</table>";
                if (boolTasks == true)
                {
                    // Add the tasks tab if necessary
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile      = Int32.Parse(Request.Cookies["profileid"].Value);
            oAsset          = new Asset(intProfile, dsnAsset);
            oForecast       = new Forecast(intProfile, dsn);
            oWorkstation    = new Workstations(intProfile, dsn);
            oServiceRequest = new ServiceRequests(intProfile, dsn);
            oOnDemandTasks  = new OnDemandTasks(intProfile, dsn);

            //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("", intMenuTab, "divMenu1", true, false);

            //End Menu



            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 intForecast = 0;

            if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
            {
                intID       = Int32.Parse(Request.QueryString["id"]);
                intForecast = Int32.Parse(oForecast.GetAnswer(intID, "forecastid"));
                intRequest  = oForecast.GetRequestID(intID, true);
                DataSet dsRequest = oServiceRequest.Get(intRequest);
                if (dsRequest.Tables[0].Rows.Count > 0)
                {
                    Response.Redirect(Request.Path + "?rid=" + intRequest);
                }
            }
            if (Request.QueryString["rid"] != null && Request.QueryString["rid"] != "")
            {
                intRequest = Int32.Parse(Request.QueryString["rid"]);
            }
            if (Request.QueryString["notify"] != null)
            {
                string strRedirect = Request.Url.PathAndQuery;
                strRedirect = strRedirect.Substring(0, strRedirect.IndexOf("&notify"));
                if (Request.QueryString["notify"] == "true")
                {
                    Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "close", "<script type=\"text/javascript\">alert('Your design implementor has been successfully notified!');window.navigate('" + strRedirect + "');<" + "/" + "script>");
                }
                else if (Request.QueryString["notify"] == "false")
                {
                    Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "close", "<script type=\"text/javascript\">alert('Your design implementor has ALREADY been notified!');window.navigate('" + strRedirect + "');<" + "/" + "script>");
                }
                else
                {
                    Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "close", "<script type=\"text/javascript\">alert('There was a problem notifying your design implementor\\n\\nPlease contact your ClearView administrator\\n\\nRequestID: " + intRequest.ToString() + "');window.navigate('" + strRedirect + "');<" + "/" + "script>");
                }
            }
            if (intID > 0)
            {
                panBegin.Visible = true;
                bool boolAssigned = false;
                if (oForecast.CanAutoProvision(intID) == true)
                {
                    boolAssigned = true;
                }
                else if (oOnDemandTasks.GetPending(intID).Tables[0].Rows.Count > 0)
                {
                    boolAssigned = true;
                }

                if (intForecast == 0)
                {
                    btnStart.Attributes.Add("onclick", "return ProcessButton(this);");
                }
                else if (boolAssigned == false)
                {
                    btnStart.Attributes.Add("onclick", "alert('You cannot execute a design until a design implementor has been assigned.');return false;");
                }
                else
                {
                    lblNotify.Visible = true;
                    //btnStart.Attributes.Add("onclick", "return confirm('NOTE: Billing will begin: " + DateTime.Today.ToShortDateString() + "\\n\\nAre you sure you want to continue?') && OpenWindow('AUTO_PROVISIONING','?answerid=" + intID.ToString() + "&modelid=" + oForecast.GetModel(intID).ToString() + "');");
                    btnStart.Attributes.Add("onclick", "return confirm('NOTE: Billing will begin: " + DateTime.Today.ToShortDateString() + "\\n\\nAre you sure you want to continue?');");
                }
            }
            else if (intRequest > 0)
            {
                intRequest       = Int32.Parse(Request.QueryString["rid"]);
                panStart.Visible = true;
                DataSet   ds        = oWorkstation.GetVirtualRequests(intRequest);
                int       intCount  = 0;
                Functions oFunction = new Functions(intProfile, dsn, intEnvironment);

                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    intCount++;
                    int    intDevice = Int32.Parse(dr["id"].ToString());
                    int    intAsset  = Int32.Parse(dr["assetid"].ToString());
                    string strName   = "Device " + intCount.ToString();
                    if (intAsset > 0)
                    {
                        string strTempName = oAsset.Get(intAsset, "name");
                        if (strTempName != "")
                        {
                            strName = strTempName;
                        }
                    }
                    if (intCount == 1)
                    {
                        //strTab += "<td><img src=\"/images/TabOnLeftCap.gif\"></td><td nowrap background=\"/images/TabOnBackground.gif\"><a href=\"javascript:void(0);\" onclick=\"ChangeTab(this,'divTab" + intCount.ToString() + "',null,null,true);\" class=\"tabheader\">" + strName + "</a></td><td><img src=\"/images/TabOnRightCap.gif\"></td>";
                        oTab.AddTab(strName, "");
                        strDivs += "<div id=\"divTab" + intCount.ToString() + "\" style=\"display:inline\"><iframe width=\"100%\" height=\"100%\" frameborder=\"0\" scrolling=\"auto\" src=\"/ondemand/ondemand_workstation_virtual.aspx?id=" + oFunction.encryptQueryString(intDevice.ToString()) + "&c=" + intCount.ToString() + "\"></iframe></div>";
                    }
                    else
                    {
                        // strTab += "<td><img src=\"/images/TabOffLeftCap.gif\"></td><td nowrap background=\"/images/TabOffBackground.gif\"><a href=\"javascript:void(0);\" onclick=\"ChangeTab(this,'divTab" + intCount.ToString() + "',null,null,true);\" class=\"tabheader\">" + strName + "</a></td><td><img src=\"/images/TabOffRightCap.gif\"></td>";
                        oTab.AddTab(strName, "");
                        strDivs += "<div id=\"divTab" + intCount.ToString() + "\" style=\"display:none\"><iframe width=\"100%\" height=\"100%\" frameborder=\"0\" scrolling=\"auto\" src=\"/ondemand/ondemand_workstation_virtual.aspx?id=" + oFunction.encryptQueryString(intDevice.ToString()) + "&c=" + intCount.ToString() + "\"></iframe></div>";
                    }
                }
                //if (strTab != "")
                //    strMenuTab1 += "<tr>" + strTab + "<td width=\"100%\" background=\"/images/TabEmptyBackground.gif\">&nbsp;</td></tr>";
                //strMenuTab1 = "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">" + strMenuTab1 + "</table>";
                strMenuTab1 = oTab.GetTabs();
            }
        }
Esempio n. 26
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile        = Int32.Parse(Request.Cookies["profileid"].Value);
            oPage             = new Pages(intProfile, dsn);
            oRequestItem      = new RequestItems(intProfile, dsn);
            oRequest          = new Requests(intProfile, dsn);
            oApplication      = new Applications(intProfile, dsn);
            oLocation         = new Locations(intProfile, dsn);
            oClass            = new Classes(intProfile, dsn);
            oForecast         = new Forecast(intProfile, dsn);
            oType             = new Types(intProfile, dsn);
            oModel            = new Models(intProfile, dsn);
            oModelsProperties = new ModelsProperties(intProfile, dsn);
            oOperatingSystems = new OperatingSystems(intProfile, dsn);
            oVirtualHDD       = new VirtualHDD(intProfile, dsn);
            oVirtualRam       = new VirtualRam(intProfile, dsn);
            oVirtualCPU       = new VirtualCPU(intProfile, dsn);
            oVariable         = new Variables(intEnvironment);
            oFunction         = new Functions(0, dsn, intEnvironment);
            oUser             = new Users(intProfile, dsn);
            oDomain           = new Domains(intProfile, dsn);
            oWorkstation      = new Workstations(intProfile, dsn);
            oCostCenter       = new CostCenter(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["rid"] != "" && Request.QueryString["rid"] != null)
            {
                if (!IsPostBack)
                {
                    LoadLists();
                }
                LoadValues();
                int    intItem        = Int32.Parse(lblItem.Text);
                int    intApp         = oRequestItem.GetItemApplication(intItem);
                string strDeliverable = oApplication.Get(intApp, "deliverables_doc");
                if (strDeliverable != "")
                {
                    panDeliverable.Visible = true;
                    btnDeliverable.Attributes.Add("onclick", "return OpenWindow('NEW_WINDOW','" + strDeliverable + "');");
                }
                if (Request.QueryString["id"] != "" && Request.QueryString["id"] != null)
                {
                    Int32.TryParse(Request.QueryString["id"], out intWorkstation);
                }
                if (intWorkstation > 0)
                {
                    panAccounts.Visible = true;
                }
                else
                {
                    panAccountsNo.Visible = true;
                }
                if (Request.QueryString["userid"] != null && Request.QueryString["userid"] != "")
                {
                    int intUser = Int32.Parse(Request.QueryString["userid"]);
                    trAccountUpdate.Visible  = true;
                    lblXID.Text              = oUser.GetFullName(intUser) + " (" + oUser.GetName(intUser) + ")";
                    btnAddAccount.Text       = "Update";
                    btnCancelAccount.Visible = true;
                }
                else
                {
                    trNew.Visible = true;
                }

                if (Request.QueryString["accts"] != null && Request.QueryString["accts"] != "")
                {
                    Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "accts", "<script type=\"text/javascript\">alert('Enter at least one account for this workstation');<" + "/" + "script>");
                }
                if (Request.QueryString["qty"] != null && Request.QueryString["qty"] != "")
                {
                    if (Request.QueryString["qty"] == intMaxWorkstationsPerDay.ToString())
                    {
                        Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "qty", "<script type=\"text/javascript\">alert('NOTE: You can request up to " + intMaxWorkstationsPerDay.ToString() + " virtual workstations per day.\\n\\nCurrently, you have requested " + Request.QueryString["qty"] + " virtual workstations and cannot be allocated additional hardware until tomorrow.\\n\\nIf your initiative requires more than " + intMaxWorkstationsPerDay.ToString() + " virtual workstations per day, you must use design builder.\\nPlease contact your technical lead or ClearView administrator for additional information.');<" + "/" + "script>");
                    }
                    else if (Request.QueryString["qty"] == "0")
                    {
                        int intDiff = intMaxWorkstationsPerDay - Int32.Parse(Request.QueryString["qty"]);
                        Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "qty", "<script type=\"text/javascript\">alert('NOTE: You can request up to " + intMaxWorkstationsPerDay.ToString() + " virtual workstations per day.\\n\\nCurrently, you have requested " + Request.QueryString["qty"] + " virtual workstations. Please enter a quantity of " + intDiff.ToString() + " or less to continue.\\n\\nIf your initiative requires more than " + intMaxWorkstationsPerDay.ToString() + " virtual workstations per day, you must use design builder.\\nPlease contact your technical lead or ClearView administrator for additional information.');<" + "/" + "script>");
                    }
                    else
                    {
                        Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "qty", "<script type=\"text/javascript\">alert('NOTE: You can request up to " + intMaxWorkstationsPerDay.ToString() + " virtual workstations per day.\\n\\nPlease enter a quantity of " + intMaxWorkstationsPerDay.ToString() + " or less to continue.\\n\\nIf your initiative requires more than " + intMaxWorkstationsPerDay.ToString() + " virtual workstations per day, you must use design builder.\\nPlease contact your technical lead or ClearView administrator for additional information.');<" + "/" + "script>");
                    }
                }
                else if (Request.QueryString["aid"] != null && Request.QueryString["aid"] != "")
                {
                    intAnswer = Int32.Parse(Request.QueryString["aid"]);
                    if (!IsPostBack)
                    {
                        DataSet dsAnswer = oForecast.GetAnswer(intAnswer);
                        if (dsAnswer.Tables[0].Rows.Count > 0)
                        {
                            txtName.Text = dsAnswer.Tables[0].Rows[0]["name"].ToString();
                            ddlLocation.SelectedValue = dsAnswer.Tables[0].Rows[0]["addressid"].ToString();
                            ddlClass.SelectedValue    = dsAnswer.Tables[0].Rows[0]["classid"].ToString();
                            txtQuantity.Text          = dsAnswer.Tables[0].Rows[0]["quantity"].ToString();
                            dsAnswer = oForecast.GetWorkstation(intAnswer);
                            if (dsAnswer.Tables[0].Rows.Count > 0)
                            {
                                ddlRam.SelectedValue       = dsAnswer.Tables[0].Rows[0]["ramid"].ToString();
                                ddlOS.SelectedValue        = dsAnswer.Tables[0].Rows[0]["osid"].ToString();
                                chkDR.Checked              = (dsAnswer.Tables[0].Rows[0]["recovery"].ToString() == "1");
                                radEmployee.SelectedValue  = dsAnswer.Tables[0].Rows[0]["internal"].ToString();
                                ddlHardDrive.SelectedValue = dsAnswer.Tables[0].Rows[0]["hddid"].ToString();
                                ddlCPU.SelectedValue       = dsAnswer.Tables[0].Rows[0]["cpuid"].ToString();
                            }
                        }
                        else
                        {
                            intAnswer = 0;
                        }
                    }
                }

                if (intAnswer == 0)
                {
                    DataSet dsService = oForecast.GetAnswerService(Int32.Parse(Request.QueryString["rid"]));
                    if (dsService.Tables[0].Rows.Count > 0)
                    {
                        Redirect("&aid=" + dsService.Tables[0].Rows[0]["id"].ToString() + "&menu_tab=2");
                    }
                }
                if (intWorkstation > 0)
                {
                    DataSet dsWorkstation = oWorkstation.GetVirtual(intWorkstation);
                    if (dsWorkstation.Tables[0].Rows.Count > 0)
                    {
                        // Load Workstation
                        txtName.Text = dsWorkstation.Tables[0].Rows[0]["nickname"].ToString();
                        ddlLocation.SelectedValue = dsWorkstation.Tables[0].Rows[0]["addressid"].ToString();
                        int intClass = Int32.Parse(dsWorkstation.Tables[0].Rows[0]["classid"].ToString());
                        ddlClass.SelectedValue = intClass.ToString();
                        txtQuantity.Text       = dsWorkstation.Tables[0].Rows[0]["quantity"].ToString();
                        int intOS = Int32.Parse(dsWorkstation.Tables[0].Rows[0]["osid"].ToString());
                        LoadOS(intOS);
                        ddlOS.SelectedValue = intOS.ToString();
                        int intDomain = Int32.Parse(dsWorkstation.Tables[0].Rows[0]["domainid"].ToString());
                        lblDomain.Text             = oDomain.Get(intDomain, "name");
                        radEmployee.SelectedValue  = dsWorkstation.Tables[0].Rows[0]["internal"].ToString();
                        chkDR.Checked              = (dsWorkstation.Tables[0].Rows[0]["recovery"].ToString() == "1");
                        ddlRam.SelectedValue       = dsWorkstation.Tables[0].Rows[0]["ramid"].ToString();
                        ddlHardDrive.SelectedValue = dsWorkstation.Tables[0].Rows[0]["hddid"].ToString();
                        ddlCPU.SelectedValue       = dsWorkstation.Tables[0].Rows[0]["cpuid"].ToString();
                        int intManager = Int32.Parse(dsWorkstation.Tables[0].Rows[0]["appcontact"].ToString());
                        txtManager.Text  = oUser.GetFullName(intManager);
                        hdnManager.Value = intManager.ToString();
                        int intCost = Int32.Parse(dsWorkstation.Tables[0].Rows[0]["costcenterid"].ToString());
                        txtCostCenter.Text  = oCostCenter.GetName(intCost);
                        hdnCostCenter.Value = intCost.ToString();

                        // Load Accounts
                        txtUser.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'300','195','" + divAJAX.ClientID + "','" + lstAJAX.ClientID + "','" + hdnUser.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);");
                        lstAJAX.Attributes.Add("ondblclick", "AJAXClickRow();");
                        chkAdmin.Attributes.Add("onclick", "CheckAdmin(this);");
                        rptAccounts.DataSource = oWorkstation.GetAccountsVMware(intWorkstation);
                        rptAccounts.DataBind();
                        foreach (RepeaterItem ri in rptAccounts.Items)
                        {
                            LinkButton _delete = (LinkButton)ri.FindControl("btnDeleteAccount");
                            _delete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this account?') && LoadWait();");
                        }
                        if (rptAccounts.Items.Count == 0)
                        {
                            lblNone.Visible = true;
                            btnNext.Attributes.Add("onclick", "alert('Enter at least one account for this workstation');return false;");
                        }
                        else
                        {
                            btnNext.Attributes.Add("onclick", "return ProcessButton(this) && LoadWait();");
                        }
                        if (oClass.IsProd(intClass))
                        {
                            panProduction.Visible = true;
                        }
                        else
                        {
                            panAdmin.Visible = true;
                        }
                        btnAddAccount.Attributes.Add("onclick", "return ValidateHidden('" + hdnUser.ClientID + "','" + txtUser.ClientID + "','Please enter a username, first name or last name') && ProcessButton(this) && LoadWait();");

                        trUpdate.Visible = true;
                        btnUpdate.Attributes.Add("onclick", "return ValidateDropDown('" + ddlClass.ClientID + "','Please select a class')" +
                                                 " && ValidateNumber0('" + txtQuantity.ClientID + "','Please enter a valid quantity')" +
                                                 " && ValidateDropDown('" + ddlOS.ClientID + "','Please select an Operating System')" +
                                                 " && ValidateDropDown('" + ddlRam.ClientID + "','Please select a RAM')" +
                                                 " && ValidateDropDown('" + ddlCPU.ClientID + "','Please select a CPU')" +
                                                 " && ValidateDropDown('" + ddlHardDrive.ClientID + "','Please select a hard drive')" +
                                                 " && ValidateHidden0('" + hdnManager.ClientID + "','" + txtManager.ClientID + "','Please enter the LAN ID of your user access administrator')" +
                                                 " && ValidateHidden0('" + hdnCostCenter.ClientID + "','" + txtCostCenter.ClientID + "','Please enter the cost center to be billed for this workstation')" +
                                                 " && ProcessButton(this) && LoadWait()" +
                                                 ";");
                    }
                    else
                    {
                        intWorkstation = 0;
                    }
                }

                if (intWorkstation == 0)
                {
                    btnNext.Attributes.Add("onclick", "return ValidateDropDown('" + ddlClass.ClientID + "','Please select a class')" +
                                           " && ValidateNumber0('" + txtQuantity.ClientID + "','Please enter a valid quantity')" +
                                           " && ValidateDropDown('" + ddlOS.ClientID + "','Please select an Operating System')" +
                                           " && ValidateDropDown('" + ddlRam.ClientID + "','Please select a RAM')" +
                                           " && ValidateDropDown('" + ddlCPU.ClientID + "','Please select a CPU')" +
                                           " && ValidateDropDown('" + ddlHardDrive.ClientID + "','Please select a hard drive')" +
                                           " && ValidateHidden0('" + hdnManager.ClientID + "','" + txtManager.ClientID + "','Please enter the LAN ID of your user access administrator')" +
                                           " && ValidateHidden0('" + hdnCostCenter.ClientID + "','" + txtCostCenter.ClientID + "','Please enter the cost center to be billed for this workstation')" +
                                           " && ProcessButton(this) && LoadWait()" +
                                           ";");
                }
            }
            int intMenuTab = 0;

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

            oTab.AddTab("Workstation Details", "");
            oTab.AddTab("Account Configuration", "");
            strMenuTab1 = oTab.GetTabs();

            btnCancel1.Attributes.Add("onclick", "return confirm('Are you sure you want to cancel this service request?');");
            ddlOS.Attributes.Add("onchange", "LoadWait();");
            ddlRam.Attributes.Add("onchange", "LoadWait();");
            ddlCPU.Attributes.Add("onchange", "LoadWait();");
            ddlHardDrive.Attributes.Add("onchange", "LoadWait();");
            txtManager.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'300','195','" + divManager.ClientID + "','" + lstManager.ClientID + "','" + hdnManager.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);");
            lstManager.Attributes.Add("ondblclick", "AJAXClickRow();");
            btnManager.Attributes.Add("onclick", "return OpenWindow('NEW_USER','');");
            btnManager2.Attributes.Add("onclick", "return OpenWindow('NEW_USER','');");
            txtCostCenter.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'200','195','" + divCostCenter.ClientID + "','" + lstCostCenter.ClientID + "','" + hdnCostCenter.ClientID + "','" + oVariable.URL() + "/frame/ajax/ajax_cost_centers.aspx',5);");
            lstCostCenter.Attributes.Add("ondblclick", "AJAXClickRow();");
        }
Esempio n. 27
0
        protected void Page_Load(object sender, EventArgs e)
        {
            oWorkstation     = new Workstations(intProfile, dsn);
            oServer          = new Servers(intProfile, dsn);
            oFunction        = new Functions(intProfile, dsn, intEnvironment);
            oUser            = new Users(intProfile, dsn);
            oVMWare          = new VMWare(intProfile, dsn);
            oAsset           = new Asset(intProfile, dsnAsset, dsn);
            oError           = new Errors(intProfile, dsn);
            oZeus            = new Zeus(intProfile, dsnZeus);
            oVariable        = new Variables(intEnvironment);
            oOperatingSystem = new OperatingSystems(intProfile, dsn);

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

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

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

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

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

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

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

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

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

                                            boolVMware = true;
                                        }
                                    }

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

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

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

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

            if (lblError.Text == "")
            {
                panIssue.Visible = true;
                btnFixed.Attributes.Add("onclick", "return ValidateText('" + txtIssue.ClientID + "','Please enter the issue') && ValidateText('" + txtResolution.ClientID + "','Please enter the resolution') && ValidateDropDown('" + ddlCode.ClientID + "','Please select a case code') && confirm('Are you sure you want to mark this error as fixed?') && ProcessButton(this);");
                radNew.Attributes.Add("onclick", "ShowHideDiv('" + divNew.ClientID + "','inline');ShowHideDiv('" + divExisting.ClientID + "','none');");
                radExisting.Attributes.Add("onclick", "ShowHideDiv('" + divNew.ClientID + "','none');ShowHideDiv('" + divExisting.ClientID + "','inline');");
            }
            else
            {
                panDenied.Visible = true;
                btnClose.Attributes.Add("onclick", "window.close();");
            }
        }
Esempio n. 28
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile       = Int32.Parse(Request.Cookies["profileid"].Value);
            oRequest         = new Requests(intProfile, dsn);
            oService         = new Services(intProfile, dsn);
            oServiceRequest  = new ServiceRequests(intProfile, dsn);
            oEnhancement     = new Enhancements(intProfile, dsn);
            oPage            = new Pages(intProfile, dsn);
            oResourceRequest = new ResourceRequest(intProfile, dsn);
            oStatusLevel     = new StatusLevels();
            oUser            = new Users(intProfile, dsn);
            oCustomized      = new Customized(intProfile, dsn);
            oFunction        = new Functions(intProfile, dsn, intEnvironment);
            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["id"] != null && Request.QueryString["id"] != "")
            {
                intID = Int32.Parse(Request.QueryString["id"]);
            }
            if (Request.QueryString["old"] != null && Request.QueryString["old"] != "")
            {
                intIDold = Int32.Parse(Request.QueryString["old"]);
            }

            if (!IsPostBack)
            {
                LoadLists();
            }

            int intMenuTab = 0;

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

            oTab.AddTab("Enhancement Details", "");
            if (intID > 0)
            {
                panEnhancement.Visible = true;
                DataSet ds = oEnhancement.Get(intID);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    panNew.Visible   = true;
                    trStatus.Visible = true;
                    lblTitle.Text    = "Edit Enhancement";
                    DataSet dsMessages = oEnhancement.GetMessages(intID);
                    if (!IsPostBack)
                    {
                        txtTitle.Text          = ds.Tables[0].Rows[0]["title"].ToString();
                        txtDescription.Text    = ds.Tables[0].Rows[0]["description"].ToString();
                        ddlUsers.SelectedValue = ds.Tables[0].Rows[0]["users"].ToString();
                        txtURL.Text            = ds.Tables[0].Rows[0]["url"].ToString();
                        if (ds.Tables[0].Rows[0]["url"].ToString() != "")
                        {
                            hypURL.Visible     = true;
                            hypURL.NavigateUrl = ds.Tables[0].Rows[0]["url"].ToString();
                        }
                        if (ds.Tables[0].Rows[0]["screenshot"].ToString() != "")
                        {
                            panUploaded.Visible   = true;
                            hypUpload.NavigateUrl = ds.Tables[0].Rows[0]["screenshot"].ToString();
                        }
                        else
                        {
                            panUpload.Visible = true;
                            hypUpload.Visible = false;
                        }
                        radRelease1.SelectedValue = ds.Tables[0].Rows[0]["release1"].ToString();
                        radRelease2.SelectedValue = ds.Tables[0].Rows[0]["release2"].ToString();
                        int intStatus = Int32.Parse(ds.Tables[0].Rows[0]["status"].ToString());
                        lblStatus.Text = oEnhancement.Status(intID);
                        int intRR = Int32.Parse(ds.Tables[0].Rows[0]["rrid"].ToString());
                        //foreach (DataRow drStep in dsSteps.Tables[0].Rows)
                        //{
                        //    if (drStep["requires_approval"].ToString() == "1" && drStep["approved"].ToString() == "")
                        //        boolApproved = false;
                        //    if (drStep["step"].ToString() == "1")
                        //        boolFunctionalReq = true;
                        //}

                        if (intStatus != (int)EnhancementStatus.Cancelled && intStatus != (int)EnhancementStatus.Completed && intStatus != (int)EnhancementStatus.Denied && intStatus != (int)EnhancementStatus.Duplicate)
                        {
                            trSave1.Visible           = true;
                            trSave2.Visible           = true;
                            btnCancel.Visible         = true;
                            btnUpdate.Visible         = true;
                            btnCancel.CommandArgument = intRR.ToString();
                            if (intStatus == (int)EnhancementStatus.UnderReview)
                            {
                                // Request is active but not yet assigned, so nobody is working on it yet.
                            }
                            else
                            {
                                btnUpdate.Enabled           = false;
                                trLocked.Visible            = true;
                                btnDeleteAttachment.Enabled = false;
                                oTab.AddTab("Functional Requirements", "");
                                DataSet dsSteps = oEnhancement.GetSteps(intID, 1, 0);
                                if (dsSteps.Tables[0].Rows.Count == 1 && dsSteps.Tables[0].Rows[0]["completed"].ToString() != "")
                                {
                                    DataSet dsDocuments = oEnhancement.GetDocuments(intID);
                                    hypFunctionalRequirements.NavigateUrl = dsDocuments.Tables[0].Rows[0]["path"].ToString();
                                    lblDays.Text    = dsDocuments.Tables[0].Rows[0]["days"].ToString();
                                    lblRelease.Text = DateTime.Parse(dsDocuments.Tables[0].Rows[0]["release"].ToString()).ToShortDateString();

                                    if (dsSteps.Tables[0].Rows[0]["approved"].ToString() == "" && dsSteps.Tables[0].Rows[0]["rejected"].ToString() == "")
                                    {
                                        trFunctionalRequirementsDocument.Visible = true;
                                        btnFunctionalApproving.Enabled           = true;
                                        btnFunctionalRejecting.Enabled           = true;
                                        btnFunctionalRejecting.Attributes.Add("onclick", "ShowHideDiv('" + trFunctionalReject.ClientID + "','inline');ShowHideDiv('" + trFunctionalButtons.ClientID + "','none');return false;");
                                        btnFunctionalCancelReject.Attributes.Add("onclick", "ShowHideDiv('" + trFunctionalReject.ClientID + "','none');ShowHideDiv('" + trFunctionalButtons.ClientID + "','inline');return false;");
                                        btnFunctionalApproving.Attributes.Add("onclick", "ShowHideDiv('" + trFunctionalApprove.ClientID + "','inline');ShowHideDiv('" + trFunctionalButtons.ClientID + "','none');return false;");
                                        btnFunctionalCancelApprove.Attributes.Add("onclick", "ShowHideDiv('" + trFunctionalApprove.ClientID + "','none');ShowHideDiv('" + trFunctionalButtons.ClientID + "','inline');return false;");
                                        btnFunctionalReject.Attributes.Add("onclick", "return ValidateText('" + txtFunctionalReject.ClientID + "','Specify why you are rejecting the functional requirements') && confirm('Rejecting the functional requirements document will cause delays in this enhancement being released.\\n\\nAre you sure you want to reject the functional requirements document?') && ProcessButton(this) && LoadWait();");
                                        btnFunctionalApprove.Attributes.Add("onclick", "return ValidateCheck('" + chkApprove.ClientID + "','You must accept the acknowledgement to approve the functional requirements') && ProcessButton(this) && LoadWait();");
                                    }
                                    else
                                    {
                                        trFunctionalButtons.Visible = false;
                                        trFunctionalStatus.Visible  = true;
                                        if (dsSteps.Tables[0].Rows[0]["approved"].ToString() != "")
                                        {
                                            imgFunctionalStatus.ImageUrl = "/images/bigCheckBox.gif";
                                            lblFunctionalStatus.Text     = "Approved on " + dsSteps.Tables[0].Rows[0]["approved"].ToString();
                                        }
                                        if (dsSteps.Tables[0].Rows[0]["rejected"].ToString() != "")
                                        {
                                            imgFunctionalStatus.ImageUrl = "/images/bigError2.gif";
                                            lblFunctionalStatus.Text     = "Rejected on " + dsSteps.Tables[0].Rows[0]["rejected"].ToString();
                                        }
                                    }
                                }
                                oTab.AddTab("Message Thread (" + dsMessages.Tables[0].Rows.Count.ToString() + ")", "");
                                oTab.AddTab("Log (" + oEnhancement.LoadLog(intID, rptLog, lblLog) + ")", "");
                            }
                            btnMessageReplyImage.Attributes.Add("onclick", "ShowHideDiv2('" + divMessageReply.ClientID + "');return false;");
                        }
                        else
                        {
                            btnDeleteAttachment.Visible = false;
                            btnMessageReplyImage.Attributes.Add("onclick", "alert('You can only post a message to an ACTIVE thread.\\n\\nSince this thread is no longer active, additional posts have been disabled');return false;");
                            btnMessageReply.Enabled = false;
                            if (ds.Tables[0].Rows[0]["reason"].ToString() != "")
                            {
                                trComments.Visible = true;
                                lblComments.Text   = ds.Tables[0].Rows[0]["reason"].ToString();
                            }
                        }
                        lblRequestBy.Text = oUser.GetFullName(intProfile);
                        lblRequestOn.Text = DateTime.Parse(ds.Tables[0].Rows[0]["created"].ToString()).ToString();
                    }
                    strMessages = oEnhancement.GetMessages(intID, false, "#E1FFE1");
                }
            }
            else if (intIDold > 0)
            {
                // OLD ENHANCEMENT (Read Only)
                panEnhancement.Visible = true;
                DataSet ds = oCustomized.GetEnhancementByID(intIDold);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    panOld.Visible         = true;
                    lblTitle.Text          = "Edit Enhancement";
                    lblOldTitle.Text       = ds.Tables[0].Rows[0]["title"].ToString();
                    lblOldDescription.Text = ds.Tables[0].Rows[0]["description"].ToString();
                    lblOldModule.Text      = oPage.Get(Int32.Parse(ds.Tables[0].Rows[0]["pageid"].ToString()), "title");
                    lblOldNumUsers.Text    = ds.Tables[0].Rows[0]["num_users"].ToString();
                    if (ds.Tables[0].Rows[0]["url"].ToString() != "")
                    {
                        hypOldURL.NavigateUrl = ds.Tables[0].Rows[0]["url"].ToString();
                    }
                    else
                    {
                        hypOldURL.Visible = false;
                    }
                    if (ds.Tables[0].Rows[0]["path"].ToString() != "")
                    {
                        hypOldAttach.NavigateUrl = ds.Tables[0].Rows[0]["path"].ToString();
                    }
                    else
                    {
                        hypOldAttach.Visible = false;
                    }
                    lblOldStart.Text  = DateTime.Parse(ds.Tables[0].Rows[0]["startdate"].ToString()).ToShortDateString();
                    lblOldEnd.Text    = DateTime.Parse(ds.Tables[0].Rows[0]["enddate"].ToString()).ToShortDateString();
                    lblOldStatus.Text = oStatusLevel.HTMLSupport(Int32.Parse(ds.Tables[0].Rows[0]["status"].ToString()));
                    int intRelease = 0;
                    if (Int32.TryParse(ds.Tables[0].Rows[0]["release"].ToString(), out intRelease) == true && intRelease > 0)
                    {
                        lblOldRelease.Text = DateTime.Parse(oEnhancement.GetVersion(intRelease, "release")).ToLongDateString();
                    }
                    else
                    {
                        lblOldRelease.Text = "To Be Determined";
                    }
                    lblOldRequestedBy.Text = oUser.GetFullName(intProfile);
                    lblOldRequestedOn.Text = DateTime.Parse(ds.Tables[0].Rows[0]["created"].ToString()).ToString();

                    intRequest = Int32.Parse(ds.Tables[0].Rows[0]["requestid"].ToString());
                    oCustomized.UpdateEnhancementNew(intRequest, 0);
                    panMessage.Visible = (oCustomized.GetMessages(intRequest, 0).Tables[0].Rows.Count > 0);
                    strMessages        = oCustomized.GetMessages(intRequest, false, "#E1FFE1");
                    if (ds.Tables[0].Rows[0]["status"].ToString() == "2" || ds.Tables[0].Rows[0]["status"].ToString() == "7")
                    {
                        btnMessage.Attributes.Add("onclick", "ShowHideDiv2('" + divMessage.ClientID + "');return false;");
                    }
                    else
                    {
                        btnMessage.Attributes.Add("onclick", "alert('You can only post a message to an ACTIVE thread.\\n\\nSince this thread is no longer active, additional posts have been disabled');return false;");
                    }
                }
            }
            else
            {
                //panNoEnhancement.Visible = true;
                panEnhancement.Visible   = true;
                hypCommunity.NavigateUrl = oVariable.Community();
                panUpload.Visible        = true;
                lblRequestBy.Text        = oUser.GetFullName(intProfile);
                lblRequestOn.Text        = DateTime.Now.ToString();
                lblTitle.Text            = oPage.Get(intPage, "title");
                btnSave.Visible          = true;
                trSave1.Visible          = true;
                trSave2.Visible          = true;
                panNew.Visible           = true;
            }
            strMenuTab1 = oTab.GetTabs();

            btnSave.Attributes.Add("onclick", "return ValidateText('" + txtTitle.ClientID + "','Please enter a title')" +
                                   " && ValidateText('" + txtDescription.ClientID + "','Please enter a description')" +
                                   " && ValidateDropDown('" + ddlUsers.ClientID + "','Please make a selection for the number of users benefited')" +
                                   " && ValidateRadioList('" + radRelease1.ClientID + "','Please make a selection for your preferred release date')" +
                                   " && ValidateRadioList('" + radRelease2.ClientID + "','Please make a selection for your alternative release date')" +
                                   " && ProcessButton(this) && LoadWait()" +
                                   ";");
            btnUpdate.Attributes.Add("onclick", "return ValidateText('" + txtTitle.ClientID + "','Please enter a title')" +
                                     " && ValidateText('" + txtDescription.ClientID + "','Please enter a description')" +
                                     " && ValidateDropDown('" + ddlUsers.ClientID + "','Please make a selection for the number of users benefited')" +
                                     " && ValidateRadioList('" + radRelease1.ClientID + "','Please make a selection for your preferred release date')" +
                                     " && ValidateRadioList('" + radRelease2.ClientID + "','Please make a selection for your alternative release date')" +
                                     " && ProcessButton(this) && LoadWait()" +
                                     ";");
            btnCancel.Attributes.Add("onclick", "return confirm('WARNING: Any changes related to this enhancement and the ClearView system will be removed.\\n\\nAre you sure you want to cancel this enhancement?') && ProcessButton(this) && LoadWait();");
            btnResponse.Attributes.Add("onclick", "return ValidateText('" + txtResponse.ClientID + "','Please enter a response') && ProcessButton(this) && LoadWait();;");
            btnMessageReply.Attributes.Add("onclick", "return ValidateText('" + txtMessageReply.ClientID + "','Please enter a response') && ProcessButton(this) && LoadWait();;");
            btnDeleteAttachment.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this file?') && ProcessButton(this) && LoadWait();;");
        }
Esempio n. 29
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Cookies["loginreferrer"].Value   = Request.Path;
            Response.Cookies["loginreferrer"].Expires = DateTime.Now.AddDays(30);
            if (Request.Cookies["adminid"] != null && Request.Cookies["adminid"].Value != "")
            {
                intProfile = Int32.Parse(Request.Cookies["adminid"].Value);
            }
            else
            {
                Response.Redirect("/admin/login.aspx");
            }
            oDesign          = new Design(intProfile, dsn);
            oOperatingSystem = new OperatingSystems(intProfile, dsn);
            oClass           = new Classes(intProfile, dsn);
            oEnvironment     = new Environments(intProfile, dsn);
            oFunction        = new Functions(intProfile, dsn, intEnvironment);
            oLocation        = new Locations(intProfile, dsn);
            oServerName      = new ServerName(intProfile, dsn);

            int intQuestion           = 0;
            int intQuestionDisplay    = 0;
            int intPhase              = 0;
            int intPhaseDisplay       = 0;
            int intClassID            = 0;
            int intOSID               = 0;
            int intEnvironmentClassID = 0;
            int intEnvironmentID      = 0;
            int intLocationID         = 0;
            int intModelID            = 0;
            int intComponentID        = 0;
            int intApplicationID      = 0;
            int intSubApplicationID   = 0;

            if (!IsPostBack)
            {
                ddlFields.DataTextField  = "name";
                ddlFields.DataValueField = "name";
                ddlFields.DataSource     = oFunction.GetSystemTableColumns("cv_designs");
                ddlFields.DataBind();
                ddlFields.Items.Insert(0, new ListItem("-- SELECT --", ""));
            }
            if (Request.QueryString["id"] == null)
            {
                if (Request.QueryString["parent"] == null)
                {
                    LoadTree(oTreeResponses);
                }
                else
                {
                    panAdd.Visible = true;
                    intQuestion    = Int32.Parse(Request.QueryString["parent"]);
                    string strField = oDesign.GetQuestion(intQuestion, "related_field");
                    if (strField != "")
                    {
                        ddlFields.SelectedValue = strField;
                        ddlFields.Enabled       = false;
                    }
                    strDisabled         = "<p><img src=\"/images/bigAlert.gif\" border=\"0\" align=\"absmiddle\"/> <b>This section is only available when updating an existing item</b></p>";
                    txtQuantityMin.Text = "0";
                    txtQuantityMax.Text = "0";
                    btnOrder.Enabled    = false;
                    btnDelete.Enabled   = false;
                }
            }
            else
            {
                if (Request.QueryString["save"] != null)
                {
                    trSave.Visible = true;
                }
                panAdd.Visible = true;
                intID          = Int32.Parse(Request.QueryString["id"]);
                if (!IsPostBack)
                {
                    DataSet ds = oDesign.GetResponse(intID);
                    hdnId.Value      = intID.ToString();
                    txtAdmin.Text    = ds.Tables[0].Rows[0]["admin"].ToString();
                    txtResponse.Text = ds.Tables[0].Rows[0]["response"].ToString();
                    txtSummary.Text  = ds.Tables[0].Rows[0]["summary"].ToString();
                    lblName.Text     = txtAdmin.Text;
                    Int32.TryParse(ds.Tables[0].Rows[0]["questionid"].ToString(), out intQuestion);
                    Int32.TryParse(oDesign.GetQuestion(intQuestion, "display"), out intQuestionDisplay);
                    Int32.TryParse(oDesign.GetQuestion(intQuestion, "phaseid"), out intPhase);
                    Int32.TryParse(oDesign.GetPhase(intPhase, "display"), out intPhaseDisplay);
                    string strField = oDesign.GetQuestion(intQuestion, "related_field");
                    if (strField != "")
                    {
                        ddlFields.SelectedValue = strField;
                        ddlFields.Enabled       = false;
                    }
                    txtValue.Enabled = false;
                    txtValue.Text    = "Not Available";
                    if (Int32.TryParse(ds.Tables[0].Rows[0]["set_classid"].ToString(), out intClassID) == true && intClassID > 0)
                    {
                        chkClass.Checked = true;
                        trClass.Visible  = true;
                    }
                    else if (Int32.TryParse(ds.Tables[0].Rows[0]["set_osid"].ToString(), out intOSID) == true && intOSID > 0)
                    {
                        chkOS.Checked = true;
                        trOS.Visible  = true;
                    }
                    else if (Int32.TryParse(ds.Tables[0].Rows[0]["set_componentid"].ToString(), out intComponentID) == true && intComponentID > 0)
                    {
                        chkComponent.Checked = true;
                        trComponent1.Visible = true;
                        trComponent2.Visible = true;
                        ddlFields.Enabled    = false;
                    }
                    else if (Int32.TryParse(ds.Tables[0].Rows[0]["set_environmentclassid"].ToString(), out intEnvironmentClassID) == true && intEnvironmentClassID > 0 && Int32.TryParse(ds.Tables[0].Rows[0]["set_environmentid"].ToString(), out intEnvironmentID) == true && intEnvironmentID > 0)
                    {
                        chkEnvironment.Checked = true;
                        trEnvironment1.Visible = true;
                        trEnvironment2.Visible = true;
                    }
                    else
                    {
                        txtValue.Enabled = true;
                        if (ddlFields.Enabled)
                        {
                            ddlFields.SelectedValue = ds.Tables[0].Rows[0]["related_field"].ToString();
                        }
                    }

                    if (Int32.TryParse(ds.Tables[0].Rows[0]["set_addressid"].ToString(), out intLocationID) == true && intLocationID > 0)
                    {
                        chkLocation.Checked = true;
                        trLocation.Visible  = true;
                    }
                    if (Int32.TryParse(ds.Tables[0].Rows[0]["set_modelid"].ToString(), out intModelID) == true && intModelID > 0)
                    {
                        chkModel.Checked = true;
                        trModel.Visible  = true;
                    }
                    if (Int32.TryParse(ds.Tables[0].Rows[0]["set_applicationid"].ToString(), out intApplicationID) == true && intApplicationID > 0)
                    {
                        chkInfrastructure.Checked = true;
                        trInfrastructure.Visible  = true;
                        if (Int32.TryParse(ds.Tables[0].Rows[0]["set_subapplicationid"].ToString(), out intSubApplicationID) == true && intSubApplicationID > 0)
                        {
                            trInfrastructure2.Style["display"] = "inline";
                        }
                    }

                    chkUnder48.Checked          = (ds.Tables[0].Rows[0]["is_under48"].ToString() == "1");
                    chkOver48.Checked           = (ds.Tables[0].Rows[0]["is_over48"].ToString() == "1");
                    chkConfidenceLock.Checked   = (ds.Tables[0].Rows[0]["is_confidence_lock"].ToString() == "1");
                    chkConfidenceUnlock.Checked = (ds.Tables[0].Rows[0]["is_confidence_unlock"].ToString() == "1");
                    chkException.Checked        = (ds.Tables[0].Rows[0]["is_exception"].ToString() == "1");
                    if (txtValue.Enabled)
                    {
                        txtValue.Text = ds.Tables[0].Rows[0]["related_value"].ToString();
                    }
                    radShowAll.Checked     = (ds.Tables[0].Rows[0]["show_all"].ToString() == "1");
                    radShowAny.Checked     = (ds.Tables[0].Rows[0]["show_any"].ToString() == "1");
                    radShow.Checked        = (radShowAll.Checked == false && radShowAny.Checked == false);
                    radHideAll.Checked     = (ds.Tables[0].Rows[0]["hide_all"].ToString() == "1");
                    radHideAny.Checked     = (ds.Tables[0].Rows[0]["hide_any"].ToString() == "1");
                    radHide.Checked        = (radHideAll.Checked == false && radHideAny.Checked == false);
                    chkVisible.Checked     = (ds.Tables[0].Rows[0]["visible"].ToString() == "1");
                    chkSelectIfOne.Checked = (ds.Tables[0].Rows[0]["select_if_one"].ToString() == "1");
                    txtQuantityMin.Text    = ds.Tables[0].Rows[0]["quantity_min"].ToString();
                    txtQuantityMax.Text    = ds.Tables[0].Rows[0]["quantity_max"].ToString();
                    chkEnabled.Checked     = (ds.Tables[0].Rows[0]["enabled"].ToString() == "1");
                    btnAdd.Text            = "Save";
                    btnAddBack.Text        = "Save & Return";

                    // Load Phase Restrictions
                    LoadRestrictions(oTreeRestrictionsDisabled, intPhaseDisplay, 1);

                    // Load Phase Restrictions
                    LoadRestrictions(oTreeRestrictionsEnabled, intPhaseDisplay, 0);

                    // Load Auto-Selections
                    LoadSelectionPhase(oTreeSelections);

                    //// Load Dynamic Questions
                    //LoadShowPhase(oTreeQuestions, intQuestionDisplay, intPhaseDisplay);

                    // Load Dynamic Responses
                    LoadShowResponses(oTreeResponsesShow, intQuestionDisplay, intPhaseDisplay, true);
                    LoadShowResponses(oTreeResponsesHide, intQuestionDisplay, intPhaseDisplay, false);

                    // Load Approvals
                    LoadApprovals(oTreeApprovals);

                    // Load Configuration
                    StringBuilder strConfiguration = new StringBuilder();
                    strConfiguration.Append("<p><b>Responses causing this option to be auto-selected:</b><br/>");
                    DataSet dsSelections = oDesign.GetSelectionSet(intID);
                    foreach (DataRow drSelection in dsSelections.Tables[0].Rows)
                    {
                        int intResponse = Int32.Parse(drSelection["responseid"].ToString());
                        strConfiguration.Append("&nbsp;&nbsp;-&nbsp;<a href=\"responses.aspx?id=" + intResponse.ToString() + "&menu_tab=3\">");
                        strConfiguration.Append(oDesign.GetResponse(intResponse, "response"));
                        strConfiguration.Append("</a><br/>");
                    }
                    strConfiguration.Append("</p>");
                    strConfiguration.Append("<p><b>Selecting this response causes the following questions to be SHOWN:</b><br/>");
                    dsSelections = oDesign.GetShowsRelated(intID, 0);
                    foreach (DataRow drSelection in dsSelections.Tables[0].Rows)
                    {
                        int intConfigQuestion = Int32.Parse(drSelection["questionid"].ToString());
                        strConfiguration.Append("&nbsp;&nbsp;-&nbsp;<a href=\"questions.aspx?id=" + intConfigQuestion.ToString() + "&menu_tab=2\">");
                        strConfiguration.Append(oDesign.GetQuestion(intConfigQuestion, "question"));
                        strConfiguration.Append("</a><br/>");
                    }
                    strConfiguration.Append("</p>");
                    strConfiguration.Append("<p><b>Selecting this response causes the following questions to be HIDDEN:</b><br/>");
                    dsSelections = oDesign.GetShowsRelated(intID, 1);
                    foreach (DataRow drSelection in dsSelections.Tables[0].Rows)
                    {
                        int intConfigQuestion = Int32.Parse(drSelection["questionid"].ToString());
                        strConfiguration.Append("&nbsp;&nbsp;-&nbsp;<a href=\"questions.aspx?id=" + intConfigQuestion.ToString() + "&menu_tab=2\">");
                        strConfiguration.Append(oDesign.GetQuestion(intConfigQuestion, "question"));
                        strConfiguration.Append("</a><br/>");
                    }
                    strConfiguration.Append("</p>");
                    strConfiguration.Append("<p><b>Selecting this response causes the following responses to be SHOWN:</b><br/>");
                    dsSelections = oDesign.GetShowResponse(intID, 0);
                    foreach (DataRow drSelection in dsSelections.Tables[0].Rows)
                    {
                        int intResponse = Int32.Parse(drSelection["responseid"].ToString());
                        strConfiguration.Append("&nbsp;&nbsp;-&nbsp;<a href=\"responses.aspx?id=" + intResponse.ToString() + "&menu_tab=5\">");
                        strConfiguration.Append(oDesign.GetResponse(intResponse, "response"));
                        strConfiguration.Append("</a><br/>");
                    }
                    strConfiguration.Append("</p>");
                    strConfiguration.Append("<p><b>Selecting this response causes the following responses to be HIDDEN:</b><br/>");
                    dsSelections = oDesign.GetShowResponse(intID, 1);
                    foreach (DataRow drSelection in dsSelections.Tables[0].Rows)
                    {
                        int intResponse = Int32.Parse(drSelection["responseid"].ToString());
                        strConfiguration.Append("&nbsp;&nbsp;-&nbsp;<a href=\"responses.aspx?id=" + intResponse.ToString() + "&menu_tab=5\">");
                        strConfiguration.Append(oDesign.GetResponse(intResponse, "response"));
                        strConfiguration.Append("</a><br/>");
                    }
                    strConfiguration.Append("</p>");
                    litConfiguration.Text = strConfiguration.ToString();
                }
            }
            if (!IsPostBack)
            {
                if (intQuestion > 0)
                {
                    LoadQuestion(intQuestion, intPhase);
                }
                LoadClass(intClassID, intEnvironmentClassID, intEnvironmentID);
                LoadOS(intOSID);
                LoadModel(intModelID);
                LoadComponents(intComponentID);
                LoadInfrastructure(intApplicationID, intSubApplicationID);
            }
            if (panAdd.Visible == true)
            {
                int intMenuTab = 0;
                if (Request.QueryString["menu_tab"] != null && Request.QueryString["menu_tab"] != "")
                {
                    intMenuTab = Int32.Parse(Request.QueryString["menu_tab"]);
                }
                Tab oTab = new Tab("", intMenuTab, "divMenu1", true, false);
                oTab.AddTab("Properties", "");
                oTab.AddTab("Phase Restrictions", "");
                oTab.AddTab("Auto-Response Selections", "");
                oTab.AddTab("Dynamic Questions", "");
                oTab.AddTab("Dynamic Responses", "");
                oTab.AddTab("Approvals", "");
                oTab.AddTab("Configuration", "");
                strMenuTab1 = oTab.GetTabs();
            }
            if (intLocationID > 0)
            {
                intLocation = intLocationID;
            }
            ddlEnvironmentClass.Attributes.Add("onchange", "PopulateEnvironments('" + ddlEnvironmentClass.ClientID + "','" + ddlEnvironment.ClientID + "',1);");
            ddlEnvironment.Attributes.Add("onchange", "UpdateDropDownHidden('" + ddlEnvironment.ClientID + "','" + hdnEnvironment.ClientID + "');");
            ddlProduct.Attributes.Add("onchange", "PopulateSoftwareComponents('" + ddlProduct.ClientID + "','" + ddlComponent.ClientID + "');");
            ddlComponent.Attributes.Add("onchange", "UpdateDropDownHidden('" + ddlComponent.ClientID + "','" + hdnComponent.ClientID + "');");
            strLocation       = oLocation.LoadDDL("ddlState", "ddlCity", "ddlAddress", hdnLocation.ClientID, intLocation, true, "ddlCommon");
            hdnLocation.Value = intLocation.ToString();
            btnOrder.Attributes.Add("onclick", "return OpenWindow('SUPPORTORDER','" + ddlQuestion.ClientID + "','" + hdnOrder.ClientID + "&type=D_RESPONSES" + "',false,400,400);");
            btnDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this item?');");
        }
        private void LoadServerErrors()
        {
            panError.Visible = true;
            DataSet ds = oServer.GetErrorByRequest(intRequest, oService.GetItemId(intService), intNumber);

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                int intAsset = 0;
                if (dr["assetid"].ToString() != "")
                {
                    intAsset = Int32.Parse(dr["assetid"].ToString());
                }

                lblAsset.Text = intAsset.ToString();
                lblStep.Text  = dr["step"].ToString();
                lblError.Text = dr["reason"].ToString();

                if (dr["fixed"].ToString() != "")
                {
                    strError += "<tr class=\"deletedRow\">";
                    strError += "<td></td>";
                }
                else
                {
                    strError += "<tr>";
                    strError += "<td></td>";
                }
                if (intAsset == 0)
                {
                    strError += "<td>" + dr["servername"].ToString() + "</td>";
                }
                else
                {
                    string strILO = oAsset.GetServerOrBlade(intAsset, "ilo");
                    if (strILO != "")
                    {
                        strError += "<td><a href=\"https://" + strILO + "\" target=\"_blank\">" + dr["servername"].ToString() + "</a></td>";
                    }
                    else
                    {
                        strError += "<td>" + dr["servername"].ToString() + "</td>";
                    }
                }
                strError += "<td>" + dr["reason"].ToString() + "</td>";
                strError += "<td><a href=\"javascript:void(0);\" onclick=\"OpenNewWindowMenu('/datapoint/service/design.aspx?id=" + oFunction.encryptQueryString(dr["designid"].ToString()) + "','800','600')\">" + dr["designid"].ToString() + "</a></td>";
                if (String.IsNullOrEmpty(dr["incident"].ToString()))
                {
                    strError += "<td>---</td>";
                }
                else
                {
                    strError += "<td>" + dr["incident"].ToString() + "</td>";
                }
                strError += "<td>" + DateTime.Parse(dr["created"].ToString()).ToString() + "</td>";
                strError += "</tr>";
            }
            strError = "<table cellpadding=\"3\" cellspacing=\"2\" width=\"100%\" border=\"0\" style=\"border:solid 1px #CCCCCC\"><tr bgcolor=\"#EEEEEE\"><td><b></b></td><td><b>Server Name</b></td><td><b>Reason</b></td><td><b>DesignID</b></td><td><b>Incident#</b></td><td><b>Created</b></td></tr>" + strError + "</table>";

            //strError = "";

            Tab oTab = new Tab("", 0, "divMenu1", true, false);

            rptRelated.DataSource = oError.Gets(lblError.Text, 0);
            rptRelated.DataBind();
            int intTab = 0;

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

            btnApplyNewSolution.Attributes.Add("onclick", "return ValidateText('" + txtProblem.ClientID + "','Please enter the problem') && ValidateText('" + txtResolution.ClientID + "','Please enter the resolution') && ValidateDropDown('" + ddlCauseCode.ClientID + "','Please select a cause code') && confirm('Are you sure you want to mark this error as fixed?') && ProcessButton(this);");
            btnNewSolution.Attributes.Add("onclick", "ShowHideDiv('" + trSolution.ClientID + "','inline');return false;");
            btnNoSolution.Attributes.Add("onclick", "return confirm('Are you sure you do not want to associate this error with any solution?');");
        }