Exemple #1
0
        protected int Save()
        {
            if (intID == 0)
            {
                // oForecast.DeleteAnswer(intForecast, intPlatform);
                intID = oForecast.AddAnswer(intForecast, intPlatform, 0, intProfile);
            }
            // Check to see if step is done
            int intDone = 0;

            if (ddlModels.SelectedIndex > 0)
            {
                int intModel = Int32.Parse(ddlModels.SelectedItem.Value);
                oForecast.UpdateAnswerModel(intID, intModel);
                if (panVirtual.Visible == true)
                {
                    oForecast.DeleteWorkstation(intID);
                    oForecast.AddWorkstation(intID, Int32.Parse(ddlRam.SelectedItem.Value), Int32.Parse(ddlOS.SelectedItem.Value), Int32.Parse(ddlRecovery.SelectedItem.Value), 0, Int32.Parse(ddlHardDrive.SelectedItem.Value), Int32.Parse(ddlCPU.SelectedItem.Value));
                    if (ddlRam.SelectedIndex > 0 && ddlOS.SelectedIndex > 0 && ddlHardDrive.SelectedIndex > 0 && ddlCPU.SelectedIndex > 0 && (boolProduction == false || ddlRecovery.SelectedIndex > 0))
                    {
                        intDone = 1;
                    }
                }
                else
                {
                    intDone = 1;
                }
            }
            return(intDone);
        }
Exemple #2
0
        protected int Save()
        {
            if (intID == 0)
            {
                // oForecast.DeleteAnswer(intForecast, intPlatform);
                intID = oForecast.AddAnswer(intForecast, intPlatform, 0, intProfile);
            }
            int intVendor = Int32.Parse(lblVendor.Text);

            if (intVendor == 0)
            {
                intVendor = oForecast.AddAnswerVendor(Int32.Parse(ddlPlatforms.SelectedItem.Value), Int32.Parse(ddlTypes.SelectedItem.Value), txtMake.Text, txtModel.Text, txtWidth.Text, txtHeight.Text, txtAmp.Text, txtOther.Text);
            }
            else
            {
                oForecast.UpdateAnswerVendor(intVendor, Int32.Parse(ddlPlatforms.SelectedItem.Value), Int32.Parse(ddlTypes.SelectedItem.Value), txtMake.Text, txtModel.Text, txtWidth.Text, txtHeight.Text, txtAmp.Text, txtOther.Text);
            }
            oForecast.UpdateAnswerVendor(intID, intVendor);
            // Check to see if step is done
            int intDone = 0;

            if (txtMake.Text.Trim() != "" && txtModel.Text.Trim() != "" && txtWidth.Text.Trim() != "" && txtHeight.Text.Trim() != "" && txtAmp.Text.Trim() != "")
            {
                intDone = 1;
            }
            return(intDone);
        }
Exemple #3
0
        protected void btnAddHost_Click(Object Sender, EventArgs e)
        {
            int intAnswer = oForecast.AddAnswer(0, Int32.Parse(Request.QueryString["id"]), Int32.Parse(ddlHost.SelectedItem.Value), intProfile);

            oForecast.UpdateAnswer(intAnswer, 0, 0, "", 0, "", "", txtName.Text, Int32.Parse(ddlLocation.SelectedItem.Value), Int32.Parse(ddlClass.SelectedItem.Value), 0, Int32.Parse(Request.Form[hdnEnvironment.UniqueID]), Int32.Parse(ddlMaintenance.SelectedItem.Value), 0, 0, Int32.Parse(txtQuantity.Text), 0);
            oForecast.UpdateAnswer(intAnswer, DateTime.Parse(txtDate.Text), Int32.Parse(ddlConfidence.SelectedItem.Value), -999);
            Response.Redirect(Request.Path + "?add=true");
        }
