コード例 #1
0
        protected override IAsyncResult BeginExecute(AsyncCodeActivityContext context, AsyncCallback callback, object state)
        {
            var confidence = Confidence.Get(context);
            var language   = Language.Get(context);
            var serviceAcc = ServiceAccountFile.Get(context);

            var task = ExecuteAsync(context, confidence, language, serviceAcc);
            var tacs = new TaskCompletionSource <string>(state);

            task.ContinueWith(t =>
            {
                if (t.IsFaulted)
                {
                    tacs.TrySetException(t.Exception.InnerExceptions);
                }
                else if (t.IsCanceled)
                {
                    tacs.TrySetCanceled();
                }
                else
                {
                    tacs.TrySetResult(t.Result);
                }
                callback?.Invoke(tacs.Task);
            });

            return(tacs.Task);
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile        = Int32.Parse(Request.Cookies["profileid"].Value);
            oPage             = new Pages(intProfile, dsn);
            oUser             = new Users(intProfile, dsn);
            oPlatform         = new Platforms(intProfile, dsn);
            oAsset            = new Asset(intProfile, dsnAsset);
            oIPAddresses      = new IPAddresses(intProfile, dsnIP, dsn);
            oLocation         = new Locations(intProfile, dsn);
            oHost             = new Host(intProfile, dsn);
            oForecast         = new Forecast(intProfile, dsn);
            oModelsProperties = new ModelsProperties(intProfile, dsn);
            oModel            = new Models(intProfile, dsn);
            oType             = new Types(intProfile, dsn);
            oConfidence       = new Confidence(intProfile, dsn);
            oClass            = new Classes(intProfile, dsn);
            oOrder            = new Orders(intProfile, dsnAsset);
            oSetting          = new Settings(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["order_add"] != null)
            {
                Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "order_add", "<script type=\"text/javascript\">alert('Device(s) successfully ordered');<" + "/" + "script>");
            }
            if (Request.QueryString["order_edit"] != null)
            {
                Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "order_edit", "<script type=\"text/javascript\">alert('Order successfully updated');<" + "/" + "script>");
            }
            if (Request.QueryString["order_delete"] != null)
            {
                Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "order_delete", "<script type=\"text/javascript\">alert('Order successfully deleted');<" + "/" + "script>");
            }
            if (!IsPostBack)
            {
                int intPlatform = 0;

                if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
                {
                    intPlatform = Int32.Parse(Request.QueryString["id"]);
                }
                if (intPlatform > 0)
                {
                    int intOrderAddress = 0;
                    LoadLists(intPlatform);
                    if (Request.QueryString["orderid"] != null && Request.QueryString["orderid"] != "")
                    {
                        panHost.Visible        = false;
                        panOrders.Visible      = false;
                        panOrderUpdate.Visible = true;
                        int     intOrder = Int32.Parse(Request.QueryString["orderid"]);
                        DataSet dsOrder  = oOrder.Get(intOrder);
                        txtOrderName.Text           = dsOrder.Tables[0].Rows[0]["name"].ToString();
                        txtOrderTracking.Text       = dsOrder.Tables[0].Rows[0]["tracking"].ToString();
                        ddlOrderModel.SelectedValue = dsOrder.Tables[0].Rows[0]["modelid"].ToString();
                        intOrderAddress             = Int32.Parse(dsOrder.Tables[0].Rows[0]["addressid"].ToString());
                        txtOrderAddress.Text        = oLocation.GetFull(intOrderAddress);
                        hdnOrderAddress.Value       = intOrderAddress.ToString();
                        int intOrderClass = Int32.Parse(dsOrder.Tables[0].Rows[0]["classid"].ToString());
                        ddlOrderClass.SelectedValue = intOrderClass.ToString();
                        int intOrderEnv = Int32.Parse(dsOrder.Tables[0].Rows[0]["environmentid"].ToString());
                        ddlOrderEnvironment.Enabled        = true;
                        ddlOrderEnvironment.DataTextField  = "name";
                        ddlOrderEnvironment.DataValueField = "id";
                        ddlOrderEnvironment.DataSource     = oClass.GetEnvironment(intOrderClass, 0);
                        ddlOrderEnvironment.DataBind();
                        ddlOrderEnvironment.Items.Insert(0, new ListItem("-- SELECT --", "0"));
                        ddlOrderEnvironment.SelectedValue = intOrderEnv.ToString();
                        hdnOrderEnvironment.Value         = intOrderEnv.ToString();
                        txtOrderQuantity.Text             = dsOrder.Tables[0].Rows[0]["quantity"].ToString();
                        txtOrderDate.Text            = DateTime.Parse(dsOrder.Tables[0].Rows[0]["ordered"].ToString()).ToShortDateString();
                        ddlOrderStatus.SelectedValue = dsOrder.Tables[0].Rows[0]["status"].ToString();
                        txtOrderComments.Text        = dsOrder.Tables[0].Rows[0]["comments"].ToString();
                        btnAddOrder.Visible          = false;
                        btnUpdateOrder.Attributes.Add("onclick", "return ValidateText('" + txtOrderTracking.ClientID + "','Please enter a tracking number')" +
                                                      " && ValidateDropDown('" + ddlOrderModel.ClientID + "','Please select a model')" +
                                                      " && ValidateHidden0('" + hdnOrderAddress.ClientID + "','" + txtOrderAddress.ClientID + "','Please select a location')" +
                                                      " && ValidateDropDown('" + ddlOrderClass.ClientID + "','Please select a class')" +
                                                      " && ValidateDropDown('" + ddlOrderEnvironment.ClientID + "','Please select an environment')" +
                                                      " && ValidateNumber0('" + txtOrderQuantity.ClientID + "','Please enter a valid quantity')" +
                                                      " && ValidateDate('" + txtOrderDate.ClientID + "','Please enter a valid order date')" +
                                                      " && ProcessButton(this)" +
                                                      ";");
                    }
                    else
                    {
                        intOrderAddress      = intLocation;
                        rptOrders.DataSource = oOrder.Gets(intPlatform);
                        rptOrders.DataBind();
                        lblNoOrders.Visible = (rptOrders.Items.Count == 0);
                        foreach (RepeaterItem ri in rptOrders.Items)
                        {
                            Label lblQuantity = (Label)ri.FindControl("lblQuantity");
                            Label lblReceived = (Label)ri.FindControl("lblReceived");
                            int   intQuantity = Int32.Parse(lblQuantity.Text);
                            int   intReceived = Int32.Parse(lblReceived.Text);
                            if (intReceived > 0)
                            {
                                if (intQuantity == intReceived)
                                {
                                    Button btnRemoveOrder = (Button)ri.FindControl("btnRemoveOrder");
                                    btnRemoveOrder.Attributes.Add("onclick", "return confirm('Are you sure you want to remove this order?\\n\\nNOTE: This does not cancel the order. It simply removes it from this view.');");
                                    btnRemoveOrder.Enabled = true;
                                }
                                Panel panRemove = (Panel)ri.FindControl("panRemove");
                                panRemove.Visible = true;
                            }
                            else
                            {
                                Panel panEdit = (Panel)ri.FindControl("panEdit");
                                panEdit.Visible = true;
                                Button btnDeleteOrder = (Button)ri.FindControl("btnDeleteOrder");
                                btnDeleteOrder.Attributes.Add("onclick", "return confirm('Are you sure you want to cancel this order?');");
                            }
                        }
                        btnUpdateOrder.Visible = false;
                        btnAddOrder.Attributes.Add("onclick", "return ValidateText('" + txtOrderTracking.ClientID + "','Please enter a tracking number')" +
                                                   " && ValidateDropDown('" + ddlOrderModel.ClientID + "','Please select a model')" +
                                                   " && ValidateHidden0('" + hdnOrderAddress.ClientID + "','" + txtOrderAddress.ClientID + "','Please select a location')" +
                                                   " && ValidateDropDown('" + ddlOrderClass.ClientID + "','Please select a class')" +
                                                   " && ValidateDropDown('" + ddlOrderEnvironment.ClientID + "','Please select an environment')" +
                                                   " && ValidateNumber0('" + txtOrderQuantity.ClientID + "','Please enter a valid quantity')" +
                                                   " && ValidateDate('" + txtOrderDate.ClientID + "','Please enter a valid order date')" +
                                                   " && ProcessButton(this)" +
                                                   ";");
                    }
                    if (intOrderAddress > 0)
                    {
                        txtOrderAddress.Text = oLocation.GetFull(intOrderAddress);
                    }
                    imgOrderDate.Attributes.Add("onclick", "return ShowCalendar('" + txtOrderDate.ClientID + "');");
                    ddlOrderClass.Attributes.Add("onchange", "PopulateEnvironments('" + ddlOrderClass.ClientID + "','" + ddlOrderEnvironment.ClientID + "',0);");
                    ddlOrderEnvironment.Attributes.Add("onchange", "UpdateDropDownHidden('" + ddlOrderEnvironment.ClientID + "','" + hdnOrderEnvironment.ClientID + "');");
                    btnOrderAddress.Attributes.Add("onclick", "return OpenLocations('" + hdnOrderAddress.ClientID + "','" + txtOrderAddress.ClientID + "');");
                    hdnOrderAddress.Value = intOrderAddress.ToString();
                    rptHosts.DataSource   = oForecast.GetAnswersPlatform(intPlatform);
                    rptHosts.DataBind();
                    foreach (RepeaterItem ri in rptHosts.Items)
                    {
                        Label  lblComplete  = (Label)ri.FindControl("lblComplete");
                        Button btnEdit      = (Button)ri.FindControl("btnEdit");
                        Button btnDelete    = (Button)ri.FindControl("btnDelete");
                        Button btnExecute   = (Button)ri.FindControl("btnExecute");
                        Button btnConfigure = (Button)ri.FindControl("btnConfigure");
                        Label  lblHost      = (Label)ri.FindControl("lblHost");
                        int    intHost      = Int32.Parse(lblHost.Text);
                        if (lblComplete.Text != "")
                        {
                            btnEdit.Enabled    = false;
                            btnDelete.Enabled  = false;
                            btnExecute.Enabled = false;
                            btnConfigure.Attributes.Add("onclick", "return OpenWindow('DEPLOY_HOST','" + oHost.Get(intHost, "path") + "?hostid=" + lblHost.Text + "&id=" + btnConfigure.CommandArgument + "');");
                        }
                        else
                        {
                            btnConfigure.Enabled = false;
                            Label lblRequestId  = (Label)ri.FindControl("lblRequestId");
                            Label lblAnswer     = (Label)ri.FindControl("lblAnswer");
                            int   intID         = Int32.Parse(lblAnswer.Text);
                            int   intModel      = Int32.Parse(oHost.Get(intHost, "modelid"));
                            int   intType       = oModel.GetType(Int32.Parse(oModelsProperties.Get(intModel, "modelid")));
                            Label lblCommitment = (Label)ri.FindControl("lblCommitment");
                            btnEdit.Attributes.Add("onclick", "return OpenWindow('INVENTORY_HOST','?id=" + intPlatform.ToString() + "&hostid=" + intID.ToString() + "');");
                            btnDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this line item?');");
                            if (oConfidence.Get(Int32.Parse(oForecast.GetAnswer(intID, "confidenceid")), "name").ToUpper().Contains("100") == true)
                            {
                                int intRequestID = 0;
                                if (lblRequestId.Text != "")
                                {
                                    intRequestID = Int32.Parse(lblRequestId.Text);
                                }
                                if (lblCommitment.Text == DateTime.Today.ToShortDateString() || (lblCommitment.Text != "" && DateTime.Parse(lblCommitment.Text) < DateTime.Today) || intRequestID > 0)
                                {
                                    btnDelete.Enabled = false;
                                    btnEdit.Text      = "View";
                                    string strExecute = oType.Get(intType, "forecast_execution_path");
                                    if (strExecute != "")
                                    {
                                        btnExecute.Attributes.Add("onclick", "return OpenWindow('FORECAST_EXECUTE','" + strExecute + "?id=" + intID.ToString() + "');");
                                    }
                                    else
                                    {
                                        btnExecute.Attributes.Add("onclick", "alert('Forecast execution has not been configured for asset type " + oType.Get(intType, "name") + "');return false;");
                                    }
                                }
                                else
                                {
                                    btnExecute.Enabled = false;
                                }
                            }
                            else
                            {
                                btnExecute.Enabled = false;
                            }
                        }
                    }
                    lblNone.Visible = (rptHosts.Items.Count == 0);
                    btnAddHost.Attributes.Add("onclick", "return OpenWindow('INVENTORY_HOST','?id=" + intPlatform.ToString() + "&hostid=0');");
                }
            }
        }
