Пример #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);
        }
Пример #2
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());
            }
        }
Пример #3
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());
            }
        }
Пример #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)
            {
                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());
            }
        }