Exemple #4
0
        protected void btnNext_Click(Object Sender, EventArgs e)
        {
            int     intRequest  = Int32.Parse(Request.QueryString["rid"]);
            int     intItem     = Int32.Parse(lblItem.Text);
            int     intNumber   = Int32.Parse(lblNumber.Text);
            DataSet dsToday     = oForecast.GetAnswersDay(intWorkstationPlatform, intProfile, 1);
            int     intQuantity = 0;

            foreach (DataRow drToday in dsToday.Tables[0].Rows)
            {
                intQuantity += Int32.Parse(drToday["quantity"].ToString());
            }
            int intTotal = Int32.Parse(txtQuantity.Text) + intQuantity;

            if (intTotal <= intMaxWorkstationsPerDay)
            {
                // Add Answer
                if (intAnswer == 0)
                {
                    intAnswer = oForecast.AddAnswer(0, intWorkstationPlatform, 0, intProfile);
                    oForecast.UpdateAnswerStep(intAnswer, 1, 1);
                }
                oForecast.UpdateAnswerService(intAnswer, intRequest);
                int     intClass  = 0;
                DataSet dsClasses = oClass.Gets(1);
                foreach (DataRow drClass in dsClasses.Tables[0].Rows)
                {
                    if (drClass["prod"].ToString() == "1" && drClass["pnc"].ToString() != "1")
                    {
                        intClass = Int32.Parse(drClass["id"].ToString());
                        break;
                    }
                }
                oForecast.UpdateAnswer(intAnswer, 0, 0, "", 0, Request.ServerVariables["REMOTE_HOST"], "", txtName.Text, Int32.Parse(Request.Form[hdnParent.UniqueID]), intClass, 0, intCore, 0, 0, 0, Int32.Parse(txtQuantity.Text), 0);
                // Add Model
                oForecast.UpdateAnswerModel(intAnswer, intModelVirtual);
                oForecast.DeleteWorkstation(intAnswer);
                oForecast.AddWorkstation(intAnswer, Int32.Parse(ddlRam.SelectedItem.Value), Int32.Parse(ddlOS.SelectedItem.Value), 0, 0, Int32.Parse(ddlHardDrive.SelectedItem.Value), Int32.Parse(ddlCPU.SelectedItem.Value));
                oForecast.UpdateAnswerStep(intAnswer, 1, 1);
                // Add Commitment Date
                oForecast.UpdateAnswer(intAnswer, DateTime.Today, intConfidence, intProfile);
                oForecast.UpdateAnswerStep(intAnswer, 1, 1);
                oRequestItem.UpdateForm(intRequest, true);
                Response.Redirect(oPage.GetFullLink(intPage) + "?rid=" + intRequest.ToString());
            }
            else
            {
                Response.Redirect(oPage.GetFullLink(intPage) + "?rid=" + intRequest.ToString() + "&qty=" + intQuantity.ToString());
            }
        }
Exemple #5
0
        protected int Save()
        {
            if (intID == 0)
            {
                // oForecast.DeleteAnswer(intForecast, intPlatform);
                intID = oForecast.AddAnswer(intForecast, intPlatform, 0, intProfile);
            }
            // Check to see if step is done
            int intDone = 0;

            if (ddlModels.SelectedIndex > 0)
            {
                intDone = 1;
                int intModel = Int32.Parse(ddlModels.SelectedItem.Value);
                oForecast.UpdateAnswerModel(intID, intModel);
            }
            return(intDone);
        }
Exemple #6
0
        private void Save(int intRequest)
        {
            int     intItem     = Int32.Parse(lblItem.Text);
            int     intService  = Int32.Parse(lblService.Text);
            int     intNumber   = Int32.Parse(lblNumber.Text);
            DataSet dsToday     = oForecast.GetAnswersDay(intWorkstationPlatform, intProfile, 1);
            int     intQuantity = 0;

            foreach (DataRow drToday in dsToday.Tables[0].Rows)
            {
                intQuantity += Int32.Parse(drToday["quantity"].ToString());
            }
            int intTotal = Int32.Parse(txtQuantity.Text) + intQuantity;

            if (intTotal <= intMaxWorkstationsPerDay)
            {
                // Add Answer
                if (intAnswer == 0)
                {
                    intAnswer = oForecast.AddAnswer(0, intWorkstationPlatform, 0, intProfile);
                    oForecast.UpdateAnswerStep(intAnswer, 1, 1);
                }
                oForecast.UpdateAnswerService(intAnswer, intRequest);
                oForecast.UpdateAnswer(intAnswer, 0, 0, "", 0, Request.ServerVariables["REMOTE_HOST"], "", txtName.Text, Int32.Parse(ddlLocation.SelectedItem.Value), Int32.Parse(ddlClass.SelectedItem.Value), 0, intCore, 0, 0, 0, Int32.Parse(txtQuantity.Text), 0);
                // Add Model
                oForecast.UpdateAnswerModel(intAnswer, intModelVMware);
                oForecast.DeleteWorkstation(intAnswer);
                oForecast.AddWorkstation(intAnswer, Int32.Parse(ddlRam.SelectedItem.Value), Int32.Parse(ddlOS.SelectedItem.Value), (chkDR.Checked ? 1 : 0), Int32.Parse(radEmployee.SelectedItem.Value), Int32.Parse(ddlHardDrive.SelectedItem.Value), Int32.Parse(ddlCPU.SelectedItem.Value));
                oForecast.UpdateAnswerStep(intAnswer, 1, 1);
                // Add Commitment Date
                oForecast.UpdateAnswer(intAnswer, DateTime.Today, intConfidence, intProfile);
                oForecast.UpdateAnswerStep(intAnswer, 1, 1);

                if (boolReqDenied)
                {
                    oService.UpdateSelectedApprove(intRequest, intService, Int32.Parse(lblNumber.Text), 0, 0, DateTime.Now, "");
                }
            }
            else
            {
                Response.Redirect(oPage.GetFullLink(intPage) + "?rid=" + intRequest.ToString() + "&qty=" + intQuantity.ToString());
            }
        }