コード例 #3
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);
            oLocation         = new Locations(intProfile, dsn);
            oConfidence       = new Confidence(intProfile, dsn);
            oModel            = new Models(intProfile, dsn);
            oModelsProperties = new ModelsProperties(intProfile, dsn);
            oVariable         = new Variables(intEnvironment);
            oClass            = new Classes(intProfile, dsn);
            oFunction         = new Functions(intProfile, dsn, intEnvironment);
            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 (Request.QueryString["code"] != null)
            {
                Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "code", "<script type=\"text/javascript\">alert('Invalid Override Code!\\n\\nPlease contact your ClearView administrator.');<" + "/" + "script>");
            }
            if (!IsPostBack)
            {
                LoadLists();
            }
            lblBurn.Text = DateTime.Today.AddDays(14).ToShortDateString();
            if (intID > 0)
            {
                DataSet ds = oForecast.GetAnswer(intID);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    bool boolHundred   = false;
                    int  intConfidence = Int32.Parse(ds.Tables[0].Rows[0]["confidenceid"].ToString());
                    if (intConfidence > 0)
                    {
                        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());
                    intQuantity = Int32.Parse(ds.Tables[0].Rows[0]["quantity"].ToString());
                    switch (ds.Tables[0].Rows[0]["override"].ToString())
                    {
                    case "-10":
                        panOverride.Visible  = true;
                        boolOverrideRejected = true;
                        lblStatus.Text       = "<img src=\"/images/error.gif\" border=\"0\" align=\"absmiddle\"/> Rejected by the Review Board";
                        lblStatusSub.Text    = "The board has reviewed your overridden design and has denied your request. Please select &quot;No&quot; to the Override question located on the first page to continue.";
                        panComments.Visible  = true;
                        lblComments.Text     = ds.Tables[0].Rows[0]["comments"].ToString();
                        break;

                    case "-1":
                        panOverride.Visible = true;
                        boolOverridePending = true;
                        lblStatus.Text      = "<img src=\"/images/pending.gif\" border=\"0\" align=\"absmiddle\"/> Pending Approval from Review Board";
                        lblStatusSub.Text   = "The board has been contacted and is currently reviewing your design. You will be contacted when your design has been reviewed. <br/><b>NOTE:</b> Because overridden designs require approval, the on-demand SLA no longer applies. The SLA for overridden designs is 15 days.";
                        lblComments.Text    = ds.Tables[0].Rows[0]["comments"].ToString();
                        break;

                    case "0":
                        panOverride.Visible = false;
                        boolOverrideNone    = true;
                        break;

                    case "1":
                        panOverride.Visible = true;
                        boolOverrideAlready = true;
                        lblStatus.Text      = "<img src=\"/images/check.gif\" border=\"0\" align=\"absmiddle\"/> Approved by the Review Board";
                        lblStatusSub.Text   = "The board has reviewed your overridden design and has accepted your request. You may now continue with the configuraion of your design.";
                        panComments.Visible = true;
                        lblComments.Text    = ds.Tables[0].Rows[0]["comments"].ToString();
                        break;
                    }
                    lblComments.Text = ds.Tables[0].Rows[0]["comments"].ToString();
                    if (lblComments.Text == "")
                    {
                        lblComments.Text = "<i>None</i>";
                    }
                    DataSet dsSteps = oForecast.GetSteps(intPlatform, 1);
                    if (dsSteps.Tables[0].Rows.Count == intStep)
                    {
                        btnNext.Text = "Finish";
                    }
                    if (intStep == 0 || intStep == 1)
                    {
                        btnBack.Enabled = false;
                    }
                    boolRecoveryOne  = (oForecast.IsDRUnder48(intID, false) && oForecast.IsDROneToOne(intID));
                    boolRecoveryMany = (oForecast.IsDRUnder48(intID, false) && oForecast.IsDRManyToOne(intID));
                    boolHA           = oForecast.IsHARoom(intID);
                    int intServerModel = oForecast.GetModel(intID);
                    intModel = intServerModel;
                    if (oModelsProperties.Get(intServerModel).Tables[0].Rows.Count > 0)
                    {
                        intModel = Int32.Parse(oModelsProperties.Get(intServerModel, "modelid"));
                    }
                    if (!IsPostBack)
                    {
                        int     intCount      = 0;
                        bool    boolCompleted = true;
                        string  strCompleted  = "";
                        DataSet dsStepsDone   = oForecast.GetStepsDone(intID, 0);
                        foreach (DataRow drStep in dsSteps.Tables[0].Rows)
                        {
                            intCount++;
                            if (dsStepsDone.Tables[0].Rows[intCount - 1]["done"].ToString() == "0")
                            {
                                if (Int32.Parse(dsStepsDone.Tables[0].Rows[intCount - 1]["step"].ToString()) != dsStepsDone.Tables[0].Rows.Count)
                                {
                                    boolCompleted = false;
                                    strCompleted  = dsStepsDone.Tables[0].Rows[intCount - 1]["step"].ToString();
                                    break;
                                }
                            }
                        }
                        panHA.Visible = boolHA;
                        txtHA.Text    = ds.Tables[0].Rows[0]["ha"].ToString();
                        if (txtHA.Text == "0")
                        {
                            txtHA.Text = "";
                        }
                        panRecovery.Visible = (boolRecoveryMany == true);
                        if (ds.Tables[0].Rows[0]["implementation"].ToString() != "")
                        {
                            txtDate.Text = DateTime.Parse(ds.Tables[0].Rows[0]["implementation"].ToString()).ToShortDateString();
                        }
                        ddlConfidence.SelectedValue = ds.Tables[0].Rows[0]["confidenceid"].ToString();
                        txtRecovery.Text            = ds.Tables[0].Rows[0]["recovery_number"].ToString();
                        if (txtRecovery.Text == "0")
                        {
                            txtRecovery.Text = "";
                        }
                        imgDate.Attributes.Add("onclick", "return ShowCalendar('" + txtDate.ClientID + "');");
                        btnNext.Attributes.Add("onclick", "return ValidateDate('" + txtDate.ClientID + "','Please enter a valid Start Build Date')" +
                                               " && ValidateDateToday('" + txtDate.ClientID + "','The Start Build Date must occur after today')" +
                                               " && EnsureConfidence('" + ddlConfidence.ClientID + "'," + (boolCompleted ? "true" : "false") + ",'NOTE: You have not completed this design.\\n\\nOnly completed designs can be set to 100% confidence. Please set the confidence to 80% and save to review your incomplete steps.\\n\\nStep: " + strCompleted + "')" +
                                               " && EnsureConfidence2('" + ddlConfidence.ClientID + "'," + (intModel == 0 ? "true" : "false") + ",'NOTE: ClearView is unable to find a solution for your design.\\n\\nOnly designs with available solutions can be set to 100% or 80% confidence level.')" +
                                               " && EnsureOverride(" + (boolOverrideNone == true ? "false" : "true") + ",'" + (boolOverrideRejected == true ? "The override for this design was rejected. Please set uncheck the override option (located on the first page) to continue." : "") + "')" +
                                               " && ForeRecoveryLast(" + (boolRecoveryMany ? "true" : "false") + ",'" + txtRecovery.ClientID + "'," + intQuantity.ToString() + ")" +
                                               " && ForeHALast(" + (boolHA ? "true" : "false") + ",'" + txtHA.ClientID + "'," + intQuantity.ToString() + ")" +
                                               ";");
                        btnUpdate.Attributes.Add("onclick", "return ValidateDate('" + txtDate.ClientID + "','Please enter a valid Start Build Date')" +
                                                 " && ValidateDateToday('" + txtDate.ClientID + "','The Start Build Date must occur after today')" +
                                                 " && EnsureConfidence('" + ddlConfidence.ClientID + "'," + (boolCompleted ? "true" : "false") + ",'NOTE: You have not completed this design.\\n\\nOnly completed designs can be set to 100% confidence. Please set the confidence to 80% and save to review your incomplete steps.\\n\\nStep: " + strCompleted + "')" +
                                                 " && EnsureConfidence2('" + ddlConfidence.ClientID + "'," + (intModel == 0 ? "true" : "false") + ",'NOTE: ClearView is unable to find a solution for your design.\\n\\nOnly designs with available solutions can be set to 100% or 80% confidence level.')" +
                                                 " && EnsureOverride(" + (boolOverrideNone == true ? "false" : "true") + ",'" + (boolOverrideRejected == true ? "The override for this design was rejected. Please set uncheck the override option (located on the first page) to continue." : "") + "')" +
                                                 " && ForeRecoveryLast(" + (boolRecoveryMany ? "true" : "false") + ",'" + txtRecovery.ClientID + "'," + intQuantity.ToString() + ")" +
                                                 " && ForeHALast(" + (boolHA ? "true" : "false") + ",'" + txtHA.ClientID + "'," + intQuantity.ToString() + ")" +
                                                 ";");
                        btnClose.Attributes.Add("onclick", "return window.close();");
                    }
                }
            }
        }
