Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile       = Int32.Parse(Request.Cookies["profileid"].Value);
            oRequest         = new Requests(intProfile, dsn);
            oService         = new Services(intProfile, dsn);
            oServiceRequest  = new ServiceRequests(intProfile, dsn);
            oCustomized      = new Customized(intProfile, dsn);
            oPage            = new Pages(intProfile, dsn);
            oResourceRequest = new ResourceRequest(intProfile, dsn);
            oStatusLevel     = new StatusLevels();
            oUser            = new Users(intProfile, dsn);
            oApplication     = new Applications(intProfile, dsn);
            oEnhancement     = new Enhancements(intProfile, dsn);
            oVariables       = new Variables(intEnvironment);
            if (Request.QueryString["applicationid"] != null && Request.QueryString["applicationid"] != "")
            {
                intApplication = Int32.Parse(Request.QueryString["applicationid"]);
            }
            if (Request.QueryString["pageid"] != null && Request.QueryString["pageid"] != "")
            {
                intPage = Int32.Parse(Request.QueryString["pageid"]);
            }
            if (Request.Cookies["application"] != null && Request.Cookies["application"].Value != "")
            {
                intApplication = Int32.Parse(Request.Cookies["application"].Value);
            }
            if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
            {
                intId = Int32.Parse(Request.QueryString["id"]);
            }
            if (Request.QueryString["old"] != null && Request.QueryString["old"] != "")
            {
                intId = Int32.Parse(Request.QueryString["old"]);
            }

            if (!IsPostBack)
            {
                drpModules.DataValueField = "pageid";
                drpModules.DataTextField  = "menutitle";
                drpModules.DataSource     = oPage.Gets(intApplication, intProfile, 0, 1, 1);
                drpModules.DataBind();
                drpModules.Items.Insert(0, new ListItem("-- SELECT --", "0"));
            }

            if (intId > 0)
            {
                panEnhancement.Visible = true;
                DataSet ds = oCustomized.GetEnhancementByID(intId);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    panStatus.Visible        = true;
                    lblTitle.Text            = "Edit Enhancement";
                    txtTitle.Text            = ds.Tables[0].Rows[0]["title"].ToString();
                    txtDescription.Text      = ds.Tables[0].Rows[0]["description"].ToString();
                    drpModules.SelectedValue = ds.Tables[0].Rows[0]["pageid"].ToString();
                    txtNumUsers.Text         = ds.Tables[0].Rows[0]["num_users"].ToString();
                    txtURL.Text = ds.Tables[0].Rows[0]["url"].ToString();
                    if (ds.Tables[0].Rows[0]["path"].ToString() != "")
                    {
                        panUploaded.Visible   = true;
                        hypUpload.NavigateUrl = ds.Tables[0].Rows[0]["path"].ToString();
                    }
                    else
                    {
                        panUpload.Visible = true;
                    }
                    txtStartDate.Text = DateTime.Parse(ds.Tables[0].Rows[0]["startdate"].ToString()).ToShortDateString();
                    txtEndDate.Text   = DateTime.Parse(ds.Tables[0].Rows[0]["enddate"].ToString()).ToShortDateString();
                    lblStatus.Text    = oStatusLevel.HTMLSupport(Int32.Parse(ds.Tables[0].Rows[0]["status"].ToString()));
                    lblStatus.Attributes.Add("oncontextmenu", "alert('CVT" + intRequest.ToString() + "');");
                    if (ds.Tables[0].Rows[0]["status"].ToString() == "0")
                    {
                        btnUpdate.Visible = true;
                        panActive.Visible = true;
                    }
                    int intRelease = 0;
                    if (Int32.TryParse(ds.Tables[0].Rows[0]["release"].ToString(), out intRelease) == true && intRelease > 0)
                    {
                        lblRelease.Text = DateTime.Parse(oEnhancement.GetVersion(intRelease, "release")).ToLongDateString();
                    }
                    else
                    {
                        lblRelease.Text = "To Be Determined";
                    }
                    lblRequestBy.Text = oUser.GetFullName(intProfile);
                    lblRequestOn.Text = DateTime.Parse(ds.Tables[0].Rows[0]["created"].ToString()).ToString();

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

            btnSave.Attributes.Add("onclick", "return ValidateText('" + txtTitle.ClientID + "','Please enter a title')" +
                                   " && ValidateText('" + txtDescription.ClientID + "','Please enter a description')" +
                                   " && ValidateNumber('" + txtNumUsers.ClientID + "','Please enter a valid number for the number of users')" +
                                   ";");
            btnUpdate.Attributes.Add("onclick", "return ValidateText('" + txtTitle.ClientID + "','Please enter a title')" +
                                     " && ValidateText('" + txtDescription.ClientID + "','Please enter a description')" +
                                     " && ValidateNumber('" + txtNumUsers.ClientID + "','Please enter a valid number for the number of users')" +
                                     ";");
            btnResponse.Attributes.Add("onclick", "return ValidateText('" + txtResponse.ClientID + "','Please enter a response');");
            btnDeleteAttachment.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this file?');");
            imgStartDate.Attributes.Add("onclick", "return ShowCalendar('" + txtStartDate.ClientID + "');");
            imgEndDate.Attributes.Add("onclick", "return ShowCalendar('" + txtEndDate.ClientID + "');");
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile       = Int32.Parse(Request.Cookies["profileid"].Value);
            oProject         = new Projects(intProfile, dsn);
            oFunction        = new Functions(intProfile, dsn, intEnvironment);
            oUser            = new Users(intProfile, dsn);
            oPage            = new Pages(intProfile, dsn);
            oResourceRequest = new ResourceRequest(intProfile, dsn);
            oRequestItem     = new RequestItems(intProfile, dsn);
            oRequest         = new Requests(intProfile, dsn);
            oService         = new Services(intProfile, dsn);
            oServiceRequest  = new ServiceRequests(intProfile, dsn);
            oRequestField    = new RequestFields(intProfile, dsn);
            oApplication     = new Applications(intProfile, dsn);
            oServiceDetail   = new ServiceDetails(intProfile, dsn);
            oDelegate        = new Delegates(intProfile, dsn);
            oCustomized      = new Customized(intProfile, dsn);
            oVariable        = new Variables(intEnvironment);
            oStatusLevel     = new StatusLevels();
            oEnhancement     = new Enhancements(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["rrid"] != null && Request.QueryString["rrid"] != "")
            {
                // Start Workflow Change
                lblResourceWorkflow.Text = Request.QueryString["rrid"];
                int intResourceWorkflow = Int32.Parse(Request.QueryString["rrid"]);
                int intResourceParent   = oResourceRequest.GetWorkflowParent(intResourceWorkflow);
                ds = oResourceRequest.Get(intResourceParent);
                // End Workflow Change
                intRequest          = Int32.Parse(ds.Tables[0].Rows[0]["requestid"].ToString());
                lblRequestedBy.Text = oUser.GetFullName(oRequest.GetUser(intRequest));
                lblRequestedOn.Text = DateTime.Parse(oResourceRequest.Get(intResourceParent, "created")).ToString();
                lblDescription.Text = oRequest.Get(intRequest, "description");
                if (lblDescription.Text == "")
                {
                    lblDescription.Text = "<i>No information</i>";
                }
                intItem   = Int32.Parse(ds.Tables[0].Rows[0]["itemid"].ToString());
                intNumber = Int32.Parse(ds.Tables[0].Rows[0]["number"].ToString());
                // Start Workflow Change
                bool boolComplete = (oResourceRequest.GetWorkflow(intResourceWorkflow, "status") == "3");
                int  intUser      = Int32.Parse(oResourceRequest.GetWorkflow(intResourceWorkflow, "userid"));
                txtCustom.Text = oResourceRequest.GetWorkflow(intResourceWorkflow, "name");
                double dblAllocated = double.Parse(oResourceRequest.GetWorkflow(intResourceWorkflow, "allocated"));
                // End Workflow Change
                intService      = Int32.Parse(ds.Tables[0].Rows[0]["serviceid"].ToString());
                lblService.Text = oService.Get(intService, "name");
                int intApp = oRequestItem.GetItemApplication(intItem);

                strMessages = oCustomized.GetMessages(intRequest, false, "#E1FFE1");

                if (Request.QueryString["save"] != null && Request.QueryString["save"] != "")
                {
                    Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "saved", "<script type=\"text/javascript\">alert('Information Saved Successfully');<" + "/" + "script>");
                }
                if (Request.QueryString["status"] != null && Request.QueryString["status"] != "")
                {
                    Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "statusd", "<script type=\"text/javascript\">alert('Status Updates has been Added');<" + "/" + "script>");
                }
                if (!IsPostBack)
                {
                    double dblUsed = oResourceRequest.GetWorkflowUsed(intResourceWorkflow);
                    lblUpdated.Text = oResourceRequest.GetUpdated(intResourceWorkflow);
                    if (dblAllocated == dblUsed)
                    {
                        if (boolComplete == false)
                        {
                            oFunction.ConfigureToolButton(btnComplete, "/images/tool_complete");
                            btnComplete.Attributes.Add("onclick", "return confirm('Are you sure you want to mark this as completed and remove it from your workload?') && ProcessControlButton();");
                        }
                        else
                        {
                            oFunction.ConfigureToolButton(btnComplete, "/images/tool_complete");
                            btnComplete.Attributes.Add("onclick", "alert('This task has already been marked COMPLETE. You can close this window.');return false;");
                        }
                    }
                    else
                    {
                        btnComplete.ImageUrl = "/images/tool_complete_dbl.gif";
                        btnComplete.Enabled  = false;
                    }
                    dblUsed = (dblUsed / dblAllocated) * 100;
                    sldHours._StartPercent = dblUsed.ToString();
                    sldHours._TotalHours   = dblAllocated.ToString();
                    intProject             = oRequest.GetProjectNumber(intRequest);
                    hdnTab.Value           = "D";
                    panWorkload.Visible    = true;
                    LoadLists();
                    LoadStatus(intResourceWorkflow);
                    LoadInformation(intResourceWorkflow);

                    btnDenied.Attributes.Add("onclick", "return CloseWindow();");
                    oFunction.ConfigureToolButton(btnSave, "/images/tool_save");
                    oFunction.ConfigureToolButton(btnPrint, "/images/tool_print");
                    btnPrint.Attributes.Add("onclick", "return PrintWindow();");
                    oFunction.ConfigureToolButton(btnClose, "/images/tool_close");
                    btnClose.Attributes.Add("onclick", "return ExitWindow();");
                    btnSave.Attributes.Add("onclick", "return ProcessControlButton();");
                    btnMessage.Attributes.Add("onclick", "ShowHideDiv2('" + divMessage.ClientID + "');return false;");

                    // 6/1/2009 - Load ReadOnly View
                    if (oResourceRequest.CanUpdate(intProfile, intResourceWorkflow, false) == false)
                    {
                        oFunction.ConfigureToolButtonRO(btnSave, btnComplete);
                        //panDenied.Visible = true;
                    }
                }
            }
            else
            {
                panDenied.Visible = true;
            }
        }