Exemple #7
0
        protected int Save()
        {
            int intDone = 1;

            oForecast.DeleteAnswerPlatform(intID);
            foreach (string strForm in Request.Form)
            {
                if (strForm.StartsWith("hdnQ_"))
                {
                    if (intID == 0)
                    {
                        int intPlatform = Int32.Parse(lblPlatform.Text);
                        intID = oForecast.AddAnswer(intForecast, intPlatform, 0, intProfile);
                    }
                    int    intQuestion      = Int32.Parse(strForm.Substring(5));
                    string strInitalDisplay = GetDisplay(intQuestion);
                    if (strInitalDisplay == "inline")
                    {
                        string strTemp   = Request.Form[strForm];
                        int    intAnswer = 0;
                        int    intCustom = 0;
                        if (strTemp.Contains("|"))
                        {
                            while (strTemp != "")
                            {
                                if (strTemp.Contains("_"))
                                {
                                    intAnswer = Int32.Parse(strTemp.Substring(0, strTemp.IndexOf("_")));
                                }
                                else
                                {
                                    intAnswer = Int32.Parse(strTemp.Substring(0, strTemp.IndexOf("|")));
                                }
                                strTemp   = strTemp.Substring(strTemp.IndexOf("|") + 1);
                                intCustom = Int32.Parse(oForecast.GetResponse(intAnswer, "custom"));
                                if (intCustom > 0)
                                {
                                    oForecast.AddAnswerPlatform(intID, intQuestion, intAnswer, Request.Form["hdnC_" + intAnswer.ToString()]);
                                }
                                else
                                {
                                    oForecast.AddAnswerPlatform(intID, intQuestion, intAnswer, "");
                                }
                            }
                        }
                        else if (strTemp != "" && strTemp != "0")
                        {
                            intAnswer = Int32.Parse(strTemp);
                            intCustom = Int32.Parse(oForecast.GetResponse(intAnswer, "custom"));
                            if (intCustom > 0)
                            {
                                oForecast.AddAnswerPlatform(intID, intQuestion, intAnswer, Request.Form["hdnC_" + intAnswer.ToString()]);
                            }
                            else
                            {
                                oForecast.AddAnswerPlatform(intID, intQuestion, intAnswer, "");
                            }
                        }
                        else
                        {
                            if (oForecast.GetQuestion(intQuestion, "required") == "1")
                            {
                                DataSet dsAffects = oForecast.GetAffectsByAffected(intQuestion);
                                foreach (DataRow drAffect in dsAffects.Tables[0].Rows)
                                {
                                    int     intQ     = Int32.Parse(drAffect["questionid"].ToString());
                                    DataSet dsAnswer = oForecast.GetAnswerPlatform(intID, intQ);
                                    bool    boolOK   = false;
                                    foreach (DataRow drAnswer in dsAnswer.Tables[0].Rows)
                                    {
                                        string strDisplay = oForecast.GetAffects(intQ, intQuestion, Int32.Parse(drAnswer["responseid"].ToString()));
                                        if (strDisplay != "")
                                        {
                                            strDisplay = (strDisplay == "1" ? "inline" : "none");
                                        }
                                        if (strDisplay == "none")
                                        {
                                            boolOK = true;
                                        }
                                    }
                                    if (boolOK == false)
                                    {
                                        intDone = 0;
                                    }
                                }
                            }
                        }
                    }
                }
            }
            bool boolRecoveryOne  = oForecast.IsDROneToOne(intID);
            bool boolRecoveryMany = oForecast.IsDRManyToOne(intID);
            bool boolRecoveryNone = oForecast.IsDROver48(intID, false);
            int  intRecovery      = (boolRecoveryNone ? 0 : (boolRecoveryOne ? Int32.Parse(lblQuantity.Text) : (boolRecoveryMany ? Int32.Parse(lblRecovery.Text) : 0)));

            oForecast.UpdateAnswerRecovery(intID, intRecovery);

            if (boolProduction == true)
            {
                oForecast.EnforceRecovery(intID, intDRHourQuestion, intDRHourResponse, intDRRecoveryQuestion, intDRRecoveryResponse, Int32.Parse(lblQuantity.Text));
            }

            return(intDone);
        }