コード例 #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     intProfile       = Int32.Parse(Request.Cookies["profileid"].Value);
     oForecast        = new Forecast(intProfile, dsn);
     oServerName      = new ServerName(intProfile, dsn);
     oServer          = new Servers(intProfile, dsn);
     oPage            = new Pages(intProfile, dsn);
     oOperatingSystem = new OperatingSystems(intProfile, dsn);
     if (Request.QueryString["pageid"] != null && Request.QueryString["pageid"] != "")
     {
         intPage = Int32.Parse(Request.QueryString["pageid"]);
     }
     if (Request.QueryString["action"] != null && Request.QueryString["action"] != "")
     {
         panFinish.Visible = true;
     }
     else
     {
         if (Request.QueryString["applicationid"] != null && Request.QueryString["applicationid"] != "")
         {
             intApplication = Int32.Parse(Request.QueryString["applicationid"]);
         }
         if (Request.Cookies["application"] != null && Request.Cookies["application"].Value != "")
         {
             intApplication = Int32.Parse(Request.Cookies["application"].Value);
         }
         if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
         {
             intAnswer = Int32.Parse(Request.QueryString["id"]);
         }
         if (!IsPostBack)
         {
             if (intAnswer > 0)
             {
                 DataSet ds = oForecast.GetAnswer(intAnswer);
                 if (ds.Tables[0].Rows.Count > 0)
                 {
                     Projects         oProject          = new Projects(intProfile, dsn);
                     Requests         oRequest          = new Requests(intProfile, dsn);
                     Organizations    oOrganization     = new Organizations(intProfile, dsn);
                     Segment          oSegment          = new Segment(intProfile, dsn);
                     Platforms        oPlatform         = new Platforms(intProfile, dsn);
                     ModelsProperties oModelsProperties = new ModelsProperties(intProfile, dsn);
                     Confidence       oConfidence       = new Confidence(intProfile, dsn);
                     Classes          oClass            = new Classes(intProfile, dsn);
                     Environments     oEnvironment      = new Environments(intProfile, dsn);
                     Locations        oLocation         = new Locations(intProfile, dsn);
                     Users            oUser             = new Users(intProfile, dsn);
                     lblID.Text = intAnswer.ToString();
                     int intForecast = Int32.Parse(ds.Tables[0].Rows[0]["forecastid"].ToString());
                     int intRequest  = Int32.Parse(oForecast.Get(intForecast, "requestid"));
                     int intProject  = oRequest.GetProjectNumber(intRequest);
                     lblName.Text      = oProject.Get(intProject, "name");
                     lblNumber.Text    = oProject.Get(intProject, "number");
                     lblPortfolio.Text = oOrganization.GetName(Int32.Parse(oProject.Get(intProject, "organization")));
                     lblSegment.Text   = oSegment.GetName(Int32.Parse(oProject.Get(intProject, "segmentid")));
                     lblPlatform.Text  = oPlatform.GetName(Int32.Parse(ds.Tables[0].Rows[0]["platformid"].ToString()));
                     lblNickname.Text  = ds.Tables[0].Rows[0]["name"].ToString();
                     int intModel = Int32.Parse(ds.Tables[0].Rows[0]["modelid"].ToString());
                     if (intModel == 0)
                     {
                         intModel = oForecast.GetModelAsset(intAnswer);
                     }
                     if (intModel == 0)
                     {
                         intModel = oForecast.GetModel(intAnswer);
                     }
                     lblModel.Text      = oModelsProperties.Get(intModel, "name");
                     lblCommitment.Text = DateTime.Parse(ds.Tables[0].Rows[0]["implementation"].ToString()).ToLongDateString();
                     lblQuantity.Text   = ds.Tables[0].Rows[0]["quantity"].ToString();
                     lblConfidence.Text = oConfidence.Get(Int32.Parse(ds.Tables[0].Rows[0]["confidenceid"].ToString()), "name");
                     int intClass = Int32.Parse(ds.Tables[0].Rows[0]["classid"].ToString());
                     lblClass.Text = oClass.Get(intClass, "name");
                     if (oClass.IsProd(intClass))
                     {
                         panTest.Visible = true;
                         lblTest.Text    = (ds.Tables[0].Rows[0]["test"].ToString() == "1" ? "Yes" : "No");
                     }
                     lblEnvironment.Text = oEnvironment.Get(Int32.Parse(ds.Tables[0].Rows[0]["environmentid"].ToString()), "name");
                     lblLocation.Text    = oLocation.GetFull(Int32.Parse(ds.Tables[0].Rows[0]["addressid"].ToString()));
                     lblIP.Text          = ds.Tables[0].Rows[0]["workstation"].ToString();
                     lblDesignedBy.Text  = oUser.GetFullName(Int32.Parse(ds.Tables[0].Rows[0]["userid"].ToString()));
                     lblRequestor.Text   = ds.Tables[0].Rows[0]["userid"].ToString();
                     lblDesignedOn.Text  = DateTime.Parse(ds.Tables[0].Rows[0]["created"].ToString()).ToString();
                     lblUpdated.Text     = DateTime.Parse(ds.Tables[0].Rows[0]["modified"].ToString()).ToString();
                     panShow.Visible     = true;
                     btnSave.Enabled     = true;
                     // Load Components
                     rptApproval.DataSource = oServerName.GetComponentDetailUserApprovalsByUser(intProfile, intAnswer, 0);
                     rptApproval.DataBind();
                     foreach (RepeaterItem ri in rptApproval.Items)
                     {
                         int          intServer   = Int32.Parse(((Label)ri.FindControl("lblServer")).Text);
                         int          intDetail   = Int32.Parse(((Label)ri.FindControl("lblDetail")).Text);
                         RadioButton  radApprove  = (RadioButton)ri.FindControl("radApprove");
                         RadioButton  radDeny     = (RadioButton)ri.FindControl("radDeny");
                         HtmlTableRow trLicense   = (HtmlTableRow)ri.FindControl("trLicense");
                         HtmlTableRow trComments  = (HtmlTableRow)ri.FindControl("trComments");
                         TextBox      txtLicense  = (TextBox)ri.FindControl("txtLicense");
                         TextBox      txtComments = (TextBox)ri.FindControl("txtComments");
                         Label        lblOS       = (Label)ri.FindControl("lblOS");
                         int          intOS       = 0;
                         Int32.TryParse(oServer.Get(intServer, "osid"), out intOS);
                         lblOS.Text = oOperatingSystem.Get(intOS, "name");
                         radApprove.Attributes.Add("onclick", "ShowHideDiv('" + trLicense.ClientID + "','inline');ShowHideDiv('" + trComments.ClientID + "','inline');");
                         radDeny.Attributes.Add("onclick", "ShowHideDiv('" + trLicense.ClientID + "','none');ShowHideDiv('" + trComments.ClientID + "','inline');");
                         DataSet dsResult = oServerName.GetComponentDetailUserApprovals(intServer, intDetail);
                         if (dsResult.Tables[0].Rows.Count > 0)
                         {
                             // Load previous information
                             DataRow drResult = dsResult.Tables[0].Rows[0];
                             if (drResult["approved"].ToString() == "1")
                             {
                                 radApprove.Checked          = true;
                                 txtLicense.Text             = drResult["license"].ToString();
                                 trLicense.Style["display"]  = "inline";
                                 txtComments.Text            = drResult["comments"].ToString();
                                 trComments.Style["display"] = "inline";
                             }
                             if (drResult["approved"].ToString() == "0")
                             {
                                 radDeny.Checked             = true;
                                 txtComments.Text            = drResult["comments"].ToString();
                                 trComments.Style["display"] = "inline";
                             }
                         }
                     }
                 }
             }
         }
     }
 }
