Exemplo n.º 1
0
        private void LoadValues()
        {
            int     intRequest = Int32.Parse(Request.QueryString["rid"]);
            DataSet dsItems;
            int     intForm = 0;

            if (Request.QueryString["formid"] != null && Request.QueryString["formid"] != "")
            {
                intForm = Int32.Parse(Request.QueryString["formid"]);
                dsItems = oRequestItem.GetForm(intRequest, intForm);
            }
            else
            {
                dsItems = oRequestItem.GetForms(intRequest);
            }
            if (dsItems.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow drItem in dsItems.Tables[0].Rows)
                {
                    if (drItem["done"].ToString() == "-1" || intForm > 0)
                    {
                        lblItem.Text    = drItem["itemid"].ToString();
                        lblNumber.Text  = drItem["number"].ToString();
                        lblService.Text = drItem["serviceid"].ToString();
                        break;
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void LoadValues()
        {
            int     intRequest = Int32.Parse(Request.QueryString["rid"]);
            DataSet dsItems;
            int     intForm = 0;

            if (Request.QueryString["formid"] != null && Request.QueryString["formid"] != "")
            {
                intForm = Int32.Parse(Request.QueryString["formid"]);
                dsItems = oRequestItem.GetForm(intRequest, intForm);
            }
            else
            {
                dsItems = oRequestItem.GetForms(intRequest);
            }
            if (dsItems.Tables[0].Rows.Count > 0)
            {
                lblReturned.Text = intForm.ToString();
                foreach (DataRow drItem in dsItems.Tables[0].Rows)
                {
                    if (drItem["done"].ToString() == "-1" || intForm > 0)
                    {
                        lblItem.Text = drItem["itemid"].ToString();
                        if (intForm > 0 && Request.QueryString["num"] != null && Request.QueryString["num"] != "")
                        {
                            lblNumber.Text = Request.QueryString["num"];
                        }
                        else
                        {
                            lblNumber.Text = drItem["number"].ToString();
                        }
                        lblService.Text = drItem["serviceid"].ToString();
                        break;
                    }
                }
            }
            else if (intForm > 0 && Request.QueryString["num"] != null && Request.QueryString["num"] != "")
            {
                lblNumber.Text = Request.QueryString["num"];
                // Coming from workflow - get back to original request.
                List <WorkflowServices> lstBefore = oService.PreviousService(intRequest, intForm, Int32.Parse(lblNumber.Text));
                int serviceid = 0;
                lblReturned.Text = intForm.ToString();
                foreach (WorkflowServices lstService in lstBefore)
                {
                    if (String.IsNullOrEmpty(lstService.Created) == false)
                    {
                        serviceid = lstService.ServiceID;
                    }
                }
                lblService.Text = serviceid.ToString();
                lblItem.Text    = oService.GetItemId(serviceid).ToString();
            }
        }
        private void LoadValues()
        {
            //int intRequest = Int32.Parse(Request.QueryString["rid"]);
            //DataSet dsItems = oRequestItem.GetForms(intRequest);
            //if (dsItems.Tables[0].Rows.Count > 0)
            //{
            //    foreach (DataRow drItem in dsItems.Tables[0].Rows)
            //    {
            //        if (drItem["done"].ToString() == "-1")
            //        {
            //            lblItem.Text = drItem["itemid"].ToString();
            //            lblService.Text = drItem["serviceid"].ToString();
            //            lblNumber.Text = drItem["number"].ToString();
            //            break;
            //        }
            //    }
            //}
            int     intRequest = Int32.Parse(Request.QueryString["rid"]);
            DataSet dsItems;
            int     intForm = 0;

            if (Request.QueryString["formid"] != null && Request.QueryString["formid"] != "")
            {
                intForm = Int32.Parse(Request.QueryString["formid"]);
                dsItems = oRequestItem.GetForm(intRequest, intForm);
            }
            else
            {
                dsItems = oRequestItem.GetForms(intRequest);
            }
            if (dsItems.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow drItem in dsItems.Tables[0].Rows)
                {
                    if (drItem["done"].ToString() == "-1" || intForm > 0)
                    {
                        lblItem.Text    = drItem["itemid"].ToString();
                        lblService.Text = drItem["serviceid"].ToString();
                        if (intForm > 0 && Request.QueryString["num"] != null && Request.QueryString["num"] != "")
                        {
                            lblNumber.Text = Request.QueryString["num"];
                        }
                        else
                        {
                            lblNumber.Text = drItem["number"].ToString();
                        }
                        break;
                    }
                }
            }
            else
            {
                lblService.Text = intForm.ToString();
            }
            // Load Data
            if (Request.QueryString["formid"] != null && Request.QueryString["formid"] != "")
            {
                int     intItem   = Int32.Parse(lblItem.Text);
                int     intNumber = Int32.Parse(lblNumber.Text);
                DataSet dsEdit    = oWorkstation.GetVirtualRebuild(intRequest, intForm, intNumber);
                foreach (DataRow drEdit in dsEdit.Tables[0].Rows)
                {
                    if (drEdit["cancelled"].ToString() == "")
                    {
                        int intName = 0;
                        if (Int32.TryParse(drEdit["nameid"].ToString(), out intName) == true)
                        {
                            lblId.Text          = drEdit["workstationid"].ToString();
                            txtDate.Text        = DateTime.Parse(drEdit["scheduled"].ToString()).ToShortDateString();
                            txtName.Text        = lblName.Text = oWorkstation.GetName(intName);
                            btnContinue.Enabled = false;
                            panFound.Visible    = true;
                            btnNext.Text        = "Update";
                            btnBack.Text        = "Cancel";
                            btnNext.Attributes.Add("onclick", "return ValidateDate('" + txtDate.ClientID + "','Please enter a valid date')" +
                                                   " && ValidateDateToday('" + txtDate.ClientID + "','The date must occur after today')" +
                                                   " && ProcessButton(this) && LoadWait()" +
                                                   ";");
                            btnCancel1.Visible = false;
                        }
                        break;
                    }
                }
            }
        }
        private void LoadValues()
        {
            //int intRequest = Int32.Parse(Request.QueryString["rid"]);
            //DataSet dsItems = oRequestItem.GetForms(intRequest);
            //if (dsItems.Tables[0].Rows.Count > 0)
            //{
            //    foreach (DataRow drItem in dsItems.Tables[0].Rows)
            //    {
            //        if (drItem["done"].ToString() == "-1")
            //        {
            //            lblItem.Text = drItem["itemid"].ToString();
            //            lblNumber.Text = drItem["number"].ToString();
            //            break;
            //        }
            //    }
            //}
            int     intRequest = Int32.Parse(Request.QueryString["rid"]);
            DataSet dsItems;
            int     intForm = 0;

            if (Request.QueryString["formid"] != null && Request.QueryString["formid"] != "")
            {
                intForm = Int32.Parse(Request.QueryString["formid"]);
                dsItems = oRequestItem.GetForm(intRequest, intForm);
            }
            else
            {
                dsItems = oRequestItem.GetForms(intRequest);
            }
            if (dsItems.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow drItem in dsItems.Tables[0].Rows)
                {
                    if (drItem["done"].ToString() == "-1" || intForm > 0)
                    {
                        lblItem.Text = drItem["itemid"].ToString();
                        if (intForm > 0 && Request.QueryString["num"] != null && Request.QueryString["num"] != "")
                        {
                            lblNumber.Text = Request.QueryString["num"];
                        }
                        else
                        {
                            lblNumber.Text = drItem["number"].ToString();
                        }
                        break;
                    }
                }
            }
            // Load Data
            if (Request.QueryString["formid"] != null && Request.QueryString["formid"] != "")
            {
                int     intItem   = Int32.Parse(lblItem.Text);
                int     intNumber = Int32.Parse(lblNumber.Text);
                DataSet dsEdit    = oCustomized.GetDecommissionServer(intRequest, intItem, intNumber);
                if (dsEdit.Tables[0].Rows.Count > 0)
                {
                    DataRow drEdit = dsEdit.Tables[0].Rows[0];
                    panEdit.Visible     = true;
                    txtName.Text        = drEdit["servername"].ToString();
                    btnContinue.Enabled = false;
                    //btnBack.Enabled = false;
                    strEdit       = oCustomized.GetDecommissionServerBody(intRequest, intItem, intNumber, dsnAsset);
                    txtPower.Text = drEdit["poweroff_new"].ToString();
                    if (drEdit["poweroff_new"].ToString() == "")
                    {
                        txtPower.Text = DateTime.Parse(drEdit["poweroff"].ToString()).ToShortDateString();
                    }
                    else
                    {
                        txtPower.Text = DateTime.Parse(drEdit["poweroff_new"].ToString()).ToShortDateString();
                    }
                }
                btnNext.Text = "Update";
                btnBack.Text = "Cancel";
                btnNext.Attributes.Add("onclick", "return ValidateDate('" + txtPower.ClientID + "','Please enter a valid date')" +
                                       " && ValidateDateToday('" + txtPower.ClientID + "','The date must occur after today')" +
                                       " && ProcessButton(this)" +
                                       ";");
                btnCancel1.Visible = false;
            }
        }
Exemplo n.º 5
0
        private void LoadValues()
        {
            int     intRequest = Int32.Parse(Request.QueryString["rid"]);
            DataSet dsItems;
            int     intForm = 0;

            if (Request.QueryString["formid"] != null && Request.QueryString["formid"] != "")
            {
                intForm = Int32.Parse(Request.QueryString["formid"]);
                dsItems = oRequestItem.GetForm(intRequest, intForm);
            }
            else
            {
                dsItems = oRequestItem.GetForms(intRequest);
            }
            if (dsItems.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow drItem in dsItems.Tables[0].Rows)
                {
                    if (drItem["done"].ToString() == "-1" || intForm > 0)
                    {
                        lblItem.Text    = drItem["itemid"].ToString();
                        lblService.Text = drItem["serviceid"].ToString();
                        if (intForm > 0 && Request.QueryString["num"] != null && Request.QueryString["num"] != "")
                        {
                            lblNumber.Text = Request.QueryString["num"];
                        }
                        else
                        {
                            lblNumber.Text = drItem["number"].ToString();
                        }
                        break;
                    }
                }
            }
            else
            {
                lblService.Text = intForm.ToString();
            }
            // Load Data
            if (Request.QueryString["formid"] != null && Request.QueryString["formid"] != "")
            {
                int     intItem   = Int32.Parse(lblItem.Text);
                int     intNumber = Int32.Parse(lblNumber.Text);
                DataSet dsEdit    = oServer.GetRebuild(intRequest, intForm, intNumber);
                foreach (DataRow drEdit in dsEdit.Tables[0].Rows)
                {
                    int intID = 0;
                    if (Int32.TryParse(drEdit["serverid"].ToString(), out intID) == true)
                    {
                        lblId.Text = intID.ToString();
                        //txtChange.Text = drEdit["change"].ToString();
                        txtName.Text        = lblName.Text = oServer.GetName(intID, true);
                        btnContinue.Enabled = false;
                        panFound.Visible    = true;
                        btnNext.Text        = "Update";
                        btnBack.Text        = "Cancel";
                        //btnNext.Attributes.Add("onclick", "return ValidateTextLength('" + txtChange.ClientID + "', 'Please enter a valid change control number\\n\\n - Must start with either \"CHG\" or \"PTM\"\\n - Must be exactly 10 characters in length', 10, ['CHG','PTM'], ['CHG0000000','PTM0000000','CHG1111111','PTM1111111','CHG9999999','PTM9999999','CHGXXXXXXX','PTMXXXXXXX'])" +
                        //    " && ProcessButton(this) && LoadWait()" +
                        //    ";");
                        btnNext.Attributes.Add("onclick", "return ProcessButton(this) && LoadWait()" +
                                               ";");
                        btnCancel1.Visible = false;
                    }
                    break;
                }
            }
        }