Exemple #8
0
        protected void btnNext_Click(Object Sender, EventArgs e)
        {
            int     intRequest  = Int32.Parse(Request.QueryString["rid"]);
            int     intItem     = Int32.Parse(lblItem.Text);
            int     intNumber   = Int32.Parse(lblNumber.Text);
            DataSet dsToday     = oForecast.GetAnswersDay(intWorkstationPlatform, intProfile, 1);
            int     intQuantity = 0;

            foreach (DataRow drToday in dsToday.Tables[0].Rows)
            {
                intQuantity += Int32.Parse(drToday["quantity"].ToString());
            }
            int intTotal = Int32.Parse(txtQuantity.Text) + intQuantity;

            if (intTotal <= intMaxWorkstationsPerDay)
            {
                if (intWorkstation == 0)
                {
                    // Add Answer
                    if (intAnswer == 0)
                    {
                        intAnswer = oForecast.AddAnswer(0, intWorkstationPlatform, 0, intProfile);
                        oForecast.UpdateAnswerStep(intAnswer, 1, 1);
                    }
                    oForecast.UpdateAnswerService(intAnswer, intRequest);
                    int intClass = Int32.Parse(ddlClass.SelectedItem.Value);
                    oForecast.UpdateAnswer(intAnswer, 0, 0, "", 0, Request.ServerVariables["REMOTE_HOST"], "", txtName.Text, Int32.Parse(ddlLocation.SelectedItem.Value), intClass, 0, intCore, 0, 0, 0, Int32.Parse(txtQuantity.Text), 0);
                    // Add Model
                    oForecast.UpdateAnswerModel(intAnswer, intModelVMware);
                    oForecast.DeleteWorkstation(intAnswer);
                    oForecast.AddWorkstation(intAnswer, Int32.Parse(ddlRam.SelectedItem.Value), Int32.Parse(ddlOS.SelectedItem.Value), (chkDR.Checked ? 1 : 0), Int32.Parse(radEmployee.SelectedItem.Value), Int32.Parse(ddlHardDrive.SelectedItem.Value), Int32.Parse(ddlCPU.SelectedItem.Value));
                    oForecast.UpdateAnswerStep(intAnswer, 1, 1);
                    // Add Commitment Date
                    oForecast.UpdateAnswer(intAnswer, DateTime.Today, intConfidence, intProfile);
                    oForecast.UpdateAnswerStep(intAnswer, 1, 1);
                    // Manager and Cost Center
                    int intCostCenter = 0;
                    Int32.TryParse(Request.Form[hdnCostCenter.UniqueID], out intCostCenter);
                    oForecast.UpdateAnswer(intAnswer, "", "", 0, intCostCenter, 0, Int32.Parse(Request.Form[hdnManager.UniqueID]), 0, 0, 0, 0, 0, 0);
                    // Create Workstation Record
                    int intOS = Int32.Parse(ddlOS.SelectedItem.Value);
                    int intSP = 0;
                    Int32.TryParse(oOperatingSystems.Get(intOS, "default_sp"), out intSP);
                    DataSet dsDomains = oDomain.GetClassEnvironment(intClass, intCore);
                    int     intDomain = 0;
                    if (dsDomains.Tables[0].Rows.Count > 0)
                    {
                        intDomain = Int32.Parse(dsDomains.Tables[0].Rows[0]["id"].ToString());
                    }
                    intWorkstation = oWorkstation.AddVirtual(intRequest, intAnswer, intNumber, 1, intModelVMware, intOS, intSP, intDomain, Int32.Parse(ddlRam.SelectedItem.Value), (chkDR.Checked ? 1 : 0), Int32.Parse(radEmployee.SelectedItem.Value), Int32.Parse(ddlHardDrive.SelectedItem.Value), Int32.Parse(ddlCPU.SelectedItem.Value), 1, 1);
                    Redirect("&id=" + intWorkstation.ToString() + "&menu_tab=2");
                }
                else
                {
                    Update();
                    if (rptAccounts.Items.Count > 0)
                    {
                        oRequestItem.UpdateForm(intRequest, true);
                        Redirect("");
                    }
                    else
                    {
                        Redirect("&menu_tab=2&accts=0");
                    }
                }
            }
            else
            {
                Redirect("&qty=" + intQuantity.ToString());
            }
        }