コード例 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile        = Int32.Parse(Request.Cookies["profileid"].Value);
            oForecast         = new Forecast(intProfile, dsn);
            oType             = new Types(intProfile, dsn);
            oModel            = new Models(intProfile, dsn);
            oModelsProperties = new ModelsProperties(intProfile, dsn);
            oPlatform         = new Platforms(intProfile, dsn);
            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;
            }
            int intCount = 0;

            if (intID > 0)
            {
                DataSet ds = oForecast.GetAnswer(intID);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    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;
                    }
                    intPlatform = Int32.Parse(ds.Tables[0].Rows[0]["platformid"].ToString());
                    int  intStep      = Int32.Parse(ds.Tables[0].Rows[0]["step"].ToString());
                    int  intClass     = Int32.Parse(ds.Tables[0].Rows[0]["classid"].ToString());
                    int  intEnv       = Int32.Parse(ds.Tables[0].Rows[0]["environmentid"].ToString());
                    int  intAddress   = Int32.Parse(ds.Tables[0].Rows[0]["addressid"].ToString());
                    int  intModel     = Int32.Parse(ds.Tables[0].Rows[0]["modelid"].ToString());
                    bool boolOverride = (ds.Tables[0].Rows[0]["override"].ToString() == "1" || ds.Tables[0].Rows[0]["override"].ToString() == "-1");
                    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;
                    }
                    if (Request.QueryString["type"] != null && Request.QueryString["type"] != "")
                    {
                        intType = Int32.Parse(Request.QueryString["type"]);
                    }
                    else if (!IsPostBack)
                    {
                        if (intModel > 0)
                        {
                            if (boolOverride == true)
                            {
                                ddlModels.SelectedValue = intModel.ToString();
                                intModel = Int32.Parse(oModelsProperties.Get(intModel, "modelid"));
                            }
                            else
                            {
                                ddlModels.SelectedValue = intModel.ToString();
                            }
                            intType = Int32.Parse(oModel.Get(intModel, "typeid"));
                        }
                    }
                    if (!IsPostBack)
                    {
                        intCount = LoadPlatform(intPlatform, intType, intClass, intEnv, intAddress);
                    }
                }
            }
            btnClose.Attributes.Add("onclick", "return window.close();");
            btnUpdate.Attributes.Add("onclick", "return ValidateDropDown('" + ddlModels.ClientID + "','Please select a model');");
        }
コード例 #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile = Int32.Parse(Request.Cookies["profileid"].Value);
            oForecast  = new Forecast(intProfile, dsn);
            oSolution  = new Solution(intProfile, dsn);
            oPlatform  = new Platforms(intProfile, dsn);
            oClass     = new Classes(intProfile, dsn);
            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 (intID > 0)
            {
                DataSet ds = oForecast.GetAnswer(intID);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    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 intClass    = Int32.Parse(ds.Tables[0].Rows[0]["classid"].ToString());
                    if (oClass.IsProd(intClass))
                    {
                        boolProduction = true;
                    }
                    int intEnvir = Int32.Parse(ds.Tables[0].Rows[0]["environmentid"].ToString());
                    int intStep  = Int32.Parse(ds.Tables[0].Rows[0]["step"].ToString());
                    intForecast      = Int32.Parse(ds.Tables[0].Rows[0]["forecastid"].ToString());
                    lblRecovery.Text = ds.Tables[0].Rows[0]["recovery_number"].ToString();
                    lblQuantity.Text = ds.Tables[0].Rows[0]["quantity"].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;
                    }
                    if (!IsPostBack)
                    {
                        LoadPlatform(intPlatform, intClass, intEnvir);
                    }
                }
            }

            Control ctrl = Page.ParseControl(strQuestions + strHidden);

            tdQuestions.Controls.Add(ctrl);

            btnNext.Attributes.Add("onclick", "return " + strAttributes);
            btnUpdate.Attributes.Add("onclick", "return " + strAttributes);
            btnClose.Attributes.Add("onclick", "return window.close();");
        }
コード例 #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            AuthenticateUser();
            intProfile = Int32.Parse(Request.Cookies["profileid"].Value);
            oForecast  = new Forecast(intProfile, dsn);
            oSolution  = new Solution(intProfile, dsn);
            oPlatform  = new Platforms(intProfile, dsn);
            oPage      = new Pages(intProfile, dsn);
            oUser      = new Users(intProfile, dsn);
            oFunction  = new Functions(intProfile, dsn, intEnvironment);

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

            // Check that person has access to design builder
            if (oUser.GetApplicationUrl(intProfile, intForecastPage) == "")
            {
                panDenied.Visible     = true;
                hypDesign.NavigateUrl = "/datapoint/service/design.aspx?id=" + oFunction.encryptQueryString(intID.ToString());
            }
            else
            {
                panAllow.Visible = true;
                int intReq          = 0;
                int intProj         = 0;
                int intForecastTemp = 0;
                if (intID > 0)
                {
                    intForecastTemp = Int32.Parse(oForecast.GetAnswer(intID, "forecastid"));
                }
                else if (intForecast > 0)
                {
                    intForecastTemp = intForecast;
                }
                if (intForecastTemp > 0)
                {
                    intReq = Int32.Parse(oForecast.Get(intForecastTemp, "requestid"));
                    Requests oRequest = new Requests(0, dsn);
                    intProj = oRequest.GetProjectNumber(intReq);
                }
                if (Request.QueryString["saved"] != null)
                {
                    Page.ClientScript.RegisterStartupScript(typeof(Page), "saved", "<script type=\"text/javascript\">CheckRefresh('" + oPage.GetFullLink(intForecastPage) + "?id=" + intForecast.ToString() + "','" + oPage.GetFullLink(intViewWorkload) + "?pid=" + intProj.ToString() + "');<" + "/" + "script>");
                }
                if (Request.QueryString["unlock"] != null)
                {
                    Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "unlocked", "<script type=\"text/javascript\">alert('Invalid Unlock Code\\n\\nPlease contact your ClearView administrator to acquire a valid code');<" + "/" + "script>");
                }

                //        Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "saved", "<script type=\"text/javascript\">if(window.opener!=null)window.opener.navigate('" + oPage.GetFullLink(intForecastPage) + "?id=" + intForecast.ToString() + "');window.close();<" + "/" + "script>");
                //            Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "saved", "<script type=\"text/javascript\">alert('Forecast Equipment Saved');if(window.opener!=null)window.opener.navigate('" + oPage.GetFullLink(intForecastPage) + "?id=" + intForecast.ToString() + "');window.close();<" + "/" + "script>");
                int     intStep     = 0;
                int     intPlatform = 0;
                int     intRequest  = 0;
                DataSet ds          = new DataSet();
                string  strTitle    = "";
                if (intID > 0)
                {
                    bool boolHundred  = false;
                    bool boolOverride = false;
                    ds = oForecast.GetAnswer(intID);
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        intRequest  = oForecast.GetRequestID(intID, false);
                        intForecast = Int32.Parse(ds.Tables[0].Rows[0]["forecastid"].ToString());
                        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;
                            }
                        }
                        intStep     = Int32.Parse(ds.Tables[0].Rows[0]["step"].ToString());
                        intPlatform = Int32.Parse(ds.Tables[0].Rows[0]["platformid"].ToString());
                        if (ds.Tables[0].Rows[0]["override"].ToString() == "1" || ds.Tables[0].Rows[0]["override"].ToString() == "-1")
                        {
                            boolOverride = true;
                        }
                        else if (intPlatform == intPlatformS)
                        {
                            oForecast.UpdateAnswerModel(intID, 0);
                        }
                        if (Request.QueryString["step"] != null && Request.QueryString["step"] != "")
                        {
                            DataSet dsTemp = oForecast.GetSteps(intPlatform, 1);
                            int     _step  = Int32.Parse(Request.QueryString["step"]);
                            if (_step <= dsTemp.Tables[0].Rows.Count)
                            {
                                intStep = _step;
                            }
                        }
                    }
                    if (intRequest != 0)
                    {
                        panLocked.Visible = true;
                    }

                    int     intRow      = intStep - 1;
                    DataSet dsSteps     = oForecast.GetSteps(intPlatform, 1);
                    DataSet dsStepsDone = oForecast.GetStepsDone(intID, 1);
                    if (Request.QueryString["save"] != null)
                    {
                        Page.ClientScript.RegisterStartupScript(typeof(Page), "save", "<script type=\"text/javascript\">CheckRefresh('" + oPage.GetFullLink(intForecastPage) + "?id=" + intForecast.ToString() + "','" + oPage.GetFullLink(intViewWorkload) + "?pid=" + intProj.ToString() + "');<" + "/" + "script>");
                    }
                    if (dsSteps.Tables[0].Rows.Count <= intRow && Request.QueryString["step"] == null)
                    {
                        if (Request.QueryString["save"] != null && dsStepsDone.Tables[0].Rows.Count == dsSteps.Tables[0].Rows.Count)
                        {
                            Response.Redirect(Request.Path + "?parent=" + intForecast.ToString() + "&id=" + intID.ToString() + "&saved=true");
                        }
                        else
                        {
                            LoadSteps(intID, intPlatform);
                            if (boolHundred == true && panLocked.Visible == false)
                            {
                                panHundred.Visible       = true;
                                lblConfidenceUnlock.Text = Request.ServerVariables["REMOTE_HOST"];
                            }
                        }
                        strTitle = "Design Summary";
                    }
                    else if (dsSteps.Tables[0].Rows.Count > 0)
                    {
                        panStep.Visible = true;
                        //imgStep.ImageUrl = "/images/num" + intStep.ToString() + ".gif";
                        imgStep.ImageUrl = dsSteps.Tables[0].Rows[intRow]["image_path"].ToString();
                        lblTitle.Text    = dsSteps.Tables[0].Rows[intRow]["name"].ToString();
                        strTitle         = dsSteps.Tables[0].Rows[intRow]["name"].ToString();
                        lblSubTitle.Text = dsSteps.Tables[0].Rows[intRow]["subtitle"].ToString();
                        string strPath = dsSteps.Tables[0].Rows[intRow]["path"].ToString();
                        if (boolOverride == true)
                        {
                            if (dsSteps.Tables[0].Rows[intRow]["override_path"].ToString() != "")
                            {
                                strPath = dsSteps.Tables[0].Rows[intRow]["override_path"].ToString();
                            }
                            panOverride.Visible = true;
                        }
                        if (strPath != "")
                        {
                            PHStep.Controls.Add((UserControl)LoadControl(strPath));
                        }
                    }
                }
                else
                {
                    panStep.Visible  = true;
                    imgStep.ImageUrl = "/images/start_design.gif";
                    strTitle         = "Start Design";
                    lblTitle.Text    = strTitle;
                    lblSubTitle.Text = "Please complete the following information to start your design.";
                    PHStep.Controls.Add((UserControl)LoadControl("/controls/fore/fore_first.ascx"));
                }
                Master.Page.Title = strTitle;
                btnConfidenceUnlock.Attributes.Add("onclick", "return ValidateText('" + txtConfidenceUnlock.ClientID + "','Please enter an unlock code') && ValidateText('" + txtConfidenceReason.ClientID + "','Please enter a reason for unlocking this design');");
            }
            btnClose.Attributes.Add("onclick", "return window.close();");
        }