Example #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile       = Int32.Parse(Request.Cookies["profileid"].Value);
            oRequest         = new Requests(intProfile, dsn);
            oService         = new Services(intProfile, dsn);
            oServiceRequest  = new ServiceRequests(intProfile, dsn);
            oEnhancement     = new Enhancements(intProfile, dsn);
            oPage            = new Pages(intProfile, dsn);
            oResourceRequest = new ResourceRequest(intProfile, dsn);
            oStatusLevel     = new StatusLevels();
            oUser            = new Users(intProfile, dsn);
            oCustomized      = new Customized(intProfile, dsn);
            oFunction        = new Functions(intProfile, dsn, intEnvironment);
            oVariable        = new Variables(intEnvironment);
            if (Request.QueryString["applicationid"] != null && Request.QueryString["applicationid"] != "")
            {
                intApplication = Int32.Parse(Request.QueryString["applicationid"]);
            }
            if (Request.QueryString["pageid"] != null && Request.QueryString["pageid"] != "")
            {
                intPage = Int32.Parse(Request.QueryString["pageid"]);
            }
            if (Request.Cookies["application"] != null && Request.Cookies["application"].Value != "")
            {
                intApplication = Int32.Parse(Request.Cookies["application"].Value);
            }
            if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
            {
                intID = Int32.Parse(Request.QueryString["id"]);
            }
            if (Request.QueryString["old"] != null && Request.QueryString["old"] != "")
            {
                intIDold = Int32.Parse(Request.QueryString["old"]);
            }

            if (!IsPostBack)
            {
                LoadLists();
            }

            int intMenuTab = 0;

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

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

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

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

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

            btnSave.Attributes.Add("onclick", "return ValidateText('" + txtTitle.ClientID + "','Please enter a title')" +
                                   " && ValidateText('" + txtDescription.ClientID + "','Please enter a description')" +
                                   " && ValidateDropDown('" + ddlUsers.ClientID + "','Please make a selection for the number of users benefited')" +
                                   " && ValidateRadioList('" + radRelease1.ClientID + "','Please make a selection for your preferred release date')" +
                                   " && ValidateRadioList('" + radRelease2.ClientID + "','Please make a selection for your alternative release date')" +
                                   " && ProcessButton(this) && LoadWait()" +
                                   ";");
            btnUpdate.Attributes.Add("onclick", "return ValidateText('" + txtTitle.ClientID + "','Please enter a title')" +
                                     " && ValidateText('" + txtDescription.ClientID + "','Please enter a description')" +
                                     " && ValidateDropDown('" + ddlUsers.ClientID + "','Please make a selection for the number of users benefited')" +
                                     " && ValidateRadioList('" + radRelease1.ClientID + "','Please make a selection for your preferred release date')" +
                                     " && ValidateRadioList('" + radRelease2.ClientID + "','Please make a selection for your alternative release date')" +
                                     " && ProcessButton(this) && LoadWait()" +
                                     ";");
            btnCancel.Attributes.Add("onclick", "return confirm('WARNING: Any changes related to this enhancement and the ClearView system will be removed.\\n\\nAre you sure you want to cancel this enhancement?') && ProcessButton(this) && LoadWait();");
            btnResponse.Attributes.Add("onclick", "return ValidateText('" + txtResponse.ClientID + "','Please enter a response') && ProcessButton(this) && LoadWait();;");
            btnMessageReply.Attributes.Add("onclick", "return ValidateText('" + txtMessageReply.ClientID + "','Please enter a response') && ProcessButton(this) && LoadWait();;");
            btnDeleteAttachment.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this file?') && ProcessButton(this) && LoadWait();;");
        }