Exemple #9
0
        private bool Save()
        {
            if (intID == 0)
            {
                intPlatform = Int32.Parse(ddlPlatform.SelectedItem.Value);
                intID       = oForecast.AddAnswer(Int32.Parse(Request.QueryString["parent"]), intPlatform, 0, intProfile);
            }
            bool boolOverride = false;
            bool boolAlready  = false;

            if (radYes.Checked && oForecast.GetAnswer(intID, "override") == "1")
            {
                boolAlready = true;
            }
            else if (radYes.Checked)
            {
                boolOverride = true;
            }
            int        intApplicationID    = Int32.Parse(ddlApplications.SelectedItem.Value);
            ServerName oServerName         = new ServerName(0, dsn);
            int        intSubApplicationID = 0;

            if (oServerName.GetSubApplications(intApplicationID, 1).Tables[0].Rows.Count > 0 && Request.Form[hdnSubApplication.UniqueID] != "")
            {
                intSubApplicationID = Int32.Parse(Request.Form[hdnSubApplication.UniqueID]);
            }
            int  intOverride = (boolAlready == true ? 1 : (boolOverride == true ? (radBreakYes.Checked ? 1 : -1) : 0));
            int  intClass    = Int32.Parse(ddlClass.SelectedItem.Value);
            bool boolName    = true;

            if (intOverride == 1)
            {
                if (radBreakYes.Checked == true)
                {
                    int intName = 0;
                    if (oClass.Get(intClass, "pnc") == "1")
                    {
                        intName = oServerName.GetNameFactory(txtDeviceName.Text);
                    }
                    else
                    {
                        intName = oServerName.GetName(txtDeviceName.Text);
                    }
                    if (intName == 0)
                    {
                        boolName = false;
                    }
                    else
                    {
                        oForecast.UpdateAnswer(intID, intOverride, 1, txtChange.Text, intName, Request.ServerVariables["REMOTE_HOST"], "", txtName.Text, Int32.Parse(Request.Form[hdnLocation.UniqueID]), intClass, (chkTest.Checked ? 1 : 0), Int32.Parse(Request.Form[hdnEnvironment.UniqueID]), Int32.Parse(ddlMaintenance.SelectedItem.Value), intApplicationID, intSubApplicationID, Int32.Parse(txtQuantity.Text), (radResiliencyYes.Checked ? 1 : 0));
                    }
                }
                else
                {
                    oForecast.UpdateAnswer(intID, intOverride, 0, "", 0, Request.ServerVariables["REMOTE_HOST"], "", txtName.Text, Int32.Parse(Request.Form[hdnLocation.UniqueID]), intClass, (chkTest.Checked ? 1 : 0), Int32.Parse(Request.Form[hdnEnvironment.UniqueID]), Int32.Parse(ddlMaintenance.SelectedItem.Value), intApplicationID, intSubApplicationID, Int32.Parse(txtQuantity.Text), (radResiliencyYes.Checked ? 1 : 0));
                }
            }
            else
            {
                oForecast.UpdateAnswer(intID, intOverride, 0, "", 0, Request.ServerVariables["REMOTE_HOST"], "", txtName.Text, Int32.Parse(Request.Form[hdnLocation.UniqueID]), intClass, (chkTest.Checked ? 1 : 0), Int32.Parse(Request.Form[hdnEnvironment.UniqueID]), Int32.Parse(ddlMaintenance.SelectedItem.Value), intApplicationID, intSubApplicationID, Int32.Parse(txtQuantity.Text), (radResiliencyYes.Checked ? 1 : 0));
            }

            if (boolName == true)
            {
                // Set up the forecast steps done table to check if a certain step of a forecast is done.
                DataSet dsSteps     = oForecast.GetSteps(intPlatform, 1);
                DataSet dsStepsDone = oForecast.GetStepsDone(intID, 0);
                if (dsSteps.Tables[0].Rows.Count != dsStepsDone.Tables[0].Rows.Count)
                {
                    int intCount = 0;
                    foreach (DataRow drStep in dsSteps.Tables[0].Rows)
                    {
                        intCount++;
                        oForecast.AddStepDone(intID, intCount, 0);
                    }
                }
            }
            else
            {
                Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "save", "<script type=\"text/javascript\">alert('Please enter a valid device name!\\n\\nThe device name you entered was not found\\n\\nIf you think this device exists, please contact your ClearView administrator');<" + "/" + "script>");
            }
            return(boolName);
        }