コード例 #8
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);
     oModel            = new Models(intProfile, dsn);
     oModelsProperties = new ModelsProperties(intProfile, dsn);
     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 (intID > 0)
     {
         DataSet ds = oForecast.GetAnswer(intID);
         if (ds.Tables[0].Rows.Count > 0)
         {
             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;
             }
         }
         DataSet dsResponses = oForecast.GetResponses(intID);
         bool    boolNone    = true;
         if (dsResponses.Tables[0].Rows.Count > 0)
         {
             foreach (DataRow drResponse in dsResponses.Tables[0].Rows)
             {
                 DataSet dsAdditional = oForecast.GetResponseAdditional(Int32.Parse(drResponse["id"].ToString()));
                 foreach (DataRow drAdditional in dsAdditional.Tables[0].Rows)
                 {
                     int intAdditional = Int32.Parse(drAdditional["additionalid"].ToString());
                     if (oForecast.GetStepAdditionalsDone(intID, intAdditional) == false)
                     {
                         string strPath = oForecast.GetStepAdditional(intAdditional, "path");
                         if (strPath != "")
                         {
                             PHAdditional.Controls.Add((Control)LoadControl(strPath));
                             boolNone = false;
                         }
                     }
                 }
             }
         }
         if (boolNone == true)
         {
             oForecast.UpdateAnswerStep(intID, 1, 1);
             Response.Redirect(Request.Path + "?id=" + intID.ToString());
         }
     }
 }
コード例 #9
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;
                    }
                }
            }
        }
コード例 #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile        = Int32.Parse(Request.Cookies["profileid"].Value);
            oForecast         = new Forecast(intProfile, dsn);
            oType             = new Types(intProfile, dsn);
            oModel            = new Models(intProfile, dsn);
            oModelsProperties = new ModelsProperties(intProfile, dsn);
            oPlatform         = new Platforms(intProfile, dsn);
            oOperatingSystems = new OperatingSystems(intProfile, dsn);
            oVirtualHDD       = new VirtualHDD(intProfile, dsn);
            oVirtualRam       = new VirtualRam(intProfile, dsn);
            oVirtualCPU       = new VirtualCPU(intProfile, dsn);
            oClass            = new Classes(intProfile, dsn);
            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 (intID > 0)
            {
                DataSet ds = oForecast.GetAnswer(intID);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    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;
                    }
                    intPlatform = Int32.Parse(ds.Tables[0].Rows[0]["platformid"].ToString());
                    int intStep    = Int32.Parse(ds.Tables[0].Rows[0]["step"].ToString());
                    int intClass   = Int32.Parse(ds.Tables[0].Rows[0]["classid"].ToString());
                    int intEnv     = Int32.Parse(ds.Tables[0].Rows[0]["environmentid"].ToString());
                    int intAddress = Int32.Parse(ds.Tables[0].Rows[0]["addressid"].ToString());
                    int intModel   = Int32.Parse(ds.Tables[0].Rows[0]["modelid"].ToString());
                    boolProduction = oClass.IsProd(Int32.Parse(ds.Tables[0].Rows[0]["classid"].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;
                    }
                    if (Request.QueryString["type"] != null && Request.QueryString["type"] != "")
                    {
                        intType = Int32.Parse(Request.QueryString["type"]);
                        if (!IsPostBack)
                        {
                            LoadPlatform(intPlatform, intType, intClass, intEnv, intAddress);
                        }
                        if (Request.QueryString["model"] != null && Request.QueryString["model"] != "")
                        {
                            intModel = Int32.Parse(Request.QueryString["model"]);
                            ddlModels.SelectedValue = intModel.ToString();
                            int intParent = Int32.Parse(oModelsProperties.Get(intModel, "modelid"));
                            if (Int32.Parse(oModel.Get(intParent, "hostid")) > 0)
                            {
                                // Virtual - requires additional info
                                panVirtual.Visible = true;
                                if (boolProduction == true)
                                {
                                    panProduction.Visible = true;
                                }
                            }
                        }
                    }
                    else if (!IsPostBack)
                    {
                        if (intModel > 0)
                        {
                            ddlModels.SelectedValue = intModel.ToString();
                            intModel = Int32.Parse(oModelsProperties.Get(intModel, "modelid"));
                            intType  = Int32.Parse(oModel.Get(intModel, "typeid"));
                            LoadPlatform(intPlatform, intType, intClass, intEnv, intAddress);
                            if (Int32.Parse(oModel.Get(intModel, "hostid")) > 0)
                            {
                                // Virtual - requires additional info
                                panVirtual.Visible = true;
                                DataSet dsVirtual = oForecast.GetWorkstation(intID);
                                if (dsVirtual.Tables[0].Rows.Count > 0)
                                {
                                    ddlRam.SelectedValue       = dsVirtual.Tables[0].Rows[0]["ramid"].ToString();
                                    ddlOS.SelectedValue        = dsVirtual.Tables[0].Rows[0]["osid"].ToString();
                                    ddlRecovery.SelectedValue  = dsVirtual.Tables[0].Rows[0]["recovery"].ToString();
                                    ddlCPU.SelectedValue       = dsVirtual.Tables[0].Rows[0]["cpuid"].ToString();
                                    ddlHardDrive.SelectedValue = dsVirtual.Tables[0].Rows[0]["hddid"].ToString();
                                }
                                if (boolProduction == true)
                                {
                                    panProduction.Visible = true;
                                }
                            }
                        }
                        else
                        {
                            LoadPlatform(intPlatform, intType, intClass, intEnv, intAddress);
                        }
                    }
                }
            }
            btnClose.Attributes.Add("onclick", "return window.close();");
            btnUpdate.Attributes.Add("onclick", "return ValidateDropDown('" + ddlModels.ClientID + "','Please select a model');");
        }