Example #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile       = Int32.Parse(Request.Cookies["profileid"].Value);
            oRequest         = new Requests(intProfile, dsn);
            oService         = new Services(intProfile, dsn);
            oServiceRequest  = new ServiceRequests(intProfile, dsn);
            oCustomized      = new Customized(intProfile, dsn);
            oPage            = new Pages(intProfile, dsn);
            oResourceRequest = new ResourceRequest(intProfile, dsn);
            oStatusLevel     = new StatusLevels();
            oUser            = new Users(intProfile, dsn);
            oApplication     = new Applications(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["id"] != null && Request.QueryString["id"] != "")
            {
                intId = Int32.Parse(Request.QueryString["id"]);
            }

            if (!IsPostBack)
            {
                drpModules.DataValueField = "pageid";
                drpModules.DataTextField  = "menutitle";
                drpModules.DataSource     = oPage.Gets(intApplication, intProfile, 0, 1, 1);
                drpModules.DataBind();
                drpModules.Items.Add(new ListItem("New Module", "-10"));
                drpModules.Items.Insert(0, new ListItem("-- SELECT --", "0"));
            }

            if (intId > 0)
            {
                panIncident.Visible = true;
                DataSet ds = oCustomized.GetIssueByID(intId);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    radNo.Checked            = true;
                    radYes.Enabled           = false;
                    radNo.Enabled            = false;
                    divNo.Style["display"]   = "inline";
                    panStatus.Visible        = true;
                    lblTitle.Text            = "Edit Issue";
                    txtTitle.Text            = ds.Tables[0].Rows[0]["title"].ToString();
                    txtDescription.Text      = ds.Tables[0].Rows[0]["description"].ToString();
                    drpModules.SelectedValue = ds.Tables[0].Rows[0]["pageid"].ToString();
                    txtNumUsers.Text         = ds.Tables[0].Rows[0]["num_users"].ToString();
                    txtURL.Text = ds.Tables[0].Rows[0]["url"].ToString();
                    if (ds.Tables[0].Rows[0]["path"].ToString() != "")
                    {
                        panUploaded.Visible   = true;
                        hypUpload.NavigateUrl = ds.Tables[0].Rows[0]["path"].ToString();
                    }
                    else
                    {
                        panUpload.Visible = true;
                    }
                    lblStatus.Text = oStatusLevel.HTMLSupport(Int32.Parse(ds.Tables[0].Rows[0]["status"].ToString()));
                    lblStatus.Attributes.Add("oncontextmenu", "alert('CVT" + intRequest.ToString() + "');");
                    if (ds.Tables[0].Rows[0]["status"].ToString() == "0")
                    {
                        btnUpdate.Visible = true;
                        panActive.Visible = true;
                    }
                    lblRequestBy.Text = oUser.GetFullName(intProfile);
                    lblRequestOn.Text = DateTime.Parse(ds.Tables[0].Rows[0]["created"].ToString()).ToString();

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

            radYes.Attributes.Add("onclick", "ShowHideDiv('" + divYes.ClientID + "','inline');ShowHideDiv('" + divNo.ClientID + "','none');");
            radNo.Attributes.Add("onclick", "ShowHideDiv('" + divNo.ClientID + "','inline');ShowHideDiv('" + divYes.ClientID + "','none');");
            btnSave.Attributes.Add("onclick", "return ValidateText('" + txtTitle.ClientID + "','Please enter a title')" +
                                   " && ValidateText('" + txtDescription.ClientID + "','Please enter a description')" +
                                   " && ValidateNumber('" + txtNumUsers.ClientID + "','Please enter a valid number for the number of users')" +
                                   ";");
            btnUpdate.Attributes.Add("onclick", "return ValidateText('" + txtTitle.ClientID + "','Please enter a title')" +
                                     " && ValidateText('" + txtDescription.ClientID + "','Please enter a description')" +
                                     " && ValidateNumber('" + txtNumUsers.ClientID + "','Please enter a valid number for the number of users')" +
                                     ";");
            btnResponse.Attributes.Add("onclick", "return ValidateText('" + txtResponse.ClientID + "','Please enter a response');");
            btnDeleteAttachment.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this file?');");
        }