コード例 #11
0
 protected void Page_Load(object sender, EventArgs e)
 {
     intProfile = Int32.Parse(Request.Cookies["profileid"].Value);
     oForecast  = new Forecast(intProfile, dsn);
     oPage      = new Pages(intProfile, dsn);
     if (Request.QueryString["pageid"] != null && Request.QueryString["pageid"] != "")
     {
         intPage = Int32.Parse(Request.QueryString["pageid"]);
     }
     if (Request.QueryString["action"] != null && Request.QueryString["action"] != "")
     {
         panFinish.Visible = true;
     }
     else
     {
         if (Request.QueryString["applicationid"] != null && Request.QueryString["applicationid"] != "")
         {
             intApplication = Int32.Parse(Request.QueryString["applicationid"]);
         }
         if (Request.Cookies["application"] != null && Request.Cookies["application"].Value != "")
         {
             intApplication = Int32.Parse(Request.Cookies["application"].Value);
         }
         if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
         {
             intAnswer = Int32.Parse(Request.QueryString["id"]);
         }
         if (!IsPostBack)
         {
             if (intAnswer > 0)
             {
                 DataSet ds = oForecast.GetAnswer(intAnswer);
                 if (ds.Tables[0].Rows.Count > 0)
                 {
                     Projects         oProject          = new Projects(intProfile, dsn);
                     Requests         oRequest          = new Requests(intProfile, dsn);
                     Organizations    oOrganization     = new Organizations(intProfile, dsn);
                     Segment          oSegment          = new Segment(intProfile, dsn);
                     Platforms        oPlatform         = new Platforms(intProfile, dsn);
                     ModelsProperties oModelsProperties = new ModelsProperties(intProfile, dsn);
                     Confidence       oConfidence       = new Confidence(intProfile, dsn);
                     Classes          oClass            = new Classes(intProfile, dsn);
                     Environments     oEnvironment      = new Environments(intProfile, dsn);
                     Locations        oLocation         = new Locations(intProfile, dsn);
                     Users            oUser             = new Users(intProfile, dsn);
                     lblID.Text = intAnswer.ToString();
                     int intForecast = Int32.Parse(ds.Tables[0].Rows[0]["forecastid"].ToString());
                     int intRequest  = Int32.Parse(oForecast.Get(intForecast, "requestid"));
                     int intProject  = oRequest.GetProjectNumber(intRequest);
                     lblName.Text       = oProject.Get(intProject, "name");
                     lblNumber.Text     = oProject.Get(intProject, "number");
                     lblPortfolio.Text  = oOrganization.GetName(Int32.Parse(oProject.Get(intProject, "organization")));
                     lblSegment.Text    = oSegment.GetName(Int32.Parse(oProject.Get(intProject, "segmentid")));
                     lblPlatform.Text   = oPlatform.GetName(Int32.Parse(ds.Tables[0].Rows[0]["platformid"].ToString()));
                     lblNickname.Text   = ds.Tables[0].Rows[0]["name"].ToString();
                     lblModel.Text      = oModelsProperties.Get(Int32.Parse(ds.Tables[0].Rows[0]["modelid"].ToString()), "name");
                     lblCommitment.Text = DateTime.Parse(ds.Tables[0].Rows[0]["implementation"].ToString()).ToLongDateString();
                     lblQuantity.Text   = ds.Tables[0].Rows[0]["quantity"].ToString();
                     lblConfidence.Text = oConfidence.Get(Int32.Parse(ds.Tables[0].Rows[0]["confidenceid"].ToString()), "name");
                     int intClass = Int32.Parse(ds.Tables[0].Rows[0]["classid"].ToString());
                     lblClass.Text = oClass.Get(intClass, "name");
                     if (oClass.IsProd(intClass))
                     {
                         panTest.Visible = true;
                         lblTest.Text    = (ds.Tables[0].Rows[0]["test"].ToString() == "1" ? "Yes" : "No");
                     }
                     lblEnvironment.Text = oEnvironment.Get(Int32.Parse(ds.Tables[0].Rows[0]["environmentid"].ToString()), "name");
                     lblLocation.Text    = oLocation.GetFull(Int32.Parse(ds.Tables[0].Rows[0]["addressid"].ToString()));
                     lblIP.Text          = ds.Tables[0].Rows[0]["workstation"].ToString();
                     lblDesignedBy.Text  = oUser.GetFullName(Int32.Parse(ds.Tables[0].Rows[0]["userid"].ToString()));
                     lblDesignedOn.Text  = DateTime.Parse(ds.Tables[0].Rows[0]["created"].ToString()).ToString();
                     lblUpdated.Text     = DateTime.Parse(ds.Tables[0].Rows[0]["modified"].ToString()).ToString();
                     panShow.Visible     = true;
                     btnApprove.Enabled  = true;
                     btnDeny.Enabled     = true;
                 }
             }
         }
     }
     btnApprove.Attributes.Add("onclick", "return confirm('Are you sure you want to APPROVE this request?');");
     btnDeny.Attributes.Add("onclick", "return ValidateText('" + txtComments.ClientID + "','Please enter a reason for the rejection of this request') && confirm('Are you sure you want to DENY this request?');");
 }
コード例 #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile = Int32.Parse(Request.Cookies["profileid"].Value);
            oForecast  = new Forecast(intProfile, dsn);
            oType      = new Types(intProfile, dsn);
            oModel     = new Models(intProfile, dsn);
            oPlatform  = new Platforms(intProfile, dsn);
            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;
            }
            int intCount   = 0;
            int intAddress = 0;

            if (intID > 0)
            {
                DataSet ds = oForecast.GetAnswer(intID);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    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;
                    }
                    intPlatform = Int32.Parse(ds.Tables[0].Rows[0]["platformid"].ToString());
                    int intStep   = Int32.Parse(ds.Tables[0].Rows[0]["step"].ToString());
                    int intModel  = Int32.Parse(ds.Tables[0].Rows[0]["modelid"].ToString());
                    int intVendor = Int32.Parse(ds.Tables[0].Rows[0]["vendorid"].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;
                    }
                    lblVendor.Text = intVendor.ToString();
                    if (Request.QueryString["type"] != null && Request.QueryString["type"] != "")
                    {
                        intType = Int32.Parse(Request.QueryString["type"]);
                    }
                    else if (!IsPostBack)
                    {
                        if (ds.Tables[0].Rows[0]["vplatform"].ToString() != "")
                        {
                            intType = Int32.Parse(ds.Tables[0].Rows[0]["vplatform"].ToString());
                        }
                        intAddress             = Int32.Parse(ds.Tables[0].Rows[0]["addressid"].ToString());
                        txtMake.Text           = ds.Tables[0].Rows[0]["make"].ToString();
                        txtModel.Text          = ds.Tables[0].Rows[0]["modelname"].ToString();
                        txtOther.Text          = ds.Tables[0].Rows[0]["description"].ToString();
                        txtWidth.Text          = ds.Tables[0].Rows[0]["size_w"].ToString();
                        txtHeight.Text         = ds.Tables[0].Rows[0]["size_h"].ToString();
                        txtAmp.Text            = ds.Tables[0].Rows[0]["amp"].ToString();
                        ddlTypes.SelectedValue = ds.Tables[0].Rows[0]["typeid"].ToString();
                    }
                    if (!IsPostBack)
                    {
                        intCount = LoadPlatform(intPlatform, intType);
                    }
                }
            }
            btnClose.Attributes.Add("onclick", "return window.close();");
            btnNext.Attributes.Add("onclick", "return ValidateDropDown('" + ddlPlatforms.ClientID + "','Please select a classification')" +
                                   " && ValidateDropDown('" + ddlTypes.ClientID + "','Please select a type')" +
                                   " && ValidateText('" + txtMake.ClientID + "','Please enter the make')" +
                                   " && ValidateText('" + txtModel.ClientID + "','Please enter the model')" +
                                   " && ValidateText('" + txtWidth.ClientID + "','Please enter the width')" +
                                   " && ValidateText('" + txtHeight.ClientID + "','Please enter the height')" +
                                   " && ValidateNumber('" + txtAmp.ClientID + "','Please enter the number of AMPs')" +
                                   ";");
            btnUpdate.Attributes.Add("onclick", "return ValidateDropDown('" + ddlPlatforms.ClientID + "','Please select a classification')" +
                                     " && ValidateDropDown('" + ddlTypes.ClientID + "','Please select a type')" +
                                     " && ValidateText('" + txtMake.ClientID + "','Please enter the make')" +
                                     " && ValidateText('" + txtModel.ClientID + "','Please enter the model')" +
                                     " && ValidateText('" + txtWidth.ClientID + "','Please enter the width')" +
                                     " && ValidateText('" + txtHeight.ClientID + "','Please enter the height')" +
                                     " && ValidateNumber('" + txtAmp.ClientID + "','Please enter the number of AMPs')" +
                                     ";");
        }
コード例 #13
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);
            oLocation    = new Locations(intProfile, dsn);
            oClass       = new Classes(intProfile, dsn);
            oEnvironment = new Environments(intProfile, dsn);
            oServerName  = new ServerName(intProfile, dsn);
            oDataPoint   = new DataPoint(intProfile, dsn);
            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)
            {
                LoadLists();
            }
            int  intAddress       = 0;
            int  intRecovery      = 0;
            bool boolRecoveryMany = false;

            if (intID > 0)
            {
                DataSet ds = oForecast.GetAnswer(intID);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    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;
                    }
                    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;
                    }
                    boolRecoveryMany = (oForecast.IsDRUnder48(intID, false) && oForecast.IsDRManyToOne(intID));
                    if (!IsPostBack)
                    {
                        lblPlatform.Text    = oPlatform.GetName(intPlatform);
                        lblPlatform.Visible = true;
                        int intClass = Int32.Parse(ds.Tables[0].Rows[0]["classid"].ToString());
                        if (ds.Tables[0].Rows[0]["override"].ToString() == "1" || ds.Tables[0].Rows[0]["override"].ToString() == "-1")
                        {
                            radYes.Checked = true;
                            divOverride.Style["display"] = "inline";
                            if (ds.Tables[0].Rows[0]["breakfix"].ToString() == "1")
                            {
                                radBreakYes.Checked        = true;
                                divChange.Style["display"] = "inline";
                                txtChange.Text             = ds.Tables[0].Rows[0]["change"].ToString();
                                divName.Style["display"]   = "inline";
                                int intName = Int32.Parse(ds.Tables[0].Rows[0]["nameid"].ToString());
                                if (oClass.Get(intClass, "pnc") == "1")
                                {
                                    txtDeviceName.Text = oServerName.GetNameFactory(intName, 0);
                                }
                                else
                                {
                                    txtDeviceName.Text = oServerName.GetName(intName, 0);
                                }
                                txtQuantity.ReadOnly = true;
                            }
                            else
                            {
                                radBreakNo.Checked = true;
                            }
                        }
                        else
                        {
                            radNo.Checked = true;
                        }
                        txtName.Text = ds.Tables[0].Rows[0]["name"].ToString();
                        try
                        {
                            ddlClass.SelectedValue = intClass.ToString();
                        }
                        catch { }
                        if (ddlClass.SelectedIndex == 0)
                        {
                            // Class is not available, add it.
                            ddlClass.Items.Add(new ListItem(oClass.Get(intClass, "name") + " *", intClass.ToString()));
                            ddlClass.SelectedValue = intClass.ToString();
                        }
                        if (oClass.IsProd(intClass) && oClass.Get(intClass, "pnc") != "1")
                        {
                            divTest.Style["display"] = "inline";
                            chkTest.Checked          = (ds.Tables[0].Rows[0]["test"].ToString() == "1");
                        }
                        int intEnv = Int32.Parse(ds.Tables[0].Rows[0]["environmentid"].ToString());
                        hdnEnvironment.Value          = intEnv.ToString();
                        ddlEnvironment.SelectedValue  = intEnv.ToString();
                        ddlEnvironment.Enabled        = true;
                        ddlEnvironment.DataTextField  = "name";
                        ddlEnvironment.DataValueField = "id";
                        ddlEnvironment.DataSource     = oClass.GetEnvironment(intClass, 1);
                        ddlEnvironment.DataBind();
                        ddlEnvironment.Items.Insert(0, new ListItem("-- SELECT --", "0"));
                        if (lblPlatform.Text.ToUpper() == "SERVER" && ddlClass.SelectedItem.Text.ToUpper() == "PRODUCTION")
                        {
                            ddlMaintenance.Enabled = true;
                        }
                        if (lblPlatform.Text.ToUpper() == "SERVER" && ddlClass.SelectedItem.Text.ToUpper() == "TEST")
                        {
                            ddlMaintenance.Enabled = true;
                        }
                        if (lblPlatform.Text.ToUpper() == "SERVER")
                        {
                            divServerType.Style["display"] = "inline";
                        }
                        intAddress = Int32.Parse(ds.Tables[0].Rows[0]["addressid"].ToString());
                        ddlMaintenance.SelectedValue = ds.Tables[0].Rows[0]["maintenanceid"].ToString();
                        int intApplicationID = Int32.Parse(ds.Tables[0].Rows[0]["applicationid"].ToString());
                        ddlApplications.SelectedValue = intApplicationID.ToString();
                        DataSet dsSubApplications = oServerName.GetSubApplications(intApplicationID, 1);
                        if (dsSubApplications.Tables[0].Rows.Count > 0)
                        {
                            int intSubApplicationID = Int32.Parse(ds.Tables[0].Rows[0]["subapplicationid"].ToString());
                            ddlSubApplications.DataTextField  = "name";
                            ddlSubApplications.DataValueField = "id";
                            ddlSubApplications.DataSource     = dsSubApplications;
                            ddlSubApplications.DataBind();
                            ddlSubApplications.Items.Insert(0, new ListItem("-- SELECT --", "0"));
                            divSubApplications.Style["display"] = "inline";
                            ddlSubApplications.SelectedValue    = intSubApplicationID.ToString();
                            hdnSubApplication.Value             = intSubApplicationID.ToString();
                        }
                        txtQuantity.Text         = ds.Tables[0].Rows[0]["quantity"].ToString();
                        radResiliencyYes.Checked = (ds.Tables[0].Rows[0]["resiliency"].ToString() == "1");
                        radResiliencyNo.Checked  = (radResiliencyYes.Checked == false);
                        if (txtQuantity.Text == "0")
                        {
                            txtQuantity.Text = "";
                        }
                        intRecovery = Int32.Parse(ds.Tables[0].Rows[0]["recovery_number"].ToString());
                    }
                }
                else
                {
                    btnBack.Enabled     = false;
                    ddlPlatform.Visible = true;
                    intAddress          = intLocation;
                    radNo.Checked       = true;
                }
            }
            else
            {
                btnBack.Enabled     = false;
                ddlPlatform.Visible = true;
                intAddress          = intLocation;
                radNo.Checked       = true;
            }
            if (intAddress > 0)
            {
                intLocation = intAddress;
            }
            strLocation       = oLocation.LoadDDL("ddlState", "ddlCity", "ddlAddress", hdnLocation.ClientID, intLocation, true, "ddlCommon");
            hdnLocation.Value = intLocation.ToString();
            ddlClass.Attributes.Add("onchange", "PopulateEnvironments('" + ddlClass.ClientID + "','" + ddlEnvironment.ClientID + "',1);EnableMaintenance();ShowTestOption('" + divTest.ClientID + "');");
            ddlPlatform.Attributes.Add("onchange", "ShowServerType('" + divServerType.ClientID + "');");
            ddlApplications.Attributes.Add("onchange", "PopulateSubApplications('" + ddlApplications.ClientID + "','" + ddlSubApplications.ClientID + "','" + divSubApplications.ClientID + "');");
            ddlEnvironment.Attributes.Add("onchange", "UpdateDropDownHidden('" + ddlEnvironment.ClientID + "','" + hdnEnvironment.ClientID + "');");
            ddlSubApplications.Attributes.Add("onchange", "UpdateDropDownHidden('" + ddlSubApplications.ClientID + "','" + hdnSubApplication.ClientID + "');");
            btnNext.Attributes.Add("onclick", "return EnsureOverride('" + radYes.ClientID + "','" + radNo.ClientID + "','" + radBreakYes.ClientID + "','" + radBreakNo.ClientID + "','" + txtChange.ClientID + "')" +
                                   " && ValidateDropDown('" + ddlPlatform.ClientID + "','Please select a platform')" +
                                   " && ValidateHidden0('" + hdnLocation.ClientID + "','ddlState','Please select a location')" +
                                   " && ValidateDropDown('" + ddlClass.ClientID + "','Please select a class')" +
                                   " && ValidateDropDown('" + ddlEnvironment.ClientID + "','Please select an environment')" +
                                   " && EnsureMaintenance('" + ddlMaintenance.ClientID + "','Please select a maintenance window')" +
                                   " && ValidateNumber0('" + txtQuantity.ClientID + "','Please enter a valid quantity')" +
                                   " && ValidateHiddenDisabled('" + hdnSubApplication.ClientID + "','" + ddlSubApplications.ClientID + "','Please select a value')" +
                                   " && ForeRecoveryFirst(" + (boolRecoveryMany ? "true" : "false") + ",'" + txtQuantity.ClientID + "'," + intRecovery.ToString() + ")" +
                                   " && ValidateTextDisabled('" + txtDeviceName.ClientID + "', 'Please enter a valid device name')" +
                                   " && EnsureDeviceName('" + radYes.ClientID + "','" + radBreakYes.ClientID + "','" + txtDeviceName.ClientID + "','" + ddlClass.ClientID + "')" +
                                   ";");
            btnUpdate.Attributes.Add("onclick", "return EnsureOverride('" + radYes.ClientID + "','" + radNo.ClientID + "','" + radBreakYes.ClientID + "','" + radBreakNo.ClientID + "','" + txtChange.ClientID + "')" +
                                     " && ValidateDropDown('" + ddlPlatform.ClientID + "','Please select a platform')" +
                                     " && ValidateHidden0('" + hdnLocation.ClientID + "','ddlState','Please select a location')" +
                                     " && ValidateDropDown('" + ddlClass.ClientID + "','Please select a class')" +
                                     " && ValidateDropDown('" + ddlEnvironment.ClientID + "','Please select an environment')" +
                                     " && EnsureMaintenance('" + ddlMaintenance.ClientID + "','Please select a maintenance window')" +
                                     " && ValidateNumber0('" + txtQuantity.ClientID + "','Please enter a valid quantity')" +
                                     " && ValidateHiddenDisabled('" + hdnSubApplication.ClientID + "','" + ddlSubApplications.ClientID + "','Please select a value')" +
                                     " && ForeRecoveryFirst(" + (boolRecoveryMany ? "true" : "false") + ",'" + txtQuantity.ClientID + "'," + intRecovery.ToString() + ")" +
                                     " && ValidateTextDisabled('" + txtDeviceName.ClientID + "', 'Please enter a valid device name')" +
                                     " && EnsureDeviceName('" + radYes.ClientID + "','" + radBreakYes.ClientID + "','" + txtDeviceName.ClientID + "','" + ddlClass.ClientID + "')" +
                                     ";");
            radYes.Attributes.Add("onclick", "ShowHideDiv('" + divOverride.ClientID + "','inline');ShowHideDivCheck('" + divChange.ClientID + "',document.getElementById('" + radBreakYes.ClientID + "'));ShowHideDivCheck('" + divName.ClientID + "',document.getElementById('" + radBreakYes.ClientID + "'));LockQuantityRadio('" + radYes.ClientID + "','" + radBreakYes.ClientID + "','" + txtQuantity.ClientID + "');");
            radNo.Attributes.Add("onclick", "ShowHideDiv('" + divOverride.ClientID + "','none');ShowHideDiv('" + divChange.ClientID + "','none');ShowHideDiv('" + divName.ClientID + "','none');LockQuantity('" + txtQuantity.ClientID + "',false);");
            radBreakYes.Attributes.Add("onclick", "ShowHideDiv('" + divChange.ClientID + "','inline');ShowHideDiv('" + divName.ClientID + "','inline');LockQuantity('" + txtQuantity.ClientID + "',true);");
            radBreakNo.Attributes.Add("onclick", "ShowHideDiv('" + divChange.ClientID + "','none');ShowHideDiv('" + divName.ClientID + "','none');LockQuantity('" + txtQuantity.ClientID + "',false);");
            btnClose.Attributes.Add("onclick", "return window.close();");
        }
コード例 #14
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);
     oModel            = new Models(intProfile, dsn);
     oModelsProperties = new ModelsProperties(intProfile, dsn);
     oLocation         = new Locations(intProfile, dsn);
     oClass            = new Classes(intProfile, dsn);
     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 (intID > 0)
     {
         DataSet ds = oForecast.GetAnswer(intID);
         if (ds.Tables[0].Rows.Count > 0)
         {
             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());
             bool boolTest    = (ds.Tables[0].Rows[0]["test"].ToString() == "1");
             int  intQuantity = Int32.Parse(ds.Tables[0].Rows[0]["quantity"].ToString());
             int  intAddress  = Int32.Parse(ds.Tables[0].Rows[0]["addressid"].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;
             }
             if (oLocation.GetAddress(intAddress, "storage") != "1")
             {
                 radNo.Checked  = true;
                 radYes.Enabled = false;
                 radYes.ToolTip = "Location " + oLocation.GetFull(intAddress) + " is not configured for storage";
             }
             else
             {
                 bool boolProduction    = oClass.IsProd(Int32.Parse(ds.Tables[0].Rows[0]["classid"].ToString()));
                 bool boolQA            = oClass.IsQA(Int32.Parse(ds.Tables[0].Rows[0]["classid"].ToString()));
                 bool boolNone          = (ds.Tables[0].Rows[0]["storage"].ToString() == "-2");
                 bool boolRequired      = oForecast.IsHACluster(intID);
                 bool boolNoReplication = oForecast.IsDROver48(intID, false);
                 // Get Model
                 int intModel = oForecast.GetModel(intID);
                 if (oModelsProperties.IsStorageDE_FDriveMustBeOnSAN(intModel) == true)
                 {
                     boolRequired = true;
                 }
                 Types oType = new Types(intProfile, dsn);
                 if (oType.GetPlatform(oModelsProperties.GetType(intModel)) == intSharedPlatform)
                 {
                     boolRequired = true;
                 }
                 if (boolRequired == true)
                 {
                     radNo.Enabled = false;
                     if (boolNone == false)
                     {
                         divYes.Style["display"] = "inline";
                     }
                     radNo.ToolTip = "Storage Required for Clusters";
                 }
                 if (!IsPostBack)
                 {
                     if (boolProduction == true)
                     {
                         panOldHighProduction.Visible     = true;
                         panOldStandardProduction.Visible = true;
                         panOldLowProduction.Visible      = true;
                     }
                     if (boolQA == true)
                     {
                         panOldHighQA.Visible     = true;
                         panOldStandardQA.Visible = true;
                         panOldLowQA.Visible      = true;
                     }
                     if ((boolProduction == false && boolQA == false) || (boolProduction == true && boolTest == true))
                     {
                         panOldHighTest.Visible     = true;
                         panOldStandardTest.Visible = true;
                         panOldLowTest.Visible      = true;
                     }
                     if (boolNoReplication == false)     // If Replication = true
                     {
                         panOldStandardReplication.Visible         = true;
                         ddlOldStandardReplicated.Enabled          = false;
                         ddlOldStandardReplicated.SelectedValue    = "Yes";
                         ddlOldStandardReplicated.ToolTip          = "Under 48 Hours requires Replication";
                         divOldStandardReplicated.Style["display"] = "inline";
                     }
                     if (ds.Tables[0].Rows[0]["storage"].ToString() == "1")
                     {
                         radYes.Checked   = true;
                         ds               = oForecast.GetStorageOS(intID);
                         panReset.Visible = (ds.Tables[0].Rows.Count > 0);
                         ds               = oForecast.GetStorage(intID);
                         if (ds.Tables[0].Rows.Count > 0)
                         {
                             divYes.Style["display"] = "inline";
                             if (ds.Tables[0].Rows[0]["high"].ToString() == "1")
                             {
                                 chkOldHigh.Checked          = true;
                                 divOldHigh.Style["display"] = "inline";
                                 txtOldHighRequire.Text      = ds.Tables[0].Rows[0]["high_total"].ToString();
                                 txtOldHighRequireQA.Text    = ds.Tables[0].Rows[0]["high_qa"].ToString();
                                 txtOldHighRequireTest.Text  = ds.Tables[0].Rows[0]["high_test"].ToString();
                             }
                             if (ds.Tables[0].Rows[0]["standard"].ToString() == "1")
                             {
                                 chkOldStandard.Checked          = true;
                                 divOldStandard.Style["display"] = "inline";
                                 txtOldStandardRequire.Text      = ds.Tables[0].Rows[0]["standard_total"].ToString();
                                 txtOldStandardRequireQA.Text    = ds.Tables[0].Rows[0]["standard_qa"].ToString();
                                 txtOldStandardRequireTest.Text  = ds.Tables[0].Rows[0]["standard_test"].ToString();
                                 double dblStandardReplicated = double.Parse(ds.Tables[0].Rows[0]["standard_replicated"].ToString());
                                 if (dblStandardReplicated > 0.00)
                                 {
                                     divOldStandardReplicated.Style["display"] = "inline";
                                     txtOldStandardReplicated.Text             = dblStandardReplicated.ToString();
                                     ddlOldStandardReplicated.SelectedValue    = "Yes";
                                 }
                             }
                             if (ds.Tables[0].Rows[0]["low"].ToString() == "1")
                             {
                                 chkOldLow.Checked          = true;
                                 divOldLow.Style["display"] = "inline";
                                 txtOldLowRequire.Text      = ds.Tables[0].Rows[0]["low_total"].ToString();
                                 txtOldLowRequireQA.Text    = ds.Tables[0].Rows[0]["low_qa"].ToString();
                                 txtOldLowRequireTest.Text  = ds.Tables[0].Rows[0]["low_test"].ToString();
                             }
                         }
                     }
                     else if (ds.Tables[0].Rows[0]["storage"].ToString() == "-1")
                     {
                         radLater.Checked = true;
                     }
                     else if (boolRequired == true && boolNone == false)
                     {
                         radYes.Checked = true;
                     }
                     else
                     {
                         radNo.Checked = true;
                     }
                 }
                 chkOldHigh.Attributes.Add("onclick", "ShowHideDivCheck('" + divOldHigh.ClientID + "',this);");
                 chkOldStandard.Attributes.Add("onclick", "ShowHideDivCheck('" + divOldStandard.ClientID + "',this);");
                 ddlOldStandardReplicated.Attributes.Add("onchange", "ShowHideDivDDL('" + divOldStandardReplicated.ClientID + "',this,'Yes');");
                 chkOldLow.Attributes.Add("onclick", "ShowHideDivCheck('" + divOldLow.ClientID + "',this);");
                 btnNext.Attributes.Add("onclick", "return EnsureStorage('" + radYes.ClientID + "','" + chkOldHigh.ClientID + "','" + chkOldStandard.ClientID + "','" + chkOldLow.ClientID + "')" +
                                        " && EnsureStorageOld('" + radYes.ClientID + "','" + chkOldHigh.ClientID + "','" + txtOldHighRequire.ClientID + "','" + txtOldHighRequireQA.ClientID + "','" + txtOldHighRequireTest.ClientID + "'," + (boolProduction ? "true" : "false") + ",false,null,null)" +
                                        " && EnsureStorageOld('" + radYes.ClientID + "','" + chkOldStandard.ClientID + "','" + txtOldStandardRequire.ClientID + "','" + txtOldStandardRequireQA.ClientID + "','" + txtOldStandardRequireTest.ClientID + "'," + (boolProduction ? "true" : "false") + "," + (boolNoReplication ? "true" : "false") + ",'" + ddlOldStandardReplicated.ClientID + "','" + txtOldStandardReplicated.ClientID + "')" +
                                        " && EnsureStorageOld('" + radYes.ClientID + "','" + chkOldLow.ClientID + "','" + txtOldLowRequire.ClientID + "','" + txtOldLowRequireQA.ClientID + "','" + txtOldLowRequireTest.ClientID + "'," + (boolProduction ? "true" : "false") + ",false,null,null)" +
                                        ";");
                 btnUpdate.Attributes.Add("onclick", "return EnsureStorage('" + radYes.ClientID + "','" + chkOldHigh.ClientID + "','" + chkOldStandard.ClientID + "','" + chkOldLow.ClientID + "')" +
                                          " && EnsureStorageOld('" + radYes.ClientID + "','" + chkOldHigh.ClientID + "','" + txtOldHighRequire.ClientID + "','" + txtOldHighRequireQA.ClientID + "','" + txtOldHighRequireTest.ClientID + "'," + (boolProduction ? "true" : "false") + ",false,null,null)" +
                                          " && EnsureStorageOld('" + radYes.ClientID + "','" + chkOldStandard.ClientID + "','" + txtOldStandardRequire.ClientID + "','" + txtOldStandardRequireQA.ClientID + "','" + txtOldStandardRequireTest.ClientID + "'," + (boolProduction ? "true" : "false") + "," + (boolNoReplication ? "true" : "false") + ",'" + ddlOldStandardReplicated.ClientID + "','" + txtOldStandardReplicated.ClientID + "')" +
                                          " && EnsureStorageOld('" + radYes.ClientID + "','" + chkOldLow.ClientID + "','" + txtOldLowRequire.ClientID + "','" + txtOldLowRequireQA.ClientID + "','" + txtOldLowRequireTest.ClientID + "'," + (boolProduction ? "true" : "false") + ",false,null,null)" +
                                          ";");
                 btnReset.Attributes.Add("onclick", "return OpenWindow('RESET_STORAGE', '?id=" + intID.ToString() + "');");
             }
         }
     }
     radLater.Attributes.Add("onclick", "ShowHideDiv('" + divYes.ClientID + "','none');");
     radNo.Attributes.Add("onclick", "ShowHideDiv('" + divYes.ClientID + "','none');");
     radYes.Attributes.Add("onclick", "ShowHideDiv('" + divYes.ClientID + "','inline');");
     btnClose.Attributes.Add("onclick", "return window.close();");
 }